History

Merge branch 'linus' into irq/core

Pick up upstream changes to avoid conflicts for pending patches.

Thomas Gleixner committed 7 years ago

Commit d869f862 parents 030fc44 74e9671952 files · +9903 −4823Browse files

Unified · Split

952 files
  1. .clang-format +42 −1
  2. Documentation/ABI/stable/sysfs-driver-mlxreg-io +3 −3
  3. Documentation/bpf/bpf_design_QA.rst +5 −6
  4. Documentation/core-api/xarray.rst +9 −6
  5. Documentation/devicetree/bindings/Makefile +5 −1
  6. Documentation/devicetree/bindings/arm/cpu-capacity.txt +1 −1
  7. Documentation/devicetree/bindings/arm/idle-states.txt +1 −1
  8. Documentation/devicetree/bindings/arm/sp810.txt +1 −1
  9. Documentation/devicetree/bindings/arm/topology.txt +1 −1
  10. Documentation/devicetree/bindings/clock/marvell,mmp2.txt +1 −1
  11. Documentation/devicetree/bindings/display/arm,pl11x.txt +1 −1
  12. Documentation/devicetree/bindings/display/msm/gpu.txt +0 −1
  13. Documentation/devicetree/bindings/gpio/gpio-mvebu.txt +0 −2
  14. Documentation/devicetree/bindings/interrupt-controller/arm,gic-v3.txt +1 −1
  15. Documentation/devicetree/bindings/serio/olpc,ap-sp.txt +0 −4
  16. Documentation/devicetree/bindings/soc/qcom/qcom,glink.txt +1 −1
  17. Documentation/devicetree/bindings/soc/qcom/qcom,smp2p.txt +2 −2
  18. Documentation/fb/fbcon.txt +8 −0
  19. Documentation/networking/index.rst +13 −13
  20. Documentation/networking/rxrpc.txt +0 −45
  21. Documentation/networking/snmp_counter.rst +125 −5
  22. Documentation/networking/timestamping.txt +2 −2
  23. Documentation/sysctl/fs.txt +16 −10
  24. Documentation/x86/resctrl_ui.txt +1 −1
  25. MAINTAINERS +54 −25
  26. Makefile +5 −5
  27. arch/arc/include/asm/Kbuild +0 −4
  28. arch/arc/include/asm/arcregs.h +10 −2
  29. arch/arc/include/asm/bitops.h +3 −3
  30. arch/arc/include/asm/perf_event.h +2 −1
  31. arch/arc/kernel/perf_event.c +182 −59
  32. arch/arc/kernel/setup.c +18 −9
  33. arch/arc/kernel/troubleshoot.c +18 −12
  34. arch/arc/lib/memset-archs.S +32 −8
  35. arch/arc/mm/fault.c +9 −4
  36. arch/arc/mm/init.c +2 −1
  37. arch/arm/include/asm/xen/page-coherent.h +94 −0
  38. arch/arm/mach-cns3xxx/pcie.c +2 −2
  39. arch/arm64/include/asm/cache.h +0 −2
  40. arch/arm64/include/asm/device.h +0 −3
  41. arch/arm64/include/asm/mmu.h +4 −1
  42. arch/arm64/include/asm/xen/page-coherent.h +76 −0
  43. arch/arm64/kernel/hibernate.c +3 −1
  44. arch/arm64/kernel/hyp-stub.S +2 −0
  45. arch/arm64/kernel/kaslr.c +7 −2
  46. arch/arm64/kernel/probes/kprobes.c +3 −3
  47. arch/arm64/mm/dma-mapping.c +1 −3
  48. arch/arm64/mm/flush.c +5 −1
  49. arch/c6x/include/asm/Kbuild +1 −0
  50. arch/c6x/include/uapi/asm/Kbuild +0 −1
  51. arch/h8300/Makefile +0 −2
  52. arch/h8300/include/asm/Kbuild +1 −0
  53. arch/h8300/include/uapi/asm/Kbuild +0 −1
  54. arch/hexagon/include/asm/Kbuild +1 −0
  55. arch/hexagon/include/uapi/asm/Kbuild +0 −1
  56. arch/ia64/Makefile +0 −2
  57. arch/m68k/include/asm/Kbuild +1 −0
  58. arch/m68k/include/uapi/asm/Kbuild +0 −1
  59. arch/microblaze/include/asm/Kbuild +1 −0
  60. arch/microblaze/include/uapi/asm/Kbuild +0 −1
  61. arch/mips/Kconfig +1 −0
  62. arch/mips/bcm47xx/setup.c +31 −0
  63. arch/mips/cavium-octeon/setup.c +1 −1
  64. arch/mips/configs/ath79_defconfig +1 −0
  65. arch/mips/include/asm/mach-lantiq/falcon/falcon_irq.h +0 −2
  66. arch/mips/include/asm/mach-lantiq/xway/lantiq_irq.h +0 −2
  67. arch/mips/jazz/jazzdma.c +3 −2
  68. arch/mips/lantiq/irq.c +6 −71
  69. arch/mips/pci/msi-octeon.c +3 −1
  70. arch/nds32/Makefile +0 −8
  71. arch/openrisc/Makefile +0 −3
  72. arch/openrisc/include/asm/Kbuild +1 −0
  73. arch/openrisc/include/uapi/asm/Kbuild +0 −1
  74. arch/powerpc/include/uapi/asm/perf_regs.h +1 −0
  75. arch/powerpc/kernel/head_8xx.S +2 −1
  76. arch/powerpc/kernel/signal_64.c +4 −3
  77. arch/powerpc/kernel/trace/ftrace.c +0 −7
  78. arch/powerpc/perf/perf_regs.c +6 −0
  79. arch/powerpc/platforms/4xx/ocm.c +3 −3
  80. arch/powerpc/platforms/chrp/setup.c +1 −2
  81. arch/powerpc/platforms/powernv/npu-dma.c +1 −1
  82. arch/powerpc/platforms/powernv/pci-ioda.c +2 −1
  83. arch/powerpc/platforms/pseries/pci.c +2 −0
  84. arch/riscv/Kconfig +1 −1
  85. arch/riscv/configs/defconfig +5 −3
  86. arch/riscv/include/asm/page.h +1 −1
  87. arch/riscv/include/asm/processor.h +1 −1
  88. arch/riscv/kernel/asm-offsets.c +1 −0
  89. arch/riscv/kernel/entry.S +17 −1
  90. arch/riscv/kernel/setup.c +1 −1
  91. arch/riscv/kernel/smpboot.c +1 −5
  92. arch/riscv/mm/init.c +2 −1
  93. arch/s390/include/asm/mmu_context.h +3 −4
  94. arch/s390/kernel/early.c +2 −2
  95. arch/s390/kernel/setup.c +2 −0
  96. arch/s390/kernel/smp.c +10 −1
  97. arch/s390/kernel/vdso.c +2 −3
  98. arch/unicore32/include/asm/Kbuild +1 −0
  99. arch/unicore32/include/uapi/asm/Kbuild +0 −1
  100. arch/x86/Kconfig +5 −5
  101. arch/x86/boot/compressed/head_64.S +8 −0
  102. arch/x86/boot/compressed/pgtable.h +1 −1
  103. arch/x86/entry/entry_64_compat.S +4 −2
  104. arch/x86/include/asm/intel-family.h +2 −1
  105. arch/x86/include/asm/mmu_context.h +18 −0
  106. arch/x86/include/asm/page_64_types.h +4 −0
  107. arch/x86/include/asm/resctrl_sched.h +2 −2
  108. arch/x86/include/asm/uaccess.h +1 −1
  109. arch/x86/kernel/cpu/Makefile +1 −1
  110. arch/x86/kernel/cpu/bugs.c +1 −1
  111. arch/x86/kernel/cpu/microcode/amd.c +1 −1
  112. arch/x86/kernel/cpu/resctrl/Makefile +2 −2
  113. arch/x86/kernel/crash.c +1 −0
  114. arch/x86/kernel/hpet.c +0 −4
  115. arch/x86/kernel/kexec-bzimage64.c +5 −0
  116. arch/x86/kernel/kvm.c +5 −2
  117. arch/x86/kernel/tsc.c +16 −14
  118. arch/x86/kvm/Makefile +0 −4
  119. arch/x86/kvm/hyperv.c +3 −4
  120. arch/x86/kvm/lapic.c +2 −0
  121. arch/x86/kvm/mmu.c +1 −0
  122. arch/x86/kvm/svm.c +15 −16
  123. arch/x86/kvm/trace.h +1 −1
  124. arch/x86/kvm/vmx/evmcs.c +4 −3
  125. arch/x86/kvm/vmx/nested.c +10 −5
  126. arch/x86/kvm/vmx/vmx.c +79 −71
  127. arch/x86/kvm/x86.c +12 −3
  128. arch/x86/lib/iomem.c +30 −3
  129. arch/x86/lib/kaslr.c +2 −2
  130. arch/x86/mm/fault.c +1 −1
  131. arch/x86/mm/mem_encrypt_identity.c +2 −2
  132. arch/x86/xen/enlighten_pv.c +1 −4
  133. arch/x86/xen/time.c +9 −3
  134. arch/xtensa/Kconfig +2 −2
  135. arch/xtensa/boot/dts/Makefile +3 −3
  136. arch/xtensa/configs/audio_kc705_defconfig +1 −1
  137. arch/xtensa/configs/cadence_csp_defconfig +1 −1
  138. arch/xtensa/configs/generic_kc705_defconfig +1 −1
  139. arch/xtensa/configs/nommu_kc705_defconfig +1 −1
  140. arch/xtensa/configs/smp_lx200_defconfig +2 −1
  141. arch/xtensa/kernel/head.S +4 −1
  142. arch/xtensa/kernel/smp.c +27 −14
  143. arch/xtensa/kernel/time.c +1 −1
  144. block/bfq-wf2q.c +5 −6
  145. block/blk-core.c +5 −1
  146. block/blk-flush.c +1 −1
  147. block/blk-mq-debugfs-zoned.c +0 −2
  148. block/blk-mq-debugfs.c +2 −1
  149. block/blk-mq.c +2 −1
  150. block/blk-wbt.c +2 −2
  151. crypto/adiantum.c +4 −0
  152. crypto/authenc.c +11 −3
  153. crypto/authencesn.c +1 −1
  154. crypto/sm3_generic.c +1 −1
  155. drivers/acpi/Makefile +2 −1
  156. drivers/acpi/bus.c +12 −12
  157. drivers/acpi/internal.h +4 −0
  158. drivers/acpi/nfit/core.c +54 −32
  159. drivers/acpi/nfit/intel.c +4 −4
  160. drivers/android/binderfs.c +151 −131
  161. drivers/ata/Kconfig +1 −1
  162. drivers/ata/pata_macio.c +4 −5
  163. drivers/ata/sata_inic162x.c +9 −13
  164. drivers/atm/he.c +1 −1
  165. drivers/base/power/runtime.c +5 −5
  166. drivers/base/regmap/regmap-irq.c +7 −1
  167. drivers/block/nbd.c +3 −2
  168. drivers/char/ipmi/ipmi_msghandler.c +100 −73
  169. drivers/char/ipmi/ipmi_ssif.c +17 −8
  170. drivers/char/mwave/mwavedd.c +7 −0
  171. drivers/clk/Kconfig +0 −1
  172. drivers/clk/clk-versaclock5.c +3 −1
  173. drivers/clk/clk.c +13 −3
  174. drivers/clk/imx/clk-frac-pll.c +3 −2
  175. drivers/clk/imx/clk-imx8qxp-lpcg.c +2 −0
  176. drivers/clk/mmp/clk-of-mmp2.c +0 −4
  177. drivers/clk/qcom/Kconfig +1 −0
  178. drivers/clk/qcom/gcc-sdm845.c +10 −4
  179. drivers/clk/socfpga/clk-pll-s10.c +1 −1
  180. drivers/clk/socfpga/clk-s10.c +10 −10
  181. drivers/clk/tegra/clk-tegra124-dfll-fcpu.c +3 −1
  182. drivers/clk/ti/divider.c +10 −1
  183. drivers/clk/zynqmp/clkc.c +2 −2
  184. drivers/cpuidle/poll_state.c +1 −1
  185. drivers/crypto/Kconfig +1 −0
  186. drivers/crypto/bcm/cipher.c +13 −31
  187. drivers/crypto/caam/caamalg.c +1 −1
  188. drivers/crypto/caam/caamhash.c +9 −6
  189. drivers/crypto/caam/desc.h +1 −0
  190. drivers/crypto/caam/error.h +9 −0
  191. drivers/crypto/cavium/nitrox/nitrox_reqmgr.c +6 −4
  192. drivers/crypto/ccree/cc_aead.c +19 −21
  193. drivers/crypto/talitos.c +9 −17
  194. drivers/edac/altera_edac.h +2 −2
  195. drivers/firewire/sbp2.c +1 −4
  196. drivers/firmware/efi/arm-runtime.c +3 −2
  197. drivers/gpio/gpio-altera-a10sr.c +3 −1
  198. drivers/gpio/gpio-eic-sprd.c +13 −1
  199. drivers/gpio/gpio-pca953x.c +1 −1
  200. drivers/gpio/gpio-pcf857x.c +12 −14
  201. drivers/gpio/gpio-vf610.c +5 −0
  202. drivers/gpio/gpiolib-acpi.c +1 −6
  203. drivers/gpio/gpiolib.c +8 −1
  204. drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c +1 −0
  205. drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +0 −18
  206. drivers/gpu/drm/amd/amdkfd/Kconfig +2 −2
  207. drivers/gpu/drm/amd/amdkfd/kfd_crat.c +8 −0
  208. drivers/gpu/drm/amd/amdkfd/kfd_topology.c +14 −7
  209. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 −2
  210. drivers/gpu/drm/amd/display/dc/core/dc_link.c +1 −11
  211. drivers/gpu/drm/amd/display/dc/dc_link.h +1 −2
  212. drivers/gpu/drm/amd/display/dc/dc_stream.h +0 −1
  213. drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +6 −1
  214. drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c +1 −1
  215. drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.c +1 −1
  216. drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c +6 −13
  217. drivers/gpu/drm/amd/display/modules/power/power_helpers.c +2 −0
  218. drivers/gpu/drm/amd/powerplay/hwmgr/vega10_processpptables.c +21 −1
  219. drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c +21 −0
  220. drivers/gpu/drm/i915/gvt/handlers.c +1 −0
  221. drivers/gpu/drm/i915/gvt/hypercall.h +1 −1
  222. drivers/gpu/drm/i915/gvt/kvmgt.c +26 −4
  223. drivers/gpu/drm/i915/gvt/mpt.h +1 −1
  224. drivers/gpu/drm/i915/gvt/scheduler.c +6 −5
  225. drivers/gpu/drm/i915/intel_lrc.c +4 −0
  226. drivers/gpu/drm/meson/meson_crtc.c +2 −21
  227. drivers/gpu/drm/meson/meson_drv.c +12 −2
  228. drivers/gpu/drm/msm/adreno/a6xx_gmu.c +1 −1
  229. drivers/gpu/drm/msm/adreno/adreno_gpu.c +0 −1
  230. drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +13 −13
  231. drivers/gpu/drm/msm/msm_drv.h +5 −1
  232. drivers/gpu/drm/msm/msm_gem.c +6 −2
  233. drivers/gpu/drm/msm/msm_gem_vma.c +3 −2
  234. drivers/gpu/drm/msm/msm_gpu.c +1 −1
  235. drivers/gpu/drm/msm/msm_gpu.h +1 −2
  236. drivers/gpu/drm/msm/msm_rd.c +6 −1
  237. drivers/gpu/drm/nouveau/nvkm/engine/device/base.c +33 −0
  238. drivers/gpu/drm/qxl/qxl_drv.c +0 −4
  239. drivers/gpu/drm/qxl/qxl_prime.c +0 −14
  240. drivers/gpu/drm/rockchip/rockchip_rgb.c +3 −1
  241. drivers/gpu/drm/sun4i/sun4i_backend.c +3 −2
  242. drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c +4 −0
  243. drivers/gpu/drm/virtio/virtgpu_drv.c +0 −4
  244. drivers/gpu/drm/virtio/virtgpu_drv.h +0 −4
  245. drivers/gpu/drm/virtio/virtgpu_prime.c +0 −14
  246. drivers/gpu/vga/Kconfig +1 −0
  247. drivers/hid/hid-core.c +12 −11
  248. drivers/hid/hid-debug.c +47 −73
  249. drivers/hid/hid-ids.h +3 −0
  250. drivers/hid/i2c-hid/i2c-hid-core.c +2 −0
  251. drivers/hv/channel.c +1 −8
  252. drivers/hv/hv_balloon.c +6 −4
  253. drivers/hv/ring_buffer.c +15 −16
  254. drivers/hv/vmbus_drv.c +61 −30
  255. drivers/hwmon/lm80.c +3 −1
  256. drivers/hwmon/nct6775.c +7 −5
  257. drivers/hwmon/occ/common.c +12 −12
  258. drivers/hwmon/tmp421.c +1 −1
  259. drivers/i3c/master.c +1 −1
  260. drivers/i3c/master/dw-i3c-master.c +14 −11
  261. drivers/i3c/master/i3c-master-cdns.c +2 −2
  262. drivers/ide/ide-atapi.c +8 −1
  263. drivers/ide/ide-io.c +31 −30
  264. drivers/ide/ide-park.c +2 −0
  265. drivers/ide/ide-probe.c +16 −7
  266. drivers/ide/ide-proc.c +1 −1
  267. drivers/iio/adc/ti_am335x_adc.c +4 −1
  268. drivers/infiniband/core/cma.c +4 −1
  269. drivers/infiniband/core/core_priv.h +0 −1
  270. drivers/infiniband/core/device.c +10 −3
  271. drivers/infiniband/core/nldev.c +0 −4
  272. drivers/infiniband/core/rdma_core.h +2 −0
  273. drivers/infiniband/core/umem_odp.c +3 −0
  274. drivers/infiniband/core/uverbs_cmd.c +10 −1
  275. drivers/infiniband/core/uverbs_ioctl.c +49 −13
  276. drivers/infiniband/core/uverbs_main.c +17 −9
  277. drivers/infiniband/core/uverbs_std_types_device.c +7 −1
  278. drivers/infiniband/hw/hfi1/file_ops.c +1 −1
  279. drivers/infiniband/hw/hfi1/ud.c +0 −1
  280. drivers/infiniband/hw/hns/hns_roce_srq.c +8 −2
  281. drivers/infiniband/hw/mlx4/mad.c +3 −3
  282. drivers/infiniband/hw/mlx5/flow.c +1 −2
  283. drivers/infiniband/hw/mlx5/odp.c +5 −5
  284. drivers/infiniband/hw/mlx5/qp.c +9 −7
  285. drivers/infiniband/hw/mthca/mthca_provider.c +2 −2
  286. drivers/infiniband/hw/qib/qib_ud.c +0 −1
  287. drivers/infiniband/hw/vmw_pvrdma/pvrdma.h +34 −1
  288. drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c +6 −0
  289. drivers/infiniband/sw/rdmavt/qp.c +6 −1
  290. drivers/infiniband/ulp/ipoib/ipoib.h +0 −1
  291. drivers/infiniband/ulp/ipoib/ipoib_cm.c +1 −2
  292. drivers/input/joystick/xpad.c +3 −0
  293. drivers/input/misc/uinput.c +3 −2
  294. drivers/input/serio/olpc_apsp.c +2 −15
  295. drivers/input/touchscreen/Kconfig +1 −1
  296. drivers/iommu/amd_iommu.c +13 −6
  297. drivers/iommu/intel-iommu.c +1 −1
  298. drivers/iommu/mtk_iommu_v1.c +4 −0
  299. drivers/iommu/of_iommu.c +1 −1
  300. drivers/irqchip/irq-gic-v3-its.c +13 −12
  301. drivers/irqchip/irq-gic-v3-mbi.c +1 −1
  302. drivers/irqchip/irq-madera.c +0 −2
  303. drivers/irqchip/irq-stm32-exti.c +1 −0
  304. drivers/irqchip/irq-xtensa-mx.c +25 −15
  305. drivers/irqchip/irq-xtensa-pic.c +5 −1
  306. drivers/isdn/hardware/avm/b1.c +1 −1
  307. drivers/isdn/hardware/mISDN/hfcsusb.c +1 −2
  308. drivers/isdn/i4l/isdn_tty.c +5 −1
  309. drivers/leds/leds-lp5523.c +3 −1
  310. drivers/md/dm-crypt.c +17 −8
  311. drivers/md/dm-rq.c +1 −1
  312. drivers/md/dm-thin-metadata.c +2 −2
  313. drivers/md/dm-thin-metadata.h +1 −1
  314. drivers/md/dm-thin.c +5 −5
  315. drivers/md/dm.c +32 −9
  316. drivers/md/md.c +1 −6
  317. drivers/md/raid5-cache.c +22 −11
  318. drivers/md/raid5.c +6 −2
  319. drivers/media/platform/vim2m.c +3 −1
  320. drivers/media/v4l2-core/v4l2-ioctl.c +19 −5
  321. drivers/mfd/Kconfig +2 −1
  322. drivers/mfd/ab8500-core.c +1 −1
  323. drivers/mfd/axp20x.c +70 −56
  324. drivers/mfd/bd9571mwv.c +1 −0
  325. drivers/mfd/cros_ec_dev.c +1 −0
  326. drivers/mfd/db8500-prcmu.c +2 −2
  327. drivers/mfd/exynos-lpass.c +3 −1
  328. drivers/mfd/madera-core.c +4 −1
  329. drivers/mfd/max77620.c +1 −1
  330. drivers/mfd/mc13xxx-core.c +3 −1
  331. drivers/mfd/mt6397-core.c +1 −2
  332. drivers/mfd/qcom_rpm.c +4 −0
  333. drivers/mfd/rave-sp.c +1 −1
  334. drivers/mfd/stmpe.c +6 −6
  335. drivers/mfd/ti_am335x_tscadc.c +3 −2
  336. drivers/mfd/tps65218.c +3 −21
  337. drivers/mfd/tps6586x.c +24 −0
  338. drivers/mfd/twl-core.c +2 −2
  339. drivers/mfd/wm5110-tables.c +2 −0
  340. drivers/misc/ibmvmc.c +5 −2
  341. drivers/misc/mei/hbm.c +9 −3
  342. drivers/misc/mei/hw-me-regs.h +2 −0
  343. drivers/misc/mei/pci-me.c +3 −1
  344. drivers/misc/mic/vop/vop_main.c +7 −2
  345. drivers/misc/pvpanic.c +4 −0
  346. drivers/mmc/core/host.c +1 −1
  347. drivers/mmc/host/Kconfig +2 −2
  348. drivers/mmc/host/bcm2835.c +2 −0
  349. drivers/mmc/host/dw_mmc-bluefield.c +0 −5
  350. drivers/mmc/host/meson-gx-mmc.c +20 −12
  351. drivers/mmc/host/mtk-sd.c +1 −1
  352. drivers/mmc/host/sdhci-iproc.c +4 −1
  353. drivers/mtd/nand/raw/denali.c +1 −1
  354. drivers/mtd/nand/raw/fsmc_nand.c +0 −21
  355. drivers/mtd/nand/raw/jz4740_nand.c +1 −1
  356. drivers/net/Kconfig +1 −1
  357. drivers/net/bonding/bond_main.c +3 −0
  358. drivers/net/caif/caif_serial.c +1 −4
  359. drivers/net/can/dev.c +13 −14
  360. drivers/net/can/flexcan.c +2 −2
  361. drivers/net/dsa/microchip/ksz_common.c +0 −2
  362. drivers/net/dsa/mt7530.c +0 −1
  363. drivers/net/dsa/mv88e6xxx/chip.c +113 −0
  364. drivers/net/dsa/mv88e6xxx/chip.h +5 −0
  365. drivers/net/dsa/mv88e6xxx/port.h +10 −0
  366. drivers/net/dsa/mv88e6xxx/serdes.c +1 −1
  367. drivers/net/dsa/realtek-smi.c +13 −5
  368. drivers/net/ethernet/alteon/acenic.c +1 −1
  369. drivers/net/ethernet/altera/altera_msgdma.c +2 −1
  370. drivers/net/ethernet/altera/altera_tse_main.c +3 −1
  371. drivers/net/ethernet/amd/amd8111e.c +1 −1
  372. drivers/net/ethernet/amd/xgbe/xgbe-common.h +0 −2
  373. drivers/net/ethernet/amd/xgbe/xgbe-dev.c +16 −6
  374. drivers/net/ethernet/apple/bmac.c +1 −1
  375. drivers/net/ethernet/broadcom/b44.c +2 −2
  376. drivers/net/ethernet/broadcom/bnxt/bnxt.c +8 −4
  377. drivers/net/ethernet/broadcom/bnxt/bnxt_hsi.h +3 −2
  378. drivers/net/ethernet/cadence/macb.h +3 −0
  379. drivers/net/ethernet/cadence/macb_main.c +19 −17
  380. drivers/net/ethernet/chelsio/cxgb3/sge.c +7 −5
  381. drivers/net/ethernet/chelsio/cxgb3/t3_hw.c +3 −3
  382. drivers/net/ethernet/chelsio/cxgb4/cxgb4_ptp.c +4 −4
  383. drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.c +1 −1
  384. drivers/net/ethernet/chelsio/cxgb4/t4_hw.c +1 −1
  385. drivers/net/ethernet/freescale/dpaa/dpaa_eth.c +6 −0
  386. drivers/net/ethernet/freescale/dpaa2/Kconfig +3 −2
  387. drivers/net/ethernet/freescale/fec_main.c +1 −1
  388. drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c +2 −4
  389. drivers/net/ethernet/hisilicon/hns/hns_enet.c +12 −10
  390. drivers/net/ethernet/hisilicon/hns/hns_ethtool.c +9 −7
  391. drivers/net/ethernet/hisilicon/hns_mdio.c +1 −1
  392. drivers/net/ethernet/i825xx/82596.c +1 −1
  393. drivers/net/ethernet/ibm/ibmveth.c +0 −2
  394. drivers/net/ethernet/intel/Kconfig +1 −1
  395. drivers/net/ethernet/intel/igb/igb.h +1 −1
  396. drivers/net/ethernet/intel/igb/igb_ethtool.c +2 −2
  397. drivers/net/ethernet/intel/igb/igb_main.c +7 −7
  398. drivers/net/ethernet/marvell/octeontx2/af/cgx.c +3 −1
  399. drivers/net/ethernet/mediatek/mtk_eth_soc.c +0 −16
  400. drivers/net/ethernet/mellanox/mlx4/cq.c +4 −2
  401. drivers/net/ethernet/mellanox/mlx4/fw.c +46 −29
  402. drivers/net/ethernet/mellanox/mlx4/icm.c +60 −41
  403. drivers/net/ethernet/mellanox/mlx4/icm.h +19 −3
  404. drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c +4 −1
  405. drivers/net/ethernet/mellanox/mlx5/core/en_main.c +1 −1
  406. drivers/net/ethernet/mellanox/mlx5/core/en_rep.c +40 −15
  407. drivers/net/ethernet/mellanox/mlx5/core/en_rx.c +13 −0
  408. drivers/net/ethernet/mellanox/mlx5/core/eswitch.c +8 −14
  409. drivers/net/ethernet/mellanox/mlx5/core/lag.c +21 −0
  410. drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h +2 −0
  411. drivers/net/ethernet/mellanox/mlx5/core/qp.c +3 −2
  412. drivers/net/ethernet/mellanox/mlxsw/Kconfig +1 −0
  413. drivers/net/ethernet/mellanox/mlxsw/pci.c +9 −7
  414. drivers/net/ethernet/mellanox/mlxsw/pci_hw.h +2 −1
  415. drivers/net/ethernet/mellanox/mlxsw/spectrum.c +5 −2
  416. drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_ctcam.c +9 −1
  417. drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c +0 −2
  418. drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c +2 −2
  419. drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c +2 −2
  420. drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c +16 −19
  421. drivers/net/ethernet/microchip/lan743x_main.c +4 −7
  422. drivers/net/ethernet/qlogic/qed/qed_dev.c +4 −4
  423. drivers/net/ethernet/qlogic/qed/qed_l2.c +11 −1
  424. drivers/net/ethernet/qlogic/qed/qed_l2.h +3 −0
  425. drivers/net/ethernet/qlogic/qed/qed_ll2.c +19 −5
  426. drivers/net/ethernet/qlogic/qed/qed_sriov.c +8 −2
  427. drivers/net/ethernet/qlogic/qed/qed_vf.c +10 −0
  428. drivers/net/ethernet/realtek/8139cp.c +1 −1
  429. drivers/net/ethernet/realtek/r8169.c +7 −2
  430. drivers/net/ethernet/renesas/ravb_main.c +7 −5
  431. drivers/net/ethernet/sfc/ef10.c +21 −8
  432. drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c +3 −1
  433. drivers/net/ethernet/stmicro/stmmac/dwxgmac2_dma.c +3 −3
  434. drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +26 −25
  435. drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c +10 −0
  436. drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c +2 −0
  437. drivers/net/ethernet/sun/cassini.c +1 −14
  438. drivers/net/ethernet/sun/cassini.h +1 −14
  439. drivers/net/ethernet/ti/cpmac.c +1 −1
  440. drivers/net/hyperv/hyperv_net.h +8 −4
  441. drivers/net/hyperv/netvsc.c +2 −2
  442. drivers/net/hyperv/netvsc_drv.c +92 −53
  443. drivers/net/hyperv/rndis_filter.c +27 −9
  444. drivers/net/macvlan.c +1 −1
  445. drivers/net/phy/asix.c +1 −7
  446. drivers/net/phy/bcm87xx.c +2 −0
  447. drivers/net/phy/cortina.c +1 −0
  448. drivers/net/phy/marvell.c +35 −2
  449. drivers/net/phy/mdio-hisi-femac.c +2 −14
  450. drivers/net/phy/mdio_bus.c +1 −0
  451. drivers/net/phy/meson-gxl.c +1 −0
  452. drivers/net/phy/micrel.c +2 −0
  453. drivers/net/phy/phy.c +7 −12
  454. drivers/net/phy/phy_device.c +17 −0
  455. drivers/net/phy/rockchip.c +2 −7
  456. drivers/net/phy/teranetics.c +1 −0
  457. drivers/net/ppp/pppoe.c +1 −0
  458. drivers/net/tun.c +7 −4
  459. drivers/net/usb/aqc111.c +15 −0
  460. drivers/net/usb/asix_devices.c +7 −2
  461. drivers/net/usb/cdc_ether.c +19 −15
  462. drivers/net/usb/qmi_wwan.c +1 −0
  463. drivers/net/virtio_net.c +6 −6
  464. drivers/net/wan/fsl_ucc_hdlc.c +61 −1
  465. drivers/net/wireless/mac80211_hwsim.c +5 −0
  466. drivers/net/wireless/virt_wifi.c +3 −1
  467. drivers/nvdimm/dimm.c +6 −0
  468. drivers/nvdimm/dimm_devs.c +17 −5
  469. drivers/nvdimm/nd-core.h +2 −2
  470. drivers/nvdimm/nd.h +1 −0
  471. drivers/nvme/host/multipath.c +1 −2
  472. drivers/nvme/host/pci.c +13 −8
  473. drivers/nvme/host/rdma.c +43 −21
  474. drivers/nvme/host/tcp.c +11 −8
  475. drivers/nvme/target/rdma.c +14 −1
  476. drivers/nvme/target/tcp.c +1 −1
  477. drivers/of/dynamic.c +0 −3
  478. drivers/of/fdt.c +0 −4
  479. drivers/of/overlay.c +0 −3
  480. drivers/of/pdt.c +0 −1
  481. drivers/of/property.c +1 −0
  482. drivers/pci/Kconfig +8 −14
  483. drivers/pci/controller/dwc/pci-imx6.c +7 −4
  484. drivers/pci/controller/dwc/pcie-armada8k.c +0 −16
  485. drivers/pci/msi.c +13 −9
  486. drivers/pci/pci.c +2 −1
  487. drivers/phy/qualcomm/phy-ath79-usb.c +2 −2
  488. drivers/phy/ti/Kconfig +1 −0
  489. drivers/phy/ti/phy-gmii-sel.c +2 −2
  490. drivers/pinctrl/intel/pinctrl-cherryview.c +4 −4
  491. drivers/pinctrl/mediatek/Kconfig +3 −0
  492. drivers/pinctrl/pinctrl-mcp23s08.c +6 −1
  493. drivers/pinctrl/sunxi/pinctrl-sun50i-h6.c +1 −1
  494. drivers/pinctrl/sunxi/pinctrl-sunxi.c +22 −22
  495. drivers/pinctrl/sunxi/pinctrl-sunxi.h +1 −1
  496. drivers/platform/x86/Kconfig +5 −3
  497. drivers/ptp/ptp_chardev.c +2 −1
  498. drivers/remoteproc/remoteproc_virtio.c +7 −2
  499. drivers/s390/char/sclp_config.c +2 −0
  500. drivers/s390/scsi/zfcp_aux.c +0 −1
  501. drivers/s390/scsi/zfcp_scsi.c +2 −0
  502. drivers/s390/virtio/virtio_ccw.c +9 −3
  503. drivers/scsi/53c700.c +1 −1
  504. drivers/scsi/aacraid/linit.c +4 −5
  505. drivers/scsi/bnx2fc/bnx2fc_io.c +2 −2
  506. drivers/scsi/csiostor/csio_attr.c +1 −1
  507. drivers/scsi/cxgbi/cxgb3i/cxgb3i.c +4 −5
  508. drivers/scsi/cxgbi/cxgb4i/cxgb4i.c +20 −8
  509. drivers/scsi/cxgbi/libcxgbi.c +4 −3
  510. drivers/scsi/cxgbi/libcxgbi.h +3 −2
  511. drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +6 −6
  512. drivers/scsi/isci/init.c +7 −7
  513. drivers/scsi/libfc/fc_lport.c +3 −3
  514. drivers/scsi/lpfc/lpfc_nvme.c +9 −7
  515. drivers/scsi/lpfc/lpfc_nvme.h +1 −1
  516. drivers/scsi/lpfc/lpfc_nvmet.c +5 −3
  517. drivers/scsi/lpfc/lpfc_nvmet.h +1 −1
  518. drivers/scsi/lpfc/lpfc_sli.c +11 −9
  519. drivers/scsi/megaraid/megaraid_sas_base.c +1 −1
  520. drivers/scsi/megaraid/megaraid_sas_fusion.c +2 −1
  521. drivers/scsi/pm8001/pm8001_sas.c +1 −1
  522. drivers/scsi/qedi/qedi_iscsi.c +3 −0
  523. drivers/scsi/qedi/qedi_iscsi.h +1 −0
  524. drivers/scsi/qla1280.c +1 −1
  525. drivers/scsi/qla2xxx/qla_def.h +2 −0
  526. drivers/scsi/qla2xxx/qla_isr.c +1 −0
  527. drivers/scsi/qla2xxx/qla_os.c +1 −1
  528. drivers/scsi/qla4xxx/ql4_os.c +2 −0
  529. drivers/scsi/scsi_debug.c +21 −20
  530. drivers/scsi/scsi_lib.c +2 −2
  531. drivers/scsi/scsi_pm.c +15 −11
  532. drivers/scsi/sd.c +6 −0
  533. drivers/scsi/smartpqi/smartpqi_init.c +1 −1
  534. drivers/scsi/ufs/ufs.h +1 −1
  535. drivers/scsi/ufs/ufshcd.c +10 −2
  536. drivers/soc/fsl/qe/qe_tdm.c +0 −55
  537. drivers/staging/android/ion/ion.c +1 −1
  538. drivers/staging/rtl8188eu/os_dep/usb_intf.c +1 −0
  539. drivers/staging/rtl8723bs/include/ieee80211.h +3 −3
  540. drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c +1 −0
  541. drivers/staging/wilc1000/host_interface.c +2 −3
  542. drivers/staging/wilc1000/wilc_wlan.c +4 −3
  543. drivers/target/iscsi/iscsi_target.c +1 −1
  544. drivers/target/target_core_user.c +62 −27
  545. drivers/thermal/intel/int340x_thermal/Kconfig +1 −1
  546. drivers/thermal/intel/int340x_thermal/processor_thermal_device.c +16 −14
  547. drivers/tty/n_hdlc.c +1 −0
  548. drivers/tty/serial/8250/8250_core.c +9 −8
  549. drivers/tty/serial/earlycon-riscv-sbi.c +8 −5
  550. drivers/tty/serial/fsl_lpuart.c +1 −1
  551. drivers/tty/serial/qcom_geni_serial.c +2 −2
  552. drivers/tty/serial/serial_core.c +8 −4
  553. drivers/tty/tty_io.c +2 −1
  554. drivers/tty/vt/vt.c +17 −33
  555. drivers/usb/chipidea/ci_hdrc_imx.c +2 −1
  556. drivers/usb/core/ledtrig-usbport.c +10 −7
  557. drivers/usb/dwc2/gadget.c +1 −1
  558. drivers/usb/dwc3/gadget.c +4 −0
  559. drivers/usb/gadget/function/f_sourcesink.c +1 −1
  560. drivers/usb/host/ehci-mv.c +1 −0
  561. drivers/usb/serial/ftdi_sio.c +14 −1
  562. drivers/usb/serial/keyspan_usa26msg.h +1 −0
  563. drivers/usb/serial/keyspan_usa28msg.h +1 −0
  564. drivers/usb/serial/keyspan_usa49msg.h +1 −0
  565. drivers/usb/serial/keyspan_usa67msg.h +1 −0
  566. drivers/usb/serial/keyspan_usa90msg.h +1 −0
  567. drivers/usb/serial/pl2303.c +1 −0
  568. drivers/usb/serial/pl2303.h +2 −0
  569. drivers/usb/serial/usb-serial-simple.c +2 −1
  570. drivers/usb/usbip/README +0 −7
  571. drivers/vfio/pci/trace.h +1 −5
  572. drivers/vfio/pci/vfio_pci_nvlink2.c +16 −20
  573. drivers/vhost/net.c +4 −2
  574. drivers/vhost/scsi.c +13 −9
  575. drivers/vhost/vhost.c +93 −19
  576. drivers/vhost/vhost.h +5 −2
  577. drivers/vhost/vsock.c +2 −2
  578. drivers/video/backlight/88pm860x_bl.c +1 −1
  579. drivers/video/backlight/pwm_bl.c +17 −11
  580. drivers/video/console/vgacon.c +4 −3
  581. drivers/video/fbdev/core/fbcon.c +7 −0
  582. drivers/video/fbdev/core/fbmem.c +10 −9
  583. drivers/video/fbdev/offb.c +9 −9
  584. drivers/video/fbdev/omap2/omapfb/omapfb-ioctl.c +2 −0
  585. drivers/video/logo/Kconfig +0 −9
  586. drivers/virtio/virtio_balloon.c +65 −33
  587. drivers/virtio/virtio_mmio.c +7 −2
  588. drivers/virtio/virtio_pci_common.c +4 −4
  589. drivers/virtio/virtio_ring.c +14 −1
  590. drivers/watchdog/mt7621_wdt.c +1 −0
  591. drivers/watchdog/rt2880_wdt.c +1 −0
  592. drivers/watchdog/tqmx86_wdt.c +4 −4
  593. drivers/xen/events/events_base.c +1 −1
  594. drivers/xen/pvcalls-back.c +4 −5
  595. drivers/xen/pvcalls-front.c +75 −29
  596. drivers/xen/swiotlb-xen.c +2 −2
  597. fs/afs/flock.c +2 −2
  598. fs/afs/inode.c +2 −1
  599. fs/afs/protocol_yfs.h +11 −0
  600. fs/afs/rxrpc.c +42 −11
  601. fs/afs/server_list.c +1 −3
  602. fs/afs/yfsclient.c +1 −1
  603. fs/autofs/expire.c +2 −1
  604. fs/autofs/inode.c +3 −1
  605. fs/block_dev.c +18 −10
  606. fs/btrfs/ctree.c +50 −28
  607. fs/btrfs/ctree.h +7 −0
  608. fs/btrfs/disk-io.c +12 −0
  609. fs/btrfs/extent-tree.c +14 −7
  610. fs/btrfs/inode.c +2 −3
  611. fs/btrfs/super.c +3 −0
  612. fs/btrfs/transaction.c +16 −8
  613. fs/btrfs/volumes.c +2 −2
  614. fs/ceph/caps.c +2 −0
  615. fs/ceph/quota.c +0 −13
  616. fs/cifs/cifs_debug.c +1 −0
  617. fs/cifs/cifsfs.h +1 −1
  618. fs/cifs/cifssmb.c +23 −12
  619. fs/cifs/connect.c +21 −0
  620. fs/cifs/file.c +8 −3
  621. fs/cifs/smb2inode.c +17 −0
  622. fs/cifs/smb2misc.c +7 −0
  623. fs/cifs/smb2ops.c +50 −22
  624. fs/cifs/smb2pdu.c +53 −24
  625. fs/cifs/smb2pdu.h +15 −4
  626. fs/cifs/trace.c +0 −10
  627. fs/cifs/trace.h +0 −10
  628. fs/cifs/transport.c +1 −10
  629. fs/dcache.c +33 −5
  630. fs/direct-io.c +3 −2
  631. fs/drop_caches.c +7 −1
  632. fs/fs-writeback.c +38 −2
  633. fs/fuse/dev.c +3 −1
  634. fs/fuse/file.c +1 −1
  635. fs/fuse/inode.c +1 −1
  636. fs/gfs2/rgrp.c +1 −1
  637. fs/iomap.c +30 −7
  638. fs/nfs/nfs4file.c +1 −7
  639. fs/nfs/super.c +5 −0
  640. fs/nfs/write.c +5 −4
  641. fs/nfsd/vfs.c +4 −2
  642. fs/notify/inotify/inotify_user.c +4 −2
  643. fs/proc/generic.c +3 −1
  644. fs/proc/internal.h +1 −0
  645. fs/proc/proc_net.c +20 −0
  646. fs/pstore/ram.c +4 −8
  647. include/dt-bindings/clock/marvell,mmp2.h +0 −1
  648. include/dt-bindings/reset/amlogic,meson-axg-reset.h +1 −2
  649. include/linux/backing-dev-defs.h +1 −0
  650. include/linux/bcma/bcma_soc.h +1 −0
  651. include/linux/blk_types.h +1 −1
  652. include/linux/bpf_verifier.h +1 −0
  653. include/linux/bpfilter.h +12 −3
  654. include/linux/compiler-clang.h +2 −3
  655. include/linux/compiler-gcc.h +0 −4
  656. include/linux/compiler-intel.h +1 −3
  657. include/linux/compiler.h +3 −1
  658. include/linux/cpu.h +0 −2
  659. include/linux/dcache.h +4 −3
  660. include/linux/fb.h +1 −0
  661. include/linux/fs.h +5 −4
  662. include/linux/hid-debug.h +4 −5
  663. include/linux/hid.h +1 −2
  664. include/linux/hyperv.h +3 −2
  665. include/linux/ide.h +2 −0
  666. include/linux/if_arp.h +1 −0
  667. include/linux/interrupt.h +1 −0
  668. include/linux/libnvdimm.h +1 −1
  669. include/linux/memory_hotplug.h +10 −8
  670. include/linux/mfd/cros_ec_commands.h +94 −0
  671. include/linux/mfd/ingenic-tcu.h +1 −1
  672. include/linux/mfd/madera/core.h +7 −0
  673. include/linux/mfd/ti_am335x_tscadc.h +4 −0
  674. include/linux/mfd/tmio.h +1 −1
  675. include/linux/of.h +0 −1
  676. include/linux/phy.h +4 −2
  677. include/linux/pm_runtime.h +1 −1
  678. include/linux/qed/qed_chain.h +31 −0
  679. include/linux/sched.h +10 −1
  680. include/linux/sched/coredump.h +1 −0
  681. include/linux/sched/wake_q.h +5 −1
  682. include/linux/skbuff.h +1 −0
  683. include/linux/umh.h +2 −0
  684. include/linux/virtio_config.h +9 −4
  685. include/linux/xarray.h +170 −57
  686. include/net/af_rxrpc.h +0 −16
  687. include/net/ax25.h +12 −0
  688. include/net/ip_fib.h +1 −1
  689. include/net/netfilter/nf_flow_table.h +0 −1
  690. include/net/tls.h +2 −0
  691. include/rdma/ib_verbs.h +22 −2
  692. include/sound/compress_driver.h +5 −1
  693. include/sound/hda_codec.h +1 −0
  694. include/sound/soc.h +6 −0
  695. include/trace/events/afs.h +2 −0
  696. include/uapi/linux/android/binderfs.h +5 −5
  697. include/uapi/linux/blkzoned.h +1 −0
  698. include/uapi/linux/in.h +1 −1
  699. include/uapi/linux/input.h +5 −1
  700. include/uapi/linux/ptp_clock.h +1 −1
  701. include/uapi/linux/virtio_config.h +6 −0
  702. include/uapi/linux/virtio_ring.h +0 −10
  703. include/uapi/rdma/hns-abi.h +5 −0
  704. include/uapi/rdma/vmw_pvrdma-abi.h +1 −0
  705. include/xen/arm/page-coherent.h +3 −94
  706. init/Kconfig +13 −1
  707. kernel/bpf/btf.c +7 −7
  708. kernel/bpf/cgroup.c +1 −0
  709. kernel/bpf/map_in_map.c +15 −2
  710. kernel/bpf/stackmap.c +9 −3
  711. kernel/bpf/verifier.c +48 −13
  712. kernel/cpu.c +5 −33
  713. kernel/dma/swiotlb.c +2 −0
  714. kernel/events/core.c +7 −7
  715. kernel/exit.c +12 −3
  716. kernel/futex.c +8 −5
  717. kernel/irq/irqdesc.c +1 −1
  718. kernel/irq/manage.c +3 −0
  719. kernel/locking/rwsem-xadd.c +9 −2
  720. kernel/sched/core.c +16 −3
  721. kernel/sched/fair.c +1 −0
  722. kernel/sched/psi.c +17 −4
  723. kernel/seccomp.c +4 −0
  724. kernel/smp.c +0 −2
  725. kernel/time/posix-cpu-timers.c +1 −0
  726. kernel/trace/trace_kprobe.c +9 −3
  727. kernel/trace/trace_uprobe.c +8 −1
  728. kernel/umh.c +31 −2
  729. kernel/workqueue.c +23 −0
  730. kernel/workqueue_internal.h +5 −1
  731. lib/int_sqrt.c +1 −1
  732. lib/sbitmap.c +3 −10
  733. lib/test_kmod.c +1 −1
  734. lib/test_xarray.c +45 −12
  735. lib/xarray.c +54 −38
  736. mm/backing-dev.c +1 −0
  737. mm/hugetlb.c +2 −1
  738. mm/kasan/Makefile +1 −0
  739. mm/memory-failure.c +2 −1
  740. mm/memory_hotplug.c +27 −35
  741. mm/migrate.c +5 −7
  742. mm/mincore.c +81 −13
  743. mm/oom_kill.c +10 −2
  744. mm/page_alloc.c +0 −12
  745. net/ax25/ax25_ip.c +2 −2
  746. net/ax25/ax25_route.c +8 −11
  747. net/bpfilter/bpfilter_kern.c +42 −34
  748. net/bpfilter/bpfilter_umh_blob.S +1 −1
  749. net/bridge/br_fdb.c +5 −0
  750. net/bridge/br_forward.c +5 −5
  751. net/bridge/br_netfilter_hooks.c +1 −1
  752. net/bridge/br_netfilter_ipv6.c +1 −0
  753. net/bridge/br_private.h +1 −0
  754. net/bridge/br_vlan.c +13 −13
  755. net/bridge/netfilter/ebtables.c +10 −5
  756. net/bridge/netfilter/nft_reject_bridge.c +1 −0
  757. net/can/bcm.c +27 −0
  758. net/can/gw.c +27 −3
  759. net/ceph/messenger.c +3 −2
  760. net/core/dev.c +3 −0
  761. net/core/filter.c +21 −13
  762. net/core/lwt_bpf.c +1 −0
  763. net/core/neighbour.c +10 −5
  764. net/core/skbuff.c +1 −6
  765. net/decnet/dn_dev.c +1 −1
  766. net/ipv4/bpfilter/sockopt.c +48 −10
  767. net/ipv4/devinet.c +1 −1
  768. net/ipv4/fib_frontend.c +2 −2
  769. net/ipv4/fib_trie.c +12 −3
  770. net/ipv4/fou.c +9 −3
  771. net/ipv4/gre_demux.c +17 −0
  772. net/ipv4/ip_gre.c +14 −18
  773. net/ipv4/ip_input.c +1 −0
  774. net/ipv4/ip_sockglue.c +5 −7
  775. net/ipv4/ip_tunnel.c +7 −1
  776. net/ipv4/ip_vti.c +50 −0
  777. net/ipv4/netfilter/ipt_CLUSTERIP.c +1 −1
  778. net/ipv4/tcp.c +1 −1
  779. net/ipv4/tcp_timer.c +1 −1
  780. net/ipv4/udp.c +13 −5
  781. net/ipv4/udp_impl.h +1 −0
  782. net/ipv4/udplite.c +1 −0
  783. net/ipv6/addrconf.c +5 −3
  784. net/ipv6/af_inet6.c +13 −1
  785. net/ipv6/datagram.c +5 −6
  786. net/ipv6/fou6.c +15 −2
  787. net/ipv6/icmp.c +6 −2
  788. net/ipv6/ip6_gre.c +10 −8
  789. net/ipv6/ip6mr.c +3 −4
  790. net/ipv6/route.c +2 −12
  791. net/ipv6/udp.c +17 −9
  792. net/ipv6/udp_impl.h +1 −0
  793. net/ipv6/udplite.c +1 −0
  794. net/mac80211/cfg.c +4 −0
  795. net/mac80211/rx.c +4 −2
  796. net/netfilter/ipvs/ip_vs_ctl.c +12 −0
  797. net/netfilter/nf_flow_table_core.c +3 −2
  798. net/netfilter/nf_tables_api.c +7 −7
  799. net/netfilter/nfnetlink_osf.c +4 −0
  800. net/netfilter/nft_compat.c +142 −47
  801. net/netfilter/nft_flow_offload.c +8 −5
  802. net/netrom/nr_timer.c +10 −10
  803. net/openvswitch/flow.c +5 −3
  804. net/openvswitch/flow_netlink.c +1 −1
  805. net/packet/af_packet.c +4 −3
  806. net/rds/ib_send.c +2 −2
  807. net/rds/message.c +2 −2
  808. net/rds/rds.h +0 −4
  809. net/rds/send.c +1 −1
  810. net/rose/rose_route.c +5 −0
  811. net/rxrpc/af_rxrpc.c +0 −70
  812. net/rxrpc/ar-internal.h +12 −7
  813. net/rxrpc/call_object.c +0 −97
  814. net/rxrpc/conn_client.c +1 −4
  815. net/rxrpc/sendmsg.c +11 −13
  816. net/sched/act_tunnel_key.c +11 −8
  817. net/sched/cls_api.c +1 −2
  818. net/sched/cls_flower.c +14 −5
  819. net/sched/sch_cake.c +3 −2
  820. net/sched/sch_cbs.c +2 −1
  821. net/sched/sch_drr.c +5 −2
  822. net/sched/sch_dsmark.c +2 −1
  823. net/sched/sch_hfsc.c +5 −4
  824. net/sched/sch_htb.c +2 −1
  825. net/sched/sch_prio.c +2 −1
  826. net/sched/sch_qfq.c +12 −8
  827. net/sched/sch_tbf.c +2 −1
  828. net/sctp/ipv6.c +3 −5
  829. net/sctp/protocol.c +3 −4
  830. net/sctp/sm_make_chunk.c +8 −3
  831. net/sctp/stream.c +25 −33
  832. net/smc/af_smc.c +3 −1
  833. net/sunrpc/auth.c +3 −0
  834. net/sunrpc/auth_gss/auth_gss.c +9 −3
  835. net/sunrpc/clnt.c +12 −8
  836. net/sunrpc/xprt.c +2 −1
  837. net/sunrpc/xprtrdma/svc_rdma_sendto.c +99 −6
  838. net/sunrpc/xprtrdma/svc_rdma_transport.c +3 −6
  839. net/sunrpc/xprtrdma/verbs.c +4 −6
  840. net/sunrpc/xprtsock.c +22 −0
  841. net/tipc/netlink_compat.c +52 −2
  842. net/tipc/topsrv.c +1 −1
  843. net/tls/tls_sw.c +5 −1
  844. net/wireless/nl80211.c +1 −1
  845. net/wireless/reg.c +9 −4
  846. net/xdp/xdp_umem.c +13 −3
  847. net/xfrm/xfrm_policy.c +33 −30
  848. net/xfrm/xfrm_user.c +9 −4
  849. samples/bpf/Makefile +1 −0
  850. samples/bpf/asm_goto_workaround.h +16 −0
  851. samples/bpf/test_cgrp2_attach2.c +7 −7
  852. samples/bpf/test_current_task_under_cgroup_user.c +1 −1
  853. samples/bpf/xdp1_user.c +1 −1
  854. scripts/Kbuild.include +0 −4
  855. scripts/gcc-plugins/arm_ssp_per_task_plugin.c +21 −2
  856. scripts/kconfig/Makefile +1 −1
  857. security/apparmor/domain.c +4 −1
  858. security/apparmor/lsm.c +2 −0
  859. security/security.c +7 −0
  860. security/selinux/ss/policydb.c +2 −1
  861. security/yama/yama_lsm.c +3 −1
  862. sound/core/compress_offload.c +2 −1
  863. sound/core/pcm_lib.c +8 −1
  864. sound/pci/hda/hda_bind.c +2 −1
  865. sound/pci/hda/hda_intel.c +2 −0
  866. sound/pci/hda/patch_ca0132.c +3 −1
  867. sound/pci/hda/patch_conexant.c +1 −0
  868. sound/pci/hda/patch_realtek.c +80 −60
  869. sound/soc/amd/raven/acp3x-pcm-dma.c +4 −2
  870. sound/soc/codecs/hdac_hdmi.c +13 −103
  871. sound/soc/codecs/pcm512x.c +4 −7
  872. sound/soc/codecs/rt274.c +4 −1
  873. sound/soc/codecs/rt5514-spi.c +2 −0
  874. sound/soc/codecs/rt5682.c +1 −0
  875. sound/soc/codecs/rt5682.h +12 −12
  876. sound/soc/codecs/tlv320aic32x4.c +4 −0
  877. sound/soc/fsl/imx-audmux.c +12 −12
  878. sound/soc/intel/Kconfig +1 −1
  879. sound/soc/intel/atom/sst-mfld-platform-pcm.c +7 −1
  880. sound/soc/intel/boards/broadwell.c +1 −1
  881. sound/soc/intel/boards/glk_rt5682_max98357a.c +7 −38
  882. sound/soc/intel/boards/haswell.c +1 −1
  883. sound/soc/intel/skylake/skl.c +4 −9
  884. sound/soc/qcom/qdsp6/q6asm-dai.c +12 −5
  885. sound/soc/qcom/sdm845.c +22 −9
  886. sound/soc/sh/dma-sh7760.c +1 −1
  887. sound/soc/soc-core.c +28 −6
  888. sound/soc/soc-dapm.c +5 −5
  889. sound/soc/ti/davinci-mcasp.c +64 −72
  890. sound/soc/xilinx/Kconfig +1 −1
  891. sound/soc/xilinx/xlnx_i2s.c +7 −8
  892. sound/usb/quirks.c +2 −0
  893. tools/arch/powerpc/include/uapi/asm/perf_regs.h +1 −0
  894. tools/bpf/bpftool/Makefile +8 −1
  895. tools/bpf/bpftool/btf_dumper.c +7 −6
  896. tools/bpf/bpftool/json_writer.c +1 −6
  897. tools/bpf/bpftool/json_writer.h +0 −5
  898. tools/include/uapi/linux/pkt_sched.h +1163 −0
  899. tools/lib/bpf/.gitignore +1 −0
  900. tools/lib/bpf/README.rst +14 −0
  901. tools/lib/bpf/bpf.c +15 −4
  902. tools/perf/arch/powerpc/include/perf_regs.h +2 −1
  903. tools/perf/arch/powerpc/util/perf_regs.c +1 −0
  904. tools/perf/builtin-script.c +3 −6
  905. tools/perf/ui/browsers/annotate.c +10 −6
  906. tools/perf/util/cpumap.c +9 −2
  907. tools/perf/util/ordered-events.c +4 −2
  908. tools/perf/util/setup.py +2 −0
  909. tools/testing/nvdimm/dimm_devs.c +2 −2
  910. tools/testing/selftests/bpf/.gitignore +1 −0
  911. tools/testing/selftests/bpf/Makefile +4 −1
  912. tools/testing/selftests/bpf/cgroup_helpers.c +3 −3
  913. tools/testing/selftests/bpf/test_btf.c +21 −8
  914. tools/testing/selftests/bpf/test_cgroup_storage.c +1 −1
  915. tools/testing/selftests/bpf/test_dev_cgroup.c +1 −1
  916. tools/testing/selftests/bpf/test_netcnt.c +1 −1
  917. tools/testing/selftests/bpf/test_progs.c +30 −0
  918. tools/testing/selftests/bpf/test_skb_cgroup_id_user.c +1 −1
  919. tools/testing/selftests/bpf/test_sock.c +1 −1
  920. tools/testing/selftests/bpf/test_sock_addr.c +51 −4
  921. tools/testing/selftests/bpf/test_socket_cookie.c +1 −1
  922. tools/testing/selftests/bpf/test_tcpbpf_user.c +1 −1
  923. tools/testing/selftests/bpf/test_tcpnotify_user.c +1 −1
  924. tools/testing/selftests/bpf/test_verifier.c +120 −0
  925. tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh +10 −3
  926. tools/testing/selftests/drivers/net/mlxsw/rtnetlink.sh +20 −0
  927. tools/testing/selftests/drivers/net/mlxsw/vxlan.sh +18 −0
  928. tools/testing/selftests/gpio/gpio-mockup-chardev.c +6 −3
  929. tools/testing/selftests/ir/Makefile +2 −0
  930. tools/testing/selftests/kvm/lib/kvm_util.c +2 −7
  931. tools/testing/selftests/kvm/x86_64/evmcs_test.c +6 −0
  932. tools/testing/selftests/net/Makefile +1 −1
  933. tools/testing/selftests/net/forwarding/bridge_vlan_aware.sh +46 −1
  934. tools/testing/selftests/net/forwarding/vxlan_bridge_1d.sh +1 −1
  935. tools/testing/selftests/net/ip_defrag.c +87 −9
  936. tools/testing/selftests/net/ip_defrag.sh +8 −1
  937. tools/testing/selftests/net/xfrm_policy.sh +131 −22
  938. tools/testing/selftests/networking/timestamping/txtimestamp.c +1 −1
  939. tools/testing/selftests/proc/.gitignore +1 −0
  940. tools/testing/selftests/proc/Makefile +1 −0
  941. tools/testing/selftests/proc/setns-dcache.c +129 −0
  942. tools/testing/selftests/rtc/rtctest.c +104 −5
  943. tools/testing/selftests/seccomp/Makefile +1 −1
  944. tools/testing/selftests/seccomp/seccomp_bpf.c +62 −20
  945. tools/testing/selftests/tc-testing/tc-tests/actions/ife.json +44 −44
  946. tools/testing/selftests/tc-testing/tc-tests/actions/tunnel_key.json +1 −30
  947. tools/testing/selftests/timers/Makefile +1 −1
  948. tools/testing/selftests/vm/gup_benchmark.c +1 −0
  949. tools/testing/selftests/x86/mpx-mini-test.c +1 −1
  950. tools/testing/selftests/x86/protection_keys.c +31 −10
  951. tools/testing/selftests/x86/unwind_vdso.c +0 −1
  952. virt/kvm/kvm_main.c +2 −1
.clang-format+42−1
@@ -72,6 +72,10 @@ ForEachMacros: · 71 unmodified lines
7272 - 'apei_estatus_for_each_section'
7373 - 'ata_for_each_dev'
7474 - 'ata_for_each_link'
75+ - '__ata_qc_for_each'
76+ - 'ata_qc_for_each'
77+ - 'ata_qc_for_each_raw'
78+ - 'ata_qc_for_each_with_internal'
7579 - 'ax25_for_each'
7680 - 'ax25_uid_for_each'
7781 - 'bio_for_each_integrity_vec'
@@ -85,6 +89,7 @@ ForEachMacros: · 7 unmodified lines
8589 - 'blk_queue_for_each_rl'
8690 - 'bond_for_each_slave'
8791 - 'bond_for_each_slave_rcu'
92+ - 'bpf_for_each_spilled_reg'
8893 - 'btree_for_each_safe128'
8994 - 'btree_for_each_safe32'
9095 - 'btree_for_each_safe64'
@@ -103,6 +108,8 @@ ForEachMacros: · 12 unmodified lines
103108 - 'drm_atomic_crtc_for_each_plane'
104109 - 'drm_atomic_crtc_state_for_each_plane'
105110 - 'drm_atomic_crtc_state_for_each_plane_state'
111+ - 'drm_atomic_for_each_plane_damage'
112+ - 'drm_connector_for_each_possible_encoder'
106113 - 'drm_for_each_connector_iter'
107114 - 'drm_for_each_crtc'
108115 - 'drm_for_each_encoder'
@@ -121,11 +128,21 @@ ForEachMacros: · 12 unmodified lines
121128 - 'for_each_bio'
122129 - 'for_each_board_func_rsrc'
123130 - 'for_each_bvec'
131+ - 'for_each_card_components'
132+ - 'for_each_card_links'
133+ - 'for_each_card_links_safe'
134+ - 'for_each_card_prelinks'
135+ - 'for_each_card_rtds'
136+ - 'for_each_card_rtds_safe'
137+ - 'for_each_cgroup_storage_type'
124138 - 'for_each_child_of_node'
125139 - 'for_each_clear_bit'
126140 - 'for_each_clear_bit_from'
127141 - 'for_each_cmsghdr'
128142 - 'for_each_compatible_node'
143+ - 'for_each_component_dais'
144+ - 'for_each_component_dais_safe'
145+ - 'for_each_comp_order'
129146 - 'for_each_console'
130147 - 'for_each_cpu'
131148 - 'for_each_cpu_and'
@@ -133,6 +150,10 @@ ForEachMacros: · 1 unmodified line
133150 - 'for_each_cpu_wrap'
134151 - 'for_each_dev_addr'
135152 - 'for_each_dma_cap_mask'
153+ - 'for_each_dpcm_be'
154+ - 'for_each_dpcm_be_rollback'
155+ - 'for_each_dpcm_be_safe'
156+ - 'for_each_dpcm_fe'
136157 - 'for_each_drhd_unit'
137158 - 'for_each_dss_dev'
138159 - 'for_each_efi_memory_desc'
@@ -149,6 +170,7 @@ ForEachMacros: · 10 unmodified lines
149170 - 'for_each_iommu'
150171 - 'for_each_ip_tunnel_rcu'
151172 - 'for_each_irq_nr'
173+ - 'for_each_link_codecs'
152174 - 'for_each_lru'
153175 - 'for_each_matching_node'
154176 - 'for_each_matching_node_and_match'
@@ -160,6 +182,7 @@ ForEachMacros: · 5 unmodified lines
160182 - 'for_each_mem_range_rev'
161183 - 'for_each_migratetype_order'
162184 - 'for_each_msi_entry'
185+ - 'for_each_msi_entry_safe'
163186 - 'for_each_net'
164187 - 'for_each_netdev'
165188 - 'for_each_netdev_continue'
@@ -183,12 +206,14 @@ ForEachMacros: · 17 unmodified lines
183206 - 'for_each_node_with_property'
184207 - 'for_each_of_allnodes'
185208 - 'for_each_of_allnodes_from'
209+ - 'for_each_of_cpu_node'
186210 - 'for_each_of_pci_range'
187211 - 'for_each_old_connector_in_state'
188212 - 'for_each_old_crtc_in_state'
189213 - 'for_each_oldnew_connector_in_state'
190214 - 'for_each_oldnew_crtc_in_state'
191215 - 'for_each_oldnew_plane_in_state'
216+ - 'for_each_oldnew_plane_in_state_reverse'
192217 - 'for_each_oldnew_private_obj_in_state'
193218 - 'for_each_old_plane_in_state'
194219 - 'for_each_old_private_obj_in_state'
@@ -206,14 +231,17 @@ ForEachMacros: · 11 unmodified lines
206231 - 'for_each_process'
207232 - 'for_each_process_thread'
208233 - 'for_each_property_of_node'
234+ - 'for_each_registered_fb'
209235 - 'for_each_reserved_mem_region'
210− - 'for_each_resv_unavail_range'
236+ - 'for_each_rtd_codec_dai'
237+ - 'for_each_rtd_codec_dai_rollback'
211238 - 'for_each_rtdcom'
212239 - 'for_each_rtdcom_safe'
213240 - 'for_each_set_bit'
214241 - 'for_each_set_bit_from'
215242 - 'for_each_sg'
216243 - 'for_each_sg_page'
244+ - 'for_each_sibling_event'
217245 - '__for_each_thread'
218246 - 'for_each_thread'
219247 - 'for_each_zone'
@@ -251,6 +279,8 @@ ForEachMacros: · 31 unmodified lines
251279 - 'hlist_nulls_for_each_entry_from'
252280 - 'hlist_nulls_for_each_entry_rcu'
253281 - 'hlist_nulls_for_each_entry_safe'
282+ - 'i3c_bus_for_each_i2cdev'
283+ - 'i3c_bus_for_each_i3cdev'
254284 - 'ide_host_for_each_port'
255285 - 'ide_port_for_each_dev'
256286 - 'ide_port_for_each_present_dev'
@@ -267,11 +297,14 @@ ForEachMacros: · 10 unmodified lines
267297 - 'kvm_for_each_memslot'
268298 - 'kvm_for_each_vcpu'
269299 - 'list_for_each'
300+ - 'list_for_each_codec'
301+ - 'list_for_each_codec_safe'
270302 - 'list_for_each_entry'
271303 - 'list_for_each_entry_continue'
272304 - 'list_for_each_entry_continue_rcu'
273305 - 'list_for_each_entry_continue_reverse'
274306 - 'list_for_each_entry_from'
307+ - 'list_for_each_entry_from_rcu'
275308 - 'list_for_each_entry_from_reverse'
276309 - 'list_for_each_entry_lockless'
277310 - 'list_for_each_entry_rcu'
@@ -291,6 +324,7 @@ ForEachMacros: · 13 unmodified lines
291324 - 'media_device_for_each_intf'
292325 - 'media_device_for_each_link'
293326 - 'media_device_for_each_pad'
327+ - 'nanddev_io_for_each_page'
294328 - 'netdev_for_each_lower_dev'
295329 - 'netdev_for_each_lower_private'
296330 - 'netdev_for_each_lower_private_rcu'
@@ -357,12 +391,14 @@ ForEachMacros: · 60 unmodified lines
357391 - 'sk_nulls_for_each'
358392 - 'sk_nulls_for_each_from'
359393 - 'sk_nulls_for_each_rcu'
394+ - 'snd_array_for_each'
360395 - 'snd_pcm_group_for_each_entry'
361396 - 'snd_soc_dapm_widget_for_each_path'
362397 - 'snd_soc_dapm_widget_for_each_path_safe'
363398 - 'snd_soc_dapm_widget_for_each_sink_path'
364399 - 'snd_soc_dapm_widget_for_each_source_path'
365400 - 'tb_property_for_each'
401+ - 'tcf_exts_for_each_action'
366402 - 'udp_portaddr_for_each_entry'
367403 - 'udp_portaddr_for_each_entry_rcu'
368404 - 'usb_hub_for_each_child'
@@ -371,6 +407,11 @@ ForEachMacros: · 2 unmodified lines
371407 - 'v4l2_m2m_for_each_dst_buf_safe'
372408 - 'v4l2_m2m_for_each_src_buf'
373409 - 'v4l2_m2m_for_each_src_buf_safe'
410+ - 'virtio_device_for_each_vq'
411+ - 'xa_for_each'
412+ - 'xas_for_each'
413+ - 'xas_for_each_conflict'
414+ - 'xas_for_each_marked'
374415 - 'zorro_for_each_dev'
375416
376417 #IncludeBlocks: Preserve # Unknown to clang-format-5.0
Documentation/ABI/stable/sysfs-driver-mlxreg-io+3−3
@@ -24,7 +24,7 @@ What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/ · 23 unmodified lines
2424 cpld3_version
2525
2626 Date: November 2018
27−KernelVersion: 4.21
27+KernelVersion: 5.0
2828 Contact: Vadim Pasternak <vadimpmellanox.com>
2929 Description: These files show with which CPLD versions have been burned
3030 on LED board.
@@ -35,7 +35,7 @@ What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/ · 4 unmodified lines
3535 jtag_enable
3636
3737 Date: November 2018
38−KernelVersion: 4.21
38+KernelVersion: 5.0
3939 Contact: Vadim Pasternak <vadimpmellanox.com>
4040 Description: These files enable and disable the access to the JTAG domain.
4141 By default access to the JTAG domain is disabled.
@@ -105,7 +105,7 @@ What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/ · 63 unmodified lines
105105 reset_voltmon_upgrade_fail
106106
107107 Date: November 2018
108−KernelVersion: 4.21
108+KernelVersion: 5.0
109109 Contact: Vadim Pasternak <vadimpmellanox.com>
110110 Description: These files show the system reset cause, as following: ComEx
111111 power fail, reset from ComEx, system platform reset, reset
Documentation/bpf/bpf_design_QA.rst+5−6
@@ -157,12 +157,11 @@ Q: Does BPF have a stable ABI? · 156 unmodified lines
157157 ------------------------------
158158 A: YES. BPF instructions, arguments to BPF programs, set of helper
159159 functions and their arguments, recognized return codes are all part
160−of ABI. However when tracing programs are using bpf_probe_read() helper
161−to walk kernel internal datastructures and compile with kernel
162−internal headers these accesses can and will break with newer
163−kernels. The union bpf_attr -> kern_version is checked at load time
164−to prevent accidentally loading kprobe-based bpf programs written
165−for a different kernel. Networking programs don't do kern_version check.
160+of ABI. However there is one specific exception to tracing programs
161+which are using helpers like bpf_probe_read() to walk kernel internal
162+data structures and compile with kernel internal headers. Both of these
163+kernel internals are subject to change and can break with newer kernels
164+such that the program needs to be adapted accordingly.
166165
167166 Q: How much stack space a BPF program uses?
168167 -------------------------------------------
Documentation/core-api/xarray.rst+9−6
@@ -108,12 +108,13 @@ some, but not all of the other indices changing. · 107 unmodified lines
108108
109109 Sometimes you need to ensure that a subsequent call to :c:func:`xa_store`
110110 will not need to allocate memory. The :c:func:`xa_reserve` function
111−will store a reserved entry at the indicated index. Users of the normal
112−API will see this entry as containing ``NULL``. If you do not need to
113−use the reserved entry, you can call :c:func:`xa_release` to remove the
114−unused entry. If another user has stored to the entry in the meantime,
115−:c:func:`xa_release` will do nothing; if instead you want the entry to
116−become ``NULL``, you should use :c:func:`xa_erase`.
111+will store a reserved entry at the indicated index. Users of the
112+normal API will see this entry as containing ``NULL``. If you do
113+not need to use the reserved entry, you can call :c:func:`xa_release`
114+to remove the unused entry. If another user has stored to the entry
115+in the meantime, :c:func:`xa_release` will do nothing; if instead you
116+want the entry to become ``NULL``, you should use :c:func:`xa_erase`.
117+Using :c:func:`xa_insert` on a reserved entry will fail.
117118
118119 If all entries in the array are ``NULL``, the :c:func:`xa_empty` function
119120 will return ``true``.
@@ -183,6 +184,8 @@ Takes xa_lock internally: · 63 unmodified lines
183184 * :c:func:`xa_store_bh`
184185 * :c:func:`xa_store_irq`
185186 * :c:func:`xa_insert`
187+ * :c:func:`xa_insert_bh`
188+ * :c:func:`xa_insert_irq`
186189 * :c:func:`xa_erase`
187190 * :c:func:`xa_erase_bh`
188191 * :c:func:`xa_erase_irq`
Documentation/devicetree/bindings/Makefile+5−1
@@ -17,7 +17,11 @@ extra-y += $(DT_TMP_SCHEMA) · 16 unmodified lines
1717 quiet_cmd_mk_schema = SCHEMA $@
1818 cmd_mk_schema = $(DT_MK_SCHEMA) $(DT_MK_SCHEMA_FLAGS) -o $@ $(filter-out FORCE, $^)
1919
20−DT_DOCS = $(shell cd $(srctree)/$(src) && find * -name '*.yaml')
20+DT_DOCS = $(shell \
21+ cd $(srctree)/$(src) && \
22+ find * \( -name '*.yaml' ! -name $(DT_TMP_SCHEMA) \) \
23+ )
24+
2125 DT_SCHEMA_FILES ?= $(addprefix $(src)/,$(DT_DOCS))
2226
2327 extra-y += $(patsubst $(src)/%.yaml,%.example.dts, $(DT_SCHEMA_FILES))
Documentation/devicetree/bindings/arm/cpu-capacity.txt+1−1
@@ -235,4 +235,4 @@ cpus { · 234 unmodified lines
235235 ===========================================
236236
237237 [1] ARM Linux Kernel documentation - CPUs bindings
238− Documentation/devicetree/bindings/arm/cpus.txt
238+ Documentation/devicetree/bindings/arm/cpus.yaml
Documentation/devicetree/bindings/arm/idle-states.txt+1−1
@@ -684,7 +684,7 @@ cpus { · 683 unmodified lines
684684 ===========================================
685685
686686 [1] ARM Linux Kernel documentation - CPUs bindings
687− Documentation/devicetree/bindings/arm/cpus.txt
687+ Documentation/devicetree/bindings/arm/cpus.yaml
688688
689689 [2] ARM Linux Kernel documentation - PSCI bindings
690690 Documentation/devicetree/bindings/arm/psci.txt
Documentation/devicetree/bindings/arm/sp810.txt+1−1
@@ -4,7 +4,7 @@ SP810 System Controller · 3 unmodified lines
44 Required properties:
55
66 - compatible: standard compatible string for a Primecell peripheral,
7− see Documentation/devicetree/bindings/arm/primecell.txt
7+ see Documentation/devicetree/bindings/arm/primecell.yaml
88 for more details
99 should be: "arm,sp810", "arm,primecell"
1010
Documentation/devicetree/bindings/arm/topology.txt+1−1
@@ -472,4 +472,4 @@ cpus { · 471 unmodified lines
472472
473473 ===============================================================================
474474 [1] ARM Linux kernel documentation
475− Documentation/devicetree/bindings/arm/cpus.txt
475+ Documentation/devicetree/bindings/arm/cpus.yaml
Documentation/devicetree/bindings/clock/marvell,mmp2.txt+1−1
@@ -18,4 +18,4 @@ Required Properties: · 17 unmodified lines
1818 Each clock is assigned an identifier and client nodes use this identifier
1919 to specify the clock which they consume.
2020
21−All these identifier could be found in <dt-bindings/clock/marvell-mmp2.h>.
21+All these identifiers could be found in <dt-bindings/clock/marvell,mmp2.h>.
Documentation/devicetree/bindings/display/arm,pl11x.txt+1−1
@@ -1,6 +1,6 @@
11 * ARM PrimeCell Color LCD Controller PL110/PL111
22
3−See also Documentation/devicetree/bindings/arm/primecell.txt
3+See also Documentation/devicetree/bindings/arm/primecell.yaml
44
55 Required properties:
66
Documentation/devicetree/bindings/display/msm/gpu.txt+0−1
@@ -27,7 +27,6 @@ Example: · 26 unmodified lines
2727 reg = <0x04300000 0x20000>;
2828 reg-names = "kgsl_3d0_reg_memory";
2929 interrupts = <GIC_SPI 80 0>;
30− interrupt-names = "kgsl_3d0_irq";
3130 clock-names =
3231 "core",
3332 "iface",
Documentation/devicetree/bindings/gpio/gpio-mvebu.txt+0−2
@@ -14,8 +14,6 @@ Required properties: · 13 unmodified lines
1414
1515 "marvell,armada-8k-gpio" should be used for the Armada 7K and 8K
1616 SoCs (either from AP or CP), see
17− Documentation/devicetree/bindings/arm/marvell/cp110-system-controller0.txt
18− and
1917 Documentation/devicetree/bindings/arm/marvell/ap806-system-controller.txt
2018 for specific details about the offset property.
2119
Documentation/devicetree/bindings/interrupt-controller/arm,gic-v3.txt+1−1
@@ -78,7 +78,7 @@ Sub-nodes: · 77 unmodified lines
7878 PPI affinity can be expressed as a single "ppi-partitions" node,
7979 containing a set of sub-nodes, each with the following property:
8080 - affinity: Should be a list of phandles to CPU nodes (as described in
81−Documentation/devicetree/bindings/arm/cpus.txt).
81+ Documentation/devicetree/bindings/arm/cpus.yaml).
8282
8383 GICv3 has one or more Interrupt Translation Services (ITS) that are
8484 used to route Message Signalled Interrupts (MSI) to the CPUs.
Documentation/devicetree/bindings/serio/olpc,ap-sp.txt+0−4
@@ -4,14 +4,10 @@ Required properties: · 3 unmodified lines
44 - compatible : "olpc,ap-sp"
55 - reg : base address and length of SoC's WTM registers
66 - interrupts : SP-AP interrupt
7−- clocks : phandle + clock-specifier for the clock that drives the WTM
8−- clock-names: should be "sp"
97
108 Example:
119 ap-sp@d4290000 {
1210 compatible = "olpc,ap-sp";
1311 reg = <0xd4290000 0x1000>;
1412 interrupts = <40>;
15− clocks = <&soc_clocks MMP2_CLK_SP>;
16− clock-names = "sp";
1713 }
Documentation/devicetree/bindings/soc/qcom/qcom,glink.txt+1−1
@@ -55,7 +55,7 @@ of these nodes are defined by the individual bindings for the specific function · 54 unmodified lines
5555 = EXAMPLE
5656 The following example represents the GLINK RPM node on a MSM8996 device, with
5757 the function for the "rpm_request" channel defined, which is used for
58−regualtors and root clocks.
58+regulators and root clocks.
5959
6060 apcs_glb: mailbox@9820000 {
6161 compatible = "qcom,msm8996-apcs-hmss-global";
Documentation/devicetree/bindings/soc/qcom/qcom,smp2p.txt+2−2
@@ -41,12 +41,12 @@ processor ID) and a string identifier. · 40 unmodified lines
4141 - qcom,local-pid:
4242 Usage: required
4343 Value type: <u32>
44− Definition: specifies the identfier of the local endpoint of this edge
44+ Definition: specifies the identifier of the local endpoint of this edge
4545
4646 - qcom,remote-pid:
4747 Usage: required
4848 Value type: <u32>
49− Definition: specifies the identfier of the remote endpoint of this edge
49+ Definition: specifies the identifier of the remote endpoint of this edge
5050
5151 = SUBNODES
5252 Each SMP2P pair contain a set of inbound and outbound entries, these are
Documentation/fb/fbcon.txt+8−0
@@ -163,6 +163,14 @@ C. Boot options · 162 unmodified lines
163163 be preserved until there actually is some text is output to the console.
164164 This option causes fbcon to bind immediately to the fbdev device.
165165
166+7. fbcon=logo-pos:<location>
167+
168+ The only possible 'location' is 'center' (without quotes), and when
169+ given, the bootup logo is moved from the default top-left corner
170+ location to the center of the framebuffer. If more than one logo is
171+ displayed due to multiple CPUs, the collected line of logos is moved
172+ as a whole.
173+
166174 C. Attaching, Detaching and Unloading
167175
168176 Before going on to how to attach, detach and unload the framebuffer console, an
Documentation/networking/index.rst+13−13
@@ -11,19 +11,19 @@ Contents: · 10 unmodified lines
1111 batman-adv
1212 can
1313 can_ucan_protocol
14− dpaa2/index
15− e100
16− e1000
17− e1000e
18− fm10k
19− igb
20− igbvf
21− ixgb
22− ixgbe
23− ixgbevf
24− i40e
25− iavf
26− ice
14+ device_drivers/freescale/dpaa2/index
15+ device_drivers/intel/e100
16+ device_drivers/intel/e1000
17+ device_drivers/intel/e1000e
18+ device_drivers/intel/fm10k
19+ device_drivers/intel/igb
20+ device_drivers/intel/igbvf
21+ device_drivers/intel/ixgb
22+ device_drivers/intel/ixgbe
23+ device_drivers/intel/ixgbevf
24+ device_drivers/intel/i40e
25+ device_drivers/intel/iavf
26+ device_drivers/intel/ice
2727 kapi
2828 z8530book
2929 msg_zerocopy
Documentation/networking/rxrpc.txt+0−45
@@ -1000,51 +1000,6 @@ The kernel interface functions are as follows: · 999 unmodified lines
10001000 size should be set when the call is begun. tx_total_len may not be less
10011001 than zero.
10021002
1003− (*) Check to see the completion state of a call so that the caller can assess
1004− whether it needs to be retried.
1005−
1006− enum rxrpc_call_completion {
1007− RXRPC_CALL_SUCCEEDED,
1008− RXRPC_CALL_REMOTELY_ABORTED,
1009− RXRPC_CALL_LOCALLY_ABORTED,
1010− RXRPC_CALL_LOCAL_ERROR,
1011− RXRPC_CALL_NETWORK_ERROR,
1012− };
1013−
1014− int rxrpc_kernel_check_call(struct socket *sock, struct rxrpc_call *call,
1015− enum rxrpc_call_completion *_compl,
1016− u32 *_abort_code);
1017−
1018− On return, -EINPROGRESS will be returned if the call is still ongoing; if
1019− it is finished, *_compl will be set to indicate the manner of completion,
1020− *_abort_code will be set to any abort code that occurred. 0 will be
1021− returned on a successful completion, -ECONNABORTED will be returned if the
1022− client failed due to a remote abort and anything else will return an
1023− appropriate error code.
1024−
1025− The caller should look at this information to decide if it's worth
1026− retrying the call.
1027−
1028− (*) Retry a client call.
1029−
1030− int rxrpc_kernel_retry_call(struct socket *sock,
1031− struct rxrpc_call *call,
1032− struct sockaddr_rxrpc *srx,
1033− struct key *key);
1034−
1035− This attempts to partially reinitialise a call and submit it again while
1036− reusing the original call's Tx queue to avoid the need to repackage and
1037− re-encrypt the data to be sent. call indicates the call to retry, srx the
1038− new address to send it to and key the encryption key to use for signing or
1039− encrypting the packets.
1040−
1041− For this to work, the first Tx data packet must still be in the transmit
1042− queue, and currently this is only permitted for local and network errors
1043− and the call must not have been aborted. Any partially constructed Tx
1044− packet is left as is and can continue being filled afterwards.
1045−
1046− It returns 0 if the call was requeued and an error otherwise.
1047−
10481003 (*) Get call RTT.
10491004
10501005 u64 rxrpc_kernel_get_rtt(struct socket *sock, struct rxrpc_call *call);
Documentation/networking/snmp_counter.rst+125−5
@@ -336,7 +336,26 @@ time client replies ACK, this socket will get another chance to move · 335 unmodified lines
336336 to the accept queue.
337337
338338
339−TCP Fast Open
339+* TcpEstabResets
340+Defined in `RFC1213 tcpEstabResets`_.
341+
342+.. _RFC1213 tcpEstabResets: https://tools.ietf.org/html/rfc1213#page-48
343+
344+* TcpAttemptFails
345+Defined in `RFC1213 tcpAttemptFails`_.
346+
347+.. _RFC1213 tcpAttemptFails: https://tools.ietf.org/html/rfc1213#page-48
348+
349+* TcpOutRsts
350+Defined in `RFC1213 tcpOutRsts`_. The RFC says this counter indicates
351+the 'segments sent containing the RST flag', but in linux kernel, this
352+couner indicates the segments kerenl tried to send. The sending
353+process might be failed due to some errors (e.g. memory alloc failed).
354+
355+.. _RFC1213 tcpOutRsts: https://tools.ietf.org/html/rfc1213#page-52
356+
357+
358+TCP Fast Path
340359 ============
341360 When kernel receives a TCP packet, it has two paths to handler the
342361 packet, one is fast path, another is slow path. The comment in kernel
@@ -383,8 +402,6 @@ increase 1. · 40 unmodified lines
383402
384403 TCP abort
385404 ========
386−
387−
388405 * TcpExtTCPAbortOnData
389406 It means TCP layer has data in flight, but need to close the
390407 connection. So TCP layer sends a RST to the other side, indicate the
@@ -545,7 +562,6 @@ packet yet, the sender would know packet 4 is out of order. The TCP · 154 unmodified lines
545562 stack of kernel will increase TcpExtTCPSACKReorder for both of the
546563 above scenarios.
547564
548−
549565 DSACK
550566 =====
551567 The DSACK is defined in `RFC2883`_. The receiver uses DSACK to report
@@ -566,13 +582,63 @@ The TCP stack receives an out of order duplicate packet, so it sends a · 14 unmodified lines
566582 DSACK to the sender.
567583
568584 * TcpExtTCPDSACKRecv
569−The TCP stack receives a DSACK, which indicate an acknowledged
585+The TCP stack receives a DSACK, which indicates an acknowledged
570586 duplicate packet is received.
571587
572588 * TcpExtTCPDSACKOfoRecv
573589 The TCP stack receives a DSACK, which indicate an out of order
574590 duplicate packet is received.
575591
592+invalid SACK and DSACK
593+====================
594+When a SACK (or DSACK) block is invalid, a corresponding counter would
595+be updated. The validation method is base on the start/end sequence
596+number of the SACK block. For more details, please refer the comment
597+of the function tcp_is_sackblock_valid in the kernel source code. A
598+SACK option could have up to 4 blocks, they are checked
599+individually. E.g., if 3 blocks of a SACk is invalid, the
600+corresponding counter would be updated 3 times. The comment of the
601+`Add counters for discarded SACK blocks`_ patch has additional
602+explaination:
603+
604+.. _Add counters for discarded SACK blocks: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=18f02545a9a16c9a89778b91a162ad16d510bb32
605+
606+* TcpExtTCPSACKDiscard
607+This counter indicates how many SACK blocks are invalid. If the invalid
608+SACK block is caused by ACK recording, the TCP stack will only ignore
609+it and won't update this counter.
610+
611+* TcpExtTCPDSACKIgnoredOld and TcpExtTCPDSACKIgnoredNoUndo
612+When a DSACK block is invalid, one of these two counters would be
613+updated. Which counter will be updated depends on the undo_marker flag
614+of the TCP socket. If the undo_marker is not set, the TCP stack isn't
615+likely to re-transmit any packets, and we still receive an invalid
616+DSACK block, the reason might be that the packet is duplicated in the
617+middle of the network. In such scenario, TcpExtTCPDSACKIgnoredNoUndo
618+will be updated. If the undo_marker is set, TcpExtTCPDSACKIgnoredOld
619+will be updated. As implied in its name, it might be an old packet.
620+
621+SACK shift
622+=========
623+The linux networking stack stores data in sk_buff struct (skb for
624+short). If a SACK block acrosses multiple skb, the TCP stack will try
625+to re-arrange data in these skb. E.g. if a SACK block acknowledges seq
626+10 to 15, skb1 has seq 10 to 13, skb2 has seq 14 to 20. The seq 14 and
627+15 in skb2 would be moved to skb1. This operation is 'shift'. If a
628+SACK block acknowledges seq 10 to 20, skb1 has seq 10 to 13, skb2 has
629+seq 14 to 20. All data in skb2 will be moved to skb1, and skb2 will be
630+discard, this operation is 'merge'.
631+
632+* TcpExtTCPSackShifted
633+A skb is shifted
634+
635+* TcpExtTCPSackMerged
636+A skb is merged
637+
638+* TcpExtTCPSackShiftFallback
639+A skb should be shifted or merged, but the TCP stack doesn't do it for
640+some reasons.
641+
576642 TCP out of order
577643 ===============
578644 * TcpExtTCPOFOQueue
@@ -662,6 +728,60 @@ unacknowledged number (more strict than `RFC 5961 section 5.2`_). · 83 unmodified lines
662728 .. _RFC 5961 section 4.2: https://tools.ietf.org/html/rfc5961#page-9
663729 .. _RFC 5961 section 5.2: https://tools.ietf.org/html/rfc5961#page-11
664730
731+TCP receive window
732+=================
733+* TcpExtTCPWantZeroWindowAdv
734+Depending on current memory usage, the TCP stack tries to set receive
735+window to zero. But the receive window might still be a no-zero
736+value. For example, if the previous window size is 10, and the TCP
737+stack receives 3 bytes, the current window size would be 7 even if the
738+window size calculated by the memory usage is zero.
739+
740+* TcpExtTCPToZeroWindowAdv
741+The TCP receive window is set to zero from a no-zero value.
742+
743+* TcpExtTCPFromZeroWindowAdv
744+The TCP receive window is set to no-zero value from zero.
745+
746+
747+Delayed ACK
748+==========
749+The TCP Delayed ACK is a technique which is used for reducing the
750+packet count in the network. For more details, please refer the
751+`Delayed ACK wiki`_
752+
753+.. _Delayed ACK wiki: https://en.wikipedia.org/wiki/TCP_delayed_acknowledgment
754+
755+* TcpExtDelayedACKs
756+A delayed ACK timer expires. The TCP stack will send a pure ACK packet
757+and exit the delayed ACK mode.
758+
759+* TcpExtDelayedACKLocked
760+A delayed ACK timer expires, but the TCP stack can't send an ACK
761+immediately due to the socket is locked by a userspace program. The
762+TCP stack will send a pure ACK later (after the userspace program
763+unlock the socket). When the TCP stack sends the pure ACK later, the
764+TCP stack will also update TcpExtDelayedACKs and exit the delayed ACK
765+mode.
766+
767+* TcpExtDelayedACKLost
768+It will be updated when the TCP stack receives a packet which has been
769+ACKed. A Delayed ACK loss might cause this issue, but it would also be
770+triggered by other reasons, such as a packet is duplicated in the
771+network.
772+
773+Tail Loss Probe (TLP)
774+===================
775+TLP is an algorithm which is used to detect TCP packet loss. For more
776+details, please refer the `TLP paper`_.
777+
778+.. _TLP paper: https://tools.ietf.org/html/draft-dukkipati-tcpm-tcp-loss-probe-01
779+
780+* TcpExtTCPLossProbes
781+A TLP probe packet is sent.
782+
783+* TcpExtTCPLossProbeRecovery
784+A packet loss is detected and recovered by TLP.
665785
666786 examples
667787 =======
Documentation/networking/timestamping.txt+2−2
@@ -417,7 +417,7 @@ is again deprecated and ts[2] holds a hardware timestamp if set. · 416 unmodified lines
417417
418418 Hardware time stamping must also be initialized for each device driver
419419 that is expected to do hardware time stamping. The parameter is defined in
420−/include/linux/net_tstamp.h as:
420+include/uapi/linux/net_tstamp.h as:
421421
422422 struct hwtstamp_config {
423423 int flags; /* no flags defined right now, must be zero */
@@ -487,7 +487,7 @@ enum { · 63 unmodified lines
487487 HWTSTAMP_FILTER_PTP_V1_L4_EVENT,
488488
489489 /* for the complete list of values, please check
490− * the include file /include/linux/net_tstamp.h
490+ * the include file include/uapi/linux/net_tstamp.h
491491 */
492492 };
493493
Documentation/sysctl/fs.txt+16−10
@@ -56,26 +56,32 @@ of any kernel data structures. · 55 unmodified lines
5656
5757 dentry-state:
5858
59−From linux/fs/dentry.c:
59+From linux/include/linux/dcache.h:
6060 --------------------------------------------------------------
61−struct {
61+struct dentry_stat_t dentry_stat {
6262 int nr_dentry;
6363 int nr_unused;
6464 int age_limit; /* age in seconds */
6565 int want_pages; /* pages requested by system */
66− int dummy[2];
67−} dentry_stat = {0, 0, 45, 0,};
68−--------------------------------------------------------------
69−
70−Dentries are dynamically allocated and deallocated, and
71−nr_dentry seems to be 0 all the time. Hence it's safe to
72−assume that only nr_unused, age_limit and want_pages are
73−used. Nr_unused seems to be exactly what its name says.
66+ int nr_negative; /* # of unused negative dentries */
67+ int dummy; /* Reserved for future use */
68+};
69+--------------------------------------------------------------
70+
71+Dentries are dynamically allocated and deallocated.
72+
73+nr_dentry shows the total number of dentries allocated (active
74++ unused). nr_unused shows the number of dentries that are not
75+actively used, but are saved in the LRU list for future reuse.
76+
7477 Age_limit is the age in seconds after which dcache entries
7578 can be reclaimed when memory is short and want_pages is
7679 nonzero when shrink_dcache_pages() has been called and the
7780 dcache isn't pruned yet.
7881
82+nr_negative shows the number of unused dentries that are also
83+negative dentries which do not mapped to actual files.
84+
7985 ==============================================================
8086
8187 dquot-max & dquot-nr:
Documentation/x86/resctrl_ui.txt+1−1
@@ -9,7 +9,7 @@ Fenghua Yu <fenghua.yu@intel.com> · 8 unmodified lines
99 Tony Luck <tony.luck@intel.com>
1010 Vikas Shivappa <vikas.shivappa@intel.com>
1111
12−This feature is enabled by the CONFIG_X86_RESCTRL and the x86 /proc/cpuinfo
12+This feature is enabled by the CONFIG_X86_CPU_RESCTRL and the x86 /proc/cpuinfo
1313 flag bits:
1414 RDT (Resource Director Technology) Allocation - "rdt_a"
1515 CAT (Cache Allocation Technology) - "cat_l3", "cat_l2"
MAINTAINERS+54−25
@@ -3052,8 +3052,8 @@ F: include/linux/bcm963xx_nvram.h · 3051 unmodified lines
30523052 F: include/linux/bcm963xx_tag.h
30533053
30543054 BROADCOM BNX2 GIGABIT ETHERNET DRIVER
3055−M: Rasesh Mody <rasesh.mody@cavium.com>
3056−M: Dept-GELinuxNICDev@cavium.com
3055+M: Rasesh Mody <rmody@marvell.com>
3056+M: GR-Linux-NIC-Dev@marvell.com
30573057 L: netdev@vger.kernel.org
30583058 S: Supported
30593059 F: drivers/net/ethernet/broadcom/bnx2.*
@@ -3072,9 +3072,9 @@ S: Supported · 12 unmodified lines
30723072 F: drivers/scsi/bnx2i/
30733073
30743074 BROADCOM BNX2X 10 GIGABIT ETHERNET DRIVER
3075−M: Ariel Elior <ariel.elior@cavium.com>
3076−M: Sudarsana Kalluru <sudarsana.kalluru@cavium.com>
3077−M: everest-linux-l2@cavium.com
3075+M: Ariel Elior <aelior@marvell.com>
3076+M: Sudarsana Kalluru <skalluru@marvell.com>
3077+M: GR-everest-linux-l2@marvell.com
30783078 L: netdev@vger.kernel.org
30793079 S: Supported
30803080 F: drivers/net/ethernet/broadcom/bnx2x/
@@ -3249,9 +3249,9 @@ S: Supported · 168 unmodified lines
32493249 F: drivers/scsi/bfa/
32503250
32513251 BROCADE BNA 10 GIGABIT ETHERNET DRIVER
3252−M: Rasesh Mody <rasesh.mody@cavium.com>
3253−M: Sudarsana Kalluru <sudarsana.kalluru@cavium.com>
3254−M: Dept-GELinuxNICDev@cavium.com
3252+M: Rasesh Mody <rmody@marvell.com>
3253+M: Sudarsana Kalluru <skalluru@marvell.com>
3254+M: GR-Linux-NIC-Dev@marvell.com
32553255 L: netdev@vger.kernel.org
32563256 S: Supported
32573257 F: drivers/net/ethernet/brocade/bna/
@@ -3471,10 +3471,9 @@ F: drivers/i2c/busses/i2c-octeon* · 213 unmodified lines
34713471 F: drivers/i2c/busses/i2c-thunderx*
34723472
34733473 CAVIUM LIQUIDIO NETWORK DRIVER
3474−M: Derek Chickles <derek.chickles@caviumnetworks.com>
3475−M: Satanand Burla <satananda.burla@caviumnetworks.com>
3476−M: Felix Manlunas <felix.manlunas@caviumnetworks.com>
3477−M: Raghu Vatsavayi <raghu.vatsavayi@caviumnetworks.com>
3474+M: Derek Chickles <dchickles@marvell.com>
3475+M: Satanand Burla <sburla@marvell.com>
3476+M: Felix Manlunas <fmanlunas@marvell.com>
34783477 L: netdev@vger.kernel.org
34793478 W: http://www.cavium.com
34803479 S: Supported
@@ -3979,6 +3978,7 @@ F: drivers/cpufreq/arm_big_little.c · 498 unmodified lines
39793978 CPU POWER MONITORING SUBSYSTEM
39803979 M: Thomas Renninger <trenn@suse.com>
39813980 M: Shuah Khan <shuah@kernel.org>
3981+M: Shuah Khan <skhan@linuxfoundation.org>
39823982 L: linux-pm@vger.kernel.org
39833983 S: Maintained
39843984 F: tools/power/cpupower/
@@ -8259,6 +8259,7 @@ F: include/uapi/linux/sunrpc/ · 4274 unmodified lines
82598259
82608260 KERNEL SELFTEST FRAMEWORK
82618261 M: Shuah Khan <shuah@kernel.org>
8262+M: Shuah Khan <skhan@linuxfoundation.org>
82628263 L: linux-kselftest@vger.kernel.org
82638264 T: git git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git
82648265 Q: https://patchwork.kernel.org/project/linux-kselftest/list/
@@ -10689,9 +10690,9 @@ S: Maintained · 2424 unmodified lines
1068910690 F: drivers/net/netdevsim/*
1069010691
1069110692 NETXEN (1/10) GbE SUPPORT
10692−M: Manish Chopra <manish.chopra@cavium.com>
10693−M: Rahul Verma <rahul.verma@cavium.com>
10694−M: Dept-GELinuxNICDev@cavium.com
10693+M: Manish Chopra <manishc@marvell.com>
10694+M: Rahul Verma <rahulv@marvell.com>
10695+M: GR-Linux-NIC-Dev@marvell.com
1069510696 L: netdev@vger.kernel.org
1069610697 S: Supported
1069710698 F: drivers/net/ethernet/qlogic/netxen/
@@ -12475,8 +12476,8 @@ S: Supported · 1777 unmodified lines
1247512476 F: drivers/scsi/qedi/
1247612477
1247712478 QLOGIC QL4xxx ETHERNET DRIVER
12478−M: Ariel Elior <Ariel.Elior@cavium.com>
12479−M: everest-linux-l2@cavium.com
12479+M: Ariel Elior <aelior@marvell.com>
12480+M: GR-everest-linux-l2@marvell.com
1248012481 L: netdev@vger.kernel.org
1248112482 S: Supported
1248212483 F: drivers/net/ethernet/qlogic/qed/
@@ -12484,8 +12485,8 @@ F: include/linux/qed/ · 1 unmodified line
1248412485 F: drivers/net/ethernet/qlogic/qede/
1248512486
1248612487 QLOGIC QL4xxx RDMA DRIVER
12487−M: Michal Kalderon <Michal.Kalderon@cavium.com>
12488−M: Ariel Elior <Ariel.Elior@cavium.com>
12488+M: Michal Kalderon <mkalderon@marvell.com>
12489+M: Ariel Elior <aelior@marvell.com>
1248912490 L: linux-rdma@vger.kernel.org
1249012491 S: Supported
1249112492 F: drivers/infiniband/hw/qedr/
@@ -12505,7 +12506,7 @@ F: Documentation/scsi/LICENSE.qla2xxx · 13 unmodified lines
1250512506 F: drivers/scsi/qla2xxx/
1250612507
1250712508 QLOGIC QLA3XXX NETWORK DRIVER
12508−M: Dept-GELinuxNICDev@cavium.com
12509+M: GR-Linux-NIC-Dev@marvell.com
1250912510 L: netdev@vger.kernel.org
1251012511 S: Supported
1251112512 F: Documentation/networking/device_drivers/qlogic/LICENSE.qla3xxx
@@ -12519,16 +12520,16 @@ F: Documentation/scsi/LICENSE.qla4xxx · 7 unmodified lines
1251912520 F: drivers/scsi/qla4xxx/
1252012521
1252112522 QLOGIC QLCNIC (1/10)Gb ETHERNET DRIVER
12522−M: Shahed Shaikh <Shahed.Shaikh@cavium.com>
12523−M: Manish Chopra <manish.chopra@cavium.com>
12524−M: Dept-GELinuxNICDev@cavium.com
12523+M: Shahed Shaikh <shshaikh@marvell.com>
12524+M: Manish Chopra <manishc@marvell.com>
12525+M: GR-Linux-NIC-Dev@marvell.com
1252512526 L: netdev@vger.kernel.org
1252612527 S: Supported
1252712528 F: drivers/net/ethernet/qlogic/qlcnic/
1252812529
1252912530 QLOGIC QLGE 10Gb ETHERNET DRIVER
12530−M: Manish Chopra <manish.chopra@cavium.com>
12531−M: Dept-GELinuxNICDev@cavium.com
12531+M: Manish Chopra <manishc@marvell.com>
12532+M: GR-Linux-NIC-Dev@marvell.com
1253212533 L: netdev@vger.kernel.org
1253312534 S: Supported
1253412535 F: drivers/net/ethernet/qlogic/qlge/
@@ -15842,6 +15843,7 @@ F: drivers/usb/common/usb-otg-fsm.c · 3307 unmodified lines
1584215843 USB OVER IP DRIVER
1584315844 M: Valentina Manea <valentina.manea.m@gmail.com>
1584415845 M: Shuah Khan <shuah@kernel.org>
15846+M: Shuah Khan <skhan@linuxfoundation.org>
1584515847 L: linux-usb@vger.kernel.org
1584615848 S: Maintained
1584715849 F: Documentation/usb/usbip_protocol.txt
@@ -16639,6 +16641,15 @@ S: Maintained · 791 unmodified lines
1663916641 F: drivers/platform/x86/
1664016642 F: drivers/platform/olpc/
1664116643
16644+X86 PLATFORM DRIVERS - ARCH
16645+R: Darren Hart <dvhart@infradead.org>
16646+R: Andy Shevchenko <andy@infradead.org>
16647+L: platform-driver-x86@vger.kernel.org
16648+L: x86@kernel.org
16649+T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/core
16650+S: Maintained
16651+F: arch/x86/platform
16652+
1664216653 X86 VDSO
1664316654 M: Andy Lutomirski <luto@kernel.org>
1664416655 L: linux-kernel@vger.kernel.org
@@ -16671,6 +16682,24 @@ T: git git://linuxtv.org/media_tree.git · 26 unmodified lines
1667116682 S: Maintained
1667216683 F: drivers/media/tuners/tuner-xc2028.*
1667316684
16685+XDP (eXpress Data Path)
16686+M: Alexei Starovoitov <ast@kernel.org>
16687+M: Daniel Borkmann <daniel@iogearbox.net>
16688+M: David S. Miller <davem@davemloft.net>
16689+M: Jakub Kicinski <jakub.kicinski@netronome.com>
16690+M: Jesper Dangaard Brouer <hawk@kernel.org>
16691+M: John Fastabend <john.fastabend@gmail.com>
16692+L: netdev@vger.kernel.org
16693+L: xdp-newbies@vger.kernel.org
16694+S: Supported
16695+F: net/core/xdp.c
16696+F: include/net/xdp.h
16697+F: kernel/bpf/devmap.c
16698+F: kernel/bpf/cpumap.c
16699+F: include/trace/events/xdp.h
16700+K: xdp
16701+N: xdp
16702+
1667416703 XDP SOCKETS (AF_XDP)
1667516704 M: Björn Töpel <bjorn.topel@intel.com>
1667616705 M: Magnus Karlsson <magnus.karlsson@intel.com>
Makefile+5−5
@@ -2,7 +2,7 @@ · 1 unmodified line
22 VERSION = 5
33 PATCHLEVEL = 0
44 SUBLEVEL = 0
5−EXTRAVERSION = -rc2
5+EXTRAVERSION = -rc5
66 NAME = Shy Crocodile
77
88 # *DOCUMENTATION*
@@ -955,6 +955,7 @@ ifdef CONFIG_STACK_VALIDATION · 946 unmodified lines
955955 endif
956956 endif
957957
958+PHONY += prepare0
958959
959960 ifeq ($(KBUILD_EXTMOD),)
960961 core-y += kernel/ certs/ mm/ fs/ ipc/ security/ crypto/ block/
@@ -1061,8 +1062,7 @@ scripts: scripts_basic scripts_dtc · 100 unmodified lines
10611062 # archprepare is used in arch Makefiles and when processed asm symlink,
10621063 # version.h and scripts_basic is processed / created.
10631064
1064−# Listed in dependency order
1065−PHONY += prepare archprepare prepare0 prepare1 prepare2 prepare3
1065+PHONY += prepare archprepare prepare1 prepare2 prepare3
10661066
10671067 # prepare3 is used to check if we are building in a separate output directory,
10681068 # and if so do:
@@ -1360,11 +1360,11 @@ mrproper: rm-dirs := $(wildcard $(MRPROPER_DIRS)) · 291 unmodified lines
13601360 mrproper: rm-files := $(wildcard $(MRPROPER_FILES))
13611361 mrproper-dirs := $(addprefix _mrproper_,scripts)
13621362
1363−PHONY += $(mrproper-dirs) mrproper archmrproper
1363+PHONY += $(mrproper-dirs) mrproper
13641364 $(mrproper-dirs):
13651365 $(Q)$(MAKE) $(clean)=$(patsubst _mrproper_%,%,$@)
13661366
1367−mrproper: clean archmrproper $(mrproper-dirs)
1367+mrproper: clean $(mrproper-dirs)
13681368 $(call cmd,rmdirs)
13691369 $(call cmd,rmfiles)
13701370
arch/arc/include/asm/Kbuild+0−4
@@ -3,23 +3,19 @@ generic-y += bugs.h · 2 unmodified lines
33 generic-y += compat.h
44 generic-y += device.h
55 generic-y += div64.h
6−generic-y += dma-mapping.h
76 generic-y += emergency-restart.h
87 generic-y += extable.h
9−generic-y += fb.h
108 generic-y += ftrace.h
119 generic-y += hardirq.h
1210 generic-y += hw_irq.h
1311 generic-y += irq_regs.h
1412 generic-y += irq_work.h
15−generic-y += kmap_types.h
1613 generic-y += local.h
1714 generic-y += local64.h
1815 generic-y += mcs_spinlock.h
1916 generic-y += mm-arch-hooks.h
2017 generic-y += msi.h
2118 generic-y += parport.h
22−generic-y += pci.h
2319 generic-y += percpu.h
2420 generic-y += preempt.h
2521 generic-y += topology.h
arch/arc/include/asm/arcregs.h+10−2
@@ -216,6 +216,14 @@ struct bcr_fp_arcv2 { · 215 unmodified lines
216216 #endif
217217 };
218218
219+struct bcr_actionpoint {
220+#ifdef CONFIG_CPU_BIG_ENDIAN
221+ unsigned int pad:21, min:1, num:2, ver:8;
222+#else
223+ unsigned int ver:8, num:2, min:1, pad:21;
224+#endif
225+};
226+
219227 #include <soc/arc/timers.h>
220228
221229 struct bcr_bpu_arcompact {
@@ -283,7 +291,7 @@ struct cpuinfo_arc_cache { · 61 unmodified lines
283291 };
284292
285293 struct cpuinfo_arc_bpu {
286− unsigned int ver, full, num_cache, num_pred;
294+ unsigned int ver, full, num_cache, num_pred, ret_stk;
287295 };
288296
289297 struct cpuinfo_arc_ccm {
@@ -302,7 +310,7 @@ struct cpuinfo_arc { · 12 unmodified lines
302310 struct {
303311 unsigned int swap:1, norm:1, minmax:1, barrel:1, crc:1, swape:1, pad1:2,
304312 fpu_sp:1, fpu_dp:1, dual:1, dual_enb:1, pad2:4,
305− debug:1, ap:1, smart:1, rtt:1, pad3:4,
313+ ap_num:4, ap_full:1, smart:1, rtt:1, pad3:1,
306314 timer0:1, timer1:1, rtc:1, gfrc:1, pad4:4;
307315 } extn;
308316 struct bcr_mpy extn_mpy;
arch/arc/include/asm/bitops.h+3−3
@@ -340,7 +340,7 @@ static inline __attribute__ ((const)) int __fls(unsigned long x) · 339 unmodified lines
340340 /*
341341 * __ffs: Similar to ffs, but zero based (0-31)
342342 */
343−static inline __attribute__ ((const)) int __ffs(unsigned long word)
343+static inline __attribute__ ((const)) unsigned long __ffs(unsigned long word)
344344 {
345345 if (!word)
346346 return word;
@@ -400,9 +400,9 @@ static inline __attribute__ ((const)) int ffs(unsigned long x) · 53 unmodified lines
400400 /*
401401 * __ffs: Similar to ffs, but zero based (0-31)
402402 */
403−static inline __attribute__ ((const)) int __ffs(unsigned long x)
403+static inline __attribute__ ((const)) unsigned long __ffs(unsigned long x)
404404 {
405− int n;
405+ unsigned long n;
406406
407407 asm volatile(
408408 " ffs.f %0, %1 \n" /* 0:31; 31(Z) if src 0 */
arch/arc/include/asm/perf_event.h+2−1
@@ -103,7 +103,8 @@ static const char * const arc_pmu_ev_hw_map[] = { · 102 unmodified lines
103103
104104 /* counts condition */
105105 [PERF_COUNT_HW_INSTRUCTIONS] = "iall",
106− [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = "ijmp", /* Excludes ZOL jumps */
106+ /* All jump instructions that are taken */
107+ [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = "ijmptak",
107108 [PERF_COUNT_ARC_BPOK] = "bpok", /* NP-NT, PT-T, PNT-NT */
108109 #ifdef CONFIG_ISA_ARCV2
109110 [PERF_COUNT_HW_BRANCH_MISSES] = "bpmp",
arch/arc/kernel/perf_event.c+182−59
@@ -1,15 +1,10 @@
1−/*
2− * Linux performance counter support for ARC700 series
3− *
4− * Copyright (C) 2013-2015 Synopsys, Inc. (www.synopsys.com)
5− *
6− * This code is inspired by the perf support of various other architectures.
7− *
8− * This program is free software; you can redistribute it and/or modify
9− * it under the terms of the GNU General Public License version 2 as
10− * published by the Free Software Foundation.
11− *
12− */
1+// SPDX-License-Identifier: GPL-2.0+
2+//
3+// Linux performance counter support for ARC CPUs.
4+// This code is inspired by the perf support of various other architectures.
5+//
6+// Copyright (C) 2013-2018 Synopsys, Inc. (www.synopsys.com)
7+
138 #include <linux/errno.h>
149 #include <linux/interrupt.h>
1510 #include <linux/module.h>
@@ -19,12 +14,31 @@ · 3 unmodified lines
1914 #include <asm/arcregs.h>
2015 #include <asm/stacktrace.h>
2116
17+/* HW holds 8 symbols + one for null terminator */
18+#define ARCPMU_EVENT_NAME_LEN 9
19+
20+enum arc_pmu_attr_groups {
21+ ARCPMU_ATTR_GR_EVENTS,
22+ ARCPMU_ATTR_GR_FORMATS,
23+ ARCPMU_NR_ATTR_GR
24+};
25+
26+struct arc_pmu_raw_event_entry {
27+ char name[ARCPMU_EVENT_NAME_LEN];
28+};
29+
2230 struct arc_pmu {
2331 struct pmu pmu;
2432 unsigned int irq;
2533 int n_counters;
34+ int n_events;
2635 u64 max_period;
2736 int ev_hw_idx[PERF_COUNT_ARC_HW_MAX];
37+
38+ struct arc_pmu_raw_event_entry *raw_entry;
39+ struct attribute **attrs;
40+ struct perf_pmu_events_attr *attr;
41+ const struct attribute_group *attr_groups[ARCPMU_NR_ATTR_GR + 1];
2842 };
2943
3044 struct arc_pmu_cpu {
@@ -49,6 +63,7 @@ static int callchain_trace(unsigned int addr, void *data) · 18 unmodified lines
4963 {
5064 struct arc_callchain_trace *ctrl = data;
5165 struct perf_callchain_entry_ctx *entry = ctrl->perf_stuff;
66+
5267 perf_callchain_store(entry, addr);
5368
5469 if (ctrl->depth++ < 3)
@@ -57,8 +72,8 @@ static int callchain_trace(unsigned int addr, void *data) · 2 unmodified lines
5772 return -1;
5873 }
5974
60−void
61−perf_callchain_kernel(struct perf_callchain_entry_ctx *entry, struct pt_regs *regs)
75+void perf_callchain_kernel(struct perf_callchain_entry_ctx *entry,
76+ struct pt_regs *regs)
6277 {
6378 struct arc_callchain_trace ctrl = {
6479 .depth = 0,
@@ -68,8 +83,8 @@ perf_callchain_kernel(struct perf_callchain_entry_ctx *entry, struct pt_regs *re · 3 unmodified lines
6883 arc_unwind_core(NULL, regs, callchain_trace, &ctrl);
6984 }
7085
71−void
72−perf_callchain_user(struct perf_callchain_entry_ctx *entry, struct pt_regs *regs)
86+void perf_callchain_user(struct perf_callchain_entry_ctx *entry,
87+ struct pt_regs *regs)
7388 {
7489 /*
7590 * User stack can't be unwound trivially with kernel dwarf unwinder
@@ -82,10 +97,10 @@ static struct arc_pmu *arc_pmu; · 6 unmodified lines
8297 static DEFINE_PER_CPU(struct arc_pmu_cpu, arc_pmu_cpu);
8398
8499 /* read counter #idx; note that counter# != event# on ARC! */
85−static uint64_t arc_pmu_read_counter(int idx)
100+static u64 arc_pmu_read_counter(int idx)
86101 {
87− uint32_t tmp;
88− uint64_t result;
102+ u32 tmp;
103+ u64 result;
89104
90105 /*
91106 * ARC supports making 'snapshots' of the counters, so we don't
@@ -94,7 +109,7 @@ static uint64_t arc_pmu_read_counter(int idx) · 2 unmodified lines
94109 write_aux_reg(ARC_REG_PCT_INDEX, idx);
95110 tmp = read_aux_reg(ARC_REG_PCT_CONTROL);
96111 write_aux_reg(ARC_REG_PCT_CONTROL, tmp | ARC_REG_PCT_CONTROL_SN);
97− result = (uint64_t) (read_aux_reg(ARC_REG_PCT_SNAPH)) << 32;
112+ result = (u64) (read_aux_reg(ARC_REG_PCT_SNAPH)) << 32;
98113 result |= read_aux_reg(ARC_REG_PCT_SNAPL);
99114
100115 return result;
@@ -103,9 +118,9 @@ static uint64_t arc_pmu_read_counter(int idx) · 2 unmodified lines
103118 static void arc_perf_event_update(struct perf_event *event,
104119 struct hw_perf_event *hwc, int idx)
105120 {
106− uint64_t prev_raw_count = local64_read(&hwc->prev_count);
107− uint64_t new_raw_count = arc_pmu_read_counter(idx);
108− int64_t delta = new_raw_count - prev_raw_count;
121+ u64 prev_raw_count = local64_read(&hwc->prev_count);
122+ u64 new_raw_count = arc_pmu_read_counter(idx);
123+ s64 delta = new_raw_count - prev_raw_count;
109124
110125 /*
111126 * We aren't afraid of hwc->prev_count changing beneath our feet
@@ -155,7 +170,7 @@ static int arc_pmu_event_init(struct perf_event *event) · 43 unmodified lines
155170 int ret;
156171
157172 if (!is_sampling_event(event)) {
158− hwc->sample_period = arc_pmu->max_period;
173+ hwc->sample_period = arc_pmu->max_period;
159174 hwc->last_period = hwc->sample_period;
160175 local64_set(&hwc->period_left, hwc->sample_period);
161176 }
@@ -192,6 +207,18 @@ static int arc_pmu_event_init(struct perf_event *event) · 30 unmodified lines
192207 pr_debug("init cache event with h/w %08x \'%s\'\n",
193208 (int)hwc->config, arc_pmu_ev_hw_map[ret]);
194209 return 0;
210+
211+ case PERF_TYPE_RAW:
212+ if (event->attr.config >= arc_pmu->n_events)
213+ return -ENOENT;
214+
215+ hwc->config |= event->attr.config;
216+ pr_debug("init raw event with idx %lld \'%s\'\n",
217+ event->attr.config,
218+ arc_pmu->raw_entry[event->attr.config].name);
219+
220+ return 0;
221+
195222 default:
196223 return -ENOENT;
197224 }
@@ -200,7 +227,7 @@ static int arc_pmu_event_init(struct perf_event *event) · 2 unmodified lines
200227 /* starts all counters */
201228 static void arc_pmu_enable(struct pmu *pmu)
202229 {
203− uint32_t tmp;
230+ u32 tmp;
204231 tmp = read_aux_reg(ARC_REG_PCT_CONTROL);
205232 write_aux_reg(ARC_REG_PCT_CONTROL, (tmp & 0xffff0000) | 0x1);
206233 }
@@ -208,7 +235,7 @@ static void arc_pmu_enable(struct pmu *pmu) · 1 unmodified line
208235 /* stops all counters */
209236 static void arc_pmu_disable(struct pmu *pmu)
210237 {
211− uint32_t tmp;
238+ u32 tmp;
212239 tmp = read_aux_reg(ARC_REG_PCT_CONTROL);
213240 write_aux_reg(ARC_REG_PCT_CONTROL, (tmp & 0xffff0000) | 0x0);
214241 }
@@ -228,7 +255,7 @@ static int arc_pmu_event_set_period(struct perf_event *event) · 13 unmodified lines
228255 local64_set(&hwc->period_left, left);
229256 hwc->last_period = period;
230257 overflow = 1;
231− } else if (unlikely(left <= 0)) {
258+ } else if (unlikely(left <= 0)) {
232259 /* left underflowed by less than period. */
233260 left += period;
234261 local64_set(&hwc->period_left, left);
@@ -246,8 +273,8 @@ static int arc_pmu_event_set_period(struct perf_event *event) · 11 unmodified lines
246273 write_aux_reg(ARC_REG_PCT_INDEX, idx);
247274
248275 /* Write value */
249− write_aux_reg(ARC_REG_PCT_COUNTL, (u32)value);
250− write_aux_reg(ARC_REG_PCT_COUNTH, (value >> 32));
276+ write_aux_reg(ARC_REG_PCT_COUNTL, lower_32_bits(value));
277+ write_aux_reg(ARC_REG_PCT_COUNTH, upper_32_bits(value));
251278
252279 perf_event_update_userpage(event);
253280
@@ -277,7 +304,7 @@ static void arc_pmu_start(struct perf_event *event, int flags) · 23 unmodified lines
277304 /* Enable interrupt for this counter */
278305 if (is_sampling_event(event))
279306 write_aux_reg(ARC_REG_PCT_INT_CTRL,
280− read_aux_reg(ARC_REG_PCT_INT_CTRL) | (1 << idx));
307+ read_aux_reg(ARC_REG_PCT_INT_CTRL) | BIT(idx));
281308
282309 /* enable ARC pmu here */
283310 write_aux_reg(ARC_REG_PCT_INDEX, idx); /* counter # */
@@ -295,9 +322,9 @@ static void arc_pmu_stop(struct perf_event *event, int flags) · 11 unmodified lines
295322 * Reset interrupt flag by writing of 1. This is required
296323 * to make sure pending interrupt was not left.
297324 */
298− write_aux_reg(ARC_REG_PCT_INT_ACT, 1 << idx);
325+ write_aux_reg(ARC_REG_PCT_INT_ACT, BIT(idx));
299326 write_aux_reg(ARC_REG_PCT_INT_CTRL,
300− read_aux_reg(ARC_REG_PCT_INT_CTRL) & ~(1 << idx));
327+ read_aux_reg(ARC_REG_PCT_INT_CTRL) & ~BIT(idx));
301328 }
302329
303330 if (!(event->hw.state & PERF_HES_STOPPED)) {
@@ -349,9 +376,10 @@ static int arc_pmu_add(struct perf_event *event, int flags) · 45 unmodified lines
349376
350377 if (is_sampling_event(event)) {
351378 /* Mimic full counter overflow as other arches do */
352− write_aux_reg(ARC_REG_PCT_INT_CNTL, (u32)arc_pmu->max_period);
379+ write_aux_reg(ARC_REG_PCT_INT_CNTL,
380+ lower_32_bits(arc_pmu->max_period));
353381 write_aux_reg(ARC_REG_PCT_INT_CNTH,
354− (arc_pmu->max_period >> 32));
382+ upper_32_bits(arc_pmu->max_period));
355383 }
356384
357385 write_aux_reg(ARC_REG_PCT_CONFIG, 0);
@@ -392,7 +420,7 @@ static irqreturn_t arc_pmu_intr(int irq, void *dev) · 34 unmodified lines
392420 idx = __ffs(active_ints);
393421
394422 /* Reset interrupt flag by writing of 1 */
395− write_aux_reg(ARC_REG_PCT_INT_ACT, 1 << idx);
423+ write_aux_reg(ARC_REG_PCT_INT_ACT, BIT(idx));
396424
397425 /*
398426 * On reset of "interrupt active" bit corresponding
@@ -400,7 +428,7 @@ static irqreturn_t arc_pmu_intr(int irq, void *dev) · 1 unmodified line
400428 * Now we need to re-enable interrupt for the counter.
401429 */
402430 write_aux_reg(ARC_REG_PCT_INT_CTRL,
403− read_aux_reg(ARC_REG_PCT_INT_CTRL) | (1 << idx));
431+ read_aux_reg(ARC_REG_PCT_INT_CTRL) | BIT(idx));
404432
405433 event = pmu_cpu->act_counter[idx];
406434 hwc = &event->hw;
@@ -414,7 +442,7 @@ static irqreturn_t arc_pmu_intr(int irq, void *dev) · 7 unmodified lines
414442 arc_pmu_stop(event, 0);
415443 }
416444
417− active_ints &= ~(1U << idx);
445+ active_ints &= ~BIT(idx);
418446 } while (active_ints);
419447
420448 done:
@@ -441,19 +469,108 @@ static void arc_cpu_pmu_irq_init(void *data) · 20 unmodified lines
441469 write_aux_reg(ARC_REG_PCT_INT_ACT, 0xffffffff);
442470 }
443471
472+/* Event field occupies the bottom 15 bits of our config field */
473+PMU_FORMAT_ATTR(event, "config:0-14");
474+static struct attribute *arc_pmu_format_attrs[] = {
475+ &format_attr_event.attr,
476+ NULL,
477+};
478+
479+static struct attribute_group arc_pmu_format_attr_gr = {
480+ .name = "format",
481+ .attrs = arc_pmu_format_attrs,
482+};
483+
484+static ssize_t arc_pmu_events_sysfs_show(struct device *dev,
485+ struct device_attribute *attr,
486+ char *page)
487+{
488+ struct perf_pmu_events_attr *pmu_attr;
489+
490+ pmu_attr = container_of(attr, struct perf_pmu_events_attr, attr);
491+ return sprintf(page, "event=0x%04llx\n", pmu_attr->id);
492+}
493+
494+/*
495+ * We don't add attrs here as we don't have pre-defined list of perf events.
496+ * We will generate and add attrs dynamically in probe() after we read HW
497+ * configuration.
498+ */
499+static struct attribute_group arc_pmu_events_attr_gr = {
500+ .name = "events",
501+};
502+
503+static void arc_pmu_add_raw_event_attr(int j, char *str)
504+{
505+ memmove(arc_pmu->raw_entry[j].name, str, ARCPMU_EVENT_NAME_LEN - 1);
506+ arc_pmu->attr[j].attr.attr.name = arc_pmu->raw_entry[j].name;
507+ arc_pmu->attr[j].attr.attr.mode = VERIFY_OCTAL_PERMISSIONS(0444);
508+ arc_pmu->attr[j].attr.show = arc_pmu_events_sysfs_show;
509+ arc_pmu->attr[j].id = j;
510+ arc_pmu->attrs[j] = &(arc_pmu->attr[j].attr.attr);
511+}
512+
513+static int arc_pmu_raw_alloc(struct device *dev)
514+{
515+ arc_pmu->attr = devm_kmalloc_array(dev, arc_pmu->n_events + 1,
516+ sizeof(*arc_pmu->attr), GFP_KERNEL | __GFP_ZERO);
517+ if (!arc_pmu->attr)
518+ return -ENOMEM;
519+
520+ arc_pmu->attrs = devm_kmalloc_array(dev, arc_pmu->n_events + 1,
521+ sizeof(*arc_pmu->attrs), GFP_KERNEL | __GFP_ZERO);
522+ if (!arc_pmu->attrs)
523+ return -ENOMEM;
524+
525+ arc_pmu->raw_entry = devm_kmalloc_array(dev, arc_pmu->n_events,
526+ sizeof(*arc_pmu->raw_entry), GFP_KERNEL | __GFP_ZERO);
527+ if (!arc_pmu->raw_entry)
528+ return -ENOMEM;
529+
530+ return 0;
531+}
532+
533+static inline bool event_in_hw_event_map(int i, char *name)
534+{
535+ if (!arc_pmu_ev_hw_map[i])
536+ return false;
537+
538+ if (!strlen(arc_pmu_ev_hw_map[i]))
539+ return false;
540+
541+ if (strcmp(arc_pmu_ev_hw_map[i], name))
542+ return false;
543+
544+ return true;
545+}
546+
547+static void arc_pmu_map_hw_event(int j, char *str)
548+{
549+ int i;
550+
551+ /* See if HW condition has been mapped to a perf event_id */
552+ for (i = 0; i < ARRAY_SIZE(arc_pmu_ev_hw_map); i++) {
553+ if (event_in_hw_event_map(i, str)) {
554+ pr_debug("mapping perf event %2d to h/w event \'%8s\' (idx %d)\n",
555+ i, str, j);
556+ arc_pmu->ev_hw_idx[i] = j;
557+ }
558+ }
559+}
560+
444561 static int arc_pmu_device_probe(struct platform_device *pdev)
445562 {
446563 struct arc_reg_pct_build pct_bcr;
447564 struct arc_reg_cc_build cc_bcr;
448− int i, j, has_interrupts;
565+ int i, has_interrupts;
449566 int counter_size; /* in bits */
450567
451568 union cc_name {
452569 struct {
453− uint32_t word0, word1;
570+ u32 word0, word1;
454571 char sentinel;
455572 } indiv;
456− char str[9];
573+ char str[ARCPMU_EVENT_NAME_LEN];
457574 } cc_name;
458575
459576
@@ -463,15 +580,22 @@ static int arc_pmu_device_probe(struct platform_device *pdev) · 3 unmodified lines
463580 return -ENODEV;
464581 }
465582 BUILD_BUG_ON(ARC_PERF_MAX_COUNTERS > 32);
466− BUG_ON(pct_bcr.c > ARC_PERF_MAX_COUNTERS);
583+ if (WARN_ON(pct_bcr.c > ARC_PERF_MAX_COUNTERS))
584+ return -EINVAL;
467585
468586 READ_BCR(ARC_REG_CC_BUILD, cc_bcr);
469− BUG_ON(!cc_bcr.v); /* Counters exist but No countable conditions ? */
587+ if (WARN(!cc_bcr.v, "Counters exist but No countable conditions?"))
588+ return -EINVAL;
470589
471590 arc_pmu = devm_kzalloc(&pdev->dev, sizeof(struct arc_pmu), GFP_KERNEL);
472591 if (!arc_pmu)
473592 return -ENOMEM;
474593
594+ arc_pmu->n_events = cc_bcr.c;
595+
596+ if (arc_pmu_raw_alloc(&pdev->dev))
597+ return -ENOMEM;
598+
475599 has_interrupts = is_isa_arcv2() ? pct_bcr.i : 0;
476600
477601 arc_pmu->n_counters = pct_bcr.c;
@@ -481,30 +605,26 @@ static int arc_pmu_device_probe(struct platform_device *pdev) · 3 unmodified lines
481605
482606 pr_info("ARC perf\t: %d counters (%d bits), %d conditions%s\n",
483607 arc_pmu->n_counters, counter_size, cc_bcr.c,
484− has_interrupts ? ", [overflow IRQ support]":"");
608+ has_interrupts ? ", [overflow IRQ support]" : "");
485609
486− cc_name.str[8] = 0;
610+ cc_name.str[ARCPMU_EVENT_NAME_LEN - 1] = 0;
487611 for (i = 0; i < PERF_COUNT_ARC_HW_MAX; i++)
488612 arc_pmu->ev_hw_idx[i] = -1;
489613
490614 /* loop thru all available h/w condition indexes */
491− for (j = 0; j < cc_bcr.c; j++) {
492− write_aux_reg(ARC_REG_CC_INDEX, j);
615+ for (i = 0; i < cc_bcr.c; i++) {
616+ write_aux_reg(ARC_REG_CC_INDEX, i);
493617 cc_name.indiv.word0 = read_aux_reg(ARC_REG_CC_NAME0);
494618 cc_name.indiv.word1 = read_aux_reg(ARC_REG_CC_NAME1);
495619
496− /* See if it has been mapped to a perf event_id */
497− for (i = 0; i < ARRAY_SIZE(arc_pmu_ev_hw_map); i++) {
498− if (arc_pmu_ev_hw_map[i] &&
499− !strcmp(arc_pmu_ev_hw_map[i], cc_name.str) &&
500− strlen(arc_pmu_ev_hw_map[i])) {
501− pr_debug("mapping perf event %2d to h/w event \'%8s\' (idx %d)\n",
502− i, cc_name.str, j);
503− arc_pmu->ev_hw_idx[i] = j;
504− }
505− }
620+ arc_pmu_map_hw_event(i, cc_name.str);
621+ arc_pmu_add_raw_event_attr(i, cc_name.str);
506622 }
507623
624+ arc_pmu_events_attr_gr.attrs = arc_pmu->attrs;
625+ arc_pmu->attr_groups[ARCPMU_ATTR_GR_EVENTS] = &arc_pmu_events_attr_gr;
626+ arc_pmu->attr_groups[ARCPMU_ATTR_GR_FORMATS] = &arc_pmu_format_attr_gr;
627+
508628 arc_pmu->pmu = (struct pmu) {
509629 .pmu_enable = arc_pmu_enable,
510630 .pmu_disable = arc_pmu_disable,
@@ -514,6 +634,7 @@ static int arc_pmu_device_probe(struct platform_device *pdev) · 3 unmodified lines
514634 .start = arc_pmu_start,
515635 .stop = arc_pmu_stop,
516636 .read = arc_pmu_read,
637+ .attr_groups = arc_pmu->attr_groups,
517638 };
518639
519640 if (has_interrupts) {
@@ -535,17 +656,19 @@ static int arc_pmu_device_probe(struct platform_device *pdev) · 15 unmodified lines
535656 } else
536657 arc_pmu->pmu.capabilities |= PERF_PMU_CAP_NO_INTERRUPT;
537658
538− return perf_pmu_register(&arc_pmu->pmu, pdev->name, PERF_TYPE_RAW);
659+ /*
660+ * perf parser doesn't really like '-' symbol in events name, so let's
661+ * use '_' in arc pct name as it goes to kernel PMU event prefix.
662+ */
663+ return perf_pmu_register(&arc_pmu->pmu, "arc_pct", PERF_TYPE_RAW);
539664 }
540665
541−#ifdef CONFIG_OF
542666 static const struct of_device_id arc_pmu_match[] = {
543667 { .compatible = "snps,arc700-pct" },
544668 { .compatible = "snps,archs-pct" },
545669 {},
546670 };
547671 MODULE_DEVICE_TABLE(of, arc_pmu_match);
548−#endif
549672
550673 static struct platform_driver arc_pmu_driver = {
551674 .driver = {
arch/arc/kernel/setup.c+18−9
@@ -123,6 +123,7 @@ static void read_arc_build_cfg_regs(void) · 122 unmodified lines
123123 struct cpuinfo_arc *cpu = &cpuinfo_arc700[smp_processor_id()];
124124 const struct id_to_str *tbl;
125125 struct bcr_isa_arcv2 isa;
126+ struct bcr_actionpoint ap;
126127
127128 FIX_PTR(cpu);
128129
@@ -195,6 +196,7 @@ static void read_arc_build_cfg_regs(void) · 66 unmodified lines
195196 cpu->bpu.full = bpu.ft;
196197 cpu->bpu.num_cache = 256 << bpu.bce;
197198 cpu->bpu.num_pred = 2048 << bpu.pte;
199+ cpu->bpu.ret_stk = 4 << bpu.rse;
198200
199201 if (cpu->core.family >= 0x54) {
200202 unsigned int exec_ctrl;
@@ -207,8 +209,11 @@ static void read_arc_build_cfg_regs(void) · 6 unmodified lines
207209 }
208210 }
209211
210− READ_BCR(ARC_REG_AP_BCR, bcr);
211− cpu->extn.ap = bcr.ver ? 1 : 0;
212+ READ_BCR(ARC_REG_AP_BCR, ap);
213+ if (ap.ver) {
214+ cpu->extn.ap_num = 2 << ap.num;
215+ cpu->extn.ap_full = !!ap.min;
216+ }
212217
213218 READ_BCR(ARC_REG_SMART_BCR, bcr);
214219 cpu->extn.smart = bcr.ver ? 1 : 0;
@@ -216,8 +221,6 @@ static void read_arc_build_cfg_regs(void) · 1 unmodified line
216221 READ_BCR(ARC_REG_RTT_BCR, bcr);
217222 cpu->extn.rtt = bcr.ver ? 1 : 0;
218223
219− cpu->extn.debug = cpu->extn.ap | cpu->extn.smart | cpu->extn.rtt;
220−
221224 READ_BCR(ARC_REG_ISA_CFG_BCR, isa);
222225
223226 /* some hacks for lack of feature BCR info in old ARC700 cores */
@@ -299,10 +302,10 @@ static char *arc_cpu_mumbojumbo(int cpu_id, char *buf, int len) · 75 unmodified lines
299302
300303 if (cpu->bpu.ver)
301304 n += scnprintf(buf + n, len - n,
302− "BPU\t\t: %s%s match, cache:%d, Predict Table:%d",
305+ "BPU\t\t: %s%s match, cache:%d, Predict Table:%d Return stk: %d",
303306 IS_AVAIL1(cpu->bpu.full, "full"),
304307 IS_AVAIL1(!cpu->bpu.full, "partial"),
305− cpu->bpu.num_cache, cpu->bpu.num_pred);
308+ cpu->bpu.num_cache, cpu->bpu.num_pred, cpu->bpu.ret_stk);
306309
307310 if (is_isa_arcv2()) {
308311 struct bcr_lpb lpb;
@@ -336,11 +339,17 @@ static char *arc_extn_mumbojumbo(int cpu_id, char *buf, int len) · 27 unmodified lines
336339 IS_AVAIL1(cpu->extn.fpu_sp, "SP "),
337340 IS_AVAIL1(cpu->extn.fpu_dp, "DP "));
338341
339− if (cpu->extn.debug)
340− n += scnprintf(buf + n, len - n, "DEBUG\t\t: %s%s%s\n",
341− IS_AVAIL1(cpu->extn.ap, "ActionPoint "),
342+ if (cpu->extn.ap_num | cpu->extn.smart | cpu->extn.rtt) {
343+ n += scnprintf(buf + n, len - n, "DEBUG\t\t: %s%s",
342344 IS_AVAIL1(cpu->extn.smart, "smaRT "),
343345 IS_AVAIL1(cpu->extn.rtt, "RTT "));
346+ if (cpu->extn.ap_num) {
347+ n += scnprintf(buf + n, len - n, "ActionPoint %d/%s",
348+ cpu->extn.ap_num,
349+ cpu->extn.ap_full ? "full":"min");
350+ }
351+ n += scnprintf(buf + n, len - n, "\n");
352+ }
344353
345354 if (cpu->dccm.sz || cpu->iccm.sz)
346355 n += scnprintf(buf + n, len - n, "Extn [CCM]\t: DCCM @ %x, %d KB / ICCM: @ %x, %d KB\n",
arch/arc/kernel/troubleshoot.c+18−12
@@ -18,6 +18,8 @@ · 17 unmodified lines
1818 #include <asm/arcregs.h>
1919 #include <asm/irqflags.h>
2020
21+#define ARC_PATH_MAX 256
22+
2123 /*
2224 * Common routine to print scratch regs (r0-r12) or callee regs (r13-r25)
2325 * -Prints 3 regs per line and a CR.
@@ -58,11 +60,12 @@ static void show_callee_regs(struct callee_regs *cregs) · 34 unmodified lines
5860 print_reg_file(&(cregs->r13), 13);
5961 }
6062
61−static void print_task_path_n_nm(struct task_struct *tsk, char *buf)
63+static void print_task_path_n_nm(struct task_struct *tsk)
6264 {
6365 char *path_nm = NULL;
6466 struct mm_struct *mm;
6567 struct file *exe_file;
68+ char buf[ARC_PATH_MAX];
6669
6770 mm = get_task_mm(tsk);
6871 if (!mm)
@@ -72,7 +75,7 @@ static void print_task_path_n_nm(struct task_struct *tsk, char *buf) · 3 unmodified lines
7275 mmput(mm);
7376
7477 if (exe_file) {
75− path_nm = file_path(exe_file, buf, 255);
78+ path_nm = file_path(exe_file, buf, ARC_PATH_MAX-1);
7679 fput(exe_file);
7780 }
7881
@@ -80,10 +83,9 @@ done: · 1 unmodified line
8083 pr_info("Path: %s\n", !IS_ERR(path_nm) ? path_nm : "?");
8184 }
8285
83−static void show_faulting_vma(unsigned long address, char *buf)
86+static void show_faulting_vma(unsigned long address)
8487 {
8588 struct vm_area_struct *vma;
86− char *nm = buf;
8789 struct mm_struct *active_mm = current->active_mm;
8890
8991 /* can't use print_vma_addr() yet as it doesn't check for
@@ -96,8 +98,11 @@ static void show_faulting_vma(unsigned long address, char *buf) · 6 unmodified lines
9698 * if the container VMA is not found
9799 */
98100 if (vma && (vma->vm_start <= address)) {
101+ char buf[ARC_PATH_MAX];
102+ char *nm = "?";
103+
99104 if (vma->vm_file) {
100− nm = file_path(vma->vm_file, buf, PAGE_SIZE - 1);
105+ nm = file_path(vma->vm_file, buf, ARC_PATH_MAX-1);
101106 if (IS_ERR(nm))
102107 nm = "?";
103108 }
@@ -173,13 +178,14 @@ void show_regs(struct pt_regs *regs) · 69 unmodified lines
173178 {
174179 struct task_struct *tsk = current;
175180 struct callee_regs *cregs;
176− char *buf;
177181
178− buf = (char *)__get_free_page(GFP_KERNEL);
179− if (!buf)
180− return;
182+ /*
183+ * generic code calls us with preemption disabled, but some calls
184+ * here could sleep, so re-enable to avoid lockdep splat
185+ */
186+ preempt_enable();
181187
182− print_task_path_n_nm(tsk, buf);
188+ print_task_path_n_nm(tsk);
183189 show_regs_print_info(KERN_INFO);
184190
185191 show_ecr_verbose(regs);
@@ -189,7 +195,7 @@ void show_regs(struct pt_regs *regs) · 3 unmodified lines
189195 (void *)regs->blink, (void *)regs->ret);
190196
191197 if (user_mode(regs))
192− show_faulting_vma(regs->ret, buf); /* faulting code, not data */
198+ show_faulting_vma(regs->ret); /* faulting code, not data */
193199
194200 pr_info("[STAT32]: 0x%08lx", regs->status32);
195201
@@ -222,7 +228,7 @@ void show_regs(struct pt_regs *regs) · 26 unmodified lines
222228 if (cregs)
223229 show_callee_regs(cregs);
224230
225− free_page((unsigned long)buf);
231+ preempt_disable();
226232 }
227233
228234 void show_kernel_fault_diag(const char *str, struct pt_regs *regs,
arch/arc/lib/memset-archs.S+32−8
@@ -7,11 +7,39 @@ · 6 unmodified lines
77 */
88
99 #include <linux/linkage.h>
10+#include <asm/cache.h>
1011
11−#undef PREALLOC_NOT_AVAIL
12+/*
13+ * The memset implementation below is optimized to use prefetchw and prealloc
14+ * instruction in case of CPU with 64B L1 data cache line (L1_CACHE_SHIFT == 6)
15+ * If you want to implement optimized memset for other possible L1 data cache
16+ * line lengths (32B and 128B) you should rewrite code carefully checking
17+ * we don't call any prefetchw/prealloc instruction for L1 cache lines which
18+ * don't belongs to memset area.
19+ */
20+
21+#if L1_CACHE_SHIFT == 6
22+
23+.macro PREALLOC_INSTR reg, off
24+ prealloc [\reg, \off]
25+.endm
26+
27+.macro PREFETCHW_INSTR reg, off
28+ prefetchw [\reg, \off]
29+.endm
30+
31+#else
32+
33+.macro PREALLOC_INSTR
34+.endm
35+
36+.macro PREFETCHW_INSTR
37+.endm
38+
39+#endif
1240
1341 ENTRY_CFI(memset)
14− prefetchw [r0] ; Prefetch the write location
42+ PREFETCHW_INSTR r0, 0 ; Prefetch the first write location
1543 mov.f 0, r2
1644 ;;; if size is zero
1745 jz.d [blink]
@@ -48,11 +76,8 @@ ENTRY_CFI(memset) · 30 unmodified lines
4876
4977 lpnz @.Lset64bytes
5078 ;; LOOP START
51−#ifdef PREALLOC_NOT_AVAIL
52− prefetchw [r3, 64] ;Prefetch the next write location
53−#else
54− prealloc [r3, 64]
55−#endif
79+ PREALLOC_INSTR r3, 64 ; alloc next line w/o fetching
80+
5681 #ifdef CONFIG_ARC_HAS_LL64
5782 std.ab r4, [r3, 8]
5883 std.ab r4, [r3, 8]
@@ -85,7 +110,6 @@ ENTRY_CFI(memset) · 26 unmodified lines
85110 lsr.f lp_count, r2, 5 ;Last remaining max 124 bytes
86111 lpnz .Lset32bytes
87112 ;; LOOP START
88− prefetchw [r3, 32] ;Prefetch the next write location
89113 #ifdef CONFIG_ARC_HAS_LL64
90114 std.ab r4, [r3, 8]
91115 std.ab r4, [r3, 8]
arch/arc/mm/fault.c+9−4
@@ -141,12 +141,17 @@ good_area: · 140 unmodified lines
141141 */
142142 fault = handle_mm_fault(vma, address, flags);
143143
144− /* If Pagefault was interrupted by SIGKILL, exit page fault "early" */
145144 if (fatal_signal_pending(current)) {
146− if ((fault & VM_FAULT_ERROR) && !(fault & VM_FAULT_RETRY))
147− up_read(&mm->mmap_sem);
148− if (user_mode(regs))
145+
146+ /*
147+ * if fault retry, mmap_sem already relinquished by core mm
148+ * so OK to return to user mode (with signal handled first)
149+ */
150+ if (fault & VM_FAULT_RETRY) {
151+ if (!user_mode(regs))
152+ goto no_context;
149153 return;
154+ }
150155 }
151156
152157 perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, address);
arch/arc/mm/init.c+2−1
@@ -119,7 +119,8 @@ void __init setup_arch_memory(void) · 118 unmodified lines
119119 */
120120
121121 memblock_add_node(low_mem_start, low_mem_sz, 0);
122− memblock_reserve(low_mem_start, __pa(_end) - low_mem_start);
122+ memblock_reserve(CONFIG_LINUX_LINK_BASE,
123+ __pa(_end) - CONFIG_LINUX_LINK_BASE);
123124
124125 #ifdef CONFIG_BLK_DEV_INITRD
125126 if (phys_initrd_size) {
arch/arm/include/asm/xen/page-coherent.h+94−0
@@ -1 +1,95 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+#ifndef _ASM_ARM_XEN_PAGE_COHERENT_H
3+#define _ASM_ARM_XEN_PAGE_COHERENT_H
4+
5+#include <linux/dma-mapping.h>
6+#include <asm/page.h>
17 #include <xen/arm/page-coherent.h>
8+
9+static inline const struct dma_map_ops *xen_get_dma_ops(struct device *dev)
10+{
11+ if (dev && dev->archdata.dev_dma_ops)
12+ return dev->archdata.dev_dma_ops;
13+ return get_arch_dma_ops(NULL);
14+}
15+
16+static inline void *xen_alloc_coherent_pages(struct device *hwdev, size_t size,
17+ dma_addr_t *dma_handle, gfp_t flags, unsigned long attrs)
18+{
19+ return xen_get_dma_ops(hwdev)->alloc(hwdev, size, dma_handle, flags, attrs);
20+}
21+
22+static inline void xen_free_coherent_pages(struct device *hwdev, size_t size,
23+ void *cpu_addr, dma_addr_t dma_handle, unsigned long attrs)
24+{
25+ xen_get_dma_ops(hwdev)->free(hwdev, size, cpu_addr, dma_handle, attrs);
26+}
27+
28+static inline void xen_dma_map_page(struct device *hwdev, struct page *page,
29+ dma_addr_t dev_addr, unsigned long offset, size_t size,
30+ enum dma_data_direction dir, unsigned long attrs)
31+{
32+ unsigned long page_pfn = page_to_xen_pfn(page);
33+ unsigned long dev_pfn = XEN_PFN_DOWN(dev_addr);
34+ unsigned long compound_pages =
35+ (1<<compound_order(page)) * XEN_PFN_PER_PAGE;
36+ bool local = (page_pfn <= dev_pfn) &&
37+ (dev_pfn - page_pfn < compound_pages);
38+
39+ /*
40+ * Dom0 is mapped 1:1, while the Linux page can span across
41+ * multiple Xen pages, it's not possible for it to contain a
42+ * mix of local and foreign Xen pages. So if the first xen_pfn
43+ * == mfn the page is local otherwise it's a foreign page
44+ * grant-mapped in dom0. If the page is local we can safely
45+ * call the native dma_ops function, otherwise we call the xen
46+ * specific function.
47+ */
48+ if (local)
49+ xen_get_dma_ops(hwdev)->map_page(hwdev, page, offset, size, dir, attrs);
50+ else
51+ __xen_dma_map_page(hwdev, page, dev_addr, offset, size, dir, attrs);
52+}
53+
54+static inline void xen_dma_unmap_page(struct device *hwdev, dma_addr_t handle,
55+ size_t size, enum dma_data_direction dir, unsigned long attrs)
56+{
57+ unsigned long pfn = PFN_DOWN(handle);
58+ /*
59+ * Dom0 is mapped 1:1, while the Linux page can be spanned accross
60+ * multiple Xen page, it's not possible to have a mix of local and
61+ * foreign Xen page. Dom0 is mapped 1:1, so calling pfn_valid on a
62+ * foreign mfn will always return false. If the page is local we can
63+ * safely call the native dma_ops function, otherwise we call the xen
64+ * specific function.
65+ */
66+ if (pfn_valid(pfn)) {
67+ if (xen_get_dma_ops(hwdev)->unmap_page)
68+ xen_get_dma_ops(hwdev)->unmap_page(hwdev, handle, size, dir, attrs);
69+ } else
70+ __xen_dma_unmap_page(hwdev, handle, size, dir, attrs);
71+}
72+
73+static inline void xen_dma_sync_single_for_cpu(struct device *hwdev,
74+ dma_addr_t handle, size_t size, enum dma_data_direction dir)
75+{
76+ unsigned long pfn = PFN_DOWN(handle);
77+ if (pfn_valid(pfn)) {
78+ if (xen_get_dma_ops(hwdev)->sync_single_for_cpu)
79+ xen_get_dma_ops(hwdev)->sync_single_for_cpu(hwdev, handle, size, dir);
80+ } else
81+ __xen_dma_sync_single_for_cpu(hwdev, handle, size, dir);
82+}
83+
84+static inline void xen_dma_sync_single_for_device(struct device *hwdev,
85+ dma_addr_t handle, size_t size, enum dma_data_direction dir)
86+{
87+ unsigned long pfn = PFN_DOWN(handle);
88+ if (pfn_valid(pfn)) {
89+ if (xen_get_dma_ops(hwdev)->sync_single_for_device)
90+ xen_get_dma_ops(hwdev)->sync_single_for_device(hwdev, handle, size, dir);
91+ } else
92+ __xen_dma_sync_single_for_device(hwdev, handle, size, dir);
93+}
94+
95+#endif /* _ASM_ARM_XEN_PAGE_COHERENT_H */
arch/arm/mach-cns3xxx/pcie.c+2−2
@@ -83,7 +83,7 @@ static void __iomem *cns3xxx_pci_map_bus(struct pci_bus *bus, · 82 unmodified lines
8383 } else /* remote PCI bus */
8484 base = cnspci->cfg1_regs + ((busno & 0xf) << 20);
8585
86− return base + (where & 0xffc) + (devfn << 12);
86+ return base + where + (devfn << 12);
8787 }
8888
8989 static int cns3xxx_pci_read_config(struct pci_bus *bus, unsigned int devfn,
@@ -93,7 +93,7 @@ static int cns3xxx_pci_read_config(struct pci_bus *bus, unsigned int devfn, · 3 unmodified lines
9393 u32 mask = (0x1ull << (size * 8)) - 1;
9494 int shift = (where % 4) * 8;
9595
96− ret = pci_generic_config_read32(bus, devfn, where, size, val);
96+ ret = pci_generic_config_read(bus, devfn, where, size, val);
9797
9898 if (ret == PCIBIOS_SUCCESSFUL && !bus->number && !devfn &&
9999 (where & 0xffc) == PCI_CLASS_REVISION)
arch/arm64/include/asm/cache.h+0−2
@@ -60,8 +60,6 @@ · 59 unmodified lines
6060
6161 #ifdef CONFIG_KASAN_SW_TAGS
6262 #define ARCH_SLAB_MINALIGN (1ULL << KASAN_SHADOW_SCALE_SHIFT)
63−#else
64−#define ARCH_SLAB_MINALIGN __alignof__(unsigned long long)
6563 #endif
6664
6765 #ifndef __ASSEMBLY__
arch/arm64/include/asm/device.h+0−3
@@ -20,9 +20,6 @@ struct dev_archdata { · 19 unmodified lines
2020 #ifdef CONFIG_IOMMU_API
2121 void *iommu; /* private IOMMU data */
2222 #endif
23−#ifdef CONFIG_XEN
24− const struct dma_map_ops *dev_dma_ops;
25−#endif
2623 };
2724
2825 struct pdev_archdata {
arch/arm64/include/asm/mmu.h+4−1
@@ -60,8 +60,11 @@ static inline bool arm64_kernel_use_ng_mappings(void) · 59 unmodified lines
6060 * later determine that kpti is required, then
6161 * kpti_install_ng_mappings() will make them non-global.
6262 */
63+ if (arm64_kernel_unmapped_at_el0())
64+ return true;
65+
6366 if (!IS_ENABLED(CONFIG_RANDOMIZE_BASE))
64− return arm64_kernel_unmapped_at_el0();
67+ return false;
6568
6669 /*
6770 * KASLR is enabled so we're going to be enabling kpti on non-broken
arch/arm64/include/asm/xen/page-coherent.h+76−0
@@ -1 +1,77 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+#ifndef _ASM_ARM64_XEN_PAGE_COHERENT_H
3+#define _ASM_ARM64_XEN_PAGE_COHERENT_H
4+
5+#include <linux/dma-mapping.h>
6+#include <asm/page.h>
17 #include <xen/arm/page-coherent.h>
8+
9+static inline void *xen_alloc_coherent_pages(struct device *hwdev, size_t size,
10+ dma_addr_t *dma_handle, gfp_t flags, unsigned long attrs)
11+{
12+ return dma_direct_alloc(hwdev, size, dma_handle, flags, attrs);
13+}
14+
15+static inline void xen_free_coherent_pages(struct device *hwdev, size_t size,
16+ void *cpu_addr, dma_addr_t dma_handle, unsigned long attrs)
17+{
18+ dma_direct_free(hwdev, size, cpu_addr, dma_handle, attrs);
19+}
20+
21+static inline void xen_dma_sync_single_for_cpu(struct device *hwdev,
22+ dma_addr_t handle, size_t size, enum dma_data_direction dir)
23+{
24+ unsigned long pfn = PFN_DOWN(handle);
25+
26+ if (pfn_valid(pfn))
27+ dma_direct_sync_single_for_cpu(hwdev, handle, size, dir);
28+ else
29+ __xen_dma_sync_single_for_cpu(hwdev, handle, size, dir);
30+}
31+
32+static inline void xen_dma_sync_single_for_device(struct device *hwdev,
33+ dma_addr_t handle, size_t size, enum dma_data_direction dir)
34+{
35+ unsigned long pfn = PFN_DOWN(handle);
36+ if (pfn_valid(pfn))
37+ dma_direct_sync_single_for_device(hwdev, handle, size, dir);
38+ else
39+ __xen_dma_sync_single_for_device(hwdev, handle, size, dir);
40+}
41+
42+static inline void xen_dma_map_page(struct device *hwdev, struct page *page,
43+ dma_addr_t dev_addr, unsigned long offset, size_t size,
44+ enum dma_data_direction dir, unsigned long attrs)
45+{
46+ unsigned long page_pfn = page_to_xen_pfn(page);
47+ unsigned long dev_pfn = XEN_PFN_DOWN(dev_addr);
48+ unsigned long compound_pages =
49+ (1<<compound_order(page)) * XEN_PFN_PER_PAGE;
50+ bool local = (page_pfn <= dev_pfn) &&
51+ (dev_pfn - page_pfn < compound_pages);
52+
53+ if (local)
54+ dma_direct_map_page(hwdev, page, offset, size, dir, attrs);
55+ else
56+ __xen_dma_map_page(hwdev, page, dev_addr, offset, size, dir, attrs);
57+}
58+
59+static inline void xen_dma_unmap_page(struct device *hwdev, dma_addr_t handle,
60+ size_t size, enum dma_data_direction dir, unsigned long attrs)
61+{
62+ unsigned long pfn = PFN_DOWN(handle);
63+ /*
64+ * Dom0 is mapped 1:1, while the Linux page can be spanned accross
65+ * multiple Xen page, it's not possible to have a mix of local and
66+ * foreign Xen page. Dom0 is mapped 1:1, so calling pfn_valid on a
67+ * foreign mfn will always return false. If the page is local we can
68+ * safely call the native dma_ops function, otherwise we call the xen
69+ * specific function.
70+ */
71+ if (pfn_valid(pfn))
72+ dma_direct_unmap_page(hwdev, handle, size, dir, attrs);
73+ else
74+ __xen_dma_unmap_page(hwdev, handle, size, dir, attrs);
75+}
76+
77+#endif /* _ASM_ARM64_XEN_PAGE_COHERENT_H */
arch/arm64/kernel/hibernate.c+3−1
@@ -299,8 +299,10 @@ int swsusp_arch_suspend(void) · 298 unmodified lines
299299 dcache_clean_range(__idmap_text_start, __idmap_text_end);
300300
301301 /* Clean kvm setup code to PoC? */
302− if (el2_reset_needed())
302+ if (el2_reset_needed()) {
303303 dcache_clean_range(__hyp_idmap_text_start, __hyp_idmap_text_end);
304+ dcache_clean_range(__hyp_text_start, __hyp_text_end);
305+ }
304306
305307 /* make the crash dump kernel image protected again */
306308 crash_post_resume();
arch/arm64/kernel/hyp-stub.S+2−0
@@ -28,6 +28,8 @@ · 27 unmodified lines
2828 #include <asm/virt.h>
2929
3030 .text
31+ .pushsection .hyp.text, "ax"
32+
3133 .align 11
3234
3335 ENTRY(__hyp_stub_vectors)
arch/arm64/kernel/kaslr.c+7−2
@@ -14,6 +14,7 @@ · 13 unmodified lines
1414 #include <linux/sched.h>
1515 #include <linux/types.h>
1616
17+#include <asm/cacheflush.h>
1718 #include <asm/fixmap.h>
1819 #include <asm/kernel-pgtable.h>
1920 #include <asm/memory.h>
@@ -43,7 +44,7 @@ static __init u64 get_kaslr_seed(void *fdt) · 23 unmodified lines
4344 return ret;
4445 }
4546
46−static __init const u8 *get_cmdline(void *fdt)
47+static __init const u8 *kaslr_get_cmdline(void *fdt)
4748 {
4849 static __initconst const u8 default_cmdline[] = CONFIG_CMDLINE;
4950
@@ -87,6 +88,7 @@ u64 __init kaslr_early_init(u64 dt_phys) · 37 unmodified lines
8788 * we end up running with module randomization disabled.
8889 */
8990 module_alloc_base = (u64)_etext - MODULES_VSIZE;
91+ __flush_dcache_area(&module_alloc_base, sizeof(module_alloc_base));
9092
9193 /*
9294 * Try to map the FDT early. If this fails, we simply bail,
@@ -109,7 +111,7 @@ u64 __init kaslr_early_init(u64 dt_phys) · 16 unmodified lines
109111 * Check if 'nokaslr' appears on the command line, and
110112 * return 0 if that is the case.
111113 */
112− cmdline = get_cmdline(fdt);
114+ cmdline = kaslr_get_cmdline(fdt);
113115 str = strstr(cmdline, "nokaslr");
114116 if (str == cmdline || (str > cmdline && *(str - 1) == ' '))
115117 return 0;
@@ -169,5 +171,8 @@ u64 __init kaslr_early_init(u64 dt_phys) · 53 unmodified lines
169171 module_alloc_base += (module_range * (seed & ((1 << 21) - 1))) >> 21;
170172 module_alloc_base &= PAGE_MASK;
171173
174+ __flush_dcache_area(&module_alloc_base, sizeof(module_alloc_base));
175+ __flush_dcache_area(&memstart_offset_seed, sizeof(memstart_offset_seed));
176+
172177 return offset;
173178 }
arch/arm64/kernel/probes/kprobes.c+3−3
@@ -478,13 +478,13 @@ bool arch_within_kprobe_blacklist(unsigned long addr) · 477 unmodified lines
478478 addr < (unsigned long)__entry_text_end) ||
479479 (addr >= (unsigned long)__idmap_text_start &&
480480 addr < (unsigned long)__idmap_text_end) ||
481+ (addr >= (unsigned long)__hyp_text_start &&
482+ addr < (unsigned long)__hyp_text_end) ||
481483 !!search_exception_tables(addr))
482484 return true;
483485
484486 if (!is_kernel_in_hyp_mode()) {
485− if ((addr >= (unsigned long)__hyp_text_start &&
486− addr < (unsigned long)__hyp_text_end) ||
487− (addr >= (unsigned long)__hyp_idmap_text_start &&
487+ if ((addr >= (unsigned long)__hyp_idmap_text_start &&
488488 addr < (unsigned long)__hyp_idmap_text_end))
489489 return true;
490490 }
arch/arm64/mm/dma-mapping.c+1−3
@@ -466,9 +466,7 @@ void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size, · 465 unmodified lines
466466 __iommu_setup_dma_ops(dev, dma_base, size, iommu);
467467
468468 #ifdef CONFIG_XEN
469− if (xen_initial_domain()) {
470− dev->archdata.dev_dma_ops = dev->dma_ops;
469+ if (xen_initial_domain())
471470 dev->dma_ops = xen_dma_ops;
472− }
473471 #endif
474472 }
arch/arm64/mm/flush.c+5−1
@@ -33,7 +33,11 @@ void sync_icache_aliases(void *kaddr, unsigned long len) · 32 unmodified lines
3333 __clean_dcache_area_pou(kaddr, len);
3434 __flush_icache_all();
3535 } else {
36− flush_icache_range(addr, addr + len);
36+ /*
37+ * Don't issue kick_all_cpus_sync() after I-cache invalidation
38+ * for user mappings.
39+ */
40+ __flush_icache_range(addr, addr + len);
3741 }
3842 }
3943
arch/c6x/include/asm/Kbuild+1−0
@@ -30,6 +30,7 @@ generic-y += pgalloc.h · 29 unmodified lines
3030 generic-y += preempt.h
3131 generic-y += segment.h
3232 generic-y += serial.h
33+generic-y += shmparam.h
3334 generic-y += tlbflush.h
3435 generic-y += topology.h
3536 generic-y += trace_clock.h
arch/c6x/include/uapi/asm/Kbuild+0−1
@@ -1,5 +1,4 @@
11 include include/uapi/asm-generic/Kbuild.asm
22
33 generic-y += kvm_para.h
4−generic-y += shmparam.h
54 generic-y += ucontext.h
arch/h8300/Makefile+0−2
@@ -37,8 +37,6 @@ libs-y += arch/$(ARCH)/lib/ · 36 unmodified lines
3737
3838 boot := arch/h8300/boot
3939
40−archmrproper:
41−
4240 archclean:
4341 $(Q)$(MAKE) $(clean)=$(boot)
4442
arch/h8300/include/asm/Kbuild+1−0
@@ -40,6 +40,7 @@ generic-y += preempt.h · 39 unmodified lines
4040 generic-y += scatterlist.h
4141 generic-y += sections.h
4242 generic-y += serial.h
43+generic-y += shmparam.h
4344 generic-y += sizes.h
4445 generic-y += spinlock.h
4546 generic-y += timex.h
arch/h8300/include/uapi/asm/Kbuild+0−1
@@ -1,5 +1,4 @@
11 include include/uapi/asm-generic/Kbuild.asm
22
33 generic-y += kvm_para.h
4−generic-y += shmparam.h
54 generic-y += ucontext.h
arch/hexagon/include/asm/Kbuild+1−0
@@ -30,6 +30,7 @@ generic-y += rwsem.h · 29 unmodified lines
3030 generic-y += sections.h
3131 generic-y += segment.h
3232 generic-y += serial.h
33+generic-y += shmparam.h
3334 generic-y += sizes.h
3435 generic-y += topology.h
3536 generic-y += trace_clock.h
arch/hexagon/include/uapi/asm/Kbuild+0−1
@@ -1,4 +1,3 @@
11 include include/uapi/asm-generic/Kbuild.asm
22
3−generic-y += shmparam.h
43 generic-y += ucontext.h
arch/ia64/Makefile+0−2
@@ -16,8 +16,6 @@ KBUILD_DEFCONFIG := generic_defconfig · 15 unmodified lines
1616 NM := $(CROSS_COMPILE)nm -B
1717 READELF := $(CROSS_COMPILE)readelf
1818
19−export AWK
20−
2119 CHECKFLAGS += -D__ia64=1 -D__ia64__=1 -D_LP64 -D__LP64__
2220
2321 OBJCOPYFLAGS := --strip-all
arch/m68k/include/asm/Kbuild+1−0
@@ -20,6 +20,7 @@ generic-y += mm-arch-hooks.h · 19 unmodified lines
2020 generic-y += percpu.h
2121 generic-y += preempt.h
2222 generic-y += sections.h
23+generic-y += shmparam.h
2324 generic-y += spinlock.h
2425 generic-y += topology.h
2526 generic-y += trace_clock.h
arch/m68k/include/uapi/asm/Kbuild+0−1
@@ -2,4 +2,3 @@ include include/uapi/asm-generic/Kbuild.asm · 1 unmodified line
22
33 generated-y += unistd_32.h
44 generic-y += kvm_para.h
5−generic-y += shmparam.h
arch/microblaze/include/asm/Kbuild+1−0
@@ -26,6 +26,7 @@ generic-y += parport.h · 25 unmodified lines
2626 generic-y += percpu.h
2727 generic-y += preempt.h
2828 generic-y += serial.h
29+generic-y += shmparam.h
2930 generic-y += syscalls.h
3031 generic-y += topology.h
3132 generic-y += trace_clock.h
arch/microblaze/include/uapi/asm/Kbuild+0−1
@@ -2,5 +2,4 @@ include include/uapi/asm-generic/Kbuild.asm · 1 unmodified line
22
33 generated-y += unistd_32.h
44 generic-y += kvm_para.h
5−generic-y += shmparam.h
65 generic-y += ucontext.h
arch/mips/Kconfig+1−0
@@ -3155,6 +3155,7 @@ config MIPS32_O32 · 3154 unmodified lines
31553155 config MIPS32_N32
31563156 bool "Kernel support for n32 binaries"
31573157 depends on 64BIT
3158+ select ARCH_WANT_COMPAT_IPC_PARSE_VERSION
31583159 select COMPAT
31593160 select MIPS32_COMPAT
31603161 select SYSVIPC_COMPAT if SYSVIPC
arch/mips/bcm47xx/setup.c+31−0
@@ -173,6 +173,31 @@ void __init plat_mem_setup(void) · 172 unmodified lines
173173 pm_power_off = bcm47xx_machine_halt;
174174 }
175175
176+#ifdef CONFIG_BCM47XX_BCMA
177+static struct device * __init bcm47xx_setup_device(void)
178+{
179+ struct device *dev;
180+ int err;
181+
182+ dev = kzalloc(sizeof(*dev), GFP_KERNEL);
183+ if (!dev)
184+ return NULL;
185+
186+ err = dev_set_name(dev, "bcm47xx_soc");
187+ if (err) {
188+ pr_err("Failed to set SoC device name: %d\n", err);
189+ kfree(dev);
190+ return NULL;
191+ }
192+
193+ err = dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(32));
194+ if (err)
195+ pr_err("Failed to set SoC DMA mask: %d\n", err);
196+
197+ return dev;
198+}
199+#endif
200+
176201 /*
177202 * This finishes bus initialization doing things that were not possible without
178203 * kmalloc. Make sure to call it late enough (after mm_init).
@@ -183,6 +208,10 @@ void __init bcm47xx_bus_setup(void) · 4 unmodified lines
183208 if (bcm47xx_bus_type == BCM47XX_BUS_TYPE_BCMA) {
184209 int err;
185210
211+ bcm47xx_bus.bcma.dev = bcm47xx_setup_device();
212+ if (!bcm47xx_bus.bcma.dev)
213+ panic("Failed to setup SoC device\n");
214+
186215 err = bcma_host_soc_init(&bcm47xx_bus.bcma);
187216 if (err)
188217 panic("Failed to initialize BCMA bus (err %d)", err);
@@ -235,6 +264,8 @@ static int __init bcm47xx_register_bus_complete(void) · 46 unmodified lines
235264 #endif
236265 #ifdef CONFIG_BCM47XX_BCMA
237266 case BCM47XX_BUS_TYPE_BCMA:
267+ if (device_register(bcm47xx_bus.bcma.dev))
268+ pr_err("Failed to register SoC device\n");
238269 bcma_bus_register(&bcm47xx_bus.bcma.bus);
239270 break;
240271 #endif
arch/mips/cavium-octeon/setup.c+1−1
@@ -98,7 +98,7 @@ static void octeon_kexec_smp_down(void *ignored) · 97 unmodified lines
9898 " sync \n"
9999 " synci ($0) \n");
100100
101− relocated_kexec_smp_wait(NULL);
101+ kexec_reboot();
102102 }
103103 #endif
104104
arch/mips/configs/ath79_defconfig+1−0
@@ -66,6 +66,7 @@ CONFIG_SERIAL_8250_CONSOLE=y · 65 unmodified lines
6666 # CONFIG_SERIAL_8250_PCI is not set
6767 CONFIG_SERIAL_8250_NR_UARTS=1
6868 CONFIG_SERIAL_8250_RUNTIME_UARTS=1
69+CONFIG_SERIAL_OF_PLATFORM=y
6970 CONFIG_SERIAL_AR933X=y
7071 CONFIG_SERIAL_AR933X_CONSOLE=y
7172 # CONFIG_HW_RANDOM is not set
arch/mips/include/asm/mach-lantiq/falcon/falcon_irq.h+0−2
@@ -18,8 +18,6 @@ · 17 unmodified lines
1818 #define INT_NUM_EXTRA_START (INT_NUM_IM4_IRL0 + 32)
1919 #define INT_NUM_IM_OFFSET (INT_NUM_IM1_IRL0 - INT_NUM_IM0_IRL0)
2020
21−#define MIPS_CPU_TIMER_IRQ 7
22−
2321 #define MAX_IM 5
2422
2523 #endif /* _FALCON_IRQ__ */
arch/mips/include/asm/mach-lantiq/xway/lantiq_irq.h+0−2
@@ -19,8 +19,6 @@ · 18 unmodified lines
1919
2020 #define LTQ_DMA_CH0_INT (INT_NUM_IM2_IRL0)
2121
22−#define MIPS_CPU_TIMER_IRQ 7
23−
2422 #define MAX_IM 5
2523
2624 #endif
arch/mips/jazz/jazzdma.c+3−2
@@ -74,14 +74,15 @@ static int __init vdma_init(void) · 73 unmodified lines
7474 get_order(VDMA_PGTBL_SIZE));
7575 BUG_ON(!pgtbl);
7676 dma_cache_wback_inv((unsigned long)pgtbl, VDMA_PGTBL_SIZE);
77− pgtbl = (VDMA_PGTBL_ENTRY *)KSEG1ADDR(pgtbl);
77+ pgtbl = (VDMA_PGTBL_ENTRY *)CKSEG1ADDR((unsigned long)pgtbl);
7878
7979 /*
8080 * Clear the R4030 translation table
8181 */
8282 vdma_pgtbl_init();
8383
84− r4030_write_reg32(JAZZ_R4030_TRSTBL_BASE, CPHYSADDR(pgtbl));
84+ r4030_write_reg32(JAZZ_R4030_TRSTBL_BASE,
85+ CPHYSADDR((unsigned long)pgtbl));
8586 r4030_write_reg32(JAZZ_R4030_TRSTBL_LIM, VDMA_PGTBL_SIZE);
8687 r4030_write_reg32(JAZZ_R4030_TRSTBL_INV, 0);
8788
arch/mips/lantiq/irq.c+6−71
@@ -224,9 +224,11 @@ static struct irq_chip ltq_eiu_type = { · 223 unmodified lines
224224 .irq_set_type = ltq_eiu_settype,
225225 };
226226
227−static void ltq_hw_irqdispatch(int module)
227+static void ltq_hw_irq_handler(struct irq_desc *desc)
228228 {
229+ int module = irq_desc_get_irq(desc) - 2;
229230 u32 irq;
231+ int hwirq;
230232
231233 irq = ltq_icu_r32(module, LTQ_ICU_IM0_IOSR);
232234 if (irq == 0)
@@ -237,7 +239,8 @@ static void ltq_hw_irqdispatch(int module) · 4 unmodified lines
237239 * other bits might be bogus
238240 */
239241 irq = __fls(irq);
240− do_IRQ((int)irq + MIPS_CPU_IRQ_CASCADE + (INT_NUM_IM_OFFSET * module));
242+ hwirq = irq + MIPS_CPU_IRQ_CASCADE + (INT_NUM_IM_OFFSET * module);
243+ generic_handle_irq(irq_linear_revmap(ltq_domain, hwirq));
241244
242245 /* if this is a EBU irq, we need to ack it or get a deadlock */
243246 if ((irq == LTQ_ICU_EBU_IRQ) && (module == 0) && LTQ_EBU_PCC_ISTAT)
@@ -245,49 +248,6 @@ static void ltq_hw_irqdispatch(int module) · 1 unmodified line
245248 LTQ_EBU_PCC_ISTAT);
246249 }
247250
248−#define DEFINE_HWx_IRQDISPATCH(x) \
249− static void ltq_hw ## x ## _irqdispatch(void) \
250− { \
251− ltq_hw_irqdispatch(x); \
252− }
253−DEFINE_HWx_IRQDISPATCH(0)
254−DEFINE_HWx_IRQDISPATCH(1)
255−DEFINE_HWx_IRQDISPATCH(2)
256−DEFINE_HWx_IRQDISPATCH(3)
257−DEFINE_HWx_IRQDISPATCH(4)
258−
259−#if MIPS_CPU_TIMER_IRQ == 7
260−static void ltq_hw5_irqdispatch(void)
261−{
262− do_IRQ(MIPS_CPU_TIMER_IRQ);
263−}
264−#else
265−DEFINE_HWx_IRQDISPATCH(5)
266−#endif
267−
268−static void ltq_hw_irq_handler(struct irq_desc *desc)
269−{
270− ltq_hw_irqdispatch(irq_desc_get_irq(desc) - 2);
271−}
272−
273−asmlinkage void plat_irq_dispatch(void)
274−{
275− unsigned int pending = read_c0_status() & read_c0_cause() & ST0_IM;
276− int irq;
277−
278− if (!pending) {
279− spurious_interrupt();
280− return;
281− }
282−
283− pending >>= CAUSEB_IP;
284− while (pending) {
285− irq = fls(pending) - 1;
286− do_IRQ(MIPS_CPU_IRQ_BASE + irq);
287− pending &= ~BIT(irq);
288− }
289−}
290−
291251 static int icu_map(struct irq_domain *d, unsigned int irq, irq_hw_number_t hw)
292252 {
293253 struct irq_chip *chip = &ltq_irq_type;
@@ -343,38 +303,13 @@ int __init icu_of_init(struct device_node *node, struct device_node *parent) · 49 unmodified lines
343303 for (i = 0; i < MAX_IM; i++)
344304 irq_set_chained_handler(i + 2, ltq_hw_irq_handler);
345305
346− if (cpu_has_vint) {
347− pr_info("Setting up vectored interrupts\n");
348− set_vi_handler(2, ltq_hw0_irqdispatch);
349− set_vi_handler(3, ltq_hw1_irqdispatch);
350− set_vi_handler(4, ltq_hw2_irqdispatch);
351− set_vi_handler(5, ltq_hw3_irqdispatch);
352− set_vi_handler(6, ltq_hw4_irqdispatch);
353− set_vi_handler(7, ltq_hw5_irqdispatch);
354− }
355−
356306 ltq_domain = irq_domain_add_linear(node,
357307 (MAX_IM * INT_NUM_IM_OFFSET) + MIPS_CPU_IRQ_CASCADE,
358308 &irq_domain_ops, 0);
359309
360−#ifndef CONFIG_MIPS_MT_SMP
361− set_c0_status(IE_IRQ0 | IE_IRQ1 | IE_IRQ2 |
362− IE_IRQ3 | IE_IRQ4 | IE_IRQ5);
363−#else
364− set_c0_status(IE_SW0 | IE_SW1 | IE_IRQ0 | IE_IRQ1 |
365− IE_IRQ2 | IE_IRQ3 | IE_IRQ4 | IE_IRQ5);
366−#endif
367−
368310 /* tell oprofile which irq to use */
369311 ltq_perfcount_irq = irq_create_mapping(ltq_domain, LTQ_PERF_IRQ);
370312
371− /*
372− * if the timer irq is not one of the mips irqs we need to
373− * create a mapping
374− */
375− if (MIPS_CPU_TIMER_IRQ != 7)
376− irq_create_mapping(ltq_domain, MIPS_CPU_TIMER_IRQ);
377−
378313 /* the external interrupts are optional and xway only */
379314 eiu_node = of_find_compatible_node(NULL, NULL, "lantiq,eiu-xway");
380315 if (eiu_node && !of_address_to_resource(eiu_node, 0, &res)) {
@@ -411,7 +346,7 @@ EXPORT_SYMBOL_GPL(get_c0_perfcount_int); · 30 unmodified lines
411346
412347 unsigned int get_c0_compare_int(void)
413348 {
414− return MIPS_CPU_TIMER_IRQ;
349+ return CP0_LEGACY_COMPARE_IRQ;
415350 }
416351
417352 static struct of_device_id __initdata of_irq_ids[] = {
arch/mips/pci/msi-octeon.c+3−1
@@ -369,7 +369,9 @@ int __init octeon_msi_initialize(void) · 368 unmodified lines
369369 int irq;
370370 struct irq_chip *msi;
371371
372− if (octeon_dma_bar_type == OCTEON_DMA_BAR_TYPE_PCIE) {
372+ if (octeon_dma_bar_type == OCTEON_DMA_BAR_TYPE_INVALID) {
373+ return 0;
374+ } else if (octeon_dma_bar_type == OCTEON_DMA_BAR_TYPE_PCIE) {
373375 msi_rcv_reg[0] = CVMX_PEXP_NPEI_MSI_RCV0;
374376 msi_rcv_reg[1] = CVMX_PEXP_NPEI_MSI_RCV1;
375377 msi_rcv_reg[2] = CVMX_PEXP_NPEI_MSI_RCV2;
arch/nds32/Makefile+0−8
@@ -3,9 +3,6 @@ OBJCOPYFLAGS := -O binary -R .note -R .note.gnu.build-id -R .comment -S · 2 unmodified lines
33
44 KBUILD_DEFCONFIG := defconfig
55
6−comma = ,
7−
8−
96 ifdef CONFIG_FUNCTION_TRACER
107 arch-y += -malways-save-lp -mno-relax
118 endif
@@ -54,8 +51,6 @@ endif · 42 unmodified lines
5451 boot := arch/nds32/boot
5552 core-y += $(boot)/dts/
5653
57−.PHONY: FORCE
58−
5954 Image: vmlinux
6055 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
6156
@@ -68,9 +63,6 @@ prepare: vdso_prepare · 6 unmodified lines
6863 vdso_prepare: prepare0
6964 $(Q)$(MAKE) $(build)=arch/nds32/kernel/vdso include/generated/vdso-offsets.h
7065
71−CLEAN_FILES += include/asm-nds32/constants.h*
72−
73−# We use MRPROPER_FILES and CLEAN_FILES now
7466 archclean:
7567 $(Q)$(MAKE) $(clean)=$(boot)
7668
arch/openrisc/Makefile+0−3
@@ -20,7 +20,6 @@ · 19 unmodified lines
2020 KBUILD_DEFCONFIG := or1ksim_defconfig
2121
2222 OBJCOPYFLAGS := -O binary -R .note -R .comment -S
23−LDFLAGS_vmlinux :=
2423 LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
2524
2625 KBUILD_CFLAGS += -pipe -ffixed-r10 -D__linux__
@@ -50,5 +49,3 @@ else · 23 unmodified lines
5049 BUILTIN_DTB := n
5150 endif
5251 core-$(BUILTIN_DTB) += arch/openrisc/boot/dts/
53−
54−all: vmlinux
arch/openrisc/include/asm/Kbuild+1−0
@@ -34,6 +34,7 @@ generic-y += qrwlock_types.h · 33 unmodified lines
3434 generic-y += qrwlock.h
3535 generic-y += sections.h
3636 generic-y += segment.h
37+generic-y += shmparam.h
3738 generic-y += string.h
3839 generic-y += switch_to.h
3940 generic-y += topology.h
arch/openrisc/include/uapi/asm/Kbuild+0−1
@@ -1,5 +1,4 @@
11 include include/uapi/asm-generic/Kbuild.asm
22
33 generic-y += kvm_para.h
4−generic-y += shmparam.h
54 generic-y += ucontext.h
arch/powerpc/include/uapi/asm/perf_regs.h+1−0
@@ -47,6 +47,7 @@ enum perf_event_powerpc_regs { · 46 unmodified lines
4747 PERF_REG_POWERPC_DAR,
4848 PERF_REG_POWERPC_DSISR,
4949 PERF_REG_POWERPC_SIER,
50+ PERF_REG_POWERPC_MMCRA,
5051 PERF_REG_POWERPC_MAX,
5152 };
5253 #endif /* _UAPI_ASM_POWERPC_PERF_REGS_H */
arch/powerpc/kernel/head_8xx.S+2−1
@@ -852,11 +852,12 @@ start_here: · 851 unmodified lines
852852
853853 /* set up the PTE pointers for the Abatron bdiGDB.
854854 */
855− tovirt(r6,r6)
856855 lis r5, abatron_pteptrs@h
857856 ori r5, r5, abatron_pteptrs@l
858857 stw r5, 0xf0(0) /* Must match your Abatron config file */
859858 tophys(r5,r5)
859+ lis r6, swapper_pg_dir@h
860+ ori r6, r6, swapper_pg_dir@l
860861 stw r6, 0(r5)
861862
862863 /* Now turn on the MMU for real! */
arch/powerpc/kernel/signal_64.c+4−3
@@ -755,11 +755,12 @@ SYSCALL_DEFINE0(rt_sigreturn) · 754 unmodified lines
755755 if (restore_tm_sigcontexts(current, &uc->uc_mcontext,
756756 &uc_transact->uc_mcontext))
757757 goto badframe;
758− }
758+ } else
759759 #endif
760− /* Fall through, for non-TM restore */
761− if (!MSR_TM_ACTIVE(msr)) {
760+ {
762761 /*
762+ * Fall through, for non-TM restore
763+ *
763764 * Unset MSR[TS] on the thread regs since MSR from user
764765 * context does not have MSR active, and recheckpoint was
765766 * not called since restore_tm_sigcontexts() was not called
arch/powerpc/kernel/trace/ftrace.c+0−7
@@ -967,13 +967,6 @@ out: · 966 unmodified lines
967967 }
968968 #endif /* CONFIG_FUNCTION_GRAPH_TRACER */
969969
970−#if defined(CONFIG_FTRACE_SYSCALLS) && defined(CONFIG_PPC64)
971−unsigned long __init arch_syscall_addr(int nr)
972−{
973− return sys_call_table[nr*2];
974−}
975−#endif /* CONFIG_FTRACE_SYSCALLS && CONFIG_PPC64 */
976−
977970 #ifdef PPC64_ELF_ABI_v1
978971 char *arch_ftrace_match_adjust(char *str, const char *search)
979972 {
arch/powerpc/perf/perf_regs.c+6−0
@@ -70,6 +70,7 @@ static unsigned int pt_regs_offset[PERF_REG_POWERPC_MAX] = { · 69 unmodified lines
7070 PT_REGS_OFFSET(PERF_REG_POWERPC_DAR, dar),
7171 PT_REGS_OFFSET(PERF_REG_POWERPC_DSISR, dsisr),
7272 PT_REGS_OFFSET(PERF_REG_POWERPC_SIER, dar),
73+ PT_REGS_OFFSET(PERF_REG_POWERPC_MMCRA, dsisr),
7374 };
7475
7576 u64 perf_reg_value(struct pt_regs *regs, int idx)
@@ -83,6 +84,11 @@ u64 perf_reg_value(struct pt_regs *regs, int idx) · 7 unmodified lines
8384 !is_sier_available()))
8485 return 0;
8586
87+ if (idx == PERF_REG_POWERPC_MMCRA &&
88+ (IS_ENABLED(CONFIG_FSL_EMB_PERF_EVENT) ||
89+ IS_ENABLED(CONFIG_PPC32)))
90+ return 0;
91+
8692 return regs_get_register(regs, pt_regs_offset[idx]);
8793 }
8894
arch/powerpc/platforms/4xx/ocm.c+3−3
@@ -237,12 +237,12 @@ static int ocm_debugfs_show(struct seq_file *m, void *v) · 236 unmodified lines
237237 continue;
238238
239239 seq_printf(m, "PPC4XX OCM : %d\n", ocm->index);
240− seq_printf(m, "PhysAddr : %pa[p]\n", &(ocm->phys));
240+ seq_printf(m, "PhysAddr : %pa\n", &(ocm->phys));
241241 seq_printf(m, "MemTotal : %d Bytes\n", ocm->memtotal);
242242 seq_printf(m, "MemTotal(NC) : %d Bytes\n", ocm->nc.memtotal);
243243 seq_printf(m, "MemTotal(C) : %d Bytes\n\n", ocm->c.memtotal);
244244
245− seq_printf(m, "NC.PhysAddr : %pa[p]\n", &(ocm->nc.phys));
245+ seq_printf(m, "NC.PhysAddr : %pa\n", &(ocm->nc.phys));
246246 seq_printf(m, "NC.VirtAddr : 0x%p\n", ocm->nc.virt);
247247 seq_printf(m, "NC.MemTotal : %d Bytes\n", ocm->nc.memtotal);
248248 seq_printf(m, "NC.MemFree : %d Bytes\n", ocm->nc.memfree);
@@ -252,7 +252,7 @@ static int ocm_debugfs_show(struct seq_file *m, void *v) · 3 unmodified lines
252252 blk->size, blk->owner);
253253 }
254254
255− seq_printf(m, "\nC.PhysAddr : %pa[p]\n", &(ocm->c.phys));
255+ seq_printf(m, "\nC.PhysAddr : %pa\n", &(ocm->c.phys));
256256 seq_printf(m, "C.VirtAddr : 0x%p\n", ocm->c.virt);
257257 seq_printf(m, "C.MemTotal : %d Bytes\n", ocm->c.memtotal);
258258 seq_printf(m, "C.MemFree : %d Bytes\n", ocm->c.memfree);
arch/powerpc/platforms/chrp/setup.c+1−2
@@ -538,8 +538,7 @@ static void __init chrp_init_IRQ(void) · 537 unmodified lines
538538 /* see if there is a keyboard in the device tree
539539 with a parent of type "adb" */
540540 for_each_node_by_name(kbd, "keyboard")
541− if (kbd->parent && kbd->parent->type
542− && strcmp(kbd->parent->type, "adb") == 0)
541+ if (of_node_is_type(kbd->parent, "adb"))
543542 break;
544543 of_node_put(kbd);
545544 if (kbd)
arch/powerpc/platforms/powernv/npu-dma.c+1−1
@@ -564,7 +564,7 @@ struct iommu_table_group *pnv_try_setup_npu_table_group(struct pnv_ioda_pe *pe) · 563 unmodified lines
564564 }
565565 } else {
566566 /* Create a group for 1 GPU and attached NPUs for POWER8 */
567− pe->npucomp = kzalloc(sizeof(pe->npucomp), GFP_KERNEL);
567+ pe->npucomp = kzalloc(sizeof(*pe->npucomp), GFP_KERNEL);
568568 table_group = &pe->npucomp->table_group;
569569 table_group->ops = &pnv_npu_peers_ops;
570570 iommu_register_group(table_group, hose->global_number,
arch/powerpc/platforms/powernv/pci-ioda.c+2−1
@@ -2681,7 +2681,8 @@ static void pnv_pci_ioda_setup_iommu_api(void) · 2680 unmodified lines
26812681 list_for_each_entry(hose, &hose_list, list_node) {
26822682 phb = hose->private_data;
26832683
2684− if (phb->type == PNV_PHB_NPU_NVLINK)
2684+ if (phb->type == PNV_PHB_NPU_NVLINK ||
2685+ phb->type == PNV_PHB_NPU_OCAPI)
26852686 continue;
26862687
26872688 list_for_each_entry(pe, &phb->ioda.pe_list, list) {
arch/powerpc/platforms/pseries/pci.c+2−0
@@ -264,7 +264,9 @@ void __init pSeries_final_fixup(void) · 263 unmodified lines
264264 if (!of_device_is_compatible(nvdn->parent,
265265 "ibm,power9-npu"))
266266 continue;
267+#ifdef CONFIG_PPC_POWERNV
267268 WARN_ON_ONCE(pnv_npu2_init(hose));
269+#endif
268270 break;
269271 }
270272 }
arch/riscv/Kconfig+1−1
@@ -103,7 +103,7 @@ choice · 102 unmodified lines
103103 prompt "Base ISA"
104104 default ARCH_RV64I
105105 help
106− This selects the base ISA that this kernel will traget and must match
106+ This selects the base ISA that this kernel will target and must match
107107 the target platform.
108108
109109 config ARCH_RV32I
arch/riscv/configs/defconfig+5−3
@@ -13,8 +13,6 @@ CONFIG_BLK_DEV_INITRD=y · 12 unmodified lines
1313 CONFIG_EXPERT=y
1414 CONFIG_BPF_SYSCALL=y
1515 CONFIG_SMP=y
16−CONFIG_PCI=y
17−CONFIG_PCIE_XILINX=y
1816 CONFIG_MODULES=y
1917 CONFIG_MODULE_UNLOAD=y
2018 CONFIG_NET=y
@@ -28,6 +26,10 @@ CONFIG_IP_PNP_DHCP=y · 7 unmodified lines
2826 CONFIG_IP_PNP_BOOTP=y
2927 CONFIG_IP_PNP_RARP=y
3028 CONFIG_NETLINK_DIAG=y
29+CONFIG_PCI=y
30+CONFIG_PCIEPORTBUS=y
31+CONFIG_PCI_HOST_GENERIC=y
32+CONFIG_PCIE_XILINX=y
3133 CONFIG_DEVTMPFS=y
3234 CONFIG_BLK_DEV_LOOP=y
3335 CONFIG_VIRTIO_BLK=y
@@ -63,7 +65,6 @@ CONFIG_USB_STORAGE=y · 29 unmodified lines
6365 CONFIG_USB_UAS=y
6466 CONFIG_VIRTIO_MMIO=y
6567 CONFIG_SIFIVE_PLIC=y
66−CONFIG_RAS=y
6768 CONFIG_EXT4_FS=y
6869 CONFIG_EXT4_FS_POSIX_ACL=y
6970 CONFIG_AUTOFS4_FS=y
@@ -77,5 +78,6 @@ CONFIG_NFS_V4_1=y · 7 unmodified lines
7778 CONFIG_NFS_V4_2=y
7879 CONFIG_ROOT_NFS=y
7980 CONFIG_CRYPTO_USER_API_HASH=y
81+CONFIG_CRYPTO_DEV_VIRTIO=y
8082 CONFIG_PRINTK_TIME=y
8183 # CONFIG_RCU_TRACE is not set
arch/riscv/include/asm/page.h+1−1
@@ -80,7 +80,7 @@ typedef struct page *pgtable_t; · 79 unmodified lines
8080 #define __pgd(x) ((pgd_t) { (x) })
8181 #define __pgprot(x) ((pgprot_t) { (x) })
8282
83−#ifdef CONFIG_64BITS
83+#ifdef CONFIG_64BIT
8484 #define PTE_FMT "%016lx"
8585 #else
8686 #define PTE_FMT "%08lx"
arch/riscv/include/asm/processor.h+1−1
@@ -22,7 +22,7 @@ · 21 unmodified lines
2222 * This decides where the kernel will search for a free chunk of vm
2323 * space during mmap's.
2424 */
25−#define TASK_UNMAPPED_BASE PAGE_ALIGN(TASK_SIZE >> 1)
25+#define TASK_UNMAPPED_BASE PAGE_ALIGN(TASK_SIZE / 3)
2626
2727 #define STACK_TOP TASK_SIZE
2828 #define STACK_TOP_MAX STACK_TOP
arch/riscv/kernel/asm-offsets.c+1−0
@@ -39,6 +39,7 @@ void asm_offsets(void) · 38 unmodified lines
3939 OFFSET(TASK_STACK, task_struct, stack);
4040 OFFSET(TASK_TI, task_struct, thread_info);
4141 OFFSET(TASK_TI_FLAGS, task_struct, thread_info.flags);
42+ OFFSET(TASK_TI_PREEMPT_COUNT, task_struct, thread_info.preempt_count);
4243 OFFSET(TASK_TI_KERNEL_SP, task_struct, thread_info.kernel_sp);
4344 OFFSET(TASK_TI_USER_SP, task_struct, thread_info.user_sp);
4445 OFFSET(TASK_TI_CPU, task_struct, thread_info.cpu);
arch/riscv/kernel/entry.S+17−1
@@ -144,6 +144,10 @@ _save_context: · 143 unmodified lines
144144 REG_L x2, PT_SP(sp)
145145 .endm
146146
147+#if !IS_ENABLED(CONFIG_PREEMPT)
148+.set resume_kernel, restore_all
149+#endif
150+
147151 ENTRY(handle_exception)
148152 SAVE_ALL
149153
@@ -228,7 +232,7 @@ ret_from_exception: · 78 unmodified lines
228232 REG_L s0, PT_SSTATUS(sp)
229233 csrc sstatus, SR_SIE
230234 andi s0, s0, SR_SPP
231− bnez s0, restore_all
235+ bnez s0, resume_kernel
232236
233237 resume_userspace:
234238 /* Interrupts must be disabled here so flags are checked atomically */
@@ -250,6 +254,18 @@ restore_all: · 15 unmodified lines
250254 RESTORE_ALL
251255 sret
252256
257+#if IS_ENABLED(CONFIG_PREEMPT)
258+resume_kernel:
259+ REG_L s0, TASK_TI_PREEMPT_COUNT(tp)
260+ bnez s0, restore_all
261+need_resched:
262+ REG_L s0, TASK_TI_FLAGS(tp)
263+ andi s0, s0, _TIF_NEED_RESCHED
264+ beqz s0, restore_all
265+ call preempt_schedule_irq
266+ j need_resched
267+#endif
268+
253269 work_pending:
254270 /* Enter slow path for supplementary processing */
255271 la ra, ret_from_exception
arch/riscv/kernel/setup.c+1−1
@@ -181,7 +181,7 @@ static void __init setup_bootmem(void) · 180 unmodified lines
181181 BUG_ON(mem_size == 0);
182182
183183 set_max_mapnr(PFN_DOWN(mem_size));
184− max_low_pfn = memblock_end_of_DRAM();
184+ max_low_pfn = PFN_DOWN(memblock_end_of_DRAM());
185185
186186 #ifdef CONFIG_BLK_DEV_INITRD
187187 setup_initrd();
arch/riscv/kernel/smpboot.c+1−5
@@ -57,15 +57,12 @@ void __init setup_smp(void) · 56 unmodified lines
5757
5858 while ((dn = of_find_node_by_type(dn, "cpu"))) {
5959 hart = riscv_of_processor_hartid(dn);
60− if (hart < 0) {
61− of_node_put(dn);
60+ if (hart < 0)
6261 continue;
63− }
6462
6563 if (hart == cpuid_to_hartid_map(0)) {
6664 BUG_ON(found_boot_cpu);
6765 found_boot_cpu = 1;
68− of_node_put(dn);
6966 continue;
7067 }
7168
@@ -73,7 +70,6 @@ void __init setup_smp(void) · 1 unmodified line
7370 set_cpu_possible(cpuid, true);
7471 set_cpu_present(cpuid, true);
7572 cpuid++;
76− of_node_put(dn);
7773 }
7874
7975 BUG_ON(!found_boot_cpu);
arch/riscv/mm/init.c+2−1
@@ -28,7 +28,8 @@ static void __init zone_sizes_init(void) · 27 unmodified lines
2828 unsigned long max_zone_pfns[MAX_NR_ZONES] = { 0, };
2929
3030 #ifdef CONFIG_ZONE_DMA32
31− max_zone_pfns[ZONE_DMA32] = PFN_DOWN(min(4UL * SZ_1G, max_low_pfn));
31+ max_zone_pfns[ZONE_DMA32] = PFN_DOWN(min(4UL * SZ_1G,
32+ (unsigned long) PFN_PHYS(max_low_pfn)));
3233 #endif
3334 max_zone_pfns[ZONE_NORMAL] = max_low_pfn;
3435
arch/s390/include/asm/mmu_context.h+3−4
@@ -25,7 +25,7 @@ static inline int init_new_context(struct task_struct *tsk, · 24 unmodified lines
2525 atomic_set(&mm->context.flush_count, 0);
2626 mm->context.gmap_asce = 0;
2727 mm->context.flush_mm = 0;
28− mm->context.compat_mm = 0;
28+ mm->context.compat_mm = test_thread_flag(TIF_31BIT);
2929 #ifdef CONFIG_PGSTE
3030 mm->context.alloc_pgste = page_table_allocate_pgste ||
3131 test_thread_flag(TIF_PGSTE) ||
@@ -90,8 +90,6 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, · 58 unmodified lines
9090 {
9191 int cpu = smp_processor_id();
9292
93− if (prev == next)
94− return;
9593 S390_lowcore.user_asce = next->context.asce;
9694 cpumask_set_cpu(cpu, &next->context.cpu_attach_mask);
9795 /* Clear previous user-ASCE from CR1 and CR7 */
@@ -103,7 +101,8 @@ static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next, · 5 unmodified lines
103101 __ctl_load(S390_lowcore.vdso_asce, 7, 7);
104102 clear_cpu_flag(CIF_ASCE_SECONDARY);
105103 }
106− cpumask_clear_cpu(cpu, &prev->context.cpu_attach_mask);
104+ if (prev != next)
105+ cpumask_clear_cpu(cpu, &prev->context.cpu_attach_mask);
107106 }
108107
109108 #define finish_arch_post_lock_switch finish_arch_post_lock_switch
arch/s390/kernel/early.c+2−2
@@ -63,10 +63,10 @@ static noinline __init void detect_machine_type(void) · 62 unmodified lines
6363 if (stsi(vmms, 3, 2, 2) || !vmms->count)
6464 return;
6565
66− /* Running under KVM? If not we assume z/VM */
66+ /* Detect known hypervisors */
6767 if (!memcmp(vmms->vm[0].cpi, "\xd2\xe5\xd4", 3))
6868 S390_lowcore.machine_flags |= MACHINE_FLAG_KVM;
69− else
69+ else if (!memcmp(vmms->vm[0].cpi, "\xa9\x61\xe5\xd4", 4))
7070 S390_lowcore.machine_flags |= MACHINE_FLAG_VM;
7171 }
7272
arch/s390/kernel/setup.c+2−0
@@ -1006,6 +1006,8 @@ void __init setup_arch(char **cmdline_p) · 1005 unmodified lines
10061006 pr_info("Linux is running under KVM in 64-bit mode\n");
10071007 else if (MACHINE_IS_LPAR)
10081008 pr_info("Linux is running natively in 64-bit mode\n");
1009+ else
1010+ pr_info("Linux is running as a guest in 64-bit mode\n");
10091011
10101012 /* Have one command line that is parsed and saved in /proc/cmdline */
10111013 /* boot_command_line has been already set up in early.c */
arch/s390/kernel/smp.c+10−1
@@ -381,8 +381,13 @@ void smp_call_online_cpu(void (*func)(void *), void *data) · 380 unmodified lines
381381 */
382382 void smp_call_ipl_cpu(void (*func)(void *), void *data)
383383 {
384+ struct lowcore *lc = pcpu_devices->lowcore;
385+
386+ if (pcpu_devices[0].address == stap())
387+ lc = &S390_lowcore;
388+
384389 pcpu_delegate(&pcpu_devices[0], func, data,
385− pcpu_devices->lowcore->nodat_stack);
390+ lc->nodat_stack);
386391 }
387392
388393 int smp_find_processor_id(u16 address)
@@ -1166,7 +1171,11 @@ static ssize_t __ref rescan_store(struct device *dev, · 777 unmodified lines
11661171 {
11671172 int rc;
11681173
1174+ rc = lock_device_hotplug_sysfs();
1175+ if (rc)
1176+ return rc;
11691177 rc = smp_rescan_cpus();
1178+ unlock_device_hotplug();
11701179 return rc ? rc : count;
11711180 }
11721181 static DEVICE_ATTR_WO(rescan);
arch/s390/kernel/vdso.c+2−3
@@ -224,10 +224,9 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp) · 223 unmodified lines
224224
225225 vdso_pages = vdso64_pages;
226226 #ifdef CONFIG_COMPAT
227− if (is_compat_task()) {
227+ mm->context.compat_mm = is_compat_task();
228+ if (mm->context.compat_mm)
228229 vdso_pages = vdso32_pages;
229− mm->context.compat_mm = 1;
230− }
231230 #endif
232231 /*
233232 * vDSO has a problem and was disabled, just don't "enable" it for
arch/unicore32/include/asm/Kbuild+1−0
@@ -28,6 +28,7 @@ generic-y += preempt.h · 27 unmodified lines
2828 generic-y += sections.h
2929 generic-y += segment.h
3030 generic-y += serial.h
31+generic-y += shmparam.h
3132 generic-y += sizes.h
3233 generic-y += syscalls.h
3334 generic-y += topology.h
arch/unicore32/include/uapi/asm/Kbuild+0−1
@@ -1,5 +1,4 @@
11 include include/uapi/asm-generic/Kbuild.asm
22
33 generic-y += kvm_para.h
4−generic-y += shmparam.h
54 generic-y += ucontext.h
arch/x86/Kconfig+5−5
@@ -198,7 +198,7 @@ config X86 · 197 unmodified lines
198198 select IRQ_FORCED_THREADING
199199 select NEED_SG_DMA_LENGTH
200200 select PCI_DOMAINS if PCI
201− select PCI_LOCKLESS_CONFIG
201+ select PCI_LOCKLESS_CONFIG if PCI
202202 select PERF_EVENTS
203203 select RTC_LIB
204204 select RTC_MC146818_LIB
@@ -446,12 +446,12 @@ config RETPOLINE · 241 unmodified lines
446446 branches. Requires a compiler with -mindirect-branch=thunk-extern
447447 support for full protection. The kernel may run slower.
448448
449−config X86_RESCTRL
450− bool "Resource Control support"
449+config X86_CPU_RESCTRL
450+ bool "x86 CPU resource control support"
451451 depends on X86 && (CPU_SUP_INTEL || CPU_SUP_AMD)
452452 select KERNFS
453453 help
454− Enable Resource Control support.
454+ Enable x86 CPU resource control support.
455455
456456 Provide support for the allocation and monitoring of system resources
457457 usage by the CPU.
@@ -617,7 +617,7 @@ config X86_INTEL_QUARK · 159 unmodified lines
617617
618618 config X86_INTEL_LPSS
619619 bool "Intel Low Power Subsystem Support"
620− depends on X86 && ACPI
620+ depends on X86 && ACPI && PCI
621621 select COMMON_CLK
622622 select PINCTRL
623623 select IOSF_MBI
arch/x86/boot/compressed/head_64.S+8−0
@@ -600,6 +600,14 @@ ENTRY(trampoline_32bit_src) · 599 unmodified lines
600600 leal TRAMPOLINE_32BIT_PGTABLE_OFFSET(%ecx), %eax
601601 movl %eax, %cr3
602602 3:
603+ /* Set EFER.LME=1 as a precaution in case hypervsior pulls the rug */
604+ pushl %ecx
605+ movl $MSR_EFER, %ecx
606+ rdmsr
607+ btsl $_EFER_LME, %eax
608+ wrmsr
609+ popl %ecx
610+
603611 /* Enable PAE and LA57 (if required) paging modes */
604612 movl $X86_CR4_PAE, %eax
605613 cmpl $0, %edx
arch/x86/boot/compressed/pgtable.h+1−1
@@ -6,7 +6,7 @@ · 5 unmodified lines
66 #define TRAMPOLINE_32BIT_PGTABLE_OFFSET 0
77
88 #define TRAMPOLINE_32BIT_CODE_OFFSET PAGE_SIZE
9−#define TRAMPOLINE_32BIT_CODE_SIZE 0x60
9+#define TRAMPOLINE_32BIT_CODE_SIZE 0x70
1010
1111 #define TRAMPOLINE_32BIT_STACK_END TRAMPOLINE_32BIT_SIZE
1212
arch/x86/entry/entry_64_compat.S+4−2
@@ -361,7 +361,8 @@ ENTRY(entry_INT80_compat) · 360 unmodified lines
361361
362362 /* Need to switch before accessing the thread stack. */
363363 SWITCH_TO_KERNEL_CR3 scratch_reg=%rdi
364− movq %rsp, %rdi
364+ /* In the Xen PV case we already run on the thread stack. */
365+ ALTERNATIVE "movq %rsp, %rdi", "jmp .Lint80_keep_stack", X86_FEATURE_XENPV
365366 movq PER_CPU_VAR(cpu_current_top_of_stack), %rsp
366367
367368 pushq 6*8(%rdi) /* regs->ss */
@@ -370,8 +371,9 @@ ENTRY(entry_INT80_compat) · 2 unmodified lines
370371 pushq 3*8(%rdi) /* regs->cs */
371372 pushq 2*8(%rdi) /* regs->ip */
372373 pushq 1*8(%rdi) /* regs->orig_ax */
373−
374374 pushq (%rdi) /* pt_regs->di */
375+.Lint80_keep_stack:
376+
375377 pushq %rsi /* pt_regs->si */
376378 xorl %esi, %esi /* nospec si */
377379 pushq %rdx /* pt_regs->dx */
arch/x86/include/asm/intel-family.h+2−1
@@ -6,7 +6,7 @@ · 5 unmodified lines
66 * "Big Core" Processors (Branded as Core, Xeon, etc...)
77 *
88 * The "_X" parts are generally the EP and EX Xeons, or the
9− * "Extreme" ones, like Broadwell-E.
9+ * "Extreme" ones, like Broadwell-E, or Atom microserver.
1010 *
1111 * While adding a new CPUID for a new microarchitecture, add a new
1212 * group to keep logically sorted out in chronological order. Within
@@ -71,6 +71,7 @@ · 58 unmodified lines
7171 #define INTEL_FAM6_ATOM_GOLDMONT 0x5C /* Apollo Lake */
7272 #define INTEL_FAM6_ATOM_GOLDMONT_X 0x5F /* Denverton */
7373 #define INTEL_FAM6_ATOM_GOLDMONT_PLUS 0x7A /* Gemini Lake */
74+#define INTEL_FAM6_ATOM_TREMONT_X 0x86 /* Jacobsville */
7475
7576 /* Xeon Phi */
7677
arch/x86/include/asm/mmu_context.h+18−0
@@ -178,6 +178,10 @@ static inline void switch_ldt(struct mm_struct *prev, struct mm_struct *next) · 177 unmodified lines
178178
179179 void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk);
180180
181+/*
182+ * Init a new mm. Used on mm copies, like at fork()
183+ * and on mm's that are brand-new, like at execve().
184+ */
181185 static inline int init_new_context(struct task_struct *tsk,
182186 struct mm_struct *mm)
183187 {
@@ -228,8 +232,22 @@ do { \ · 44 unmodified lines
228232 } while (0)
229233 #endif
230234
235+static inline void arch_dup_pkeys(struct mm_struct *oldmm,
236+ struct mm_struct *mm)
237+{
238+#ifdef CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS
239+ if (!cpu_feature_enabled(X86_FEATURE_OSPKE))
240+ return;
241+
242+ /* Duplicate the oldmm pkey state in mm: */
243+ mm->context.pkey_allocation_map = oldmm->context.pkey_allocation_map;
244+ mm->context.execute_only_pkey = oldmm->context.execute_only_pkey;
245+#endif
246+}
247+
231248 static inline int arch_dup_mmap(struct mm_struct *oldmm, struct mm_struct *mm)
232249 {
250+ arch_dup_pkeys(oldmm, mm);
233251 paravirt_arch_dup_mmap(oldmm, mm);
234252 return ldt_dup_context(oldmm, mm);
235253 }
arch/x86/include/asm/page_64_types.h+4−0
@@ -7,7 +7,11 @@ · 6 unmodified lines
77 #endif
88
99 #ifdef CONFIG_KASAN
10+#ifdef CONFIG_KASAN_EXTRA
11+#define KASAN_STACK_ORDER 2
12+#else
1013 #define KASAN_STACK_ORDER 1
14+#endif
1115 #else
1216 #define KASAN_STACK_ORDER 0
1317 #endif
arch/x86/include/asm/resctrl_sched.h+2−2
@@ -2,7 +2,7 @@ · 1 unmodified line
22 #ifndef _ASM_X86_RESCTRL_SCHED_H
33 #define _ASM_X86_RESCTRL_SCHED_H
44
5−#ifdef CONFIG_X86_RESCTRL
5+#ifdef CONFIG_X86_CPU_RESCTRL
66
77 #include <linux/sched.h>
88 #include <linux/jump_label.h>
@@ -88,6 +88,6 @@ static inline void resctrl_sched_in(void) · 79 unmodified lines
8888
8989 static inline void resctrl_sched_in(void) {}
9090
91−#endif /* CONFIG_X86_RESCTRL */
91+#endif /* CONFIG_X86_CPU_RESCTRL */
9292
9393 #endif /* _ASM_X86_RESCTRL_SCHED_H */
arch/x86/include/asm/uaccess.h+1−1
@@ -711,7 +711,7 @@ static __must_check inline bool user_access_begin(const void __user *ptr, size_t · 710 unmodified lines
711711 {
712712 if (unlikely(!access_ok(ptr,len)))
713713 return 0;
714− __uaccess_begin();
714+ __uaccess_begin_nospec();
715715 return 1;
716716 }
717717 #define user_access_begin(a,b) user_access_begin(a,b)
arch/x86/kernel/cpu/Makefile+1−1
@@ -39,7 +39,7 @@ obj-$(CONFIG_CPU_SUP_UMC_32) += umc.o · 38 unmodified lines
3939 obj-$(CONFIG_X86_MCE) += mce/
4040 obj-$(CONFIG_MTRR) += mtrr/
4141 obj-$(CONFIG_MICROCODE) += microcode/
42−obj-$(CONFIG_X86_RESCTRL) += resctrl/
42+obj-$(CONFIG_X86_CPU_RESCTRL) += resctrl/
4343
4444 obj-$(CONFIG_X86_LOCAL_APIC) += perfctr-watchdog.o
4545
arch/x86/kernel/cpu/bugs.c+1−1
@@ -71,7 +71,7 @@ void __init check_bugs(void) · 70 unmodified lines
7171 * identify_boot_cpu() initialized SMT support information, let the
7272 * core code know.
7373 */
74− cpu_smt_check_topology_early();
74+ cpu_smt_check_topology();
7575
7676 if (!IS_ENABLED(CONFIG_SMP)) {
7777 pr_info("CPU: ");
arch/x86/kernel/cpu/microcode/amd.c+1−1
@@ -855,7 +855,7 @@ load_microcode_amd(bool save, u8 family, const u8 *data, size_t size) · 854 unmodified lines
855855 if (!p) {
856856 return ret;
857857 } else {
858− if (boot_cpu_data.microcode == p->patch_id)
858+ if (boot_cpu_data.microcode >= p->patch_id)
859859 return ret;
860860
861861 ret = UCODE_NEW;
arch/x86/kernel/cpu/resctrl/Makefile+2−2
@@ -1,4 +1,4 @@
11 # SPDX-License-Identifier: GPL-2.0
2−obj-$(CONFIG_X86_RESCTRL) += core.o rdtgroup.o monitor.o
3−obj-$(CONFIG_X86_RESCTRL) += ctrlmondata.o pseudo_lock.o
2+obj-$(CONFIG_X86_CPU_RESCTRL) += core.o rdtgroup.o monitor.o
3+obj-$(CONFIG_X86_CPU_RESCTRL) += ctrlmondata.o pseudo_lock.o
44 CFLAGS_pseudo_lock.o = -I$(src)
arch/x86/kernel/crash.c+1−0
@@ -470,6 +470,7 @@ int crash_load_segments(struct kimage *image) · 469 unmodified lines
470470
471471 kbuf.memsz = kbuf.bufsz;
472472 kbuf.buf_align = ELF_CORE_HEADER_ALIGN;
473+ kbuf.mem = KEXEC_BUF_MEM_UNKNOWN;
473474 ret = kexec_add_buffer(&kbuf);
474475 if (ret) {
475476 vfree((void *)image->arch.elf_headers);
arch/x86/kernel/hpet.c+0−4
@@ -21,10 +21,6 @@ · 20 unmodified lines
2121
2222 #define HPET_MASK CLOCKSOURCE_MASK(32)
2323
24−/* FSEC = 10^-15
25− NSEC = 10^-9 */
26−#define FSEC_PER_NSEC 1000000L
27−
2824 #define HPET_DEV_USED_BIT 2
2925 #define HPET_DEV_USED (1 << HPET_DEV_USED_BIT)
3026 #define HPET_DEV_VALID 0x8
arch/x86/kernel/kexec-bzimage64.c+5−0
@@ -167,6 +167,9 @@ setup_efi_state(struct boot_params *params, unsigned long params_load_addr, · 166 unmodified lines
167167 struct efi_info *current_ei = &boot_params.efi_info;
168168 struct efi_info *ei = &params->efi_info;
169169
170+ if (!efi_enabled(EFI_RUNTIME_SERVICES))
171+ return 0;
172+
170173 if (!current_ei->efi_memmap_size)
171174 return 0;
172175
@@ -434,6 +437,7 @@ static void *bzImage64_load(struct kimage *image, char *kernel, · 261 unmodified lines
434437 kbuf.memsz = PAGE_ALIGN(header->init_size);
435438 kbuf.buf_align = header->kernel_alignment;
436439 kbuf.buf_min = MIN_KERNEL_LOAD_ADDR;
440+ kbuf.mem = KEXEC_BUF_MEM_UNKNOWN;
437441 ret = kexec_add_buffer(&kbuf);
438442 if (ret)
439443 goto out_free_params;
@@ -448,6 +452,7 @@ static void *bzImage64_load(struct kimage *image, char *kernel, · 8 unmodified lines
448452 kbuf.bufsz = kbuf.memsz = initrd_len;
449453 kbuf.buf_align = PAGE_SIZE;
450454 kbuf.buf_min = MIN_INITRD_LOAD_ADDR;
455+ kbuf.mem = KEXEC_BUF_MEM_UNKNOWN;
451456 ret = kexec_add_buffer(&kbuf);
452457 if (ret)
453458 goto out_free_params;
arch/x86/kernel/kvm.c+5−2
@@ -457,6 +457,7 @@ static void __send_ipi_mask(const struct cpumask *mask, int vector) · 456 unmodified lines
457457 #else
458458 u64 ipi_bitmap = 0;
459459 #endif
460+ long ret;
460461
461462 if (cpumask_empty(mask))
462463 return;
@@ -482,8 +483,9 @@ static void __send_ipi_mask(const struct cpumask *mask, int vector) · 19 unmodified lines
482483 } else if (apic_id < min + KVM_IPI_CLUSTER_SIZE) {
483484 max = apic_id < max ? max : apic_id;
484485 } else {
485− kvm_hypercall4(KVM_HC_SEND_IPI, (unsigned long)ipi_bitmap,
486+ ret = kvm_hypercall4(KVM_HC_SEND_IPI, (unsigned long)ipi_bitmap,
486487 (unsigned long)(ipi_bitmap >> BITS_PER_LONG), min, icr);
488+ WARN_ONCE(ret < 0, "KVM: failed to send PV IPI: %ld", ret);
487489 min = max = apic_id;
488490 ipi_bitmap = 0;
489491 }
@@ -491,8 +493,9 @@ static void __send_ipi_mask(const struct cpumask *mask, int vector) · 1 unmodified line
491493 }
492494
493495 if (ipi_bitmap) {
494− kvm_hypercall4(KVM_HC_SEND_IPI, (unsigned long)ipi_bitmap,
496+ ret = kvm_hypercall4(KVM_HC_SEND_IPI, (unsigned long)ipi_bitmap,
495497 (unsigned long)(ipi_bitmap >> BITS_PER_LONG), min, icr);
498+ WARN_ONCE(ret < 0, "KVM: failed to send PV IPI: %ld", ret);
496499 }
497500
498501 local_irq_restore(flags);
arch/x86/kernel/tsc.c+16−14
@@ -297,15 +297,16 @@ static int __init tsc_setup(char *str) · 296 unmodified lines
297297
298298 __setup("tsc=", tsc_setup);
299299
300−#define MAX_RETRIES 5
301−#define SMI_TRESHOLD 50000
300+#define MAX_RETRIES 5
301+#define TSC_DEFAULT_THRESHOLD 0x20000
302302
303303 /*
304− * Read TSC and the reference counters. Take care of SMI disturbance
304+ * Read TSC and the reference counters. Take care of any disturbances
305305 */
306306 static u64 tsc_read_refs(u64 *p, int hpet)
307307 {
308308 u64 t1, t2;
309+ u64 thresh = tsc_khz ? tsc_khz >> 5 : TSC_DEFAULT_THRESHOLD;
309310 int i;
310311
311312 for (i = 0; i < MAX_RETRIES; i++) {
@@ -315,7 +316,7 @@ static u64 tsc_read_refs(u64 *p, int hpet) · 3 unmodified lines
315316 else
316317 *p = acpi_pm_read_early();
317318 t2 = get_cycles();
318− if ((t2 - t1) < SMI_TRESHOLD)
319+ if ((t2 - t1) < thresh)
319320 return t2;
320321 }
321322 return ULLONG_MAX;
@@ -703,15 +704,15 @@ static unsigned long pit_hpet_ptimer_calibrate_cpu(void) · 381 unmodified lines
703704 * zero. In each wait loop iteration we read the TSC and check
704705 * the delta to the previous read. We keep track of the min
705706 * and max values of that delta. The delta is mostly defined
706− * by the IO time of the PIT access, so we can detect when a
707− * SMI/SMM disturbance happened between the two reads. If the
707+ * by the IO time of the PIT access, so we can detect when
708+ * any disturbance happened between the two reads. If the
708709 * maximum time is significantly larger than the minimum time,
709710 * then we discard the result and have another try.
710711 *
711712 * 2) Reference counter. If available we use the HPET or the
712713 * PMTIMER as a reference to check the sanity of that value.
713714 * We use separate TSC readouts and check inside of the
714− * reference read for a SMI/SMM disturbance. We dicard
715+ * reference read for any possible disturbance. We dicard
715716 * disturbed values here as well. We do that around the PIT
716717 * calibration delay loop as we have to wait for a certain
717718 * amount of time anyway.
@@ -744,7 +745,7 @@ static unsigned long pit_hpet_ptimer_calibrate_cpu(void) · 26 unmodified lines
744745 if (ref1 == ref2)
745746 continue;
746747
747− /* Check, whether the sampling was disturbed by an SMI */
748+ /* Check, whether the sampling was disturbed */
748749 if (tsc1 == ULLONG_MAX || tsc2 == ULLONG_MAX)
749750 continue;
750751
@@ -1268,7 +1269,7 @@ static DECLARE_DELAYED_WORK(tsc_irqwork, tsc_refine_calibration_work); · 517 unmodified lines
12681269 */
12691270 static void tsc_refine_calibration_work(struct work_struct *work)
12701271 {
1271− static u64 tsc_start = -1, ref_start;
1272+ static u64 tsc_start = ULLONG_MAX, ref_start;
12721273 static int hpet;
12731274 u64 tsc_stop, ref_stop, delta;
12741275 unsigned long freq;
@@ -1283,14 +1284,15 @@ static void tsc_refine_calibration_work(struct work_struct *work) · 8 unmodified lines
12831284 * delayed the first time we expire. So set the workqueue
12841285 * again once we know timers are working.
12851286 */
1286− if (tsc_start == -1) {
1287+ if (tsc_start == ULLONG_MAX) {
1288+restart:
12871289 /*
12881290 * Only set hpet once, to avoid mixing hardware
12891291 * if the hpet becomes enabled later.
12901292 */
12911293 hpet = is_hpet_enabled();
1292− schedule_delayed_work(&tsc_irqwork, HZ);
12931294 tsc_start = tsc_read_refs(&ref_start, hpet);
1295+ schedule_delayed_work(&tsc_irqwork, HZ);
12941296 return;
12951297 }
12961298
@@ -1300,9 +1302,9 @@ static void tsc_refine_calibration_work(struct work_struct *work) · 3 unmodified lines
13001302 if (ref_start == ref_stop)
13011303 goto out;
13021304
1303− /* Check, whether the sampling was disturbed by an SMI */
1304− if (tsc_start == ULLONG_MAX || tsc_stop == ULLONG_MAX)
1305− goto out;
1305+ /* Check, whether the sampling was disturbed */
1306+ if (tsc_stop == ULLONG_MAX)
1307+ goto restart;
13061308
13071309 delta = tsc_stop - tsc_start;
13081310 delta *= 1000000LL;
arch/x86/kvm/Makefile+0−4
@@ -2,10 +2,6 @@ · 1 unmodified line
22
33 ccflags-y += -Iarch/x86/kvm
44
5−CFLAGS_x86.o := -I.
6−CFLAGS_svm.o := -I.
7−CFLAGS_vmx.o := -I.
8−
95 KVM := ../../../virt/kvm
106
117 kvm-y += $(KVM)/kvm_main.o $(KVM)/coalesced_mmio.o \
arch/x86/kvm/hyperv.c+3−4
@@ -1636,7 +1636,7 @@ int kvm_hv_hypercall(struct kvm_vcpu *vcpu) · 1635 unmodified lines
16361636 ret = kvm_hvcall_signal_event(vcpu, fast, ingpa);
16371637 if (ret != HV_STATUS_INVALID_PORT_ID)
16381638 break;
1639− /* maybe userspace knows this conn_id: fall through */
1639+ /* fall through - maybe userspace knows this conn_id. */
16401640 case HVCALL_POST_MESSAGE:
16411641 /* don't bother userspace if it has no way to handle it */
16421642 if (unlikely(rep || !vcpu_to_synic(vcpu)->active)) {
@@ -1832,7 +1832,6 @@ int kvm_vcpu_ioctl_get_hv_cpuid(struct kvm_vcpu *vcpu, struct kvm_cpuid2 *cpuid, · 189 unmodified lines
18321832 ent->eax |= HV_X64_MSR_VP_INDEX_AVAILABLE;
18331833 ent->eax |= HV_X64_MSR_RESET_AVAILABLE;
18341834 ent->eax |= HV_MSR_REFERENCE_TSC_AVAILABLE;
1835− ent->eax |= HV_X64_MSR_GUEST_IDLE_AVAILABLE;
18361835 ent->eax |= HV_X64_ACCESS_FREQUENCY_MSRS;
18371836 ent->eax |= HV_X64_ACCESS_REENLIGHTENMENT;
18381837
@@ -1848,11 +1847,11 @@ int kvm_vcpu_ioctl_get_hv_cpuid(struct kvm_vcpu *vcpu, struct kvm_cpuid2 *cpuid, · 9 unmodified lines
18481847 case HYPERV_CPUID_ENLIGHTMENT_INFO:
18491848 ent->eax |= HV_X64_REMOTE_TLB_FLUSH_RECOMMENDED;
18501849 ent->eax |= HV_X64_APIC_ACCESS_RECOMMENDED;
1851− ent->eax |= HV_X64_SYSTEM_RESET_RECOMMENDED;
18521850 ent->eax |= HV_X64_RELAXED_TIMING_RECOMMENDED;
18531851 ent->eax |= HV_X64_CLUSTER_IPI_RECOMMENDED;
18541852 ent->eax |= HV_X64_EX_PROCESSOR_MASKS_RECOMMENDED;
1855− ent->eax |= HV_X64_ENLIGHTENED_VMCS_RECOMMENDED;
1853+ if (evmcs_ver)
1854+ ent->eax |= HV_X64_ENLIGHTENED_VMCS_RECOMMENDED;
18561855
18571856 /*
18581857 * Default number of spinlock retry attempts, matches
arch/x86/kvm/lapic.c+2−0
@@ -1035,6 +1035,7 @@ static int __apic_accept_irq(struct kvm_lapic *apic, int delivery_mode, · 1034 unmodified lines
10351035 switch (delivery_mode) {
10361036 case APIC_DM_LOWEST:
10371037 vcpu->arch.apic_arb_prio++;
1038+ /* fall through */
10381039 case APIC_DM_FIXED:
10391040 if (unlikely(trig_mode && !level))
10401041 break;
@@ -1874,6 +1875,7 @@ int kvm_lapic_reg_write(struct kvm_lapic *apic, u32 reg, u32 val) · 833 unmodified lines
18741875
18751876 case APIC_LVT0:
18761877 apic_manage_nmi_watchdog(apic, val);
1878+ /* fall through */
18771879 case APIC_LVTTHMR:
18781880 case APIC_LVTPC:
18791881 case APIC_LVT1:
arch/x86/kvm/mmu.c+1−0
@@ -4371,6 +4371,7 @@ __reset_rsvds_bits_mask(struct kvm_vcpu *vcpu, · 4370 unmodified lines
43714371 rsvd_bits(maxphyaddr, 51);
43724372 rsvd_check->rsvd_bits_mask[1][4] =
43734373 rsvd_check->rsvd_bits_mask[0][4];
4374+ /* fall through */
43744375 case PT64_ROOT_4LEVEL:
43754376 rsvd_check->rsvd_bits_mask[0][3] = exb_bit_rsvd |
43764377 nonleaf_bit8_rsvd | rsvd_bits(7, 7) |
arch/x86/kvm/svm.c+15−16
@@ -3414,6 +3414,14 @@ static int nested_svm_vmexit(struct vcpu_svm *svm) · 3413 unmodified lines
34143414 kvm_mmu_reset_context(&svm->vcpu);
34153415 kvm_mmu_load(&svm->vcpu);
34163416
3417+ /*
3418+ * Drop what we picked up for L2 via svm_complete_interrupts() so it
3419+ * doesn't end up in L1.
3420+ */
3421+ svm->vcpu.arch.nmi_injected = false;
3422+ kvm_clear_exception_queue(&svm->vcpu);
3423+ kvm_clear_interrupt_queue(&svm->vcpu);
3424+
34173425 return 0;
34183426 }
34193427
@@ -4395,7 +4403,7 @@ static int svm_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr) · 975 unmodified lines
43954403 case MSR_IA32_APICBASE:
43964404 if (kvm_vcpu_apicv_active(vcpu))
43974405 avic_update_vapic_bar(to_svm(vcpu), data);
4398− /* Follow through */
4406+ /* Fall through */
43994407 default:
44004408 return kvm_set_msr_common(vcpu, msr);
44014409 }
@@ -4504,28 +4512,19 @@ static int avic_incomplete_ipi_interception(struct vcpu_svm *svm) · 102 unmodified lines
45044512 kvm_lapic_reg_write(apic, APIC_ICR, icrl);
45054513 break;
45064514 case AVIC_IPI_FAILURE_TARGET_NOT_RUNNING: {
4507− int i;
4508− struct kvm_vcpu *vcpu;
4509− struct kvm *kvm = svm->vcpu.kvm;
45104515 struct kvm_lapic *apic = svm->vcpu.arch.apic;
45114516
45124517 /*
4513− * At this point, we expect that the AVIC HW has already
4514− * set the appropriate IRR bits on the valid target
4515− * vcpus. So, we just need to kick the appropriate vcpu.
4518+ * Update ICR high and low, then emulate sending IPI,
4519+ * which is handled when writing APIC_ICR.
45164520 */
4517− kvm_for_each_vcpu(i, vcpu, kvm) {
4518− bool m = kvm_apic_match_dest(vcpu, apic,
4519− icrl & KVM_APIC_SHORT_MASK,
4520− GET_APIC_DEST_FIELD(icrh),
4521− icrl & KVM_APIC_DEST_MASK);
4522−
4523− if (m && !avic_vcpu_is_running(vcpu))
4524− kvm_vcpu_wake_up(vcpu);
4525− }
4521+ kvm_lapic_reg_write(apic, APIC_ICR2, icrh);
4522+ kvm_lapic_reg_write(apic, APIC_ICR, icrl);
45264523 break;
45274524 }
45284525 case AVIC_IPI_FAILURE_INVALID_TARGET:
4526+ WARN_ONCE(1, "Invalid IPI target: index=%u, vcpu=%d, icr=%#0x:%#0x\n",
4527+ index, svm->vcpu.vcpu_id, icrh, icrl);
45294528 break;
45304529 case AVIC_IPI_FAILURE_INVALID_BACKING_PAGE:
45314530 WARN_ONCE(1, "Invalid backing page\n");
arch/x86/kvm/trace.h+1−1
@@ -1465,7 +1465,7 @@ TRACE_EVENT(kvm_hv_send_ipi_ex, · 1464 unmodified lines
14651465 #endif /* _TRACE_KVM_H */
14661466
14671467 #undef TRACE_INCLUDE_PATH
1468−#define TRACE_INCLUDE_PATH arch/x86/kvm
1468+#define TRACE_INCLUDE_PATH ../../arch/x86/kvm
14691469 #undef TRACE_INCLUDE_FILE
14701470 #define TRACE_INCLUDE_FILE trace
14711471
arch/x86/kvm/vmx/evmcs.c+4−3
@@ -332,16 +332,17 @@ int nested_enable_evmcs(struct kvm_vcpu *vcpu, · 331 unmodified lines
332332 uint16_t *vmcs_version)
333333 {
334334 struct vcpu_vmx *vmx = to_vmx(vcpu);
335+ bool evmcs_already_enabled = vmx->nested.enlightened_vmcs_enabled;
336+
337+ vmx->nested.enlightened_vmcs_enabled = true;
335338
336339 if (vmcs_version)
337340 *vmcs_version = nested_get_evmcs_version(vcpu);
338341
339342 /* We don't support disabling the feature for simplicity. */
340− if (vmx->nested.enlightened_vmcs_enabled)
343+ if (evmcs_already_enabled)
341344 return 0;
342345
343− vmx->nested.enlightened_vmcs_enabled = true;
344−
345346 vmx->nested.msrs.pinbased_ctls_high &= ~EVMCS1_UNSUPPORTED_PINCTRL;
346347 vmx->nested.msrs.entry_ctls_high &= ~EVMCS1_UNSUPPORTED_VMENTRY_CTRL;
347348 vmx->nested.msrs.exit_ctls_high &= ~EVMCS1_UNSUPPORTED_VMEXIT_CTRL;
arch/x86/kvm/vmx/nested.c+10−5
@@ -55,7 +55,7 @@ static u16 shadow_read_write_fields[] = { · 54 unmodified lines
5555 static int max_shadow_read_write_fields =
5656 ARRAY_SIZE(shadow_read_write_fields);
5757
58−void init_vmcs_shadow_fields(void)
58+static void init_vmcs_shadow_fields(void)
5959 {
6060 int i, j;
6161
@@ -211,6 +211,7 @@ static void free_nested(struct kvm_vcpu *vcpu) · 149 unmodified lines
211211 if (!vmx->nested.vmxon && !vmx->nested.smm.vmxon)
212212 return;
213213
214+ hrtimer_cancel(&vmx->nested.preemption_timer);
214215 vmx->nested.vmxon = false;
215216 vmx->nested.smm.vmxon = false;
216217 free_vpid(vmx->nested.vpid02);
@@ -4140,11 +4141,11 @@ static int enter_vmx_operation(struct kvm_vcpu *vcpu) · 3923 unmodified lines
41404141 if (r < 0)
41414142 goto out_vmcs02;
41424143
4143− vmx->nested.cached_vmcs12 = kmalloc(VMCS12_SIZE, GFP_KERNEL);
4144+ vmx->nested.cached_vmcs12 = kzalloc(VMCS12_SIZE, GFP_KERNEL);
41444145 if (!vmx->nested.cached_vmcs12)
41454146 goto out_cached_vmcs12;
41464147
4147− vmx->nested.cached_shadow_vmcs12 = kmalloc(VMCS12_SIZE, GFP_KERNEL);
4148+ vmx->nested.cached_shadow_vmcs12 = kzalloc(VMCS12_SIZE, GFP_KERNEL);
41484149 if (!vmx->nested.cached_shadow_vmcs12)
41494150 goto out_cached_shadow_vmcs12;
41504151
@@ -5263,13 +5264,17 @@ static int vmx_get_nested_state(struct kvm_vcpu *vcpu, · 1112 unmodified lines
52635264 copy_shadow_to_vmcs12(vmx);
52645265 }
52655266
5266− if (copy_to_user(user_kvm_nested_state->data, vmcs12, sizeof(*vmcs12)))
5267+ /*
5268+ * Copy over the full allocated size of vmcs12 rather than just the size
5269+ * of the struct.
5270+ */
5271+ if (copy_to_user(user_kvm_nested_state->data, vmcs12, VMCS12_SIZE))
52675272 return -EFAULT;
52685273
52695274 if (nested_cpu_has_shadow_vmcs(vmcs12) &&
52705275 vmcs12->vmcs_link_pointer != -1ull) {
52715276 if (copy_to_user(user_kvm_nested_state->data + VMCS12_SIZE,
5272− get_shadow_vmcs12(vcpu), sizeof(*vmcs12)))
5277+ get_shadow_vmcs12(vcpu), VMCS12_SIZE))
52735278 return -EFAULT;
52745279 }
52755280
arch/x86/kvm/vmx/vmx.c+79−71
@@ -26,6 +26,7 @@ · 25 unmodified lines
2626 #include <linux/mod_devicetable.h>
2727 #include <linux/mm.h>
2828 #include <linux/sched.h>
29+#include <linux/sched/smt.h>
2930 #include <linux/slab.h>
3031 #include <linux/tboot.h>
3132 #include <linux/trace_events.h>
@@ -423,7 +424,7 @@ static void check_ept_pointer_match(struct kvm *kvm) · 391 unmodified lines
423424 to_kvm_vmx(kvm)->ept_pointers_match = EPT_POINTERS_MATCH;
424425 }
425426
426−int kvm_fill_hv_flush_list_func(struct hv_guest_mapping_flush_list *flush,
427+static int kvm_fill_hv_flush_list_func(struct hv_guest_mapping_flush_list *flush,
427428 void *data)
428429 {
429430 struct kvm_tlb_range *range = data;
@@ -1773,7 +1774,7 @@ static int vmx_get_msr(struct kvm_vcpu *vcpu, struct msr_data *msr_info) · 1343 unmodified lines
17731774 if (!msr_info->host_initiated &&
17741775 !guest_cpuid_has(vcpu, X86_FEATURE_RDTSCP))
17751776 return 1;
1776− /* Otherwise falls through */
1777+ /* Else, falls through */
17771778 default:
17781779 msr = find_msr_entry(vmx, msr_info->index);
17791780 if (msr) {
@@ -2014,7 +2015,7 @@ static int vmx_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr_info) · 234 unmodified lines
20142015 /* Check reserved bit, higher 32 bits should be zero */
20152016 if ((data >> 32) != 0)
20162017 return 1;
2017− /* Otherwise falls through */
2018+ /* Else, falls through */
20182019 default:
20192020 msr = find_msr_entry(vmx, msr_index);
20202021 if (msr) {
@@ -2344,7 +2345,7 @@ static __init int setup_vmcs_config(struct vmcs_config *vmcs_conf, · 323 unmodified lines
23442345 case 37: /* AAT100 */
23452346 case 44: /* BC86,AAY89,BD102 */
23462347 case 46: /* BA97 */
2347− _vmexit_control &= ~VM_ENTRY_LOAD_IA32_PERF_GLOBAL_CTRL;
2348+ _vmentry_control &= ~VM_ENTRY_LOAD_IA32_PERF_GLOBAL_CTRL;
23482349 _vmexit_control &= ~VM_EXIT_LOAD_IA32_PERF_GLOBAL_CTRL;
23492350 pr_warn_once("kvm: VM_EXIT_LOAD_IA32_PERF_GLOBAL_CTRL "
23502351 "does not work properly. Using workaround\n");
@@ -6362,72 +6363,9 @@ static void vmx_update_hv_timer(struct kvm_vcpu *vcpu) · 4011 unmodified lines
63626363 vmx->loaded_vmcs->hv_timer_armed = false;
63636364 }
63646365
6365−static void vmx_vcpu_run(struct kvm_vcpu *vcpu)
6366+static void __vmx_vcpu_run(struct kvm_vcpu *vcpu, struct vcpu_vmx *vmx)
63666367 {
6367− struct vcpu_vmx *vmx = to_vmx(vcpu);
6368− unsigned long cr3, cr4, evmcs_rsp;
6369−
6370− /* Record the guest's net vcpu time for enforced NMI injections. */
6371− if (unlikely(!enable_vnmi &&
6372− vmx->loaded_vmcs->soft_vnmi_blocked))
6373− vmx->loaded_vmcs->entry_time = ktime_get();
6374−
6375− /* Don't enter VMX if guest state is invalid, let the exit handler
6376− start emulation until we arrive back to a valid state */
6377− if (vmx->emulation_required)
6378− return;
6379−
6380− if (vmx->ple_window_dirty) {
6381− vmx->ple_window_dirty = false;
6382− vmcs_write32(PLE_WINDOW, vmx->ple_window);
6383− }
6384−
6385− if (vmx->nested.need_vmcs12_sync)
6386− nested_sync_from_vmcs12(vcpu);
6387−
6388− if (test_bit(VCPU_REGS_RSP, (unsigned long *)&vcpu->arch.regs_dirty))
6389− vmcs_writel(GUEST_RSP, vcpu->arch.regs[VCPU_REGS_RSP]);
6390− if (test_bit(VCPU_REGS_RIP, (unsigned long *)&vcpu->arch.regs_dirty))
6391− vmcs_writel(GUEST_RIP, vcpu->arch.regs[VCPU_REGS_RIP]);
6392−
6393− cr3 = __get_current_cr3_fast();
6394− if (unlikely(cr3 != vmx->loaded_vmcs->host_state.cr3)) {
6395− vmcs_writel(HOST_CR3, cr3);
6396− vmx->loaded_vmcs->host_state.cr3 = cr3;
6397− }
6398−
6399− cr4 = cr4_read_shadow();
6400− if (unlikely(cr4 != vmx->loaded_vmcs->host_state.cr4)) {
6401− vmcs_writel(HOST_CR4, cr4);
6402− vmx->loaded_vmcs->host_state.cr4 = cr4;
6403− }
6404−
6405− /* When single-stepping over STI and MOV SS, we must clear the
6406− * corresponding interruptibility bits in the guest state. Otherwise
6407− * vmentry fails as it then expects bit 14 (BS) in pending debug
6408− * exceptions being set, but that's not correct for the guest debugging
6409− * case. */
6410− if (vcpu->guest_debug & KVM_GUESTDBG_SINGLESTEP)
6411− vmx_set_interrupt_shadow(vcpu, 0);
6412−
6413− if (static_cpu_has(X86_FEATURE_PKU) &&
6414− kvm_read_cr4_bits(vcpu, X86_CR4_PKE) &&
6415− vcpu->arch.pkru != vmx->host_pkru)
6416− __write_pkru(vcpu->arch.pkru);
6417−
6418− pt_guest_enter(vmx);
6419−
6420− atomic_switch_perf_msrs(vmx);
6421−
6422− vmx_update_hv_timer(vcpu);
6423−
6424− /*
6425− * If this vCPU has touched SPEC_CTRL, restore the guest's value if
6426− * it's non-zero. Since vmentry is serialising on affected CPUs, there
6427− * is no need to worry about the conditional branch over the wrmsr
6428− * being speculatively taken.
6429− */
6430− x86_spec_ctrl_set_guest(vmx->spec_ctrl, 0);
6368+ unsigned long evmcs_rsp;
64316369
64326370 vmx->__launched = vmx->loaded_vmcs->launched;
64336371
@@ -6567,6 +6505,77 @@ static void vmx_vcpu_run(struct kvm_vcpu *vcpu) · 133 unmodified lines
65676505 , "eax", "ebx", "edi"
65686506 #endif
65696507 );
6508+}
6509+STACK_FRAME_NON_STANDARD(__vmx_vcpu_run);
6510+
6511+static void vmx_vcpu_run(struct kvm_vcpu *vcpu)
6512+{
6513+ struct vcpu_vmx *vmx = to_vmx(vcpu);
6514+ unsigned long cr3, cr4;
6515+
6516+ /* Record the guest's net vcpu time for enforced NMI injections. */
6517+ if (unlikely(!enable_vnmi &&
6518+ vmx->loaded_vmcs->soft_vnmi_blocked))
6519+ vmx->loaded_vmcs->entry_time = ktime_get();
6520+
6521+ /* Don't enter VMX if guest state is invalid, let the exit handler
6522+ start emulation until we arrive back to a valid state */
6523+ if (vmx->emulation_required)
6524+ return;
6525+
6526+ if (vmx->ple_window_dirty) {
6527+ vmx->ple_window_dirty = false;
6528+ vmcs_write32(PLE_WINDOW, vmx->ple_window);
6529+ }
6530+
6531+ if (vmx->nested.need_vmcs12_sync)
6532+ nested_sync_from_vmcs12(vcpu);
6533+
6534+ if (test_bit(VCPU_REGS_RSP, (unsigned long *)&vcpu->arch.regs_dirty))
6535+ vmcs_writel(GUEST_RSP, vcpu->arch.regs[VCPU_REGS_RSP]);
6536+ if (test_bit(VCPU_REGS_RIP, (unsigned long *)&vcpu->arch.regs_dirty))
6537+ vmcs_writel(GUEST_RIP, vcpu->arch.regs[VCPU_REGS_RIP]);
6538+
6539+ cr3 = __get_current_cr3_fast();
6540+ if (unlikely(cr3 != vmx->loaded_vmcs->host_state.cr3)) {
6541+ vmcs_writel(HOST_CR3, cr3);
6542+ vmx->loaded_vmcs->host_state.cr3 = cr3;
6543+ }
6544+
6545+ cr4 = cr4_read_shadow();
6546+ if (unlikely(cr4 != vmx->loaded_vmcs->host_state.cr4)) {
6547+ vmcs_writel(HOST_CR4, cr4);
6548+ vmx->loaded_vmcs->host_state.cr4 = cr4;
6549+ }
6550+
6551+ /* When single-stepping over STI and MOV SS, we must clear the
6552+ * corresponding interruptibility bits in the guest state. Otherwise
6553+ * vmentry fails as it then expects bit 14 (BS) in pending debug
6554+ * exceptions being set, but that's not correct for the guest debugging
6555+ * case. */
6556+ if (vcpu->guest_debug & KVM_GUESTDBG_SINGLESTEP)
6557+ vmx_set_interrupt_shadow(vcpu, 0);
6558+
6559+ if (static_cpu_has(X86_FEATURE_PKU) &&
6560+ kvm_read_cr4_bits(vcpu, X86_CR4_PKE) &&
6561+ vcpu->arch.pkru != vmx->host_pkru)
6562+ __write_pkru(vcpu->arch.pkru);
6563+
6564+ pt_guest_enter(vmx);
6565+
6566+ atomic_switch_perf_msrs(vmx);
6567+
6568+ vmx_update_hv_timer(vcpu);
6569+
6570+ /*
6571+ * If this vCPU has touched SPEC_CTRL, restore the guest's value if
6572+ * it's non-zero. Since vmentry is serialising on affected CPUs, there
6573+ * is no need to worry about the conditional branch over the wrmsr
6574+ * being speculatively taken.
6575+ */
6576+ x86_spec_ctrl_set_guest(vmx->spec_ctrl, 0);
6577+
6578+ __vmx_vcpu_run(vcpu, vmx);
65706579
65716580 /*
65726581 * We do not use IBRS in the kernel. If this vCPU has used the
@@ -6648,7 +6657,6 @@ static void vmx_vcpu_run(struct kvm_vcpu *vcpu) · 75 unmodified lines
66486657 vmx_recover_nmi_blocking(vmx);
66496658 vmx_complete_interrupts(vmx);
66506659 }
6651−STACK_FRAME_NON_STANDARD(vmx_vcpu_run);
66526660
66536661 static struct kvm *vmx_vm_alloc(void)
66546662 {
@@ -6816,7 +6824,7 @@ static int vmx_vm_init(struct kvm *kvm) · 161 unmodified lines
68166824 * Warn upon starting the first VM in a potentially
68176825 * insecure environment.
68186826 */
6819− if (cpu_smt_control == CPU_SMT_ENABLED)
6827+ if (sched_smt_active())
68206828 pr_warn_once(L1TF_MSG_SMT);
68216829 if (l1tf_vmx_mitigation == VMENTER_L1D_FLUSH_NEVER)
68226830 pr_warn_once(L1TF_MSG_L1D);
arch/x86/kvm/x86.c+12−3
@@ -3834,6 +3834,8 @@ static int kvm_vcpu_ioctl_enable_cap(struct kvm_vcpu *vcpu, · 3833 unmodified lines
38343834 case KVM_CAP_HYPERV_SYNIC2:
38353835 if (cap->args[0])
38363836 return -EINVAL;
3837+ /* fall through */
3838+
38373839 case KVM_CAP_HYPERV_SYNIC:
38383840 if (!irqchip_in_kernel(vcpu->kvm))
38393841 return -EINVAL;
@@ -5114,6 +5116,13 @@ int kvm_read_guest_virt(struct kvm_vcpu *vcpu, · 1274 unmodified lines
51145116 {
51155117 u32 access = (kvm_x86_ops->get_cpl(vcpu) == 3) ? PFERR_USER_MASK : 0;
51165118
5119+ /*
5120+ * FIXME: this should call handle_emulation_failure if X86EMUL_IO_NEEDED
5121+ * is returned, but our callers are not ready for that and they blindly
5122+ * call kvm_inject_page_fault. Ensure that they at least do not leak
5123+ * uninitialized kernel stack memory into cr2 and error code.
5124+ */
5125+ memset(exception, 0, sizeof(*exception));
51175126 return kvm_read_guest_virt_helper(addr, val, bytes, vcpu, access,
51185127 exception);
51195128 }
@@ -6480,8 +6489,7 @@ restart: · 1360 unmodified lines
64806489 toggle_interruptibility(vcpu, ctxt->interruptibility);
64816490 vcpu->arch.emulate_regs_need_sync_to_vcpu = false;
64826491 kvm_rip_write(vcpu, ctxt->eip);
6483− if (r == EMULATE_DONE &&
6484− (ctxt->tf || (vcpu->guest_debug & KVM_GUESTDBG_SINGLESTEP)))
6492+ if (r == EMULATE_DONE && ctxt->tf)
64856493 kvm_vcpu_do_singlestep(vcpu, &r);
64866494 if (!ctxt->have_exception ||
64876495 exception_type(ctxt->exception.vector) == EXCPT_TRAP)
@@ -7093,10 +7101,10 @@ int kvm_emulate_hypercall(struct kvm_vcpu *vcpu) · 605 unmodified lines
70937101 case KVM_HC_CLOCK_PAIRING:
70947102 ret = kvm_pv_clock_pairing(vcpu, a0, a1);
70957103 break;
7104+#endif
70967105 case KVM_HC_SEND_IPI:
70977106 ret = kvm_pv_send_ipi(vcpu->kvm, a0, a1, a2, a3, op_64_bit);
70987107 break;
7099−#endif
71007108 default:
71017109 ret = -KVM_ENOSYS;
71027110 break;
@@ -7937,6 +7945,7 @@ static inline int vcpu_block(struct kvm *kvm, struct kvm_vcpu *vcpu) · 834 unmodified lines
79377945 vcpu->arch.pv.pv_unhalted = false;
79387946 vcpu->arch.mp_state =
79397947 KVM_MP_STATE_RUNNABLE;
7948+ /* fall through */
79407949 case KVM_MP_STATE_RUNNABLE:
79417950 vcpu->arch.apf.halted = false;
79427951 break;
arch/x86/lib/iomem.c+30−3
@@ -2,8 +2,11 @@ · 1 unmodified line
22 #include <linux/module.h>
33 #include <linux/io.h>
44
5+#define movs(type,to,from) \
6+ asm volatile("movs" type:"=&D" (to), "=&S" (from):"0" (to), "1" (from):"memory")
7+
58 /* Originally from i386/string.h */
6−static __always_inline void __iomem_memcpy(void *to, const void *from, size_t n)
9+static __always_inline void rep_movs(void *to, const void *from, size_t n)
710 {
811 unsigned long d0, d1, d2;
912 asm volatile("rep ; movsl\n\t"
@@ -21,13 +24,37 @@ static __always_inline void __iomem_memcpy(void *to, const void *from, size_t n) · 11 unmodified lines
2124
2225 void memcpy_fromio(void *to, const volatile void __iomem *from, size_t n)
2326 {
24− __iomem_memcpy(to, (const void *)from, n);
27+ if (unlikely(!n))
28+ return;
29+
30+ /* Align any unaligned source IO */
31+ if (unlikely(1 & (unsigned long)from)) {
32+ movs("b", to, from);
33+ n--;
34+ }
35+ if (n > 1 && unlikely(2 & (unsigned long)from)) {
36+ movs("w", to, from);
37+ n-=2;
38+ }
39+ rep_movs(to, (const void *)from, n);
2540 }
2641 EXPORT_SYMBOL(memcpy_fromio);
2742
2843 void memcpy_toio(volatile void __iomem *to, const void *from, size_t n)
2944 {
30− __iomem_memcpy((void *)to, (const void *) from, n);
45+ if (unlikely(!n))
46+ return;
47+
48+ /* Align any unaligned destination IO */
49+ if (unlikely(1 & (unsigned long)to)) {
50+ movs("b", to, from);
51+ n--;
52+ }
53+ if (n > 1 && unlikely(2 & (unsigned long)to)) {
54+ movs("w", to, from);
55+ n-=2;
56+ }
57+ rep_movs((void *)to, (const void *) from, n);
3158 }
3259 EXPORT_SYMBOL(memcpy_toio);
3360
arch/x86/lib/kaslr.c+2−2
@@ -36,8 +36,8 @@ static inline u16 i8254(void) · 35 unmodified lines
3636 u16 status, timer;
3737
3838 do {
39− outb(I8254_PORT_CONTROL,
40− I8254_CMD_READBACK | I8254_SELECT_COUNTER0);
39+ outb(I8254_CMD_READBACK | I8254_SELECT_COUNTER0,
40+ I8254_PORT_CONTROL);
4141 status = inb(I8254_PORT_COUNTER0);
4242 timer = inb(I8254_PORT_COUNTER0);
4343 timer |= inb(I8254_PORT_COUNTER0) << 8;
arch/x86/mm/fault.c+1−1
@@ -595,7 +595,7 @@ static void show_ldttss(const struct desc_ptr *gdt, const char *name, u16 index) · 594 unmodified lines
595595 return;
596596 }
597597
598− addr = desc.base0 | (desc.base1 << 16) | (desc.base2 << 24);
598+ addr = desc.base0 | (desc.base1 << 16) | ((unsigned long)desc.base2 << 24);
599599 #ifdef CONFIG_X86_64
600600 addr |= ((u64)desc.base3 << 32);
601601 #endif
arch/x86/mm/mem_encrypt_identity.c+2−2
@@ -158,8 +158,8 @@ static void __init sme_populate_pgd(struct sme_populate_pgd_data *ppd) · 157 unmodified lines
158158 pmd = pmd_offset(pud, ppd->vaddr);
159159 if (pmd_none(*pmd)) {
160160 pte = ppd->pgtable_area;
161− memset(pte, 0, sizeof(pte) * PTRS_PER_PTE);
162− ppd->pgtable_area += sizeof(pte) * PTRS_PER_PTE;
161+ memset(pte, 0, sizeof(*pte) * PTRS_PER_PTE);
162+ ppd->pgtable_area += sizeof(*pte) * PTRS_PER_PTE;
163163 set_pmd(pmd, __pmd(PMD_FLAGS | __pa(pte)));
164164 }
165165
arch/x86/xen/enlighten_pv.c+1−4
@@ -898,10 +898,7 @@ static u64 xen_read_msr_safe(unsigned int msr, int *err) · 897 unmodified lines
898898 val = native_read_msr_safe(msr, err);
899899 switch (msr) {
900900 case MSR_IA32_APICBASE:
901−#ifdef CONFIG_X86_X2APIC
902− if (!(cpuid_ecx(1) & (1 << (X86_FEATURE_X2APIC & 31))))
903−#endif
904− val &= ~X2APIC_ENABLE;
901+ val &= ~X2APIC_ENABLE;
905902 break;
906903 }
907904 return val;
arch/x86/xen/time.c+9−3
@@ -361,8 +361,6 @@ void xen_timer_resume(void) · 360 unmodified lines
361361 {
362362 int cpu;
363363
364− pvclock_resume();
365−
366364 if (xen_clockevent != &xen_vcpuop_clockevent)
367365 return;
368366
@@ -379,12 +377,15 @@ static const struct pv_time_ops xen_time_ops __initconst = { · 10 unmodified lines
379377 };
380378
381379 static struct pvclock_vsyscall_time_info *xen_clock __read_mostly;
380+static u64 xen_clock_value_saved;
382381
383382 void xen_save_time_memory_area(void)
384383 {
385384 struct vcpu_register_time_memory_area t;
386385 int ret;
387386
387+ xen_clock_value_saved = xen_clocksource_read() - xen_sched_clock_offset;
388+
388389 if (!xen_clock)
389390 return;
390391
@@ -404,7 +405,7 @@ void xen_restore_time_memory_area(void) · 13 unmodified lines
404405 int ret;
405406
406407 if (!xen_clock)
407− return;
408+ goto out;
408409
409410 t.addr.v = &xen_clock->pvti;
410411
@@ -421,6 +422,11 @@ void xen_restore_time_memory_area(void) · 10 unmodified lines
421422 if (ret != 0)
422423 pr_notice("Cannot restore secondary vcpu_time_info (err %d)",
423424 ret);
425+
426+out:
427+ /* Need pvclock_resume() before using xen_clocksource_read(). */
428+ pvclock_resume();
429+ xen_sched_clock_offset = xen_clocksource_read() - xen_clock_value_saved;
424430 }
425431
426432 static void xen_setup_vsyscall_time_info(void)
arch/xtensa/Kconfig+2−2
@@ -164,7 +164,7 @@ config XTENSA_FAKE_NMI · 163 unmodified lines
164164 If unsure, say N.
165165
166166 config XTENSA_UNALIGNED_USER
167− bool "Unaligned memory access in use space"
167+ bool "Unaligned memory access in user space"
168168 help
169169 The Xtensa architecture currently does not handle unaligned
170170 memory accesses in hardware but through an exception handler.
@@ -451,7 +451,7 @@ config USE_OF · 280 unmodified lines
451451 help
452452 Include support for flattened device tree machine descriptions.
453453
454−config BUILTIN_DTB
454+config BUILTIN_DTB_SOURCE
455455 string "DTB to build into the kernel image"
456456 depends on OF
457457
arch/xtensa/boot/dts/Makefile+3−3
@@ -7,9 +7,9 @@ · 6 unmodified lines
77 #
88 #
99
10−BUILTIN_DTB := $(patsubst "%",%,$(CONFIG_BUILTIN_DTB)).dtb.o
11−ifneq ($(CONFIG_BUILTIN_DTB),"")
12−obj-$(CONFIG_OF) += $(BUILTIN_DTB)
10+BUILTIN_DTB_SOURCE := $(patsubst "%",%,$(CONFIG_BUILTIN_DTB_SOURCE)).dtb.o
11+ifneq ($(CONFIG_BUILTIN_DTB_SOURCE),"")
12+obj-$(CONFIG_OF) += $(BUILTIN_DTB_SOURCE)
1313 endif
1414
1515 # for CONFIG_OF_ALL_DTBS test
arch/xtensa/configs/audio_kc705_defconfig+1−1
@@ -34,7 +34,7 @@ CONFIG_XTENSA_PLATFORM_XTFPGA=y · 33 unmodified lines
3434 CONFIG_CMDLINE_BOOL=y
3535 CONFIG_CMDLINE="earlycon=uart8250,mmio32native,0xfd050020,115200n8 console=ttyS0,115200n8 ip=dhcp root=/dev/nfs rw debug memmap=0x38000000@0"
3636 CONFIG_USE_OF=y
37−CONFIG_BUILTIN_DTB="kc705"
37+CONFIG_BUILTIN_DTB_SOURCE="kc705"
3838 # CONFIG_COMPACTION is not set
3939 # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
4040 CONFIG_PM=y
arch/xtensa/configs/cadence_csp_defconfig+1−1
@@ -38,7 +38,7 @@ CONFIG_HIGHMEM=y · 37 unmodified lines
3838 # CONFIG_PCI is not set
3939 CONFIG_XTENSA_PLATFORM_XTFPGA=y
4040 CONFIG_USE_OF=y
41−CONFIG_BUILTIN_DTB="csp"
41+CONFIG_BUILTIN_DTB_SOURCE="csp"
4242 # CONFIG_COMPACTION is not set
4343 CONFIG_XTFPGA_LCD=y
4444 # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
arch/xtensa/configs/generic_kc705_defconfig+1−1
@@ -33,7 +33,7 @@ CONFIG_XTENSA_PLATFORM_XTFPGA=y · 32 unmodified lines
3333 CONFIG_CMDLINE_BOOL=y
3434 CONFIG_CMDLINE="earlycon=uart8250,mmio32native,0xfd050020,115200n8 console=ttyS0,115200n8 ip=dhcp root=/dev/nfs rw debug memmap=0x38000000@0"
3535 CONFIG_USE_OF=y
36−CONFIG_BUILTIN_DTB="kc705"
36+CONFIG_BUILTIN_DTB_SOURCE="kc705"
3737 # CONFIG_COMPACTION is not set
3838 # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
3939 CONFIG_NET=y
arch/xtensa/configs/nommu_kc705_defconfig+1−1
@@ -39,7 +39,7 @@ CONFIG_XTENSA_PLATFORM_XTFPGA=y · 38 unmodified lines
3939 CONFIG_CMDLINE_BOOL=y
4040 CONFIG_CMDLINE="earlycon=uart8250,mmio32native,0x9d050020,115200n8 console=ttyS0,115200n8 ip=dhcp root=/dev/nfs rw debug memmap=256M@0x60000000"
4141 CONFIG_USE_OF=y
42−CONFIG_BUILTIN_DTB="kc705_nommu"
42+CONFIG_BUILTIN_DTB_SOURCE="kc705_nommu"
4343 CONFIG_BINFMT_FLAT=y
4444 CONFIG_NET=y
4545 CONFIG_PACKET=y
arch/xtensa/configs/smp_lx200_defconfig+2−1
@@ -33,11 +33,12 @@ CONFIG_SMP=y · 32 unmodified lines
3333 CONFIG_HOTPLUG_CPU=y
3434 # CONFIG_INITIALIZE_XTENSA_MMU_INSIDE_VMLINUX is not set
3535 # CONFIG_PCI is not set
36+CONFIG_VECTORS_OFFSET=0x00002000
3637 CONFIG_XTENSA_PLATFORM_XTFPGA=y
3738 CONFIG_CMDLINE_BOOL=y
3839 CONFIG_CMDLINE="earlycon=uart8250,mmio32native,0xfd050020,115200n8 console=ttyS0,115200n8 ip=dhcp root=/dev/nfs rw debug memmap=96M@0"
3940 CONFIG_USE_OF=y
40−CONFIG_BUILTIN_DTB="lx200mx"
41+CONFIG_BUILTIN_DTB_SOURCE="lx200mx"
4142 # CONFIG_COMPACTION is not set
4243 # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set
4344 CONFIG_NET=y
arch/xtensa/kernel/head.S+4−1
@@ -276,12 +276,13 @@ should_never_return: · 275 unmodified lines
276276
277277 movi a2, cpu_start_ccount
278278 1:
279+ memw
279280 l32i a3, a2, 0
280281 beqi a3, 0, 1b
281282 movi a3, 0
282283 s32i a3, a2, 0
283− memw
284284 1:
285+ memw
285286 l32i a3, a2, 0
286287 beqi a3, 0, 1b
287288 wsr a3, ccount
@@ -317,11 +318,13 @@ ENTRY(cpu_restart) · 29 unmodified lines
317318 rsr a0, prid
318319 neg a2, a0
319320 movi a3, cpu_start_id
321+ memw
320322 s32i a2, a3, 0
321323 #if XCHAL_DCACHE_IS_WRITEBACK
322324 dhwbi a3, 0
323325 #endif
324326 1:
327+ memw
325328 l32i a2, a3, 0
326329 dhi a3, 0
327330 bne a2, a0, 1b
arch/xtensa/kernel/smp.c+27−14
@@ -83,7 +83,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus) · 82 unmodified lines
8383 {
8484 unsigned i;
8585
86− for (i = 0; i < max_cpus; ++i)
86+ for_each_possible_cpu(i)
8787 set_cpu_present(i, true);
8888 }
8989
@@ -96,6 +96,11 @@ void __init smp_init_cpus(void) · 6 unmodified lines
9696 pr_info("%s: Core Count = %d\n", __func__, ncpus);
9797 pr_info("%s: Core Id = %d\n", __func__, core_id);
9898
99+ if (ncpus > NR_CPUS) {
100+ ncpus = NR_CPUS;
101+ pr_info("%s: limiting core count by %d\n", __func__, ncpus);
102+ }
103+
99104 for (i = 0; i < ncpus; ++i)
100105 set_cpu_possible(i, true);
101106 }
@@ -195,9 +200,11 @@ static int boot_secondary(unsigned int cpu, struct task_struct *ts) · 93 unmodified lines
195200 int i;
196201
197202 #ifdef CONFIG_HOTPLUG_CPU
198− cpu_start_id = cpu;
199− system_flush_invalidate_dcache_range(
200− (unsigned long)&cpu_start_id, sizeof(cpu_start_id));
203+ WRITE_ONCE(cpu_start_id, cpu);
204+ /* Pairs with the third memw in the cpu_restart */
205+ mb();
206+ system_flush_invalidate_dcache_range((unsigned long)&cpu_start_id,
207+ sizeof(cpu_start_id));
201208 #endif
202209 smp_call_function_single(0, mx_cpu_start, (void *)cpu, 1);
203210
@@ -206,18 +213,21 @@ static int boot_secondary(unsigned int cpu, struct task_struct *ts) · 2 unmodified lines
206213 ccount = get_ccount();
207214 while (!ccount);
208215
209− cpu_start_ccount = ccount;
216+ WRITE_ONCE(cpu_start_ccount, ccount);
210217
211− while (time_before(jiffies, timeout)) {
218+ do {
219+ /*
220+ * Pairs with the first two memws in the
221+ * .Lboot_secondary.
222+ */
212223 mb();
213− if (!cpu_start_ccount)
214− break;
215− }
224+ ccount = READ_ONCE(cpu_start_ccount);
225+ } while (ccount && time_before(jiffies, timeout));
216226
217− if (cpu_start_ccount) {
227+ if (ccount) {
218228 smp_call_function_single(0, mx_cpu_stop,
219− (void *)cpu, 1);
220− cpu_start_ccount = 0;
229+ (void *)cpu, 1);
230+ WRITE_ONCE(cpu_start_ccount, 0);
221231 return -EIO;
222232 }
223233 }
@@ -237,6 +247,7 @@ int __cpu_up(unsigned int cpu, struct task_struct *idle) · 13 unmodified lines
237247 pr_debug("%s: Calling wakeup_secondary(cpu:%d, idle:%p, sp: %08lx)\n",
238248 __func__, cpu, idle, start_info.stack);
239249
250+ init_completion(&cpu_running);
240251 ret = boot_secondary(cpu, idle);
241252 if (ret == 0) {
242253 wait_for_completion_timeout(&cpu_running,
@@ -298,8 +309,10 @@ void __cpu_die(unsigned int cpu) · 55 unmodified lines
298309 unsigned long timeout = jiffies + msecs_to_jiffies(1000);
299310 while (time_before(jiffies, timeout)) {
300311 system_invalidate_dcache_range((unsigned long)&cpu_start_id,
301− sizeof(cpu_start_id));
302− if (cpu_start_id == -cpu) {
312+ sizeof(cpu_start_id));
313+ /* Pairs with the second memw in the cpu_restart */
314+ mb();
315+ if (READ_ONCE(cpu_start_id) == -cpu) {
303316 platform_cpu_kill(cpu);
304317 return;
305318 }
arch/xtensa/kernel/time.c+1−1
@@ -89,7 +89,7 @@ static int ccount_timer_shutdown(struct clock_event_device *evt) · 88 unmodified lines
8989 container_of(evt, struct ccount_timer, evt);
9090
9191 if (timer->irq_enabled) {
92− disable_irq(evt->irq);
92+ disable_irq_nosync(evt->irq);
9393 timer->irq_enabled = 0;
9494 }
9595 return 0;
block/bfq-wf2q.c+5−6
@@ -1154,15 +1154,14 @@ static void bfq_activate_requeue_entity(struct bfq_entity *entity, · 1153 unmodified lines
11541154 }
11551155
11561156 /**
1157− * __bfq_deactivate_entity - deactivate an entity from its service tree.
1158− * @entity: the entity to deactivate.
1157+ * __bfq_deactivate_entity - update sched_data and service trees for
1158+ * entity, so as to represent entity as inactive
1159+ * @entity: the entity being deactivated.
11591160 * @ins_into_idle_tree: if false, the entity will not be put into the
11601161 * idle tree.
11611162 *
1162− * Deactivates an entity, independently of its previous state. Must
1163− * be invoked only if entity is on a service tree. Extracts the entity
1164− * from that tree, and if necessary and allowed, puts it into the idle
1165− * tree.
1163+ * If necessary and allowed, puts entity into the idle tree. NOTE:
1164+ * entity may be on no tree if in service.
11661165 */
11671166 bool __bfq_deactivate_entity(struct bfq_entity *entity, bool ins_into_idle_tree)
11681167 {
block/blk-core.c+5−1
@@ -462,6 +462,10 @@ static void blk_rq_timed_out_timer(struct timer_list *t) · 461 unmodified lines
462462 kblockd_schedule_work(&q->timeout_work);
463463 }
464464
465+static void blk_timeout_work(struct work_struct *work)
466+{
467+}
468+
465469 /**
466470 * blk_alloc_queue_node - allocate a request queue
467471 * @gfp_mask: memory allocation flags
@@ -505,7 +509,7 @@ struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id) · 37 unmodified lines
505509 timer_setup(&q->backing_dev_info->laptop_mode_wb_timer,
506510 laptop_mode_timer_fn, 0);
507511 timer_setup(&q->timeout, blk_rq_timed_out_timer, 0);
508− INIT_WORK(&q->timeout_work, NULL);
512+ INIT_WORK(&q->timeout_work, blk_timeout_work);
509513 INIT_LIST_HEAD(&q->icq_list);
510514 #ifdef CONFIG_BLK_CGROUP
511515 INIT_LIST_HEAD(&q->blkg_list);
block/blk-flush.c+1−1
@@ -335,7 +335,7 @@ static void mq_flush_data_end_io(struct request *rq, blk_status_t error) · 334 unmodified lines
335335 blk_flush_complete_seq(rq, fq, REQ_FSEQ_DATA, error);
336336 spin_unlock_irqrestore(&fq->mq_flush_lock, flags);
337337
338− blk_mq_run_hw_queue(hctx, true);
338+ blk_mq_sched_restart(hctx);
339339 }
340340
341341 /**
block/blk-mq-debugfs-zoned.c+0−2
@@ -1,8 +1,6 @@
11 // SPDX-License-Identifier: GPL-2.0
22 /*
33 * Copyright (C) 2017 Western Digital Corporation or its affiliates.
4− *
5− * This file is released under the GPL.
64 */
75
86 #include <linux/blkdev.h>
block/blk-mq-debugfs.c+2−1
@@ -308,8 +308,9 @@ static const char *const cmd_flag_name[] = { · 307 unmodified lines
308308 CMD_FLAG_NAME(PREFLUSH),
309309 CMD_FLAG_NAME(RAHEAD),
310310 CMD_FLAG_NAME(BACKGROUND),
311− CMD_FLAG_NAME(NOUNMAP),
312311 CMD_FLAG_NAME(NOWAIT),
312+ CMD_FLAG_NAME(NOUNMAP),
313+ CMD_FLAG_NAME(HIPRI),
313314 };
314315 #undef CMD_FLAG_NAME
315316
block/blk-mq.c+2−1
@@ -1906,7 +1906,7 @@ static blk_qc_t blk_mq_make_request(struct request_queue *q, struct bio *bio) · 1905 unmodified lines
19061906 {
19071907 const int is_sync = op_is_sync(bio->bi_opf);
19081908 const int is_flush_fua = op_is_flush(bio->bi_opf);
1909− struct blk_mq_alloc_data data = { .flags = 0, .cmd_flags = bio->bi_opf };
1909+ struct blk_mq_alloc_data data = { .flags = 0};
19101910 struct request *rq;
19111911 struct blk_plug *plug;
19121912 struct request *same_queue_rq = NULL;
@@ -1928,6 +1928,7 @@ static blk_qc_t blk_mq_make_request(struct request_queue *q, struct bio *bio) · 15 unmodified lines
19281928
19291929 rq_qos_throttle(q, bio);
19301930
1931+ data.cmd_flags = bio->bi_opf;
19311932 rq = blk_mq_get_request(q, bio, &data);
19321933 if (unlikely(!rq)) {
19331934 rq_qos_cleanup(q, bio);
block/blk-wbt.c+2−2
@@ -597,7 +597,7 @@ static void wbt_track(struct rq_qos *rqos, struct request *rq, struct bio *bio) · 596 unmodified lines
597597 rq->wbt_flags |= bio_to_wbt_flags(rwb, bio);
598598 }
599599
600−void wbt_issue(struct rq_qos *rqos, struct request *rq)
600+static void wbt_issue(struct rq_qos *rqos, struct request *rq)
601601 {
602602 struct rq_wb *rwb = RQWB(rqos);
603603
@@ -617,7 +617,7 @@ void wbt_issue(struct rq_qos *rqos, struct request *rq) · 13 unmodified lines
617617 }
618618 }
619619
620−void wbt_requeue(struct rq_qos *rqos, struct request *rq)
620+static void wbt_requeue(struct rq_qos *rqos, struct request *rq)
621621 {
622622 struct rq_wb *rwb = RQWB(rqos);
623623 if (!rwb_enabled(rwb))
crypto/adiantum.c+4−0
@@ -539,6 +539,8 @@ static int adiantum_create(struct crypto_template *tmpl, struct rtattr **tb) · 538 unmodified lines
539539 ictx = skcipher_instance_ctx(inst);
540540
541541 /* Stream cipher, e.g. "xchacha12" */
542+ crypto_set_skcipher_spawn(&ictx->streamcipher_spawn,
543+ skcipher_crypto_instance(inst));
542544 err = crypto_grab_skcipher(&ictx->streamcipher_spawn, streamcipher_name,
543545 0, crypto_requires_sync(algt->type,
544546 algt->mask));
@@ -547,6 +549,8 @@ static int adiantum_create(struct crypto_template *tmpl, struct rtattr **tb) · 2 unmodified lines
547549 streamcipher_alg = crypto_spawn_skcipher_alg(&ictx->streamcipher_spawn);
548550
549551 /* Block cipher, e.g. "aes" */
552+ crypto_set_spawn(&ictx->blockcipher_spawn,
553+ skcipher_crypto_instance(inst));
550554 err = crypto_grab_spawn(&ictx->blockcipher_spawn, blockcipher_name,
551555 CRYPTO_ALG_TYPE_CIPHER, CRYPTO_ALG_TYPE_MASK);
552556 if (err)
crypto/authenc.c+11−3
@@ -58,14 +58,22 @@ int crypto_authenc_extractkeys(struct crypto_authenc_keys *keys, const u8 *key, · 57 unmodified lines
5858 return -EINVAL;
5959 if (rta->rta_type != CRYPTO_AUTHENC_KEYA_PARAM)
6060 return -EINVAL;
61− if (RTA_PAYLOAD(rta) < sizeof(*param))
61+
62+ /*
63+ * RTA_OK() didn't align the rtattr's payload when validating that it
64+ * fits in the buffer. Yet, the keys should start on the next 4-byte
65+ * aligned boundary. To avoid confusion, require that the rtattr
66+ * payload be exactly the param struct, which has a 4-byte aligned size.
67+ */
68+ if (RTA_PAYLOAD(rta) != sizeof(*param))
6269 return -EINVAL;
70+ BUILD_BUG_ON(sizeof(*param) % RTA_ALIGNTO);
6371
6472 param = RTA_DATA(rta);
6573 keys->enckeylen = be32_to_cpu(param->enckeylen);
6674
67− key += RTA_ALIGN(rta->rta_len);
68− keylen -= RTA_ALIGN(rta->rta_len);
75+ key += rta->rta_len;
76+ keylen -= rta->rta_len;
6977
7078 if (keylen < keys->enckeylen)
7179 return -EINVAL;
crypto/authencesn.c+1−1
@@ -279,7 +279,7 @@ static void authenc_esn_verify_ahash_done(struct crypto_async_request *areq, · 278 unmodified lines
279279 struct aead_request *req = areq->data;
280280
281281 err = err ?: crypto_authenc_esn_decrypt_tail(req, 0);
282− aead_request_complete(req, err);
282+ authenc_esn_request_complete(req, err);
283283 }
284284
285285 static int crypto_authenc_esn_decrypt(struct aead_request *req)
crypto/sm3_generic.c+1−1
@@ -100,7 +100,7 @@ static void sm3_compress(u32 *w, u32 *wt, u32 *m) · 99 unmodified lines
100100
101101 for (i = 0; i <= 63; i++) {
102102
103− ss1 = rol32((rol32(a, 12) + e + rol32(t(i), i)), 7);
103+ ss1 = rol32((rol32(a, 12) + e + rol32(t(i), i & 31)), 7);
104104
105105 ss2 = ss1 ^ rol32(a, 12);
106106
drivers/acpi/Makefile+2−1
@@ -41,7 +41,8 @@ acpi-y += ec.o · 40 unmodified lines
4141 acpi-$(CONFIG_ACPI_DOCK) += dock.o
4242 acpi-$(CONFIG_PCI) += pci_root.o pci_link.o pci_irq.o
4343 obj-$(CONFIG_ACPI_MCFG) += pci_mcfg.o
44−acpi-y += acpi_lpss.o acpi_apd.o
44+acpi-$(CONFIG_PCI) += acpi_lpss.o
45+acpi-y += acpi_apd.o
4546 acpi-y += acpi_platform.o
4647 acpi-y += acpi_pnp.o
4748 acpi-$(CONFIG_ARM_AMBA) += acpi_amba.o
drivers/acpi/bus.c+12−12
@@ -1054,18 +1054,6 @@ void __init acpi_early_init(void) · 1053 unmodified lines
10541054 goto error0;
10551055 }
10561056
1057− /*
1058− * ACPI 2.0 requires the EC driver to be loaded and work before
1059− * the EC device is found in the namespace (i.e. before
1060− * acpi_load_tables() is called).
1061− *
1062− * This is accomplished by looking for the ECDT table, and getting
1063− * the EC parameters out of that.
1064− *
1065− * Ignore the result. Not having an ECDT is not fatal.
1066− */
1067− status = acpi_ec_ecdt_probe();
1068−
10691057 #ifdef CONFIG_X86
10701058 if (!acpi_ioapic) {
10711059 /* compatible (0) means level (3) */
@@ -1142,6 +1130,18 @@ static int __init acpi_bus_init(void) · 70 unmodified lines
11421130 goto error1;
11431131 }
11441132
1133+ /*
1134+ * ACPI 2.0 requires the EC driver to be loaded and work before the EC
1135+ * device is found in the namespace.
1136+ *
1137+ * This is accomplished by looking for the ECDT table and getting the EC
1138+ * parameters out of that.
1139+ *
1140+ * Do that before calling acpi_initialize_objects() which may trigger EC
1141+ * address space accesses.
1142+ */
1143+ acpi_ec_ecdt_probe();
1144+
11451145 status = acpi_enable_subsystem(ACPI_NO_ACPI_ENABLE);
11461146 if (ACPI_FAILURE(status)) {
11471147 printk(KERN_ERR PREFIX
drivers/acpi/internal.h+4−0
@@ -81,7 +81,11 @@ void acpi_debugfs_init(void); · 80 unmodified lines
8181 #else
8282 static inline void acpi_debugfs_init(void) { return; }
8383 #endif
84+#ifdef CONFIG_PCI
8485 void acpi_lpss_init(void);
86+#else
87+static inline void acpi_lpss_init(void) {}
88+#endif
8589
8690 void acpi_apd_init(void);
8791
drivers/acpi/nfit/core.c+54−32
@@ -26,7 +26,6 @@ · 25 unmodified lines
2626 #include <acpi/nfit.h>
2727 #include "intel.h"
2828 #include "nfit.h"
29−#include "intel.h"
3029
3130 /*
3231 * For readq() and writeq() on 32-bit builds, the hi-lo, lo-hi order is
@@ -78,12 +77,6 @@ const guid_t *to_nfit_uuid(enum nfit_uuids id) · 45 unmodified lines
7877 }
7978 EXPORT_SYMBOL(to_nfit_uuid);
8079
81−static struct acpi_nfit_desc *to_acpi_nfit_desc(
82− struct nvdimm_bus_descriptor *nd_desc)
83−{
84− return container_of(nd_desc, struct acpi_nfit_desc, nd_desc);
85−}
86−
8780 static struct acpi_device *to_acpi_dev(struct acpi_nfit_desc *acpi_desc)
8881 {
8982 struct nvdimm_bus_descriptor *nd_desc = &acpi_desc->nd_desc;
@@ -416,10 +409,36 @@ static bool payload_dumpable(struct nvdimm *nvdimm, unsigned int func) · 326 unmodified lines
416409 return true;
417410 }
418411
412+static int cmd_to_func(struct nfit_mem *nfit_mem, unsigned int cmd,
413+ struct nd_cmd_pkg *call_pkg)
414+{
415+ if (call_pkg) {
416+ int i;
417+
418+ if (nfit_mem->family != call_pkg->nd_family)
419+ return -ENOTTY;
420+
421+ for (i = 0; i < ARRAY_SIZE(call_pkg->nd_reserved2); i++)
422+ if (call_pkg->nd_reserved2[i])
423+ return -EINVAL;
424+ return call_pkg->nd_command;
425+ }
426+
427+ /* Linux ND commands == NVDIMM_FAMILY_INTEL function numbers */
428+ if (nfit_mem->family == NVDIMM_FAMILY_INTEL)
429+ return cmd;
430+
431+ /*
432+ * Force function number validation to fail since 0 is never
433+ * published as a valid function in dsm_mask.
434+ */
435+ return 0;
436+}
437+
419438 int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc, struct nvdimm *nvdimm,
420439 unsigned int cmd, void *buf, unsigned int buf_len, int *cmd_rc)
421440 {
422− struct acpi_nfit_desc *acpi_desc = to_acpi_nfit_desc(nd_desc);
441+ struct acpi_nfit_desc *acpi_desc = to_acpi_desc(nd_desc);
423442 struct nfit_mem *nfit_mem = nvdimm_provider_data(nvdimm);
424443 union acpi_object in_obj, in_buf, *out_obj;
425444 const struct nd_cmd_desc *desc = NULL;
@@ -429,30 +448,23 @@ int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc, struct nvdimm *nvdimm, · 3 unmodified lines
429448 unsigned long cmd_mask, dsm_mask;
430449 u32 offset, fw_status = 0;
431450 acpi_handle handle;
432− unsigned int func;
433451 const guid_t *guid;
434− int rc, i;
452+ int func, rc, i;
435453
436454 if (cmd_rc)
437455 *cmd_rc = -EINVAL;
438− func = cmd;
439− if (cmd == ND_CMD_CALL) {
440− call_pkg = buf;
441− func = call_pkg->nd_command;
442−
443− for (i = 0; i < ARRAY_SIZE(call_pkg->nd_reserved2); i++)
444− if (call_pkg->nd_reserved2[i])
445− return -EINVAL;
446− }
447456
448457 if (nvdimm) {
449458 struct acpi_device *adev = nfit_mem->adev;
450459
451460 if (!adev)
452461 return -ENOTTY;
453− if (call_pkg && nfit_mem->family != call_pkg->nd_family)
454− return -ENOTTY;
455462
463+ if (cmd == ND_CMD_CALL)
464+ call_pkg = buf;
465+ func = cmd_to_func(nfit_mem, cmd, call_pkg);
466+ if (func < 0)
467+ return func;
456468 dimm_name = nvdimm_name(nvdimm);
457469 cmd_name = nvdimm_cmd_name(cmd);
458470 cmd_mask = nvdimm_cmd_mask(nvdimm);
@@ -463,6 +475,7 @@ int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc, struct nvdimm *nvdimm, · 4 unmodified lines
463475 } else {
464476 struct acpi_device *adev = to_acpi_dev(acpi_desc);
465477
478+ func = cmd;
466479 cmd_name = nvdimm_bus_cmd_name(cmd);
467480 cmd_mask = nd_desc->cmd_mask;
468481 dsm_mask = cmd_mask;
@@ -477,7 +490,13 @@ int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc, struct nvdimm *nvdimm, · 8 unmodified lines
477490 if (!desc || (cmd && (desc->out_num + desc->in_num == 0)))
478491 return -ENOTTY;
479492
480− if (!test_bit(cmd, &cmd_mask) || !test_bit(func, &dsm_mask))
493+ /*
494+ * Check for a valid command. For ND_CMD_CALL, we also have to
495+ * make sure that the DSM function is supported.
496+ */
497+ if (cmd == ND_CMD_CALL && !test_bit(func, &dsm_mask))
498+ return -ENOTTY;
499+ else if (!test_bit(cmd, &cmd_mask))
481500 return -ENOTTY;
482501
483502 in_obj.type = ACPI_TYPE_PACKAGE;
@@ -721,6 +740,7 @@ int nfit_get_smbios_id(u32 device_handle, u16 *flags) · 237 unmodified lines
721740 struct acpi_nfit_memory_map *memdev;
722741 struct acpi_nfit_desc *acpi_desc;
723742 struct nfit_mem *nfit_mem;
743+ u16 physical_id;
724744
725745 mutex_lock(&acpi_desc_lock);
726746 list_for_each_entry(acpi_desc, &acpi_descs, list) {
@@ -728,10 +748,11 @@ int nfit_get_smbios_id(u32 device_handle, u16 *flags) · 1 unmodified line
728748 list_for_each_entry(nfit_mem, &acpi_desc->dimms, list) {
729749 memdev = __to_nfit_memdev(nfit_mem);
730750 if (memdev->device_handle == device_handle) {
751+ *flags = memdev->flags;
752+ physical_id = memdev->physical_id;
731753 mutex_unlock(&acpi_desc->init_mutex);
732754 mutex_unlock(&acpi_desc_lock);
733− *flags = memdev->flags;
734− return memdev->physical_id;
755+ return physical_id;
735756 }
736757 }
737758 mutex_unlock(&acpi_desc->init_mutex);
@@ -1872,6 +1893,13 @@ static int acpi_nfit_add_dimm(struct acpi_nfit_desc *acpi_desc, · 1134 unmodified lines
18721893 return 0;
18731894 }
18741895
1896+ /*
1897+ * Function 0 is the command interrogation function, don't
1898+ * export it to potential userspace use, and enable it to be
1899+ * used as an error value in acpi_nfit_ctl().
1900+ */
1901+ dsm_mask &= ~1UL;
1902+
18751903 guid = to_nfit_uuid(nfit_mem->family);
18761904 for_each_set_bit(i, &dsm_mask, BITS_PER_LONG)
18771905 if (acpi_check_dsm(adev_dimm->handle, guid,
@@ -2047,11 +2075,6 @@ static int acpi_nfit_register_dimms(struct acpi_nfit_desc *acpi_desc) · 169 unmodified lines
20472075 if (!nvdimm)
20482076 continue;
20492077
2050− rc = nvdimm_security_setup_events(nvdimm);
2051− if (rc < 0)
2052− dev_warn(acpi_desc->dev,
2053− "security event setup failed: %d\n", rc);
2054−
20552078 nfit_kernfs = sysfs_get_dirent(nvdimm_kobj(nvdimm)->sd, "nfit");
20562079 if (nfit_kernfs)
20572080 nfit_mem->flags_attr = sysfs_get_dirent(nfit_kernfs,
@@ -2231,7 +2254,6 @@ static int acpi_nfit_init_interleave_set(struct acpi_nfit_desc *acpi_desc, · 173 unmodified lines
22312254 nd_set = devm_kzalloc(dev, sizeof(*nd_set), GFP_KERNEL);
22322255 if (!nd_set)
22332256 return -ENOMEM;
2234− ndr_desc->nd_set = nd_set;
22352257 guid_copy(&nd_set->type_guid, (guid_t *) spa->range_guid);
22362258
22372259 info = devm_kzalloc(dev, sizeof_nfit_set_info(nr), GFP_KERNEL);
@@ -3367,7 +3389,7 @@ EXPORT_SYMBOL_GPL(acpi_nfit_init); · 1129 unmodified lines
33673389
33683390 static int acpi_nfit_flush_probe(struct nvdimm_bus_descriptor *nd_desc)
33693391 {
3370− struct acpi_nfit_desc *acpi_desc = to_acpi_nfit_desc(nd_desc);
3392+ struct acpi_nfit_desc *acpi_desc = to_acpi_desc(nd_desc);
33713393 struct device *dev = acpi_desc->dev;
33723394
33733395 /* Bounce the device lock to flush acpi_nfit_add / acpi_nfit_notify */
@@ -3384,7 +3406,7 @@ static int acpi_nfit_flush_probe(struct nvdimm_bus_descriptor *nd_desc) · 10 unmodified lines
33843406 static int __acpi_nfit_clear_to_send(struct nvdimm_bus_descriptor *nd_desc,
33853407 struct nvdimm *nvdimm, unsigned int cmd)
33863408 {
3387− struct acpi_nfit_desc *acpi_desc = to_acpi_nfit_desc(nd_desc);
3409+ struct acpi_nfit_desc *acpi_desc = to_acpi_desc(nd_desc);
33883410
33893411 if (nvdimm)
33903412 return 0;
drivers/acpi/nfit/intel.c+4−4
@@ -146,7 +146,7 @@ static int intel_security_change_key(struct nvdimm *nvdimm, · 145 unmodified lines
146146
147147 static void nvdimm_invalidate_cache(void);
148148
149−static int intel_security_unlock(struct nvdimm *nvdimm,
149+static int __maybe_unused intel_security_unlock(struct nvdimm *nvdimm,
150150 const struct nvdimm_key_data *key_data)
151151 {
152152 struct nfit_mem *nfit_mem = nvdimm_provider_data(nvdimm);
@@ -227,7 +227,7 @@ static int intel_security_disable(struct nvdimm *nvdimm, · 74 unmodified lines
227227 return 0;
228228 }
229229
230−static int intel_security_erase(struct nvdimm *nvdimm,
230+static int __maybe_unused intel_security_erase(struct nvdimm *nvdimm,
231231 const struct nvdimm_key_data *key,
232232 enum nvdimm_passphrase_type ptype)
233233 {
@@ -276,7 +276,7 @@ static int intel_security_erase(struct nvdimm *nvdimm, · 42 unmodified lines
276276 return 0;
277277 }
278278
279−static int intel_security_query_overwrite(struct nvdimm *nvdimm)
279+static int __maybe_unused intel_security_query_overwrite(struct nvdimm *nvdimm)
280280 {
281281 int rc;
282282 struct nfit_mem *nfit_mem = nvdimm_provider_data(nvdimm);
@@ -313,7 +313,7 @@ static int intel_security_query_overwrite(struct nvdimm *nvdimm) · 30 unmodified lines
313313 return 0;
314314 }
315315
316−static int intel_security_overwrite(struct nvdimm *nvdimm,
316+static int __maybe_unused intel_security_overwrite(struct nvdimm *nvdimm,
317317 const struct nvdimm_key_data *nkey)
318318 {
319319 int rc;
drivers/android/binderfs.c+151−131
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 #include <linux/kdev_t.h>
1212 #include <linux/kernel.h>
1313 #include <linux/list.h>
14+#include <linux/namei.h>
1415 #include <linux/magic.h>
1516 #include <linux/major.h>
1617 #include <linux/miscdevice.h>
@@ -20,6 +21,7 @@ · 3 unmodified lines
2021 #include <linux/parser.h>
2122 #include <linux/radix-tree.h>
2223 #include <linux/sched.h>
24+#include <linux/seq_file.h>
2325 #include <linux/slab.h>
2426 #include <linux/spinlock_types.h>
2527 #include <linux/stddef.h>
@@ -30,7 +32,7 @@ · 4 unmodified lines
3032 #include <linux/xarray.h>
3133 #include <uapi/asm-generic/errno-base.h>
3234 #include <uapi/linux/android/binder.h>
33−#include <uapi/linux/android/binder_ctl.h>
35+#include <uapi/linux/android/binderfs.h>
3436
3537 #include "binder_internal.h"
3638
@@ -39,13 +41,31 @@ · 2 unmodified lines
3941 #define INODE_OFFSET 3
4042 #define INTSTRLEN 21
4143 #define BINDERFS_MAX_MINOR (1U << MINORBITS)
42−
43−static struct vfsmount *binderfs_mnt;
44+/* Ensure that the initial ipc namespace always has devices available. */
45+#define BINDERFS_MAX_MINOR_CAPPED (BINDERFS_MAX_MINOR - 4)
4446
4547 static dev_t binderfs_dev;
4648 static DEFINE_MUTEX(binderfs_minors_mutex);
4749 static DEFINE_IDA(binderfs_minors);
4850
51+/**
52+ * binderfs_mount_opts - mount options for binderfs
53+ * @max: maximum number of allocatable binderfs binder devices
54+ */
55+struct binderfs_mount_opts {
56+ int max;
57+};
58+
59+enum {
60+ Opt_max,
61+ Opt_err
62+};
63+
64+static const match_table_t tokens = {
65+ { Opt_max, "max=%d" },
66+ { Opt_err, NULL }
67+};
68+
4969 /**
5070 * binderfs_info - information about a binderfs mount
5171 * @ipc_ns: The ipc namespace the binderfs mount belongs to.
@@ -55,13 +75,16 @@ static DEFINE_IDA(binderfs_minors); · 3 unmodified lines
5575 * created.
5676 * @root_gid: gid that needs to be used when a new binder device is
5777 * created.
78+ * @mount_opts: The mount options in use.
79+ * @device_count: The current number of allocated binder devices.
5880 */
5981 struct binderfs_info {
6082 struct ipc_namespace *ipc_ns;
6183 struct dentry *control_dentry;
6284 kuid_t root_uid;
6385 kgid_t root_gid;
64−
86+ struct binderfs_mount_opts mount_opts;
87+ int device_count;
6588 };
6689
6790 static inline struct binderfs_info *BINDERFS_I(const struct inode *inode)
@@ -84,7 +107,7 @@ bool is_binderfs_device(const struct inode *inode) · 16 unmodified lines
84107 * @userp: buffer to copy information about new device for userspace to
85108 * @req: struct binderfs_device as copied from userspace
86109 *
87− * This function allocated a new binder_device and reserves a new minor
110+ * This function allocates a new binder_device and reserves a new minor
88111 * number for it.
89112 * Minor numbers are limited and tracked globally in binderfs_minors. The
90113 * function will stash a struct binder_device for the specific binder
@@ -100,20 +123,34 @@ static int binderfs_binder_device_create(struct inode *ref_inode, · 9 unmodified lines
100123 struct binderfs_device *req)
101124 {
102125 int minor, ret;
103− struct dentry *dentry, *dup, *root;
126+ struct dentry *dentry, *root;
104127 struct binder_device *device;
105− size_t name_len = BINDERFS_MAX_NAME + 1;
106128 char *name = NULL;
129+ size_t name_len;
107130 struct inode *inode = NULL;
108131 struct super_block *sb = ref_inode->i_sb;
109132 struct binderfs_info *info = sb->s_fs_info;
133+#if defined(CONFIG_IPC_NS)
134+ bool use_reserve = (info->ipc_ns == &init_ipc_ns);
135+#else
136+ bool use_reserve = true;
137+#endif
110138
111139 /* Reserve new minor number for the new device. */
112140 mutex_lock(&binderfs_minors_mutex);
113− minor = ida_alloc_max(&binderfs_minors, BINDERFS_MAX_MINOR, GFP_KERNEL);
114− mutex_unlock(&binderfs_minors_mutex);
115− if (minor < 0)
141+ if (++info->device_count <= info->mount_opts.max)
142+ minor = ida_alloc_max(&binderfs_minors,
143+ use_reserve ? BINDERFS_MAX_MINOR :
144+ BINDERFS_MAX_MINOR_CAPPED,
145+ GFP_KERNEL);
146+ else
147+ minor = -ENOSPC;
148+ if (minor < 0) {
149+ --info->device_count;
150+ mutex_unlock(&binderfs_minors_mutex);
116151 return minor;
152+ }
153+ mutex_unlock(&binderfs_minors_mutex);
117154
118155 ret = -ENOMEM;
119156 device = kzalloc(sizeof(*device), GFP_KERNEL);
@@ -132,12 +169,13 @@ static int binderfs_binder_device_create(struct inode *ref_inode, · 12 unmodified lines
132169 inode->i_uid = info->root_uid;
133170 inode->i_gid = info->root_gid;
134171
135− name = kmalloc(name_len, GFP_KERNEL);
172+ req->name[BINDERFS_MAX_NAME] = '\0'; /* NUL-terminate */
173+ name_len = strlen(req->name);
174+ /* Make sure to include terminating NUL byte */
175+ name = kmemdup(req->name, name_len + 1, GFP_KERNEL);
136176 if (!name)
137177 goto err;
138178
139− strscpy(name, req->name, name_len);
140−
141179 device->binderfs_inode = inode;
142180 device->context.binder_context_mgr_uid = INVALID_UID;
143181 device->context.name = name;
@@ -156,28 +194,25 @@ static int binderfs_binder_device_create(struct inode *ref_inode, · 12 unmodified lines
156194
157195 root = sb->s_root;
158196 inode_lock(d_inode(root));
159− dentry = d_alloc_name(root, name);
160− if (!dentry) {
197+
198+ /* look it up */
199+ dentry = lookup_one_len(name, root, name_len);
200+ if (IS_ERR(dentry)) {
161201 inode_unlock(d_inode(root));
162− ret = -ENOMEM;
202+ ret = PTR_ERR(dentry);
163203 goto err;
164204 }
165205
166− /* Verify that the name userspace gave us is not already in use. */
167− dup = d_lookup(root, &dentry->d_name);
168− if (dup) {
169− if (d_really_is_positive(dup)) {
170− dput(dup);
171− dput(dentry);
172− inode_unlock(d_inode(root));
173− ret = -EEXIST;
174− goto err;
175− }
176− dput(dup);
206+ if (d_really_is_positive(dentry)) {
207+ /* already exists */
208+ dput(dentry);
209+ inode_unlock(d_inode(root));
210+ ret = -EEXIST;
211+ goto err;
177212 }
178213
179214 inode->i_private = device;
180− d_add(dentry, inode);
215+ d_instantiate(dentry, inode);
181216 fsnotify_create(root->d_inode, dentry);
182217 inode_unlock(d_inode(root));
183218
@@ -187,6 +222,7 @@ err: · 3 unmodified lines
187222 kfree(name);
188223 kfree(device);
189224 mutex_lock(&binderfs_minors_mutex);
225+ --info->device_count;
190226 ida_free(&binderfs_minors, minor);
191227 mutex_unlock(&binderfs_minors_mutex);
192228 iput(inode);
@@ -232,6 +268,7 @@ static long binder_ctl_ioctl(struct file *file, unsigned int cmd, · 39 unmodified lines
232268 static void binderfs_evict_inode(struct inode *inode)
233269 {
234270 struct binder_device *device = inode->i_private;
271+ struct binderfs_info *info = BINDERFS_I(inode);
235272
236273 clear_inode(inode);
237274
@@ -239,6 +276,7 @@ static void binderfs_evict_inode(struct inode *inode) · 1 unmodified line
239276 return;
240277
241278 mutex_lock(&binderfs_minors_mutex);
279+ --info->device_count;
242280 ida_free(&binderfs_minors, device->miscdev.minor);
243281 mutex_unlock(&binderfs_minors_mutex);
244282
@@ -246,43 +284,87 @@ static void binderfs_evict_inode(struct inode *inode) · 1 unmodified line
246284 kfree(device);
247285 }
248286
287+/**
288+ * binderfs_parse_mount_opts - parse binderfs mount options
289+ * @data: options to set (can be NULL in which case defaults are used)
290+ */
291+static int binderfs_parse_mount_opts(char *data,
292+ struct binderfs_mount_opts *opts)
293+{
294+ char *p;
295+ opts->max = BINDERFS_MAX_MINOR;
296+
297+ while ((p = strsep(&data, ",")) != NULL) {
298+ substring_t args[MAX_OPT_ARGS];
299+ int token;
300+ int max_devices;
301+
302+ if (!*p)
303+ continue;
304+
305+ token = match_token(p, tokens, args);
306+ switch (token) {
307+ case Opt_max:
308+ if (match_int(&args[0], &max_devices) ||
309+ (max_devices < 0 ||
310+ (max_devices > BINDERFS_MAX_MINOR)))
311+ return -EINVAL;
312+
313+ opts->max = max_devices;
314+ break;
315+ default:
316+ pr_err("Invalid mount options\n");
317+ return -EINVAL;
318+ }
319+ }
320+
321+ return 0;
322+}
323+
324+static int binderfs_remount(struct super_block *sb, int *flags, char *data)
325+{
326+ struct binderfs_info *info = sb->s_fs_info;
327+ return binderfs_parse_mount_opts(data, &info->mount_opts);
328+}
329+
330+static int binderfs_show_mount_opts(struct seq_file *seq, struct dentry *root)
331+{
332+ struct binderfs_info *info;
333+
334+ info = root->d_sb->s_fs_info;
335+ if (info->mount_opts.max <= BINDERFS_MAX_MINOR)
336+ seq_printf(seq, ",max=%d", info->mount_opts.max);
337+
338+ return 0;
339+}
340+
249341 static const struct super_operations binderfs_super_ops = {
250− .statfs = simple_statfs,
251− .evict_inode = binderfs_evict_inode,
342+ .evict_inode = binderfs_evict_inode,
343+ .remount_fs = binderfs_remount,
344+ .show_options = binderfs_show_mount_opts,
345+ .statfs = simple_statfs,
252346 };
253347
348+static inline bool is_binderfs_control_device(const struct dentry *dentry)
349+{
350+ struct binderfs_info *info = dentry->d_sb->s_fs_info;
351+ return info->control_dentry == dentry;
352+}
353+
254354 static int binderfs_rename(struct inode *old_dir, struct dentry *old_dentry,
255355 struct inode *new_dir, struct dentry *new_dentry,
256356 unsigned int flags)
257357 {
258− struct inode *inode = d_inode(old_dentry);
259−
260− /* binderfs doesn't support directories. */
261− if (d_is_dir(old_dentry))
358+ if (is_binderfs_control_device(old_dentry) ||
359+ is_binderfs_control_device(new_dentry))
262360 return -EPERM;
263361
264− if (flags & ~RENAME_NOREPLACE)
265− return -EINVAL;
266−
267− if (!simple_empty(new_dentry))
268− return -ENOTEMPTY;
269−
270− if (d_really_is_positive(new_dentry))
271− simple_unlink(new_dir, new_dentry);
272−
273− old_dir->i_ctime = old_dir->i_mtime = new_dir->i_ctime =
274− new_dir->i_mtime = inode->i_ctime = current_time(old_dir);
275−
276− return 0;
362+ return simple_rename(old_dir, old_dentry, new_dir, new_dentry, flags);
277363 }
278364
279365 static int binderfs_unlink(struct inode *dir, struct dentry *dentry)
280366 {
281− /*
282− * The control dentry is only ever touched during mount so checking it
283− * here should not require us to take lock.
284− */
285− if (BINDERFS_I(dir)->control_dentry == dentry)
367+ if (is_binderfs_control_device(dentry))
286368 return -EPERM;
287369
288370 return simple_unlink(dir, dentry);
@@ -318,8 +400,6 @@ static int binderfs_binder_ctl_create(struct super_block *sb) · 29 unmodified lines
318400 if (!device)
319401 return -ENOMEM;
320402
321− inode_lock(d_inode(root));
322−
323403 /* If we have already created a binder-control node, return. */
324404 if (info->control_dentry) {
325405 ret = 0;
@@ -358,12 +438,10 @@ static int binderfs_binder_ctl_create(struct super_block *sb) · 32 unmodified lines
358438 inode->i_private = device;
359439 info->control_dentry = dentry;
360440 d_add(dentry, inode);
361− inode_unlock(d_inode(root));
362441
363442 return 0;
364443
365444 out:
366− inode_unlock(d_inode(root));
367445 kfree(device);
368446 iput(inode);
369447
@@ -378,12 +456,9 @@ static const struct inode_operations binderfs_dir_inode_operations = { · 8 unmodified lines
378456
379457 static int binderfs_fill_super(struct super_block *sb, void *data, int silent)
380458 {
459+ int ret;
381460 struct binderfs_info *info;
382− int ret = -ENOMEM;
383461 struct inode *inode = NULL;
384− struct ipc_namespace *ipc_ns = sb->s_fs_info;
385−
386− get_ipc_ns(ipc_ns);
387462
388463 sb->s_blocksize = PAGE_SIZE;
389464 sb->s_blocksize_bits = PAGE_SHIFT;
@@ -405,11 +480,17 @@ static int binderfs_fill_super(struct super_block *sb, void *data, int silent) · 15 unmodified lines
405480 sb->s_op = &binderfs_super_ops;
406481 sb->s_time_gran = 1;
407482
408− info = kzalloc(sizeof(struct binderfs_info), GFP_KERNEL);
409− if (!info)
410− goto err_without_dentry;
483+ sb->s_fs_info = kzalloc(sizeof(struct binderfs_info), GFP_KERNEL);
484+ if (!sb->s_fs_info)
485+ return -ENOMEM;
486+ info = sb->s_fs_info;
487+
488+ info->ipc_ns = get_ipc_ns(current->nsproxy->ipc_ns);
489+
490+ ret = binderfs_parse_mount_opts(data, &info->mount_opts);
491+ if (ret)
492+ return ret;
411493
412− info->ipc_ns = ipc_ns;
413494 info->root_gid = make_kgid(sb->s_user_ns, 0);
414495 if (!gid_valid(info->root_gid))
415496 info->root_gid = GLOBAL_ROOT_GID;
@@ -417,11 +498,9 @@ static int binderfs_fill_super(struct super_block *sb, void *data, int silent) · 1 unmodified line
417498 if (!uid_valid(info->root_uid))
418499 info->root_uid = GLOBAL_ROOT_UID;
419500
420− sb->s_fs_info = info;
421−
422501 inode = new_inode(sb);
423502 if (!inode)
424− goto err_without_dentry;
503+ return -ENOMEM;
425504
426505 inode->i_ino = FIRST_INODE;
427506 inode->i_fop = &simple_dir_operations;
@@ -432,79 +511,28 @@ static int binderfs_fill_super(struct super_block *sb, void *data, int silent) · 4 unmodified lines
432511
433512 sb->s_root = d_make_root(inode);
434513 if (!sb->s_root)
435− goto err_without_dentry;
436−
437− ret = binderfs_binder_ctl_create(sb);
438− if (ret)
439− goto err_with_dentry;
440−
441− return 0;
442−
443−err_with_dentry:
444− dput(sb->s_root);
445− sb->s_root = NULL;
446−
447−err_without_dentry:
448− put_ipc_ns(ipc_ns);
449− iput(inode);
450− kfree(info);
451−
452− return ret;
453−}
454−
455−static int binderfs_test_super(struct super_block *sb, void *data)
456−{
457− struct binderfs_info *info = sb->s_fs_info;
458−
459− if (info)
460− return info->ipc_ns == data;
461−
462− return 0;
463−}
514+ return -ENOMEM;
464515
465−static int binderfs_set_super(struct super_block *sb, void *data)
466−{
467− sb->s_fs_info = data;
468− return set_anon_super(sb, NULL);
516+ return binderfs_binder_ctl_create(sb);
469517 }
470518
471519 static struct dentry *binderfs_mount(struct file_system_type *fs_type,
472520 int flags, const char *dev_name,
473521 void *data)
474522 {
475− struct super_block *sb;
476− struct ipc_namespace *ipc_ns = current->nsproxy->ipc_ns;
477−
478− if (!ns_capable(ipc_ns->user_ns, CAP_SYS_ADMIN))
479− return ERR_PTR(-EPERM);
480−
481− sb = sget_userns(fs_type, binderfs_test_super, binderfs_set_super,
482− flags, ipc_ns->user_ns, ipc_ns);
483− if (IS_ERR(sb))
484− return ERR_CAST(sb);
485−
486− if (!sb->s_root) {
487− int ret = binderfs_fill_super(sb, data, flags & SB_SILENT ? 1 : 0);
488− if (ret) {
489− deactivate_locked_super(sb);
490− return ERR_PTR(ret);
491− }
492−
493− sb->s_flags |= SB_ACTIVE;
494− }
495−
496− return dget(sb->s_root);
523+ return mount_nodev(fs_type, flags, data, binderfs_fill_super);
497524 }
498525
499526 static void binderfs_kill_super(struct super_block *sb)
500527 {
501528 struct binderfs_info *info = sb->s_fs_info;
502529
530+ kill_litter_super(sb);
531+
503532 if (info && info->ipc_ns)
504533 put_ipc_ns(info->ipc_ns);
505534
506535 kfree(info);
507− kill_litter_super(sb);
508536 }
509537
510538 static struct file_system_type binder_fs_type = {
@@ -530,14 +558,6 @@ static int __init init_binderfs(void) · 19 unmodified lines
530558 return ret;
531559 }
532560
533− binderfs_mnt = kern_mount(&binder_fs_type);
534− if (IS_ERR(binderfs_mnt)) {
535− ret = PTR_ERR(binderfs_mnt);
536− binderfs_mnt = NULL;
537− unregister_filesystem(&binder_fs_type);
538− unregister_chrdev_region(binderfs_dev, BINDERFS_MAX_MINOR);
539− }
540−
541561 return ret;
542562 }
543563
drivers/ata/Kconfig+1−1
@@ -1091,7 +1091,7 @@ comment "Generic fallback / legacy drivers" · 1090 unmodified lines
10911091
10921092 config PATA_ACPI
10931093 tristate "ACPI firmware driver for PATA"
1094− depends on ATA_ACPI && ATA_BMDMA
1094+ depends on ATA_ACPI && ATA_BMDMA && PCI
10951095 help
10961096 This option enables an ACPI method driver which drives
10971097 motherboard PATA controller interfaces through the ACPI
drivers/ata/pata_macio.c+4−5
@@ -915,6 +915,10 @@ static struct scsi_host_template pata_macio_sht = { · 914 unmodified lines
915915 .sg_tablesize = MAX_DCMDS,
916916 /* We may not need that strict one */
917917 .dma_boundary = ATA_DMA_BOUNDARY,
918+ /* Not sure what the real max is but we know it's less than 64K, let's
919+ * use 64K minus 256
920+ */
921+ .max_segment_size = MAX_DBDMA_SEG,
918922 .slave_configure = pata_macio_slave_config,
919923 };
920924
@@ -1044,11 +1048,6 @@ static int pata_macio_common_init(struct pata_macio_priv *priv, · 123 unmodified lines
10441048 /* Make sure we have sane initial timings in the cache */
10451049 pata_macio_default_timings(priv);
10461050
1047− /* Not sure what the real max is but we know it's less than 64K, let's
1048− * use 64K minus 256
1049− */
1050− dma_set_max_seg_size(priv->dev, MAX_DBDMA_SEG);
1051−
10521051 /* Allocate libata host for 1 port */
10531052 memset(&pinfo, 0, sizeof(struct ata_port_info));
10541053 pmac_macio_calc_timing_masks(priv, &pinfo);
drivers/ata/sata_inic162x.c+9−13
@@ -245,8 +245,15 @@ struct inic_port_priv { · 244 unmodified lines
245245
246246 static struct scsi_host_template inic_sht = {
247247 ATA_BASE_SHT(DRV_NAME),
248− .sg_tablesize = LIBATA_MAX_PRD, /* maybe it can be larger? */
249− .dma_boundary = INIC_DMA_BOUNDARY,
248+ .sg_tablesize = LIBATA_MAX_PRD, /* maybe it can be larger? */
249+
250+ /*
251+ * This controller is braindamaged. dma_boundary is 0xffff like others
252+ * but it will lock up the whole machine HARD if 65536 byte PRD entry
253+ * is fed. Reduce maximum segment size.
254+ */
255+ .dma_boundary = INIC_DMA_BOUNDARY,
256+ .max_segment_size = 65536 - 512,
250257 };
251258
252259 static const int scr_map[] = {
@@ -868,17 +875,6 @@ static int inic_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) · 615 unmodified lines
868875 return rc;
869876 }
870877
871− /*
872− * This controller is braindamaged. dma_boundary is 0xffff
873− * like others but it will lock up the whole machine HARD if
874− * 65536 byte PRD entry is fed. Reduce maximum segment size.
875− */
876− rc = dma_set_max_seg_size(&pdev->dev, 65536 - 512);
877− if (rc) {
878− dev_err(&pdev->dev, "failed to set the maximum segment size\n");
879− return rc;
880− }
881−
882878 rc = init_controller(hpriv->mmio_base, hpriv->cached_hctl);
883879 if (rc) {
884880 dev_err(&pdev->dev, "failed to initialize controller\n");
drivers/atm/he.c+1−1
@@ -718,7 +718,7 @@ static int he_init_cs_block_rcm(struct he_dev *he_dev) · 717 unmodified lines
718718 instead of '/ 512', use '>> 9' to prevent a call
719719 to divdu3 on x86 platforms
720720 */
721− rate_cps = (unsigned long long) (1 << exp) * (man + 512) >> 9;
721+ rate_cps = (unsigned long long) (1UL << exp) * (man + 512) >> 9;
722722
723723 if (rate_cps < 10)
724724 rate_cps = 10; /* 2.2.1 minimum payload rate is 10 cps */
drivers/base/power/runtime.c+5−5
@@ -130,7 +130,7 @@ u64 pm_runtime_autosuspend_expiration(struct device *dev) · 129 unmodified lines
130130 {
131131 int autosuspend_delay;
132132 u64 last_busy, expires = 0;
133− u64 now = ktime_to_ns(ktime_get());
133+ u64 now = ktime_get_mono_fast_ns();
134134
135135 if (!dev->power.use_autosuspend)
136136 goto out;
@@ -909,7 +909,7 @@ static enum hrtimer_restart pm_suspend_timer_fn(struct hrtimer *timer) · 772 unmodified lines
909909 * If 'expires' is after the current time, we've been called
910910 * too early.
911911 */
912− if (expires > 0 && expires < ktime_to_ns(ktime_get())) {
912+ if (expires > 0 && expires < ktime_get_mono_fast_ns()) {
913913 dev->power.timer_expires = 0;
914914 rpm_suspend(dev, dev->power.timer_autosuspends ?
915915 (RPM_ASYNC | RPM_AUTO) : RPM_ASYNC);
@@ -928,7 +928,7 @@ static enum hrtimer_restart pm_suspend_timer_fn(struct hrtimer *timer) · 12 unmodified lines
928928 int pm_schedule_suspend(struct device *dev, unsigned int delay)
929929 {
930930 unsigned long flags;
931− ktime_t expires;
931+ u64 expires;
932932 int retval;
933933
934934 spin_lock_irqsave(&dev->power.lock, flags);
@@ -945,8 +945,8 @@ int pm_schedule_suspend(struct device *dev, unsigned int delay) · 10 unmodified lines
945945 /* Other scheduled or pending requests need to be canceled. */
946946 pm_runtime_cancel_pending(dev);
947947
948− expires = ktime_add(ktime_get(), ms_to_ktime(delay));
949− dev->power.timer_expires = ktime_to_ns(expires);
948+ expires = ktime_get_mono_fast_ns() + (u64)delay * NSEC_PER_MSEC;
949+ dev->power.timer_expires = expires;
950950 dev->power.timer_autosuspends = 0;
951951 hrtimer_start(&dev->power.suspend_timer, expires, HRTIMER_MODE_ABS);
952952
drivers/base/regmap/regmap-irq.c+7−1
@@ -108,6 +108,9 @@ static void regmap_irq_sync_unlock(struct irq_data *data) · 107 unmodified lines
108108 * suppress pointless writes.
109109 */
110110 for (i = 0; i < d->chip->num_regs; i++) {
111+ if (!d->chip->mask_base)
112+ continue;
113+
111114 reg = d->chip->mask_base +
112115 (i * map->reg_stride * d->irq_reg_stride);
113116 if (d->chip->mask_invert) {
@@ -258,7 +261,7 @@ static int regmap_irq_set_type(struct irq_data *data, unsigned int type) · 144 unmodified lines
258261 const struct regmap_irq_type *t = &irq_data->type;
259262
260263 if ((t->types_supported & type) != type)
261− return -ENOTSUPP;
264+ return 0;
262265
263266 reg = t->type_reg_offset / map->reg_stride;
264267
@@ -588,6 +591,9 @@ int regmap_add_irq_chip(struct regmap *map, int irq, int irq_flags, · 323 unmodified lines
588591 /* Mask all the interrupts by default */
589592 for (i = 0; i < chip->num_regs; i++) {
590593 d->mask_buf[i] = d->mask_buf_def[i];
594+ if (!chip->mask_base)
595+ continue;
596+
591597 reg = chip->mask_base +
592598 (i * map->reg_stride * d->irq_reg_stride);
593599 if (chip->mask_invert)
drivers/block/nbd.c+3−2
@@ -288,9 +288,10 @@ static void nbd_size_update(struct nbd_device *nbd) · 287 unmodified lines
288288 blk_queue_physical_block_size(nbd->disk->queue, config->blksize);
289289 set_capacity(nbd->disk, config->bytesize >> 9);
290290 if (bdev) {
291− if (bdev->bd_disk)
291+ if (bdev->bd_disk) {
292292 bd_set_size(bdev, config->bytesize);
293− else
293+ set_blocksize(bdev, config->blksize);
294+ } else
294295 bdev->bd_invalidated = 1;
295296 bdput(bdev);
296297 }
drivers/char/ipmi/ipmi_msghandler.c+100−73
@@ -32,6 +32,7 @@ · 31 unmodified lines
3232 #include <linux/moduleparam.h>
3333 #include <linux/workqueue.h>
3434 #include <linux/uuid.h>
35+#include <linux/nospec.h>
3536
3637 #define IPMI_DRIVER_VERSION "39.2"
3738
@@ -62,7 +63,8 @@ static void ipmi_debug_msg(const char *title, unsigned char *data, · 24 unmodified lines
6263 { }
6364 #endif
6465
65−static int initialized;
66+static bool initialized;
67+static bool drvregistered;
6668
6769 enum ipmi_panic_event_op {
6870 IPMI_SEND_PANIC_EVENT_NONE,
@@ -612,7 +614,7 @@ static DEFINE_MUTEX(ipmidriver_mutex); · 543 unmodified lines
612614
613615 static LIST_HEAD(ipmi_interfaces);
614616 static DEFINE_MUTEX(ipmi_interfaces_mutex);
615−DEFINE_STATIC_SRCU(ipmi_interfaces_srcu);
617+struct srcu_struct ipmi_interfaces_srcu;
616618
617619 /*
618620 * List of watchers that want to know when smi's are added and deleted.
@@ -720,7 +722,15 @@ struct watcher_entry { · 101 unmodified lines
720722 int ipmi_smi_watcher_register(struct ipmi_smi_watcher *watcher)
721723 {
722724 struct ipmi_smi *intf;
723− int index;
725+ int index, rv;
726+
727+ /*
728+ * Make sure the driver is actually initialized, this handles
729+ * problems with initialization order.
730+ */
731+ rv = ipmi_init_msghandler();
732+ if (rv)
733+ return rv;
724734
725735 mutex_lock(&smi_watchers_mutex);
726736
@@ -884,7 +894,7 @@ static int deliver_response(struct ipmi_smi *intf, struct ipmi_recv_msg *msg) · 157 unmodified lines
884894
885895 if (user) {
886896 user->handler->ipmi_recv_hndl(msg, user->handler_data);
887− release_ipmi_user(msg->user, index);
897+ release_ipmi_user(user, index);
888898 } else {
889899 /* User went away, give up. */
890900 ipmi_free_recv_msg(msg);
@@ -1076,7 +1086,7 @@ int ipmi_create_user(unsigned int if_num, · 185 unmodified lines
10761086 {
10771087 unsigned long flags;
10781088 struct ipmi_user *new_user;
1079− int rv = 0, index;
1089+ int rv, index;
10801090 struct ipmi_smi *intf;
10811091
10821092 /*
@@ -1094,18 +1104,9 @@ int ipmi_create_user(unsigned int if_num, · 11 unmodified lines
10941104 * Make sure the driver is actually initialized, this handles
10951105 * problems with initialization order.
10961106 */
1097− if (!initialized) {
1098− rv = ipmi_init_msghandler();
1099− if (rv)
1100− return rv;
1101−
1102− /*
1103− * The init code doesn't return an error if it was turned
1104− * off, but it won't initialize. Check that.
1105− */
1106− if (!initialized)
1107− return -ENODEV;
1108− }
1107+ rv = ipmi_init_msghandler();
1108+ if (rv)
1109+ return rv;
11091110
11101111 new_user = kmalloc(sizeof(*new_user), GFP_KERNEL);
11111112 if (!new_user)
@@ -1183,6 +1184,7 @@ EXPORT_SYMBOL(ipmi_get_smi_info); · 71 unmodified lines
11831184 static void free_user(struct kref *ref)
11841185 {
11851186 struct ipmi_user *user = container_of(ref, struct ipmi_user, refcount);
1187+ cleanup_srcu_struct(&user->release_barrier);
11861188 kfree(user);
11871189 }
11881190
@@ -1259,7 +1261,6 @@ int ipmi_destroy_user(struct ipmi_user *user) · 70 unmodified lines
12591261 {
12601262 _ipmi_destroy_user(user);
12611263
1262− cleanup_srcu_struct(&user->release_barrier);
12631264 kref_put(&user->refcount, free_user);
12641265
12651266 return 0;
@@ -1298,10 +1299,12 @@ int ipmi_set_my_address(struct ipmi_user *user, · 32 unmodified lines
12981299 if (!user)
12991300 return -ENODEV;
13001301
1301− if (channel >= IPMI_MAX_CHANNELS)
1302+ if (channel >= IPMI_MAX_CHANNELS) {
13021303 rv = -EINVAL;
1303− else
1304+ } else {
1305+ channel = array_index_nospec(channel, IPMI_MAX_CHANNELS);
13041306 user->intf->addrinfo[channel].address = address;
1307+ }
13051308 release_ipmi_user(user, index);
13061309
13071310 return rv;
@@ -1318,10 +1321,12 @@ int ipmi_get_my_address(struct ipmi_user *user, · 10 unmodified lines
13181321 if (!user)
13191322 return -ENODEV;
13201323
1321− if (channel >= IPMI_MAX_CHANNELS)
1324+ if (channel >= IPMI_MAX_CHANNELS) {
13221325 rv = -EINVAL;
1323− else
1326+ } else {
1327+ channel = array_index_nospec(channel, IPMI_MAX_CHANNELS);
13241328 *address = user->intf->addrinfo[channel].address;
1329+ }
13251330 release_ipmi_user(user, index);
13261331
13271332 return rv;
@@ -1338,10 +1343,12 @@ int ipmi_set_my_LUN(struct ipmi_user *user, · 10 unmodified lines
13381343 if (!user)
13391344 return -ENODEV;
13401345
1341− if (channel >= IPMI_MAX_CHANNELS)
1346+ if (channel >= IPMI_MAX_CHANNELS) {
13421347 rv = -EINVAL;
1343− else
1348+ } else {
1349+ channel = array_index_nospec(channel, IPMI_MAX_CHANNELS);
13441350 user->intf->addrinfo[channel].lun = LUN & 0x3;
1351+ }
13451352 release_ipmi_user(user, index);
13461353
13471354 return rv;
@@ -1358,10 +1365,12 @@ int ipmi_get_my_LUN(struct ipmi_user *user, · 10 unmodified lines
13581365 if (!user)
13591366 return -ENODEV;
13601367
1361− if (channel >= IPMI_MAX_CHANNELS)
1368+ if (channel >= IPMI_MAX_CHANNELS) {
13621369 rv = -EINVAL;
1363− else
1370+ } else {
1371+ channel = array_index_nospec(channel, IPMI_MAX_CHANNELS);
13641372 *address = user->intf->addrinfo[channel].lun;
1373+ }
13651374 release_ipmi_user(user, index);
13661375
13671376 return rv;
@@ -2184,6 +2193,7 @@ static int check_addr(struct ipmi_smi *intf, · 816 unmodified lines
21842193 {
21852194 if (addr->channel >= IPMI_MAX_CHANNELS)
21862195 return -EINVAL;
2196+ addr->channel = array_index_nospec(addr->channel, IPMI_MAX_CHANNELS);
21872197 *lun = intf->addrinfo[addr->channel].lun;
21882198 *saddr = intf->addrinfo[addr->channel].address;
21892199 return 0;
@@ -3291,17 +3301,9 @@ int ipmi_register_smi(const struct ipmi_smi_handlers *handlers, · 1101 unmodified lines
32913301 * Make sure the driver is actually initialized, this handles
32923302 * problems with initialization order.
32933303 */
3294− if (!initialized) {
3295− rv = ipmi_init_msghandler();
3296− if (rv)
3297− return rv;
3298− /*
3299− * The init code doesn't return an error if it was turned
3300− * off, but it won't initialize. Check that.
3301− */
3302− if (!initialized)
3303− return -ENODEV;
3304− }
3304+ rv = ipmi_init_msghandler();
3305+ if (rv)
3306+ return rv;
33053307
33063308 intf = kzalloc(sizeof(*intf), GFP_KERNEL);
33073309 if (!intf)
@@ -5017,6 +5019,22 @@ static int panic_event(struct notifier_block *this, · 1709 unmodified lines
50175019 return NOTIFY_DONE;
50185020 }
50195021
5022+/* Must be called with ipmi_interfaces_mutex held. */
5023+static int ipmi_register_driver(void)
5024+{
5025+ int rv;
5026+
5027+ if (drvregistered)
5028+ return 0;
5029+
5030+ rv = driver_register(&ipmidriver.driver);
5031+ if (rv)
5032+ pr_err("Could not register IPMI driver\n");
5033+ else
5034+ drvregistered = true;
5035+ return rv;
5036+}
5037+
50205038 static struct notifier_block panic_block = {
50215039 .notifier_call = panic_event,
50225040 .next = NULL,
@@ -5027,66 +5045,75 @@ static int ipmi_init_msghandler(void) · 4 unmodified lines
50275045 {
50285046 int rv;
50295047
5048+ mutex_lock(&ipmi_interfaces_mutex);
5049+ rv = ipmi_register_driver();
5050+ if (rv)
5051+ goto out;
50305052 if (initialized)
5031− return 0;
5032−
5033− rv = driver_register(&ipmidriver.driver);
5034− if (rv) {
5035− pr_err("Could not register IPMI driver\n");
5036− return rv;
5037− }
5053+ goto out;
50385054
5039− pr_info("version " IPMI_DRIVER_VERSION "\n");
5055+ init_srcu_struct(&ipmi_interfaces_srcu);
50405056
50415057 timer_setup(&ipmi_timer, ipmi_timeout, 0);
50425058 mod_timer(&ipmi_timer, jiffies + IPMI_TIMEOUT_JIFFIES);
50435059
50445060 atomic_notifier_chain_register(&panic_notifier_list, &panic_block);
50455061
5046− initialized = 1;
5062+ initialized = true;
50475063
5048− return 0;
5064+out:
5065+ mutex_unlock(&ipmi_interfaces_mutex);
5066+ return rv;
50495067 }
50505068
50515069 static int __init ipmi_init_msghandler_mod(void)
50525070 {
5053− ipmi_init_msghandler();
5054− return 0;
5071+ int rv;
5072+
5073+ pr_info("version " IPMI_DRIVER_VERSION "\n");
5074+
5075+ mutex_lock(&ipmi_interfaces_mutex);
5076+ rv = ipmi_register_driver();
5077+ mutex_unlock(&ipmi_interfaces_mutex);
5078+
5079+ return rv;
50555080 }
50565081
50575082 static void __exit cleanup_ipmi(void)
50585083 {
50595084 int count;
50605085
5061− if (!initialized)
5062− return;
5063−
5064− atomic_notifier_chain_unregister(&panic_notifier_list, &panic_block);
5086+ if (initialized) {
5087+ atomic_notifier_chain_unregister(&panic_notifier_list,
5088+ &panic_block);
50655089
5066− /*
5067− * This can't be called if any interfaces exist, so no worry
5068− * about shutting down the interfaces.
5069− */
5090+ /*
5091+ * This can't be called if any interfaces exist, so no worry
5092+ * about shutting down the interfaces.
5093+ */
50705094
5071− /*
5072− * Tell the timer to stop, then wait for it to stop. This
5073− * avoids problems with race conditions removing the timer
5074− * here.
5075− */
5076− atomic_inc(&stop_operation);
5077− del_timer_sync(&ipmi_timer);
5095+ /*
5096+ * Tell the timer to stop, then wait for it to stop. This
5097+ * avoids problems with race conditions removing the timer
5098+ * here.
5099+ */
5100+ atomic_inc(&stop_operation);
5101+ del_timer_sync(&ipmi_timer);
50785102
5079− driver_unregister(&ipmidriver.driver);
5103+ initialized = false;
50805104
5081− initialized = 0;
5105+ /* Check for buffer leaks. */
5106+ count = atomic_read(&smi_msg_inuse_count);
5107+ if (count != 0)
5108+ pr_warn("SMI message count %d at exit\n", count);
5109+ count = atomic_read(&recv_msg_inuse_count);
5110+ if (count != 0)
5111+ pr_warn("recv message count %d at exit\n", count);
50825112
5083− /* Check for buffer leaks. */
5084− count = atomic_read(&smi_msg_inuse_count);
5085− if (count != 0)
5086− pr_warn("SMI message count %d at exit\n", count);
5087− count = atomic_read(&recv_msg_inuse_count);
5088− if (count != 0)
5089− pr_warn("recv message count %d at exit\n", count);
5113+ cleanup_srcu_struct(&ipmi_interfaces_srcu);
5114+ }
5115+ if (drvregistered)
5116+ driver_unregister(&ipmidriver.driver);
50905117 }
50915118 module_exit(cleanup_ipmi);
50925119
drivers/char/ipmi/ipmi_ssif.c+17−8
@@ -632,8 +632,9 @@ static void msg_done_handler(struct ssif_info *ssif_info, int result, · 631 unmodified lines
632632
633633 /* Remove the multi-part read marker. */
634634 len -= 2;
635+ data += 2;
635636 for (i = 0; i < len; i++)
636− ssif_info->data[i] = data[i+2];
637+ ssif_info->data[i] = data[i];
637638 ssif_info->multi_len = len;
638639 ssif_info->multi_pos = 1;
639640
@@ -661,8 +662,19 @@ static void msg_done_handler(struct ssif_info *ssif_info, int result, · 21 unmodified lines
661662 }
662663
663664 blocknum = data[0];
665+ len--;
666+ data++;
667+
668+ if (blocknum != 0xff && len != 31) {
669+ /* All blocks but the last must have 31 data bytes. */
670+ result = -EIO;
671+ if (ssif_info->ssif_debug & SSIF_DEBUG_MSG)
672+ pr_info("Received middle message <31\n");
664673
665− if (ssif_info->multi_len + len - 1 > IPMI_MAX_MSG_LENGTH) {
674+ goto continue_op;
675+ }
676+
677+ if (ssif_info->multi_len + len > IPMI_MAX_MSG_LENGTH) {
666678 /* Received message too big, abort the operation. */
667679 result = -E2BIG;
668680 if (ssif_info->ssif_debug & SSIF_DEBUG_MSG)
@@ -671,16 +683,14 @@ static void msg_done_handler(struct ssif_info *ssif_info, int result, · 2 unmodified lines
671683 goto continue_op;
672684 }
673685
674− /* Remove the blocknum from the data. */
675− len--;
676686 for (i = 0; i < len; i++)
677− ssif_info->data[i + ssif_info->multi_len] = data[i + 1];
687+ ssif_info->data[i + ssif_info->multi_len] = data[i];
678688 ssif_info->multi_len += len;
679689 if (blocknum == 0xff) {
680690 /* End of read */
681691 len = ssif_info->multi_len;
682692 data = ssif_info->data;
683− } else if (blocknum + 1 != ssif_info->multi_pos) {
693+ } else if (blocknum != ssif_info->multi_pos) {
684694 /*
685695 * Out of sequence block, just abort. Block
686696 * numbers start at zero for the second block,
@@ -707,6 +717,7 @@ static void msg_done_handler(struct ssif_info *ssif_info, int result, · 20 unmodified lines
707717 }
708718 }
709719
720+ continue_op:
710721 if (result < 0) {
711722 ssif_inc_stat(ssif_info, receive_errors);
712723 } else {
@@ -714,8 +725,6 @@ static void msg_done_handler(struct ssif_info *ssif_info, int result, · 1 unmodified line
714725 ssif_inc_stat(ssif_info, received_message_parts);
715726 }
716727
717−
718− continue_op:
719728 if (ssif_info->ssif_debug & SSIF_DEBUG_STATE)
720729 pr_info("DONE 1: state = %d, result=%d\n",
721730 ssif_info->ssif_state, result);
drivers/char/mwave/mwavedd.c+7−0
@@ -59,6 +59,7 @@ · 58 unmodified lines
5959 #include <linux/mutex.h>
6060 #include <linux/delay.h>
6161 #include <linux/serial_8250.h>
62+#include <linux/nospec.h>
6263 #include "smapi.h"
6364 #include "mwavedd.h"
6465 #include "3780i.h"
@@ -289,6 +290,8 @@ static long mwave_ioctl(struct file *file, unsigned int iocmd, · 224 unmodified lines
289290 ipcnum);
290291 return -EINVAL;
291292 }
293+ ipcnum = array_index_nospec(ipcnum,
294+ ARRAY_SIZE(pDrvData->IPCs));
292295 PRINTK_3(TRACE_MWAVE,
293296 "mwavedd::mwave_ioctl IOCTL_MW_REGISTER_IPC"
294297 " ipcnum %x entry usIntCount %x\n",
@@ -317,6 +320,8 @@ static long mwave_ioctl(struct file *file, unsigned int iocmd, · 22 unmodified lines
317320 " Invalid ipcnum %x\n", ipcnum);
318321 return -EINVAL;
319322 }
323+ ipcnum = array_index_nospec(ipcnum,
324+ ARRAY_SIZE(pDrvData->IPCs));
320325 PRINTK_3(TRACE_MWAVE,
321326 "mwavedd::mwave_ioctl IOCTL_MW_GET_IPC"
322327 " ipcnum %x, usIntCount %x\n",
@@ -383,6 +388,8 @@ static long mwave_ioctl(struct file *file, unsigned int iocmd, · 60 unmodified lines
383388 ipcnum);
384389 return -EINVAL;
385390 }
391+ ipcnum = array_index_nospec(ipcnum,
392+ ARRAY_SIZE(pDrvData->IPCs));
386393 mutex_lock(&mwave_mutex);
387394 if (pDrvData->IPCs[ipcnum].bIsEnabled == true) {
388395 pDrvData->IPCs[ipcnum].bIsEnabled = false;
drivers/clk/Kconfig+0−1
@@ -293,7 +293,6 @@ config COMMON_CLK_BD718XX · 292 unmodified lines
293293 source "drivers/clk/actions/Kconfig"
294294 source "drivers/clk/bcm/Kconfig"
295295 source "drivers/clk/hisilicon/Kconfig"
296−source "drivers/clk/imx/Kconfig"
297296 source "drivers/clk/imgtec/Kconfig"
298297 source "drivers/clk/imx/Kconfig"
299298 source "drivers/clk/ingenic/Kconfig"
drivers/clk/clk-versaclock5.c+3−1
@@ -262,8 +262,10 @@ static int vc5_mux_set_parent(struct clk_hw *hw, u8 index) · 261 unmodified lines
262262
263263 if (vc5->clk_mux_ins == VC5_MUX_IN_XIN)
264264 src = VC5_PRIM_SRC_SHDN_EN_XTAL;
265− if (vc5->clk_mux_ins == VC5_MUX_IN_CLKIN)
265+ else if (vc5->clk_mux_ins == VC5_MUX_IN_CLKIN)
266266 src = VC5_PRIM_SRC_SHDN_EN_CLKIN;
267+ else /* Invalid; should have been caught by vc5_probe() */
268+ return -EINVAL;
267269 }
268270
269271 return regmap_update_bits(vc5->regmap, VC5_PRIM_SRC_SHDN, mask, src);
drivers/clk/clk.c+13−3
@@ -1513,9 +1513,19 @@ static int clk_fetch_parent_index(struct clk_core *core, · 1512 unmodified lines
15131513 if (!parent)
15141514 return -EINVAL;
15151515
1516− for (i = 0; i < core->num_parents; i++)
1517− if (clk_core_get_parent_by_index(core, i) == parent)
1516+ for (i = 0; i < core->num_parents; i++) {
1517+ if (core->parents[i] == parent)
1518+ return i;
1519+
1520+ if (core->parents[i])
1521+ continue;
1522+
1523+ /* Fallback to comparing globally unique names */
1524+ if (!strcmp(parent->name, core->parent_names[i])) {
1525+ core->parents[i] = parent;
15181526 return i;
1527+ }
1528+ }
15191529
15201530 return -EINVAL;
15211531 }
@@ -2779,7 +2789,7 @@ static void clk_dump_one(struct seq_file *s, struct clk_core *c, int level) · 1257 unmodified lines
27792789 seq_printf(s, "\"protect_count\": %d,", c->protect_count);
27802790 seq_printf(s, "\"rate\": %lu,", clk_core_get_rate(c));
27812791 seq_printf(s, "\"accuracy\": %lu,", clk_core_get_accuracy(c));
2782− seq_printf(s, "\"phase\": %d", clk_core_get_phase(c));
2792+ seq_printf(s, "\"phase\": %d,", clk_core_get_phase(c));
27832793 seq_printf(s, "\"duty_cycle\": %u",
27842794 clk_core_get_scaled_duty_cycle(c, 100000));
27852795 }
drivers/clk/imx/clk-frac-pll.c+3−2
@@ -155,13 +155,14 @@ static int clk_pll_set_rate(struct clk_hw *hw, unsigned long rate, · 154 unmodified lines
155155 {
156156 struct clk_frac_pll *pll = to_clk_frac_pll(hw);
157157 u32 val, divfi, divff;
158− u64 temp64 = parent_rate;
158+ u64 temp64;
159159 int ret;
160160
161161 parent_rate *= 8;
162162 rate *= 2;
163163 divfi = rate / parent_rate;
164− temp64 *= rate - divfi;
164+ temp64 = parent_rate * divfi;
165+ temp64 = rate - temp64;
165166 temp64 *= PLL_FRAC_DENOM;
166167 do_div(temp64, parent_rate);
167168 divff = temp64;
drivers/clk/imx/clk-imx8qxp-lpcg.c+2−0
@@ -169,6 +169,8 @@ static int imx8qxp_lpcg_clk_probe(struct platform_device *pdev) · 168 unmodified lines
169169 return -ENODEV;
170170
171171 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
172+ if (!res)
173+ return -EINVAL;
172174 base = devm_ioremap(dev, res->start, resource_size(res));
173175 if (!base)
174176 return -ENOMEM;
drivers/clk/mmp/clk-of-mmp2.c+0−4
@@ -53,7 +53,6 @@ · 52 unmodified lines
5353 #define APMU_DISP1 0x110
5454 #define APMU_CCIC0 0x50
5555 #define APMU_CCIC1 0xf4
56−#define APMU_SP 0x68
5756 #define MPMU_UART_PLL 0x14
5857
5958 struct mmp2_clk_unit {
@@ -210,8 +209,6 @@ static struct mmp_clk_mix_config ccic1_mix_config = { · 150 unmodified lines
210209 .reg_info = DEFINE_MIX_REG_INFO(4, 16, 2, 6, 32),
211210 };
212211
213−static DEFINE_SPINLOCK(sp_lock);
214−
215212 static struct mmp_param_mux_clk apmu_mux_clks[] = {
216213 {MMP2_CLK_DISP0_MUX, "disp0_mux", disp_parent_names, ARRAY_SIZE(disp_parent_names), CLK_SET_RATE_PARENT, APMU_DISP0, 6, 2, 0, &disp0_lock},
217214 {MMP2_CLK_DISP1_MUX, "disp1_mux", disp_parent_names, ARRAY_SIZE(disp_parent_names), CLK_SET_RATE_PARENT, APMU_DISP1, 6, 2, 0, &disp1_lock},
@@ -242,7 +239,6 @@ static struct mmp_param_gate_clk apmu_gate_clks[] = { · 24 unmodified lines
242239 {MMP2_CLK_CCIC1, "ccic1_clk", "ccic1_mix_clk", CLK_SET_RATE_PARENT, APMU_CCIC1, 0x1b, 0x1b, 0x0, 0, &ccic1_lock},
243240 {MMP2_CLK_CCIC1_PHY, "ccic1_phy_clk", "ccic1_mix_clk", CLK_SET_RATE_PARENT, APMU_CCIC1, 0x24, 0x24, 0x0, 0, &ccic1_lock},
244241 {MMP2_CLK_CCIC1_SPHY, "ccic1_sphy_clk", "ccic1_sphy_div", CLK_SET_RATE_PARENT, APMU_CCIC1, 0x300, 0x300, 0x0, 0, &ccic1_lock},
245− {MMP2_CLK_SP, "sp_clk", NULL, CLK_SET_RATE_PARENT, APMU_SP, 0x1b, 0x1b, 0x0, 0, &sp_lock},
246242 };
247243
248244 static void mmp2_axi_periph_clk_init(struct mmp2_clk_unit *pxa_unit)
drivers/clk/qcom/Kconfig+1−0
@@ -215,6 +215,7 @@ config MSM_MMCC_8996 · 214 unmodified lines
215215
216216 config MSM_GCC_8998
217217 tristate "MSM8998 Global Clock Controller"
218+ select QCOM_GDSC
218219 help
219220 Support for the global clock controller on msm8998 devices.
220221 Say Y if you want to use peripheral devices such as UART, SPI,
drivers/clk/qcom/gcc-sdm845.c+10−4
@@ -115,8 +115,8 @@ static const char * const gcc_parent_names_6[] = { · 114 unmodified lines
115115 "core_bi_pll_test_se",
116116 };
117117
118−static const char * const gcc_parent_names_7[] = {
119− "bi_tcxo",
118+static const char * const gcc_parent_names_7_ao[] = {
119+ "bi_tcxo_ao",
120120 "gpll0",
121121 "gpll0_out_even",
122122 "core_bi_pll_test_se",
@@ -128,6 +128,12 @@ static const char * const gcc_parent_names_8[] = { · 5 unmodified lines
128128 "core_bi_pll_test_se",
129129 };
130130
131+static const char * const gcc_parent_names_8_ao[] = {
132+ "bi_tcxo_ao",
133+ "gpll0",
134+ "core_bi_pll_test_se",
135+};
136+
131137 static const struct parent_map gcc_parent_map_10[] = {
132138 { P_BI_TCXO, 0 },
133139 { P_GPLL0_OUT_MAIN, 1 },
@@ -210,7 +216,7 @@ static struct clk_rcg2 gcc_cpuss_ahb_clk_src = { · 76 unmodified lines
210216 .freq_tbl = ftbl_gcc_cpuss_ahb_clk_src,
211217 .clkr.hw.init = &(struct clk_init_data){
212218 .name = "gcc_cpuss_ahb_clk_src",
213− .parent_names = gcc_parent_names_7,
219+ .parent_names = gcc_parent_names_7_ao,
214220 .num_parents = 4,
215221 .ops = &clk_rcg2_ops,
216222 },
@@ -229,7 +235,7 @@ static struct clk_rcg2 gcc_cpuss_rbcpr_clk_src = { · 12 unmodified lines
229235 .freq_tbl = ftbl_gcc_cpuss_rbcpr_clk_src,
230236 .clkr.hw.init = &(struct clk_init_data){
231237 .name = "gcc_cpuss_rbcpr_clk_src",
232− .parent_names = gcc_parent_names_8,
238+ .parent_names = gcc_parent_names_8_ao,
233239 .num_parents = 3,
234240 .ops = &clk_rcg2_ops,
235241 },
drivers/clk/socfpga/clk-pll-s10.c+1−1
@@ -43,7 +43,7 @@ static unsigned long clk_pll_recalc_rate(struct clk_hw *hwclk, · 42 unmodified lines
4343 /* Read mdiv and fdiv from the fdbck register */
4444 reg = readl(socfpgaclk->hw.reg + 0x4);
4545 mdiv = (reg & SOCFPGA_PLL_MDIV_MASK) >> SOCFPGA_PLL_MDIV_SHIFT;
46− vco_freq = (unsigned long long)parent_rate * (mdiv + 6);
46+ vco_freq = (unsigned long long)vco_freq * (mdiv + 6);
4747
4848 return (unsigned long)vco_freq;
4949 }
drivers/clk/socfpga/clk-s10.c+10−10
@@ -12,17 +12,17 @@ · 11 unmodified lines
1212
1313 #include "stratix10-clk.h"
1414
15−static const char * const pll_mux[] = { "osc1", "cb_intosc_hs_div2_clk",
16− "f2s_free_clk",};
15+static const char * const pll_mux[] = { "osc1", "cb-intosc-hs-div2-clk",
16+ "f2s-free-clk",};
1717 static const char * const cntr_mux[] = { "main_pll", "periph_pll",
18− "osc1", "cb_intosc_hs_div2_clk",
19− "f2s_free_clk"};
20−static const char * const boot_mux[] = { "osc1", "cb_intosc_hs_div2_clk",};
18+ "osc1", "cb-intosc-hs-div2-clk",
19+ "f2s-free-clk"};
20+static const char * const boot_mux[] = { "osc1", "cb-intosc-hs-div2-clk",};
2121
2222 static const char * const noc_free_mux[] = {"main_noc_base_clk",
2323 "peri_noc_base_clk",
24− "osc1", "cb_intosc_hs_div2_clk",
25− "f2s_free_clk"};
24+ "osc1", "cb-intosc-hs-div2-clk",
25+ "f2s-free-clk"};
2626
2727 static const char * const emaca_free_mux[] = {"peri_emaca_clk", "boot_clk"};
2828 static const char * const emacb_free_mux[] = {"peri_emacb_clk", "boot_clk"};
@@ -33,14 +33,14 @@ static const char * const s2f_usr1_free_mux[] = {"peri_s2f_usr1_clk", "boot_clk" · 4 unmodified lines
3333 static const char * const psi_ref_free_mux[] = {"peri_psi_ref_clk", "boot_clk"};
3434 static const char * const mpu_mux[] = { "mpu_free_clk", "boot_clk",};
3535
36−static const char * const s2f_usr0_mux[] = {"f2s_free_clk", "boot_clk"};
36+static const char * const s2f_usr0_mux[] = {"f2s-free-clk", "boot_clk"};
3737 static const char * const emac_mux[] = {"emaca_free_clk", "emacb_free_clk"};
3838 static const char * const noc_mux[] = {"noc_free_clk", "boot_clk"};
3939
4040 static const char * const mpu_free_mux[] = {"main_mpu_base_clk",
4141 "peri_mpu_base_clk",
42− "osc1", "cb_intosc_hs_div2_clk",
43− "f2s_free_clk"};
42+ "osc1", "cb-intosc-hs-div2-clk",
43+ "f2s-free-clk"};
4444
4545 /* clocks in AO (always on) controller */
4646 static const struct stratix10_pll_clock s10_pll_clks[] = {
drivers/clk/tegra/clk-tegra124-dfll-fcpu.c+3−1
@@ -133,9 +133,11 @@ static int tegra124_dfll_fcpu_remove(struct platform_device *pdev) · 132 unmodified lines
133133 struct tegra_dfll_soc_data *soc;
134134
135135 soc = tegra_dfll_unregister(pdev);
136− if (IS_ERR(soc))
136+ if (IS_ERR(soc)) {
137137 dev_err(&pdev->dev, "failed to unregister DFLL: %ld\n",
138138 PTR_ERR(soc));
139+ return PTR_ERR(soc);
140+ }
139141
140142 tegra_cvb_remove_opp_table(soc->dev, soc->cvb, soc->max_freq);
141143
drivers/clk/ti/divider.c+10−1
@@ -403,8 +403,10 @@ int ti_clk_parse_divider_data(int *div_table, int num_dividers, int max_div, · 402 unmodified lines
403403 num_dividers = i;
404404
405405 tmp = kcalloc(valid_div + 1, sizeof(*tmp), GFP_KERNEL);
406− if (!tmp)
406+ if (!tmp) {
407+ *table = ERR_PTR(-ENOMEM);
407408 return -ENOMEM;
409+ }
408410
409411 valid_div = 0;
410412 *width = 0;
@@ -439,6 +441,7 @@ struct clk_hw *ti_clk_build_component_div(struct ti_clk_divider *setup) · 28 unmodified lines
439441 {
440442 struct clk_omap_divider *div;
441443 struct clk_omap_reg *reg;
444+ int ret;
442445
443446 if (!setup)
444447 return NULL;
@@ -458,6 +461,12 @@ struct clk_hw *ti_clk_build_component_div(struct ti_clk_divider *setup) · 13 unmodified lines
458461 div->flags |= CLK_DIVIDER_POWER_OF_TWO;
459462
460463 div->table = _get_div_table_from_setup(setup, &div->width);
464+ if (IS_ERR(div->table)) {
465+ ret = PTR_ERR(div->table);
466+ kfree(div);
467+ return ERR_PTR(ret);
468+ }
469+
461470
462471 div->shift = setup->bit_shift;
463472 div->latch = -EINVAL;
drivers/clk/zynqmp/clkc.c+2−2
@@ -669,8 +669,8 @@ static int zynqmp_clk_setup(struct device_node *np) · 668 unmodified lines
669669 if (ret)
670670 return ret;
671671
672− zynqmp_data = kzalloc(sizeof(*zynqmp_data) + sizeof(*zynqmp_data) *
673− clock_max_idx, GFP_KERNEL);
672+ zynqmp_data = kzalloc(struct_size(zynqmp_data, hws, clock_max_idx),
673+ GFP_KERNEL);
674674 if (!zynqmp_data)
675675 return -ENOMEM;
676676
drivers/cpuidle/poll_state.c+1−1
@@ -21,7 +21,7 @@ static int __cpuidle poll_idle(struct cpuidle_device *dev, · 20 unmodified lines
2121 local_irq_enable();
2222 if (!current_set_polling_and_test()) {
2323 unsigned int loop_count = 0;
24− u64 limit = TICK_USEC;
24+ u64 limit = TICK_NSEC;
2525 int i;
2626
2727 for (i = 1; i < drv->state_count; i++) {
drivers/crypto/Kconfig+1−0
@@ -692,6 +692,7 @@ config CRYPTO_DEV_BCM_SPU · 691 unmodified lines
692692 depends on ARCH_BCM_IPROC
693693 depends on MAILBOX
694694 default m
695+ select CRYPTO_AUTHENC
695696 select CRYPTO_DES
696697 select CRYPTO_MD5
697698 select CRYPTO_SHA1
drivers/crypto/bcm/cipher.c+13−31
@@ -2845,44 +2845,28 @@ static int aead_authenc_setkey(struct crypto_aead *cipher, · 2844 unmodified lines
28452845 struct spu_hw *spu = &iproc_priv.spu;
28462846 struct iproc_ctx_s *ctx = crypto_aead_ctx(cipher);
28472847 struct crypto_tfm *tfm = crypto_aead_tfm(cipher);
2848− struct rtattr *rta = (void *)key;
2849− struct crypto_authenc_key_param *param;
2850− const u8 *origkey = key;
2851− const unsigned int origkeylen = keylen;
2852−
2853− int ret = 0;
2848+ struct crypto_authenc_keys keys;
2849+ int ret;
28542850
28552851 flow_log("%s() aead:%p key:%p keylen:%u\n", __func__, cipher, key,
28562852 keylen);
28572853 flow_dump(" key: ", key, keylen);
28582854
2859− if (!RTA_OK(rta, keylen))
2860− goto badkey;
2861− if (rta->rta_type != CRYPTO_AUTHENC_KEYA_PARAM)
2862− goto badkey;
2863− if (RTA_PAYLOAD(rta) < sizeof(*param))
2855+ ret = crypto_authenc_extractkeys(&keys, key, keylen);
2856+ if (ret)
28642857 goto badkey;
28652858
2866− param = RTA_DATA(rta);
2867− ctx->enckeylen = be32_to_cpu(param->enckeylen);
2868−
2869− key += RTA_ALIGN(rta->rta_len);
2870− keylen -= RTA_ALIGN(rta->rta_len);
2871−
2872− if (keylen < ctx->enckeylen)
2873− goto badkey;
2874− if (ctx->enckeylen > MAX_KEY_SIZE)
2859+ if (keys.enckeylen > MAX_KEY_SIZE ||
2860+ keys.authkeylen > MAX_KEY_SIZE)
28752861 goto badkey;
28762862
2877− ctx->authkeylen = keylen - ctx->enckeylen;
2878−
2879− if (ctx->authkeylen > MAX_KEY_SIZE)
2880− goto badkey;
2863+ ctx->enckeylen = keys.enckeylen;
2864+ ctx->authkeylen = keys.authkeylen;
28812865
2882− memcpy(ctx->enckey, key + ctx->authkeylen, ctx->enckeylen);
2866+ memcpy(ctx->enckey, keys.enckey, keys.enckeylen);
28832867 /* May end up padding auth key. So make sure it's zeroed. */
28842868 memset(ctx->authkey, 0, sizeof(ctx->authkey));
2885− memcpy(ctx->authkey, key, ctx->authkeylen);
2869+ memcpy(ctx->authkey, keys.authkey, keys.authkeylen);
28862870
28872871 switch (ctx->alg->cipher_info.alg) {
28882872 case CIPHER_ALG_DES:
@@ -2890,7 +2874,7 @@ static int aead_authenc_setkey(struct crypto_aead *cipher, · 1 unmodified line
28902874 u32 tmp[DES_EXPKEY_WORDS];
28912875 u32 flags = CRYPTO_TFM_RES_WEAK_KEY;
28922876
2893− if (des_ekey(tmp, key) == 0) {
2877+ if (des_ekey(tmp, keys.enckey) == 0) {
28942878 if (crypto_aead_get_flags(cipher) &
28952879 CRYPTO_TFM_REQ_WEAK_KEY) {
28962880 crypto_aead_set_flags(cipher, flags);
@@ -2905,7 +2889,7 @@ static int aead_authenc_setkey(struct crypto_aead *cipher, · 8 unmodified lines
29052889 break;
29062890 case CIPHER_ALG_3DES:
29072891 if (ctx->enckeylen == (DES_KEY_SIZE * 3)) {
2908− const u32 *K = (const u32 *)key;
2892+ const u32 *K = (const u32 *)keys.enckey;
29092893 u32 flags = CRYPTO_TFM_RES_BAD_KEY_SCHED;
29102894
29112895 if (!((K[0] ^ K[2]) | (K[1] ^ K[3])) ||
@@ -2956,9 +2940,7 @@ static int aead_authenc_setkey(struct crypto_aead *cipher, · 44 unmodified lines
29562940 ctx->fallback_cipher->base.crt_flags &= ~CRYPTO_TFM_REQ_MASK;
29572941 ctx->fallback_cipher->base.crt_flags |=
29582942 tfm->crt_flags & CRYPTO_TFM_REQ_MASK;
2959− ret =
2960− crypto_aead_setkey(ctx->fallback_cipher, origkey,
2961− origkeylen);
2943+ ret = crypto_aead_setkey(ctx->fallback_cipher, key, keylen);
29622944 if (ret) {
29632945 flow_log(" fallback setkey() returned:%d\n", ret);
29642946 tfm->crt_flags &= ~CRYPTO_TFM_RES_MASK;
drivers/crypto/caam/caamalg.c+1−1
@@ -3476,7 +3476,7 @@ static int __init caam_algapi_init(void) · 3475 unmodified lines
34763476 * Skip algorithms requiring message digests
34773477 * if MD or MD size is not supported by device.
34783478 */
3479− if ((c2_alg_sel & ~OP_ALG_ALGSEL_SUBMASK) == 0x40 &&
3479+ if (is_mdha(c2_alg_sel) &&
34803480 (!md_inst || t_alg->aead.maxauthsize > md_limit))
34813481 continue;
34823482
drivers/crypto/caam/caamhash.c+9−6
@@ -1072,13 +1072,16 @@ static int ahash_final_no_ctx(struct ahash_request *req) · 1071 unmodified lines
10721072
10731073 desc = edesc->hw_desc;
10741074
1075− state->buf_dma = dma_map_single(jrdev, buf, buflen, DMA_TO_DEVICE);
1076− if (dma_mapping_error(jrdev, state->buf_dma)) {
1077− dev_err(jrdev, "unable to map src\n");
1078− goto unmap;
1079− }
1075+ if (buflen) {
1076+ state->buf_dma = dma_map_single(jrdev, buf, buflen,
1077+ DMA_TO_DEVICE);
1078+ if (dma_mapping_error(jrdev, state->buf_dma)) {
1079+ dev_err(jrdev, "unable to map src\n");
1080+ goto unmap;
1081+ }
10801082
1081− append_seq_in_ptr(desc, state->buf_dma, buflen, 0);
1083+ append_seq_in_ptr(desc, state->buf_dma, buflen, 0);
1084+ }
10821085
10831086 edesc->dst_dma = map_seq_out_ptr_result(desc, jrdev, req->result,
10841087 digestsize);
drivers/crypto/caam/desc.h+1−0
@@ -1155,6 +1155,7 @@ · 1154 unmodified lines
11551155 #define OP_ALG_ALGSEL_DES (0x20 << OP_ALG_ALGSEL_SHIFT)
11561156 #define OP_ALG_ALGSEL_3DES (0x21 << OP_ALG_ALGSEL_SHIFT)
11571157 #define OP_ALG_ALGSEL_ARC4 (0x30 << OP_ALG_ALGSEL_SHIFT)
1158+#define OP_ALG_CHA_MDHA (0x40 << OP_ALG_ALGSEL_SHIFT)
11581159 #define OP_ALG_ALGSEL_MD5 (0x40 << OP_ALG_ALGSEL_SHIFT)
11591160 #define OP_ALG_ALGSEL_SHA1 (0x41 << OP_ALG_ALGSEL_SHIFT)
11601161 #define OP_ALG_ALGSEL_SHA224 (0x42 << OP_ALG_ALGSEL_SHIFT)
drivers/crypto/caam/error.h+9−0
@@ -7,6 +7,9 @@ · 6 unmodified lines
77
88 #ifndef CAAM_ERROR_H
99 #define CAAM_ERROR_H
10+
11+#include "desc.h"
12+
1013 #define CAAM_ERROR_STR_MAX 302
1114
1215 void caam_strstatus(struct device *dev, u32 status, bool qi_v2);
@@ -17,4 +20,10 @@ void caam_strstatus(struct device *dev, u32 status, bool qi_v2); · 4 unmodified lines
1720 void caam_dump_sg(const char *level, const char *prefix_str, int prefix_type,
1821 int rowsize, int groupsize, struct scatterlist *sg,
1922 size_t tlen, bool ascii);
23+
24+static inline bool is_mdha(u32 algtype)
25+{
26+ return (algtype & OP_ALG_ALGSEL_MASK & ~OP_ALG_ALGSEL_SUBMASK) ==
27+ OP_ALG_CHA_MDHA;
28+}
2029 #endif /* CAAM_ERROR_H */
drivers/crypto/cavium/nitrox/nitrox_reqmgr.c+6−4
@@ -537,6 +537,8 @@ static void process_response_list(struct nitrox_cmdq *cmdq) · 536 unmodified lines
537537 struct nitrox_device *ndev = cmdq->ndev;
538538 struct nitrox_softreq *sr;
539539 int req_completed = 0, err = 0, budget;
540+ completion_t callback;
541+ void *cb_arg;
540542
541543 /* check all pending requests */
542544 budget = atomic_read(&cmdq->pending_count);
@@ -564,13 +566,13 @@ static void process_response_list(struct nitrox_cmdq *cmdq) · 21 unmodified lines
564566 smp_mb__after_atomic();
565567 /* remove from response list */
566568 response_list_del(sr, cmdq);
567−
568569 /* ORH error code */
569570 err = READ_ONCE(*sr->resp.orh) & 0xff;
571+ callback = sr->callback;
572+ cb_arg = sr->cb_arg;
570573 softreq_destroy(sr);
571−
572− if (sr->callback)
573− sr->callback(sr->cb_arg, err);
574+ if (callback)
575+ callback(cb_arg, err);
574576
575577 req_completed++;
576578 }
drivers/crypto/ccree/cc_aead.c+19−21
@@ -549,13 +549,12 @@ static int cc_aead_setkey(struct crypto_aead *tfm, const u8 *key, · 548 unmodified lines
549549 unsigned int keylen)
550550 {
551551 struct cc_aead_ctx *ctx = crypto_aead_ctx(tfm);
552− struct rtattr *rta = (struct rtattr *)key;
553552 struct cc_crypto_req cc_req = {};
554− struct crypto_authenc_key_param *param;
555553 struct cc_hw_desc desc[MAX_AEAD_SETKEY_SEQ];
556− int rc = -EINVAL;
557554 unsigned int seq_len = 0;
558555 struct device *dev = drvdata_to_dev(ctx->drvdata);
556+ const u8 *enckey, *authkey;
557+ int rc;
559558
560559 dev_dbg(dev, "Setting key in context @%p for %s. key=%p keylen=%u\n",
561560 ctx, crypto_tfm_alg_name(crypto_aead_tfm(tfm)), key, keylen);
@@ -563,35 +562,33 @@ static int cc_aead_setkey(struct crypto_aead *tfm, const u8 *key, · 1 unmodified line
563562 /* STAT_PHASE_0: Init and sanity checks */
564563
565564 if (ctx->auth_mode != DRV_HASH_NULL) { /* authenc() alg. */
566− if (!RTA_OK(rta, keylen))
567− goto badkey;
568− if (rta->rta_type != CRYPTO_AUTHENC_KEYA_PARAM)
569− goto badkey;
570− if (RTA_PAYLOAD(rta) < sizeof(*param))
571− goto badkey;
572− param = RTA_DATA(rta);
573− ctx->enc_keylen = be32_to_cpu(param->enckeylen);
574− key += RTA_ALIGN(rta->rta_len);
575− keylen -= RTA_ALIGN(rta->rta_len);
576− if (keylen < ctx->enc_keylen)
565+ struct crypto_authenc_keys keys;
566+
567+ rc = crypto_authenc_extractkeys(&keys, key, keylen);
568+ if (rc)
577569 goto badkey;
578− ctx->auth_keylen = keylen - ctx->enc_keylen;
570+ enckey = keys.enckey;
571+ authkey = keys.authkey;
572+ ctx->enc_keylen = keys.enckeylen;
573+ ctx->auth_keylen = keys.authkeylen;
579574
580575 if (ctx->cipher_mode == DRV_CIPHER_CTR) {
581576 /* the nonce is stored in bytes at end of key */
577+ rc = -EINVAL;
582578 if (ctx->enc_keylen <
583579 (AES_MIN_KEY_SIZE + CTR_RFC3686_NONCE_SIZE))
584580 goto badkey;
585581 /* Copy nonce from last 4 bytes in CTR key to
586582 * first 4 bytes in CTR IV
587583 */
588− memcpy(ctx->ctr_nonce, key + ctx->auth_keylen +
589− ctx->enc_keylen - CTR_RFC3686_NONCE_SIZE,
590− CTR_RFC3686_NONCE_SIZE);
584+ memcpy(ctx->ctr_nonce, enckey + ctx->enc_keylen -
585+ CTR_RFC3686_NONCE_SIZE, CTR_RFC3686_NONCE_SIZE);
591586 /* Set CTR key size */
592587 ctx->enc_keylen -= CTR_RFC3686_NONCE_SIZE;
593588 }
594589 } else { /* non-authenc - has just one key */
590+ enckey = key;
591+ authkey = NULL;
595592 ctx->enc_keylen = keylen;
596593 ctx->auth_keylen = 0;
597594 }
@@ -603,13 +600,14 @@ static int cc_aead_setkey(struct crypto_aead *tfm, const u8 *key, · 5 unmodified lines
603600 /* STAT_PHASE_1: Copy key to ctx */
604601
605602 /* Get key material */
606− memcpy(ctx->enckey, key + ctx->auth_keylen, ctx->enc_keylen);
603+ memcpy(ctx->enckey, enckey, ctx->enc_keylen);
607604 if (ctx->enc_keylen == 24)
608605 memset(ctx->enckey + 24, 0, CC_AES_KEY_SIZE_MAX - 24);
609606 if (ctx->auth_mode == DRV_HASH_XCBC_MAC) {
610− memcpy(ctx->auth_state.xcbc.xcbc_keys, key, ctx->auth_keylen);
607+ memcpy(ctx->auth_state.xcbc.xcbc_keys, authkey,
608+ ctx->auth_keylen);
611609 } else if (ctx->auth_mode != DRV_HASH_NULL) { /* HMAC */
612− rc = cc_get_plain_hmac_key(tfm, key, ctx->auth_keylen);
610+ rc = cc_get_plain_hmac_key(tfm, authkey, ctx->auth_keylen);
613611 if (rc)
614612 goto badkey;
615613 }
drivers/crypto/talitos.c+9−17
@@ -1361,23 +1361,18 @@ static struct talitos_edesc *talitos_edesc_alloc(struct device *dev, · 1360 unmodified lines
13611361 struct talitos_private *priv = dev_get_drvdata(dev);
13621362 bool is_sec1 = has_ftr_sec1(priv);
13631363 int max_len = is_sec1 ? TALITOS1_MAX_DATA_LEN : TALITOS2_MAX_DATA_LEN;
1364− void *err;
13651364
13661365 if (cryptlen + authsize > max_len) {
13671366 dev_err(dev, "length exceeds h/w max limit\n");
13681367 return ERR_PTR(-EINVAL);
13691368 }
13701369
1371− if (ivsize)
1372− iv_dma = dma_map_single(dev, iv, ivsize, DMA_TO_DEVICE);
1373−
13741370 if (!dst || dst == src) {
13751371 src_len = assoclen + cryptlen + authsize;
13761372 src_nents = sg_nents_for_len(src, src_len);
13771373 if (src_nents < 0) {
13781374 dev_err(dev, "Invalid number of src SG.\n");
1379− err = ERR_PTR(-EINVAL);
1380− goto error_sg;
1375+ return ERR_PTR(-EINVAL);
13811376 }
13821377 src_nents = (src_nents == 1) ? 0 : src_nents;
13831378 dst_nents = dst ? src_nents : 0;
@@ -1387,16 +1382,14 @@ static struct talitos_edesc *talitos_edesc_alloc(struct device *dev, · 3 unmodified lines
13871382 src_nents = sg_nents_for_len(src, src_len);
13881383 if (src_nents < 0) {
13891384 dev_err(dev, "Invalid number of src SG.\n");
1390− err = ERR_PTR(-EINVAL);
1391− goto error_sg;
1385+ return ERR_PTR(-EINVAL);
13921386 }
13931387 src_nents = (src_nents == 1) ? 0 : src_nents;
13941388 dst_len = assoclen + cryptlen + (encrypt ? authsize : 0);
13951389 dst_nents = sg_nents_for_len(dst, dst_len);
13961390 if (dst_nents < 0) {
13971391 dev_err(dev, "Invalid number of dst SG.\n");
1398− err = ERR_PTR(-EINVAL);
1399− goto error_sg;
1392+ return ERR_PTR(-EINVAL);
14001393 }
14011394 dst_nents = (dst_nents == 1) ? 0 : dst_nents;
14021395 }
@@ -1423,11 +1416,14 @@ static struct talitos_edesc *talitos_edesc_alloc(struct device *dev, · 20 unmodified lines
14231416 /* if its a ahash, add space for a second desc next to the first one */
14241417 if (is_sec1 && !dst)
14251418 alloc_len += sizeof(struct talitos_desc);
1419+ alloc_len += ivsize;
14261420
14271421 edesc = kmalloc(alloc_len, GFP_DMA | flags);
1428− if (!edesc) {
1429− err = ERR_PTR(-ENOMEM);
1430− goto error_sg;
1422+ if (!edesc)
1423+ return ERR_PTR(-ENOMEM);
1424+ if (ivsize) {
1425+ iv = memcpy(((u8 *)edesc) + alloc_len - ivsize, iv, ivsize);
1426+ iv_dma = dma_map_single(dev, iv, ivsize, DMA_TO_DEVICE);
14311427 }
14321428 memset(&edesc->desc, 0, sizeof(edesc->desc));
14331429
@@ -1445,10 +1441,6 @@ static struct talitos_edesc *talitos_edesc_alloc(struct device *dev, · 11 unmodified lines
14451441 DMA_BIDIRECTIONAL);
14461442 }
14471443 return edesc;
1448−error_sg:
1449− if (iv_dma)
1450− dma_unmap_single(dev, iv_dma, ivsize, DMA_TO_DEVICE);
1451− return err;
14521444 }
14531445
14541446 static struct talitos_edesc *aead_edesc_alloc(struct aead_request *areq, u8 *iv,
drivers/edac/altera_edac.h+2−2
@@ -295,8 +295,8 @@ struct altr_sdram_mc_data { · 294 unmodified lines
295295 #define S10_SYSMGR_ECC_INTSTAT_DERR_OFST 0xA0
296296
297297 /* Sticky registers for Uncorrected Errors */
298−#define S10_SYSMGR_UE_VAL_OFST 0x120
299−#define S10_SYSMGR_UE_ADDR_OFST 0x124
298+#define S10_SYSMGR_UE_VAL_OFST 0x220
299+#define S10_SYSMGR_UE_ADDR_OFST 0x224
300300
301301 #define S10_DDR0_IRQ_MASK BIT(16)
302302
drivers/firewire/sbp2.c+1−4
@@ -1144,10 +1144,6 @@ static int sbp2_probe(struct fw_unit *unit, const struct ieee1394_device_id *id) · 1143 unmodified lines
11441144 if (device->is_local)
11451145 return -ENODEV;
11461146
1147− if (dma_get_max_seg_size(device->card->device) > SBP2_MAX_SEG_SIZE)
1148− WARN_ON(dma_set_max_seg_size(device->card->device,
1149− SBP2_MAX_SEG_SIZE));
1150−
11511147 shost = scsi_host_alloc(&scsi_driver_template, sizeof(*tgt));
11521148 if (shost == NULL)
11531149 return -ENOMEM;
@@ -1610,6 +1606,7 @@ static struct scsi_host_template scsi_driver_template = { · 456 unmodified lines
16101606 .eh_abort_handler = sbp2_scsi_abort,
16111607 .this_id = -1,
16121608 .sg_tablesize = SG_ALL,
1609+ .max_segment_size = SBP2_MAX_SEG_SIZE,
16131610 .can_queue = 1,
16141611 .sdev_attrs = sbp2_scsi_sysfs_attrs,
16151612 };
drivers/firmware/efi/arm-runtime.c+3−2
@@ -37,8 +37,9 @@ extern u64 efi_system_table; · 36 unmodified lines
3737 static struct ptdump_info efi_ptdump_info = {
3838 .mm = &efi_mm,
3939 .markers = (struct addr_marker[]){
40− { 0, "UEFI runtime start" },
41− { DEFAULT_MAP_WINDOW_64, "UEFI runtime end" }
40+ { 0, "UEFI runtime start" },
41+ { DEFAULT_MAP_WINDOW_64, "UEFI runtime end" },
42+ { -1, NULL }
4243 },
4344 .base_addr = 0,
4445 };
drivers/gpio/gpio-altera-a10sr.c+3−1
@@ -66,8 +66,10 @@ static int altr_a10sr_gpio_direction_input(struct gpio_chip *gc, · 65 unmodified lines
6666 static int altr_a10sr_gpio_direction_output(struct gpio_chip *gc,
6767 unsigned int nr, int value)
6868 {
69− if (nr <= (ALTR_A10SR_OUT_VALID_RANGE_HI - ALTR_A10SR_LED_VALID_SHIFT))
69+ if (nr <= (ALTR_A10SR_OUT_VALID_RANGE_HI - ALTR_A10SR_LED_VALID_SHIFT)) {
70+ altr_a10sr_gpio_set(gc, nr, value);
7071 return 0;
72+ }
7173 return -EINVAL;
7274 }
7375
drivers/gpio/gpio-eic-sprd.c+13−1
@@ -180,7 +180,18 @@ static void sprd_eic_free(struct gpio_chip *chip, unsigned int offset) · 179 unmodified lines
180180
181181 static int sprd_eic_get(struct gpio_chip *chip, unsigned int offset)
182182 {
183− return sprd_eic_read(chip, offset, SPRD_EIC_DBNC_DATA);
183+ struct sprd_eic *sprd_eic = gpiochip_get_data(chip);
184+
185+ switch (sprd_eic->type) {
186+ case SPRD_EIC_DEBOUNCE:
187+ return sprd_eic_read(chip, offset, SPRD_EIC_DBNC_DATA);
188+ case SPRD_EIC_ASYNC:
189+ return sprd_eic_read(chip, offset, SPRD_EIC_ASYNC_DATA);
190+ case SPRD_EIC_SYNC:
191+ return sprd_eic_read(chip, offset, SPRD_EIC_SYNC_DATA);
192+ default:
193+ return -ENOTSUPP;
194+ }
184195 }
185196
186197 static int sprd_eic_direction_input(struct gpio_chip *chip, unsigned int offset)
@@ -368,6 +379,7 @@ static int sprd_eic_irq_set_type(struct irq_data *data, unsigned int flow_type) · 181 unmodified lines
368379 irq_set_handler_locked(data, handle_edge_irq);
369380 break;
370381 case IRQ_TYPE_EDGE_BOTH:
382+ sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTMODE, 0);
371383 sprd_eic_update(chip, offset, SPRD_EIC_ASYNC_INTBOTH, 1);
372384 irq_set_handler_locked(data, handle_edge_irq);
373385 break;
drivers/gpio/gpio-pca953x.c+1−1
@@ -289,7 +289,7 @@ static bool pca953x_volatile_register(struct device *dev, unsigned int reg) · 288 unmodified lines
289289 return pca953x_check_register(chip, reg, bank);
290290 }
291291
292−const struct regmap_config pca953x_i2c_regmap = {
292+static const struct regmap_config pca953x_i2c_regmap = {
293293 .reg_bits = 8,
294294 .val_bits = 8,
295295
drivers/gpio/gpio-pcf857x.c+12−14
@@ -84,6 +84,7 @@ MODULE_DEVICE_TABLE(of, pcf857x_of_table); · 83 unmodified lines
8484 */
8585 struct pcf857x {
8686 struct gpio_chip chip;
87+ struct irq_chip irqchip;
8788 struct i2c_client *client;
8889 struct mutex lock; /* protect 'out' */
8990 unsigned out; /* software latch */
@@ -252,18 +253,6 @@ static void pcf857x_irq_bus_sync_unlock(struct irq_data *data) · 162 unmodified lines
252253 mutex_unlock(&gpio->lock);
253254 }
254255
255−static struct irq_chip pcf857x_irq_chip = {
256− .name = "pcf857x",
257− .irq_enable = pcf857x_irq_enable,
258− .irq_disable = pcf857x_irq_disable,
259− .irq_ack = noop,
260− .irq_mask = noop,
261− .irq_unmask = noop,
262− .irq_set_wake = pcf857x_irq_set_wake,
263− .irq_bus_lock = pcf857x_irq_bus_lock,
264− .irq_bus_sync_unlock = pcf857x_irq_bus_sync_unlock,
265−};
266−
267256 /*-------------------------------------------------------------------------*/
268257
269258 static int pcf857x_probe(struct i2c_client *client,
@@ -376,8 +365,17 @@ static int pcf857x_probe(struct i2c_client *client, · 106 unmodified lines
376365
377366 /* Enable irqchip if we have an interrupt */
378367 if (client->irq) {
368+ gpio->irqchip.name = "pcf857x",
369+ gpio->irqchip.irq_enable = pcf857x_irq_enable,
370+ gpio->irqchip.irq_disable = pcf857x_irq_disable,
371+ gpio->irqchip.irq_ack = noop,
372+ gpio->irqchip.irq_mask = noop,
373+ gpio->irqchip.irq_unmask = noop,
374+ gpio->irqchip.irq_set_wake = pcf857x_irq_set_wake,
375+ gpio->irqchip.irq_bus_lock = pcf857x_irq_bus_lock,
376+ gpio->irqchip.irq_bus_sync_unlock = pcf857x_irq_bus_sync_unlock,
379377 status = gpiochip_irqchip_add_nested(&gpio->chip,
380− &pcf857x_irq_chip,
378+ &gpio->irqchip,
381379 0, handle_level_irq,
382380 IRQ_TYPE_NONE);
383381 if (status) {
@@ -392,7 +390,7 @@ static int pcf857x_probe(struct i2c_client *client, · 8 unmodified lines
392390 if (status)
393391 goto fail;
394392
395− gpiochip_set_nested_irqchip(&gpio->chip, &pcf857x_irq_chip,
393+ gpiochip_set_nested_irqchip(&gpio->chip, &gpio->irqchip,
396394 client->irq);
397395 gpio->irq_parent = client->irq;
398396 }
drivers/gpio/gpio-vf610.c+5−0
@@ -253,6 +253,7 @@ static int vf610_gpio_probe(struct platform_device *pdev) · 252 unmodified lines
253253 struct vf610_gpio_port *port;
254254 struct resource *iores;
255255 struct gpio_chip *gc;
256+ int i;
256257 int ret;
257258
258259 port = devm_kzalloc(&pdev->dev, sizeof(*port), GFP_KERNEL);
@@ -319,6 +320,10 @@ static int vf610_gpio_probe(struct platform_device *pdev) · 60 unmodified lines
319320 if (ret < 0)
320321 return ret;
321322
323+ /* Mask all GPIO interrupts */
324+ for (i = 0; i < gc->ngpio; i++)
325+ vf610_gpio_writel(0, port->base + PORT_PCR(i));
326+
322327 /* Clear the interrupt status register for all GPIO's */
323328 vf610_gpio_writel(~0, port->base + PORT_ISFR);
324329
drivers/gpio/gpiolib-acpi.c+1−6
@@ -357,8 +357,6 @@ void acpi_gpiochip_free_interrupts(struct gpio_chip *chip) · 356 unmodified lines
357357 mutex_unlock(&acpi_gpio_deferred_req_irqs_lock);
358358
359359 list_for_each_entry_safe_reverse(event, ep, &acpi_gpio->events, node) {
360− struct gpio_desc *desc;
361−
362360 if (event->irq_requested) {
363361 if (event->irq_is_wake)
364362 disable_irq_wake(event->irq);
@@ -366,11 +364,8 @@ void acpi_gpiochip_free_interrupts(struct gpio_chip *chip) · 1 unmodified line
366364 free_irq(event->irq, event);
367365 }
368366
369− desc = event->desc;
370− if (WARN_ON(IS_ERR(desc)))
371− continue;
372367 gpiochip_unlock_as_irq(chip, event->pin);
373− gpiochip_free_own_desc(desc);
368+ gpiochip_free_own_desc(event->desc);
374369 list_del(&event->node);
375370 kfree(event);
376371 }
drivers/gpio/gpiolib.c+8−1
@@ -828,7 +828,14 @@ static irqreturn_t lineevent_irq_thread(int irq, void *p) · 827 unmodified lines
828828 /* Do not leak kernel stack to userspace */
829829 memset(&ge, 0, sizeof(ge));
830830
831− ge.timestamp = le->timestamp;
831+ /*
832+ * We may be running from a nested threaded interrupt in which case
833+ * we didn't get the timestamp from lineevent_irq_handler().
834+ */
835+ if (!le->timestamp)
836+ ge.timestamp = ktime_get_real_ns();
837+ else
838+ ge.timestamp = le->timestamp;
832839
833840 if (le->eflags & GPIOEVENT_REQUEST_RISING_EDGE
834841 && le->eflags & GPIOEVENT_REQUEST_FALLING_EDGE) {
drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c+1−0
@@ -576,6 +576,7 @@ static const struct amdgpu_px_quirk amdgpu_px_quirk_list[] = { · 575 unmodified lines
576576 { 0x1002, 0x6900, 0x1028, 0x0812, AMDGPU_PX_QUIRK_FORCE_ATPX },
577577 { 0x1002, 0x6900, 0x1028, 0x0813, AMDGPU_PX_QUIRK_FORCE_ATPX },
578578 { 0x1002, 0x6900, 0x1025, 0x125A, AMDGPU_PX_QUIRK_FORCE_ATPX },
579+ { 0x1002, 0x6900, 0x17AA, 0x3806, AMDGPU_PX_QUIRK_FORCE_ATPX },
579580 { 0, 0, 0, 0, 0 },
580581 };
581582
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c+0−18
@@ -531,17 +531,6 @@ amdgpu_display_user_framebuffer_create(struct drm_device *dev, · 530 unmodified lines
531531 struct drm_gem_object *obj;
532532 struct amdgpu_framebuffer *amdgpu_fb;
533533 int ret;
534− int height;
535− struct amdgpu_device *adev = dev->dev_private;
536− int cpp = drm_format_plane_cpp(mode_cmd->pixel_format, 0);
537− int pitch = mode_cmd->pitches[0] / cpp;
538−
539− pitch = amdgpu_align_pitch(adev, pitch, cpp, false);
540− if (mode_cmd->pitches[0] != pitch) {
541− DRM_DEBUG_KMS("Invalid pitch: expecting %d but got %d\n",
542− pitch, mode_cmd->pitches[0]);
543− return ERR_PTR(-EINVAL);
544− }
545534
546535 obj = drm_gem_object_lookup(file_priv, mode_cmd->handles[0]);
547536 if (obj == NULL) {
@@ -556,13 +545,6 @@ amdgpu_display_user_framebuffer_create(struct drm_device *dev, · 8 unmodified lines
556545 return ERR_PTR(-EINVAL);
557546 }
558547
559− height = ALIGN(mode_cmd->height, 8);
560− if (obj->size < pitch * height) {
561− DRM_DEBUG_KMS("Invalid GEM size: expecting >= %d but got %zu\n",
562− pitch * height, obj->size);
563− return ERR_PTR(-EINVAL);
564− }
565−
566548 amdgpu_fb = kzalloc(sizeof(*amdgpu_fb), GFP_KERNEL);
567549 if (amdgpu_fb == NULL) {
568550 drm_gem_object_put_unlocked(obj);
drivers/gpu/drm/amd/amdkfd/Kconfig+2−2
@@ -4,8 +4,8 @@ · 3 unmodified lines
44
55 config HSA_AMD
66 bool "HSA kernel driver for AMD GPU devices"
7− depends on DRM_AMDGPU && X86_64
8− imply AMD_IOMMU_V2
7+ depends on DRM_AMDGPU && (X86_64 || ARM64)
8+ imply AMD_IOMMU_V2 if X86_64
99 select MMU_NOTIFIER
1010 help
1111 Enable this if you want to use HSA features on AMD GPU devices.
drivers/gpu/drm/amd/amdkfd/kfd_crat.c+8−0
@@ -863,6 +863,7 @@ static int kfd_fill_mem_info_for_cpu(int numa_node_id, int *avail_size, · 862 unmodified lines
863863 return 0;
864864 }
865865
866+#if CONFIG_X86_64
866867 static int kfd_fill_iolink_info_for_cpu(int numa_node_id, int *avail_size,
867868 uint32_t *num_entries,
868869 struct crat_subtype_iolink *sub_type_hdr)
@@ -905,6 +906,7 @@ static int kfd_fill_iolink_info_for_cpu(int numa_node_id, int *avail_size, · 36 unmodified lines
905906
906907 return 0;
907908 }
909+#endif
908910
909911 /* kfd_create_vcrat_image_cpu - Create Virtual CRAT for CPU
910912 *
@@ -920,7 +922,9 @@ static int kfd_create_vcrat_image_cpu(void *pcrat_image, size_t *size) · 9 unmodified lines
920922 struct crat_subtype_generic *sub_type_hdr;
921923 int avail_size = *size;
922924 int numa_node_id;
925+#ifdef CONFIG_X86_64
923926 uint32_t entries = 0;
927+#endif
924928 int ret = 0;
925929
926930 if (!pcrat_image || avail_size < VCRAT_SIZE_FOR_CPU)
@@ -982,6 +986,7 @@ static int kfd_create_vcrat_image_cpu(void *pcrat_image, size_t *size) · 55 unmodified lines
982986 sub_type_hdr->length);
983987
984988 /* Fill in Subtype: IO Link */
989+#ifdef CONFIG_X86_64
985990 ret = kfd_fill_iolink_info_for_cpu(numa_node_id, &avail_size,
986991 &entries,
987992 (struct crat_subtype_iolink *)sub_type_hdr);
@@ -992,6 +997,9 @@ static int kfd_create_vcrat_image_cpu(void *pcrat_image, size_t *size) · 4 unmodified lines
992997
993998 sub_type_hdr = (typeof(sub_type_hdr))((char *)sub_type_hdr +
994999 sub_type_hdr->length * entries);
1000+#else
1001+ pr_info("IO link not available for non x86 platforms\n");
1002+#endif
9951003
9961004 crat_table->num_domains++;
9971005 }
drivers/gpu/drm/amd/amdkfd/kfd_topology.c+14−7
@@ -1093,8 +1093,6 @@ static uint32_t kfd_generate_gpu_id(struct kfd_dev *gpu) · 1092 unmodified lines
10931093 * the GPU device is not already present in the topology device
10941094 * list then return NULL. This means a new topology device has to
10951095 * be created for this GPU.
1096− * TODO: Rather than assiging @gpu to first topology device withtout
1097− * gpu attached, it will better to have more stringent check.
10981096 */
10991097 static struct kfd_topology_device *kfd_assign_gpu(struct kfd_dev *gpu)
11001098 {
@@ -1102,12 +1100,20 @@ static struct kfd_topology_device *kfd_assign_gpu(struct kfd_dev *gpu) · 1 unmodified line
11021100 struct kfd_topology_device *out_dev = NULL;
11031101
11041102 down_write(&topology_lock);
1105− list_for_each_entry(dev, &topology_device_list, list)
1103+ list_for_each_entry(dev, &topology_device_list, list) {
1104+ /* Discrete GPUs need their own topology device list
1105+ * entries. Don't assign them to CPU/APU nodes.
1106+ */
1107+ if (!gpu->device_info->needs_iommu_device &&
1108+ dev->node_props.cpu_cores_count)
1109+ continue;
1110+
11061111 if (!dev->gpu && (dev->node_props.simd_count > 0)) {
11071112 dev->gpu = gpu;
11081113 out_dev = dev;
11091114 break;
11101115 }
1116+ }
11111117 up_write(&topology_lock);
11121118 return out_dev;
11131119 }
@@ -1392,7 +1398,6 @@ int kfd_topology_enum_kfd_devices(uint8_t idx, struct kfd_dev **kdev) · 278 unmodified lines
13921398
13931399 static int kfd_cpumask_to_apic_id(const struct cpumask *cpumask)
13941400 {
1395− const struct cpuinfo_x86 *cpuinfo;
13961401 int first_cpu_of_numa_node;
13971402
13981403 if (!cpumask || cpumask == cpu_none_mask)
@@ -1400,9 +1405,11 @@ static int kfd_cpumask_to_apic_id(const struct cpumask *cpumask) · 1 unmodified line
14001405 first_cpu_of_numa_node = cpumask_first(cpumask);
14011406 if (first_cpu_of_numa_node >= nr_cpu_ids)
14021407 return -1;
1403− cpuinfo = &cpu_data(first_cpu_of_numa_node);
1404−
1405− return cpuinfo->apicid;
1408+#ifdef CONFIG_X86_64
1409+ return cpu_data(first_cpu_of_numa_node).apicid;
1410+#else
1411+ return first_cpu_of_numa_node;
1412+#endif
14061413 }
14071414
14081415 /* kfd_numa_node_to_apic_id - Returns the APIC ID of the first logical processor
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c+2−2
@@ -1772,7 +1772,7 @@ static int amdgpu_dm_backlight_update_status(struct backlight_device *bd) · 1771 unmodified lines
17721772 + caps.min_input_signal * 0x101;
17731773
17741774 if (dc_link_set_backlight_level(dm->backlight_link,
1775− brightness, 0, 0))
1775+ brightness, 0))
17761776 return 0;
17771777 else
17781778 return 1;
@@ -5933,7 +5933,7 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev, · 4154 unmodified lines
59335933 for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) {
59345934 if (!drm_atomic_crtc_needs_modeset(new_crtc_state) &&
59355935 !new_crtc_state->color_mgmt_changed &&
5936− !new_crtc_state->vrr_enabled)
5936+ old_crtc_state->vrr_enabled == new_crtc_state->vrr_enabled)
59375937 continue;
59385938
59395939 if (!new_crtc_state->enable)
drivers/gpu/drm/amd/display/dc/core/dc_link.c+1−11
@@ -2190,8 +2190,7 @@ int dc_link_get_backlight_level(const struct dc_link *link) · 2189 unmodified lines
21902190
21912191 bool dc_link_set_backlight_level(const struct dc_link *link,
21922192 uint32_t backlight_pwm_u16_16,
2193− uint32_t frame_ramp,
2194− const struct dc_stream_state *stream)
2193+ uint32_t frame_ramp)
21952194 {
21962195 struct dc *core_dc = link->ctx->dc;
21972196 struct abm *abm = core_dc->res_pool->abm;
@@ -2206,10 +2205,6 @@ bool dc_link_set_backlight_level(const struct dc_link *link, · 8 unmodified lines
22062205 (abm->funcs->set_backlight_level_pwm == NULL))
22072206 return false;
22082207
2209− if (stream)
2210− ((struct dc_stream_state *)stream)->bl_pwm_level =
2211− backlight_pwm_u16_16;
2212−
22132208 use_smooth_brightness = dmcu->funcs->is_dmcu_initialized(dmcu);
22142209
22152210 DC_LOG_BACKLIGHT("New Backlight level: %d (0x%X)\n",
@@ -2637,11 +2632,6 @@ void core_link_enable_stream( · 421 unmodified lines
26372632
26382633 if (dc_is_dp_signal(pipe_ctx->stream->signal))
26392634 enable_stream_features(pipe_ctx);
2640−
2641− dc_link_set_backlight_level(pipe_ctx->stream->sink->link,
2642− pipe_ctx->stream->bl_pwm_level,
2643− 0,
2644− pipe_ctx->stream);
26452635 }
26462636
26472637 }
drivers/gpu/drm/amd/display/dc/dc_link.h+1−2
@@ -146,8 +146,7 @@ static inline struct dc_link *dc_get_link_at_index(struct dc *dc, uint32_t link_ · 145 unmodified lines
146146 */
147147 bool dc_link_set_backlight_level(const struct dc_link *dc_link,
148148 uint32_t backlight_pwm_u16_16,
149− uint32_t frame_ramp,
150− const struct dc_stream_state *stream);
149+ uint32_t frame_ramp);
151150
152151 int dc_link_get_backlight_level(const struct dc_link *dc_link);
153152
drivers/gpu/drm/amd/display/dc/dc_stream.h+0−1
@@ -91,7 +91,6 @@ struct dc_stream_state { · 90 unmodified lines
9191
9292 /* DMCU info */
9393 unsigned int abm_level;
94− unsigned int bl_pwm_level;
9594
9695 /* from core_stream struct */
9796 struct dc_context *ctx;
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c+6−1
@@ -1000,7 +1000,7 @@ void dce110_enable_audio_stream(struct pipe_ctx *pipe_ctx) · 999 unmodified lines
10001000
10011001 pipe_ctx->stream_res.audio->funcs->az_enable(pipe_ctx->stream_res.audio);
10021002
1003− if (num_audio == 1 && pp_smu != NULL && pp_smu->set_pme_wa_enable != NULL)
1003+ if (num_audio >= 1 && pp_smu != NULL && pp_smu->set_pme_wa_enable != NULL)
10041004 /*this is the first audio. apply the PME w/a in order to wake AZ from D3*/
10051005 pp_smu->set_pme_wa_enable(&pp_smu->pp_smu);
10061006 /* un-mute audio */
@@ -1017,6 +1017,8 @@ void dce110_disable_audio_stream(struct pipe_ctx *pipe_ctx, int option) · 10 unmodified lines
10171017 pipe_ctx->stream_res.stream_enc->funcs->audio_mute_control(
10181018 pipe_ctx->stream_res.stream_enc, true);
10191019 if (pipe_ctx->stream_res.audio) {
1020+ struct pp_smu_funcs_rv *pp_smu = dc->res_pool->pp_smu;
1021+
10201022 if (option != KEEP_ACQUIRED_RESOURCE ||
10211023 !dc->debug.az_endpoint_mute_only) {
10221024 /*only disalbe az_endpoint if power down or free*/
@@ -1036,6 +1038,9 @@ void dce110_disable_audio_stream(struct pipe_ctx *pipe_ctx, int option) · 13 unmodified lines
10361038 update_audio_usage(&dc->current_state->res_ctx, dc->res_pool, pipe_ctx->stream_res.audio, false);
10371039 pipe_ctx->stream_res.audio = NULL;
10381040 }
1041+ if (pp_smu != NULL && pp_smu->set_pme_wa_enable != NULL)
1042+ /*this is the first audio. apply the PME w/a in order to wake AZ from D3*/
1043+ pp_smu->set_pme_wa_enable(&pp_smu->pp_smu);
10391044
10401045 /* TODO: notify audio driver for if audio modes list changed
10411046 * add audio mode list change flag */
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c+1−1
@@ -463,7 +463,7 @@ void dpp1_set_cursor_position( · 462 unmodified lines
463463 if (src_y_offset >= (int)param->viewport.height)
464464 cur_en = 0; /* not visible beyond bottom edge*/
465465
466− if (src_y_offset < 0)
466+ if (src_y_offset + (int)height <= 0)
467467 cur_en = 0; /* not visible beyond top edge*/
468468
469469 REG_UPDATE(CURSOR0_CONTROL,
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.c+1−1
@@ -1140,7 +1140,7 @@ void hubp1_cursor_set_position( · 1139 unmodified lines
11401140 if (src_y_offset >= (int)param->viewport.height)
11411141 cur_en = 0; /* not visible beyond bottom edge*/
11421142
1143− if (src_y_offset < 0) //+ (int)hubp->curs_attr.height
1143+ if (src_y_offset + (int)hubp->curs_attr.height <= 0)
11441144 cur_en = 0; /* not visible beyond top edge*/
11451145
11461146 if (cur_en && REG_READ(CURSOR_SURFACE_ADDRESS) == 0)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c+6−13
@@ -2355,29 +2355,22 @@ static void dcn10_apply_ctx_for_surface( · 2354 unmodified lines
23552355 top_pipe_to_program->plane_state->update_flags.bits.full_update)
23562356 for (i = 0; i < dc->res_pool->pipe_count; i++) {
23572357 struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[i];
2358−
2358+ tg = pipe_ctx->stream_res.tg;
23592359 /* Skip inactive pipes and ones already updated */
23602360 if (!pipe_ctx->stream || pipe_ctx->stream == stream
2361− || !pipe_ctx->plane_state)
2361+ || !pipe_ctx->plane_state
2362+ || !tg->funcs->is_tg_enabled(tg))
23622363 continue;
23632364
2364− pipe_ctx->stream_res.tg->funcs->lock(pipe_ctx->stream_res.tg);
2365+ tg->funcs->lock(tg);
23652366
23662367 pipe_ctx->plane_res.hubp->funcs->hubp_setup_interdependent(
23672368 pipe_ctx->plane_res.hubp,
23682369 &pipe_ctx->dlg_regs,
23692370 &pipe_ctx->ttu_regs);
2370− }
2371−
2372− for (i = 0; i < dc->res_pool->pipe_count; i++) {
2373− struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[i];
23742371
2375− if (!pipe_ctx->stream || pipe_ctx->stream == stream
2376− || !pipe_ctx->plane_state)
2377− continue;
2378−
2379− dcn10_pipe_control_lock(dc, pipe_ctx, false);
2380− }
2372+ tg->funcs->unlock(tg);
2373+ }
23812374
23822375 if (num_planes == 0)
23832376 false_optc_underflow_wa(dc, stream, tg);
drivers/gpu/drm/amd/display/modules/power/power_helpers.c+2−0
@@ -57,6 +57,7 @@ static const unsigned char abm_config[abm_defines_max_config][abm_defines_max_le · 56 unmodified lines
5757 #define NUM_POWER_FN_SEGS 8
5858 #define NUM_BL_CURVE_SEGS 16
5959
60+#pragma pack(push, 1)
6061 /* NOTE: iRAM is 256B in size */
6162 struct iram_table_v_2 {
6263 /* flags */
@@ -100,6 +101,7 @@ struct iram_table_v_2 { · 37 unmodified lines
100101 uint8_t dummy8; /* 0xfe */
101102 uint8_t dummy9; /* 0xff */
102103 };
104+#pragma pack(pop)
103105
104106 static uint16_t backlight_8_to_16(unsigned int backlight_8bit)
105107 {
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_processpptables.c+21−1
@@ -32,6 +32,7 @@ · 31 unmodified lines
3232 #include "vega10_pptable.h"
3333
3434 #define NUM_DSPCLK_LEVELS 8
35+#define VEGA10_ENGINECLOCK_HARDMAX 198000
3536
3637 static void set_hw_cap(struct pp_hwmgr *hwmgr, bool enable,
3738 enum phm_platform_caps cap)
@@ -258,7 +259,26 @@ static int init_over_drive_limits( · 220 unmodified lines
258259 struct pp_hwmgr *hwmgr,
259260 const ATOM_Vega10_POWERPLAYTABLE *powerplay_table)
260261 {
261− hwmgr->platform_descriptor.overdriveLimit.engineClock =
262+ const ATOM_Vega10_GFXCLK_Dependency_Table *gfxclk_dep_table =
263+ (const ATOM_Vega10_GFXCLK_Dependency_Table *)
264+ (((unsigned long) powerplay_table) +
265+ le16_to_cpu(powerplay_table->usGfxclkDependencyTableOffset));
266+ bool is_acg_enabled = false;
267+ ATOM_Vega10_GFXCLK_Dependency_Record_V2 *patom_record_v2;
268+
269+ if (gfxclk_dep_table->ucRevId == 1) {
270+ patom_record_v2 =
271+ (ATOM_Vega10_GFXCLK_Dependency_Record_V2 *)gfxclk_dep_table->entries;
272+ is_acg_enabled =
273+ (bool)patom_record_v2[gfxclk_dep_table->ucNumEntries-1].ucACGEnable;
274+ }
275+
276+ if (powerplay_table->ulMaxODEngineClock > VEGA10_ENGINECLOCK_HARDMAX &&
277+ !is_acg_enabled)
278+ hwmgr->platform_descriptor.overdriveLimit.engineClock =
279+ VEGA10_ENGINECLOCK_HARDMAX;
280+ else
281+ hwmgr->platform_descriptor.overdriveLimit.engineClock =
262282 le32_to_cpu(powerplay_table->ulMaxODEngineClock);
263283 hwmgr->platform_descriptor.overdriveLimit.memoryClock =
264284 le32_to_cpu(powerplay_table->ulMaxODMemoryClock);
drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c+21−0
@@ -753,6 +753,22 @@ static int vega12_init_smc_table(struct pp_hwmgr *hwmgr) · 752 unmodified lines
753753 return 0;
754754 }
755755
756+static int vega12_run_acg_btc(struct pp_hwmgr *hwmgr)
757+{
758+ uint32_t result;
759+
760+ PP_ASSERT_WITH_CODE(
761+ smum_send_msg_to_smc(hwmgr, PPSMC_MSG_RunAcgBtc) == 0,
762+ "[Run_ACG_BTC] Attempt to run ACG BTC failed!",
763+ return -EINVAL);
764+
765+ result = smum_get_argument(hwmgr);
766+ PP_ASSERT_WITH_CODE(result == 1,
767+ "Failed to run ACG BTC!", return -EINVAL);
768+
769+ return 0;
770+}
771+
756772 static int vega12_set_allowed_featuresmask(struct pp_hwmgr *hwmgr)
757773 {
758774 struct vega12_hwmgr *data =
@@ -931,6 +947,11 @@ static int vega12_enable_dpm_tasks(struct pp_hwmgr *hwmgr) · 172 unmodified lines
931947 "Failed to initialize SMC table!",
932948 result = tmp_result);
933949
950+ tmp_result = vega12_run_acg_btc(hwmgr);
951+ PP_ASSERT_WITH_CODE(!tmp_result,
952+ "Failed to run ACG BTC!",
953+ result = tmp_result);
954+
934955 result = vega12_enable_all_smu_features(hwmgr);
935956 PP_ASSERT_WITH_CODE(!result,
936957 "Failed to enable all smu features!",
drivers/gpu/drm/i915/gvt/handlers.c+1−0
@@ -2799,6 +2799,7 @@ static int init_broadwell_mmio_info(struct intel_gvt *gvt) · 2798 unmodified lines
27992799 MMIO_DFH(_MMIO(0xe2a0), D_BDW_PLUS, F_CMD_ACCESS, NULL, NULL);
28002800 MMIO_DFH(_MMIO(0xe2b0), D_BDW_PLUS, F_CMD_ACCESS, NULL, NULL);
28012801 MMIO_DFH(_MMIO(0xe2c0), D_BDW_PLUS, F_CMD_ACCESS, NULL, NULL);
2802+ MMIO_DFH(_MMIO(0x21f0), D_BDW_PLUS, F_CMD_ACCESS, NULL, NULL);
28022803 return 0;
28032804 }
28042805
drivers/gpu/drm/i915/gvt/hypercall.h+1−1
@@ -41,7 +41,7 @@ struct intel_gvt_mpt { · 40 unmodified lines
4141 int (*host_init)(struct device *dev, void *gvt, const void *ops);
4242 void (*host_exit)(struct device *dev, void *gvt);
4343 int (*attach_vgpu)(void *vgpu, unsigned long *handle);
44− void (*detach_vgpu)(unsigned long handle);
44+ void (*detach_vgpu)(void *vgpu);
4545 int (*inject_msi)(unsigned long handle, u32 addr, u16 data);
4646 unsigned long (*from_virt_to_mfn)(void *p);
4747 int (*enable_page_track)(unsigned long handle, u64 gfn);
drivers/gpu/drm/i915/gvt/kvmgt.c+26−4
@@ -996,7 +996,7 @@ static int intel_vgpu_mmap(struct mdev_device *mdev, struct vm_area_struct *vma) · 995 unmodified lines
996996 {
997997 unsigned int index;
998998 u64 virtaddr;
999− unsigned long req_size, pgoff = 0;
999+ unsigned long req_size, pgoff, req_start;
10001000 pgprot_t pg_prot;
10011001 struct intel_vgpu *vgpu = mdev_get_drvdata(mdev);
10021002
@@ -1014,7 +1014,17 @@ static int intel_vgpu_mmap(struct mdev_device *mdev, struct vm_area_struct *vma) · 11 unmodified lines
10141014 pg_prot = vma->vm_page_prot;
10151015 virtaddr = vma->vm_start;
10161016 req_size = vma->vm_end - vma->vm_start;
1017− pgoff = vgpu_aperture_pa_base(vgpu) >> PAGE_SHIFT;
1017+ pgoff = vma->vm_pgoff &
1018+ ((1U << (VFIO_PCI_OFFSET_SHIFT - PAGE_SHIFT)) - 1);
1019+ req_start = pgoff << PAGE_SHIFT;
1020+
1021+ if (!intel_vgpu_in_aperture(vgpu, req_start))
1022+ return -EINVAL;
1023+ if (req_start + req_size >
1024+ vgpu_aperture_offset(vgpu) + vgpu_aperture_sz(vgpu))
1025+ return -EINVAL;
1026+
1027+ pgoff = (gvt_aperture_pa_base(vgpu->gvt) >> PAGE_SHIFT) + pgoff;
10181028
10191029 return remap_pfn_range(vma, virtaddr, pgoff, req_size, pg_prot);
10201030 }
@@ -1662,9 +1672,21 @@ static int kvmgt_attach_vgpu(void *vgpu, unsigned long *handle) · 641 unmodified lines
16621672 return 0;
16631673 }
16641674
1665−static void kvmgt_detach_vgpu(unsigned long handle)
1675+static void kvmgt_detach_vgpu(void *p_vgpu)
16661676 {
1667− /* nothing to do here */
1677+ int i;
1678+ struct intel_vgpu *vgpu = (struct intel_vgpu *)p_vgpu;
1679+
1680+ if (!vgpu->vdev.region)
1681+ return;
1682+
1683+ for (i = 0; i < vgpu->vdev.num_regions; i++)
1684+ if (vgpu->vdev.region[i].ops->release)
1685+ vgpu->vdev.region[i].ops->release(vgpu,
1686+ &vgpu->vdev.region[i]);
1687+ vgpu->vdev.num_regions = 0;
1688+ kfree(vgpu->vdev.region);
1689+ vgpu->vdev.region = NULL;
16681690 }
16691691
16701692 static int kvmgt_inject_msi(unsigned long handle, u32 addr, u16 data)
drivers/gpu/drm/i915/gvt/mpt.h+1−1
@@ -101,7 +101,7 @@ static inline void intel_gvt_hypervisor_detach_vgpu(struct intel_vgpu *vgpu) · 100 unmodified lines
101101 if (!intel_gvt_host.mpt->detach_vgpu)
102102 return;
103103
104− intel_gvt_host.mpt->detach_vgpu(vgpu->handle);
104+ intel_gvt_host.mpt->detach_vgpu(vgpu);
105105 }
106106
107107 #define MSI_CAP_CONTROL(offset) (offset + 2)
drivers/gpu/drm/i915/gvt/scheduler.c+6−5
@@ -332,6 +332,9 @@ static void release_shadow_wa_ctx(struct intel_shadow_wa_ctx *wa_ctx) · 331 unmodified lines
332332
333333 i915_gem_object_unpin_map(wa_ctx->indirect_ctx.obj);
334334 i915_gem_object_put(wa_ctx->indirect_ctx.obj);
335+
336+ wa_ctx->indirect_ctx.obj = NULL;
337+ wa_ctx->indirect_ctx.shadow_va = NULL;
335338 }
336339
337340 static int set_context_ppgtt_from_shadow(struct intel_vgpu_workload *workload,
@@ -911,11 +914,6 @@ static void complete_current_workload(struct intel_gvt *gvt, int ring_id) · 573 unmodified lines
911914
912915 list_del_init(&workload->list);
913916
914− if (!workload->status) {
915− release_shadow_batch_buffer(workload);
916− release_shadow_wa_ctx(&workload->wa_ctx);
917− }
918−
919917 if (workload->status || (vgpu->resetting_eng & ENGINE_MASK(ring_id))) {
920918 /* if workload->status is not successful means HW GPU
921919 * has occurred GPU hang or something wrong with i915/GVT,
@@ -1283,6 +1281,9 @@ void intel_vgpu_destroy_workload(struct intel_vgpu_workload *workload) · 361 unmodified lines
12831281 {
12841282 struct intel_vgpu_submission *s = &workload->vgpu->submission;
12851283
1284+ release_shadow_batch_buffer(workload);
1285+ release_shadow_wa_ctx(&workload->wa_ctx);
1286+
12861287 if (workload->shadow_mm)
12871288 intel_vgpu_mm_put(workload->shadow_mm);
12881289
drivers/gpu/drm/i915/intel_lrc.c+4−0
@@ -303,6 +303,7 @@ static void __unwind_incomplete_requests(struct intel_engine_cs *engine) · 302 unmodified lines
303303 */
304304 if (!(prio & I915_PRIORITY_NEWCLIENT)) {
305305 prio |= I915_PRIORITY_NEWCLIENT;
306+ active->sched.attr.priority = prio;
306307 list_move_tail(&active->sched.link,
307308 i915_sched_lookup_priolist(engine, prio));
308309 }
@@ -645,6 +646,9 @@ static void execlists_dequeue(struct intel_engine_cs *engine) · 336 unmodified lines
645646 int i;
646647
647648 priolist_for_each_request_consume(rq, rn, p, i) {
649+ GEM_BUG_ON(last &&
650+ need_preempt(engine, last, rq_prio(rq)));
651+
648652 /*
649653 * Can we combine this request with the current port?
650654 * It has to be the same context/ringbuffer and not
drivers/gpu/drm/meson/meson_crtc.c+2−21
@@ -46,7 +46,6 @@ struct meson_crtc { · 45 unmodified lines
4646 struct drm_crtc base;
4747 struct drm_pending_vblank_event *event;
4848 struct meson_drm *priv;
49− bool enabled;
5049 };
5150 #define to_meson_crtc(x) container_of(x, struct meson_crtc, base)
5251
@@ -82,7 +81,8 @@ static const struct drm_crtc_funcs meson_crtc_funcs = { · 29 unmodified lines
8281
8382 };
8483
85−static void meson_crtc_enable(struct drm_crtc *crtc)
84+static void meson_crtc_atomic_enable(struct drm_crtc *crtc,
85+ struct drm_crtc_state *old_state)
8686 {
8787 struct meson_crtc *meson_crtc = to_meson_crtc(crtc);
8888 struct drm_crtc_state *crtc_state = crtc->state;
@@ -108,20 +108,6 @@ static void meson_crtc_enable(struct drm_crtc *crtc) · 19 unmodified lines
108108
109109 drm_crtc_vblank_on(crtc);
110110
111− meson_crtc->enabled = true;
112−}
113−
114−static void meson_crtc_atomic_enable(struct drm_crtc *crtc,
115− struct drm_crtc_state *old_state)
116−{
117− struct meson_crtc *meson_crtc = to_meson_crtc(crtc);
118− struct meson_drm *priv = meson_crtc->priv;
119−
120− DRM_DEBUG_DRIVER("\n");
121−
122− if (!meson_crtc->enabled)
123− meson_crtc_enable(crtc);
124−
125111 priv->viu.osd1_enabled = true;
126112 }
127113
@@ -153,8 +139,6 @@ static void meson_crtc_atomic_disable(struct drm_crtc *crtc, · 25 unmodified lines
153139
154140 crtc->state->event = NULL;
155141 }
156−
157− meson_crtc->enabled = false;
158142 }
159143
160144 static void meson_crtc_atomic_begin(struct drm_crtc *crtc,
@@ -163,9 +147,6 @@ static void meson_crtc_atomic_begin(struct drm_crtc *crtc, · 2 unmodified lines
163147 struct meson_crtc *meson_crtc = to_meson_crtc(crtc);
164148 unsigned long flags;
165149
166− if (crtc->state->enable && !meson_crtc->enabled)
167− meson_crtc_enable(crtc);
168−
169150 if (crtc->state->event) {
170151 WARN_ON(drm_crtc_vblank_get(crtc) != 0);
171152
drivers/gpu/drm/meson/meson_drv.c+12−2
@@ -75,6 +75,10 @@ static const struct drm_mode_config_funcs meson_mode_config_funcs = { · 74 unmodified lines
7575 .fb_create = drm_gem_fb_create,
7676 };
7777
78+static const struct drm_mode_config_helper_funcs meson_mode_config_helpers = {
79+ .atomic_commit_tail = drm_atomic_helper_commit_tail_rpm,
80+};
81+
7882 static irqreturn_t meson_irq(int irq, void *arg)
7983 {
8084 struct drm_device *dev = arg;
@@ -266,6 +270,7 @@ static int meson_drv_bind_master(struct device *dev, bool has_components) · 185 unmodified lines
266270 drm->mode_config.max_width = 3840;
267271 drm->mode_config.max_height = 2160;
268272 drm->mode_config.funcs = &meson_mode_config_funcs;
273+ drm->mode_config.helper_private = &meson_mode_config_helpers;
269274
270275 /* Hardware Initialization */
271276
@@ -388,8 +393,10 @@ static int meson_probe_remote(struct platform_device *pdev, · 116 unmodified lines
388393 remote_node = of_graph_get_remote_port_parent(ep);
389394 if (!remote_node ||
390395 remote_node == parent || /* Ignore parent endpoint */
391− !of_device_is_available(remote_node))
396+ !of_device_is_available(remote_node)) {
397+ of_node_put(remote_node);
392398 continue;
399+ }
393400
394401 count += meson_probe_remote(pdev, match, remote, remote_node);
395402
@@ -408,10 +415,13 @@ static int meson_drv_probe(struct platform_device *pdev) · 12 unmodified lines
408415
409416 for_each_endpoint_of_node(np, ep) {
410417 remote = of_graph_get_remote_port_parent(ep);
411− if (!remote || !of_device_is_available(remote))
418+ if (!remote || !of_device_is_available(remote)) {
419+ of_node_put(remote);
412420 continue;
421+ }
413422
414423 count += meson_probe_remote(pdev, &match, np, remote);
424+ of_node_put(remote);
415425 }
416426
417427 if (count && !match)
drivers/gpu/drm/msm/adreno/a6xx_gmu.c+1−1
@@ -944,7 +944,7 @@ static u32 a6xx_gmu_get_arc_level(struct device *dev, unsigned long freq) · 943 unmodified lines
944944 np = dev_pm_opp_get_of_node(opp);
945945
946946 if (np) {
947− of_property_read_u32(np, "qcom,level", &val);
947+ of_property_read_u32(np, "opp-level", &val);
948948 of_node_put(np);
949949 }
950950
drivers/gpu/drm/msm/adreno/adreno_gpu.c+0−1
@@ -765,7 +765,6 @@ int adreno_gpu_init(struct drm_device *drm, struct platform_device *pdev, · 764 unmodified lines
765765 adreno_gpu->rev = config->rev;
766766
767767 adreno_gpu_config.ioname = "kgsl_3d0_reg_memory";
768− adreno_gpu_config.irqname = "kgsl_3d0_irq";
769768
770769 adreno_gpu_config.va_start = SZ_16M;
771770 adreno_gpu_config.va_end = 0xffffffff;
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c+13−13
@@ -365,19 +365,6 @@ static void _dpu_plane_set_qos_ctrl(struct drm_plane *plane, · 364 unmodified lines
365365 &pdpu->pipe_qos_cfg);
366366 }
367367
368−static void dpu_plane_danger_signal_ctrl(struct drm_plane *plane, bool enable)
369−{
370− struct dpu_plane *pdpu = to_dpu_plane(plane);
371− struct dpu_kms *dpu_kms = _dpu_plane_get_kms(plane);
372−
373− if (!pdpu->is_rt_pipe)
374− return;
375−
376− pm_runtime_get_sync(&dpu_kms->pdev->dev);
377− _dpu_plane_set_qos_ctrl(plane, enable, DPU_PLANE_QOS_PANIC_CTRL);
378− pm_runtime_put_sync(&dpu_kms->pdev->dev);
379−}
380−
381368 /**
382369 * _dpu_plane_set_ot_limit - set OT limit for the given plane
383370 * @plane: Pointer to drm plane
@@ -1248,6 +1235,19 @@ static void dpu_plane_reset(struct drm_plane *plane) · 864 unmodified lines
12481235 }
12491236
12501237 #ifdef CONFIG_DEBUG_FS
1238+static void dpu_plane_danger_signal_ctrl(struct drm_plane *plane, bool enable)
1239+{
1240+ struct dpu_plane *pdpu = to_dpu_plane(plane);
1241+ struct dpu_kms *dpu_kms = _dpu_plane_get_kms(plane);
1242+
1243+ if (!pdpu->is_rt_pipe)
1244+ return;
1245+
1246+ pm_runtime_get_sync(&dpu_kms->pdev->dev);
1247+ _dpu_plane_set_qos_ctrl(plane, enable, DPU_PLANE_QOS_PANIC_CTRL);
1248+ pm_runtime_put_sync(&dpu_kms->pdev->dev);
1249+}
1250+
12511251 static ssize_t _dpu_plane_danger_read(struct file *file,
12521252 char __user *buff, size_t count, loff_t *ppos)
12531253 {
drivers/gpu/drm/msm/msm_drv.h+5−1
@@ -250,7 +250,8 @@ void msm_gem_purge_vma(struct msm_gem_address_space *aspace, · 249 unmodified lines
250250 void msm_gem_unmap_vma(struct msm_gem_address_space *aspace,
251251 struct msm_gem_vma *vma);
252252 int msm_gem_map_vma(struct msm_gem_address_space *aspace,
253− struct msm_gem_vma *vma, struct sg_table *sgt, int npages);
253+ struct msm_gem_vma *vma, int prot,
254+ struct sg_table *sgt, int npages);
254255 void msm_gem_close_vma(struct msm_gem_address_space *aspace,
255256 struct msm_gem_vma *vma);
256257
@@ -333,6 +334,7 @@ void msm_gem_kernel_put(struct drm_gem_object *bo, · 76 unmodified lines
333334 struct drm_gem_object *msm_gem_import(struct drm_device *dev,
334335 struct dma_buf *dmabuf, struct sg_table *sgt);
335336
337+__printf(2, 3)
336338 void msm_gem_object_set_name(struct drm_gem_object *bo, const char *fmt, ...);
337339
338340 int msm_framebuffer_prepare(struct drm_framebuffer *fb,
@@ -396,12 +398,14 @@ void msm_framebuffer_describe(struct drm_framebuffer *fb, struct seq_file *m); · 57 unmodified lines
396398 int msm_debugfs_late_init(struct drm_device *dev);
397399 int msm_rd_debugfs_init(struct drm_minor *minor);
398400 void msm_rd_debugfs_cleanup(struct msm_drm_private *priv);
401+__printf(3, 4)
399402 void msm_rd_dump_submit(struct msm_rd_state *rd, struct msm_gem_submit *submit,
400403 const char *fmt, ...);
401404 int msm_perf_debugfs_init(struct drm_minor *minor);
402405 void msm_perf_debugfs_cleanup(struct msm_drm_private *priv);
403406 #else
404407 static inline int msm_debugfs_late_init(struct drm_device *dev) { return 0; }
408+__printf(3, 4)
405409 static inline void msm_rd_dump_submit(struct msm_rd_state *rd, struct msm_gem_submit *submit,
406410 const char *fmt, ...) {}
407411 static inline void msm_rd_debugfs_cleanup(struct msm_drm_private *priv) {}
drivers/gpu/drm/msm/msm_gem.c+6−2
@@ -391,6 +391,10 @@ static int msm_gem_pin_iova(struct drm_gem_object *obj, · 390 unmodified lines
391391 struct msm_gem_object *msm_obj = to_msm_bo(obj);
392392 struct msm_gem_vma *vma;
393393 struct page **pages;
394+ int prot = IOMMU_READ;
395+
396+ if (!(msm_obj->flags & MSM_BO_GPU_READONLY))
397+ prot |= IOMMU_WRITE;
394398
395399 WARN_ON(!mutex_is_locked(&msm_obj->lock));
396400
@@ -405,8 +409,8 @@ static int msm_gem_pin_iova(struct drm_gem_object *obj, · 8 unmodified lines
405409 if (IS_ERR(pages))
406410 return PTR_ERR(pages);
407411
408− return msm_gem_map_vma(aspace, vma, msm_obj->sgt,
409− obj->size >> PAGE_SHIFT);
412+ return msm_gem_map_vma(aspace, vma, prot,
413+ msm_obj->sgt, obj->size >> PAGE_SHIFT);
410414 }
411415
412416 /* get iova and pin it. Should have a matching put */
drivers/gpu/drm/msm/msm_gem_vma.c+3−2
@@ -68,7 +68,8 @@ void msm_gem_unmap_vma(struct msm_gem_address_space *aspace, · 67 unmodified lines
6868
6969 int
7070 msm_gem_map_vma(struct msm_gem_address_space *aspace,
71− struct msm_gem_vma *vma, struct sg_table *sgt, int npages)
71+ struct msm_gem_vma *vma, int prot,
72+ struct sg_table *sgt, int npages)
7273 {
7374 unsigned size = npages << PAGE_SHIFT;
7475 int ret = 0;
@@ -86,7 +87,7 @@ msm_gem_map_vma(struct msm_gem_address_space *aspace, · 11 unmodified lines
8687
8788 if (aspace->mmu)
8889 ret = aspace->mmu->funcs->map(aspace->mmu, vma->iova, sgt,
89− size, IOMMU_READ | IOMMU_WRITE);
90+ size, prot);
9091
9192 if (ret)
9293 vma->mapped = false;
drivers/gpu/drm/msm/msm_gpu.c+1−1
@@ -900,7 +900,7 @@ int msm_gpu_init(struct drm_device *drm, struct platform_device *pdev, · 899 unmodified lines
900900 }
901901
902902 /* Get Interrupt: */
903− gpu->irq = platform_get_irq_byname(pdev, config->irqname);
903+ gpu->irq = platform_get_irq(pdev, 0);
904904 if (gpu->irq < 0) {
905905 ret = gpu->irq;
906906 DRM_DEV_ERROR(drm->dev, "failed to get irq: %d\n", ret);
drivers/gpu/drm/msm/msm_gpu.h+1−2
@@ -31,7 +31,6 @@ struct msm_gpu_state; · 30 unmodified lines
3131
3232 struct msm_gpu_config {
3333 const char *ioname;
34− const char *irqname;
3534 uint64_t va_start;
3635 uint64_t va_end;
3736 unsigned int nr_rings;
@@ -63,7 +62,7 @@ struct msm_gpu_funcs { · 25 unmodified lines
6362 struct msm_ringbuffer *(*active_ring)(struct msm_gpu *gpu);
6463 void (*recover)(struct msm_gpu *gpu);
6564 void (*destroy)(struct msm_gpu *gpu);
66−#ifdef CONFIG_DEBUG_FS
65+#if defined(CONFIG_DEBUG_FS) || defined(CONFIG_DEV_COREDUMP)
6766 /* show GPU status in debugfs: */
6867 void (*show)(struct msm_gpu *gpu, struct msm_gpu_state *state,
6968 struct drm_printer *p);
drivers/gpu/drm/msm/msm_rd.c+6−1
@@ -115,7 +115,9 @@ static void rd_write(struct msm_rd_state *rd, const void *buf, int sz) · 114 unmodified lines
115115 char *fptr = &fifo->buf[fifo->head];
116116 int n;
117117
118− wait_event(rd->fifo_event, circ_space(&rd->fifo) > 0);
118+ wait_event(rd->fifo_event, circ_space(&rd->fifo) > 0 || !rd->open);
119+ if (!rd->open)
120+ return;
119121
120122 /* Note that smp_load_acquire() is not strictly required
121123 * as CIRC_SPACE_TO_END() does not access the tail more
@@ -213,7 +215,10 @@ out: · 91 unmodified lines
213215 static int rd_release(struct inode *inode, struct file *file)
214216 {
215217 struct msm_rd_state *rd = inode->i_private;
218+
216219 rd->open = false;
220+ wake_up_all(&rd->fifo_event);
221+
217222 return 0;
218223 }
219224
drivers/gpu/drm/nouveau/nvkm/engine/device/base.c+33−0
@@ -2434,6 +2434,38 @@ nv140_chipset = { · 2433 unmodified lines
24342434 .sec2 = gp102_sec2_new,
24352435 };
24362436
2437+static const struct nvkm_device_chip
2438+nv162_chipset = {
2439+ .name = "TU102",
2440+ .bar = tu104_bar_new,
2441+ .bios = nvkm_bios_new,
2442+ .bus = gf100_bus_new,
2443+ .devinit = tu104_devinit_new,
2444+ .fault = tu104_fault_new,
2445+ .fb = gv100_fb_new,
2446+ .fuse = gm107_fuse_new,
2447+ .gpio = gk104_gpio_new,
2448+ .i2c = gm200_i2c_new,
2449+ .ibus = gm200_ibus_new,
2450+ .imem = nv50_instmem_new,
2451+ .ltc = gp102_ltc_new,
2452+ .mc = tu104_mc_new,
2453+ .mmu = tu104_mmu_new,
2454+ .pci = gp100_pci_new,
2455+ .pmu = gp102_pmu_new,
2456+ .therm = gp100_therm_new,
2457+ .timer = gk20a_timer_new,
2458+ .top = gk104_top_new,
2459+ .ce[0] = tu104_ce_new,
2460+ .ce[1] = tu104_ce_new,
2461+ .ce[2] = tu104_ce_new,
2462+ .ce[3] = tu104_ce_new,
2463+ .ce[4] = tu104_ce_new,
2464+ .disp = tu104_disp_new,
2465+ .dma = gv100_dma_new,
2466+ .fifo = tu104_fifo_new,
2467+};
2468+
24372469 static const struct nvkm_device_chip
24382470 nv164_chipset = {
24392471 .name = "TU104",
@@ -2950,6 +2982,7 @@ nvkm_device_ctor(const struct nvkm_device_func *func, · 510 unmodified lines
29502982 case 0x138: device->chip = &nv138_chipset; break;
29512983 case 0x13b: device->chip = &nv13b_chipset; break;
29522984 case 0x140: device->chip = &nv140_chipset; break;
2985+ case 0x162: device->chip = &nv162_chipset; break;
29532986 case 0x164: device->chip = &nv164_chipset; break;
29542987 case 0x166: device->chip = &nv166_chipset; break;
29552988 default:
drivers/gpu/drm/qxl/qxl_drv.c+0−4
@@ -250,14 +250,10 @@ static struct drm_driver qxl_driver = { · 249 unmodified lines
250250 #if defined(CONFIG_DEBUG_FS)
251251 .debugfs_init = qxl_debugfs_init,
252252 #endif
253− .prime_handle_to_fd = drm_gem_prime_handle_to_fd,
254− .prime_fd_to_handle = drm_gem_prime_fd_to_handle,
255253 .gem_prime_export = drm_gem_prime_export,
256254 .gem_prime_import = drm_gem_prime_import,
257255 .gem_prime_pin = qxl_gem_prime_pin,
258256 .gem_prime_unpin = qxl_gem_prime_unpin,
259− .gem_prime_get_sg_table = qxl_gem_prime_get_sg_table,
260− .gem_prime_import_sg_table = qxl_gem_prime_import_sg_table,
261257 .gem_prime_vmap = qxl_gem_prime_vmap,
262258 .gem_prime_vunmap = qxl_gem_prime_vunmap,
263259 .gem_prime_mmap = qxl_gem_prime_mmap,
drivers/gpu/drm/qxl/qxl_prime.c+0−14
@@ -38,20 +38,6 @@ void qxl_gem_prime_unpin(struct drm_gem_object *obj) · 37 unmodified lines
3838 WARN_ONCE(1, "not implemented");
3939 }
4040
41−struct sg_table *qxl_gem_prime_get_sg_table(struct drm_gem_object *obj)
42−{
43− WARN_ONCE(1, "not implemented");
44− return ERR_PTR(-ENOSYS);
45−}
46−
47−struct drm_gem_object *qxl_gem_prime_import_sg_table(
48− struct drm_device *dev, struct dma_buf_attachment *attach,
49− struct sg_table *table)
50−{
51− WARN_ONCE(1, "not implemented");
52− return ERR_PTR(-ENOSYS);
53−}
54−
5541 void *qxl_gem_prime_vmap(struct drm_gem_object *obj)
5642 {
5743 WARN_ONCE(1, "not implemented");
drivers/gpu/drm/rockchip/rockchip_rgb.c+3−1
@@ -113,8 +113,10 @@ struct rockchip_rgb *rockchip_rgb_init(struct device *dev, · 112 unmodified lines
113113 child_count++;
114114 ret = drm_of_find_panel_or_bridge(dev->of_node, 0, endpoint_id,
115115 &panel, &bridge);
116− if (!ret)
116+ if (!ret) {
117+ of_node_put(endpoint);
117118 break;
119+ }
118120 }
119121
120122 of_node_put(port);
drivers/gpu/drm/sun4i/sun4i_backend.c+3−2
@@ -786,17 +786,18 @@ static struct sun4i_frontend *sun4i_backend_find_frontend(struct sun4i_drv *drv, · 785 unmodified lines
786786 remote = of_graph_get_remote_port_parent(ep);
787787 if (!remote)
788788 continue;
789+ of_node_put(remote);
789790
790791 /* does this node match any registered engines? */
791792 list_for_each_entry(frontend, &drv->frontend_list, list) {
792793 if (remote == frontend->node) {
793− of_node_put(remote);
794794 of_node_put(port);
795+ of_node_put(ep);
795796 return frontend;
796797 }
797798 }
798799 }
799−
800+ of_node_put(port);
800801 return ERR_PTR(-EINVAL);
801802 }
802803
drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c+4−0
@@ -92,6 +92,8 @@ static void sun4i_hdmi_disable(struct drm_encoder *encoder) · 91 unmodified lines
9292 val = readl(hdmi->base + SUN4I_HDMI_VID_CTRL_REG);
9393 val &= ~SUN4I_HDMI_VID_CTRL_ENABLE;
9494 writel(val, hdmi->base + SUN4I_HDMI_VID_CTRL_REG);
95+
96+ clk_disable_unprepare(hdmi->tmds_clk);
9597 }
9698
9799 static void sun4i_hdmi_enable(struct drm_encoder *encoder)
@@ -102,6 +104,8 @@ static void sun4i_hdmi_enable(struct drm_encoder *encoder) · 4 unmodified lines
102104
103105 DRM_DEBUG_DRIVER("Enabling the HDMI Output\n");
104106
107+ clk_prepare_enable(hdmi->tmds_clk);
108+
105109 sun4i_hdmi_setup_avi_infoframes(hdmi, mode);
106110 val |= SUN4I_HDMI_PKT_CTRL_TYPE(0, SUN4I_HDMI_PKT_AVI);
107111 val |= SUN4I_HDMI_PKT_CTRL_TYPE(1, SUN4I_HDMI_PKT_END);
drivers/gpu/drm/virtio/virtgpu_drv.c+0−4
@@ -127,14 +127,10 @@ static struct drm_driver driver = { · 126 unmodified lines
127127 #if defined(CONFIG_DEBUG_FS)
128128 .debugfs_init = virtio_gpu_debugfs_init,
129129 #endif
130− .prime_handle_to_fd = drm_gem_prime_handle_to_fd,
131− .prime_fd_to_handle = drm_gem_prime_fd_to_handle,
132130 .gem_prime_export = drm_gem_prime_export,
133131 .gem_prime_import = drm_gem_prime_import,
134132 .gem_prime_pin = virtgpu_gem_prime_pin,
135133 .gem_prime_unpin = virtgpu_gem_prime_unpin,
136− .gem_prime_get_sg_table = virtgpu_gem_prime_get_sg_table,
137− .gem_prime_import_sg_table = virtgpu_gem_prime_import_sg_table,
138134 .gem_prime_vmap = virtgpu_gem_prime_vmap,
139135 .gem_prime_vunmap = virtgpu_gem_prime_vunmap,
140136 .gem_prime_mmap = virtgpu_gem_prime_mmap,
drivers/gpu/drm/virtio/virtgpu_drv.h+0−4
@@ -372,10 +372,6 @@ int virtio_gpu_object_wait(struct virtio_gpu_object *bo, bool no_wait); · 371 unmodified lines
372372 /* virtgpu_prime.c */
373373 int virtgpu_gem_prime_pin(struct drm_gem_object *obj);
374374 void virtgpu_gem_prime_unpin(struct drm_gem_object *obj);
375−struct sg_table *virtgpu_gem_prime_get_sg_table(struct drm_gem_object *obj);
376−struct drm_gem_object *virtgpu_gem_prime_import_sg_table(
377− struct drm_device *dev, struct dma_buf_attachment *attach,
378− struct sg_table *sgt);
379375 void *virtgpu_gem_prime_vmap(struct drm_gem_object *obj);
380376 void virtgpu_gem_prime_vunmap(struct drm_gem_object *obj, void *vaddr);
381377 int virtgpu_gem_prime_mmap(struct drm_gem_object *obj,
drivers/gpu/drm/virtio/virtgpu_prime.c+0−14
@@ -39,20 +39,6 @@ void virtgpu_gem_prime_unpin(struct drm_gem_object *obj) · 38 unmodified lines
3939 WARN_ONCE(1, "not implemented");
4040 }
4141
42−struct sg_table *virtgpu_gem_prime_get_sg_table(struct drm_gem_object *obj)
43−{
44− WARN_ONCE(1, "not implemented");
45− return ERR_PTR(-ENODEV);
46−}
47−
48−struct drm_gem_object *virtgpu_gem_prime_import_sg_table(
49− struct drm_device *dev, struct dma_buf_attachment *attach,
50− struct sg_table *table)
51−{
52− WARN_ONCE(1, "not implemented");
53− return ERR_PTR(-ENODEV);
54−}
55−
5642 void *virtgpu_gem_prime_vmap(struct drm_gem_object *obj)
5743 {
5844 struct virtio_gpu_object *bo = gem_to_virtio_gpu_obj(obj);
drivers/gpu/vga/Kconfig+1−0
@@ -21,6 +21,7 @@ config VGA_SWITCHEROO · 20 unmodified lines
2121 bool "Laptop Hybrid Graphics - GPU switching support"
2222 depends on X86
2323 depends on ACPI
24+ depends on PCI
2425 select VGA_ARB
2526 help
2627 Many laptops released in 2008/9/10 have two GPUs with a multiplexer
drivers/hid/hid-core.c+12−11
@@ -125,6 +125,7 @@ static int open_collection(struct hid_parser *parser, unsigned type) · 124 unmodified lines
125125 {
126126 struct hid_collection *collection;
127127 unsigned usage;
128+ int collection_index;
128129
129130 usage = parser->local.usage[0];
130131
@@ -167,13 +168,13 @@ static int open_collection(struct hid_parser *parser, unsigned type) · 36 unmodified lines
167168 parser->collection_stack[parser->collection_stack_ptr++] =
168169 parser->device->maxcollection;
169170
170− collection = parser->device->collection +
171− parser->device->maxcollection++;
171+ collection_index = parser->device->maxcollection++;
172+ collection = parser->device->collection + collection_index;
172173 collection->type = type;
173174 collection->usage = usage;
174175 collection->level = parser->collection_stack_ptr - 1;
175− collection->parent = parser->active_collection;
176− parser->active_collection = collection;
176+ collection->parent_idx = (collection->level == 0) ? -1 :
177+ parser->collection_stack[collection->level - 1];
177178
178179 if (type == HID_COLLECTION_APPLICATION)
179180 parser->device->maxapplication++;
@@ -192,8 +193,6 @@ static int close_collection(struct hid_parser *parser) · 12 unmodified lines
192193 return -EINVAL;
193194 }
194195 parser->collection_stack_ptr--;
195− if (parser->active_collection)
196− parser->active_collection = parser->active_collection->parent;
197196 return 0;
198197 }
199198
@@ -1006,10 +1005,12 @@ static void hid_apply_multiplier_to_field(struct hid_device *hid, · 806 unmodified lines
10061005 usage = &field->usage[i];
10071006
10081007 collection = &hid->collection[usage->collection_index];
1009− while (collection && collection != multiplier_collection)
1010− collection = collection->parent;
1008+ while (collection->parent_idx != -1 &&
1009+ collection != multiplier_collection)
1010+ collection = &hid->collection[collection->parent_idx];
10111011
1012− if (collection || multiplier_collection == NULL)
1012+ if (collection->parent_idx != -1 ||
1013+ multiplier_collection == NULL)
10131014 usage->resolution_multiplier = effective_multiplier;
10141015
10151016 }
@@ -1044,9 +1045,9 @@ static void hid_apply_multiplier(struct hid_device *hid, · 28 unmodified lines
10441045 * applicable fields later.
10451046 */
10461047 multiplier_collection = &hid->collection[multiplier->usage->collection_index];
1047− while (multiplier_collection &&
1048+ while (multiplier_collection->parent_idx != -1 &&
10481049 multiplier_collection->type != HID_COLLECTION_LOGICAL)
1049− multiplier_collection = multiplier_collection->parent;
1050+ multiplier_collection = &hid->collection[multiplier_collection->parent_idx];
10501051
10511052 effective_multiplier = hid_calculate_multiplier(hid, multiplier);
10521053
drivers/hid/hid-debug.c+47−73
@@ -30,6 +30,7 @@ · 29 unmodified lines
3030
3131 #include <linux/debugfs.h>
3232 #include <linux/seq_file.h>
33+#include <linux/kfifo.h>
3334 #include <linux/sched/signal.h>
3435 #include <linux/export.h>
3536 #include <linux/slab.h>
@@ -661,17 +662,12 @@ EXPORT_SYMBOL_GPL(hid_dump_device); · 625 unmodified lines
661662 /* enqueue string to 'events' ring buffer */
662663 void hid_debug_event(struct hid_device *hdev, char *buf)
663664 {
664− unsigned i;
665665 struct hid_debug_list *list;
666666 unsigned long flags;
667667
668668 spin_lock_irqsave(&hdev->debug_list_lock, flags);
669− list_for_each_entry(list, &hdev->debug_list, node) {
670− for (i = 0; buf[i]; i++)
671− list->hid_debug_buf[(list->tail + i) % HID_DEBUG_BUFSIZE] =
672− buf[i];
673− list->tail = (list->tail + i) % HID_DEBUG_BUFSIZE;
674− }
669+ list_for_each_entry(list, &hdev->debug_list, node)
670+ kfifo_in(&list->hid_debug_fifo, buf, strlen(buf));
675671 spin_unlock_irqrestore(&hdev->debug_list_lock, flags);
676672
677673 wake_up_interruptible(&hdev->debug_wait);
@@ -722,8 +718,7 @@ void hid_dump_input(struct hid_device *hdev, struct hid_usage *usage, __s32 valu · 44 unmodified lines
722718 hid_debug_event(hdev, buf);
723719
724720 kfree(buf);
725− wake_up_interruptible(&hdev->debug_wait);
726−
721+ wake_up_interruptible(&hdev->debug_wait);
727722 }
728723 EXPORT_SYMBOL_GPL(hid_dump_input);
729724
@@ -1083,8 +1078,8 @@ static int hid_debug_events_open(struct inode *inode, struct file *file) · 353 unmodified lines
10831078 goto out;
10841079 }
10851080
1086− if (!(list->hid_debug_buf = kzalloc(HID_DEBUG_BUFSIZE, GFP_KERNEL))) {
1087− err = -ENOMEM;
1081+ err = kfifo_alloc(&list->hid_debug_fifo, HID_DEBUG_FIFOSIZE, GFP_KERNEL);
1082+ if (err) {
10881083 kfree(list);
10891084 goto out;
10901085 }
@@ -1104,77 +1099,57 @@ static ssize_t hid_debug_events_read(struct file *file, char __user *buffer, · 13 unmodified lines
11041099 size_t count, loff_t *ppos)
11051100 {
11061101 struct hid_debug_list *list = file->private_data;
1107− int ret = 0, len;
1102+ int ret = 0, copied;
11081103 DECLARE_WAITQUEUE(wait, current);
11091104
11101105 mutex_lock(&list->read_mutex);
1111− while (ret == 0) {
1112− if (list->head == list->tail) {
1113− add_wait_queue(&list->hdev->debug_wait, &wait);
1114− set_current_state(TASK_INTERRUPTIBLE);
1115−
1116− while (list->head == list->tail) {
1117− if (file->f_flags & O_NONBLOCK) {
1118− ret = -EAGAIN;
1119− break;
1120− }
1121− if (signal_pending(current)) {
1122− ret = -ERESTARTSYS;
1123− break;
1124− }
1106+ if (kfifo_is_empty(&list->hid_debug_fifo)) {
1107+ add_wait_queue(&list->hdev->debug_wait, &wait);
1108+ set_current_state(TASK_INTERRUPTIBLE);
1109+
1110+ while (kfifo_is_empty(&list->hid_debug_fifo)) {
1111+ if (file->f_flags & O_NONBLOCK) {
1112+ ret = -EAGAIN;
1113+ break;
1114+ }
11251115
1126− if (!list->hdev || !list->hdev->debug) {
1127− ret = -EIO;
1128− set_current_state(TASK_RUNNING);
1129− goto out;
1130− }
1116+ if (signal_pending(current)) {
1117+ ret = -ERESTARTSYS;
1118+ break;
1119+ }
11311120
1132− /* allow O_NONBLOCK from other threads */
1133− mutex_unlock(&list->read_mutex);
1134− schedule();
1135− mutex_lock(&list->read_mutex);
1136− set_current_state(TASK_INTERRUPTIBLE);
1121+ /* if list->hdev is NULL we cannot remove_wait_queue().
1122+ * if list->hdev->debug is 0 then hid_debug_unregister()
1123+ * was already called and list->hdev is being destroyed.
1124+ * if we add remove_wait_queue() here we can hit a race.
1125+ */
1126+ if (!list->hdev || !list->hdev->debug) {
1127+ ret = -EIO;
1128+ set_current_state(TASK_RUNNING);
1129+ goto out;
11371130 }
11381131
1139− set_current_state(TASK_RUNNING);
1140− remove_wait_queue(&list->hdev->debug_wait, &wait);
1132+ /* allow O_NONBLOCK from other threads */
1133+ mutex_unlock(&list->read_mutex);
1134+ schedule();
1135+ mutex_lock(&list->read_mutex);
1136+ set_current_state(TASK_INTERRUPTIBLE);
11411137 }
11421138
1143− if (ret)
1144− goto out;
1139+ __set_current_state(TASK_RUNNING);
1140+ remove_wait_queue(&list->hdev->debug_wait, &wait);
11451141
1146− /* pass the ringbuffer contents to userspace */
1147−copy_rest:
1148− if (list->tail == list->head)
1142+ if (ret)
11491143 goto out;
1150− if (list->tail > list->head) {
1151− len = list->tail - list->head;
1152− if (len > count)
1153− len = count;
1154−
1155− if (copy_to_user(buffer + ret, &list->hid_debug_buf[list->head], len)) {
1156− ret = -EFAULT;
1157− goto out;
1158− }
1159− ret += len;
1160− list->head += len;
1161− } else {
1162− len = HID_DEBUG_BUFSIZE - list->head;
1163− if (len > count)
1164− len = count;
1165−
1166− if (copy_to_user(buffer, &list->hid_debug_buf[list->head], len)) {
1167− ret = -EFAULT;
1168− goto out;
1169− }
1170− list->head = 0;
1171− ret += len;
1172− count -= len;
1173− if (count > 0)
1174− goto copy_rest;
1175− }
1176−
11771144 }
1145+
1146+ /* pass the fifo content to userspace, locking is not needed with only
1147+ * one concurrent reader and one concurrent writer
1148+ */
1149+ ret = kfifo_to_user(&list->hid_debug_fifo, buffer, count, &copied);
1150+ if (ret)
1151+ goto out;
1152+ ret = copied;
11781153 out:
11791154 mutex_unlock(&list->read_mutex);
11801155 return ret;
@@ -1185,7 +1160,7 @@ static __poll_t hid_debug_events_poll(struct file *file, poll_table *wait) · 4 unmodified lines
11851160 struct hid_debug_list *list = file->private_data;
11861161
11871162 poll_wait(file, &list->hdev->debug_wait, wait);
1188− if (list->head != list->tail)
1163+ if (!kfifo_is_empty(&list->hid_debug_fifo))
11891164 return EPOLLIN | EPOLLRDNORM;
11901165 if (!list->hdev->debug)
11911166 return EPOLLERR | EPOLLHUP;
@@ -1200,7 +1175,7 @@ static int hid_debug_events_release(struct inode *inode, struct file *file) · 8 unmodified lines
12001175 spin_lock_irqsave(&list->hdev->debug_list_lock, flags);
12011176 list_del(&list->node);
12021177 spin_unlock_irqrestore(&list->hdev->debug_list_lock, flags);
1203− kfree(list->hid_debug_buf);
1178+ kfifo_free(&list->hid_debug_fifo);
12041179 kfree(list);
12051180
12061181 return 0;
@@ -1246,4 +1221,3 @@ void hid_debug_exit(void) · 39 unmodified lines
12461221 {
12471222 debugfs_remove_recursive(hid_debug_root);
12481223 }
1249−
drivers/hid/hid-ids.h+3−0
@@ -461,6 +461,9 @@ · 460 unmodified lines
461461 #define USB_DEVICE_ID_GENERAL_TOUCH_WIN8_PIT_010A 0x010a
462462 #define USB_DEVICE_ID_GENERAL_TOUCH_WIN8_PIT_E100 0xe100
463463
464+#define I2C_VENDOR_ID_GOODIX 0x27c6
465+#define I2C_DEVICE_ID_GOODIX_01F0 0x01f0
466+
464467 #define USB_VENDOR_ID_GOODTOUCH 0x1aad
465468 #define USB_DEVICE_ID_GOODTOUCH_000f 0x000f
466469
drivers/hid/i2c-hid/i2c-hid-core.c+2−0
@@ -179,6 +179,8 @@ static const struct i2c_hid_quirks { · 178 unmodified lines
179179 I2C_HID_QUIRK_DELAY_AFTER_SLEEP },
180180 { USB_VENDOR_ID_LG, I2C_DEVICE_ID_LG_8001,
181181 I2C_HID_QUIRK_NO_RUNTIME_PM },
182+ { I2C_VENDOR_ID_GOODIX, I2C_DEVICE_ID_GOODIX_01F0,
183+ I2C_HID_QUIRK_NO_RUNTIME_PM },
182184 { 0, 0 }
183185 };
184186
drivers/hv/channel.c+1−8
@@ -701,19 +701,12 @@ static int vmbus_close_internal(struct vmbus_channel *channel) · 700 unmodified lines
701701 int vmbus_disconnect_ring(struct vmbus_channel *channel)
702702 {
703703 struct vmbus_channel *cur_channel, *tmp;
704− unsigned long flags;
705− LIST_HEAD(list);
706704 int ret;
707705
708706 if (channel->primary_channel != NULL)
709707 return -EINVAL;
710708
711− /* Snapshot the list of subchannels */
712− spin_lock_irqsave(&channel->lock, flags);
713− list_splice_init(&channel->sc_list, &list);
714− spin_unlock_irqrestore(&channel->lock, flags);
715−
716− list_for_each_entry_safe(cur_channel, tmp, &list, sc_list) {
709+ list_for_each_entry_safe(cur_channel, tmp, &channel->sc_list, sc_list) {
717710 if (cur_channel->rescind)
718711 wait_for_completion(&cur_channel->rescind_event);
719712
drivers/hv/hv_balloon.c+6−4
@@ -888,12 +888,14 @@ static unsigned long handle_pg_range(unsigned long pg_start, · 887 unmodified lines
888888 pfn_cnt -= pgs_ol;
889889 /*
890890 * Check if the corresponding memory block is already
891− * online by checking its last previously backed page.
892− * In case it is we need to bring rest (which was not
893− * backed previously) online too.
891+ * online. It is possible to observe struct pages still
892+ * being uninitialized here so check section instead.
893+ * In case the section is online we need to bring the
894+ * rest of pfns (which were not backed previously)
895+ * online too.
894896 */
895897 if (start_pfn > has->start_pfn &&
896− !PageReserved(pfn_to_page(start_pfn - 1)))
898+ online_section_nr(pfn_to_section_nr(start_pfn)))
897899 hv_bring_pgs_online(has, start_pfn, pgs_ol);
898900
899901 }
drivers/hv/ring_buffer.c+15−16
@@ -164,26 +164,25 @@ hv_get_ringbuffer_availbytes(const struct hv_ring_buffer_info *rbi, · 163 unmodified lines
164164 }
165165
166166 /* Get various debug metrics for the specified ring buffer. */
167−void hv_ringbuffer_get_debuginfo(const struct hv_ring_buffer_info *ring_info,
168− struct hv_ring_buffer_debug_info *debug_info)
167+int hv_ringbuffer_get_debuginfo(const struct hv_ring_buffer_info *ring_info,
168+ struct hv_ring_buffer_debug_info *debug_info)
169169 {
170170 u32 bytes_avail_towrite;
171171 u32 bytes_avail_toread;
172172
173− if (ring_info->ring_buffer) {
174− hv_get_ringbuffer_availbytes(ring_info,
175− &bytes_avail_toread,
176− &bytes_avail_towrite);
177−
178− debug_info->bytes_avail_toread = bytes_avail_toread;
179− debug_info->bytes_avail_towrite = bytes_avail_towrite;
180− debug_info->current_read_index =
181− ring_info->ring_buffer->read_index;
182− debug_info->current_write_index =
183− ring_info->ring_buffer->write_index;
184− debug_info->current_interrupt_mask =
185− ring_info->ring_buffer->interrupt_mask;
186− }
173+ if (!ring_info->ring_buffer)
174+ return -EINVAL;
175+
176+ hv_get_ringbuffer_availbytes(ring_info,
177+ &bytes_avail_toread,
178+ &bytes_avail_towrite);
179+ debug_info->bytes_avail_toread = bytes_avail_toread;
180+ debug_info->bytes_avail_towrite = bytes_avail_towrite;
181+ debug_info->current_read_index = ring_info->ring_buffer->read_index;
182+ debug_info->current_write_index = ring_info->ring_buffer->write_index;
183+ debug_info->current_interrupt_mask
184+ = ring_info->ring_buffer->interrupt_mask;
185+ return 0;
187186 }
188187 EXPORT_SYMBOL_GPL(hv_ringbuffer_get_debuginfo);
189188
drivers/hv/vmbus_drv.c+61−30
@@ -313,12 +313,16 @@ static ssize_t out_intr_mask_show(struct device *dev, · 312 unmodified lines
313313 {
314314 struct hv_device *hv_dev = device_to_hv_device(dev);
315315 struct hv_ring_buffer_debug_info outbound;
316+ int ret;
316317
317318 if (!hv_dev->channel)
318319 return -ENODEV;
319− if (hv_dev->channel->state != CHANNEL_OPENED_STATE)
320− return -EINVAL;
321− hv_ringbuffer_get_debuginfo(&hv_dev->channel->outbound, &outbound);
320+
321+ ret = hv_ringbuffer_get_debuginfo(&hv_dev->channel->outbound,
322+ &outbound);
323+ if (ret < 0)
324+ return ret;
325+
322326 return sprintf(buf, "%d\n", outbound.current_interrupt_mask);
323327 }
324328 static DEVICE_ATTR_RO(out_intr_mask);
@@ -328,12 +332,15 @@ static ssize_t out_read_index_show(struct device *dev, · 3 unmodified lines
328332 {
329333 struct hv_device *hv_dev = device_to_hv_device(dev);
330334 struct hv_ring_buffer_debug_info outbound;
335+ int ret;
331336
332337 if (!hv_dev->channel)
333338 return -ENODEV;
334− if (hv_dev->channel->state != CHANNEL_OPENED_STATE)
335− return -EINVAL;
336− hv_ringbuffer_get_debuginfo(&hv_dev->channel->outbound, &outbound);
339+
340+ ret = hv_ringbuffer_get_debuginfo(&hv_dev->channel->outbound,
341+ &outbound);
342+ if (ret < 0)
343+ return ret;
337344 return sprintf(buf, "%d\n", outbound.current_read_index);
338345 }
339346 static DEVICE_ATTR_RO(out_read_index);
@@ -344,12 +351,15 @@ static ssize_t out_write_index_show(struct device *dev, · 4 unmodified lines
344351 {
345352 struct hv_device *hv_dev = device_to_hv_device(dev);
346353 struct hv_ring_buffer_debug_info outbound;
354+ int ret;
347355
348356 if (!hv_dev->channel)
349357 return -ENODEV;
350− if (hv_dev->channel->state != CHANNEL_OPENED_STATE)
351− return -EINVAL;
352− hv_ringbuffer_get_debuginfo(&hv_dev->channel->outbound, &outbound);
358+
359+ ret = hv_ringbuffer_get_debuginfo(&hv_dev->channel->outbound,
360+ &outbound);
361+ if (ret < 0)
362+ return ret;
353363 return sprintf(buf, "%d\n", outbound.current_write_index);
354364 }
355365 static DEVICE_ATTR_RO(out_write_index);
@@ -360,12 +370,15 @@ static ssize_t out_read_bytes_avail_show(struct device *dev, · 4 unmodified lines
360370 {
361371 struct hv_device *hv_dev = device_to_hv_device(dev);
362372 struct hv_ring_buffer_debug_info outbound;
373+ int ret;
363374
364375 if (!hv_dev->channel)
365376 return -ENODEV;
366− if (hv_dev->channel->state != CHANNEL_OPENED_STATE)
367− return -EINVAL;
368− hv_ringbuffer_get_debuginfo(&hv_dev->channel->outbound, &outbound);
377+
378+ ret = hv_ringbuffer_get_debuginfo(&hv_dev->channel->outbound,
379+ &outbound);
380+ if (ret < 0)
381+ return ret;
369382 return sprintf(buf, "%d\n", outbound.bytes_avail_toread);
370383 }
371384 static DEVICE_ATTR_RO(out_read_bytes_avail);
@@ -376,12 +389,15 @@ static ssize_t out_write_bytes_avail_show(struct device *dev, · 4 unmodified lines
376389 {
377390 struct hv_device *hv_dev = device_to_hv_device(dev);
378391 struct hv_ring_buffer_debug_info outbound;
392+ int ret;
379393
380394 if (!hv_dev->channel)
381395 return -ENODEV;
382− if (hv_dev->channel->state != CHANNEL_OPENED_STATE)
383− return -EINVAL;
384− hv_ringbuffer_get_debuginfo(&hv_dev->channel->outbound, &outbound);
396+
397+ ret = hv_ringbuffer_get_debuginfo(&hv_dev->channel->outbound,
398+ &outbound);
399+ if (ret < 0)
400+ return ret;
385401 return sprintf(buf, "%d\n", outbound.bytes_avail_towrite);
386402 }
387403 static DEVICE_ATTR_RO(out_write_bytes_avail);
@@ -391,12 +407,15 @@ static ssize_t in_intr_mask_show(struct device *dev, · 3 unmodified lines
391407 {
392408 struct hv_device *hv_dev = device_to_hv_device(dev);
393409 struct hv_ring_buffer_debug_info inbound;
410+ int ret;
394411
395412 if (!hv_dev->channel)
396413 return -ENODEV;
397− if (hv_dev->channel->state != CHANNEL_OPENED_STATE)
398− return -EINVAL;
399− hv_ringbuffer_get_debuginfo(&hv_dev->channel->inbound, &inbound);
414+
415+ ret = hv_ringbuffer_get_debuginfo(&hv_dev->channel->inbound, &inbound);
416+ if (ret < 0)
417+ return ret;
418+
400419 return sprintf(buf, "%d\n", inbound.current_interrupt_mask);
401420 }
402421 static DEVICE_ATTR_RO(in_intr_mask);
@@ -406,12 +425,15 @@ static ssize_t in_read_index_show(struct device *dev, · 3 unmodified lines
406425 {
407426 struct hv_device *hv_dev = device_to_hv_device(dev);
408427 struct hv_ring_buffer_debug_info inbound;
428+ int ret;
409429
410430 if (!hv_dev->channel)
411431 return -ENODEV;
412− if (hv_dev->channel->state != CHANNEL_OPENED_STATE)
413− return -EINVAL;
414− hv_ringbuffer_get_debuginfo(&hv_dev->channel->inbound, &inbound);
432+
433+ ret = hv_ringbuffer_get_debuginfo(&hv_dev->channel->inbound, &inbound);
434+ if (ret < 0)
435+ return ret;
436+
415437 return sprintf(buf, "%d\n", inbound.current_read_index);
416438 }
417439 static DEVICE_ATTR_RO(in_read_index);
@@ -421,12 +443,15 @@ static ssize_t in_write_index_show(struct device *dev, · 3 unmodified lines
421443 {
422444 struct hv_device *hv_dev = device_to_hv_device(dev);
423445 struct hv_ring_buffer_debug_info inbound;
446+ int ret;
424447
425448 if (!hv_dev->channel)
426449 return -ENODEV;
427− if (hv_dev->channel->state != CHANNEL_OPENED_STATE)
428− return -EINVAL;
429− hv_ringbuffer_get_debuginfo(&hv_dev->channel->inbound, &inbound);
450+
451+ ret = hv_ringbuffer_get_debuginfo(&hv_dev->channel->inbound, &inbound);
452+ if (ret < 0)
453+ return ret;
454+
430455 return sprintf(buf, "%d\n", inbound.current_write_index);
431456 }
432457 static DEVICE_ATTR_RO(in_write_index);
@@ -437,12 +462,15 @@ static ssize_t in_read_bytes_avail_show(struct device *dev, · 4 unmodified lines
437462 {
438463 struct hv_device *hv_dev = device_to_hv_device(dev);
439464 struct hv_ring_buffer_debug_info inbound;
465+ int ret;
440466
441467 if (!hv_dev->channel)
442468 return -ENODEV;
443− if (hv_dev->channel->state != CHANNEL_OPENED_STATE)
444− return -EINVAL;
445− hv_ringbuffer_get_debuginfo(&hv_dev->channel->inbound, &inbound);
469+
470+ ret = hv_ringbuffer_get_debuginfo(&hv_dev->channel->inbound, &inbound);
471+ if (ret < 0)
472+ return ret;
473+
446474 return sprintf(buf, "%d\n", inbound.bytes_avail_toread);
447475 }
448476 static DEVICE_ATTR_RO(in_read_bytes_avail);
@@ -453,12 +481,15 @@ static ssize_t in_write_bytes_avail_show(struct device *dev, · 4 unmodified lines
453481 {
454482 struct hv_device *hv_dev = device_to_hv_device(dev);
455483 struct hv_ring_buffer_debug_info inbound;
484+ int ret;
456485
457486 if (!hv_dev->channel)
458487 return -ENODEV;
459− if (hv_dev->channel->state != CHANNEL_OPENED_STATE)
460− return -EINVAL;
461− hv_ringbuffer_get_debuginfo(&hv_dev->channel->inbound, &inbound);
488+
489+ ret = hv_ringbuffer_get_debuginfo(&hv_dev->channel->inbound, &inbound);
490+ if (ret < 0)
491+ return ret;
492+
462493 return sprintf(buf, "%d\n", inbound.bytes_avail_towrite);
463494 }
464495 static DEVICE_ATTR_RO(in_write_bytes_avail);
drivers/hwmon/lm80.c+3−1
@@ -393,8 +393,10 @@ static ssize_t set_fan_div(struct device *dev, struct device_attribute *attr, · 392 unmodified lines
393393 }
394394
395395 rv = lm80_read_value(client, LM80_REG_FANDIV);
396− if (rv < 0)
396+ if (rv < 0) {
397+ mutex_unlock(&data->update_lock);
397398 return rv;
399+ }
398400 reg = (rv & ~(3 << (2 * (nr + 1))))
399401 | (data->fan_div[nr] << (2 * (nr + 1)));
400402 lm80_write_value(client, LM80_REG_FANDIV, reg);
drivers/hwmon/nct6775.c+7−5
@@ -44,8 +44,8 @@ · 43 unmodified lines
4444 * nct6796d 14 7 7 2+6 0xd420 0xc1 0x5ca3
4545 * nct6797d 14 7 7 2+6 0xd450 0xc1 0x5ca3
4646 * (0xd451)
47− * nct6798d 14 7 7 2+6 0xd458 0xc1 0x5ca3
48− * (0xd459)
47+ * nct6798d 14 7 7 2+6 0xd428 0xc1 0x5ca3
48+ * (0xd429)
4949 *
5050 * #temp lists the number of monitored temperature sources (first value) plus
5151 * the number of directly connectable temperature sensors (second value).
@@ -138,7 +138,7 @@ MODULE_PARM_DESC(fan_debounce, "Enable debouncing for fan RPM signal"); · 86 unmodified lines
138138 #define SIO_NCT6795_ID 0xd350
139139 #define SIO_NCT6796_ID 0xd420
140140 #define SIO_NCT6797_ID 0xd450
141−#define SIO_NCT6798_ID 0xd458
141+#define SIO_NCT6798_ID 0xd428
142142 #define SIO_ID_MASK 0xFFF8
143143
144144 enum pwm_enable { off, manual, thermal_cruise, speed_cruise, sf3, sf4 };
@@ -4508,7 +4508,8 @@ static int __maybe_unused nct6775_resume(struct device *dev) · 4363 unmodified lines
45084508
45094509 if (data->kind == nct6791 || data->kind == nct6792 ||
45104510 data->kind == nct6793 || data->kind == nct6795 ||
4511− data->kind == nct6796)
4511+ data->kind == nct6796 || data->kind == nct6797 ||
4512+ data->kind == nct6798)
45124513 nct6791_enable_io_mapping(sioreg);
45134514
45144515 superio_exit(sioreg);
@@ -4644,7 +4645,8 @@ static int __init nct6775_find(int sioaddr, struct nct6775_sio_data *sio_data) · 129 unmodified lines
46444645
46454646 if (sio_data->kind == nct6791 || sio_data->kind == nct6792 ||
46464647 sio_data->kind == nct6793 || sio_data->kind == nct6795 ||
4647− sio_data->kind == nct6796)
4648+ sio_data->kind == nct6796 || sio_data->kind == nct6797 ||
4649+ sio_data->kind == nct6798)
46484650 nct6791_enable_io_mapping(sioaddr);
46494651
46504652 superio_exit(sioaddr);
drivers/hwmon/occ/common.c+12−12
@@ -380,8 +380,8 @@ static ssize_t occ_show_power_1(struct device *dev, · 379 unmodified lines
380380 val *= 1000000ULL;
381381 break;
382382 case 2:
383− val = get_unaligned_be32(&power->update_tag) *
384− occ->powr_sample_time_us;
383+ val = (u64)get_unaligned_be32(&power->update_tag) *
384+ occ->powr_sample_time_us;
385385 break;
386386 case 3:
387387 val = get_unaligned_be16(&power->value) * 1000000ULL;
@@ -425,8 +425,8 @@ static ssize_t occ_show_power_2(struct device *dev, · 37 unmodified lines
425425 &power->update_tag);
426426 break;
427427 case 2:
428− val = get_unaligned_be32(&power->update_tag) *
429− occ->powr_sample_time_us;
428+ val = (u64)get_unaligned_be32(&power->update_tag) *
429+ occ->powr_sample_time_us;
430430 break;
431431 case 3:
432432 val = get_unaligned_be16(&power->value) * 1000000ULL;
@@ -463,8 +463,8 @@ static ssize_t occ_show_power_a0(struct device *dev, · 30 unmodified lines
463463 &power->system.update_tag);
464464 break;
465465 case 2:
466− val = get_unaligned_be32(&power->system.update_tag) *
467− occ->powr_sample_time_us;
466+ val = (u64)get_unaligned_be32(&power->system.update_tag) *
467+ occ->powr_sample_time_us;
468468 break;
469469 case 3:
470470 val = get_unaligned_be16(&power->system.value) * 1000000ULL;
@@ -477,8 +477,8 @@ static ssize_t occ_show_power_a0(struct device *dev, · 6 unmodified lines
477477 &power->proc.update_tag);
478478 break;
479479 case 6:
480− val = get_unaligned_be32(&power->proc.update_tag) *
481− occ->powr_sample_time_us;
480+ val = (u64)get_unaligned_be32(&power->proc.update_tag) *
481+ occ->powr_sample_time_us;
482482 break;
483483 case 7:
484484 val = get_unaligned_be16(&power->proc.value) * 1000000ULL;
@@ -491,8 +491,8 @@ static ssize_t occ_show_power_a0(struct device *dev, · 6 unmodified lines
491491 &power->vdd.update_tag);
492492 break;
493493 case 10:
494− val = get_unaligned_be32(&power->vdd.update_tag) *
495− occ->powr_sample_time_us;
494+ val = (u64)get_unaligned_be32(&power->vdd.update_tag) *
495+ occ->powr_sample_time_us;
496496 break;
497497 case 11:
498498 val = get_unaligned_be16(&power->vdd.value) * 1000000ULL;
@@ -505,8 +505,8 @@ static ssize_t occ_show_power_a0(struct device *dev, · 6 unmodified lines
505505 &power->vdn.update_tag);
506506 break;
507507 case 14:
508− val = get_unaligned_be32(&power->vdn.update_tag) *
509− occ->powr_sample_time_us;
508+ val = (u64)get_unaligned_be32(&power->vdn.update_tag) *
509+ occ->powr_sample_time_us;
510510 break;
511511 case 15:
512512 val = get_unaligned_be16(&power->vdn.value) * 1000000ULL;
drivers/hwmon/tmp421.c+1−1
@@ -88,7 +88,7 @@ static const struct of_device_id tmp421_of_match[] = { · 87 unmodified lines
8888 .data = (void *)2
8989 },
9090 {
91− .compatible = "ti,tmp422",
91+ .compatible = "ti,tmp442",
9292 .data = (void *)3
9393 },
9494 { },
drivers/i3c/master.c+1−1
@@ -1828,7 +1828,7 @@ int i3c_master_add_i3c_dev_locked(struct i3c_master_controller *master, · 1827 unmodified lines
18281828
18291829 ret = i3c_master_retrieve_dev_info(newdev);
18301830 if (ret)
1831− goto err_free_dev;
1831+ goto err_detach_dev;
18321832
18331833 olddev = i3c_master_search_i3c_dev_duplicate(newdev);
18341834 if (olddev) {
drivers/i3c/master/dw-i3c-master.c+14−11
@@ -419,12 +419,9 @@ static void dw_i3c_master_enqueue_xfer(struct dw_i3c_master *master, · 418 unmodified lines
419419 spin_unlock_irqrestore(&master->xferqueue.lock, flags);
420420 }
421421
422−static void dw_i3c_master_dequeue_xfer(struct dw_i3c_master *master,
423− struct dw_i3c_xfer *xfer)
422+static void dw_i3c_master_dequeue_xfer_locked(struct dw_i3c_master *master,
423+ struct dw_i3c_xfer *xfer)
424424 {
425− unsigned long flags;
426−
427− spin_lock_irqsave(&master->xferqueue.lock, flags);
428425 if (master->xferqueue.cur == xfer) {
429426 u32 status;
430427
@@ -439,6 +436,15 @@ static void dw_i3c_master_dequeue_xfer(struct dw_i3c_master *master, · 8 unmodified lines
439436 } else {
440437 list_del_init(&xfer->node);
441438 }
439+}
440+
441+static void dw_i3c_master_dequeue_xfer(struct dw_i3c_master *master,
442+ struct dw_i3c_xfer *xfer)
443+{
444+ unsigned long flags;
445+
446+ spin_lock_irqsave(&master->xferqueue.lock, flags);
447+ dw_i3c_master_dequeue_xfer_locked(master, xfer);
442448 spin_unlock_irqrestore(&master->xferqueue.lock, flags);
443449 }
444450
@@ -494,7 +500,7 @@ static void dw_i3c_master_end_xfer_locked(struct dw_i3c_master *master, u32 isr) · 49 unmodified lines
494500 complete(&xfer->comp);
495501
496502 if (ret < 0) {
497− dw_i3c_master_dequeue_xfer(master, xfer);
503+ dw_i3c_master_dequeue_xfer_locked(master, xfer);
498504 writel(readl(master->regs + DEVICE_CTRL) | DEV_CTRL_RESUME,
499505 master->regs + DEVICE_CTRL);
500506 }
@@ -901,9 +907,6 @@ static int dw_i3c_master_reattach_i3c_dev(struct i3c_dev_desc *dev, · 400 unmodified lines
901907 master->regs +
902908 DEV_ADDR_TABLE_LOC(master->datstartaddr, data->index));
903909
904− if (!old_dyn_addr)
905− return 0;
906−
907910 master->addrs[data->index] = dev->info.dyn_addr;
908911
909912 return 0;
@@ -925,11 +928,11 @@ static int dw_i3c_master_attach_i3c_dev(struct i3c_dev_desc *dev) · 15 unmodified lines
925928 return -ENOMEM;
926929
927930 data->index = pos;
928− master->addrs[pos] = dev->info.dyn_addr;
931+ master->addrs[pos] = dev->info.dyn_addr ? : dev->info.static_addr;
929932 master->free_pos &= ~BIT(pos);
930933 i3c_dev_set_master_data(dev, data);
931934
932− writel(DEV_ADDR_TABLE_DYNAMIC_ADDR(dev->info.dyn_addr),
935+ writel(DEV_ADDR_TABLE_DYNAMIC_ADDR(master->addrs[pos]),
933936 master->regs +
934937 DEV_ADDR_TABLE_LOC(master->datstartaddr, data->index));
935938
drivers/i3c/master/i3c-master-cdns.c+2−2
@@ -1556,8 +1556,8 @@ static int cdns_i3c_master_probe(struct platform_device *pdev) · 1555 unmodified lines
15561556 return PTR_ERR(master->pclk);
15571557
15581558 master->sysclk = devm_clk_get(&pdev->dev, "sysclk");
1559− if (IS_ERR(master->pclk))
1560− return PTR_ERR(master->pclk);
1559+ if (IS_ERR(master->sysclk))
1560+ return PTR_ERR(master->sysclk);
15611561
15621562 irq = platform_get_irq(pdev, 0);
15631563 if (irq < 0)
drivers/ide/ide-atapi.c+8−1
@@ -235,21 +235,28 @@ EXPORT_SYMBOL_GPL(ide_prep_sense); · 234 unmodified lines
235235
236236 int ide_queue_sense_rq(ide_drive_t *drive, void *special)
237237 {
238− struct request *sense_rq = drive->sense_rq;
238+ ide_hwif_t *hwif = drive->hwif;
239+ struct request *sense_rq;
240+ unsigned long flags;
241+
242+ spin_lock_irqsave(&hwif->lock, flags);
239243
240244 /* deferred failure from ide_prep_sense() */
241245 if (!drive->sense_rq_armed) {
242246 printk(KERN_WARNING PFX "%s: error queuing a sense request\n",
243247 drive->name);
248+ spin_unlock_irqrestore(&hwif->lock, flags);
244249 return -ENOMEM;
245250 }
246251
252+ sense_rq = drive->sense_rq;
247253 ide_req(sense_rq)->special = special;
248254 drive->sense_rq_armed = false;
249255
250256 drive->hwif->rq = NULL;
251257
252258 ide_insert_request_head(drive, sense_rq);
259+ spin_unlock_irqrestore(&hwif->lock, flags);
253260 return 0;
254261 }
255262 EXPORT_SYMBOL_GPL(ide_queue_sense_rq);
drivers/ide/ide-io.c+31−30
@@ -68,8 +68,10 @@ int ide_end_rq(ide_drive_t *drive, struct request *rq, blk_status_t error, · 67 unmodified lines
6868 }
6969
7070 if (!blk_update_request(rq, error, nr_bytes)) {
71− if (rq == drive->sense_rq)
71+ if (rq == drive->sense_rq) {
7272 drive->sense_rq = NULL;
73+ drive->sense_rq_active = false;
74+ }
7375
7476 __blk_mq_end_request(rq, error);
7577 return 0;
@@ -451,16 +453,11 @@ void ide_requeue_and_plug(ide_drive_t *drive, struct request *rq) · 375 unmodified lines
451453 blk_mq_delay_run_hw_queue(q->queue_hw_ctx[0], 3);
452454 }
453455
454−/*
455− * Issue a new request to a device.
456− */
457−blk_status_t ide_queue_rq(struct blk_mq_hw_ctx *hctx,
458− const struct blk_mq_queue_data *bd)
456+blk_status_t ide_issue_rq(ide_drive_t *drive, struct request *rq,
457+ bool local_requeue)
459458 {
460− ide_drive_t *drive = hctx->queue->queuedata;
461− ide_hwif_t *hwif = drive->hwif;
459+ ide_hwif_t *hwif = drive->hwif;
462460 struct ide_host *host = hwif->host;
463− struct request *rq = bd->rq;
464461 ide_startstop_t startstop;
465462
466463 if (!blk_rq_is_passthrough(rq) && !(rq->rq_flags & RQF_DONTPREP)) {
@@ -474,8 +471,6 @@ blk_status_t ide_queue_rq(struct blk_mq_hw_ctx *hctx, · 7 unmodified lines
474471 if (ide_lock_host(host, hwif))
475472 return BLK_STS_DEV_RESOURCE;
476473
477− blk_mq_start_request(rq);
478−
479474 spin_lock_irq(&hwif->lock);
480475
481476 if (!ide_lock_port(hwif)) {
@@ -510,18 +505,6 @@ repeat: · 28 unmodified lines
510505 hwif->cur_dev = drive;
511506 drive->dev_flags &= ~(IDE_DFLAG_SLEEPING | IDE_DFLAG_PARKED);
512507
513− /*
514− * we know that the queue isn't empty, but this can happen
515− * if ->prep_rq() decides to kill a request
516− */
517− if (!rq) {
518− rq = bd->rq;
519− if (!rq) {
520− ide_unlock_port(hwif);
521− goto out;
522− }
523− }
524−
525508 /*
526509 * Sanity: don't accept a request that isn't a PM request
527510 * if we are currently power managed. This is very important as
@@ -560,9 +543,12 @@ repeat: · 32 unmodified lines
560543 }
561544 } else {
562545 plug_device:
546+ if (local_requeue)
547+ list_add(&rq->queuelist, &drive->rq_list);
563548 spin_unlock_irq(&hwif->lock);
564549 ide_unlock_host(host);
565− ide_requeue_and_plug(drive, rq);
550+ if (!local_requeue)
551+ ide_requeue_and_plug(drive, rq);
566552 return BLK_STS_OK;
567553 }
568554
@@ -573,6 +559,26 @@ out: · 4 unmodified lines
573559 return BLK_STS_OK;
574560 }
575561
562+/*
563+ * Issue a new request to a device.
564+ */
565+blk_status_t ide_queue_rq(struct blk_mq_hw_ctx *hctx,
566+ const struct blk_mq_queue_data *bd)
567+{
568+ ide_drive_t *drive = hctx->queue->queuedata;
569+ ide_hwif_t *hwif = drive->hwif;
570+
571+ spin_lock_irq(&hwif->lock);
572+ if (drive->sense_rq_active) {
573+ spin_unlock_irq(&hwif->lock);
574+ return BLK_STS_DEV_RESOURCE;
575+ }
576+ spin_unlock_irq(&hwif->lock);
577+
578+ blk_mq_start_request(bd->rq);
579+ return ide_issue_rq(drive, bd->rq, false);
580+}
581+
576582 static int drive_is_ready(ide_drive_t *drive)
577583 {
578584 ide_hwif_t *hwif = drive->hwif;
@@ -893,13 +899,8 @@ EXPORT_SYMBOL_GPL(ide_pad_transfer); · 314 unmodified lines
893899
894900 void ide_insert_request_head(ide_drive_t *drive, struct request *rq)
895901 {
896− ide_hwif_t *hwif = drive->hwif;
897− unsigned long flags;
898−
899− spin_lock_irqsave(&hwif->lock, flags);
902+ drive->sense_rq_active = true;
900903 list_add_tail(&rq->queuelist, &drive->rq_list);
901− spin_unlock_irqrestore(&hwif->lock, flags);
902−
903904 kblockd_schedule_work(&drive->rq_work);
904905 }
905906 EXPORT_SYMBOL_GPL(ide_insert_request_head);
drivers/ide/ide-park.c+2−0
@@ -54,7 +54,9 @@ static void issue_park_cmd(ide_drive_t *drive, unsigned long timeout) · 53 unmodified lines
5454 scsi_req(rq)->cmd[0] = REQ_UNPARK_HEADS;
5555 scsi_req(rq)->cmd_len = 1;
5656 ide_req(rq)->type = ATA_PRIV_MISC;
57+ spin_lock_irq(&hwif->lock);
5758 ide_insert_request_head(drive, rq);
59+ spin_unlock_irq(&hwif->lock);
5860
5961 out:
6062 return;
drivers/ide/ide-probe.c+16−7
@@ -1159,18 +1159,27 @@ static void drive_rq_insert_work(struct work_struct *work) · 1158 unmodified lines
11591159 ide_drive_t *drive = container_of(work, ide_drive_t, rq_work);
11601160 ide_hwif_t *hwif = drive->hwif;
11611161 struct request *rq;
1162+ blk_status_t ret;
11621163 LIST_HEAD(list);
11631164
1164− spin_lock_irq(&hwif->lock);
1165− if (!list_empty(&drive->rq_list))
1166− list_splice_init(&drive->rq_list, &list);
1167− spin_unlock_irq(&hwif->lock);
1165+ blk_mq_quiesce_queue(drive->queue);
11681166
1169− while (!list_empty(&list)) {
1170− rq = list_first_entry(&list, struct request, queuelist);
1167+ ret = BLK_STS_OK;
1168+ spin_lock_irq(&hwif->lock);
1169+ while (!list_empty(&drive->rq_list)) {
1170+ rq = list_first_entry(&drive->rq_list, struct request, queuelist);
11711171 list_del_init(&rq->queuelist);
1172− blk_execute_rq_nowait(drive->queue, rq->rq_disk, rq, true, NULL);
1172+
1173+ spin_unlock_irq(&hwif->lock);
1174+ ret = ide_issue_rq(drive, rq, true);
1175+ spin_lock_irq(&hwif->lock);
11731176 }
1177+ spin_unlock_irq(&hwif->lock);
1178+
1179+ blk_mq_unquiesce_queue(drive->queue);
1180+
1181+ if (ret != BLK_STS_OK)
1182+ kblockd_schedule_work(&drive->rq_work);
11741183 }
11751184
11761185 static const u8 ide_hwif_to_major[] =
drivers/ide/ide-proc.c+1−1
@@ -544,7 +544,7 @@ void ide_proc_port_register_devices(ide_hwif_t *hwif) · 543 unmodified lines
544544 drive->proc = proc_mkdir(drive->name, parent);
545545 if (drive->proc) {
546546 ide_add_proc_entries(drive->proc, generic_drive_entries, drive);
547− proc_create_data("setting", S_IFREG|S_IRUSR|S_IWUSR,
547+ proc_create_data("settings", S_IFREG|S_IRUSR|S_IWUSR,
548548 drive->proc, &ide_settings_proc_fops,
549549 drive);
550550 }
drivers/iio/adc/ti_am335x_adc.c+4−1
@@ -142,7 +142,10 @@ static void tiadc_step_config(struct iio_dev *indio_dev) · 141 unmodified lines
142142 stepconfig |= STEPCONFIG_MODE_SWCNT;
143143
144144 tiadc_writel(adc_dev, REG_STEPCONFIG(steps),
145− stepconfig | STEPCONFIG_INP(chan));
145+ stepconfig | STEPCONFIG_INP(chan) |
146+ STEPCONFIG_INM_ADCREFM |
147+ STEPCONFIG_RFP_VREFP |
148+ STEPCONFIG_RFM_VREFN);
146149
147150 if (adc_dev->open_delay[i] > STEPDELAY_OPEN_MASK) {
148151 dev_warn(dev, "chan %d open delay truncating to 0x3FFFF\n",
drivers/infiniband/core/cma.c+4−1
@@ -494,7 +494,10 @@ static void _cma_attach_to_dev(struct rdma_id_private *id_priv, · 493 unmodified lines
494494 id_priv->id.route.addr.dev_addr.transport =
495495 rdma_node_get_transport(cma_dev->device->node_type);
496496 list_add_tail(&id_priv->list, &cma_dev->id_list);
497− rdma_restrack_kadd(&id_priv->res);
497+ if (id_priv->res.kern_name)
498+ rdma_restrack_kadd(&id_priv->res);
499+ else
500+ rdma_restrack_uadd(&id_priv->res);
498501 }
499502
500503 static void cma_attach_to_dev(struct rdma_id_private *id_priv,
drivers/infiniband/core/core_priv.h+0−1
@@ -267,7 +267,6 @@ static inline int ib_mad_enforce_security(struct ib_mad_agent_private *map, · 266 unmodified lines
267267 #endif
268268
269269 struct ib_device *ib_device_get_by_index(u32 ifindex);
270−void ib_device_put(struct ib_device *device);
271270 /* RDMA device netlink */
272271 void nldev_init(void);
273272 void nldev_exit(void);
drivers/infiniband/core/device.c+10−3
@@ -156,19 +156,26 @@ struct ib_device *ib_device_get_by_index(u32 index) · 155 unmodified lines
156156 down_read(&lists_rwsem);
157157 device = __ib_device_get_by_index(index);
158158 if (device) {
159− /* Do not return a device if unregistration has started. */
160− if (!refcount_inc_not_zero(&device->refcount))
159+ if (!ib_device_try_get(device))
161160 device = NULL;
162161 }
163162 up_read(&lists_rwsem);
164163 return device;
165164 }
166165
166+/**
167+ * ib_device_put - Release IB device reference
168+ * @device: device whose reference to be released
169+ *
170+ * ib_device_put() releases reference to the IB device to allow it to be
171+ * unregistered and eventually free.
172+ */
167173 void ib_device_put(struct ib_device *device)
168174 {
169175 if (refcount_dec_and_test(&device->refcount))
170176 complete(&device->unreg_completion);
171177 }
178+EXPORT_SYMBOL(ib_device_put);
172179
173180 static struct ib_device *__ib_device_get_by_name(const char *name)
174181 {
@@ -303,7 +310,6 @@ struct ib_device *ib_alloc_device(size_t size) · 128 unmodified lines
303310 rwlock_init(&device->client_data_lock);
304311 INIT_LIST_HEAD(&device->client_data_list);
305312 INIT_LIST_HEAD(&device->port_list);
306− refcount_set(&device->refcount, 1);
307313 init_completion(&device->unreg_completion);
308314
309315 return device;
@@ -620,6 +626,7 @@ int ib_register_device(struct ib_device *device, const char *name, · 310 unmodified lines
620626 goto cg_cleanup;
621627 }
622628
629+ refcount_set(&device->refcount, 1);
623630 device->reg_state = IB_DEV_REGISTERED;
624631
625632 list_for_each_entry(client, &client_list, list)
drivers/infiniband/core/nldev.c+0−4
@@ -584,10 +584,6 @@ static int fill_res_pd_entry(struct sk_buff *msg, struct netlink_callback *cb, · 583 unmodified lines
584584 if (nla_put_u64_64bit(msg, RDMA_NLDEV_ATTR_RES_USECNT,
585585 atomic_read(&pd->usecnt), RDMA_NLDEV_ATTR_PAD))
586586 goto err;
587− if ((pd->flags & IB_PD_UNSAFE_GLOBAL_RKEY) &&
588− nla_put_u32(msg, RDMA_NLDEV_ATTR_RES_UNSAFE_GLOBAL_RKEY,
589− pd->unsafe_global_rkey))
590− goto err;
591587
592588 if (fill_res_name_pid(msg, res))
593589 goto err;
drivers/infiniband/core/rdma_core.h+2−0
@@ -106,6 +106,8 @@ int uverbs_finalize_object(struct ib_uobject *uobj, · 105 unmodified lines
106106 enum uverbs_obj_access access,
107107 bool commit);
108108
109+int uverbs_output_written(const struct uverbs_attr_bundle *bundle, size_t idx);
110+
109111 void setup_ufile_idr_uobject(struct ib_uverbs_file *ufile);
110112 void release_ufile_idr_uobject(struct ib_uverbs_file *ufile);
111113
drivers/infiniband/core/umem_odp.c+3−0
@@ -352,6 +352,8 @@ struct ib_umem_odp *ib_alloc_odp_umem(struct ib_ucontext_per_mm *per_mm, · 351 unmodified lines
352352 umem->writable = 1;
353353 umem->is_odp = 1;
354354 odp_data->per_mm = per_mm;
355+ umem->owning_mm = per_mm->mm;
356+ mmgrab(umem->owning_mm);
355357
356358 mutex_init(&odp_data->umem_mutex);
357359 init_completion(&odp_data->notifier_completion);
@@ -384,6 +386,7 @@ struct ib_umem_odp *ib_alloc_odp_umem(struct ib_ucontext_per_mm *per_mm, · 26 unmodified lines
384386 out_page_list:
385387 vfree(odp_data->page_list);
386388 out_odp_data:
389+ mmdrop(umem->owning_mm);
387390 kfree(odp_data);
388391 return ERR_PTR(ret);
389392 }
drivers/infiniband/core/uverbs_cmd.c+10−1
@@ -60,6 +60,10 @@ static int uverbs_response(struct uverbs_attr_bundle *attrs, const void *resp, · 59 unmodified lines
6060 {
6161 int ret;
6262
63+ if (uverbs_attr_is_valid(attrs, UVERBS_ATTR_CORE_OUT))
64+ return uverbs_copy_to_struct_or_zero(
65+ attrs, UVERBS_ATTR_CORE_OUT, resp, resp_len);
66+
6367 if (copy_to_user(attrs->ucore.outbuf, resp,
6468 min(attrs->ucore.outlen, resp_len)))
6569 return -EFAULT;
@@ -1181,6 +1185,9 @@ static int ib_uverbs_poll_cq(struct uverbs_attr_bundle *attrs) · 1115 unmodified lines
11811185 goto out_put;
11821186 }
11831187
1188+ if (uverbs_attr_is_valid(attrs, UVERBS_ATTR_CORE_OUT))
1189+ ret = uverbs_output_written(attrs, UVERBS_ATTR_CORE_OUT);
1190+
11841191 ret = 0;
11851192
11861193 out_put:
@@ -2012,8 +2019,10 @@ static int ib_uverbs_post_send(struct uverbs_attr_bundle *attrs) · 825 unmodified lines
20122019 return -ENOMEM;
20132020
20142021 qp = uobj_get_obj_read(qp, UVERBS_OBJECT_QP, cmd.qp_handle, attrs);
2015− if (!qp)
2022+ if (!qp) {
2023+ ret = -EINVAL;
20162024 goto out;
2025+ }
20172026
20182027 is_ud = qp->qp_type == IB_QPT_UD;
20192028 sg_ind = 0;
drivers/infiniband/core/uverbs_ioctl.c+49−13
@@ -144,6 +144,21 @@ static bool uverbs_is_attr_cleared(const struct ib_uverbs_attr *uattr, · 143 unmodified lines
144144 0, uattr->len - len);
145145 }
146146
147+static int uverbs_set_output(const struct uverbs_attr_bundle *bundle,
148+ const struct uverbs_attr *attr)
149+{
150+ struct bundle_priv *pbundle =
151+ container_of(bundle, struct bundle_priv, bundle);
152+ u16 flags;
153+
154+ flags = pbundle->uattrs[attr->ptr_attr.uattr_idx].flags |
155+ UVERBS_ATTR_F_VALID_OUTPUT;
156+ if (put_user(flags,
157+ &pbundle->user_attrs[attr->ptr_attr.uattr_idx].flags))
158+ return -EFAULT;
159+ return 0;
160+}
161+
147162 static int uverbs_process_idrs_array(struct bundle_priv *pbundle,
148163 const struct uverbs_api_attr *attr_uapi,
149164 struct uverbs_objs_arr_attr *attr,
@@ -455,6 +470,19 @@ static int ib_uverbs_run_method(struct bundle_priv *pbundle, · 305 unmodified lines
455470 ret = handler(&pbundle->bundle);
456471 }
457472
473+ /*
474+ * Until the drivers are revised to use the bundle directly we have to
475+ * assume that the driver wrote to its UHW_OUT and flag userspace
476+ * appropriately.
477+ */
478+ if (!ret && pbundle->method_elm->has_udata) {
479+ const struct uverbs_attr *attr =
480+ uverbs_attr_get(&pbundle->bundle, UVERBS_ATTR_UHW_OUT);
481+
482+ if (!IS_ERR(attr))
483+ ret = uverbs_set_output(&pbundle->bundle, attr);
484+ }
485+
458486 /*
459487 * EPROTONOSUPPORT is ONLY to be returned if the ioctl framework can
460488 * not invoke the method because the request is not supported. No
@@ -706,10 +734,7 @@ void uverbs_fill_udata(struct uverbs_attr_bundle *bundle, · 245 unmodified lines
706734 int uverbs_copy_to(const struct uverbs_attr_bundle *bundle, size_t idx,
707735 const void *from, size_t size)
708736 {
709− struct bundle_priv *pbundle =
710− container_of(bundle, struct bundle_priv, bundle);
711737 const struct uverbs_attr *attr = uverbs_attr_get(bundle, idx);
712− u16 flags;
713738 size_t min_size;
714739
715740 if (IS_ERR(attr))
@@ -719,16 +744,25 @@ int uverbs_copy_to(const struct uverbs_attr_bundle *bundle, size_t idx, · 3 unmodified lines
719744 if (copy_to_user(u64_to_user_ptr(attr->ptr_attr.data), from, min_size))
720745 return -EFAULT;
721746
722− flags = pbundle->uattrs[attr->ptr_attr.uattr_idx].flags |
723− UVERBS_ATTR_F_VALID_OUTPUT;
724− if (put_user(flags,
725− &pbundle->user_attrs[attr->ptr_attr.uattr_idx].flags))
726− return -EFAULT;
727−
728− return 0;
747+ return uverbs_set_output(bundle, attr);
729748 }
730749 EXPORT_SYMBOL(uverbs_copy_to);
731750
751+
752+/*
753+ * This is only used if the caller has directly used copy_to_use to write the
754+ * data. It signals to user space that the buffer is filled in.
755+ */
756+int uverbs_output_written(const struct uverbs_attr_bundle *bundle, size_t idx)
757+{
758+ const struct uverbs_attr *attr = uverbs_attr_get(bundle, idx);
759+
760+ if (IS_ERR(attr))
761+ return PTR_ERR(attr);
762+
763+ return uverbs_set_output(bundle, attr);
764+}
765+
732766 int _uverbs_get_const(s64 *to, const struct uverbs_attr_bundle *attrs_bundle,
733767 size_t idx, s64 lower_bound, u64 upper_bound,
734768 s64 *def_val)
@@ -757,8 +791,10 @@ int uverbs_copy_to_struct_or_zero(const struct uverbs_attr_bundle *bundle, · 22 unmodified lines
757791 {
758792 const struct uverbs_attr *attr = uverbs_attr_get(bundle, idx);
759793
760− if (clear_user(u64_to_user_ptr(attr->ptr_attr.data),
761− attr->ptr_attr.len))
762− return -EFAULT;
794+ if (size < attr->ptr_attr.len) {
795+ if (clear_user(u64_to_user_ptr(attr->ptr_attr.data) + size,
796+ attr->ptr_attr.len - size))
797+ return -EFAULT;
798+ }
763799 return uverbs_copy_to(bundle, idx, from, size);
764800 }
drivers/infiniband/core/uverbs_main.c+17−9
@@ -204,6 +204,9 @@ void ib_uverbs_release_file(struct kref *ref) · 203 unmodified lines
204204 if (atomic_dec_and_test(&file->device->refcount))
205205 ib_uverbs_comp_dev(file->device);
206206
207+ if (file->async_file)
208+ kref_put(&file->async_file->ref,
209+ ib_uverbs_release_async_event_file);
207210 put_device(&file->device->dev);
208211 kfree(file);
209212 }
@@ -690,6 +693,7 @@ static ssize_t ib_uverbs_write(struct file *filp, const char __user *buf, · 480 unmodified lines
690693
691694 buf += sizeof(hdr);
692695
696+ memset(bundle.attr_present, 0, sizeof(bundle.attr_present));
693697 bundle.ufile = file;
694698 if (!method_elm->is_ex) {
695699 size_t in_len = hdr.in_words * 4 - sizeof(hdr);
@@ -963,11 +967,19 @@ void uverbs_user_mmap_disassociate(struct ib_uverbs_file *ufile) · 267 unmodified lines
963967
964968 /* Get an arbitrary mm pointer that hasn't been cleaned yet */
965969 mutex_lock(&ufile->umap_lock);
966− if (!list_empty(&ufile->umaps)) {
967− mm = list_first_entry(&ufile->umaps,
968− struct rdma_umap_priv, list)
969− ->vma->vm_mm;
970− mmget(mm);
970+ while (!list_empty(&ufile->umaps)) {
971+ int ret;
972+
973+ priv = list_first_entry(&ufile->umaps,
974+ struct rdma_umap_priv, list);
975+ mm = priv->vma->vm_mm;
976+ ret = mmget_not_zero(mm);
977+ if (!ret) {
978+ list_del_init(&priv->list);
979+ mm = NULL;
980+ continue;
981+ }
982+ break;
971983 }
972984 mutex_unlock(&ufile->umap_lock);
973985 if (!mm)
@@ -1095,10 +1107,6 @@ static int ib_uverbs_close(struct inode *inode, struct file *filp) · 121 unmodified lines
10951107 list_del_init(&file->list);
10961108 mutex_unlock(&file->device->lists_mutex);
10971109
1098− if (file->async_file)
1099− kref_put(&file->async_file->ref,
1100− ib_uverbs_release_async_event_file);
1101−
11021110 kref_put(&file->ref, ib_uverbs_release_file);
11031111
11041112 return 0;
drivers/infiniband/core/uverbs_std_types_device.c+7−1
@@ -168,12 +168,18 @@ void copy_port_attr_to_resp(struct ib_port_attr *attr, · 167 unmodified lines
168168 static int UVERBS_HANDLER(UVERBS_METHOD_QUERY_PORT)(
169169 struct uverbs_attr_bundle *attrs)
170170 {
171− struct ib_device *ib_dev = attrs->ufile->device->ib_dev;
171+ struct ib_device *ib_dev;
172172 struct ib_port_attr attr = {};
173173 struct ib_uverbs_query_port_resp_ex resp = {};
174+ struct ib_ucontext *ucontext;
174175 int ret;
175176 u8 port_num;
176177
178+ ucontext = ib_uverbs_get_ucontext(attrs);
179+ if (IS_ERR(ucontext))
180+ return PTR_ERR(ucontext);
181+ ib_dev = ucontext->device;
182+
177183 /* FIXME: Extend the UAPI_DEF_OBJ_NEEDS_FN stuff.. */
178184 if (!ib_dev->ops.query_port)
179185 return -EOPNOTSUPP;
drivers/infiniband/hw/hfi1/file_ops.c+1−1
@@ -488,7 +488,7 @@ static int hfi1_file_mmap(struct file *fp, struct vm_area_struct *vma) · 487 unmodified lines
488488 vmf = 1;
489489 break;
490490 case STATUS:
491− if (flags & (unsigned long)(VM_WRITE | VM_EXEC)) {
491+ if (flags & VM_WRITE) {
492492 ret = -EPERM;
493493 goto done;
494494 }
drivers/infiniband/hw/hfi1/ud.c+0−1
@@ -987,7 +987,6 @@ void hfi1_ud_rcv(struct hfi1_packet *packet) · 986 unmodified lines
987987 opcode == IB_OPCODE_UD_SEND_ONLY_WITH_IMMEDIATE) {
988988 wc.ex.imm_data = packet->ohdr->u.ud.imm_data;
989989 wc.wc_flags = IB_WC_WITH_IMM;
990− tlen -= sizeof(u32);
991990 } else if (opcode == IB_OPCODE_UD_SEND_ONLY) {
992991 wc.ex.imm_data = 0;
993992 wc.wc_flags = 0;
drivers/infiniband/hw/hns/hns_roce_srq.c+8−2
@@ -210,6 +210,7 @@ struct ib_srq *hns_roce_create_srq(struct ib_pd *pd, · 209 unmodified lines
210210 struct ib_udata *udata)
211211 {
212212 struct hns_roce_dev *hr_dev = to_hr_dev(pd->device);
213+ struct hns_roce_ib_create_srq_resp resp = {};
213214 struct hns_roce_srq *srq;
214215 int srq_desc_size;
215216 int srq_buf_size;
@@ -378,16 +379,21 @@ struct ib_srq *hns_roce_create_srq(struct ib_pd *pd, · 162 unmodified lines
378379
379380 srq->event = hns_roce_ib_srq_event;
380381 srq->ibsrq.ext.xrc.srq_num = srq->srqn;
382+ resp.srqn = srq->srqn;
381383
382384 if (udata) {
383− if (ib_copy_to_udata(udata, &srq->srqn, sizeof(__u32))) {
385+ if (ib_copy_to_udata(udata, &resp,
386+ min(udata->outlen, sizeof(resp)))) {
384387 ret = -EFAULT;
385− goto err_wrid;
388+ goto err_srqc_alloc;
386389 }
387390 }
388391
389392 return &srq->ibsrq;
390393
394+err_srqc_alloc:
395+ hns_roce_srq_free(hr_dev, srq);
396+
391397 err_wrid:
392398 kvfree(srq->wrid);
393399
drivers/infiniband/hw/mlx4/mad.c+3−3
@@ -1411,7 +1411,7 @@ int mlx4_ib_send_to_wire(struct mlx4_ib_dev *dev, int slave, u8 port, · 1410 unmodified lines
14111411
14121412 sqp_mad = (struct mlx4_mad_snd_buf *) (sqp->tx_ring[wire_tx_ix].buf.addr);
14131413 if (sqp->tx_ring[wire_tx_ix].ah)
1414− rdma_destroy_ah(sqp->tx_ring[wire_tx_ix].ah, 0);
1414+ mlx4_ib_destroy_ah(sqp->tx_ring[wire_tx_ix].ah, 0);
14151415 sqp->tx_ring[wire_tx_ix].ah = ah;
14161416 ib_dma_sync_single_for_cpu(&dev->ib_dev,
14171417 sqp->tx_ring[wire_tx_ix].buf.map,
@@ -1902,7 +1902,7 @@ static void mlx4_ib_sqp_comp_worker(struct work_struct *work) · 484 unmodified lines
19021902 if (wc.status == IB_WC_SUCCESS) {
19031903 switch (wc.opcode) {
19041904 case IB_WC_SEND:
1905− rdma_destroy_ah(sqp->tx_ring[wc.wr_id &
1905+ mlx4_ib_destroy_ah(sqp->tx_ring[wc.wr_id &
19061906 (MLX4_NUM_TUNNEL_BUFS - 1)].ah, 0);
19071907 sqp->tx_ring[wc.wr_id & (MLX4_NUM_TUNNEL_BUFS - 1)].ah
19081908 = NULL;
@@ -1931,7 +1931,7 @@ static void mlx4_ib_sqp_comp_worker(struct work_struct *work) · 22 unmodified lines
19311931 " status = %d, wrid = 0x%llx\n",
19321932 ctx->slave, wc.status, wc.wr_id);
19331933 if (!MLX4_TUN_IS_RECV(wc.wr_id)) {
1934− rdma_destroy_ah(sqp->tx_ring[wc.wr_id &
1934+ mlx4_ib_destroy_ah(sqp->tx_ring[wc.wr_id &
19351935 (MLX4_NUM_TUNNEL_BUFS - 1)].ah, 0);
19361936 sqp->tx_ring[wc.wr_id & (MLX4_NUM_TUNNEL_BUFS - 1)].ah
19371937 = NULL;
drivers/infiniband/hw/mlx5/flow.c+1−2
@@ -630,8 +630,7 @@ const struct uapi_definition mlx5_ib_flow_defs[] = { · 629 unmodified lines
630630 UAPI_DEF_IS_OBJ_SUPPORTED(flow_is_supported)),
631631 UAPI_DEF_CHAIN_OBJ_TREE(
632632 UVERBS_OBJECT_FLOW,
633− &mlx5_ib_fs,
634− UAPI_DEF_IS_OBJ_SUPPORTED(flow_is_supported)),
633+ &mlx5_ib_fs),
635634 UAPI_DEF_CHAIN_OBJ_TREE(UVERBS_OBJECT_FLOW_ACTION,
636635 &mlx5_ib_flow_actions),
637636 {},
drivers/infiniband/hw/mlx5/odp.c+5−5
@@ -1595,10 +1595,12 @@ static void mlx5_ib_prefetch_mr_work(struct work_struct *work) · 1594 unmodified lines
15951595 struct prefetch_mr_work *w =
15961596 container_of(work, struct prefetch_mr_work, work);
15971597
1598− if (w->dev->ib_dev.reg_state == IB_DEV_REGISTERED)
1598+ if (ib_device_try_get(&w->dev->ib_dev)) {
15991599 mlx5_ib_prefetch_sg_list(w->dev, w->pf_flags, w->sg_list,
16001600 w->num_sge);
1601−
1601+ ib_device_put(&w->dev->ib_dev);
1602+ }
1603+ put_device(&w->dev->ib_dev.dev);
16021604 kfree(w);
16031605 }
16041606
@@ -1617,15 +1619,13 @@ int mlx5_ib_advise_mr_prefetch(struct ib_pd *pd, · 12 unmodified lines
16171619 return mlx5_ib_prefetch_sg_list(dev, pf_flags, sg_list,
16181620 num_sge);
16191621
1620− if (dev->ib_dev.reg_state != IB_DEV_REGISTERED)
1621− return -ENODEV;
1622−
16231622 work = kvzalloc(struct_size(work, sg_list, num_sge), GFP_KERNEL);
16241623 if (!work)
16251624 return -ENOMEM;
16261625
16271626 memcpy(work->sg_list, sg_list, num_sge * sizeof(struct ib_sge));
16281627
1628+ get_device(&dev->ib_dev.dev);
16291629 work->dev = dev;
16301630 work->pf_flags = pf_flags;
16311631 work->num_sge = num_sge;
drivers/infiniband/hw/mlx5/qp.c+9−7
@@ -1912,14 +1912,16 @@ static int create_qp_common(struct mlx5_ib_dev *dev, struct ib_pd *pd, · 1911 unmodified lines
19121912 }
19131913
19141914 if (!check_flags_mask(ucmd.flags,
1915+ MLX5_QP_FLAG_ALLOW_SCATTER_CQE |
1916+ MLX5_QP_FLAG_BFREG_INDEX |
1917+ MLX5_QP_FLAG_PACKET_BASED_CREDIT_MODE |
1918+ MLX5_QP_FLAG_SCATTER_CQE |
19151919 MLX5_QP_FLAG_SIGNATURE |
1916− MLX5_QP_FLAG_SCATTER_CQE |
1917− MLX5_QP_FLAG_TUNNEL_OFFLOADS |
1918− MLX5_QP_FLAG_BFREG_INDEX |
1919− MLX5_QP_FLAG_TYPE_DCT |
1920− MLX5_QP_FLAG_TYPE_DCI |
1921− MLX5_QP_FLAG_ALLOW_SCATTER_CQE |
1922− MLX5_QP_FLAG_PACKET_BASED_CREDIT_MODE))
1920+ MLX5_QP_FLAG_TIR_ALLOW_SELF_LB_MC |
1921+ MLX5_QP_FLAG_TIR_ALLOW_SELF_LB_UC |
1922+ MLX5_QP_FLAG_TUNNEL_OFFLOADS |
1923+ MLX5_QP_FLAG_TYPE_DCI |
1924+ MLX5_QP_FLAG_TYPE_DCT))
19231925 return -EINVAL;
19241926
19251927 err = get_qp_user_index(to_mucontext(pd->uobject->context),
drivers/infiniband/hw/mthca/mthca_provider.c+2−2
@@ -534,7 +534,7 @@ static struct ib_qp *mthca_create_qp(struct ib_pd *pd, · 533 unmodified lines
534534 {
535535 struct mthca_ucontext *context;
536536
537− qp = kmalloc(sizeof *qp, GFP_KERNEL);
537+ qp = kzalloc(sizeof(*qp), GFP_KERNEL);
538538 if (!qp)
539539 return ERR_PTR(-ENOMEM);
540540
@@ -600,7 +600,7 @@ static struct ib_qp *mthca_create_qp(struct ib_pd *pd, · 59 unmodified lines
600600 if (udata)
601601 return ERR_PTR(-EINVAL);
602602
603− qp = kmalloc(sizeof (struct mthca_sqp), GFP_KERNEL);
603+ qp = kzalloc(sizeof(struct mthca_sqp), GFP_KERNEL);
604604 if (!qp)
605605 return ERR_PTR(-ENOMEM);
606606
drivers/infiniband/hw/qib/qib_ud.c+0−1
@@ -512,7 +512,6 @@ void qib_ud_rcv(struct qib_ibport *ibp, struct ib_header *hdr, · 511 unmodified lines
512512 opcode == IB_OPCODE_UD_SEND_ONLY_WITH_IMMEDIATE) {
513513 wc.ex.imm_data = ohdr->u.ud.imm_data;
514514 wc.wc_flags = IB_WC_WITH_IMM;
515− tlen -= sizeof(u32);
516515 } else if (opcode == IB_OPCODE_UD_SEND_ONLY) {
517516 wc.ex.imm_data = 0;
518517 wc.wc_flags = 0;
drivers/infiniband/hw/vmw_pvrdma/pvrdma.h+34−1
@@ -427,7 +427,40 @@ static inline enum ib_qp_state pvrdma_qp_state_to_ib(enum pvrdma_qp_state state) · 426 unmodified lines
427427
428428 static inline enum pvrdma_wr_opcode ib_wr_opcode_to_pvrdma(enum ib_wr_opcode op)
429429 {
430− return (enum pvrdma_wr_opcode)op;
430+ switch (op) {
431+ case IB_WR_RDMA_WRITE:
432+ return PVRDMA_WR_RDMA_WRITE;
433+ case IB_WR_RDMA_WRITE_WITH_IMM:
434+ return PVRDMA_WR_RDMA_WRITE_WITH_IMM;
435+ case IB_WR_SEND:
436+ return PVRDMA_WR_SEND;
437+ case IB_WR_SEND_WITH_IMM:
438+ return PVRDMA_WR_SEND_WITH_IMM;
439+ case IB_WR_RDMA_READ:
440+ return PVRDMA_WR_RDMA_READ;
441+ case IB_WR_ATOMIC_CMP_AND_SWP:
442+ return PVRDMA_WR_ATOMIC_CMP_AND_SWP;
443+ case IB_WR_ATOMIC_FETCH_AND_ADD:
444+ return PVRDMA_WR_ATOMIC_FETCH_AND_ADD;
445+ case IB_WR_LSO:
446+ return PVRDMA_WR_LSO;
447+ case IB_WR_SEND_WITH_INV:
448+ return PVRDMA_WR_SEND_WITH_INV;
449+ case IB_WR_RDMA_READ_WITH_INV:
450+ return PVRDMA_WR_RDMA_READ_WITH_INV;
451+ case IB_WR_LOCAL_INV:
452+ return PVRDMA_WR_LOCAL_INV;
453+ case IB_WR_REG_MR:
454+ return PVRDMA_WR_FAST_REG_MR;
455+ case IB_WR_MASKED_ATOMIC_CMP_AND_SWP:
456+ return PVRDMA_WR_MASKED_ATOMIC_CMP_AND_SWP;
457+ case IB_WR_MASKED_ATOMIC_FETCH_AND_ADD:
458+ return PVRDMA_WR_MASKED_ATOMIC_FETCH_AND_ADD;
459+ case IB_WR_REG_SIG_MR:
460+ return PVRDMA_WR_REG_SIG_MR;
461+ default:
462+ return PVRDMA_WR_ERROR;
463+ }
431464 }
432465
433466 static inline enum ib_wc_status pvrdma_wc_status_to_ib(
drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c+6−0
@@ -721,6 +721,12 @@ int pvrdma_post_send(struct ib_qp *ibqp, const struct ib_send_wr *wr, · 720 unmodified lines
721721 wr->opcode == IB_WR_RDMA_WRITE_WITH_IMM)
722722 wqe_hdr->ex.imm_data = wr->ex.imm_data;
723723
724+ if (unlikely(wqe_hdr->opcode == PVRDMA_WR_ERROR)) {
725+ *bad_wr = wr;
726+ ret = -EINVAL;
727+ goto out;
728+ }
729+
724730 switch (qp->ibqp.qp_type) {
725731 case IB_QPT_GSI:
726732 case IB_QPT_UD:
drivers/infiniband/sw/rdmavt/qp.c+6−1
@@ -2910,6 +2910,8 @@ send: · 2909 unmodified lines
29102910 goto op_err;
29112911 if (!ret)
29122912 goto rnr_nak;
2913+ if (wqe->length > qp->r_len)
2914+ goto inv_err;
29132915 break;
29142916
29152917 case IB_WR_RDMA_WRITE_WITH_IMM:
@@ -3078,7 +3080,10 @@ op_err: · 162 unmodified lines
30783080 goto err;
30793081
30803082 inv_err:
3081− send_status = IB_WC_REM_INV_REQ_ERR;
3083+ send_status =
3084+ sqp->ibqp.qp_type == IB_QPT_RC ?
3085+ IB_WC_REM_INV_REQ_ERR :
3086+ IB_WC_SUCCESS;
30823087 wc.status = IB_WC_LOC_QP_OP_ERR;
30833088 goto err;
30843089
drivers/infiniband/ulp/ipoib/ipoib.h+0−1
@@ -248,7 +248,6 @@ struct ipoib_cm_tx { · 247 unmodified lines
248248 struct list_head list;
249249 struct net_device *dev;
250250 struct ipoib_neigh *neigh;
251− struct ipoib_path *path;
252251 struct ipoib_tx_buf *tx_ring;
253252 unsigned int tx_head;
254253 unsigned int tx_tail;
drivers/infiniband/ulp/ipoib/ipoib_cm.c+1−2
@@ -1312,7 +1312,6 @@ struct ipoib_cm_tx *ipoib_cm_create_tx(struct net_device *dev, struct ipoib_path · 1311 unmodified lines
13121312
13131313 neigh->cm = tx;
13141314 tx->neigh = neigh;
1315− tx->path = path;
13161315 tx->dev = dev;
13171316 list_add(&tx->list, &priv->cm.start_list);
13181317 set_bit(IPOIB_FLAG_INITIALIZED, &tx->flags);
@@ -1371,7 +1370,7 @@ static void ipoib_cm_tx_start(struct work_struct *work) · 52 unmodified lines
13711370 neigh->daddr + QPN_AND_OPTIONS_OFFSET);
13721371 goto free_neigh;
13731372 }
1374− memcpy(&pathrec, &p->path->pathrec, sizeof(pathrec));
1373+ memcpy(&pathrec, &path->pathrec, sizeof(pathrec));
13751374
13761375 spin_unlock_irqrestore(&priv->lock, flags);
13771376 netif_tx_unlock_bh(dev);
drivers/input/joystick/xpad.c+3−0
@@ -252,6 +252,8 @@ static const struct xpad_device { · 251 unmodified lines
252252 { 0x0f30, 0x0202, "Joytech Advanced Controller", 0, XTYPE_XBOX },
253253 { 0x0f30, 0x8888, "BigBen XBMiniPad Controller", 0, XTYPE_XBOX },
254254 { 0x102c, 0xff0c, "Joytech Wireless Advanced Controller", 0, XTYPE_XBOX },
255+ { 0x1038, 0x1430, "SteelSeries Stratus Duo", 0, XTYPE_XBOX360 },
256+ { 0x1038, 0x1431, "SteelSeries Stratus Duo", 0, XTYPE_XBOX360 },
255257 { 0x11c9, 0x55f0, "Nacon GC-100XF", 0, XTYPE_XBOX360 },
256258 { 0x12ab, 0x0004, "Honey Bee Xbox360 dancepad", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360 },
257259 { 0x12ab, 0x0301, "PDP AFTERGLOW AX.1", 0, XTYPE_XBOX360 },
@@ -428,6 +430,7 @@ static const struct usb_device_id xpad_table[] = { · 170 unmodified lines
428430 XPAD_XBOXONE_VENDOR(0x0e6f), /* 0x0e6f X-Box One controllers */
429431 XPAD_XBOX360_VENDOR(0x0f0d), /* Hori Controllers */
430432 XPAD_XBOXONE_VENDOR(0x0f0d), /* Hori Controllers */
433+ XPAD_XBOX360_VENDOR(0x1038), /* SteelSeries Controllers */
431434 XPAD_XBOX360_VENDOR(0x11c9), /* Nacon GC100XF */
432435 XPAD_XBOX360_VENDOR(0x12ab), /* X-Box 360 dance pads */
433436 XPAD_XBOX360_VENDOR(0x1430), /* RedOctane X-Box 360 controllers */
drivers/input/misc/uinput.c+3−2
@@ -39,6 +39,7 @@ · 38 unmodified lines
3939 #include <linux/init.h>
4040 #include <linux/fs.h>
4141 #include <linux/miscdevice.h>
42+#include <linux/overflow.h>
4243 #include <linux/input/mt.h>
4344 #include "../input-compat.h"
4445
@@ -405,7 +406,7 @@ static int uinput_open(struct inode *inode, struct file *file) · 360 unmodified lines
405406 static int uinput_validate_absinfo(struct input_dev *dev, unsigned int code,
406407 const struct input_absinfo *abs)
407408 {
408− int min, max;
409+ int min, max, range;
409410
410411 min = abs->minimum;
411412 max = abs->maximum;
@@ -417,7 +418,7 @@ static int uinput_validate_absinfo(struct input_dev *dev, unsigned int code, · 5 unmodified lines
417418 return -EINVAL;
418419 }
419420
420− if (abs->flat > max - min) {
421+ if (!check_sub_overflow(max, min, &range) && abs->flat > range) {
421422 printk(KERN_DEBUG
422423 "%s: abs_flat #%02x out of range: %d (min:%d/max:%d)\n",
423424 UINPUT_NAME, code, abs->flat, min, max);
drivers/input/serio/olpc_apsp.c+2−15
@@ -23,7 +23,6 @@ · 22 unmodified lines
2323 #include <linux/of.h>
2424 #include <linux/slab.h>
2525 #include <linux/delay.h>
26−#include <linux/clk.h>
2726
2827 /*
2928 * The OLPC XO-1.75 and XO-4 laptops do not have a hardware PS/2 controller.
@@ -75,7 +74,6 @@ struct olpc_apsp { · 45 unmodified lines
7574 struct serio *kbio;
7675 struct serio *padio;
7776 void __iomem *base;
78− struct clk *clk;
7977 int open_count;
8078 int irq;
8179 };
@@ -148,17 +146,11 @@ static int olpc_apsp_open(struct serio *port) · 66 unmodified lines
148146 struct olpc_apsp *priv = port->port_data;
149147 unsigned int tmp;
150148 unsigned long l;
151− int error;
152149
153150 if (priv->open_count++ == 0) {
154− error = clk_prepare_enable(priv->clk);
155− if (error)
156− return error;
157−
158151 l = readl(priv->base + COMMAND_FIFO_STATUS);
159152 if (!(l & CMD_STS_MASK)) {
160153 dev_err(priv->dev, "SP cannot accept commands.\n");
161− clk_disable_unprepare(priv->clk);
162154 return -EIO;
163155 }
164156
@@ -179,8 +171,6 @@ static void olpc_apsp_close(struct serio *port) · 14 unmodified lines
179171 /* Disable interrupt 0 */
180172 tmp = readl(priv->base + PJ_INTERRUPT_MASK);
181173 writel(tmp | INT_0, priv->base + PJ_INTERRUPT_MASK);
182−
183− clk_disable_unprepare(priv->clk);
184174 }
185175 }
186176
@@ -195,6 +185,8 @@ static int olpc_apsp_probe(struct platform_device *pdev) · 8 unmodified lines
195185 if (!priv)
196186 return -ENOMEM;
197187
188+ priv->dev = &pdev->dev;
189+
198190 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
199191 priv->base = devm_ioremap_resource(&pdev->dev, res);
200192 if (IS_ERR(priv->base)) {
@@ -206,10 +198,6 @@ static int olpc_apsp_probe(struct platform_device *pdev) · 5 unmodified lines
206198 if (priv->irq < 0)
207199 return priv->irq;
208200
209− priv->clk = devm_clk_get(&pdev->dev, "sp");
210− if (IS_ERR(priv->clk))
211− return PTR_ERR(priv->clk);
212−
213201 /* KEYBOARD */
214202 kb_serio = kzalloc(sizeof(struct serio), GFP_KERNEL);
215203 if (!kb_serio)
@@ -248,7 +236,6 @@ static int olpc_apsp_probe(struct platform_device *pdev) · 32 unmodified lines
248236 goto err_irq;
249237 }
250238
251− priv->dev = &pdev->dev;
252239 device_init_wakeup(priv->dev, 1);
253240 platform_set_drvdata(pdev, priv);
254241
drivers/input/touchscreen/Kconfig+1−1
@@ -698,7 +698,7 @@ config TOUCHSCREEN_EDT_FT5X06 · 697 unmodified lines
698698
699699 config TOUCHSCREEN_RASPBERRYPI_FW
700700 tristate "Raspberry Pi's firmware base touch screen support"
701− depends on RASPBERRYPI_FIRMWARE || COMPILE_TEST
701+ depends on RASPBERRYPI_FIRMWARE || (RASPBERRYPI_FIRMWARE=n && COMPILE_TEST)
702702 help
703703 Say Y here if you have the official Raspberry Pi 7 inch screen on
704704 your system.
drivers/iommu/amd_iommu.c+13−6
@@ -1991,16 +1991,13 @@ static void do_attach(struct iommu_dev_data *dev_data, · 1990 unmodified lines
19911991
19921992 static void do_detach(struct iommu_dev_data *dev_data)
19931993 {
1994+ struct protection_domain *domain = dev_data->domain;
19941995 struct amd_iommu *iommu;
19951996 u16 alias;
19961997
19971998 iommu = amd_iommu_rlookup_table[dev_data->devid];
19981999 alias = dev_data->alias;
19992000
2000− /* decrease reference counters */
2001− dev_data->domain->dev_iommu[iommu->index] -= 1;
2002− dev_data->domain->dev_cnt -= 1;
2003−
20042001 /* Update data structures */
20052002 dev_data->domain = NULL;
20062003 list_del(&dev_data->list);
@@ -2010,6 +2007,16 @@ static void do_detach(struct iommu_dev_data *dev_data) · 3 unmodified lines
20102007
20112008 /* Flush the DTE entry */
20122009 device_flush_dte(dev_data);
2010+
2011+ /* Flush IOTLB */
2012+ domain_flush_tlb_pde(domain);
2013+
2014+ /* Wait for the flushes to finish */
2015+ domain_flush_complete(domain);
2016+
2017+ /* decrease reference counters - needs to happen after the flushes */
2018+ domain->dev_iommu[iommu->index] -= 1;
2019+ domain->dev_cnt -= 1;
20132020 }
20142021
20152022 /*
@@ -2617,13 +2624,13 @@ out_unmap: · 601 unmodified lines
26172624 bus_addr = address + s->dma_address + (j << PAGE_SHIFT);
26182625 iommu_unmap_page(domain, bus_addr, PAGE_SIZE);
26192626
2620− if (--mapped_pages)
2627+ if (--mapped_pages == 0)
26212628 goto out_free_iova;
26222629 }
26232630 }
26242631
26252632 out_free_iova:
2626− free_iova_fast(&dma_dom->iovad, address, npages);
2633+ free_iova_fast(&dma_dom->iovad, address >> PAGE_SHIFT, npages);
26272634
26282635 out_err:
26292636 return 0;
drivers/iommu/intel-iommu.c+1−1
@@ -5294,7 +5294,7 @@ static void intel_iommu_put_resv_regions(struct device *dev, · 5293 unmodified lines
52945294 struct iommu_resv_region *entry, *next;
52955295
52965296 list_for_each_entry_safe(entry, next, head, list) {
5297− if (entry->type == IOMMU_RESV_RESERVED)
5297+ if (entry->type == IOMMU_RESV_MSI)
52985298 kfree(entry);
52995299 }
53005300 }
drivers/iommu/mtk_iommu_v1.c+4−0
@@ -441,6 +441,10 @@ static int mtk_iommu_add_device(struct device *dev) · 440 unmodified lines
441441 iommu_spec.args_count = count;
442442
443443 mtk_iommu_create_mapping(dev, &iommu_spec);
444+
445+ /* dev->iommu_fwspec might have changed */
446+ fwspec = dev_iommu_fwspec_get(dev);
447+
444448 of_node_put(iommu_spec.np);
445449 }
446450
drivers/iommu/of_iommu.c+1−1
@@ -224,7 +224,7 @@ const struct iommu_ops *of_iommu_configure(struct device *dev, · 223 unmodified lines
224224 * If we have reason to believe the IOMMU driver missed the initial
225225 * probe for dev, replay it to get things in order.
226226 */
227− if (dev->bus && !device_iommu_mapped(dev))
227+ if (!err && dev->bus && !device_iommu_mapped(dev))
228228 err = iommu_probe_device(dev);
229229
230230 /* Ignore all other errors apart from EPROBE_DEFER */
drivers/irqchip/irq-gic-v3-its.c+13−12
@@ -2399,13 +2399,14 @@ static void its_free_device(struct its_device *its_dev) · 2398 unmodified lines
23992399 kfree(its_dev);
24002400 }
24012401
2402−static int its_alloc_device_irq(struct its_device *dev, irq_hw_number_t *hwirq)
2402+static int its_alloc_device_irq(struct its_device *dev, int nvecs, irq_hw_number_t *hwirq)
24032403 {
24042404 int idx;
24052405
2406− idx = find_first_zero_bit(dev->event_map.lpi_map,
2407− dev->event_map.nr_lpis);
2408− if (idx == dev->event_map.nr_lpis)
2406+ idx = bitmap_find_free_region(dev->event_map.lpi_map,
2407+ dev->event_map.nr_lpis,
2408+ get_count_order(nvecs));
2409+ if (idx < 0)
24092410 return -ENOSPC;
24102411
24112412 *hwirq = dev->event_map.lpi_base + idx;
@@ -2501,21 +2502,21 @@ static int its_irq_domain_alloc(struct irq_domain *domain, unsigned int virq, · 89 unmodified lines
25012502 int err;
25022503 int i;
25032504
2504− for (i = 0; i < nr_irqs; i++) {
2505− err = its_alloc_device_irq(its_dev, &hwirq);
2506− if (err)
2507− return err;
2505+ err = its_alloc_device_irq(its_dev, nr_irqs, &hwirq);
2506+ if (err)
2507+ return err;
25082508
2509− err = its_irq_gic_domain_alloc(domain, virq + i, hwirq);
2509+ for (i = 0; i < nr_irqs; i++) {
2510+ err = its_irq_gic_domain_alloc(domain, virq + i, hwirq + i);
25102511 if (err)
25112512 return err;
25122513
25132514 irq_domain_set_hwirq_and_chip(domain, virq + i,
2514− hwirq, &its_irq_chip, its_dev);
2515+ hwirq + i, &its_irq_chip, its_dev);
25152516 irqd_set_single_target(irq_desc_get_irq_data(irq_to_desc(virq + i)));
25162517 pr_debug("ID:%d pID:%d vID:%d\n",
2517− (int)(hwirq - its_dev->event_map.lpi_base),
2518− (int) hwirq, virq + i);
2518+ (int)(hwirq + i - its_dev->event_map.lpi_base),
2519+ (int)(hwirq + i), virq + i);
25192520 }
25202521
25212522 return 0;
drivers/irqchip/irq-gic-v3-mbi.c+1−1
@@ -24,7 +24,7 @@ struct mbi_range { · 23 unmodified lines
2424 unsigned long *bm;
2525 };
2626
27−static struct mutex mbi_lock;
27+static DEFINE_MUTEX(mbi_lock);
2828 static phys_addr_t mbi_phys_base;
2929 static struct mbi_range *mbi_ranges;
3030 static unsigned int mbi_range_nr;
drivers/irqchip/irq-madera.c+0−2
@@ -7,7 +7,6 @@ · 6 unmodified lines
77 */
88
99 #include <linux/module.h>
10−#include <linux/gpio.h>
1110 #include <linux/interrupt.h>
1211 #include <linux/irq.h>
1312 #include <linux/irqdomain.h>
@@ -16,7 +15,6 @@ · 2 unmodified lines
1615 #include <linux/slab.h>
1716 #include <linux/of.h>
1817 #include <linux/of_device.h>
19−#include <linux/of_gpio.h>
2018 #include <linux/of_irq.h>
2119 #include <linux/irqchip/irq-madera.h>
2220 #include <linux/mfd/madera/core.h>
drivers/irqchip/irq-stm32-exti.c+1−0
@@ -822,6 +822,7 @@ out_unmap: · 821 unmodified lines
822822 static const struct irq_domain_ops stm32_exti_h_domain_ops = {
823823 .alloc = stm32_exti_h_domain_alloc,
824824 .free = irq_domain_free_irqs_common,
825+ .xlate = irq_domain_xlate_twocell,
825826 };
826827
827828 static int
drivers/irqchip/irq-xtensa-mx.c+25−15
@@ -71,14 +71,17 @@ static void xtensa_mx_irq_mask(struct irq_data *d) · 70 unmodified lines
7171 unsigned int mask = 1u << d->hwirq;
7272
7373 if (mask & (XCHAL_INTTYPE_MASK_EXTERN_EDGE |
74− XCHAL_INTTYPE_MASK_EXTERN_LEVEL)) {
75− set_er(1u << (xtensa_get_ext_irq_no(d->hwirq) -
76− HW_IRQ_MX_BASE), MIENG);
77− } else {
78− mask = __this_cpu_read(cached_irq_mask) & ~mask;
79− __this_cpu_write(cached_irq_mask, mask);
80− xtensa_set_sr(mask, intenable);
74+ XCHAL_INTTYPE_MASK_EXTERN_LEVEL)) {
75+ unsigned int ext_irq = xtensa_get_ext_irq_no(d->hwirq);
76+
77+ if (ext_irq >= HW_IRQ_MX_BASE) {
78+ set_er(1u << (ext_irq - HW_IRQ_MX_BASE), MIENG);
79+ return;
80+ }
8181 }
82+ mask = __this_cpu_read(cached_irq_mask) & ~mask;
83+ __this_cpu_write(cached_irq_mask, mask);
84+ xtensa_set_sr(mask, intenable);
8285 }
8386
8487 static void xtensa_mx_irq_unmask(struct irq_data *d)
@@ -86,14 +89,17 @@ static void xtensa_mx_irq_unmask(struct irq_data *d) · 1 unmodified line
8689 unsigned int mask = 1u << d->hwirq;
8790
8891 if (mask & (XCHAL_INTTYPE_MASK_EXTERN_EDGE |
89− XCHAL_INTTYPE_MASK_EXTERN_LEVEL)) {
90− set_er(1u << (xtensa_get_ext_irq_no(d->hwirq) -
91− HW_IRQ_MX_BASE), MIENGSET);
92− } else {
93− mask |= __this_cpu_read(cached_irq_mask);
94− __this_cpu_write(cached_irq_mask, mask);
95− xtensa_set_sr(mask, intenable);
92+ XCHAL_INTTYPE_MASK_EXTERN_LEVEL)) {
93+ unsigned int ext_irq = xtensa_get_ext_irq_no(d->hwirq);
94+
95+ if (ext_irq >= HW_IRQ_MX_BASE) {
96+ set_er(1u << (ext_irq - HW_IRQ_MX_BASE), MIENGSET);
97+ return;
98+ }
9699 }
100+ mask |= __this_cpu_read(cached_irq_mask);
101+ __this_cpu_write(cached_irq_mask, mask);
102+ xtensa_set_sr(mask, intenable);
97103 }
98104
99105 static void xtensa_mx_irq_enable(struct irq_data *d)
@@ -113,7 +119,11 @@ static void xtensa_mx_irq_ack(struct irq_data *d) · 13 unmodified lines
113119
114120 static int xtensa_mx_irq_retrigger(struct irq_data *d)
115121 {
116− xtensa_set_sr(1 << d->hwirq, intset);
122+ unsigned int mask = 1u << d->hwirq;
123+
124+ if (WARN_ON(mask & ~XCHAL_INTTYPE_MASK_SOFTWARE))
125+ return 0;
126+ xtensa_set_sr(mask, intset);
117127 return 1;
118128 }
119129
drivers/irqchip/irq-xtensa-pic.c+5−1
@@ -70,7 +70,11 @@ static void xtensa_irq_ack(struct irq_data *d) · 69 unmodified lines
7070
7171 static int xtensa_irq_retrigger(struct irq_data *d)
7272 {
73− xtensa_set_sr(1 << d->hwirq, intset);
73+ unsigned int mask = 1u << d->hwirq;
74+
75+ if (WARN_ON(mask & ~XCHAL_INTTYPE_MASK_SOFTWARE))
76+ return 0;
77+ xtensa_set_sr(mask, intset);
7478 return 1;
7579 }
7680
drivers/isdn/hardware/avm/b1.c+1−1
@@ -423,7 +423,7 @@ void b1_parse_version(avmctrl_info *cinfo) · 422 unmodified lines
423423 int i, j;
424424
425425 for (j = 0; j < AVM_MAXVERSION; j++)
426− cinfo->version[j] = "\0\0" + 1;
426+ cinfo->version[j] = "";
427427 for (i = 0, j = 0;
428428 j < AVM_MAXVERSION && i < cinfo->versionlen;
429429 j++, i += cinfo->versionbuf[i] + 1)
drivers/isdn/hardware/mISDN/hfcsusb.c+1−2
@@ -262,8 +262,7 @@ hfcsusb_ph_info(struct hfcsusb *hw) · 261 unmodified lines
262262 struct dchannel *dch = &hw->dch;
263263 int i;
264264
265− phi = kzalloc(sizeof(struct ph_info) +
266− dch->dev.nrbchan * sizeof(struct ph_info_ch), GFP_ATOMIC);
265+ phi = kzalloc(struct_size(phi, bch, dch->dev.nrbchan), GFP_ATOMIC);
267266 phi->dch.ch.protocol = hw->protocol;
268267 phi->dch.ch.Flags = dch->Flags;
269268 phi->dch.state = dch->state;
drivers/isdn/i4l/isdn_tty.c+5−1
@@ -1437,15 +1437,19 @@ isdn_tty_set_termios(struct tty_struct *tty, struct ktermios *old_termios) · 1436 unmodified lines
14371437 {
14381438 modem_info *info = (modem_info *) tty->driver_data;
14391439
1440+ mutex_lock(&modem_info_mutex);
14401441 if (!old_termios)
14411442 isdn_tty_change_speed(info);
14421443 else {
14431444 if (tty->termios.c_cflag == old_termios->c_cflag &&
14441445 tty->termios.c_ispeed == old_termios->c_ispeed &&
1445− tty->termios.c_ospeed == old_termios->c_ospeed)
1446+ tty->termios.c_ospeed == old_termios->c_ospeed) {
1447+ mutex_unlock(&modem_info_mutex);
14461448 return;
1449+ }
14471450 isdn_tty_change_speed(info);
14481451 }
1452+ mutex_unlock(&modem_info_mutex);
14491453 }
14501454
14511455 /*
drivers/leds/leds-lp5523.c+3−1
@@ -318,7 +318,9 @@ static int lp5523_init_program_engine(struct lp55xx_chip *chip) · 317 unmodified lines
318318
319319 /* Let the programs run for couple of ms and check the engine status */
320320 usleep_range(3000, 6000);
321− lp55xx_read(chip, LP5523_REG_STATUS, &status);
321+ ret = lp55xx_read(chip, LP5523_REG_STATUS, &status);
322+ if (ret)
323+ return ret;
322324 status &= LP5523_ENG_STATUS_MASK;
323325
324326 if (status != LP5523_ENG_STATUS_MASK) {
drivers/md/dm-crypt.c+17−8
@@ -2414,9 +2414,21 @@ static int crypt_ctr_cipher_new(struct dm_target *ti, char *cipher_in, char *key · 2413 unmodified lines
24142414 * capi:cipher_api_spec-iv:ivopts
24152415 */
24162416 tmp = &cipher_in[strlen("capi:")];
2417− cipher_api = strsep(&tmp, "-");
2418− *ivmode = strsep(&tmp, ":");
2419− *ivopts = tmp;
2417+
2418+ /* Separate IV options if present, it can contain another '-' in hash name */
2419+ *ivopts = strrchr(tmp, ':');
2420+ if (*ivopts) {
2421+ **ivopts = '\0';
2422+ (*ivopts)++;
2423+ }
2424+ /* Parse IV mode */
2425+ *ivmode = strrchr(tmp, '-');
2426+ if (*ivmode) {
2427+ **ivmode = '\0';
2428+ (*ivmode)++;
2429+ }
2430+ /* The rest is crypto API spec */
2431+ cipher_api = tmp;
24202432
24212433 if (*ivmode && !strcmp(*ivmode, "lmk"))
24222434 cc->tfms_count = 64;
@@ -2486,11 +2498,8 @@ static int crypt_ctr_cipher_old(struct dm_target *ti, char *cipher_in, char *key · 63 unmodified lines
24862498 goto bad_mem;
24872499
24882500 chainmode = strsep(&tmp, "-");
2489− *ivopts = strsep(&tmp, "-");
2490− *ivmode = strsep(&*ivopts, ":");
2491−
2492− if (tmp)
2493− DMWARN("Ignoring unexpected additional cipher options");
2501+ *ivmode = strsep(&tmp, ":");
2502+ *ivopts = tmp;
24942503
24952504 /*
24962505 * For compatibility with the original dm-crypt mapping format, if
drivers/md/dm-rq.c+1−1
@@ -131,7 +131,7 @@ static void rq_end_stats(struct mapped_device *md, struct request *orig) · 130 unmodified lines
131131 static void rq_completed(struct mapped_device *md)
132132 {
133133 /* nudge anyone waiting on suspend queue */
134− if (unlikely(waitqueue_active(&md->wait)))
134+ if (unlikely(wq_has_sleeper(&md->wait)))
135135 wake_up(&md->wait);
136136
137137 /*
drivers/md/dm-thin-metadata.c+2−2
@@ -1678,7 +1678,7 @@ int dm_thin_remove_range(struct dm_thin_device *td, · 1677 unmodified lines
16781678 return r;
16791679 }
16801680
1681−int dm_pool_block_is_used(struct dm_pool_metadata *pmd, dm_block_t b, bool *result)
1681+int dm_pool_block_is_shared(struct dm_pool_metadata *pmd, dm_block_t b, bool *result)
16821682 {
16831683 int r;
16841684 uint32_t ref_count;
@@ -1686,7 +1686,7 @@ int dm_pool_block_is_used(struct dm_pool_metadata *pmd, dm_block_t b, bool *resu · 1 unmodified line
16861686 down_read(&pmd->root_lock);
16871687 r = dm_sm_get_count(pmd->data_sm, b, &ref_count);
16881688 if (!r)
1689− *result = (ref_count != 0);
1689+ *result = (ref_count > 1);
16901690 up_read(&pmd->root_lock);
16911691
16921692 return r;
drivers/md/dm-thin-metadata.h+1−1
@@ -195,7 +195,7 @@ int dm_pool_get_metadata_dev_size(struct dm_pool_metadata *pmd, · 194 unmodified lines
195195
196196 int dm_pool_get_data_dev_size(struct dm_pool_metadata *pmd, dm_block_t *result);
197197
198−int dm_pool_block_is_used(struct dm_pool_metadata *pmd, dm_block_t b, bool *result);
198+int dm_pool_block_is_shared(struct dm_pool_metadata *pmd, dm_block_t b, bool *result);
199199
200200 int dm_pool_inc_data_range(struct dm_pool_metadata *pmd, dm_block_t b, dm_block_t e);
201201 int dm_pool_dec_data_range(struct dm_pool_metadata *pmd, dm_block_t b, dm_block_t e);
drivers/md/dm-thin.c+5−5
@@ -1048,7 +1048,7 @@ static void passdown_double_checking_shared_status(struct dm_thin_new_mapping *m · 1047 unmodified lines
10481048 * passdown we have to check that these blocks are now unused.
10491049 */
10501050 int r = 0;
1051− bool used = true;
1051+ bool shared = true;
10521052 struct thin_c *tc = m->tc;
10531053 struct pool *pool = tc->pool;
10541054 dm_block_t b = m->data_block, e, end = m->data_block + m->virt_end - m->virt_begin;
@@ -1058,11 +1058,11 @@ static void passdown_double_checking_shared_status(struct dm_thin_new_mapping *m · 3 unmodified lines
10581058 while (b != end) {
10591059 /* find start of unmapped run */
10601060 for (; b < end; b++) {
1061− r = dm_pool_block_is_used(pool->pmd, b, &used);
1061+ r = dm_pool_block_is_shared(pool->pmd, b, &shared);
10621062 if (r)
10631063 goto out;
10641064
1065− if (!used)
1065+ if (!shared)
10661066 break;
10671067 }
10681068
@@ -1071,11 +1071,11 @@ static void passdown_double_checking_shared_status(struct dm_thin_new_mapping *m · 2 unmodified lines
10711071
10721072 /* find end of run */
10731073 for (e = b + 1; e != end; e++) {
1074− r = dm_pool_block_is_used(pool->pmd, e, &used);
1074+ r = dm_pool_block_is_shared(pool->pmd, e, &shared);
10751075 if (r)
10761076 goto out;
10771077
1078− if (used)
1078+ if (shared)
10791079 break;
10801080 }
10811081
drivers/md/dm.c+32−9
@@ -699,7 +699,7 @@ static void end_io_acct(struct dm_io *io) · 698 unmodified lines
699699 true, duration, &io->stats_aux);
700700
701701 /* nudge anyone waiting on suspend queue */
702− if (unlikely(waitqueue_active(&md->wait)))
702+ if (unlikely(wq_has_sleeper(&md->wait)))
703703 wake_up(&md->wait);
704704 }
705705
@@ -1320,7 +1320,7 @@ static int clone_bio(struct dm_target_io *tio, struct bio *bio, · 614 unmodified lines
13201320
13211321 __bio_clone_fast(clone, bio);
13221322
1323− if (unlikely(bio_integrity(bio) != NULL)) {
1323+ if (bio_integrity(bio)) {
13241324 int r;
13251325
13261326 if (unlikely(!dm_target_has_integrity(tio->ti->type) &&
@@ -1339,7 +1339,7 @@ static int clone_bio(struct dm_target_io *tio, struct bio *bio, · 12 unmodified lines
13391339 bio_advance(clone, to_bytes(sector - clone->bi_iter.bi_sector));
13401340 clone->bi_iter.bi_size = to_bytes(len);
13411341
1342− if (unlikely(bio_integrity(bio) != NULL))
1342+ if (bio_integrity(bio))
13431343 bio_integrity_trim(clone);
13441344
13451345 return 0;
@@ -1588,6 +1588,9 @@ static void init_clone_info(struct clone_info *ci, struct mapped_device *md, · 242 unmodified lines
15881588 ci->sector = bio->bi_iter.bi_sector;
15891589 }
15901590
1591+#define __dm_part_stat_sub(part, field, subnd) \
1592+ (part_stat_get(part, field) -= (subnd))
1593+
15911594 /*
15921595 * Entry point to split a bio into clones and submit them to the targets.
15931596 */
@@ -1642,7 +1645,21 @@ static blk_qc_t __split_and_process_bio(struct mapped_device *md, · 48 unmodified lines
16421645 struct bio *b = bio_split(bio, bio_sectors(bio) - ci.sector_count,
16431646 GFP_NOIO, &md->queue->bio_split);
16441647 ci.io->orig_bio = b;
1648+
1649+ /*
1650+ * Adjust IO stats for each split, otherwise upon queue
1651+ * reentry there will be redundant IO accounting.
1652+ * NOTE: this is a stop-gap fix, a proper fix involves
1653+ * significant refactoring of DM core's bio splitting
1654+ * (by eliminating DM's splitting and just using bio_split)
1655+ */
1656+ part_stat_lock();
1657+ __dm_part_stat_sub(&dm_disk(md)->part0,
1658+ sectors[op_stat_group(bio_op(bio))], ci.sector_count);
1659+ part_stat_unlock();
1660+
16451661 bio_chain(b, bio);
1662+ trace_block_split(md->queue, b, bio->bi_iter.bi_sector);
16461663 ret = generic_make_request(bio);
16471664 break;
16481665 }
@@ -1713,6 +1730,15 @@ out: · 64 unmodified lines
17131730 return ret;
17141731 }
17151732
1733+static blk_qc_t dm_process_bio(struct mapped_device *md,
1734+ struct dm_table *map, struct bio *bio)
1735+{
1736+ if (dm_get_md_type(md) == DM_TYPE_NVME_BIO_BASED)
1737+ return __process_bio(md, map, bio);
1738+ else
1739+ return __split_and_process_bio(md, map, bio);
1740+}
1741+
17161742 static blk_qc_t dm_make_request(struct request_queue *q, struct bio *bio)
17171743 {
17181744 struct mapped_device *md = q->queuedata;
@@ -1733,10 +1759,7 @@ static blk_qc_t dm_make_request(struct request_queue *q, struct bio *bio) · 14 unmodified lines
17331759 return ret;
17341760 }
17351761
1736− if (dm_get_md_type(md) == DM_TYPE_NVME_BIO_BASED)
1737− ret = __process_bio(md, map, bio);
1738− else
1739− ret = __split_and_process_bio(md, map, bio);
1762+ ret = dm_process_bio(md, map, bio);
17401763
17411764 dm_put_live_table(md, srcu_idx);
17421765 return ret;
@@ -2415,9 +2438,9 @@ static void dm_wq_work(struct work_struct *work) · 672 unmodified lines
24152438 break;
24162439
24172440 if (dm_request_based(md))
2418− generic_make_request(c);
2441+ (void) generic_make_request(c);
24192442 else
2420− __split_and_process_bio(md, map, c);
2443+ (void) dm_process_bio(md, map, c);
24212444 }
24222445
24232446 dm_put_live_table(md, srcu_idx);
drivers/md/md.c+1−6
@@ -207,15 +207,10 @@ static bool create_on_open = true; · 206 unmodified lines
207207 struct bio *bio_alloc_mddev(gfp_t gfp_mask, int nr_iovecs,
208208 struct mddev *mddev)
209209 {
210− struct bio *b;
211−
212210 if (!mddev || !bioset_initialized(&mddev->bio_set))
213211 return bio_alloc(gfp_mask, nr_iovecs);
214212
215− b = bio_alloc_bioset(gfp_mask, nr_iovecs, &mddev->bio_set);
216− if (!b)
217− return NULL;
218− return b;
213+ return bio_alloc_bioset(gfp_mask, nr_iovecs, &mddev->bio_set);
219214 }
220215 EXPORT_SYMBOL_GPL(bio_alloc_mddev);
221216
drivers/md/raid5-cache.c+22−11
@@ -1935,12 +1935,14 @@ out: · 1934 unmodified lines
19351935 }
19361936
19371937 static struct stripe_head *
1938−r5c_recovery_alloc_stripe(struct r5conf *conf,
1939− sector_t stripe_sect)
1938+r5c_recovery_alloc_stripe(
1939+ struct r5conf *conf,
1940+ sector_t stripe_sect,
1941+ int noblock)
19401942 {
19411943 struct stripe_head *sh;
19421944
1943− sh = raid5_get_active_stripe(conf, stripe_sect, 0, 1, 0);
1945+ sh = raid5_get_active_stripe(conf, stripe_sect, 0, noblock, 0);
19441946 if (!sh)
19451947 return NULL; /* no more stripe available */
19461948
@@ -2150,7 +2152,7 @@ r5c_recovery_analyze_meta_block(struct r5l_log *log, · 203 unmodified lines
21502152 stripe_sect);
21512153
21522154 if (!sh) {
2153− sh = r5c_recovery_alloc_stripe(conf, stripe_sect);
2155+ sh = r5c_recovery_alloc_stripe(conf, stripe_sect, 1);
21542156 /*
21552157 * cannot get stripe from raid5_get_active_stripe
21562158 * try replay some stripes
@@ -2159,20 +2161,29 @@ r5c_recovery_analyze_meta_block(struct r5l_log *log, · 2 unmodified lines
21592161 r5c_recovery_replay_stripes(
21602162 cached_stripe_list, ctx);
21612163 sh = r5c_recovery_alloc_stripe(
2162− conf, stripe_sect);
2164+ conf, stripe_sect, 1);
21632165 }
21642166 if (!sh) {
2167+ int new_size = conf->min_nr_stripes * 2;
21652168 pr_debug("md/raid:%s: Increasing stripe cache size to %d to recovery data on journal.\n",
21662169 mdname(mddev),
2167− conf->min_nr_stripes * 2);
2168− raid5_set_cache_size(mddev,
2169− conf->min_nr_stripes * 2);
2170− sh = r5c_recovery_alloc_stripe(conf,
2171− stripe_sect);
2170+ new_size);
2171+ ret = raid5_set_cache_size(mddev, new_size);
2172+ if (conf->min_nr_stripes <= new_size / 2) {
2173+ pr_err("md/raid:%s: Cannot increase cache size, ret=%d, new_size=%d, min_nr_stripes=%d, max_nr_stripes=%d\n",
2174+ mdname(mddev),
2175+ ret,
2176+ new_size,
2177+ conf->min_nr_stripes,
2178+ conf->max_nr_stripes);
2179+ return -ENOMEM;
2180+ }
2181+ sh = r5c_recovery_alloc_stripe(
2182+ conf, stripe_sect, 0);
21722183 }
21732184 if (!sh) {
21742185 pr_err("md/raid:%s: Cannot get enough stripes due to memory pressure. Recovery failed.\n",
2175− mdname(mddev));
2186+ mdname(mddev));
21762187 return -ENOMEM;
21772188 }
21782189 list_add_tail(&sh->lru, cached_stripe_list);
drivers/md/raid5.c+6−2
@@ -6369,6 +6369,7 @@ raid5_show_stripe_cache_size(struct mddev *mddev, char *page) · 6368 unmodified lines
63696369 int
63706370 raid5_set_cache_size(struct mddev *mddev, int size)
63716371 {
6372+ int result = 0;
63726373 struct r5conf *conf = mddev->private;
63736374
63746375 if (size <= 16 || size > 32768)
@@ -6385,11 +6386,14 @@ raid5_set_cache_size(struct mddev *mddev, int size) · 10 unmodified lines
63856386
63866387 mutex_lock(&conf->cache_size_mutex);
63876388 while (size > conf->max_nr_stripes)
6388− if (!grow_one_stripe(conf, GFP_KERNEL))
6389+ if (!grow_one_stripe(conf, GFP_KERNEL)) {
6390+ conf->min_nr_stripes = conf->max_nr_stripes;
6391+ result = -ENOMEM;
63896392 break;
6393+ }
63906394 mutex_unlock(&conf->cache_size_mutex);
63916395
6392− return 0;
6396+ return result;
63936397 }
63946398 EXPORT_SYMBOL(raid5_set_cache_size);
63956399
drivers/media/platform/vim2m.c+3−1
@@ -807,7 +807,9 @@ static void vim2m_stop_streaming(struct vb2_queue *q) · 806 unmodified lines
807807 struct vb2_v4l2_buffer *vbuf;
808808 unsigned long flags;
809809
810− cancel_delayed_work_sync(&dev->work_run);
810+ if (v4l2_m2m_get_curr_priv(dev->m2m_dev) == ctx)
811+ cancel_delayed_work_sync(&dev->work_run);
812+
811813 for (;;) {
812814 if (V4L2_TYPE_IS_OUTPUT(q->type))
813815 vbuf = v4l2_m2m_src_buf_remove(ctx->fh.m2m_ctx);
drivers/media/v4l2-core/v4l2-ioctl.c+19−5
@@ -287,6 +287,7 @@ static void v4l_print_format(const void *arg, bool write_only) · 286 unmodified lines
287287 const struct v4l2_window *win;
288288 const struct v4l2_sdr_format *sdr;
289289 const struct v4l2_meta_format *meta;
290+ u32 planes;
290291 unsigned i;
291292
292293 pr_cont("type=%s", prt_names(p->type, v4l2_type_names));
@@ -317,7 +318,8 @@ static void v4l_print_format(const void *arg, bool write_only) · 24 unmodified lines
317318 prt_names(mp->field, v4l2_field_names),
318319 mp->colorspace, mp->num_planes, mp->flags,
319320 mp->ycbcr_enc, mp->quantization, mp->xfer_func);
320− for (i = 0; i < mp->num_planes; i++)
321+ planes = min_t(u32, mp->num_planes, VIDEO_MAX_PLANES);
322+ for (i = 0; i < planes; i++)
321323 printk(KERN_DEBUG "plane %u: bytesperline=%u sizeimage=%u\n", i,
322324 mp->plane_fmt[i].bytesperline,
323325 mp->plane_fmt[i].sizeimage);
@@ -1551,8 +1553,11 @@ static int v4l_s_fmt(const struct v4l2_ioctl_ops *ops, · 1227 unmodified lines
15511553 if (unlikely(!ops->vidioc_s_fmt_vid_cap_mplane))
15521554 break;
15531555 CLEAR_AFTER_FIELD(p, fmt.pix_mp.xfer_func);
1556+ if (p->fmt.pix_mp.num_planes > VIDEO_MAX_PLANES)
1557+ break;
15541558 for (i = 0; i < p->fmt.pix_mp.num_planes; i++)
1555− CLEAR_AFTER_FIELD(p, fmt.pix_mp.plane_fmt[i].bytesperline);
1559+ CLEAR_AFTER_FIELD(&p->fmt.pix_mp.plane_fmt[i],
1560+ bytesperline);
15561561 return ops->vidioc_s_fmt_vid_cap_mplane(file, fh, arg);
15571562 case V4L2_BUF_TYPE_VIDEO_OVERLAY:
15581563 if (unlikely(!ops->vidioc_s_fmt_vid_overlay))
@@ -1581,8 +1586,11 @@ static int v4l_s_fmt(const struct v4l2_ioctl_ops *ops, · 22 unmodified lines
15811586 if (unlikely(!ops->vidioc_s_fmt_vid_out_mplane))
15821587 break;
15831588 CLEAR_AFTER_FIELD(p, fmt.pix_mp.xfer_func);
1589+ if (p->fmt.pix_mp.num_planes > VIDEO_MAX_PLANES)
1590+ break;
15841591 for (i = 0; i < p->fmt.pix_mp.num_planes; i++)
1585− CLEAR_AFTER_FIELD(p, fmt.pix_mp.plane_fmt[i].bytesperline);
1592+ CLEAR_AFTER_FIELD(&p->fmt.pix_mp.plane_fmt[i],
1593+ bytesperline);
15861594 return ops->vidioc_s_fmt_vid_out_mplane(file, fh, arg);
15871595 case V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY:
15881596 if (unlikely(!ops->vidioc_s_fmt_vid_out_overlay))
@@ -1648,8 +1656,11 @@ static int v4l_try_fmt(const struct v4l2_ioctl_ops *ops, · 59 unmodified lines
16481656 if (unlikely(!ops->vidioc_try_fmt_vid_cap_mplane))
16491657 break;
16501658 CLEAR_AFTER_FIELD(p, fmt.pix_mp.xfer_func);
1659+ if (p->fmt.pix_mp.num_planes > VIDEO_MAX_PLANES)
1660+ break;
16511661 for (i = 0; i < p->fmt.pix_mp.num_planes; i++)
1652− CLEAR_AFTER_FIELD(p, fmt.pix_mp.plane_fmt[i].bytesperline);
1662+ CLEAR_AFTER_FIELD(&p->fmt.pix_mp.plane_fmt[i],
1663+ bytesperline);
16531664 return ops->vidioc_try_fmt_vid_cap_mplane(file, fh, arg);
16541665 case V4L2_BUF_TYPE_VIDEO_OVERLAY:
16551666 if (unlikely(!ops->vidioc_try_fmt_vid_overlay))
@@ -1678,8 +1689,11 @@ static int v4l_try_fmt(const struct v4l2_ioctl_ops *ops, · 22 unmodified lines
16781689 if (unlikely(!ops->vidioc_try_fmt_vid_out_mplane))
16791690 break;
16801691 CLEAR_AFTER_FIELD(p, fmt.pix_mp.xfer_func);
1692+ if (p->fmt.pix_mp.num_planes > VIDEO_MAX_PLANES)
1693+ break;
16811694 for (i = 0; i < p->fmt.pix_mp.num_planes; i++)
1682− CLEAR_AFTER_FIELD(p, fmt.pix_mp.plane_fmt[i].bytesperline);
1695+ CLEAR_AFTER_FIELD(&p->fmt.pix_mp.plane_fmt[i],
1696+ bytesperline);
16831697 return ops->vidioc_try_fmt_vid_out_mplane(file, fh, arg);
16841698 case V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY:
16851699 if (unlikely(!ops->vidioc_try_fmt_vid_out_overlay))
drivers/mfd/Kconfig+2−1
@@ -102,6 +102,7 @@ config MFD_AAT2870_CORE · 101 unmodified lines
102102 config MFD_AT91_USART
103103 tristate "AT91 USART Driver"
104104 select MFD_CORE
105+ depends on ARCH_AT91 || COMPILE_TEST
105106 help
106107 Select this to get support for AT91 USART IP. This is a wrapper
107108 over at91-usart-serial driver and usart-spi-driver. Only one function
@@ -1418,7 +1419,7 @@ config MFD_TPS65217 · 1310 unmodified lines
14181419
14191420 config MFD_TPS68470
14201421 bool "TI TPS68470 Power Management / LED chips"
1421− depends on ACPI && I2C=y
1422+ depends on ACPI && PCI && I2C=y
14221423 select MFD_CORE
14231424 select REGMAP_I2C
14241425 select I2C_DESIGNWARE_PLATFORM
drivers/mfd/ab8500-core.c+1−1
@@ -261,7 +261,7 @@ static int get_register_interruptible(struct ab8500 *ab8500, u8 bank, · 260 unmodified lines
261261 mutex_unlock(&ab8500->lock);
262262 dev_vdbg(ab8500->dev, "rd: addr %#x => data %#x\n", addr, ret);
263263
264− return ret;
264+ return (ret < 0) ? ret : 0;
265265 }
266266
267267 static int ab8500_get_register(struct device *dev, u8 bank,
drivers/mfd/axp20x.c+70−56
@@ -641,9 +641,9 @@ static const struct mfd_cell axp221_cells[] = { · 640 unmodified lines
641641
642642 static const struct mfd_cell axp223_cells[] = {
643643 {
644− .name = "axp221-pek",
645− .num_resources = ARRAY_SIZE(axp22x_pek_resources),
646− .resources = axp22x_pek_resources,
644+ .name = "axp221-pek",
645+ .num_resources = ARRAY_SIZE(axp22x_pek_resources),
646+ .resources = axp22x_pek_resources,
647647 }, {
648648 .name = "axp22x-adc",
649649 .of_compatible = "x-powers,axp221-adc",
@@ -651,7 +651,7 @@ static const struct mfd_cell axp223_cells[] = { · 1 unmodified line
651651 .name = "axp20x-battery-power-supply",
652652 .of_compatible = "x-powers,axp221-battery-power-supply",
653653 }, {
654− .name = "axp20x-regulator",
654+ .name = "axp20x-regulator",
655655 }, {
656656 .name = "axp20x-ac-power-supply",
657657 .of_compatible = "x-powers,axp221-ac-power-supply",
@@ -667,9 +667,9 @@ static const struct mfd_cell axp223_cells[] = { · 9 unmodified lines
667667
668668 static const struct mfd_cell axp152_cells[] = {
669669 {
670− .name = "axp20x-pek",
671− .num_resources = ARRAY_SIZE(axp152_pek_resources),
672− .resources = axp152_pek_resources,
670+ .name = "axp20x-pek",
671+ .num_resources = ARRAY_SIZE(axp152_pek_resources),
672+ .resources = axp152_pek_resources,
673673 },
674674 };
675675
@@ -698,87 +698,101 @@ static const struct resource axp288_charger_resources[] = { · 22 unmodified lines
698698
699699 static const struct mfd_cell axp288_cells[] = {
700700 {
701− .name = "axp288_adc",
702− .num_resources = ARRAY_SIZE(axp288_adc_resources),
703− .resources = axp288_adc_resources,
704− },
705− {
706− .name = "axp288_extcon",
707− .num_resources = ARRAY_SIZE(axp288_extcon_resources),
708− .resources = axp288_extcon_resources,
709− },
710− {
711− .name = "axp288_charger",
712− .num_resources = ARRAY_SIZE(axp288_charger_resources),
713− .resources = axp288_charger_resources,
714− },
715− {
716− .name = "axp288_fuel_gauge",
717− .num_resources = ARRAY_SIZE(axp288_fuel_gauge_resources),
718− .resources = axp288_fuel_gauge_resources,
719− },
720− {
721− .name = "axp221-pek",
722− .num_resources = ARRAY_SIZE(axp288_power_button_resources),
723− .resources = axp288_power_button_resources,
724− },
725− {
726− .name = "axp288_pmic_acpi",
701+ .name = "axp288_adc",
702+ .num_resources = ARRAY_SIZE(axp288_adc_resources),
703+ .resources = axp288_adc_resources,
704+ }, {
705+ .name = "axp288_extcon",
706+ .num_resources = ARRAY_SIZE(axp288_extcon_resources),
707+ .resources = axp288_extcon_resources,
708+ }, {
709+ .name = "axp288_charger",
710+ .num_resources = ARRAY_SIZE(axp288_charger_resources),
711+ .resources = axp288_charger_resources,
712+ }, {
713+ .name = "axp288_fuel_gauge",
714+ .num_resources = ARRAY_SIZE(axp288_fuel_gauge_resources),
715+ .resources = axp288_fuel_gauge_resources,
716+ }, {
717+ .name = "axp221-pek",
718+ .num_resources = ARRAY_SIZE(axp288_power_button_resources),
719+ .resources = axp288_power_button_resources,
720+ }, {
721+ .name = "axp288_pmic_acpi",
727722 },
728723 };
729724
730725 static const struct mfd_cell axp803_cells[] = {
731726 {
732− .name = "axp221-pek",
733− .num_resources = ARRAY_SIZE(axp803_pek_resources),
734− .resources = axp803_pek_resources,
727+ .name = "axp221-pek",
728+ .num_resources = ARRAY_SIZE(axp803_pek_resources),
729+ .resources = axp803_pek_resources,
730+ }, {
731+ .name = "axp20x-gpio",
732+ .of_compatible = "x-powers,axp813-gpio",
733+ }, {
734+ .name = "axp813-adc",
735+ .of_compatible = "x-powers,axp813-adc",
736+ }, {
737+ .name = "axp20x-battery-power-supply",
738+ .of_compatible = "x-powers,axp813-battery-power-supply",
739+ }, {
740+ .name = "axp20x-ac-power-supply",
741+ .of_compatible = "x-powers,axp813-ac-power-supply",
742+ .num_resources = ARRAY_SIZE(axp20x_ac_power_supply_resources),
743+ .resources = axp20x_ac_power_supply_resources,
735744 },
736− { .name = "axp20x-regulator" },
745+ { .name = "axp20x-regulator" },
737746 };
738747
739748 static const struct mfd_cell axp806_self_working_cells[] = {
740749 {
741− .name = "axp221-pek",
742− .num_resources = ARRAY_SIZE(axp806_pek_resources),
743− .resources = axp806_pek_resources,
750+ .name = "axp221-pek",
751+ .num_resources = ARRAY_SIZE(axp806_pek_resources),
752+ .resources = axp806_pek_resources,
744753 },
745− { .name = "axp20x-regulator" },
754+ { .name = "axp20x-regulator" },
746755 };
747756
748757 static const struct mfd_cell axp806_cells[] = {
749758 {
750− .id = 2,
751− .name = "axp20x-regulator",
759+ .id = 2,
760+ .name = "axp20x-regulator",
752761 },
753762 };
754763
755764 static const struct mfd_cell axp809_cells[] = {
756765 {
757− .name = "axp221-pek",
758− .num_resources = ARRAY_SIZE(axp809_pek_resources),
759− .resources = axp809_pek_resources,
766+ .name = "axp221-pek",
767+ .num_resources = ARRAY_SIZE(axp809_pek_resources),
768+ .resources = axp809_pek_resources,
760769 }, {
761− .id = 1,
762− .name = "axp20x-regulator",
770+ .id = 1,
771+ .name = "axp20x-regulator",
763772 },
764773 };
765774
766775 static const struct mfd_cell axp813_cells[] = {
767776 {
768− .name = "axp221-pek",
769− .num_resources = ARRAY_SIZE(axp803_pek_resources),
770− .resources = axp803_pek_resources,
777+ .name = "axp221-pek",
778+ .num_resources = ARRAY_SIZE(axp803_pek_resources),
779+ .resources = axp803_pek_resources,
771780 }, {
772− .name = "axp20x-regulator",
781+ .name = "axp20x-regulator",
773782 }, {
774− .name = "axp20x-gpio",
775− .of_compatible = "x-powers,axp813-gpio",
783+ .name = "axp20x-gpio",
784+ .of_compatible = "x-powers,axp813-gpio",
776785 }, {
777− .name = "axp813-adc",
778− .of_compatible = "x-powers,axp813-adc",
786+ .name = "axp813-adc",
787+ .of_compatible = "x-powers,axp813-adc",
779788 }, {
780789 .name = "axp20x-battery-power-supply",
781790 .of_compatible = "x-powers,axp813-battery-power-supply",
791+ }, {
792+ .name = "axp20x-ac-power-supply",
793+ .of_compatible = "x-powers,axp813-ac-power-supply",
794+ .num_resources = ARRAY_SIZE(axp20x_ac_power_supply_resources),
795+ .resources = axp20x_ac_power_supply_resources,
782796 },
783797 };
784798
drivers/mfd/bd9571mwv.c+1−0
@@ -59,6 +59,7 @@ static const struct regmap_access_table bd9571mwv_writable_table = { · 58 unmodified lines
5959 };
6060
6161 static const struct regmap_range bd9571mwv_volatile_yes_ranges[] = {
62+ regmap_reg_range(BD9571MWV_DVFS_MONIVDAC, BD9571MWV_DVFS_MONIVDAC),
6263 regmap_reg_range(BD9571MWV_GPIO_IN, BD9571MWV_GPIO_IN),
6364 regmap_reg_range(BD9571MWV_GPIO_INT, BD9571MWV_GPIO_INT),
6465 regmap_reg_range(BD9571MWV_INT_INTREQ, BD9571MWV_INT_INTREQ),
drivers/mfd/cros_ec_dev.c+1−0
@@ -499,6 +499,7 @@ static int ec_device_remove(struct platform_device *pdev) · 498 unmodified lines
499499
500500 cros_ec_debugfs_remove(ec);
501501
502+ mfd_remove_devices(ec->dev);
502503 cdev_del(&ec->cdev);
503504 device_unregister(&ec->class_dev);
504505 return 0;
drivers/mfd/db8500-prcmu.c+2−2
@@ -2584,7 +2584,7 @@ static struct irq_chip prcmu_irq_chip = { · 2583 unmodified lines
25842584 .irq_unmask = prcmu_irq_unmask,
25852585 };
25862586
2587−static __init char *fw_project_name(u32 project)
2587+static char *fw_project_name(u32 project)
25882588 {
25892589 switch (project) {
25902590 case PRCMU_FW_PROJECT_U8500:
@@ -2732,7 +2732,7 @@ void __init db8500_prcmu_early_init(u32 phy_base, u32 size) · 141 unmodified lines
27322732 INIT_WORK(&mb0_transfer.mask_work, prcmu_mask_work);
27332733 }
27342734
2735−static void __init init_prcm_registers(void)
2735+static void init_prcm_registers(void)
27362736 {
27372737 u32 val;
27382738
drivers/mfd/exynos-lpass.c+3−1
@@ -82,11 +82,13 @@ static void exynos_lpass_enable(struct exynos_lpass *lpass) · 81 unmodified lines
8282 LPASS_INTR_SFR | LPASS_INTR_DMA | LPASS_INTR_I2S);
8383
8484 regmap_write(lpass->top, SFR_LPASS_INTR_CPU_MASK,
85− LPASS_INTR_SFR | LPASS_INTR_DMA | LPASS_INTR_I2S);
85+ LPASS_INTR_SFR | LPASS_INTR_DMA | LPASS_INTR_I2S |
86+ LPASS_INTR_UART);
8687
8788 exynos_lpass_core_sw_reset(lpass, LPASS_I2S_SW_RESET);
8889 exynos_lpass_core_sw_reset(lpass, LPASS_DMA_SW_RESET);
8990 exynos_lpass_core_sw_reset(lpass, LPASS_MEM_SW_RESET);
91+ exynos_lpass_core_sw_reset(lpass, LPASS_UART_SW_RESET);
9092 }
9193
9294 static void exynos_lpass_disable(struct exynos_lpass *lpass)
drivers/mfd/madera-core.c+4−1
@@ -15,6 +15,7 @@ · 14 unmodified lines
1515 #include <linux/gpio.h>
1616 #include <linux/mfd/core.h>
1717 #include <linux/module.h>
18+#include <linux/mutex.h>
1819 #include <linux/notifier.h>
1920 #include <linux/of.h>
2021 #include <linux/of_gpio.h>
@@ -155,7 +156,7 @@ static int madera_wait_for_boot(struct madera *madera) · 134 unmodified lines
155156 usleep_range(MADERA_BOOT_POLL_INTERVAL_USEC / 2,
156157 MADERA_BOOT_POLL_INTERVAL_USEC);
157158 regmap_read(madera->regmap, MADERA_IRQ1_RAW_STATUS_1, &val);
158− };
159+ }
159160
160161 if (!(val & MADERA_BOOT_DONE_STS1)) {
161162 dev_err(madera->dev, "Polling BOOT_DONE_STS timed out\n");
@@ -357,6 +358,8 @@ int madera_dev_init(struct madera *madera) · 195 unmodified lines
357358
358359 dev_set_drvdata(madera->dev, madera);
359360 BLOCKING_INIT_NOTIFIER_HEAD(&madera->notifier);
361+ mutex_init(&madera->dapm_ptr_lock);
362+
360363 madera_set_micbias_info(madera);
361364
362365 /*
drivers/mfd/max77620.c+1−1
@@ -280,7 +280,7 @@ static int max77620_config_fps(struct max77620_chip *chip, · 279 unmodified lines
280280
281281 for (fps_id = 0; fps_id < MAX77620_FPS_COUNT; fps_id++) {
282282 sprintf(fps_name, "fps%d", fps_id);
283− if (!strcmp(fps_np->name, fps_name))
283+ if (of_node_name_eq(fps_np, fps_name))
284284 break;
285285 }
286286
drivers/mfd/mc13xxx-core.c+3−1
@@ -274,7 +274,9 @@ int mc13xxx_adc_do_conversion(struct mc13xxx *mc13xxx, unsigned int mode, · 273 unmodified lines
274274
275275 mc13xxx->adcflags |= MC13XXX_ADC_WORKING;
276276
277− mc13xxx_reg_read(mc13xxx, MC13XXX_ADC0, &old_adc0);
277+ ret = mc13xxx_reg_read(mc13xxx, MC13XXX_ADC0, &old_adc0);
278+ if (ret)
279+ goto out;
278280
279281 adc0 = MC13XXX_ADC0_ADINC1 | MC13XXX_ADC0_ADINC2 |
280282 MC13XXX_ADC0_CHRGRAWDIV;
drivers/mfd/mt6397-core.c+1−2
@@ -329,8 +329,7 @@ static int mt6397_probe(struct platform_device *pdev) · 328 unmodified lines
329329
330330 default:
331331 dev_err(&pdev->dev, "unsupported chip: %d\n", id);
332− ret = -ENODEV;
333− break;
332+ return -ENODEV;
334333 }
335334
336335 if (ret) {
drivers/mfd/qcom_rpm.c+4−0
@@ -638,6 +638,10 @@ static int qcom_rpm_probe(struct platform_device *pdev) · 637 unmodified lines
638638 return -EFAULT;
639639 }
640640
641+ writel(fw_version[0], RPM_CTRL_REG(rpm, 0));
642+ writel(fw_version[1], RPM_CTRL_REG(rpm, 1));
643+ writel(fw_version[2], RPM_CTRL_REG(rpm, 2));
644+
641645 dev_info(&pdev->dev, "RPM firmware %u.%u.%u\n", fw_version[0],
642646 fw_version[1],
643647 fw_version[2]);
drivers/mfd/rave-sp.c+1−1
@@ -109,7 +109,7 @@ struct rave_sp_reply { · 108 unmodified lines
109109 /**
110110 * struct rave_sp_checksum - Variant specific checksum implementation details
111111 *
112− * @length: Caculated checksum length
112+ * @length: Calculated checksum length
113113 * @subroutine: Utilized checksum algorithm implementation
114114 */
115115 struct rave_sp_checksum {
drivers/mfd/stmpe.c+6−6
@@ -1302,17 +1302,17 @@ static void stmpe_of_probe(struct stmpe_platform_data *pdata, · 1301 unmodified lines
13021302 pdata->autosleep = (pdata->autosleep_timeout) ? true : false;
13031303
13041304 for_each_child_of_node(np, child) {
1305− if (!strcmp(child->name, "stmpe_gpio")) {
1305+ if (of_node_name_eq(child, "stmpe_gpio")) {
13061306 pdata->blocks |= STMPE_BLOCK_GPIO;
1307− } else if (!strcmp(child->name, "stmpe_keypad")) {
1307+ } else if (of_node_name_eq(child, "stmpe_keypad")) {
13081308 pdata->blocks |= STMPE_BLOCK_KEYPAD;
1309− } else if (!strcmp(child->name, "stmpe_touchscreen")) {
1309+ } else if (of_node_name_eq(child, "stmpe_touchscreen")) {
13101310 pdata->blocks |= STMPE_BLOCK_TOUCHSCREEN;
1311− } else if (!strcmp(child->name, "stmpe_adc")) {
1311+ } else if (of_node_name_eq(child, "stmpe_adc")) {
13121312 pdata->blocks |= STMPE_BLOCK_ADC;
1313− } else if (!strcmp(child->name, "stmpe_pwm")) {
1313+ } else if (of_node_name_eq(child, "stmpe_pwm")) {
13141314 pdata->blocks |= STMPE_BLOCK_PWM;
1315− } else if (!strcmp(child->name, "stmpe_rotator")) {
1315+ } else if (of_node_name_eq(child, "stmpe_rotator")) {
13161316 pdata->blocks |= STMPE_BLOCK_ROTATOR;
13171317 }
13181318 }
drivers/mfd/ti_am335x_tscadc.c+3−2
@@ -264,8 +264,9 @@ static int ti_tscadc_probe(struct platform_device *pdev) · 263 unmodified lines
264264 cell->pdata_size = sizeof(tscadc);
265265 }
266266
267− err = mfd_add_devices(&pdev->dev, pdev->id, tscadc->cells,
268− tscadc->used_cells, NULL, 0, NULL);
267+ err = mfd_add_devices(&pdev->dev, PLATFORM_DEVID_AUTO,
268+ tscadc->cells, tscadc->used_cells, NULL,
269+ 0, NULL);
269270 if (err < 0)
270271 goto err_disable_clk;
271272
drivers/mfd/tps65218.c+3−21
@@ -235,9 +235,9 @@ static int tps65218_probe(struct i2c_client *client, · 234 unmodified lines
235235
236236 mutex_init(&tps->tps_lock);
237237
238− ret = regmap_add_irq_chip(tps->regmap, tps->irq,
239− IRQF_ONESHOT, 0, &tps65218_irq_chip,
240− &tps->irq_data);
238+ ret = devm_regmap_add_irq_chip(&client->dev, tps->regmap, tps->irq,
239+ IRQF_ONESHOT, 0, &tps65218_irq_chip,
240+ &tps->irq_data);
241241 if (ret < 0)
242242 return ret;
243243
@@ -253,26 +253,9 @@ static int tps65218_probe(struct i2c_client *client, · 9 unmodified lines
253253 ARRAY_SIZE(tps65218_cells), NULL, 0,
254254 regmap_irq_get_domain(tps->irq_data));
255255
256− if (ret < 0)
257− goto err_irq;
258−
259− return 0;
260−
261−err_irq:
262− regmap_del_irq_chip(tps->irq, tps->irq_data);
263−
264256 return ret;
265257 }
266258
267−static int tps65218_remove(struct i2c_client *client)
268−{
269− struct tps65218 *tps = i2c_get_clientdata(client);
270−
271− regmap_del_irq_chip(tps->irq, tps->irq_data);
272−
273− return 0;
274−}
275−
276259 static const struct i2c_device_id tps65218_id_table[] = {
277260 { "tps65218", TPS65218 },
278261 { },
@@ -285,7 +268,6 @@ static struct i2c_driver tps65218_driver = { · 6 unmodified lines
285268 .of_match_table = of_tps65218_match_table,
286269 },
287270 .probe = tps65218_probe,
288− .remove = tps65218_remove,
289271 .id_table = tps65218_id_table,
290272 };
291273
drivers/mfd/tps6586x.c+24−0
@@ -592,6 +592,29 @@ static int tps6586x_i2c_remove(struct i2c_client *client) · 591 unmodified lines
592592 return 0;
593593 }
594594
595+static int __maybe_unused tps6586x_i2c_suspend(struct device *dev)
596+{
597+ struct tps6586x *tps6586x = dev_get_drvdata(dev);
598+
599+ if (tps6586x->client->irq)
600+ disable_irq(tps6586x->client->irq);
601+
602+ return 0;
603+}
604+
605+static int __maybe_unused tps6586x_i2c_resume(struct device *dev)
606+{
607+ struct tps6586x *tps6586x = dev_get_drvdata(dev);
608+
609+ if (tps6586x->client->irq)
610+ enable_irq(tps6586x->client->irq);
611+
612+ return 0;
613+}
614+
615+static SIMPLE_DEV_PM_OPS(tps6586x_pm_ops, tps6586x_i2c_suspend,
616+ tps6586x_i2c_resume);
617+
595618 static const struct i2c_device_id tps6586x_id_table[] = {
596619 { "tps6586x", 0 },
597620 { },
@@ -602,6 +625,7 @@ static struct i2c_driver tps6586x_driver = { · 4 unmodified lines
602625 .driver = {
603626 .name = "tps6586x",
604627 .of_match_table = of_match_ptr(tps6586x_of_match),
628+ .pm = &tps6586x_pm_ops,
605629 },
606630 .probe = tps6586x_i2c_probe,
607631 .remove = tps6586x_i2c_remove,
drivers/mfd/twl-core.c+2−2
@@ -979,7 +979,7 @@ add_children(struct twl4030_platform_data *pdata, unsigned irq_base, · 978 unmodified lines
979979 * letting it generate the right frequencies for USB, MADC, and
980980 * other purposes.
981981 */
982−static inline int __init protect_pm_master(void)
982+static inline int protect_pm_master(void)
983983 {
984984 int e = 0;
985985
@@ -988,7 +988,7 @@ static inline int __init protect_pm_master(void) · 2 unmodified lines
988988 return e;
989989 }
990990
991−static inline int __init unprotect_pm_master(void)
991+static inline int unprotect_pm_master(void)
992992 {
993993 int e = 0;
994994
drivers/mfd/wm5110-tables.c+2−0
@@ -1618,6 +1618,7 @@ static const struct reg_default wm5110_reg_default[] = { · 1617 unmodified lines
16181618 { 0x00000ECD, 0x0000 }, /* R3789 - HPLPF4_2 */
16191619 { 0x00000EE0, 0x0000 }, /* R3808 - ASRC_ENABLE */
16201620 { 0x00000EE2, 0x0000 }, /* R3810 - ASRC_RATE1 */
1621+ { 0x00000EE3, 0x4000 }, /* R3811 - ASRC_RATE2 */
16211622 { 0x00000EF0, 0x0000 }, /* R3824 - ISRC 1 CTRL 1 */
16221623 { 0x00000EF1, 0x0000 }, /* R3825 - ISRC 1 CTRL 2 */
16231624 { 0x00000EF2, 0x0000 }, /* R3826 - ISRC 1 CTRL 3 */
@@ -2869,6 +2870,7 @@ static bool wm5110_readable_register(struct device *dev, unsigned int reg) · 1245 unmodified lines
28692870 case ARIZONA_ASRC_ENABLE:
28702871 case ARIZONA_ASRC_STATUS:
28712872 case ARIZONA_ASRC_RATE1:
2873+ case ARIZONA_ASRC_RATE2:
28722874 case ARIZONA_ISRC_1_CTRL_1:
28732875 case ARIZONA_ISRC_1_CTRL_2:
28742876 case ARIZONA_ISRC_1_CTRL_3:
drivers/misc/ibmvmc.c+5−2
@@ -820,21 +820,24 @@ static int ibmvmc_send_msg(struct crq_server_adapter *adapter, · 819 unmodified lines
820820 *
821821 * Return:
822822 * 0 - Success
823+ * Non-zero - Failure
823824 */
824825 static int ibmvmc_open(struct inode *inode, struct file *file)
825826 {
826827 struct ibmvmc_file_session *session;
827− int rc = 0;
828828
829829 pr_debug("%s: inode = 0x%lx, file = 0x%lx, state = 0x%x\n", __func__,
830830 (unsigned long)inode, (unsigned long)file,
831831 ibmvmc.state);
832832
833833 session = kzalloc(sizeof(*session), GFP_KERNEL);
834+ if (!session)
835+ return -ENOMEM;
836+
834837 session->file = file;
835838 file->private_data = session;
836839
837− return rc;
840+ return 0;
838841 }
839842
840843 /**
drivers/misc/mei/hbm.c+9−3
@@ -1187,9 +1187,15 @@ int mei_hbm_dispatch(struct mei_device *dev, struct mei_msg_hdr *hdr) · 1186 unmodified lines
11871187 dma_setup_res = (struct hbm_dma_setup_response *)mei_msg;
11881188
11891189 if (dma_setup_res->status) {
1190− dev_info(dev->dev, "hbm: dma setup response: failure = %d %s\n",
1191− dma_setup_res->status,
1192− mei_hbm_status_str(dma_setup_res->status));
1190+ u8 status = dma_setup_res->status;
1191+
1192+ if (status == MEI_HBMS_NOT_ALLOWED) {
1193+ dev_dbg(dev->dev, "hbm: dma setup not allowed\n");
1194+ } else {
1195+ dev_info(dev->dev, "hbm: dma setup response: failure = %d %s\n",
1196+ status,
1197+ mei_hbm_status_str(status));
1198+ }
11931199 dev->hbm_f_dr_supported = 0;
11941200 mei_dmam_ring_free(dev);
11951201 }
drivers/misc/mei/hw-me-regs.h+2−0
@@ -127,6 +127,8 @@ · 126 unmodified lines
127127 #define MEI_DEV_ID_BXT_M 0x1A9A /* Broxton M */
128128 #define MEI_DEV_ID_APL_I 0x5A9A /* Apollo Lake I */
129129
130+#define MEI_DEV_ID_DNV_IE 0x19E5 /* Denverton IE */
131+
130132 #define MEI_DEV_ID_GLK 0x319A /* Gemini Lake */
131133
132134 #define MEI_DEV_ID_KBP 0xA2BA /* Kaby Point */
drivers/misc/mei/pci-me.c+3−1
@@ -88,11 +88,13 @@ static const struct pci_device_id mei_me_pci_tbl[] = { · 87 unmodified lines
8888 {MEI_PCI_DEVICE(MEI_DEV_ID_SPT_2, MEI_ME_PCH8_CFG)},
8989 {MEI_PCI_DEVICE(MEI_DEV_ID_SPT_H, MEI_ME_PCH8_SPS_CFG)},
9090 {MEI_PCI_DEVICE(MEI_DEV_ID_SPT_H_2, MEI_ME_PCH8_SPS_CFG)},
91− {MEI_PCI_DEVICE(MEI_DEV_ID_LBG, MEI_ME_PCH8_CFG)},
91+ {MEI_PCI_DEVICE(MEI_DEV_ID_LBG, MEI_ME_PCH12_CFG)},
9292
9393 {MEI_PCI_DEVICE(MEI_DEV_ID_BXT_M, MEI_ME_PCH8_CFG)},
9494 {MEI_PCI_DEVICE(MEI_DEV_ID_APL_I, MEI_ME_PCH8_CFG)},
9595
96+ {MEI_PCI_DEVICE(MEI_DEV_ID_DNV_IE, MEI_ME_PCH8_CFG)},
97+
9698 {MEI_PCI_DEVICE(MEI_DEV_ID_GLK, MEI_ME_PCH8_CFG)},
9799
98100 {MEI_PCI_DEVICE(MEI_DEV_ID_KBP, MEI_ME_PCH8_CFG)},
drivers/misc/mic/vop/vop_main.c+7−2
@@ -394,16 +394,21 @@ static int vop_find_vqs(struct virtio_device *dev, unsigned nvqs, · 393 unmodified lines
394394 struct _vop_vdev *vdev = to_vopvdev(dev);
395395 struct vop_device *vpdev = vdev->vpdev;
396396 struct mic_device_ctrl __iomem *dc = vdev->dc;
397− int i, err, retry;
397+ int i, err, retry, queue_idx = 0;
398398
399399 /* We must have this many virtqueues. */
400400 if (nvqs > ioread8(&vdev->desc->num_vq))
401401 return -ENOENT;
402402
403403 for (i = 0; i < nvqs; ++i) {
404+ if (!names[i]) {
405+ vqs[i] = NULL;
406+ continue;
407+ }
408+
404409 dev_dbg(_vop_dev(vdev), "%s: %d: %s\n",
405410 __func__, i, names[i]);
406− vqs[i] = vop_find_vq(dev, i, callbacks[i], names[i],
411+ vqs[i] = vop_find_vq(dev, queue_idx++, callbacks[i], names[i],
407412 ctx ? ctx[i] : false);
408413 if (IS_ERR(vqs[i])) {
409414 err = PTR_ERR(vqs[i]);
drivers/misc/pvpanic.c+4−0
@@ -70,8 +70,12 @@ pvpanic_walk_resources(struct acpi_resource *res, void *context) · 69 unmodified lines
7070 struct resource r;
7171
7272 if (acpi_dev_resource_io(res, &r)) {
73+#ifdef CONFIG_HAS_IOPORT_MAP
7374 base = ioport_map(r.start, resource_size(&r));
7475 return AE_OK;
76+#else
77+ return AE_ERROR;
78+#endif
7579 } else if (acpi_dev_resource_memory(res, &r)) {
7680 base = ioremap(r.start, resource_size(&r));
7781 return AE_OK;
drivers/mmc/core/host.c+1−1
@@ -234,7 +234,7 @@ int mmc_of_parse(struct mmc_host *host) · 233 unmodified lines
234234 if (device_property_read_bool(dev, "broken-cd"))
235235 host->caps |= MMC_CAP_NEEDS_POLL;
236236
237− ret = mmc_gpiod_request_cd(host, "cd", 0, true,
237+ ret = mmc_gpiod_request_cd(host, "cd", 0, false,
238238 cd_debounce_delay_ms * 1000,
239239 &cd_gpio_invert);
240240 if (!ret)
drivers/mmc/host/Kconfig+2−2
@@ -116,7 +116,7 @@ config MMC_RICOH_MMC · 115 unmodified lines
116116
117117 config MMC_SDHCI_ACPI
118118 tristate "SDHCI support for ACPI enumerated SDHCI controllers"
119− depends on MMC_SDHCI && ACPI
119+ depends on MMC_SDHCI && ACPI && PCI
120120 select IOSF_MBI if X86
121121 help
122122 This selects support for ACPI enumerated SDHCI controllers,
@@ -978,7 +978,7 @@ config MMC_SDHCI_OMAP · 855 unmodified lines
978978 tristate "TI SDHCI Controller Support"
979979 depends on MMC_SDHCI_PLTFM && OF
980980 select THERMAL
981− select TI_SOC_THERMAL
981+ imply TI_SOC_THERMAL
982982 help
983983 This selects the Secure Digital Host Controller Interface (SDHCI)
984984 support present in TI's DRA7 SOCs. The controller supports
drivers/mmc/host/bcm2835.c+2−0
@@ -1431,6 +1431,8 @@ static int bcm2835_probe(struct platform_device *pdev) · 1430 unmodified lines
14311431
14321432 err:
14331433 dev_dbg(dev, "%s -> err %d\n", __func__, ret);
1434+ if (host->dma_chan_rxtx)
1435+ dma_release_channel(host->dma_chan_rxtx);
14341436 mmc_free_host(mmc);
14351437
14361438 return ret;
drivers/mmc/host/dw_mmc-bluefield.c+0−5
@@ -1,11 +1,6 @@
11 // SPDX-License-Identifier: GPL-2.0
22 /*
33 * Copyright (C) 2018 Mellanox Technologies.
4− *
5− * This program is free software; you can redistribute it and/or modify
6− * it under the terms of the GNU General Public License as published by
7− * the Free Software Foundation; either version 2 of the License, or
8− * (at your option) any later version.
94 */
105
116 #include <linux/bitfield.h>
drivers/mmc/host/meson-gx-mmc.c+20−12
@@ -179,6 +179,8 @@ struct meson_host { · 178 unmodified lines
179179 struct sd_emmc_desc *descs;
180180 dma_addr_t descs_dma_addr;
181181
182+ int irq;
183+
182184 bool vqmmc_enabled;
183185 };
184186
@@ -738,6 +740,11 @@ static int meson_mmc_clk_phase_tuning(struct mmc_host *mmc, u32 opcode, · 553 unmodified lines
738740 static int meson_mmc_execute_tuning(struct mmc_host *mmc, u32 opcode)
739741 {
740742 struct meson_host *host = mmc_priv(mmc);
743+ int adj = 0;
744+
745+ /* enable signal resampling w/o delay */
746+ adj = ADJUST_ADJ_EN;
747+ writel(adj, host->regs + host->data->adjust);
741748
742749 return meson_mmc_clk_phase_tuning(mmc, opcode, host->rx_clk);
743750 }
@@ -768,6 +775,9 @@ static void meson_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) · 24 unmodified lines
768775 if (!IS_ERR(mmc->supply.vmmc))
769776 mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, ios->vdd);
770777
778+ /* disable signal resampling */
779+ writel(0, host->regs + host->data->adjust);
780+
771781 /* Reset rx phase */
772782 clk_set_phase(host->rx_clk, 0);
773783
@@ -1166,7 +1176,7 @@ static int meson_mmc_get_cd(struct mmc_host *mmc) · 392 unmodified lines
11661176
11671177 static void meson_mmc_cfg_init(struct meson_host *host)
11681178 {
1169− u32 cfg = 0, adj = 0;
1179+ u32 cfg = 0;
11701180
11711181 cfg |= FIELD_PREP(CFG_RESP_TIMEOUT_MASK,
11721182 ilog2(SD_EMMC_CFG_RESP_TIMEOUT));
@@ -1177,10 +1187,6 @@ static void meson_mmc_cfg_init(struct meson_host *host) · 4 unmodified lines
11771187 cfg |= CFG_ERR_ABORT;
11781188
11791189 writel(cfg, host->regs + SD_EMMC_CFG);
1180−
1181− /* enable signal resampling w/o delay */
1182− adj = ADJUST_ADJ_EN;
1183− writel(adj, host->regs + host->data->adjust);
11841190 }
11851191
11861192 static int meson_mmc_card_busy(struct mmc_host *mmc)
@@ -1231,7 +1237,7 @@ static int meson_mmc_probe(struct platform_device *pdev) · 44 unmodified lines
12311237 struct resource *res;
12321238 struct meson_host *host;
12331239 struct mmc_host *mmc;
1234− int ret, irq;
1240+ int ret;
12351241
12361242 mmc = mmc_alloc_host(sizeof(struct meson_host), &pdev->dev);
12371243 if (!mmc)
@@ -1276,8 +1282,8 @@ static int meson_mmc_probe(struct platform_device *pdev) · 38 unmodified lines
12761282 goto free_host;
12771283 }
12781284
1279− irq = platform_get_irq(pdev, 0);
1280− if (irq <= 0) {
1285+ host->irq = platform_get_irq(pdev, 0);
1286+ if (host->irq <= 0) {
12811287 dev_err(&pdev->dev, "failed to get interrupt resource.\n");
12821288 ret = -EINVAL;
12831289 goto free_host;
@@ -1331,9 +1337,8 @@ static int meson_mmc_probe(struct platform_device *pdev) · 47 unmodified lines
13311337 writel(IRQ_CRC_ERR | IRQ_TIMEOUTS | IRQ_END_OF_CHAIN,
13321338 host->regs + SD_EMMC_IRQ_EN);
13331339
1334− ret = devm_request_threaded_irq(&pdev->dev, irq, meson_mmc_irq,
1335− meson_mmc_irq_thread, IRQF_SHARED,
1336− NULL, host);
1340+ ret = request_threaded_irq(host->irq, meson_mmc_irq,
1341+ meson_mmc_irq_thread, IRQF_SHARED, NULL, host);
13371342 if (ret)
13381343 goto err_init_clk;
13391344
@@ -1351,7 +1356,7 @@ static int meson_mmc_probe(struct platform_device *pdev) · 11 unmodified lines
13511356 if (host->bounce_buf == NULL) {
13521357 dev_err(host->dev, "Unable to map allocate DMA bounce buffer.\n");
13531358 ret = -ENOMEM;
1354− goto err_init_clk;
1359+ goto err_free_irq;
13551360 }
13561361
13571362 host->descs = dma_alloc_coherent(host->dev, SD_EMMC_DESC_BUF_LEN,
@@ -1370,6 +1375,8 @@ static int meson_mmc_probe(struct platform_device *pdev) · 12 unmodified lines
13701375 err_bounce_buf:
13711376 dma_free_coherent(host->dev, host->bounce_buf_size,
13721377 host->bounce_buf, host->bounce_dma_addr);
1378+err_free_irq:
1379+ free_irq(host->irq, host);
13731380 err_init_clk:
13741381 clk_disable_unprepare(host->mmc_clk);
13751382 err_core_clk:
@@ -1387,6 +1394,7 @@ static int meson_mmc_remove(struct platform_device *pdev) · 11 unmodified lines
13871394
13881395 /* disable interrupts */
13891396 writel(0, host->regs + SD_EMMC_IRQ_EN);
1397+ free_irq(host->irq, host);
13901398
13911399 dma_free_coherent(host->dev, SD_EMMC_DESC_BUF_LEN,
13921400 host->descs, host->descs_dma_addr);
drivers/mmc/host/mtk-sd.c+1−1
@@ -846,7 +846,7 @@ static void msdc_set_mclk(struct msdc_host *host, unsigned char timing, u32 hz) · 845 unmodified lines
846846
847847 if (timing == MMC_TIMING_MMC_HS400 &&
848848 host->dev_comp->hs400_tune)
849− sdr_set_field(host->base + PAD_CMD_TUNE,
849+ sdr_set_field(host->base + tune_reg,
850850 MSDC_PAD_TUNE_CMDRRDLY,
851851 host->hs400_cmd_int_delay);
852852 dev_dbg(host->dev, "sclk: %d, timing: %d\n", host->mmc->actual_clock,
drivers/mmc/host/sdhci-iproc.c+4−1
@@ -296,7 +296,10 @@ static int sdhci_iproc_probe(struct platform_device *pdev) · 295 unmodified lines
296296
297297 iproc_host->data = iproc_data;
298298
299− mmc_of_parse(host->mmc);
299+ ret = mmc_of_parse(host->mmc);
300+ if (ret)
301+ goto err;
302+
300303 sdhci_get_property(pdev);
301304
302305 host->mmc->caps |= iproc_host->data->mmc_caps;
drivers/mtd/nand/raw/denali.c+1−1
@@ -1322,7 +1322,7 @@ int denali_init(struct denali_nand_info *denali) · 1321 unmodified lines
13221322 }
13231323
13241324 /* clk rate info is needed for setup_data_interface */
1325− if (denali->clk_rate && denali->clk_x_rate)
1325+ if (!denali->clk_rate || !denali->clk_x_rate)
13261326 chip->options |= NAND_KEEP_TIMINGS;
13271327
13281328 chip->legacy.dummy_controller.ops = &denali_controller_ops;
drivers/mtd/nand/raw/fsmc_nand.c+0−21
@@ -593,23 +593,6 @@ static void fsmc_write_buf_dma(struct fsmc_nand_data *host, const u8 *buf, · 592 unmodified lines
593593 dma_xfer(host, (void *)buf, len, DMA_TO_DEVICE);
594594 }
595595
596−/* fsmc_select_chip - assert or deassert nCE */
597−static void fsmc_ce_ctrl(struct fsmc_nand_data *host, bool assert)
598−{
599− u32 pc = readl(host->regs_va + FSMC_PC);
600−
601− if (!assert)
602− writel_relaxed(pc & ~FSMC_ENABLE, host->regs_va + FSMC_PC);
603− else
604− writel_relaxed(pc | FSMC_ENABLE, host->regs_va + FSMC_PC);
605−
606− /*
607− * nCE line changes must be applied before returning from this
608− * function.
609− */
610− mb();
611−}
612−
613596 /*
614597 * fsmc_exec_op - hook called by the core to execute NAND operations
615598 *
@@ -627,8 +610,6 @@ static int fsmc_exec_op(struct nand_chip *chip, const struct nand_operation *op, · 11 unmodified lines
627610
628611 pr_debug("Executing operation [%d instructions]:\n", op->ninstrs);
629612
630− fsmc_ce_ctrl(host, true);
631−
632613 for (op_id = 0; op_id < op->ninstrs; op_id++) {
633614 instr = &op->instrs[op_id];
634615
@@ -686,8 +667,6 @@ static int fsmc_exec_op(struct nand_chip *chip, const struct nand_operation *op, · 51 unmodified lines
686667 }
687668 }
688669
689− fsmc_ce_ctrl(host, false);
690−
691670 return ret;
692671 }
693672
drivers/mtd/nand/raw/jz4740_nand.c+1−1
@@ -260,7 +260,7 @@ static int jz_nand_correct_ecc_rs(struct nand_chip *chip, uint8_t *dat, · 259 unmodified lines
260260 }
261261
262262 static int jz_nand_ioremap_resource(struct platform_device *pdev,
263− const char *name, struct resource **res, void *__iomem *base)
263+ const char *name, struct resource **res, void __iomem **base)
264264 {
265265 int ret;
266266
drivers/net/Kconfig+1−1
@@ -519,7 +519,7 @@ config NET_FAILOVER · 518 unmodified lines
519519 and destroy a failover master netdev and manages a primary and
520520 standby slave netdevs that get registered via the generic failover
521521 infrastructure. This can be used by paravirtual drivers to enable
522− an alternate low latency datapath. It alsoenables live migration of
522+ an alternate low latency datapath. It also enables live migration of
523523 a VM with direct attached VF by failing over to the paravirtual
524524 datapath when the VF is unplugged.
525525
drivers/net/bonding/bond_main.c+3−0
@@ -1963,6 +1963,9 @@ static int __bond_release_one(struct net_device *bond_dev, · 1962 unmodified lines
19631963 if (!bond_has_slaves(bond)) {
19641964 bond_set_carrier(bond);
19651965 eth_hw_addr_random(bond_dev);
1966+ bond->nest_level = SINGLE_DEPTH_NESTING;
1967+ } else {
1968+ bond->nest_level = dev_get_nest_level(bond_dev) + 1;
19661969 }
19671970
19681971 unblock_netpoll_tx();
drivers/net/caif/caif_serial.c+1−4
@@ -257,10 +257,7 @@ static int handle_tx(struct ser_device *ser) · 256 unmodified lines
257257 if (skb->len == 0) {
258258 struct sk_buff *tmp = skb_dequeue(&ser->head);
259259 WARN_ON(tmp != skb);
260− if (in_interrupt())
261− dev_kfree_skb_irq(skb);
262− else
263− kfree_skb(skb);
260+ dev_consume_skb_any(skb);
264261 }
265262 }
266263 /* Send flow off if queue is empty */
drivers/net/can/dev.c+13−14
@@ -480,8 +480,6 @@ EXPORT_SYMBOL_GPL(can_put_echo_skb); · 479 unmodified lines
480480 struct sk_buff *__can_get_echo_skb(struct net_device *dev, unsigned int idx, u8 *len_ptr)
481481 {
482482 struct can_priv *priv = netdev_priv(dev);
483− struct sk_buff *skb = priv->echo_skb[idx];
484− struct canfd_frame *cf;
485483
486484 if (idx >= priv->echo_skb_max) {
487485 netdev_err(dev, "%s: BUG! Trying to access can_priv::echo_skb out of bounds (%u/max %u)\n",
@@ -489,20 +487,21 @@ struct sk_buff *__can_get_echo_skb(struct net_device *dev, unsigned int idx, u8 · 1 unmodified line
489487 return NULL;
490488 }
491489
492− if (!skb) {
493− netdev_err(dev, "%s: BUG! Trying to echo non existing skb: can_priv::echo_skb[%u]\n",
494− __func__, idx);
495− return NULL;
496− }
490+ if (priv->echo_skb[idx]) {
491+ /* Using "struct canfd_frame::len" for the frame
492+ * length is supported on both CAN and CANFD frames.
493+ */
494+ struct sk_buff *skb = priv->echo_skb[idx];
495+ struct canfd_frame *cf = (struct canfd_frame *)skb->data;
496+ u8 len = cf->len;
497497
498− /* Using "struct canfd_frame::len" for the frame
499− * length is supported on both CAN and CANFD frames.
500− */
501− cf = (struct canfd_frame *)skb->data;
502− *len_ptr = cf->len;
503− priv->echo_skb[idx] = NULL;
498+ *len_ptr = len;
499+ priv->echo_skb[idx] = NULL;
504500
505− return skb;
501+ return skb;
502+ }
503+
504+ return NULL;
506505 }
507506
508507 /*
drivers/net/can/flexcan.c+2−2
@@ -1106,7 +1106,7 @@ static int flexcan_chip_start(struct net_device *dev) · 1105 unmodified lines
11061106 }
11071107 } else {
11081108 /* clear and invalidate unused mailboxes first */
1109− for (i = FLEXCAN_TX_MB_RESERVED_OFF_FIFO; i <= priv->mb_count; i++) {
1109+ for (i = FLEXCAN_TX_MB_RESERVED_OFF_FIFO; i < priv->mb_count; i++) {
11101110 mb = flexcan_get_mb(priv, i);
11111111 priv->write(FLEXCAN_MB_CODE_RX_INACTIVE,
11121112 &mb->can_ctrl);
@@ -1432,7 +1432,7 @@ static int flexcan_setup_stop_mode(struct platform_device *pdev) · 319 unmodified lines
14321432 gpr_np = of_find_node_by_phandle(phandle);
14331433 if (!gpr_np) {
14341434 dev_dbg(&pdev->dev, "could not find gpr node by phandle\n");
1435− return PTR_ERR(gpr_np);
1435+ return -ENODEV;
14361436 }
14371437
14381438 priv = netdev_priv(dev);
drivers/net/dsa/microchip/ksz_common.c+0−2
@@ -7,7 +7,6 @@ · 6 unmodified lines
77
88 #include <linux/delay.h>
99 #include <linux/export.h>
10−#include <linux/gpio.h>
1110 #include <linux/gpio/consumer.h>
1211 #include <linux/kernel.h>
1312 #include <linux/module.h>
@@ -15,7 +14,6 @@ · 1 unmodified line
1514 #include <linux/phy.h>
1615 #include <linux/etherdevice.h>
1716 #include <linux/if_bridge.h>
18−#include <linux/of_gpio.h>
1917 #include <linux/of_net.h>
2018 #include <net/dsa.h>
2119 #include <net/switchdev.h>
drivers/net/dsa/mt7530.c+0−1
@@ -18,7 +18,6 @@ · 17 unmodified lines
1818 #include <linux/mfd/syscon.h>
1919 #include <linux/module.h>
2020 #include <linux/netdevice.h>
21−#include <linux/of_gpio.h>
2221 #include <linux/of_mdio.h>
2322 #include <linux/of_net.h>
2423 #include <linux/of_platform.h>
drivers/net/dsa/mv88e6xxx/chip.c+113−0
@@ -2403,6 +2403,107 @@ static int mv88e6xxx_stats_setup(struct mv88e6xxx_chip *chip) · 2402 unmodified lines
24032403 return mv88e6xxx_g1_stats_clear(chip);
24042404 }
24052405
2406+/* The mv88e6390 has some hidden registers used for debug and
2407+ * development. The errata also makes use of them.
2408+ */
2409+static int mv88e6390_hidden_write(struct mv88e6xxx_chip *chip, int port,
2410+ int reg, u16 val)
2411+{
2412+ u16 ctrl;
2413+ int err;
2414+
2415+ err = mv88e6xxx_port_write(chip, PORT_RESERVED_1A_DATA_PORT,
2416+ PORT_RESERVED_1A, val);
2417+ if (err)
2418+ return err;
2419+
2420+ ctrl = PORT_RESERVED_1A_BUSY | PORT_RESERVED_1A_WRITE |
2421+ PORT_RESERVED_1A_BLOCK | port << PORT_RESERVED_1A_PORT_SHIFT |
2422+ reg;
2423+
2424+ return mv88e6xxx_port_write(chip, PORT_RESERVED_1A_CTRL_PORT,
2425+ PORT_RESERVED_1A, ctrl);
2426+}
2427+
2428+static int mv88e6390_hidden_wait(struct mv88e6xxx_chip *chip)
2429+{
2430+ return mv88e6xxx_wait(chip, PORT_RESERVED_1A_CTRL_PORT,
2431+ PORT_RESERVED_1A, PORT_RESERVED_1A_BUSY);
2432+}
2433+
2434+
2435+static int mv88e6390_hidden_read(struct mv88e6xxx_chip *chip, int port,
2436+ int reg, u16 *val)
2437+{
2438+ u16 ctrl;
2439+ int err;
2440+
2441+ ctrl = PORT_RESERVED_1A_BUSY | PORT_RESERVED_1A_READ |
2442+ PORT_RESERVED_1A_BLOCK | port << PORT_RESERVED_1A_PORT_SHIFT |
2443+ reg;
2444+
2445+ err = mv88e6xxx_port_write(chip, PORT_RESERVED_1A_CTRL_PORT,
2446+ PORT_RESERVED_1A, ctrl);
2447+ if (err)
2448+ return err;
2449+
2450+ err = mv88e6390_hidden_wait(chip);
2451+ if (err)
2452+ return err;
2453+
2454+ return mv88e6xxx_port_read(chip, PORT_RESERVED_1A_DATA_PORT,
2455+ PORT_RESERVED_1A, val);
2456+}
2457+
2458+/* Check if the errata has already been applied. */
2459+static bool mv88e6390_setup_errata_applied(struct mv88e6xxx_chip *chip)
2460+{
2461+ int port;
2462+ int err;
2463+ u16 val;
2464+
2465+ for (port = 0; port < mv88e6xxx_num_ports(chip); port++) {
2466+ err = mv88e6390_hidden_read(chip, port, 0, &val);
2467+ if (err) {
2468+ dev_err(chip->dev,
2469+ "Error reading hidden register: %d\n", err);
2470+ return false;
2471+ }
2472+ if (val != 0x01c0)
2473+ return false;
2474+ }
2475+
2476+ return true;
2477+}
2478+
2479+/* The 6390 copper ports have an errata which require poking magic
2480+ * values into undocumented hidden registers and then performing a
2481+ * software reset.
2482+ */
2483+static int mv88e6390_setup_errata(struct mv88e6xxx_chip *chip)
2484+{
2485+ int port;
2486+ int err;
2487+
2488+ if (mv88e6390_setup_errata_applied(chip))
2489+ return 0;
2490+
2491+ /* Set the ports into blocking mode */
2492+ for (port = 0; port < mv88e6xxx_num_ports(chip); port++) {
2493+ err = mv88e6xxx_port_set_state(chip, port, BR_STATE_DISABLED);
2494+ if (err)
2495+ return err;
2496+ }
2497+
2498+ for (port = 0; port < mv88e6xxx_num_ports(chip); port++) {
2499+ err = mv88e6390_hidden_write(chip, port, 0, 0x01c0);
2500+ if (err)
2501+ return err;
2502+ }
2503+
2504+ return mv88e6xxx_software_reset(chip);
2505+}
2506+
24062507 static int mv88e6xxx_setup(struct dsa_switch *ds)
24072508 {
24082509 struct mv88e6xxx_chip *chip = ds->priv;
@@ -2415,6 +2516,12 @@ static int mv88e6xxx_setup(struct dsa_switch *ds) · 6 unmodified lines
24152516
24162517 mutex_lock(&chip->reg_lock);
24172518
2519+ if (chip->info->ops->setup_errata) {
2520+ err = chip->info->ops->setup_errata(chip);
2521+ if (err)
2522+ goto unlock;
2523+ }
2524+
24182525 /* Cache the cmode of each port. */
24192526 for (i = 0; i < mv88e6xxx_num_ports(chip); i++) {
24202527 if (chip->info->ops->port_get_cmode) {
@@ -3226,6 +3333,7 @@ static const struct mv88e6xxx_ops mv88e6185_ops = { · 805 unmodified lines
32263333
32273334 static const struct mv88e6xxx_ops mv88e6190_ops = {
32283335 /* MV88E6XXX_FAMILY_6390 */
3336+ .setup_errata = mv88e6390_setup_errata,
32293337 .irl_init_all = mv88e6390_g2_irl_init_all,
32303338 .get_eeprom = mv88e6xxx_g2_get_eeprom8,
32313339 .set_eeprom = mv88e6xxx_g2_set_eeprom8,
@@ -3269,6 +3377,7 @@ static const struct mv88e6xxx_ops mv88e6190_ops = { · 37 unmodified lines
32693377
32703378 static const struct mv88e6xxx_ops mv88e6190x_ops = {
32713379 /* MV88E6XXX_FAMILY_6390 */
3380+ .setup_errata = mv88e6390_setup_errata,
32723381 .irl_init_all = mv88e6390_g2_irl_init_all,
32733382 .get_eeprom = mv88e6xxx_g2_get_eeprom8,
32743383 .set_eeprom = mv88e6xxx_g2_set_eeprom8,
@@ -3312,6 +3421,7 @@ static const struct mv88e6xxx_ops mv88e6190x_ops = { · 37 unmodified lines
33123421
33133422 static const struct mv88e6xxx_ops mv88e6191_ops = {
33143423 /* MV88E6XXX_FAMILY_6390 */
3424+ .setup_errata = mv88e6390_setup_errata,
33153425 .irl_init_all = mv88e6390_g2_irl_init_all,
33163426 .get_eeprom = mv88e6xxx_g2_get_eeprom8,
33173427 .set_eeprom = mv88e6xxx_g2_set_eeprom8,
@@ -3404,6 +3514,7 @@ static const struct mv88e6xxx_ops mv88e6240_ops = { · 86 unmodified lines
34043514
34053515 static const struct mv88e6xxx_ops mv88e6290_ops = {
34063516 /* MV88E6XXX_FAMILY_6390 */
3517+ .setup_errata = mv88e6390_setup_errata,
34073518 .irl_init_all = mv88e6390_g2_irl_init_all,
34083519 .get_eeprom = mv88e6xxx_g2_get_eeprom8,
34093520 .set_eeprom = mv88e6xxx_g2_set_eeprom8,
@@ -3709,6 +3820,7 @@ static const struct mv88e6xxx_ops mv88e6352_ops = { · 299 unmodified lines
37093820
37103821 static const struct mv88e6xxx_ops mv88e6390_ops = {
37113822 /* MV88E6XXX_FAMILY_6390 */
3823+ .setup_errata = mv88e6390_setup_errata,
37123824 .irl_init_all = mv88e6390_g2_irl_init_all,
37133825 .get_eeprom = mv88e6xxx_g2_get_eeprom8,
37143826 .set_eeprom = mv88e6xxx_g2_set_eeprom8,
@@ -3756,6 +3868,7 @@ static const struct mv88e6xxx_ops mv88e6390_ops = { · 41 unmodified lines
37563868
37573869 static const struct mv88e6xxx_ops mv88e6390x_ops = {
37583870 /* MV88E6XXX_FAMILY_6390 */
3871+ .setup_errata = mv88e6390_setup_errata,
37593872 .irl_init_all = mv88e6390_g2_irl_init_all,
37603873 .get_eeprom = mv88e6xxx_g2_get_eeprom8,
37613874 .set_eeprom = mv88e6xxx_g2_set_eeprom8,
drivers/net/dsa/mv88e6xxx/chip.h+5−0
@@ -300,6 +300,11 @@ struct mv88e6xxx_mdio_bus { · 299 unmodified lines
300300 };
301301
302302 struct mv88e6xxx_ops {
303+ /* Switch Setup Errata, called early in the switch setup to
304+ * allow any errata actions to be performed
305+ */
306+ int (*setup_errata)(struct mv88e6xxx_chip *chip);
307+
303308 int (*ieee_pri_map)(struct mv88e6xxx_chip *chip);
304309 int (*ip_pri_map)(struct mv88e6xxx_chip *chip);
305310
drivers/net/dsa/mv88e6xxx/port.h+10−0
@@ -251,6 +251,16 @@ · 250 unmodified lines
251251 /* Offset 0x19: Port IEEE Priority Remapping Registers (4-7) */
252252 #define MV88E6095_PORT_IEEE_PRIO_REMAP_4567 0x19
253253
254+/* Offset 0x1a: Magic undocumented errata register */
255+#define PORT_RESERVED_1A 0x1a
256+#define PORT_RESERVED_1A_BUSY BIT(15)
257+#define PORT_RESERVED_1A_WRITE BIT(14)
258+#define PORT_RESERVED_1A_READ 0
259+#define PORT_RESERVED_1A_PORT_SHIFT 5
260+#define PORT_RESERVED_1A_BLOCK (0xf << 10)
261+#define PORT_RESERVED_1A_CTRL_PORT 4
262+#define PORT_RESERVED_1A_DATA_PORT 5
263+
254264 int mv88e6xxx_port_read(struct mv88e6xxx_chip *chip, int port, int reg,
255265 u16 *val);
256266 int mv88e6xxx_port_write(struct mv88e6xxx_chip *chip, int port, int reg,
drivers/net/dsa/mv88e6xxx/serdes.c+1−1
@@ -664,7 +664,7 @@ int mv88e6390_serdes_irq_setup(struct mv88e6xxx_chip *chip, int port) · 663 unmodified lines
664664 if (port < 9)
665665 return 0;
666666
667− return mv88e6390_serdes_irq_setup(chip, port);
667+ return mv88e6390x_serdes_irq_setup(chip, port);
668668 }
669669
670670 void mv88e6390x_serdes_irq_free(struct mv88e6xxx_chip *chip, int port)
drivers/net/dsa/realtek-smi.c+13−5
@@ -347,16 +347,17 @@ int realtek_smi_setup_mdio(struct realtek_smi *smi) · 346 unmodified lines
347347 struct device_node *mdio_np;
348348 int ret;
349349
350− mdio_np = of_find_compatible_node(smi->dev->of_node, NULL,
351− "realtek,smi-mdio");
350+ mdio_np = of_get_compatible_child(smi->dev->of_node, "realtek,smi-mdio");
352351 if (!mdio_np) {
353352 dev_err(smi->dev, "no MDIO bus node\n");
354353 return -ENODEV;
355354 }
356355
357356 smi->slave_mii_bus = devm_mdiobus_alloc(smi->dev);
358− if (!smi->slave_mii_bus)
359− return -ENOMEM;
357+ if (!smi->slave_mii_bus) {
358+ ret = -ENOMEM;
359+ goto err_put_node;
360+ }
360361 smi->slave_mii_bus->priv = smi;
361362 smi->slave_mii_bus->name = "SMI slave MII";
362363 smi->slave_mii_bus->read = realtek_smi_mdio_read;
@@ -371,10 +372,15 @@ int realtek_smi_setup_mdio(struct realtek_smi *smi) · 8 unmodified lines
371372 if (ret) {
372373 dev_err(smi->dev, "unable to register MDIO bus %s\n",
373374 smi->slave_mii_bus->id);
374− of_node_put(mdio_np);
375+ goto err_put_node;
375376 }
376377
377378 return 0;
379+
380+err_put_node:
381+ of_node_put(mdio_np);
382+
383+ return ret;
378384 }
379385
380386 static int realtek_smi_probe(struct platform_device *pdev)
@@ -457,6 +463,8 @@ static int realtek_smi_remove(struct platform_device *pdev) · 76 unmodified lines
457463 struct realtek_smi *smi = dev_get_drvdata(&pdev->dev);
458464
459465 dsa_unregister_switch(smi->ds);
466+ if (smi->slave_mii_bus)
467+ of_node_put(smi->slave_mii_bus->dev.of_node);
460468 gpiod_set_value(smi->reset, 1);
461469
462470 return 0;
drivers/net/ethernet/alteon/acenic.c+1−1
@@ -2059,7 +2059,7 @@ static inline void ace_tx_int(struct net_device *dev, · 2058 unmodified lines
20592059 if (skb) {
20602060 dev->stats.tx_packets++;
20612061 dev->stats.tx_bytes += skb->len;
2062− dev_kfree_skb_irq(skb);
2062+ dev_consume_skb_irq(skb);
20632063 info->skb = NULL;
20642064 }
20652065
drivers/net/ethernet/altera/altera_msgdma.c+2−1
@@ -145,7 +145,8 @@ u32 msgdma_tx_completions(struct altera_tse_private *priv) · 144 unmodified lines
145145 & 0xffff;
146146
147147 if (inuse) { /* Tx FIFO is not empty */
148− ready = priv->tx_prod - priv->tx_cons - inuse - 1;
148+ ready = max_t(int,
149+ priv->tx_prod - priv->tx_cons - inuse - 1, 0);
149150 } else {
150151 /* Check for buffered last packet */
151152 status = csrrd32(priv->tx_dma_csr, msgdma_csroffs(status));
drivers/net/ethernet/altera/altera_tse_main.c+3−1
@@ -714,8 +714,10 @@ static struct phy_device *connect_local_phy(struct net_device *dev) · 713 unmodified lines
714714
715715 phydev = phy_connect(dev, phy_id_fmt, &altera_tse_adjust_link,
716716 priv->phy_iface);
717− if (IS_ERR(phydev))
717+ if (IS_ERR(phydev)) {
718718 netdev_err(dev, "Could not attach to PHY\n");
719+ phydev = NULL;
720+ }
719721
720722 } else {
721723 int ret;
drivers/net/ethernet/amd/amd8111e.c+1−1
@@ -666,7 +666,7 @@ static int amd8111e_tx(struct net_device *dev) · 665 unmodified lines
666666 pci_unmap_single(lp->pci_dev, lp->tx_dma_addr[tx_index],
667667 lp->tx_skbuff[tx_index]->len,
668668 PCI_DMA_TODEVICE);
669− dev_kfree_skb_irq (lp->tx_skbuff[tx_index]);
669+ dev_consume_skb_irq(lp->tx_skbuff[tx_index]);
670670 lp->tx_skbuff[tx_index] = NULL;
671671 lp->tx_dma_addr[tx_index] = 0;
672672 }
drivers/net/ethernet/amd/xgbe/xgbe-common.h+0−2
@@ -431,8 +431,6 @@ · 430 unmodified lines
431431 #define MAC_MDIOSCAR_PA_WIDTH 5
432432 #define MAC_MDIOSCAR_RA_INDEX 0
433433 #define MAC_MDIOSCAR_RA_WIDTH 16
434−#define MAC_MDIOSCAR_REG_INDEX 0
435−#define MAC_MDIOSCAR_REG_WIDTH 21
436434 #define MAC_MDIOSCCDR_BUSY_INDEX 22
437435 #define MAC_MDIOSCCDR_BUSY_WIDTH 1
438436 #define MAC_MDIOSCCDR_CMD_INDEX 16
drivers/net/ethernet/amd/xgbe/xgbe-dev.c+16−6
@@ -1284,6 +1284,20 @@ static void xgbe_write_mmd_regs(struct xgbe_prv_data *pdata, int prtad, · 1283 unmodified lines
12841284 }
12851285 }
12861286
1287+static unsigned int xgbe_create_mdio_sca(int port, int reg)
1288+{
1289+ unsigned int mdio_sca, da;
1290+
1291+ da = (reg & MII_ADDR_C45) ? reg >> 16 : 0;
1292+
1293+ mdio_sca = 0;
1294+ XGMAC_SET_BITS(mdio_sca, MAC_MDIOSCAR, RA, reg);
1295+ XGMAC_SET_BITS(mdio_sca, MAC_MDIOSCAR, PA, port);
1296+ XGMAC_SET_BITS(mdio_sca, MAC_MDIOSCAR, DA, da);
1297+
1298+ return mdio_sca;
1299+}
1300+
12871301 static int xgbe_write_ext_mii_regs(struct xgbe_prv_data *pdata, int addr,
12881302 int reg, u16 val)
12891303 {
@@ -1291,9 +1305,7 @@ static int xgbe_write_ext_mii_regs(struct xgbe_prv_data *pdata, int addr, · 1 unmodified line
12911305
12921306 reinit_completion(&pdata->mdio_complete);
12931307
1294− mdio_sca = 0;
1295− XGMAC_SET_BITS(mdio_sca, MAC_MDIOSCAR, REG, reg);
1296− XGMAC_SET_BITS(mdio_sca, MAC_MDIOSCAR, DA, addr);
1308+ mdio_sca = xgbe_create_mdio_sca(addr, reg);
12971309 XGMAC_IOWRITE(pdata, MAC_MDIOSCAR, mdio_sca);
12981310
12991311 mdio_sccd = 0;
@@ -1317,9 +1329,7 @@ static int xgbe_read_ext_mii_regs(struct xgbe_prv_data *pdata, int addr, · 17 unmodified lines
13171329
13181330 reinit_completion(&pdata->mdio_complete);
13191331
1320− mdio_sca = 0;
1321− XGMAC_SET_BITS(mdio_sca, MAC_MDIOSCAR, REG, reg);
1322− XGMAC_SET_BITS(mdio_sca, MAC_MDIOSCAR, DA, addr);
1332+ mdio_sca = xgbe_create_mdio_sca(addr, reg);
13231333 XGMAC_IOWRITE(pdata, MAC_MDIOSCAR, mdio_sca);
13241334
13251335 mdio_sccd = 0;
drivers/net/ethernet/apple/bmac.c+1−1
@@ -777,7 +777,7 @@ static irqreturn_t bmac_txdma_intr(int irq, void *dev_id) · 776 unmodified lines
777777
778778 if (bp->tx_bufs[bp->tx_empty]) {
779779 ++dev->stats.tx_packets;
780− dev_kfree_skb_irq(bp->tx_bufs[bp->tx_empty]);
780+ dev_consume_skb_irq(bp->tx_bufs[bp->tx_empty]);
781781 }
782782 bp->tx_bufs[bp->tx_empty] = NULL;
783783 bp->tx_fullup = 0;
drivers/net/ethernet/broadcom/b44.c+2−2
@@ -638,7 +638,7 @@ static void b44_tx(struct b44 *bp) · 637 unmodified lines
638638 bytes_compl += skb->len;
639639 pkts_compl++;
640640
641− dev_kfree_skb_irq(skb);
641+ dev_consume_skb_irq(skb);
642642 }
643643
644644 netdev_completed_queue(bp->dev, pkts_compl, bytes_compl);
@@ -1012,7 +1012,7 @@ static netdev_tx_t b44_start_xmit(struct sk_buff *skb, struct net_device *dev) · 367 unmodified lines
10121012 }
10131013
10141014 skb_copy_from_linear_data(skb, skb_put(bounce_skb, len), len);
1015− dev_kfree_skb_any(skb);
1015+ dev_consume_skb_any(skb);
10161016 skb = bounce_skb;
10171017 }
10181018
drivers/net/ethernet/broadcom/bnxt/bnxt.c+8−4
@@ -5601,7 +5601,8 @@ static int bnxt_hwrm_check_pf_rings(struct bnxt *bp, int tx_rings, int rx_rings, · 5600 unmodified lines
56015601 FUNC_CFG_REQ_FLAGS_STAT_CTX_ASSETS_TEST |
56025602 FUNC_CFG_REQ_FLAGS_VNIC_ASSETS_TEST;
56035603 if (bp->flags & BNXT_FLAG_CHIP_P5)
5604− flags |= FUNC_CFG_REQ_FLAGS_RSSCOS_CTX_ASSETS_TEST;
5604+ flags |= FUNC_CFG_REQ_FLAGS_RSSCOS_CTX_ASSETS_TEST |
5605+ FUNC_CFG_REQ_FLAGS_NQ_ASSETS_TEST;
56055606 else
56065607 flags |= FUNC_CFG_REQ_FLAGS_RING_GRP_ASSETS_TEST;
56075608 }
@@ -6221,9 +6222,12 @@ static int bnxt_alloc_ctx_pg_tbls(struct bnxt *bp, · 613 unmodified lines
62216222 rmem->pg_tbl_map = ctx_pg->ctx_dma_arr[i];
62226223 rmem->depth = 1;
62236224 rmem->nr_pages = MAX_CTX_PAGES;
6224− if (i == (nr_tbls - 1))
6225− rmem->nr_pages = ctx_pg->nr_pages %
6226− MAX_CTX_PAGES;
6225+ if (i == (nr_tbls - 1)) {
6226+ int rem = ctx_pg->nr_pages % MAX_CTX_PAGES;
6227+
6228+ if (rem)
6229+ rmem->nr_pages = rem;
6230+ }
62276231 rc = bnxt_alloc_ctx_mem_blk(bp, pg_tbl);
62286232 if (rc)
62296233 break;
drivers/net/ethernet/broadcom/bnxt/bnxt_hsi.h+3−2
@@ -386,8 +386,8 @@ struct hwrm_err_output { · 385 unmodified lines
386386 #define HWRM_VERSION_MAJOR 1
387387 #define HWRM_VERSION_MINOR 10
388388 #define HWRM_VERSION_UPDATE 0
389−#define HWRM_VERSION_RSVD 33
390−#define HWRM_VERSION_STR "1.10.0.33"
389+#define HWRM_VERSION_RSVD 35
390+#define HWRM_VERSION_STR "1.10.0.35"
391391
392392 /* hwrm_ver_get_input (size:192b/24B) */
393393 struct hwrm_ver_get_input {
@@ -1184,6 +1184,7 @@ struct hwrm_func_cfg_input { · 790 unmodified lines
11841184 #define FUNC_CFG_REQ_FLAGS_L2_CTX_ASSETS_TEST 0x100000UL
11851185 #define FUNC_CFG_REQ_FLAGS_TRUSTED_VF_ENABLE 0x200000UL
11861186 #define FUNC_CFG_REQ_FLAGS_DYNAMIC_TX_RING_ALLOC 0x400000UL
1187+ #define FUNC_CFG_REQ_FLAGS_NQ_ASSETS_TEST 0x800000UL
11871188 __le32 enables;
11881189 #define FUNC_CFG_REQ_ENABLES_MTU 0x1UL
11891190 #define FUNC_CFG_REQ_ENABLES_MRU 0x2UL
drivers/net/ethernet/cadence/macb.h+3−0
@@ -643,6 +643,7 @@ · 642 unmodified lines
643643 #define MACB_CAPS_JUMBO 0x00000020
644644 #define MACB_CAPS_GEM_HAS_PTP 0x00000040
645645 #define MACB_CAPS_BD_RD_PREFETCH 0x00000080
646+#define MACB_CAPS_NEEDS_RSTONUBR 0x00000100
646647 #define MACB_CAPS_FIFO_MODE 0x10000000
647648 #define MACB_CAPS_GIGABIT_MODE_AVAILABLE 0x20000000
648649 #define MACB_CAPS_SG_DISABLED 0x40000000
@@ -1214,6 +1215,8 @@ struct macb { · 565 unmodified lines
12141215
12151216 int rx_bd_rd_prefetch;
12161217 int tx_bd_rd_prefetch;
1218+
1219+ u32 rx_intr_mask;
12171220 };
12181221
12191222 #ifdef CONFIG_MACB_USE_HWSTAMP
drivers/net/ethernet/cadence/macb_main.c+19−17
@@ -56,8 +56,7 @@ · 55 unmodified lines
5656 /* level of occupied TX descriptors under which we wake up TX process */
5757 #define MACB_TX_WAKEUP_THRESH(bp) (3 * (bp)->tx_ring_size / 4)
5858
59−#define MACB_RX_INT_FLAGS (MACB_BIT(RCOMP) | MACB_BIT(RXUBR) \
60− | MACB_BIT(ISR_ROVR))
59+#define MACB_RX_INT_FLAGS (MACB_BIT(RCOMP) | MACB_BIT(ISR_ROVR))
6160 #define MACB_TX_ERR_FLAGS (MACB_BIT(ISR_TUND) \
6261 | MACB_BIT(ISR_RLE) \
6362 | MACB_BIT(TXERR))
@@ -1270,7 +1269,7 @@ static int macb_poll(struct napi_struct *napi, int budget) · 1206 unmodified lines
12701269 queue_writel(queue, ISR, MACB_BIT(RCOMP));
12711270 napi_reschedule(napi);
12721271 } else {
1273− queue_writel(queue, IER, MACB_RX_INT_FLAGS);
1272+ queue_writel(queue, IER, bp->rx_intr_mask);
12741273 }
12751274 }
12761275
@@ -1288,7 +1287,7 @@ static void macb_hresp_error_task(unsigned long data) · 11 unmodified lines
12881287 u32 ctrl;
12891288
12901289 for (q = 0, queue = bp->queues; q < bp->num_queues; ++q, ++queue) {
1291− queue_writel(queue, IDR, MACB_RX_INT_FLAGS |
1290+ queue_writel(queue, IDR, bp->rx_intr_mask |
12921291 MACB_TX_INT_FLAGS |
12931292 MACB_BIT(HRESP));
12941293 }
@@ -1318,7 +1317,7 @@ static void macb_hresp_error_task(unsigned long data) · 23 unmodified lines
13181317
13191318 /* Enable interrupts */
13201319 queue_writel(queue, IER,
1321− MACB_RX_INT_FLAGS |
1320+ bp->rx_intr_mask |
13221321 MACB_TX_INT_FLAGS |
13231322 MACB_BIT(HRESP));
13241323 }
@@ -1372,14 +1371,14 @@ static irqreturn_t macb_interrupt(int irq, void *dev_id) · 47 unmodified lines
13721371 (unsigned int)(queue - bp->queues),
13731372 (unsigned long)status);
13741373
1375− if (status & MACB_RX_INT_FLAGS) {
1374+ if (status & bp->rx_intr_mask) {
13761375 /* There's no point taking any more interrupts
13771376 * until we have processed the buffers. The
13781377 * scheduling call may fail if the poll routine
13791378 * is already scheduled, so disable interrupts
13801379 * now.
13811380 */
1382− queue_writel(queue, IDR, MACB_RX_INT_FLAGS);
1381+ queue_writel(queue, IDR, bp->rx_intr_mask);
13831382 if (bp->caps & MACB_CAPS_ISR_CLEAR_ON_WRITE)
13841383 queue_writel(queue, ISR, MACB_BIT(RCOMP));
13851384
@@ -1412,8 +1411,9 @@ static irqreturn_t macb_interrupt(int irq, void *dev_id) · 26 unmodified lines
14121411 /* There is a hardware issue under heavy load where DMA can
14131412 * stop, this causes endless "used buffer descriptor read"
14141413 * interrupts but it can be cleared by re-enabling RX. See
1415− * the at91 manual, section 41.3.1 or the Zynq manual
1416− * section 16.7.4 for details.
1414+ * the at91rm9200 manual, section 41.3.1 or the Zynq manual
1415+ * section 16.7.4 for details. RXUBR is only enabled for
1416+ * these two versions.
14171417 */
14181418 if (status & MACB_BIT(RXUBR)) {
14191419 ctrl = macb_readl(bp, NCR);
@@ -1738,12 +1738,8 @@ static int macb_pad_and_fcs(struct sk_buff **skb, struct net_device *ndev) · 318 unmodified lines
17381738 *skb = nskb;
17391739 }
17401740
1741− if (padlen) {
1742− if (padlen >= ETH_FCS_LEN)
1743− skb_put_zero(*skb, padlen - ETH_FCS_LEN);
1744− else
1745− skb_trim(*skb, ETH_FCS_LEN - padlen);
1746− }
1741+ if (padlen > ETH_FCS_LEN)
1742+ skb_put_zero(*skb, padlen - ETH_FCS_LEN);
17471743
17481744 add_fcs:
17491745 /* set FCS to packet */
@@ -2263,7 +2259,7 @@ static void macb_init_hw(struct macb *bp) · 513 unmodified lines
22632259
22642260 /* Enable interrupts */
22652261 queue_writel(queue, IER,
2266− MACB_RX_INT_FLAGS |
2262+ bp->rx_intr_mask |
22672263 MACB_TX_INT_FLAGS |
22682264 MACB_BIT(HRESP));
22692265 }
@@ -3911,6 +3907,7 @@ static const struct macb_config sama5d4_config = { · 1641 unmodified lines
39113907 };
39123908
39133909 static const struct macb_config emac_config = {
3910+ .caps = MACB_CAPS_NEEDS_RSTONUBR,
39143911 .clk_init = at91ether_clk_init,
39153912 .init = at91ether_init,
39163913 };
@@ -3932,7 +3929,8 @@ static const struct macb_config zynqmp_config = { · 15 unmodified lines
39323929 };
39333930
39343931 static const struct macb_config zynq_config = {
3935− .caps = MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_NO_GIGABIT_HALF,
3932+ .caps = MACB_CAPS_GIGABIT_MODE_AVAILABLE | MACB_CAPS_NO_GIGABIT_HALF |
3933+ MACB_CAPS_NEEDS_RSTONUBR,
39363934 .dma_burst_length = 16,
39373935 .clk_init = macb_clk_init,
39383936 .init = macb_init,
@@ -4087,6 +4085,10 @@ static int macb_probe(struct platform_device *pdev) · 148 unmodified lines
40874085 macb_dma_desc_get_size(bp);
40884086 }
40894087
4088+ bp->rx_intr_mask = MACB_RX_INT_FLAGS;
4089+ if (bp->caps & MACB_CAPS_NEEDS_RSTONUBR)
4090+ bp->rx_intr_mask |= MACB_BIT(RXUBR);
4091+
40904092 mac = of_get_mac_address(np);
40914093 if (mac) {
40924094 ether_addr_copy(bp->dev->dev_addr, mac);
drivers/net/ethernet/chelsio/cxgb3/sge.c+7−5
@@ -2381,7 +2381,7 @@ no_mem: · 2380 unmodified lines
23812381 lro_add_page(adap, qs, fl,
23822382 G_RSPD_LEN(len),
23832383 flags & F_RSPD_EOP);
2384− goto next_fl;
2384+ goto next_fl;
23852385 }
23862386
23872387 skb = get_packet_pg(adap, fl, q,
@@ -3214,11 +3214,13 @@ void t3_start_sge_timers(struct adapter *adap) · 826 unmodified lines
32143214 for (i = 0; i < SGE_QSETS; ++i) {
32153215 struct sge_qset *q = &adap->sge.qs[i];
32163216
3217− if (q->tx_reclaim_timer.function)
3218− mod_timer(&q->tx_reclaim_timer, jiffies + TX_RECLAIM_PERIOD);
3217+ if (q->tx_reclaim_timer.function)
3218+ mod_timer(&q->tx_reclaim_timer,
3219+ jiffies + TX_RECLAIM_PERIOD);
32193220
3220− if (q->rx_reclaim_timer.function)
3221− mod_timer(&q->rx_reclaim_timer, jiffies + RX_RECLAIM_PERIOD);
3221+ if (q->rx_reclaim_timer.function)
3222+ mod_timer(&q->rx_reclaim_timer,
3223+ jiffies + RX_RECLAIM_PERIOD);
32223224 }
32233225 }
32243226
drivers/net/ethernet/chelsio/cxgb3/t3_hw.c+3−3
@@ -1082,7 +1082,7 @@ int t3_check_fw_version(struct adapter *adapter) · 1081 unmodified lines
10821082 CH_WARN(adapter, "found newer FW version(%u.%u), "
10831083 "driver compiled for version %u.%u\n", major, minor,
10841084 FW_VERSION_MAJOR, FW_VERSION_MINOR);
1085− return 0;
1085+ return 0;
10861086 }
10871087 return -EINVAL;
10881088 }
@@ -3619,7 +3619,7 @@ int t3_reset_adapter(struct adapter *adapter) · 2530 unmodified lines
36193619
36203620 static int init_parity(struct adapter *adap)
36213621 {
3622− int i, err, addr;
3622+ int i, err, addr;
36233623
36243624 if (t3_read_reg(adap, A_SG_CONTEXT_CMD) & F_CONTEXT_CMD_BUSY)
36253625 return -EBUSY;
@@ -3806,6 +3806,6 @@ int t3_replay_prep_adapter(struct adapter *adapter) · 180 unmodified lines
38063806 p->phy.ops->power_down(&p->phy, 1);
38073807 }
38083808
3809−return 0;
3809+ return 0;
38103810 }
38113811
drivers/net/ethernet/chelsio/cxgb4/cxgb4_ptp.c+4−4
@@ -378,10 +378,10 @@ static void cxgb4_init_ptp_timer(struct adapter *adapter) · 377 unmodified lines
378378 int err;
379379
380380 memset(&c, 0, sizeof(c));
381− c.op_to_portid = cpu_to_be32(FW_CMD_OP_V(FW_PTP_CMD) |
382− FW_CMD_REQUEST_F |
383− FW_CMD_WRITE_F |
384− FW_PTP_CMD_PORTID_V(0));
381+ c.op_to_portid = cpu_to_be32(FW_CMD_OP_V(FW_PTP_CMD) |
382+ FW_CMD_REQUEST_F |
383+ FW_CMD_WRITE_F |
384+ FW_PTP_CMD_PORTID_V(0));
385385 c.retval_len16 = cpu_to_be32(FW_CMD_LEN16_V(sizeof(c) / 16));
386386 c.u.scmd.sc = FW_PTP_SC_INIT_TIMER;
387387
drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.c+1−1
@@ -78,7 +78,7 @@ static void free_msix_idx_in_bmap(struct adapter *adap, unsigned int msix_idx) · 77 unmodified lines
7878 unsigned long flags;
7979
8080 spin_lock_irqsave(&bmap->lock, flags);
81− __clear_bit(msix_idx, bmap->msix_bmap);
81+ __clear_bit(msix_idx, bmap->msix_bmap);
8282 spin_unlock_irqrestore(&bmap->lock, flags);
8383 }
8484
drivers/net/ethernet/chelsio/cxgb4/t4_hw.c+1−1
@@ -3794,7 +3794,7 @@ int t4_load_phy_fw(struct adapter *adap, · 3793 unmodified lines
37943794 /* If we have version number support, then check to see if the adapter
37953795 * already has up-to-date PHY firmware loaded.
37963796 */
3797− if (phy_fw_version) {
3797+ if (phy_fw_version) {
37983798 new_phy_fw_vers = phy_fw_version(phy_fw_data, phy_fw_size);
37993799 ret = t4_phy_fw_ver(adap, &cur_phy_fw_ver);
38003800 if (ret < 0)
drivers/net/ethernet/freescale/dpaa/dpaa_eth.c+6−0
@@ -2051,6 +2051,7 @@ dpaa_start_xmit(struct sk_buff *skb, struct net_device *net_dev) · 2050 unmodified lines
20512051 bool nonlinear = skb_is_nonlinear(skb);
20522052 struct rtnl_link_stats64 *percpu_stats;
20532053 struct dpaa_percpu_priv *percpu_priv;
2054+ struct netdev_queue *txq;
20542055 struct dpaa_priv *priv;
20552056 struct qm_fd fd;
20562057 int offset = 0;
@@ -2100,6 +2101,11 @@ dpaa_start_xmit(struct sk_buff *skb, struct net_device *net_dev) · 43 unmodified lines
21002101 if (unlikely(err < 0))
21012102 goto skb_to_fd_failed;
21022103
2104+ txq = netdev_get_tx_queue(net_dev, queue_mapping);
2105+
2106+ /* LLTX requires to do our own update of trans_start */
2107+ txq->trans_start = jiffies;
2108+
21032109 if (priv->tx_tstamp && skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP) {
21042110 fd.cmd |= cpu_to_be32(FM_FD_CMD_UPD);
21052111 skb_shinfo(skb)->tx_flags |= SKBTX_IN_PROGRESS;
drivers/net/ethernet/freescale/dpaa2/Kconfig+3−2
@@ -9,8 +9,9 @@ config FSL_DPAA2_ETH · 8 unmodified lines
99
1010 config FSL_DPAA2_PTP_CLOCK
1111 tristate "Freescale DPAA2 PTP Clock"
12− depends on FSL_DPAA2_ETH && POSIX_TIMERS
13− select PTP_1588_CLOCK
12+ depends on FSL_DPAA2_ETH
13+ imply PTP_1588_CLOCK
14+ default y
1415 help
1516 This driver adds support for using the DPAA2 1588 timer module
1617 as a PTP clock.
drivers/net/ethernet/freescale/fec_main.c+1−1
@@ -3467,7 +3467,7 @@ fec_probe(struct platform_device *pdev) · 3466 unmodified lines
34673467 if (ret)
34683468 goto failed_clk_ipg;
34693469
3470− fep->reg_phy = devm_regulator_get(&pdev->dev, "phy");
3470+ fep->reg_phy = devm_regulator_get_optional(&pdev->dev, "phy");
34713471 if (!IS_ERR(fep->reg_phy)) {
34723472 ret = regulator_enable(fep->reg_phy);
34733473 if (ret) {
drivers/net/ethernet/hisilicon/hns/hns_ae_adapt.c+2−4
@@ -147,12 +147,10 @@ static void hns_ae_put_handle(struct hnae_handle *handle) · 146 unmodified lines
147147 struct hnae_vf_cb *vf_cb = hns_ae_get_vf_cb(handle);
148148 int i;
149149
150− vf_cb->mac_cb = NULL;
151−
152− kfree(vf_cb);
153−
154150 for (i = 0; i < handle->q_num; i++)
155151 hns_ae_get_ring_pair(handle->qs[i])->used_by_vf = 0;
152+
153+ kfree(vf_cb);
156154 }
157155
158156 static int hns_ae_wait_flow_down(struct hnae_handle *handle)
drivers/net/ethernet/hisilicon/hns/hns_enet.c+12−10
@@ -1170,6 +1170,13 @@ int hns_nic_init_phy(struct net_device *ndev, struct hnae_handle *h) · 1169 unmodified lines
11701170 if (!h->phy_dev)
11711171 return 0;
11721172
1173+ ethtool_convert_legacy_u32_to_link_mode(supported, h->if_support);
1174+ linkmode_and(phy_dev->supported, phy_dev->supported, supported);
1175+ linkmode_copy(phy_dev->advertising, phy_dev->supported);
1176+
1177+ if (h->phy_if == PHY_INTERFACE_MODE_XGMII)
1178+ phy_dev->autoneg = false;
1179+
11731180 if (h->phy_if != PHY_INTERFACE_MODE_XGMII) {
11741181 phy_dev->dev_flags = 0;
11751182
@@ -1181,16 +1188,6 @@ int hns_nic_init_phy(struct net_device *ndev, struct hnae_handle *h) · 5 unmodified lines
11811188 if (unlikely(ret))
11821189 return -ENODEV;
11831190
1184− ethtool_convert_legacy_u32_to_link_mode(supported, h->if_support);
1185− linkmode_and(phy_dev->supported, phy_dev->supported, supported);
1186− linkmode_copy(phy_dev->advertising, phy_dev->supported);
1187−
1188− if (h->phy_if == PHY_INTERFACE_MODE_XGMII)
1189− phy_dev->autoneg = false;
1190−
1191− if (h->phy_if == PHY_INTERFACE_MODE_SGMII)
1192− phy_stop(phy_dev);
1193−
11941191 return 0;
11951192 }
11961193
@@ -2421,6 +2418,8 @@ static int hns_nic_dev_probe(struct platform_device *pdev) · 1224 unmodified lines
24212418 out_notify_fail:
24222419 (void)cancel_work_sync(&priv->service_task);
24232420 out_read_prop_fail:
2421+ /* safe for ACPI FW */
2422+ of_node_put(to_of_node(priv->fwnode));
24242423 free_netdev(ndev);
24252424 return ret;
24262425 }
@@ -2450,6 +2449,9 @@ static int hns_nic_dev_remove(struct platform_device *pdev) · 23 unmodified lines
24502449 set_bit(NIC_STATE_REMOVING, &priv->state);
24512450 (void)cancel_work_sync(&priv->service_task);
24522451
2452+ /* safe for ACPI FW */
2453+ of_node_put(to_of_node(priv->fwnode));
2454+
24532455 free_netdev(ndev);
24542456 return 0;
24552457 }
drivers/net/ethernet/hisilicon/hns/hns_ethtool.c+9−7
@@ -1157,16 +1157,18 @@ static int hns_get_regs_len(struct net_device *net_dev) · 1156 unmodified lines
11571157 */
11581158 static int hns_nic_nway_reset(struct net_device *netdev)
11591159 {
1160− int ret = 0;
11611160 struct phy_device *phy = netdev->phydev;
11621161
1163− if (netif_running(netdev)) {
1164− /* if autoneg is disabled, don't restart auto-negotiation */
1165− if (phy && phy->autoneg == AUTONEG_ENABLE)
1166− ret = genphy_restart_aneg(phy);
1167− }
1162+ if (!netif_running(netdev))
1163+ return 0;
11681164
1169− return ret;
1165+ if (!phy)
1166+ return -EOPNOTSUPP;
1167+
1168+ if (phy->autoneg != AUTONEG_ENABLE)
1169+ return -EINVAL;
1170+
1171+ return genphy_restart_aneg(phy);
11701172 }
11711173
11721174 static u32
drivers/net/ethernet/hisilicon/hns_mdio.c+1−1
@@ -321,7 +321,7 @@ static int hns_mdio_read(struct mii_bus *bus, int phy_id, int regnum) · 320 unmodified lines
321321 }
322322
323323 hns_mdio_cmd_write(mdio_dev, is_c45,
324− MDIO_C45_WRITE_ADDR, phy_id, devad);
324+ MDIO_C45_READ, phy_id, devad);
325325 }
326326
327327 /* Step 5: waitting for MDIO_COMMAND_REG 's mdio_start==0,*/
drivers/net/ethernet/i825xx/82596.c+1−1
@@ -1310,7 +1310,7 @@ static irqreturn_t i596_interrupt(int irq, void *dev_id) · 1309 unmodified lines
13101310 dev->stats.tx_aborted_errors++;
13111311 }
13121312
1313− dev_kfree_skb_irq(skb);
1313+ dev_consume_skb_irq(skb);
13141314
13151315 tx_cmd->cmd.command = 0; /* Mark free */
13161316 break;
drivers/net/ethernet/ibm/ibmveth.c+0−2
@@ -1313,7 +1313,6 @@ static int ibmveth_poll(struct napi_struct *napi, int budget) · 1312 unmodified lines
13131313 unsigned long lpar_rc;
13141314 u16 mss = 0;
13151315
1316−restart_poll:
13171316 while (frames_processed < budget) {
13181317 if (!ibmveth_rxq_pending_buffer(adapter))
13191318 break;
@@ -1401,7 +1400,6 @@ restart_poll: · 81 unmodified lines
14011400 napi_reschedule(napi)) {
14021401 lpar_rc = h_vio_signal(adapter->vdev->unit_address,
14031402 VIO_IRQ_DISABLE);
1404− goto restart_poll;
14051403 }
14061404 }
14071405
drivers/net/ethernet/intel/Kconfig+1−1
@@ -159,7 +159,7 @@ config IXGBE · 158 unmodified lines
159159 tristate "Intel(R) 10GbE PCI Express adapters support"
160160 depends on PCI
161161 select MDIO
162− select MDIO_DEVICE
162+ select PHYLIB
163163 imply PTP_1588_CLOCK
164164 ---help---
165165 This driver supports Intel(R) 10GbE PCI Express family of
drivers/net/ethernet/intel/igb/igb.h+1−1
@@ -515,7 +515,7 @@ struct igb_adapter { · 514 unmodified lines
515515 /* OS defined structs */
516516 struct pci_dev *pdev;
517517
518− struct mutex stats64_lock;
518+ spinlock_t stats64_lock;
519519 struct rtnl_link_stats64 stats64;
520520
521521 /* structs defined in e1000_hw.h */
drivers/net/ethernet/intel/igb/igb_ethtool.c+2−2
@@ -2295,7 +2295,7 @@ static void igb_get_ethtool_stats(struct net_device *netdev, · 2294 unmodified lines
22952295 int i, j;
22962296 char *p;
22972297
2298− mutex_lock(&adapter->stats64_lock);
2298+ spin_lock(&adapter->stats64_lock);
22992299 igb_update_stats(adapter);
23002300
23012301 for (i = 0; i < IGB_GLOBAL_STATS_LEN; i++) {
@@ -2338,7 +2338,7 @@ static void igb_get_ethtool_stats(struct net_device *netdev, · 36 unmodified lines
23382338 } while (u64_stats_fetch_retry_irq(&ring->rx_syncp, start));
23392339 i += IGB_RX_QUEUE_STATS_LEN;
23402340 }
2341− mutex_unlock(&adapter->stats64_lock);
2341+ spin_unlock(&adapter->stats64_lock);
23422342 }
23432343
23442344 static void igb_get_strings(struct net_device *netdev, u32 stringset, u8 *data)
drivers/net/ethernet/intel/igb/igb_main.c+7−7
@@ -2203,9 +2203,9 @@ void igb_down(struct igb_adapter *adapter) · 2202 unmodified lines
22032203 del_timer_sync(&adapter->phy_info_timer);
22042204
22052205 /* record the stats before reset*/
2206− mutex_lock(&adapter->stats64_lock);
2206+ spin_lock(&adapter->stats64_lock);
22072207 igb_update_stats(adapter);
2208− mutex_unlock(&adapter->stats64_lock);
2208+ spin_unlock(&adapter->stats64_lock);
22092209
22102210 adapter->link_speed = 0;
22112211 adapter->link_duplex = 0;
@@ -3840,7 +3840,7 @@ static int igb_sw_init(struct igb_adapter *adapter) · 1628 unmodified lines
38403840 adapter->min_frame_size = ETH_ZLEN + ETH_FCS_LEN;
38413841
38423842 spin_lock_init(&adapter->nfc_lock);
3843− mutex_init(&adapter->stats64_lock);
3843+ spin_lock_init(&adapter->stats64_lock);
38443844 #ifdef CONFIG_PCI_IOV
38453845 switch (hw->mac.type) {
38463846 case e1000_82576:
@@ -5406,9 +5406,9 @@ no_wait: · 1559 unmodified lines
54065406 }
54075407 }
54085408
5409− mutex_lock(&adapter->stats64_lock);
5409+ spin_lock(&adapter->stats64_lock);
54105410 igb_update_stats(adapter);
5411− mutex_unlock(&adapter->stats64_lock);
5411+ spin_unlock(&adapter->stats64_lock);
54125412
54135413 for (i = 0; i < adapter->num_tx_queues; i++) {
54145414 struct igb_ring *tx_ring = adapter->tx_ring[i];
@@ -6235,10 +6235,10 @@ static void igb_get_stats64(struct net_device *netdev, · 820 unmodified lines
62356235 {
62366236 struct igb_adapter *adapter = netdev_priv(netdev);
62376237
6238− mutex_lock(&adapter->stats64_lock);
6238+ spin_lock(&adapter->stats64_lock);
62396239 igb_update_stats(adapter);
62406240 memcpy(stats, &adapter->stats64, sizeof(*stats));
6241− mutex_unlock(&adapter->stats64_lock);
6241+ spin_unlock(&adapter->stats64_lock);
62426242 }
62436243
62446244 /**
drivers/net/ethernet/marvell/octeontx2/af/cgx.c+3−1
@@ -825,7 +825,7 @@ static int cgx_probe(struct pci_dev *pdev, const struct pci_device_id *id) · 824 unmodified lines
825825 if (!cgx->cgx_cmd_workq) {
826826 dev_err(dev, "alloc workqueue failed for cgx cmd");
827827 err = -ENOMEM;
828− goto err_release_regions;
828+ goto err_free_irq_vectors;
829829 }
830830
831831 list_add(&cgx->cgx_list, &cgx_list);
@@ -841,6 +841,8 @@ static int cgx_probe(struct pci_dev *pdev, const struct pci_device_id *id) · 9 unmodified lines
841841 err_release_lmac:
842842 cgx_lmac_exit(cgx);
843843 list_del(&cgx->cgx_list);
844+err_free_irq_vectors:
845+ pci_free_irq_vectors(pdev);
844846 err_release_regions:
845847 pci_release_regions(pdev);
846848 err_disable_device:
drivers/net/ethernet/mediatek/mtk_eth_soc.c+0−16
@@ -258,11 +258,6 @@ static void mtk_phy_link_adjust(struct net_device *dev) · 257 unmodified lines
258258
259259 mtk_w32(mac->hw, mcr, MTK_MAC_MCR(mac->id));
260260
261− if (dev->phydev->link)
262− netif_carrier_on(dev);
263− else
264− netif_carrier_off(dev);
265−
266261 if (!of_phy_is_fixed_link(mac->of_node))
267262 phy_print_status(dev->phydev);
268263 }
@@ -347,17 +342,6 @@ static int mtk_phy_connect(struct net_device *dev) · 78 unmodified lines
347342 if (mtk_phy_connect_node(eth, mac, np))
348343 goto err_phy;
349344
350− dev->phydev->autoneg = AUTONEG_ENABLE;
351− dev->phydev->speed = 0;
352− dev->phydev->duplex = 0;
353−
354− phy_set_max_speed(dev->phydev, SPEED_1000);
355− phy_support_asym_pause(dev->phydev);
356− linkmode_copy(dev->phydev->advertising, dev->phydev->supported);
357− linkmode_set_bit(ETHTOOL_LINK_MODE_Autoneg_BIT,
358− dev->phydev->advertising);
359− phy_start_aneg(dev->phydev);
360−
361345 of_node_put(np);
362346
363347 return 0;
drivers/net/ethernet/mellanox/mlx4/cq.c+4−2
@@ -306,14 +306,16 @@ static int mlx4_init_user_cqes(void *buf, int entries, int cqe_size) · 305 unmodified lines
306306
307307 if (entries_per_copy < entries) {
308308 for (i = 0; i < entries / entries_per_copy; i++) {
309− err = copy_to_user(buf, init_ents, PAGE_SIZE);
309+ err = copy_to_user((void __user *)buf, init_ents, PAGE_SIZE) ?
310+ -EFAULT : 0;
310311 if (err)
311312 goto out;
312313
313314 buf += PAGE_SIZE;
314315 }
315316 } else {
316− err = copy_to_user(buf, init_ents, entries * cqe_size);
317+ err = copy_to_user((void __user *)buf, init_ents, entries * cqe_size) ?
318+ -EFAULT : 0;
317319 }
318320
319321 out:
drivers/net/ethernet/mellanox/mlx4/fw.c+46−29
@@ -2067,9 +2067,11 @@ int mlx4_QUERY_HCA(struct mlx4_dev *dev, · 2066 unmodified lines
20672067 {
20682068 struct mlx4_cmd_mailbox *mailbox;
20692069 __be32 *outbox;
2070+ u64 qword_field;
20702071 u32 dword_field;
2071− int err;
2072+ u16 word_field;
20722073 u8 byte_field;
2074+ int err;
20732075 static const u8 a0_dmfs_query_hw_steering[] = {
20742076 [0] = MLX4_STEERING_DMFS_A0_DEFAULT,
20752077 [1] = MLX4_STEERING_DMFS_A0_DYNAMIC,
@@ -2097,19 +2099,32 @@ int mlx4_QUERY_HCA(struct mlx4_dev *dev, · 21 unmodified lines
20972099
20982100 /* QPC/EEC/CQC/EQC/RDMARC attributes */
20992101
2100− MLX4_GET(param->qpc_base, outbox, INIT_HCA_QPC_BASE_OFFSET);
2101− MLX4_GET(param->log_num_qps, outbox, INIT_HCA_LOG_QP_OFFSET);
2102− MLX4_GET(param->srqc_base, outbox, INIT_HCA_SRQC_BASE_OFFSET);
2103− MLX4_GET(param->log_num_srqs, outbox, INIT_HCA_LOG_SRQ_OFFSET);
2104− MLX4_GET(param->cqc_base, outbox, INIT_HCA_CQC_BASE_OFFSET);
2105− MLX4_GET(param->log_num_cqs, outbox, INIT_HCA_LOG_CQ_OFFSET);
2106− MLX4_GET(param->altc_base, outbox, INIT_HCA_ALTC_BASE_OFFSET);
2107− MLX4_GET(param->auxc_base, outbox, INIT_HCA_AUXC_BASE_OFFSET);
2108− MLX4_GET(param->eqc_base, outbox, INIT_HCA_EQC_BASE_OFFSET);
2109− MLX4_GET(param->log_num_eqs, outbox, INIT_HCA_LOG_EQ_OFFSET);
2110− MLX4_GET(param->num_sys_eqs, outbox, INIT_HCA_NUM_SYS_EQS_OFFSET);
2111− MLX4_GET(param->rdmarc_base, outbox, INIT_HCA_RDMARC_BASE_OFFSET);
2112− MLX4_GET(param->log_rd_per_qp, outbox, INIT_HCA_LOG_RD_OFFSET);
2102+ MLX4_GET(qword_field, outbox, INIT_HCA_QPC_BASE_OFFSET);
2103+ param->qpc_base = qword_field & ~((u64)0x1f);
2104+ MLX4_GET(byte_field, outbox, INIT_HCA_LOG_QP_OFFSET);
2105+ param->log_num_qps = byte_field & 0x1f;
2106+ MLX4_GET(qword_field, outbox, INIT_HCA_SRQC_BASE_OFFSET);
2107+ param->srqc_base = qword_field & ~((u64)0x1f);
2108+ MLX4_GET(byte_field, outbox, INIT_HCA_LOG_SRQ_OFFSET);
2109+ param->log_num_srqs = byte_field & 0x1f;
2110+ MLX4_GET(qword_field, outbox, INIT_HCA_CQC_BASE_OFFSET);
2111+ param->cqc_base = qword_field & ~((u64)0x1f);
2112+ MLX4_GET(byte_field, outbox, INIT_HCA_LOG_CQ_OFFSET);
2113+ param->log_num_cqs = byte_field & 0x1f;
2114+ MLX4_GET(qword_field, outbox, INIT_HCA_ALTC_BASE_OFFSET);
2115+ param->altc_base = qword_field;
2116+ MLX4_GET(qword_field, outbox, INIT_HCA_AUXC_BASE_OFFSET);
2117+ param->auxc_base = qword_field;
2118+ MLX4_GET(qword_field, outbox, INIT_HCA_EQC_BASE_OFFSET);
2119+ param->eqc_base = qword_field & ~((u64)0x1f);
2120+ MLX4_GET(byte_field, outbox, INIT_HCA_LOG_EQ_OFFSET);
2121+ param->log_num_eqs = byte_field & 0x1f;
2122+ MLX4_GET(word_field, outbox, INIT_HCA_NUM_SYS_EQS_OFFSET);
2123+ param->num_sys_eqs = word_field & 0xfff;
2124+ MLX4_GET(qword_field, outbox, INIT_HCA_RDMARC_BASE_OFFSET);
2125+ param->rdmarc_base = qword_field & ~((u64)0x1f);
2126+ MLX4_GET(byte_field, outbox, INIT_HCA_LOG_RD_OFFSET);
2127+ param->log_rd_per_qp = byte_field & 0x7;
21132128
21142129 MLX4_GET(dword_field, outbox, INIT_HCA_FLAGS_OFFSET);
21152130 if (dword_field & (1 << INIT_HCA_DEVICE_MANAGED_FLOW_STEERING_EN)) {
@@ -2128,22 +2143,21 @@ int mlx4_QUERY_HCA(struct mlx4_dev *dev, · 12 unmodified lines
21282143 /* steering attributes */
21292144 if (param->steering_mode == MLX4_STEERING_MODE_DEVICE_MANAGED) {
21302145 MLX4_GET(param->mc_base, outbox, INIT_HCA_FS_BASE_OFFSET);
2131− MLX4_GET(param->log_mc_entry_sz, outbox,
2132− INIT_HCA_FS_LOG_ENTRY_SZ_OFFSET);
2133− MLX4_GET(param->log_mc_table_sz, outbox,
2134− INIT_HCA_FS_LOG_TABLE_SZ_OFFSET);
2135− MLX4_GET(byte_field, outbox,
2136− INIT_HCA_FS_A0_OFFSET);
2146+ MLX4_GET(byte_field, outbox, INIT_HCA_FS_LOG_ENTRY_SZ_OFFSET);
2147+ param->log_mc_entry_sz = byte_field & 0x1f;
2148+ MLX4_GET(byte_field, outbox, INIT_HCA_FS_LOG_TABLE_SZ_OFFSET);
2149+ param->log_mc_table_sz = byte_field & 0x1f;
2150+ MLX4_GET(byte_field, outbox, INIT_HCA_FS_A0_OFFSET);
21372151 param->dmfs_high_steer_mode =
21382152 a0_dmfs_query_hw_steering[(byte_field >> 6) & 3];
21392153 } else {
21402154 MLX4_GET(param->mc_base, outbox, INIT_HCA_MC_BASE_OFFSET);
2141− MLX4_GET(param->log_mc_entry_sz, outbox,
2142− INIT_HCA_LOG_MC_ENTRY_SZ_OFFSET);
2143− MLX4_GET(param->log_mc_hash_sz, outbox,
2144− INIT_HCA_LOG_MC_HASH_SZ_OFFSET);
2145− MLX4_GET(param->log_mc_table_sz, outbox,
2146− INIT_HCA_LOG_MC_TABLE_SZ_OFFSET);
2155+ MLX4_GET(byte_field, outbox, INIT_HCA_LOG_MC_ENTRY_SZ_OFFSET);
2156+ param->log_mc_entry_sz = byte_field & 0x1f;
2157+ MLX4_GET(byte_field, outbox, INIT_HCA_LOG_MC_HASH_SZ_OFFSET);
2158+ param->log_mc_hash_sz = byte_field & 0x1f;
2159+ MLX4_GET(byte_field, outbox, INIT_HCA_LOG_MC_TABLE_SZ_OFFSET);
2160+ param->log_mc_table_sz = byte_field & 0x1f;
21472161 }
21482162
21492163 /* CX3 is capable of extending CQEs/EQEs from 32 to 64 bytes */
@@ -2167,15 +2181,18 @@ int mlx4_QUERY_HCA(struct mlx4_dev *dev, · 17 unmodified lines
21672181 /* TPT attributes */
21682182
21692183 MLX4_GET(param->dmpt_base, outbox, INIT_HCA_DMPT_BASE_OFFSET);
2170− MLX4_GET(param->mw_enabled, outbox, INIT_HCA_TPT_MW_OFFSET);
2171− MLX4_GET(param->log_mpt_sz, outbox, INIT_HCA_LOG_MPT_SZ_OFFSET);
2184+ MLX4_GET(byte_field, outbox, INIT_HCA_TPT_MW_OFFSET);
2185+ param->mw_enabled = byte_field >> 7;
2186+ MLX4_GET(byte_field, outbox, INIT_HCA_LOG_MPT_SZ_OFFSET);
2187+ param->log_mpt_sz = byte_field & 0x3f;
21722188 MLX4_GET(param->mtt_base, outbox, INIT_HCA_MTT_BASE_OFFSET);
21732189 MLX4_GET(param->cmpt_base, outbox, INIT_HCA_CMPT_BASE_OFFSET);
21742190
21752191 /* UAR attributes */
21762192
21772193 MLX4_GET(param->uar_page_sz, outbox, INIT_HCA_UAR_PAGE_SZ_OFFSET);
2178− MLX4_GET(param->log_uar_sz, outbox, INIT_HCA_LOG_UAR_SZ_OFFSET);
2194+ MLX4_GET(byte_field, outbox, INIT_HCA_LOG_UAR_SZ_OFFSET);
2195+ param->log_uar_sz = byte_field & 0xf;
21792196
21802197 /* phv_check enable */
21812198 MLX4_GET(byte_field, outbox, INIT_HCA_CACHELINE_SZ_OFFSET);
drivers/net/ethernet/mellanox/mlx4/icm.c+60−41
@@ -57,12 +57,12 @@ static void mlx4_free_icm_pages(struct mlx4_dev *dev, struct mlx4_icm_chunk *chu · 56 unmodified lines
5757 int i;
5858
5959 if (chunk->nsg > 0)
60− pci_unmap_sg(dev->persist->pdev, chunk->mem, chunk->npages,
61− PCI_DMA_BIDIRECTIONAL);
60+ dma_unmap_sg(&dev->persist->pdev->dev, chunk->sg, chunk->npages,
61+ DMA_BIDIRECTIONAL);
6262
6363 for (i = 0; i < chunk->npages; ++i)
64− __free_pages(sg_page(&chunk->mem[i]),
65− get_order(chunk->mem[i].length));
64+ __free_pages(sg_page(&chunk->sg[i]),
65+ get_order(chunk->sg[i].length));
6666 }
6767
6868 static void mlx4_free_icm_coherent(struct mlx4_dev *dev, struct mlx4_icm_chunk *chunk)
@@ -71,9 +71,9 @@ static void mlx4_free_icm_coherent(struct mlx4_dev *dev, struct mlx4_icm_chunk * · 2 unmodified lines
7171
7272 for (i = 0; i < chunk->npages; ++i)
7373 dma_free_coherent(&dev->persist->pdev->dev,
74− chunk->mem[i].length,
75− lowmem_page_address(sg_page(&chunk->mem[i])),
76− sg_dma_address(&chunk->mem[i]));
74+ chunk->buf[i].size,
75+ chunk->buf[i].addr,
76+ chunk->buf[i].dma_addr);
7777 }
7878
7979 void mlx4_free_icm(struct mlx4_dev *dev, struct mlx4_icm *icm, int coherent)
@@ -111,22 +111,21 @@ static int mlx4_alloc_icm_pages(struct scatterlist *mem, int order, · 31 unmodified lines
111111 return 0;
112112 }
113113
114−static int mlx4_alloc_icm_coherent(struct device *dev, struct scatterlist *mem,
115− int order, gfp_t gfp_mask)
114+static int mlx4_alloc_icm_coherent(struct device *dev, struct mlx4_icm_buf *buf,
115+ int order, gfp_t gfp_mask)
116116 {
117− void *buf = dma_alloc_coherent(dev, PAGE_SIZE << order,
118− &sg_dma_address(mem), gfp_mask);
119− if (!buf)
117+ buf->addr = dma_alloc_coherent(dev, PAGE_SIZE << order,
118+ &buf->dma_addr, gfp_mask);
119+ if (!buf->addr)
120120 return -ENOMEM;
121121
122− if (offset_in_page(buf)) {
123− dma_free_coherent(dev, PAGE_SIZE << order,
124− buf, sg_dma_address(mem));
122+ if (offset_in_page(buf->addr)) {
123+ dma_free_coherent(dev, PAGE_SIZE << order, buf->addr,
124+ buf->dma_addr);
125125 return -ENOMEM;
126126 }
127127
128− sg_set_buf(mem, buf, PAGE_SIZE << order);
129− sg_dma_len(mem) = PAGE_SIZE << order;
128+ buf->size = PAGE_SIZE << order;
130129 return 0;
131130 }
132131
@@ -159,21 +158,21 @@ struct mlx4_icm *mlx4_alloc_icm(struct mlx4_dev *dev, int npages, · 26 unmodified lines
159158
160159 while (npages > 0) {
161160 if (!chunk) {
162− chunk = kmalloc_node(sizeof(*chunk),
161+ chunk = kzalloc_node(sizeof(*chunk),
163162 gfp_mask & ~(__GFP_HIGHMEM |
164163 __GFP_NOWARN),
165164 dev->numa_node);
166165 if (!chunk) {
167− chunk = kmalloc(sizeof(*chunk),
166+ chunk = kzalloc(sizeof(*chunk),
168167 gfp_mask & ~(__GFP_HIGHMEM |
169168 __GFP_NOWARN));
170169 if (!chunk)
171170 goto fail;
172171 }
172+ chunk->coherent = coherent;
173173
174− sg_init_table(chunk->mem, MLX4_ICM_CHUNK_LEN);
175− chunk->npages = 0;
176− chunk->nsg = 0;
174+ if (!coherent)
175+ sg_init_table(chunk->sg, MLX4_ICM_CHUNK_LEN);
177176 list_add_tail(&chunk->list, &icm->chunk_list);
178177 }
179178
@@ -186,10 +185,10 @@ struct mlx4_icm *mlx4_alloc_icm(struct mlx4_dev *dev, int npages, · 6 unmodified lines
186185
187186 if (coherent)
188187 ret = mlx4_alloc_icm_coherent(&dev->persist->pdev->dev,
189− &chunk->mem[chunk->npages],
190− cur_order, mask);
188+ &chunk->buf[chunk->npages],
189+ cur_order, mask);
191190 else
192− ret = mlx4_alloc_icm_pages(&chunk->mem[chunk->npages],
191+ ret = mlx4_alloc_icm_pages(&chunk->sg[chunk->npages],
193192 cur_order, mask,
194193 dev->numa_node);
195194
@@ -205,9 +204,9 @@ struct mlx4_icm *mlx4_alloc_icm(struct mlx4_dev *dev, int npages, · 9 unmodified lines
205204 if (coherent)
206205 ++chunk->nsg;
207206 else if (chunk->npages == MLX4_ICM_CHUNK_LEN) {
208− chunk->nsg = pci_map_sg(dev->persist->pdev, chunk->mem,
209− chunk->npages,
210− PCI_DMA_BIDIRECTIONAL);
207+ chunk->nsg = dma_map_sg(&dev->persist->pdev->dev,
208+ chunk->sg, chunk->npages,
209+ DMA_BIDIRECTIONAL);
211210
212211 if (chunk->nsg <= 0)
213212 goto fail;
@@ -220,9 +219,8 @@ struct mlx4_icm *mlx4_alloc_icm(struct mlx4_dev *dev, int npages, · 6 unmodified lines
220219 }
221220
222221 if (!coherent && chunk) {
223− chunk->nsg = pci_map_sg(dev->persist->pdev, chunk->mem,
224− chunk->npages,
225− PCI_DMA_BIDIRECTIONAL);
222+ chunk->nsg = dma_map_sg(&dev->persist->pdev->dev, chunk->sg,
223+ chunk->npages, DMA_BIDIRECTIONAL);
226224
227225 if (chunk->nsg <= 0)
228226 goto fail;
@@ -320,7 +318,7 @@ void *mlx4_table_find(struct mlx4_icm_table *table, u32 obj, · 91 unmodified lines
320318 u64 idx;
321319 struct mlx4_icm_chunk *chunk;
322320 struct mlx4_icm *icm;
323− struct page *page = NULL;
321+ void *addr = NULL;
324322
325323 if (!table->lowmem)
326324 return NULL;
@@ -336,28 +334,49 @@ void *mlx4_table_find(struct mlx4_icm_table *table, u32 obj, · 9 unmodified lines
336334
337335 list_for_each_entry(chunk, &icm->chunk_list, list) {
338336 for (i = 0; i < chunk->npages; ++i) {
337+ dma_addr_t dma_addr;
338+ size_t len;
339+
340+ if (table->coherent) {
341+ len = chunk->buf[i].size;
342+ dma_addr = chunk->buf[i].dma_addr;
343+ addr = chunk->buf[i].addr;
344+ } else {
345+ struct page *page;
346+
347+ len = sg_dma_len(&chunk->sg[i]);
348+ dma_addr = sg_dma_address(&chunk->sg[i]);
349+
350+ /* XXX: we should never do this for highmem
351+ * allocation. This function either needs
352+ * to be split, or the kernel virtual address
353+ * return needs to be made optional.
354+ */
355+ page = sg_page(&chunk->sg[i]);
356+ addr = lowmem_page_address(page);
357+ }
358+
339359 if (dma_handle && dma_offset >= 0) {
340− if (sg_dma_len(&chunk->mem[i]) > dma_offset)
341− *dma_handle = sg_dma_address(&chunk->mem[i]) +
342− dma_offset;
343− dma_offset -= sg_dma_len(&chunk->mem[i]);
360+ if (len > dma_offset)
361+ *dma_handle = dma_addr + dma_offset;
362+ dma_offset -= len;
344363 }
364+
345365 /*
346366 * DMA mapping can merge pages but not split them,
347367 * so if we found the page, dma_handle has already
348368 * been assigned to.
349369 */
350− if (chunk->mem[i].length > offset) {
351− page = sg_page(&chunk->mem[i]);
370+ if (len > offset)
352371 goto out;
353− }
354− offset -= chunk->mem[i].length;
372+ offset -= len;
355373 }
356374 }
357375
376+ addr = NULL;
358377 out:
359378 mutex_unlock(&table->mutex);
360− return page ? lowmem_page_address(page) + offset : NULL;
379+ return addr ? addr + offset : NULL;
361380 }
362381
363382 int mlx4_table_get_range(struct mlx4_dev *dev, struct mlx4_icm_table *table,
drivers/net/ethernet/mellanox/mlx4/icm.h+19−3
@@ -47,11 +47,21 @@ enum { · 46 unmodified lines
4747 MLX4_ICM_PAGE_SIZE = 1 << MLX4_ICM_PAGE_SHIFT,
4848 };
4949
50+struct mlx4_icm_buf {
51+ void *addr;
52+ size_t size;
53+ dma_addr_t dma_addr;
54+};
55+
5056 struct mlx4_icm_chunk {
5157 struct list_head list;
5258 int npages;
5359 int nsg;
54− struct scatterlist mem[MLX4_ICM_CHUNK_LEN];
60+ bool coherent;
61+ union {
62+ struct scatterlist sg[MLX4_ICM_CHUNK_LEN];
63+ struct mlx4_icm_buf buf[MLX4_ICM_CHUNK_LEN];
64+ };
5565 };
5666
5767 struct mlx4_icm {
@@ -114,12 +124,18 @@ static inline void mlx4_icm_next(struct mlx4_icm_iter *iter) · 56 unmodified lines
114124
115125 static inline dma_addr_t mlx4_icm_addr(struct mlx4_icm_iter *iter)
116126 {
117− return sg_dma_address(&iter->chunk->mem[iter->page_idx]);
127+ if (iter->chunk->coherent)
128+ return iter->chunk->buf[iter->page_idx].dma_addr;
129+ else
130+ return sg_dma_address(&iter->chunk->sg[iter->page_idx]);
118131 }
119132
120133 static inline unsigned long mlx4_icm_size(struct mlx4_icm_iter *iter)
121134 {
122− return sg_dma_len(&iter->chunk->mem[iter->page_idx]);
135+ if (iter->chunk->coherent)
136+ return iter->chunk->buf[iter->page_idx].size;
137+ else
138+ return sg_dma_len(&iter->chunk->sg[iter->page_idx]);
123139 }
124140
125141 int mlx4_MAP_ICM_AUX(struct mlx4_dev *dev, struct mlx4_icm *icm);
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c+4−1
@@ -844,9 +844,12 @@ int mlx5e_ethtool_get_link_ksettings(struct mlx5e_priv *priv, · 843 unmodified lines
844844 ethtool_link_ksettings_add_link_mode(link_ksettings, supported,
845845 Autoneg);
846846
847− if (get_fec_supported_advertised(mdev, link_ksettings))
847+ err = get_fec_supported_advertised(mdev, link_ksettings);
848+ if (err) {
848849 netdev_dbg(priv->netdev, "%s: FEC caps query failed: %d\n",
849850 __func__, err);
851+ err = 0; /* don't fail caps query because of FEC error */
852+ }
850853
851854 if (!an_disable_admin)
852855 ethtool_link_ksettings_add_link_mode(link_ksettings,
drivers/net/ethernet/mellanox/mlx5/core/en_main.c+1−1
@@ -950,7 +950,7 @@ static int mlx5e_open_rq(struct mlx5e_channel *c, · 949 unmodified lines
950950 if (params->rx_dim_enabled)
951951 __set_bit(MLX5E_RQ_STATE_AM, &c->rq.state);
952952
953− if (params->pflags & MLX5E_PFLAG_RX_NO_CSUM_COMPLETE)
953+ if (MLX5E_GET_PFLAG(params, MLX5E_PFLAG_RX_NO_CSUM_COMPLETE))
954954 __set_bit(MLX5E_RQ_STATE_NO_CSUM_COMPLETE, &c->rq.state);
955955
956956 return 0;
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c+40−15
@@ -58,7 +58,8 @@ struct mlx5e_rep_indr_block_priv { · 57 unmodified lines
5858 struct list_head list;
5959 };
6060
61−static void mlx5e_rep_indr_unregister_block(struct net_device *netdev);
61+static void mlx5e_rep_indr_unregister_block(struct mlx5e_rep_priv *rpriv,
62+ struct net_device *netdev);
6263
6364 static void mlx5e_rep_get_drvinfo(struct net_device *dev,
6465 struct ethtool_drvinfo *drvinfo)
@@ -179,6 +180,7 @@ static void mlx5e_rep_update_sw_counters(struct mlx5e_priv *priv) · 114 unmodified lines
179180
180181 s->tx_packets += sq_stats->packets;
181182 s->tx_bytes += sq_stats->bytes;
183+ s->tx_queue_dropped += sq_stats->dropped;
182184 }
183185 }
184186 }
@@ -663,7 +665,7 @@ static void mlx5e_rep_indr_clean_block_privs(struct mlx5e_rep_priv *rpriv) · 478 unmodified lines
663665 struct list_head *head = &rpriv->uplink_priv.tc_indr_block_priv_list;
664666
665667 list_for_each_entry_safe(cb_priv, temp, head, list) {
666− mlx5e_rep_indr_unregister_block(cb_priv->netdev);
668+ mlx5e_rep_indr_unregister_block(rpriv, cb_priv->netdev);
667669 kfree(cb_priv);
668670 }
669671 }
@@ -735,7 +737,7 @@ mlx5e_rep_indr_setup_tc_block(struct net_device *netdev, · 65 unmodified lines
735737
736738 err = tcf_block_cb_register(f->block,
737739 mlx5e_rep_indr_setup_block_cb,
738− netdev, indr_priv, f->extack);
740+ indr_priv, indr_priv, f->extack);
739741 if (err) {
740742 list_del(&indr_priv->list);
741743 kfree(indr_priv);
@@ -743,14 +745,15 @@ mlx5e_rep_indr_setup_tc_block(struct net_device *netdev, · 1 unmodified line
743745
744746 return err;
745747 case TC_BLOCK_UNBIND:
748+ indr_priv = mlx5e_rep_indr_block_priv_lookup(rpriv, netdev);
749+ if (!indr_priv)
750+ return -ENOENT;
751+
746752 tcf_block_cb_unregister(f->block,
747753 mlx5e_rep_indr_setup_block_cb,
748− netdev);
749− indr_priv = mlx5e_rep_indr_block_priv_lookup(rpriv, netdev);
750− if (indr_priv) {
751− list_del(&indr_priv->list);
752− kfree(indr_priv);
753− }
754+ indr_priv);
755+ list_del(&indr_priv->list);
756+ kfree(indr_priv);
754757
755758 return 0;
756759 default:
@@ -779,7 +782,7 @@ static int mlx5e_rep_indr_register_block(struct mlx5e_rep_priv *rpriv, · 22 unmodified lines
779782
780783 err = __tc_indr_block_cb_register(netdev, rpriv,
781784 mlx5e_rep_indr_setup_tc_cb,
782− netdev);
785+ rpriv);
783786 if (err) {
784787 struct mlx5e_priv *priv = netdev_priv(rpriv->netdev);
785788
@@ -789,10 +792,11 @@ static int mlx5e_rep_indr_register_block(struct mlx5e_rep_priv *rpriv, · 3 unmodified lines
789792 return err;
790793 }
791794
792−static void mlx5e_rep_indr_unregister_block(struct net_device *netdev)
795+static void mlx5e_rep_indr_unregister_block(struct mlx5e_rep_priv *rpriv,
796+ struct net_device *netdev)
793797 {
794798 __tc_indr_block_cb_unregister(netdev, mlx5e_rep_indr_setup_tc_cb,
795− netdev);
799+ rpriv);
796800 }
797801
798802 static int mlx5e_nic_rep_netdevice_event(struct notifier_block *nb,
@@ -811,7 +815,7 @@ static int mlx5e_nic_rep_netdevice_event(struct notifier_block *nb, · 12 unmodified lines
811815 mlx5e_rep_indr_register_block(rpriv, netdev);
812816 break;
813817 case NETDEV_UNREGISTER:
814− mlx5e_rep_indr_unregister_block(netdev);
818+ mlx5e_rep_indr_unregister_block(rpriv, netdev);
815819 break;
816820 }
817821 return NOTIFY_OK;
@@ -1122,9 +1126,17 @@ static int mlx5e_rep_get_phys_port_name(struct net_device *dev, · 304 unmodified lines
11221126 struct mlx5e_priv *priv = netdev_priv(dev);
11231127 struct mlx5e_rep_priv *rpriv = priv->ppriv;
11241128 struct mlx5_eswitch_rep *rep = rpriv->rep;
1125− int ret;
1129+ int ret, pf_num;
1130+
1131+ ret = mlx5_lag_get_pf_num(priv->mdev, &pf_num);
1132+ if (ret)
1133+ return ret;
1134+
1135+ if (rep->vport == FDB_UPLINK_VPORT)
1136+ ret = snprintf(buf, len, "p%d", pf_num);
1137+ else
1138+ ret = snprintf(buf, len, "pf%dvf%d", pf_num, rep->vport - 1);
11261139
1127− ret = snprintf(buf, len, "%d", rep->vport - 1);
11281140 if (ret >= len)
11291141 return -EOPNOTSUPP;
11301142
@@ -1281,6 +1293,18 @@ static int mlx5e_uplink_rep_set_mac(struct net_device *netdev, void *addr) · 150 unmodified lines
12811293 return 0;
12821294 }
12831295
1296+static int mlx5e_uplink_rep_set_vf_vlan(struct net_device *dev, int vf, u16 vlan, u8 qos,
1297+ __be16 vlan_proto)
1298+{
1299+ netdev_warn_once(dev, "legacy vf vlan setting isn't supported in switchdev mode\n");
1300+
1301+ if (vlan != 0)
1302+ return -EOPNOTSUPP;
1303+
1304+ /* allow setting 0-vid for compatibility with libvirt */
1305+ return 0;
1306+}
1307+
12841308 static const struct switchdev_ops mlx5e_rep_switchdev_ops = {
12851309 .switchdev_port_attr_get = mlx5e_attr_get,
12861310 };
@@ -1315,6 +1339,7 @@ static const struct net_device_ops mlx5e_netdev_ops_uplink_rep = { · 28 unmodified lines
13151339 .ndo_set_vf_rate = mlx5e_set_vf_rate,
13161340 .ndo_get_vf_config = mlx5e_get_vf_config,
13171341 .ndo_get_vf_stats = mlx5e_get_vf_stats,
1342+ .ndo_set_vf_vlan = mlx5e_uplink_rep_set_vf_vlan,
13181343 };
13191344
13201345 bool mlx5e_eswitch_rep(struct net_device *netdev)
drivers/net/ethernet/mellanox/mlx5/core/en_rx.c+13−0
@@ -732,6 +732,8 @@ static u8 get_ip_proto(struct sk_buff *skb, int network_depth, __be16 proto) · 731 unmodified lines
732732 ((struct ipv6hdr *)ip_p)->nexthdr;
733733 }
734734
735+#define short_frame(size) ((size) <= ETH_ZLEN + ETH_FCS_LEN)
736+
735737 static inline void mlx5e_handle_csum(struct net_device *netdev,
736738 struct mlx5_cqe64 *cqe,
737739 struct mlx5e_rq *rq,
@@ -754,6 +756,17 @@ static inline void mlx5e_handle_csum(struct net_device *netdev, · 16 unmodified lines
754756 if (unlikely(test_bit(MLX5E_RQ_STATE_NO_CSUM_COMPLETE, &rq->state)))
755757 goto csum_unnecessary;
756758
759+ /* CQE csum doesn't cover padding octets in short ethernet
760+ * frames. And the pad field is appended prior to calculating
761+ * and appending the FCS field.
762+ *
763+ * Detecting these padded frames requires to verify and parse
764+ * IP headers, so we simply force all those small frames to be
765+ * CHECKSUM_UNNECESSARY even if they are not padded.
766+ */
767+ if (short_frame(skb->len))
768+ goto csum_unnecessary;
769+
757770 if (likely(is_last_ethertype_ip(skb, &network_depth, &proto))) {
758771 if (unlikely(get_ip_proto(skb, network_depth, proto) == IPPROTO_SCTP))
759772 goto csum_unnecessary;
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c+8−14
@@ -1134,13 +1134,6 @@ static int esw_vport_ingress_config(struct mlx5_eswitch *esw, · 1133 unmodified lines
11341134 int err = 0;
11351135 u8 *smac_v;
11361136
1137− if (vport->info.spoofchk && !is_valid_ether_addr(vport->info.mac)) {
1138− mlx5_core_warn(esw->dev,
1139− "vport[%d] configure ingress rules failed, illegal mac with spoofchk\n",
1140− vport->vport);
1141− return -EPERM;
1142− }
1143−
11441137 esw_vport_cleanup_ingress_rules(esw, vport);
11451138
11461139 if (!vport->info.vlan && !vport->info.qos && !vport->info.spoofchk) {
@@ -1728,7 +1721,7 @@ int mlx5_eswitch_init(struct mlx5_core_dev *dev) · 581 unmodified lines
17281721 int vport_num;
17291722 int err;
17301723
1731− if (!MLX5_ESWITCH_MANAGER(dev))
1724+ if (!MLX5_VPORT_MANAGER(dev))
17321725 return 0;
17331726
17341727 esw_info(dev,
@@ -1797,7 +1790,7 @@ abort: · 62 unmodified lines
17971790
17981791 void mlx5_eswitch_cleanup(struct mlx5_eswitch *esw)
17991792 {
1800− if (!esw || !MLX5_ESWITCH_MANAGER(esw->dev))
1793+ if (!esw || !MLX5_VPORT_MANAGER(esw->dev))
18011794 return;
18021795
18031796 esw_info(esw->dev, "cleanup\n");
@@ -1827,13 +1820,10 @@ int mlx5_eswitch_set_vport_mac(struct mlx5_eswitch *esw, · 23 unmodified lines
18271820 mutex_lock(&esw->state_lock);
18281821 evport = &esw->vports[vport];
18291822
1830− if (evport->info.spoofchk && !is_valid_ether_addr(mac)) {
1823+ if (evport->info.spoofchk && !is_valid_ether_addr(mac))
18311824 mlx5_core_warn(esw->dev,
1832− "MAC invalidation is not allowed when spoofchk is on, vport(%d)\n",
1825+ "Set invalid MAC while spoofchk is on, vport(%d)\n",
18331826 vport);
1834− err = -EPERM;
1835− goto unlock;
1836− }
18371827
18381828 err = mlx5_modify_nic_vport_mac_address(esw->dev, vport, mac);
18391829 if (err) {
@@ -1979,6 +1969,10 @@ int mlx5_eswitch_set_vport_spoofchk(struct mlx5_eswitch *esw, · 139 unmodified lines
19791969 evport = &esw->vports[vport];
19801970 pschk = evport->info.spoofchk;
19811971 evport->info.spoofchk = spoofchk;
1972+ if (pschk && !is_valid_ether_addr(evport->info.mac))
1973+ mlx5_core_warn(esw->dev,
1974+ "Spoofchk in set while MAC is invalid, vport(%d)\n",
1975+ evport->vport);
19821976 if (evport->enabled && esw->mode == SRIOV_LEGACY)
19831977 err = esw_vport_ingress_config(esw, evport);
19841978 if (err)
drivers/net/ethernet/mellanox/mlx5/core/lag.c+21−0
@@ -616,6 +616,27 @@ void mlx5_lag_add(struct mlx5_core_dev *dev, struct net_device *netdev) · 615 unmodified lines
616616 }
617617 }
618618
619+int mlx5_lag_get_pf_num(struct mlx5_core_dev *dev, int *pf_num)
620+{
621+ struct mlx5_lag *ldev;
622+ int n;
623+
624+ ldev = mlx5_lag_dev_get(dev);
625+ if (!ldev) {
626+ mlx5_core_warn(dev, "no lag device, can't get pf num\n");
627+ return -EINVAL;
628+ }
629+
630+ for (n = 0; n < MLX5_MAX_PORTS; n++)
631+ if (ldev->pf[n].dev == dev) {
632+ *pf_num = n;
633+ return 0;
634+ }
635+
636+ mlx5_core_warn(dev, "wasn't able to locate pf in the lag device\n");
637+ return -EINVAL;
638+}
639+
619640 /* Must be called with intf_mutex held */
620641 void mlx5_lag_remove(struct mlx5_core_dev *dev)
621642 {
drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h+2−0
@@ -187,6 +187,8 @@ static inline int mlx5_lag_is_lacp_owner(struct mlx5_core_dev *dev) · 186 unmodified lines
187187 MLX5_CAP_GEN(dev, lag_master);
188188 }
189189
190+int mlx5_lag_get_pf_num(struct mlx5_core_dev *dev, int *pf_num);
191+
190192 void mlx5_reload_interface(struct mlx5_core_dev *mdev, int protocol);
191193 void mlx5_lag_update(struct mlx5_core_dev *dev);
192194
drivers/net/ethernet/mellanox/mlx5/core/qp.c+3−2
@@ -44,14 +44,15 @@ static struct mlx5_core_rsc_common * · 43 unmodified lines
4444 mlx5_get_rsc(struct mlx5_qp_table *table, u32 rsn)
4545 {
4646 struct mlx5_core_rsc_common *common;
47+ unsigned long flags;
4748
48− spin_lock(&table->lock);
49+ spin_lock_irqsave(&table->lock, flags);
4950
5051 common = radix_tree_lookup(&table->tree, rsn);
5152 if (common)
5253 atomic_inc(&common->refcount);
5354
54− spin_unlock(&table->lock);
55+ spin_unlock_irqrestore(&table->lock, flags);
5556
5657 return common;
5758 }
drivers/net/ethernet/mellanox/mlxsw/Kconfig+1−0
@@ -78,6 +78,7 @@ config MLXSW_SPECTRUM · 77 unmodified lines
7878 depends on IPV6 || IPV6=n
7979 depends on NET_IPGRE || NET_IPGRE=n
8080 depends on IPV6_GRE || IPV6_GRE=n
81+ depends on VXLAN || VXLAN=n
8182 select GENERIC_ALLOCATOR
8283 select PARMAN
8384 select OBJAGG
drivers/net/ethernet/mellanox/mlxsw/pci.c+9−7
@@ -604,29 +604,31 @@ static void mlxsw_pci_cq_tasklet(unsigned long data) · 603 unmodified lines
604604 u16 wqe_counter = mlxsw_pci_cqe_wqe_counter_get(cqe);
605605 u8 sendq = mlxsw_pci_cqe_sr_get(q->u.cq.v, cqe);
606606 u8 dqn = mlxsw_pci_cqe_dqn_get(q->u.cq.v, cqe);
607+ char ncqe[MLXSW_PCI_CQE_SIZE_MAX];
608+
609+ memcpy(ncqe, cqe, q->elem_size);
610+ mlxsw_pci_queue_doorbell_consumer_ring(mlxsw_pci, q);
607611
608612 if (sendq) {
609613 struct mlxsw_pci_queue *sdq;
610614
611615 sdq = mlxsw_pci_sdq_get(mlxsw_pci, dqn);
612616 mlxsw_pci_cqe_sdq_handle(mlxsw_pci, sdq,
613− wqe_counter, cqe);
617+ wqe_counter, ncqe);
614618 q->u.cq.comp_sdq_count++;
615619 } else {
616620 struct mlxsw_pci_queue *rdq;
617621
618622 rdq = mlxsw_pci_rdq_get(mlxsw_pci, dqn);
619623 mlxsw_pci_cqe_rdq_handle(mlxsw_pci, rdq,
620− wqe_counter, q->u.cq.v, cqe);
624+ wqe_counter, q->u.cq.v, ncqe);
621625 q->u.cq.comp_rdq_count++;
622626 }
623627 if (++items == credits)
624628 break;
625629 }
626− if (items) {
627− mlxsw_pci_queue_doorbell_consumer_ring(mlxsw_pci, q);
630+ if (items)
628631 mlxsw_pci_queue_doorbell_arm_consumer_ring(mlxsw_pci, q);
629− }
630632 }
631633
632634 static u16 mlxsw_pci_cq_elem_count(const struct mlxsw_pci_queue *q)
@@ -1365,10 +1367,10 @@ static int mlxsw_pci_sw_reset(struct mlxsw_pci *mlxsw_pci, · 732 unmodified lines
13651367 u32 val = mlxsw_pci_read32(mlxsw_pci, FW_READY);
13661368
13671369 if ((val & MLXSW_PCI_FW_READY_MASK) == MLXSW_PCI_FW_READY_MAGIC)
1368− break;
1370+ return 0;
13691371 cond_resched();
13701372 } while (time_before(jiffies, end));
1371− return 0;
1373+ return -EBUSY;
13721374 }
13731375
13741376 static int mlxsw_pci_alloc_irq_vectors(struct mlxsw_pci *mlxsw_pci)
drivers/net/ethernet/mellanox/mlxsw/pci_hw.h+2−1
@@ -27,7 +27,7 @@ · 26 unmodified lines
2727
2828 #define MLXSW_PCI_SW_RESET 0xF0010
2929 #define MLXSW_PCI_SW_RESET_RST_BIT BIT(0)
30−#define MLXSW_PCI_SW_RESET_TIMEOUT_MSECS 5000
30+#define MLXSW_PCI_SW_RESET_TIMEOUT_MSECS 13000
3131 #define MLXSW_PCI_SW_RESET_WAIT_MSECS 100
3232 #define MLXSW_PCI_FW_READY 0xA1844
3333 #define MLXSW_PCI_FW_READY_MASK 0xFFFF
@@ -53,6 +53,7 @@ · 19 unmodified lines
5353 #define MLXSW_PCI_WQE_SIZE 32 /* 32 bytes per element */
5454 #define MLXSW_PCI_CQE01_SIZE 16 /* 16 bytes per element */
5555 #define MLXSW_PCI_CQE2_SIZE 32 /* 32 bytes per element */
56+#define MLXSW_PCI_CQE_SIZE_MAX MLXSW_PCI_CQE2_SIZE
5657 #define MLXSW_PCI_EQE_SIZE 16 /* 16 bytes per element */
5758 #define MLXSW_PCI_WQE_COUNT (MLXSW_PCI_AQ_SIZE / MLXSW_PCI_WQE_SIZE)
5859 #define MLXSW_PCI_CQE01_COUNT (MLXSW_PCI_AQ_SIZE / MLXSW_PCI_CQE01_SIZE)
drivers/net/ethernet/mellanox/mlxsw/spectrum.c+5−2
@@ -5005,12 +5005,15 @@ static int mlxsw_sp_netdevice_port_upper_event(struct net_device *lower_dev, · 5004 unmodified lines
50055005 lower_dev,
50065006 upper_dev);
50075007 } else if (netif_is_lag_master(upper_dev)) {
5008− if (info->linking)
5008+ if (info->linking) {
50095009 err = mlxsw_sp_port_lag_join(mlxsw_sp_port,
50105010 upper_dev);
5011− else
5011+ } else {
5012+ mlxsw_sp_port_lag_tx_en_set(mlxsw_sp_port,
5013+ false);
50125014 mlxsw_sp_port_lag_leave(mlxsw_sp_port,
50135015 upper_dev);
5016+ }
50145017 } else if (netif_is_ovs_master(upper_dev)) {
50155018 if (info->linking)
50165019 err = mlxsw_sp_port_ovs_join(mlxsw_sp_port);
drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_ctcam.c+9−1
@@ -72,7 +72,15 @@ mlxsw_sp_acl_ctcam_region_entry_insert(struct mlxsw_sp *mlxsw_sp, · 71 unmodified lines
7272 act_set = mlxsw_afa_block_first_set(rulei->act_block);
7373 mlxsw_reg_ptce2_flex_action_set_memcpy_to(ptce2_pl, act_set);
7474
75− return mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ptce2), ptce2_pl);
75+ err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(ptce2), ptce2_pl);
76+ if (err)
77+ goto err_ptce2_write;
78+
79+ return 0;
80+
81+err_ptce2_write:
82+ cregion->ops->entry_remove(cregion, centry);
83+ return err;
7684 }
7785
7886 static void
drivers/net/ethernet/mellanox/mlxsw/spectrum_acl_erp.c+0−2
@@ -1022,7 +1022,6 @@ void mlxsw_sp_acl_erp_mask_put(struct mlxsw_sp_acl_atcam_region *aregion, · 1021 unmodified lines
10221022 {
10231023 struct objagg_obj *objagg_obj = (struct objagg_obj *) erp_mask;
10241024
1025− ASSERT_RTNL();
10261025 objagg_obj_put(aregion->erp_table->objagg, objagg_obj);
10271026 }
10281027
@@ -1054,7 +1053,6 @@ void mlxsw_sp_acl_erp_bf_remove(struct mlxsw_sp *mlxsw_sp, · 25 unmodified lines
10541053 const struct mlxsw_sp_acl_erp *erp = objagg_obj_root_priv(objagg_obj);
10551054 unsigned int erp_bank;
10561055
1057− ASSERT_RTNL();
10581056 if (!mlxsw_sp_acl_erp_table_is_used(erp->erp_table))
10591057 return;
10601058
drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c+2−2
@@ -997,8 +997,8 @@ static const struct mlxsw_sp_fid_ops mlxsw_sp_fid_dummy_ops = { · 996 unmodified lines
997997 static const struct mlxsw_sp_fid_family mlxsw_sp_fid_dummy_family = {
998998 .type = MLXSW_SP_FID_TYPE_DUMMY,
999999 .fid_size = sizeof(struct mlxsw_sp_fid),
1000− .start_index = MLXSW_SP_RFID_BASE - 1,
1001− .end_index = MLXSW_SP_RFID_BASE - 1,
1000+ .start_index = VLAN_N_VID - 1,
1001+ .end_index = VLAN_N_VID - 1,
10021002 .ops = &mlxsw_sp_fid_dummy_ops,
10031003 };
10041004
drivers/net/ethernet/mellanox/mlxsw/spectrum_nve.c+2−2
@@ -816,14 +816,14 @@ int mlxsw_sp_nve_fid_enable(struct mlxsw_sp *mlxsw_sp, struct mlxsw_sp_fid *fid, · 815 unmodified lines
816816 ops = nve->nve_ops_arr[params->type];
817817
818818 if (!ops->can_offload(nve, params->dev, extack))
819− return -EOPNOTSUPP;
819+ return -EINVAL;
820820
821821 memset(&config, 0, sizeof(config));
822822 ops->nve_config(nve, params->dev, &config);
823823 if (nve->num_nve_tunnels &&
824824 memcmp(&config, &nve->config, sizeof(config))) {
825825 NL_SET_ERR_MSG_MOD(extack, "Conflicting NVE tunnels configuration");
826− return -EOPNOTSUPP;
826+ return -EINVAL;
827827 }
828828
829829 err = mlxsw_sp_nve_tunnel_init(mlxsw_sp, &config);
drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c+16−19
@@ -1078,8 +1078,7 @@ static int · 1077 unmodified lines
10781078 mlxsw_sp_bridge_port_vlan_add(struct mlxsw_sp_port *mlxsw_sp_port,
10791079 struct mlxsw_sp_bridge_port *bridge_port,
10801080 u16 vid, bool is_untagged, bool is_pvid,
1081− struct netlink_ext_ack *extack,
1082− struct switchdev_trans *trans)
1081+ struct netlink_ext_ack *extack)
10831082 {
10841083 u16 pvid = mlxsw_sp_port_pvid_determine(mlxsw_sp_port, vid, is_pvid);
10851084 struct mlxsw_sp_port_vlan *mlxsw_sp_port_vlan;
@@ -1095,9 +1094,6 @@ mlxsw_sp_bridge_port_vlan_add(struct mlxsw_sp_port *mlxsw_sp_port, · 9 unmodified lines
10951094 mlxsw_sp_port_vlan->bridge_port != bridge_port)
10961095 return -EEXIST;
10971096
1098− if (switchdev_trans_ph_prepare(trans))
1099− return 0;
1100−
11011097 if (!mlxsw_sp_port_vlan) {
11021098 mlxsw_sp_port_vlan = mlxsw_sp_port_vlan_create(mlxsw_sp_port,
11031099 vid);
@@ -1188,6 +1184,9 @@ static int mlxsw_sp_port_vlans_add(struct mlxsw_sp_port *mlxsw_sp_port, · 84 unmodified lines
11881184 return err;
11891185 }
11901186
1187+ if (switchdev_trans_ph_commit(trans))
1188+ return 0;
1189+
11911190 bridge_port = mlxsw_sp_bridge_port_find(mlxsw_sp->bridge, orig_dev);
11921191 if (WARN_ON(!bridge_port))
11931192 return -EINVAL;
@@ -1200,7 +1199,7 @@ static int mlxsw_sp_port_vlans_add(struct mlxsw_sp_port *mlxsw_sp_port, · 6 unmodified lines
12001199
12011200 err = mlxsw_sp_bridge_port_vlan_add(mlxsw_sp_port, bridge_port,
12021201 vid, flag_untagged,
1203− flag_pvid, extack, trans);
1202+ flag_pvid, extack);
12041203 if (err)
12051204 return err;
12061205 }
@@ -1234,7 +1233,7 @@ mlxsw_sp_bridge_port_fdb_flush(struct mlxsw_sp *mlxsw_sp, · 27 unmodified lines
12341233 static enum mlxsw_reg_sfd_rec_policy mlxsw_sp_sfd_rec_policy(bool dynamic)
12351234 {
12361235 return dynamic ? MLXSW_REG_SFD_REC_POLICY_DYNAMIC_ENTRY_INGRESS :
1237− MLXSW_REG_SFD_REC_POLICY_STATIC_ENTRY;
1236+ MLXSW_REG_SFD_REC_POLICY_DYNAMIC_ENTRY_MLAG;
12381237 }
12391238
12401239 static enum mlxsw_reg_sfd_op mlxsw_sp_sfd_op(bool adding)
@@ -1291,7 +1290,7 @@ out: · 50 unmodified lines
12911290 static int __mlxsw_sp_port_fdb_uc_op(struct mlxsw_sp *mlxsw_sp, u8 local_port,
12921291 const char *mac, u16 fid, bool adding,
12931292 enum mlxsw_reg_sfd_rec_action action,
1294− bool dynamic)
1293+ enum mlxsw_reg_sfd_rec_policy policy)
12951294 {
12961295 char *sfd_pl;
12971296 u8 num_rec;
@@ -1302,8 +1301,7 @@ static int __mlxsw_sp_port_fdb_uc_op(struct mlxsw_sp *mlxsw_sp, u8 local_port, · 4 unmodified lines
13021301 return -ENOMEM;
13031302
13041303 mlxsw_reg_sfd_pack(sfd_pl, mlxsw_sp_sfd_op(adding), 0);
1305− mlxsw_reg_sfd_uc_pack(sfd_pl, 0, mlxsw_sp_sfd_rec_policy(dynamic),
1306− mac, fid, action, local_port);
1304+ mlxsw_reg_sfd_uc_pack(sfd_pl, 0, policy, mac, fid, action, local_port);
13071305 num_rec = mlxsw_reg_sfd_num_rec_get(sfd_pl);
13081306 err = mlxsw_reg_write(mlxsw_sp->core, MLXSW_REG(sfd), sfd_pl);
13091307 if (err)
@@ -1322,7 +1320,8 @@ static int mlxsw_sp_port_fdb_uc_op(struct mlxsw_sp *mlxsw_sp, u8 local_port, · 12 unmodified lines
13221320 bool dynamic)
13231321 {
13241322 return __mlxsw_sp_port_fdb_uc_op(mlxsw_sp, local_port, mac, fid, adding,
1325− MLXSW_REG_SFD_REC_ACTION_NOP, dynamic);
1323+ MLXSW_REG_SFD_REC_ACTION_NOP,
1324+ mlxsw_sp_sfd_rec_policy(dynamic));
13261325 }
13271326
13281327 int mlxsw_sp_rif_fdb_op(struct mlxsw_sp *mlxsw_sp, const char *mac, u16 fid,
@@ -1330,7 +1329,7 @@ int mlxsw_sp_rif_fdb_op(struct mlxsw_sp *mlxsw_sp, const char *mac, u16 fid, · 1 unmodified line
13301329 {
13311330 return __mlxsw_sp_port_fdb_uc_op(mlxsw_sp, 0, mac, fid, adding,
13321331 MLXSW_REG_SFD_REC_ACTION_FORWARD_IP_ROUTER,
1333− false);
1332+ MLXSW_REG_SFD_REC_POLICY_STATIC_ENTRY);
13341333 }
13351334
13361335 static int mlxsw_sp_port_fdb_uc_lag_op(struct mlxsw_sp *mlxsw_sp, u16 lag_id,
@@ -1808,7 +1807,7 @@ static void · 471 unmodified lines
18081807 mlxsw_sp_bridge_port_vlan_del(struct mlxsw_sp_port *mlxsw_sp_port,
18091808 struct mlxsw_sp_bridge_port *bridge_port, u16 vid)
18101809 {
1811− u16 pvid = mlxsw_sp_port->pvid == vid ? 0 : vid;
1810+ u16 pvid = mlxsw_sp_port->pvid == vid ? 0 : mlxsw_sp_port->pvid;
18121811 struct mlxsw_sp_port_vlan *mlxsw_sp_port_vlan;
18131812
18141813 mlxsw_sp_port_vlan = mlxsw_sp_port_vlan_find_by_vid(mlxsw_sp_port, vid);
@@ -3207,7 +3206,6 @@ mlxsw_sp_switchdev_vxlan_vlan_add(struct mlxsw_sp *mlxsw_sp, · 1392 unmodified lines
32073206 struct mlxsw_sp_bridge_device *bridge_device,
32083207 const struct net_device *vxlan_dev, u16 vid,
32093208 bool flag_untagged, bool flag_pvid,
3210− struct switchdev_trans *trans,
32113209 struct netlink_ext_ack *extack)
32123210 {
32133211 struct vxlan_dev *vxlan = netdev_priv(vxlan_dev);
@@ -3225,9 +3223,6 @@ mlxsw_sp_switchdev_vxlan_vlan_add(struct mlxsw_sp *mlxsw_sp, · 11 unmodified lines
32253223 mlxsw_sp_bridge_8021q_vxlan_dev_find(bridge_device->dev, vid))
32263224 return -EINVAL;
32273225
3228− if (switchdev_trans_ph_prepare(trans))
3229− return 0;
3230−
32313226 if (!netif_running(vxlan_dev))
32323227 return 0;
32333228
@@ -3345,6 +3340,9 @@ mlxsw_sp_switchdev_vxlan_vlans_add(struct net_device *vxlan_dev, · 111 unmodified lines
33453340
33463341 port_obj_info->handled = true;
33473342
3343+ if (switchdev_trans_ph_commit(trans))
3344+ return 0;
3345+
33483346 bridge_device = mlxsw_sp_bridge_device_find(mlxsw_sp->bridge, br_dev);
33493347 if (!bridge_device)
33503348 return -EINVAL;
@@ -3358,8 +3356,7 @@ mlxsw_sp_switchdev_vxlan_vlans_add(struct net_device *vxlan_dev, · 7 unmodified lines
33583356 err = mlxsw_sp_switchdev_vxlan_vlan_add(mlxsw_sp, bridge_device,
33593357 vxlan_dev, vid,
33603358 flag_untagged,
3361− flag_pvid, trans,
3362− extack);
3359+ flag_pvid, extack);
33633360 if (err)
33643361 return err;
33653362 }
drivers/net/ethernet/microchip/lan743x_main.c+4−7
@@ -962,13 +962,10 @@ static void lan743x_phy_link_status_change(struct net_device *netdev) · 961 unmodified lines
962962
963963 memset(&ksettings, 0, sizeof(ksettings));
964964 phy_ethtool_get_link_ksettings(netdev, &ksettings);
965− local_advertisement = phy_read(phydev, MII_ADVERTISE);
966− if (local_advertisement < 0)
967− return;
968−
969− remote_advertisement = phy_read(phydev, MII_LPA);
970− if (remote_advertisement < 0)
971− return;
965+ local_advertisement =
966+ linkmode_adv_to_mii_adv_t(phydev->advertising);
967+ remote_advertisement =
968+ linkmode_adv_to_mii_adv_t(phydev->lp_advertising);
972969
973970 lan743x_phy_update_flowcontrol(adapter,
974971 ksettings.base.duplex,
drivers/net/ethernet/qlogic/qed/qed_dev.c+4−4
@@ -795,19 +795,19 @@ static void qed_init_qm_pq(struct qed_hwfn *p_hwfn, · 794 unmodified lines
795795
796796 /* get pq index according to PQ_FLAGS */
797797 static u16 *qed_init_qm_get_idx_from_flags(struct qed_hwfn *p_hwfn,
798− u32 pq_flags)
798+ unsigned long pq_flags)
799799 {
800800 struct qed_qm_info *qm_info = &p_hwfn->qm_info;
801801
802802 /* Can't have multiple flags set here */
803− if (bitmap_weight((unsigned long *)&pq_flags,
803+ if (bitmap_weight(&pq_flags,
804804 sizeof(pq_flags) * BITS_PER_BYTE) > 1) {
805− DP_ERR(p_hwfn, "requested multiple pq flags 0x%x\n", pq_flags);
805+ DP_ERR(p_hwfn, "requested multiple pq flags 0x%lx\n", pq_flags);
806806 goto err;
807807 }
808808
809809 if (!(qed_get_pq_flags(p_hwfn) & pq_flags)) {
810− DP_ERR(p_hwfn, "pq flag 0x%x is not set\n", pq_flags);
810+ DP_ERR(p_hwfn, "pq flag 0x%lx is not set\n", pq_flags);
811811 goto err;
812812 }
813813
drivers/net/ethernet/qlogic/qed/qed_l2.c+11−1
@@ -609,6 +609,10 @@ qed_sp_update_accept_mode(struct qed_hwfn *p_hwfn, · 608 unmodified lines
609609 (!!(accept_filter & QED_ACCEPT_MCAST_MATCHED) &&
610610 !!(accept_filter & QED_ACCEPT_MCAST_UNMATCHED)));
611611
612+ SET_FIELD(state, ETH_VPORT_TX_MODE_UCAST_ACCEPT_ALL,
613+ (!!(accept_filter & QED_ACCEPT_UCAST_MATCHED) &&
614+ !!(accept_filter & QED_ACCEPT_UCAST_UNMATCHED)));
615+
612616 SET_FIELD(state, ETH_VPORT_TX_MODE_BCAST_ACCEPT_ALL,
613617 !!(accept_filter & QED_ACCEPT_BCAST));
614618
@@ -744,6 +748,11 @@ int qed_sp_vport_update(struct qed_hwfn *p_hwfn, · 129 unmodified lines
744748 return rc;
745749 }
746750
751+ if (p_params->update_ctl_frame_check) {
752+ p_cmn->ctl_frame_mac_check_en = p_params->mac_chk_en;
753+ p_cmn->ctl_frame_ethtype_check_en = p_params->ethtype_chk_en;
754+ }
755+
747756 /* Update mcast bins for VFs, PF doesn't use this functionality */
748757 qed_sp_update_mcast_bin(p_hwfn, p_ramrod, p_params);
749758
@@ -2688,7 +2697,8 @@ static int qed_configure_filter_rx_mode(struct qed_dev *cdev, · 1938 unmodified lines
26882697 if (type == QED_FILTER_RX_MODE_TYPE_PROMISC) {
26892698 accept_flags.rx_accept_filter |= QED_ACCEPT_UCAST_UNMATCHED |
26902699 QED_ACCEPT_MCAST_UNMATCHED;
2691− accept_flags.tx_accept_filter |= QED_ACCEPT_MCAST_UNMATCHED;
2700+ accept_flags.tx_accept_filter |= QED_ACCEPT_UCAST_UNMATCHED |
2701+ QED_ACCEPT_MCAST_UNMATCHED;
26922702 } else if (type == QED_FILTER_RX_MODE_TYPE_MULTI_PROMISC) {
26932703 accept_flags.rx_accept_filter |= QED_ACCEPT_MCAST_UNMATCHED;
26942704 accept_flags.tx_accept_filter |= QED_ACCEPT_MCAST_UNMATCHED;
drivers/net/ethernet/qlogic/qed/qed_l2.h+3−0
@@ -219,6 +219,9 @@ struct qed_sp_vport_update_params { · 218 unmodified lines
219219 struct qed_rss_params *rss_params;
220220 struct qed_filter_accept_flags accept_flags;
221221 struct qed_sge_tpa_params *sge_tpa_params;
222+ u8 update_ctl_frame_check;
223+ u8 mac_chk_en;
224+ u8 ethtype_chk_en;
222225 };
223226
224227 int qed_sp_vport_update(struct qed_hwfn *p_hwfn,
drivers/net/ethernet/qlogic/qed/qed_ll2.c+19−5
@@ -1619,6 +1619,10 @@ static void qed_ll2_post_rx_buffer_notify_fw(struct qed_hwfn *p_hwfn, · 1618 unmodified lines
16191619 cq_prod = qed_chain_get_prod_idx(&p_rx->rcq_chain);
16201620 rx_prod.bd_prod = cpu_to_le16(bd_prod);
16211621 rx_prod.cqe_prod = cpu_to_le16(cq_prod);
1622+
1623+ /* Make sure chain element is updated before ringing the doorbell */
1624+ dma_wmb();
1625+
16221626 DIRECT_REG_WR(p_rx->set_prod_addr, *((u32 *)&rx_prod));
16231627 }
16241628
@@ -2447,19 +2451,24 @@ static int qed_ll2_start_xmit(struct qed_dev *cdev, struct sk_buff *skb, · 822 unmodified lines
24472451 {
24482452 struct qed_ll2_tx_pkt_info pkt;
24492453 const skb_frag_t *frag;
2454+ u8 flags = 0, nr_frags;
24502455 int rc = -EINVAL, i;
24512456 dma_addr_t mapping;
24522457 u16 vlan = 0;
2453− u8 flags = 0;
24542458
24552459 if (unlikely(skb->ip_summed != CHECKSUM_NONE)) {
24562460 DP_INFO(cdev, "Cannot transmit a checksummed packet\n");
24572461 return -EINVAL;
24582462 }
24592463
2460− if (1 + skb_shinfo(skb)->nr_frags > CORE_LL2_TX_MAX_BDS_PER_PACKET) {
2464+ /* Cache number of fragments from SKB since SKB may be freed by
2465+ * the completion routine after calling qed_ll2_prepare_tx_packet()
2466+ */
2467+ nr_frags = skb_shinfo(skb)->nr_frags;
2468+
2469+ if (1 + nr_frags > CORE_LL2_TX_MAX_BDS_PER_PACKET) {
24612470 DP_ERR(cdev, "Cannot transmit a packet with %d fragments\n",
2462− 1 + skb_shinfo(skb)->nr_frags);
2471+ 1 + nr_frags);
24632472 return -EINVAL;
24642473 }
24652474
@@ -2481,7 +2490,7 @@ static int qed_ll2_start_xmit(struct qed_dev *cdev, struct sk_buff *skb, · 15 unmodified lines
24812490 }
24822491
24832492 memset(&pkt, 0, sizeof(pkt));
2484− pkt.num_of_bds = 1 + skb_shinfo(skb)->nr_frags;
2493+ pkt.num_of_bds = 1 + nr_frags;
24852494 pkt.vlan = vlan;
24862495 pkt.bd_flags = flags;
24872496 pkt.tx_dest = QED_LL2_TX_DEST_NW;
@@ -2492,12 +2501,17 @@ static int qed_ll2_start_xmit(struct qed_dev *cdev, struct sk_buff *skb, · 4 unmodified lines
24922501 test_bit(QED_LL2_XMIT_FLAGS_FIP_DISCOVERY, &xmit_flags))
24932502 pkt.remove_stag = true;
24942503
2504+ /* qed_ll2_prepare_tx_packet() may actually send the packet if
2505+ * there are no fragments in the skb and subsequently the completion
2506+ * routine may run and free the SKB, so no dereferencing the SKB
2507+ * beyond this point unless skb has any fragments.
2508+ */
24952509 rc = qed_ll2_prepare_tx_packet(&cdev->hwfns[0], cdev->ll2->handle,
24962510 &pkt, 1);
24972511 if (rc)
24982512 goto err;
24992513
2500− for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
2514+ for (i = 0; i < nr_frags; i++) {
25012515 frag = &skb_shinfo(skb)->frags[i];
25022516
25032517 mapping = skb_frag_dma_map(&cdev->pdev->dev, frag, 0,
drivers/net/ethernet/qlogic/qed/qed_sriov.c+8−2
@@ -1969,7 +1969,9 @@ static void qed_iov_vf_mbx_start_vport(struct qed_hwfn *p_hwfn, · 1968 unmodified lines
19691969 params.vport_id = vf->vport_id;
19701970 params.max_buffers_per_cqe = start->max_buffers_per_cqe;
19711971 params.mtu = vf->mtu;
1972− params.check_mac = true;
1972+
1973+ /* Non trusted VFs should enable control frame filtering */
1974+ params.check_mac = !vf->p_vf_info.is_trusted_configured;
19731975
19741976 rc = qed_sp_eth_vport_start(p_hwfn, &params);
19751977 if (rc) {
@@ -5130,6 +5132,9 @@ static void qed_iov_handle_trust_change(struct qed_hwfn *hwfn) · 3154 unmodified lines
51305132 params.opaque_fid = vf->opaque_fid;
51315133 params.vport_id = vf->vport_id;
51325134
5135+ params.update_ctl_frame_check = 1;
5136+ params.mac_chk_en = !vf_info->is_trusted_configured;
5137+
51335138 if (vf_info->rx_accept_mode & mask) {
51345139 flags->update_rx_mode_config = 1;
51355140 flags->rx_accept_filter = vf_info->rx_accept_mode;
@@ -5147,7 +5152,8 @@ static void qed_iov_handle_trust_change(struct qed_hwfn *hwfn) · 11 unmodified lines
51475152 }
51485153
51495154 if (flags->update_rx_mode_config ||
5150− flags->update_tx_mode_config)
5155+ flags->update_tx_mode_config ||
5156+ params.update_ctl_frame_check)
51515157 qed_sp_vport_update(hwfn, &params,
51525158 QED_SPQ_MODE_EBLOCK, NULL);
51535159 }
drivers/net/ethernet/qlogic/qed/qed_vf.c+10−0
@@ -261,6 +261,7 @@ static int qed_vf_pf_acquire(struct qed_hwfn *p_hwfn) · 260 unmodified lines
261261 struct pfvf_acquire_resp_tlv *resp = &p_iov->pf2vf_reply->acquire_resp;
262262 struct pf_vf_pfdev_info *pfdev_info = &resp->pfdev_info;
263263 struct vf_pf_resc_request *p_resc;
264+ u8 retry_cnt = VF_ACQUIRE_THRESH;
264265 bool resources_acquired = false;
265266 struct vfpf_acquire_tlv *req;
266267 int rc = 0, attempts = 0;
@@ -314,6 +315,15 @@ static int qed_vf_pf_acquire(struct qed_hwfn *p_hwfn) · 47 unmodified lines
314315
315316 /* send acquire request */
316317 rc = qed_send_msg2pf(p_hwfn, &resp->hdr.status, sizeof(*resp));
318+
319+ /* Re-try acquire in case of vf-pf hw channel timeout */
320+ if (retry_cnt && rc == -EBUSY) {
321+ DP_VERBOSE(p_hwfn, QED_MSG_IOV,
322+ "VF retrying to acquire due to VPC timeout\n");
323+ retry_cnt--;
324+ continue;
325+ }
326+
317327 if (rc)
318328 goto exit;
319329
drivers/net/ethernet/realtek/8139cp.c+1−1
@@ -691,7 +691,7 @@ static void cp_tx (struct cp_private *cp) · 690 unmodified lines
691691 }
692692 bytes_compl += skb->len;
693693 pkts_compl++;
694− dev_kfree_skb_irq(skb);
694+ dev_consume_skb_irq(skb);
695695 }
696696
697697 cp->tx_skb[tx_tail] = NULL;
drivers/net/ethernet/realtek/r8169.c+7−2
@@ -205,6 +205,8 @@ enum cfg_version { · 204 unmodified lines
205205 };
206206
207207 static const struct pci_device_id rtl8169_pci_tbl[] = {
208+ { PCI_VDEVICE(REALTEK, 0x2502), RTL_CFG_1 },
209+ { PCI_VDEVICE(REALTEK, 0x2600), RTL_CFG_1 },
208210 { PCI_VDEVICE(REALTEK, 0x8129), RTL_CFG_0 },
209211 { PCI_VDEVICE(REALTEK, 0x8136), RTL_CFG_2 },
210212 { PCI_VDEVICE(REALTEK, 0x8161), RTL_CFG_1 },
@@ -706,6 +708,7 @@ module_param(use_dac, int, 0); · 495 unmodified lines
706708 MODULE_PARM_DESC(use_dac, "Enable PCI DAC. Unsafe on 32 bit PCI slot.");
707709 module_param_named(debug, debug.msg_enable, int, 0);
708710 MODULE_PARM_DESC(debug, "Debug verbosity level (0=none, ..., 16=all)");
711+MODULE_SOFTDEP("pre: realtek");
709712 MODULE_LICENSE("GPL");
710713 MODULE_FIRMWARE(FIRMWARE_8168D_1);
711714 MODULE_FIRMWARE(FIRMWARE_8168D_2);
@@ -1679,11 +1682,13 @@ static bool rtl8169_reset_counters(struct rtl8169_private *tp) · 967 unmodified lines
16791682
16801683 static bool rtl8169_update_counters(struct rtl8169_private *tp)
16811684 {
1685+ u8 val = RTL_R8(tp, ChipCmd);
1686+
16821687 /*
16831688 * Some chips are unable to dump tally counters when the receiver
1684− * is disabled.
1689+ * is disabled. If 0xff chip may be in a PCI power-save state.
16851690 */
1686− if ((RTL_R8(tp, ChipCmd) & CmdRxEnb) == 0)
1691+ if (!(val & CmdRxEnb) || val == 0xff)
16871692 return true;
16881693
16891694 return rtl8169_do_counters(tp, CounterDump);
drivers/net/ethernet/renesas/ravb_main.c+7−5
@@ -343,7 +343,7 @@ static int ravb_ring_init(struct net_device *ndev, int q) · 342 unmodified lines
343343 int i;
344344
345345 priv->rx_buf_sz = (ndev->mtu <= 1492 ? PKT_BUF_SZ : ndev->mtu) +
346− ETH_HLEN + VLAN_HLEN;
346+ ETH_HLEN + VLAN_HLEN + sizeof(__sum16);
347347
348348 /* Allocate RX and TX skb rings */
349349 priv->rx_skb[q] = kcalloc(priv->num_rx_ring[q],
@@ -524,13 +524,15 @@ static void ravb_rx_csum(struct sk_buff *skb) · 174 unmodified lines
524524 {
525525 u8 *hw_csum;
526526
527− /* The hardware checksum is 2 bytes appended to packet data */
528− if (unlikely(skb->len < 2))
527+ /* The hardware checksum is contained in sizeof(__sum16) (2) bytes
528+ * appended to packet data
529+ */
530+ if (unlikely(skb->len < sizeof(__sum16)))
529531 return;
530− hw_csum = skb_tail_pointer(skb) - 2;
532+ hw_csum = skb_tail_pointer(skb) - sizeof(__sum16);
531533 skb->csum = csum_unfold((__force __sum16)get_unaligned_le16(hw_csum));
532534 skb->ip_summed = CHECKSUM_COMPLETE;
533− skb_trim(skb, skb->len - 2);
535+ skb_trim(skb, skb->len - sizeof(__sum16));
534536 }
535537
536538 /* Packet receive function for Ethernet AVB */
drivers/net/ethernet/sfc/ef10.c+21−8
@@ -6046,22 +6046,25 @@ static const struct efx_ef10_nvram_type_info efx_ef10_nvram_types[] = { · 6045 unmodified lines
60466046 { NVRAM_PARTITION_TYPE_EXPANSION_UEFI, 0, 0, "sfc_uefi" },
60476047 { NVRAM_PARTITION_TYPE_STATUS, 0, 0, "sfc_status" }
60486048 };
6049+#define EF10_NVRAM_PARTITION_COUNT ARRAY_SIZE(efx_ef10_nvram_types)
60496050
60506051 static int efx_ef10_mtd_probe_partition(struct efx_nic *efx,
60516052 struct efx_mcdi_mtd_partition *part,
6052− unsigned int type)
6053+ unsigned int type,
6054+ unsigned long *found)
60536055 {
60546056 MCDI_DECLARE_BUF(inbuf, MC_CMD_NVRAM_METADATA_IN_LEN);
60556057 MCDI_DECLARE_BUF(outbuf, MC_CMD_NVRAM_METADATA_OUT_LENMAX);
60566058 const struct efx_ef10_nvram_type_info *info;
60576059 size_t size, erase_size, outlen;
6060+ int type_idx = 0;
60586061 bool protected;
60596062 int rc;
60606063
6061− for (info = efx_ef10_nvram_types; ; info++) {
6062− if (info ==
6063− efx_ef10_nvram_types + ARRAY_SIZE(efx_ef10_nvram_types))
6064+ for (type_idx = 0; ; type_idx++) {
6065+ if (type_idx == EF10_NVRAM_PARTITION_COUNT)
60646066 return -ENODEV;
6067+ info = efx_ef10_nvram_types + type_idx;
60656068 if ((type & ~info->type_mask) == info->type)
60666069 break;
60676070 }
@@ -6074,6 +6077,13 @@ static int efx_ef10_mtd_probe_partition(struct efx_nic *efx, · 6 unmodified lines
60746077 if (protected)
60756078 return -ENODEV; /* hide it */
60766079
6080+ /* If we've already exposed a partition of this type, hide this
6081+ * duplicate. All operations on MTDs are keyed by the type anyway,
6082+ * so we can't act on the duplicate.
6083+ */
6084+ if (__test_and_set_bit(type_idx, found))
6085+ return -EEXIST;
6086+
60776087 part->nvram_type = type;
60786088
60796089 MCDI_SET_DWORD(inbuf, NVRAM_METADATA_IN_TYPE, type);
@@ -6105,6 +6115,7 @@ static int efx_ef10_mtd_probe_partition(struct efx_nic *efx, · 25 unmodified lines
61056115 static int efx_ef10_mtd_probe(struct efx_nic *efx)
61066116 {
61076117 MCDI_DECLARE_BUF(outbuf, MC_CMD_NVRAM_PARTITIONS_OUT_LENMAX);
6118+ DECLARE_BITMAP(found, EF10_NVRAM_PARTITION_COUNT);
61086119 struct efx_mcdi_mtd_partition *parts;
61096120 size_t outlen, n_parts_total, i, n_parts;
61106121 unsigned int type;
@@ -6133,11 +6144,13 @@ static int efx_ef10_mtd_probe(struct efx_nic *efx) · 22 unmodified lines
61336144 for (i = 0; i < n_parts_total; i++) {
61346145 type = MCDI_ARRAY_DWORD(outbuf, NVRAM_PARTITIONS_OUT_TYPE_ID,
61356146 i);
6136− rc = efx_ef10_mtd_probe_partition(efx, &parts[n_parts], type);
6137− if (rc == 0)
6138− n_parts++;
6139− else if (rc != -ENODEV)
6147+ rc = efx_ef10_mtd_probe_partition(efx, &parts[n_parts], type,
6148+ found);
6149+ if (rc == -EEXIST || rc == -ENODEV)
6150+ continue;
6151+ if (rc)
61406152 goto fail;
6153+ n_parts++;
61416154 }
61426155
61436156 rc = efx_mtd_add(efx, &parts[0].common, n_parts, sizeof(*parts));
drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c+3−1
@@ -1342,8 +1342,10 @@ static int rk_gmac_powerup(struct rk_priv_data *bsp_priv) · 1341 unmodified lines
13421342 }
13431343
13441344 ret = phy_power_on(bsp_priv, true);
1345− if (ret)
1345+ if (ret) {
1346+ gmac_clk_enable(bsp_priv, false);
13461347 return ret;
1348+ }
13471349
13481350 pm_runtime_enable(dev);
13491351 pm_runtime_get_sync(dev);
drivers/net/ethernet/stmicro/stmmac/dwxgmac2_dma.c+3−3
@@ -263,6 +263,7 @@ static int dwxgmac2_dma_interrupt(void __iomem *ioaddr, · 262 unmodified lines
263263 struct stmmac_extra_stats *x, u32 chan)
264264 {
265265 u32 intr_status = readl(ioaddr + XGMAC_DMA_CH_STATUS(chan));
266+ u32 intr_en = readl(ioaddr + XGMAC_DMA_CH_INT_EN(chan));
266267 int ret = 0;
267268
268269 /* ABNORMAL interrupts */
@@ -282,8 +283,7 @@ static int dwxgmac2_dma_interrupt(void __iomem *ioaddr, · 13 unmodified lines
282283 x->normal_irq_n++;
283284
284285 if (likely(intr_status & XGMAC_RI)) {
285− u32 value = readl(ioaddr + XGMAC_DMA_CH_INT_EN(chan));
286− if (likely(value & XGMAC_RIE)) {
286+ if (likely(intr_en & XGMAC_RIE)) {
287287 x->rx_normal_irq_n++;
288288 ret |= handle_rx;
289289 }
@@ -295,7 +295,7 @@ static int dwxgmac2_dma_interrupt(void __iomem *ioaddr, · 5 unmodified lines
295295 }
296296
297297 /* Clear interrupts */
298− writel(~0x0, ioaddr + XGMAC_DMA_CH_STATUS(chan));
298+ writel(intr_en & intr_status, ioaddr + XGMAC_DMA_CH_STATUS(chan));
299299
300300 return ret;
301301 }
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c+26−25
@@ -3517,27 +3517,28 @@ static int stmmac_napi_poll(struct napi_struct *napi, int budget) · 3516 unmodified lines
35173517 struct stmmac_channel *ch =
35183518 container_of(napi, struct stmmac_channel, napi);
35193519 struct stmmac_priv *priv = ch->priv_data;
3520− int work_done = 0, work_rem = budget;
3520+ int work_done, rx_done = 0, tx_done = 0;
35213521 u32 chan = ch->index;
35223522
35233523 priv->xstats.napi_poll++;
35243524
3525− if (ch->has_tx) {
3526− int done = stmmac_tx_clean(priv, work_rem, chan);
3525+ if (ch->has_tx)
3526+ tx_done = stmmac_tx_clean(priv, budget, chan);
3527+ if (ch->has_rx)
3528+ rx_done = stmmac_rx(priv, budget, chan);
35273529
3528− work_done += done;
3529− work_rem -= done;
3530− }
3531−
3532− if (ch->has_rx) {
3533− int done = stmmac_rx(priv, work_rem, chan);
3530+ work_done = max(rx_done, tx_done);
3531+ work_done = min(work_done, budget);
35343532
3535− work_done += done;
3536− work_rem -= done;
3537− }
3533+ if (work_done < budget && napi_complete_done(napi, work_done)) {
3534+ int stat;
35383535
3539− if (work_done < budget && napi_complete_done(napi, work_done))
35403536 stmmac_enable_dma_irq(priv, priv->ioaddr, chan);
3537+ stat = stmmac_dma_interrupt_status(priv, priv->ioaddr,
3538+ &priv->xstats, chan);
3539+ if (stat && napi_reschedule(napi))
3540+ stmmac_disable_dma_irq(priv, priv->ioaddr, chan);
3541+ }
35413542
35423543 return work_done;
35433544 }
@@ -4160,6 +4161,18 @@ static int stmmac_hw_init(struct stmmac_priv *priv) · 616 unmodified lines
41604161 return ret;
41614162 }
41624163
4164+ /* Rx Watchdog is available in the COREs newer than the 3.40.
4165+ * In some case, for example on bugged HW this feature
4166+ * has to be disable and this can be done by passing the
4167+ * riwt_off field from the platform.
4168+ */
4169+ if (((priv->synopsys_id >= DWMAC_CORE_3_50) ||
4170+ (priv->plat->has_xgmac)) && (!priv->plat->riwt_off)) {
4171+ priv->use_riwt = 1;
4172+ dev_info(priv->device,
4173+ "Enable RX Mitigation via HW Watchdog Timer\n");
4174+ }
4175+
41634176 return 0;
41644177 }
41654178
@@ -4292,18 +4305,6 @@ int stmmac_dvr_probe(struct device *device, · 126 unmodified lines
42924305 if (flow_ctrl)
42934306 priv->flow_ctrl = FLOW_AUTO; /* RX/TX pause on */
42944307
4295− /* Rx Watchdog is available in the COREs newer than the 3.40.
4296− * In some case, for example on bugged HW this feature
4297− * has to be disable and this can be done by passing the
4298− * riwt_off field from the platform.
4299− */
4300− if (((priv->synopsys_id >= DWMAC_CORE_3_50) ||
4301− (priv->plat->has_xgmac)) && (!priv->plat->riwt_off)) {
4302− priv->use_riwt = 1;
4303− dev_info(priv->device,
4304− "Enable RX Mitigation via HW Watchdog Timer\n");
4305− }
4306−
43074308 /* Setup channels NAPI */
43084309 maxq = max(priv->plat->rx_queues_to_use, priv->plat->tx_queues_to_use);
43094310
drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c+10−0
@@ -299,7 +299,17 @@ static int stmmac_pci_probe(struct pci_dev *pdev, · 298 unmodified lines
299299 */
300300 static void stmmac_pci_remove(struct pci_dev *pdev)
301301 {
302+ int i;
303+
302304 stmmac_dvr_remove(&pdev->dev);
305+
306+ for (i = 0; i <= PCI_STD_RESOURCE_END; i++) {
307+ if (pci_resource_len(pdev, i) == 0)
308+ continue;
309+ pcim_iounmap_regions(pdev, BIT(i));
310+ break;
311+ }
312+
303313 pci_disable_device(pdev);
304314 }
305315
drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c+2−0
@@ -301,6 +301,8 @@ static int tc_setup_cbs(struct stmmac_priv *priv, · 300 unmodified lines
301301 /* Queue 0 is not AVB capable */
302302 if (queue <= 0 || queue >= tx_queues_count)
303303 return -EINVAL;
304+ if (!priv->dma_cap.av)
305+ return -EOPNOTSUPP;
304306 if (priv->speed != SPEED_100 && priv->speed != SPEED_1000)
305307 return -EOPNOTSUPP;
306308
drivers/net/ethernet/sun/cassini.c+1−14
@@ -1,22 +1,9 @@
1−// SPDX-License-Identifier: GPL-2.0
1+// SPDX-License-Identifier: GPL-2.0+
22 /* cassini.c: Sun Microsystems Cassini(+) ethernet driver.
33 *
44 * Copyright (C) 2004 Sun Microsystems Inc.
55 * Copyright (C) 2003 Adrian Sun (asun@darksunrising.com)
66 *
7− * This program is free software; you can redistribute it and/or
8− * modify it under the terms of the GNU General Public License as
9− * published by the Free Software Foundation; either version 2 of the
10− * License, or (at your option) any later version.
11− *
12− * This program is distributed in the hope that it will be useful,
13− * but WITHOUT ANY WARRANTY; without even the implied warranty of
14− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15− * GNU General Public License for more details.
16− *
17− * You should have received a copy of the GNU General Public License
18− * along with this program; if not, see <http://www.gnu.org/licenses/>.
19− *
207 * This driver uses the sungem driver (c) David Miller
218 * (davem@redhat.com) as its basis.
229 *
drivers/net/ethernet/sun/cassini.h+1−14
@@ -1,23 +1,10 @@
1−/* SPDX-License-Identifier: GPL-2.0 */
1+/* SPDX-License-Identifier: GPL-2.0+ */
22 /* $Id: cassini.h,v 1.16 2004/08/17 21:15:16 zaumen Exp $
33 * cassini.h: Definitions for Sun Microsystems Cassini(+) ethernet driver.
44 *
55 * Copyright (C) 2004 Sun Microsystems Inc.
66 * Copyright (c) 2003 Adrian Sun (asun@darksunrising.com)
77 *
8− * This program is free software; you can redistribute it and/or
9− * modify it under the terms of the GNU General Public License as
10− * published by the Free Software Foundation; either version 2 of the
11− * License, or (at your option) any later version.
12− *
13− * This program is distributed in the hope that it will be useful,
14− * but WITHOUT ANY WARRANTY; without even the implied warranty of
15− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16− * GNU General Public License for more details.
17− *
18− * You should have received a copy of the GNU General Public License
19− * along with this program; if not, see <http://www.gnu.org/licenses/>.
20− *
218 * vendor id: 0x108E (Sun Microsystems, Inc.)
229 * device id: 0xabba (Cassini)
2310 * revision ids: 0x01 = Cassini
drivers/net/ethernet/ti/cpmac.c+1−1
@@ -608,7 +608,7 @@ static void cpmac_end_xmit(struct net_device *dev, int queue) · 607 unmodified lines
608608 netdev_dbg(dev, "sent 0x%p, len=%d\n",
609609 desc->skb, desc->skb->len);
610610
611− dev_kfree_skb_irq(desc->skb);
611+ dev_consume_skb_irq(desc->skb);
612612 desc->skb = NULL;
613613 if (__netif_subqueue_stopped(dev, queue))
614614 netif_wake_subqueue(dev, queue);
drivers/net/hyperv/hyperv_net.h+8−4
@@ -144,6 +144,8 @@ struct hv_netvsc_packet { · 143 unmodified lines
144144 u32 total_data_buflen;
145145 };
146146
147+#define NETVSC_HASH_KEYLEN 40
148+
147149 struct netvsc_device_info {
148150 unsigned char mac_adr[ETH_ALEN];
149151 u32 num_chn;
@@ -151,6 +153,8 @@ struct netvsc_device_info { · 1 unmodified line
151153 u32 recv_sections;
152154 u32 send_section_size;
153155 u32 recv_section_size;
156+
157+ u8 rss_key[NETVSC_HASH_KEYLEN];
154158 };
155159
156160 enum rndis_device_state {
@@ -160,8 +164,6 @@ enum rndis_device_state { · 3 unmodified lines
160164 RNDIS_DEV_DATAINITIALIZED,
161165 };
162166
163−#define NETVSC_HASH_KEYLEN 40
164−
165167 struct rndis_device {
166168 struct net_device *ndev;
167169
@@ -209,7 +211,9 @@ int netvsc_recv_callback(struct net_device *net, · 41 unmodified lines
209211 void netvsc_channel_cb(void *context);
210212 int netvsc_poll(struct napi_struct *napi, int budget);
211213
212−int rndis_set_subchannel(struct net_device *ndev, struct netvsc_device *nvdev);
214+int rndis_set_subchannel(struct net_device *ndev,
215+ struct netvsc_device *nvdev,
216+ struct netvsc_device_info *dev_info);
213217 int rndis_filter_open(struct netvsc_device *nvdev);
214218 int rndis_filter_close(struct netvsc_device *nvdev);
215219 struct netvsc_device *rndis_filter_device_add(struct hv_device *dev,
@@ -1177,7 +1181,7 @@ enum ndis_per_pkt_info_type { · 961 unmodified lines
11771181
11781182 enum rndis_per_pkt_info_interal_type {
11791183 RNDIS_PKTINFO_ID = 1,
1180− /* Add more memebers here */
1184+ /* Add more members here */
11811185
11821186 RNDIS_PKTINFO_MAX
11831187 };
drivers/net/hyperv/netvsc.c+2−2
@@ -84,7 +84,7 @@ static void netvsc_subchan_work(struct work_struct *w) · 83 unmodified lines
8484
8585 rdev = nvdev->extension;
8686 if (rdev) {
87− ret = rndis_set_subchannel(rdev->ndev, nvdev);
87+ ret = rndis_set_subchannel(rdev->ndev, nvdev, NULL);
8888 if (ret == 0) {
8989 netif_device_attach(rdev->ndev);
9090 } else {
@@ -1331,7 +1331,7 @@ void netvsc_channel_cb(void *context) · 1240 unmodified lines
13311331 prefetch(hv_get_ring_buffer(rbi) + rbi->priv_read_index);
13321332
13331333 if (napi_schedule_prep(&nvchan->napi)) {
1334− /* disable interupts from host */
1334+ /* disable interrupts from host */
13351335 hv_begin_read(rbi);
13361336
13371337 __napi_schedule_irqoff(&nvchan->napi);
drivers/net/hyperv/netvsc_drv.c+92−53
@@ -370,7 +370,7 @@ static u32 fill_pg_buf(struct page *page, u32 offset, u32 len, · 369 unmodified lines
370370 {
371371 int j = 0;
372372
373− /* Deal with compund pages by ignoring unused part
373+ /* Deal with compound pages by ignoring unused part
374374 * of the page.
375375 */
376376 page += (offset >> PAGE_SHIFT);
@@ -858,6 +858,39 @@ static void netvsc_get_channels(struct net_device *net, · 481 unmodified lines
858858 }
859859 }
860860
861+/* Alloc struct netvsc_device_info, and initialize it from either existing
862+ * struct netvsc_device, or from default values.
863+ */
864+static struct netvsc_device_info *netvsc_devinfo_get
865+ (struct netvsc_device *nvdev)
866+{
867+ struct netvsc_device_info *dev_info;
868+
869+ dev_info = kzalloc(sizeof(*dev_info), GFP_ATOMIC);
870+
871+ if (!dev_info)
872+ return NULL;
873+
874+ if (nvdev) {
875+ dev_info->num_chn = nvdev->num_chn;
876+ dev_info->send_sections = nvdev->send_section_cnt;
877+ dev_info->send_section_size = nvdev->send_section_size;
878+ dev_info->recv_sections = nvdev->recv_section_cnt;
879+ dev_info->recv_section_size = nvdev->recv_section_size;
880+
881+ memcpy(dev_info->rss_key, nvdev->extension->rss_key,
882+ NETVSC_HASH_KEYLEN);
883+ } else {
884+ dev_info->num_chn = VRSS_CHANNEL_DEFAULT;
885+ dev_info->send_sections = NETVSC_DEFAULT_TX;
886+ dev_info->send_section_size = NETVSC_SEND_SECTION_SIZE;
887+ dev_info->recv_sections = NETVSC_DEFAULT_RX;
888+ dev_info->recv_section_size = NETVSC_RECV_SECTION_SIZE;
889+ }
890+
891+ return dev_info;
892+}
893+
861894 static int netvsc_detach(struct net_device *ndev,
862895 struct netvsc_device *nvdev)
863896 {
@@ -909,7 +942,7 @@ static int netvsc_attach(struct net_device *ndev, · 45 unmodified lines
909942 return PTR_ERR(nvdev);
910943
911944 if (nvdev->num_chn > 1) {
912− ret = rndis_set_subchannel(ndev, nvdev);
945+ ret = rndis_set_subchannel(ndev, nvdev, dev_info);
913946
914947 /* if unavailable, just proceed with one queue */
915948 if (ret) {
@@ -943,7 +976,7 @@ static int netvsc_set_channels(struct net_device *net, · 27 unmodified lines
943976 struct net_device_context *net_device_ctx = netdev_priv(net);
944977 struct netvsc_device *nvdev = rtnl_dereference(net_device_ctx->nvdev);
945978 unsigned int orig, count = channels->combined_count;
946− struct netvsc_device_info device_info;
979+ struct netvsc_device_info *device_info;
947980 int ret;
948981
949982 /* We do not support separate count for rx, tx, or other */
@@ -962,24 +995,26 @@ static int netvsc_set_channels(struct net_device *net, · 12 unmodified lines
962995
963996 orig = nvdev->num_chn;
964997
965− memset(&device_info, 0, sizeof(device_info));
966− device_info.num_chn = count;
967− device_info.send_sections = nvdev->send_section_cnt;
968− device_info.send_section_size = nvdev->send_section_size;
969− device_info.recv_sections = nvdev->recv_section_cnt;
970− device_info.recv_section_size = nvdev->recv_section_size;
998+ device_info = netvsc_devinfo_get(nvdev);
999+
1000+ if (!device_info)
1001+ return -ENOMEM;
1002+
1003+ device_info->num_chn = count;
9711004
9721005 ret = netvsc_detach(net, nvdev);
9731006 if (ret)
974− return ret;
1007+ goto out;
9751008
976− ret = netvsc_attach(net, &device_info);
1009+ ret = netvsc_attach(net, device_info);
9771010 if (ret) {
978− device_info.num_chn = orig;
979− if (netvsc_attach(net, &device_info))
1011+ device_info->num_chn = orig;
1012+ if (netvsc_attach(net, device_info))
9801013 netdev_err(net, "restoring channel setting failed\n");
9811014 }
9821015
1016+out:
1017+ kfree(device_info);
9831018 return ret;
9841019 }
9851020
@@ -1048,48 +1083,45 @@ static int netvsc_change_mtu(struct net_device *ndev, int mtu) · 62 unmodified lines
10481083 struct net_device *vf_netdev = rtnl_dereference(ndevctx->vf_netdev);
10491084 struct netvsc_device *nvdev = rtnl_dereference(ndevctx->nvdev);
10501085 int orig_mtu = ndev->mtu;
1051− struct netvsc_device_info device_info;
1086+ struct netvsc_device_info *device_info;
10521087 int ret = 0;
10531088
10541089 if (!nvdev || nvdev->destroy)
10551090 return -ENODEV;
10561091
1092+ device_info = netvsc_devinfo_get(nvdev);
1093+
1094+ if (!device_info)
1095+ return -ENOMEM;
1096+
10571097 /* Change MTU of underlying VF netdev first. */
10581098 if (vf_netdev) {
10591099 ret = dev_set_mtu(vf_netdev, mtu);
10601100 if (ret)
1061− return ret;
1101+ goto out;
10621102 }
10631103
1064− memset(&device_info, 0, sizeof(device_info));
1065− device_info.num_chn = nvdev->num_chn;
1066− device_info.send_sections = nvdev->send_section_cnt;
1067− device_info.send_section_size = nvdev->send_section_size;
1068− device_info.recv_sections = nvdev->recv_section_cnt;
1069− device_info.recv_section_size = nvdev->recv_section_size;
1070−
10711104 ret = netvsc_detach(ndev, nvdev);
10721105 if (ret)
10731106 goto rollback_vf;
10741107
10751108 ndev->mtu = mtu;
10761109
1077− ret = netvsc_attach(ndev, &device_info);
1078− if (ret)
1079− goto rollback;
1080−
1081− return 0;
1110+ ret = netvsc_attach(ndev, device_info);
1111+ if (!ret)
1112+ goto out;
10821113
1083−rollback:
10841114 /* Attempt rollback to original MTU */
10851115 ndev->mtu = orig_mtu;
10861116
1087− if (netvsc_attach(ndev, &device_info))
1117+ if (netvsc_attach(ndev, device_info))
10881118 netdev_err(ndev, "restoring mtu failed\n");
10891119 rollback_vf:
10901120 if (vf_netdev)
10911121 dev_set_mtu(vf_netdev, orig_mtu);
10921122
1123+out:
1124+ kfree(device_info);
10931125 return ret;
10941126 }
10951127
@@ -1674,7 +1706,7 @@ static int netvsc_set_ringparam(struct net_device *ndev, · 578 unmodified lines
16741706 {
16751707 struct net_device_context *ndevctx = netdev_priv(ndev);
16761708 struct netvsc_device *nvdev = rtnl_dereference(ndevctx->nvdev);
1677− struct netvsc_device_info device_info;
1709+ struct netvsc_device_info *device_info;
16781710 struct ethtool_ringparam orig;
16791711 u32 new_tx, new_rx;
16801712 int ret = 0;
@@ -1694,26 +1726,29 @@ static int netvsc_set_ringparam(struct net_device *ndev, · 13 unmodified lines
16941726 new_rx == orig.rx_pending)
16951727 return 0; /* no change */
16961728
1697− memset(&device_info, 0, sizeof(device_info));
1698− device_info.num_chn = nvdev->num_chn;
1699− device_info.send_sections = new_tx;
1700− device_info.send_section_size = nvdev->send_section_size;
1701− device_info.recv_sections = new_rx;
1702− device_info.recv_section_size = nvdev->recv_section_size;
1729+ device_info = netvsc_devinfo_get(nvdev);
1730+
1731+ if (!device_info)
1732+ return -ENOMEM;
1733+
1734+ device_info->send_sections = new_tx;
1735+ device_info->recv_sections = new_rx;
17031736
17041737 ret = netvsc_detach(ndev, nvdev);
17051738 if (ret)
1706− return ret;
1739+ goto out;
17071740
1708− ret = netvsc_attach(ndev, &device_info);
1741+ ret = netvsc_attach(ndev, device_info);
17091742 if (ret) {
1710− device_info.send_sections = orig.tx_pending;
1711− device_info.recv_sections = orig.rx_pending;
1743+ device_info->send_sections = orig.tx_pending;
1744+ device_info->recv_sections = orig.rx_pending;
17121745
1713− if (netvsc_attach(ndev, &device_info))
1746+ if (netvsc_attach(ndev, device_info))
17141747 netdev_err(ndev, "restoring ringparam failed");
17151748 }
17161749
1750+out:
1751+ kfree(device_info);
17171752 return ret;
17181753 }
17191754
@@ -2088,7 +2123,7 @@ static int netvsc_register_vf(struct net_device *vf_netdev) · 368 unmodified lines
20882123 if (!netvsc_dev || rtnl_dereference(net_device_ctx->vf_netdev))
20892124 return NOTIFY_DONE;
20902125
2091− /* if syntihetic interface is a different namespace,
2126+ /* if synthetic interface is a different namespace,
20922127 * then move the VF to that namespace; join will be
20932128 * done again in that context.
20942129 */
@@ -2167,7 +2202,7 @@ static int netvsc_probe(struct hv_device *dev, · 72 unmodified lines
21672202 {
21682203 struct net_device *net = NULL;
21692204 struct net_device_context *net_device_ctx;
2170− struct netvsc_device_info device_info;
2205+ struct netvsc_device_info *device_info = NULL;
21712206 struct netvsc_device *nvdev;
21722207 int ret = -ENOMEM;
21732208
@@ -2214,21 +2249,21 @@ static int netvsc_probe(struct hv_device *dev, · 40 unmodified lines
22142249 netif_set_real_num_rx_queues(net, 1);
22152250
22162251 /* Notify the netvsc driver of the new device */
2217− memset(&device_info, 0, sizeof(device_info));
2218− device_info.num_chn = VRSS_CHANNEL_DEFAULT;
2219− device_info.send_sections = NETVSC_DEFAULT_TX;
2220− device_info.send_section_size = NETVSC_SEND_SECTION_SIZE;
2221− device_info.recv_sections = NETVSC_DEFAULT_RX;
2222− device_info.recv_section_size = NETVSC_RECV_SECTION_SIZE;
2223−
2224− nvdev = rndis_filter_device_add(dev, &device_info);
2252+ device_info = netvsc_devinfo_get(NULL);
2253+
2254+ if (!device_info) {
2255+ ret = -ENOMEM;
2256+ goto devinfo_failed;
2257+ }
2258+
2259+ nvdev = rndis_filter_device_add(dev, device_info);
22252260 if (IS_ERR(nvdev)) {
22262261 ret = PTR_ERR(nvdev);
22272262 netdev_err(net, "unable to add netvsc device (ret %d)\n", ret);
22282263 goto rndis_failed;
22292264 }
22302265
2231− memcpy(net->dev_addr, device_info.mac_adr, ETH_ALEN);
2266+ memcpy(net->dev_addr, device_info->mac_adr, ETH_ALEN);
22322267
22332268 /* We must get rtnl lock before scheduling nvdev->subchan_work,
22342269 * otherwise netvsc_subchan_work() can get rtnl lock first and wait
@@ -2236,7 +2271,7 @@ static int netvsc_probe(struct hv_device *dev, · 1 unmodified line
22362271 * netvsc_probe() can't get rtnl lock and as a result vmbus_onoffer()
22372272 * -> ... -> device_add() -> ... -> __device_attach() can't get
22382273 * the device lock, so all the subchannels can't be processed --
2239− * finally netvsc_subchan_work() hangs for ever.
2274+ * finally netvsc_subchan_work() hangs forever.
22402275 */
22412276 rtnl_lock();
22422277
@@ -2266,12 +2301,16 @@ static int netvsc_probe(struct hv_device *dev, · 23 unmodified lines
22662301
22672302 list_add(&net_device_ctx->list, &netvsc_dev_list);
22682303 rtnl_unlock();
2304+
2305+ kfree(device_info);
22692306 return 0;
22702307
22712308 register_failed:
22722309 rtnl_unlock();
22732310 rndis_filter_device_remove(dev, nvdev);
22742311 rndis_failed:
2312+ kfree(device_info);
2313+devinfo_failed:
22752314 free_percpu(net_device_ctx->vf_stats);
22762315 no_stats:
22772316 hv_set_drvdata(dev, NULL);
drivers/net/hyperv/rndis_filter.c+27−9
@@ -774,8 +774,8 @@ cleanup: · 773 unmodified lines
774774 return ret;
775775 }
776776
777−int rndis_filter_set_rss_param(struct rndis_device *rdev,
778− const u8 *rss_key)
777+static int rndis_set_rss_param_msg(struct rndis_device *rdev,
778+ const u8 *rss_key, u16 flag)
779779 {
780780 struct net_device *ndev = rdev->ndev;
781781 struct rndis_request *request;
@@ -804,7 +804,7 @@ int rndis_filter_set_rss_param(struct rndis_device *rdev, · 22 unmodified lines
804804 rssp->hdr.type = NDIS_OBJECT_TYPE_RSS_PARAMETERS;
805805 rssp->hdr.rev = NDIS_RECEIVE_SCALE_PARAMETERS_REVISION_2;
806806 rssp->hdr.size = sizeof(struct ndis_recv_scale_param);
807− rssp->flag = 0;
807+ rssp->flag = flag;
808808 rssp->hashinfo = NDIS_HASH_FUNC_TOEPLITZ | NDIS_HASH_IPV4 |
809809 NDIS_HASH_TCP_IPV4 | NDIS_HASH_IPV6 |
810810 NDIS_HASH_TCP_IPV6;
@@ -829,9 +829,12 @@ int rndis_filter_set_rss_param(struct rndis_device *rdev, · 18 unmodified lines
829829
830830 wait_for_completion(&request->wait_event);
831831 set_complete = &request->response_msg.msg.set_complete;
832− if (set_complete->status == RNDIS_STATUS_SUCCESS)
833− memcpy(rdev->rss_key, rss_key, NETVSC_HASH_KEYLEN);
834− else {
832+ if (set_complete->status == RNDIS_STATUS_SUCCESS) {
833+ if (!(flag & NDIS_RSS_PARAM_FLAG_DISABLE_RSS) &&
834+ !(flag & NDIS_RSS_PARAM_FLAG_HASH_KEY_UNCHANGED))
835+ memcpy(rdev->rss_key, rss_key, NETVSC_HASH_KEYLEN);
836+
837+ } else {
835838 netdev_err(ndev, "Fail to set RSS parameters:0x%x\n",
836839 set_complete->status);
837840 ret = -EINVAL;
@@ -842,6 +845,16 @@ cleanup: · 4 unmodified lines
842845 return ret;
843846 }
844847
848+int rndis_filter_set_rss_param(struct rndis_device *rdev,
849+ const u8 *rss_key)
850+{
851+ /* Disable RSS before change */
852+ rndis_set_rss_param_msg(rdev, rss_key,
853+ NDIS_RSS_PARAM_FLAG_DISABLE_RSS);
854+
855+ return rndis_set_rss_param_msg(rdev, rss_key, 0);
856+}
857+
845858 static int rndis_filter_query_device_link_status(struct rndis_device *dev,
846859 struct netvsc_device *net_device)
847860 {
@@ -1121,7 +1134,9 @@ static void netvsc_sc_open(struct vmbus_channel *new_sc) · 273 unmodified lines
11211134 * This breaks overlap of processing the host message for the
11221135 * new primary channel with the initialization of sub-channels.
11231136 */
1124−int rndis_set_subchannel(struct net_device *ndev, struct netvsc_device *nvdev)
1137+int rndis_set_subchannel(struct net_device *ndev,
1138+ struct netvsc_device *nvdev,
1139+ struct netvsc_device_info *dev_info)
11251140 {
11261141 struct nvsp_message *init_packet = &nvdev->channel_init_pkt;
11271142 struct net_device_context *ndev_ctx = netdev_priv(ndev);
@@ -1161,8 +1176,11 @@ int rndis_set_subchannel(struct net_device *ndev, struct netvsc_device *nvdev) · 33 unmodified lines
11611176 wait_event(nvdev->subchan_open,
11621177 atomic_read(&nvdev->open_chn) == nvdev->num_chn);
11631178
1164− /* ignore failues from setting rss parameters, still have channels */
1165− rndis_filter_set_rss_param(rdev, netvsc_hash_key);
1179+ /* ignore failures from setting rss parameters, still have channels */
1180+ if (dev_info)
1181+ rndis_filter_set_rss_param(rdev, dev_info->rss_key);
1182+ else
1183+ rndis_filter_set_rss_param(rdev, netvsc_hash_key);
11661184
11671185 netif_set_real_num_tx_queues(ndev, nvdev->num_chn);
11681186 netif_set_real_num_rx_queues(ndev, nvdev->num_chn);
drivers/net/macvlan.c+1−1
@@ -337,7 +337,7 @@ static void macvlan_process_broadcast(struct work_struct *w) · 336 unmodified lines
337337
338338 if (src)
339339 dev_put(src->dev);
340− kfree_skb(skb);
340+ consume_skb(skb);
341341 }
342342 }
343343
drivers/net/phy/asix.c+1−7
@@ -1,13 +1,7 @@
1−// SPDX-License-Identifier: GPL-2.0
1+// SPDX-License-Identifier: GPL-2.0+
22 /* Driver for Asix PHYs
33 *
44 * Author: Michael Schmitz <schmitzmic@gmail.com>
5− *
6− * This program is free software; you can redistribute it and/or modify it
7− * under the terms of the GNU General Public License as published by the
8− * Free Software Foundation; either version 2 of the License, or (at your
9− * option) any later version.
10− *
115 */
126 #include <linux/kernel.h>
137 #include <linux/errno.h>
drivers/net/phy/bcm87xx.c+2−0
@@ -197,6 +197,7 @@ static struct phy_driver bcm87xx_driver[] = { · 196 unmodified lines
197197 .phy_id = PHY_ID_BCM8706,
198198 .phy_id_mask = 0xffffffff,
199199 .name = "Broadcom BCM8706",
200+ .features = PHY_10GBIT_FEC_FEATURES,
200201 .config_init = bcm87xx_config_init,
201202 .config_aneg = bcm87xx_config_aneg,
202203 .read_status = bcm87xx_read_status,
@@ -208,6 +209,7 @@ static struct phy_driver bcm87xx_driver[] = { · 5 unmodified lines
208209 .phy_id = PHY_ID_BCM8727,
209210 .phy_id_mask = 0xffffffff,
210211 .name = "Broadcom BCM8727",
212+ .features = PHY_10GBIT_FEC_FEATURES,
211213 .config_init = bcm87xx_config_init,
212214 .config_aneg = bcm87xx_config_aneg,
213215 .read_status = bcm87xx_read_status,
drivers/net/phy/cortina.c+1−0
@@ -88,6 +88,7 @@ static struct phy_driver cortina_driver[] = { · 87 unmodified lines
8888 .phy_id = PHY_ID_CS4340,
8989 .phy_id_mask = 0xffffffff,
9090 .name = "Cortina CS4340",
91+ .features = PHY_10GBIT_FEATURES,
9192 .config_init = gen10g_config_init,
9293 .config_aneg = gen10g_config_aneg,
9394 .read_status = cortina_read_status,
drivers/net/phy/marvell.c+35−2
@@ -1046,6 +1046,39 @@ static int m88e1145_config_init(struct phy_device *phydev) · 1045 unmodified lines
10461046 return 0;
10471047 }
10481048
1049+/* The VOD can be out of specification on link up. Poke an
1050+ * undocumented register, in an undocumented page, with a magic value
1051+ * to fix this.
1052+ */
1053+static int m88e6390_errata(struct phy_device *phydev)
1054+{
1055+ int err;
1056+
1057+ err = phy_write(phydev, MII_BMCR,
1058+ BMCR_ANENABLE | BMCR_SPEED1000 | BMCR_FULLDPLX);
1059+ if (err)
1060+ return err;
1061+
1062+ usleep_range(300, 400);
1063+
1064+ err = phy_write_paged(phydev, 0xf8, 0x08, 0x36);
1065+ if (err)
1066+ return err;
1067+
1068+ return genphy_soft_reset(phydev);
1069+}
1070+
1071+static int m88e6390_config_aneg(struct phy_device *phydev)
1072+{
1073+ int err;
1074+
1075+ err = m88e6390_errata(phydev);
1076+ if (err)
1077+ return err;
1078+
1079+ return m88e1510_config_aneg(phydev);
1080+}
1081+
10491082 /**
10501083 * fiber_lpa_mod_linkmode_lpa_t
10511084 * @advertising: the linkmode advertisement settings
@@ -1402,7 +1435,7 @@ static int m88e1318_set_wol(struct phy_device *phydev, · 350 unmodified lines
14021435 * before enabling it if !phy_interrupt_is_valid()
14031436 */
14041437 if (!phy_interrupt_is_valid(phydev))
1405− phy_read(phydev, MII_M1011_IEVENT);
1438+ __phy_read(phydev, MII_M1011_IEVENT);
14061439
14071440 /* Enable the WOL interrupt */
14081441 err = __phy_modify(phydev, MII_88E1318S_PHY_CSIER, 0,
@@ -2283,7 +2316,7 @@ static struct phy_driver marvell_drivers[] = { · 874 unmodified lines
22832316 .features = PHY_GBIT_FEATURES,
22842317 .probe = m88e6390_probe,
22852318 .config_init = &marvell_config_init,
2286− .config_aneg = &m88e1510_config_aneg,
2319+ .config_aneg = &m88e6390_config_aneg,
22872320 .read_status = &marvell_read_status,
22882321 .ack_interrupt = &marvell_ack_interrupt,
22892322 .config_intr = &marvell_config_intr,
drivers/net/phy/mdio-hisi-femac.c+2−14
@@ -1,20 +1,8 @@
1+// SPDX-License-Identifier: GPL-2.0+
12 /*
23 * Hisilicon Fast Ethernet MDIO Bus Driver
34 *
45 * Copyright (c) 2016 HiSilicon Technologies Co., Ltd.
5− *
6− * This program is free software; you can redistribute it and/or modify
7− * it under the terms of the GNU General Public License as published by
8− * the Free Software Foundation; either version 2 of the License, or
9− * (at your option) any later version.
10− *
11− * This program is distributed in the hope that it will be useful,
12− * but WITHOUT ANY WARRANTY; without even the implied warranty of
13− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14− * GNU General Public License for more details.
15− *
16− * You should have received a copy of the GNU General Public License
17− * along with this program. If not, see <http://www.gnu.org/licenses/>.
186 */
197
208 #include <linux/clk.h>
@@ -163,4 +151,4 @@ module_platform_driver(hisi_femac_mdio_driver); · 142 unmodified lines
163151
164152 MODULE_DESCRIPTION("Hisilicon Fast Ethernet MAC MDIO interface driver");
165153 MODULE_AUTHOR("Dongpo Li <lidongpo@hisilicon.com>");
166−MODULE_LICENSE("GPL v2");
154+MODULE_LICENSE("GPL");
drivers/net/phy/mdio_bus.c+1−0
@@ -390,6 +390,7 @@ int __mdiobus_register(struct mii_bus *bus, struct module *owner) · 389 unmodified lines
390390 if (IS_ERR(gpiod)) {
391391 dev_err(&bus->dev, "mii_bus %s couldn't get reset GPIO\n",
392392 bus->id);
393+ device_del(&bus->dev);
393394 return PTR_ERR(gpiod);
394395 } else if (gpiod) {
395396 bus->reset_gpiod = gpiod;
drivers/net/phy/meson-gxl.c+1−0
@@ -233,6 +233,7 @@ static struct phy_driver meson_gxl_phy[] = { · 232 unmodified lines
233233 .name = "Meson GXL Internal PHY",
234234 .features = PHY_BASIC_FEATURES,
235235 .flags = PHY_IS_INTERNAL,
236+ .soft_reset = genphy_soft_reset,
236237 .config_init = meson_gxl_config_init,
237238 .aneg_done = genphy_aneg_done,
238239 .read_status = meson_gxl_read_status,
drivers/net/phy/micrel.c+2−0
@@ -1070,6 +1070,7 @@ static struct phy_driver ksphy_driver[] = { · 1069 unmodified lines
10701070 .driver_data = &ksz9021_type,
10711071 .probe = kszphy_probe,
10721072 .config_init = ksz9031_config_init,
1073+ .soft_reset = genphy_soft_reset,
10731074 .read_status = ksz9031_read_status,
10741075 .ack_interrupt = kszphy_ack_interrupt,
10751076 .config_intr = kszphy_config_intr,
@@ -1098,6 +1099,7 @@ static struct phy_driver ksphy_driver[] = { · 22 unmodified lines
10981099 .phy_id = PHY_ID_KSZ8873MLL,
10991100 .phy_id_mask = MICREL_PHY_ID_MASK,
11001101 .name = "Micrel KSZ8873MLL Switch",
1102+ .features = PHY_BASIC_FEATURES,
11011103 .config_init = kszphy_config_init,
11021104 .config_aneg = ksz8873mll_config_aneg,
11031105 .read_status = ksz8873mll_read_status,
drivers/net/phy/phy.c+7−12
@@ -543,13 +543,6 @@ int phy_start_aneg(struct phy_device *phydev) · 542 unmodified lines
543543
544544 mutex_lock(&phydev->lock);
545545
546− if (!__phy_is_started(phydev)) {
547− WARN(1, "called from state %s\n",
548− phy_state_to_str(phydev->state));
549− err = -EBUSY;
550− goto out_unlock;
551− }
552−
553546 if (AUTONEG_DISABLE == phydev->autoneg)
554547 phy_sanitize_settings(phydev);
555548
@@ -560,11 +553,13 @@ int phy_start_aneg(struct phy_device *phydev) · 4 unmodified lines
560553 if (err < 0)
561554 goto out_unlock;
562555
563− if (phydev->autoneg == AUTONEG_ENABLE) {
564− err = phy_check_link_status(phydev);
565− } else {
566− phydev->state = PHY_FORCING;
567− phydev->link_timeout = PHY_FORCE_TIMEOUT;
556+ if (__phy_is_started(phydev)) {
557+ if (phydev->autoneg == AUTONEG_ENABLE) {
558+ err = phy_check_link_status(phydev);
559+ } else {
560+ phydev->state = PHY_FORCING;
561+ phydev->link_timeout = PHY_FORCE_TIMEOUT;
562+ }
568563 }
569564
570565 out_unlock:
drivers/net/phy/phy_device.c+17−0
@@ -61,6 +61,9 @@ EXPORT_SYMBOL_GPL(phy_gbit_all_ports_features); · 60 unmodified lines
6161 __ETHTOOL_DECLARE_LINK_MODE_MASK(phy_10gbit_features) __ro_after_init;
6262 EXPORT_SYMBOL_GPL(phy_10gbit_features);
6363
64+__ETHTOOL_DECLARE_LINK_MODE_MASK(phy_10gbit_fec_features) __ro_after_init;
65+EXPORT_SYMBOL_GPL(phy_10gbit_fec_features);
66+
6467 static const int phy_basic_ports_array[] = {
6568 ETHTOOL_LINK_MODE_Autoneg_BIT,
6669 ETHTOOL_LINK_MODE_TP_BIT,
@@ -109,6 +112,11 @@ const int phy_10gbit_features_array[1] = { · 42 unmodified lines
109112 };
110113 EXPORT_SYMBOL_GPL(phy_10gbit_features_array);
111114
115+const int phy_10gbit_fec_features_array[1] = {
116+ ETHTOOL_LINK_MODE_10000baseR_FEC_BIT,
117+};
118+EXPORT_SYMBOL_GPL(phy_10gbit_fec_features_array);
119+
112120 __ETHTOOL_DECLARE_LINK_MODE_MASK(phy_10gbit_full_features) __ro_after_init;
113121 EXPORT_SYMBOL_GPL(phy_10gbit_full_features);
114122
@@ -191,6 +199,10 @@ static void features_init(void) · 76 unmodified lines
191199 linkmode_set_bit_array(phy_10gbit_full_features_array,
192200 ARRAY_SIZE(phy_10gbit_full_features_array),
193201 phy_10gbit_full_features);
202+ /* 10G FEC only */
203+ linkmode_set_bit_array(phy_10gbit_fec_features_array,
204+ ARRAY_SIZE(phy_10gbit_fec_features_array),
205+ phy_10gbit_fec_features);
194206 }
195207
196208 void phy_device_free(struct phy_device *phydev)
@@ -2243,6 +2255,11 @@ int phy_driver_register(struct phy_driver *new_driver, struct module *owner) · 2046 unmodified lines
22432255 {
22442256 int retval;
22452257
2258+ if (WARN_ON(!new_driver->features)) {
2259+ pr_err("%s: Driver features are missing\n", new_driver->name);
2260+ return -EINVAL;
2261+ }
2262+
22462263 new_driver->mdiodrv.flags |= MDIO_DEVICE_IS_PHY;
22472264 new_driver->mdiodrv.driver.name = new_driver->name;
22482265 new_driver->mdiodrv.driver.bus = &mdio_bus_type;
drivers/net/phy/rockchip.c+2−7
@@ -1,3 +1,4 @@
1+// SPDX-License-Identifier: GPL-2.0+
12 /**
23 * drivers/net/phy/rockchip.c
34 *
@@ -6,12 +7,6 @@ · 2 unmodified lines
67 * Copyright (c) 2017, Fuzhou Rockchip Electronics Co., Ltd
78 *
89 * David Wu <david.wu@rock-chips.com>
9− *
10− * This program is free software; you can redistribute it and/or modify
11− * it under the terms of the GNU General Public License as published by
12− * the Free Software Foundation; either version 2 of the License, or
13− * (at your option) any later version.
14− *
1510 */
1611
1712 #include <linux/ethtool.h>
@@ -229,4 +224,4 @@ MODULE_DEVICE_TABLE(mdio, rockchip_phy_tbl); · 211 unmodified lines
229224
230225 MODULE_AUTHOR("David Wu <david.wu@rock-chips.com>");
231226 MODULE_DESCRIPTION("Rockchip Ethernet PHY driver");
232−MODULE_LICENSE("GPL v2");
227+MODULE_LICENSE("GPL");
drivers/net/phy/teranetics.c+1−0
@@ -80,6 +80,7 @@ static struct phy_driver teranetics_driver[] = { · 79 unmodified lines
8080 .phy_id = PHY_ID_TN2020,
8181 .phy_id_mask = 0xffffffff,
8282 .name = "Teranetics TN2020",
83+ .features = PHY_10GBIT_FEATURES,
8384 .soft_reset = gen10g_no_soft_reset,
8485 .aneg_done = teranetics_aneg_done,
8586 .config_init = gen10g_config_init,
drivers/net/ppp/pppoe.c+1−0
@@ -445,6 +445,7 @@ static int pppoe_rcv(struct sk_buff *skb, struct net_device *dev, · 444 unmodified lines
445445 if (pskb_trim_rcsum(skb, len))
446446 goto drop;
447447
448+ ph = pppoe_hdr(skb);
448449 pn = pppoe_pernet(dev_net(dev));
449450
450451 /* Note that get_item does a sock_hold(), so sk_pppox(po)
drivers/net/tun.c+7−4
@@ -856,10 +856,6 @@ static int tun_attach(struct tun_struct *tun, struct file *file, · 855 unmodified lines
856856 err = 0;
857857 }
858858
859− rcu_assign_pointer(tfile->tun, tun);
860− rcu_assign_pointer(tun->tfiles[tun->numqueues], tfile);
861− tun->numqueues++;
862−
863859 if (tfile->detached) {
864860 tun_enable_queue(tfile);
865861 } else {
@@ -876,6 +872,13 @@ static int tun_attach(struct tun_struct *tun, struct file *file, · 10 unmodified lines
876872 * refcnt.
877873 */
878874
875+ /* Publish tfile->tun and tun->tfiles only after we've fully
876+ * initialized tfile; otherwise we risk using half-initialized
877+ * object.
878+ */
879+ rcu_assign_pointer(tfile->tun, tun);
880+ rcu_assign_pointer(tun->tfiles[tun->numqueues], tfile);
881+ tun->numqueues++;
879882 out:
880883 return err;
881884 }
drivers/net/usb/aqc111.c+15−0
@@ -1287,6 +1287,20 @@ static const struct driver_info asix112_info = { · 1286 unmodified lines
12871287
12881288 #undef ASIX112_DESC
12891289
1290+static const struct driver_info trendnet_info = {
1291+ .description = "USB-C 3.1 to 5GBASE-T Ethernet Adapter",
1292+ .bind = aqc111_bind,
1293+ .unbind = aqc111_unbind,
1294+ .status = aqc111_status,
1295+ .link_reset = aqc111_link_reset,
1296+ .reset = aqc111_reset,
1297+ .stop = aqc111_stop,
1298+ .flags = FLAG_ETHER | FLAG_FRAMING_AX |
1299+ FLAG_AVOID_UNLINK_URBS | FLAG_MULTI_PACKET,
1300+ .rx_fixup = aqc111_rx_fixup,
1301+ .tx_fixup = aqc111_tx_fixup,
1302+};
1303+
12901304 static int aqc111_suspend(struct usb_interface *intf, pm_message_t message)
12911305 {
12921306 struct usbnet *dev = usb_get_intfdata(intf);
@@ -1440,6 +1454,7 @@ static const struct usb_device_id products[] = { · 147 unmodified lines
14401454 {AQC111_USB_ETH_DEV(0x2eca, 0xc101, aqc111_info)},
14411455 {AQC111_USB_ETH_DEV(0x0b95, 0x2790, asix111_info)},
14421456 {AQC111_USB_ETH_DEV(0x0b95, 0x2791, asix112_info)},
1457+ {AQC111_USB_ETH_DEV(0x20f4, 0xe05a, trendnet_info)},
14431458 { },/* END */
14441459 };
14451460 MODULE_DEVICE_TABLE(usb, products);
drivers/net/usb/asix_devices.c+7−2
@@ -739,8 +739,13 @@ static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf) · 738 unmodified lines
739739 asix_read_cmd(dev, AX_CMD_STATMNGSTS_REG, 0, 0, 1, &chipcode, 0);
740740 chipcode &= AX_CHIPCODE_MASK;
741741
742− (chipcode == AX_AX88772_CHIPCODE) ? ax88772_hw_reset(dev, 0) :
743− ax88772a_hw_reset(dev, 0);
742+ ret = (chipcode == AX_AX88772_CHIPCODE) ? ax88772_hw_reset(dev, 0) :
743+ ax88772a_hw_reset(dev, 0);
744+
745+ if (ret < 0) {
746+ netdev_dbg(dev->net, "Failed to reset AX88772: %d\n", ret);
747+ return ret;
748+ }
744749
745750 /* Read PHYID register *AFTER* the PHY was reset properly */
746751 phyid = asix_get_phyid(dev);
drivers/net/usb/cdc_ether.c+19−15
@@ -179,10 +179,8 @@ int usbnet_generic_cdc_bind(struct usbnet *dev, struct usb_interface *intf) · 178 unmodified lines
179179 * probed with) and a slave/data interface; union
180180 * descriptors sort this all out.
181181 */
182− info->control = usb_ifnum_to_if(dev->udev,
183− info->u->bMasterInterface0);
184− info->data = usb_ifnum_to_if(dev->udev,
185− info->u->bSlaveInterface0);
182+ info->control = usb_ifnum_to_if(dev->udev, info->u->bMasterInterface0);
183+ info->data = usb_ifnum_to_if(dev->udev, info->u->bSlaveInterface0);
186184 if (!info->control || !info->data) {
187185 dev_dbg(&intf->dev,
188186 "master #%u/%p slave #%u/%p\n",
@@ -216,18 +214,16 @@ int usbnet_generic_cdc_bind(struct usbnet *dev, struct usb_interface *intf) · 27 unmodified lines
216214 /* a data interface altsetting does the real i/o */
217215 d = &info->data->cur_altsetting->desc;
218216 if (d->bInterfaceClass != USB_CLASS_CDC_DATA) {
219− dev_dbg(&intf->dev, "slave class %u\n",
220− d->bInterfaceClass);
217+ dev_dbg(&intf->dev, "slave class %u\n", d->bInterfaceClass);
221218 goto bad_desc;
222219 }
223220 skip:
224− if ( rndis &&
225− header.usb_cdc_acm_descriptor &&
226− header.usb_cdc_acm_descriptor->bmCapabilities) {
227− dev_dbg(&intf->dev,
228− "ACM capabilities %02x, not really RNDIS?\n",
229− header.usb_cdc_acm_descriptor->bmCapabilities);
230− goto bad_desc;
221+ if (rndis && header.usb_cdc_acm_descriptor &&
222+ header.usb_cdc_acm_descriptor->bmCapabilities) {
223+ dev_dbg(&intf->dev,
224+ "ACM capabilities %02x, not really RNDIS?\n",
225+ header.usb_cdc_acm_descriptor->bmCapabilities);
226+ goto bad_desc;
231227 }
232228
233229 if (header.usb_cdc_ether_desc && info->ether->wMaxSegmentSize) {
@@ -238,7 +234,7 @@ skip: · 4 unmodified lines
238234 }
239235
240236 if (header.usb_cdc_mdlm_desc &&
241− memcmp(header.usb_cdc_mdlm_desc->bGUID, mbm_guid, 16)) {
237+ memcmp(header.usb_cdc_mdlm_desc->bGUID, mbm_guid, 16)) {
242238 dev_dbg(&intf->dev, "GUID doesn't match\n");
243239 goto bad_desc;
244240 }
@@ -302,7 +298,7 @@ skip: · 57 unmodified lines
302298 if (info->control->cur_altsetting->desc.bNumEndpoints == 1) {
303299 struct usb_endpoint_descriptor *desc;
304300
305− dev->status = &info->control->cur_altsetting->endpoint [0];
301+ dev->status = &info->control->cur_altsetting->endpoint[0];
306302 desc = &dev->status->desc;
307303 if (!usb_endpoint_is_int_in(desc) ||
308304 (le16_to_cpu(desc->wMaxPacketSize)
@@ -847,6 +843,14 @@ static const struct usb_device_id products[] = { · 538 unmodified lines
847843 .driver_info = 0,
848844 },
849845
846+/* USB-C 3.1 to 5GBASE-T Ethernet Adapter (based on AQC111U) */
847+{
848+ USB_DEVICE_AND_INTERFACE_INFO(0x20f4, 0xe05a, USB_CLASS_COMM,
849+ USB_CDC_SUBCLASS_ETHERNET,
850+ USB_CDC_PROTO_NONE),
851+ .driver_info = 0,
852+},
853+
850854 /* WHITELIST!!!
851855 *
852856 * CDC Ether uses two interfaces, not necessarily consecutive.
drivers/net/usb/qmi_wwan.c+1−0
@@ -123,6 +123,7 @@ static void qmimux_setup(struct net_device *dev) · 122 unmodified lines
123123 dev->addr_len = 0;
124124 dev->flags = IFF_POINTOPOINT | IFF_NOARP | IFF_MULTICAST;
125125 dev->netdev_ops = &qmimux_netdev_ops;
126+ dev->mtu = 1500;
126127 dev->needs_free_netdev = true;
127128 }
128129
drivers/net/virtio_net.c+6−6
@@ -1330,7 +1330,7 @@ static int virtnet_receive(struct receive_queue *rq, int budget, · 1329 unmodified lines
13301330 return stats.packets;
13311331 }
13321332
1333−static void free_old_xmit_skbs(struct send_queue *sq)
1333+static void free_old_xmit_skbs(struct send_queue *sq, bool in_napi)
13341334 {
13351335 struct sk_buff *skb;
13361336 unsigned int len;
@@ -1343,7 +1343,7 @@ static void free_old_xmit_skbs(struct send_queue *sq) · 6 unmodified lines
13431343 bytes += skb->len;
13441344 packets++;
13451345
1346− dev_consume_skb_any(skb);
1346+ napi_consume_skb(skb, in_napi);
13471347 }
13481348
13491349 /* Avoid overhead when no packets have been processed
@@ -1369,7 +1369,7 @@ static void virtnet_poll_cleantx(struct receive_queue *rq) · 19 unmodified lines
13691369 return;
13701370
13711371 if (__netif_tx_trylock(txq)) {
1372− free_old_xmit_skbs(sq);
1372+ free_old_xmit_skbs(sq, true);
13731373 __netif_tx_unlock(txq);
13741374 }
13751375
@@ -1445,7 +1445,7 @@ static int virtnet_poll_tx(struct napi_struct *napi, int budget) · 69 unmodified lines
14451445 struct netdev_queue *txq = netdev_get_tx_queue(vi->dev, vq2txq(sq->vq));
14461446
14471447 __netif_tx_lock(txq, raw_smp_processor_id());
1448− free_old_xmit_skbs(sq);
1448+ free_old_xmit_skbs(sq, true);
14491449 __netif_tx_unlock(txq);
14501450
14511451 virtqueue_napi_complete(napi, sq->vq, 0);
@@ -1514,7 +1514,7 @@ static netdev_tx_t start_xmit(struct sk_buff *skb, struct net_device *dev) · 62 unmodified lines
15141514 bool use_napi = sq->napi.weight;
15151515
15161516 /* Free up any pending old buffers before queueing new ones. */
1517− free_old_xmit_skbs(sq);
1517+ free_old_xmit_skbs(sq, false);
15181518
15191519 if (use_napi && kick)
15201520 virtqueue_enable_cb_delayed(sq->vq);
@@ -1557,7 +1557,7 @@ static netdev_tx_t start_xmit(struct sk_buff *skb, struct net_device *dev) · 36 unmodified lines
15571557 if (!use_napi &&
15581558 unlikely(!virtqueue_enable_cb_delayed(sq->vq))) {
15591559 /* More just got used, free them then recheck. */
1560− free_old_xmit_skbs(sq);
1560+ free_old_xmit_skbs(sq, false);
15611561 if (sq->vq->num_free >= 2+MAX_SKB_FRAGS) {
15621562 netif_start_subqueue(dev, qnum);
15631563 virtqueue_disable_cb(sq->vq);
drivers/net/wan/fsl_ucc_hdlc.c+61−1
@@ -1056,6 +1056,54 @@ static const struct net_device_ops uhdlc_ops = { · 1055 unmodified lines
10561056 .ndo_tx_timeout = uhdlc_tx_timeout,
10571057 };
10581058
1059+static int hdlc_map_iomem(char *name, int init_flag, void __iomem **ptr)
1060+{
1061+ struct device_node *np;
1062+ struct platform_device *pdev;
1063+ struct resource *res;
1064+ static int siram_init_flag;
1065+ int ret = 0;
1066+
1067+ np = of_find_compatible_node(NULL, NULL, name);
1068+ if (!np)
1069+ return -EINVAL;
1070+
1071+ pdev = of_find_device_by_node(np);
1072+ if (!pdev) {
1073+ pr_err("%pOFn: failed to lookup pdev\n", np);
1074+ of_node_put(np);
1075+ return -EINVAL;
1076+ }
1077+
1078+ of_node_put(np);
1079+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1080+ if (!res) {
1081+ ret = -EINVAL;
1082+ goto error_put_device;
1083+ }
1084+ *ptr = ioremap(res->start, resource_size(res));
1085+ if (!*ptr) {
1086+ ret = -ENOMEM;
1087+ goto error_put_device;
1088+ }
1089+
1090+ /* We've remapped the addresses, and we don't need the device any
1091+ * more, so we should release it.
1092+ */
1093+ put_device(&pdev->dev);
1094+
1095+ if (init_flag && siram_init_flag == 0) {
1096+ memset_io(*ptr, 0, resource_size(res));
1097+ siram_init_flag = 1;
1098+ }
1099+ return 0;
1100+
1101+error_put_device:
1102+ put_device(&pdev->dev);
1103+
1104+ return ret;
1105+}
1106+
10591107 static int ucc_hdlc_probe(struct platform_device *pdev)
10601108 {
10611109 struct device_node *np = pdev->dev.of_node;
@@ -1150,6 +1198,15 @@ static int ucc_hdlc_probe(struct platform_device *pdev) · 88 unmodified lines
11501198 ret = ucc_of_parse_tdm(np, utdm, ut_info);
11511199 if (ret)
11521200 goto free_utdm;
1201+
1202+ ret = hdlc_map_iomem("fsl,t1040-qe-si", 0,
1203+ (void __iomem **)&utdm->si_regs);
1204+ if (ret)
1205+ goto free_utdm;
1206+ ret = hdlc_map_iomem("fsl,t1040-qe-siram", 1,
1207+ (void __iomem **)&utdm->siram);
1208+ if (ret)
1209+ goto unmap_si_regs;
11531210 }
11541211
11551212 if (of_property_read_u16(np, "fsl,hmask", &uhdlc_priv->hmask))
@@ -1158,7 +1215,7 @@ static int ucc_hdlc_probe(struct platform_device *pdev) · 2 unmodified lines
11581215 ret = uhdlc_init(uhdlc_priv);
11591216 if (ret) {
11601217 dev_err(&pdev->dev, "Failed to init uhdlc\n");
1161− goto free_utdm;
1218+ goto undo_uhdlc_init;
11621219 }
11631220
11641221 dev = alloc_hdlcdev(uhdlc_priv);
@@ -1187,6 +1244,9 @@ static int ucc_hdlc_probe(struct platform_device *pdev) · 22 unmodified lines
11871244 free_dev:
11881245 free_netdev(dev);
11891246 undo_uhdlc_init:
1247+ iounmap(utdm->siram);
1248+unmap_si_regs:
1249+ iounmap(utdm->si_regs);
11901250 free_utdm:
11911251 if (uhdlc_priv->tsa)
11921252 kfree(utdm);
drivers/net/wireless/mac80211_hwsim.c+5−0
@@ -2761,6 +2761,11 @@ static int mac80211_hwsim_new_radio(struct genl_info *info, · 2760 unmodified lines
27612761 BIT(NL80211_CHAN_WIDTH_160);
27622762 }
27632763
2764+ if (!n_limits) {
2765+ err = -EINVAL;
2766+ goto failed_hw;
2767+ }
2768+
27642769 data->if_combination.n_limits = n_limits;
27652770 data->if_combination.max_interfaces = 2048;
27662771 data->if_combination.limits = data->if_limits;
drivers/net/wireless/virt_wifi.c+3−1
@@ -530,8 +530,10 @@ static int virt_wifi_newlink(struct net *src_net, struct net_device *dev, · 529 unmodified lines
530530 SET_NETDEV_DEV(dev, &priv->lowerdev->dev);
531531 dev->ieee80211_ptr = kzalloc(sizeof(*dev->ieee80211_ptr), GFP_KERNEL);
532532
533− if (!dev->ieee80211_ptr)
533+ if (!dev->ieee80211_ptr) {
534+ err = -ENOMEM;
534535 goto remove_handler;
536+ }
535537
536538 dev->ieee80211_ptr->iftype = NL80211_IFTYPE_STATION;
537539 dev->ieee80211_ptr->wiphy = common_wiphy;
drivers/nvdimm/dimm.c+6−0
@@ -26,6 +26,12 @@ static int nvdimm_probe(struct device *dev) · 25 unmodified lines
2626 struct nvdimm_drvdata *ndd;
2727 int rc;
2828
29+ rc = nvdimm_security_setup_events(dev);
30+ if (rc < 0) {
31+ dev_err(dev, "security event setup failed: %d\n", rc);
32+ return rc;
33+ }
34+
2935 rc = nvdimm_check_config_data(dev);
3036 if (rc) {
3137 /* not required for non-aliased nvdimm, ex. NVDIMM-N */
drivers/nvdimm/dimm_devs.c+17−5
@@ -578,13 +578,25 @@ struct nvdimm *__nvdimm_create(struct nvdimm_bus *nvdimm_bus, · 577 unmodified lines
578578 }
579579 EXPORT_SYMBOL_GPL(__nvdimm_create);
580580
581−int nvdimm_security_setup_events(struct nvdimm *nvdimm)
581+static void shutdown_security_notify(void *data)
582582 {
583− nvdimm->sec.overwrite_state = sysfs_get_dirent(nvdimm->dev.kobj.sd,
584− "security");
583+ struct nvdimm *nvdimm = data;
584+
585+ sysfs_put(nvdimm->sec.overwrite_state);
586+}
587+
588+int nvdimm_security_setup_events(struct device *dev)
589+{
590+ struct nvdimm *nvdimm = to_nvdimm(dev);
591+
592+ if (nvdimm->sec.state < 0 || !nvdimm->sec.ops
593+ || !nvdimm->sec.ops->overwrite)
594+ return 0;
595+ nvdimm->sec.overwrite_state = sysfs_get_dirent(dev->kobj.sd, "security");
585596 if (!nvdimm->sec.overwrite_state)
586− return -ENODEV;
587− return 0;
597+ return -ENOMEM;
598+
599+ return devm_add_action_or_reset(dev, shutdown_security_notify, nvdimm);
588600 }
589601 EXPORT_SYMBOL_GPL(nvdimm_security_setup_events);
590602
drivers/nvdimm/nd-core.h+2−2
@@ -54,12 +54,12 @@ struct nvdimm { · 53 unmodified lines
5454 };
5555
5656 static inline enum nvdimm_security_state nvdimm_security_state(
57− struct nvdimm *nvdimm, bool master)
57+ struct nvdimm *nvdimm, enum nvdimm_passphrase_type ptype)
5858 {
5959 if (!nvdimm->sec.ops)
6060 return -ENXIO;
6161
62− return nvdimm->sec.ops->state(nvdimm, master);
62+ return nvdimm->sec.ops->state(nvdimm, ptype);
6363 }
6464 int nvdimm_security_freeze(struct nvdimm *nvdimm);
6565 #if IS_ENABLED(CONFIG_NVDIMM_KEYS)
drivers/nvdimm/nd.h+1−0
@@ -250,6 +250,7 @@ long nvdimm_clear_poison(struct device *dev, phys_addr_t phys, · 249 unmodified lines
250250 void nvdimm_set_aliasing(struct device *dev);
251251 void nvdimm_set_locked(struct device *dev);
252252 void nvdimm_clear_locked(struct device *dev);
253+int nvdimm_security_setup_events(struct device *dev);
253254 #if IS_ENABLED(CONFIG_NVDIMM_KEYS)
254255 int nvdimm_security_unlock(struct device *dev);
255256 #else
drivers/nvme/host/multipath.c+1−2
@@ -545,8 +545,7 @@ int nvme_mpath_init(struct nvme_ctrl *ctrl, struct nvme_id_ctrl *id) · 544 unmodified lines
545545 timer_setup(&ctrl->anatt_timer, nvme_anatt_timeout, 0);
546546 ctrl->ana_log_size = sizeof(struct nvme_ana_rsp_hdr) +
547547 ctrl->nanagrpid * sizeof(struct nvme_ana_group_desc);
548− if (!(ctrl->anacap & (1 << 6)))
549− ctrl->ana_log_size += ctrl->max_namespaces * sizeof(__le32);
548+ ctrl->ana_log_size += ctrl->max_namespaces * sizeof(__le32);
550549
551550 if (ctrl->ana_log_size > ctrl->max_hw_sectors << SECTOR_SHIFT) {
552551 dev_err(ctrl->device,
drivers/nvme/host/pci.c+13−8
@@ -2041,14 +2041,18 @@ static int nvme_setup_host_mem(struct nvme_dev *dev) · 2040 unmodified lines
20412041 return ret;
20422042 }
20432043
2044+/* irq_queues covers admin queue */
20442045 static void nvme_calc_io_queues(struct nvme_dev *dev, unsigned int irq_queues)
20452046 {
20462047 unsigned int this_w_queues = write_queues;
20472048
2049+ WARN_ON(!irq_queues);
2050+
20482051 /*
2049− * Setup read/write queue split
2052+ * Setup read/write queue split, assign admin queue one independent
2053+ * irq vector if irq_queues is > 1.
20502054 */
2051− if (irq_queues == 1) {
2055+ if (irq_queues <= 2) {
20522056 dev->io_queues[HCTX_TYPE_DEFAULT] = 1;
20532057 dev->io_queues[HCTX_TYPE_READ] = 0;
20542058 return;
@@ -2056,21 +2060,21 @@ static void nvme_calc_io_queues(struct nvme_dev *dev, unsigned int irq_queues) · 1 unmodified line
20562060
20572061 /*
20582062 * If 'write_queues' is set, ensure it leaves room for at least
2059− * one read queue
2063+ * one read queue and one admin queue
20602064 */
20612065 if (this_w_queues >= irq_queues)
2062− this_w_queues = irq_queues - 1;
2066+ this_w_queues = irq_queues - 2;
20632067
20642068 /*
20652069 * If 'write_queues' is set to zero, reads and writes will share
20662070 * a queue set.
20672071 */
20682072 if (!this_w_queues) {
2069− dev->io_queues[HCTX_TYPE_DEFAULT] = irq_queues;
2073+ dev->io_queues[HCTX_TYPE_DEFAULT] = irq_queues - 1;
20702074 dev->io_queues[HCTX_TYPE_READ] = 0;
20712075 } else {
20722076 dev->io_queues[HCTX_TYPE_DEFAULT] = this_w_queues;
2073− dev->io_queues[HCTX_TYPE_READ] = irq_queues - this_w_queues;
2077+ dev->io_queues[HCTX_TYPE_READ] = irq_queues - this_w_queues - 1;
20742078 }
20752079 }
20762080
@@ -2095,7 +2099,7 @@ static int nvme_setup_irqs(struct nvme_dev *dev, unsigned int nr_io_queues) · 18 unmodified lines
20952099 this_p_queues = nr_io_queues - 1;
20962100 irq_queues = 1;
20972101 } else {
2098− irq_queues = nr_io_queues - this_p_queues;
2102+ irq_queues = nr_io_queues - this_p_queues + 1;
20992103 }
21002104 dev->io_queues[HCTX_TYPE_POLL] = this_p_queues;
21012105
@@ -2115,8 +2119,9 @@ static int nvme_setup_irqs(struct nvme_dev *dev, unsigned int nr_io_queues) · 13 unmodified lines
21152119 * If we got a failure and we're down to asking for just
21162120 * 1 + 1 queues, just ask for a single vector. We'll share
21172121 * that between the single IO queue and the admin queue.
2122+ * Otherwise, we assign one independent vector to admin queue.
21182123 */
2119− if (result >= 0 && irq_queues > 1)
2124+ if (irq_queues > 1)
21202125 irq_queues = irq_sets[0] + irq_sets[1] + 1;
21212126
21222127 result = pci_alloc_irq_vectors_affinity(pdev, irq_queues,
drivers/nvme/host/rdma.c+43−21
@@ -119,6 +119,7 @@ struct nvme_rdma_ctrl { · 118 unmodified lines
119119
120120 struct nvme_ctrl ctrl;
121121 bool use_inline_data;
122+ u32 io_queues[HCTX_MAX_TYPES];
122123 };
123124
124125 static inline struct nvme_rdma_ctrl *to_rdma_ctrl(struct nvme_ctrl *ctrl)
@@ -165,8 +166,8 @@ static inline int nvme_rdma_queue_idx(struct nvme_rdma_queue *queue) · 40 unmodified lines
165166 static bool nvme_rdma_poll_queue(struct nvme_rdma_queue *queue)
166167 {
167168 return nvme_rdma_queue_idx(queue) >
168− queue->ctrl->ctrl.opts->nr_io_queues +
169− queue->ctrl->ctrl.opts->nr_write_queues;
169+ queue->ctrl->io_queues[HCTX_TYPE_DEFAULT] +
170+ queue->ctrl->io_queues[HCTX_TYPE_READ];
170171 }
171172
172173 static inline size_t nvme_rdma_inline_data_size(struct nvme_rdma_queue *queue)
@@ -661,8 +662,21 @@ static int nvme_rdma_alloc_io_queues(struct nvme_rdma_ctrl *ctrl) · 488 unmodified lines
661662 nr_io_queues = min_t(unsigned int, nr_io_queues,
662663 ibdev->num_comp_vectors);
663664
664− nr_io_queues += min(opts->nr_write_queues, num_online_cpus());
665− nr_io_queues += min(opts->nr_poll_queues, num_online_cpus());
665+ if (opts->nr_write_queues) {
666+ ctrl->io_queues[HCTX_TYPE_DEFAULT] =
667+ min(opts->nr_write_queues, nr_io_queues);
668+ nr_io_queues += ctrl->io_queues[HCTX_TYPE_DEFAULT];
669+ } else {
670+ ctrl->io_queues[HCTX_TYPE_DEFAULT] = nr_io_queues;
671+ }
672+
673+ ctrl->io_queues[HCTX_TYPE_READ] = nr_io_queues;
674+
675+ if (opts->nr_poll_queues) {
676+ ctrl->io_queues[HCTX_TYPE_POLL] =
677+ min(opts->nr_poll_queues, num_online_cpus());
678+ nr_io_queues += ctrl->io_queues[HCTX_TYPE_POLL];
679+ }
666680
667681 ret = nvme_set_queue_count(&ctrl->ctrl, &nr_io_queues);
668682 if (ret)
@@ -1689,18 +1703,28 @@ static enum blk_eh_timer_return · 1020 unmodified lines
16891703 nvme_rdma_timeout(struct request *rq, bool reserved)
16901704 {
16911705 struct nvme_rdma_request *req = blk_mq_rq_to_pdu(rq);
1706+ struct nvme_rdma_queue *queue = req->queue;
1707+ struct nvme_rdma_ctrl *ctrl = queue->ctrl;
16921708
1693− dev_warn(req->queue->ctrl->ctrl.device,
1694− "I/O %d QID %d timeout, reset controller\n",
1695− rq->tag, nvme_rdma_queue_idx(req->queue));
1709+ dev_warn(ctrl->ctrl.device, "I/O %d QID %d timeout\n",
1710+ rq->tag, nvme_rdma_queue_idx(queue));
16961711
1697− /* queue error recovery */
1698− nvme_rdma_error_recovery(req->queue->ctrl);
1712+ if (ctrl->ctrl.state != NVME_CTRL_LIVE) {
1713+ /*
1714+ * Teardown immediately if controller times out while starting
1715+ * or we are already started error recovery. all outstanding
1716+ * requests are completed on shutdown, so we return BLK_EH_DONE.
1717+ */
1718+ flush_work(&ctrl->err_work);
1719+ nvme_rdma_teardown_io_queues(ctrl, false);
1720+ nvme_rdma_teardown_admin_queue(ctrl, false);
1721+ return BLK_EH_DONE;
1722+ }
16991723
1700− /* fail with DNR on cmd timeout */
1701− nvme_req(rq)->status = NVME_SC_ABORT_REQ | NVME_SC_DNR;
1724+ dev_warn(ctrl->ctrl.device, "starting error recovery\n");
1725+ nvme_rdma_error_recovery(ctrl);
17021726
1703− return BLK_EH_DONE;
1727+ return BLK_EH_RESET_TIMER;
17041728 }
17051729
17061730 static blk_status_t nvme_rdma_queue_rq(struct blk_mq_hw_ctx *hctx,
@@ -1779,17 +1803,15 @@ static int nvme_rdma_map_queues(struct blk_mq_tag_set *set) · 72 unmodified lines
17791803 struct nvme_rdma_ctrl *ctrl = set->driver_data;
17801804
17811805 set->map[HCTX_TYPE_DEFAULT].queue_offset = 0;
1782− set->map[HCTX_TYPE_READ].nr_queues = ctrl->ctrl.opts->nr_io_queues;
1806+ set->map[HCTX_TYPE_DEFAULT].nr_queues =
1807+ ctrl->io_queues[HCTX_TYPE_DEFAULT];
1808+ set->map[HCTX_TYPE_READ].nr_queues = ctrl->io_queues[HCTX_TYPE_READ];
17831809 if (ctrl->ctrl.opts->nr_write_queues) {
17841810 /* separate read/write queues */
1785− set->map[HCTX_TYPE_DEFAULT].nr_queues =
1786− ctrl->ctrl.opts->nr_write_queues;
17871811 set->map[HCTX_TYPE_READ].queue_offset =
1788− ctrl->ctrl.opts->nr_write_queues;
1812+ ctrl->io_queues[HCTX_TYPE_DEFAULT];
17891813 } else {
17901814 /* mixed read/write queues */
1791− set->map[HCTX_TYPE_DEFAULT].nr_queues =
1792− ctrl->ctrl.opts->nr_io_queues;
17931815 set->map[HCTX_TYPE_READ].queue_offset = 0;
17941816 }
17951817 blk_mq_rdma_map_queues(&set->map[HCTX_TYPE_DEFAULT],
@@ -1799,12 +1821,12 @@ static int nvme_rdma_map_queues(struct blk_mq_tag_set *set) · 3 unmodified lines
17991821
18001822 if (ctrl->ctrl.opts->nr_poll_queues) {
18011823 set->map[HCTX_TYPE_POLL].nr_queues =
1802− ctrl->ctrl.opts->nr_poll_queues;
1824+ ctrl->io_queues[HCTX_TYPE_POLL];
18031825 set->map[HCTX_TYPE_POLL].queue_offset =
1804− ctrl->ctrl.opts->nr_io_queues;
1826+ ctrl->io_queues[HCTX_TYPE_DEFAULT];
18051827 if (ctrl->ctrl.opts->nr_write_queues)
18061828 set->map[HCTX_TYPE_POLL].queue_offset +=
1807− ctrl->ctrl.opts->nr_write_queues;
1829+ ctrl->io_queues[HCTX_TYPE_READ];
18081830 blk_mq_map_queues(&set->map[HCTX_TYPE_POLL]);
18091831 }
18101832 return 0;
drivers/nvme/host/tcp.c+11−8
@@ -1948,20 +1948,23 @@ nvme_tcp_timeout(struct request *rq, bool reserved) · 1947 unmodified lines
19481948 struct nvme_tcp_ctrl *ctrl = req->queue->ctrl;
19491949 struct nvme_tcp_cmd_pdu *pdu = req->pdu;
19501950
1951− dev_dbg(ctrl->ctrl.device,
1951+ dev_warn(ctrl->ctrl.device,
19521952 "queue %d: timeout request %#x type %d\n",
1953− nvme_tcp_queue_id(req->queue), rq->tag,
1954− pdu->hdr.type);
1953+ nvme_tcp_queue_id(req->queue), rq->tag, pdu->hdr.type);
19551954
19561955 if (ctrl->ctrl.state != NVME_CTRL_LIVE) {
1957− union nvme_result res = {};
1958−
1959− nvme_req(rq)->flags |= NVME_REQ_CANCELLED;
1960− nvme_end_request(rq, cpu_to_le16(NVME_SC_ABORT_REQ), res);
1956+ /*
1957+ * Teardown immediately if controller times out while starting
1958+ * or we are already started error recovery. all outstanding
1959+ * requests are completed on shutdown, so we return BLK_EH_DONE.
1960+ */
1961+ flush_work(&ctrl->err_work);
1962+ nvme_tcp_teardown_io_queues(&ctrl->ctrl, false);
1963+ nvme_tcp_teardown_admin_queue(&ctrl->ctrl, false);
19611964 return BLK_EH_DONE;
19621965 }
19631966
1964− /* queue error recovery */
1967+ dev_warn(ctrl->ctrl.device, "starting error recovery\n");
19651968 nvme_tcp_error_recovery(&ctrl->ctrl);
19661969
19671970 return BLK_EH_RESET_TIMER;
drivers/nvme/target/rdma.c+14−1
@@ -139,6 +139,10 @@ static void nvmet_rdma_recv_done(struct ib_cq *cq, struct ib_wc *wc); · 138 unmodified lines
139139 static void nvmet_rdma_read_data_done(struct ib_cq *cq, struct ib_wc *wc);
140140 static void nvmet_rdma_qp_event(struct ib_event *event, void *priv);
141141 static void nvmet_rdma_queue_disconnect(struct nvmet_rdma_queue *queue);
142+static void nvmet_rdma_free_rsp(struct nvmet_rdma_device *ndev,
143+ struct nvmet_rdma_rsp *r);
144+static int nvmet_rdma_alloc_rsp(struct nvmet_rdma_device *ndev,
145+ struct nvmet_rdma_rsp *r);
142146
143147 static const struct nvmet_fabrics_ops nvmet_rdma_ops;
144148
@@ -182,9 +186,17 @@ nvmet_rdma_get_rsp(struct nvmet_rdma_queue *queue) · 37 unmodified lines
182186 spin_unlock_irqrestore(&queue->rsps_lock, flags);
183187
184188 if (unlikely(!rsp)) {
185− rsp = kmalloc(sizeof(*rsp), GFP_KERNEL);
189+ int ret;
190+
191+ rsp = kzalloc(sizeof(*rsp), GFP_KERNEL);
186192 if (unlikely(!rsp))
187193 return NULL;
194+ ret = nvmet_rdma_alloc_rsp(queue->dev, rsp);
195+ if (unlikely(ret)) {
196+ kfree(rsp);
197+ return NULL;
198+ }
199+
188200 rsp->allocated = true;
189201 }
190202
@@ -197,6 +209,7 @@ nvmet_rdma_put_rsp(struct nvmet_rdma_rsp *rsp) · 6 unmodified lines
197209 unsigned long flags;
198210
199211 if (unlikely(rsp->allocated)) {
212+ nvmet_rdma_free_rsp(rsp->queue->dev, rsp);
200213 kfree(rsp);
201214 return;
202215 }
drivers/nvme/target/tcp.c+1−1
@@ -1089,7 +1089,7 @@ out: · 1088 unmodified lines
10891089
10901090 static int nvmet_tcp_try_recv_one(struct nvmet_tcp_queue *queue)
10911091 {
1092− int result;
1092+ int result = 0;
10931093
10941094 if (unlikely(queue->rcv_state == NVMET_TCP_RECV_ERR))
10951095 return 0;
drivers/of/dynamic.c+0−3
@@ -207,11 +207,8 @@ static void __of_attach_node(struct device_node *np) · 206 unmodified lines
207207
208208 if (!of_node_check_flag(np, OF_OVERLAY)) {
209209 np->name = __of_get_property(np, "name", NULL);
210− np->type = __of_get_property(np, "device_type", NULL);
211210 if (!np->name)
212211 np->name = "<NULL>";
213− if (!np->type)
214− np->type = "<NULL>";
215212
216213 phandle = __of_get_property(np, "phandle", &sz);
217214 if (!phandle)
drivers/of/fdt.c+0−4
@@ -314,12 +314,8 @@ static bool populate_node(const void *blob, · 313 unmodified lines
314314 populate_properties(blob, offset, mem, np, pathp, dryrun);
315315 if (!dryrun) {
316316 np->name = of_get_property(np, "name", NULL);
317− np->type = of_get_property(np, "device_type", NULL);
318−
319317 if (!np->name)
320318 np->name = "<NULL>";
321− if (!np->type)
322− np->type = "<NULL>";
323319 }
324320
325321 *pnp = np;
drivers/of/overlay.c+0−3
@@ -423,12 +423,9 @@ static int add_changeset_node(struct overlay_changeset *ovcs, · 422 unmodified lines
423423
424424 tchild->parent = target->np;
425425 tchild->name = __of_get_property(node, "name", NULL);
426− tchild->type = __of_get_property(node, "device_type", NULL);
427426
428427 if (!tchild->name)
429428 tchild->name = "<NULL>";
430− if (!tchild->type)
431− tchild->type = "<NULL>";
432429
433430 /* ignore obsolete "linux,phandle" */
434431 phandle = __of_get_property(node, "phandle", &size);
drivers/of/pdt.c+0−1
@@ -155,7 +155,6 @@ static struct device_node * __init of_pdt_create_node(phandle node, · 154 unmodified lines
155155 dp->parent = parent;
156156
157157 dp->name = of_pdt_get_one_property(node, "name");
158− dp->type = of_pdt_get_one_property(node, "device_type");
159158 dp->phandle = node;
160159
161160 dp->properties = of_pdt_build_prop_list(node);
drivers/of/property.c+1−0
@@ -806,6 +806,7 @@ struct device_node *of_graph_get_remote_node(const struct device_node *node, · 805 unmodified lines
806806
807807 if (!of_device_is_available(remote)) {
808808 pr_debug("not available for remote node\n");
809+ of_node_put(remote);
809810 return NULL;
810811 }
811812
drivers/pci/Kconfig+8−14
@@ -21,13 +21,14 @@ menuconfig PCI · 20 unmodified lines
2121 support for PCI-X and the foundations for PCI Express support.
2222 Say 'Y' here unless you know what you are doing.
2323
24+if PCI
25+
2426 config PCI_DOMAINS
2527 bool
2628 depends on PCI
2729
2830 config PCI_DOMAINS_GENERIC
2931 bool
30− depends on PCI
3132 select PCI_DOMAINS
3233
3334 config PCI_SYSCALL
@@ -37,7 +38,6 @@ source "drivers/pci/pcie/Kconfig" · 3 unmodified lines
3738
3839 config PCI_MSI
3940 bool "Message Signaled Interrupts (MSI and MSI-X)"
40− depends on PCI
4141 select GENERIC_MSI_IRQ
4242 help
4343 This allows device drivers to enable MSI (Message Signaled
@@ -59,7 +59,6 @@ config PCI_MSI_IRQ_DOMAIN · 15 unmodified lines
5959 config PCI_QUIRKS
6060 default y
6161 bool "Enable PCI quirk workarounds" if EXPERT
62− depends on PCI
6362 help
6463 This enables workarounds for various PCI chipset bugs/quirks.
6564 Disable this only if your target machine is unaffected by PCI
@@ -67,7 +66,7 @@ config PCI_QUIRKS · 1 unmodified line
6766
6867 config PCI_DEBUG
6968 bool "PCI Debugging"
70− depends on PCI && DEBUG_KERNEL
69+ depends on DEBUG_KERNEL
7170 help
7271 Say Y here if you want the PCI core to produce a bunch of debug
7372 messages to the system log. Select this if you are having a
@@ -77,7 +76,6 @@ config PCI_DEBUG · 3 unmodified lines
7776
7877 config PCI_REALLOC_ENABLE_AUTO
7978 bool "Enable PCI resource re-allocation detection"
80− depends on PCI
8179 depends on PCI_IOV
8280 help
8381 Say Y here if you want the PCI core to detect if PCI resource
@@ -90,7 +88,6 @@ config PCI_REALLOC_ENABLE_AUTO · 6 unmodified lines
9088
9189 config PCI_STUB
9290 tristate "PCI Stub driver"
93− depends on PCI
9491 help
9592 Say Y or M here if you want be able to reserve a PCI device
9693 when it is going to be assigned to a guest operating system.
@@ -99,7 +96,6 @@ config PCI_STUB · 2 unmodified lines
9996
10097 config PCI_PF_STUB
10198 tristate "PCI PF Stub driver"
102− depends on PCI
10399 depends on PCI_IOV
104100 help
105101 Say Y or M here if you want to enable support for devices that
@@ -111,7 +107,7 @@ config PCI_PF_STUB · 5 unmodified lines
111107
112108 config XEN_PCIDEV_FRONTEND
113109 tristate "Xen PCI Frontend"
114− depends on PCI && X86 && XEN
110+ depends on X86 && XEN
115111 select PCI_XEN
116112 select XEN_XENBUS_FRONTEND
117113 default y
@@ -133,7 +129,6 @@ config PCI_BRIDGE_EMUL · 15 unmodified lines
133129
134130 config PCI_IOV
135131 bool "PCI IOV support"
136− depends on PCI
137132 select PCI_ATS
138133 help
139134 I/O Virtualization is a PCI feature supported by some devices
@@ -144,7 +139,6 @@ config PCI_IOV · 4 unmodified lines
144139
145140 config PCI_PRI
146141 bool "PCI PRI support"
147− depends on PCI
148142 select PCI_ATS
149143 help
150144 PRI is the PCI Page Request Interface. It allows PCI devices that are
@@ -154,7 +148,6 @@ config PCI_PRI · 3 unmodified lines
154148
155149 config PCI_PASID
156150 bool "PCI PASID support"
157− depends on PCI
158151 select PCI_ATS
159152 help
160153 Process Address Space Identifiers (PASIDs) can be used by PCI devices
@@ -167,7 +160,7 @@ config PCI_PASID · 6 unmodified lines
167160
168161 config PCI_P2PDMA
169162 bool "PCI peer-to-peer transfer support"
170− depends on PCI && ZONE_DEVICE
163+ depends on ZONE_DEVICE
171164 select GENERIC_ALLOCATOR
172165 help
173166 Enableѕ drivers to do PCI peer-to-peer transactions to and from
@@ -184,12 +177,11 @@ config PCI_P2PDMA · 10 unmodified lines
184177
185178 config PCI_LABEL
186179 def_bool y if (DMI || ACPI)
187− depends on PCI
188180 select NLS
189181
190182 config PCI_HYPERV
191183 tristate "Hyper-V PCI Frontend"
192− depends on PCI && X86 && HYPERV && PCI_MSI && PCI_MSI_IRQ_DOMAIN && X86_64
184+ depends on X86 && HYPERV && PCI_MSI && PCI_MSI_IRQ_DOMAIN && X86_64
193185 help
194186 The PCI device frontend driver allows the kernel to import arbitrary
195187 PCI devices from a PCI backend to support PCI driver domains.
@@ -198,3 +190,5 @@ source "drivers/pci/hotplug/Kconfig" · 2 unmodified lines
198190 source "drivers/pci/controller/Kconfig"
199191 source "drivers/pci/endpoint/Kconfig"
200192 source "drivers/pci/switch/Kconfig"
193+
194+endif
drivers/pci/controller/dwc/pci-imx6.c+7−4
@@ -310,6 +310,9 @@ static int imx6_pcie_attach_pd(struct device *dev) · 309 unmodified lines
310310 imx6_pcie->pd_pcie = dev_pm_domain_attach_by_name(dev, "pcie");
311311 if (IS_ERR(imx6_pcie->pd_pcie))
312312 return PTR_ERR(imx6_pcie->pd_pcie);
313+ /* Do nothing when power domain missing */
314+ if (!imx6_pcie->pd_pcie)
315+ return 0;
313316 link = device_link_add(dev, imx6_pcie->pd_pcie,
314317 DL_FLAG_STATELESS |
315318 DL_FLAG_PM_RUNTIME |
@@ -323,13 +326,13 @@ static int imx6_pcie_attach_pd(struct device *dev) · 7 unmodified lines
323326 if (IS_ERR(imx6_pcie->pd_pcie_phy))
324327 return PTR_ERR(imx6_pcie->pd_pcie_phy);
325328
326− device_link_add(dev, imx6_pcie->pd_pcie_phy,
329+ link = device_link_add(dev, imx6_pcie->pd_pcie_phy,
327330 DL_FLAG_STATELESS |
328331 DL_FLAG_PM_RUNTIME |
329332 DL_FLAG_RPM_ACTIVE);
330− if (IS_ERR(link)) {
331− dev_err(dev, "Failed to add device_link to pcie_phy pd: %ld\n", PTR_ERR(link));
332− return PTR_ERR(link);
333+ if (!link) {
334+ dev_err(dev, "Failed to add device_link to pcie_phy pd.\n");
335+ return -EINVAL;
333336 }
334337
335338 return 0;
drivers/pci/controller/dwc/pcie-armada8k.c+0−16
@@ -22,7 +22,6 @@ · 21 unmodified lines
2222 #include <linux/resource.h>
2323 #include <linux/of_pci.h>
2424 #include <linux/of_irq.h>
25−#include <linux/gpio/consumer.h>
2625
2726 #include "pcie-designware.h"
2827
@@ -30,7 +29,6 @@ struct armada8k_pcie { · 1 unmodified line
3029 struct dw_pcie *pci;
3130 struct clk *clk;
3231 struct clk *clk_reg;
33− struct gpio_desc *reset_gpio;
3432 };
3533
3634 #define PCIE_VENDOR_REGS_OFFSET 0x8000
@@ -139,12 +137,6 @@ static int armada8k_pcie_host_init(struct pcie_port *pp) · 102 unmodified lines
139137 struct dw_pcie *pci = to_dw_pcie_from_pp(pp);
140138 struct armada8k_pcie *pcie = to_armada8k_pcie(pci);
141139
142− if (pcie->reset_gpio) {
143− /* assert and then deassert the reset signal */
144− gpiod_set_value_cansleep(pcie->reset_gpio, 1);
145− msleep(100);
146− gpiod_set_value_cansleep(pcie->reset_gpio, 0);
147− }
148140 dw_pcie_setup_rc(pp);
149141 armada8k_pcie_establish_link(pcie);
150142
@@ -257,14 +249,6 @@ static int armada8k_pcie_probe(struct platform_device *pdev) · 106 unmodified lines
257249 goto fail_clkreg;
258250 }
259251
260− /* Get reset gpio signal and hold asserted (logically high) */
261− pcie->reset_gpio = devm_gpiod_get_optional(dev, "reset",
262− GPIOD_OUT_HIGH);
263− if (IS_ERR(pcie->reset_gpio)) {
264− ret = PTR_ERR(pcie->reset_gpio);
265− goto fail_clkreg;
266− }
267−
268252 platform_set_drvdata(pdev, pcie);
269253
270254 ret = armada8k_add_pcie_port(pcie, pdev);
drivers/pci/msi.c+13−9
@@ -1168,7 +1168,8 @@ int pci_alloc_irq_vectors_affinity(struct pci_dev *dev, unsigned int min_vecs, · 1167 unmodified lines
11681168 const struct irq_affinity *affd)
11691169 {
11701170 static const struct irq_affinity msi_default_affd;
1171− int vecs = -ENOSPC;
1171+ int msix_vecs = -ENOSPC;
1172+ int msi_vecs = -ENOSPC;
11721173
11731174 if (flags & PCI_IRQ_AFFINITY) {
11741175 if (!affd)
@@ -1179,16 +1180,17 @@ int pci_alloc_irq_vectors_affinity(struct pci_dev *dev, unsigned int min_vecs, · 4 unmodified lines
11791180 }
11801181
11811182 if (flags & PCI_IRQ_MSIX) {
1182− vecs = __pci_enable_msix_range(dev, NULL, min_vecs, max_vecs,
1183− affd);
1184− if (vecs > 0)
1185− return vecs;
1183+ msix_vecs = __pci_enable_msix_range(dev, NULL, min_vecs,
1184+ max_vecs, affd);
1185+ if (msix_vecs > 0)
1186+ return msix_vecs;
11861187 }
11871188
11881189 if (flags & PCI_IRQ_MSI) {
1189− vecs = __pci_enable_msi_range(dev, min_vecs, max_vecs, affd);
1190− if (vecs > 0)
1191− return vecs;
1190+ msi_vecs = __pci_enable_msi_range(dev, min_vecs, max_vecs,
1191+ affd);
1192+ if (msi_vecs > 0)
1193+ return msi_vecs;
11921194 }
11931195
11941196 /* use legacy irq if allowed */
@@ -1199,7 +1201,9 @@ int pci_alloc_irq_vectors_affinity(struct pci_dev *dev, unsigned int min_vecs, · 4 unmodified lines
11991201 }
12001202 }
12011203
1202− return vecs;
1204+ if (msix_vecs == -ENOSPC)
1205+ return -ENOSPC;
1206+ return msi_vecs;
12031207 }
12041208 EXPORT_SYMBOL(pci_alloc_irq_vectors_affinity);
12051209
drivers/pci/pci.c+2−1
@@ -6195,7 +6195,8 @@ static int __init pci_setup(char *str) · 6194 unmodified lines
61956195 } else if (!strncmp(str, "pcie_scan_all", 13)) {
61966196 pci_add_flags(PCI_SCAN_ALL_PCIE_DEVS);
61976197 } else if (!strncmp(str, "disable_acs_redir=", 18)) {
6198− disable_acs_redir_param = str + 18;
6198+ disable_acs_redir_param =
6199+ kstrdup(str + 18, GFP_KERNEL);
61996200 } else {
62006201 printk(KERN_ERR "PCI: Unknown option `%s'\n",
62016202 str);
drivers/phy/qualcomm/phy-ath79-usb.c+2−2
@@ -31,7 +31,7 @@ static int ath79_usb_phy_power_on(struct phy *phy) · 30 unmodified lines
3131
3232 err = reset_control_deassert(priv->reset);
3333 if (err && priv->no_suspend_override)
34− reset_control_assert(priv->no_suspend_override);
34+ reset_control_deassert(priv->no_suspend_override);
3535
3636 return err;
3737 }
@@ -69,7 +69,7 @@ static int ath79_usb_phy_probe(struct platform_device *pdev) · 31 unmodified lines
6969 if (!priv)
7070 return -ENOMEM;
7171
72− priv->reset = devm_reset_control_get(&pdev->dev, "usb-phy");
72+ priv->reset = devm_reset_control_get(&pdev->dev, "phy");
7373 if (IS_ERR(priv->reset))
7474 return PTR_ERR(priv->reset);
7575
drivers/phy/ti/Kconfig+1−0
@@ -82,6 +82,7 @@ config PHY_TI_GMII_SEL · 81 unmodified lines
8282 default y if TI_CPSW=y
8383 depends on TI_CPSW || COMPILE_TEST
8484 select GENERIC_PHY
85+ select REGMAP
8586 default m
8687 help
8788 This driver supports configuring of the TI CPSW Port mode depending on
drivers/phy/ti/phy-gmii-sel.c+2−2
@@ -204,11 +204,11 @@ static struct phy *phy_gmii_sel_of_xlate(struct device *dev, · 203 unmodified lines
204204
205205 if (args->args_count < 1)
206206 return ERR_PTR(-EINVAL);
207+ if (!priv || !priv->if_phys)
208+ return ERR_PTR(-ENODEV);
207209 if (priv->soc_data->features & BIT(PHY_GMII_SEL_RMII_IO_CLK_EN) &&
208210 args->args_count < 2)
209211 return ERR_PTR(-EINVAL);
210− if (!priv || !priv->if_phys)
211− return ERR_PTR(-ENODEV);
212212 if (phy_id > priv->soc_data->num_ports)
213213 return ERR_PTR(-EINVAL);
214214 if (phy_id != priv->if_phys[phy_id - 1].id)
drivers/pinctrl/intel/pinctrl-cherryview.c+4−4
@@ -1513,7 +1513,7 @@ static const struct dmi_system_id chv_no_valid_mask[] = { · 1512 unmodified lines
15131513 .matches = {
15141514 DMI_MATCH(DMI_SYS_VENDOR, "GOOGLE"),
15151515 DMI_MATCH(DMI_PRODUCT_FAMILY, "Intel_Strago"),
1516− DMI_MATCH(DMI_BOARD_VERSION, "1.0"),
1516+ DMI_MATCH(DMI_PRODUCT_VERSION, "1.0"),
15171517 },
15181518 },
15191519 {
@@ -1521,7 +1521,7 @@ static const struct dmi_system_id chv_no_valid_mask[] = { · 1 unmodified line
15211521 .matches = {
15221522 DMI_MATCH(DMI_SYS_VENDOR, "HP"),
15231523 DMI_MATCH(DMI_PRODUCT_NAME, "Setzer"),
1524− DMI_MATCH(DMI_BOARD_VERSION, "1.0"),
1524+ DMI_MATCH(DMI_PRODUCT_VERSION, "1.0"),
15251525 },
15261526 },
15271527 {
@@ -1529,7 +1529,7 @@ static const struct dmi_system_id chv_no_valid_mask[] = { · 1 unmodified line
15291529 .matches = {
15301530 DMI_MATCH(DMI_SYS_VENDOR, "GOOGLE"),
15311531 DMI_MATCH(DMI_PRODUCT_NAME, "Cyan"),
1532− DMI_MATCH(DMI_BOARD_VERSION, "1.0"),
1532+ DMI_MATCH(DMI_PRODUCT_VERSION, "1.0"),
15331533 },
15341534 },
15351535 {
@@ -1537,7 +1537,7 @@ static const struct dmi_system_id chv_no_valid_mask[] = { · 1 unmodified line
15371537 .matches = {
15381538 DMI_MATCH(DMI_SYS_VENDOR, "GOOGLE"),
15391539 DMI_MATCH(DMI_PRODUCT_NAME, "Celes"),
1540− DMI_MATCH(DMI_BOARD_VERSION, "1.0"),
1540+ DMI_MATCH(DMI_PRODUCT_VERSION, "1.0"),
15411541 },
15421542 },
15431543 {}
drivers/pinctrl/mediatek/Kconfig+3−0
@@ -45,12 +45,14 @@ config PINCTRL_MT2701 · 44 unmodified lines
4545 config PINCTRL_MT7623
4646 bool "Mediatek MT7623 pin control with generic binding"
4747 depends on MACH_MT7623 || COMPILE_TEST
48+ depends on OF
4849 default MACH_MT7623
4950 select PINCTRL_MTK_MOORE
5051
5152 config PINCTRL_MT7629
5253 bool "Mediatek MT7629 pin control"
5354 depends on MACH_MT7629 || COMPILE_TEST
55+ depends on OF
5456 default MACH_MT7629
5557 select PINCTRL_MTK_MOORE
5658
@@ -92,6 +94,7 @@ config PINCTRL_MT6797 · 35 unmodified lines
9294
9395 config PINCTRL_MT7622
9496 bool "MediaTek MT7622 pin control"
97+ depends on OF
9598 depends on ARM64 || COMPILE_TEST
9699 default ARM64 && ARCH_MEDIATEK
97100 select PINCTRL_MTK_MOORE
drivers/pinctrl/pinctrl-mcp23s08.c+6−1
@@ -832,8 +832,13 @@ static int mcp23s08_probe_one(struct mcp23s08 *mcp, struct device *dev, · 831 unmodified lines
832832 break;
833833
834834 case MCP_TYPE_S18:
835+ one_regmap_config =
836+ devm_kmemdup(dev, &mcp23x17_regmap,
837+ sizeof(struct regmap_config), GFP_KERNEL);
838+ if (!one_regmap_config)
839+ return -ENOMEM;
835840 mcp->regmap = devm_regmap_init(dev, &mcp23sxx_spi_regmap, mcp,
836− &mcp23x17_regmap);
841+ one_regmap_config);
837842 mcp->reg_shift = 1;
838843 mcp->chip.ngpio = 16;
839844 mcp->chip.label = "mcp23s18";
drivers/pinctrl/sunxi/pinctrl-sun50i-h6.c+1−1
@@ -588,7 +588,7 @@ static const unsigned int h6_irq_bank_map[] = { 1, 5, 6, 7 }; · 587 unmodified lines
588588 static const struct sunxi_pinctrl_desc h6_pinctrl_data = {
589589 .pins = h6_pins,
590590 .npins = ARRAY_SIZE(h6_pins),
591− .irq_banks = 3,
591+ .irq_banks = 4,
592592 .irq_bank_map = h6_irq_bank_map,
593593 .irq_read_needs_mux = true,
594594 };
drivers/pinctrl/sunxi/pinctrl-sunxi.c+22−22
@@ -698,26 +698,24 @@ static int sunxi_pmx_request(struct pinctrl_dev *pctldev, unsigned offset) · 697 unmodified lines
698698 {
699699 struct sunxi_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
700700 unsigned short bank = offset / PINS_PER_BANK;
701− struct sunxi_pinctrl_regulator *s_reg = &pctl->regulators[bank];
702− struct regulator *reg;
701+ unsigned short bank_offset = bank - pctl->desc->pin_base /
702+ PINS_PER_BANK;
703+ struct sunxi_pinctrl_regulator *s_reg = &pctl->regulators[bank_offset];
704+ struct regulator *reg = s_reg->regulator;
705+ char supply[16];
703706 int ret;
704707
705− reg = s_reg->regulator;
706− if (!reg) {
707− char supply[16];
708−
709− snprintf(supply, sizeof(supply), "vcc-p%c", 'a' + bank);
710− reg = regulator_get(pctl->dev, supply);
711− if (IS_ERR(reg)) {
712− dev_err(pctl->dev, "Couldn't get bank P%c regulator\n",
713− 'A' + bank);
714− return PTR_ERR(reg);
715− }
716−
717− s_reg->regulator = reg;
718− refcount_set(&s_reg->refcount, 1);
719− } else {
708+ if (reg) {
720709 refcount_inc(&s_reg->refcount);
710+ return 0;
711+ }
712+
713+ snprintf(supply, sizeof(supply), "vcc-p%c", 'a' + bank);
714+ reg = regulator_get(pctl->dev, supply);
715+ if (IS_ERR(reg)) {
716+ dev_err(pctl->dev, "Couldn't get bank P%c regulator\n",
717+ 'A' + bank);
718+ return PTR_ERR(reg);
721719 }
722720
723721 ret = regulator_enable(reg);
@@ -727,13 +725,13 @@ static int sunxi_pmx_request(struct pinctrl_dev *pctldev, unsigned offset) · 3 unmodified lines
727725 goto out;
728726 }
729727
728+ s_reg->regulator = reg;
729+ refcount_set(&s_reg->refcount, 1);
730+
730731 return 0;
731732
732733 out:
733− if (refcount_dec_and_test(&s_reg->refcount)) {
734− regulator_put(s_reg->regulator);
735− s_reg->regulator = NULL;
736− }
734+ regulator_put(s_reg->regulator);
737735
738736 return ret;
739737 }
@@ -742,7 +740,9 @@ static int sunxi_pmx_free(struct pinctrl_dev *pctldev, unsigned offset) · 2 unmodified lines
742740 {
743741 struct sunxi_pinctrl *pctl = pinctrl_dev_get_drvdata(pctldev);
744742 unsigned short bank = offset / PINS_PER_BANK;
745− struct sunxi_pinctrl_regulator *s_reg = &pctl->regulators[bank];
743+ unsigned short bank_offset = bank - pctl->desc->pin_base /
744+ PINS_PER_BANK;
745+ struct sunxi_pinctrl_regulator *s_reg = &pctl->regulators[bank_offset];
746746
747747 if (!refcount_dec_and_test(&s_reg->refcount))
748748 return 0;
drivers/pinctrl/sunxi/pinctrl-sunxi.h+1−1
@@ -136,7 +136,7 @@ struct sunxi_pinctrl { · 135 unmodified lines
136136 struct gpio_chip *chip;
137137 const struct sunxi_pinctrl_desc *desc;
138138 struct device *dev;
139− struct sunxi_pinctrl_regulator regulators[12];
139+ struct sunxi_pinctrl_regulator regulators[9];
140140 struct irq_domain *domain;
141141 struct sunxi_pinctrl_function *functions;
142142 unsigned nfunctions;
drivers/platform/x86/Kconfig+5−3
@@ -905,6 +905,7 @@ config TOSHIBA_WMI · 904 unmodified lines
905905 config ACPI_CMPC
906906 tristate "CMPC Laptop Extras"
907907 depends on ACPI && INPUT
908+ depends on BACKLIGHT_LCD_SUPPORT
908909 depends on RFKILL || RFKILL=n
909910 select BACKLIGHT_CLASS_DEVICE
910911 help
@@ -1009,7 +1010,7 @@ config INTEL_MFLD_THERMAL · 98 unmodified lines
10091010
10101011 config INTEL_IPS
10111012 tristate "Intel Intelligent Power Sharing"
1012− depends on ACPI
1013+ depends on ACPI && PCI
10131014 ---help---
10141015 Intel Calpella platforms support dynamic power sharing between the
10151016 CPU and GPU, maximizing performance in a given TDP. This driver,
@@ -1128,6 +1129,7 @@ config INTEL_OAKTRAIL · 112 unmodified lines
11281129 config SAMSUNG_Q10
11291130 tristate "Samsung Q10 Extras"
11301131 depends on ACPI
1132+ depends on BACKLIGHT_LCD_SUPPORT
11311133 select BACKLIGHT_CLASS_DEVICE
11321134 ---help---
11331135 This driver provides support for backlight control on Samsung Q10
@@ -1135,7 +1137,7 @@ config SAMSUNG_Q10 · 1 unmodified line
11351137
11361138 config APPLE_GMUX
11371139 tristate "Apple Gmux Driver"
1138− depends on ACPI
1140+ depends on ACPI && PCI
11391141 depends on PNP
11401142 depends on BACKLIGHT_CLASS_DEVICE
11411143 depends on BACKLIGHT_APPLE=n || BACKLIGHT_APPLE
@@ -1174,7 +1176,7 @@ config INTEL_SMARTCONNECT · 32 unmodified lines
11741176
11751177 config INTEL_PMC_IPC
11761178 tristate "Intel PMC IPC Driver"
1177− depends on ACPI
1179+ depends on ACPI && PCI
11781180 ---help---
11791181 This driver provides support for PMC control on some Intel platforms.
11801182 The PMC is an ARC processor which defines IPC commands for communication
drivers/ptp/ptp_chardev.c+2−1
@@ -224,7 +224,8 @@ long ptp_ioctl(struct posix_clock *pc, unsigned int cmd, unsigned long arg) · 223 unmodified lines
224224 extoff = NULL;
225225 break;
226226 }
227− if (extoff->n_samples > PTP_MAX_SAMPLES) {
227+ if (extoff->n_samples > PTP_MAX_SAMPLES
228+ || extoff->rsv[0] || extoff->rsv[1] || extoff->rsv[2]) {
228229 err = -EINVAL;
229230 break;
230231 }
drivers/remoteproc/remoteproc_virtio.c+7−2
@@ -153,10 +153,15 @@ static int rproc_virtio_find_vqs(struct virtio_device *vdev, unsigned int nvqs, · 152 unmodified lines
153153 const bool * ctx,
154154 struct irq_affinity *desc)
155155 {
156− int i, ret;
156+ int i, ret, queue_idx = 0;
157157
158158 for (i = 0; i < nvqs; ++i) {
159− vqs[i] = rp_find_vq(vdev, i, callbacks[i], names[i],
159+ if (!names[i]) {
160+ vqs[i] = NULL;
161+ continue;
162+ }
163+
164+ vqs[i] = rp_find_vq(vdev, queue_idx++, callbacks[i], names[i],
160165 ctx ? ctx[i] : false);
161166 if (IS_ERR(vqs[i])) {
162167 ret = PTR_ERR(vqs[i]);
drivers/s390/char/sclp_config.c+2−0
@@ -60,7 +60,9 @@ static void sclp_cpu_capability_notify(struct work_struct *work) · 59 unmodified lines
6060
6161 static void __ref sclp_cpu_change_notify(struct work_struct *work)
6262 {
63+ lock_device_hotplug();
6364 smp_rescan_cpus();
65+ unlock_device_hotplug();
6466 }
6567
6668 static void sclp_conf_receiver_fn(struct evbuf_header *evbuf)
drivers/s390/scsi/zfcp_aux.c+0−1
@@ -403,7 +403,6 @@ struct zfcp_adapter *zfcp_adapter_enqueue(struct ccw_device *ccw_device) · 402 unmodified lines
403403 goto failed;
404404
405405 /* report size limit per scatter-gather segment */
406− adapter->dma_parms.max_segment_size = ZFCP_QDIO_SBALE_LEN;
407406 adapter->ccw_device->dev.dma_parms = &adapter->dma_parms;
408407
409408 adapter->stat_read_buf_num = FSF_STATUS_READS_RECOM;
drivers/s390/scsi/zfcp_scsi.c+2−0
@@ -428,6 +428,8 @@ static struct scsi_host_template zfcp_scsi_host_template = { · 427 unmodified lines
428428 .max_sectors = (((QDIO_MAX_ELEMENTS_PER_BUFFER - 1)
429429 * ZFCP_QDIO_MAX_SBALS_PER_REQ) - 2) * 8,
430430 /* GCD, adjusted later */
431+ /* report size limit per scatter-gather segment */
432+ .max_segment_size = ZFCP_QDIO_SBALE_LEN,
431433 .dma_boundary = ZFCP_QDIO_SBALE_LEN - 1,
432434 .shost_attrs = zfcp_sysfs_shost_attrs,
433435 .sdev_attrs = zfcp_sysfs_sdev_attrs,
drivers/s390/virtio/virtio_ccw.c+9−3
@@ -635,7 +635,7 @@ static int virtio_ccw_find_vqs(struct virtio_device *vdev, unsigned nvqs, · 634 unmodified lines
635635 {
636636 struct virtio_ccw_device *vcdev = to_vc_device(vdev);
637637 unsigned long *indicatorp = NULL;
638− int ret, i;
638+ int ret, i, queue_idx = 0;
639639 struct ccw1 *ccw;
640640
641641 ccw = kzalloc(sizeof(*ccw), GFP_DMA | GFP_KERNEL);
@@ -643,8 +643,14 @@ static int virtio_ccw_find_vqs(struct virtio_device *vdev, unsigned nvqs, · 1 unmodified line
643643 return -ENOMEM;
644644
645645 for (i = 0; i < nvqs; ++i) {
646− vqs[i] = virtio_ccw_setup_vq(vdev, i, callbacks[i], names[i],
647− ctx ? ctx[i] : false, ccw);
646+ if (!names[i]) {
647+ vqs[i] = NULL;
648+ continue;
649+ }
650+
651+ vqs[i] = virtio_ccw_setup_vq(vdev, queue_idx++, callbacks[i],
652+ names[i], ctx ? ctx[i] : false,
653+ ccw);
648654 if (IS_ERR(vqs[i])) {
649655 ret = PTR_ERR(vqs[i]);
650656 vqs[i] = NULL;
drivers/scsi/53c700.c+1−1
@@ -295,7 +295,7 @@ NCR_700_detect(struct scsi_host_template *tpnt, · 294 unmodified lines
295295 if(tpnt->sdev_attrs == NULL)
296296 tpnt->sdev_attrs = NCR_700_dev_attrs;
297297
298− memory = dma_alloc_attrs(hostdata->dev, TOTAL_MEM_SIZE, &pScript,
298+ memory = dma_alloc_attrs(dev, TOTAL_MEM_SIZE, &pScript,
299299 GFP_KERNEL, DMA_ATTR_NON_CONSISTENT);
300300 if(memory == NULL) {
301301 printk(KERN_ERR "53c700: Failed to allocate memory for driver, detaching\n");
drivers/scsi/aacraid/linit.c+4−5
@@ -1747,11 +1747,10 @@ static int aac_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) · 1746 unmodified lines
17471747 shost->max_sectors = (shost->sg_tablesize * 8) + 112;
17481748 }
17491749
1750− error = dma_set_max_seg_size(&pdev->dev,
1751− (aac->adapter_info.options & AAC_OPT_NEW_COMM) ?
1752− (shost->max_sectors << 9) : 65536);
1753− if (error)
1754− goto out_deinit;
1750+ if (aac->adapter_info.options & AAC_OPT_NEW_COMM)
1751+ shost->max_segment_size = shost->max_sectors << 9;
1752+ else
1753+ shost->max_segment_size = 65536;
17551754
17561755 /*
17571756 * Firmware printf works only with older firmware.
drivers/scsi/bnx2fc/bnx2fc_io.c+2−2
@@ -240,6 +240,7 @@ struct bnx2fc_cmd_mgr *bnx2fc_cmd_mgr_alloc(struct bnx2fc_hba *hba) · 239 unmodified lines
240240 return NULL;
241241 }
242242
243+ cmgr->hba = hba;
243244 cmgr->free_list = kcalloc(arr_sz, sizeof(*cmgr->free_list),
244245 GFP_KERNEL);
245246 if (!cmgr->free_list) {
@@ -256,7 +257,6 @@ struct bnx2fc_cmd_mgr *bnx2fc_cmd_mgr_alloc(struct bnx2fc_hba *hba) · 10 unmodified lines
256257 goto mem_err;
257258 }
258259
259− cmgr->hba = hba;
260260 cmgr->cmds = (struct bnx2fc_cmd **)(cmgr + 1);
261261
262262 for (i = 0; i < arr_sz; i++) {
@@ -295,7 +295,7 @@ struct bnx2fc_cmd_mgr *bnx2fc_cmd_mgr_alloc(struct bnx2fc_hba *hba) · 32 unmodified lines
295295
296296 /* Allocate pool of io_bdts - one for each bnx2fc_cmd */
297297 mem_size = num_ios * sizeof(struct io_bdt *);
298− cmgr->io_bdt_pool = kmalloc(mem_size, GFP_KERNEL);
298+ cmgr->io_bdt_pool = kzalloc(mem_size, GFP_KERNEL);
299299 if (!cmgr->io_bdt_pool) {
300300 printk(KERN_ERR PFX "failed to alloc io_bdt_pool\n");
301301 goto mem_err;
drivers/scsi/csiostor/csio_attr.c+1−1
@@ -594,12 +594,12 @@ csio_vport_create(struct fc_vport *fc_vport, bool disable) · 593 unmodified lines
594594 }
595595
596596 fc_vport_set_state(fc_vport, FC_VPORT_INITIALIZING);
597+ ln->fc_vport = fc_vport;
597598
598599 if (csio_fcoe_alloc_vnp(hw, ln))
599600 goto error;
600601
601602 *(struct csio_lnode **)fc_vport->dd_data = ln;
602− ln->fc_vport = fc_vport;
603603 if (!fc_vport->node_name)
604604 fc_vport->node_name = wwn_to_u64(csio_ln_wwnn(ln));
605605 if (!fc_vport->port_name)
drivers/scsi/cxgbi/cxgb3i/cxgb3i.c+4−5
@@ -1144,7 +1144,7 @@ static void ddp_clear_map(struct cxgbi_device *cdev, struct cxgbi_ppm *ppm, · 1143 unmodified lines
11441144 }
11451145
11461146 static int ddp_setup_conn_pgidx(struct cxgbi_sock *csk,
1147− unsigned int tid, int pg_idx, bool reply)
1147+ unsigned int tid, int pg_idx)
11481148 {
11491149 struct sk_buff *skb = alloc_wr(sizeof(struct cpl_set_tcb_field), 0,
11501150 GFP_KERNEL);
@@ -1160,7 +1160,7 @@ static int ddp_setup_conn_pgidx(struct cxgbi_sock *csk, · 9 unmodified lines
11601160 req = (struct cpl_set_tcb_field *)skb->head;
11611161 req->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD));
11621162 OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_SET_TCB_FIELD, tid));
1163− req->reply = V_NO_REPLY(reply ? 0 : 1);
1163+ req->reply = V_NO_REPLY(1);
11641164 req->cpu_idx = 0;
11651165 req->word = htons(31);
11661166 req->mask = cpu_to_be64(0xF0000000);
@@ -1177,11 +1177,10 @@ static int ddp_setup_conn_pgidx(struct cxgbi_sock *csk, · 10 unmodified lines
11771177 * @tid: connection id
11781178 * @hcrc: header digest enabled
11791179 * @dcrc: data digest enabled
1180− * @reply: request reply from h/w
11811180 * set up the iscsi digest settings for a connection identified by tid
11821181 */
11831182 static int ddp_setup_conn_digest(struct cxgbi_sock *csk, unsigned int tid,
1184− int hcrc, int dcrc, int reply)
1183+ int hcrc, int dcrc)
11851184 {
11861185 struct sk_buff *skb = alloc_wr(sizeof(struct cpl_set_tcb_field), 0,
11871186 GFP_KERNEL);
@@ -1197,7 +1196,7 @@ static int ddp_setup_conn_digest(struct cxgbi_sock *csk, unsigned int tid, · 9 unmodified lines
11971196 req = (struct cpl_set_tcb_field *)skb->head;
11981197 req->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD));
11991198 OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_SET_TCB_FIELD, tid));
1200− req->reply = V_NO_REPLY(reply ? 0 : 1);
1199+ req->reply = V_NO_REPLY(1);
12011200 req->cpu_idx = 0;
12021201 req->word = htons(31);
12031202 req->mask = cpu_to_be64(0x0F000000);
drivers/scsi/cxgbi/cxgb4i/cxgb4i.c+20−8
@@ -1548,16 +1548,22 @@ static void do_set_tcb_rpl(struct cxgbi_device *cdev, struct sk_buff *skb) · 1547 unmodified lines
15481548 struct cxgbi_sock *csk;
15491549
15501550 csk = lookup_tid(t, tid);
1551− if (!csk)
1551+ if (!csk) {
15521552 pr_err("can't find conn. for tid %u.\n", tid);
1553+ return;
1554+ }
15531555
15541556 log_debug(1 << CXGBI_DBG_TOE | 1 << CXGBI_DBG_SOCK,
15551557 "csk 0x%p,%u,%lx,%u, status 0x%x.\n",
15561558 csk, csk->state, csk->flags, csk->tid, rpl->status);
15571559
1558− if (rpl->status != CPL_ERR_NONE)
1560+ if (rpl->status != CPL_ERR_NONE) {
15591561 pr_err("csk 0x%p,%u, SET_TCB_RPL status %u.\n",
15601562 csk, tid, rpl->status);
1563+ csk->err = -EINVAL;
1564+ }
1565+
1566+ complete(&csk->cmpl);
15611567
15621568 __kfree_skb(skb);
15631569 }
@@ -1983,7 +1989,7 @@ static int ddp_set_map(struct cxgbi_ppm *ppm, struct cxgbi_sock *csk, · 419 unmodified lines
19831989 }
19841990
19851991 static int ddp_setup_conn_pgidx(struct cxgbi_sock *csk, unsigned int tid,
1986− int pg_idx, bool reply)
1992+ int pg_idx)
19871993 {
19881994 struct sk_buff *skb;
19891995 struct cpl_set_tcb_field *req;
@@ -1999,7 +2005,7 @@ static int ddp_setup_conn_pgidx(struct cxgbi_sock *csk, unsigned int tid, · 9 unmodified lines
19992005 req = (struct cpl_set_tcb_field *)skb->head;
20002006 INIT_TP_WR(req, csk->tid);
20012007 OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_SET_TCB_FIELD, csk->tid));
2002− req->reply_ctrl = htons(NO_REPLY_V(reply) | QUEUENO_V(csk->rss_qid));
2008+ req->reply_ctrl = htons(NO_REPLY_V(0) | QUEUENO_V(csk->rss_qid));
20032009 req->word_cookie = htons(0);
20042010 req->mask = cpu_to_be64(0x3 << 8);
20052011 req->val = cpu_to_be64(pg_idx << 8);
@@ -2008,12 +2014,15 @@ static int ddp_setup_conn_pgidx(struct cxgbi_sock *csk, unsigned int tid, · 2 unmodified lines
20082014 log_debug(1 << CXGBI_DBG_TOE | 1 << CXGBI_DBG_SOCK,
20092015 "csk 0x%p, tid 0x%x, pg_idx %u.\n", csk, csk->tid, pg_idx);
20102016
2017+ reinit_completion(&csk->cmpl);
20112018 cxgb4_ofld_send(csk->cdev->ports[csk->port_id], skb);
2012− return 0;
2019+ wait_for_completion(&csk->cmpl);
2020+
2021+ return csk->err;
20132022 }
20142023
20152024 static int ddp_setup_conn_digest(struct cxgbi_sock *csk, unsigned int tid,
2016− int hcrc, int dcrc, int reply)
2025+ int hcrc, int dcrc)
20172026 {
20182027 struct sk_buff *skb;
20192028 struct cpl_set_tcb_field *req;
@@ -2031,7 +2040,7 @@ static int ddp_setup_conn_digest(struct cxgbi_sock *csk, unsigned int tid, · 11 unmodified lines
20312040 req = (struct cpl_set_tcb_field *)skb->head;
20322041 INIT_TP_WR(req, tid);
20332042 OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_SET_TCB_FIELD, tid));
2034− req->reply_ctrl = htons(NO_REPLY_V(reply) | QUEUENO_V(csk->rss_qid));
2043+ req->reply_ctrl = htons(NO_REPLY_V(0) | QUEUENO_V(csk->rss_qid));
20352044 req->word_cookie = htons(0);
20362045 req->mask = cpu_to_be64(0x3 << 4);
20372046 req->val = cpu_to_be64(((hcrc ? ULP_CRC_HEADER : 0) |
@@ -2041,8 +2050,11 @@ static int ddp_setup_conn_digest(struct cxgbi_sock *csk, unsigned int tid, · 3 unmodified lines
20412050 log_debug(1 << CXGBI_DBG_TOE | 1 << CXGBI_DBG_SOCK,
20422051 "csk 0x%p, tid 0x%x, crc %d,%d.\n", csk, csk->tid, hcrc, dcrc);
20432052
2053+ reinit_completion(&csk->cmpl);
20442054 cxgb4_ofld_send(csk->cdev->ports[csk->port_id], skb);
2045− return 0;
2055+ wait_for_completion(&csk->cmpl);
2056+
2057+ return csk->err;
20462058 }
20472059
20482060 static struct cxgbi_ppm *cdev2ppm(struct cxgbi_device *cdev)
drivers/scsi/cxgbi/libcxgbi.c+4−3
@@ -573,6 +573,7 @@ static struct cxgbi_sock *cxgbi_sock_create(struct cxgbi_device *cdev) · 572 unmodified lines
573573 skb_queue_head_init(&csk->receive_queue);
574574 skb_queue_head_init(&csk->write_queue);
575575 timer_setup(&csk->retry_timer, NULL, 0);
576+ init_completion(&csk->cmpl);
576577 rwlock_init(&csk->callback_lock);
577578 csk->cdev = cdev;
578579 csk->flags = 0;
@@ -2251,14 +2252,14 @@ int cxgbi_set_conn_param(struct iscsi_cls_conn *cls_conn, · 1672 unmodified lines
22512252 if (!err && conn->hdrdgst_en)
22522253 err = csk->cdev->csk_ddp_setup_digest(csk, csk->tid,
22532254 conn->hdrdgst_en,
2254− conn->datadgst_en, 0);
2255+ conn->datadgst_en);
22552256 break;
22562257 case ISCSI_PARAM_DATADGST_EN:
22572258 err = iscsi_set_param(cls_conn, param, buf, buflen);
22582259 if (!err && conn->datadgst_en)
22592260 err = csk->cdev->csk_ddp_setup_digest(csk, csk->tid,
22602261 conn->hdrdgst_en,
2261− conn->datadgst_en, 0);
2262+ conn->datadgst_en);
22622263 break;
22632264 case ISCSI_PARAM_MAX_R2T:
22642265 return iscsi_tcp_set_max_r2t(conn, buf);
@@ -2384,7 +2385,7 @@ int cxgbi_bind_conn(struct iscsi_cls_session *cls_session, · 119 unmodified lines
23842385
23852386 ppm = csk->cdev->cdev2ppm(csk->cdev);
23862387 err = csk->cdev->csk_ddp_setup_pgidx(csk, csk->tid,
2387− ppm->tformat.pgsz_idx_dflt, 0);
2388+ ppm->tformat.pgsz_idx_dflt);
23882389 if (err < 0)
23892390 return err;
23902391
drivers/scsi/cxgbi/libcxgbi.h+3−2
@@ -149,6 +149,7 @@ struct cxgbi_sock { · 148 unmodified lines
149149 struct sk_buff_head receive_queue;
150150 struct sk_buff_head write_queue;
151151 struct timer_list retry_timer;
152+ struct completion cmpl;
152153 int err;
153154 rwlock_t callback_lock;
154155 void *user_data;
@@ -490,9 +491,9 @@ struct cxgbi_device { · 335 unmodified lines
490491 struct cxgbi_ppm *,
491492 struct cxgbi_task_tag_info *);
492493 int (*csk_ddp_setup_digest)(struct cxgbi_sock *,
493− unsigned int, int, int, int);
494+ unsigned int, int, int);
494495 int (*csk_ddp_setup_pgidx)(struct cxgbi_sock *,
495− unsigned int, int, bool);
496+ unsigned int, int);
496497
497498 void (*csk_release_offload_resources)(struct cxgbi_sock *);
498499 int (*csk_rx_pdu_ready)(struct cxgbi_sock *, struct sk_buff *);
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c+6−6
@@ -2507,6 +2507,12 @@ hisi_sas_v3_probe(struct pci_dev *pdev, const struct pci_device_id *id) · 2506 unmodified lines
25072507 sha->sas_port[i] = &hisi_hba->port[i].sas_port;
25082508 }
25092509
2510+ if (hisi_hba->prot_mask) {
2511+ dev_info(dev, "Registering for DIF/DIX prot_mask=0x%x\n",
2512+ prot_mask);
2513+ scsi_host_set_prot(hisi_hba->shost, prot_mask);
2514+ }
2515+
25102516 rc = scsi_add_host(shost, dev);
25112517 if (rc)
25122518 goto err_out_ha;
@@ -2519,12 +2525,6 @@ hisi_sas_v3_probe(struct pci_dev *pdev, const struct pci_device_id *id) · 6 unmodified lines
25192525 if (rc)
25202526 goto err_out_register_ha;
25212527
2522− if (hisi_hba->prot_mask) {
2523− dev_info(dev, "Registering for DIF/DIX prot_mask=0x%x\n",
2524− prot_mask);
2525− scsi_host_set_prot(hisi_hba->shost, prot_mask);
2526− }
2527−
25282528 scsi_scan_host(shost);
25292529
25302530 return 0;
drivers/scsi/isci/init.c+7−7
@@ -576,6 +576,13 @@ static struct isci_host *isci_host_alloc(struct pci_dev *pdev, int id) · 575 unmodified lines
576576 shost->max_lun = ~0;
577577 shost->max_cmd_len = MAX_COMMAND_SIZE;
578578
579+ /* turn on DIF support */
580+ scsi_host_set_prot(shost,
581+ SHOST_DIF_TYPE1_PROTECTION |
582+ SHOST_DIF_TYPE2_PROTECTION |
583+ SHOST_DIF_TYPE3_PROTECTION);
584+ scsi_host_set_guard(shost, SHOST_DIX_GUARD_CRC);
585+
579586 err = scsi_add_host(shost, &pdev->dev);
580587 if (err)
581588 goto err_shost;
@@ -663,13 +670,6 @@ static int isci_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) · 81 unmodified lines
663670 goto err_host_alloc;
664671 }
665672 pci_info->hosts[i] = h;
666−
667− /* turn on DIF support */
668− scsi_host_set_prot(to_shost(h),
669− SHOST_DIF_TYPE1_PROTECTION |
670− SHOST_DIF_TYPE2_PROTECTION |
671− SHOST_DIF_TYPE3_PROTECTION);
672− scsi_host_set_guard(to_shost(h), SHOST_DIX_GUARD_CRC);
673673 }
674674
675675 err = isci_setup_interrupts(pdev);
drivers/scsi/libfc/fc_lport.c+3−3
@@ -1726,14 +1726,14 @@ void fc_lport_flogi_resp(struct fc_seq *sp, struct fc_frame *fp, · 1725 unmodified lines
17261726 fc_frame_payload_op(fp) != ELS_LS_ACC) {
17271727 FC_LPORT_DBG(lport, "FLOGI not accepted or bad response\n");
17281728 fc_lport_error(lport, fp);
1729− goto err;
1729+ goto out;
17301730 }
17311731
17321732 flp = fc_frame_payload_get(fp, sizeof(*flp));
17331733 if (!flp) {
17341734 FC_LPORT_DBG(lport, "FLOGI bad response\n");
17351735 fc_lport_error(lport, fp);
1736− goto err;
1736+ goto out;
17371737 }
17381738
17391739 mfs = ntohs(flp->fl_csp.sp_bb_data) &
@@ -1743,7 +1743,7 @@ void fc_lport_flogi_resp(struct fc_seq *sp, struct fc_frame *fp, · 3 unmodified lines
17431743 FC_LPORT_DBG(lport, "FLOGI bad mfs:%hu response, "
17441744 "lport->mfs:%hu\n", mfs, lport->mfs);
17451745 fc_lport_error(lport, fp);
1746− goto err;
1746+ goto out;
17471747 }
17481748
17491749 if (mfs <= lport->mfs) {
drivers/scsi/lpfc/lpfc_nvme.c+9−7
@@ -297,7 +297,8 @@ lpfc_nvme_localport_delete(struct nvme_fc_local_port *localport) · 296 unmodified lines
297297 lport);
298298
299299 /* release any threads waiting for the unreg to complete */
300− complete(&lport->lport_unreg_done);
300+ if (lport->vport->localport)
301+ complete(lport->lport_unreg_cmp);
301302 }
302303
303304 /* lpfc_nvme_remoteport_delete
@@ -2545,7 +2546,8 @@ lpfc_nvme_create_localport(struct lpfc_vport *vport) · 2241 unmodified lines
25452546 */
25462547 void
25472548 lpfc_nvme_lport_unreg_wait(struct lpfc_vport *vport,
2548− struct lpfc_nvme_lport *lport)
2549+ struct lpfc_nvme_lport *lport,
2550+ struct completion *lport_unreg_cmp)
25492551 {
25502552 #if (IS_ENABLED(CONFIG_NVME_FC))
25512553 u32 wait_tmo;
@@ -2557,8 +2559,7 @@ lpfc_nvme_lport_unreg_wait(struct lpfc_vport *vport, · 5 unmodified lines
25572559 */
25582560 wait_tmo = msecs_to_jiffies(LPFC_NVME_WAIT_TMO * 1000);
25592561 while (true) {
2560− ret = wait_for_completion_timeout(&lport->lport_unreg_done,
2561− wait_tmo);
2562+ ret = wait_for_completion_timeout(lport_unreg_cmp, wait_tmo);
25622563 if (unlikely(!ret)) {
25632564 lpfc_printf_vlog(vport, KERN_ERR, LOG_NVME_IOERR,
25642565 "6176 Lport %p Localport %p wait "
@@ -2592,12 +2593,12 @@ lpfc_nvme_destroy_localport(struct lpfc_vport *vport) · 27 unmodified lines
25922593 struct lpfc_nvme_lport *lport;
25932594 struct lpfc_nvme_ctrl_stat *cstat;
25942595 int ret;
2596+ DECLARE_COMPLETION_ONSTACK(lport_unreg_cmp);
25952597
25962598 if (vport->nvmei_support == 0)
25972599 return;
25982600
25992601 localport = vport->localport;
2600− vport->localport = NULL;
26012602 lport = (struct lpfc_nvme_lport *)localport->private;
26022603 cstat = lport->cstat;
26032604
@@ -2608,13 +2609,14 @@ lpfc_nvme_destroy_localport(struct lpfc_vport *vport) · 4 unmodified lines
26082609 /* lport's rport list is clear. Unregister
26092610 * lport and release resources.
26102611 */
2611− init_completion(&lport->lport_unreg_done);
2612+ lport->lport_unreg_cmp = &lport_unreg_cmp;
26122613 ret = nvme_fc_unregister_localport(localport);
26132614
26142615 /* Wait for completion. This either blocks
26152616 * indefinitely or succeeds
26162617 */
2617− lpfc_nvme_lport_unreg_wait(vport, lport);
2618+ lpfc_nvme_lport_unreg_wait(vport, lport, &lport_unreg_cmp);
2619+ vport->localport = NULL;
26182620 kfree(cstat);
26192621
26202622 /* Regardless of the unregister upcall response, clear
drivers/scsi/lpfc/lpfc_nvme.h+1−1
@@ -50,7 +50,7 @@ struct lpfc_nvme_ctrl_stat { · 49 unmodified lines
5050 /* Declare nvme-based local and remote port definitions. */
5151 struct lpfc_nvme_lport {
5252 struct lpfc_vport *vport;
53− struct completion lport_unreg_done;
53+ struct completion *lport_unreg_cmp;
5454 /* Add stats counters here */
5555 struct lpfc_nvme_ctrl_stat *cstat;
5656 atomic_t fc4NvmeLsRequests;
drivers/scsi/lpfc/lpfc_nvmet.c+5−3
@@ -1003,7 +1003,8 @@ lpfc_nvmet_targetport_delete(struct nvmet_fc_target_port *targetport) · 1002 unmodified lines
10031003 struct lpfc_nvmet_tgtport *tport = targetport->private;
10041004
10051005 /* release any threads waiting for the unreg to complete */
1006− complete(&tport->tport_unreg_done);
1006+ if (tport->phba->targetport)
1007+ complete(tport->tport_unreg_cmp);
10071008 }
10081009
10091010 static void
@@ -1692,6 +1693,7 @@ lpfc_nvmet_destroy_targetport(struct lpfc_hba *phba) · 682 unmodified lines
16921693 struct lpfc_nvmet_tgtport *tgtp;
16931694 struct lpfc_queue *wq;
16941695 uint32_t qidx;
1696+ DECLARE_COMPLETION_ONSTACK(tport_unreg_cmp);
16951697
16961698 if (phba->nvmet_support == 0)
16971699 return;
@@ -1701,9 +1703,9 @@ lpfc_nvmet_destroy_targetport(struct lpfc_hba *phba) · 3 unmodified lines
17011703 wq = phba->sli4_hba.nvme_wq[qidx];
17021704 lpfc_nvmet_wqfull_flush(phba, wq, NULL);
17031705 }
1704− init_completion(&tgtp->tport_unreg_done);
1706+ tgtp->tport_unreg_cmp = &tport_unreg_cmp;
17051707 nvmet_fc_unregister_targetport(phba->targetport);
1706− wait_for_completion_timeout(&tgtp->tport_unreg_done, 5);
1708+ wait_for_completion_timeout(&tport_unreg_cmp, 5);
17071709 lpfc_nvmet_cleanup_io_context(phba);
17081710 }
17091711 phba->targetport = NULL;
drivers/scsi/lpfc/lpfc_nvmet.h+1−1
@@ -34,7 +34,7 @@ · 33 unmodified lines
3434 /* Used for NVME Target */
3535 struct lpfc_nvmet_tgtport {
3636 struct lpfc_hba *phba;
37− struct completion tport_unreg_done;
37+ struct completion *tport_unreg_cmp;
3838
3939 /* Stats counters - lpfc_nvmet_unsol_ls_buffer */
4040 atomic_t rcv_ls_req_in;
drivers/scsi/lpfc/lpfc_sli.c+11−9
@@ -9407,6 +9407,7 @@ lpfc_sli4_iocb2wqe(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq, · 9406 unmodified lines
94079407 cmnd = CMD_XMIT_SEQUENCE64_CR;
94089408 if (phba->link_flag & LS_LOOPBACK_MODE)
94099409 bf_set(wqe_xo, &wqe->xmit_sequence.wge_ctl, 1);
9410+ /* fall through */
94109411 case CMD_XMIT_SEQUENCE64_CR:
94119412 /* word3 iocb=io_tag32 wqe=reserved */
94129413 wqe->xmit_sequence.rsvd3 = 0;
@@ -13528,6 +13529,7 @@ lpfc_sli4_sp_handle_rcqe(struct lpfc_hba *phba, struct lpfc_rcqe *rcqe) · 4115 unmodified lines
1352813529 case FC_STATUS_RQ_BUF_LEN_EXCEEDED:
1352913530 lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
1353013531 "2537 Receive Frame Truncated!!\n");
13532+ /* fall through */
1353113533 case FC_STATUS_RQ_SUCCESS:
1353213534 spin_lock_irqsave(&phba->hbalock, iflags);
1353313535 lpfc_sli4_rq_release(hrq, drq);
@@ -13937,7 +13939,7 @@ lpfc_sli4_nvmet_handle_rcqe(struct lpfc_hba *phba, struct lpfc_queue *cq, · 403 unmodified lines
1393713939 case FC_STATUS_RQ_BUF_LEN_EXCEEDED:
1393813940 lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
1393913941 "6126 Receive Frame Truncated!!\n");
13940− /* Drop thru */
13942+ /* fall through */
1394113943 case FC_STATUS_RQ_SUCCESS:
1394213944 spin_lock_irqsave(&phba->hbalock, iflags);
1394313945 lpfc_sli4_rq_release(hrq, drq);
@@ -14849,7 +14851,7 @@ lpfc_eq_create(struct lpfc_hba *phba, struct lpfc_queue *eq, uint32_t imax) · 905 unmodified lines
1484914851 eq->entry_count);
1485014852 if (eq->entry_count < 256)
1485114853 return -EINVAL;
14852− /* otherwise default to smallest count (drop through) */
14854+ /* fall through - otherwise default to smallest count */
1485314855 case 256:
1485414856 bf_set(lpfc_eq_context_count, &eq_create->u.request.context,
1485514857 LPFC_EQ_CNT_256);
@@ -14980,7 +14982,7 @@ lpfc_cq_create(struct lpfc_hba *phba, struct lpfc_queue *cq, · 124 unmodified lines
1498014982 LPFC_CQ_CNT_WORD7);
1498114983 break;
1498214984 }
14983− /* Fall Thru */
14985+ /* fall through */
1498414986 default:
1498514987 lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
1498614988 "0361 Unsupported CQ count: "
@@ -14991,7 +14993,7 @@ lpfc_cq_create(struct lpfc_hba *phba, struct lpfc_queue *cq, · 4 unmodified lines
1499114993 status = -EINVAL;
1499214994 goto out;
1499314995 }
14994− /* otherwise default to smallest count (drop through) */
14996+ /* fall through - otherwise default to smallest count */
1499514997 case 256:
1499614998 bf_set(lpfc_cq_context_count, &cq_create->u.request.context,
1499714999 LPFC_CQ_CNT_256);
@@ -15151,7 +15153,7 @@ lpfc_cq_create_set(struct lpfc_hba *phba, struct lpfc_queue **cqp, · 153 unmodified lines
1515115153 LPFC_CQ_CNT_WORD7);
1515215154 break;
1515315155 }
15154− /* Fall Thru */
15156+ /* fall through */
1515515157 default:
1515615158 lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
1515715159 "3118 Bad CQ count. (%d)\n",
@@ -15160,7 +15162,7 @@ lpfc_cq_create_set(struct lpfc_hba *phba, struct lpfc_queue **cqp, · 2 unmodified lines
1516015162 status = -EINVAL;
1516115163 goto out;
1516215164 }
15163− /* otherwise default to smallest (drop thru) */
15165+ /* fall through - otherwise default to smallest */
1516415166 case 256:
1516515167 bf_set(lpfc_mbx_cq_create_set_cqe_cnt,
1516615168 &cq_set->u.request, LPFC_CQ_CNT_256);
@@ -15432,7 +15434,7 @@ lpfc_mq_create(struct lpfc_hba *phba, struct lpfc_queue *mq, · 265 unmodified lines
1543215434 status = -EINVAL;
1543315435 goto out;
1543415436 }
15435− /* otherwise default to smallest count (drop through) */
15437+ /* fall through - otherwise default to smallest count */
1543615438 case 16:
1543715439 bf_set(lpfc_mq_context_ring_size,
1543815440 &mq_create_ext->u.request.context,
@@ -15851,7 +15853,7 @@ lpfc_rq_create(struct lpfc_hba *phba, struct lpfc_queue *hrq, · 412 unmodified lines
1585115853 status = -EINVAL;
1585215854 goto out;
1585315855 }
15854− /* otherwise default to smallest count (drop through) */
15856+ /* fall through - otherwise default to smallest count */
1585515857 case 512:
1585615858 bf_set(lpfc_rq_context_rqe_count,
1585715859 &rq_create->u.request.context,
@@ -15988,7 +15990,7 @@ lpfc_rq_create(struct lpfc_hba *phba, struct lpfc_queue *hrq, · 130 unmodified lines
1598815990 status = -EINVAL;
1598915991 goto out;
1599015992 }
15991− /* otherwise default to smallest count (drop through) */
15993+ /* fall through - otherwise default to smallest count */
1599215994 case 512:
1599315995 bf_set(lpfc_rq_context_rqe_count,
1599415996 &rq_create->u.request.context,
drivers/scsi/megaraid/megaraid_sas_base.c+1−1
@@ -6236,7 +6236,7 @@ megasas_set_dma_mask(struct megasas_instance *instance) · 6235 unmodified lines
62366236 instance->consistent_mask_64bit = true;
62376237
62386238 dev_info(&pdev->dev, "%s bit DMA mask and %s bit consistent mask\n",
6239− ((*pdev->dev.dma_mask == DMA_BIT_MASK(64)) ? "63" : "32"),
6239+ ((*pdev->dev.dma_mask == DMA_BIT_MASK(63)) ? "63" : "32"),
62406240 (instance->consistent_mask_64bit ? "63" : "32"));
62416241
62426242 return 0;
drivers/scsi/megaraid/megaraid_sas_fusion.c+2−1
@@ -175,7 +175,8 @@ megasas_clear_intr_fusion(struct megasas_instance *instance) · 174 unmodified lines
175175 /*
176176 * Check if it is our interrupt
177177 */
178− status = readl(&regs->outbound_intr_status);
178+ status = megasas_readl(instance,
179+ &regs->outbound_intr_status);
179180
180181 if (status & 1) {
181182 writel(status, &regs->outbound_intr_status);
drivers/scsi/pm8001/pm8001_sas.c+1−1
@@ -657,7 +657,7 @@ static int pm8001_dev_found_notify(struct domain_device *dev) · 656 unmodified lines
657657 if (dev->dev_type == SAS_SATA_DEV) {
658658 pm8001_device->attached_phy =
659659 dev->rphy->identify.phy_identifier;
660− flag = 1; /* directly sata*/
660+ flag = 1; /* directly sata */
661661 }
662662 } /*register this device to HBA*/
663663 PM8001_DISC_DBG(pm8001_ha, pm8001_printk("Found device\n"));
drivers/scsi/qedi/qedi_iscsi.c+3−0
@@ -953,6 +953,7 @@ static int qedi_ep_poll(struct iscsi_endpoint *ep, int timeout_ms) · 952 unmodified lines
953953
954954 qedi_ep = ep->dd_data;
955955 if (qedi_ep->state == EP_STATE_IDLE ||
956+ qedi_ep->state == EP_STATE_OFLDCONN_NONE ||
956957 qedi_ep->state == EP_STATE_OFLDCONN_FAILED)
957958 return -1;
958959
@@ -1035,6 +1036,7 @@ static void qedi_ep_disconnect(struct iscsi_endpoint *ep) · 76 unmodified lines
10351036
10361037 switch (qedi_ep->state) {
10371038 case EP_STATE_OFLDCONN_START:
1039+ case EP_STATE_OFLDCONN_NONE:
10381040 goto ep_release_conn;
10391041 case EP_STATE_OFLDCONN_FAILED:
10401042 break;
@@ -1225,6 +1227,7 @@ static int qedi_set_path(struct Scsi_Host *shost, struct iscsi_path *path_data) · 184 unmodified lines
12251227
12261228 if (!is_valid_ether_addr(&path_data->mac_addr[0])) {
12271229 QEDI_NOTICE(&qedi->dbg_ctx, "dst mac NOT VALID\n");
1230+ qedi_ep->state = EP_STATE_OFLDCONN_NONE;
12281231 ret = -EIO;
12291232 goto set_path_exit;
12301233 }
drivers/scsi/qedi/qedi_iscsi.h+1−0
@@ -59,6 +59,7 @@ enum { · 58 unmodified lines
5959 EP_STATE_OFLDCONN_FAILED = 0x2000,
6060 EP_STATE_CONNECT_FAILED = 0x4000,
6161 EP_STATE_DISCONN_TIMEDOUT = 0x8000,
62+ EP_STATE_OFLDCONN_NONE = 0x10000,
6263 };
6364
6465 struct qedi_conn;
drivers/scsi/qla1280.c+1−1
@@ -4248,7 +4248,7 @@ qla1280_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) · 4247 unmodified lines
42484248 ha->devnum = devnum; /* specifies microcode load address */
42494249
42504250 #ifdef QLA_64BIT_PTR
4251− if (dma_set_mask(&ha->pdev->dev, DMA_BIT_MASK(64))) {
4251+ if (dma_set_mask_and_coherent(&ha->pdev->dev, DMA_BIT_MASK(64))) {
42524252 if (dma_set_mask(&ha->pdev->dev, DMA_BIT_MASK(32))) {
42534253 printk(KERN_WARNING "scsi(%li): Unable to set a "
42544254 "suitable DMA mask - aborting\n", ha->host_no);
drivers/scsi/qla2xxx/qla_def.h+2−0
@@ -4394,6 +4394,8 @@ typedef struct scsi_qla_host { · 4393 unmodified lines
43944394 uint16_t n2n_id;
43954395 struct list_head gpnid_list;
43964396 struct fab_scan scan;
4397+
4398+ unsigned int irq_offset;
43974399 } scsi_qla_host_t;
43984400
43994401 struct qla27xx_image_status {
drivers/scsi/qla2xxx/qla_isr.c+1−0
@@ -3446,6 +3446,7 @@ qla24xx_enable_msix(struct qla_hw_data *ha, struct rsp_que *rsp) · 3445 unmodified lines
34463446 "Adjusted Max no of queues pairs: %d.\n", ha->max_qpairs);
34473447 }
34483448 }
3449+ vha->irq_offset = desc.pre_vectors;
34493450 ha->msix_entries = kcalloc(ha->msix_count,
34503451 sizeof(struct qla_msix_entry),
34513452 GFP_KERNEL);
drivers/scsi/qla2xxx/qla_os.c+1−1
@@ -6939,7 +6939,7 @@ static int qla2xxx_map_queues(struct Scsi_Host *shost) · 6938 unmodified lines
69396939 if (USER_CTRL_IRQ(vha->hw))
69406940 rc = blk_mq_map_queues(qmap);
69416941 else
6942− rc = blk_mq_pci_map_queues(qmap, vha->hw->pdev, 0);
6942+ rc = blk_mq_pci_map_queues(qmap, vha->hw->pdev, vha->irq_offset);
69436943 return rc;
69446944 }
69456945
drivers/scsi/qla4xxx/ql4_os.c+2−0
@@ -7232,6 +7232,8 @@ static int qla4xxx_sysfs_ddb_tgt_create(struct scsi_qla_host *ha, · 7231 unmodified lines
72327232
72337233 rc = qla4xxx_copy_from_fwddb_param(fnode_sess, fnode_conn,
72347234 fw_ddb_entry);
7235+ if (rc)
7236+ goto free_sess;
72357237
72367238 ql4_printk(KERN_INFO, ha, "%s: sysfs entry %s created\n",
72377239 __func__, fnode_sess->dev.kobj.name);
drivers/scsi/scsi_debug.c+21−20
@@ -62,7 +62,7 @@ · 61 unmodified lines
6262
6363 /* make sure inq_product_rev string corresponds to this version */
6464 #define SDEBUG_VERSION "0188" /* format to fit INQUIRY revision field */
65−static const char *sdebug_version_date = "20180128";
65+static const char *sdebug_version_date = "20190125";
6666
6767 #define MY_NAME "scsi_debug"
6868
@@ -735,7 +735,7 @@ static inline bool scsi_debug_lbp(void) · 666 unmodified lines
735735 (sdebug_lbpu || sdebug_lbpws || sdebug_lbpws10);
736736 }
737737
738−static void *fake_store(unsigned long long lba)
738+static void *lba2fake_store(unsigned long long lba)
739739 {
740740 lba = do_div(lba, sdebug_store_sectors);
741741
@@ -2514,8 +2514,8 @@ static int do_device_access(struct scsi_cmnd *scmd, u32 sg_skip, u64 lba, · 1772 unmodified lines
25142514 return ret;
25152515 }
25162516
2517−/* If fake_store(lba,num) compares equal to arr(num), then copy top half of
2518− * arr into fake_store(lba,num) and return true. If comparison fails then
2517+/* If lba2fake_store(lba,num) compares equal to arr(num), then copy top half of
2518+ * arr into lba2fake_store(lba,num) and return true. If comparison fails then
25192519 * return false. */
25202520 static bool comp_write_worker(u64 lba, u32 num, const u8 *arr)
25212521 {
@@ -2643,7 +2643,7 @@ static int prot_verify_read(struct scsi_cmnd *SCpnt, sector_t start_sec, · 121 unmodified lines
26432643 if (sdt->app_tag == cpu_to_be16(0xffff))
26442644 continue;
26452645
2646− ret = dif_verify(sdt, fake_store(sector), sector, ei_lba);
2646+ ret = dif_verify(sdt, lba2fake_store(sector), sector, ei_lba);
26472647 if (ret) {
26482648 dif_errors++;
26492649 return ret;
@@ -3261,10 +3261,12 @@ err_out: · 611 unmodified lines
32613261 static int resp_write_same(struct scsi_cmnd *scp, u64 lba, u32 num,
32623262 u32 ei_lba, bool unmap, bool ndob)
32633263 {
3264+ int ret;
32643265 unsigned long iflags;
32653266 unsigned long long i;
3266− int ret;
3267− u64 lba_off;
3267+ u32 lb_size = sdebug_sector_size;
3268+ u64 block, lbaa;
3269+ u8 *fs1p;
32683270
32693271 ret = check_device_access_params(scp, lba, num);
32703272 if (ret)
@@ -3276,31 +3278,30 @@ static int resp_write_same(struct scsi_cmnd *scp, u64 lba, u32 num, · 5 unmodified lines
32763278 unmap_region(lba, num);
32773279 goto out;
32783280 }
3279−
3280− lba_off = lba * sdebug_sector_size;
3281+ lbaa = lba;
3282+ block = do_div(lbaa, sdebug_store_sectors);
32813283 /* if ndob then zero 1 logical block, else fetch 1 logical block */
3284+ fs1p = fake_storep + (block * lb_size);
32823285 if (ndob) {
3283− memset(fake_storep + lba_off, 0, sdebug_sector_size);
3286+ memset(fs1p, 0, lb_size);
32843287 ret = 0;
32853288 } else
3286− ret = fetch_to_dev_buffer(scp, fake_storep + lba_off,
3287− sdebug_sector_size);
3289+ ret = fetch_to_dev_buffer(scp, fs1p, lb_size);
32883290
32893291 if (-1 == ret) {
32903292 write_unlock_irqrestore(&atomic_rw, iflags);
32913293 return DID_ERROR << 16;
3292− } else if (sdebug_verbose && !ndob && (ret < sdebug_sector_size))
3294+ } else if (sdebug_verbose && !ndob && (ret < lb_size))
32933295 sdev_printk(KERN_INFO, scp->device,
32943296 "%s: %s: lb size=%u, IO sent=%d bytes\n",
3295− my_name, "write same",
3296− sdebug_sector_size, ret);
3297+ my_name, "write same", lb_size, ret);
32973298
32983299 /* Copy first sector to remaining blocks */
3299− for (i = 1 ; i < num ; i++)
3300− memcpy(fake_storep + ((lba + i) * sdebug_sector_size),
3301− fake_storep + lba_off,
3302− sdebug_sector_size);
3303−
3300+ for (i = 1 ; i < num ; i++) {
3301+ lbaa = lba + i;
3302+ block = do_div(lbaa, sdebug_store_sectors);
3303+ memmove(fake_storep + (block * lb_size), fs1p, lb_size);
3304+ }
33043305 if (scsi_debug_lbp())
33053306 map_region(lba, num);
33063307 out:
drivers/scsi/scsi_lib.c+2−2
@@ -1842,8 +1842,8 @@ void __scsi_init_queue(struct Scsi_Host *shost, struct request_queue *q) · 1841 unmodified lines
18421842 blk_queue_segment_boundary(q, shost->dma_boundary);
18431843 dma_set_seg_boundary(dev, shost->dma_boundary);
18441844
1845− blk_queue_max_segment_size(q,
1846− min(shost->max_segment_size, dma_get_max_seg_size(dev)));
1845+ blk_queue_max_segment_size(q, shost->max_segment_size);
1846+ dma_set_max_seg_size(dev, shost->max_segment_size);
18471847
18481848 /*
18491849 * Set a reasonable default alignment: The larger of 32-byte (dword),
drivers/scsi/scsi_pm.c+15−11
@@ -80,8 +80,22 @@ static int scsi_dev_type_resume(struct device *dev, · 79 unmodified lines
8080
8181 if (err == 0) {
8282 pm_runtime_disable(dev);
83− pm_runtime_set_active(dev);
83+ err = pm_runtime_set_active(dev);
8484 pm_runtime_enable(dev);
85+
86+ /*
87+ * Forcibly set runtime PM status of request queue to "active"
88+ * to make sure we can again get requests from the queue
89+ * (see also blk_pm_peek_request()).
90+ *
91+ * The resume hook will correct runtime PM status of the disk.
92+ */
93+ if (!err && scsi_is_sdev_device(dev)) {
94+ struct scsi_device *sdev = to_scsi_device(dev);
95+
96+ if (sdev->request_queue->dev)
97+ blk_set_runtime_active(sdev->request_queue);
98+ }
8599 }
86100
87101 return err;
@@ -140,16 +154,6 @@ static int scsi_bus_resume_common(struct device *dev, · 52 unmodified lines
140154 else
141155 fn = NULL;
142156
143− /*
144− * Forcibly set runtime PM status of request queue to "active" to
145− * make sure we can again get requests from the queue (see also
146− * blk_pm_peek_request()).
147− *
148− * The resume hook will correct runtime PM status of the disk.
149− */
150− if (scsi_is_sdev_device(dev) && pm_runtime_suspended(dev))
151− blk_set_runtime_active(to_scsi_device(dev)->request_queue);
152−
153157 if (fn) {
154158 async_schedule_domain(fn, dev, &scsi_sd_pm_domain);
155159
drivers/scsi/sd.c+6−0
@@ -206,6 +206,12 @@ cache_type_store(struct device *dev, struct device_attribute *attr, · 205 unmodified lines
206206 sp = buffer_data[0] & 0x80 ? 1 : 0;
207207 buffer_data[0] &= ~0x80;
208208
209+ /*
210+ * Ensure WP, DPOFUA, and RESERVED fields are cleared in
211+ * received mode parameter buffer before doing MODE SELECT.
212+ */
213+ data.device_specific = 0;
214+
209215 if (scsi_mode_select(sdp, 1, sp, 8, buffer_data, len, SD_TIMEOUT,
210216 SD_MAX_RETRIES, &data, &sshdr)) {
211217 if (scsi_sense_valid(&sshdr))
drivers/scsi/smartpqi/smartpqi_init.c+1−1
@@ -323,7 +323,7 @@ static inline void pqi_device_remove_start(struct pqi_scsi_dev *device) · 322 unmodified lines
323323 static inline bool pqi_device_in_remove(struct pqi_ctrl_info *ctrl_info,
324324 struct pqi_scsi_dev *device)
325325 {
326− return device->in_remove & !ctrl_info->in_shutdown;
326+ return device->in_remove && !ctrl_info->in_shutdown;
327327 }
328328
329329 static inline void pqi_schedule_rescan_worker_with_delay(
drivers/scsi/ufs/ufs.h+1−1
@@ -195,7 +195,7 @@ enum ufs_desc_def_size { · 194 unmodified lines
195195 QUERY_DESC_CONFIGURATION_DEF_SIZE = 0x90,
196196 QUERY_DESC_UNIT_DEF_SIZE = 0x23,
197197 QUERY_DESC_INTERCONNECT_DEF_SIZE = 0x06,
198− QUERY_DESC_GEOMETRY_DEF_SIZE = 0x44,
198+ QUERY_DESC_GEOMETRY_DEF_SIZE = 0x48,
199199 QUERY_DESC_POWER_DEF_SIZE = 0x62,
200200 QUERY_DESC_HEALTH_DEF_SIZE = 0x25,
201201 };
drivers/scsi/ufs/ufshcd.c+10−2
@@ -108,13 +108,19 @@ · 107 unmodified lines
108108 int ufshcd_dump_regs(struct ufs_hba *hba, size_t offset, size_t len,
109109 const char *prefix)
110110 {
111− u8 *regs;
111+ u32 *regs;
112+ size_t pos;
113+
114+ if (offset % 4 != 0 || len % 4 != 0) /* keep readl happy */
115+ return -EINVAL;
112116
113117 regs = kzalloc(len, GFP_KERNEL);
114118 if (!regs)
115119 return -ENOMEM;
116120
117− memcpy_fromio(regs, hba->mmio_base + offset, len);
121+ for (pos = 0; pos < len; pos += 4)
122+ regs[pos / 4] = ufshcd_readl(hba, offset + pos);
123+
118124 ufshcd_hex_dump(prefix, regs, len);
119125 kfree(regs);
120126
@@ -8001,6 +8007,8 @@ out: · 7880 unmodified lines
80018007 trace_ufshcd_system_resume(dev_name(hba->dev), ret,
80028008 ktime_to_us(ktime_sub(ktime_get(), start)),
80038009 hba->curr_dev_pwr_mode, hba->uic_link_state);
8010+ if (!ret)
8011+ hba->is_sys_suspended = false;
80048012 return ret;
80058013 }
80068014 EXPORT_SYMBOL(ufshcd_system_resume);
drivers/soc/fsl/qe/qe_tdm.c+0−55
@@ -44,10 +44,6 @@ int ucc_of_parse_tdm(struct device_node *np, struct ucc_tdm *utdm, · 43 unmodified lines
4444 const char *sprop;
4545 int ret = 0;
4646 u32 val;
47− struct resource *res;
48− struct device_node *np2;
49− static int siram_init_flag;
50− struct platform_device *pdev;
5147
5248 sprop = of_get_property(np, "fsl,rx-sync-clock", NULL);
5349 if (sprop) {
@@ -124,57 +120,6 @@ int ucc_of_parse_tdm(struct device_node *np, struct ucc_tdm *utdm, · 70 unmodified lines
124120 utdm->siram_entry_id = val;
125121
126122 set_si_param(utdm, ut_info);
127−
128− np2 = of_find_compatible_node(NULL, NULL, "fsl,t1040-qe-si");
129− if (!np2)
130− return -EINVAL;
131−
132− pdev = of_find_device_by_node(np2);
133− if (!pdev) {
134− pr_err("%pOFn: failed to lookup pdev\n", np2);
135− of_node_put(np2);
136− return -EINVAL;
137− }
138−
139− of_node_put(np2);
140− res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
141− utdm->si_regs = devm_ioremap_resource(&pdev->dev, res);
142− if (IS_ERR(utdm->si_regs)) {
143− ret = PTR_ERR(utdm->si_regs);
144− goto err_miss_siram_property;
145− }
146−
147− np2 = of_find_compatible_node(NULL, NULL, "fsl,t1040-qe-siram");
148− if (!np2) {
149− ret = -EINVAL;
150− goto err_miss_siram_property;
151− }
152−
153− pdev = of_find_device_by_node(np2);
154− if (!pdev) {
155− ret = -EINVAL;
156− pr_err("%pOFn: failed to lookup pdev\n", np2);
157− of_node_put(np2);
158− goto err_miss_siram_property;
159− }
160−
161− of_node_put(np2);
162− res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
163− utdm->siram = devm_ioremap_resource(&pdev->dev, res);
164− if (IS_ERR(utdm->siram)) {
165− ret = PTR_ERR(utdm->siram);
166− goto err_miss_siram_property;
167− }
168−
169− if (siram_init_flag == 0) {
170− memset_io(utdm->siram, 0, resource_size(res));
171− siram_init_flag = 1;
172− }
173−
174− return ret;
175−
176−err_miss_siram_property:
177− devm_iounmap(&pdev->dev, utdm->si_regs);
178123 return ret;
179124 }
180125 EXPORT_SYMBOL(ucc_of_parse_tdm);
drivers/staging/android/ion/ion.c+1−1
@@ -248,10 +248,10 @@ static void ion_dma_buf_detatch(struct dma_buf *dmabuf, · 247 unmodified lines
248248 struct ion_dma_buf_attachment *a = attachment->priv;
249249 struct ion_buffer *buffer = dmabuf->priv;
250250
251− free_duped_table(a->table);
252251 mutex_lock(&buffer->lock);
253252 list_del(&a->list);
254253 mutex_unlock(&buffer->lock);
254+ free_duped_table(a->table);
255255
256256 kfree(a);
257257 }
drivers/staging/rtl8188eu/os_dep/usb_intf.c+1−0
@@ -35,6 +35,7 @@ static const struct usb_device_id rtw_usb_id_tbl[] = { · 34 unmodified lines
3535 {USB_DEVICE(0x2001, 0x330F)}, /* DLink DWA-125 REV D1 */
3636 {USB_DEVICE(0x2001, 0x3310)}, /* Dlink DWA-123 REV D1 */
3737 {USB_DEVICE(0x2001, 0x3311)}, /* DLink GO-USB-N150 REV B1 */
38+ {USB_DEVICE(0x2001, 0x331B)}, /* D-Link DWA-121 rev B1 */
3839 {USB_DEVICE(0x2357, 0x010c)}, /* TP-Link TL-WN722N v2 */
3940 {USB_DEVICE(0x0df6, 0x0076)}, /* Sitecom N150 v2 */
4041 {USB_DEVICE(USB_VENDER_ID_REALTEK, 0xffef)}, /* Rosewill RNX-N150NUB */
drivers/staging/rtl8723bs/include/ieee80211.h+3−3
@@ -850,18 +850,18 @@ enum ieee80211_state { · 849 unmodified lines
850850 #define IP_FMT "%pI4"
851851 #define IP_ARG(x) (x)
852852
853−extern __inline int is_multicast_mac_addr(const u8 *addr)
853+static inline int is_multicast_mac_addr(const u8 *addr)
854854 {
855855 return ((addr[0] != 0xff) && (0x01 & addr[0]));
856856 }
857857
858−extern __inline int is_broadcast_mac_addr(const u8 *addr)
858+static inline int is_broadcast_mac_addr(const u8 *addr)
859859 {
860860 return ((addr[0] == 0xff) && (addr[1] == 0xff) && (addr[2] == 0xff) && \
861861 (addr[3] == 0xff) && (addr[4] == 0xff) && (addr[5] == 0xff));
862862 }
863863
864−extern __inline int is_zero_mac_addr(const u8 *addr)
864+static inline int is_zero_mac_addr(const u8 *addr)
865865 {
866866 return ((addr[0] == 0x00) && (addr[1] == 0x00) && (addr[2] == 0x00) && \
867867 (addr[3] == 0x00) && (addr[4] == 0x00) && (addr[5] == 0x00));
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c+1−0
@@ -446,6 +446,7 @@ remote_event_wait(wait_queue_head_t *wq, struct remote_event *event) · 445 unmodified lines
446446 static inline void
447447 remote_event_signal_local(wait_queue_head_t *wq, struct remote_event *event)
448448 {
449+ event->fired = 1;
449450 event->armed = 0;
450451 wake_up_all(wq);
451452 }
drivers/staging/wilc1000/host_interface.c+2−3
@@ -36,7 +36,7 @@ struct wilc_op_mode { · 35 unmodified lines
3636 struct wilc_reg_frame {
3737 bool reg;
3838 u8 reg_id;
39− __le32 frame_type;
39+ __le16 frame_type;
4040 } __packed;
4141
4242 struct wilc_drv_handler {
@@ -1744,7 +1744,6 @@ int wilc_add_rx_gtk(struct wilc_vif *vif, const u8 *rx_gtk, u8 gtk_key_len, · 1701 unmodified lines
17441744 result = wilc_send_config_pkt(vif, WILC_SET_CFG, wid_list,
17451745 ARRAY_SIZE(wid_list),
17461746 wilc_get_vif_idx(vif));
1747− kfree(gtk_key);
17481747 } else if (mode == WILC_STATION_MODE) {
17491748 struct wid wid;
17501749
@@ -1754,9 +1753,9 @@ int wilc_add_rx_gtk(struct wilc_vif *vif, const u8 *rx_gtk, u8 gtk_key_len, · 3 unmodified lines
17541753 wid.val = (u8 *)gtk_key;
17551754 result = wilc_send_config_pkt(vif, WILC_SET_CFG, &wid, 1,
17561755 wilc_get_vif_idx(vif));
1757− kfree(gtk_key);
17581756 }
17591757
1758+ kfree(gtk_key);
17601759 return result;
17611760 }
17621761
drivers/staging/wilc1000/wilc_wlan.c+4−3
@@ -1252,21 +1252,22 @@ static u32 init_chip(struct net_device *dev) · 1251 unmodified lines
12521252 ret = wilc->hif_func->hif_read_reg(wilc, 0x1118, &reg);
12531253 if (!ret) {
12541254 netdev_err(dev, "fail read reg 0x1118\n");
1255− return ret;
1255+ goto release;
12561256 }
12571257 reg |= BIT(0);
12581258 ret = wilc->hif_func->hif_write_reg(wilc, 0x1118, reg);
12591259 if (!ret) {
12601260 netdev_err(dev, "fail write reg 0x1118\n");
1261− return ret;
1261+ goto release;
12621262 }
12631263 ret = wilc->hif_func->hif_write_reg(wilc, 0xc0000, 0x71);
12641264 if (!ret) {
12651265 netdev_err(dev, "fail write reg 0xc0000\n");
1266− return ret;
1266+ goto release;
12671267 }
12681268 }
12691269
1270+release:
12701271 release_bus(wilc, WILC_BUS_RELEASE_ONLY);
12711272
12721273 return ret;
drivers/target/iscsi/iscsi_target.c+1−1
@@ -714,7 +714,7 @@ static int __init iscsi_target_init_module(void) · 713 unmodified lines
714714 sizeof(struct iscsi_queue_req),
715715 __alignof__(struct iscsi_queue_req), 0, NULL);
716716 if (!lio_qr_cache) {
717− pr_err("nable to kmem_cache_create() for"
717+ pr_err("Unable to kmem_cache_create() for"
718718 " lio_qr_cache\n");
719719 goto bitmap_out;
720720 }
drivers/target/target_core_user.c+62−27
@@ -148,7 +148,7 @@ struct tcmu_dev { · 147 unmodified lines
148148 size_t ring_size;
149149
150150 struct mutex cmdr_lock;
151− struct list_head cmdr_queue;
151+ struct list_head qfull_queue;
152152
153153 uint32_t dbi_max;
154154 uint32_t dbi_thresh;
@@ -159,6 +159,7 @@ struct tcmu_dev { · 4 unmodified lines
159159
160160 struct timer_list cmd_timer;
161161 unsigned int cmd_time_out;
162+ struct list_head inflight_queue;
162163
163164 struct timer_list qfull_timer;
164165 int qfull_time_out;
@@ -179,7 +180,7 @@ struct tcmu_dev { · 14 unmodified lines
179180 struct tcmu_cmd {
180181 struct se_cmd *se_cmd;
181182 struct tcmu_dev *tcmu_dev;
182− struct list_head cmdr_queue_entry;
183+ struct list_head queue_entry;
183184
184185 uint16_t cmd_id;
185186
@@ -192,6 +193,7 @@ struct tcmu_cmd { · 6 unmodified lines
192193 unsigned long deadline;
193194
194195 #define TCMU_CMD_BIT_EXPIRED 0
196+#define TCMU_CMD_BIT_INFLIGHT 1
195197 unsigned long flags;
196198 };
197199 /*
@@ -586,7 +588,7 @@ static struct tcmu_cmd *tcmu_alloc_cmd(struct se_cmd *se_cmd) · 388 unmodified lines
586588 if (!tcmu_cmd)
587589 return NULL;
588590
589− INIT_LIST_HEAD(&tcmu_cmd->cmdr_queue_entry);
591+ INIT_LIST_HEAD(&tcmu_cmd->queue_entry);
590592 tcmu_cmd->se_cmd = se_cmd;
591593 tcmu_cmd->tcmu_dev = udev;
592594
@@ -915,11 +917,13 @@ setup_timer: · 322 unmodified lines
915917 return 0;
916918
917919 tcmu_cmd->deadline = round_jiffies_up(jiffies + msecs_to_jiffies(tmo));
918− mod_timer(timer, tcmu_cmd->deadline);
920+ if (!timer_pending(timer))
921+ mod_timer(timer, tcmu_cmd->deadline);
922+
919923 return 0;
920924 }
921925
922−static int add_to_cmdr_queue(struct tcmu_cmd *tcmu_cmd)
926+static int add_to_qfull_queue(struct tcmu_cmd *tcmu_cmd)
923927 {
924928 struct tcmu_dev *udev = tcmu_cmd->tcmu_dev;
925929 unsigned int tmo;
@@ -942,7 +946,7 @@ static int add_to_cmdr_queue(struct tcmu_cmd *tcmu_cmd) · 16 unmodified lines
942946 if (ret)
943947 return ret;
944948
945− list_add_tail(&tcmu_cmd->cmdr_queue_entry, &udev->cmdr_queue);
949+ list_add_tail(&tcmu_cmd->queue_entry, &udev->qfull_queue);
946950 pr_debug("adding cmd %u on dev %s to ring space wait queue\n",
947951 tcmu_cmd->cmd_id, udev->name);
948952 return 0;
@@ -999,7 +1003,7 @@ static int queue_cmd_ring(struct tcmu_cmd *tcmu_cmd, sense_reason_t *scsi_err) · 50 unmodified lines
9991003 base_command_size = tcmu_cmd_get_base_cmd_size(tcmu_cmd->dbi_cnt);
10001004 command_size = tcmu_cmd_get_cmd_size(tcmu_cmd, base_command_size);
10011005
1002− if (!list_empty(&udev->cmdr_queue))
1006+ if (!list_empty(&udev->qfull_queue))
10031007 goto queue;
10041008
10051009 mb = udev->mb_addr;
@@ -1096,13 +1100,16 @@ static int queue_cmd_ring(struct tcmu_cmd *tcmu_cmd, sense_reason_t *scsi_err) · 90 unmodified lines
10961100 UPDATE_HEAD(mb->cmd_head, command_size, udev->cmdr_size);
10971101 tcmu_flush_dcache_range(mb, sizeof(*mb));
10981102
1103+ list_add_tail(&tcmu_cmd->queue_entry, &udev->inflight_queue);
1104+ set_bit(TCMU_CMD_BIT_INFLIGHT, &tcmu_cmd->flags);
1105+
10991106 /* TODO: only if FLUSH and FUA? */
11001107 uio_event_notify(&udev->uio_info);
11011108
11021109 return 0;
11031110
11041111 queue:
1105− if (add_to_cmdr_queue(tcmu_cmd)) {
1112+ if (add_to_qfull_queue(tcmu_cmd)) {
11061113 *scsi_err = TCM_OUT_OF_RESOURCES;
11071114 return -1;
11081115 }
@@ -1145,6 +1152,8 @@ static void tcmu_handle_completion(struct tcmu_cmd *cmd, struct tcmu_cmd_entry * · 36 unmodified lines
11451152 if (test_bit(TCMU_CMD_BIT_EXPIRED, &cmd->flags))
11461153 goto out;
11471154
1155+ list_del_init(&cmd->queue_entry);
1156+
11481157 tcmu_cmd_reset_dbi_cur(cmd);
11491158
11501159 if (entry->hdr.uflags & TCMU_UFLAG_UNKNOWN_OP) {
@@ -1194,9 +1203,29 @@ out: · 43 unmodified lines
11941203 tcmu_free_cmd(cmd);
11951204 }
11961205
1206+static void tcmu_set_next_deadline(struct list_head *queue,
1207+ struct timer_list *timer)
1208+{
1209+ struct tcmu_cmd *tcmu_cmd, *tmp_cmd;
1210+ unsigned long deadline = 0;
1211+
1212+ list_for_each_entry_safe(tcmu_cmd, tmp_cmd, queue, queue_entry) {
1213+ if (!time_after(jiffies, tcmu_cmd->deadline)) {
1214+ deadline = tcmu_cmd->deadline;
1215+ break;
1216+ }
1217+ }
1218+
1219+ if (deadline)
1220+ mod_timer(timer, deadline);
1221+ else
1222+ del_timer(timer);
1223+}
1224+
11971225 static unsigned int tcmu_handle_completions(struct tcmu_dev *udev)
11981226 {
11991227 struct tcmu_mailbox *mb;
1228+ struct tcmu_cmd *cmd;
12001229 int handled = 0;
12011230
12021231 if (test_bit(TCMU_DEV_BIT_BROKEN, &udev->flags)) {
@@ -1210,7 +1239,6 @@ static unsigned int tcmu_handle_completions(struct tcmu_dev *udev) · 7 unmodified lines
12101239 while (udev->cmdr_last_cleaned != READ_ONCE(mb->cmd_tail)) {
12111240
12121241 struct tcmu_cmd_entry *entry = (void *) mb + CMDR_OFF + udev->cmdr_last_cleaned;
1213− struct tcmu_cmd *cmd;
12141242
12151243 tcmu_flush_dcache_range(entry, sizeof(*entry));
12161244
@@ -1243,7 +1271,7 @@ static unsigned int tcmu_handle_completions(struct tcmu_dev *udev) · 26 unmodified lines
12431271 /* no more pending commands */
12441272 del_timer(&udev->cmd_timer);
12451273
1246− if (list_empty(&udev->cmdr_queue)) {
1274+ if (list_empty(&udev->qfull_queue)) {
12471275 /*
12481276 * no more pending or waiting commands so try to
12491277 * reclaim blocks if needed.
@@ -1252,6 +1280,8 @@ static unsigned int tcmu_handle_completions(struct tcmu_dev *udev) · 2 unmodified lines
12521280 tcmu_global_max_blocks)
12531281 schedule_delayed_work(&tcmu_unmap_work, 0);
12541282 }
1283+ } else if (udev->cmd_time_out) {
1284+ tcmu_set_next_deadline(&udev->inflight_queue, &udev->cmd_timer);
12551285 }
12561286
12571287 return handled;
@@ -1271,7 +1301,7 @@ static int tcmu_check_expired_cmd(int id, void *p, void *data) · 13 unmodified lines
12711301 if (!time_after(jiffies, cmd->deadline))
12721302 return 0;
12731303
1274− is_running = list_empty(&cmd->cmdr_queue_entry);
1304+ is_running = test_bit(TCMU_CMD_BIT_INFLIGHT, &cmd->flags);
12751305 se_cmd = cmd->se_cmd;
12761306
12771307 if (is_running) {
@@ -1287,9 +1317,9 @@ static int tcmu_check_expired_cmd(int id, void *p, void *data) · 9 unmodified lines
12871317 * target_complete_cmd will translate this to LUN COMM FAILURE
12881318 */
12891319 scsi_status = SAM_STAT_CHECK_CONDITION;
1320+ list_del_init(&cmd->queue_entry);
12901321 } else {
1291− list_del_init(&cmd->cmdr_queue_entry);
1292−
1322+ list_del_init(&cmd->queue_entry);
12931323 idr_remove(&udev->commands, id);
12941324 tcmu_free_cmd(cmd);
12951325 scsi_status = SAM_STAT_TASK_SET_FULL;
@@ -1372,7 +1402,8 @@ static struct se_device *tcmu_alloc_device(struct se_hba *hba, const char *name) · 76 unmodified lines
13721402
13731403 INIT_LIST_HEAD(&udev->node);
13741404 INIT_LIST_HEAD(&udev->timedout_entry);
1375− INIT_LIST_HEAD(&udev->cmdr_queue);
1405+ INIT_LIST_HEAD(&udev->qfull_queue);
1406+ INIT_LIST_HEAD(&udev->inflight_queue);
13761407 idr_init(&udev->commands);
13771408
13781409 timer_setup(&udev->qfull_timer, tcmu_qfull_timedout, 0);
@@ -1383,7 +1414,7 @@ static struct se_device *tcmu_alloc_device(struct se_hba *hba, const char *name) · 4 unmodified lines
13831414 return &udev->se_dev;
13841415 }
13851416
1386−static bool run_cmdr_queue(struct tcmu_dev *udev, bool fail)
1417+static bool run_qfull_queue(struct tcmu_dev *udev, bool fail)
13871418 {
13881419 struct tcmu_cmd *tcmu_cmd, *tmp_cmd;
13891420 LIST_HEAD(cmds);
@@ -1391,15 +1422,15 @@ static bool run_cmdr_queue(struct tcmu_dev *udev, bool fail) · 1 unmodified line
13911422 sense_reason_t scsi_ret;
13921423 int ret;
13931424
1394− if (list_empty(&udev->cmdr_queue))
1425+ if (list_empty(&udev->qfull_queue))
13951426 return true;
13961427
13971428 pr_debug("running %s's cmdr queue forcefail %d\n", udev->name, fail);
13981429
1399− list_splice_init(&udev->cmdr_queue, &cmds);
1430+ list_splice_init(&udev->qfull_queue, &cmds);
14001431
1401− list_for_each_entry_safe(tcmu_cmd, tmp_cmd, &cmds, cmdr_queue_entry) {
1402− list_del_init(&tcmu_cmd->cmdr_queue_entry);
1432+ list_for_each_entry_safe(tcmu_cmd, tmp_cmd, &cmds, queue_entry) {
1433+ list_del_init(&tcmu_cmd->queue_entry);
14031434
14041435 pr_debug("removing cmd %u on dev %s from queue\n",
14051436 tcmu_cmd->cmd_id, udev->name);
@@ -1437,14 +1468,13 @@ static bool run_cmdr_queue(struct tcmu_dev *udev, bool fail) · 31 unmodified lines
14371468 * cmd was requeued, so just put all cmds back in
14381469 * the queue
14391470 */
1440− list_splice_tail(&cmds, &udev->cmdr_queue);
1471+ list_splice_tail(&cmds, &udev->qfull_queue);
14411472 drained = false;
1442− goto done;
1473+ break;
14431474 }
14441475 }
1445− if (list_empty(&udev->cmdr_queue))
1446− del_timer(&udev->qfull_timer);
1447−done:
1476+
1477+ tcmu_set_next_deadline(&udev->qfull_queue, &udev->qfull_timer);
14481478 return drained;
14491479 }
14501480
@@ -1454,7 +1484,7 @@ static int tcmu_irqcontrol(struct uio_info *info, s32 irq_on) · 3 unmodified lines
14541484
14551485 mutex_lock(&udev->cmdr_lock);
14561486 tcmu_handle_completions(udev);
1457− run_cmdr_queue(udev, false);
1487+ run_qfull_queue(udev, false);
14581488 mutex_unlock(&udev->cmdr_lock);
14591489
14601490 return 0;
@@ -1982,7 +2012,7 @@ static void tcmu_block_dev(struct tcmu_dev *udev) · 521 unmodified lines
19822012 /* complete IO that has executed successfully */
19832013 tcmu_handle_completions(udev);
19842014 /* fail IO waiting to be queued */
1985− run_cmdr_queue(udev, true);
2015+ run_qfull_queue(udev, true);
19862016
19872017 unlock:
19882018 mutex_unlock(&udev->cmdr_lock);
@@ -1997,7 +2027,7 @@ static void tcmu_reset_ring(struct tcmu_dev *udev, u8 err_level) · 8 unmodified lines
19972027 mutex_lock(&udev->cmdr_lock);
19982028
19992029 idr_for_each_entry(&udev->commands, cmd, i) {
2000− if (!list_empty(&cmd->cmdr_queue_entry))
2030+ if (!test_bit(TCMU_CMD_BIT_INFLIGHT, &cmd->flags))
20012031 continue;
20022032
20032033 pr_debug("removing cmd %u on dev %s from ring (is expired %d)\n",
@@ -2006,6 +2036,7 @@ static void tcmu_reset_ring(struct tcmu_dev *udev, u8 err_level) · 2 unmodified lines
20062036
20072037 idr_remove(&udev->commands, i);
20082038 if (!test_bit(TCMU_CMD_BIT_EXPIRED, &cmd->flags)) {
2039+ list_del_init(&cmd->queue_entry);
20092040 if (err_level == 1) {
20102041 /*
20112042 * Userspace was not able to start the
@@ -2666,6 +2697,10 @@ static void check_timedout_devices(void) · 654 unmodified lines
26662697
26672698 mutex_lock(&udev->cmdr_lock);
26682699 idr_for_each(&udev->commands, tcmu_check_expired_cmd, NULL);
2700+
2701+ tcmu_set_next_deadline(&udev->inflight_queue, &udev->cmd_timer);
2702+ tcmu_set_next_deadline(&udev->qfull_queue, &udev->qfull_timer);
2703+
26692704 mutex_unlock(&udev->cmdr_lock);
26702705
26712706 spin_lock_bh(&timed_out_udevs_lock);
drivers/thermal/intel/int340x_thermal/Kconfig+1−1
@@ -4,7 +4,7 @@ · 3 unmodified lines
44
55 config INT340X_THERMAL
66 tristate "ACPI INT340X thermal drivers"
7− depends on X86 && ACPI
7+ depends on X86 && ACPI && PCI
88 select THERMAL_GOV_USER_SPACE
99 select ACPI_THERMAL_REL
1010 select ACPI_FAN
drivers/thermal/intel/int340x_thermal/processor_thermal_device.c+16−14
@@ -84,7 +84,12 @@ static ssize_t power_limit_##index##_##suffix##_show(struct device *dev, \ · 83 unmodified lines
8484 struct pci_dev *pci_dev; \
8585 struct platform_device *pdev; \
8686 struct proc_thermal_device *proc_dev; \
87−\
87+ \
88+ if (proc_thermal_emum_mode == PROC_THERMAL_NONE) { \
89+ dev_warn(dev, "Attempted to get power limit before device was initialized!\n"); \
90+ return 0; \
91+ } \
92+ \
8893 if (proc_thermal_emum_mode == PROC_THERMAL_PLATFORM_DEV) { \
8994 pdev = to_platform_device(dev); \
9095 proc_dev = platform_get_drvdata(pdev); \
@@ -298,11 +303,6 @@ static int proc_thermal_add(struct device *dev, · 207 unmodified lines
298303 *priv = proc_priv;
299304
300305 ret = proc_thermal_read_ppcc(proc_priv);
301− if (!ret) {
302− ret = sysfs_create_group(&dev->kobj,
303− &power_limit_attribute_group);
304−
305− }
306306 if (ret)
307307 return ret;
308308
@@ -316,8 +316,7 @@ static int proc_thermal_add(struct device *dev, · 7 unmodified lines
316316
317317 proc_priv->int340x_zone = int340x_thermal_zone_add(adev, ops);
318318 if (IS_ERR(proc_priv->int340x_zone)) {
319− ret = PTR_ERR(proc_priv->int340x_zone);
320− goto remove_group;
319+ return PTR_ERR(proc_priv->int340x_zone);
321320 } else
322321 ret = 0;
323322
@@ -331,9 +330,6 @@ static int proc_thermal_add(struct device *dev, · 7 unmodified lines
331330
332331 remove_zone:
333332 int340x_thermal_zone_remove(proc_priv->int340x_zone);
334−remove_group:
335− sysfs_remove_group(&proc_priv->dev->kobj,
336− &power_limit_attribute_group);
337333
338334 return ret;
339335 }
@@ -364,7 +360,10 @@ static int int3401_add(struct platform_device *pdev) · 24 unmodified lines
364360 platform_set_drvdata(pdev, proc_priv);
365361 proc_thermal_emum_mode = PROC_THERMAL_PLATFORM_DEV;
366362
367− return 0;
363+ dev_info(&pdev->dev, "Creating sysfs group for PROC_THERMAL_PLATFORM_DEV\n");
364+
365+ return sysfs_create_group(&pdev->dev.kobj,
366+ &power_limit_attribute_group);
368367 }
369368
370369 static int int3401_remove(struct platform_device *pdev)
@@ -423,7 +422,7 @@ static int proc_thermal_pci_probe(struct pci_dev *pdev, · 52 unmodified lines
423422 proc_priv->soc_dts = intel_soc_dts_iosf_init(
424423 INTEL_SOC_DTS_INTERRUPT_MSI, 2, 0);
425424
426− if (proc_priv->soc_dts && pdev->irq) {
425+ if (!IS_ERR(proc_priv->soc_dts) && pdev->irq) {
427426 ret = pci_enable_msi(pdev);
428427 if (!ret) {
429428 ret = request_threaded_irq(pdev->irq, NULL,
@@ -441,7 +440,10 @@ static int proc_thermal_pci_probe(struct pci_dev *pdev, · 11 unmodified lines
441440 dev_err(&pdev->dev, "No auxiliary DTSs enabled\n");
442441 }
443442
444− return 0;
443+ dev_info(&pdev->dev, "Creating sysfs group for PROC_THERMAL_PCI\n");
444+
445+ return sysfs_create_group(&pdev->dev.kobj,
446+ &power_limit_attribute_group);
445447 }
446448
447449 static void proc_thermal_pci_remove(struct pci_dev *pdev)
drivers/tty/n_hdlc.c+1−0
@@ -597,6 +597,7 @@ static ssize_t n_hdlc_tty_read(struct tty_struct *tty, struct file *file, · 596 unmodified lines
597597 /* too large for caller's buffer */
598598 ret = -EOVERFLOW;
599599 } else {
600+ __set_current_state(TASK_RUNNING);
600601 if (copy_to_user(buf, rbuf->buf, rbuf->count))
601602 ret = -EFAULT;
602603 else
drivers/tty/serial/8250/8250_core.c+9−8
@@ -1070,15 +1070,16 @@ int serial8250_register_8250_port(struct uart_8250_port *up) · 1069 unmodified lines
10701070
10711071 ret = 0;
10721072 }
1073− }
10741073
1075− /* Initialise interrupt backoff work if required */
1076− if (up->overrun_backoff_time_ms > 0) {
1077− uart->overrun_backoff_time_ms = up->overrun_backoff_time_ms;
1078− INIT_DELAYED_WORK(&uart->overrun_backoff,
1079− serial_8250_overrun_backoff_work);
1080− } else {
1081− uart->overrun_backoff_time_ms = 0;
1074+ /* Initialise interrupt backoff work if required */
1075+ if (up->overrun_backoff_time_ms > 0) {
1076+ uart->overrun_backoff_time_ms =
1077+ up->overrun_backoff_time_ms;
1078+ INIT_DELAYED_WORK(&uart->overrun_backoff,
1079+ serial_8250_overrun_backoff_work);
1080+ } else {
1081+ uart->overrun_backoff_time_ms = 0;
1082+ }
10821083 }
10831084
10841085 mutex_unlock(&serial_mutex);
drivers/tty/serial/earlycon-riscv-sbi.c+8−5
@@ -10,13 +10,16 @@ · 9 unmodified lines
1010 #include <linux/serial_core.h>
1111 #include <asm/sbi.h>
1212
13−static void sbi_console_write(struct console *con,
14− const char *s, unsigned int n)
13+static void sbi_putc(struct uart_port *port, int c)
1514 {
16− int i;
15+ sbi_console_putchar(c);
16+}
1717
18− for (i = 0; i < n; ++i)
19− sbi_console_putchar(s[i]);
18+static void sbi_console_write(struct console *con,
19+ const char *s, unsigned n)
20+{
21+ struct earlycon_device *dev = con->data;
22+ uart_console_write(&dev->port, s, n, sbi_putc);
2023 }
2124
2225 static int __init early_sbi_setup(struct earlycon_device *device,
drivers/tty/serial/fsl_lpuart.c+1−1
@@ -1697,7 +1697,7 @@ lpuart32_set_termios(struct uart_port *port, struct ktermios *termios, · 1696 unmodified lines
16971697 }
16981698
16991699 /* ask the core to calculate the divisor */
1700− baud = uart_get_baud_rate(port, termios, old, 50, port->uartclk / 16);
1700+ baud = uart_get_baud_rate(port, termios, old, 50, port->uartclk / 4);
17011701
17021702 spin_lock_irqsave(&sport->port.lock, flags);
17031703
drivers/tty/serial/qcom_geni_serial.c+2−2
@@ -225,7 +225,7 @@ static unsigned int qcom_geni_serial_get_mctrl(struct uart_port *uport) · 224 unmodified lines
225225 unsigned int mctrl = TIOCM_DSR | TIOCM_CAR;
226226 u32 geni_ios;
227227
228− if (uart_console(uport) || !uart_cts_enabled(uport)) {
228+ if (uart_console(uport)) {
229229 mctrl |= TIOCM_CTS;
230230 } else {
231231 geni_ios = readl_relaxed(uport->membase + SE_GENI_IOS);
@@ -241,7 +241,7 @@ static void qcom_geni_serial_set_mctrl(struct uart_port *uport, · 9 unmodified lines
241241 {
242242 u32 uart_manual_rfr = 0;
243243
244− if (uart_console(uport) || !uart_cts_enabled(uport))
244+ if (uart_console(uport))
245245 return;
246246
247247 if (!(mctrl & TIOCM_RTS))
drivers/tty/serial/serial_core.c+8−4
@@ -550,10 +550,12 @@ static int uart_put_char(struct tty_struct *tty, unsigned char c) · 549 unmodified lines
550550 int ret = 0;
551551
552552 circ = &state->xmit;
553− if (!circ->buf)
553+ port = uart_port_lock(state, flags);
554+ if (!circ->buf) {
555+ uart_port_unlock(port, flags);
554556 return 0;
557+ }
555558
556− port = uart_port_lock(state, flags);
557559 if (port && uart_circ_chars_free(circ) != 0) {
558560 circ->buf[circ->head] = c;
559561 circ->head = (circ->head + 1) & (UART_XMIT_SIZE - 1);
@@ -586,11 +588,13 @@ static int uart_write(struct tty_struct *tty, · 26 unmodified lines
586588 return -EL3HLT;
587589 }
588590
591+ port = uart_port_lock(state, flags);
589592 circ = &state->xmit;
590− if (!circ->buf)
593+ if (!circ->buf) {
594+ uart_port_unlock(port, flags);
591595 return 0;
596+ }
592597
593− port = uart_port_lock(state, flags);
594598 while (port) {
595599 c = CIRC_SPACE_TO_END(circ->head, circ->tail, UART_XMIT_SIZE);
596600 if (count < c)
drivers/tty/tty_io.c+2−1
@@ -2189,7 +2189,8 @@ static int tiocsti(struct tty_struct *tty, char __user *p) · 2188 unmodified lines
21892189 ld = tty_ldisc_ref_wait(tty);
21902190 if (!ld)
21912191 return -EIO;
2192− ld->ops->receive_buf(tty, &ch, &mbz, 1);
2192+ if (ld->ops->receive_buf)
2193+ ld->ops->receive_buf(tty, &ch, &mbz, 1);
21932194 tty_ldisc_deref(ld);
21942195 return 0;
21952196 }
drivers/tty/vt/vt.c+17−33
@@ -1272,6 +1272,7 @@ static int vc_do_resize(struct tty_struct *tty, struct vc_data *vc, · 1271 unmodified lines
12721272 if (con_is_visible(vc))
12731273 update_screen(vc);
12741274 vt_event_post(VT_EVENT_RESIZE, vc->vc_num, vc->vc_num);
1275+ notify_update(vc);
12751276 return err;
12761277 }
12771278
@@ -2764,8 +2765,8 @@ rescan_last_byte: · 1486 unmodified lines
27642765 con_flush(vc, draw_from, draw_to, &draw_x);
27652766 vc_uniscr_debug_check(vc);
27662767 console_conditional_schedule();
2767− console_unlock();
27682768 notify_update(vc);
2769+ console_unlock();
27692770 return n;
27702771 }
27712772
@@ -2884,8 +2885,7 @@ static void vt_console_print(struct console *co, const char *b, unsigned count) · 112 unmodified lines
28842885 unsigned char c;
28852886 static DEFINE_SPINLOCK(printing_lock);
28862887 const ushort *start;
2887− ushort cnt = 0;
2888− ushort myx;
2888+ ushort start_x, cnt;
28892889 int kmsg_console;
28902890
28912891 /* console busy or not yet initialized */
@@ -2898,10 +2898,6 @@ static void vt_console_print(struct console *co, const char *b, unsigned count) · 6 unmodified lines
28982898 if (kmsg_console && vc_cons_allocated(kmsg_console - 1))
28992899 vc = vc_cons[kmsg_console - 1].d;
29002900
2901− /* read `x' only after setting currcons properly (otherwise
2902− the `x' macro will read the x of the foreground console). */
2903− myx = vc->vc_x;
2904−
29052901 if (!vc_cons_allocated(fg_console)) {
29062902 /* impossible */
29072903 /* printk("vt_console_print: tty %d not allocated ??\n", currcons+1); */
@@ -2916,53 +2912,41 @@ static void vt_console_print(struct console *co, const char *b, unsigned count) · 8 unmodified lines
29162912 hide_cursor(vc);
29172913
29182914 start = (ushort *)vc->vc_pos;
2919−
2920− /* Contrived structure to try to emulate original need_wrap behaviour
2921− * Problems caused when we have need_wrap set on '\n' character */
2915+ start_x = vc->vc_x;
2916+ cnt = 0;
29222917 while (count--) {
29232918 c = *b++;
29242919 if (c == 10 || c == 13 || c == 8 || vc->vc_need_wrap) {
2925− if (cnt > 0) {
2926− if (con_is_visible(vc))
2927− vc->vc_sw->con_putcs(vc, start, cnt, vc->vc_y, vc->vc_x);
2928− vc->vc_x += cnt;
2929− if (vc->vc_need_wrap)
2930− vc->vc_x--;
2931− cnt = 0;
2932− }
2920+ if (cnt && con_is_visible(vc))
2921+ vc->vc_sw->con_putcs(vc, start, cnt, vc->vc_y, start_x);
2922+ cnt = 0;
29332923 if (c == 8) { /* backspace */
29342924 bs(vc);
29352925 start = (ushort *)vc->vc_pos;
2936− myx = vc->vc_x;
2926+ start_x = vc->vc_x;
29372927 continue;
29382928 }
29392929 if (c != 13)
29402930 lf(vc);
29412931 cr(vc);
29422932 start = (ushort *)vc->vc_pos;
2943− myx = vc->vc_x;
2933+ start_x = vc->vc_x;
29442934 if (c == 10 || c == 13)
29452935 continue;
29462936 }
2937+ vc_uniscr_putc(vc, c);
29472938 scr_writew((vc->vc_attr << 8) + c, (unsigned short *)vc->vc_pos);
29482939 notify_write(vc, c);
29492940 cnt++;
2950− if (myx == vc->vc_cols - 1) {
2951− vc->vc_need_wrap = 1;
2952− continue;
2953− }
2954− vc->vc_pos += 2;
2955− myx++;
2956− }
2957− if (cnt > 0) {
2958− if (con_is_visible(vc))
2959− vc->vc_sw->con_putcs(vc, start, cnt, vc->vc_y, vc->vc_x);
2960− vc->vc_x += cnt;
2961− if (vc->vc_x == vc->vc_cols) {
2962− vc->vc_x--;
2941+ if (vc->vc_x == vc->vc_cols - 1) {
29632942 vc->vc_need_wrap = 1;
2943+ } else {
2944+ vc->vc_pos += 2;
2945+ vc->vc_x++;
29642946 }
29652947 }
2948+ if (cnt && con_is_visible(vc))
2949+ vc->vc_sw->con_putcs(vc, start, cnt, vc->vc_y, start_x);
29662950 set_cursor(vc);
29672951 notify_update(vc);
29682952
drivers/usb/chipidea/ci_hdrc_imx.c+2−1
@@ -316,7 +316,8 @@ static int ci_hdrc_imx_probe(struct platform_device *pdev) · 315 unmodified lines
316316 if (IS_ERR(data->usbmisc_data))
317317 return PTR_ERR(data->usbmisc_data);
318318
319− if (of_usb_get_phy_mode(dev->of_node) == USBPHY_INTERFACE_MODE_HSIC) {
319+ if ((of_usb_get_phy_mode(dev->of_node) == USBPHY_INTERFACE_MODE_HSIC)
320+ && data->usbmisc_data) {
320321 pdata.flags |= CI_HDRC_IMX_IS_HSIC;
321322 data->usbmisc_data->hsic = 1;
322323 data->pinctrl = devm_pinctrl_get(dev);
drivers/usb/core/ledtrig-usbport.c+10−7
@@ -119,11 +119,6 @@ static const struct attribute_group ports_group = { · 118 unmodified lines
119119 .attrs = ports_attrs,
120120 };
121121
122−static const struct attribute_group *ports_groups[] = {
123− &ports_group,
124− NULL
125−};
126−
127122 /***************************************
128123 * Adding & removing ports
129124 ***************************************/
@@ -307,6 +302,7 @@ static int usbport_trig_notify(struct notifier_block *nb, unsigned long action, · 177 unmodified lines
307302 static int usbport_trig_activate(struct led_classdev *led_cdev)
308303 {
309304 struct usbport_trig_data *usbport_data;
305+ int err;
310306
311307 usbport_data = kzalloc(sizeof(*usbport_data), GFP_KERNEL);
312308 if (!usbport_data)
@@ -315,6 +311,9 @@ static int usbport_trig_activate(struct led_classdev *led_cdev) · 2 unmodified lines
315311
316312 /* List of ports */
317313 INIT_LIST_HEAD(&usbport_data->ports);
314+ err = sysfs_create_group(&led_cdev->dev->kobj, &ports_group);
315+ if (err)
316+ goto err_free;
318317 usb_for_each_dev(usbport_data, usbport_trig_add_usb_dev_ports);
319318 usbport_trig_update_count(usbport_data);
320319
@@ -322,8 +321,11 @@ static int usbport_trig_activate(struct led_classdev *led_cdev) · 1 unmodified line
322321 usbport_data->nb.notifier_call = usbport_trig_notify;
323322 led_set_trigger_data(led_cdev, usbport_data);
324323 usb_register_notify(&usbport_data->nb);
325−
326324 return 0;
325+
326+err_free:
327+ kfree(usbport_data);
328+ return err;
327329 }
328330
329331 static void usbport_trig_deactivate(struct led_classdev *led_cdev)
@@ -335,6 +337,8 @@ static void usbport_trig_deactivate(struct led_classdev *led_cdev) · 5 unmodified lines
335337 usbport_trig_remove_port(usbport_data, port);
336338 }
337339
340+ sysfs_remove_group(&led_cdev->dev->kobj, &ports_group);
341+
338342 usb_unregister_notify(&usbport_data->nb);
339343
340344 kfree(usbport_data);
@@ -344,7 +348,6 @@ static struct led_trigger usbport_led_trigger = { · 3 unmodified lines
344348 .name = "usbport",
345349 .activate = usbport_trig_activate,
346350 .deactivate = usbport_trig_deactivate,
347− .groups = ports_groups,
348351 };
349352
350353 static int __init usbport_trig_init(void)
drivers/usb/dwc2/gadget.c+1−1
@@ -261,7 +261,7 @@ static void dwc2_gadget_wkup_alert_handler(struct dwc2_hsotg *hsotg) · 260 unmodified lines
261261
262262 if (gintsts2 & GINTSTS2_WKUP_ALERT_INT) {
263263 dev_dbg(hsotg->dev, "%s: Wkup_Alert_Int\n", __func__);
264− dwc2_clear_bit(hsotg, GINTSTS2, GINTSTS2_WKUP_ALERT_INT);
264+ dwc2_set_bit(hsotg, GINTSTS2, GINTSTS2_WKUP_ALERT_INT);
265265 dwc2_set_bit(hsotg, DCTL, DCTL_RMTWKUPSIG);
266266 }
267267 }
drivers/usb/dwc3/gadget.c+4−0
@@ -177,6 +177,7 @@ static void dwc3_gadget_del_and_unmap_request(struct dwc3_ep *dep, · 176 unmodified lines
177177 req->started = false;
178178 list_del(&req->list);
179179 req->remaining = 0;
180+ req->needs_extra_trb = false;
180181
181182 if (req->request.status == -EINPROGRESS)
182183 req->request.status = status;
@@ -1984,6 +1985,7 @@ static int __dwc3_gadget_start(struct dwc3 *dwc) · 1801 unmodified lines
19841985
19851986 /* begin to receive SETUP packets */
19861987 dwc->ep0state = EP0_SETUP_PHASE;
1988+ dwc->link_state = DWC3_LINK_STATE_SS_DIS;
19871989 dwc3_ep0_out_start(dwc);
19881990
19891991 dwc3_gadget_enable_irq(dwc);
@@ -3379,6 +3381,8 @@ int dwc3_gadget_suspend(struct dwc3 *dwc) · 1389 unmodified lines
33793381 dwc3_disconnect_gadget(dwc);
33803382 __dwc3_gadget_stop(dwc);
33813383
3384+ synchronize_irq(dwc->irq_gadget);
3385+
33823386 return 0;
33833387 }
33843388
drivers/usb/gadget/function/f_sourcesink.c+1−1
@@ -838,7 +838,7 @@ static struct usb_function *source_sink_alloc_func( · 837 unmodified lines
838838
839839 ss = kzalloc(sizeof(*ss), GFP_KERNEL);
840840 if (!ss)
841− return NULL;
841+ return ERR_PTR(-ENOMEM);
842842
843843 ss_opts = container_of(fi, struct f_ss_opts, func_inst);
844844
drivers/usb/host/ehci-mv.c+1−0
@@ -302,3 +302,4 @@ MODULE_AUTHOR("Chao Xie <chao.xie@marvell.com>"); · 301 unmodified lines
302302 MODULE_AUTHOR("Neil Zhang <zhangwm@marvell.com>");
303303 MODULE_ALIAS("mv-ehci");
304304 MODULE_LICENSE("GPL");
305+MODULE_DEVICE_TABLE(of, ehci_mv_dt_ids);
drivers/usb/serial/ftdi_sio.c+14−1
@@ -1783,6 +1783,10 @@ static int ftdi_set_bitmode(struct usb_serial_port *port, u8 mode) · 1782 unmodified lines
17831783 int result;
17841784 u16 val;
17851785
1786+ result = usb_autopm_get_interface(serial->interface);
1787+ if (result)
1788+ return result;
1789+
17861790 val = (mode << 8) | (priv->gpio_output << 4) | priv->gpio_value;
17871791 result = usb_control_msg(serial->dev,
17881792 usb_sndctrlpipe(serial->dev, 0),
@@ -1795,6 +1799,8 @@ static int ftdi_set_bitmode(struct usb_serial_port *port, u8 mode) · 6 unmodified lines
17951799 val, result);
17961800 }
17971801
1802+ usb_autopm_put_interface(serial->interface);
1803+
17981804 return result;
17991805 }
18001806
@@ -1846,9 +1852,15 @@ static int ftdi_read_cbus_pins(struct usb_serial_port *port) · 45 unmodified lines
18461852 unsigned char *buf;
18471853 int result;
18481854
1855+ result = usb_autopm_get_interface(serial->interface);
1856+ if (result)
1857+ return result;
1858+
18491859 buf = kmalloc(1, GFP_KERNEL);
1850− if (!buf)
1860+ if (!buf) {
1861+ usb_autopm_put_interface(serial->interface);
18511862 return -ENOMEM;
1863+ }
18521864
18531865 result = usb_control_msg(serial->dev,
18541866 usb_rcvctrlpipe(serial->dev, 0),
@@ -1863,6 +1875,7 @@ static int ftdi_read_cbus_pins(struct usb_serial_port *port) · 8 unmodified lines
18631875 }
18641876
18651877 kfree(buf);
1878+ usb_autopm_put_interface(serial->interface);
18661879
18671880 return result;
18681881 }
drivers/usb/serial/keyspan_usa26msg.h+1−0
@@ -1,3 +1,4 @@
1+/* SPDX-License-Identifier: BSD-3-Clause */
12 /*
23 usa26msg.h
34
drivers/usb/serial/keyspan_usa28msg.h+1−0
@@ -1,3 +1,4 @@
1+/* SPDX-License-Identifier: BSD-3-Clause */
12 /*
23 usa28msg.h
34
drivers/usb/serial/keyspan_usa49msg.h+1−0
@@ -1,3 +1,4 @@
1+/* SPDX-License-Identifier: BSD-3-Clause */
12 /*
23 usa49msg.h
34
drivers/usb/serial/keyspan_usa67msg.h+1−0
@@ -1,3 +1,4 @@
1+/* SPDX-License-Identifier: BSD-3-Clause */
12 /*
23 usa67msg.h
34
drivers/usb/serial/keyspan_usa90msg.h+1−0
@@ -1,3 +1,4 @@
1+/* SPDX-License-Identifier: BSD-3-Clause */
12 /*
23 usa90msg.h
34
drivers/usb/serial/pl2303.c+1−0
@@ -46,6 +46,7 @@ static const struct usb_device_id id_table[] = { · 45 unmodified lines
4646 { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_HCR331) },
4747 { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_MOTOROLA) },
4848 { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_ZTEK) },
49+ { USB_DEVICE(PL2303_VENDOR_ID, PL2303_PRODUCT_ID_TB) },
4950 { USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID) },
5051 { USB_DEVICE(IODATA_VENDOR_ID, IODATA_PRODUCT_ID_RSAQ5) },
5152 { USB_DEVICE(ATEN_VENDOR_ID, ATEN_PRODUCT_ID),
drivers/usb/serial/pl2303.h+2−0
@@ -8,6 +8,7 @@ · 7 unmodified lines
88
99 #define PL2303_VENDOR_ID 0x067b
1010 #define PL2303_PRODUCT_ID 0x2303
11+#define PL2303_PRODUCT_ID_TB 0x2304
1112 #define PL2303_PRODUCT_ID_RSAQ2 0x04bb
1213 #define PL2303_PRODUCT_ID_DCU11 0x1234
1314 #define PL2303_PRODUCT_ID_PHAROS 0xaaa0
@@ -20,6 +21,7 @@ · 6 unmodified lines
2021 #define PL2303_PRODUCT_ID_MOTOROLA 0x0307
2122 #define PL2303_PRODUCT_ID_ZTEK 0xe1f1
2223
24+
2325 #define ATEN_VENDOR_ID 0x0557
2426 #define ATEN_VENDOR_ID2 0x0547
2527 #define ATEN_PRODUCT_ID 0x2008
drivers/usb/serial/usb-serial-simple.c+2−1
@@ -85,7 +85,8 @@ DEVICE(moto_modem, MOTO_IDS); · 84 unmodified lines
8585 /* Motorola Tetra driver */
8686 #define MOTOROLA_TETRA_IDS() \
8787 { USB_DEVICE(0x0cad, 0x9011) }, /* Motorola Solutions TETRA PEI */ \
88− { USB_DEVICE(0x0cad, 0x9012) } /* MTP6550 */
88+ { USB_DEVICE(0x0cad, 0x9012) }, /* MTP6550 */ \
89+ { USB_DEVICE(0x0cad, 0x9016) } /* TPG2200 */
8990 DEVICE(motorola_tetra, MOTOROLA_TETRA_IDS);
9091
9192 /* Novatel Wireless GPS driver */
drivers/usb/usbip/README+0−7
@@ -1,7 +0,0 @@
1−TODO:
2− - more discussion about the protocol
3− - testing
4− - review of the userspace interface
5− - document the protocol
6−
7−Please send patches for this code to Greg Kroah-Hartman <greg@kroah.com>
drivers/vfio/pci/trace.h+1−5
@@ -1,13 +1,9 @@
1−/* SPDX-License-Identifier: GPL-2.0+ */
1+/* SPDX-License-Identifier: GPL-2.0-only */
22 /*
33 * VFIO PCI mmap/mmap_fault tracepoints
44 *
55 * Copyright (C) 2018 IBM Corp. All rights reserved.
66 * Author: Alexey Kardashevskiy <aik@ozlabs.ru>
7− *
8− * This program is free software; you can redistribute it and/or modify
9− * it under the terms of the GNU General Public License version 2 as
10− * published by the Free Software Foundation.
117 */
128
139 #undef TRACE_SYSTEM
drivers/vfio/pci/vfio_pci_nvlink2.c+16−20
@@ -1,14 +1,10 @@
1−// SPDX-License-Identifier: GPL-2.0+
1+// SPDX-License-Identifier: GPL-2.0-only
22 /*
33 * VFIO PCI NVIDIA Whitherspoon GPU support a.k.a. NVLink2.
44 *
55 * Copyright (C) 2018 IBM Corp. All rights reserved.
66 * Author: Alexey Kardashevskiy <aik@ozlabs.ru>
77 *
8− * This program is free software; you can redistribute it and/or modify
9− * it under the terms of the GNU General Public License version 2 as
10− * published by the Free Software Foundation.
11− *
128 * Register an on-GPU RAM region for cacheable access.
139 *
1410 * Derived from original vfio_pci_igd.c:
@@ -178,11 +174,11 @@ static int vfio_pci_nvgpu_add_capability(struct vfio_pci_device *vdev, · 163 unmodified lines
178174 struct vfio_pci_region *region, struct vfio_info_cap *caps)
179175 {
180176 struct vfio_pci_nvgpu_data *data = region->data;
181− struct vfio_region_info_cap_nvlink2_ssatgt cap = { 0 };
182−
183− cap.header.id = VFIO_REGION_INFO_CAP_NVLINK2_SSATGT;
184− cap.header.version = 1;
185− cap.tgt = data->gpu_tgt;
177+ struct vfio_region_info_cap_nvlink2_ssatgt cap = {
178+ .header.id = VFIO_REGION_INFO_CAP_NVLINK2_SSATGT,
179+ .header.version = 1,
180+ .tgt = data->gpu_tgt
181+ };
186182
187183 return vfio_info_add_capability(caps, &cap.header, sizeof(cap));
188184 }
@@ -365,18 +361,18 @@ static int vfio_pci_npu2_add_capability(struct vfio_pci_device *vdev, · 176 unmodified lines
365361 struct vfio_pci_region *region, struct vfio_info_cap *caps)
366362 {
367363 struct vfio_pci_npu2_data *data = region->data;
368− struct vfio_region_info_cap_nvlink2_ssatgt captgt = { 0 };
369− struct vfio_region_info_cap_nvlink2_lnkspd capspd = { 0 };
364+ struct vfio_region_info_cap_nvlink2_ssatgt captgt = {
365+ .header.id = VFIO_REGION_INFO_CAP_NVLINK2_SSATGT,
366+ .header.version = 1,
367+ .tgt = data->gpu_tgt
368+ };
369+ struct vfio_region_info_cap_nvlink2_lnkspd capspd = {
370+ .header.id = VFIO_REGION_INFO_CAP_NVLINK2_LNKSPD,
371+ .header.version = 1,
372+ .link_speed = data->link_speed
373+ };
370374 int ret;
371375
372− captgt.header.id = VFIO_REGION_INFO_CAP_NVLINK2_SSATGT;
373− captgt.header.version = 1;
374− captgt.tgt = data->gpu_tgt;
375−
376− capspd.header.id = VFIO_REGION_INFO_CAP_NVLINK2_LNKSPD;
377− capspd.header.version = 1;
378− capspd.link_speed = data->link_speed;
379−
380376 ret = vfio_info_add_capability(caps, &captgt.header, sizeof(captgt));
381377 if (ret)
382378 return ret;
drivers/vhost/net.c+4−2
@@ -1236,7 +1236,8 @@ static void handle_rx(struct vhost_net *net) · 1235 unmodified lines
12361236 if (nvq->done_idx > VHOST_NET_BATCH)
12371237 vhost_net_signal_used(nvq);
12381238 if (unlikely(vq_log))
1239− vhost_log_write(vq, vq_log, log, vhost_len);
1239+ vhost_log_write(vq, vq_log, log, vhost_len,
1240+ vq->iov, in);
12401241 total_len += vhost_len;
12411242 if (unlikely(vhost_exceeds_weight(++recv_pkts, total_len))) {
12421243 vhost_poll_queue(&vq->poll);
@@ -1336,7 +1337,8 @@ static int vhost_net_open(struct inode *inode, struct file *f) · 93 unmodified lines
13361337 n->vqs[i].rx_ring = NULL;
13371338 vhost_net_buf_init(&n->vqs[i].rxq);
13381339 }
1339− vhost_dev_init(dev, vqs, VHOST_NET_VQ_MAX);
1340+ vhost_dev_init(dev, vqs, VHOST_NET_VQ_MAX,
1341+ UIO_MAXIOV + VHOST_NET_BATCH);
13401342
13411343 vhost_poll_init(n->poll + VHOST_NET_VQ_TX, handle_tx_net, EPOLLOUT, dev);
13421344 vhost_poll_init(n->poll + VHOST_NET_VQ_RX, handle_rx_net, EPOLLIN, dev);
drivers/vhost/scsi.c+13−9
@@ -1127,16 +1127,18 @@ vhost_scsi_send_tmf_reject(struct vhost_scsi *vs, · 1126 unmodified lines
11271127 struct vhost_virtqueue *vq,
11281128 struct vhost_scsi_ctx *vc)
11291129 {
1130− struct virtio_scsi_ctrl_tmf_resp __user *resp;
11311130 struct virtio_scsi_ctrl_tmf_resp rsp;
1131+ struct iov_iter iov_iter;
11321132 int ret;
11331133
11341134 pr_debug("%s\n", __func__);
11351135 memset(&rsp, 0, sizeof(rsp));
11361136 rsp.response = VIRTIO_SCSI_S_FUNCTION_REJECTED;
1137− resp = vq->iov[vc->out].iov_base;
1138− ret = __copy_to_user(resp, &rsp, sizeof(rsp));
1139− if (!ret)
1137+
1138+ iov_iter_init(&iov_iter, READ, &vq->iov[vc->out], vc->in, sizeof(rsp));
1139+
1140+ ret = copy_to_iter(&rsp, sizeof(rsp), &iov_iter);
1141+ if (likely(ret == sizeof(rsp)))
11401142 vhost_add_used_and_signal(&vs->dev, vq, vc->head, 0);
11411143 else
11421144 pr_err("Faulted on virtio_scsi_ctrl_tmf_resp\n");
@@ -1147,16 +1149,18 @@ vhost_scsi_send_an_resp(struct vhost_scsi *vs, · 4 unmodified lines
11471149 struct vhost_virtqueue *vq,
11481150 struct vhost_scsi_ctx *vc)
11491151 {
1150− struct virtio_scsi_ctrl_an_resp __user *resp;
11511152 struct virtio_scsi_ctrl_an_resp rsp;
1153+ struct iov_iter iov_iter;
11521154 int ret;
11531155
11541156 pr_debug("%s\n", __func__);
11551157 memset(&rsp, 0, sizeof(rsp)); /* event_actual = 0 */
11561158 rsp.response = VIRTIO_SCSI_S_OK;
1157− resp = vq->iov[vc->out].iov_base;
1158− ret = __copy_to_user(resp, &rsp, sizeof(rsp));
1159− if (!ret)
1159+
1160+ iov_iter_init(&iov_iter, READ, &vq->iov[vc->out], vc->in, sizeof(rsp));
1161+
1162+ ret = copy_to_iter(&rsp, sizeof(rsp), &iov_iter);
1163+ if (likely(ret == sizeof(rsp)))
11601164 vhost_add_used_and_signal(&vs->dev, vq, vc->head, 0);
11611165 else
11621166 pr_err("Faulted on virtio_scsi_ctrl_an_resp\n");
@@ -1623,7 +1627,7 @@ static int vhost_scsi_open(struct inode *inode, struct file *f) · 460 unmodified lines
16231627 vqs[i] = &vs->vqs[i].vq;
16241628 vs->vqs[i].vq.handle_kick = vhost_scsi_handle_kick;
16251629 }
1626− vhost_dev_init(&vs->dev, vqs, VHOST_SCSI_MAX_VQ);
1630+ vhost_dev_init(&vs->dev, vqs, VHOST_SCSI_MAX_VQ, UIO_MAXIOV);
16271631
16281632 vhost_scsi_init_inflight(vs, NULL);
16291633
drivers/vhost/vhost.c+93−19
@@ -390,9 +390,9 @@ static long vhost_dev_alloc_iovecs(struct vhost_dev *dev) · 389 unmodified lines
390390 vq->indirect = kmalloc_array(UIO_MAXIOV,
391391 sizeof(*vq->indirect),
392392 GFP_KERNEL);
393− vq->log = kmalloc_array(UIO_MAXIOV, sizeof(*vq->log),
393+ vq->log = kmalloc_array(dev->iov_limit, sizeof(*vq->log),
394394 GFP_KERNEL);
395− vq->heads = kmalloc_array(UIO_MAXIOV, sizeof(*vq->heads),
395+ vq->heads = kmalloc_array(dev->iov_limit, sizeof(*vq->heads),
396396 GFP_KERNEL);
397397 if (!vq->indirect || !vq->log || !vq->heads)
398398 goto err_nomem;
@@ -414,7 +414,7 @@ static void vhost_dev_free_iovecs(struct vhost_dev *dev) · 15 unmodified lines
414414 }
415415
416416 void vhost_dev_init(struct vhost_dev *dev,
417− struct vhost_virtqueue **vqs, int nvqs)
417+ struct vhost_virtqueue **vqs, int nvqs, int iov_limit)
418418 {
419419 struct vhost_virtqueue *vq;
420420 int i;
@@ -427,6 +427,7 @@ void vhost_dev_init(struct vhost_dev *dev, · 6 unmodified lines
427427 dev->iotlb = NULL;
428428 dev->mm = NULL;
429429 dev->worker = NULL;
430+ dev->iov_limit = iov_limit;
430431 init_llist_head(&dev->work_list);
431432 init_waitqueue_head(&dev->wait);
432433 INIT_LIST_HEAD(&dev->read_list);
@@ -1034,8 +1035,10 @@ ssize_t vhost_chr_write_iter(struct vhost_dev *dev, · 601 unmodified lines
10341035 int type, ret;
10351036
10361037 ret = copy_from_iter(&type, sizeof(type), from);
1037− if (ret != sizeof(type))
1038+ if (ret != sizeof(type)) {
1039+ ret = -EINVAL;
10381040 goto done;
1041+ }
10391042
10401043 switch (type) {
10411044 case VHOST_IOTLB_MSG:
@@ -1054,8 +1057,10 @@ ssize_t vhost_chr_write_iter(struct vhost_dev *dev, · 12 unmodified lines
10541057
10551058 iov_iter_advance(from, offset);
10561059 ret = copy_from_iter(&msg, sizeof(msg), from);
1057− if (ret != sizeof(msg))
1060+ if (ret != sizeof(msg)) {
1061+ ret = -EINVAL;
10581062 goto done;
1063+ }
10591064 if (vhost_process_iotlb_msg(dev, &msg)) {
10601065 ret = -EFAULT;
10611066 goto done;
@@ -1733,13 +1738,87 @@ static int log_write(void __user *log_base, · 671 unmodified lines
17331738 return r;
17341739 }
17351740
1741+static int log_write_hva(struct vhost_virtqueue *vq, u64 hva, u64 len)
1742+{
1743+ struct vhost_umem *umem = vq->umem;
1744+ struct vhost_umem_node *u;
1745+ u64 start, end, l, min;
1746+ int r;
1747+ bool hit = false;
1748+
1749+ while (len) {
1750+ min = len;
1751+ /* More than one GPAs can be mapped into a single HVA. So
1752+ * iterate all possible umems here to be safe.
1753+ */
1754+ list_for_each_entry(u, &umem->umem_list, link) {
1755+ if (u->userspace_addr > hva - 1 + len ||
1756+ u->userspace_addr - 1 + u->size < hva)
1757+ continue;
1758+ start = max(u->userspace_addr, hva);
1759+ end = min(u->userspace_addr - 1 + u->size,
1760+ hva - 1 + len);
1761+ l = end - start + 1;
1762+ r = log_write(vq->log_base,
1763+ u->start + start - u->userspace_addr,
1764+ l);
1765+ if (r < 0)
1766+ return r;
1767+ hit = true;
1768+ min = min(l, min);
1769+ }
1770+
1771+ if (!hit)
1772+ return -EFAULT;
1773+
1774+ len -= min;
1775+ hva += min;
1776+ }
1777+
1778+ return 0;
1779+}
1780+
1781+static int log_used(struct vhost_virtqueue *vq, u64 used_offset, u64 len)
1782+{
1783+ struct iovec iov[64];
1784+ int i, ret;
1785+
1786+ if (!vq->iotlb)
1787+ return log_write(vq->log_base, vq->log_addr + used_offset, len);
1788+
1789+ ret = translate_desc(vq, (uintptr_t)vq->used + used_offset,
1790+ len, iov, 64, VHOST_ACCESS_WO);
1791+ if (ret)
1792+ return ret;
1793+
1794+ for (i = 0; i < ret; i++) {
1795+ ret = log_write_hva(vq, (uintptr_t)iov[i].iov_base,
1796+ iov[i].iov_len);
1797+ if (ret)
1798+ return ret;
1799+ }
1800+
1801+ return 0;
1802+}
1803+
17361804 int vhost_log_write(struct vhost_virtqueue *vq, struct vhost_log *log,
1737− unsigned int log_num, u64 len)
1805+ unsigned int log_num, u64 len, struct iovec *iov, int count)
17381806 {
17391807 int i, r;
17401808
17411809 /* Make sure data written is seen before log. */
17421810 smp_wmb();
1811+
1812+ if (vq->iotlb) {
1813+ for (i = 0; i < count; i++) {
1814+ r = log_write_hva(vq, (uintptr_t)iov[i].iov_base,
1815+ iov[i].iov_len);
1816+ if (r < 0)
1817+ return r;
1818+ }
1819+ return 0;
1820+ }
1821+
17431822 for (i = 0; i < log_num; ++i) {
17441823 u64 l = min(log[i].len, len);
17451824 r = log_write(vq->log_base, log[i].addr, l);
@@ -1769,9 +1848,8 @@ static int vhost_update_used_flags(struct vhost_virtqueue *vq) · 23 unmodified lines
17691848 smp_wmb();
17701849 /* Log used flag write. */
17711850 used = &vq->used->flags;
1772− log_write(vq->log_base, vq->log_addr +
1773− (used - (void __user *)vq->used),
1774− sizeof vq->used->flags);
1851+ log_used(vq, (used - (void __user *)vq->used),
1852+ sizeof vq->used->flags);
17751853 if (vq->log_ctx)
17761854 eventfd_signal(vq->log_ctx, 1);
17771855 }
@@ -1789,9 +1867,8 @@ static int vhost_update_avail_event(struct vhost_virtqueue *vq, u16 avail_event) · 11 unmodified lines
17891867 smp_wmb();
17901868 /* Log avail event write */
17911869 used = vhost_avail_event(vq);
1792− log_write(vq->log_base, vq->log_addr +
1793− (used - (void __user *)vq->used),
1794− sizeof *vhost_avail_event(vq));
1870+ log_used(vq, (used - (void __user *)vq->used),
1871+ sizeof *vhost_avail_event(vq));
17951872 if (vq->log_ctx)
17961873 eventfd_signal(vq->log_ctx, 1);
17971874 }
@@ -2191,10 +2268,8 @@ static int __vhost_add_used_n(struct vhost_virtqueue *vq, · 393 unmodified lines
21912268 /* Make sure data is seen before log. */
21922269 smp_wmb();
21932270 /* Log used ring entry write. */
2194− log_write(vq->log_base,
2195− vq->log_addr +
2196− ((void __user *)used - (void __user *)vq->used),
2197− count * sizeof *used);
2271+ log_used(vq, ((void __user *)used - (void __user *)vq->used),
2272+ count * sizeof *used);
21982273 }
21992274 old = vq->last_used_idx;
22002275 new = (vq->last_used_idx += count);
@@ -2236,9 +2311,8 @@ int vhost_add_used_n(struct vhost_virtqueue *vq, struct vring_used_elem *heads, · 35 unmodified lines
22362311 /* Make sure used idx is seen before log. */
22372312 smp_wmb();
22382313 /* Log used index update. */
2239− log_write(vq->log_base,
2240− vq->log_addr + offsetof(struct vring_used, idx),
2241− sizeof vq->used->idx);
2314+ log_used(vq, offsetof(struct vring_used, idx),
2315+ sizeof vq->used->idx);
22422316 if (vq->log_ctx)
22432317 eventfd_signal(vq->log_ctx, 1);
22442318 }
drivers/vhost/vhost.h+5−2
@@ -170,9 +170,11 @@ struct vhost_dev { · 169 unmodified lines
170170 struct list_head read_list;
171171 struct list_head pending_list;
172172 wait_queue_head_t wait;
173+ int iov_limit;
173174 };
174175
175−void vhost_dev_init(struct vhost_dev *, struct vhost_virtqueue **vqs, int nvqs);
176+void vhost_dev_init(struct vhost_dev *, struct vhost_virtqueue **vqs,
177+ int nvqs, int iov_limit);
176178 long vhost_dev_set_owner(struct vhost_dev *dev);
177179 bool vhost_dev_has_owner(struct vhost_dev *dev);
178180 long vhost_dev_check_owner(struct vhost_dev *);
@@ -205,7 +207,8 @@ bool vhost_vq_avail_empty(struct vhost_dev *, struct vhost_virtqueue *); · 26 unmodified lines
205207 bool vhost_enable_notify(struct vhost_dev *, struct vhost_virtqueue *);
206208
207209 int vhost_log_write(struct vhost_virtqueue *vq, struct vhost_log *log,
208− unsigned int log_num, u64 len);
210+ unsigned int log_num, u64 len,
211+ struct iovec *iov, int count);
209212 int vq_iotlb_prefetch(struct vhost_virtqueue *vq);
210213
211214 struct vhost_msg_node *vhost_new_msg(struct vhost_virtqueue *vq, int type);
drivers/vhost/vsock.c+2−2
@@ -531,7 +531,7 @@ static int vhost_vsock_dev_open(struct inode *inode, struct file *file) · 530 unmodified lines
531531 vsock->vqs[VSOCK_VQ_TX].handle_kick = vhost_vsock_handle_tx_kick;
532532 vsock->vqs[VSOCK_VQ_RX].handle_kick = vhost_vsock_handle_rx_kick;
533533
534− vhost_dev_init(&vsock->dev, vqs, ARRAY_SIZE(vsock->vqs));
534+ vhost_dev_init(&vsock->dev, vqs, ARRAY_SIZE(vsock->vqs), UIO_MAXIOV);
535535
536536 file->private_data = vsock;
537537 spin_lock_init(&vsock->send_pkt_list_lock);
@@ -642,7 +642,7 @@ static int vhost_vsock_set_cid(struct vhost_vsock *vsock, u64 guest_cid) · 104 unmodified lines
642642 hash_del_rcu(&vsock->hash);
643643
644644 vsock->guest_cid = guest_cid;
645− hash_add_rcu(vhost_vsock_hash, &vsock->hash, guest_cid);
645+ hash_add_rcu(vhost_vsock_hash, &vsock->hash, vsock->guest_cid);
646646 mutex_unlock(&vhost_vsock_mutex);
647647
648648 return 0;
drivers/video/backlight/88pm860x_bl.c+1−1
@@ -174,7 +174,7 @@ static int pm860x_backlight_dt_init(struct platform_device *pdev, · 173 unmodified lines
174174 return -ENODEV;
175175 }
176176 for_each_child_of_node(nproot, np) {
177− if (!of_node_cmp(np->name, name)) {
177+ if (of_node_name_eq(np, name)) {
178178 of_property_read_u32(np, "marvell,88pm860x-iset",
179179 &iset);
180180 data->iset = PM8606_WLED_CURRENT(iset);
drivers/video/backlight/pwm_bl.c+17−11
@@ -30,6 +30,7 @@ struct pwm_bl_data { · 29 unmodified lines
3030 struct device *dev;
3131 unsigned int lth_brightness;
3232 unsigned int *levels;
33+ bool enabled;
3334 struct regulator *power_supply;
3435 struct gpio_desc *enable_gpio;
3536 unsigned int scale;
@@ -50,7 +51,7 @@ static void pwm_backlight_power_on(struct pwm_bl_data *pb) · 14 unmodified lines
5051 int err;
5152
5253 pwm_get_state(pb->pwm, &state);
53− if (state.enabled)
54+ if (pb->enabled)
5455 return;
5556
5657 err = regulator_enable(pb->power_supply);
@@ -65,6 +66,8 @@ static void pwm_backlight_power_on(struct pwm_bl_data *pb) · 8 unmodified lines
6566
6667 if (pb->enable_gpio)
6768 gpiod_set_value_cansleep(pb->enable_gpio, 1);
69+
70+ pb->enabled = true;
6871 }
6972
7073 static void pwm_backlight_power_off(struct pwm_bl_data *pb)
@@ -72,7 +75,7 @@ static void pwm_backlight_power_off(struct pwm_bl_data *pb) · 1 unmodified line
7275 struct pwm_state state;
7376
7477 pwm_get_state(pb->pwm, &state);
75− if (!state.enabled)
78+ if (!pb->enabled)
7679 return;
7780
7881 if (pb->enable_gpio)
@@ -86,6 +89,7 @@ static void pwm_backlight_power_off(struct pwm_bl_data *pb) · 7 unmodified lines
8689 pwm_apply_state(pb->pwm, &state);
8790
8891 regulator_disable(pb->power_supply);
92+ pb->enabled = false;
8993 }
9094
9195 static int compute_duty_cycle(struct pwm_bl_data *pb, int brightness)
@@ -268,6 +272,16 @@ static int pwm_backlight_parse_dt(struct device *dev, · 176 unmodified lines
268272
269273 memset(data, 0, sizeof(*data));
270274
275+ /*
276+ * These values are optional and set as 0 by default, the out values
277+ * are modified only if a valid u32 value can be decoded.
278+ */
279+ of_property_read_u32(node, "post-pwm-on-delay-ms",
280+ &data->post_pwm_on_delay);
281+ of_property_read_u32(node, "pwm-off-delay-ms", &data->pwm_off_delay);
282+
283+ data->enable_gpio = -EINVAL;
284+
271285 /*
272286 * Determine the number of brightness levels, if this property is not
273287 * set a default table of brightness levels will be used.
@@ -380,15 +394,6 @@ static int pwm_backlight_parse_dt(struct device *dev, · 106 unmodified lines
380394 data->max_brightness--;
381395 }
382396
383− /*
384− * These values are optional and set as 0 by default, the out values
385− * are modified only if a valid u32 value can be decoded.
386− */
387− of_property_read_u32(node, "post-pwm-on-delay-ms",
388− &data->post_pwm_on_delay);
389− of_property_read_u32(node, "pwm-off-delay-ms", &data->pwm_off_delay);
390−
391− data->enable_gpio = -EINVAL;
392397 return 0;
393398 }
394399
@@ -483,6 +488,7 @@ static int pwm_backlight_probe(struct platform_device *pdev) · 88 unmodified lines
483488 pb->check_fb = data->check_fb;
484489 pb->exit = data->exit;
485490 pb->dev = &pdev->dev;
491+ pb->enabled = false;
486492 pb->post_pwm_on_delay = data->post_pwm_on_delay;
487493 pb->pwm_off_delay = data->pwm_off_delay;
488494
drivers/video/console/vgacon.c+4−3
@@ -271,6 +271,7 @@ static void vgacon_scrollback_update(struct vc_data *c, int t, int count) · 270 unmodified lines
271271
272272 static void vgacon_restore_screen(struct vc_data *c)
273273 {
274+ c->vc_origin = c->vc_visible_origin;
274275 vgacon_scrollback_cur->save = 0;
275276
276277 if (!vga_is_gfx && !vgacon_scrollback_cur->restore) {
@@ -287,8 +288,7 @@ static void vgacon_scrolldelta(struct vc_data *c, int lines) · 10 unmodified lines
287288 int start, end, count, soff;
288289
289290 if (!lines) {
290− c->vc_visible_origin = c->vc_origin;
291− vga_set_mem_top(c);
291+ vgacon_restore_screen(c);
292292 return;
293293 }
294294
@@ -298,6 +298,7 @@ static void vgacon_scrolldelta(struct vc_data *c, int lines) · 3 unmodified lines
298298 if (!vgacon_scrollback_cur->save) {
299299 vgacon_cursor(c, CM_ERASE);
300300 vgacon_save_screen(c);
301+ c->vc_origin = (unsigned long)c->vc_screenbuf;
301302 vgacon_scrollback_cur->save = 1;
302303 }
303304
@@ -335,7 +336,7 @@ static void vgacon_scrolldelta(struct vc_data *c, int lines) · 31 unmodified lines
335336 int copysize;
336337
337338 int diff = c->vc_rows - count;
338− void *d = (void *) c->vc_origin;
339+ void *d = (void *) c->vc_visible_origin;
339340 void *s = (void *) c->vc_screenbuf;
340341
341342 count *= c->vc_size_row;
drivers/video/fbdev/core/fbcon.c+7−0
@@ -510,6 +510,13 @@ static int __init fb_console_setup(char *this_opt) · 509 unmodified lines
510510 continue;
511511 }
512512 #endif
513+
514+ if (!strncmp(options, "logo-pos:", 9)) {
515+ options += 9;
516+ if (!strcmp(options, "center"))
517+ fb_center_logo = true;
518+ continue;
519+ }
513520 }
514521 return 1;
515522 }
drivers/video/fbdev/core/fbmem.c+10−9
@@ -53,6 +53,9 @@ EXPORT_SYMBOL(registered_fb); · 52 unmodified lines
5353 int num_registered_fb __read_mostly;
5454 EXPORT_SYMBOL(num_registered_fb);
5555
56+bool fb_center_logo __read_mostly;
57+EXPORT_SYMBOL(fb_center_logo);
58+
5659 static struct fb_info *get_fb_info(unsigned int idx)
5760 {
5861 struct fb_info *fb_info;
@@ -506,8 +509,7 @@ static int fb_show_logo_line(struct fb_info *info, int rotate, · 447 unmodified lines
506509 fb_set_logo(info, logo, logo_new, fb_logo.depth);
507510 }
508511
509−#ifdef CONFIG_FB_LOGO_CENTER
510− {
512+ if (fb_center_logo) {
511513 int xres = info->var.xres;
512514 int yres = info->var.yres;
513515
@@ -520,11 +522,11 @@ static int fb_show_logo_line(struct fb_info *info, int rotate, · 6 unmodified lines
520522 --n;
521523 image.dx = (xres - n * (logo->width + 8) - 8) / 2;
522524 image.dy = y ?: (yres - logo->height) / 2;
525+ } else {
526+ image.dx = 0;
527+ image.dy = y;
523528 }
524−#else
525− image.dx = 0;
526− image.dy = y;
527−#endif
529+
528530 image.width = logo->width;
529531 image.height = logo->height;
530532
@@ -684,9 +686,8 @@ int fb_prepare_logo(struct fb_info *info, int rotate) · 153 unmodified lines
684686 }
685687
686688 height = fb_logo.logo->height;
687−#ifdef CONFIG_FB_LOGO_CENTER
688− height += (yres - fb_logo.logo->height) / 2;
689−#endif
689+ if (fb_center_logo)
690+ height += (yres - fb_logo.logo->height) / 2;
690691
691692 return fb_prepare_extra_logos(info, height, yres);
692693 }
drivers/video/fbdev/offb.c+9−9
@@ -318,28 +318,28 @@ static void __iomem *offb_map_reg(struct device_node *np, int index, · 317 unmodified lines
318318 }
319319
320320 static void offb_init_palette_hacks(struct fb_info *info, struct device_node *dp,
321− const char *name, unsigned long address)
321+ unsigned long address)
322322 {
323323 struct offb_par *par = (struct offb_par *) info->par;
324324
325− if (dp && !strncmp(name, "ATY,Rage128", 11)) {
325+ if (of_node_name_prefix(dp, "ATY,Rage128")) {
326326 par->cmap_adr = offb_map_reg(dp, 2, 0, 0x1fff);
327327 if (par->cmap_adr)
328328 par->cmap_type = cmap_r128;
329− } else if (dp && (!strncmp(name, "ATY,RageM3pA", 12)
330− || !strncmp(name, "ATY,RageM3p12A", 14))) {
329+ } else if (of_node_name_prefix(dp, "ATY,RageM3pA") ||
330+ of_node_name_prefix(dp, "ATY,RageM3p12A")) {
331331 par->cmap_adr = offb_map_reg(dp, 2, 0, 0x1fff);
332332 if (par->cmap_adr)
333333 par->cmap_type = cmap_M3A;
334− } else if (dp && !strncmp(name, "ATY,RageM3pB", 12)) {
334+ } else if (of_node_name_prefix(dp, "ATY,RageM3pB")) {
335335 par->cmap_adr = offb_map_reg(dp, 2, 0, 0x1fff);
336336 if (par->cmap_adr)
337337 par->cmap_type = cmap_M3B;
338− } else if (dp && !strncmp(name, "ATY,Rage6", 9)) {
338+ } else if (of_node_name_prefix(dp, "ATY,Rage6")) {
339339 par->cmap_adr = offb_map_reg(dp, 1, 0, 0x1fff);
340340 if (par->cmap_adr)
341341 par->cmap_type = cmap_radeon;
342− } else if (!strncmp(name, "ATY,", 4)) {
342+ } else if (of_node_name_prefix(dp, "ATY,")) {
343343 unsigned long base = address & 0xff000000UL;
344344 par->cmap_adr =
345345 ioremap(base + 0x7ff000, 0x1000) + 0xcc0;
@@ -350,7 +350,7 @@ static void offb_init_palette_hacks(struct fb_info *info, struct device_node *dp · 4 unmodified lines
350350 par->cmap_adr = offb_map_reg(dp, 0, 0x6000, 0x1000);
351351 if (par->cmap_adr)
352352 par->cmap_type = cmap_gxt2000;
353− } else if (dp && !strncmp(name, "vga,Display-", 12)) {
353+ } else if (of_node_name_prefix(dp, "vga,Display-")) {
354354 /* Look for AVIVO initialized by SLOF */
355355 struct device_node *pciparent = of_get_parent(dp);
356356 const u32 *vid, *did;
@@ -438,7 +438,7 @@ static void __init offb_init_fb(const char *name, · 81 unmodified lines
438438
439439 par->cmap_type = cmap_unknown;
440440 if (depth == 8)
441− offb_init_palette_hacks(info, dp, name, address);
441+ offb_init_palette_hacks(info, dp, address);
442442 else
443443 fix->visual = FB_VISUAL_TRUECOLOR;
444444
drivers/video/fbdev/omap2/omapfb/omapfb-ioctl.c+2−0
@@ -609,6 +609,8 @@ int omapfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg) · 608 unmodified lines
609609
610610 int r = 0;
611611
612+ memset(&p, 0, sizeof(p));
613+
612614 switch (cmd) {
613615 case OMAPFB_SYNC_GFX:
614616 DBG("ioctl SYNC_GFX\n");
drivers/video/logo/Kconfig+0−9
@@ -10,15 +10,6 @@ menuconfig LOGO · 9 unmodified lines
1010
1111 if LOGO
1212
13−config FB_LOGO_CENTER
14− bool "Center the logo"
15− depends on FB=y
16− help
17− When this option is selected, the bootup logo is centered both
18− horizontally and vertically. If more than one logo is displayed
19− due to multiple CPUs, the collected line of logos is centered
20− as a whole.
21−
2213 config FB_LOGO_EXTRA
2314 bool
2415 depends on FB=y
drivers/virtio/virtio_balloon.c+65−33
@@ -61,6 +61,10 @@ enum virtio_balloon_vq { · 60 unmodified lines
6161 VIRTIO_BALLOON_VQ_MAX
6262 };
6363
64+enum virtio_balloon_config_read {
65+ VIRTIO_BALLOON_CONFIG_READ_CMD_ID = 0,
66+};
67+
6468 struct virtio_balloon {
6569 struct virtio_device *vdev;
6670 struct virtqueue *inflate_vq, *deflate_vq, *stats_vq, *free_page_vq;
@@ -77,14 +81,20 @@ struct virtio_balloon { · 10 unmodified lines
7781 /* Prevent updating balloon when it is being canceled. */
7882 spinlock_t stop_update_lock;
7983 bool stop_update;
84+ /* Bitmap to indicate if reading the related config fields are needed */
85+ unsigned long config_read_bitmap;
8086
8187 /* The list of allocated free pages, waiting to be given back to mm */
8288 struct list_head free_page_list;
8389 spinlock_t free_page_list_lock;
8490 /* The number of free page blocks on the above list */
8591 unsigned long num_free_page_blocks;
86− /* The cmd id received from host */
87− u32 cmd_id_received;
92+ /*
93+ * The cmd id received from host.
94+ * Read it via virtio_balloon_cmd_id_received to get the latest value
95+ * sent from host.
96+ */
97+ u32 cmd_id_received_cache;
8898 /* The cmd id that is actively in use */
8999 __virtio32 cmd_id_active;
90100 /* Buffer to store the stop sign */
@@ -390,37 +400,31 @@ static unsigned long return_free_pages_to_mm(struct virtio_balloon *vb, · 299 unmodified lines
390400 return num_returned;
391401 }
392402
403+static void virtio_balloon_queue_free_page_work(struct virtio_balloon *vb)
404+{
405+ if (!virtio_has_feature(vb->vdev, VIRTIO_BALLOON_F_FREE_PAGE_HINT))
406+ return;
407+
408+ /* No need to queue the work if the bit was already set. */
409+ if (test_and_set_bit(VIRTIO_BALLOON_CONFIG_READ_CMD_ID,
410+ &vb->config_read_bitmap))
411+ return;
412+
413+ queue_work(vb->balloon_wq, &vb->report_free_page_work);
414+}
415+
393416 static void virtballoon_changed(struct virtio_device *vdev)
394417 {
395418 struct virtio_balloon *vb = vdev->priv;
396419 unsigned long flags;
397− s64 diff = towards_target(vb);
398−
399− if (diff) {
400− spin_lock_irqsave(&vb->stop_update_lock, flags);
401− if (!vb->stop_update)
402− queue_work(system_freezable_wq,
403− &vb->update_balloon_size_work);
404− spin_unlock_irqrestore(&vb->stop_update_lock, flags);
405− }
406420
407− if (virtio_has_feature(vdev, VIRTIO_BALLOON_F_FREE_PAGE_HINT)) {
408− virtio_cread(vdev, struct virtio_balloon_config,
409− free_page_report_cmd_id, &vb->cmd_id_received);
410− if (vb->cmd_id_received == VIRTIO_BALLOON_CMD_ID_DONE) {
411− /* Pass ULONG_MAX to give back all the free pages */
412− return_free_pages_to_mm(vb, ULONG_MAX);
413− } else if (vb->cmd_id_received != VIRTIO_BALLOON_CMD_ID_STOP &&
414− vb->cmd_id_received !=
415− virtio32_to_cpu(vdev, vb->cmd_id_active)) {
416− spin_lock_irqsave(&vb->stop_update_lock, flags);
417− if (!vb->stop_update) {
418− queue_work(vb->balloon_wq,
419− &vb->report_free_page_work);
420− }
421− spin_unlock_irqrestore(&vb->stop_update_lock, flags);
422− }
421+ spin_lock_irqsave(&vb->stop_update_lock, flags);
422+ if (!vb->stop_update) {
423+ queue_work(system_freezable_wq,
424+ &vb->update_balloon_size_work);
425+ virtio_balloon_queue_free_page_work(vb);
423426 }
427+ spin_unlock_irqrestore(&vb->stop_update_lock, flags);
424428 }
425429
426430 static void update_balloon_size(struct virtio_balloon *vb)
@@ -527,6 +531,17 @@ static int init_vqs(struct virtio_balloon *vb) · 100 unmodified lines
527531 return 0;
528532 }
529533
534+static u32 virtio_balloon_cmd_id_received(struct virtio_balloon *vb)
535+{
536+ if (test_and_clear_bit(VIRTIO_BALLOON_CONFIG_READ_CMD_ID,
537+ &vb->config_read_bitmap))
538+ virtio_cread(vb->vdev, struct virtio_balloon_config,
539+ free_page_report_cmd_id,
540+ &vb->cmd_id_received_cache);
541+
542+ return vb->cmd_id_received_cache;
543+}
544+
530545 static int send_cmd_id_start(struct virtio_balloon *vb)
531546 {
532547 struct scatterlist sg;
@@ -537,7 +552,8 @@ static int send_cmd_id_start(struct virtio_balloon *vb) · 4 unmodified lines
537552 while (virtqueue_get_buf(vq, &unused))
538553 ;
539554
540− vb->cmd_id_active = cpu_to_virtio32(vb->vdev, vb->cmd_id_received);
555+ vb->cmd_id_active = virtio32_to_cpu(vb->vdev,
556+ virtio_balloon_cmd_id_received(vb));
541557 sg_init_one(&sg, &vb->cmd_id_active, sizeof(vb->cmd_id_active));
542558 err = virtqueue_add_outbuf(vq, &sg, 1, &vb->cmd_id_active, GFP_KERNEL);
543559 if (!err)
@@ -620,7 +636,8 @@ static int send_free_pages(struct virtio_balloon *vb) · 76 unmodified lines
620636 * stop the reporting.
621637 */
622638 cmd_id_active = virtio32_to_cpu(vb->vdev, vb->cmd_id_active);
623− if (cmd_id_active != vb->cmd_id_received)
639+ if (unlikely(cmd_id_active !=
640+ virtio_balloon_cmd_id_received(vb)))
624641 break;
625642
626643 /*
@@ -637,11 +654,9 @@ static int send_free_pages(struct virtio_balloon *vb) · 10 unmodified lines
637654 return 0;
638655 }
639656
640−static void report_free_page_func(struct work_struct *work)
657+static void virtio_balloon_report_free_page(struct virtio_balloon *vb)
641658 {
642659 int err;
643− struct virtio_balloon *vb = container_of(work, struct virtio_balloon,
644− report_free_page_work);
645660 struct device *dev = &vb->vdev->dev;
646661
647662 /* Start by sending the received cmd id to host with an outbuf. */
@@ -659,6 +674,23 @@ static void report_free_page_func(struct work_struct *work) · 11 unmodified lines
659674 dev_err(dev, "Failed to send a stop id, err = %d\n", err);
660675 }
661676
677+static void report_free_page_func(struct work_struct *work)
678+{
679+ struct virtio_balloon *vb = container_of(work, struct virtio_balloon,
680+ report_free_page_work);
681+ u32 cmd_id_received;
682+
683+ cmd_id_received = virtio_balloon_cmd_id_received(vb);
684+ if (cmd_id_received == VIRTIO_BALLOON_CMD_ID_DONE) {
685+ /* Pass ULONG_MAX to give back all the free pages */
686+ return_free_pages_to_mm(vb, ULONG_MAX);
687+ } else if (cmd_id_received != VIRTIO_BALLOON_CMD_ID_STOP &&
688+ cmd_id_received !=
689+ virtio32_to_cpu(vb->vdev, vb->cmd_id_active)) {
690+ virtio_balloon_report_free_page(vb);
691+ }
692+}
693+
662694 #ifdef CONFIG_BALLOON_COMPACTION
663695 /*
664696 * virtballoon_migratepage - perform the balloon page migration on behalf of
@@ -885,7 +917,7 @@ static int virtballoon_probe(struct virtio_device *vdev) · 220 unmodified lines
885917 goto out_del_vqs;
886918 }
887919 INIT_WORK(&vb->report_free_page_work, report_free_page_func);
888− vb->cmd_id_received = VIRTIO_BALLOON_CMD_ID_STOP;
920+ vb->cmd_id_received_cache = VIRTIO_BALLOON_CMD_ID_STOP;
889921 vb->cmd_id_active = cpu_to_virtio32(vb->vdev,
890922 VIRTIO_BALLOON_CMD_ID_STOP);
891923 vb->cmd_id_stop = cpu_to_virtio32(vb->vdev,
drivers/virtio/virtio_mmio.c+7−2
@@ -468,7 +468,7 @@ static int vm_find_vqs(struct virtio_device *vdev, unsigned nvqs, · 467 unmodified lines
468468 {
469469 struct virtio_mmio_device *vm_dev = to_virtio_mmio_device(vdev);
470470 unsigned int irq = platform_get_irq(vm_dev->pdev, 0);
471− int i, err;
471+ int i, err, queue_idx = 0;
472472
473473 err = request_irq(irq, vm_interrupt, IRQF_SHARED,
474474 dev_name(&vdev->dev), vm_dev);
@@ -476,7 +476,12 @@ static int vm_find_vqs(struct virtio_device *vdev, unsigned nvqs, · 1 unmodified line
476476 return err;
477477
478478 for (i = 0; i < nvqs; ++i) {
479− vqs[i] = vm_setup_vq(vdev, i, callbacks[i], names[i],
479+ if (!names[i]) {
480+ vqs[i] = NULL;
481+ continue;
482+ }
483+
484+ vqs[i] = vm_setup_vq(vdev, queue_idx++, callbacks[i], names[i],
480485 ctx ? ctx[i] : false);
481486 if (IS_ERR(vqs[i])) {
482487 vm_del_vqs(vdev);
drivers/virtio/virtio_pci_common.c+4−4
@@ -285,7 +285,7 @@ static int vp_find_vqs_msix(struct virtio_device *vdev, unsigned nvqs, · 284 unmodified lines
285285 {
286286 struct virtio_pci_device *vp_dev = to_vp_device(vdev);
287287 u16 msix_vec;
288− int i, err, nvectors, allocated_vectors;
288+ int i, err, nvectors, allocated_vectors, queue_idx = 0;
289289
290290 vp_dev->vqs = kcalloc(nvqs, sizeof(*vp_dev->vqs), GFP_KERNEL);
291291 if (!vp_dev->vqs)
@@ -321,7 +321,7 @@ static int vp_find_vqs_msix(struct virtio_device *vdev, unsigned nvqs, · 29 unmodified lines
321321 msix_vec = allocated_vectors++;
322322 else
323323 msix_vec = VP_MSIX_VQ_VECTOR;
324− vqs[i] = vp_setup_vq(vdev, i, callbacks[i], names[i],
324+ vqs[i] = vp_setup_vq(vdev, queue_idx++, callbacks[i], names[i],
325325 ctx ? ctx[i] : false,
326326 msix_vec);
327327 if (IS_ERR(vqs[i])) {
@@ -356,7 +356,7 @@ static int vp_find_vqs_intx(struct virtio_device *vdev, unsigned nvqs, · 28 unmodified lines
356356 const char * const names[], const bool *ctx)
357357 {
358358 struct virtio_pci_device *vp_dev = to_vp_device(vdev);
359− int i, err;
359+ int i, err, queue_idx = 0;
360360
361361 vp_dev->vqs = kcalloc(nvqs, sizeof(*vp_dev->vqs), GFP_KERNEL);
362362 if (!vp_dev->vqs)
@@ -374,7 +374,7 @@ static int vp_find_vqs_intx(struct virtio_device *vdev, unsigned nvqs, · 11 unmodified lines
374374 vqs[i] = NULL;
375375 continue;
376376 }
377− vqs[i] = vp_setup_vq(vdev, i, callbacks[i], names[i],
377+ vqs[i] = vp_setup_vq(vdev, queue_idx++, callbacks[i], names[i],
378378 ctx ? ctx[i] : false,
379379 VIRTIO_MSI_NO_VECTOR);
380380 if (IS_ERR(vqs[i])) {
drivers/virtio/virtio_ring.c+14−1
@@ -152,7 +152,12 @@ struct vring_virtqueue { · 151 unmodified lines
152152 /* Available for packed ring */
153153 struct {
154154 /* Actual memory layout for this queue. */
155− struct vring_packed vring;
155+ struct {
156+ unsigned int num;
157+ struct vring_packed_desc *desc;
158+ struct vring_packed_desc_event *driver;
159+ struct vring_packed_desc_event *device;
160+ } vring;
156161
157162 /* Driver ring wrap counter. */
158163 bool avail_wrap_counter;
@@ -1609,6 +1614,9 @@ static struct virtqueue *vring_create_virtqueue_packed( · 1450 unmodified lines
16091614 !context;
16101615 vq->event = virtio_has_feature(vdev, VIRTIO_RING_F_EVENT_IDX);
16111616
1617+ if (virtio_has_feature(vdev, VIRTIO_F_ORDER_PLATFORM))
1618+ vq->weak_barriers = false;
1619+
16121620 vq->packed.ring_dma_addr = ring_dma_addr;
16131621 vq->packed.driver_event_dma_addr = driver_event_dma_addr;
16141622 vq->packed.device_event_dma_addr = device_event_dma_addr;
@@ -2079,6 +2087,9 @@ struct virtqueue *__vring_new_virtqueue(unsigned int index, · 464 unmodified lines
20792087 !context;
20802088 vq->event = virtio_has_feature(vdev, VIRTIO_RING_F_EVENT_IDX);
20812089
2090+ if (virtio_has_feature(vdev, VIRTIO_F_ORDER_PLATFORM))
2091+ vq->weak_barriers = false;
2092+
20822093 vq->split.queue_dma_addr = 0;
20832094 vq->split.queue_size_in_bytes = 0;
20842095
@@ -2213,6 +2224,8 @@ void vring_transport_features(struct virtio_device *vdev) · 128 unmodified lines
22132224 break;
22142225 case VIRTIO_F_RING_PACKED:
22152226 break;
2227+ case VIRTIO_F_ORDER_PLATFORM:
2228+ break;
22162229 default:
22172230 /* We don't understand this bit. */
22182231 __virtio_clear_bit(vdev, i);
drivers/watchdog/mt7621_wdt.c+1−0
@@ -17,6 +17,7 @@ · 16 unmodified lines
1717 #include <linux/watchdog.h>
1818 #include <linux/moduleparam.h>
1919 #include <linux/platform_device.h>
20+#include <linux/mod_devicetable.h>
2021
2122 #include <asm/mach-ralink/ralink_regs.h>
2223
drivers/watchdog/rt2880_wdt.c+1−0
@@ -18,6 +18,7 @@ · 17 unmodified lines
1818 #include <linux/watchdog.h>
1919 #include <linux/moduleparam.h>
2020 #include <linux/platform_device.h>
21+#include <linux/mod_devicetable.h>
2122
2223 #include <asm/mach-ralink/ralink_regs.h>
2324
drivers/watchdog/tqmx86_wdt.c+4−4
@@ -79,13 +79,13 @@ static int tqmx86_wdt_probe(struct platform_device *pdev) · 78 unmodified lines
7979 return -ENOMEM;
8080
8181 res = platform_get_resource(pdev, IORESOURCE_IO, 0);
82− if (IS_ERR(res))
83− return PTR_ERR(res);
82+ if (!res)
83+ return -ENODEV;
8484
8585 priv->io_base = devm_ioport_map(&pdev->dev, res->start,
8686 resource_size(res));
87− if (IS_ERR(priv->io_base))
88− return PTR_ERR(priv->io_base);
87+ if (!priv->io_base)
88+ return -ENOMEM;
8989
9090 watchdog_set_drvdata(&priv->wdd, priv);
9191
drivers/xen/events/events_base.c+1−1
@@ -1650,7 +1650,7 @@ void xen_callback_vector(void) · 1649 unmodified lines
16501650 xen_have_vector_callback = 0;
16511651 return;
16521652 }
1653− pr_info("Xen HVM callback vector for event delivery is enabled\n");
1653+ pr_info_once("Xen HVM callback vector for event delivery is enabled\n");
16541654 alloc_intr_gate(HYPERVISOR_CALLBACK_VECTOR,
16551655 xen_hvm_callback_vector);
16561656 }
drivers/xen/pvcalls-back.c+4−5
@@ -160,9 +160,10 @@ static void pvcalls_conn_back_read(void *opaque) · 159 unmodified lines
160160
161161 /* write the data, then modify the indexes */
162162 virt_wmb();
163− if (ret < 0)
163+ if (ret < 0) {
164+ atomic_set(&map->read, 0);
164165 intf->in_error = ret;
165− else
166+ } else
166167 intf->in_prod = prod + ret;
167168 /* update the indexes, then notify the other end */
168169 virt_wmb();
@@ -282,13 +283,11 @@ static int pvcalls_back_socket(struct xenbus_device *dev, · 113 unmodified lines
282283 static void pvcalls_sk_state_change(struct sock *sock)
283284 {
284285 struct sock_mapping *map = sock->sk_user_data;
285− struct pvcalls_data_intf *intf;
286286
287287 if (map == NULL)
288288 return;
289289
290− intf = map->ring;
291− intf->in_error = -ENOTCONN;
290+ atomic_inc(&map->read);
292291 notify_remote_via_irq(map->irq);
293292 }
294293
drivers/xen/pvcalls-front.c+75−29
@@ -31,6 +31,12 @@ · 30 unmodified lines
3131 #define PVCALLS_NR_RSP_PER_RING __CONST_RING_SIZE(xen_pvcalls, XEN_PAGE_SIZE)
3232 #define PVCALLS_FRONT_MAX_SPIN 5000
3333
34+static struct proto pvcalls_proto = {
35+ .name = "PVCalls",
36+ .owner = THIS_MODULE,
37+ .obj_size = sizeof(struct sock),
38+};
39+
3440 struct pvcalls_bedata {
3541 struct xen_pvcalls_front_ring ring;
3642 grant_ref_t ref;
@@ -335,6 +341,42 @@ int pvcalls_front_socket(struct socket *sock) · 298 unmodified lines
335341 return ret;
336342 }
337343
344+static void free_active_ring(struct sock_mapping *map)
345+{
346+ if (!map->active.ring)
347+ return;
348+
349+ free_pages((unsigned long)map->active.data.in,
350+ map->active.ring->ring_order);
351+ free_page((unsigned long)map->active.ring);
352+}
353+
354+static int alloc_active_ring(struct sock_mapping *map)
355+{
356+ void *bytes;
357+
358+ map->active.ring = (struct pvcalls_data_intf *)
359+ get_zeroed_page(GFP_KERNEL);
360+ if (!map->active.ring)
361+ goto out;
362+
363+ map->active.ring->ring_order = PVCALLS_RING_ORDER;
364+ bytes = (void *)__get_free_pages(GFP_KERNEL | __GFP_ZERO,
365+ PVCALLS_RING_ORDER);
366+ if (!bytes)
367+ goto out;
368+
369+ map->active.data.in = bytes;
370+ map->active.data.out = bytes +
371+ XEN_FLEX_RING_SIZE(PVCALLS_RING_ORDER);
372+
373+ return 0;
374+
375+out:
376+ free_active_ring(map);
377+ return -ENOMEM;
378+}
379+
338380 static int create_active(struct sock_mapping *map, int *evtchn)
339381 {
340382 void *bytes;
@@ -343,15 +385,7 @@ static int create_active(struct sock_mapping *map, int *evtchn) · 2 unmodified lines
343385 *evtchn = -1;
344386 init_waitqueue_head(&map->active.inflight_conn_req);
345387
346− map->active.ring = (struct pvcalls_data_intf *)
347− __get_free_page(GFP_KERNEL | __GFP_ZERO);
348− if (map->active.ring == NULL)
349− goto out_error;
350− map->active.ring->ring_order = PVCALLS_RING_ORDER;
351− bytes = (void *)__get_free_pages(GFP_KERNEL | __GFP_ZERO,
352− PVCALLS_RING_ORDER);
353− if (bytes == NULL)
354− goto out_error;
388+ bytes = map->active.data.in;
355389 for (i = 0; i < (1 << PVCALLS_RING_ORDER); i++)
356390 map->active.ring->ref[i] = gnttab_grant_foreign_access(
357391 pvcalls_front_dev->otherend_id,
@@ -361,10 +395,6 @@ static int create_active(struct sock_mapping *map, int *evtchn) · 3 unmodified lines
361395 pvcalls_front_dev->otherend_id,
362396 pfn_to_gfn(virt_to_pfn((void *)map->active.ring)), 0);
363397
364− map->active.data.in = bytes;
365− map->active.data.out = bytes +
366− XEN_FLEX_RING_SIZE(PVCALLS_RING_ORDER);
367−
368398 ret = xenbus_alloc_evtchn(pvcalls_front_dev, evtchn);
369399 if (ret)
370400 goto out_error;
@@ -385,8 +415,6 @@ static int create_active(struct sock_mapping *map, int *evtchn) · 14 unmodified lines
385415 out_error:
386416 if (*evtchn >= 0)
387417 xenbus_free_evtchn(pvcalls_front_dev, *evtchn);
388− free_pages((unsigned long)map->active.data.in, PVCALLS_RING_ORDER);
389− free_page((unsigned long)map->active.ring);
390418 return ret;
391419 }
392420
@@ -406,17 +434,24 @@ int pvcalls_front_connect(struct socket *sock, struct sockaddr *addr, · 13 unmodified lines
406434 return PTR_ERR(map);
407435
408436 bedata = dev_get_drvdata(&pvcalls_front_dev->dev);
437+ ret = alloc_active_ring(map);
438+ if (ret < 0) {
439+ pvcalls_exit_sock(sock);
440+ return ret;
441+ }
409442
410443 spin_lock(&bedata->socket_lock);
411444 ret = get_request(bedata, &req_id);
412445 if (ret < 0) {
413446 spin_unlock(&bedata->socket_lock);
447+ free_active_ring(map);
414448 pvcalls_exit_sock(sock);
415449 return ret;
416450 }
417451 ret = create_active(map, &evtchn);
418452 if (ret < 0) {
419453 spin_unlock(&bedata->socket_lock);
454+ free_active_ring(map);
420455 pvcalls_exit_sock(sock);
421456 return ret;
422457 }
@@ -469,8 +504,10 @@ static int __write_ring(struct pvcalls_data_intf *intf, · 46 unmodified lines
469504 virt_mb();
470505
471506 size = pvcalls_queued(prod, cons, array_size);
472− if (size >= array_size)
507+ if (size > array_size)
473508 return -EINVAL;
509+ if (size == array_size)
510+ return 0;
474511 if (len > array_size - size)
475512 len = array_size - size;
476513
@@ -560,15 +597,13 @@ static int __read_ring(struct pvcalls_data_intf *intf, · 83 unmodified lines
560597 error = intf->in_error;
561598 /* get pointers before reading from the ring */
562599 virt_rmb();
563− if (error < 0)
564− return error;
565600
566601 size = pvcalls_queued(prod, cons, array_size);
567602 masked_prod = pvcalls_mask(prod, array_size);
568603 masked_cons = pvcalls_mask(cons, array_size);
569604
570605 if (size == 0)
571− return 0;
606+ return error ?: size;
572607
573608 if (len > size)
574609 len = size;
@@ -780,25 +815,36 @@ int pvcalls_front_accept(struct socket *sock, struct socket *newsock, int flags) · 205 unmodified lines
780815 }
781816 }
782817
783− spin_lock(&bedata->socket_lock);
784− ret = get_request(bedata, &req_id);
785− if (ret < 0) {
818+ map2 = kzalloc(sizeof(*map2), GFP_KERNEL);
819+ if (map2 == NULL) {
786820 clear_bit(PVCALLS_FLAG_ACCEPT_INFLIGHT,
787821 (void *)&map->passive.flags);
788− spin_unlock(&bedata->socket_lock);
822+ pvcalls_exit_sock(sock);
823+ return -ENOMEM;
824+ }
825+ ret = alloc_active_ring(map2);
826+ if (ret < 0) {
827+ clear_bit(PVCALLS_FLAG_ACCEPT_INFLIGHT,
828+ (void *)&map->passive.flags);
829+ kfree(map2);
789830 pvcalls_exit_sock(sock);
790831 return ret;
791832 }
792− map2 = kzalloc(sizeof(*map2), GFP_ATOMIC);
793− if (map2 == NULL) {
833+ spin_lock(&bedata->socket_lock);
834+ ret = get_request(bedata, &req_id);
835+ if (ret < 0) {
794836 clear_bit(PVCALLS_FLAG_ACCEPT_INFLIGHT,
795837 (void *)&map->passive.flags);
796838 spin_unlock(&bedata->socket_lock);
839+ free_active_ring(map2);
840+ kfree(map2);
797841 pvcalls_exit_sock(sock);
798− return -ENOMEM;
842+ return ret;
799843 }
844+
800845 ret = create_active(map2, &evtchn);
801846 if (ret < 0) {
847+ free_active_ring(map2);
802848 kfree(map2);
803849 clear_bit(PVCALLS_FLAG_ACCEPT_INFLIGHT,
804850 (void *)&map->passive.flags);
@@ -839,7 +885,7 @@ int pvcalls_front_accept(struct socket *sock, struct socket *newsock, int flags) · 34 unmodified lines
839885
840886 received:
841887 map2->sock = newsock;
842− newsock->sk = kzalloc(sizeof(*newsock->sk), GFP_KERNEL);
888+ newsock->sk = sk_alloc(sock_net(sock->sk), PF_INET, GFP_KERNEL, &pvcalls_proto, false);
843889 if (!newsock->sk) {
844890 bedata->rsp[req_id].req_id = PVCALLS_INVALID_ID;
845891 map->passive.inflight_req_id = PVCALLS_INVALID_ID;
@@ -1032,8 +1078,8 @@ int pvcalls_front_release(struct socket *sock) · 186 unmodified lines
10321078 spin_lock(&bedata->socket_lock);
10331079 list_del(&map->list);
10341080 spin_unlock(&bedata->socket_lock);
1035− if (READ_ONCE(map->passive.inflight_req_id) !=
1036− PVCALLS_INVALID_ID) {
1081+ if (READ_ONCE(map->passive.inflight_req_id) != PVCALLS_INVALID_ID &&
1082+ READ_ONCE(map->passive.inflight_req_id) != 0) {
10371083 pvcalls_front_free_map(bedata,
10381084 map->passive.accept_map);
10391085 }
drivers/xen/swiotlb-xen.c+2−2
@@ -645,7 +645,7 @@ xen_swiotlb_dma_mmap(struct device *dev, struct vm_area_struct *vma, · 644 unmodified lines
645645 void *cpu_addr, dma_addr_t dma_addr, size_t size,
646646 unsigned long attrs)
647647 {
648−#if defined(CONFIG_ARM) || defined(CONFIG_ARM64)
648+#ifdef CONFIG_ARM
649649 if (xen_get_dma_ops(dev)->mmap)
650650 return xen_get_dma_ops(dev)->mmap(dev, vma, cpu_addr,
651651 dma_addr, size, attrs);
@@ -662,7 +662,7 @@ xen_swiotlb_get_sgtable(struct device *dev, struct sg_table *sgt, · 10 unmodified lines
662662 void *cpu_addr, dma_addr_t handle, size_t size,
663663 unsigned long attrs)
664664 {
665−#if defined(CONFIG_ARM) || defined(CONFIG_ARM64)
665+#ifdef CONFIG_ARM
666666 if (xen_get_dma_ops(dev)->get_sgtable) {
667667 #if 0
668668 /*
fs/afs/flock.c+2−2
@@ -208,7 +208,7 @@ again: · 207 unmodified lines
208208 /* The new front of the queue now owns the state variables. */
209209 next = list_entry(vnode->pending_locks.next,
210210 struct file_lock, fl_u.afs.link);
211− vnode->lock_key = afs_file_key(next->fl_file);
211+ vnode->lock_key = key_get(afs_file_key(next->fl_file));
212212 vnode->lock_type = (next->fl_type == F_RDLCK) ? AFS_LOCK_READ : AFS_LOCK_WRITE;
213213 vnode->lock_state = AFS_VNODE_LOCK_WAITING_FOR_CB;
214214 goto again;
@@ -413,7 +413,7 @@ static void afs_dequeue_lock(struct afs_vnode *vnode, struct file_lock *fl) · 198 unmodified lines
413413 /* The new front of the queue now owns the state variables. */
414414 next = list_entry(vnode->pending_locks.next,
415415 struct file_lock, fl_u.afs.link);
416− vnode->lock_key = afs_file_key(next->fl_file);
416+ vnode->lock_key = key_get(afs_file_key(next->fl_file));
417417 vnode->lock_type = (next->fl_type == F_RDLCK) ? AFS_LOCK_READ : AFS_LOCK_WRITE;
418418 vnode->lock_state = AFS_VNODE_LOCK_WAITING_FOR_CB;
419419 afs_lock_may_be_available(vnode);
fs/afs/inode.c+2−1
@@ -414,7 +414,6 @@ int afs_validate(struct afs_vnode *vnode, struct key *key) · 413 unmodified lines
414414 } else if (test_bit(AFS_VNODE_DELETED, &vnode->flags)) {
415415 valid = true;
416416 } else {
417− vnode->cb_s_break = vnode->cb_interest->server->cb_s_break;
418417 vnode->cb_v_break = vnode->volume->cb_v_break;
419418 valid = false;
420419 }
@@ -546,6 +545,8 @@ void afs_evict_inode(struct inode *inode) · 125 unmodified lines
546545 #endif
547546
548547 afs_put_permits(rcu_access_pointer(vnode->permit_cache));
548+ key_put(vnode->lock_key);
549+ vnode->lock_key = NULL;
549550 _leave("");
550551 }
551552
fs/afs/protocol_yfs.h+11−0
@@ -161,3 +161,14 @@ struct yfs_xdr_YFSStoreVolumeStatus { · 160 unmodified lines
161161 struct yfs_xdr_u64 max_quota;
162162 struct yfs_xdr_u64 file_quota;
163163 } __packed;
164+
165+enum yfs_lock_type {
166+ yfs_LockNone = -1,
167+ yfs_LockRead = 0,
168+ yfs_LockWrite = 1,
169+ yfs_LockExtend = 2,
170+ yfs_LockRelease = 3,
171+ yfs_LockMandatoryRead = 0x100,
172+ yfs_LockMandatoryWrite = 0x101,
173+ yfs_LockMandatoryExtend = 0x102,
174+};
fs/afs/rxrpc.c+42−11
@@ -23,6 +23,7 @@ struct workqueue_struct *afs_async_calls; · 22 unmodified lines
2323 static void afs_wake_up_call_waiter(struct sock *, struct rxrpc_call *, unsigned long);
2424 static long afs_wait_for_call_to_complete(struct afs_call *, struct afs_addr_cursor *);
2525 static void afs_wake_up_async_call(struct sock *, struct rxrpc_call *, unsigned long);
26+static void afs_delete_async_call(struct work_struct *);
2627 static void afs_process_async_call(struct work_struct *);
2728 static void afs_rx_new_call(struct sock *, struct rxrpc_call *, unsigned long);
2829 static void afs_rx_discard_new_call(struct rxrpc_call *, unsigned long);
@@ -203,20 +204,26 @@ void afs_put_call(struct afs_call *call) · 174 unmodified lines
203204 }
204205 }
205206
207+static struct afs_call *afs_get_call(struct afs_call *call,
208+ enum afs_call_trace why)
209+{
210+ int u = atomic_inc_return(&call->usage);
211+
212+ trace_afs_call(call, why, u,
213+ atomic_read(&call->net->nr_outstanding_calls),
214+ __builtin_return_address(0));
215+ return call;
216+}
217+
206218 /*
207219 * Queue the call for actual work.
208220 */
209221 static void afs_queue_call_work(struct afs_call *call)
210222 {
211223 if (call->type->work) {
212− int u = atomic_inc_return(&call->usage);
213−
214− trace_afs_call(call, afs_call_trace_work, u,
215− atomic_read(&call->net->nr_outstanding_calls),
216− __builtin_return_address(0));
217−
218224 INIT_WORK(&call->work, call->type->work);
219225
226+ afs_get_call(call, afs_call_trace_work);
220227 if (!queue_work(afs_wq, &call->work))
221228 afs_put_call(call);
222229 }
@@ -398,6 +405,12 @@ long afs_make_call(struct afs_addr_cursor *ac, struct afs_call *call, · 175 unmodified lines
398405 }
399406 }
400407
408+ /* If the call is going to be asynchronous, we need an extra ref for
409+ * the call to hold itself so the caller need not hang on to its ref.
410+ */
411+ if (call->async)
412+ afs_get_call(call, afs_call_trace_get);
413+
401414 /* create a call */
402415 rxcall = rxrpc_kernel_begin_call(call->net->socket, srx, call->key,
403416 (unsigned long)call,
@@ -438,15 +451,17 @@ long afs_make_call(struct afs_addr_cursor *ac, struct afs_call *call, · 34 unmodified lines
438451 goto error_do_abort;
439452 }
440453
441− /* at this point, an async call may no longer exist as it may have
442− * already completed */
443− if (call->async)
454+ /* Note that at this point, we may have received the reply or an abort
455+ * - and an asynchronous call may already have completed.
456+ */
457+ if (call->async) {
458+ afs_put_call(call);
444459 return -EINPROGRESS;
460+ }
445461
446462 return afs_wait_for_call_to_complete(call, ac);
447463
448464 error_do_abort:
449− call->state = AFS_CALL_COMPLETE;
450465 if (ret != -ECONNABORTED) {
451466 rxrpc_kernel_abort_call(call->net->socket, rxcall,
452467 RX_USER_ABORT, ret, "KSD");
@@ -463,8 +478,24 @@ error_do_abort: · 10 unmodified lines
463478 error_kill_call:
464479 if (call->type->done)
465480 call->type->done(call);
466− afs_put_call(call);
481+
482+ /* We need to dispose of the extra ref we grabbed for an async call.
483+ * The call, however, might be queued on afs_async_calls and we need to
484+ * make sure we don't get any more notifications that might requeue it.
485+ */
486+ if (call->rxcall) {
487+ rxrpc_kernel_end_call(call->net->socket, call->rxcall);
488+ call->rxcall = NULL;
489+ }
490+ if (call->async) {
491+ if (cancel_work_sync(&call->async_work))
492+ afs_put_call(call);
493+ afs_put_call(call);
494+ }
495+
467496 ac->error = ret;
497+ call->state = AFS_CALL_COMPLETE;
498+ afs_put_call(call);
468499 _leave(" = %d", ret);
469500 return ret;
470501 }
fs/afs/server_list.c+1−3
@@ -42,9 +42,7 @@ struct afs_server_list *afs_alloc_server_list(struct afs_cell *cell, · 41 unmodified lines
4242 if (vldb->fs_mask[i] & type_mask)
4343 nr_servers++;
4444
45− slist = kzalloc(sizeof(struct afs_server_list) +
46− sizeof(struct afs_server_entry) * nr_servers,
47− GFP_KERNEL);
45+ slist = kzalloc(struct_size(slist, servers, nr_servers), GFP_KERNEL);
4846 if (!slist)
4947 goto error;
5048
fs/afs/yfsclient.c+1−1
@@ -803,7 +803,7 @@ int yfs_fs_create_file(struct afs_fs_cursor *fc, · 802 unmodified lines
803803 bp = xdr_encode_YFSFid(bp, &vnode->fid);
804804 bp = xdr_encode_string(bp, name, namesz);
805805 bp = xdr_encode_YFSStoreStatus_mode(bp, mode);
806− bp = xdr_encode_u32(bp, 0); /* ViceLockType */
806+ bp = xdr_encode_u32(bp, yfs_LockNone); /* ViceLockType */
807807 yfs_check_req(call, bp);
808808
809809 afs_use_fs_server(call, fc->cbi);
fs/autofs/expire.c+2−1
@@ -596,7 +596,6 @@ int autofs_expire_run(struct super_block *sb, · 595 unmodified lines
596596 pkt.len = dentry->d_name.len;
597597 memcpy(pkt.name, dentry->d_name.name, pkt.len);
598598 pkt.name[pkt.len] = '\0';
599− dput(dentry);
600599
601600 if (copy_to_user(pkt_p, &pkt, sizeof(struct autofs_packet_expire)))
602601 ret = -EFAULT;
@@ -609,6 +608,8 @@ int autofs_expire_run(struct super_block *sb, · 6 unmodified lines
609608 complete_all(&ino->expire_complete);
610609 spin_unlock(&sbi->fs_lock);
611610
611+ dput(dentry);
612+
612613 return ret;
613614 }
614615
fs/autofs/inode.c+3−1
@@ -266,8 +266,10 @@ int autofs_fill_super(struct super_block *s, void *data, int silent) · 265 unmodified lines
266266 }
267267 root_inode = autofs_get_inode(s, S_IFDIR | 0755);
268268 root = d_make_root(root_inode);
269− if (!root)
269+ if (!root) {
270+ ret = -ENOMEM;
270271 goto fail_ino;
272+ }
271273 pipe = NULL;
272274
273275 root->d_fsdata = ino;
fs/block_dev.c+18−10
@@ -104,6 +104,20 @@ void invalidate_bdev(struct block_device *bdev) · 103 unmodified lines
104104 }
105105 EXPORT_SYMBOL(invalidate_bdev);
106106
107+static void set_init_blocksize(struct block_device *bdev)
108+{
109+ unsigned bsize = bdev_logical_block_size(bdev);
110+ loff_t size = i_size_read(bdev->bd_inode);
111+
112+ while (bsize < PAGE_SIZE) {
113+ if (size & bsize)
114+ break;
115+ bsize <<= 1;
116+ }
117+ bdev->bd_block_size = bsize;
118+ bdev->bd_inode->i_blkbits = blksize_bits(bsize);
119+}
120+
107121 int set_blocksize(struct block_device *bdev, int size)
108122 {
109123 /* Size must be a power of two, and between 512 and PAGE_SIZE */
@@ -1431,18 +1445,9 @@ EXPORT_SYMBOL(check_disk_change); · 1321 unmodified lines
14311445
14321446 void bd_set_size(struct block_device *bdev, loff_t size)
14331447 {
1434− unsigned bsize = bdev_logical_block_size(bdev);
1435−
14361448 inode_lock(bdev->bd_inode);
14371449 i_size_write(bdev->bd_inode, size);
14381450 inode_unlock(bdev->bd_inode);
1439− while (bsize < PAGE_SIZE) {
1440− if (size & bsize)
1441− break;
1442− bsize <<= 1;
1443− }
1444− bdev->bd_block_size = bsize;
1445− bdev->bd_inode->i_blkbits = blksize_bits(bsize);
14461451 }
14471452 EXPORT_SYMBOL(bd_set_size);
14481453
@@ -1519,8 +1524,10 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part) · 70 unmodified lines
15191524 }
15201525 }
15211526
1522− if (!ret)
1527+ if (!ret) {
15231528 bd_set_size(bdev,(loff_t)get_capacity(disk)<<9);
1529+ set_init_blocksize(bdev);
1530+ }
15241531
15251532 /*
15261533 * If the device is invalidated, rescan partition
@@ -1555,6 +1562,7 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part) · 28 unmodified lines
15551562 goto out_clear;
15561563 }
15571564 bd_set_size(bdev, (loff_t)bdev->bd_part->nr_sects << 9);
1565+ set_init_blocksize(bdev);
15581566 }
15591567
15601568 if (bdev->bd_bdi == &noop_backing_dev_info)
fs/btrfs/ctree.c+50−28
@@ -968,6 +968,48 @@ static noinline int update_ref_for_cow(struct btrfs_trans_handle *trans, · 967 unmodified lines
968968 return 0;
969969 }
970970
971+static struct extent_buffer *alloc_tree_block_no_bg_flush(
972+ struct btrfs_trans_handle *trans,
973+ struct btrfs_root *root,
974+ u64 parent_start,
975+ const struct btrfs_disk_key *disk_key,
976+ int level,
977+ u64 hint,
978+ u64 empty_size)
979+{
980+ struct btrfs_fs_info *fs_info = root->fs_info;
981+ struct extent_buffer *ret;
982+
983+ /*
984+ * If we are COWing a node/leaf from the extent, chunk, device or free
985+ * space trees, make sure that we do not finish block group creation of
986+ * pending block groups. We do this to avoid a deadlock.
987+ * COWing can result in allocation of a new chunk, and flushing pending
988+ * block groups (btrfs_create_pending_block_groups()) can be triggered
989+ * when finishing allocation of a new chunk. Creation of a pending block
990+ * group modifies the extent, chunk, device and free space trees,
991+ * therefore we could deadlock with ourselves since we are holding a
992+ * lock on an extent buffer that btrfs_create_pending_block_groups() may
993+ * try to COW later.
994+ * For similar reasons, we also need to delay flushing pending block
995+ * groups when splitting a leaf or node, from one of those trees, since
996+ * we are holding a write lock on it and its parent or when inserting a
997+ * new root node for one of those trees.
998+ */
999+ if (root == fs_info->extent_root ||
1000+ root == fs_info->chunk_root ||
1001+ root == fs_info->dev_root ||
1002+ root == fs_info->free_space_root)
1003+ trans->can_flush_pending_bgs = false;
1004+
1005+ ret = btrfs_alloc_tree_block(trans, root, parent_start,
1006+ root->root_key.objectid, disk_key, level,
1007+ hint, empty_size);
1008+ trans->can_flush_pending_bgs = true;
1009+
1010+ return ret;
1011+}
1012+
9711013 /*
9721014 * does the dirty work in cow of a single block. The parent block (if
9731015 * supplied) is updated to point to the new cow copy. The new buffer is marked
@@ -1015,28 +1057,8 @@ static noinline int __btrfs_cow_block(struct btrfs_trans_handle *trans, · 41 unmodified lines
10151057 if ((root->root_key.objectid == BTRFS_TREE_RELOC_OBJECTID) && parent)
10161058 parent_start = parent->start;
10171059
1018− /*
1019− * If we are COWing a node/leaf from the extent, chunk, device or free
1020− * space trees, make sure that we do not finish block group creation of
1021− * pending block groups. We do this to avoid a deadlock.
1022− * COWing can result in allocation of a new chunk, and flushing pending
1023− * block groups (btrfs_create_pending_block_groups()) can be triggered
1024− * when finishing allocation of a new chunk. Creation of a pending block
1025− * group modifies the extent, chunk, device and free space trees,
1026− * therefore we could deadlock with ourselves since we are holding a
1027− * lock on an extent buffer that btrfs_create_pending_block_groups() may
1028− * try to COW later.
1029− */
1030− if (root == fs_info->extent_root ||
1031− root == fs_info->chunk_root ||
1032− root == fs_info->dev_root ||
1033− root == fs_info->free_space_root)
1034− trans->can_flush_pending_bgs = false;
1035−
1036− cow = btrfs_alloc_tree_block(trans, root, parent_start,
1037− root->root_key.objectid, &disk_key, level,
1038− search_start, empty_size);
1039− trans->can_flush_pending_bgs = true;
1060+ cow = alloc_tree_block_no_bg_flush(trans, root, parent_start, &disk_key,
1061+ level, search_start, empty_size);
10401062 if (IS_ERR(cow))
10411063 return PTR_ERR(cow);
10421064
@@ -3345,8 +3367,8 @@ static noinline int insert_new_root(struct btrfs_trans_handle *trans, · 2302 unmodified lines
33453367 else
33463368 btrfs_node_key(lower, &lower_key, 0);
33473369
3348− c = btrfs_alloc_tree_block(trans, root, 0, root->root_key.objectid,
3349− &lower_key, level, root->node->start, 0);
3370+ c = alloc_tree_block_no_bg_flush(trans, root, 0, &lower_key, level,
3371+ root->node->start, 0);
33503372 if (IS_ERR(c))
33513373 return PTR_ERR(c);
33523374
@@ -3475,8 +3497,8 @@ static noinline int split_node(struct btrfs_trans_handle *trans, · 122 unmodified lines
34753497 mid = (c_nritems + 1) / 2;
34763498 btrfs_node_key(c, &disk_key, mid);
34773499
3478− split = btrfs_alloc_tree_block(trans, root, 0, root->root_key.objectid,
3479− &disk_key, level, c->start, 0);
3500+ split = alloc_tree_block_no_bg_flush(trans, root, 0, &disk_key, level,
3501+ c->start, 0);
34803502 if (IS_ERR(split))
34813503 return PTR_ERR(split);
34823504
@@ -4260,8 +4282,8 @@ again: · 777 unmodified lines
42604282 else
42614283 btrfs_item_key(l, &disk_key, mid);
42624284
4263− right = btrfs_alloc_tree_block(trans, root, 0, root->root_key.objectid,
4264− &disk_key, 0, l->start, 0);
4285+ right = alloc_tree_block_no_bg_flush(trans, root, 0, &disk_key, 0,
4286+ l->start, 0);
42654287 if (IS_ERR(right))
42664288 return PTR_ERR(right);
42674289
fs/btrfs/ctree.h+7−0
@@ -35,6 +35,7 @@ · 34 unmodified lines
3535 struct btrfs_trans_handle;
3636 struct btrfs_transaction;
3737 struct btrfs_pending_snapshot;
38+struct btrfs_delayed_ref_root;
3839 extern struct kmem_cache *btrfs_trans_handle_cachep;
3940 extern struct kmem_cache *btrfs_bit_radix_cachep;
4041 extern struct kmem_cache *btrfs_path_cachep;
@@ -786,6 +787,9 @@ enum { · 745 unmodified lines
786787 * main phase. The fs_info::balance_ctl is initialized.
787788 */
788789 BTRFS_FS_BALANCE_RUNNING,
790+
791+ /* Indicate that the cleaner thread is awake and doing something. */
792+ BTRFS_FS_CLEANER_RUNNING,
789793 };
790794
791795 struct btrfs_fs_info {
@@ -2661,6 +2665,9 @@ int btrfs_run_delayed_refs(struct btrfs_trans_handle *trans, · 1869 unmodified lines
26612665 unsigned long count);
26622666 int btrfs_async_run_delayed_refs(struct btrfs_fs_info *fs_info,
26632667 unsigned long count, u64 transid, int wait);
2668+void btrfs_cleanup_ref_head_accounting(struct btrfs_fs_info *fs_info,
2669+ struct btrfs_delayed_ref_root *delayed_refs,
2670+ struct btrfs_delayed_ref_head *head);
26642671 int btrfs_lookup_data_extent(struct btrfs_fs_info *fs_info, u64 start, u64 len);
26652672 int btrfs_lookup_extent_info(struct btrfs_trans_handle *trans,
26662673 struct btrfs_fs_info *fs_info, u64 bytenr,
fs/btrfs/disk-io.c+12−0
@@ -1682,6 +1682,8 @@ static int cleaner_kthread(void *arg) · 1681 unmodified lines
16821682 while (1) {
16831683 again = 0;
16841684
1685+ set_bit(BTRFS_FS_CLEANER_RUNNING, &fs_info->flags);
1686+
16851687 /* Make the cleaner go to sleep early. */
16861688 if (btrfs_need_cleaner_sleep(fs_info))
16871689 goto sleep;
@@ -1728,6 +1730,7 @@ static int cleaner_kthread(void *arg) · 40 unmodified lines
17281730 */
17291731 btrfs_delete_unused_bgs(fs_info);
17301732 sleep:
1733+ clear_bit(BTRFS_FS_CLEANER_RUNNING, &fs_info->flags);
17311734 if (kthread_should_park())
17321735 kthread_parkme();
17331736 if (kthread_should_stop())
@@ -4201,6 +4204,14 @@ static void btrfs_destroy_all_ordered_extents(struct btrfs_fs_info *fs_info) · 2467 unmodified lines
42014204 spin_lock(&fs_info->ordered_root_lock);
42024205 }
42034206 spin_unlock(&fs_info->ordered_root_lock);
4207+
4208+ /*
4209+ * We need this here because if we've been flipped read-only we won't
4210+ * get sync() from the umount, so we need to make sure any ordered
4211+ * extents that haven't had their dirty pages IO start writeout yet
4212+ * actually get run and error out properly.
4213+ */
4214+ btrfs_wait_ordered_roots(fs_info, U64_MAX, 0, (u64)-1);
42044215 }
42054216
42064217 static int btrfs_destroy_delayed_refs(struct btrfs_transaction *trans,
@@ -4265,6 +4276,7 @@ static int btrfs_destroy_delayed_refs(struct btrfs_transaction *trans, · 58 unmodified lines
42654276 if (pin_bytes)
42664277 btrfs_pin_extent(fs_info, head->bytenr,
42674278 head->num_bytes, 1);
4279+ btrfs_cleanup_ref_head_accounting(fs_info, delayed_refs, head);
42684280 btrfs_put_delayed_ref_head(head);
42694281 cond_resched();
42704282 spin_lock(&delayed_refs->lock);
fs/btrfs/extent-tree.c+14−7
@@ -2456,12 +2456,10 @@ static int run_and_cleanup_extent_op(struct btrfs_trans_handle *trans, · 2455 unmodified lines
24562456 return ret ? ret : 1;
24572457 }
24582458
2459−static void cleanup_ref_head_accounting(struct btrfs_trans_handle *trans,
2460− struct btrfs_delayed_ref_head *head)
2459+void btrfs_cleanup_ref_head_accounting(struct btrfs_fs_info *fs_info,
2460+ struct btrfs_delayed_ref_root *delayed_refs,
2461+ struct btrfs_delayed_ref_head *head)
24612462 {
2462− struct btrfs_fs_info *fs_info = trans->fs_info;
2463− struct btrfs_delayed_ref_root *delayed_refs =
2464− &trans->transaction->delayed_refs;
24652463 int nr_items = 1; /* Dropping this ref head update. */
24662464
24672465 if (head->total_ref_mod < 0) {
@@ -2544,7 +2542,7 @@ static int cleanup_ref_head(struct btrfs_trans_handle *trans, · 76 unmodified lines
25442542 }
25452543 }
25462544
2547− cleanup_ref_head_accounting(trans, head);
2545+ btrfs_cleanup_ref_head_accounting(fs_info, delayed_refs, head);
25482546
25492547 trace_run_delayed_ref_head(fs_info, head, 0);
25502548 btrfs_delayed_ref_unlock(head);
@@ -4954,6 +4952,15 @@ static void flush_space(struct btrfs_fs_info *fs_info, · 2403 unmodified lines
49544952 ret = 0;
49554953 break;
49564954 case COMMIT_TRANS:
4955+ /*
4956+ * If we have pending delayed iputs then we could free up a
4957+ * bunch of pinned space, so make sure we run the iputs before
4958+ * we do our pinned bytes check below.
4959+ */
4960+ mutex_lock(&fs_info->cleaner_delayed_iput_mutex);
4961+ btrfs_run_delayed_iputs(fs_info);
4962+ mutex_unlock(&fs_info->cleaner_delayed_iput_mutex);
4963+
49574964 ret = may_commit_transaction(fs_info, space_info);
49584965 break;
49594966 default:
@@ -7188,7 +7195,7 @@ static noinline int check_ref_cleanup(struct btrfs_trans_handle *trans, · 2228 unmodified lines
71887195 if (head->must_insert_reserved)
71897196 ret = 1;
71907197
7191− cleanup_ref_head_accounting(trans, head);
7198+ btrfs_cleanup_ref_head_accounting(trans->fs_info, delayed_refs, head);
71927199 mutex_unlock(&head->mutex);
71937200 btrfs_put_delayed_ref_head(head);
71947201 return ret;
fs/btrfs/inode.c+2−3
@@ -3129,9 +3129,6 @@ out: · 3128 unmodified lines
31293129 /* once for the tree */
31303130 btrfs_put_ordered_extent(ordered_extent);
31313131
3132− /* Try to release some metadata so we don't get an OOM but don't wait */
3133− btrfs_btree_balance_dirty_nodelay(fs_info);
3134−
31353132 return ret;
31363133 }
31373134
@@ -3254,6 +3251,8 @@ void btrfs_add_delayed_iput(struct inode *inode) · 116 unmodified lines
32543251 ASSERT(list_empty(&binode->delayed_iput));
32553252 list_add_tail(&binode->delayed_iput, &fs_info->delayed_iputs);
32563253 spin_unlock(&fs_info->delayed_iput_lock);
3254+ if (!test_bit(BTRFS_FS_CLEANER_RUNNING, &fs_info->flags))
3255+ wake_up_process(fs_info->cleaner_kthread);
32573256 }
32583257
32593258 void btrfs_run_delayed_iputs(struct btrfs_fs_info *fs_info)
fs/btrfs/super.c+3−0
@@ -1621,6 +1621,7 @@ static struct dentry *btrfs_mount(struct file_system_type *fs_type, int flags, · 1620 unmodified lines
16211621 flags | SB_RDONLY, device_name, data);
16221622 if (IS_ERR(mnt_root)) {
16231623 root = ERR_CAST(mnt_root);
1624+ kfree(subvol_name);
16241625 goto out;
16251626 }
16261627
@@ -1630,12 +1631,14 @@ static struct dentry *btrfs_mount(struct file_system_type *fs_type, int flags, · 3 unmodified lines
16301631 if (error < 0) {
16311632 root = ERR_PTR(error);
16321633 mntput(mnt_root);
1634+ kfree(subvol_name);
16331635 goto out;
16341636 }
16351637 }
16361638 }
16371639 if (IS_ERR(mnt_root)) {
16381640 root = ERR_CAST(mnt_root);
1641+ kfree(subvol_name);
16391642 goto out;
16401643 }
16411644
fs/btrfs/transaction.c+16−8
@@ -850,14 +850,6 @@ static int __btrfs_end_transaction(struct btrfs_trans_handle *trans, · 849 unmodified lines
850850
851851 btrfs_trans_release_chunk_metadata(trans);
852852
853− if (lock && should_end_transaction(trans) &&
854− READ_ONCE(cur_trans->state) == TRANS_STATE_RUNNING) {
855− spin_lock(&info->trans_lock);
856− if (cur_trans->state == TRANS_STATE_RUNNING)
857− cur_trans->state = TRANS_STATE_BLOCKED;
858− spin_unlock(&info->trans_lock);
859− }
860−
861853 if (lock && READ_ONCE(cur_trans->state) == TRANS_STATE_BLOCKED) {
862854 if (throttle)
863855 return btrfs_commit_transaction(trans);
@@ -1879,6 +1871,21 @@ static void cleanup_transaction(struct btrfs_trans_handle *trans, int err) · 1015 unmodified lines
18791871 kmem_cache_free(btrfs_trans_handle_cachep, trans);
18801872 }
18811873
1874+/*
1875+ * Release reserved delayed ref space of all pending block groups of the
1876+ * transaction and remove them from the list
1877+ */
1878+static void btrfs_cleanup_pending_block_groups(struct btrfs_trans_handle *trans)
1879+{
1880+ struct btrfs_fs_info *fs_info = trans->fs_info;
1881+ struct btrfs_block_group_cache *block_group, *tmp;
1882+
1883+ list_for_each_entry_safe(block_group, tmp, &trans->new_bgs, bg_list) {
1884+ btrfs_delayed_refs_rsv_release(fs_info, 1);
1885+ list_del_init(&block_group->bg_list);
1886+ }
1887+}
1888+
18821889 static inline int btrfs_start_delalloc_flush(struct btrfs_fs_info *fs_info)
18831890 {
18841891 /*
@@ -2270,6 +2277,7 @@ scrub_continue: · 385 unmodified lines
22702277 btrfs_scrub_continue(fs_info);
22712278 cleanup_transaction:
22722279 btrfs_trans_release_metadata(trans);
2280+ btrfs_cleanup_pending_block_groups(trans);
22732281 btrfs_trans_release_chunk_metadata(trans);
22742282 trans->block_rsv = NULL;
22752283 btrfs_warn(fs_info, "Skipping commit of aborted transaction.");
fs/btrfs/volumes.c+2−2
@@ -957,11 +957,11 @@ static noinline struct btrfs_device *device_list_add(const char *path, · 956 unmodified lines
957957 else
958958 fs_devices = alloc_fs_devices(disk_super->fsid, NULL);
959959
960− fs_devices->fsid_change = fsid_change_in_progress;
961−
962960 if (IS_ERR(fs_devices))
963961 return ERR_CAST(fs_devices);
964962
963+ fs_devices->fsid_change = fsid_change_in_progress;
964+
965965 mutex_lock(&fs_devices->device_list_mutex);
966966 list_add(&fs_devices->fs_list, &fs_uuids);
967967
fs/ceph/caps.c+2−0
@@ -1035,6 +1035,8 @@ static void drop_inode_snap_realm(struct ceph_inode_info *ci) · 1034 unmodified lines
10351035 list_del_init(&ci->i_snap_realm_item);
10361036 ci->i_snap_realm_counter++;
10371037 ci->i_snap_realm = NULL;
1038+ if (realm->ino == ci->i_vino.ino)
1039+ realm->inode = NULL;
10381040 spin_unlock(&realm->inodes_with_caps_lock);
10391041 ceph_put_snap_realm(ceph_sb_to_client(ci->vfs_inode.i_sb)->mdsc,
10401042 realm);
fs/ceph/quota.c+0−13
@@ -3,19 +3,6 @@ · 2 unmodified lines
33 * quota.c - CephFS quota
44 *
55 * Copyright (C) 2017-2018 SUSE
6− *
7− * This program is free software; you can redistribute it and/or
8− * modify it under the terms of the GNU General Public License
9− * as published by the Free Software Foundation; either version 2
10− * of the License, or (at your option) any later version.
11− *
12− * This program is distributed in the hope that it will be useful,
13− * but WITHOUT ANY WARRANTY; without even the implied warranty of
14− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15− * GNU General Public License for more details.
16− *
17− * You should have received a copy of the GNU General Public License
18− * along with this program; if not, see <http://www.gnu.org/licenses/>.
196 */
207
218 #include <linux/statfs.h>
fs/cifs/cifs_debug.c+1−0
@@ -252,6 +252,7 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v) · 251 unmodified lines
252252 seq_printf(m, ",ACL");
253253 #endif
254254 seq_putc(m, '\n');
255+ seq_printf(m, "CIFSMaxBufSize: %d\n", CIFSMaxBufSize);
255256 seq_printf(m, "Active VFS Requests: %d\n", GlobalTotalActiveXid);
256257 seq_printf(m, "Servers:");
257258
fs/cifs/cifsfs.h+1−1
@@ -150,5 +150,5 @@ extern long cifs_ioctl(struct file *filep, unsigned int cmd, unsigned long arg); · 149 unmodified lines
150150 extern const struct export_operations cifs_export_ops;
151151 #endif /* CONFIG_CIFS_NFSD_EXPORT */
152152
153−#define CIFS_VERSION "2.16"
153+#define CIFS_VERSION "2.17"
154154 #endif /* _CIFSFS_H */
fs/cifs/cifssmb.c+23−12
@@ -1549,18 +1549,26 @@ cifs_discard_remaining_data(struct TCP_Server_Info *server) · 1548 unmodified lines
15491549 }
15501550
15511551 static int
1552−cifs_readv_discard(struct TCP_Server_Info *server, struct mid_q_entry *mid)
1552+__cifs_readv_discard(struct TCP_Server_Info *server, struct mid_q_entry *mid,
1553+ bool malformed)
15531554 {
15541555 int length;
1555− struct cifs_readdata *rdata = mid->callback_data;
15561556
15571557 length = cifs_discard_remaining_data(server);
1558− dequeue_mid(mid, rdata->result);
1558+ dequeue_mid(mid, malformed);
15591559 mid->resp_buf = server->smallbuf;
15601560 server->smallbuf = NULL;
15611561 return length;
15621562 }
15631563
1564+static int
1565+cifs_readv_discard(struct TCP_Server_Info *server, struct mid_q_entry *mid)
1566+{
1567+ struct cifs_readdata *rdata = mid->callback_data;
1568+
1569+ return __cifs_readv_discard(server, mid, rdata->result);
1570+}
1571+
15641572 int
15651573 cifs_readv_receive(struct TCP_Server_Info *server, struct mid_q_entry *mid)
15661574 {
@@ -1602,12 +1610,23 @@ cifs_readv_receive(struct TCP_Server_Info *server, struct mid_q_entry *mid) · 35 unmodified lines
16021610 return -1;
16031611 }
16041612
1613+ /* set up first two iov for signature check and to get credits */
1614+ rdata->iov[0].iov_base = buf;
1615+ rdata->iov[0].iov_len = 4;
1616+ rdata->iov[1].iov_base = buf + 4;
1617+ rdata->iov[1].iov_len = server->total_read - 4;
1618+ cifs_dbg(FYI, "0: iov_base=%p iov_len=%zu\n",
1619+ rdata->iov[0].iov_base, rdata->iov[0].iov_len);
1620+ cifs_dbg(FYI, "1: iov_base=%p iov_len=%zu\n",
1621+ rdata->iov[1].iov_base, rdata->iov[1].iov_len);
1622+
16051623 /* Was the SMB read successful? */
16061624 rdata->result = server->ops->map_error(buf, false);
16071625 if (rdata->result != 0) {
16081626 cifs_dbg(FYI, "%s: server returned error %d\n",
16091627 __func__, rdata->result);
1610− return cifs_readv_discard(server, mid);
1628+ /* normal error on read response */
1629+ return __cifs_readv_discard(server, mid, false);
16111630 }
16121631
16131632 /* Is there enough to get to the rest of the READ_RSP header? */
@@ -1651,14 +1670,6 @@ cifs_readv_receive(struct TCP_Server_Info *server, struct mid_q_entry *mid) · 37 unmodified lines
16511670 server->total_read += length;
16521671 }
16531672
1654− /* set up first iov for signature check */
1655− rdata->iov[0].iov_base = buf;
1656− rdata->iov[0].iov_len = 4;
1657− rdata->iov[1].iov_base = buf + 4;
1658− rdata->iov[1].iov_len = server->total_read - 4;
1659− cifs_dbg(FYI, "0: iov_base=%p iov_len=%u\n",
1660− rdata->iov[0].iov_base, server->total_read);
1661−
16621673 /* how much data is in the response? */
16631674 #ifdef CONFIG_CIFS_SMB_DIRECT
16641675 use_rdma_mr = rdata->mr;
fs/cifs/connect.c+21−0
@@ -720,6 +720,21 @@ server_unresponsive(struct TCP_Server_Info *server) · 719 unmodified lines
720720 return false;
721721 }
722722
723+static inline bool
724+zero_credits(struct TCP_Server_Info *server)
725+{
726+ int val;
727+
728+ spin_lock(&server->req_lock);
729+ val = server->credits + server->echo_credits + server->oplock_credits;
730+ if (server->in_flight == 0 && val == 0) {
731+ spin_unlock(&server->req_lock);
732+ return true;
733+ }
734+ spin_unlock(&server->req_lock);
735+ return false;
736+}
737+
723738 static int
724739 cifs_readv_from_socket(struct TCP_Server_Info *server, struct msghdr *smb_msg)
725740 {
@@ -732,6 +747,12 @@ cifs_readv_from_socket(struct TCP_Server_Info *server, struct msghdr *smb_msg) · 6 unmodified lines
732747 for (total_read = 0; msg_data_left(smb_msg); total_read += length) {
733748 try_to_freeze();
734749
750+ /* reconnect if no credits and no requests in flight */
751+ if (zero_credits(server)) {
752+ cifs_reconnect(server);
753+ return -ECONNABORTED;
754+ }
755+
735756 if (server_unresponsive(server))
736757 return -ECONNABORTED;
737758 if (cifs_rdma_enabled(server) && server->smbd_conn)
fs/cifs/file.c+8−3
@@ -2696,6 +2696,7 @@ cifs_write_from_iter(loff_t offset, size_t len, struct iov_iter *from, · 2695 unmodified lines
26962696
26972697 rc = cifs_write_allocate_pages(wdata->pages, nr_pages);
26982698 if (rc) {
2699+ kvfree(wdata->pages);
26992700 kfree(wdata);
27002701 add_credits_and_wake_if(server, credits, 0);
27012702 break;
@@ -2707,6 +2708,7 @@ cifs_write_from_iter(loff_t offset, size_t len, struct iov_iter *from, · 5 unmodified lines
27072708 if (rc) {
27082709 for (i = 0; i < nr_pages; i++)
27092710 put_page(wdata->pages[i]);
2711+ kvfree(wdata->pages);
27102712 kfree(wdata);
27112713 add_credits_and_wake_if(server, credits, 0);
27122714 break;
@@ -3386,8 +3388,12 @@ cifs_send_async_read(loff_t offset, size_t len, struct cifsFileInfo *open_file, · 673 unmodified lines
33863388 }
33873389
33883390 rc = cifs_read_allocate_pages(rdata, npages);
3389− if (rc)
3390− goto error;
3391+ if (rc) {
3392+ kvfree(rdata->pages);
3393+ kfree(rdata);
3394+ add_credits_and_wake_if(server, credits, 0);
3395+ break;
3396+ }
33913397
33923398 rdata->tailsz = PAGE_SIZE;
33933399 }
@@ -3407,7 +3413,6 @@ cifs_send_async_read(loff_t offset, size_t len, struct cifsFileInfo *open_file, · 13 unmodified lines
34073413 if (!rdata->cfile->invalidHandle ||
34083414 !(rc = cifs_reopen_file(rdata->cfile, true)))
34093415 rc = server->ops->async_readv(rdata);
3410−error:
34113416 if (rc) {
34123417 add_credits_and_wake_if(server, rdata->credits, 0);
34133418 kref_put(&rdata->refcount,
fs/cifs/smb2inode.c+17−0
@@ -293,6 +293,8 @@ smb2_query_path_info(const unsigned int xid, struct cifs_tcon *tcon, · 292 unmodified lines
293293 int rc;
294294 struct smb2_file_all_info *smb2_data;
295295 __u32 create_options = 0;
296+ struct cifs_fid fid;
297+ bool no_cached_open = tcon->nohandlecache;
296298
297299 *adjust_tz = false;
298300 *symlink = false;
@@ -301,6 +303,21 @@ smb2_query_path_info(const unsigned int xid, struct cifs_tcon *tcon, · 2 unmodified lines
301303 GFP_KERNEL);
302304 if (smb2_data == NULL)
303305 return -ENOMEM;
306+
307+ /* If it is a root and its handle is cached then use it */
308+ if (!strlen(full_path) && !no_cached_open) {
309+ rc = open_shroot(xid, tcon, &fid);
310+ if (rc)
311+ goto out;
312+ rc = SMB2_query_info(xid, tcon, fid.persistent_fid,
313+ fid.volatile_fid, smb2_data);
314+ close_shroot(&tcon->crfid);
315+ if (rc)
316+ goto out;
317+ move_smb2_info_to_cifs(data, smb2_data);
318+ goto out;
319+ }
320+
304321 if (backup_cred(cifs_sb))
305322 create_options |= CREATE_OPEN_BACKUP_INTENT;
306323
fs/cifs/smb2misc.c+7−0
@@ -648,6 +648,13 @@ smb2_is_valid_oplock_break(char *buffer, struct TCP_Server_Info *server) · 647 unmodified lines
648648 if (rsp->sync_hdr.Command != SMB2_OPLOCK_BREAK)
649649 return false;
650650
651+ if (rsp->sync_hdr.CreditRequest) {
652+ spin_lock(&server->req_lock);
653+ server->credits += le16_to_cpu(rsp->sync_hdr.CreditRequest);
654+ spin_unlock(&server->req_lock);
655+ wake_up(&server->request_q);
656+ }
657+
651658 if (rsp->StructureSize !=
652659 smb2_rsp_struct_sizes[SMB2_OPLOCK_BREAK_HE]) {
653660 if (le16_to_cpu(rsp->StructureSize) == 44)
fs/cifs/smb2ops.c+50−22
@@ -34,6 +34,7 @@ · 33 unmodified lines
3434 #include "cifs_ioctl.h"
3535 #include "smbdirect.h"
3636
37+/* Change credits for different ops and return the total number of credits */
3738 static int
3839 change_conf(struct TCP_Server_Info *server)
3940 {
@@ -41,17 +42,15 @@ change_conf(struct TCP_Server_Info *server) · 1 unmodified line
4142 server->oplock_credits = server->echo_credits = 0;
4243 switch (server->credits) {
4344 case 0:
44− return -1;
45+ return 0;
4546 case 1:
4647 server->echoes = false;
4748 server->oplocks = false;
48− cifs_dbg(VFS, "disabling echoes and oplocks\n");
4949 break;
5050 case 2:
5151 server->echoes = true;
5252 server->oplocks = false;
5353 server->echo_credits = 1;
54− cifs_dbg(FYI, "disabling oplocks\n");
5554 break;
5655 default:
5756 server->echoes = true;
@@ -64,14 +63,15 @@ change_conf(struct TCP_Server_Info *server) · 6 unmodified lines
6463 server->echo_credits = 1;
6564 }
6665 server->credits -= server->echo_credits + server->oplock_credits;
67− return 0;
66+ return server->credits + server->echo_credits + server->oplock_credits;
6867 }
6968
7069 static void
7170 smb2_add_credits(struct TCP_Server_Info *server, const unsigned int add,
7271 const int optype)
7372 {
74− int *val, rc = 0;
73+ int *val, rc = -1;
74+
7575 spin_lock(&server->req_lock);
7676 val = server->ops->get_credits_field(server, optype);
7777
@@ -101,8 +101,26 @@ smb2_add_credits(struct TCP_Server_Info *server, const unsigned int add, · 23 unmodified lines
101101 }
102102 spin_unlock(&server->req_lock);
103103 wake_up(&server->request_q);
104− if (rc)
105− cifs_reconnect(server);
104+
105+ if (server->tcpStatus == CifsNeedReconnect)
106+ return;
107+
108+ switch (rc) {
109+ case -1:
110+ /* change_conf hasn't been executed */
111+ break;
112+ case 0:
113+ cifs_dbg(VFS, "Possible client or server bug - zero credits\n");
114+ break;
115+ case 1:
116+ cifs_dbg(VFS, "disabling echoes and oplocks\n");
117+ break;
118+ case 2:
119+ cifs_dbg(FYI, "disabling oplocks\n");
120+ break;
121+ default:
122+ cifs_dbg(FYI, "add %u credits total=%d\n", add, rc);
123+ }
106124 }
107125
108126 static void
@@ -136,7 +154,11 @@ smb2_get_credits(struct mid_q_entry *mid) · 27 unmodified lines
136154 {
137155 struct smb2_sync_hdr *shdr = (struct smb2_sync_hdr *)mid->resp_buf;
138156
139− return le16_to_cpu(shdr->CreditRequest);
157+ if (mid->mid_state == MID_RESPONSE_RECEIVED
158+ || mid->mid_state == MID_RESPONSE_MALFORMED)
159+ return le16_to_cpu(shdr->CreditRequest);
160+
161+ return 0;
140162 }
141163
142164 static int
@@ -165,14 +187,14 @@ smb2_wait_mtu_credits(struct TCP_Server_Info *server, unsigned int size, · 22 unmodified lines
165187
166188 scredits = server->credits;
167189 /* can deadlock with reopen */
168− if (scredits == 1) {
190+ if (scredits <= 8) {
169191 *num = SMB2_MAX_BUFFER_SIZE;
170192 *credits = 0;
171193 break;
172194 }
173195
174− /* leave one credit for a possible reopen */
175− scredits--;
196+ /* leave some credits for reopen and other ops */
197+ scredits -= 8;
176198 *num = min_t(unsigned int, size,
177199 scredits * SMB2_MAX_BUFFER_SIZE);
178200
@@ -844,7 +866,9 @@ smb2_query_eas(const unsigned int xid, struct cifs_tcon *tcon, · 665 unmodified lines
844866 FILE_READ_EA,
845867 FILE_FULL_EA_INFORMATION,
846868 SMB2_O_INFO_FILE,
847− SMB2_MAX_EA_BUF,
869+ CIFSMaxBufSize -
870+ MAX_SMB2_CREATE_RESPONSE_SIZE -
871+ MAX_SMB2_CLOSE_RESPONSE_SIZE,
848872 &rsp_iov, &buftype, cifs_sb);
849873 if (rc) {
850874 /*
@@ -3189,11 +3213,23 @@ handle_read_data(struct TCP_Server_Info *server, struct mid_q_entry *mid, · 2338 unmodified lines
31893213 server->ops->is_status_pending(buf, server, 0))
31903214 return -1;
31913215
3192− rdata->result = server->ops->map_error(buf, false);
3216+ /* set up first two iov to get credits */
3217+ rdata->iov[0].iov_base = buf;
3218+ rdata->iov[0].iov_len = 4;
3219+ rdata->iov[1].iov_base = buf + 4;
3220+ rdata->iov[1].iov_len =
3221+ min_t(unsigned int, buf_len, server->vals->read_rsp_size) - 4;
3222+ cifs_dbg(FYI, "0: iov_base=%p iov_len=%zu\n",
3223+ rdata->iov[0].iov_base, rdata->iov[0].iov_len);
3224+ cifs_dbg(FYI, "1: iov_base=%p iov_len=%zu\n",
3225+ rdata->iov[1].iov_base, rdata->iov[1].iov_len);
3226+
3227+ rdata->result = server->ops->map_error(buf, true);
31933228 if (rdata->result != 0) {
31943229 cifs_dbg(FYI, "%s: server returned error %d\n",
31953230 __func__, rdata->result);
3196− dequeue_mid(mid, rdata->result);
3231+ /* normal error on read response */
3232+ dequeue_mid(mid, false);
31973233 return 0;
31983234 }
31993235
@@ -3266,14 +3302,6 @@ handle_read_data(struct TCP_Server_Info *server, struct mid_q_entry *mid, · 66 unmodified lines
32663302 return 0;
32673303 }
32683304
3269− /* set up first iov for signature check */
3270− rdata->iov[0].iov_base = buf;
3271− rdata->iov[0].iov_len = 4;
3272− rdata->iov[1].iov_base = buf + 4;
3273− rdata->iov[1].iov_len = server->vals->read_rsp_size - 4;
3274− cifs_dbg(FYI, "0: iov_base=%p iov_len=%zu\n",
3275− rdata->iov[0].iov_base, server->vals->read_rsp_size);
3276−
32773305 length = rdata->copy_into_pages(server, rdata, &iter);
32783306
32793307 kfree(bvec);
fs/cifs/smb2pdu.c+53−24
@@ -2816,6 +2816,7 @@ query_info(const unsigned int xid, struct cifs_tcon *tcon, · 2815 unmodified lines
28162816 int resp_buftype = CIFS_NO_BUFFER;
28172817 struct cifs_ses *ses = tcon->ses;
28182818 int flags = 0;
2819+ bool allocated = false;
28192820
28202821 cifs_dbg(FYI, "Query Info\n");
28212822
@@ -2855,14 +2856,21 @@ query_info(const unsigned int xid, struct cifs_tcon *tcon, · 33 unmodified lines
28552856 "Error %d allocating memory for acl\n",
28562857 rc);
28572858 *dlen = 0;
2859+ rc = -ENOMEM;
28582860 goto qinf_exit;
28592861 }
2862+ allocated = true;
28602863 }
28612864 }
28622865
28632866 rc = smb2_validate_and_copy_iov(le16_to_cpu(rsp->OutputBufferOffset),
28642867 le32_to_cpu(rsp->OutputBufferLength),
28652868 &rsp_iov, min_len, *data);
2869+ if (rc && allocated) {
2870+ kfree(*data);
2871+ *data = NULL;
2872+ *dlen = 0;
2873+ }
28662874
28672875 qinf_exit:
28682876 SMB2_query_info_free(&rqst);
@@ -2916,9 +2924,10 @@ smb2_echo_callback(struct mid_q_entry *mid) · 47 unmodified lines
29162924 {
29172925 struct TCP_Server_Info *server = mid->callback_data;
29182926 struct smb2_echo_rsp *rsp = (struct smb2_echo_rsp *)mid->resp_buf;
2919− unsigned int credits_received = 1;
2927+ unsigned int credits_received = 0;
29202928
2921− if (mid->mid_state == MID_RESPONSE_RECEIVED)
2929+ if (mid->mid_state == MID_RESPONSE_RECEIVED
2930+ || mid->mid_state == MID_RESPONSE_MALFORMED)
29222931 credits_received = le16_to_cpu(rsp->sync_hdr.CreditRequest);
29232932
29242933 DeleteMidQEntry(mid);
@@ -3175,7 +3184,7 @@ smb2_readv_callback(struct mid_q_entry *mid) · 250 unmodified lines
31753184 struct TCP_Server_Info *server = tcon->ses->server;
31763185 struct smb2_sync_hdr *shdr =
31773186 (struct smb2_sync_hdr *)rdata->iov[0].iov_base;
3178− unsigned int credits_received = 1;
3187+ unsigned int credits_received = 0;
31793188 struct smb_rqst rqst = { .rq_iov = rdata->iov,
31803189 .rq_nvec = 2,
31813190 .rq_pages = rdata->pages,
@@ -3214,6 +3223,9 @@ smb2_readv_callback(struct mid_q_entry *mid) · 32 unmodified lines
32143223 task_io_account_read(rdata->got_bytes);
32153224 cifs_stats_bytes_read(tcon, rdata->got_bytes);
32163225 break;
3226+ case MID_RESPONSE_MALFORMED:
3227+ credits_received = le16_to_cpu(shdr->CreditRequest);
3228+ /* fall through */
32173229 default:
32183230 if (rdata->result != -ENODATA)
32193231 rdata->result = -EIO;
@@ -3229,8 +3241,17 @@ smb2_readv_callback(struct mid_q_entry *mid) · 9 unmodified lines
32293241 rdata->mr = NULL;
32303242 }
32313243 #endif
3232− if (rdata->result)
3244+ if (rdata->result && rdata->result != -ENODATA) {
32333245 cifs_stats_fail_inc(tcon, SMB2_READ_HE);
3246+ trace_smb3_read_err(0 /* xid */,
3247+ rdata->cfile->fid.persistent_fid,
3248+ tcon->tid, tcon->ses->Suid, rdata->offset,
3249+ rdata->bytes, rdata->result);
3250+ } else
3251+ trace_smb3_read_done(0 /* xid */,
3252+ rdata->cfile->fid.persistent_fid,
3253+ tcon->tid, tcon->ses->Suid,
3254+ rdata->offset, rdata->got_bytes);
32343255
32353256 queue_work(cifsiod_wq, &rdata->work);
32363257 DeleteMidQEntry(mid);
@@ -3305,13 +3326,11 @@ smb2_async_readv(struct cifs_readdata *rdata) · 68 unmodified lines
33053326 if (rc) {
33063327 kref_put(&rdata->refcount, cifs_readdata_release);
33073328 cifs_stats_fail_inc(io_parms.tcon, SMB2_READ_HE);
3308− trace_smb3_read_err(rc, 0 /* xid */, io_parms.persistent_fid,
3309− io_parms.tcon->tid, io_parms.tcon->ses->Suid,
3310− io_parms.offset, io_parms.length);
3311− } else
3312− trace_smb3_read_done(0 /* xid */, io_parms.persistent_fid,
3313− io_parms.tcon->tid, io_parms.tcon->ses->Suid,
3314− io_parms.offset, io_parms.length);
3329+ trace_smb3_read_err(0 /* xid */, io_parms.persistent_fid,
3330+ io_parms.tcon->tid,
3331+ io_parms.tcon->ses->Suid,
3332+ io_parms.offset, io_parms.length, rc);
3333+ }
33153334
33163335 cifs_small_buf_release(buf);
33173336 return rc;
@@ -3355,10 +3374,11 @@ SMB2_read(const unsigned int xid, struct cifs_io_parms *io_parms, · 37 unmodified lines
33553374 if (rc != -ENODATA) {
33563375 cifs_stats_fail_inc(io_parms->tcon, SMB2_READ_HE);
33573376 cifs_dbg(VFS, "Send error in read = %d\n", rc);
3377+ trace_smb3_read_err(xid, req->PersistentFileId,
3378+ io_parms->tcon->tid, ses->Suid,
3379+ io_parms->offset, io_parms->length,
3380+ rc);
33583381 }
3359− trace_smb3_read_err(rc, xid, req->PersistentFileId,
3360− io_parms->tcon->tid, ses->Suid,
3361− io_parms->offset, io_parms->length);
33623382 free_rsp_buf(resp_buftype, rsp_iov.iov_base);
33633383 return rc == -ENODATA ? 0 : rc;
33643384 } else
@@ -3399,7 +3419,7 @@ smb2_writev_callback(struct mid_q_entry *mid) · 34 unmodified lines
33993419 struct cifs_tcon *tcon = tlink_tcon(wdata->cfile->tlink);
34003420 unsigned int written;
34013421 struct smb2_write_rsp *rsp = (struct smb2_write_rsp *)mid->resp_buf;
3402− unsigned int credits_received = 1;
3422+ unsigned int credits_received = 0;
34033423
34043424 switch (mid->mid_state) {
34053425 case MID_RESPONSE_RECEIVED:
@@ -3427,6 +3447,9 @@ smb2_writev_callback(struct mid_q_entry *mid) · 21 unmodified lines
34273447 case MID_RETRY_NEEDED:
34283448 wdata->result = -EAGAIN;
34293449 break;
3450+ case MID_RESPONSE_MALFORMED:
3451+ credits_received = le16_to_cpu(rsp->sync_hdr.CreditRequest);
3452+ /* fall through */
34303453 default:
34313454 wdata->result = -EIO;
34323455 break;
@@ -3444,8 +3467,17 @@ smb2_writev_callback(struct mid_q_entry *mid) · 11 unmodified lines
34443467 wdata->mr = NULL;
34453468 }
34463469 #endif
3447− if (wdata->result)
3470+ if (wdata->result) {
34483471 cifs_stats_fail_inc(tcon, SMB2_WRITE_HE);
3472+ trace_smb3_write_err(0 /* no xid */,
3473+ wdata->cfile->fid.persistent_fid,
3474+ tcon->tid, tcon->ses->Suid, wdata->offset,
3475+ wdata->bytes, wdata->result);
3476+ } else
3477+ trace_smb3_write_done(0 /* no xid */,
3478+ wdata->cfile->fid.persistent_fid,
3479+ tcon->tid, tcon->ses->Suid,
3480+ wdata->offset, wdata->bytes);
34493481
34503482 queue_work(cifsiod_wq, &wdata->work);
34513483 DeleteMidQEntry(mid);
@@ -3587,10 +3619,7 @@ smb2_async_writev(struct cifs_writedata *wdata, · 135 unmodified lines
35873619 wdata->bytes, rc);
35883620 kref_put(&wdata->refcount, release);
35893621 cifs_stats_fail_inc(tcon, SMB2_WRITE_HE);
3590− } else
3591− trace_smb3_write_done(0 /* no xid */, req->PersistentFileId,
3592− tcon->tid, tcon->ses->Suid, wdata->offset,
3593− wdata->bytes);
3622+ }
35943623
35953624 async_writev_out:
35963625 cifs_small_buf_release(req);
@@ -3816,8 +3845,8 @@ SMB2_query_directory(const unsigned int xid, struct cifs_tcon *tcon, · 219 unmodified lines
38163845 rsp->sync_hdr.Status == STATUS_NO_MORE_FILES) {
38173846 srch_inf->endOfSearch = true;
38183847 rc = 0;
3819− }
3820− cifs_stats_fail_inc(tcon, SMB2_QUERY_DIRECTORY_HE);
3848+ } else
3849+ cifs_stats_fail_inc(tcon, SMB2_QUERY_DIRECTORY_HE);
38213850 goto qdir_exit;
38223851 }
38233852
@@ -4412,8 +4441,8 @@ SMB2_lease_break(const unsigned int xid, struct cifs_tcon *tcon, · 588 unmodified lines
44124441 rc = cifs_send_recv(xid, ses, &rqst, &resp_buf_type, flags, &rsp_iov);
44134442 cifs_small_buf_release(req);
44144443
4415− please_key_low = (__u64 *)req->LeaseKey;
4416− please_key_high = (__u64 *)(req->LeaseKey+8);
4444+ please_key_low = (__u64 *)lease_key;
4445+ please_key_high = (__u64 *)(lease_key+8);
44174446 if (rc) {
44184447 cifs_stats_fail_inc(tcon, SMB2_OPLOCK_BREAK_HE);
44194448 trace_smb3_lease_err(le32_to_cpu(lease_state), tcon->tid,
fs/cifs/smb2pdu.h+15−4
@@ -84,8 +84,9 @@ · 83 unmodified lines
8484
8585 #define NUMBER_OF_SMB2_COMMANDS 0x0013
8686
87−/* 4 len + 52 transform hdr + 64 hdr + 56 create rsp */
88−#define MAX_SMB2_HDR_SIZE 0x00b0
87+/* 52 transform hdr + 64 hdr + 88 create rsp */
88+#define SMB2_TRANSFORM_HEADER_SIZE 52
89+#define MAX_SMB2_HDR_SIZE 204
8990
9091 #define SMB2_PROTO_NUMBER cpu_to_le32(0x424d53fe)
9192 #define SMB2_TRANSFORM_PROTO_NUM cpu_to_le32(0x424d53fd)
@@ -648,6 +649,13 @@ struct smb2_create_req { · 556 unmodified lines
648649 __u8 Buffer[0];
649650 } __packed;
650651
652+/*
653+ * Maximum size of a SMB2_CREATE response is 64 (smb2 header) +
654+ * 88 (fixed part of create response) + 520 (path) + 150 (contexts) +
655+ * 2 bytes of padding.
656+ */
657+#define MAX_SMB2_CREATE_RESPONSE_SIZE 824
658+
651659 struct smb2_create_rsp {
652660 struct smb2_sync_hdr sync_hdr;
653661 __le16 StructureSize; /* Must be 89 */
@@ -996,6 +1004,11 @@ struct smb2_close_req { · 342 unmodified lines
9961004 __u64 VolatileFileId; /* opaque endianness */
9971005 } __packed;
9981006
1007+/*
1008+ * Maximum size of a SMB2_CLOSE response is 64 (smb2 header) + 60 (data)
1009+ */
1010+#define MAX_SMB2_CLOSE_RESPONSE_SIZE 124
1011+
9991012 struct smb2_close_rsp {
10001013 struct smb2_sync_hdr sync_hdr;
10011014 __le16 StructureSize; /* 60 */
@@ -1398,8 +1411,6 @@ struct smb2_file_link_info { /* encoding of request for level 11 */ · 396 unmodified lines
13981411 char FileName[0]; /* Name to be assigned to new link */
13991412 } __packed; /* level 11 Set */
14001413
1401−#define SMB2_MAX_EA_BUF 65536
1402−
14031414 struct smb2_file_full_ea_info { /* encoding of response for level 15 */
14041415 __le32 next_entry_offset;
14051416 __u8 flags;
fs/cifs/trace.c+0−10
@@ -3,16 +3,6 @@ · 2 unmodified lines
33 * Copyright (C) 2018, Microsoft Corporation.
44 *
55 * Author(s): Steve French <stfrench@microsoft.com>
6− *
7− * This program is free software; you can redistribute it and/or modify
8− * it under the terms of the GNU General Public License as published by
9− * the Free Software Foundation; either version 2 of the License, or
10− * (at your option) any later version.
11− *
12− * This program is distributed in the hope that it will be useful,
13− * but WITHOUT ANY WARRANTY; without even the implied warranty of
14− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
15− * the GNU General Public License for more details.
166 */
177 #define CREATE_TRACE_POINTS
188 #include "trace.h"
fs/cifs/trace.h+0−10
@@ -3,16 +3,6 @@ · 2 unmodified lines
33 * Copyright (C) 2018, Microsoft Corporation.
44 *
55 * Author(s): Steve French <stfrench@microsoft.com>
6− *
7− * This program is free software; you can redistribute it and/or modify
8− * it under the terms of the GNU General Public License as published by
9− * the Free Software Foundation; either version 2 of the License, or
10− * (at your option) any later version.
11− *
12− * This program is distributed in the hope that it will be useful,
13− * but WITHOUT ANY WARRANTY; without even the implied warranty of
14− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
15− * the GNU General Public License for more details.
166 */
177 #undef TRACE_SYSTEM
188 #define TRACE_SYSTEM cifs
fs/cifs/transport.c+1−10
@@ -786,17 +786,8 @@ static void · 785 unmodified lines
786786 cifs_compound_callback(struct mid_q_entry *mid)
787787 {
788788 struct TCP_Server_Info *server = mid->server;
789− unsigned int optype = mid->optype;
790− unsigned int credits_received = 0;
791789
792− if (mid->mid_state == MID_RESPONSE_RECEIVED) {
793− if (mid->resp_buf)
794− credits_received = server->ops->get_credits(mid);
795− else
796− cifs_dbg(FYI, "Bad state for cancelled MID\n");
797− }
798−
799− add_credits(server, credits_received, optype);
790+ add_credits(server, server->ops->get_credits(mid), mid->optype);
800791 }
801792
802793 static void
fs/dcache.c+33−5
@@ -119,6 +119,7 @@ struct dentry_stat_t dentry_stat = { · 118 unmodified lines
119119
120120 static DEFINE_PER_CPU(long, nr_dentry);
121121 static DEFINE_PER_CPU(long, nr_dentry_unused);
122+static DEFINE_PER_CPU(long, nr_dentry_negative);
122123
123124 #if defined(CONFIG_SYSCTL) && defined(CONFIG_PROC_FS)
124125
@@ -152,11 +153,22 @@ static long get_nr_dentry_unused(void) · 27 unmodified lines
152153 return sum < 0 ? 0 : sum;
153154 }
154155
156+static long get_nr_dentry_negative(void)
157+{
158+ int i;
159+ long sum = 0;
160+
161+ for_each_possible_cpu(i)
162+ sum += per_cpu(nr_dentry_negative, i);
163+ return sum < 0 ? 0 : sum;
164+}
165+
155166 int proc_nr_dentry(struct ctl_table *table, int write, void __user *buffer,
156167 size_t *lenp, loff_t *ppos)
157168 {
158169 dentry_stat.nr_dentry = get_nr_dentry();
159170 dentry_stat.nr_unused = get_nr_dentry_unused();
171+ dentry_stat.nr_negative = get_nr_dentry_negative();
160172 return proc_doulongvec_minmax(table, write, buffer, lenp, ppos);
161173 }
162174 #endif
@@ -317,6 +329,8 @@ static inline void __d_clear_type_and_inode(struct dentry *dentry) · 154 unmodified lines
317329 flags &= ~(DCACHE_ENTRY_TYPE | DCACHE_FALLTHRU);
318330 WRITE_ONCE(dentry->d_flags, flags);
319331 dentry->d_inode = NULL;
332+ if (dentry->d_flags & DCACHE_LRU_LIST)
333+ this_cpu_inc(nr_dentry_negative);
320334 }
321335
322336 static void dentry_free(struct dentry *dentry)
@@ -371,6 +385,11 @@ static void dentry_unlink_inode(struct dentry * dentry) · 48 unmodified lines
371385 * The per-cpu "nr_dentry_unused" counters are updated with
372386 * the DCACHE_LRU_LIST bit.
373387 *
388+ * The per-cpu "nr_dentry_negative" counters are only updated
389+ * when deleted from or added to the per-superblock LRU list, not
390+ * from/to the shrink list. That is to avoid an unneeded dec/inc
391+ * pair when moving from LRU to shrink list in select_collect().
392+ *
374393 * These helper functions make sure we always follow the
375394 * rules. d_lock must be held by the caller.
376395 */
@@ -380,6 +399,8 @@ static void d_lru_add(struct dentry *dentry) · 3 unmodified lines
380399 D_FLAG_VERIFY(dentry, 0);
381400 dentry->d_flags |= DCACHE_LRU_LIST;
382401 this_cpu_inc(nr_dentry_unused);
402+ if (d_is_negative(dentry))
403+ this_cpu_inc(nr_dentry_negative);
383404 WARN_ON_ONCE(!list_lru_add(&dentry->d_sb->s_dentry_lru, &dentry->d_lru));
384405 }
385406
@@ -388,6 +409,8 @@ static void d_lru_del(struct dentry *dentry) · 2 unmodified lines
388409 D_FLAG_VERIFY(dentry, DCACHE_LRU_LIST);
389410 dentry->d_flags &= ~DCACHE_LRU_LIST;
390411 this_cpu_dec(nr_dentry_unused);
412+ if (d_is_negative(dentry))
413+ this_cpu_dec(nr_dentry_negative);
391414 WARN_ON_ONCE(!list_lru_del(&dentry->d_sb->s_dentry_lru, &dentry->d_lru));
392415 }
393416
@@ -418,6 +441,8 @@ static void d_lru_isolate(struct list_lru_one *lru, struct dentry *dentry) · 24 unmodified lines
418441 D_FLAG_VERIFY(dentry, DCACHE_LRU_LIST);
419442 dentry->d_flags &= ~DCACHE_LRU_LIST;
420443 this_cpu_dec(nr_dentry_unused);
444+ if (d_is_negative(dentry))
445+ this_cpu_dec(nr_dentry_negative);
421446 list_lru_isolate(lru, &dentry->d_lru);
422447 }
423448
@@ -426,6 +451,8 @@ static void d_lru_shrink_move(struct list_lru_one *lru, struct dentry *dentry, · 2 unmodified lines
426451 {
427452 D_FLAG_VERIFY(dentry, DCACHE_LRU_LIST);
428453 dentry->d_flags |= DCACHE_SHRINK_LIST;
454+ if (d_is_negative(dentry))
455+ this_cpu_dec(nr_dentry_negative);
429456 list_lru_isolate_move(lru, &dentry->d_lru, list);
430457 }
431458
@@ -1188,15 +1215,11 @@ static enum lru_status dentry_lru_isolate_shrink(struct list_head *item, · 756 unmodified lines
11881215 */
11891216 void shrink_dcache_sb(struct super_block *sb)
11901217 {
1191− long freed;
1192−
11931218 do {
11941219 LIST_HEAD(dispose);
11951220
1196− freed = list_lru_walk(&sb->s_dentry_lru,
1221+ list_lru_walk(&sb->s_dentry_lru,
11971222 dentry_lru_isolate_shrink, &dispose, 1024);
1198−
1199− this_cpu_sub(nr_dentry_unused, freed);
12001223 shrink_dentry_list(&dispose);
12011224 } while (list_lru_count(&sb->s_dentry_lru) > 0);
12021225 }
@@ -1820,6 +1843,11 @@ static void __d_instantiate(struct dentry *dentry, struct inode *inode) · 617 unmodified lines
18201843 WARN_ON(d_in_lookup(dentry));
18211844
18221845 spin_lock(&dentry->d_lock);
1846+ /*
1847+ * Decrement negative dentry count if it was in the LRU list.
1848+ */
1849+ if (dentry->d_flags & DCACHE_LRU_LIST)
1850+ this_cpu_dec(nr_dentry_negative);
18231851 hlist_add_head(&dentry->d_u.d_alias, &inode->i_dentry);
18241852 raw_write_seqcount_begin(&dentry->d_seq);
18251853 __d_set_inode_and_type(dentry, inode, add_flags);
fs/direct-io.c+3−2
@@ -679,6 +679,7 @@ static int get_more_blocks(struct dio *dio, struct dio_submit *sdio, · 678 unmodified lines
679679 unsigned long fs_count; /* Number of filesystem-sized blocks */
680680 int create;
681681 unsigned int i_blkbits = sdio->blkbits + sdio->blkfactor;
682+ loff_t i_size;
682683
683684 /*
684685 * If there was a memory error and we've overwritten all the
@@ -708,8 +709,8 @@ static int get_more_blocks(struct dio *dio, struct dio_submit *sdio, · 23 unmodified lines
708709 */
709710 create = dio->op == REQ_OP_WRITE;
710711 if (dio->flags & DIO_SKIP_HOLES) {
711− if (fs_startblk <= ((i_size_read(dio->inode) - 1) >>
712− i_blkbits))
712+ i_size = i_size_read(dio->inode);
713+ if (i_size && fs_startblk <= (i_size - 1) >> i_blkbits)
713714 create = 0;
714715 }
715716
fs/drop_caches.c+7−1
@@ -21,8 +21,13 @@ static void drop_pagecache_sb(struct super_block *sb, void *unused) · 20 unmodified lines
2121 spin_lock(&sb->s_inode_list_lock);
2222 list_for_each_entry(inode, &sb->s_inodes, i_sb_list) {
2323 spin_lock(&inode->i_lock);
24+ /*
25+ * We must skip inodes in unusual state. We may also skip
26+ * inodes without pages but we deliberately won't in case
27+ * we need to reschedule to avoid softlockups.
28+ */
2429 if ((inode->i_state & (I_FREEING|I_WILL_FREE|I_NEW)) ||
25− (inode->i_mapping->nrpages == 0)) {
30+ (inode->i_mapping->nrpages == 0 && !need_resched())) {
2631 spin_unlock(&inode->i_lock);
2732 continue;
2833 }
@@ -30,6 +35,7 @@ static void drop_pagecache_sb(struct super_block *sb, void *unused) · 1 unmodified line
3035 spin_unlock(&inode->i_lock);
3136 spin_unlock(&sb->s_inode_list_lock);
3237
38+ cond_resched();
3339 invalidate_mapping_pages(inode->i_mapping, 0, -1);
3440 iput(toput_inode);
3541 toput_inode = inode;
fs/fs-writeback.c+38−2
@@ -331,11 +331,22 @@ struct inode_switch_wbs_context { · 330 unmodified lines
331331 struct work_struct work;
332332 };
333333
334+static void bdi_down_write_wb_switch_rwsem(struct backing_dev_info *bdi)
335+{
336+ down_write(&bdi->wb_switch_rwsem);
337+}
338+
339+static void bdi_up_write_wb_switch_rwsem(struct backing_dev_info *bdi)
340+{
341+ up_write(&bdi->wb_switch_rwsem);
342+}
343+
334344 static void inode_switch_wbs_work_fn(struct work_struct *work)
335345 {
336346 struct inode_switch_wbs_context *isw =
337347 container_of(work, struct inode_switch_wbs_context, work);
338348 struct inode *inode = isw->inode;
349+ struct backing_dev_info *bdi = inode_to_bdi(inode);
339350 struct address_space *mapping = inode->i_mapping;
340351 struct bdi_writeback *old_wb = inode->i_wb;
341352 struct bdi_writeback *new_wb = isw->new_wb;
@@ -343,6 +354,12 @@ static void inode_switch_wbs_work_fn(struct work_struct *work) · 1 unmodified line
343354 struct page *page;
344355 bool switched = false;
345356
357+ /*
358+ * If @inode switches cgwb membership while sync_inodes_sb() is
359+ * being issued, sync_inodes_sb() might miss it. Synchronize.
360+ */
361+ down_read(&bdi->wb_switch_rwsem);
362+
346363 /*
347364 * By the time control reaches here, RCU grace period has passed
348365 * since I_WB_SWITCH assertion and all wb stat update transactions
@@ -428,6 +445,8 @@ skip_switch: · 79 unmodified lines
428445 spin_unlock(&new_wb->list_lock);
429446 spin_unlock(&old_wb->list_lock);
430447
448+ up_read(&bdi->wb_switch_rwsem);
449+
431450 if (switched) {
432451 wb_wakeup(new_wb);
433452 wb_put(old_wb);
@@ -468,9 +487,18 @@ static void inode_switch_wbs(struct inode *inode, int new_wb_id) · 34 unmodified lines
468487 if (inode->i_state & I_WB_SWITCH)
469488 return;
470489
490+ /*
491+ * Avoid starting new switches while sync_inodes_sb() is in
492+ * progress. Otherwise, if the down_write protected issue path
493+ * blocks heavily, we might end up starting a large number of
494+ * switches which will block on the rwsem.
495+ */
496+ if (!down_read_trylock(&bdi->wb_switch_rwsem))
497+ return;
498+
471499 isw = kzalloc(sizeof(*isw), GFP_ATOMIC);
472500 if (!isw)
473− return;
501+ goto out_unlock;
474502
475503 /* find and pin the new wb */
476504 rcu_read_lock();
@@ -504,12 +532,14 @@ static void inode_switch_wbs(struct inode *inode, int new_wb_id) · 27 unmodified lines
504532 * Let's continue after I_WB_SWITCH is guaranteed to be visible.
505533 */
506534 call_rcu(&isw->rcu_head, inode_switch_wbs_rcu_fn);
507− return;
535+ goto out_unlock;
508536
509537 out_free:
510538 if (isw->new_wb)
511539 wb_put(isw->new_wb);
512540 kfree(isw);
541+out_unlock:
542+ up_read(&bdi->wb_switch_rwsem);
513543 }
514544
515545 /**
@@ -887,6 +917,9 @@ fs_initcall(cgroup_writeback_init); · 371 unmodified lines
887917
888918 #else /* CONFIG_CGROUP_WRITEBACK */
889919
920+static void bdi_down_write_wb_switch_rwsem(struct backing_dev_info *bdi) { }
921+static void bdi_up_write_wb_switch_rwsem(struct backing_dev_info *bdi) { }
922+
890923 static struct bdi_writeback *
891924 locked_inode_to_wb_and_lock_list(struct inode *inode)
892925 __releases(&inode->i_lock)
@@ -2413,8 +2446,11 @@ void sync_inodes_sb(struct super_block *sb) · 1520 unmodified lines
24132446 return;
24142447 WARN_ON(!rwsem_is_locked(&sb->s_umount));
24152448
2449+ /* protect against inode wb switch, see inode_switch_wbs_work_fn() */
2450+ bdi_down_write_wb_switch_rwsem(bdi);
24162451 bdi_split_work_to_wbs(bdi, &work, false);
24172452 wb_wait_for_completion(bdi, &done);
2453+ bdi_up_write_wb_switch_rwsem(bdi);
24182454
24192455 wait_sb_inodes(sb);
24202456 }
fs/fuse/dev.c+3−1
@@ -1742,7 +1742,6 @@ static int fuse_retrieve(struct fuse_conn *fc, struct inode *inode, · 1741 unmodified lines
17421742 req->in.h.nodeid = outarg->nodeid;
17431743 req->in.numargs = 2;
17441744 req->in.argpages = 1;
1745− req->page_descs[0].offset = offset;
17461745 req->end = fuse_retrieve_end;
17471746
17481747 index = outarg->offset >> PAGE_SHIFT;
@@ -1757,6 +1756,7 @@ static int fuse_retrieve(struct fuse_conn *fc, struct inode *inode, · 8 unmodified lines
17571756
17581757 this_num = min_t(unsigned, num, PAGE_SIZE - offset);
17591758 req->pages[req->num_pages] = page;
1759+ req->page_descs[req->num_pages].offset = offset;
17601760 req->page_descs[req->num_pages].length = this_num;
17611761 req->num_pages++;
17621762
@@ -2077,8 +2077,10 @@ static ssize_t fuse_dev_splice_write(struct pipe_inode_info *pipe, · 314 unmodified lines
20772077
20782078 ret = fuse_dev_do_write(fud, &cs, len);
20792079
2080+ pipe_lock(pipe);
20802081 for (idx = 0; idx < nbuf; idx++)
20812082 pipe_buf_release(pipe, &bufs[idx]);
2083+ pipe_unlock(pipe);
20822084
20832085 out:
20842086 kvfree(bufs);
fs/fuse/file.c+1−1
@@ -1782,7 +1782,7 @@ static bool fuse_writepage_in_flight(struct fuse_req *new_req, · 1781 unmodified lines
17821782 spin_unlock(&fc->lock);
17831783
17841784 dec_wb_stat(&bdi->wb, WB_WRITEBACK);
1785− dec_node_page_state(page, NR_WRITEBACK_TEMP);
1785+ dec_node_page_state(new_req->pages[0], NR_WRITEBACK_TEMP);
17861786 wb_writeout_inc(&bdi->wb);
17871787 fuse_writepage_free(fc, new_req);
17881788 fuse_request_free(new_req);
fs/fuse/inode.c+1−1
@@ -628,6 +628,7 @@ void fuse_conn_init(struct fuse_conn *fc, struct user_namespace *user_ns) · 627 unmodified lines
628628 get_random_bytes(&fc->scramble_key, sizeof(fc->scramble_key));
629629 fc->pid_ns = get_pid_ns(task_active_pid_ns(current));
630630 fc->user_ns = get_user_ns(user_ns);
631+ fc->max_pages = FUSE_DEFAULT_MAX_PAGES_PER_REQ;
631632 }
632633 EXPORT_SYMBOL_GPL(fuse_conn_init);
633634
@@ -1162,7 +1163,6 @@ static int fuse_fill_super(struct super_block *sb, void *data, int silent) · 528 unmodified lines
11621163 fc->user_id = d.user_id;
11631164 fc->group_id = d.group_id;
11641165 fc->max_read = max_t(unsigned, 4096, d.max_read);
1165− fc->max_pages = FUSE_DEFAULT_MAX_PAGES_PER_REQ;
11661166
11671167 /* Used by get_root_inode() */
11681168 sb->s_fs_info = fc;
fs/gfs2/rgrp.c+1−1
@@ -1780,9 +1780,9 @@ static int gfs2_rbm_find(struct gfs2_rbm *rbm, u8 state, u32 *minext, · 1779 unmodified lines
17801780 goto next_iter;
17811781 }
17821782 if (ret == -E2BIG) {
1783− n += rbm->bii - initial_bii;
17841783 rbm->bii = 0;
17851784 rbm->offset = 0;
1785+ n += (rbm->bii - initial_bii);
17861786 goto res_covered_end_of_rgrp;
17871787 }
17881788 return ret;
fs/iomap.c+30−7
@@ -116,6 +116,12 @@ iomap_page_create(struct inode *inode, struct page *page) · 115 unmodified lines
116116 atomic_set(&iop->read_count, 0);
117117 atomic_set(&iop->write_count, 0);
118118 bitmap_zero(iop->uptodate, PAGE_SIZE / SECTOR_SIZE);
119+
120+ /*
121+ * migrate_page_move_mapping() assumes that pages with private data have
122+ * their count elevated by 1.
123+ */
124+ get_page(page);
119125 set_page_private(page, (unsigned long)iop);
120126 SetPagePrivate(page);
121127 return iop;
@@ -132,6 +138,7 @@ iomap_page_release(struct page *page) · 10 unmodified lines
132138 WARN_ON_ONCE(atomic_read(&iop->write_count));
133139 ClearPagePrivate(page);
134140 set_page_private(page, 0);
141+ put_page(page);
135142 kfree(iop);
136143 }
137144
@@ -569,8 +576,10 @@ iomap_migrate_page(struct address_space *mapping, struct page *newpage, · 431 unmodified lines
569576
570577 if (page_has_private(page)) {
571578 ClearPagePrivate(page);
579+ get_page(newpage);
572580 set_page_private(newpage, page_private(page));
573581 set_page_private(page, 0);
582+ put_page(page);
574583 SetPagePrivate(newpage);
575584 }
576585
@@ -1804,6 +1813,7 @@ iomap_dio_rw(struct kiocb *iocb, struct iov_iter *iter, · 1227 unmodified lines
18041813 loff_t pos = iocb->ki_pos, start = pos;
18051814 loff_t end = iocb->ki_pos + count - 1, ret = 0;
18061815 unsigned int flags = IOMAP_DIRECT;
1816+ bool wait_for_completion = is_sync_kiocb(iocb);
18071817 struct blk_plug plug;
18081818 struct iomap_dio *dio;
18091819
@@ -1823,7 +1833,6 @@ iomap_dio_rw(struct kiocb *iocb, struct iov_iter *iter, · 13 unmodified lines
18231833 dio->end_io = end_io;
18241834 dio->error = 0;
18251835 dio->flags = 0;
1826− dio->wait_for_completion = is_sync_kiocb(iocb);
18271836
18281837 dio->submit.iter = iter;
18291838 dio->submit.waiter = current;
@@ -1878,7 +1887,7 @@ iomap_dio_rw(struct kiocb *iocb, struct iov_iter *iter, · 48 unmodified lines
18781887 dio_warn_stale_pagecache(iocb->ki_filp);
18791888 ret = 0;
18801889
1881− if (iov_iter_rw(iter) == WRITE && !dio->wait_for_completion &&
1890+ if (iov_iter_rw(iter) == WRITE && !wait_for_completion &&
18821891 !inode->i_sb->s_dio_done_wq) {
18831892 ret = sb_init_dio_done_wq(inode->i_sb);
18841893 if (ret < 0)
@@ -1894,7 +1903,7 @@ iomap_dio_rw(struct kiocb *iocb, struct iov_iter *iter, · 9 unmodified lines
18941903 if (ret <= 0) {
18951904 /* magic error code to fall back to buffered I/O */
18961905 if (ret == -ENOTBLK) {
1897− dio->wait_for_completion = true;
1906+ wait_for_completion = true;
18981907 ret = 0;
18991908 }
19001909 break;
@@ -1916,8 +1925,24 @@ iomap_dio_rw(struct kiocb *iocb, struct iov_iter *iter, · 15 unmodified lines
19161925 if (dio->flags & IOMAP_DIO_WRITE_FUA)
19171926 dio->flags &= ~IOMAP_DIO_NEED_SYNC;
19181927
1928+ /*
1929+ * We are about to drop our additional submission reference, which
1930+ * might be the last reference to the dio. There are three three
1931+ * different ways we can progress here:
1932+ *
1933+ * (a) If this is the last reference we will always complete and free
1934+ * the dio ourselves.
1935+ * (b) If this is not the last reference, and we serve an asynchronous
1936+ * iocb, we must never touch the dio after the decrement, the
1937+ * I/O completion handler will complete and free it.
1938+ * (c) If this is not the last reference, but we serve a synchronous
1939+ * iocb, the I/O completion handler will wake us up on the drop
1940+ * of the final reference, and we will complete and free it here
1941+ * after we got woken by the I/O completion handler.
1942+ */
1943+ dio->wait_for_completion = wait_for_completion;
19191944 if (!atomic_dec_and_test(&dio->ref)) {
1920− if (!dio->wait_for_completion)
1945+ if (!wait_for_completion)
19211946 return -EIOCBQUEUED;
19221947
19231948 for (;;) {
@@ -1934,9 +1959,7 @@ iomap_dio_rw(struct kiocb *iocb, struct iov_iter *iter, · 10 unmodified lines
19341959 __set_current_state(TASK_RUNNING);
19351960 }
19361961
1937− ret = iomap_dio_complete(dio);
1938−
1939− return ret;
1962+ return iomap_dio_complete(dio);
19401963
19411964 out_free_dio:
19421965 kfree(dio);
fs/nfs/nfs4file.c+1−7
@@ -133,15 +133,9 @@ static ssize_t nfs4_copy_file_range(struct file *file_in, loff_t pos_in, · 132 unmodified lines
133133 struct file *file_out, loff_t pos_out,
134134 size_t count, unsigned int flags)
135135 {
136− ssize_t ret;
137−
138136 if (file_inode(file_in) == file_inode(file_out))
139137 return -EINVAL;
140−retry:
141− ret = nfs42_proc_copy(file_in, pos_in, file_out, pos_out, count);
142− if (ret == -EAGAIN)
143− goto retry;
144− return ret;
138+ return nfs42_proc_copy(file_in, pos_in, file_out, pos_out, count);
145139 }
146140
147141 static loff_t nfs4_file_llseek(struct file *filep, loff_t offset, int whence)
fs/nfs/super.c+5−0
@@ -1895,6 +1895,11 @@ static int nfs_parse_devname(const char *dev_name, · 1894 unmodified lines
18951895 size_t len;
18961896 char *end;
18971897
1898+ if (unlikely(!dev_name || !*dev_name)) {
1899+ dfprintk(MOUNT, "NFS: device name not specified\n");
1900+ return -EINVAL;
1901+ }
1902+
18981903 /* Is the host name protected with square brakcets? */
18991904 if (*dev_name == '[') {
19001905 end = strchr(++dev_name, ']');
fs/nfs/write.c+5−4
@@ -621,11 +621,12 @@ static int nfs_page_async_flush(struct nfs_pageio_descriptor *pgio, · 620 unmodified lines
621621 nfs_set_page_writeback(page);
622622 WARN_ON_ONCE(test_bit(PG_CLEAN, &req->wb_flags));
623623
624− ret = 0;
624+ ret = req->wb_context->error;
625625 /* If there is a fatal error that covers this write, just exit */
626− if (nfs_error_is_fatal_on_server(req->wb_context->error))
626+ if (nfs_error_is_fatal_on_server(ret))
627627 goto out_launder;
628628
629+ ret = 0;
629630 if (!nfs_pageio_add_request(pgio, req)) {
630631 ret = pgio->pg_error;
631632 /*
@@ -635,9 +636,9 @@ static int nfs_page_async_flush(struct nfs_pageio_descriptor *pgio, · 3 unmodified lines
635636 nfs_context_set_write_error(req->wb_context, ret);
636637 if (nfs_error_is_fatal_on_server(ret))
637638 goto out_launder;
638− }
639+ } else
640+ ret = -EAGAIN;
639641 nfs_redirty_request(req);
640− ret = -EAGAIN;
641642 } else
642643 nfs_add_stats(page_file_mapping(page)->host,
643644 NFSIOS_WRITEPAGES, 1);
fs/nfsd/vfs.c+4−2
@@ -557,9 +557,11 @@ __be32 nfsd4_clone_file_range(struct file *src, u64 src_pos, struct file *dst, · 556 unmodified lines
557557 loff_t cloned;
558558
559559 cloned = vfs_clone_file_range(src, src_pos, dst, dst_pos, count, 0);
560+ if (cloned < 0)
561+ return nfserrno(cloned);
560562 if (count && cloned != count)
561− cloned = -EINVAL;
562− return nfserrno(cloned < 0 ? cloned : 0);
563+ return nfserrno(-EINVAL);
564+ return 0;
563565 }
564566
565567 ssize_t nfsd_copy_file_range(struct file *src, u64 src_pos, struct file *dst,
fs/notify/inotify/inotify_user.c+4−2
@@ -724,8 +724,10 @@ SYSCALL_DEFINE3(inotify_add_watch, int, fd, const char __user *, pathname, · 723 unmodified lines
724724 return -EBADF;

11 more lines aren’t shown here.

fs/proc/generic.c+3−1

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

fs/proc/internal.h+1−0

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

fs/proc/proc_net.c+20−0

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

fs/pstore/ram.c+4−8

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

include/dt-bindings/clock/marvell,mmp2.h+0−1

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

include/dt-bindings/reset/amlogic,meson-axg-reset.h+1−2

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

include/linux/backing-dev-defs.h+1−0

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

include/linux/bcma/bcma_soc.h+1−0

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

include/linux/blk_types.h+1−1

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

include/linux/bpf_verifier.h+1−0

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

include/linux/bpfilter.h+12−3

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

include/linux/compiler-clang.h+2−3

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

include/linux/compiler-gcc.h+0−4

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

include/linux/compiler-intel.h+1−3

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

include/linux/compiler.h+3−1

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

include/linux/cpu.h+0−2

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

include/linux/dcache.h+4−3

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

include/linux/fb.h+1−0

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

include/linux/fs.h+5−4

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

include/linux/hid-debug.h+4−5

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

include/linux/hid.h+1−2

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

include/linux/hyperv.h+3−2

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

include/linux/ide.h+2−0

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

include/linux/if_arp.h+1−0

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

include/linux/interrupt.h+1−0

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

include/linux/libnvdimm.h+1−1

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

include/linux/memory_hotplug.h+10−8

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

include/linux/mfd/cros_ec_commands.h+94−0

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

include/linux/mfd/ingenic-tcu.h+1−1

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

include/linux/mfd/madera/core.h+7−0

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

include/linux/mfd/ti_am335x_tscadc.h+4−0

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

include/linux/mfd/tmio.h+1−1

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

include/linux/of.h+0−1

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

include/linux/phy.h+4−2

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

include/linux/pm_runtime.h+1−1

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

include/linux/qed/qed_chain.h+31−0

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

include/linux/sched.h+10−1

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

include/linux/sched/coredump.h+1−0

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

include/linux/sched/wake_q.h+5−1

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

include/linux/skbuff.h+1−0

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

include/linux/umh.h+2−0

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

include/linux/virtio_config.h+9−4

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

include/linux/xarray.h+170−57

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

include/net/af_rxrpc.h+0−16

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

include/net/ax25.h+12−0

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

include/net/ip_fib.h+1−1

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

include/net/netfilter/nf_flow_table.h+0−1

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

include/net/tls.h+2−0

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

include/rdma/ib_verbs.h+22−2

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

include/sound/compress_driver.h+5−1

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

include/sound/hda_codec.h+1−0

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

include/sound/soc.h+6−0

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

include/trace/events/afs.h+2−0

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

include/uapi/linux/android/binderfs.hrenamed from include/uapi/linux/android/binder_ctl.h+5−5

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

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

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

include/uapi/linux/in.h+1−1

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

include/uapi/linux/input.h+5−1

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

include/uapi/linux/ptp_clock.h+1−1

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

include/uapi/linux/virtio_config.h+6−0

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

include/uapi/linux/virtio_ring.h+0−10

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

include/uapi/rdma/hns-abi.h+5−0

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

include/uapi/rdma/vmw_pvrdma-abi.h+1−0

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

include/xen/arm/page-coherent.h+3−94

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

init/Kconfig+13−1

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

kernel/bpf/btf.c+7−7

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

kernel/bpf/cgroup.c+1−0

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

kernel/bpf/map_in_map.c+15−2

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

kernel/bpf/stackmap.c+9−3

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

kernel/bpf/verifier.c+48−13

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

kernel/cpu.c+5−33

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

kernel/dma/swiotlb.c+2−0

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

kernel/events/core.c+7−7

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

kernel/exit.c+12−3

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

kernel/futex.c+8−5

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

kernel/irq/irqdesc.c+1−1

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

kernel/irq/manage.c+3−0

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

kernel/locking/rwsem-xadd.c+9−2

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

kernel/sched/core.c+16−3

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

kernel/sched/fair.c+1−0

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

kernel/sched/psi.c+17−4

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

kernel/seccomp.c+4−0

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

kernel/smp.c+0−2

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

kernel/time/posix-cpu-timers.c+1−0

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

kernel/trace/trace_kprobe.c+9−3

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

kernel/trace/trace_uprobe.c+8−1

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

kernel/umh.c+31−2

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

kernel/workqueue.c+23−0

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

kernel/workqueue_internal.h+5−1

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

lib/int_sqrt.c+1−1

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

lib/sbitmap.c+3−10

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

lib/test_kmod.c+1−1

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

lib/test_xarray.c+45−12

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

lib/xarray.c+54−38

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

mm/backing-dev.c+1−0

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

mm/hugetlb.c+2−1

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

mm/kasan/Makefile+1−0

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

mm/memory-failure.c+2−1

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

mm/memory_hotplug.c+27−35

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

mm/migrate.c+5−7

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

mm/mincore.c+81−13

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

mm/oom_kill.c+10−2

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

mm/page_alloc.c+0−12

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

net/ax25/ax25_ip.c+2−2

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

net/ax25/ax25_route.c+8−11

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

net/bpfilter/bpfilter_kern.c+42−34

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

net/bpfilter/bpfilter_umh_blob.S+1−1

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

net/bridge/br_fdb.c+5−0

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

net/bridge/br_forward.c+5−5

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

net/bridge/br_netfilter_hooks.c+1−1

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

net/bridge/br_netfilter_ipv6.c+1−0

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

net/bridge/br_private.h+1−0

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

net/bridge/br_vlan.c+13−13

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

net/bridge/netfilter/ebtables.c+10−5

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

net/bridge/netfilter/nft_reject_bridge.c+1−0

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

net/can/bcm.c+27−0

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

net/can/gw.c+27−3

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

net/ceph/messenger.c+3−2

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

net/core/dev.c+3−0

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

net/core/filter.c+21−13

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

net/core/lwt_bpf.c+1−0

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

net/core/neighbour.c+10−5

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

net/core/skbuff.c+1−6

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

net/decnet/dn_dev.c+1−1

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

net/ipv4/bpfilter/sockopt.c+48−10

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

net/ipv4/devinet.c+1−1

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

net/ipv4/fib_frontend.c+2−2

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

net/ipv4/fib_trie.c+12−3

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

net/ipv4/fou.c+9−3

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

net/ipv4/gre_demux.c+17−0

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

net/ipv4/ip_gre.c+14−18

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

net/ipv4/ip_input.c+1−0

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

net/ipv4/ip_sockglue.c+5−7

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

net/ipv4/ip_tunnel.c+7−1

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

net/ipv4/ip_vti.c+50−0

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

net/ipv4/netfilter/ipt_CLUSTERIP.c+1−1

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

net/ipv4/tcp.c+1−1

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

net/ipv4/tcp_timer.c+1−1

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

net/ipv4/udp.c+13−5

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

net/ipv4/udp_impl.h+1−0

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

net/ipv4/udplite.c+1−0

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

net/ipv6/addrconf.c+5−3

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

net/ipv6/af_inet6.c+13−1

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

net/ipv6/datagram.c+5−6

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

net/ipv6/fou6.c+15−2

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

net/ipv6/icmp.c+6−2

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

net/ipv6/ip6_gre.c+10−8

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

net/ipv6/ip6mr.c+3−4

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

net/ipv6/route.c+2−12

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

net/ipv6/udp.c+17−9

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

net/ipv6/udp_impl.h+1−0

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

net/ipv6/udplite.c+1−0

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

net/mac80211/cfg.c+4−0

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

net/mac80211/rx.c+4−2

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

net/netfilter/ipvs/ip_vs_ctl.c+12−0

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

net/netfilter/nf_flow_table_core.c+3−2

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

net/netfilter/nf_tables_api.c+7−7

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

net/netfilter/nfnetlink_osf.c+4−0

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

net/netfilter/nft_compat.c+142−47

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

net/netfilter/nft_flow_offload.c+8−5

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

net/netrom/nr_timer.c+10−10

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

net/openvswitch/flow.c+5−3

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

net/openvswitch/flow_netlink.c+1−1

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

net/packet/af_packet.c+4−3

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

net/rds/ib_send.c+2−2

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

net/rds/message.c+2−2

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

net/rds/rds.h+0−4

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

net/rds/send.c+1−1

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

net/rose/rose_route.c+5−0

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

net/rxrpc/af_rxrpc.c+0−70

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

net/rxrpc/ar-internal.h+12−7

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

net/rxrpc/call_object.c+0−97

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

net/rxrpc/conn_client.c+1−4

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

net/rxrpc/sendmsg.c+11−13

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

net/sched/act_tunnel_key.c+11−8

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

net/sched/cls_api.c+1−2

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

net/sched/cls_flower.c+14−5

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

net/sched/sch_cake.c+3−2

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

net/sched/sch_cbs.c+2−1

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

net/sched/sch_drr.c+5−2

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

net/sched/sch_dsmark.c+2−1

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

net/sched/sch_hfsc.c+5−4

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

net/sched/sch_htb.c+2−1

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

net/sched/sch_prio.c+2−1

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

net/sched/sch_qfq.c+12−8

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

net/sched/sch_tbf.c+2−1

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

net/sctp/ipv6.c+3−5

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

net/sctp/protocol.c+3−4

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

net/sctp/sm_make_chunk.c+8−3

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

net/sctp/stream.c+25−33

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

net/smc/af_smc.c+3−1

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

net/sunrpc/auth.c+3−0

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

net/sunrpc/auth_gss/auth_gss.c+9−3

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

net/sunrpc/clnt.c+12−8

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

net/sunrpc/xprt.c+2−1

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

net/sunrpc/xprtrdma/svc_rdma_sendto.c+99−6

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

net/sunrpc/xprtrdma/svc_rdma_transport.c+3−6

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

net/sunrpc/xprtrdma/verbs.c+4−6

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

net/sunrpc/xprtsock.c+22−0

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

net/tipc/netlink_compat.c+52−2

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

net/tipc/topsrv.c+1−1

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

net/tls/tls_sw.c+5−1

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

net/wireless/nl80211.c+1−1

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

net/wireless/reg.c+9−4

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

net/xdp/xdp_umem.c+13−3

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

net/xfrm/xfrm_policy.c+33−30

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

net/xfrm/xfrm_user.c+9−4

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

samples/bpf/Makefile+1−0

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

samples/bpf/asm_goto_workaround.h+16−0

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

samples/bpf/test_cgrp2_attach2.c+7−7

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

samples/bpf/test_current_task_under_cgroup_user.c+1−1

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

samples/bpf/xdp1_user.c+1−1

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

scripts/Kbuild.include+0−4

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

scripts/gcc-plugins/arm_ssp_per_task_plugin.c+21−2

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

scripts/kconfig/Makefile+1−1

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

security/apparmor/domain.c+4−1

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

security/apparmor/lsm.c+2−0

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

security/security.c+7−0

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

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

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

security/yama/yama_lsm.c+3−1

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

sound/core/compress_offload.c+2−1

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

sound/core/pcm_lib.c+8−1

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

sound/pci/hda/hda_bind.c+2−1

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

sound/pci/hda/hda_intel.c+2−0

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

sound/pci/hda/patch_ca0132.c+3−1

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

sound/pci/hda/patch_conexant.c+1−0

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

sound/pci/hda/patch_realtek.c+80−60

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

sound/soc/amd/raven/acp3x-pcm-dma.c+4−2

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

sound/soc/codecs/hdac_hdmi.c+13−103

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

sound/soc/codecs/pcm512x.c+4−7

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

sound/soc/codecs/rt274.c+4−1

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

sound/soc/codecs/rt5514-spi.c+2−0

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

sound/soc/codecs/rt5682.c+1−0

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

sound/soc/codecs/rt5682.h+12−12

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

sound/soc/codecs/tlv320aic32x4.c+4−0

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

sound/soc/fsl/imx-audmux.c+12−12

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

sound/soc/intel/Kconfig+1−1

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

sound/soc/intel/atom/sst-mfld-platform-pcm.c+7−1

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

sound/soc/intel/boards/broadwell.c+1−1

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

sound/soc/intel/boards/glk_rt5682_max98357a.c+7−38

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

sound/soc/intel/boards/haswell.c+1−1

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

sound/soc/intel/skylake/skl.c+4−9

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

sound/soc/qcom/qdsp6/q6asm-dai.c+12−5

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

sound/soc/qcom/sdm845.c+22−9

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

sound/soc/sh/dma-sh7760.c+1−1

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

sound/soc/soc-core.c+28−6

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

sound/soc/soc-dapm.c+5−5

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

sound/soc/ti/davinci-mcasp.c+64−72

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

sound/soc/xilinx/Kconfig+1−1

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

sound/soc/xilinx/xlnx_i2s.c+7−8

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

sound/usb/quirks.c+2−0

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

tools/arch/powerpc/include/uapi/asm/perf_regs.h+1−0

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

tools/bpf/bpftool/Makefile+8−1

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

tools/bpf/bpftool/btf_dumper.c+7−6

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

tools/bpf/bpftool/json_writer.c+1−6

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

tools/bpf/bpftool/json_writer.h+0−5

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

tools/include/uapi/linux/pkt_sched.h+1163−0

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

tools/lib/bpf/.gitignore+1−0

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

tools/lib/bpf/README.rst+14−0

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

tools/lib/bpf/bpf.c+15−4

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

tools/perf/arch/powerpc/include/perf_regs.h+2−1

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

tools/perf/arch/powerpc/util/perf_regs.c+1−0

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

tools/perf/builtin-script.c+3−6

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

tools/perf/ui/browsers/annotate.c+10−6

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

tools/perf/util/cpumap.c+9−2

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

tools/perf/util/ordered-events.c+4−2

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

tools/perf/util/setup.py+2−0

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

tools/testing/nvdimm/dimm_devs.c+2−2

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

tools/testing/selftests/bpf/.gitignore+1−0

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

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

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

tools/testing/selftests/bpf/cgroup_helpers.c+3−3

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

tools/testing/selftests/bpf/test_btf.c+21−8

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

tools/testing/selftests/bpf/test_cgroup_storage.c+1−1

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

tools/testing/selftests/bpf/test_dev_cgroup.c+1−1

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

tools/testing/selftests/bpf/test_netcnt.c+1−1

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

tools/testing/selftests/bpf/test_progs.c+30−0

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

tools/testing/selftests/bpf/test_skb_cgroup_id_user.c+1−1

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

tools/testing/selftests/bpf/test_sock.c+1−1

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

tools/testing/selftests/bpf/test_sock_addr.c+51−4

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

tools/testing/selftests/bpf/test_socket_cookie.c+1−1

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

tools/testing/selftests/bpf/test_tcpbpf_user.c+1−1

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

tools/testing/selftests/bpf/test_tcpnotify_user.c+1−1

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

tools/testing/selftests/bpf/test_verifier.c+120−0

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

tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh+10−3

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

tools/testing/selftests/drivers/net/mlxsw/rtnetlink.sh+20−0

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

tools/testing/selftests/drivers/net/mlxsw/vxlan.sh+18−0

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

tools/testing/selftests/gpio/gpio-mockup-chardev.c+6−3

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

tools/testing/selftests/ir/Makefile+2−0

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

tools/testing/selftests/kvm/lib/kvm_util.c+2−7

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

tools/testing/selftests/kvm/x86_64/evmcs_test.c+6−0

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

tools/testing/selftests/net/Makefile+1−1

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

tools/testing/selftests/net/forwarding/bridge_vlan_aware.sh+46−1

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

tools/testing/selftests/net/forwarding/vxlan_bridge_1d.sh+1−1

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

tools/testing/selftests/net/ip_defrag.c+87−9

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

tools/testing/selftests/net/ip_defrag.sh+8−1

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

tools/testing/selftests/net/xfrm_policy.sh+131−22

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

tools/testing/selftests/networking/timestamping/txtimestamp.c+1−1

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

tools/testing/selftests/proc/.gitignore+1−0

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

tools/testing/selftests/proc/Makefile+1−0

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

tools/testing/selftests/proc/setns-dcache.c+129−0

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

tools/testing/selftests/rtc/rtctest.c+104−5

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

tools/testing/selftests/seccomp/Makefile+1−1

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

tools/testing/selftests/seccomp/seccomp_bpf.c+62−20

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

tools/testing/selftests/tc-testing/tc-tests/actions/ife.json+44−44

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

tools/testing/selftests/tc-testing/tc-tests/actions/tunnel_key.json+1−30

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

tools/testing/selftests/timers/Makefile+1−1

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

tools/testing/selftests/vm/gup_benchmark.c+1−0

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

tools/testing/selftests/x86/mpx-mini-test.c+1−1

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

tools/testing/selftests/x86/protection_keys.c+31−10

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

tools/testing/selftests/x86/unwind_vdso.c+0−1

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

virt/kvm/kvm_main.c+2−1

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

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t