History

Merge tag 'v4.12-rc6' into patchwork

Linux 4.12-rc6 * tag 'v4.12-rc6': (813 commits) Linux 4.12-rc6 mm: larger stack guard gap, between vmas virtio_balloon: disable VIOMMU support mm: correct the comment when reclaimed pages exceed the scanned pages userfaultfd: shmem: handle coredumping in handle_userfault() mm: numa: avoid waiting on freed migrated pages swap: cond_resched in swap_cgroup_prepare() mm/memory-failure.c: use compound_head() flags for huge pages perf unwind: Report module before querying isactivation in dwfl unwind fs: pass on flags in compat_writev objtool: Add fortify_panic as __noreturn function powerpc/debug: Add missing warn flag to WARN_ON's non-builtin path USB: gadgetfs, dummy-hcd, net2280: fix locking for callbacks drm: mxsfb_crtc: Reset the eLCDIF controller drm/mgag200: Fix to always set HiPri for G200e4 V2 i2c: ismt: fix wrong device address when unmap the data buffer i2c: rcar: use correct length when unmapping DMA powerpc/xive: Fix offset for store EOI MMIOs drm/tegra: Correct idr_alloc() minimum id drm/tegra: Fix lockup on a use of staging API ...

Mauro Carvalho Chehab committed 9 years ago

Commit ff6ccad2 parents 3bd30b2 41f1830898 files · +8658 −5429Browse files

Unified · Split

898 files
  1. Documentation/admin-guide/kernel-parameters.txt +16 −0
  2. Documentation/devicetree/bindings/net/dsa/marvell.txt +4 −0
  3. Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt +0 −2
  4. Documentation/devicetree/bindings/usb/dwc2.txt +1 −0
  5. Documentation/networking/dpaa.txt +194 −0
  6. Documentation/networking/scaling.txt +1 −1
  7. Documentation/networking/tcp.txt +13 −18
  8. MAINTAINERS +16 −17
  9. Makefile +1 −1
  10. arch/arc/mm/mmap.c +1 −1
  11. arch/arm/boot/compressed/efi-header.S +1 −3
  12. arch/arm/boot/compressed/head.S +10 −7
  13. arch/arm/boot/dts/am335x-sl50.dts +2 −6
  14. arch/arm/boot/dts/bcm283x.dtsi +5 −0
  15. arch/arm/boot/dts/imx6ul-14x14-evk.dts +6 −0
  16. arch/arm/boot/dts/keystone-k2l-netcp.dtsi +2 −2
  17. arch/arm/boot/dts/keystone-k2l.dtsi +8 −0
  18. arch/arm/boot/dts/sunxi-h3-h5.dtsi +4 −3
  19. arch/arm/boot/dts/versatile-pb.dts +1 −1
  20. arch/arm/common/mcpm_entry.c +3 −3
  21. arch/arm/include/asm/device.h +2 −1
  22. arch/arm/include/asm/pgtable-nommu.h +1 −0
  23. arch/arm/kvm/init.S +2 −3
  24. arch/arm/mach-at91/Kconfig +1 −0
  25. arch/arm/mach-davinci/pm.c +6 −1
  26. arch/arm/mm/dma-mapping.c +14 −15
  27. arch/arm/mm/mmap.c +2 −2
  28. arch/arm64/Kconfig +0 −4
  29. arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +3 −2
  30. arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi +1 −1
  31. arch/arm64/boot/dts/allwinner/sunxi-h3-h5.dtsi +0 −1
  32. arch/arm64/boot/dts/marvell/armada-cp110-master.dtsi +1 −2
  33. arch/arm64/boot/dts/marvell/armada-cp110-slave.dtsi +1 −2
  34. arch/arm64/configs/defconfig +10 −0
  35. arch/arm64/include/asm/acpi.h +3 −3
  36. arch/arm64/include/asm/sysreg.h +4 −0
  37. arch/arm64/kernel/pci.c +3 −1
  38. arch/arm64/kvm/hyp-init.S +7 −4
  39. arch/arm64/kvm/vgic-sys-reg-v3.c +5 −5
  40. arch/arm64/net/bpf_jit_comp.c +5 −2
  41. arch/frv/include/asm/timex.h +6 −0
  42. arch/frv/mm/elf-fdpic.c +1 −1
  43. arch/hexagon/mm/uaccess.c +2 −3
  44. arch/mips/boot/Makefile +5 −5
  45. arch/mips/include/asm/highmem.h +5 −0
  46. arch/mips/include/asm/kprobes.h +2 −1
  47. arch/mips/include/asm/pgtable-32.h +6 −1
  48. arch/mips/kernel/branch.c +3 −1
  49. arch/mips/kernel/ftrace.c +5 −19
  50. arch/mips/kernel/perf_event_mipsxx.c +5 −1
  51. arch/mips/kernel/process.c +0 −1
  52. arch/mips/mm/mmap.c +1 −1
  53. arch/mips/mm/pgtable-32.c +3 −3
  54. arch/openrisc/kernel/process.c +0 −2
  55. arch/parisc/kernel/sys_parisc.c +9 −6
  56. arch/powerpc/Kconfig +0 −21
  57. arch/powerpc/include/asm/book3s/64/hash-4k.h +1 −1
  58. arch/powerpc/include/asm/bug.h +1 −1
  59. arch/powerpc/include/asm/cputable.h +1 −2
  60. arch/powerpc/include/asm/processor.h +12 −13
  61. arch/powerpc/include/asm/topology.h +14 −0
  62. arch/powerpc/include/asm/xive.h +7 −5
  63. arch/powerpc/kernel/dt_cpu_ftrs.c +48 −10
  64. arch/powerpc/kernel/process.c +3 −0
  65. arch/powerpc/kernel/setup-common.c +1 −1
  66. arch/powerpc/kernel/setup_64.c +2 −2
  67. arch/powerpc/kvm/book3s_xive_template.c +2 −2
  68. arch/powerpc/mm/hugetlbpage-radix.c +1 −1
  69. arch/powerpc/mm/mmap.c +2 −2
  70. arch/powerpc/mm/mmu_context_book3s64.c +1 −1
  71. arch/powerpc/mm/slice.c +1 −1
  72. arch/powerpc/perf/power9-pmu.c +2 −2
  73. arch/powerpc/platforms/Kconfig +11 −0
  74. arch/powerpc/platforms/cell/spufs/coredump.c +2 −0
  75. arch/powerpc/platforms/powernv/npu-dma.c +2 −1
  76. arch/powerpc/platforms/powernv/subcore.c +7 −1
  77. arch/powerpc/platforms/pseries/hotplug-memory.c +2 −0
  78. arch/powerpc/sysdev/simple_gpio.c +2 −1
  79. arch/powerpc/sysdev/xive/common.c +1 −1
  80. arch/s390/Kconfig +0 −3
  81. arch/s390/configs/default_defconfig +33 −6
  82. arch/s390/configs/gcov_defconfig +24 −4
  83. arch/s390/configs/performance_defconfig +23 −4
  84. arch/s390/configs/zfcpdump_defconfig +4 −2
  85. arch/s390/defconfig +3 −5
  86. arch/s390/include/asm/kvm_host.h +0 −1
  87. arch/s390/kernel/entry.S +13 −6
  88. arch/s390/kvm/interrupt.c +2 −2
  89. arch/s390/kvm/kvm-s390.c +0 −2
  90. arch/s390/mm/mmap.c +2 −2
  91. arch/sh/mm/mmap.c +2 −2
  92. arch/sparc/Kconfig +8 −7
  93. arch/sparc/include/asm/mmu_64.h +1 −1
  94. arch/sparc/include/asm/mmu_context_64.h +4 −28
  95. arch/sparc/include/asm/pil.h +0 −1
  96. arch/sparc/include/asm/vio.h +1 −0
  97. arch/sparc/kernel/ds.c +1 −1
  98. arch/sparc/kernel/irq_64.c +13 −4
  99. arch/sparc/kernel/kernel.h +0 −1
  100. arch/sparc/kernel/smp_64.c +0 −31
  101. arch/sparc/kernel/sys_sparc_64.c +2 −2
  102. arch/sparc/kernel/tsb.S +7 −4
  103. arch/sparc/kernel/ttable_64.S +1 −1
  104. arch/sparc/kernel/vio.c +64 −4
  105. arch/sparc/lib/Makefile +1 −0
  106. arch/sparc/lib/multi3.S +35 −0
  107. arch/sparc/mm/hugetlbpage.c +1 −1
  108. arch/sparc/mm/init_64.c +60 −29
  109. arch/sparc/mm/tsb.c +5 −2
  110. arch/sparc/mm/ultra.S +0 −5
  111. arch/tile/mm/hugetlbpage.c +1 −1
  112. arch/x86/Kconfig +0 −4
  113. arch/x86/include/asm/extable.h +1 −0
  114. arch/x86/kernel/cpu/cyrix.c +1 −0
  115. arch/x86/kernel/cpu/microcode/amd.c +8 −8
  116. arch/x86/kernel/cpu/microcode/intel.c +3 −0
  117. arch/x86/kernel/kvm.c +1 −1
  118. arch/x86/kernel/process_32.c +1 −1
  119. arch/x86/kernel/sys_x86_64.c +2 −2
  120. arch/x86/kernel/traps.c +1 −1
  121. arch/x86/kvm/cpuid.c +11 −9
  122. arch/x86/kvm/lapic.c +4 −1
  123. arch/x86/kvm/mmu.c +5 −2
  124. arch/x86/kvm/mmu.h +1 −0
  125. arch/x86/kvm/svm.c +12 −14
  126. arch/x86/kvm/vmx.c +63 −86
  127. arch/x86/kvm/x86.c +6 −4
  128. arch/x86/mm/extable.c +3 −0
  129. arch/x86/mm/hugetlbpage.c +1 −1
  130. arch/x86/mm/init.c +3 −3
  131. arch/x86/mm/pat.c +3 −6
  132. arch/x86/platform/efi/efi.c +4 −2
  133. arch/x86/platform/efi/efi_64.c +71 −8
  134. arch/x86/platform/efi/quirks.c +3 −0
  135. arch/xtensa/include/asm/irq.h +2 −1
  136. arch/xtensa/kernel/irq.c +0 −5
  137. arch/xtensa/kernel/setup.c +1 −2
  138. arch/xtensa/kernel/syscall.c +1 −1
  139. arch/xtensa/kernel/vmlinux.lds.S +3 −3
  140. arch/xtensa/platforms/iss/simdisk.c +1 −2
  141. arch/xtensa/platforms/xtfpga/include/platform/hardware.h +4 −2
  142. arch/xtensa/platforms/xtfpga/setup.c +5 −5
  143. block/bfq-cgroup.c +93 −23
  144. block/bfq-iosched.c +1 −1
  145. block/bfq-iosched.h +11 −12
  146. block/bio-integrity.c +3 −0
  147. block/blk-cgroup.c +1 −1
  148. block/blk-core.c +8 −2
  149. block/blk-mq.c +26 −9
  150. block/blk-sysfs.c +23 −13
  151. block/blk-throttle.c +18 −4
  152. block/blk.h +1 −1
  153. block/cfq-iosched.c +15 −2
  154. crypto/asymmetric_keys/public_key.c +1 −1
  155. crypto/asymmetric_keys/verify_pefile.c +2 −2
  156. crypto/asymmetric_keys/x509_cert_parser.c +1 −0
  157. crypto/drbg.c +2 −3
  158. crypto/gcm.c +2 −4
  159. drivers/acpi/acpica/tbutils.c +25 −13
  160. drivers/acpi/acpica/utresrc.c +0 −9
  161. drivers/acpi/arm64/iort.c +14 −8
  162. drivers/acpi/battery.c +1 −1
  163. drivers/acpi/button.c +3 −4
  164. drivers/acpi/device_pm.c +1 −2
  165. drivers/acpi/scan.c +2 −2
  166. drivers/acpi/sleep.c +0 −28
  167. drivers/acpi/sysfs.c +5 −2
  168. drivers/ata/ahci.c +38 −0
  169. drivers/ata/libahci_platform.c +3 −2
  170. drivers/ata/libata-core.c +1 −1
  171. drivers/ata/sata_mv.c +8 −5
  172. drivers/ata/sata_rcar.c +12 −3
  173. drivers/base/power/main.c +5 −0
  174. drivers/base/power/wakeup.c +6 −12
  175. drivers/block/loop.c +3 −0
  176. drivers/block/nbd.c +5 −10
  177. drivers/block/rbd.c +2 −0
  178. drivers/char/mem.c +1 −1
  179. drivers/char/pcmcia/cm4040_cs.c +3 −3
  180. drivers/char/random.c +44 −3
  181. drivers/cpufreq/cpufreq.c +1 −0
  182. drivers/cpufreq/cpufreq_conservative.c +2 −2
  183. drivers/cpufreq/intel_pstate.c +3 −2
  184. drivers/cpufreq/kirkwood-cpufreq.c +16 −3
  185. drivers/cpuidle/dt_idle_states.c +3 −1
  186. drivers/dax/super.c +7 −2
  187. drivers/devfreq/event/exynos-nocp.c +5 −1
  188. drivers/devfreq/event/exynos-ppmu.c +6 −2
  189. drivers/dma/ep93xx_dma.c +35 −4
  190. drivers/dma/mv_xor_v2.c +44 −65
  191. drivers/dma/pl330.c +2 −1
  192. drivers/dma/sh/rcar-dmac.c +3 −0
  193. drivers/dma/sh/usb-dmac.c +1 −1
  194. drivers/firmware/dmi-id.c +2 −0
  195. drivers/firmware/dmi_scan.c +38 −12
  196. drivers/firmware/efi/efi-bgrt.c +27 −0
  197. drivers/firmware/efi/libstub/secureboot.c +2 −2
  198. drivers/firmware/google/vpd.c +4 −4
  199. drivers/gpio/gpio-aspeed.c +3 −0
  200. drivers/gpio/gpio-crystalcove.c +36 −18
  201. drivers/gpio/gpio-mvebu.c +8 −1
  202. drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c +5 −5
  203. drivers/gpu/drm/amd/amdgpu/dce_v10_0.c +5 −2
  204. drivers/gpu/drm/amd/amdgpu/dce_v11_0.c +5 −2
  205. drivers/gpu/drm/amd/amdgpu/dce_v6_0.c +5 −2
  206. drivers/gpu/drm/amd/amdgpu/dce_v8_0.c +5 −2
  207. drivers/gpu/drm/amd/amdgpu/vce_v3_0.c +68 −27
  208. drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.c +10 −10
  209. drivers/gpu/drm/bridge/synopsys/Kconfig +1 −0
  210. drivers/gpu/drm/drm_atomic_helper.c +11 −0
  211. drivers/gpu/drm/drm_dp_helper.c +83 −0
  212. drivers/gpu/drm/drm_drv.c +6 −1
  213. drivers/gpu/drm/exynos/exynos_drm_drv.c +1 −7
  214. drivers/gpu/drm/exynos/exynos_drm_drv.h +1 −4
  215. drivers/gpu/drm/exynos/exynos_drm_dsi.c +9 −17
  216. drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c +1 −1
  217. drivers/gpu/drm/i915/gvt/execlist.c +20 −10
  218. drivers/gpu/drm/i915/gvt/handlers.c +21 −9
  219. drivers/gpu/drm/i915/i915_drv.c +9 −4
  220. drivers/gpu/drm/i915/i915_drv.h +12 −1
  221. drivers/gpu/drm/i915/i915_gem.c +4 −0
  222. drivers/gpu/drm/i915/i915_gem_gtt.c +106 −2
  223. drivers/gpu/drm/i915/i915_gem_shrinker.c +0 −5
  224. drivers/gpu/drm/i915/i915_gem_tiling.c +1 −1
  225. drivers/gpu/drm/i915/i915_irq.c +6 −9
  226. drivers/gpu/drm/i915/i915_pci.c +1 −2
  227. drivers/gpu/drm/i915/i915_pvinfo.h +2 −6
  228. drivers/gpu/drm/i915/i915_reg.h +1 −1
  229. drivers/gpu/drm/i915/i915_vgpu.c +4 −6
  230. drivers/gpu/drm/i915/intel_display.c +31 −14
  231. drivers/gpu/drm/i915/intel_dp.c +10 −35
  232. drivers/gpu/drm/i915/intel_dp_mst.c +4 −1
  233. drivers/gpu/drm/i915/intel_drv.h +1 −12
  234. drivers/gpu/drm/i915/intel_engine_cs.c +17 −3
  235. drivers/gpu/drm/i915/intel_fbc.c +7 −12
  236. drivers/gpu/drm/i915/intel_lpe_audio.c +0 −36
  237. drivers/gpu/drm/i915/intel_lrc.c +1 −1
  238. drivers/gpu/drm/i915/intel_lspcon.c +1 −1
  239. drivers/gpu/drm/i915/intel_pm.c +33 −12
  240. drivers/gpu/drm/i915/intel_psr.c +3 −2
  241. drivers/gpu/drm/i915/intel_sprite.c +21 −0
  242. drivers/gpu/drm/i915/intel_uc.h +0 −2
  243. drivers/gpu/drm/i915/selftests/i915_gem_context.c +5 −3
  244. drivers/gpu/drm/imx/imx-ldb.c +1 −1
  245. drivers/gpu/drm/mediatek/mtk_dsi.c +6 −9
  246. drivers/gpu/drm/mediatek/mtk_hdmi.c +1 −1
  247. drivers/gpu/drm/meson/meson_drv.c +15 −5
  248. drivers/gpu/drm/mgag200/mgag200_mode.c +8 −1
  249. drivers/gpu/drm/msm/Kconfig +1 −0
  250. drivers/gpu/drm/msm/mdp/mdp5/mdp5_mdss.c +1 −1
  251. drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c +7 −2
  252. drivers/gpu/drm/msm/msm_drv.c +1 −0
  253. drivers/gpu/drm/msm/msm_drv.h +1 −0
  254. drivers/gpu/drm/msm/msm_fence.c +2 −8
  255. drivers/gpu/drm/msm/msm_gem.c +6 −0
  256. drivers/gpu/drm/msm/msm_gem_prime.c +7 −0
  257. drivers/gpu/drm/msm/msm_gem_submit.c +7 −7
  258. drivers/gpu/drm/msm/msm_gpu.c +2 −2
  259. drivers/gpu/drm/mxsfb/mxsfb_crtc.c +42 −0
  260. drivers/gpu/drm/nouveau/include/nvkm/subdev/timer.h +1 −0
  261. drivers/gpu/drm/nouveau/nouveau_drm.c +17 −21
  262. drivers/gpu/drm/nouveau/nouveau_drv.h +1 −2
  263. drivers/gpu/drm/nouveau/nouveau_vga.c +2 −11
  264. drivers/gpu/drm/nouveau/nv50_display.c +2 −1
  265. drivers/gpu/drm/nouveau/nvkm/subdev/timer/base.c +4 −3
  266. drivers/gpu/drm/radeon/cik.c +5 −2
  267. drivers/gpu/drm/radeon/evergreen.c +5 −2
  268. drivers/gpu/drm/radeon/radeon_uvd.c +1 −1
  269. drivers/gpu/drm/radeon/si.c +5 −2
  270. drivers/gpu/drm/rockchip/analogix_dp-rockchip.c +0 −12
  271. drivers/gpu/drm/rockchip/cdn-dp-core.c +2 −7
  272. drivers/gpu/drm/rockchip/rockchip_drm_vop.c +8 −0
  273. drivers/gpu/drm/rockchip/rockchip_drm_vop.h +3 −0
  274. drivers/gpu/drm/rockchip/rockchip_vop_reg.c +2 −0
  275. drivers/gpu/drm/tegra/drm.c +5 −17
  276. drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +2 −2
  277. drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c +2 −0
  278. drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +1 −114
  279. drivers/gpu/drm/vmwgfx/vmwgfx_kms.h +0 −15
  280. drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c +22 −5
  281. drivers/gpu/drm/vmwgfx/vmwgfx_surface.c +15 −8
  282. drivers/gpu/host1x/dev.c +1 −1
  283. drivers/gpu/ipu-v3/ipu-common.c +8 −7
  284. drivers/gpu/ipu-v3/ipu-pre.c +5 −8
  285. drivers/hid/Kconfig +4 −2
  286. drivers/hid/hid-asus.c +12 −0
  287. drivers/hid/hid-core.c +224 −61
  288. drivers/hid/hid-elecom.c +53 −9
  289. drivers/hid/hid-ids.h +3 −0
  290. drivers/hid/hid-magicmouse.c +8 −7
  291. drivers/hid/i2c-hid/i2c-hid.c +13 −0
  292. drivers/hid/wacom_wac.c +23 −22
  293. drivers/hsi/clients/ssi_protocol.c +1 −1
  294. drivers/hwmon/Kconfig +1 −0
  295. drivers/hwmon/aspeed-pwm-tacho.c +35 −30
  296. drivers/i2c/busses/i2c-ismt.c +1 −1
  297. drivers/i2c/busses/i2c-rcar.c +1 −1
  298. drivers/iio/adc/bcm_iproc_adc.c +4 −4
  299. drivers/iio/adc/max9611.c +5 −5
  300. drivers/iio/adc/meson_saradc.c +2 −2
  301. drivers/iio/adc/mxs-lradc-adc.c +5 −2
  302. drivers/iio/adc/sun4i-gpadc-iio.c +24 −14
  303. drivers/iio/adc/ti_am335x_adc.c +1 −1
  304. drivers/iio/buffer/industrialio-buffer-dma.c +1 −0
  305. drivers/iio/buffer/industrialio-buffer-dmaengine.c +1 −0
  306. drivers/iio/imu/inv_mpu6050/inv_mpu_core.c +36 −3
  307. drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h +3 −0
  308. drivers/iio/industrialio-trigger.c +2 −1
  309. drivers/iio/light/ltr501.c +2 −2
  310. drivers/iio/proximity/as3935.c +6 −8
  311. drivers/infiniband/core/addr.c +1 −9
  312. drivers/infiniband/core/cm.c +2 −2
  313. drivers/infiniband/core/cma.c +6 −7
  314. drivers/infiniband/core/core_priv.h +10 −0
  315. drivers/infiniband/core/netlink.c +1 −1
  316. drivers/infiniband/core/sa_query.c +3 −3
  317. drivers/infiniband/core/umem.c +1 −1
  318. drivers/infiniband/core/umem_odp.c +5 −1
  319. drivers/infiniband/core/uverbs_marshall.c +4 −4
  320. drivers/infiniband/hw/bnxt_re/bnxt_re.h +4 −0
  321. drivers/infiniband/hw/bnxt_re/ib_verbs.c +347 −124
  322. drivers/infiniband/hw/bnxt_re/ib_verbs.h +16 −6
  323. drivers/infiniband/hw/bnxt_re/main.c +0 −4
  324. drivers/infiniband/hw/bnxt_re/qplib_fp.c +199 −185
  325. drivers/infiniband/hw/bnxt_re/qplib_fp.h +17 −1
  326. drivers/infiniband/hw/bnxt_re/qplib_rcfw.c +164 −150
  327. drivers/infiniband/hw/bnxt_re/qplib_rcfw.h +20 −41
  328. drivers/infiniband/hw/bnxt_re/qplib_res.h +4 −0
  329. drivers/infiniband/hw/bnxt_re/qplib_sp.c +83 −250
  330. drivers/infiniband/hw/bnxt_re/qplib_sp.h +2 −0
  331. drivers/infiniband/hw/cxgb4/cm.c +7 −2
  332. drivers/infiniband/hw/cxgb4/device.c +8 −4
  333. drivers/infiniband/hw/hfi1/chip.c +50 −17
  334. drivers/infiniband/hw/hfi1/chip_registers.h +2 −0
  335. drivers/infiniband/hw/hfi1/hfi.h +10 −1
  336. drivers/infiniband/hw/hfi1/intr.c +2 −1
  337. drivers/infiniband/hw/hfi1/pcie.c +2 −2
  338. drivers/infiniband/hw/hfi1/rc.c +4 −1
  339. drivers/infiniband/hw/hfi1/sysfs.c +2 −1
  340. drivers/infiniband/hw/i40iw/i40iw_cm.c +1 −2
  341. drivers/infiniband/hw/i40iw/i40iw_ctrl.c +1 −11
  342. drivers/infiniband/hw/i40iw/i40iw_main.c +13 −7
  343. drivers/infiniband/hw/i40iw/i40iw_osdep.h +0 −1
  344. drivers/infiniband/hw/i40iw/i40iw_type.h +0 −2
  345. drivers/infiniband/hw/i40iw/i40iw_utils.c +0 −17
  346. drivers/infiniband/hw/i40iw/i40iw_virtchnl.c +1 −4
  347. drivers/infiniband/hw/mlx4/mad.c +1 −0
  348. drivers/infiniband/hw/mlx5/main.c +18 −2
  349. drivers/infiniband/hw/mlx5/mlx5_ib.h +2 −1
  350. drivers/infiniband/hw/mlx5/qp.c +23 −36
  351. drivers/infiniband/hw/nes/nes_cm.c +1 −2
  352. drivers/infiniband/hw/qedr/qedr.h +4 −1
  353. drivers/infiniband/hw/qedr/qedr_cm.c +6 −4
  354. drivers/infiniband/hw/qedr/verbs.c +41 −27
  355. drivers/infiniband/hw/qib/qib_rc.c +3 −1
  356. drivers/infiniband/sw/rxe/rxe.h +4 −1
  357. drivers/infiniband/sw/rxe/rxe_verbs.c +2 −7
  358. drivers/infiniband/ulp/ipoib/ipoib_ethtool.c +1 −1
  359. drivers/infiniband/ulp/ipoib/ipoib_ib.c +0 −1
  360. drivers/infiniband/ulp/ipoib/ipoib_main.c +14 −3
  361. drivers/infiniband/ulp/ipoib/ipoib_vlan.c +7 −4
  362. drivers/infiniband/ulp/srp/ib_srp.c +2 −2
  363. drivers/input/keyboard/tm2-touchkey.c +1 −1
  364. drivers/input/misc/axp20x-pek.c +37 −7
  365. drivers/input/mouse/elantech.c +16 −0
  366. drivers/input/mouse/synaptics.c +28 −9
  367. drivers/input/rmi4/rmi_f03.c +1 −1
  368. drivers/input/touchscreen/silead.c +3 −0
  369. drivers/iommu/of_iommu.c +7 −0
  370. drivers/irqchip/irq-xtensa-mx.c +1 −1
  371. drivers/irqchip/irq-xtensa-pic.c +1 −1
  372. drivers/isdn/i4l/isdn_ppp.c +1 −1
  373. drivers/isdn/mISDN/stack.c +1 −1
  374. drivers/leds/leds-bcm6328.c +2 −2
  375. drivers/leds/trigger/ledtrig-heartbeat.c +0 −31
  376. drivers/md/bitmap.c +4 −4
  377. drivers/md/dm-bufio.c +1 −1
  378. drivers/md/dm-integrity.c +8 −22
  379. drivers/md/dm-ioctl.c +3 −2
  380. drivers/md/dm-raid1.c +1 −1
  381. drivers/md/dm-snap-persistent.c +2 −1
  382. drivers/md/dm-verity-target.c +2 −2
  383. drivers/md/dm.c +1 −1
  384. drivers/md/md-cluster.c +3 −1
  385. drivers/md/md.c +13 −5
  386. drivers/md/md.h +1 −0
  387. drivers/md/raid1.c +2 −0
  388. drivers/md/raid10.c +3 −0
  389. drivers/md/raid5-cache.c +2 −2
  390. drivers/md/raid5-ppl.c +2 −2
  391. drivers/md/raid5.c +17 −4
  392. drivers/media/cec/cec-api.c +1 −7
  393. drivers/media/platform/mtk-vcodec/vdec/vdec_h264_if.c +4 −4
  394. drivers/media/platform/mtk-vcodec/vdec/vdec_vp8_if.c +4 −4
  395. drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_if.c +4 −4
  396. drivers/memory/atmel-ebi.c +1 −1
  397. drivers/misc/cxl/file.c +2 −5
  398. drivers/misc/cxl/native.c +11 −3
  399. drivers/misc/mei/bus.c +3 −1
  400. drivers/misc/sgi-xp/xp.h +11 −1
  401. drivers/misc/sgi-xp/xp_main.c +7 −29
  402. drivers/mmc/host/meson-gx-mmc.c +9 −0
  403. drivers/mtd/nand/nand_base.c +35 −11
  404. drivers/mtd/nand/nand_ids.c +0 −1
  405. drivers/mtd/nand/nand_samsung.c +3 −0
  406. drivers/mtd/nand/tango_nand.c +16 −7
  407. drivers/net/bonding/bond_3ad.c +27 −0
  408. drivers/net/bonding/bond_main.c +3 −3
  409. drivers/net/caif/caif_hsi.c +1 −1
  410. drivers/net/caif/caif_serial.c +1 −1
  411. drivers/net/caif/caif_spi.c +1 −1
  412. drivers/net/caif/caif_virtio.c +1 −1
  413. drivers/net/can/dev.c +3 −0
  414. drivers/net/can/peak_canfd/peak_canfd.c +1 −1
  415. drivers/net/can/slcan.c +3 −4
  416. drivers/net/can/usb/gs_usb.c +2 −0
  417. drivers/net/can/usb/peak_usb/pcan_usb_core.c +1 −3
  418. drivers/net/can/vcan.c +2 −2
  419. drivers/net/can/vxcan.c +2 −2
  420. drivers/net/dsa/mv88e6xxx/global2.h +3 −3
  421. drivers/net/dummy.c +2 −2
  422. drivers/net/ethernet/amazon/ena/ena_com.c +21 −14
  423. drivers/net/ethernet/amazon/ena/ena_ethtool.c +1 −1
  424. drivers/net/ethernet/amazon/ena/ena_netdev.c +132 −47
  425. drivers/net/ethernet/amazon/ena/ena_netdev.h +15 −3
  426. drivers/net/ethernet/amd/xgbe/xgbe-desc.c +2 −3
  427. drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.h +0 −3
  428. drivers/net/ethernet/broadcom/bcmsysport.c +5 −2
  429. drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +16 −5
  430. drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c +13 −2
  431. drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h +1 −0
  432. drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +18 −9
  433. drivers/net/ethernet/chelsio/cxgb4/t4_hw.c +7 −2
  434. drivers/net/ethernet/chelsio/cxgb4/t4fw_version.h +3 −3
  435. drivers/net/ethernet/ethoc.c +2 −1
  436. drivers/net/ethernet/freescale/fsl_pq_mdio.c +8 −1
  437. drivers/net/ethernet/ibm/emac/core.c +40 −27
  438. drivers/net/ethernet/ibm/ibmvnic.c +7 −1
  439. drivers/net/ethernet/intel/i40e/i40e.h +1 −0
  440. drivers/net/ethernet/intel/i40e/i40e_ethtool.c +2 −2
  441. drivers/net/ethernet/intel/i40e/i40e_main.c +22 −21
  442. drivers/net/ethernet/intel/i40e/i40e_txrx.c +4 −3
  443. drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +2 −0
  444. drivers/net/ethernet/intel/i40evf/i40e_txrx.c +2 −1
  445. drivers/net/ethernet/marvell/mvpp2.c +33 −43
  446. drivers/net/ethernet/mellanox/mlx4/en_ethtool.c +0 −5
  447. drivers/net/ethernet/mellanox/mlx4/mcg.c +11 −4
  448. drivers/net/ethernet/mellanox/mlx4/qp.c +19 −0
  449. drivers/net/ethernet/mellanox/mlx4/resource_tracker.c +11 −5
  450. drivers/net/ethernet/mellanox/mlx5/core/en.h +5 −3
  451. drivers/net/ethernet/mellanox/mlx5/core/en_rx_am.c +26 −19
  452. drivers/net/ethernet/mellanox/mlx5/core/en_stats.h +2 −9
  453. drivers/net/ethernet/mellanox/mlx5/core/fs_core.c +1 −1
  454. drivers/net/ethernet/mellanox/mlx5/core/health.c +5 −6
  455. drivers/net/ethernet/mellanox/mlx5/core/main.c +6 −5
  456. drivers/net/ethernet/qlogic/qed/qed_debug.c +1 −1
  457. drivers/net/ethernet/qlogic/qed/qed_main.c +2 −1
  458. drivers/net/ethernet/qlogic/qlcnic/qlcnic.h +24 −2
  459. drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c +2 −0
  460. drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c +1 −1
  461. drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c +2 −0
  462. drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c +2 −0
  463. drivers/net/ethernet/qualcomm/emac/emac-mac.c +1 −1
  464. drivers/net/ethernet/qualcomm/emac/emac-phy.c +4 −71
  465. drivers/net/ethernet/qualcomm/emac/emac.c +1 −21
  466. drivers/net/ethernet/renesas/ravb_main.c +12 −12
  467. drivers/net/ethernet/stmicro/stmmac/altr_tse_pcs.c +5 −1
  468. drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c +7 −4
  469. drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +21 −11
  470. drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.h +2 −1
  471. drivers/net/geneve.c +2 −2
  472. drivers/net/gtp.c +1 −1
  473. drivers/net/hamradio/6pack.c +1 −1
  474. drivers/net/hamradio/bpqether.c +1 −1
  475. drivers/net/hamradio/hdlcdrv.c +2 −0
  476. drivers/net/hyperv/hyperv_net.h +3 −2
  477. drivers/net/hyperv/netvsc_drv.c +18 −36
  478. drivers/net/hyperv/rndis_filter.c +29 −1
  479. drivers/net/ifb.c +2 −2
  480. drivers/net/ipvlan/ipvlan_main.c +1 −1
  481. drivers/net/loopback.c +2 −2
  482. drivers/net/macsec.c +2 −2
  483. drivers/net/macvlan.c +1 −1
  484. drivers/net/netconsole.c +1 −1
  485. drivers/net/nlmon.c +1 −1
  486. drivers/net/phy/Kconfig +1 −0
  487. drivers/net/phy/marvell.c +0 −2
  488. drivers/net/phy/mdio_bus.c +13 −0
  489. drivers/net/phy/micrel.c +28 −14
  490. drivers/net/phy/phy.c +3 −1
  491. drivers/net/slip/slip.c +3 −4
  492. drivers/net/team/team.c +2 −2
  493. drivers/net/tun.c +2 −2
  494. drivers/net/usb/cdc-phonet.c +1 −1
  495. drivers/net/usb/qmi_wwan.c +5 −1
  496. drivers/net/usb/r8152.c +2 −0
  497. drivers/net/veth.c +2 −2
  498. drivers/net/virtio_net.c +3 −2
  499. drivers/net/vrf.c +33 −5
  500. drivers/net/vsockmon.c +1 −1
  501. drivers/net/vxlan.c +31 −10
  502. drivers/net/wan/dlci.c +1 −1
  503. drivers/net/wan/hdlc_fr.c +1 −1
  504. drivers/net/wan/lapbether.c +1 −1
  505. drivers/net/wireless/ath/ath6kl/main.c +1 −1
  506. drivers/net/wireless/ath/wcn36xx/main.c +2 −0
  507. drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +0 −1
  508. drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +2 −1
  509. drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +1 −1
  510. drivers/net/wireless/intel/iwlwifi/iwl-7000.c +2 −2
  511. drivers/net/wireless/intel/iwlwifi/iwl-8000.c +2 −2
  512. drivers/net/wireless/intel/iwlwifi/iwl-prph.h +1 −0
  513. drivers/net/wireless/intel/iwlwifi/mvm/fw-api-rs.h +5 −0
  514. drivers/net/wireless/intel/iwlwifi/mvm/fw-api-tx.h +3 −0
  515. drivers/net/wireless/intel/iwlwifi/mvm/fw-dbg.c +1 −11
  516. drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c +1 −1
  517. drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +5 −1
  518. drivers/net/wireless/intel/iwlwifi/mvm/ops.c +24 −8
  519. drivers/net/wireless/intel/iwlwifi/mvm/rs.c +11 −35
  520. drivers/net/wireless/intel/iwlwifi/mvm/rs.h +15 −0
  521. drivers/net/wireless/intel/iwlwifi/mvm/sta.c +17 −9
  522. drivers/net/wireless/intel/iwlwifi/mvm/sta.h +2 −0
  523. drivers/net/wireless/intel/iwlwifi/mvm/tt.c +5 −3
  524. drivers/net/wireless/intel/iwlwifi/mvm/tx.c +11 −1
  525. drivers/net/wireless/intel/iwlwifi/pcie/trans.c +4 −2
  526. drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c +6 −3
  527. drivers/net/wireless/intersil/hostap/hostap_main.c +1 −1
  528. drivers/net/wireless/mac80211_hwsim.c +1 −1
  529. drivers/net/wireless/marvell/mwifiex/main.c +1 −1
  530. drivers/nvme/host/core.c +14 −7
  531. drivers/nvme/host/fc.c +18 −2
  532. drivers/nvme/host/pci.c +6 −7
  533. drivers/nvme/host/rdma.c +29 −15
  534. drivers/of/device.c +2 −2
  535. drivers/pci/access.c +6 −6
  536. drivers/pci/endpoint/functions/Kconfig +1 −0
  537. drivers/perf/arm_pmu_acpi.c +11 −0
  538. drivers/phy/phy-qcom-qmp.c +7 −7
  539. drivers/pinctrl/core.c +3 −17
  540. drivers/pinctrl/freescale/pinctrl-mxs.c +12 −4
  541. drivers/pinctrl/intel/pinctrl-cherryview.c +19 −5
  542. drivers/pinctrl/pinconf-generic.c +0 −3
  543. drivers/pinctrl/pinmux.c +4 −17
  544. drivers/pinctrl/sunxi/pinctrl-sun8i-a83t.c +1 −1
  545. drivers/platform/goldfish/goldfish_pipe.c +1 −1
  546. drivers/platform/x86/intel_telemetry_debugfs.c +7 −9
  547. drivers/reset/hisilicon/hi6220_reset.c +2 −0
  548. drivers/s390/cio/vfio_ccw_ops.c +6 −6
  549. drivers/s390/crypto/ap_bus.c +24 −14
  550. drivers/s390/crypto/ap_card.c +8 −1
  551. drivers/s390/crypto/ap_queue.c +8 −1
  552. drivers/s390/net/netiucv.c +2 −2
  553. drivers/scsi/bnx2fc/bnx2fc.h +1 −0
  554. drivers/scsi/bnx2fc/bnx2fc_fcoe.c +8 −2
  555. drivers/scsi/cxgbi/cxgb4i/cxgb4i.c +0 −1
  556. drivers/scsi/cxgbi/libcxgbi.c +40 −14
  557. drivers/scsi/cxgbi/libcxgbi.h +9 −8
  558. drivers/scsi/device_handler/scsi_dh_rdac.c +4 −6
  559. drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c +23 −4
  560. drivers/scsi/lpfc/lpfc_crtn.h +1 −1
  561. drivers/scsi/lpfc/lpfc_ct.c +3 −2
  562. drivers/scsi/lpfc/lpfc_nportdisc.c +5 −2
  563. drivers/scsi/lpfc/lpfc_nvmet.c +2 −2
  564. drivers/scsi/qedi/qedi.h +2 −1
  565. drivers/scsi/qedi/qedi_fw.c +2 −0
  566. drivers/scsi/qedi/qedi_iscsi.c +6 −1
  567. drivers/scsi/qedi/qedi_main.c +13 −12
  568. drivers/scsi/qla2xxx/qla_bsg.c +5 −4
  569. drivers/scsi/qla2xxx/qla_dbg.c +2 −2
  570. drivers/scsi/qla2xxx/qla_def.h +1 −0
  571. drivers/scsi/qla2xxx/qla_init.c +4 −1
  572. drivers/scsi/qla2xxx/qla_inline.h +7 −19
  573. drivers/scsi/qla2xxx/qla_isr.c +1 −1
  574. drivers/scsi/qla2xxx/qla_mbx.c +2 −11
  575. drivers/scsi/qla2xxx/qla_os.c +29 −17
  576. drivers/scsi/qla2xxx/qla_target.c +5 −3
  577. drivers/scsi/qla2xxx/qla_tmpl.c +1 −1
  578. drivers/scsi/scsi_debug.c +1 −1
  579. drivers/staging/ccree/Kconfig +1 −1
  580. drivers/staging/ccree/ssi_buffer_mgr.c +2 −1
  581. drivers/staging/iio/cdc/ad7152.c +1 −5
  582. drivers/staging/lustre/lustre/lov/lov_pack.c +0 −9
  583. drivers/staging/rtl8188eu/os_dep/mon.c +1 −1
  584. drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c +2 −1
  585. drivers/staging/rtl8723bs/os_dep/os_intfs.c +0 −2
  586. drivers/staging/rtl8723bs/os_dep/osdep_service.c +1 −1
  587. drivers/target/iscsi/iscsi_target.c +24 −6
  588. drivers/target/iscsi/iscsi_target_erl0.c +5 −1
  589. drivers/target/iscsi/iscsi_target_erl0.h +1 −1
  590. drivers/target/iscsi/iscsi_target_login.c +4 −0
  591. drivers/target/iscsi/iscsi_target_nego.c +132 −62
  592. drivers/target/target_core_transport.c +18 −5
  593. drivers/target/target_core_user.c +33 −13
  594. drivers/tty/tty_port.c +0 −2
  595. drivers/usb/chipidea/core.c +4 −1
  596. drivers/usb/chipidea/debug.c +2 −1
  597. drivers/usb/chipidea/udc.c +6 −2
  598. drivers/usb/chipidea/usbmisc_imx.c +32 −9
  599. drivers/usb/dwc2/params.c +2 −0
  600. drivers/usb/gadget/composite.c +5 −6
  601. drivers/usb/gadget/function/f_mass_storage.c +11 −2
  602. drivers/usb/gadget/function/f_phonet.c +1 −1
  603. drivers/usb/gadget/legacy/inode.c +6 −3
  604. drivers/usb/gadget/udc/dummy_hcd.c +4 −9
  605. drivers/usb/gadget/udc/net2280.c +1 −8
  606. drivers/usb/gadget/udc/renesas_usb3.c +32 −13
  607. drivers/usb/host/xhci-mem.c +5 −2
  608. drivers/usb/host/xhci-pci.c +3 −0
  609. drivers/usb/musb/musb_dsps.c +5 −0
  610. drivers/video/fbdev/core/fbmon.c +1 −1
  611. drivers/video/fbdev/smscufx.c +3 −2
  612. drivers/video/fbdev/udlfb.c +5 −4
  613. drivers/video/fbdev/via/viafbdev.c +3 −5
  614. drivers/virtio/virtio_balloon.c +7 −0
  615. drivers/xen/privcmd.c +2 −2
  616. fs/btrfs/ctree.h +2 −2
  617. fs/btrfs/dir-item.c +1 −1
  618. fs/btrfs/disk-io.c +6 −4
  619. fs/btrfs/extent-tree.c +4 −3
  620. fs/btrfs/extent_io.c +123 −3
  621. fs/btrfs/hash.c +4 −1
  622. fs/btrfs/inode.c +3 −3
  623. fs/ceph/acl.c +1 −0
  624. fs/ceph/export.c +4 −0
  625. fs/ceph/inode.c +2 −3
  626. fs/ceph/mds_client.c +1 −3
  627. fs/configfs/item.c +8 −0
  628. fs/configfs/symlink.c +1 −2
  629. fs/dax.c +23 −0
  630. fs/dcache.c +4 −6
  631. fs/ext4/acl.c +4 −0
  632. fs/ext4/ext4.h +0 −2
  633. fs/ext4/extents.c +42 −43
  634. fs/ext4/file.c +16 −38
  635. fs/ext4/inline.c +2 −3
  636. fs/ext4/inode.c +22 −8
  637. fs/ext4/mballoc.c +14 −9
  638. fs/ext4/namei.c +5 −8
  639. fs/ext4/super.c +8 −9
  640. fs/ext4/xattr.c +8 −0
  641. fs/f2fs/f2fs.h +4 −1
  642. fs/gfs2/log.c +1 −1
  643. fs/hugetlbfs/inode.c +1 −1
  644. fs/jbd2/transaction.c +6 −0
  645. fs/namespace.c +2 −0
  646. fs/nfs/flexfilelayout/flexfilelayout.c +1 −0
  647. fs/nfs/internal.h +0 −2
  648. fs/nfs/namespace.c +1 −1
  649. fs/nfs/nfs42proc.c +1 −1
  650. fs/nfs/nfs4client.c +0 −1
  651. fs/nfs/pnfs.c +17 −8
  652. fs/nfs/pnfs.h +10 −0
  653. fs/nfs/super.c +3 −2
  654. fs/nfsd/nfs3xdr.c +6 −17
  655. fs/nfsd/nfs4proc.c +6 −7
  656. fs/nfsd/nfsxdr.c +3 −10
  657. fs/ntfs/namei.c +1 −1
  658. fs/ocfs2/export.c +1 −1
  659. fs/overlayfs/Kconfig +1 −0
  660. fs/overlayfs/copy_up.c +17 −7
  661. fs/overlayfs/dir.c +47 −14
  662. fs/overlayfs/inode.c +11 −1
  663. fs/overlayfs/namei.c +5 −11
  664. fs/overlayfs/overlayfs.h +14 −2
  665. fs/overlayfs/ovl_entry.h +2 −0
  666. fs/overlayfs/super.c +17 −1
  667. fs/overlayfs/util.c +64 −8
  668. fs/proc/base.c +1 −1
  669. fs/proc/task_mmu.c +0 −4
  670. fs/quota/dquot.c +16 −0
  671. fs/read_write.c +1 −1
  672. fs/reiserfs/journal.c +2 −2
  673. fs/stat.c +1 −0
  674. fs/ufs/balloc.c +38 −10
  675. fs/ufs/inode.c +41 −28
  676. fs/ufs/super.c +60 −27
  677. fs/ufs/ufs_fs.h +3 −4
  678. fs/ufs/util.c +8 −9
  679. fs/ufs/util.h +9 −10
  680. fs/userfaultfd.c +21 −8
  681. fs/xfs/xfs_buf.c +26 −12
  682. fs/xfs/xfs_buf.h +2 −3
  683. fs/xfs/xfs_icache.c +2 −3
  684. include/acpi/actbl.h +14 −0
  685. include/drm/drm_dp_helper.h +51 −0
  686. include/linux/blkdev.h +2 −0
  687. include/linux/cgroup-defs.h +1 −0
  688. include/linux/cgroup.h +20 −0
  689. include/linux/compiler-clang.h +8 −0
  690. include/linux/configfs.h +2 −1
  691. include/linux/dma-iommu.h +1 −0
  692. include/linux/dmi.h +1 −1
  693. include/linux/elevator.h +1 −1
  694. include/linux/gfp.h +1 −1
  695. include/linux/gpio/machine.h +7 −0
  696. include/linux/irqchip/arm-gic-v3.h +4 −0
  697. include/linux/irqchip/arm-gic.h +25 −3
  698. include/linux/jiffies.h +5 −1
  699. include/linux/key.h +0 −1
  700. include/linux/memblock.h +8 −0
  701. include/linux/mlx4/qp.h +1 −0
  702. include/linux/mlx5/mlx5_ifc.h +9 −1
  703. include/linux/mm.h +36 −28
  704. include/linux/mmzone.h +1 −0
  705. include/linux/mod_devicetable.h +1 −0
  706. include/linux/netdevice.h +10 −5
  707. include/linux/pinctrl/pinconf-generic.h +0 −3
  708. include/linux/quotaops.h +6 −0
  709. include/linux/srcu.h +0 −2
  710. include/linux/sunrpc/svc.h +2 −1
  711. include/linux/suspend.h +2 −5
  712. include/media/cec.h +1 −1
  713. include/net/ipv6.h +1 −0
  714. include/net/tcp.h +1 −1
  715. include/rdma/ib_sa.h +3 −22
  716. include/rdma/rdma_netlink.h +0 −10
  717. include/target/iscsi/iscsi_target_core.h +1 −0
  718. include/uapi/linux/ethtool.h +4 −2
  719. include/uapi/linux/keyctl.h +2 −2
  720. include/uapi/linux/openvswitch.h +1 −0
  721. kernel/cgroup/cgroup.c +5 −0
  722. kernel/cgroup/cpuset.c +2 −2
  723. kernel/cpu.c +2 −2
  724. kernel/events/core.c +21 −0
  725. kernel/irq/manage.c +3 −1
  726. kernel/livepatch/Kconfig +1 −0
  727. kernel/power/process.c +1 −1
  728. kernel/power/suspend.c +4 −25
  729. kernel/printk/printk.c +10 −36
  730. kernel/rcu/srcu.c +2 −3
  731. kernel/rcu/srcutiny.c +4 −3
  732. kernel/rcu/srcutree.c +2 −3
  733. kernel/sched/core.c +1 −1
  734. kernel/sched/cpufreq_schedutil.c +0 −3
  735. kernel/sched/fair.c +1 −1
  736. kernel/time/alarmtimer.c +11 −3
  737. kernel/time/tick-broadcast.c +3 −1
  738. kernel/time/tick-internal.h +0 −2
  739. lib/libcrc32c.c +4 −2
  740. mm/gup.c +8 −17
  741. mm/huge_memory.c +7 −1
  742. mm/hugetlb.c +5 −0
  743. mm/ksm.c +1 −2
  744. mm/memblock.c +23 −0
  745. mm/memory-failure.c +6 −7
  746. mm/memory.c +30 −48
  747. mm/mlock.c +3 −2
  748. mm/mmap.c +89 −60
  749. mm/page_alloc.c +25 −12
  750. mm/slub.c +4 −2
  751. mm/swap_cgroup.c +3 −0
  752. mm/util.c +5 −2
  753. mm/vmpressure.c +3 −3
  754. net/8021q/vlan_dev.c +2 −2
  755. net/batman-adv/distributed-arp-table.c +3 −2
  756. net/batman-adv/routing.c +1 −1
  757. net/batman-adv/soft-interface.c +2 −3
  758. net/bluetooth/6lowpan.c +1 −1
  759. net/bridge/br_device.c +1 −1
  760. net/bridge/br_netlink.c +1 −1
  761. net/bridge/br_stp_if.c +2 −1
  762. net/caif/caif_socket.c +4 −0
  763. net/caif/cfpkt_skbuff.c +1 −5
  764. net/caif/chnl_net.c +2 −2
  765. net/can/af_can.c +1 −2
  766. net/core/dev.c +30 −12
  767. net/core/devlink.c +6 −2
  768. net/core/dst.c +14 −0
  769. net/core/rtnetlink.c +2 −1
  770. net/core/skbuff.c +4 −1
  771. net/decnet/netfilter/dn_rtmsg.c +3 −1
  772. net/dsa/dsa.c +47 −0
  773. net/dsa/dsa2.c +3 −1
  774. net/dsa/legacy.c +0 −47
  775. net/hsr/hsr_device.c +2 −2
  776. net/hsr/hsr_forward.c +1 −2
  777. net/hsr/hsr_framereg.c +7 −2
  778. net/hsr/hsr_framereg.h +1 −1
  779. net/ieee802154/6lowpan/core.c +1 −1
  780. net/ipv4/af_inet.c +1 −1
  781. net/ipv4/icmp.c +6 −2
  782. net/ipv4/igmp.c +13 −8
  783. net/ipv4/ip_tunnel.c +2 −2
  784. net/ipv4/ipmr.c +16 −18
  785. net/ipv4/tcp.c +4 −2
  786. net/ipv4/tcp_cong.c +1 −0
  787. net/ipv6/calipso.c +5 −1
  788. net/ipv6/icmp.c +1 −1
  789. net/ipv6/ila/ila_xlat.c +1 −0
  790. net/ipv6/ip6_gre.c +5 −4
  791. net/ipv6/ip6_offload.c +3 −1
  792. net/ipv6/ip6_tunnel.c +7 −4
  793. net/ipv6/ip6_vti.c +4 −4
  794. net/ipv6/ip6mr.c +1 −1
  795. net/ipv6/ping.c +1 −1
  796. net/ipv6/proc.c +1 −1
  797. net/ipv6/raw.c +1 −1
  798. net/ipv6/route.c +1 −0
  799. net/ipv6/sit.c +3 −3
  800. net/ipv6/xfrm6_mode_ro.c +2 −0
  801. net/ipv6/xfrm6_mode_transport.c +2 −0
  802. net/irda/irlan/irlan_eth.c +1 −1
  803. net/l2tp/l2tp_eth.c +8 −7
  804. net/mac80211/agg-tx.c +52 −76
  805. net/mac80211/cfg.c +2 −0
  806. net/mac80211/ht.c +12 −4
  807. net/mac80211/ieee80211_i.h +5 −11
  808. net/mac80211/iface.c +5 −13
  809. net/mac80211/mlme.c +31 −31
  810. net/mac80211/rx.c +5 −1
  811. net/mac80211/sta_info.c +1 −1
  812. net/mac80211/sta_info.h +2 −0
  813. net/mac80211/wpa.c +5 −4
  814. net/mac802154/iface.c +3 −4
  815. net/mpls/af_mpls.c +1 −1
  816. net/netfilter/nf_conntrack_netlink.c +6 −1
  817. net/netfilter/nf_conntrack_proto_sctp.c +6 −3
  818. net/netfilter/nf_nat_core.c +1 −1
  819. net/netfilter/nft_set_rbtree.c +11 −11
  820. net/netlink/af_netlink.c +3 −1
  821. net/openvswitch/vport-internal_dev.c +2 −2
  822. net/phonet/pep-gprs.c +1 −1
  823. net/sched/act_pedit.c +3 −1
  824. net/sched/act_police.c +3 −5
  825. net/sctp/socket.c +2 −2
  826. net/sunrpc/xprtrdma/backchannel.c +2 −4
  827. net/sunrpc/xprtsock.c +6 −1
  828. net/tipc/msg.c +1 −1
  829. net/unix/af_unix.c +6 −1
  830. scripts/gdb/linux/dmesg.py +5 −4
  831. security/keys/Kconfig +5 −1
  832. security/keys/dh.c +184 −116
  833. security/keys/encrypted-keys/encrypted.c +74 −130
  834. security/keys/gc.c +1 −3
  835. security/keys/key.c +6 −10
  836. security/keys/keyctl.c +11 −5
  837. security/keys/keyring.c +6 −6
  838. security/keys/process_keys.c +4 −3
  839. security/keys/trusted.c +22 −28
  840. security/keys/user_defined.c +12 −4
  841. security/selinux/hooks.c +2 −3
  842. sound/core/timer.c +5 −2
  843. sound/pci/hda/patch_realtek.c +8 −7
  844. sound/soc/atmel/atmel-classd.c +9 −0
  845. sound/soc/codecs/da7213.c +1 −1
  846. sound/soc/codecs/rt286.c +7 −0
  847. sound/soc/generic/simple-card.c +1 −1
  848. sound/soc/intel/skylake/skl-sst-ipc.c +5 −0
  849. sound/soc/intel/skylake/skl-topology.c +1 −1
  850. sound/soc/intel/skylake/skl.c +88 −74
  851. sound/soc/intel/skylake/skl.h +3 −1
  852. sound/soc/sh/rcar/adg.c +4 −2
  853. sound/soc/sh/rcar/cmd.c +1 −0
  854. sound/soc/sh/rcar/core.c +51 −0
  855. sound/soc/sh/rcar/gen.c +1 −0
  856. sound/soc/sh/rcar/rsnd.h +2 −0
  857. sound/soc/sh/rcar/src.c +10 −2
  858. sound/soc/sh/rcar/ssi.c +15 −3
  859. sound/soc/sh/rcar/ssiu.c +2 −1
  860. sound/soc/soc-core.c +3 −2
  861. sound/usb/mixer_us16x08.c +12 −7
  862. tools/objtool/builtin-check.c +2 −1
  863. tools/perf/Documentation/perf-probe.txt +6 −2
  864. tools/perf/Documentation/perf-script-perl.txt +1 −1
  865. tools/perf/Documentation/perf-script-python.txt +9 −14
  866. tools/perf/Makefile.config +19 −19
  867. tools/perf/Makefile.perf +1 −1
  868. tools/perf/arch/Build +1 −1
  869. tools/perf/arch/common.c +1 −0
  870. tools/perf/builtin-stat.c +4 −1
  871. tools/perf/builtin-trace.c +4 −0
  872. tools/perf/pmu-events/Build +2 −2
  873. tools/perf/tests/Build +1 −1
  874. tools/perf/tests/bp_signal.c +14 −0
  875. tools/perf/tests/builtin-test.c +7 −0
  876. tools/perf/tests/code-reading.c +19 −1
  877. tools/perf/tests/task-exit.c +1 −1
  878. tools/perf/tests/tests.h +3 −0
  879. tools/perf/util/annotate.c +43 −29
  880. tools/perf/util/build-id.c +0 −45
  881. tools/perf/util/build-id.h +0 −1
  882. tools/perf/util/dso.c +94 −6
  883. tools/perf/util/dso.h +9 −0
  884. tools/perf/util/evsel.c +12 −0
  885. tools/perf/util/header.c +11 −3
  886. tools/perf/util/machine.c +1 −10
  887. tools/perf/util/scripting-engines/trace-event-python.c +1 −1
  888. tools/perf/util/symbol-elf.c +3 −38
  889. tools/perf/util/symbol.c +0 −4
  890. tools/perf/util/unwind-libdw.c +17 −1
  891. tools/testing/selftests/bpf/bpf_endian.h +30 −11
  892. usr/Kconfig +1 −0
  893. virt/kvm/arm/hyp/vgic-v3-sr.c +1 −1
  894. virt/kvm/arm/mmu.c +3 −0
  895. virt/kvm/arm/vgic/vgic-mmio-v2.c +14 −2
  896. virt/kvm/arm/vgic/vgic-v2.c +25 −3
  897. virt/kvm/arm/vgic/vgic-v3.c +33 −14
  898. virt/kvm/arm/vgic/vgic.h +8 −4
Documentation/admin-guide/kernel-parameters.txt+16−0
@@ -866,6 +866,15 @@ · 865 unmodified lines
866 866
867 dscc4.setup= [NET]867 dscc4.setup= [NET]
868 868
869 dt_cpu_ftrs= [PPC]
870 Format: {"off" | "known"}
871 Control how the dt_cpu_ftrs device-tree binding is
872 used for CPU feature discovery and setup (if it
873 exists).
874 off: Do not use it, fall back to legacy cpu table.
875 known: Do not pass through unknown features to guests
876 or userspace, only those that the kernel is aware of.
877
869 dump_apple_properties [X86]878 dump_apple_properties [X86]
870 Dump name and content of EFI device properties on879 Dump name and content of EFI device properties on
871 x86 Macs. Useful for driver authors to determine880 x86 Macs. Useful for driver authors to determine
@@ -3802,6 +3811,13 @@ · 2930 unmodified lines
3802 expediting. Set to zero to disable automatic3811 expediting. Set to zero to disable automatic
3803 expediting.3812 expediting.
3804 3813
3814 stack_guard_gap= [MM]
3815 override the default stack gap protection. The value
3816 is in page units and it defines how many pages prior
3817 to (for stacks growing down) resp. after (for stacks
3818 growing up) the main stack are reserved for no other
3819 mapping. Default value is 256 pages.
3820
3805 stacktrace [FTRACE]3821 stacktrace [FTRACE]
3806 Enabled the stack tracer on boot up.3822 Enabled the stack tracer on boot up.
3807 3823
Documentation/devicetree/bindings/net/dsa/marvell.txt+4−0
@@ -26,6 +26,10 @@ Optional properties: · 25 unmodified lines
26- interrupt-controller : Indicates the switch is itself an interrupt26- interrupt-controller : Indicates the switch is itself an interrupt
27 controller. This is used for the PHY interrupts.27 controller. This is used for the PHY interrupts.
28#interrupt-cells = <2> : Controller uses two cells, number and flag28#interrupt-cells = <2> : Controller uses two cells, number and flag
29- eeprom-length : Set to the length of an EEPROM connected to the
30 switch. Must be set if the switch can not detect
31 the presence and/or size of a connected EEPROM,
32 otherwise optional.
29- mdio : Container of PHY and devices on the switches MDIO33- mdio : Container of PHY and devices on the switches MDIO
30 bus.34 bus.
31- mdio? : Container of PHYs and devices on the external MDIO35- mdio? : Container of PHYs and devices on the external MDIO
Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt+0−2
@@ -247,7 +247,6 @@ bias-bus-hold - latch weakly · 246 unmodified lines
247bias-pull-up - pull up the pin247bias-pull-up - pull up the pin
248bias-pull-down - pull down the pin248bias-pull-down - pull down the pin
249bias-pull-pin-default - use pin-default pull state249bias-pull-pin-default - use pin-default pull state
250bi-directional - pin supports simultaneous input/output operations
251drive-push-pull - drive actively high and low250drive-push-pull - drive actively high and low
252drive-open-drain - drive with open drain251drive-open-drain - drive with open drain
253drive-open-source - drive with open source252drive-open-source - drive with open source
@@ -260,7 +259,6 @@ input-debounce - debounce mode with debound time X · 6 unmodified lines
260power-source - select between different power supplies259power-source - select between different power supplies
261low-power-enable - enable low power mode260low-power-enable - enable low power mode
262low-power-disable - disable low power mode261low-power-disable - disable low power mode
263output-enable - enable output on pin regardless of output value
264output-low - set the pin to output mode with low level262output-low - set the pin to output mode with low level
265output-high - set the pin to output mode with high level263output-high - set the pin to output mode with high level
266slew-rate - set the slew rate264slew-rate - set the slew rate
Documentation/devicetree/bindings/usb/dwc2.txt+1−0
@@ -10,6 +10,7 @@ Required properties: · 9 unmodified lines
10 - "rockchip,rk3288-usb", "rockchip,rk3066-usb", "snps,dwc2": for rk3288 Soc;10 - "rockchip,rk3288-usb", "rockchip,rk3066-usb", "snps,dwc2": for rk3288 Soc;
11 - "lantiq,arx100-usb": The DWC2 USB controller instance in Lantiq ARX SoCs;11 - "lantiq,arx100-usb": The DWC2 USB controller instance in Lantiq ARX SoCs;
12 - "lantiq,xrx200-usb": The DWC2 USB controller instance in Lantiq XRX SoCs;12 - "lantiq,xrx200-usb": The DWC2 USB controller instance in Lantiq XRX SoCs;
13 - "amlogic,meson8-usb": The DWC2 USB controller instance in Amlogic Meson8 SoCs;
13 - "amlogic,meson8b-usb": The DWC2 USB controller instance in Amlogic Meson8b SoCs;14 - "amlogic,meson8b-usb": The DWC2 USB controller instance in Amlogic Meson8b SoCs;
14 - "amlogic,meson-gxbb-usb": The DWC2 USB controller instance in Amlogic S905 SoCs;15 - "amlogic,meson-gxbb-usb": The DWC2 USB controller instance in Amlogic S905 SoCs;
15 - "amcc,dwc-otg": The DWC2 USB controller instance in AMCC Canyonlands 460EX SoCs;16 - "amcc,dwc-otg": The DWC2 USB controller instance in AMCC Canyonlands 460EX SoCs;
Documentation/networking/dpaa.txt+194−0
@@ -0,0 +1,194 @@
1The QorIQ DPAA Ethernet Driver
2==============================
3
4Authors:
5Madalin Bucur <madalin.bucur@nxp.com>
6Camelia Groza <camelia.groza@nxp.com>
7
8Contents
9========
10
11 - DPAA Ethernet Overview
12 - DPAA Ethernet Supported SoCs
13 - Configuring DPAA Ethernet in your kernel
14 - DPAA Ethernet Frame Processing
15 - DPAA Ethernet Features
16 - Debugging
17
18DPAA Ethernet Overview
19======================
20
21DPAA stands for Data Path Acceleration Architecture and it is a
22set of networking acceleration IPs that are available on several
23generations of SoCs, both on PowerPC and ARM64.
24
25The Freescale DPAA architecture consists of a series of hardware blocks
26that support Ethernet connectivity. The Ethernet driver depends upon the
27following drivers in the Linux kernel:
28
29 - Peripheral Access Memory Unit (PAMU) (* needed only for PPC platforms)
30 drivers/iommu/fsl_*
31 - Frame Manager (FMan)
32 drivers/net/ethernet/freescale/fman
33 - Queue Manager (QMan), Buffer Manager (BMan)
34 drivers/soc/fsl/qbman
35
36A simplified view of the dpaa_eth interfaces mapped to FMan MACs:
37
38 dpaa_eth /eth0\ ... /ethN\
39 driver | | | |
40 ------------- ---- ----------- ---- -------------
41 -Ports / Tx Rx \ ... / Tx Rx \
42 FMan | | | |
43 -MACs | MAC0 | | MACN |
44 / dtsec0 \ ... / dtsecN \ (or tgec)
45 / \ / \(or memac)
46 --------- -------------- --- -------------- ---------
47 FMan, FMan Port, FMan SP, FMan MURAM drivers
48 ---------------------------------------------------------
49 FMan HW blocks: MURAM, MACs, Ports, SP
50 ---------------------------------------------------------
51
52The dpaa_eth relation to the QMan, BMan and FMan:
53 ________________________________
54 dpaa_eth / eth0 \
55 driver / \
56 --------- -^- -^- -^- --- ---------
57 QMan driver / \ / \ / \ \ / | BMan |
58 |Rx | |Rx | |Tx | |Tx | | driver |
59 --------- |Dfl| |Err| |Cnf| |FQs| | |
60 QMan HW |FQ | |FQ | |FQs| | | | |
61 / \ / \ / \ \ / | |
62 --------- --- --- --- -v- ---------
63 | FMan QMI | |
64 | FMan HW FMan BMI | BMan HW |
65 ----------------------- --------
66
67where the acronyms used above (and in the code) are:
68DPAA = Data Path Acceleration Architecture
69FMan = DPAA Frame Manager
70QMan = DPAA Queue Manager
71BMan = DPAA Buffers Manager
72QMI = QMan interface in FMan
73BMI = BMan interface in FMan
74FMan SP = FMan Storage Profiles
75MURAM = Multi-user RAM in FMan
76FQ = QMan Frame Queue
77Rx Dfl FQ = default reception FQ
78Rx Err FQ = Rx error frames FQ
79Tx Cnf FQ = Tx confirmation FQs
80Tx FQs = transmission frame queues
81dtsec = datapath three speed Ethernet controller (10/100/1000 Mbps)
82tgec = ten gigabit Ethernet controller (10 Gbps)
83memac = multirate Ethernet MAC (10/100/1000/10000)
84
85DPAA Ethernet Supported SoCs
86============================
87
88The DPAA drivers enable the Ethernet controllers present on the following SoCs:
89
90# PPC
91P1023
92P2041
93P3041
94P4080
95P5020
96P5040
97T1023
98T1024
99T1040
100T1042
101T2080
102T4240
103B4860
104
105# ARM
106LS1043A
107LS1046A
108
109Configuring DPAA Ethernet in your kernel
110========================================
111
112To enable the DPAA Ethernet driver, the following Kconfig options are required:
113
114# common for arch/arm64 and arch/powerpc platforms
115CONFIG_FSL_DPAA=y
116CONFIG_FSL_FMAN=y
117CONFIG_FSL_DPAA_ETH=y
118CONFIG_FSL_XGMAC_MDIO=y
119
120# for arch/powerpc only
121CONFIG_FSL_PAMU=y
122
123# common options needed for the PHYs used on the RDBs
124CONFIG_VITESSE_PHY=y
125CONFIG_REALTEK_PHY=y
126CONFIG_AQUANTIA_PHY=y
127
128DPAA Ethernet Frame Processing
129==============================
130
131On Rx, buffers for the incoming frames are retrieved from one of the three
132existing buffers pools. The driver initializes and seeds these, each with
133buffers of different sizes: 1KB, 2KB and 4KB.
134
135On Tx, all transmitted frames are returned to the driver through Tx
136confirmation frame queues. The driver is then responsible for freeing the
137buffers. In order to do this properly, a backpointer is added to the buffer
138before transmission that points to the skb. When the buffer returns to the
139driver on a confirmation FQ, the skb can be correctly consumed.
140
141DPAA Ethernet Features
142======================
143
144Currently the DPAA Ethernet driver enables the basic features required for
145a Linux Ethernet driver. The support for advanced features will be added
146gradually.
147
148The driver has Rx and Tx checksum offloading for UDP and TCP. Currently the Rx
149checksum offload feature is enabled by default and cannot be controlled through
150ethtool.
151
152The driver has support for multiple prioritized Tx traffic classes. Priorities
153range from 0 (lowest) to 3 (highest). These are mapped to HW workqueues with
154strict priority levels. Each traffic class contains NR_CPU TX queues. By
155default, only one traffic class is enabled and the lowest priority Tx queues
156are used. Higher priority traffic classes can be enabled with the mqprio
157qdisc. For example, all four traffic classes are enabled on an interface with
158the following command. Furthermore, skb priority levels are mapped to traffic
159classes as follows:
160
161 * priorities 0 to 3 - traffic class 0 (low priority)
162 * priorities 4 to 7 - traffic class 1 (medium-low priority)
163 * priorities 8 to 11 - traffic class 2 (medium-high priority)
164 * priorities 12 to 15 - traffic class 3 (high priority)
165
166tc qdisc add dev <int> root handle 1: \
167 mqprio num_tc 4 map 0 0 0 0 1 1 1 1 2 2 2 2 3 3 3 3 hw 1
168
169Debugging
170=========
171
172The following statistics are exported for each interface through ethtool:
173
174 - interrupt count per CPU
175 - Rx packets count per CPU
176 - Tx packets count per CPU
177 - Tx confirmed packets count per CPU
178 - Tx S/G frames count per CPU
179 - Tx error count per CPU
180 - Rx error count per CPU
181 - Rx error count per type
182 - congestion related statistics:
183 - congestion status
184 - time spent in congestion
185 - number of time the device entered congestion
186 - dropped packets count per cause
187
188The driver also exports the following information in sysfs:
189
190 - the FQ IDs for each FQ type
191 /sys/devices/platform/dpaa-ethernet.0/net/<int>/fqids
192
193 - the IDs of the buffer pools in use
194 /sys/devices/platform/dpaa-ethernet.0/net/<int>/bpids
Documentation/networking/scaling.txt+1−1
@@ -122,7 +122,7 @@ associated flow of the packet. The hash is either provided by hardware · 121 unmodified lines
122or will be computed in the stack. Capable hardware can pass the hash in122or will be computed in the stack. Capable hardware can pass the hash in
123the receive descriptor for the packet; this would usually be the same123the receive descriptor for the packet; this would usually be the same
124hash used for RSS (e.g. computed Toeplitz hash). The hash is saved in124hash used for RSS (e.g. computed Toeplitz hash). The hash is saved in
125skb->rx_hash and can be used elsewhere in the stack as a hash of the125skb->hash and can be used elsewhere in the stack as a hash of the
126packet’s flow.126packet’s flow.
127 127
128Each receive hardware queue has an associated list of CPUs to which128Each receive hardware queue has an associated list of CPUs to which
Documentation/networking/tcp.txt+13−18
@@ -1,7 +1,7 @@
1TCP protocol1TCP protocol
2============2============
3 3
4Last updated: 9 February 20084Last updated: 3 June 2017
5 5
6Contents6Contents
7========7========
@@ -29,18 +29,19 @@ As of 2.6.13, Linux supports pluggable congestion control algorithms. · 21 unmodified lines
29A congestion control mechanism can be registered through functions in29A congestion control mechanism can be registered through functions in
30tcp_cong.c. The functions used by the congestion control mechanism are30tcp_cong.c. The functions used by the congestion control mechanism are
31registered via passing a tcp_congestion_ops struct to31registered via passing a tcp_congestion_ops struct to
32tcp_register_congestion_control. As a minimum name, ssthresh,32tcp_register_congestion_control. As a minimum, the congestion control
33cong_avoid must be valid.33mechanism must provide a valid name and must implement either ssthresh,
34cong_avoid and undo_cwnd hooks or the "omnipotent" cong_control hook.
34 35
35Private data for a congestion control mechanism is stored in tp->ca_priv.36Private data for a congestion control mechanism is stored in tp->ca_priv.
36tcp_ca(tp) returns a pointer to this space. This is preallocated space - it37tcp_ca(tp) returns a pointer to this space. This is preallocated space - it
37is important to check the size of your private data will fit this space, or38is important to check the size of your private data will fit this space, or
38alternatively space could be allocated elsewhere and a pointer to it could39alternatively, space could be allocated elsewhere and a pointer to it could
39be stored here.40be stored here.
40 41
41There are three kinds of congestion control algorithms currently: The42There are three kinds of congestion control algorithms currently: The
42simplest ones are derived from TCP reno (highspeed, scalable) and just43simplest ones are derived from TCP reno (highspeed, scalable) and just
43provide an alternative the congestion window calculation. More complex44provide an alternative congestion window calculation. More complex
44ones like BIC try to look at other events to provide better45ones like BIC try to look at other events to provide better
45heuristics. There are also round trip time based algorithms like46heuristics. There are also round trip time based algorithms like
46Vegas and Westwood+.47Vegas and Westwood+.
@@ -49,21 +50,15 @@ Good TCP congestion control is a complex problem because the algorithm · 2 unmodified lines
49needs to maintain fairness and performance. Please review current50needs to maintain fairness and performance. Please review current
50research and RFC's before developing new modules.51research and RFC's before developing new modules.
51 52
52The method that is used to determine which congestion control mechanism is53The default congestion control mechanism is chosen based on the
53determined by the setting of the sysctl net.ipv4.tcp_congestion_control.54DEFAULT_TCP_CONG Kconfig parameter. If you really want a particular default
54The default congestion control will be the last one registered (LIFO);55value then you can set it using sysctl net.ipv4.tcp_congestion_control. The
55so if you built everything as modules, the default will be reno. If you56module will be autoloaded if needed and you will get the expected protocol. If
56build with the defaults from Kconfig, then CUBIC will be builtin (not a57you ask for an unknown congestion method, then the sysctl attempt will fail.
57module) and it will end up the default.
58 58
59If you really want a particular default value then you will need59If you remove a TCP congestion control module, then you will get the next
60to set it with the sysctl. If you use a sysctl, the module will be autoloaded
61if needed and you will get the expected protocol. If you ask for an
62unknown congestion method, then the sysctl attempt will fail.
63
64If you remove a tcp congestion control module, then you will get the next
65available one. Since reno cannot be built as a module, and cannot be60available one. Since reno cannot be built as a module, and cannot be
66deleted, it will always be available.61removed, it will always be available.
67 62
68How the new TCP output machine [nyi] works.63How the new TCP output machine [nyi] works.
69===========================================64===========================================
MAINTAINERS+16−17
@@ -1172,7 +1172,7 @@ N: clps711x · 1171 unmodified lines
1172 1172
1173ARM/CIRRUS LOGIC EP93XX ARM ARCHITECTURE1173ARM/CIRRUS LOGIC EP93XX ARM ARCHITECTURE
1174M: Hartley Sweeten <hsweeten@visionengravers.com>1174M: Hartley Sweeten <hsweeten@visionengravers.com>
1175M: Ryan Mallon <rmallon@gmail.com>1175M: Alexander Sverdlin <alexander.sverdlin@gmail.com>
1176L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)1176L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
1177S: Maintained1177S: Maintained
1178F: arch/arm/mach-ep93xx/1178F: arch/arm/mach-ep93xx/
@@ -1489,13 +1489,15 @@ M: Gregory Clement <gregory.clement@free-electrons.com> · 310 unmodified lines
1489M: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>1489M: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
1490L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)1490L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
1491S: Maintained1491S: Maintained
1492F: arch/arm/mach-mvebu/
1493F: drivers/rtc/rtc-armada38x.c
1494F: arch/arm/boot/dts/armada*1492F: arch/arm/boot/dts/armada*
1495F: arch/arm/boot/dts/kirkwood*1493F: arch/arm/boot/dts/kirkwood*
1494F: arch/arm/configs/mvebu_*_defconfig
1495F: arch/arm/mach-mvebu/
1496F: arch/arm64/boot/dts/marvell/armada*1496F: arch/arm64/boot/dts/marvell/armada*
1497F: drivers/cpufreq/mvebu-cpufreq.c1497F: drivers/cpufreq/mvebu-cpufreq.c
1498F: arch/arm/configs/mvebu_*_defconfig1498F: drivers/irqchip/irq-armada-370-xp.c
1499F: drivers/irqchip/irq-mvebu-*
1500F: drivers/rtc/rtc-armada38x.c
1499 1501
1500ARM/Marvell Berlin SoC support1502ARM/Marvell Berlin SoC support
1501M: Jisheng Zhang <jszhang@marvell.com>1503M: Jisheng Zhang <jszhang@marvell.com>
@@ -1721,7 +1723,6 @@ N: rockchip · 219 unmodified lines
1721ARM/SAMSUNG EXYNOS ARM ARCHITECTURES1723ARM/SAMSUNG EXYNOS ARM ARCHITECTURES
1722M: Kukjin Kim <kgene@kernel.org>1724M: Kukjin Kim <kgene@kernel.org>
1723M: Krzysztof Kozlowski <krzk@kernel.org>1725M: Krzysztof Kozlowski <krzk@kernel.org>
1724R: Javier Martinez Canillas <javier@osg.samsung.com>
1725L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)1726L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
1726L: linux-samsung-soc@vger.kernel.org (moderated for non-subscribers)1727L: linux-samsung-soc@vger.kernel.org (moderated for non-subscribers)
1727Q: https://patchwork.kernel.org/project/linux-samsung-soc/list/1728Q: https://patchwork.kernel.org/project/linux-samsung-soc/list/
@@ -1829,7 +1830,6 @@ F: drivers/edac/altera_edac. · 101 unmodified lines
1829ARM/STI ARCHITECTURE1830ARM/STI ARCHITECTURE
1830M: Patrice Chotard <patrice.chotard@st.com>1831M: Patrice Chotard <patrice.chotard@st.com>
1831L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)1832L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
1832L: kernel@stlinux.com
1833W: http://www.stlinux.com1833W: http://www.stlinux.com
1834S: Maintained1834S: Maintained
1835F: arch/arm/mach-sti/1835F: arch/arm/mach-sti/
@@ -5630,7 +5630,7 @@ F: scripts/get_maintainer.pl · 3794 unmodified lines
5630 5630
5631GENWQE (IBM Generic Workqueue Card)5631GENWQE (IBM Generic Workqueue Card)
5632M: Frank Haverkamp <haver@linux.vnet.ibm.com>5632M: Frank Haverkamp <haver@linux.vnet.ibm.com>
5633M: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>5633M: Guilherme G. Piccoli <gpiccoli@linux.vnet.ibm.com>
5634S: Supported5634S: Supported
5635F: drivers/misc/genwqe/5635F: drivers/misc/genwqe/
5636 5636
@@ -5675,7 +5675,6 @@ F: tools/testing/selftests/gpio/ · 38 unmodified lines
5675 5675
5676GPIO SUBSYSTEM5676GPIO SUBSYSTEM
5677M: Linus Walleij <linus.walleij@linaro.org>5677M: Linus Walleij <linus.walleij@linaro.org>
5678M: Alexandre Courbot <gnurou@gmail.com>
5679L: linux-gpio@vger.kernel.org5678L: linux-gpio@vger.kernel.org
5680T: git git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git5679T: git git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git
5681S: Maintained5680S: Maintained
@@ -7715,7 +7714,7 @@ F: drivers/platform/x86/hp_accel.c · 2033 unmodified lines
7715 7714
7716LIVE PATCHING7715LIVE PATCHING
7717M: Josh Poimboeuf <jpoimboe@redhat.com>7716M: Josh Poimboeuf <jpoimboe@redhat.com>
7718M: Jessica Yu <jeyu@redhat.com>7717M: Jessica Yu <jeyu@kernel.org>
7719M: Jiri Kosina <jikos@kernel.org>7718M: Jiri Kosina <jikos@kernel.org>
7720M: Miroslav Benes <mbenes@suse.cz>7719M: Miroslav Benes <mbenes@suse.cz>
7721R: Petr Mladek <pmladek@suse.com>7720R: Petr Mladek <pmladek@suse.com>
@@ -8547,7 +8546,7 @@ S: Odd Fixes · 825 unmodified lines
8547F: drivers/media/radio/radio-miropcm20*8546F: drivers/media/radio/radio-miropcm20*
8548 8547
8549MELLANOX MLX4 core VPI driver8548MELLANOX MLX4 core VPI driver
8550M: Yishai Hadas <yishaih@mellanox.com>8549M: Tariq Toukan <tariqt@mellanox.com>
8551L: netdev@vger.kernel.org8550L: netdev@vger.kernel.org
8552L: linux-rdma@vger.kernel.org8551L: linux-rdma@vger.kernel.org
8553W: http://www.mellanox.com8552W: http://www.mellanox.com
@@ -8555,7 +8554,6 @@ Q: http://patchwork.ozlabs.org/project/netdev/list/ · 1 unmodified line
8555S: Supported8554S: Supported
8556F: drivers/net/ethernet/mellanox/mlx4/8555F: drivers/net/ethernet/mellanox/mlx4/
8557F: include/linux/mlx4/8556F: include/linux/mlx4/
8558F: include/uapi/rdma/mlx4-abi.h
8559 8557
8560MELLANOX MLX4 IB driver8558MELLANOX MLX4 IB driver
8561M: Yishai Hadas <yishaih@mellanox.com>8559M: Yishai Hadas <yishaih@mellanox.com>
@@ -8565,6 +8563,7 @@ Q: http://patchwork.kernel.org/project/linux-rdma/list/ · 3 unmodified lines
8565S: Supported8563S: Supported
8566F: drivers/infiniband/hw/mlx4/8564F: drivers/infiniband/hw/mlx4/
8567F: include/linux/mlx4/8565F: include/linux/mlx4/
8566F: include/uapi/rdma/mlx4-abi.h
8568 8567
8569MELLANOX MLX5 core VPI driver8568MELLANOX MLX5 core VPI driver
8570M: Saeed Mahameed <saeedm@mellanox.com>8569M: Saeed Mahameed <saeedm@mellanox.com>
@@ -8577,7 +8576,6 @@ Q: http://patchwork.ozlabs.org/project/netdev/list/ · 6 unmodified lines
8577S: Supported8576S: Supported
8578F: drivers/net/ethernet/mellanox/mlx5/core/8577F: drivers/net/ethernet/mellanox/mlx5/core/
8579F: include/linux/mlx5/8578F: include/linux/mlx5/
8580F: include/uapi/rdma/mlx5-abi.h
8581 8579
8582MELLANOX MLX5 IB driver8580MELLANOX MLX5 IB driver
8583M: Matan Barak <matanb@mellanox.com>8581M: Matan Barak <matanb@mellanox.com>
@@ -8588,6 +8586,7 @@ Q: http://patchwork.kernel.org/project/linux-rdma/list/ · 4 unmodified lines
8588S: Supported8586S: Supported
8589F: drivers/infiniband/hw/mlx5/8587F: drivers/infiniband/hw/mlx5/
8590F: include/linux/mlx5/8588F: include/linux/mlx5/
8589F: include/uapi/rdma/mlx5-abi.h
8591 8590
8592MELEXIS MLX90614 DRIVER8591MELEXIS MLX90614 DRIVER
8593M: Crt Mori <cmo@melexis.com>8592M: Crt Mori <cmo@melexis.com>
@@ -8627,7 +8626,7 @@ S: Maintained · 33 unmodified lines
8627F: drivers/media/dvb-frontends/mn88473*8626F: drivers/media/dvb-frontends/mn88473*
8628 8627
8629MODULE SUPPORT8628MODULE SUPPORT
8630M: Jessica Yu <jeyu@redhat.com>8629M: Jessica Yu <jeyu@kernel.org>
8631M: Rusty Russell <rusty@rustcorp.com.au>8630M: Rusty Russell <rusty@rustcorp.com.au>
8632T: git git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux.git modules-next8631T: git git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux.git modules-next
8633S: Maintained8632S: Maintained
@@ -10503,7 +10502,7 @@ S: Orphan · 1869 unmodified lines
10503 10502
10504PXA RTC DRIVER10503PXA RTC DRIVER
10505M: Robert Jarzmik <robert.jarzmik@free.fr>10504M: Robert Jarzmik <robert.jarzmik@free.fr>
10506L: rtc-linux@googlegroups.com10505L: linux-rtc@vger.kernel.org
10507S: Maintained10506S: Maintained
10508 10507
10509QAT DRIVER10508QAT DRIVER
@@ -10810,7 +10809,7 @@ X: kernel/torture.c · 300 unmodified lines
10810REAL TIME CLOCK (RTC) SUBSYSTEM10809REAL TIME CLOCK (RTC) SUBSYSTEM
10811M: Alessandro Zummo <a.zummo@towertech.it>10810M: Alessandro Zummo <a.zummo@towertech.it>
10812M: Alexandre Belloni <alexandre.belloni@free-electrons.com>10811M: Alexandre Belloni <alexandre.belloni@free-electrons.com>
10813L: rtc-linux@googlegroups.com10812L: linux-rtc@vger.kernel.org
10814Q: http://patchwork.ozlabs.org/project/rtc-linux/list/10813Q: http://patchwork.ozlabs.org/project/rtc-linux/list/
10815T: git git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux.git10814T: git git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux.git
10816S: Maintained10815S: Maintained
@@ -11321,7 +11320,6 @@ F: drivers/media/rc/serial_ir.c · 504 unmodified lines
11321 11320
11322STI CEC DRIVER11321STI CEC DRIVER
11323M: Benjamin Gaignard <benjamin.gaignard@linaro.org>11322M: Benjamin Gaignard <benjamin.gaignard@linaro.org>
11324L: kernel@stlinux.com
11325S: Maintained11323S: Maintained
11326F: drivers/staging/media/st-cec/11324F: drivers/staging/media/st-cec/
11327F: Documentation/devicetree/bindings/media/stih-cec.txt11325F: Documentation/devicetree/bindings/media/stih-cec.txt
@@ -11831,6 +11829,7 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/nsekhar/linux-davinci.git · 503 unmodified lines
11831S: Supported11829S: Supported
11832F: arch/arm/mach-davinci/11830F: arch/arm/mach-davinci/
11833F: drivers/i2c/busses/i2c-davinci.c11831F: drivers/i2c/busses/i2c-davinci.c
11832F: arch/arm/boot/dts/da850*
11834 11833
11835TI DAVINCI SERIES MEDIA DRIVER11834TI DAVINCI SERIES MEDIA DRIVER
11836M: "Lad, Prabhakar" <prabhakar.csengg@gmail.com>11835M: "Lad, Prabhakar" <prabhakar.csengg@gmail.com>
@@ -13920,7 +13919,7 @@ S: Odd fixes · 2083 unmodified lines
13920F: drivers/net/wireless/wl3501*13919F: drivers/net/wireless/wl3501*
13921 13920
13922WOLFSON MICROELECTRONICS DRIVERS13921WOLFSON MICROELECTRONICS DRIVERS
13923L: patches@opensource.wolfsonmicro.com13922L: patches@opensource.cirrus.com
13924T: git https://github.com/CirrusLogic/linux-drivers.git13923T: git https://github.com/CirrusLogic/linux-drivers.git
13925W: https://github.com/CirrusLogic/linux-drivers/wiki13924W: https://github.com/CirrusLogic/linux-drivers/wiki
13926S: Supported13925S: Supported
Makefile+1−1
@@ -1,7 +1,7 @@
1VERSION = 41VERSION = 4
2PATCHLEVEL = 122PATCHLEVEL = 12
3SUBLEVEL = 03SUBLEVEL = 0
4EXTRAVERSION = -rc34EXTRAVERSION = -rc6
5NAME = Fearless Coyote5NAME = Fearless Coyote
6 6
7# *DOCUMENTATION*7# *DOCUMENTATION*
arch/arc/mm/mmap.c+1−1
@@ -65,7 +65,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, · 64 unmodified lines
65 65
66 vma = find_vma(mm, addr);66 vma = find_vma(mm, addr);
67 if (TASK_SIZE - len >= addr &&67 if (TASK_SIZE - len >= addr &&
68 (!vma || addr + len <= vma->vm_start))68 (!vma || addr + len <= vm_start_gap(vma)))
69 return addr;69 return addr;
70 }70 }
71 71
arch/arm/boot/compressed/efi-header.S+1−3
@@ -17,14 +17,12 @@ · 16 unmodified lines
17 @ there.17 @ there.
18 .inst 'M' | ('Z' << 8) | (0x1310 << 16) @ tstne r0, #0x4d00018 .inst 'M' | ('Z' << 8) | (0x1310 << 16) @ tstne r0, #0x4d000
19#else19#else
20 mov r0, r020 W(mov) r0, r0
21#endif21#endif
22 .endm22 .endm
23 23
24 .macro __EFI_HEADER24 .macro __EFI_HEADER
25#ifdef CONFIG_EFI_STUB25#ifdef CONFIG_EFI_STUB
26 b __efi_start
27
28 .set start_offset, __efi_start - start26 .set start_offset, __efi_start - start
29 .org start + 0x3c27 .org start + 0x3c
30 @28 @
arch/arm/boot/compressed/head.S+10−7
@@ -130,19 +130,22 @@ start: · 129 unmodified lines
130 .rept 7130 .rept 7
131 __nop131 __nop
132 .endr132 .endr
133 ARM( mov r0, r0 )133#ifndef CONFIG_THUMB2_KERNEL
134 ARM( b 1f )134 mov r0, r0
135 THUMB( badr r12, 1f )135#else
136 THUMB( bx r12 )136 AR_CLASS( sub pc, pc, #3 ) @ A/R: switch to Thumb2 mode
137 M_CLASS( nop.w ) @ M: already in Thumb2 mode
138 .thumb
139#endif
140 W(b) 1f
137 141
138 .word _magic_sig @ Magic numbers to help the loader142 .word _magic_sig @ Magic numbers to help the loader
139 .word _magic_start @ absolute load/run zImage address143 .word _magic_start @ absolute load/run zImage address
140 .word _magic_end @ zImage end address144 .word _magic_end @ zImage end address
141 .word 0x04030201 @ endianness flag145 .word 0x04030201 @ endianness flag
142 146
143 THUMB( .thumb )147 __EFI_HEADER
1441: __EFI_HEADER1481:
145
146 ARM_BE8( setend be ) @ go BE8 if compiled for BE8149 ARM_BE8( setend be ) @ go BE8 if compiled for BE8
147 AR_CLASS( mrs r9, cpsr )150 AR_CLASS( mrs r9, cpsr )
148#ifdef CONFIG_ARM_VIRT_EXT151#ifdef CONFIG_ARM_VIRT_EXT
arch/arm/boot/dts/am335x-sl50.dts+2−6
@@ -220,7 +220,7 @@ · 219 unmodified lines
220 220
221 mmc1_pins: pinmux_mmc1_pins {221 mmc1_pins: pinmux_mmc1_pins {
222 pinctrl-single,pins = <222 pinctrl-single,pins = <
223 AM33XX_IOPAD(0x960, PIN_INPUT | MUX_MODE7) /* spi0_cs1.gpio0_6 */223 AM33XX_IOPAD(0x96c, PIN_INPUT | MUX_MODE7) /* uart0_rtsn.gpio1_9 */
224 >;224 >;
225 };225 };
226 226
@@ -280,10 +280,6 @@ · 53 unmodified lines
280 AM33XX_IOPAD(0x834, PIN_INPUT_PULLUP | MUX_MODE7) /* nKbdReset - gpmc_ad13.gpio1_13 */280 AM33XX_IOPAD(0x834, PIN_INPUT_PULLUP | MUX_MODE7) /* nKbdReset - gpmc_ad13.gpio1_13 */
281 AM33XX_IOPAD(0x838, PIN_INPUT_PULLUP | MUX_MODE7) /* nDispReset - gpmc_ad14.gpio1_14 */281 AM33XX_IOPAD(0x838, PIN_INPUT_PULLUP | MUX_MODE7) /* nDispReset - gpmc_ad14.gpio1_14 */
282 AM33XX_IOPAD(0x844, PIN_INPUT_PULLUP | MUX_MODE7) /* USB1_enPower - gpmc_a1.gpio1_17 */282 AM33XX_IOPAD(0x844, PIN_INPUT_PULLUP | MUX_MODE7) /* USB1_enPower - gpmc_a1.gpio1_17 */
283 /* AVR Programming - SPI Bus (bit bang) - Screen and Keyboard */
284 AM33XX_IOPAD(0x954, PIN_INPUT_PULLUP | MUX_MODE7) /* Kbd/Disp/BattMOSI spi0_d0.gpio0_3 */
285 AM33XX_IOPAD(0x958, PIN_INPUT_PULLUP | MUX_MODE7) /* Kbd/Disp/BattMISO spi0_d1.gpio0_4 */
286 AM33XX_IOPAD(0x950, PIN_INPUT_PULLUP | MUX_MODE7) /* Kbd/Disp/BattSCLK spi0_clk.gpio0_2 */
287 /* PDI Bus - Battery system */283 /* PDI Bus - Battery system */
288 AM33XX_IOPAD(0x840, PIN_INPUT_PULLUP | MUX_MODE7) /* nBattReset gpmc_a0.gpio1_16 */284 AM33XX_IOPAD(0x840, PIN_INPUT_PULLUP | MUX_MODE7) /* nBattReset gpmc_a0.gpio1_16 */
289 AM33XX_IOPAD(0x83c, PIN_INPUT_PULLUP | MUX_MODE7) /* BattPDIData gpmc_ad15.gpio1_15 */285 AM33XX_IOPAD(0x83c, PIN_INPUT_PULLUP | MUX_MODE7) /* BattPDIData gpmc_ad15.gpio1_15 */
@@ -384,7 +380,7 @@ · 94 unmodified lines
384 pinctrl-names = "default";380 pinctrl-names = "default";
385 pinctrl-0 = <&mmc1_pins>;381 pinctrl-0 = <&mmc1_pins>;
386 bus-width = <4>;382 bus-width = <4>;
387 cd-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;383 cd-gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
388 vmmc-supply = <&vmmcsd_fixed>;384 vmmc-supply = <&vmmcsd_fixed>;
389};385};
390 386
arch/arm/boot/dts/bcm283x.dtsi+5−0
@@ -3,6 +3,11 @@ · 2 unmodified lines
3#include <dt-bindings/clock/bcm2835-aux.h>3#include <dt-bindings/clock/bcm2835-aux.h>
4#include <dt-bindings/gpio/gpio.h>4#include <dt-bindings/gpio/gpio.h>
5 5
6/* firmware-provided startup stubs live here, where the secondary CPUs are
7 * spinning.
8 */
9/memreserve/ 0x00000000 0x00001000;
10
6/* This include file covers the common peripherals and configuration between11/* This include file covers the common peripherals and configuration between
7 * bcm2835 and bcm2836 implementations, leaving the CPU configuration to12 * bcm2835 and bcm2836 implementations, leaving the CPU configuration to
8 * bcm2835.dtsi and bcm2836.dtsi.13 * bcm2835.dtsi and bcm2836.dtsi.
arch/arm/boot/dts/imx6ul-14x14-evk.dts+6−0
@@ -120,10 +120,16 @@ · 119 unmodified lines
120 120
121 ethphy0: ethernet-phy@2 {121 ethphy0: ethernet-phy@2 {
122 reg = <2>;122 reg = <2>;
123 micrel,led-mode = <1>;
124 clocks = <&clks IMX6UL_CLK_ENET_REF>;
125 clock-names = "rmii-ref";
123 };126 };
124 127
125 ethphy1: ethernet-phy@1 {128 ethphy1: ethernet-phy@1 {
126 reg = <1>;129 reg = <1>;
130 micrel,led-mode = <1>;
131 clocks = <&clks IMX6UL_CLK_ENET2_REF>;
132 clock-names = "rmii-ref";
127 };133 };
128 };134 };
129};135};
arch/arm/boot/dts/keystone-k2l-netcp.dtsi+2−2
@@ -137,8 +137,8 @@ netcp: netcp@26000000 { · 136 unmodified lines
137 /* NetCP address range */137 /* NetCP address range */
138 ranges = <0 0x26000000 0x1000000>;138 ranges = <0 0x26000000 0x1000000>;
139 139
140 clocks = <&clkpa>, <&clkcpgmac>, <&chipclk12>, <&clkosr>;140 clocks = <&clkpa>, <&clkcpgmac>, <&chipclk12>;
141 clock-names = "pa_clk", "ethss_clk", "cpts", "osr_clk";141 clock-names = "pa_clk", "ethss_clk", "cpts";
142 dma-coherent;142 dma-coherent;
143 143
144 ti,navigator-dmas = <&dma_gbe 0>,144 ti,navigator-dmas = <&dma_gbe 0>,
arch/arm/boot/dts/keystone-k2l.dtsi+8−0
@@ -232,6 +232,14 @@ · 231 unmodified lines
232 };232 };
233 };233 };
234 234
235 osr: sram@70000000 {
236 compatible = "mmio-sram";
237 reg = <0x70000000 0x10000>;
238 #address-cells = <1>;
239 #size-cells = <1>;
240 clocks = <&clkosr>;
241 };
242
235 dspgpio0: keystone_dsp_gpio@02620240 {243 dspgpio0: keystone_dsp_gpio@02620240 {
236 compatible = "ti,keystone-dsp-gpio";244 compatible = "ti,keystone-dsp-gpio";
237 gpio-controller;245 gpio-controller;
arch/arm/boot/dts/sunxi-h3-h5.dtsi+4−3
@@ -558,10 +558,11 @@ · 557 unmodified lines
558 };558 };
559 559
560 r_ccu: clock@1f01400 {560 r_ccu: clock@1f01400 {
561 compatible = "allwinner,sun50i-a64-r-ccu";561 compatible = "allwinner,sun8i-h3-r-ccu";
562 reg = <0x01f01400 0x100>;562 reg = <0x01f01400 0x100>;
563 clocks = <&osc24M>, <&osc32k>, <&iosc>;563 clocks = <&osc24M>, <&osc32k>, <&iosc>,
564 clock-names = "hosc", "losc", "iosc";564 <&ccu 9>;
565 clock-names = "hosc", "losc", "iosc", "pll-periph";
565 #clock-cells = <1>;566 #clock-cells = <1>;
566 #reset-cells = <1>;567 #reset-cells = <1>;
567 };568 };
arch/arm/boot/dts/versatile-pb.dts+1−1
@@ -1,4 +1,4 @@
1#include <versatile-ab.dts>1#include "versatile-ab.dts"
2 2
3/ {3/ {
4 model = "ARM Versatile PB";4 model = "ARM Versatile PB";
arch/arm/common/mcpm_entry.c+3−3
@@ -235,7 +235,7 @@ int mcpm_cpu_power_up(unsigned int cpu, unsigned int cluster) · 234 unmodified lines
235 return ret;235 return ret;
236}236}
237 237
238typedef void (*phys_reset_t)(unsigned long);238typedef typeof(cpu_reset) phys_reset_t;
239 239
240void mcpm_cpu_power_down(void)240void mcpm_cpu_power_down(void)
241{241{
@@ -300,7 +300,7 @@ void mcpm_cpu_power_down(void) · 58 unmodified lines
300 * on the CPU.300 * on the CPU.
301 */301 */
302 phys_reset = (phys_reset_t)(unsigned long)__pa_symbol(cpu_reset);302 phys_reset = (phys_reset_t)(unsigned long)__pa_symbol(cpu_reset);
303 phys_reset(__pa_symbol(mcpm_entry_point));303 phys_reset(__pa_symbol(mcpm_entry_point), false);
304 304
305 /* should never get here */305 /* should never get here */
306 BUG();306 BUG();
@@ -389,7 +389,7 @@ static int __init nocache_trampoline(unsigned long _arg) · 82 unmodified lines
389 __mcpm_cpu_down(cpu, cluster);389 __mcpm_cpu_down(cpu, cluster);
390 390
391 phys_reset = (phys_reset_t)(unsigned long)__pa_symbol(cpu_reset);391 phys_reset = (phys_reset_t)(unsigned long)__pa_symbol(cpu_reset);
392 phys_reset(__pa_symbol(mcpm_entry_point));392 phys_reset(__pa_symbol(mcpm_entry_point), false);
393 BUG();393 BUG();
394}394}
395 395
arch/arm/include/asm/device.h+2−1
@@ -19,7 +19,8 @@ struct dev_archdata { · 18 unmodified lines
19#ifdef CONFIG_XEN19#ifdef CONFIG_XEN
20 const struct dma_map_ops *dev_dma_ops;20 const struct dma_map_ops *dev_dma_ops;
21#endif21#endif
22 bool dma_coherent;22 unsigned int dma_coherent:1;
23 unsigned int dma_ops_setup:1;
23};24};
24 25
25struct omap_device;26struct omap_device;
arch/arm/include/asm/pgtable-nommu.h+1−0
@@ -66,6 +66,7 @@ typedef pte_t *pte_addr_t; · 65 unmodified lines
66#define pgprot_noncached(prot) (prot)66#define pgprot_noncached(prot) (prot)
67#define pgprot_writecombine(prot) (prot)67#define pgprot_writecombine(prot) (prot)
68#define pgprot_dmacoherent(prot) (prot)68#define pgprot_dmacoherent(prot) (prot)
69#define pgprot_device(prot) (prot)
69 70
70 71
71/*72/*
arch/arm/kvm/init.S+2−3
@@ -104,7 +104,6 @@ __do_hyp_init: · 103 unmodified lines
104 @ - Write permission implies XN: disabled104 @ - Write permission implies XN: disabled
105 @ - Instruction cache: enabled105 @ - Instruction cache: enabled
106 @ - Data/Unified cache: enabled106 @ - Data/Unified cache: enabled
107 @ - Memory alignment checks: enabled
108 @ - MMU: enabled (this code must be run from an identity mapping)107 @ - MMU: enabled (this code must be run from an identity mapping)
109 mrc p15, 4, r0, c1, c0, 0 @ HSCR108 mrc p15, 4, r0, c1, c0, 0 @ HSCR
110 ldr r2, =HSCTLR_MASK109 ldr r2, =HSCTLR_MASK
@@ -112,8 +111,8 @@ __do_hyp_init: · 1 unmodified line
112 mrc p15, 0, r1, c1, c0, 0 @ SCTLR111 mrc p15, 0, r1, c1, c0, 0 @ SCTLR
113 ldr r2, =(HSCTLR_EE | HSCTLR_FI | HSCTLR_I | HSCTLR_C)112 ldr r2, =(HSCTLR_EE | HSCTLR_FI | HSCTLR_I | HSCTLR_C)
114 and r1, r1, r2113 and r1, r1, r2
115 ARM( ldr r2, =(HSCTLR_M | HSCTLR_A) )114 ARM( ldr r2, =(HSCTLR_M) )
116 THUMB( ldr r2, =(HSCTLR_M | HSCTLR_A | HSCTLR_TE) )115 THUMB( ldr r2, =(HSCTLR_M | HSCTLR_TE) )
117 orr r1, r1, r2116 orr r1, r1, r2
118 orr r0, r0, r1117 orr r0, r0, r1
119 mcr p15, 4, r0, c1, c0, 0 @ HSCR118 mcr p15, 4, r0, c1, c0, 0 @ HSCR
arch/arm/mach-at91/Kconfig+1−0
@@ -1,6 +1,7 @@
1menuconfig ARCH_AT911menuconfig ARCH_AT91
2 bool "Atmel SoCs"2 bool "Atmel SoCs"
3 depends on ARCH_MULTI_V4T || ARCH_MULTI_V5 || ARCH_MULTI_V73 depends on ARCH_MULTI_V4T || ARCH_MULTI_V5 || ARCH_MULTI_V7
4 select ARM_CPU_SUSPEND if PM
4 select COMMON_CLK_AT915 select COMMON_CLK_AT91
5 select GPIOLIB6 select GPIOLIB
6 select PINCTRL7 select PINCTRL
arch/arm/mach-davinci/pm.c+6−1
@@ -153,7 +153,8 @@ int __init davinci_pm_init(void) · 152 unmodified lines
153 davinci_sram_suspend = sram_alloc(davinci_cpu_suspend_sz, NULL);153 davinci_sram_suspend = sram_alloc(davinci_cpu_suspend_sz, NULL);
154 if (!davinci_sram_suspend) {154 if (!davinci_sram_suspend) {
155 pr_err("PM: cannot allocate SRAM memory\n");155 pr_err("PM: cannot allocate SRAM memory\n");
156 return -ENOMEM;156 ret = -ENOMEM;
157 goto no_sram_mem;
157 }158 }
158 159
159 davinci_sram_push(davinci_sram_suspend, davinci_cpu_suspend,160 davinci_sram_push(davinci_sram_suspend, davinci_cpu_suspend,
@@ -161,6 +162,10 @@ int __init davinci_pm_init(void) · 1 unmodified line
161 162
162 suspend_set_ops(&davinci_pm_ops);163 suspend_set_ops(&davinci_pm_ops);
163 164
165 return 0;
166
167no_sram_mem:
168 iounmap(pm_config.ddrpsc_reg_base);
164no_ddrpsc_mem:169no_ddrpsc_mem:
165 iounmap(pm_config.ddrpll_reg_base);170 iounmap(pm_config.ddrpll_reg_base);
166no_ddrpll_mem:171no_ddrpll_mem:
arch/arm/mm/dma-mapping.c+14−15
@@ -2311,7 +2311,14 @@ int arm_iommu_attach_device(struct device *dev, · 2310 unmodified lines
2311}2311}
2312EXPORT_SYMBOL_GPL(arm_iommu_attach_device);2312EXPORT_SYMBOL_GPL(arm_iommu_attach_device);
2313 2313
2314static void __arm_iommu_detach_device(struct device *dev)2314/**
2315 * arm_iommu_detach_device
2316 * @dev: valid struct device pointer
2317 *
2318 * Detaches the provided device from a previously attached map.
2319 * This voids the dma operations (dma_map_ops pointer)
2320 */
2321void arm_iommu_detach_device(struct device *dev)
2315{2322{
2316 struct dma_iommu_mapping *mapping;2323 struct dma_iommu_mapping *mapping;
2317 2324
@@ -2324,22 +2331,10 @@ static void __arm_iommu_detach_device(struct device *dev) · 6 unmodified lines
2324 iommu_detach_device(mapping->domain, dev);2331 iommu_detach_device(mapping->domain, dev);
2325 kref_put(&mapping->kref, release_iommu_mapping);2332 kref_put(&mapping->kref, release_iommu_mapping);
2326 to_dma_iommu_mapping(dev) = NULL;2333 to_dma_iommu_mapping(dev) = NULL;
2334 set_dma_ops(dev, NULL);
2327 2335
2328 pr_debug("Detached IOMMU controller from %s device.\n", dev_name(dev));2336 pr_debug("Detached IOMMU controller from %s device.\n", dev_name(dev));
2329}2337}
2330
2331/**
2332 * arm_iommu_detach_device
2333 * @dev: valid struct device pointer
2334 *
2335 * Detaches the provided device from a previously attached map.
2336 * This voids the dma operations (dma_map_ops pointer)
2337 */
2338void arm_iommu_detach_device(struct device *dev)
2339{
2340 __arm_iommu_detach_device(dev);
2341 set_dma_ops(dev, NULL);
2342}
2343EXPORT_SYMBOL_GPL(arm_iommu_detach_device);2338EXPORT_SYMBOL_GPL(arm_iommu_detach_device);
2344 2339
2345static const struct dma_map_ops *arm_get_iommu_dma_map_ops(bool coherent)2340static const struct dma_map_ops *arm_get_iommu_dma_map_ops(bool coherent)
@@ -2379,7 +2374,7 @@ static void arm_teardown_iommu_dma_ops(struct device *dev) · 33 unmodified lines
2379 if (!mapping)2374 if (!mapping)
2380 return;2375 return;
2381 2376
2382 __arm_iommu_detach_device(dev);2377 arm_iommu_detach_device(dev);
2383 arm_iommu_release_mapping(mapping);2378 arm_iommu_release_mapping(mapping);
2384}2379}
2385 2380
@@ -2430,9 +2425,13 @@ void arch_setup_dma_ops(struct device *dev, u64 dma_base, u64 size, · 44 unmodified lines
2430 dev->dma_ops = xen_dma_ops;2425 dev->dma_ops = xen_dma_ops;
2431 }2426 }
2432#endif2427#endif
2428 dev->archdata.dma_ops_setup = true;
2433}2429}
2434 2430
2435void arch_teardown_dma_ops(struct device *dev)2431void arch_teardown_dma_ops(struct device *dev)
2436{2432{
2433 if (!dev->archdata.dma_ops_setup)
2434 return;
2435
2437 arm_teardown_iommu_dma_ops(dev);2436 arm_teardown_iommu_dma_ops(dev);
2438}2437}
arch/arm/mm/mmap.c+2−2
@@ -90,7 +90,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, · 89 unmodified lines
90 90
91 vma = find_vma(mm, addr);91 vma = find_vma(mm, addr);
92 if (TASK_SIZE - len >= addr &&92 if (TASK_SIZE - len >= addr &&
93 (!vma || addr + len <= vma->vm_start))93 (!vma || addr + len <= vm_start_gap(vma)))
94 return addr;94 return addr;
95 }95 }
96 96
@@ -141,7 +141,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, · 44 unmodified lines
141 addr = PAGE_ALIGN(addr);141 addr = PAGE_ALIGN(addr);
142 vma = find_vma(mm, addr);142 vma = find_vma(mm, addr);
143 if (TASK_SIZE - len >= addr &&143 if (TASK_SIZE - len >= addr &&
144 (!vma || addr + len <= vma->vm_start))144 (!vma || addr + len <= vm_start_gap(vma)))
145 return addr;145 return addr;
146 }146 }
147 147
arch/arm64/Kconfig+0−4
@@ -1084,10 +1084,6 @@ config SYSVIPC_COMPAT · 1083 unmodified lines
1084 def_bool y1084 def_bool y
1085 depends on COMPAT && SYSVIPC1085 depends on COMPAT && SYSVIPC
1086 1086
1087config KEYS_COMPAT
1088 def_bool y
1089 depends on COMPAT && KEYS
1090
1091endmenu1087endmenu
1092 1088
1093menu "Power management options"1089menu "Power management options"
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi+3−2
@@ -406,8 +406,9 @@ · 405 unmodified lines
406 r_ccu: clock@1f01400 {406 r_ccu: clock@1f01400 {
407 compatible = "allwinner,sun50i-a64-r-ccu";407 compatible = "allwinner,sun50i-a64-r-ccu";
408 reg = <0x01f01400 0x100>;408 reg = <0x01f01400 0x100>;
409 clocks = <&osc24M>, <&osc32k>, <&iosc>;409 clocks = <&osc24M>, <&osc32k>, <&iosc>,
410 clock-names = "hosc", "losc", "iosc";410 <&ccu 11>;
411 clock-names = "hosc", "losc", "iosc", "pll-periph";
411 #clock-cells = <1>;412 #clock-cells = <1>;
412 #reset-cells = <1>;413 #reset-cells = <1>;
413 };414 };
arch/arm64/boot/dts/allwinner/sun50i-h5.dtsi+1−1
@@ -40,7 +40,7 @@ · 39 unmodified lines
40 * OTHER DEALINGS IN THE SOFTWARE.40 * OTHER DEALINGS IN THE SOFTWARE.
41 */41 */
42 42
43#include "sunxi-h3-h5.dtsi"43#include <arm/sunxi-h3-h5.dtsi>
44 44
45/ {45/ {
46 cpus {46 cpus {
arch/arm64/boot/dts/allwinner/sunxi-h3-h5.dtsi+0−1
@@ -1 +0,0 @@
1../../../../arm/boot/dts/sunxi-h3-h5.dtsi
arch/arm64/boot/dts/marvell/armada-cp110-master.dtsi+1−2
@@ -231,8 +231,7 @@ · 230 unmodified lines
231 cpm_crypto: crypto@800000 {231 cpm_crypto: crypto@800000 {
232 compatible = "inside-secure,safexcel-eip197";232 compatible = "inside-secure,safexcel-eip197";
233 reg = <0x800000 0x200000>;233 reg = <0x800000 0x200000>;
234 interrupts = <GIC_SPI 34 (IRQ_TYPE_EDGE_RISING234 interrupts = <GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>,
235 | IRQ_TYPE_LEVEL_HIGH)>,
236 <GIC_SPI 54 IRQ_TYPE_LEVEL_HIGH>,235 <GIC_SPI 54 IRQ_TYPE_LEVEL_HIGH>,
237 <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>,236 <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>,
238 <GIC_SPI 56 IRQ_TYPE_LEVEL_HIGH>,237 <GIC_SPI 56 IRQ_TYPE_LEVEL_HIGH>,
arch/arm64/boot/dts/marvell/armada-cp110-slave.dtsi+1−2
@@ -221,8 +221,7 @@ · 220 unmodified lines
221 cps_crypto: crypto@800000 {221 cps_crypto: crypto@800000 {
222 compatible = "inside-secure,safexcel-eip197";222 compatible = "inside-secure,safexcel-eip197";
223 reg = <0x800000 0x200000>;223 reg = <0x800000 0x200000>;
224 interrupts = <GIC_SPI 34 (IRQ_TYPE_EDGE_RISING224 interrupts = <GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>,
225 | IRQ_TYPE_LEVEL_HIGH)>,
226 <GIC_SPI 278 IRQ_TYPE_LEVEL_HIGH>,225 <GIC_SPI 278 IRQ_TYPE_LEVEL_HIGH>,
227 <GIC_SPI 279 IRQ_TYPE_LEVEL_HIGH>,226 <GIC_SPI 279 IRQ_TYPE_LEVEL_HIGH>,
228 <GIC_SPI 280 IRQ_TYPE_LEVEL_HIGH>,227 <GIC_SPI 280 IRQ_TYPE_LEVEL_HIGH>,
arch/arm64/configs/defconfig+10−0
@@ -68,6 +68,7 @@ CONFIG_PCIE_QCOM=y · 67 unmodified lines
68CONFIG_PCIE_ARMADA_8K=y68CONFIG_PCIE_ARMADA_8K=y
69CONFIG_PCI_AARDVARK=y69CONFIG_PCI_AARDVARK=y
70CONFIG_PCIE_RCAR=y70CONFIG_PCIE_RCAR=y
71CONFIG_PCIE_ROCKCHIP=m
71CONFIG_PCI_HOST_GENERIC=y72CONFIG_PCI_HOST_GENERIC=y
72CONFIG_PCI_XGENE=y73CONFIG_PCI_XGENE=y
73CONFIG_ARM64_VA_BITS_48=y74CONFIG_ARM64_VA_BITS_48=y
@@ -208,6 +209,8 @@ CONFIG_BRCMFMAC=m · 134 unmodified lines
208CONFIG_WL18XX=m209CONFIG_WL18XX=m
209CONFIG_WLCORE_SDIO=m210CONFIG_WLCORE_SDIO=m
210CONFIG_INPUT_EVDEV=y211CONFIG_INPUT_EVDEV=y
212CONFIG_KEYBOARD_ADC=m
213CONFIG_KEYBOARD_CROS_EC=y
211CONFIG_KEYBOARD_GPIO=y214CONFIG_KEYBOARD_GPIO=y
212CONFIG_INPUT_MISC=y215CONFIG_INPUT_MISC=y
213CONFIG_INPUT_PM8941_PWRKEY=y216CONFIG_INPUT_PM8941_PWRKEY=y
@@ -263,6 +266,7 @@ CONFIG_SPI_MESON_SPIFC=m · 49 unmodified lines
263CONFIG_SPI_ORION=y266CONFIG_SPI_ORION=y
264CONFIG_SPI_PL022=y267CONFIG_SPI_PL022=y
265CONFIG_SPI_QUP=y268CONFIG_SPI_QUP=y
269CONFIG_SPI_ROCKCHIP=y
266CONFIG_SPI_S3C64XX=y270CONFIG_SPI_S3C64XX=y
267CONFIG_SPI_SPIDEV=m271CONFIG_SPI_SPIDEV=m
268CONFIG_SPMI=y272CONFIG_SPMI=y
@@ -292,6 +296,7 @@ CONFIG_THERMAL_GOV_POWER_ALLOCATOR=y · 23 unmodified lines
292CONFIG_CPU_THERMAL=y296CONFIG_CPU_THERMAL=y
293CONFIG_THERMAL_EMULATION=y297CONFIG_THERMAL_EMULATION=y
294CONFIG_EXYNOS_THERMAL=y298CONFIG_EXYNOS_THERMAL=y
299CONFIG_ROCKCHIP_THERMAL=m
295CONFIG_WATCHDOG=y300CONFIG_WATCHDOG=y
296CONFIG_S3C2410_WATCHDOG=y301CONFIG_S3C2410_WATCHDOG=y
297CONFIG_MESON_GXBB_WATCHDOG=m302CONFIG_MESON_GXBB_WATCHDOG=m
@@ -300,12 +305,14 @@ CONFIG_RENESAS_WDT=y · 2 unmodified lines
300CONFIG_BCM2835_WDT=y305CONFIG_BCM2835_WDT=y
301CONFIG_MFD_CROS_EC=y306CONFIG_MFD_CROS_EC=y
302CONFIG_MFD_CROS_EC_I2C=y307CONFIG_MFD_CROS_EC_I2C=y
308CONFIG_MFD_CROS_EC_SPI=y
303CONFIG_MFD_EXYNOS_LPASS=m309CONFIG_MFD_EXYNOS_LPASS=m
304CONFIG_MFD_HI655X_PMIC=y310CONFIG_MFD_HI655X_PMIC=y
305CONFIG_MFD_MAX77620=y311CONFIG_MFD_MAX77620=y
306CONFIG_MFD_SPMI_PMIC=y312CONFIG_MFD_SPMI_PMIC=y
307CONFIG_MFD_RK808=y313CONFIG_MFD_RK808=y
308CONFIG_MFD_SEC_CORE=y314CONFIG_MFD_SEC_CORE=y
315CONFIG_REGULATOR_FAN53555=y
309CONFIG_REGULATOR_FIXED_VOLTAGE=y316CONFIG_REGULATOR_FIXED_VOLTAGE=y
310CONFIG_REGULATOR_GPIO=y317CONFIG_REGULATOR_GPIO=y
311CONFIG_REGULATOR_HI655X=y318CONFIG_REGULATOR_HI655X=y
@@ -473,8 +480,10 @@ CONFIG_ARCH_TEGRA_186_SOC=y · 161 unmodified lines
473CONFIG_EXTCON_USB_GPIO=y480CONFIG_EXTCON_USB_GPIO=y
474CONFIG_IIO=y481CONFIG_IIO=y
475CONFIG_EXYNOS_ADC=y482CONFIG_EXYNOS_ADC=y
483CONFIG_ROCKCHIP_SARADC=m
476CONFIG_PWM=y484CONFIG_PWM=y
477CONFIG_PWM_BCM2835=m485CONFIG_PWM_BCM2835=m
486CONFIG_PWM_CROS_EC=m
478CONFIG_PWM_MESON=m487CONFIG_PWM_MESON=m
479CONFIG_PWM_ROCKCHIP=y488CONFIG_PWM_ROCKCHIP=y
480CONFIG_PWM_SAMSUNG=y489CONFIG_PWM_SAMSUNG=y
@@ -484,6 +493,7 @@ CONFIG_PHY_HI6220_USB=y · 3 unmodified lines
484CONFIG_PHY_SUN4I_USB=y493CONFIG_PHY_SUN4I_USB=y
485CONFIG_PHY_ROCKCHIP_INNO_USB2=y494CONFIG_PHY_ROCKCHIP_INNO_USB2=y
486CONFIG_PHY_ROCKCHIP_EMMC=y495CONFIG_PHY_ROCKCHIP_EMMC=y
496CONFIG_PHY_ROCKCHIP_PCIE=m
487CONFIG_PHY_XGENE=y497CONFIG_PHY_XGENE=y
488CONFIG_PHY_TEGRA_XUSB=y498CONFIG_PHY_TEGRA_XUSB=y
489CONFIG_ARM_SCPI_PROTOCOL=y499CONFIG_ARM_SCPI_PROTOCOL=y
arch/arm64/include/asm/acpi.h+3−3
@@ -23,9 +23,9 @@ · 22 unmodified lines
23#define ACPI_MADT_GICC_LENGTH \23#define ACPI_MADT_GICC_LENGTH \
24 (acpi_gbl_FADT.header.revision < 6 ? 76 : 80)24 (acpi_gbl_FADT.header.revision < 6 ? 76 : 80)
25 25
26#define BAD_MADT_GICC_ENTRY(entry, end) \26#define BAD_MADT_GICC_ENTRY(entry, end) \
27 (!(entry) || (unsigned long)(entry) + sizeof(*(entry)) > (end) || \27 (!(entry) || (entry)->header.length != ACPI_MADT_GICC_LENGTH || \
28 (entry)->header.length != ACPI_MADT_GICC_LENGTH)28 (unsigned long)(entry) + ACPI_MADT_GICC_LENGTH > (end))
29 29
30/* Basic configuration for ACPI */30/* Basic configuration for ACPI */
31#ifdef CONFIG_ACPI31#ifdef CONFIG_ACPI
arch/arm64/include/asm/sysreg.h+4−0
@@ -286,6 +286,10 @@ · 285 unmodified lines
286#define SCTLR_ELx_A (1 << 1)286#define SCTLR_ELx_A (1 << 1)
287#define SCTLR_ELx_M 1287#define SCTLR_ELx_M 1
288 288
289#define SCTLR_EL2_RES1 ((1 << 4) | (1 << 5) | (1 << 11) | (1 << 16) | \
290 (1 << 16) | (1 << 18) | (1 << 22) | (1 << 23) | \
291 (1 << 28) | (1 << 29))
292
289#define SCTLR_ELx_FLAGS (SCTLR_ELx_M | SCTLR_ELx_A | SCTLR_ELx_C | \293#define SCTLR_ELx_FLAGS (SCTLR_ELx_M | SCTLR_ELx_A | SCTLR_ELx_C | \
290 SCTLR_ELx_SA | SCTLR_ELx_I)294 SCTLR_ELx_SA | SCTLR_ELx_I)
291 295
arch/arm64/kernel/pci.c+3−1
@@ -191,8 +191,10 @@ struct pci_bus *pci_acpi_scan_root(struct acpi_pci_root *root) · 190 unmodified lines
191 return NULL;191 return NULL;
192 192
193 root_ops = kzalloc_node(sizeof(*root_ops), GFP_KERNEL, node);193 root_ops = kzalloc_node(sizeof(*root_ops), GFP_KERNEL, node);
194 if (!root_ops)194 if (!root_ops) {
195 kfree(ri);
195 return NULL;196 return NULL;
197 }
196 198
197 ri->cfg = pci_acpi_setup_ecam_mapping(root);199 ri->cfg = pci_acpi_setup_ecam_mapping(root);
198 if (!ri->cfg) {200 if (!ri->cfg) {
arch/arm64/kvm/hyp-init.S+7−4
@@ -106,10 +106,13 @@ __do_hyp_init: · 105 unmodified lines
106 tlbi alle2106 tlbi alle2
107 dsb sy107 dsb sy
108 108
109 mrs x4, sctlr_el2109 /*
110 and x4, x4, #SCTLR_ELx_EE // preserve endianness of EL2110 * Preserve all the RES1 bits while setting the default flags,
111 ldr x5, =SCTLR_ELx_FLAGS111 * as well as the EE bit on BE. Drop the A flag since the compiler
112 orr x4, x4, x5112 * is allowed to generate unaligned accesses.
113 */
114 ldr x4, =(SCTLR_EL2_RES1 | (SCTLR_ELx_FLAGS & ~SCTLR_ELx_A))
115CPU_BE( orr x4, x4, #SCTLR_ELx_EE)
113 msr sctlr_el2, x4116 msr sctlr_el2, x4
114 isb117 isb
115 118
arch/arm64/kvm/vgic-sys-reg-v3.c+5−5
@@ -65,8 +65,8 @@ static bool access_gic_ctlr(struct kvm_vcpu *vcpu, struct sys_reg_params *p, · 64 unmodified lines
65 * Here set VMCR.CTLR in ICC_CTLR_EL1 layout.65 * Here set VMCR.CTLR in ICC_CTLR_EL1 layout.
66 * The vgic_set_vmcr() will convert to ICH_VMCR layout.66 * The vgic_set_vmcr() will convert to ICH_VMCR layout.
67 */67 */
68 vmcr.ctlr = val & ICC_CTLR_EL1_CBPR_MASK;68 vmcr.cbpr = (val & ICC_CTLR_EL1_CBPR_MASK) >> ICC_CTLR_EL1_CBPR_SHIFT;
69 vmcr.ctlr |= val & ICC_CTLR_EL1_EOImode_MASK;69 vmcr.eoim = (val & ICC_CTLR_EL1_EOImode_MASK) >> ICC_CTLR_EL1_EOImode_SHIFT;
70 vgic_set_vmcr(vcpu, &vmcr);70 vgic_set_vmcr(vcpu, &vmcr);
71 } else {71 } else {
72 val = 0;72 val = 0;
@@ -83,8 +83,8 @@ static bool access_gic_ctlr(struct kvm_vcpu *vcpu, struct sys_reg_params *p, · 10 unmodified lines
83 * The VMCR.CTLR value is in ICC_CTLR_EL1 layout.83 * The VMCR.CTLR value is in ICC_CTLR_EL1 layout.
84 * Extract it directly using ICC_CTLR_EL1 reg definitions.84 * Extract it directly using ICC_CTLR_EL1 reg definitions.
85 */85 */
86 val |= vmcr.ctlr & ICC_CTLR_EL1_CBPR_MASK;86 val |= (vmcr.cbpr << ICC_CTLR_EL1_CBPR_SHIFT) & ICC_CTLR_EL1_CBPR_MASK;
87 val |= vmcr.ctlr & ICC_CTLR_EL1_EOImode_MASK;87 val |= (vmcr.eoim << ICC_CTLR_EL1_EOImode_SHIFT) & ICC_CTLR_EL1_EOImode_MASK;
88 88
89 p->regval = val;89 p->regval = val;
90 }90 }
@@ -135,7 +135,7 @@ static bool access_gic_bpr1(struct kvm_vcpu *vcpu, struct sys_reg_params *p, · 44 unmodified lines
135 p->regval = 0;135 p->regval = 0;
136 136
137 vgic_get_vmcr(vcpu, &vmcr);137 vgic_get_vmcr(vcpu, &vmcr);
138 if (!((vmcr.ctlr & ICH_VMCR_CBPR_MASK) >> ICH_VMCR_CBPR_SHIFT)) {138 if (!vmcr.cbpr) {
139 if (p->is_write) {139 if (p->is_write) {
140 vmcr.abpr = (p->regval & ICC_BPR1_EL1_MASK) >>140 vmcr.abpr = (p->regval & ICC_BPR1_EL1_MASK) >>
141 ICC_BPR1_EL1_SHIFT;141 ICC_BPR1_EL1_SHIFT;
arch/arm64/net/bpf_jit_comp.c+5−2
@@ -36,6 +36,7 @@ int bpf_jit_enable __read_mostly; · 35 unmodified lines
36#define TMP_REG_1 (MAX_BPF_JIT_REG + 0)36#define TMP_REG_1 (MAX_BPF_JIT_REG + 0)
37#define TMP_REG_2 (MAX_BPF_JIT_REG + 1)37#define TMP_REG_2 (MAX_BPF_JIT_REG + 1)
38#define TCALL_CNT (MAX_BPF_JIT_REG + 2)38#define TCALL_CNT (MAX_BPF_JIT_REG + 2)
39#define TMP_REG_3 (MAX_BPF_JIT_REG + 3)
39 40
40/* Map BPF registers to A64 registers */41/* Map BPF registers to A64 registers */
41static const int bpf2a64[] = {42static const int bpf2a64[] = {
@@ -57,6 +58,7 @@ static const int bpf2a64[] = { · 15 unmodified lines
57 /* temporary registers for internal BPF JIT */58 /* temporary registers for internal BPF JIT */
58 [TMP_REG_1] = A64_R(10),59 [TMP_REG_1] = A64_R(10),
59 [TMP_REG_2] = A64_R(11),60 [TMP_REG_2] = A64_R(11),
61 [TMP_REG_3] = A64_R(12),
60 /* tail_call_cnt */62 /* tail_call_cnt */
61 [TCALL_CNT] = A64_R(26),63 [TCALL_CNT] = A64_R(26),
62 /* temporary register for blinding constants */64 /* temporary register for blinding constants */
@@ -319,6 +321,7 @@ static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx) · 256 unmodified lines
319 const u8 src = bpf2a64[insn->src_reg];321 const u8 src = bpf2a64[insn->src_reg];
320 const u8 tmp = bpf2a64[TMP_REG_1];322 const u8 tmp = bpf2a64[TMP_REG_1];
321 const u8 tmp2 = bpf2a64[TMP_REG_2];323 const u8 tmp2 = bpf2a64[TMP_REG_2];
324 const u8 tmp3 = bpf2a64[TMP_REG_3];
322 const s16 off = insn->off;325 const s16 off = insn->off;
323 const s32 imm = insn->imm;326 const s32 imm = insn->imm;
324 const int i = insn - ctx->prog->insnsi;327 const int i = insn - ctx->prog->insnsi;
@@ -689,10 +692,10 @@ emit_cond_jmp: · 364 unmodified lines
689 emit(A64_PRFM(tmp, PST, L1, STRM), ctx);692 emit(A64_PRFM(tmp, PST, L1, STRM), ctx);
690 emit(A64_LDXR(isdw, tmp2, tmp), ctx);693 emit(A64_LDXR(isdw, tmp2, tmp), ctx);
691 emit(A64_ADD(isdw, tmp2, tmp2, src), ctx);694 emit(A64_ADD(isdw, tmp2, tmp2, src), ctx);
692 emit(A64_STXR(isdw, tmp2, tmp, tmp2), ctx);695 emit(A64_STXR(isdw, tmp2, tmp, tmp3), ctx);
693 jmp_offset = -3;696 jmp_offset = -3;
694 check_imm19(jmp_offset);697 check_imm19(jmp_offset);
695 emit(A64_CBNZ(0, tmp2, jmp_offset), ctx);698 emit(A64_CBNZ(0, tmp3, jmp_offset), ctx);
696 break;699 break;
697 700
698 /* R0 = ntohx(*(size *)(((struct sk_buff *)R6)->data + imm)) */701 /* R0 = ntohx(*(size *)(((struct sk_buff *)R6)->data + imm)) */
arch/frv/include/asm/timex.h+6−0
@@ -16,5 +16,11 @@ static inline cycles_t get_cycles(void) · 15 unmodified lines
16#define vxtime_lock() do {} while (0)16#define vxtime_lock() do {} while (0)
17#define vxtime_unlock() do {} while (0)17#define vxtime_unlock() do {} while (0)
18 18
19/* This attribute is used in include/linux/jiffies.h alongside with
20 * __cacheline_aligned_in_smp. It is assumed that __cacheline_aligned_in_smp
21 * for frv does not contain another section specification.
22 */
23#define __jiffy_arch_data __attribute__((__section__(".data")))
24
19#endif25#endif
20 26
arch/frv/mm/elf-fdpic.c+1−1
@@ -75,7 +75,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi · 74 unmodified lines
75 addr = PAGE_ALIGN(addr);75 addr = PAGE_ALIGN(addr);
76 vma = find_vma(current->mm, addr);76 vma = find_vma(current->mm, addr);
77 if (TASK_SIZE - len >= addr &&77 if (TASK_SIZE - len >= addr &&
78 (!vma || addr + len <= vma->vm_start))78 (!vma || addr + len <= vm_start_gap(vma)))
79 goto success;79 goto success;
80 }80 }
81 81
arch/hexagon/mm/uaccess.c+2−3
@@ -37,15 +37,14 @@ __kernel_size_t __clear_user_hexagon(void __user *dest, unsigned long count) · 36 unmodified lines
37 long uncleared;37 long uncleared;
38 38
39 while (count > PAGE_SIZE) {39 while (count > PAGE_SIZE) {
40 uncleared = __copy_to_user_hexagon(dest, &empty_zero_page,40 uncleared = raw_copy_to_user(dest, &empty_zero_page, PAGE_SIZE);
41 PAGE_SIZE);
42 if (uncleared)41 if (uncleared)
43 return count - (PAGE_SIZE - uncleared);42 return count - (PAGE_SIZE - uncleared);
44 count -= PAGE_SIZE;43 count -= PAGE_SIZE;
45 dest += PAGE_SIZE;44 dest += PAGE_SIZE;
46 }45 }
47 if (count)46 if (count)
48 count = __copy_to_user_hexagon(dest, &empty_zero_page, count);47 count = raw_copy_to_user(dest, &empty_zero_page, count);
49 48
50 return count;49 return count;
51}50}
arch/mips/boot/Makefile+5−5
@@ -128,19 +128,19 @@ quiet_cmd_cpp_its_S = ITS $@ · 127 unmodified lines
128 -DADDR_BITS=$(ADDR_BITS) \128 -DADDR_BITS=$(ADDR_BITS) \
129 -DADDR_CELLS=$(itb_addr_cells)129 -DADDR_CELLS=$(itb_addr_cells)
130 130
131$(obj)/vmlinux.its: $(srctree)/arch/mips/$(PLATFORM)/vmlinux.its.S FORCE131$(obj)/vmlinux.its: $(srctree)/arch/mips/$(PLATFORM)/vmlinux.its.S $(VMLINUX) FORCE
132 $(call if_changed_dep,cpp_its_S,none,vmlinux.bin)132 $(call if_changed_dep,cpp_its_S,none,vmlinux.bin)
133 133
134$(obj)/vmlinux.gz.its: $(srctree)/arch/mips/$(PLATFORM)/vmlinux.its.S FORCE134$(obj)/vmlinux.gz.its: $(srctree)/arch/mips/$(PLATFORM)/vmlinux.its.S $(VMLINUX) FORCE
135 $(call if_changed_dep,cpp_its_S,gzip,vmlinux.bin.gz)135 $(call if_changed_dep,cpp_its_S,gzip,vmlinux.bin.gz)
136 136
137$(obj)/vmlinux.bz2.its: $(srctree)/arch/mips/$(PLATFORM)/vmlinux.its.S FORCE137$(obj)/vmlinux.bz2.its: $(srctree)/arch/mips/$(PLATFORM)/vmlinux.its.S $(VMLINUX) FORCE
138 $(call if_changed_dep,cpp_its_S,bzip2,vmlinux.bin.bz2)138 $(call if_changed_dep,cpp_its_S,bzip2,vmlinux.bin.bz2)
139 139
140$(obj)/vmlinux.lzma.its: $(srctree)/arch/mips/$(PLATFORM)/vmlinux.its.S FORCE140$(obj)/vmlinux.lzma.its: $(srctree)/arch/mips/$(PLATFORM)/vmlinux.its.S $(VMLINUX) FORCE
141 $(call if_changed_dep,cpp_its_S,lzma,vmlinux.bin.lzma)141 $(call if_changed_dep,cpp_its_S,lzma,vmlinux.bin.lzma)
142 142
143$(obj)/vmlinux.lzo.its: $(srctree)/arch/mips/$(PLATFORM)/vmlinux.its.S FORCE143$(obj)/vmlinux.lzo.its: $(srctree)/arch/mips/$(PLATFORM)/vmlinux.its.S $(VMLINUX) FORCE
144 $(call if_changed_dep,cpp_its_S,lzo,vmlinux.bin.lzo)144 $(call if_changed_dep,cpp_its_S,lzo,vmlinux.bin.lzo)
145 145
146quiet_cmd_itb-image = ITB $@146quiet_cmd_itb-image = ITB $@
arch/mips/include/asm/highmem.h+5−0
@@ -35,7 +35,12 @@ extern pte_t *pkmap_page_table; · 34 unmodified lines
35 * easily, subsequent pte tables have to be allocated in one physical35 * easily, subsequent pte tables have to be allocated in one physical
36 * chunk of RAM.36 * chunk of RAM.
37 */37 */
38#ifdef CONFIG_PHYS_ADDR_T_64BIT
39#define LAST_PKMAP 512
40#else
38#define LAST_PKMAP 102441#define LAST_PKMAP 1024
42#endif
43
39#define LAST_PKMAP_MASK (LAST_PKMAP-1)44#define LAST_PKMAP_MASK (LAST_PKMAP-1)
40#define PKMAP_NR(virt) ((virt-PKMAP_BASE) >> PAGE_SHIFT)45#define PKMAP_NR(virt) ((virt-PKMAP_BASE) >> PAGE_SHIFT)
41#define PKMAP_ADDR(nr) (PKMAP_BASE + ((nr) << PAGE_SHIFT))46#define PKMAP_ADDR(nr) (PKMAP_BASE + ((nr) << PAGE_SHIFT))
arch/mips/include/asm/kprobes.h+2−1
@@ -43,7 +43,8 @@ typedef union mips_instruction kprobe_opcode_t; · 42 unmodified lines
43 43
44#define flush_insn_slot(p) \44#define flush_insn_slot(p) \
45do { \45do { \
46 flush_icache_range((unsigned long)p->addr, \46 if (p->addr) \
47 flush_icache_range((unsigned long)p->addr, \
47 (unsigned long)p->addr + \48 (unsigned long)p->addr + \
48 (MAX_INSN_SIZE * sizeof(kprobe_opcode_t))); \49 (MAX_INSN_SIZE * sizeof(kprobe_opcode_t))); \
49} while (0)50} while (0)
arch/mips/include/asm/pgtable-32.h+6−1
@@ -19,6 +19,10 @@ · 18 unmodified lines
19#define __ARCH_USE_5LEVEL_HACK19#define __ARCH_USE_5LEVEL_HACK
20#include <asm-generic/pgtable-nopmd.h>20#include <asm-generic/pgtable-nopmd.h>
21 21
22#ifdef CONFIG_HIGHMEM
23#include <asm/highmem.h>
24#endif
25
22extern int temp_tlb_entry;26extern int temp_tlb_entry;
23 27
24/*28/*
@@ -62,7 +66,8 @@ extern int add_temporary_entry(unsigned long entrylo0, unsigned long entrylo1, · 37 unmodified lines
62 66
63#define VMALLOC_START MAP_BASE67#define VMALLOC_START MAP_BASE
64 68
65#define PKMAP_BASE (0xfe000000UL)69#define PKMAP_END ((FIXADDR_START) & ~((LAST_PKMAP << PAGE_SHIFT)-1))
70#define PKMAP_BASE (PKMAP_END - PAGE_SIZE * LAST_PKMAP)
66 71
67#ifdef CONFIG_HIGHMEM72#ifdef CONFIG_HIGHMEM
68# define VMALLOC_END (PKMAP_BASE-2*PAGE_SIZE)73# define VMALLOC_END (PKMAP_BASE-2*PAGE_SIZE)
arch/mips/kernel/branch.c+3−1
@@ -804,8 +804,10 @@ int __compute_return_epc_for_insn(struct pt_regs *regs, · 803 unmodified lines
804 break;804 break;
805 }805 }
806 /* Compact branch: BNEZC || JIALC */806 /* Compact branch: BNEZC || JIALC */
807 if (insn.i_format.rs)807 if (!insn.i_format.rs) {
808 /* JIALC: set $31/ra */
808 regs->regs[31] = epc + 4;809 regs->regs[31] = epc + 4;
810 }
809 regs->cp0_epc += 8;811 regs->cp0_epc += 8;
810 break;812 break;
811#endif813#endif
arch/mips/kernel/ftrace.c+5−19
@@ -38,20 +38,6 @@ void arch_ftrace_update_code(int command) · 37 unmodified lines
38 38
39#endif39#endif
40 40
41/*
42 * Check if the address is in kernel space
43 *
44 * Clone core_kernel_text() from kernel/extable.c, but doesn't call
45 * init_kernel_text() for Ftrace doesn't trace functions in init sections.
46 */
47static inline int in_kernel_space(unsigned long ip)
48{
49 if (ip >= (unsigned long)_stext &&
50 ip <= (unsigned long)_etext)
51 return 1;
52 return 0;
53}
54
55#ifdef CONFIG_DYNAMIC_FTRACE41#ifdef CONFIG_DYNAMIC_FTRACE
56 42
57#define JAL 0x0c000000 /* jump & link: ip --> ra, jump to target */43#define JAL 0x0c000000 /* jump & link: ip --> ra, jump to target */
@@ -198,7 +184,7 @@ int ftrace_make_nop(struct module *mod, · 140 unmodified lines
198 * If ip is in kernel space, no long call, otherwise, long call is184 * If ip is in kernel space, no long call, otherwise, long call is
199 * needed.185 * needed.
200 */186 */
201 new = in_kernel_space(ip) ? INSN_NOP : INSN_B_1F;187 new = core_kernel_text(ip) ? INSN_NOP : INSN_B_1F;
202#ifdef CONFIG_64BIT188#ifdef CONFIG_64BIT
203 return ftrace_modify_code(ip, new);189 return ftrace_modify_code(ip, new);
204#else190#else
@@ -218,12 +204,12 @@ int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr) · 13 unmodified lines
218 unsigned int new;204 unsigned int new;
219 unsigned long ip = rec->ip;205 unsigned long ip = rec->ip;
220 206
221 new = in_kernel_space(ip) ? insn_jal_ftrace_caller : insn_la_mcount[0];207 new = core_kernel_text(ip) ? insn_jal_ftrace_caller : insn_la_mcount[0];
222 208
223#ifdef CONFIG_64BIT209#ifdef CONFIG_64BIT
224 return ftrace_modify_code(ip, new);210 return ftrace_modify_code(ip, new);
225#else211#else
226 return ftrace_modify_code_2r(ip, new, in_kernel_space(ip) ?212 return ftrace_modify_code_2r(ip, new, core_kernel_text(ip) ?
227 INSN_NOP : insn_la_mcount[1]);213 INSN_NOP : insn_la_mcount[1]);
228#endif214#endif
229}215}
@@ -289,7 +275,7 @@ unsigned long ftrace_get_parent_ra_addr(unsigned long self_ra, unsigned long · 59 unmodified lines
289 * instruction "lui v1, hi_16bit_of_mcount"(offset is 24), but for275 * instruction "lui v1, hi_16bit_of_mcount"(offset is 24), but for
290 * kernel, move after the instruction "move ra, at"(offset is 16)276 * kernel, move after the instruction "move ra, at"(offset is 16)
291 */277 */
292 ip = self_ra - (in_kernel_space(self_ra) ? 16 : 24);278 ip = self_ra - (core_kernel_text(self_ra) ? 16 : 24);
293 279
294 /*280 /*
295 * search the text until finding the non-store instruction or "s{d,w}281 * search the text until finding the non-store instruction or "s{d,w}
@@ -394,7 +380,7 @@ void prepare_ftrace_return(unsigned long *parent_ra_addr, unsigned long self_ra, · 98 unmodified lines
394 * entries configured through the tracing/set_graph_function interface.380 * entries configured through the tracing/set_graph_function interface.
395 */381 */
396 382
397 insns = in_kernel_space(self_ra) ? 2 : MCOUNT_OFFSET_INSNS + 1;383 insns = core_kernel_text(self_ra) ? 2 : MCOUNT_OFFSET_INSNS + 1;
398 trace.func = self_ra - (MCOUNT_INSN_SIZE * insns);384 trace.func = self_ra - (MCOUNT_INSN_SIZE * insns);
399 385
400 /* Only trace if the calling function expects to */386 /* Only trace if the calling function expects to */
arch/mips/kernel/perf_event_mipsxx.c+5−1
@@ -1597,7 +1597,6 @@ static const struct mips_perf_event *mipsxx_pmu_map_raw_event(u64 config) · 1596 unmodified lines
1597 break;1597 break;
1598 case CPU_P5600:1598 case CPU_P5600:
1599 case CPU_P6600:1599 case CPU_P6600:
1600 case CPU_I6400:
1601 /* 8-bit event numbers */1600 /* 8-bit event numbers */
1602 raw_id = config & 0x1ff;1601 raw_id = config & 0x1ff;
1603 base_id = raw_id & 0xff;1602 base_id = raw_id & 0xff;
@@ -1610,6 +1609,11 @@ static const struct mips_perf_event *mipsxx_pmu_map_raw_event(u64 config) · 6 unmodified lines
1610 raw_event.range = P;1609 raw_event.range = P;
1611#endif1610#endif
1612 break;1611 break;
1612 case CPU_I6400:
1613 /* 8-bit event numbers */
1614 base_id = config & 0xff;
1615 raw_event.cntr_mask = CNTR_EVEN | CNTR_ODD;
1616 break;
1613 case CPU_1004K:1617 case CPU_1004K:
1614 if (IS_BOTH_COUNTERS_1004K_EVENT(base_id))1618 if (IS_BOTH_COUNTERS_1004K_EVENT(base_id))
1615 raw_event.cntr_mask = CNTR_EVEN | CNTR_ODD;1619 raw_event.cntr_mask = CNTR_EVEN | CNTR_ODD;
arch/mips/kernel/process.c+0−1
@@ -120,7 +120,6 @@ int copy_thread_tls(unsigned long clone_flags, unsigned long usp, · 119 unmodified lines
120 struct thread_info *ti = task_thread_info(p);120 struct thread_info *ti = task_thread_info(p);
121 struct pt_regs *childregs, *regs = current_pt_regs();121 struct pt_regs *childregs, *regs = current_pt_regs();
122 unsigned long childksp;122 unsigned long childksp;
123 p->set_child_tid = p->clear_child_tid = NULL;
124 123
125 childksp = (unsigned long)task_stack_page(p) + THREAD_SIZE - 32;124 childksp = (unsigned long)task_stack_page(p) + THREAD_SIZE - 32;
126 125
arch/mips/mm/mmap.c+1−1
@@ -93,7 +93,7 @@ static unsigned long arch_get_unmapped_area_common(struct file *filp, · 92 unmodified lines
93 93
94 vma = find_vma(mm, addr);94 vma = find_vma(mm, addr);
95 if (TASK_SIZE - len >= addr &&95 if (TASK_SIZE - len >= addr &&
96 (!vma || addr + len <= vma->vm_start))96 (!vma || addr + len <= vm_start_gap(vma)))
97 return addr;97 return addr;
98 }98 }
99 99
arch/mips/mm/pgtable-32.c+3−3
@@ -51,15 +51,15 @@ void __init pagetable_init(void) · 50 unmodified lines
51 /*51 /*
52 * Fixed mappings:52 * Fixed mappings:
53 */53 */
54 vaddr = __fix_to_virt(__end_of_fixed_addresses - 1) & PMD_MASK;54 vaddr = __fix_to_virt(__end_of_fixed_addresses - 1);
55 fixrange_init(vaddr, vaddr + FIXADDR_SIZE, pgd_base);55 fixrange_init(vaddr & PMD_MASK, vaddr + FIXADDR_SIZE, pgd_base);
56 56
57#ifdef CONFIG_HIGHMEM57#ifdef CONFIG_HIGHMEM
58 /*58 /*
59 * Permanent kmaps:59 * Permanent kmaps:
60 */60 */
61 vaddr = PKMAP_BASE;61 vaddr = PKMAP_BASE;
62 fixrange_init(vaddr, vaddr + PAGE_SIZE*LAST_PKMAP, pgd_base);62 fixrange_init(vaddr & PMD_MASK, vaddr + PAGE_SIZE*LAST_PKMAP, pgd_base);
63 63
64 pgd = swapper_pg_dir + __pgd_offset(vaddr);64 pgd = swapper_pg_dir + __pgd_offset(vaddr);
65 pud = pud_offset(pgd, vaddr);65 pud = pud_offset(pgd, vaddr);
arch/openrisc/kernel/process.c+0−2
@@ -167,8 +167,6 @@ copy_thread(unsigned long clone_flags, unsigned long usp, · 166 unmodified lines
167 167
168 top_of_kernel_stack = sp;168 top_of_kernel_stack = sp;
169 169
170 p->set_child_tid = p->clear_child_tid = NULL;
171
172 /* Locate userspace context on stack... */170 /* Locate userspace context on stack... */
173 sp -= STACK_FRAME_OVERHEAD; /* redzone */171 sp -= STACK_FRAME_OVERHEAD; /* redzone */
174 sp -= sizeof(struct pt_regs);172 sp -= sizeof(struct pt_regs);
arch/parisc/kernel/sys_parisc.c+9−6
@@ -90,7 +90,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, · 89 unmodified lines
90 unsigned long len, unsigned long pgoff, unsigned long flags)90 unsigned long len, unsigned long pgoff, unsigned long flags)
91{91{
92 struct mm_struct *mm = current->mm;92 struct mm_struct *mm = current->mm;
93 struct vm_area_struct *vma;93 struct vm_area_struct *vma, *prev;
94 unsigned long task_size = TASK_SIZE;94 unsigned long task_size = TASK_SIZE;
95 int do_color_align, last_mmap;95 int do_color_align, last_mmap;
96 struct vm_unmapped_area_info info;96 struct vm_unmapped_area_info info;
@@ -117,9 +117,10 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, · 20 unmodified lines
117 else117 else
118 addr = PAGE_ALIGN(addr);118 addr = PAGE_ALIGN(addr);
119 119
120 vma = find_vma(mm, addr);120 vma = find_vma_prev(mm, addr, &prev);
121 if (task_size - len >= addr &&121 if (task_size - len >= addr &&
122 (!vma || addr + len <= vma->vm_start))122 (!vma || addr + len <= vm_start_gap(vma)) &&
123 (!prev || addr >= vm_end_gap(prev)))
123 goto found_addr;124 goto found_addr;
124 }125 }
125 126
@@ -143,7 +144,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, · 17 unmodified lines
143 const unsigned long len, const unsigned long pgoff,144 const unsigned long len, const unsigned long pgoff,
144 const unsigned long flags)145 const unsigned long flags)
145{146{
146 struct vm_area_struct *vma;147 struct vm_area_struct *vma, *prev;
147 struct mm_struct *mm = current->mm;148 struct mm_struct *mm = current->mm;
148 unsigned long addr = addr0;149 unsigned long addr = addr0;
149 int do_color_align, last_mmap;150 int do_color_align, last_mmap;
@@ -177,9 +178,11 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, · 27 unmodified lines
177 addr = COLOR_ALIGN(addr, last_mmap, pgoff);178 addr = COLOR_ALIGN(addr, last_mmap, pgoff);
178 else179 else
179 addr = PAGE_ALIGN(addr);180 addr = PAGE_ALIGN(addr);
180 vma = find_vma(mm, addr);181
182 vma = find_vma_prev(mm, addr, &prev);
181 if (TASK_SIZE - len >= addr &&183 if (TASK_SIZE - len >= addr &&
182 (!vma || addr + len <= vma->vm_start))184 (!vma || addr + len <= vm_start_gap(vma)) &&
185 (!prev || addr >= vm_end_gap(prev)))
183 goto found_addr;186 goto found_addr;
184 }187 }
185 188
arch/powerpc/Kconfig+0−21
@@ -380,22 +380,6 @@ source "arch/powerpc/platforms/Kconfig" · 379 unmodified lines
380 380
381menu "Kernel options"381menu "Kernel options"
382 382
383config PPC_DT_CPU_FTRS
384 bool "Device-tree based CPU feature discovery & setup"
385 depends on PPC_BOOK3S_64
386 default n
387 help
388 This enables code to use a new device tree binding for describing CPU
389 compatibility and features. Saying Y here will attempt to use the new
390 binding if the firmware provides it. Currently only the skiboot
391 firmware provides this binding.
392 If you're not sure say Y.
393
394config PPC_CPUFEATURES_ENABLE_UNKNOWN
395 bool "cpufeatures pass through unknown features to guest/userspace"
396 depends on PPC_DT_CPU_FTRS
397 default y
398
399config HIGHMEM383config HIGHMEM
400 bool "High memory support"384 bool "High memory support"
401 depends on PPC32385 depends on PPC32
@@ -1215,11 +1199,6 @@ source "arch/powerpc/Kconfig.debug" · 813 unmodified lines
1215 1199
1216source "security/Kconfig"1200source "security/Kconfig"
1217 1201
1218config KEYS_COMPAT
1219 bool
1220 depends on COMPAT && KEYS
1221 default y
1222
1223source "crypto/Kconfig"1202source "crypto/Kconfig"
1224 1203
1225config PPC_LIB_RHEAP1204config PPC_LIB_RHEAP
arch/powerpc/include/asm/book3s/64/hash-4k.h+1−1
@@ -8,7 +8,7 @@ · 7 unmodified lines
8#define H_PTE_INDEX_SIZE 98#define H_PTE_INDEX_SIZE 9
9#define H_PMD_INDEX_SIZE 79#define H_PMD_INDEX_SIZE 7
10#define H_PUD_INDEX_SIZE 910#define H_PUD_INDEX_SIZE 9
11#define H_PGD_INDEX_SIZE 1211#define H_PGD_INDEX_SIZE 9
12 12
13#ifndef __ASSEMBLY__13#ifndef __ASSEMBLY__
14#define H_PTE_TABLE_SIZE (sizeof(pte_t) << H_PTE_INDEX_SIZE)14#define H_PTE_TABLE_SIZE (sizeof(pte_t) << H_PTE_INDEX_SIZE)
arch/powerpc/include/asm/bug.h+1−1
@@ -104,7 +104,7 @@ · 103 unmodified lines
104 "1: "PPC_TLNEI" %4,0\n" \104 "1: "PPC_TLNEI" %4,0\n" \
105 _EMIT_BUG_ENTRY \105 _EMIT_BUG_ENTRY \
106 : : "i" (__FILE__), "i" (__LINE__), \106 : : "i" (__FILE__), "i" (__LINE__), \
107 "i" (BUGFLAG_TAINT(TAINT_WARN)), \107 "i" (BUGFLAG_WARNING|BUGFLAG_TAINT(TAINT_WARN)),\
108 "i" (sizeof(struct bug_entry)), \108 "i" (sizeof(struct bug_entry)), \
109 "r" (__ret_warn_on)); \109 "r" (__ret_warn_on)); \
110 } \110 } \
arch/powerpc/include/asm/cputable.h+1−2
@@ -214,7 +214,6 @@ enum { · 213 unmodified lines
214#define CPU_FTR_DAWR LONG_ASM_CONST(0x0400000000000000)214#define CPU_FTR_DAWR LONG_ASM_CONST(0x0400000000000000)
215#define CPU_FTR_DABRX LONG_ASM_CONST(0x0800000000000000)215#define CPU_FTR_DABRX LONG_ASM_CONST(0x0800000000000000)
216#define CPU_FTR_PMAO_BUG LONG_ASM_CONST(0x1000000000000000)216#define CPU_FTR_PMAO_BUG LONG_ASM_CONST(0x1000000000000000)
217#define CPU_FTR_SUBCORE LONG_ASM_CONST(0x2000000000000000)
218#define CPU_FTR_POWER9_DD1 LONG_ASM_CONST(0x4000000000000000)217#define CPU_FTR_POWER9_DD1 LONG_ASM_CONST(0x4000000000000000)
219 218
220#ifndef __ASSEMBLY__219#ifndef __ASSEMBLY__
@@ -463,7 +462,7 @@ enum { · 242 unmodified lines
463 CPU_FTR_STCX_CHECKS_ADDRESS | CPU_FTR_POPCNTB | CPU_FTR_POPCNTD | \462 CPU_FTR_STCX_CHECKS_ADDRESS | CPU_FTR_POPCNTB | CPU_FTR_POPCNTD | \
464 CPU_FTR_ICSWX | CPU_FTR_CFAR | CPU_FTR_HVMODE | CPU_FTR_VMX_COPY | \463 CPU_FTR_ICSWX | CPU_FTR_CFAR | CPU_FTR_HVMODE | CPU_FTR_VMX_COPY | \
465 CPU_FTR_DBELL | CPU_FTR_HAS_PPR | CPU_FTR_DAWR | \464 CPU_FTR_DBELL | CPU_FTR_HAS_PPR | CPU_FTR_DAWR | \
466 CPU_FTR_ARCH_207S | CPU_FTR_TM_COMP | CPU_FTR_SUBCORE)465 CPU_FTR_ARCH_207S | CPU_FTR_TM_COMP)
467#define CPU_FTRS_POWER8E (CPU_FTRS_POWER8 | CPU_FTR_PMAO_BUG)466#define CPU_FTRS_POWER8E (CPU_FTRS_POWER8 | CPU_FTR_PMAO_BUG)
468#define CPU_FTRS_POWER8_DD1 (CPU_FTRS_POWER8 & ~CPU_FTR_DBELL)467#define CPU_FTRS_POWER8_DD1 (CPU_FTRS_POWER8 & ~CPU_FTR_DBELL)
469#define CPU_FTRS_POWER9 (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \468#define CPU_FTRS_POWER9 (CPU_FTR_USE_TB | CPU_FTR_LWSYNC | \
arch/powerpc/include/asm/processor.h+12−13
@@ -110,13 +110,18 @@ void release_thread(struct task_struct *); · 109 unmodified lines
110#define TASK_SIZE_128TB (0x0000800000000000UL)110#define TASK_SIZE_128TB (0x0000800000000000UL)
111#define TASK_SIZE_512TB (0x0002000000000000UL)111#define TASK_SIZE_512TB (0x0002000000000000UL)
112 112
113#ifdef CONFIG_PPC_BOOK3S_64113/*
114 * For now 512TB is only supported with book3s and 64K linux page size.
115 */
116#if defined(CONFIG_PPC_BOOK3S_64) && defined(CONFIG_PPC_64K_PAGES)
114/*117/*
115 * Max value currently used:118 * Max value currently used:
116 */119 */
117#define TASK_SIZE_USER64 TASK_SIZE_512TB120#define TASK_SIZE_USER64 TASK_SIZE_512TB
121#define DEFAULT_MAP_WINDOW_USER64 TASK_SIZE_128TB
118#else122#else
119#define TASK_SIZE_USER64 TASK_SIZE_64TB123#define TASK_SIZE_USER64 TASK_SIZE_64TB
124#define DEFAULT_MAP_WINDOW_USER64 TASK_SIZE_64TB
120#endif125#endif
121 126
122/*127/*
@@ -132,7 +137,7 @@ void release_thread(struct task_struct *); · 9 unmodified lines
132 * space during mmap's.137 * space during mmap's.
133 */138 */
134#define TASK_UNMAPPED_BASE_USER32 (PAGE_ALIGN(TASK_SIZE_USER32 / 4))139#define TASK_UNMAPPED_BASE_USER32 (PAGE_ALIGN(TASK_SIZE_USER32 / 4))
135#define TASK_UNMAPPED_BASE_USER64 (PAGE_ALIGN(TASK_SIZE_128TB / 4))140#define TASK_UNMAPPED_BASE_USER64 (PAGE_ALIGN(DEFAULT_MAP_WINDOW_USER64 / 4))
136 141
137#define TASK_UNMAPPED_BASE ((is_32bit_task()) ? \142#define TASK_UNMAPPED_BASE ((is_32bit_task()) ? \
138 TASK_UNMAPPED_BASE_USER32 : TASK_UNMAPPED_BASE_USER64 )143 TASK_UNMAPPED_BASE_USER32 : TASK_UNMAPPED_BASE_USER64 )
@@ -143,21 +148,15 @@ void release_thread(struct task_struct *); · 4 unmodified lines
143 * with 128TB and conditionally enable upto 512TB148 * with 128TB and conditionally enable upto 512TB
144 */149 */
145#ifdef CONFIG_PPC_BOOK3S_64150#ifdef CONFIG_PPC_BOOK3S_64
146#define DEFAULT_MAP_WINDOW ((is_32bit_task()) ? \151#define DEFAULT_MAP_WINDOW ((is_32bit_task()) ? \
147 TASK_SIZE_USER32 : TASK_SIZE_128TB)152 TASK_SIZE_USER32 : DEFAULT_MAP_WINDOW_USER64)
148#else153#else
149#define DEFAULT_MAP_WINDOW TASK_SIZE154#define DEFAULT_MAP_WINDOW TASK_SIZE
150#endif155#endif
151 156
152#ifdef __powerpc64__157#ifdef __powerpc64__
153 158
154#ifdef CONFIG_PPC_BOOK3S_64159#define STACK_TOP_USER64 DEFAULT_MAP_WINDOW_USER64
155/* Limit stack to 128TB */
156#define STACK_TOP_USER64 TASK_SIZE_128TB
157#else
158#define STACK_TOP_USER64 TASK_SIZE_USER64
159#endif
160
161#define STACK_TOP_USER32 TASK_SIZE_USER32160#define STACK_TOP_USER32 TASK_SIZE_USER32
162 161
163#define STACK_TOP (is_32bit_task() ? \162#define STACK_TOP (is_32bit_task() ? \
arch/powerpc/include/asm/topology.h+14−0
@@ -44,8 +44,22 @@ extern void __init dump_numa_cpu_topology(void); · 43 unmodified lines
44extern int sysfs_add_device_to_node(struct device *dev, int nid);44extern int sysfs_add_device_to_node(struct device *dev, int nid);
45extern void sysfs_remove_device_from_node(struct device *dev, int nid);45extern void sysfs_remove_device_from_node(struct device *dev, int nid);
46 46
47static inline int early_cpu_to_node(int cpu)
48{
49 int nid;
50
51 nid = numa_cpu_lookup_table[cpu];
52
53 /*
54 * Fall back to node 0 if nid is unset (it should be, except bugs).
55 * This allows callers to safely do NODE_DATA(early_cpu_to_node(cpu)).
56 */
57 return (nid < 0) ? 0 : nid;
58}
47#else59#else
48 60
61static inline int early_cpu_to_node(int cpu) { return 0; }
62
49static inline void dump_numa_cpu_topology(void) {}63static inline void dump_numa_cpu_topology(void) {}
50 64
51static inline int sysfs_add_device_to_node(struct device *dev, int nid)65static inline int sysfs_add_device_to_node(struct device *dev, int nid)
arch/powerpc/include/asm/xive.h+7−5
@@ -94,11 +94,13 @@ struct xive_q { · 93 unmodified lines
94 * store at 0 and some ESBs support doing a trigger via a94 * store at 0 and some ESBs support doing a trigger via a
95 * separate trigger page.95 * separate trigger page.
96 */96 */
97#define XIVE_ESB_GET 0x80097#define XIVE_ESB_STORE_EOI 0x400 /* Store */
98#define XIVE_ESB_SET_PQ_00 0xc0098#define XIVE_ESB_LOAD_EOI 0x000 /* Load */
99#define XIVE_ESB_SET_PQ_01 0xd0099#define XIVE_ESB_GET 0x800 /* Load */
100#define XIVE_ESB_SET_PQ_10 0xe00100#define XIVE_ESB_SET_PQ_00 0xc00 /* Load */
101#define XIVE_ESB_SET_PQ_11 0xf00101#define XIVE_ESB_SET_PQ_01 0xd00 /* Load */
102#define XIVE_ESB_SET_PQ_10 0xe00 /* Load */
103#define XIVE_ESB_SET_PQ_11 0xf00 /* Load */
102 104
103#define XIVE_ESB_VAL_P 0x2105#define XIVE_ESB_VAL_P 0x2
104#define XIVE_ESB_VAL_Q 0x1106#define XIVE_ESB_VAL_Q 0x1
arch/powerpc/kernel/dt_cpu_ftrs.c+48−10
@@ -8,6 +8,7 @@ · 7 unmodified lines
8#include <linux/export.h>8#include <linux/export.h>
9#include <linux/init.h>9#include <linux/init.h>
10#include <linux/jump_label.h>10#include <linux/jump_label.h>
11#include <linux/libfdt.h>
11#include <linux/memblock.h>12#include <linux/memblock.h>
12#include <linux/printk.h>13#include <linux/printk.h>
13#include <linux/sched.h>14#include <linux/sched.h>
@@ -642,7 +643,6 @@ static struct dt_cpu_feature_match __initdata · 628 unmodified lines
642 {"processor-control-facility", feat_enable_dbell, CPU_FTR_DBELL},643 {"processor-control-facility", feat_enable_dbell, CPU_FTR_DBELL},
643 {"processor-control-facility-v3", feat_enable_dbell, CPU_FTR_DBELL},644 {"processor-control-facility-v3", feat_enable_dbell, CPU_FTR_DBELL},
644 {"processor-utilization-of-resources-register", feat_enable_purr, 0},645 {"processor-utilization-of-resources-register", feat_enable_purr, 0},
645 {"subcore", feat_enable, CPU_FTR_SUBCORE},
646 {"no-execute", feat_enable, 0},646 {"no-execute", feat_enable, 0},
647 {"strong-access-ordering", feat_enable, CPU_FTR_SAO},647 {"strong-access-ordering", feat_enable, CPU_FTR_SAO},
648 {"cache-inhibited-large-page", feat_enable_large_ci, 0},648 {"cache-inhibited-large-page", feat_enable_large_ci, 0},
@@ -671,12 +671,24 @@ static struct dt_cpu_feature_match __initdata · 22 unmodified lines
671 {"wait-v3", feat_enable, 0},671 {"wait-v3", feat_enable, 0},
672};672};
673 673
674/* XXX: how to configure this? Default + boot time? */674static bool __initdata using_dt_cpu_ftrs;
675#ifdef CONFIG_PPC_CPUFEATURES_ENABLE_UNKNOWN675static bool __initdata enable_unknown = true;
676#define CPU_FEATURE_ENABLE_UNKNOWN 1676
677#else677static int __init dt_cpu_ftrs_parse(char *str)
678#define CPU_FEATURE_ENABLE_UNKNOWN 0678{
679#endif679 if (!str)
680 return 0;
681
682 if (!strcmp(str, "off"))
683 using_dt_cpu_ftrs = false;
684 else if (!strcmp(str, "known"))
685 enable_unknown = false;
686 else
687 return 1;
688
689 return 0;
690}
691early_param("dt_cpu_ftrs", dt_cpu_ftrs_parse);
680 692
681static void __init cpufeatures_setup_start(u32 isa)693static void __init cpufeatures_setup_start(u32 isa)
682{694{
@@ -707,7 +719,7 @@ static bool __init cpufeatures_process_feature(struct dt_cpu_feature *f) · 24 unmodified lines
707 }719 }
708 }720 }
709 721
710 if (!known && CPU_FEATURE_ENABLE_UNKNOWN) {722 if (!known && enable_unknown) {
711 if (!feat_try_enable_unknown(f)) {723 if (!feat_try_enable_unknown(f)) {
712 pr_info("not enabling: %s (unknown and unsupported by kernel)\n",724 pr_info("not enabling: %s (unknown and unsupported by kernel)\n",
713 f->name);725 f->name);
@@ -756,6 +768,26 @@ static void __init cpufeatures_setup_finished(void) · 42 unmodified lines
756 cur_cpu_spec->cpu_features, cur_cpu_spec->mmu_features);768 cur_cpu_spec->cpu_features, cur_cpu_spec->mmu_features);
757}769}
758 770
771static int __init disabled_on_cmdline(void)
772{
773 unsigned long root, chosen;
774 const char *p;
775
776 root = of_get_flat_dt_root();
777 chosen = of_get_flat_dt_subnode_by_name(root, "chosen");
778 if (chosen == -FDT_ERR_NOTFOUND)
779 return false;
780
781 p = of_get_flat_dt_prop(chosen, "bootargs", NULL);
782 if (!p)
783 return false;
784
785 if (strstr(p, "dt_cpu_ftrs=off"))
786 return true;
787
788 return false;
789}
790
759static int __init fdt_find_cpu_features(unsigned long node, const char *uname,791static int __init fdt_find_cpu_features(unsigned long node, const char *uname,
760 int depth, void *data)792 int depth, void *data)
761{793{
@@ -766,8 +798,6 @@ static int __init fdt_find_cpu_features(unsigned long node, const char *uname, · 4 unmodified lines
766 return 0;798 return 0;
767}799}
768 800
769static bool __initdata using_dt_cpu_ftrs = false;
770
771bool __init dt_cpu_ftrs_in_use(void)801bool __init dt_cpu_ftrs_in_use(void)
772{802{
773 return using_dt_cpu_ftrs;803 return using_dt_cpu_ftrs;
@@ -775,6 +805,8 @@ bool __init dt_cpu_ftrs_in_use(void) · 1 unmodified line
775 805
776bool __init dt_cpu_ftrs_init(void *fdt)806bool __init dt_cpu_ftrs_init(void *fdt)
777{807{
808 using_dt_cpu_ftrs = false;
809
778 /* Setup and verify the FDT, if it fails we just bail */810 /* Setup and verify the FDT, if it fails we just bail */
779 if (!early_init_dt_verify(fdt))811 if (!early_init_dt_verify(fdt))
780 return false;812 return false;
@@ -782,6 +814,9 @@ bool __init dt_cpu_ftrs_init(void *fdt) · 1 unmodified line
782 if (!of_scan_flat_dt(fdt_find_cpu_features, NULL))814 if (!of_scan_flat_dt(fdt_find_cpu_features, NULL))
783 return false;815 return false;
784 816
817 if (disabled_on_cmdline())
818 return false;
819
785 cpufeatures_setup_cpu();820 cpufeatures_setup_cpu();
786 821
787 using_dt_cpu_ftrs = true;822 using_dt_cpu_ftrs = true;
@@ -1027,5 +1062,8 @@ static int __init dt_cpu_ftrs_scan_callback(unsigned long node, const char · 239 unmodified lines
1027 1062
1028void __init dt_cpu_ftrs_scan(void)1063void __init dt_cpu_ftrs_scan(void)
1029{1064{
1065 if (!using_dt_cpu_ftrs)
1066 return;
1067
1030 of_scan_flat_dt(dt_cpu_ftrs_scan_callback, NULL);1068 of_scan_flat_dt(dt_cpu_ftrs_scan_callback, NULL);
1031}1069}
arch/powerpc/kernel/process.c+3−0
@@ -1666,6 +1666,7 @@ void start_thread(struct pt_regs *regs, unsigned long start, unsigned long sp) · 1665 unmodified lines
1666#ifdef CONFIG_VSX1666#ifdef CONFIG_VSX
1667 current->thread.used_vsr = 0;1667 current->thread.used_vsr = 0;
1668#endif1668#endif
1669 current->thread.load_fp = 0;
1669 memset(&current->thread.fp_state, 0, sizeof(current->thread.fp_state));1670 memset(&current->thread.fp_state, 0, sizeof(current->thread.fp_state));
1670 current->thread.fp_save_area = NULL;1671 current->thread.fp_save_area = NULL;
1671#ifdef CONFIG_ALTIVEC1672#ifdef CONFIG_ALTIVEC
@@ -1674,6 +1675,7 @@ void start_thread(struct pt_regs *regs, unsigned long start, unsigned long sp) · 2 unmodified lines
1674 current->thread.vr_save_area = NULL;1675 current->thread.vr_save_area = NULL;
1675 current->thread.vrsave = 0;1676 current->thread.vrsave = 0;
1676 current->thread.used_vr = 0;1677 current->thread.used_vr = 0;
1678 current->thread.load_vec = 0;
1677#endif /* CONFIG_ALTIVEC */1679#endif /* CONFIG_ALTIVEC */
1678#ifdef CONFIG_SPE1680#ifdef CONFIG_SPE
1679 memset(current->thread.evr, 0, sizeof(current->thread.evr));1681 memset(current->thread.evr, 0, sizeof(current->thread.evr));
@@ -1685,6 +1687,7 @@ void start_thread(struct pt_regs *regs, unsigned long start, unsigned long sp) · 5 unmodified lines
1685 current->thread.tm_tfhar = 0;1687 current->thread.tm_tfhar = 0;
1686 current->thread.tm_texasr = 0;1688 current->thread.tm_texasr = 0;
1687 current->thread.tm_tfiar = 0;1689 current->thread.tm_tfiar = 0;
1690 current->thread.load_tm = 0;
1688#endif /* CONFIG_PPC_TRANSACTIONAL_MEM */1691#endif /* CONFIG_PPC_TRANSACTIONAL_MEM */
1689}1692}
1690EXPORT_SYMBOL(start_thread);1693EXPORT_SYMBOL(start_thread);
arch/powerpc/kernel/setup-common.c+1−1
@@ -928,7 +928,7 @@ void __init setup_arch(char **cmdline_p) · 927 unmodified lines
928 928
929#ifdef CONFIG_PPC_MM_SLICES929#ifdef CONFIG_PPC_MM_SLICES
930#ifdef CONFIG_PPC64930#ifdef CONFIG_PPC64
931 init_mm.context.addr_limit = TASK_SIZE_128TB;931 init_mm.context.addr_limit = DEFAULT_MAP_WINDOW_USER64;
932#else932#else
933#error "context.addr_limit not initialized."933#error "context.addr_limit not initialized."
934#endif934#endif
arch/powerpc/kernel/setup_64.c+2−2
@@ -661,7 +661,7 @@ void __init emergency_stack_init(void) · 660 unmodified lines
661 661
662static void * __init pcpu_fc_alloc(unsigned int cpu, size_t size, size_t align)662static void * __init pcpu_fc_alloc(unsigned int cpu, size_t size, size_t align)
663{663{
664 return __alloc_bootmem_node(NODE_DATA(cpu_to_node(cpu)), size, align,664 return __alloc_bootmem_node(NODE_DATA(early_cpu_to_node(cpu)), size, align,
665 __pa(MAX_DMA_ADDRESS));665 __pa(MAX_DMA_ADDRESS));
666}666}
667 667
@@ -672,7 +672,7 @@ static void __init pcpu_fc_free(void *ptr, size_t size) · 4 unmodified lines
672 672
673static int pcpu_cpu_distance(unsigned int from, unsigned int to)673static int pcpu_cpu_distance(unsigned int from, unsigned int to)
674{674{
675 if (cpu_to_node(from) == cpu_to_node(to))675 if (early_cpu_to_node(from) == early_cpu_to_node(to))
676 return LOCAL_DISTANCE;676 return LOCAL_DISTANCE;
677 else677 else
678 return REMOTE_DISTANCE;678 return REMOTE_DISTANCE;
arch/powerpc/kvm/book3s_xive_template.c+2−2
@@ -69,7 +69,7 @@ static void GLUE(X_PFX,source_eoi)(u32 hw_irq, struct xive_irq_data *xd) · 68 unmodified lines
69{69{
70 /* If the XIVE supports the new "store EOI facility, use it */70 /* If the XIVE supports the new "store EOI facility, use it */
71 if (xd->flags & XIVE_IRQ_FLAG_STORE_EOI)71 if (xd->flags & XIVE_IRQ_FLAG_STORE_EOI)
72 __x_writeq(0, __x_eoi_page(xd));72 __x_writeq(0, __x_eoi_page(xd) + XIVE_ESB_STORE_EOI);
73 else if (hw_irq && xd->flags & XIVE_IRQ_FLAG_EOI_FW) {73 else if (hw_irq && xd->flags & XIVE_IRQ_FLAG_EOI_FW) {
74 opal_int_eoi(hw_irq);74 opal_int_eoi(hw_irq);
75 } else {75 } else {
@@ -89,7 +89,7 @@ static void GLUE(X_PFX,source_eoi)(u32 hw_irq, struct xive_irq_data *xd) · 13 unmodified lines
89 * properly.89 * properly.
90 */90 */
91 if (xd->flags & XIVE_IRQ_FLAG_LSI)91 if (xd->flags & XIVE_IRQ_FLAG_LSI)
92 __x_readq(__x_eoi_page(xd));92 __x_readq(__x_eoi_page(xd) + XIVE_ESB_LOAD_EOI);
93 else {93 else {
94 eoi_val = GLUE(X_PFX,esb_load)(xd, XIVE_ESB_SET_PQ_00);94 eoi_val = GLUE(X_PFX,esb_load)(xd, XIVE_ESB_SET_PQ_00);
95 95
arch/powerpc/mm/hugetlbpage-radix.c+1−1
@@ -68,7 +68,7 @@ radix__hugetlb_get_unmapped_area(struct file *file, unsigned long addr, · 67 unmodified lines
68 addr = ALIGN(addr, huge_page_size(h));68 addr = ALIGN(addr, huge_page_size(h));
69 vma = find_vma(mm, addr);69 vma = find_vma(mm, addr);
70 if (mm->task_size - len >= addr &&70 if (mm->task_size - len >= addr &&
71 (!vma || addr + len <= vma->vm_start))71 (!vma || addr + len <= vm_start_gap(vma)))
72 return addr;72 return addr;
73 }73 }
74 /*74 /*
arch/powerpc/mm/mmap.c+2−2
@@ -112,7 +112,7 @@ radix__arch_get_unmapped_area(struct file *filp, unsigned long addr, · 111 unmodified lines
112 addr = PAGE_ALIGN(addr);112 addr = PAGE_ALIGN(addr);
113 vma = find_vma(mm, addr);113 vma = find_vma(mm, addr);
114 if (mm->task_size - len >= addr && addr >= mmap_min_addr &&114 if (mm->task_size - len >= addr && addr >= mmap_min_addr &&
115 (!vma || addr + len <= vma->vm_start))115 (!vma || addr + len <= vm_start_gap(vma)))
116 return addr;116 return addr;
117 }117 }
118 118
@@ -157,7 +157,7 @@ radix__arch_get_unmapped_area_topdown(struct file *filp, · 38 unmodified lines
157 addr = PAGE_ALIGN(addr);157 addr = PAGE_ALIGN(addr);
158 vma = find_vma(mm, addr);158 vma = find_vma(mm, addr);
159 if (mm->task_size - len >= addr && addr >= mmap_min_addr &&159 if (mm->task_size - len >= addr && addr >= mmap_min_addr &&
160 (!vma || addr + len <= vma->vm_start))160 (!vma || addr + len <= vm_start_gap(vma)))
161 return addr;161 return addr;
162 }162 }
163 163
arch/powerpc/mm/mmu_context_book3s64.c+1−1
@@ -99,7 +99,7 @@ static int hash__init_new_context(struct mm_struct *mm) · 98 unmodified lines
99 * mm->context.addr_limit. Default to max task size so that we copy the99 * mm->context.addr_limit. Default to max task size so that we copy the
100 * default values to paca which will help us to handle slb miss early.100 * default values to paca which will help us to handle slb miss early.
101 */101 */
102 mm->context.addr_limit = TASK_SIZE_128TB;102 mm->context.addr_limit = DEFAULT_MAP_WINDOW_USER64;
103 103
104 /*104 /*
105 * The old code would re-promote on fork, we don't do that when using105 * The old code would re-promote on fork, we don't do that when using
arch/powerpc/mm/slice.c+1−1
@@ -99,7 +99,7 @@ static int slice_area_is_free(struct mm_struct *mm, unsigned long addr, · 98 unmodified lines
99 if ((mm->task_size - len) < addr)99 if ((mm->task_size - len) < addr)
100 return 0;100 return 0;
101 vma = find_vma(mm, addr);101 vma = find_vma(mm, addr);
102 return (!vma || (addr + len) <= vma->vm_start);102 return (!vma || (addr + len) <= vm_start_gap(vma));
103}103}
104 104
105static int slice_low_has_vma(struct mm_struct *mm, unsigned long slice)105static int slice_low_has_vma(struct mm_struct *mm, unsigned long slice)
arch/powerpc/perf/power9-pmu.c+2−2
@@ -402,7 +402,7 @@ static struct power_pmu power9_isa207_pmu = { · 401 unmodified lines
402 .name = "POWER9",402 .name = "POWER9",
403 .n_counter = MAX_PMU_COUNTERS,403 .n_counter = MAX_PMU_COUNTERS,
404 .add_fields = ISA207_ADD_FIELDS,404 .add_fields = ISA207_ADD_FIELDS,
405 .test_adder = ISA207_TEST_ADDER,405 .test_adder = P9_DD1_TEST_ADDER,
406 .compute_mmcr = isa207_compute_mmcr,406 .compute_mmcr = isa207_compute_mmcr,
407 .config_bhrb = power9_config_bhrb,407 .config_bhrb = power9_config_bhrb,
408 .bhrb_filter_map = power9_bhrb_filter_map,408 .bhrb_filter_map = power9_bhrb_filter_map,
@@ -421,7 +421,7 @@ static struct power_pmu power9_pmu = { · 12 unmodified lines
421 .name = "POWER9",421 .name = "POWER9",
422 .n_counter = MAX_PMU_COUNTERS,422 .n_counter = MAX_PMU_COUNTERS,
423 .add_fields = ISA207_ADD_FIELDS,423 .add_fields = ISA207_ADD_FIELDS,
424 .test_adder = P9_DD1_TEST_ADDER,424 .test_adder = ISA207_TEST_ADDER,
425 .compute_mmcr = isa207_compute_mmcr,425 .compute_mmcr = isa207_compute_mmcr,
426 .config_bhrb = power9_config_bhrb,426 .config_bhrb = power9_config_bhrb,
427 .bhrb_filter_map = power9_bhrb_filter_map,427 .bhrb_filter_map = power9_bhrb_filter_map,
arch/powerpc/platforms/Kconfig+11−0
@@ -59,6 +59,17 @@ config PPC_OF_BOOT_TRAMPOLINE · 58 unmodified lines
59 59
60 In case of doubt, say Y60 In case of doubt, say Y
61 61
62config PPC_DT_CPU_FTRS
63 bool "Device-tree based CPU feature discovery & setup"
64 depends on PPC_BOOK3S_64
65 default y
66 help
67 This enables code to use a new device tree binding for describing CPU
68 compatibility and features. Saying Y here will attempt to use the new
69 binding if the firmware provides it. Currently only the skiboot
70 firmware provides this binding.
71 If you're not sure say Y.
72
62config UDBG_RTAS_CONSOLE73config UDBG_RTAS_CONSOLE
63 bool "RTAS based debug console"74 bool "RTAS based debug console"
64 depends on PPC_RTAS75 depends on PPC_RTAS
arch/powerpc/platforms/cell/spufs/coredump.c+2−0
@@ -175,6 +175,8 @@ static int spufs_arch_write_note(struct spu_context *ctx, int i, · 174 unmodified lines
175 skip = roundup(cprm->pos - total + sz, 4) - cprm->pos;175 skip = roundup(cprm->pos - total + sz, 4) - cprm->pos;
176 if (!dump_skip(cprm, skip))176 if (!dump_skip(cprm, skip))
177 goto Eio;177 goto Eio;
178
179 rc = 0;
178out:180out:
179 free_page((unsigned long)buf);181 free_page((unsigned long)buf);
180 return rc;182 return rc;
arch/powerpc/platforms/powernv/npu-dma.c+2−1
@@ -75,7 +75,8 @@ struct pci_dev *pnv_pci_get_npu_dev(struct pci_dev *gpdev, int index) · 74 unmodified lines
75 if (WARN_ON(!gpdev))75 if (WARN_ON(!gpdev))
76 return NULL;76 return NULL;
77 77
78 if (WARN_ON(!gpdev->dev.of_node))78 /* Not all PCI devices have device-tree nodes */
79 if (!gpdev->dev.of_node)
79 return NULL;80 return NULL;
80 81
81 /* Get assoicated PCI device */82 /* Get assoicated PCI device */
arch/powerpc/platforms/powernv/subcore.c+7−1
@@ -407,7 +407,13 @@ static DEVICE_ATTR(subcores_per_core, 0644, · 406 unmodified lines
407 407
408static int subcore_init(void)408static int subcore_init(void)
409{409{
410 if (!cpu_has_feature(CPU_FTR_SUBCORE))410 unsigned pvr_ver;
411
412 pvr_ver = PVR_VER(mfspr(SPRN_PVR));
413
414 if (pvr_ver != PVR_POWER8 &&
415 pvr_ver != PVR_POWER8E &&
416 pvr_ver != PVR_POWER8NVL)
411 return 0;417 return 0;
412 418
413 /*419 /*
arch/powerpc/platforms/pseries/hotplug-memory.c+2−0
@@ -124,6 +124,7 @@ static struct property *dlpar_clone_drconf_property(struct device_node *dn) · 123 unmodified lines
124 for (i = 0; i < num_lmbs; i++) {124 for (i = 0; i < num_lmbs; i++) {
125 lmbs[i].base_addr = be64_to_cpu(lmbs[i].base_addr);125 lmbs[i].base_addr = be64_to_cpu(lmbs[i].base_addr);
126 lmbs[i].drc_index = be32_to_cpu(lmbs[i].drc_index);126 lmbs[i].drc_index = be32_to_cpu(lmbs[i].drc_index);
127 lmbs[i].aa_index = be32_to_cpu(lmbs[i].aa_index);
127 lmbs[i].flags = be32_to_cpu(lmbs[i].flags);128 lmbs[i].flags = be32_to_cpu(lmbs[i].flags);
128 }129 }
129 130
@@ -147,6 +148,7 @@ static void dlpar_update_drconf_property(struct device_node *dn, · 17 unmodified lines
147 for (i = 0; i < num_lmbs; i++) {148 for (i = 0; i < num_lmbs; i++) {
148 lmbs[i].base_addr = cpu_to_be64(lmbs[i].base_addr);149 lmbs[i].base_addr = cpu_to_be64(lmbs[i].base_addr);
149 lmbs[i].drc_index = cpu_to_be32(lmbs[i].drc_index);150 lmbs[i].drc_index = cpu_to_be32(lmbs[i].drc_index);
151 lmbs[i].aa_index = cpu_to_be32(lmbs[i].aa_index);
150 lmbs[i].flags = cpu_to_be32(lmbs[i].flags);152 lmbs[i].flags = cpu_to_be32(lmbs[i].flags);
151 }153 }
152 154
arch/powerpc/sysdev/simple_gpio.c+2−1
@@ -75,7 +75,8 @@ static int u8_gpio_dir_out(struct gpio_chip *gc, unsigned int gpio, int val) · 74 unmodified lines
75 75
76static void u8_gpio_save_regs(struct of_mm_gpio_chip *mm_gc)76static void u8_gpio_save_regs(struct of_mm_gpio_chip *mm_gc)
77{77{
78 struct u8_gpio_chip *u8_gc = gpiochip_get_data(&mm_gc->gc);78 struct u8_gpio_chip *u8_gc =
79 container_of(mm_gc, struct u8_gpio_chip, mm_gc);
79 80
80 u8_gc->data = in_8(mm_gc->regs);81 u8_gc->data = in_8(mm_gc->regs);
81}82}
arch/powerpc/sysdev/xive/common.c+1−1
@@ -297,7 +297,7 @@ void xive_do_source_eoi(u32 hw_irq, struct xive_irq_data *xd) · 296 unmodified lines
297{297{
298 /* If the XIVE supports the new "store EOI facility, use it */298 /* If the XIVE supports the new "store EOI facility, use it */
299 if (xd->flags & XIVE_IRQ_FLAG_STORE_EOI)299 if (xd->flags & XIVE_IRQ_FLAG_STORE_EOI)
300 out_be64(xd->eoi_mmio, 0);300 out_be64(xd->eoi_mmio + XIVE_ESB_STORE_EOI, 0);
301 else if (hw_irq && xd->flags & XIVE_IRQ_FLAG_EOI_FW) {301 else if (hw_irq && xd->flags & XIVE_IRQ_FLAG_EOI_FW) {
302 /*302 /*
303 * The FW told us to call it. This happens for some303 * The FW told us to call it. This happens for some
arch/s390/Kconfig+0−3
@@ -363,9 +363,6 @@ config COMPAT · 362 unmodified lines
363config SYSVIPC_COMPAT363config SYSVIPC_COMPAT
364 def_bool y if COMPAT && SYSVIPC364 def_bool y if COMPAT && SYSVIPC
365 365
366config KEYS_COMPAT
367 def_bool y if COMPAT && KEYS
368
369config SMP366config SMP
370 def_bool y367 def_bool y
371 prompt "Symmetric multi-processing support"368 prompt "Symmetric multi-processing support"
arch/s390/configs/default_defconfig+33−6
@@ -30,6 +30,7 @@ CONFIG_USER_NS=y · 29 unmodified lines
30CONFIG_SCHED_AUTOGROUP=y30CONFIG_SCHED_AUTOGROUP=y
31CONFIG_BLK_DEV_INITRD=y31CONFIG_BLK_DEV_INITRD=y
32CONFIG_EXPERT=y32CONFIG_EXPERT=y
33# CONFIG_SYSFS_SYSCALL is not set
33CONFIG_BPF_SYSCALL=y34CONFIG_BPF_SYSCALL=y
34CONFIG_USERFAULTFD=y35CONFIG_USERFAULTFD=y
35# CONFIG_COMPAT_BRK is not set36# CONFIG_COMPAT_BRK is not set
@@ -44,7 +45,10 @@ CONFIG_MODULE_UNLOAD=y · 8 unmodified lines
44CONFIG_MODULE_FORCE_UNLOAD=y45CONFIG_MODULE_FORCE_UNLOAD=y
45CONFIG_MODVERSIONS=y46CONFIG_MODVERSIONS=y
46CONFIG_MODULE_SRCVERSION_ALL=y47CONFIG_MODULE_SRCVERSION_ALL=y
48CONFIG_BLK_DEV_INTEGRITY=y
47CONFIG_BLK_DEV_THROTTLING=y49CONFIG_BLK_DEV_THROTTLING=y
50CONFIG_BLK_WBT=y
51CONFIG_BLK_WBT_SQ=y
48CONFIG_PARTITION_ADVANCED=y52CONFIG_PARTITION_ADVANCED=y
49CONFIG_IBM_PARTITION=y53CONFIG_IBM_PARTITION=y
50CONFIG_BSD_DISKLABEL=y54CONFIG_BSD_DISKLABEL=y
@@ -90,6 +94,8 @@ CONFIG_UNIX=y · 39 unmodified lines
90CONFIG_UNIX_DIAG=m94CONFIG_UNIX_DIAG=m
91CONFIG_XFRM_USER=m95CONFIG_XFRM_USER=m
92CONFIG_NET_KEY=m96CONFIG_NET_KEY=m
97CONFIG_SMC=m
98CONFIG_SMC_DIAG=m
93CONFIG_INET=y99CONFIG_INET=y
94CONFIG_IP_MULTICAST=y100CONFIG_IP_MULTICAST=y
95CONFIG_IP_ADVANCED_ROUTER=y101CONFIG_IP_ADVANCED_ROUTER=y
@@ -359,6 +365,7 @@ CONFIG_NET_ACT_SIMP=m · 263 unmodified lines
359CONFIG_NET_ACT_SKBEDIT=m365CONFIG_NET_ACT_SKBEDIT=m
360CONFIG_NET_ACT_CSUM=m366CONFIG_NET_ACT_CSUM=m
361CONFIG_DNS_RESOLVER=y367CONFIG_DNS_RESOLVER=y
368CONFIG_NETLINK_DIAG=m
362CONFIG_CGROUP_NET_PRIO=y369CONFIG_CGROUP_NET_PRIO=y
363CONFIG_BPF_JIT=y370CONFIG_BPF_JIT=y
364CONFIG_NET_PKTGEN=m371CONFIG_NET_PKTGEN=m
@@ -367,16 +374,19 @@ CONFIG_DEVTMPFS=y · 2 unmodified lines
367CONFIG_DMA_CMA=y374CONFIG_DMA_CMA=y
368CONFIG_CMA_SIZE_MBYTES=0375CONFIG_CMA_SIZE_MBYTES=0
369CONFIG_CONNECTOR=y376CONFIG_CONNECTOR=y
377CONFIG_ZRAM=m
370CONFIG_BLK_DEV_LOOP=m378CONFIG_BLK_DEV_LOOP=m
371CONFIG_BLK_DEV_CRYPTOLOOP=m379CONFIG_BLK_DEV_CRYPTOLOOP=m
380CONFIG_BLK_DEV_DRBD=m
372CONFIG_BLK_DEV_NBD=m381CONFIG_BLK_DEV_NBD=m
373CONFIG_BLK_DEV_OSD=m382CONFIG_BLK_DEV_OSD=m
374CONFIG_BLK_DEV_RAM=y383CONFIG_BLK_DEV_RAM=y
375CONFIG_BLK_DEV_RAM_SIZE=32768384CONFIG_BLK_DEV_RAM_SIZE=32768
376CONFIG_CDROM_PKTCDVD=m385CONFIG_BLK_DEV_RAM_DAX=y
377CONFIG_ATA_OVER_ETH=m
378CONFIG_VIRTIO_BLK=y386CONFIG_VIRTIO_BLK=y
387CONFIG_BLK_DEV_RBD=m
379CONFIG_ENCLOSURE_SERVICES=m388CONFIG_ENCLOSURE_SERVICES=m
389CONFIG_GENWQE=m
380CONFIG_RAID_ATTRS=m390CONFIG_RAID_ATTRS=m
381CONFIG_SCSI=y391CONFIG_SCSI=y
382CONFIG_BLK_DEV_SD=y392CONFIG_BLK_DEV_SD=y
@@ -442,6 +452,8 @@ CONFIG_NLMON=m · 59 unmodified lines
442# CONFIG_NET_VENDOR_INTEL is not set452# CONFIG_NET_VENDOR_INTEL is not set
443# CONFIG_NET_VENDOR_MARVELL is not set453# CONFIG_NET_VENDOR_MARVELL is not set
444CONFIG_MLX4_EN=m454CONFIG_MLX4_EN=m
455CONFIG_MLX5_CORE=m
456CONFIG_MLX5_CORE_EN=y
445# CONFIG_NET_VENDOR_NATSEMI is not set457# CONFIG_NET_VENDOR_NATSEMI is not set
446CONFIG_PPP=m458CONFIG_PPP=m
447CONFIG_PPP_BSDCOMP=m459CONFIG_PPP_BSDCOMP=m
@@ -452,7 +464,6 @@ CONFIG_PPTP=m · 4 unmodified lines
452CONFIG_PPPOL2TP=m464CONFIG_PPPOL2TP=m
453CONFIG_PPP_ASYNC=m465CONFIG_PPP_ASYNC=m
454CONFIG_PPP_SYNC_TTY=m466CONFIG_PPP_SYNC_TTY=m
455# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
456# CONFIG_INPUT_KEYBOARD is not set467# CONFIG_INPUT_KEYBOARD is not set
457# CONFIG_INPUT_MOUSE is not set468# CONFIG_INPUT_MOUSE is not set
458# CONFIG_SERIO is not set469# CONFIG_SERIO is not set
@@ -471,6 +482,7 @@ CONFIG_DIAG288_WATCHDOG=m · 12 unmodified lines
471CONFIG_INFINIBAND=m482CONFIG_INFINIBAND=m
472CONFIG_INFINIBAND_USER_ACCESS=m483CONFIG_INFINIBAND_USER_ACCESS=m
473CONFIG_MLX4_INFINIBAND=m484CONFIG_MLX4_INFINIBAND=m
485CONFIG_MLX5_INFINIBAND=m
474CONFIG_VIRTIO_BALLOON=m486CONFIG_VIRTIO_BALLOON=m
475CONFIG_EXT4_FS=y487CONFIG_EXT4_FS=y
476CONFIG_EXT4_FS_POSIX_ACL=y488CONFIG_EXT4_FS_POSIX_ACL=y
@@ -487,12 +499,18 @@ CONFIG_XFS_POSIX_ACL=y · 10 unmodified lines
487CONFIG_XFS_RT=y499CONFIG_XFS_RT=y
488CONFIG_XFS_DEBUG=y500CONFIG_XFS_DEBUG=y
489CONFIG_GFS2_FS=m501CONFIG_GFS2_FS=m
502CONFIG_GFS2_FS_LOCKING_DLM=y
490CONFIG_OCFS2_FS=m503CONFIG_OCFS2_FS=m
491CONFIG_BTRFS_FS=y504CONFIG_BTRFS_FS=y
492CONFIG_BTRFS_FS_POSIX_ACL=y505CONFIG_BTRFS_FS_POSIX_ACL=y
506CONFIG_BTRFS_DEBUG=y
493CONFIG_NILFS2_FS=m507CONFIG_NILFS2_FS=m
508CONFIG_FS_DAX=y
509CONFIG_EXPORTFS_BLOCK_OPS=y
494CONFIG_FANOTIFY=y510CONFIG_FANOTIFY=y
511CONFIG_FANOTIFY_ACCESS_PERMISSIONS=y
495CONFIG_QUOTA_NETLINK_INTERFACE=y512CONFIG_QUOTA_NETLINK_INTERFACE=y
513CONFIG_QUOTA_DEBUG=y
496CONFIG_QFMT_V1=m514CONFIG_QFMT_V1=m
497CONFIG_QFMT_V2=m515CONFIG_QFMT_V2=m
498CONFIG_AUTOFS4_FS=m516CONFIG_AUTOFS4_FS=m
@@ -558,6 +576,7 @@ CONFIG_HEADERS_CHECK=y · 59 unmodified lines
558CONFIG_DEBUG_SECTION_MISMATCH=y576CONFIG_DEBUG_SECTION_MISMATCH=y
559CONFIG_MAGIC_SYSRQ=y577CONFIG_MAGIC_SYSRQ=y
560CONFIG_DEBUG_PAGEALLOC=y578CONFIG_DEBUG_PAGEALLOC=y
579CONFIG_DEBUG_RODATA_TEST=y
561CONFIG_DEBUG_OBJECTS=y580CONFIG_DEBUG_OBJECTS=y
562CONFIG_DEBUG_OBJECTS_SELFTEST=y581CONFIG_DEBUG_OBJECTS_SELFTEST=y
563CONFIG_DEBUG_OBJECTS_FREE=y582CONFIG_DEBUG_OBJECTS_FREE=y
@@ -580,7 +599,6 @@ CONFIG_DETECT_HUNG_TASK=y · 16 unmodified lines
580CONFIG_WQ_WATCHDOG=y599CONFIG_WQ_WATCHDOG=y
581CONFIG_PANIC_ON_OOPS=y600CONFIG_PANIC_ON_OOPS=y
582CONFIG_DEBUG_TIMEKEEPING=y601CONFIG_DEBUG_TIMEKEEPING=y
583CONFIG_TIMER_STATS=y
584CONFIG_DEBUG_RT_MUTEXES=y602CONFIG_DEBUG_RT_MUTEXES=y
585CONFIG_DEBUG_WW_MUTEX_SLOWPATH=y603CONFIG_DEBUG_WW_MUTEX_SLOWPATH=y
586CONFIG_PROVE_LOCKING=y604CONFIG_PROVE_LOCKING=y
@@ -595,6 +613,7 @@ CONFIG_RCU_TORTURE_TEST=m · 8 unmodified lines
595CONFIG_RCU_CPU_STALL_TIMEOUT=300613CONFIG_RCU_CPU_STALL_TIMEOUT=300
596CONFIG_NOTIFIER_ERROR_INJECTION=m614CONFIG_NOTIFIER_ERROR_INJECTION=m
597CONFIG_PM_NOTIFIER_ERROR_INJECT=m615CONFIG_PM_NOTIFIER_ERROR_INJECT=m
616CONFIG_NETDEV_NOTIFIER_ERROR_INJECT=m
598CONFIG_FAULT_INJECTION=y617CONFIG_FAULT_INJECTION=y
599CONFIG_FAILSLAB=y618CONFIG_FAILSLAB=y
600CONFIG_FAIL_PAGE_ALLOC=y619CONFIG_FAIL_PAGE_ALLOC=y
@@ -616,13 +635,12 @@ CONFIG_HIST_TRIGGERS=y · 15 unmodified lines
616CONFIG_TRACE_ENUM_MAP_FILE=y635CONFIG_TRACE_ENUM_MAP_FILE=y
617CONFIG_LKDTM=m636CONFIG_LKDTM=m
618CONFIG_TEST_LIST_SORT=y637CONFIG_TEST_LIST_SORT=y
638CONFIG_TEST_SORT=y
619CONFIG_KPROBES_SANITY_TEST=y639CONFIG_KPROBES_SANITY_TEST=y
620CONFIG_RBTREE_TEST=y640CONFIG_RBTREE_TEST=y
621CONFIG_INTERVAL_TREE_TEST=m641CONFIG_INTERVAL_TREE_TEST=m
622CONFIG_PERCPU_TEST=m642CONFIG_PERCPU_TEST=m
623CONFIG_ATOMIC64_SELFTEST=y643CONFIG_ATOMIC64_SELFTEST=y
624CONFIG_TEST_STRING_HELPERS=y
625CONFIG_TEST_KSTRTOX=y
626CONFIG_DMA_API_DEBUG=y644CONFIG_DMA_API_DEBUG=y
627CONFIG_TEST_BPF=m645CONFIG_TEST_BPF=m
628CONFIG_BUG_ON_DATA_CORRUPTION=y646CONFIG_BUG_ON_DATA_CORRUPTION=y
@@ -630,6 +648,7 @@ CONFIG_S390_PTDUMP=y · 1 unmodified line
630CONFIG_ENCRYPTED_KEYS=m648CONFIG_ENCRYPTED_KEYS=m
631CONFIG_SECURITY=y649CONFIG_SECURITY=y
632CONFIG_SECURITY_NETWORK=y650CONFIG_SECURITY_NETWORK=y
651CONFIG_HARDENED_USERCOPY=y
633CONFIG_SECURITY_SELINUX=y652CONFIG_SECURITY_SELINUX=y
634CONFIG_SECURITY_SELINUX_BOOTPARAM=y653CONFIG_SECURITY_SELINUX_BOOTPARAM=y
635CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=0654CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=0
@@ -640,7 +659,9 @@ CONFIG_CRYPTO_RSA=m · 4 unmodified lines
640CONFIG_CRYPTO_DH=m659CONFIG_CRYPTO_DH=m
641CONFIG_CRYPTO_ECDH=m660CONFIG_CRYPTO_ECDH=m
642CONFIG_CRYPTO_USER=m661CONFIG_CRYPTO_USER=m
662CONFIG_CRYPTO_PCRYPT=m
643CONFIG_CRYPTO_CRYPTD=m663CONFIG_CRYPTO_CRYPTD=m
664CONFIG_CRYPTO_MCRYPTD=m
644CONFIG_CRYPTO_TEST=m665CONFIG_CRYPTO_TEST=m
645CONFIG_CRYPTO_CCM=m666CONFIG_CRYPTO_CCM=m
646CONFIG_CRYPTO_GCM=m667CONFIG_CRYPTO_GCM=m
@@ -648,6 +669,7 @@ CONFIG_CRYPTO_CHACHA20POLY1305=m · 1 unmodified line
648CONFIG_CRYPTO_LRW=m669CONFIG_CRYPTO_LRW=m
649CONFIG_CRYPTO_PCBC=m670CONFIG_CRYPTO_PCBC=m
650CONFIG_CRYPTO_KEYWRAP=m671CONFIG_CRYPTO_KEYWRAP=m
672CONFIG_CRYPTO_CMAC=m
651CONFIG_CRYPTO_XCBC=m673CONFIG_CRYPTO_XCBC=m
652CONFIG_CRYPTO_VMAC=m674CONFIG_CRYPTO_VMAC=m
653CONFIG_CRYPTO_CRC32=m675CONFIG_CRYPTO_CRC32=m
@@ -657,8 +679,10 @@ CONFIG_CRYPTO_RMD160=m · 3 unmodified lines
657CONFIG_CRYPTO_RMD256=m679CONFIG_CRYPTO_RMD256=m
658CONFIG_CRYPTO_RMD320=m680CONFIG_CRYPTO_RMD320=m
659CONFIG_CRYPTO_SHA512=m681CONFIG_CRYPTO_SHA512=m
682CONFIG_CRYPTO_SHA3=m
660CONFIG_CRYPTO_TGR192=m683CONFIG_CRYPTO_TGR192=m
661CONFIG_CRYPTO_WP512=m684CONFIG_CRYPTO_WP512=m
685CONFIG_CRYPTO_AES_TI=m
662CONFIG_CRYPTO_ANUBIS=m686CONFIG_CRYPTO_ANUBIS=m
663CONFIG_CRYPTO_BLOWFISH=m687CONFIG_CRYPTO_BLOWFISH=m
664CONFIG_CRYPTO_CAMELLIA=m688CONFIG_CRYPTO_CAMELLIA=m
@@ -674,6 +698,7 @@ CONFIG_CRYPTO_TWOFISH=m · 9 unmodified lines
674CONFIG_CRYPTO_842=m698CONFIG_CRYPTO_842=m
675CONFIG_CRYPTO_LZ4=m699CONFIG_CRYPTO_LZ4=m
676CONFIG_CRYPTO_LZ4HC=m700CONFIG_CRYPTO_LZ4HC=m
701CONFIG_CRYPTO_ANSI_CPRNG=m
677CONFIG_CRYPTO_USER_API_HASH=m702CONFIG_CRYPTO_USER_API_HASH=m
678CONFIG_CRYPTO_USER_API_SKCIPHER=m703CONFIG_CRYPTO_USER_API_SKCIPHER=m
679CONFIG_CRYPTO_USER_API_RNG=m704CONFIG_CRYPTO_USER_API_RNG=m
@@ -685,6 +710,7 @@ CONFIG_CRYPTO_SHA256_S390=m · 5 unmodified lines
685CONFIG_CRYPTO_SHA512_S390=m710CONFIG_CRYPTO_SHA512_S390=m
686CONFIG_CRYPTO_DES_S390=m711CONFIG_CRYPTO_DES_S390=m
687CONFIG_CRYPTO_AES_S390=m712CONFIG_CRYPTO_AES_S390=m
713CONFIG_CRYPTO_PAES_S390=m
688CONFIG_CRYPTO_GHASH_S390=m714CONFIG_CRYPTO_GHASH_S390=m
689CONFIG_CRYPTO_CRC32_S390=y715CONFIG_CRYPTO_CRC32_S390=y
690CONFIG_ASYMMETRIC_KEY_TYPE=y716CONFIG_ASYMMETRIC_KEY_TYPE=y
@@ -692,6 +718,7 @@ CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE=m · 1 unmodified line
692CONFIG_X509_CERTIFICATE_PARSER=m718CONFIG_X509_CERTIFICATE_PARSER=m
693CONFIG_CRC7=m719CONFIG_CRC7=m
694CONFIG_CRC8=m720CONFIG_CRC8=m
721CONFIG_RANDOM32_SELFTEST=y
695CONFIG_CORDIC=m722CONFIG_CORDIC=m
696CONFIG_CMM=m723CONFIG_CMM=m
697CONFIG_APPLDATA_BASE=y724CONFIG_APPLDATA_BASE=y
arch/s390/configs/gcov_defconfig+24−4
@@ -31,6 +31,7 @@ CONFIG_USER_NS=y · 30 unmodified lines
31CONFIG_SCHED_AUTOGROUP=y31CONFIG_SCHED_AUTOGROUP=y
32CONFIG_BLK_DEV_INITRD=y32CONFIG_BLK_DEV_INITRD=y
33CONFIG_EXPERT=y33CONFIG_EXPERT=y
34# CONFIG_SYSFS_SYSCALL is not set
34CONFIG_BPF_SYSCALL=y35CONFIG_BPF_SYSCALL=y
35CONFIG_USERFAULTFD=y36CONFIG_USERFAULTFD=y
36# CONFIG_COMPAT_BRK is not set37# CONFIG_COMPAT_BRK is not set
@@ -46,7 +47,10 @@ CONFIG_MODULE_UNLOAD=y · 9 unmodified lines
46CONFIG_MODULE_FORCE_UNLOAD=y47CONFIG_MODULE_FORCE_UNLOAD=y
47CONFIG_MODVERSIONS=y48CONFIG_MODVERSIONS=y
48CONFIG_MODULE_SRCVERSION_ALL=y49CONFIG_MODULE_SRCVERSION_ALL=y
50CONFIG_BLK_DEV_INTEGRITY=y
49CONFIG_BLK_DEV_THROTTLING=y51CONFIG_BLK_DEV_THROTTLING=y
52CONFIG_BLK_WBT=y
53CONFIG_BLK_WBT_SQ=y
50CONFIG_PARTITION_ADVANCED=y54CONFIG_PARTITION_ADVANCED=y
51CONFIG_IBM_PARTITION=y55CONFIG_IBM_PARTITION=y
52CONFIG_BSD_DISKLABEL=y56CONFIG_BSD_DISKLABEL=y
@@ -88,6 +92,8 @@ CONFIG_UNIX=y · 35 unmodified lines
88CONFIG_UNIX_DIAG=m92CONFIG_UNIX_DIAG=m
89CONFIG_XFRM_USER=m93CONFIG_XFRM_USER=m
90CONFIG_NET_KEY=m94CONFIG_NET_KEY=m
95CONFIG_SMC=m
96CONFIG_SMC_DIAG=m
91CONFIG_INET=y97CONFIG_INET=y
92CONFIG_IP_MULTICAST=y98CONFIG_IP_MULTICAST=y
93CONFIG_IP_ADVANCED_ROUTER=y99CONFIG_IP_ADVANCED_ROUTER=y
@@ -356,6 +362,7 @@ CONFIG_NET_ACT_SIMP=m · 262 unmodified lines
356CONFIG_NET_ACT_SKBEDIT=m362CONFIG_NET_ACT_SKBEDIT=m
357CONFIG_NET_ACT_CSUM=m363CONFIG_NET_ACT_CSUM=m
358CONFIG_DNS_RESOLVER=y364CONFIG_DNS_RESOLVER=y
365CONFIG_NETLINK_DIAG=m
359CONFIG_CGROUP_NET_PRIO=y366CONFIG_CGROUP_NET_PRIO=y
360CONFIG_BPF_JIT=y367CONFIG_BPF_JIT=y
361CONFIG_NET_PKTGEN=m368CONFIG_NET_PKTGEN=m
@@ -364,16 +371,18 @@ CONFIG_DEVTMPFS=y · 2 unmodified lines
364CONFIG_DMA_CMA=y371CONFIG_DMA_CMA=y
365CONFIG_CMA_SIZE_MBYTES=0372CONFIG_CMA_SIZE_MBYTES=0
366CONFIG_CONNECTOR=y373CONFIG_CONNECTOR=y
374CONFIG_ZRAM=m
367CONFIG_BLK_DEV_LOOP=m375CONFIG_BLK_DEV_LOOP=m
368CONFIG_BLK_DEV_CRYPTOLOOP=m376CONFIG_BLK_DEV_CRYPTOLOOP=m
377CONFIG_BLK_DEV_DRBD=m
369CONFIG_BLK_DEV_NBD=m378CONFIG_BLK_DEV_NBD=m
370CONFIG_BLK_DEV_OSD=m379CONFIG_BLK_DEV_OSD=m
371CONFIG_BLK_DEV_RAM=y380CONFIG_BLK_DEV_RAM=y
372CONFIG_BLK_DEV_RAM_SIZE=32768381CONFIG_BLK_DEV_RAM_SIZE=32768
373CONFIG_CDROM_PKTCDVD=m382CONFIG_BLK_DEV_RAM_DAX=y
374CONFIG_ATA_OVER_ETH=m
375CONFIG_VIRTIO_BLK=y383CONFIG_VIRTIO_BLK=y
376CONFIG_ENCLOSURE_SERVICES=m384CONFIG_ENCLOSURE_SERVICES=m
385CONFIG_GENWQE=m
377CONFIG_RAID_ATTRS=m386CONFIG_RAID_ATTRS=m
378CONFIG_SCSI=y387CONFIG_SCSI=y
379CONFIG_BLK_DEV_SD=y388CONFIG_BLK_DEV_SD=y
@@ -439,6 +448,8 @@ CONFIG_NLMON=m · 59 unmodified lines
439# CONFIG_NET_VENDOR_INTEL is not set448# CONFIG_NET_VENDOR_INTEL is not set
440# CONFIG_NET_VENDOR_MARVELL is not set449# CONFIG_NET_VENDOR_MARVELL is not set
441CONFIG_MLX4_EN=m450CONFIG_MLX4_EN=m
451CONFIG_MLX5_CORE=m
452CONFIG_MLX5_CORE_EN=y
442# CONFIG_NET_VENDOR_NATSEMI is not set453# CONFIG_NET_VENDOR_NATSEMI is not set
443CONFIG_PPP=m454CONFIG_PPP=m
444CONFIG_PPP_BSDCOMP=m455CONFIG_PPP_BSDCOMP=m
@@ -449,7 +460,6 @@ CONFIG_PPTP=m · 4 unmodified lines
449CONFIG_PPPOL2TP=m460CONFIG_PPPOL2TP=m
450CONFIG_PPP_ASYNC=m461CONFIG_PPP_ASYNC=m
451CONFIG_PPP_SYNC_TTY=m462CONFIG_PPP_SYNC_TTY=m
452# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
453# CONFIG_INPUT_KEYBOARD is not set463# CONFIG_INPUT_KEYBOARD is not set
454# CONFIG_INPUT_MOUSE is not set464# CONFIG_INPUT_MOUSE is not set
455# CONFIG_SERIO is not set465# CONFIG_SERIO is not set
@@ -468,6 +478,7 @@ CONFIG_DIAG288_WATCHDOG=m · 12 unmodified lines
468CONFIG_INFINIBAND=m478CONFIG_INFINIBAND=m
469CONFIG_INFINIBAND_USER_ACCESS=m479CONFIG_INFINIBAND_USER_ACCESS=m
470CONFIG_MLX4_INFINIBAND=m480CONFIG_MLX4_INFINIBAND=m
481CONFIG_MLX5_INFINIBAND=m
471CONFIG_VIRTIO_BALLOON=m482CONFIG_VIRTIO_BALLOON=m
472CONFIG_EXT4_FS=y483CONFIG_EXT4_FS=y
473CONFIG_EXT4_FS_POSIX_ACL=y484CONFIG_EXT4_FS_POSIX_ACL=y
@@ -483,11 +494,15 @@ CONFIG_XFS_QUOTA=y · 9 unmodified lines
483CONFIG_XFS_POSIX_ACL=y494CONFIG_XFS_POSIX_ACL=y
484CONFIG_XFS_RT=y495CONFIG_XFS_RT=y
485CONFIG_GFS2_FS=m496CONFIG_GFS2_FS=m
497CONFIG_GFS2_FS_LOCKING_DLM=y
486CONFIG_OCFS2_FS=m498CONFIG_OCFS2_FS=m
487CONFIG_BTRFS_FS=y499CONFIG_BTRFS_FS=y
488CONFIG_BTRFS_FS_POSIX_ACL=y500CONFIG_BTRFS_FS_POSIX_ACL=y
489CONFIG_NILFS2_FS=m501CONFIG_NILFS2_FS=m
502CONFIG_FS_DAX=y
503CONFIG_EXPORTFS_BLOCK_OPS=y
490CONFIG_FANOTIFY=y504CONFIG_FANOTIFY=y
505CONFIG_FANOTIFY_ACCESS_PERMISSIONS=y
491CONFIG_QUOTA_NETLINK_INTERFACE=y506CONFIG_QUOTA_NETLINK_INTERFACE=y
492CONFIG_QFMT_V1=m507CONFIG_QFMT_V1=m
493CONFIG_QFMT_V2=m508CONFIG_QFMT_V2=m
@@ -553,7 +568,6 @@ CONFIG_UNUSED_SYMBOLS=y · 59 unmodified lines
553CONFIG_MAGIC_SYSRQ=y568CONFIG_MAGIC_SYSRQ=y
554CONFIG_DEBUG_MEMORY_INIT=y569CONFIG_DEBUG_MEMORY_INIT=y
555CONFIG_PANIC_ON_OOPS=y570CONFIG_PANIC_ON_OOPS=y
556CONFIG_TIMER_STATS=y
557CONFIG_RCU_TORTURE_TEST=m571CONFIG_RCU_TORTURE_TEST=m
558CONFIG_RCU_CPU_STALL_TIMEOUT=60572CONFIG_RCU_CPU_STALL_TIMEOUT=60
559CONFIG_LATENCYTOP=y573CONFIG_LATENCYTOP=y
@@ -576,6 +590,7 @@ CONFIG_BIG_KEYS=y · 16 unmodified lines
576CONFIG_ENCRYPTED_KEYS=m590CONFIG_ENCRYPTED_KEYS=m
577CONFIG_SECURITY=y591CONFIG_SECURITY=y
578CONFIG_SECURITY_NETWORK=y592CONFIG_SECURITY_NETWORK=y
593CONFIG_HARDENED_USERCOPY=y
579CONFIG_SECURITY_SELINUX=y594CONFIG_SECURITY_SELINUX=y
580CONFIG_SECURITY_SELINUX_BOOTPARAM=y595CONFIG_SECURITY_SELINUX_BOOTPARAM=y
581CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=0596CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=0
@@ -599,6 +614,7 @@ CONFIG_CRYPTO_CHACHA20POLY1305=m · 17 unmodified lines
599CONFIG_CRYPTO_LRW=m614CONFIG_CRYPTO_LRW=m
600CONFIG_CRYPTO_PCBC=m615CONFIG_CRYPTO_PCBC=m
601CONFIG_CRYPTO_KEYWRAP=m616CONFIG_CRYPTO_KEYWRAP=m
617CONFIG_CRYPTO_CMAC=m
602CONFIG_CRYPTO_XCBC=m618CONFIG_CRYPTO_XCBC=m
603CONFIG_CRYPTO_VMAC=m619CONFIG_CRYPTO_VMAC=m
604CONFIG_CRYPTO_CRC32=m620CONFIG_CRYPTO_CRC32=m
@@ -611,6 +627,7 @@ CONFIG_CRYPTO_SHA512=m · 6 unmodified lines
611CONFIG_CRYPTO_SHA3=m627CONFIG_CRYPTO_SHA3=m
612CONFIG_CRYPTO_TGR192=m628CONFIG_CRYPTO_TGR192=m
613CONFIG_CRYPTO_WP512=m629CONFIG_CRYPTO_WP512=m
630CONFIG_CRYPTO_AES_TI=m
614CONFIG_CRYPTO_ANUBIS=m631CONFIG_CRYPTO_ANUBIS=m
615CONFIG_CRYPTO_BLOWFISH=m632CONFIG_CRYPTO_BLOWFISH=m
616CONFIG_CRYPTO_CAMELLIA=m633CONFIG_CRYPTO_CAMELLIA=m
@@ -626,16 +643,19 @@ CONFIG_CRYPTO_TWOFISH=m · 9 unmodified lines
626CONFIG_CRYPTO_842=m643CONFIG_CRYPTO_842=m
627CONFIG_CRYPTO_LZ4=m644CONFIG_CRYPTO_LZ4=m
628CONFIG_CRYPTO_LZ4HC=m645CONFIG_CRYPTO_LZ4HC=m
646CONFIG_CRYPTO_ANSI_CPRNG=m
629CONFIG_CRYPTO_USER_API_HASH=m647CONFIG_CRYPTO_USER_API_HASH=m
630CONFIG_CRYPTO_USER_API_SKCIPHER=m648CONFIG_CRYPTO_USER_API_SKCIPHER=m
631CONFIG_CRYPTO_USER_API_RNG=m649CONFIG_CRYPTO_USER_API_RNG=m
632CONFIG_CRYPTO_USER_API_AEAD=m650CONFIG_CRYPTO_USER_API_AEAD=m
633CONFIG_ZCRYPT=m651CONFIG_ZCRYPT=m
652CONFIG_PKEY=m
634CONFIG_CRYPTO_SHA1_S390=m653CONFIG_CRYPTO_SHA1_S390=m
635CONFIG_CRYPTO_SHA256_S390=m654CONFIG_CRYPTO_SHA256_S390=m
636CONFIG_CRYPTO_SHA512_S390=m655CONFIG_CRYPTO_SHA512_S390=m
637CONFIG_CRYPTO_DES_S390=m656CONFIG_CRYPTO_DES_S390=m
638CONFIG_CRYPTO_AES_S390=m657CONFIG_CRYPTO_AES_S390=m
658CONFIG_CRYPTO_PAES_S390=m
639CONFIG_CRYPTO_GHASH_S390=m659CONFIG_CRYPTO_GHASH_S390=m
640CONFIG_CRYPTO_CRC32_S390=y660CONFIG_CRYPTO_CRC32_S390=y
641CONFIG_CRC7=m661CONFIG_CRC7=m
arch/s390/configs/performance_defconfig+23−4
@@ -31,6 +31,7 @@ CONFIG_USER_NS=y · 30 unmodified lines
31CONFIG_SCHED_AUTOGROUP=y31CONFIG_SCHED_AUTOGROUP=y
32CONFIG_BLK_DEV_INITRD=y32CONFIG_BLK_DEV_INITRD=y
33CONFIG_EXPERT=y33CONFIG_EXPERT=y
34# CONFIG_SYSFS_SYSCALL is not set
34CONFIG_BPF_SYSCALL=y35CONFIG_BPF_SYSCALL=y
35CONFIG_USERFAULTFD=y36CONFIG_USERFAULTFD=y
36# CONFIG_COMPAT_BRK is not set37# CONFIG_COMPAT_BRK is not set
@@ -44,7 +45,10 @@ CONFIG_MODULE_UNLOAD=y · 7 unmodified lines
44CONFIG_MODULE_FORCE_UNLOAD=y45CONFIG_MODULE_FORCE_UNLOAD=y
45CONFIG_MODVERSIONS=y46CONFIG_MODVERSIONS=y
46CONFIG_MODULE_SRCVERSION_ALL=y47CONFIG_MODULE_SRCVERSION_ALL=y
48CONFIG_BLK_DEV_INTEGRITY=y
47CONFIG_BLK_DEV_THROTTLING=y49CONFIG_BLK_DEV_THROTTLING=y
50CONFIG_BLK_WBT=y
51CONFIG_BLK_WBT_SQ=y
48CONFIG_PARTITION_ADVANCED=y52CONFIG_PARTITION_ADVANCED=y
49CONFIG_IBM_PARTITION=y53CONFIG_IBM_PARTITION=y
50CONFIG_BSD_DISKLABEL=y54CONFIG_BSD_DISKLABEL=y
@@ -86,6 +90,8 @@ CONFIG_UNIX=y · 35 unmodified lines
86CONFIG_UNIX_DIAG=m90CONFIG_UNIX_DIAG=m
87CONFIG_XFRM_USER=m91CONFIG_XFRM_USER=m
88CONFIG_NET_KEY=m92CONFIG_NET_KEY=m
93CONFIG_SMC=m
94CONFIG_SMC_DIAG=m
89CONFIG_INET=y95CONFIG_INET=y
90CONFIG_IP_MULTICAST=y96CONFIG_IP_MULTICAST=y
91CONFIG_IP_ADVANCED_ROUTER=y97CONFIG_IP_ADVANCED_ROUTER=y
@@ -354,6 +360,7 @@ CONFIG_NET_ACT_SIMP=m · 262 unmodified lines
354CONFIG_NET_ACT_SKBEDIT=m360CONFIG_NET_ACT_SKBEDIT=m
355CONFIG_NET_ACT_CSUM=m361CONFIG_NET_ACT_CSUM=m
356CONFIG_DNS_RESOLVER=y362CONFIG_DNS_RESOLVER=y
363CONFIG_NETLINK_DIAG=m
357CONFIG_CGROUP_NET_PRIO=y364CONFIG_CGROUP_NET_PRIO=y
358CONFIG_BPF_JIT=y365CONFIG_BPF_JIT=y
359CONFIG_NET_PKTGEN=m366CONFIG_NET_PKTGEN=m
@@ -362,16 +369,18 @@ CONFIG_DEVTMPFS=y · 2 unmodified lines
362CONFIG_DMA_CMA=y369CONFIG_DMA_CMA=y
363CONFIG_CMA_SIZE_MBYTES=0370CONFIG_CMA_SIZE_MBYTES=0
364CONFIG_CONNECTOR=y371CONFIG_CONNECTOR=y
372CONFIG_ZRAM=m
365CONFIG_BLK_DEV_LOOP=m373CONFIG_BLK_DEV_LOOP=m
366CONFIG_BLK_DEV_CRYPTOLOOP=m374CONFIG_BLK_DEV_CRYPTOLOOP=m
375CONFIG_BLK_DEV_DRBD=m
367CONFIG_BLK_DEV_NBD=m376CONFIG_BLK_DEV_NBD=m
368CONFIG_BLK_DEV_OSD=m377CONFIG_BLK_DEV_OSD=m
369CONFIG_BLK_DEV_RAM=y378CONFIG_BLK_DEV_RAM=y
370CONFIG_BLK_DEV_RAM_SIZE=32768379CONFIG_BLK_DEV_RAM_SIZE=32768
371CONFIG_CDROM_PKTCDVD=m380CONFIG_BLK_DEV_RAM_DAX=y
372CONFIG_ATA_OVER_ETH=m
373CONFIG_VIRTIO_BLK=y381CONFIG_VIRTIO_BLK=y
374CONFIG_ENCLOSURE_SERVICES=m382CONFIG_ENCLOSURE_SERVICES=m
383CONFIG_GENWQE=m
375CONFIG_RAID_ATTRS=m384CONFIG_RAID_ATTRS=m
376CONFIG_SCSI=y385CONFIG_SCSI=y
377CONFIG_BLK_DEV_SD=y386CONFIG_BLK_DEV_SD=y
@@ -437,6 +446,8 @@ CONFIG_NLMON=m · 59 unmodified lines
437# CONFIG_NET_VENDOR_INTEL is not set446# CONFIG_NET_VENDOR_INTEL is not set
438# CONFIG_NET_VENDOR_MARVELL is not set447# CONFIG_NET_VENDOR_MARVELL is not set
439CONFIG_MLX4_EN=m448CONFIG_MLX4_EN=m
449CONFIG_MLX5_CORE=m
450CONFIG_MLX5_CORE_EN=y
440# CONFIG_NET_VENDOR_NATSEMI is not set451# CONFIG_NET_VENDOR_NATSEMI is not set
441CONFIG_PPP=m452CONFIG_PPP=m
442CONFIG_PPP_BSDCOMP=m453CONFIG_PPP_BSDCOMP=m
@@ -447,7 +458,6 @@ CONFIG_PPTP=m · 4 unmodified lines
447CONFIG_PPPOL2TP=m458CONFIG_PPPOL2TP=m
448CONFIG_PPP_ASYNC=m459CONFIG_PPP_ASYNC=m
449CONFIG_PPP_SYNC_TTY=m460CONFIG_PPP_SYNC_TTY=m
450# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
451# CONFIG_INPUT_KEYBOARD is not set461# CONFIG_INPUT_KEYBOARD is not set
452# CONFIG_INPUT_MOUSE is not set462# CONFIG_INPUT_MOUSE is not set
453# CONFIG_SERIO is not set463# CONFIG_SERIO is not set
@@ -466,6 +476,7 @@ CONFIG_DIAG288_WATCHDOG=m · 12 unmodified lines
466CONFIG_INFINIBAND=m476CONFIG_INFINIBAND=m
467CONFIG_INFINIBAND_USER_ACCESS=m477CONFIG_INFINIBAND_USER_ACCESS=m
468CONFIG_MLX4_INFINIBAND=m478CONFIG_MLX4_INFINIBAND=m
479CONFIG_MLX5_INFINIBAND=m
469CONFIG_VIRTIO_BALLOON=m480CONFIG_VIRTIO_BALLOON=m
470CONFIG_EXT4_FS=y481CONFIG_EXT4_FS=y
471CONFIG_EXT4_FS_POSIX_ACL=y482CONFIG_EXT4_FS_POSIX_ACL=y
@@ -481,11 +492,15 @@ CONFIG_XFS_QUOTA=y · 9 unmodified lines
481CONFIG_XFS_POSIX_ACL=y492CONFIG_XFS_POSIX_ACL=y
482CONFIG_XFS_RT=y493CONFIG_XFS_RT=y
483CONFIG_GFS2_FS=m494CONFIG_GFS2_FS=m
495CONFIG_GFS2_FS_LOCKING_DLM=y
484CONFIG_OCFS2_FS=m496CONFIG_OCFS2_FS=m
485CONFIG_BTRFS_FS=y497CONFIG_BTRFS_FS=y
486CONFIG_BTRFS_FS_POSIX_ACL=y498CONFIG_BTRFS_FS_POSIX_ACL=y
487CONFIG_NILFS2_FS=m499CONFIG_NILFS2_FS=m
500CONFIG_FS_DAX=y
501CONFIG_EXPORTFS_BLOCK_OPS=y
488CONFIG_FANOTIFY=y502CONFIG_FANOTIFY=y
503CONFIG_FANOTIFY_ACCESS_PERMISSIONS=y
489CONFIG_QUOTA_NETLINK_INTERFACE=y504CONFIG_QUOTA_NETLINK_INTERFACE=y
490CONFIG_QFMT_V1=m505CONFIG_QFMT_V1=m
491CONFIG_QFMT_V2=m506CONFIG_QFMT_V2=m
@@ -551,7 +566,6 @@ CONFIG_UNUSED_SYMBOLS=y · 59 unmodified lines
551CONFIG_MAGIC_SYSRQ=y566CONFIG_MAGIC_SYSRQ=y
552CONFIG_DEBUG_MEMORY_INIT=y567CONFIG_DEBUG_MEMORY_INIT=y
553CONFIG_PANIC_ON_OOPS=y568CONFIG_PANIC_ON_OOPS=y
554CONFIG_TIMER_STATS=y
555CONFIG_RCU_TORTURE_TEST=m569CONFIG_RCU_TORTURE_TEST=m
556CONFIG_RCU_CPU_STALL_TIMEOUT=60570CONFIG_RCU_CPU_STALL_TIMEOUT=60
557CONFIG_LATENCYTOP=y571CONFIG_LATENCYTOP=y
@@ -574,6 +588,7 @@ CONFIG_BIG_KEYS=y · 16 unmodified lines
574CONFIG_ENCRYPTED_KEYS=m588CONFIG_ENCRYPTED_KEYS=m
575CONFIG_SECURITY=y589CONFIG_SECURITY=y
576CONFIG_SECURITY_NETWORK=y590CONFIG_SECURITY_NETWORK=y
591CONFIG_HARDENED_USERCOPY=y
577CONFIG_SECURITY_SELINUX=y592CONFIG_SECURITY_SELINUX=y
578CONFIG_SECURITY_SELINUX_BOOTPARAM=y593CONFIG_SECURITY_SELINUX_BOOTPARAM=y
579CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=0594CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=0
@@ -597,6 +612,7 @@ CONFIG_CRYPTO_CHACHA20POLY1305=m · 17 unmodified lines
597CONFIG_CRYPTO_LRW=m612CONFIG_CRYPTO_LRW=m
598CONFIG_CRYPTO_PCBC=m613CONFIG_CRYPTO_PCBC=m
599CONFIG_CRYPTO_KEYWRAP=m614CONFIG_CRYPTO_KEYWRAP=m
615CONFIG_CRYPTO_CMAC=m
600CONFIG_CRYPTO_XCBC=m616CONFIG_CRYPTO_XCBC=m
601CONFIG_CRYPTO_VMAC=m617CONFIG_CRYPTO_VMAC=m
602CONFIG_CRYPTO_CRC32=m618CONFIG_CRYPTO_CRC32=m
@@ -609,6 +625,7 @@ CONFIG_CRYPTO_SHA512=m · 6 unmodified lines
609CONFIG_CRYPTO_SHA3=m625CONFIG_CRYPTO_SHA3=m
610CONFIG_CRYPTO_TGR192=m626CONFIG_CRYPTO_TGR192=m
611CONFIG_CRYPTO_WP512=m627CONFIG_CRYPTO_WP512=m
628CONFIG_CRYPTO_AES_TI=m
612CONFIG_CRYPTO_ANUBIS=m629CONFIG_CRYPTO_ANUBIS=m
613CONFIG_CRYPTO_BLOWFISH=m630CONFIG_CRYPTO_BLOWFISH=m
614CONFIG_CRYPTO_CAMELLIA=m631CONFIG_CRYPTO_CAMELLIA=m
@@ -624,6 +641,7 @@ CONFIG_CRYPTO_TWOFISH=m · 9 unmodified lines
624CONFIG_CRYPTO_842=m641CONFIG_CRYPTO_842=m
625CONFIG_CRYPTO_LZ4=m642CONFIG_CRYPTO_LZ4=m
626CONFIG_CRYPTO_LZ4HC=m643CONFIG_CRYPTO_LZ4HC=m
644CONFIG_CRYPTO_ANSI_CPRNG=m
627CONFIG_CRYPTO_USER_API_HASH=m645CONFIG_CRYPTO_USER_API_HASH=m
628CONFIG_CRYPTO_USER_API_SKCIPHER=m646CONFIG_CRYPTO_USER_API_SKCIPHER=m
629CONFIG_CRYPTO_USER_API_RNG=m647CONFIG_CRYPTO_USER_API_RNG=m
@@ -635,6 +653,7 @@ CONFIG_CRYPTO_SHA256_S390=m · 5 unmodified lines
635CONFIG_CRYPTO_SHA512_S390=m653CONFIG_CRYPTO_SHA512_S390=m
636CONFIG_CRYPTO_DES_S390=m654CONFIG_CRYPTO_DES_S390=m
637CONFIG_CRYPTO_AES_S390=m655CONFIG_CRYPTO_AES_S390=m
656CONFIG_CRYPTO_PAES_S390=m
638CONFIG_CRYPTO_GHASH_S390=m657CONFIG_CRYPTO_GHASH_S390=m
639CONFIG_CRYPTO_CRC32_S390=y658CONFIG_CRYPTO_CRC32_S390=y
640CONFIG_CRC7=m659CONFIG_CRC7=m
arch/s390/configs/zfcpdump_defconfig+4−2
@@ -12,8 +12,10 @@ CONFIG_TUNE_ZEC12=y · 11 unmodified lines
12CONFIG_NR_CPUS=212CONFIG_NR_CPUS=2
13# CONFIG_HOTPLUG_CPU is not set13# CONFIG_HOTPLUG_CPU is not set
14CONFIG_HZ_100=y14CONFIG_HZ_100=y
15# CONFIG_ARCH_RANDOM is not set
15# CONFIG_COMPACTION is not set16# CONFIG_COMPACTION is not set
16# CONFIG_MIGRATION is not set17# CONFIG_MIGRATION is not set
18# CONFIG_BOUNCE is not set
17# CONFIG_CHECK_STACK is not set19# CONFIG_CHECK_STACK is not set
18# CONFIG_CHSC_SCH is not set20# CONFIG_CHSC_SCH is not set
19# CONFIG_SCM_BUS is not set21# CONFIG_SCM_BUS is not set
@@ -36,11 +38,11 @@ CONFIG_SCSI_CONSTANTS=y · 16 unmodified lines
36CONFIG_SCSI_LOGGING=y38CONFIG_SCSI_LOGGING=y
37CONFIG_SCSI_FC_ATTRS=y39CONFIG_SCSI_FC_ATTRS=y
38CONFIG_ZFCP=y40CONFIG_ZFCP=y
39# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
40# CONFIG_INPUT_KEYBOARD is not set41# CONFIG_INPUT_KEYBOARD is not set
41# CONFIG_INPUT_MOUSE is not set42# CONFIG_INPUT_MOUSE is not set
42# CONFIG_SERIO is not set43# CONFIG_SERIO is not set
43# CONFIG_HVC_IUCV is not set44# CONFIG_HVC_IUCV is not set
45# CONFIG_HW_RANDOM_S390 is not set
44CONFIG_RAW_DRIVER=y46CONFIG_RAW_DRIVER=y
45# CONFIG_SCLP_ASYNC is not set47# CONFIG_SCLP_ASYNC is not set
46# CONFIG_HMC_DRV is not set48# CONFIG_HMC_DRV is not set
@@ -54,9 +56,9 @@ CONFIG_RAW_DRIVER=y · 7 unmodified lines
54# CONFIG_INOTIFY_USER is not set56# CONFIG_INOTIFY_USER is not set
55CONFIG_CONFIGFS_FS=y57CONFIG_CONFIGFS_FS=y
56# CONFIG_MISC_FILESYSTEMS is not set58# CONFIG_MISC_FILESYSTEMS is not set
59# CONFIG_NETWORK_FILESYSTEMS is not set
57CONFIG_PRINTK_TIME=y60CONFIG_PRINTK_TIME=y
58CONFIG_DEBUG_INFO=y61CONFIG_DEBUG_INFO=y
59CONFIG_DEBUG_FS=y
60CONFIG_DEBUG_KERNEL=y62CONFIG_DEBUG_KERNEL=y
61CONFIG_PANIC_ON_OOPS=y63CONFIG_PANIC_ON_OOPS=y
62# CONFIG_SCHED_DEBUG is not set64# CONFIG_SCHED_DEBUG is not set
arch/s390/defconfig+3−5
@@ -28,6 +28,7 @@ CONFIG_NAMESPACES=y · 27 unmodified lines
28CONFIG_USER_NS=y28CONFIG_USER_NS=y
29CONFIG_BLK_DEV_INITRD=y29CONFIG_BLK_DEV_INITRD=y
30CONFIG_EXPERT=y30CONFIG_EXPERT=y
31# CONFIG_SYSFS_SYSCALL is not set
31CONFIG_BPF_SYSCALL=y32CONFIG_BPF_SYSCALL=y
32CONFIG_USERFAULTFD=y33CONFIG_USERFAULTFD=y
33# CONFIG_COMPAT_BRK is not set34# CONFIG_COMPAT_BRK is not set
@@ -108,7 +109,6 @@ CONFIG_ZFCP=y · 74 unmodified lines
108CONFIG_SCSI_VIRTIO=y109CONFIG_SCSI_VIRTIO=y
109CONFIG_MD=y110CONFIG_MD=y
110CONFIG_MD_LINEAR=m111CONFIG_MD_LINEAR=m
111CONFIG_MD_RAID0=m
112CONFIG_MD_MULTIPATH=m112CONFIG_MD_MULTIPATH=m
113CONFIG_BLK_DEV_DM=y113CONFIG_BLK_DEV_DM=y
114CONFIG_DM_CRYPT=m114CONFIG_DM_CRYPT=m
@@ -131,6 +131,7 @@ CONFIG_TUN=m · 16 unmodified lines
131CONFIG_VIRTIO_NET=y131CONFIG_VIRTIO_NET=y
132# CONFIG_NET_VENDOR_ALACRITECH is not set132# CONFIG_NET_VENDOR_ALACRITECH is not set
133# CONFIG_NET_VENDOR_SOLARFLARE is not set133# CONFIG_NET_VENDOR_SOLARFLARE is not set
134# CONFIG_NET_VENDOR_SYNOPSYS is not set
134# CONFIG_INPUT is not set135# CONFIG_INPUT is not set
135# CONFIG_SERIO is not set136# CONFIG_SERIO is not set
136CONFIG_DEVKMEM=y137CONFIG_DEVKMEM=y
@@ -162,7 +163,6 @@ CONFIG_MAGIC_SYSRQ=y · 25 unmodified lines
162CONFIG_DEBUG_PAGEALLOC=y163CONFIG_DEBUG_PAGEALLOC=y
163CONFIG_DETECT_HUNG_TASK=y164CONFIG_DETECT_HUNG_TASK=y
164CONFIG_PANIC_ON_OOPS=y165CONFIG_PANIC_ON_OOPS=y
165CONFIG_TIMER_STATS=y
166CONFIG_DEBUG_RT_MUTEXES=y166CONFIG_DEBUG_RT_MUTEXES=y
167CONFIG_PROVE_LOCKING=y167CONFIG_PROVE_LOCKING=y
168CONFIG_LOCK_STAT=y168CONFIG_LOCK_STAT=y
@@ -172,14 +172,12 @@ CONFIG_DEBUG_LIST=y · 3 unmodified lines
172CONFIG_DEBUG_SG=y172CONFIG_DEBUG_SG=y
173CONFIG_DEBUG_NOTIFIERS=y173CONFIG_DEBUG_NOTIFIERS=y
174CONFIG_RCU_CPU_STALL_TIMEOUT=60174CONFIG_RCU_CPU_STALL_TIMEOUT=60
175CONFIG_RCU_TRACE=y
176CONFIG_LATENCYTOP=y175CONFIG_LATENCYTOP=y
177CONFIG_SCHED_TRACER=y176CONFIG_SCHED_TRACER=y
178CONFIG_FTRACE_SYSCALLS=y177CONFIG_FTRACE_SYSCALLS=y
179CONFIG_TRACER_SNAPSHOT_PER_CPU_SWAP=y178CONFIG_TRACER_SNAPSHOT_PER_CPU_SWAP=y
180CONFIG_STACK_TRACER=y179CONFIG_STACK_TRACER=y
181CONFIG_BLK_DEV_IO_TRACE=y180CONFIG_BLK_DEV_IO_TRACE=y
182CONFIG_UPROBE_EVENTS=y
183CONFIG_FUNCTION_PROFILER=y181CONFIG_FUNCTION_PROFILER=y
184CONFIG_TRACE_ENUM_MAP_FILE=y182CONFIG_TRACE_ENUM_MAP_FILE=y
185CONFIG_KPROBES_SANITY_TEST=y183CONFIG_KPROBES_SANITY_TEST=y
@@ -190,7 +188,6 @@ CONFIG_CRYPTO_CCM=m · 4 unmodified lines
190CONFIG_CRYPTO_GCM=m188CONFIG_CRYPTO_GCM=m
191CONFIG_CRYPTO_CBC=y189CONFIG_CRYPTO_CBC=y
192CONFIG_CRYPTO_CTS=m190CONFIG_CRYPTO_CTS=m
193CONFIG_CRYPTO_ECB=m
194CONFIG_CRYPTO_LRW=m191CONFIG_CRYPTO_LRW=m
195CONFIG_CRYPTO_PCBC=m192CONFIG_CRYPTO_PCBC=m
196CONFIG_CRYPTO_XTS=m193CONFIG_CRYPTO_XTS=m
@@ -230,6 +227,7 @@ CONFIG_CRYPTO_USER_API_SKCIPHER=m · 33 unmodified lines
230CONFIG_CRYPTO_USER_API_RNG=m227CONFIG_CRYPTO_USER_API_RNG=m
231CONFIG_ZCRYPT=m228CONFIG_ZCRYPT=m
232CONFIG_PKEY=m229CONFIG_PKEY=m
230CONFIG_CRYPTO_PAES_S390=m
233CONFIG_CRYPTO_SHA1_S390=m231CONFIG_CRYPTO_SHA1_S390=m
234CONFIG_CRYPTO_SHA256_S390=m232CONFIG_CRYPTO_SHA256_S390=m
235CONFIG_CRYPTO_SHA512_S390=m233CONFIG_CRYPTO_SHA512_S390=m
arch/s390/include/asm/kvm_host.h+0−1
@@ -541,7 +541,6 @@ struct kvm_s390_float_interrupt { · 540 unmodified lines
541 struct mutex ais_lock;541 struct mutex ais_lock;
542 u8 simm;542 u8 simm;
543 u8 nimm;543 u8 nimm;
544 int ais_enabled;
545};544};
546 545
547struct kvm_hw_wp_info_arch {546struct kvm_hw_wp_info_arch {
arch/s390/kernel/entry.S+13−6
@@ -231,12 +231,17 @@ ENTRY(sie64a) · 230 unmodified lines
231 lctlg %c1,%c1,__LC_USER_ASCE # load primary asce231 lctlg %c1,%c1,__LC_USER_ASCE # load primary asce
232.Lsie_done:232.Lsie_done:
233# some program checks are suppressing. C code (e.g. do_protection_exception)233# some program checks are suppressing. C code (e.g. do_protection_exception)
234# will rewind the PSW by the ILC, which is 4 bytes in case of SIE. Other234# will rewind the PSW by the ILC, which is often 4 bytes in case of SIE. There
235# instructions between sie64a and .Lsie_done should not cause program235# are some corner cases (e.g. runtime instrumentation) where ILC is unpredictable.
236# interrupts. So lets use a nop (47 00 00 00) as a landing pad.236# Other instructions between sie64a and .Lsie_done should not cause program
237# interrupts. So lets use 3 nops as a landing pad for all possible rewinds.
237# See also .Lcleanup_sie238# See also .Lcleanup_sie
238.Lrewind_pad:239.Lrewind_pad6:
239 nop 0240 nopr 7
241.Lrewind_pad4:
242 nopr 7
243.Lrewind_pad2:
244 nopr 7
240 .globl sie_exit245 .globl sie_exit
241sie_exit:246sie_exit:
242 lg %r14,__SF_EMPTY+8(%r15) # load guest register save area247 lg %r14,__SF_EMPTY+8(%r15) # load guest register save area
@@ -249,7 +254,9 @@ sie_exit: · 6 unmodified lines
249 stg %r14,__SF_EMPTY+16(%r15) # set exit reason code254 stg %r14,__SF_EMPTY+16(%r15) # set exit reason code
250 j sie_exit255 j sie_exit
251 256
252 EX_TABLE(.Lrewind_pad,.Lsie_fault)257 EX_TABLE(.Lrewind_pad6,.Lsie_fault)
258 EX_TABLE(.Lrewind_pad4,.Lsie_fault)
259 EX_TABLE(.Lrewind_pad2,.Lsie_fault)
253 EX_TABLE(sie_exit,.Lsie_fault)260 EX_TABLE(sie_exit,.Lsie_fault)
254EXPORT_SYMBOL(sie64a)261EXPORT_SYMBOL(sie64a)
255EXPORT_SYMBOL(sie_exit)262EXPORT_SYMBOL(sie_exit)
arch/s390/kvm/interrupt.c+2−2
@@ -2160,7 +2160,7 @@ static int modify_ais_mode(struct kvm *kvm, struct kvm_device_attr *attr) · 2159 unmodified lines
2160 struct kvm_s390_ais_req req;2160 struct kvm_s390_ais_req req;
2161 int ret = 0;2161 int ret = 0;
2162 2162
2163 if (!fi->ais_enabled)2163 if (!test_kvm_facility(kvm, 72))
2164 return -ENOTSUPP;2164 return -ENOTSUPP;
2165 2165
2166 if (copy_from_user(&req, (void __user *)attr->addr, sizeof(req)))2166 if (copy_from_user(&req, (void __user *)attr->addr, sizeof(req)))
@@ -2204,7 +2204,7 @@ static int kvm_s390_inject_airq(struct kvm *kvm, · 37 unmodified lines
2204 };2204 };
2205 int ret = 0;2205 int ret = 0;
2206 2206
2207 if (!fi->ais_enabled || !adapter->suppressible)2207 if (!test_kvm_facility(kvm, 72) || !adapter->suppressible)
2208 return kvm_s390_inject_vm(kvm, &s390int);2208 return kvm_s390_inject_vm(kvm, &s390int);
2209 2209
2210 mutex_lock(&fi->ais_lock);2210 mutex_lock(&fi->ais_lock);
arch/s390/kvm/kvm-s390.c+0−2
@@ -558,7 +558,6 @@ static int kvm_vm_ioctl_enable_cap(struct kvm *kvm, struct kvm_enable_cap *cap) · 557 unmodified lines
558 } else {558 } else {
559 set_kvm_facility(kvm->arch.model.fac_mask, 72);559 set_kvm_facility(kvm->arch.model.fac_mask, 72);
560 set_kvm_facility(kvm->arch.model.fac_list, 72);560 set_kvm_facility(kvm->arch.model.fac_list, 72);
561 kvm->arch.float_int.ais_enabled = 1;
562 r = 0;561 r = 0;
563 }562 }
564 mutex_unlock(&kvm->lock);563 mutex_unlock(&kvm->lock);
@@ -1533,7 +1532,6 @@ int kvm_arch_init_vm(struct kvm *kvm, unsigned long type) · 968 unmodified lines
1533 mutex_init(&kvm->arch.float_int.ais_lock);1532 mutex_init(&kvm->arch.float_int.ais_lock);
1534 kvm->arch.float_int.simm = 0;1533 kvm->arch.float_int.simm = 0;
1535 kvm->arch.float_int.nimm = 0;1534 kvm->arch.float_int.nimm = 0;
1536 kvm->arch.float_int.ais_enabled = 0;
1537 spin_lock_init(&kvm->arch.float_int.lock);1535 spin_lock_init(&kvm->arch.float_int.lock);
1538 for (i = 0; i < FIRQ_LIST_COUNT; i++)1536 for (i = 0; i < FIRQ_LIST_COUNT; i++)
1539 INIT_LIST_HEAD(&kvm->arch.float_int.lists[i]);1537 INIT_LIST_HEAD(&kvm->arch.float_int.lists[i]);
arch/s390/mm/mmap.c+2−2
@@ -101,7 +101,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, · 100 unmodified lines
101 addr = PAGE_ALIGN(addr);101 addr = PAGE_ALIGN(addr);
102 vma = find_vma(mm, addr);102 vma = find_vma(mm, addr);
103 if (TASK_SIZE - len >= addr && addr >= mmap_min_addr &&103 if (TASK_SIZE - len >= addr && addr >= mmap_min_addr &&
104 (!vma || addr + len <= vma->vm_start))104 (!vma || addr + len <= vm_start_gap(vma)))
105 goto check_asce_limit;105 goto check_asce_limit;
106 }106 }
107 107
@@ -151,7 +151,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, · 43 unmodified lines
151 addr = PAGE_ALIGN(addr);151 addr = PAGE_ALIGN(addr);
152 vma = find_vma(mm, addr);152 vma = find_vma(mm, addr);
153 if (TASK_SIZE - len >= addr && addr >= mmap_min_addr &&153 if (TASK_SIZE - len >= addr && addr >= mmap_min_addr &&
154 (!vma || addr + len <= vma->vm_start))154 (!vma || addr + len <= vm_start_gap(vma)))
155 goto check_asce_limit;155 goto check_asce_limit;
156 }156 }
157 157
arch/sh/mm/mmap.c+2−2
@@ -64,7 +64,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, · 63 unmodified lines
64 64
65 vma = find_vma(mm, addr);65 vma = find_vma(mm, addr);
66 if (TASK_SIZE - len >= addr &&66 if (TASK_SIZE - len >= addr &&
67 (!vma || addr + len <= vma->vm_start))67 (!vma || addr + len <= vm_start_gap(vma)))
68 return addr;68 return addr;
69 }69 }
70 70
@@ -114,7 +114,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, · 43 unmodified lines
114 114
115 vma = find_vma(mm, addr);115 vma = find_vma(mm, addr);
116 if (TASK_SIZE - len >= addr &&116 if (TASK_SIZE - len >= addr &&
117 (!vma || addr + len <= vma->vm_start))117 (!vma || addr + len <= vm_start_gap(vma)))
118 return addr;118 return addr;
119 }119 }
120 120
arch/sparc/Kconfig+8−7
@@ -192,9 +192,9 @@ config NR_CPUS · 191 unmodified lines
192 int "Maximum number of CPUs"192 int "Maximum number of CPUs"
193 depends on SMP193 depends on SMP
194 range 2 32 if SPARC32194 range 2 32 if SPARC32
195 range 2 1024 if SPARC64195 range 2 4096 if SPARC64
196 default 32 if SPARC32196 default 32 if SPARC32
197 default 64 if SPARC64197 default 4096 if SPARC64
198 198
199source kernel/Kconfig.hz199source kernel/Kconfig.hz
200 200
@@ -295,9 +295,13 @@ config NUMA · 94 unmodified lines
295 depends on SPARC64 && SMP295 depends on SPARC64 && SMP
296 296
297config NODES_SHIFT297config NODES_SHIFT
298 int298 int "Maximum NUMA Nodes (as a power of 2)"
299 default "4"299 range 4 5 if SPARC64
300 default "5"
300 depends on NEED_MULTIPLE_NODES301 depends on NEED_MULTIPLE_NODES
302 help
303 Specify the maximum number of NUMA Nodes available on the target
304 system. Increases memory reserved to accommodate various tables.
301 305
302# Some NUMA nodes have memory ranges that span306# Some NUMA nodes have memory ranges that span
303# other nodes. Even though a pfn is valid and307# other nodes. Even though a pfn is valid and
@@ -573,9 +577,6 @@ config SYSVIPC_COMPAT · 269 unmodified lines
573 depends on COMPAT && SYSVIPC577 depends on COMPAT && SYSVIPC
574 default y578 default y
575 579
576config KEYS_COMPAT
577 def_bool y if COMPAT && KEYS
578
579endmenu580endmenu
580 581
581source "net/Kconfig"582source "net/Kconfig"
arch/sparc/include/asm/mmu_64.h+1−1
@@ -52,7 +52,7 @@ · 51 unmodified lines
52#define CTX_NR_MASK TAG_CONTEXT_BITS52#define CTX_NR_MASK TAG_CONTEXT_BITS
53#define CTX_HW_MASK (CTX_NR_MASK | CTX_PGSZ_MASK)53#define CTX_HW_MASK (CTX_NR_MASK | CTX_PGSZ_MASK)
54 54
55#define CTX_FIRST_VERSION ((_AC(1,UL) << CTX_VERSION_SHIFT) + _AC(1,UL))55#define CTX_FIRST_VERSION BIT(CTX_VERSION_SHIFT)
56#define CTX_VALID(__ctx) \56#define CTX_VALID(__ctx) \
57 (!(((__ctx.sparc64_ctx_val) ^ tlb_context_cache) & CTX_VERSION_MASK))57 (!(((__ctx.sparc64_ctx_val) ^ tlb_context_cache) & CTX_VERSION_MASK))
58#define CTX_HWBITS(__ctx) ((__ctx.sparc64_ctx_val) & CTX_HW_MASK)58#define CTX_HWBITS(__ctx) ((__ctx.sparc64_ctx_val) & CTX_HW_MASK)
arch/sparc/include/asm/mmu_context_64.h+4−28
@@ -19,13 +19,8 @@ extern spinlock_t ctx_alloc_lock; · 18 unmodified lines
19extern unsigned long tlb_context_cache;19extern unsigned long tlb_context_cache;
20extern unsigned long mmu_context_bmap[];20extern unsigned long mmu_context_bmap[];
21 21
22DECLARE_PER_CPU(struct mm_struct *, per_cpu_secondary_mm);
22void get_new_mmu_context(struct mm_struct *mm);23void get_new_mmu_context(struct mm_struct *mm);
23#ifdef CONFIG_SMP
24void smp_new_mmu_context_version(void);
25#else
26#define smp_new_mmu_context_version() do { } while (0)
27#endif
28
29int init_new_context(struct task_struct *tsk, struct mm_struct *mm);24int init_new_context(struct task_struct *tsk, struct mm_struct *mm);
30void destroy_context(struct mm_struct *mm);25void destroy_context(struct mm_struct *mm);
31 26
@@ -76,8 +71,9 @@ void __flush_tlb_mm(unsigned long, unsigned long); · 44 unmodified lines
76static inline void switch_mm(struct mm_struct *old_mm, struct mm_struct *mm, struct task_struct *tsk)71static inline void switch_mm(struct mm_struct *old_mm, struct mm_struct *mm, struct task_struct *tsk)
77{72{
78 unsigned long ctx_valid, flags;73 unsigned long ctx_valid, flags;
79 int cpu;74 int cpu = smp_processor_id();
80 75
76 per_cpu(per_cpu_secondary_mm, cpu) = mm;
81 if (unlikely(mm == &init_mm))77 if (unlikely(mm == &init_mm))
82 return;78 return;
83 79
@@ -123,7 +119,6 @@ static inline void switch_mm(struct mm_struct *old_mm, struct mm_struct *mm, str · 39 unmodified lines
123 * for the first time, we must flush that context out of the119 * for the first time, we must flush that context out of the
124 * local TLB.120 * local TLB.
125 */121 */
126 cpu = smp_processor_id();
127 if (!ctx_valid || !cpumask_test_cpu(cpu, mm_cpumask(mm))) {122 if (!ctx_valid || !cpumask_test_cpu(cpu, mm_cpumask(mm))) {
128 cpumask_set_cpu(cpu, mm_cpumask(mm));123 cpumask_set_cpu(cpu, mm_cpumask(mm));
129 __flush_tlb_mm(CTX_HWBITS(mm->context),124 __flush_tlb_mm(CTX_HWBITS(mm->context),
@@ -133,26 +128,7 @@ static inline void switch_mm(struct mm_struct *old_mm, struct mm_struct *mm, str · 3 unmodified lines
133}128}
134 129
135#define deactivate_mm(tsk,mm) do { } while (0)130#define deactivate_mm(tsk,mm) do { } while (0)
136 131#define activate_mm(active_mm, mm) switch_mm(active_mm, mm, NULL)
137/* Activate a new MM instance for the current task. */
138static inline void activate_mm(struct mm_struct *active_mm, struct mm_struct *mm)
139{
140 unsigned long flags;
141 int cpu;
142
143 spin_lock_irqsave(&mm->context.lock, flags);
144 if (!CTX_VALID(mm->context))
145 get_new_mmu_context(mm);
146 cpu = smp_processor_id();
147 if (!cpumask_test_cpu(cpu, mm_cpumask(mm)))
148 cpumask_set_cpu(cpu, mm_cpumask(mm));
149
150 load_secondary_context(mm);
151 __flush_tlb_mm(CTX_HWBITS(mm->context), SECONDARY_CONTEXT);
152 tsb_context_switch(mm);
153 spin_unlock_irqrestore(&mm->context.lock, flags);
154}
155
156#endif /* !(__ASSEMBLY__) */132#endif /* !(__ASSEMBLY__) */
157 133
158#endif /* !(__SPARC64_MMU_CONTEXT_H) */134#endif /* !(__SPARC64_MMU_CONTEXT_H) */
arch/sparc/include/asm/pil.h+0−1
@@ -20,7 +20,6 @@ · 19 unmodified lines
20#define PIL_SMP_CALL_FUNC 120#define PIL_SMP_CALL_FUNC 1
21#define PIL_SMP_RECEIVE_SIGNAL 221#define PIL_SMP_RECEIVE_SIGNAL 2
22#define PIL_SMP_CAPTURE 322#define PIL_SMP_CAPTURE 3
23#define PIL_SMP_CTX_NEW_VERSION 4
24#define PIL_DEVICE_IRQ 523#define PIL_DEVICE_IRQ 5
25#define PIL_SMP_CALL_FUNC_SNGL 624#define PIL_SMP_CALL_FUNC_SNGL 6
26#define PIL_DEFERRED_PCR_WORK 725#define PIL_DEFERRED_PCR_WORK 7
arch/sparc/include/asm/vio.h+1−0
@@ -327,6 +327,7 @@ struct vio_dev { · 326 unmodified lines
327 int compat_len;327 int compat_len;
328 328
329 u64 dev_no;329 u64 dev_no;
330 u64 id;
330 331
331 unsigned long channel_id;332 unsigned long channel_id;
332 333
arch/sparc/kernel/ds.c+1−1
@@ -909,7 +909,7 @@ static int register_services(struct ds_info *dp) · 908 unmodified lines
909 pbuf.req.handle = cp->handle;909 pbuf.req.handle = cp->handle;
910 pbuf.req.major = 1;910 pbuf.req.major = 1;
911 pbuf.req.minor = 0;911 pbuf.req.minor = 0;
912 strcpy(pbuf.req.svc_id, cp->service_id);912 strcpy(pbuf.id_buf, cp->service_id);
913 913
914 err = __ds_send(lp, &pbuf, msg_len);914 err = __ds_send(lp, &pbuf, msg_len);
915 if (err > 0)915 if (err > 0)
arch/sparc/kernel/irq_64.c+13−4
@@ -1034,17 +1034,26 @@ static void __init init_cpu_send_mondo_info(struct trap_per_cpu *tb) · 1033 unmodified lines
1034{1034{
1035#ifdef CONFIG_SMP1035#ifdef CONFIG_SMP
1036 unsigned long page;1036 unsigned long page;
1037 void *mondo, *p;
1037 1038
1038 BUILD_BUG_ON((NR_CPUS * sizeof(u16)) > (PAGE_SIZE - 64));1039 BUILD_BUG_ON((NR_CPUS * sizeof(u16)) > PAGE_SIZE);
1040
1041 /* Make sure mondo block is 64byte aligned */
1042 p = kzalloc(127, GFP_KERNEL);
1043 if (!p) {
1044 prom_printf("SUN4V: Error, cannot allocate mondo block.\n");
1045 prom_halt();
1046 }
1047 mondo = (void *)(((unsigned long)p + 63) & ~0x3f);
1048 tb->cpu_mondo_block_pa = __pa(mondo);
1039 1049
1040 page = get_zeroed_page(GFP_KERNEL);1050 page = get_zeroed_page(GFP_KERNEL);
1041 if (!page) {1051 if (!page) {
1042 prom_printf("SUN4V: Error, cannot allocate cpu mondo page.\n");1052 prom_printf("SUN4V: Error, cannot allocate cpu list page.\n");
1043 prom_halt();1053 prom_halt();
1044 }1054 }
1045 1055
1046 tb->cpu_mondo_block_pa = __pa(page);1056 tb->cpu_list_pa = __pa(page);
1047 tb->cpu_list_pa = __pa(page + 64);
1048#endif1057#endif
1049}1058}
1050 1059
arch/sparc/kernel/kernel.h+0−1
@@ -37,7 +37,6 @@ void handle_stdfmna(struct pt_regs *regs, unsigned long sfar, unsigned long sfsr · 36 unmodified lines
37/* smp_64.c */37/* smp_64.c */
38void __irq_entry smp_call_function_client(int irq, struct pt_regs *regs);38void __irq_entry smp_call_function_client(int irq, struct pt_regs *regs);
39void __irq_entry smp_call_function_single_client(int irq, struct pt_regs *regs);39void __irq_entry smp_call_function_single_client(int irq, struct pt_regs *regs);
40void __irq_entry smp_new_mmu_context_version_client(int irq, struct pt_regs *regs);
41void __irq_entry smp_penguin_jailcell(int irq, struct pt_regs *regs);40void __irq_entry smp_penguin_jailcell(int irq, struct pt_regs *regs);
42void __irq_entry smp_receive_signal_client(int irq, struct pt_regs *regs);41void __irq_entry smp_receive_signal_client(int irq, struct pt_regs *regs);
43 42
arch/sparc/kernel/smp_64.c+0−31
@@ -964,37 +964,6 @@ void flush_dcache_page_all(struct mm_struct *mm, struct page *page) · 963 unmodified lines
964 preempt_enable();964 preempt_enable();
965}965}
966 966
967void __irq_entry smp_new_mmu_context_version_client(int irq, struct pt_regs *regs)
968{
969 struct mm_struct *mm;
970 unsigned long flags;
971
972 clear_softint(1 << irq);
973
974 /* See if we need to allocate a new TLB context because
975 * the version of the one we are using is now out of date.
976 */
977 mm = current->active_mm;
978 if (unlikely(!mm || (mm == &init_mm)))
979 return;
980
981 spin_lock_irqsave(&mm->context.lock, flags);
982
983 if (unlikely(!CTX_VALID(mm->context)))
984 get_new_mmu_context(mm);
985
986 spin_unlock_irqrestore(&mm->context.lock, flags);
987
988 load_secondary_context(mm);
989 __flush_tlb_mm(CTX_HWBITS(mm->context),
990 SECONDARY_CONTEXT);
991}
992
993void smp_new_mmu_context_version(void)
994{
995 smp_cross_call(&xcall_new_mmu_context_version, 0, 0, 0);
996}
997
998#ifdef CONFIG_KGDB967#ifdef CONFIG_KGDB
999void kgdb_roundup_cpus(unsigned long flags)968void kgdb_roundup_cpus(unsigned long flags)
1000{969{
arch/sparc/kernel/sys_sparc_64.c+2−2
@@ -120,7 +120,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, unsi · 119 unmodified lines
120 120
121 vma = find_vma(mm, addr);121 vma = find_vma(mm, addr);
122 if (task_size - len >= addr &&122 if (task_size - len >= addr &&
123 (!vma || addr + len <= vma->vm_start))123 (!vma || addr + len <= vm_start_gap(vma)))
124 return addr;124 return addr;
125 }125 }
126 126
@@ -183,7 +183,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, · 56 unmodified lines
183 183
184 vma = find_vma(mm, addr);184 vma = find_vma(mm, addr);
185 if (task_size - len >= addr &&185 if (task_size - len >= addr &&
186 (!vma || addr + len <= vma->vm_start))186 (!vma || addr + len <= vm_start_gap(vma)))
187 return addr;187 return addr;
188 }188 }
189 189
arch/sparc/kernel/tsb.S+7−4
@@ -455,13 +455,16 @@ __tsb_context_switch: · 454 unmodified lines
455 .type copy_tsb,#function455 .type copy_tsb,#function
456copy_tsb: /* %o0=old_tsb_base, %o1=old_tsb_size456copy_tsb: /* %o0=old_tsb_base, %o1=old_tsb_size
457 * %o2=new_tsb_base, %o3=new_tsb_size457 * %o2=new_tsb_base, %o3=new_tsb_size
458 * %o4=page_size_shift
458 */459 */
459 sethi %uhi(TSB_PASS_BITS), %g7460 sethi %uhi(TSB_PASS_BITS), %g7
460 srlx %o3, 4, %o3461 srlx %o3, 4, %o3
461 add %o0, %o1, %g1 /* end of old tsb */462 add %o0, %o1, %o1 /* end of old tsb */
462 sllx %g7, 32, %g7463 sllx %g7, 32, %g7
463 sub %o3, 1, %o3 /* %o3 == new tsb hash mask */464 sub %o3, 1, %o3 /* %o3 == new tsb hash mask */
464 465
466 mov %o4, %g1 /* page_size_shift */
467
465661: prefetcha [%o0] ASI_N, #one_read468661: prefetcha [%o0] ASI_N, #one_read
466 .section .tsb_phys_patch, "ax"469 .section .tsb_phys_patch, "ax"
467 .word 661b470 .word 661b
@@ -486,9 +489,9 @@ copy_tsb: /* %o0=old_tsb_base, %o1=old_tsb_size · 18 unmodified lines
486 /* This can definitely be computed faster... */489 /* This can definitely be computed faster... */
487 srlx %o0, 4, %o5 /* Build index */490 srlx %o0, 4, %o5 /* Build index */
488 and %o5, 511, %o5 /* Mask index */491 and %o5, 511, %o5 /* Mask index */
489 sllx %o5, PAGE_SHIFT, %o5 /* Put into vaddr position */492 sllx %o5, %g1, %o5 /* Put into vaddr position */
490 or %o4, %o5, %o4 /* Full VADDR. */493 or %o4, %o5, %o4 /* Full VADDR. */
491 srlx %o4, PAGE_SHIFT, %o4 /* Shift down to create index */494 srlx %o4, %g1, %o4 /* Shift down to create index */
492 and %o4, %o3, %o4 /* Mask with new_tsb_nents-1 */495 and %o4, %o3, %o4 /* Mask with new_tsb_nents-1 */
493 sllx %o4, 4, %o4 /* Shift back up into tsb ent offset */496 sllx %o4, 4, %o4 /* Shift back up into tsb ent offset */
494 TSB_STORE(%o2 + %o4, %g2) /* Store TAG */497 TSB_STORE(%o2 + %o4, %g2) /* Store TAG */
@@ -496,7 +499,7 @@ copy_tsb: /* %o0=old_tsb_base, %o1=old_tsb_size · 1 unmodified line
496 TSB_STORE(%o2 + %o4, %g3) /* Store TTE */499 TSB_STORE(%o2 + %o4, %g3) /* Store TTE */
497 500
49880: add %o0, 16, %o050180: add %o0, 16, %o0
499 cmp %o0, %g1502 cmp %o0, %o1
500 bne,pt %xcc, 90b503 bne,pt %xcc, 90b
501 nop504 nop
502 505
arch/sparc/kernel/ttable_64.S+1−1
@@ -50,7 +50,7 @@ tl0_resv03e: BTRAP(0x3e) BTRAP(0x3f) BTRAP(0x40) · 49 unmodified lines
50tl0_irq1: TRAP_IRQ(smp_call_function_client, 1)50tl0_irq1: TRAP_IRQ(smp_call_function_client, 1)
51tl0_irq2: TRAP_IRQ(smp_receive_signal_client, 2)51tl0_irq2: TRAP_IRQ(smp_receive_signal_client, 2)
52tl0_irq3: TRAP_IRQ(smp_penguin_jailcell, 3)52tl0_irq3: TRAP_IRQ(smp_penguin_jailcell, 3)
53tl0_irq4: TRAP_IRQ(smp_new_mmu_context_version_client, 4)53tl0_irq4: BTRAP(0x44)
54#else54#else
55tl0_irq1: BTRAP(0x41)55tl0_irq1: BTRAP(0x41)
56tl0_irq2: BTRAP(0x42)56tl0_irq2: BTRAP(0x42)
arch/sparc/kernel/vio.c+64−4
@@ -302,13 +302,16 @@ static struct vio_dev *vio_create_one(struct mdesc_handle *hp, u64 mp, · 301 unmodified lines
302 if (!id) {302 if (!id) {
303 dev_set_name(&vdev->dev, "%s", bus_id_name);303 dev_set_name(&vdev->dev, "%s", bus_id_name);
304 vdev->dev_no = ~(u64)0;304 vdev->dev_no = ~(u64)0;
305 vdev->id = ~(u64)0;
305 } else if (!cfg_handle) {306 } else if (!cfg_handle) {
306 dev_set_name(&vdev->dev, "%s-%llu", bus_id_name, *id);307 dev_set_name(&vdev->dev, "%s-%llu", bus_id_name, *id);
307 vdev->dev_no = *id;308 vdev->dev_no = *id;
309 vdev->id = ~(u64)0;
308 } else {310 } else {
309 dev_set_name(&vdev->dev, "%s-%llu-%llu", bus_id_name,311 dev_set_name(&vdev->dev, "%s-%llu-%llu", bus_id_name,
310 *cfg_handle, *id);312 *cfg_handle, *id);
311 vdev->dev_no = *cfg_handle;313 vdev->dev_no = *cfg_handle;
314 vdev->id = *id;
312 }315 }
313 316
314 vdev->dev.parent = parent;317 vdev->dev.parent = parent;
@@ -351,27 +354,84 @@ static void vio_add(struct mdesc_handle *hp, u64 node) · 36 unmodified lines
351 (void) vio_create_one(hp, node, &root_vdev->dev);354 (void) vio_create_one(hp, node, &root_vdev->dev);
352}355}
353 356
357struct vio_md_node_query {
358 const char *type;
359 u64 dev_no;
360 u64 id;
361};
362
354static int vio_md_node_match(struct device *dev, void *arg)363static int vio_md_node_match(struct device *dev, void *arg)
355{364{
365 struct vio_md_node_query *query = (struct vio_md_node_query *) arg;
356 struct vio_dev *vdev = to_vio_dev(dev);366 struct vio_dev *vdev = to_vio_dev(dev);
357 367
358 if (vdev->mp == (u64) arg)368 if (vdev->dev_no != query->dev_no)
359 return 1;369 return 0;
370 if (vdev->id != query->id)
371 return 0;
372 if (strcmp(vdev->type, query->type))
373 return 0;
360 374
361 return 0;375 return 1;
362}376}
363 377
364static void vio_remove(struct mdesc_handle *hp, u64 node)378static void vio_remove(struct mdesc_handle *hp, u64 node)
365{379{
380 const char *type;
381 const u64 *id, *cfg_handle;
382 u64 a;
383 struct vio_md_node_query query;
366 struct device *dev;384 struct device *dev;
367 385
368 dev = device_find_child(&root_vdev->dev, (void *) node,386 type = mdesc_get_property(hp, node, "device-type", NULL);
387 if (!type) {
388 type = mdesc_get_property(hp, node, "name", NULL);
389 if (!type)
390 type = mdesc_node_name(hp, node);
391 }
392
393 query.type = type;
394
395 id = mdesc_get_property(hp, node, "id", NULL);
396 cfg_handle = NULL;
397 mdesc_for_each_arc(a, hp, node, MDESC_ARC_TYPE_BACK) {
398 u64 target;
399
400 target = mdesc_arc_target(hp, a);
401 cfg_handle = mdesc_get_property(hp, target,
402 "cfg-handle", NULL);
403 if (cfg_handle)
404 break;
405 }
406
407 if (!id) {
408 query.dev_no = ~(u64)0;
409 query.id = ~(u64)0;
410 } else if (!cfg_handle) {
411 query.dev_no = *id;
412 query.id = ~(u64)0;
413 } else {
414 query.dev_no = *cfg_handle;
415 query.id = *id;
416 }
417
418 dev = device_find_child(&root_vdev->dev, &query,
369 vio_md_node_match);419 vio_md_node_match);
370 if (dev) {420 if (dev) {
371 printk(KERN_INFO "VIO: Removing device %s\n", dev_name(dev));421 printk(KERN_INFO "VIO: Removing device %s\n", dev_name(dev));
372 422
373 device_unregister(dev);423 device_unregister(dev);
374 put_device(dev);424 put_device(dev);
425 } else {
426 if (!id)
427 printk(KERN_ERR "VIO: Removed unknown %s node.\n",
428 type);
429 else if (!cfg_handle)
430 printk(KERN_ERR "VIO: Removed unknown %s node %llu.\n",
431 type, *id);
432 else
433 printk(KERN_ERR "VIO: Removed unknown %s node %llu-%llu.\n",
434 type, *cfg_handle, *id);
375 }435 }
376}436}
377 437
arch/sparc/lib/Makefile+1−0
@@ -15,6 +15,7 @@ lib-$(CONFIG_SPARC32) += copy_user.o locks.o · 14 unmodified lines
15lib-$(CONFIG_SPARC64) += atomic_64.o15lib-$(CONFIG_SPARC64) += atomic_64.o
16lib-$(CONFIG_SPARC32) += lshrdi3.o ashldi3.o16lib-$(CONFIG_SPARC32) += lshrdi3.o ashldi3.o
17lib-$(CONFIG_SPARC32) += muldi3.o bitext.o cmpdi2.o17lib-$(CONFIG_SPARC32) += muldi3.o bitext.o cmpdi2.o
18lib-$(CONFIG_SPARC64) += multi3.o
18 19
19lib-$(CONFIG_SPARC64) += copy_page.o clear_page.o bzero.o20lib-$(CONFIG_SPARC64) += copy_page.o clear_page.o bzero.o
20lib-$(CONFIG_SPARC64) += csum_copy.o csum_copy_from_user.o csum_copy_to_user.o21lib-$(CONFIG_SPARC64) += csum_copy.o csum_copy_from_user.o csum_copy_to_user.o
arch/sparc/lib/multi3.S+35−0
@@ -0,0 +1,35 @@
1#include <linux/linkage.h>
2#include <asm/export.h>
3
4 .text
5 .align 4
6ENTRY(__multi3) /* %o0 = u, %o1 = v */
7 mov %o1, %g1
8 srl %o3, 0, %g4
9 mulx %g4, %g1, %o1
10 srlx %g1, 0x20, %g3
11 mulx %g3, %g4, %g5
12 sllx %g5, 0x20, %o5
13 srl %g1, 0, %g4
14 sub %o1, %o5, %o5
15 srlx %o5, 0x20, %o5
16 addcc %g5, %o5, %g5
17 srlx %o3, 0x20, %o5
18 mulx %g4, %o5, %g4
19 mulx %g3, %o5, %o5
20 sethi %hi(0x80000000), %g3
21 addcc %g5, %g4, %g5
22 srlx %g5, 0x20, %g5
23 add %g3, %g3, %g3
24 movcc %xcc, %g0, %g3
25 addcc %o5, %g5, %o5
26 sllx %g4, 0x20, %g4
27 add %o1, %g4, %o1
28 add %o5, %g3, %g2
29 mulx %g1, %o2, %g1
30 add %g1, %g2, %g1
31 mulx %o0, %o3, %o0
32 retl
33 add %g1, %o0, %o0
34ENDPROC(__multi3)
35EXPORT_SYMBOL(__multi3)
arch/sparc/mm/hugetlbpage.c+1−1
@@ -120,7 +120,7 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr, · 119 unmodified lines
120 addr = ALIGN(addr, huge_page_size(h));120 addr = ALIGN(addr, huge_page_size(h));
121 vma = find_vma(mm, addr);121 vma = find_vma(mm, addr);
122 if (task_size - len >= addr &&122 if (task_size - len >= addr &&
123 (!vma || addr + len <= vma->vm_start))123 (!vma || addr + len <= vm_start_gap(vma)))
124 return addr;124 return addr;
125 }125 }
126 if (mm->get_unmapped_area == arch_get_unmapped_area)126 if (mm->get_unmapped_area == arch_get_unmapped_area)
arch/sparc/mm/init_64.c+60−29
@@ -358,7 +358,8 @@ static int __init setup_hugepagesz(char *string) · 357 unmodified lines
358 }358 }
359 359
360 if ((hv_pgsz_mask & cpu_pgsz_mask) == 0U) {360 if ((hv_pgsz_mask & cpu_pgsz_mask) == 0U) {
361 pr_warn("hugepagesz=%llu not supported by MMU.\n",361 hugetlb_bad_size();
362 pr_err("hugepagesz=%llu not supported by MMU.\n",
362 hugepage_size);363 hugepage_size);
363 goto out;364 goto out;
364 }365 }
@@ -706,10 +707,58 @@ EXPORT_SYMBOL(__flush_dcache_range); · 341 unmodified lines
706 707
707/* get_new_mmu_context() uses "cache + 1". */708/* get_new_mmu_context() uses "cache + 1". */
708DEFINE_SPINLOCK(ctx_alloc_lock);709DEFINE_SPINLOCK(ctx_alloc_lock);
709unsigned long tlb_context_cache = CTX_FIRST_VERSION - 1;710unsigned long tlb_context_cache = CTX_FIRST_VERSION;
710#define MAX_CTX_NR (1UL << CTX_NR_BITS)711#define MAX_CTX_NR (1UL << CTX_NR_BITS)
711#define CTX_BMAP_SLOTS BITS_TO_LONGS(MAX_CTX_NR)712#define CTX_BMAP_SLOTS BITS_TO_LONGS(MAX_CTX_NR)
712DECLARE_BITMAP(mmu_context_bmap, MAX_CTX_NR);713DECLARE_BITMAP(mmu_context_bmap, MAX_CTX_NR);
714DEFINE_PER_CPU(struct mm_struct *, per_cpu_secondary_mm) = {0};
715
716static void mmu_context_wrap(void)
717{
718 unsigned long old_ver = tlb_context_cache & CTX_VERSION_MASK;
719 unsigned long new_ver, new_ctx, old_ctx;
720 struct mm_struct *mm;
721 int cpu;
722
723 bitmap_zero(mmu_context_bmap, 1 << CTX_NR_BITS);
724
725 /* Reserve kernel context */
726 set_bit(0, mmu_context_bmap);
727
728 new_ver = (tlb_context_cache & CTX_VERSION_MASK) + CTX_FIRST_VERSION;
729 if (unlikely(new_ver == 0))
730 new_ver = CTX_FIRST_VERSION;
731 tlb_context_cache = new_ver;
732
733 /*
734 * Make sure that any new mm that are added into per_cpu_secondary_mm,
735 * are going to go through get_new_mmu_context() path.
736 */
737 mb();
738
739 /*
740 * Updated versions to current on those CPUs that had valid secondary
741 * contexts
742 */
743 for_each_online_cpu(cpu) {
744 /*
745 * If a new mm is stored after we took this mm from the array,
746 * it will go into get_new_mmu_context() path, because we
747 * already bumped the version in tlb_context_cache.
748 */
749 mm = per_cpu(per_cpu_secondary_mm, cpu);
750
751 if (unlikely(!mm || mm == &init_mm))
752 continue;
753
754 old_ctx = mm->context.sparc64_ctx_val;
755 if (likely((old_ctx & CTX_VERSION_MASK) == old_ver)) {
756 new_ctx = (old_ctx & ~CTX_VERSION_MASK) | new_ver;
757 set_bit(new_ctx & CTX_NR_MASK, mmu_context_bmap);
758 mm->context.sparc64_ctx_val = new_ctx;
759 }
760 }
761}
713 762
714/* Caller does TLB context flushing on local CPU if necessary.763/* Caller does TLB context flushing on local CPU if necessary.
715 * The caller also ensures that CTX_VALID(mm->context) is false.764 * The caller also ensures that CTX_VALID(mm->context) is false.
@@ -725,48 +774,30 @@ void get_new_mmu_context(struct mm_struct *mm) · 9 unmodified lines
725{774{
726 unsigned long ctx, new_ctx;775 unsigned long ctx, new_ctx;
727 unsigned long orig_pgsz_bits;776 unsigned long orig_pgsz_bits;
728 int new_version;
729 777
730 spin_lock(&ctx_alloc_lock);778 spin_lock(&ctx_alloc_lock);
779retry:
780 /* wrap might have happened, test again if our context became valid */
781 if (unlikely(CTX_VALID(mm->context)))
782 goto out;
731 orig_pgsz_bits = (mm->context.sparc64_ctx_val & CTX_PGSZ_MASK);783 orig_pgsz_bits = (mm->context.sparc64_ctx_val & CTX_PGSZ_MASK);
732 ctx = (tlb_context_cache + 1) & CTX_NR_MASK;784 ctx = (tlb_context_cache + 1) & CTX_NR_MASK;
733 new_ctx = find_next_zero_bit(mmu_context_bmap, 1 << CTX_NR_BITS, ctx);785 new_ctx = find_next_zero_bit(mmu_context_bmap, 1 << CTX_NR_BITS, ctx);
734 new_version = 0;
735 if (new_ctx >= (1 << CTX_NR_BITS)) {786 if (new_ctx >= (1 << CTX_NR_BITS)) {
736 new_ctx = find_next_zero_bit(mmu_context_bmap, ctx, 1);787 new_ctx = find_next_zero_bit(mmu_context_bmap, ctx, 1);
737 if (new_ctx >= ctx) {788 if (new_ctx >= ctx) {
738 int i;789 mmu_context_wrap();
739 new_ctx = (tlb_context_cache & CTX_VERSION_MASK) +790 goto retry;
740 CTX_FIRST_VERSION;
741 if (new_ctx == 1)
742 new_ctx = CTX_FIRST_VERSION;
743
744 /* Don't call memset, for 16 entries that's just
745 * plain silly...
746 */
747 mmu_context_bmap[0] = 3;
748 mmu_context_bmap[1] = 0;
749 mmu_context_bmap[2] = 0;
750 mmu_context_bmap[3] = 0;
751 for (i = 4; i < CTX_BMAP_SLOTS; i += 4) {
752 mmu_context_bmap[i + 0] = 0;
753 mmu_context_bmap[i + 1] = 0;
754 mmu_context_bmap[i + 2] = 0;
755 mmu_context_bmap[i + 3] = 0;
756 }
757 new_version = 1;
758 goto out;
759 }791 }
760 }792 }
793 if (mm->context.sparc64_ctx_val)
794 cpumask_clear(mm_cpumask(mm));
761 mmu_context_bmap[new_ctx>>6] |= (1UL << (new_ctx & 63));795 mmu_context_bmap[new_ctx>>6] |= (1UL << (new_ctx & 63));
762 new_ctx |= (tlb_context_cache & CTX_VERSION_MASK);796 new_ctx |= (tlb_context_cache & CTX_VERSION_MASK);
763out:
764 tlb_context_cache = new_ctx;797 tlb_context_cache = new_ctx;
765 mm->context.sparc64_ctx_val = new_ctx | orig_pgsz_bits;798 mm->context.sparc64_ctx_val = new_ctx | orig_pgsz_bits;
799out:
766 spin_unlock(&ctx_alloc_lock);800 spin_unlock(&ctx_alloc_lock);
767
768 if (unlikely(new_version))
769 smp_new_mmu_context_version();
770}801}
771 802
772static int numa_enabled = 1;803static int numa_enabled = 1;
arch/sparc/mm/tsb.c+5−2
@@ -496,7 +496,8 @@ retry_tsb_alloc: · 495 unmodified lines
496 extern void copy_tsb(unsigned long old_tsb_base,496 extern void copy_tsb(unsigned long old_tsb_base,
497 unsigned long old_tsb_size,497 unsigned long old_tsb_size,
498 unsigned long new_tsb_base,498 unsigned long new_tsb_base,
499 unsigned long new_tsb_size);499 unsigned long new_tsb_size,
500 unsigned long page_size_shift);
500 unsigned long old_tsb_base = (unsigned long) old_tsb;501 unsigned long old_tsb_base = (unsigned long) old_tsb;
501 unsigned long new_tsb_base = (unsigned long) new_tsb;502 unsigned long new_tsb_base = (unsigned long) new_tsb;
502 503
@@ -504,7 +505,9 @@ retry_tsb_alloc: · 1 unmodified line
504 old_tsb_base = __pa(old_tsb_base);505 old_tsb_base = __pa(old_tsb_base);
505 new_tsb_base = __pa(new_tsb_base);506 new_tsb_base = __pa(new_tsb_base);
506 }507 }
507 copy_tsb(old_tsb_base, old_size, new_tsb_base, new_size);508 copy_tsb(old_tsb_base, old_size, new_tsb_base, new_size,
509 tsb_index == MM_TSB_BASE ?
510 PAGE_SHIFT : REAL_HPAGE_SHIFT);
508 }511 }
509 512
510 mm->context.tsb_block[tsb_index].tsb = new_tsb;513 mm->context.tsb_block[tsb_index].tsb = new_tsb;
arch/sparc/mm/ultra.S+0−5
@@ -971,11 +971,6 @@ xcall_capture: · 970 unmodified lines
971 wr %g0, (1 << PIL_SMP_CAPTURE), %set_softint971 wr %g0, (1 << PIL_SMP_CAPTURE), %set_softint
972 retry972 retry
973 973
974 .globl xcall_new_mmu_context_version
975xcall_new_mmu_context_version:
976 wr %g0, (1 << PIL_SMP_CTX_NEW_VERSION), %set_softint
977 retry
978
979#ifdef CONFIG_KGDB974#ifdef CONFIG_KGDB
980 .globl xcall_kgdb_capture975 .globl xcall_kgdb_capture
981xcall_kgdb_capture:976xcall_kgdb_capture:
arch/tile/mm/hugetlbpage.c+1−1
@@ -233,7 +233,7 @@ unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr, · 232 unmodified lines
233 addr = ALIGN(addr, huge_page_size(h));233 addr = ALIGN(addr, huge_page_size(h));
234 vma = find_vma(mm, addr);234 vma = find_vma(mm, addr);
235 if (TASK_SIZE - len >= addr &&235 if (TASK_SIZE - len >= addr &&
236 (!vma || addr + len <= vma->vm_start))236 (!vma || addr + len <= vm_start_gap(vma)))
237 return addr;237 return addr;
238 }238 }
239 if (current->mm->get_unmapped_area == arch_get_unmapped_area)239 if (current->mm->get_unmapped_area == arch_get_unmapped_area)
arch/x86/Kconfig+0−4
@@ -2776,10 +2776,6 @@ config COMPAT_FOR_U64_ALIGNMENT · 2775 unmodified lines
2776config SYSVIPC_COMPAT2776config SYSVIPC_COMPAT
2777 def_bool y2777 def_bool y
2778 depends on SYSVIPC2778 depends on SYSVIPC
2779
2780config KEYS_COMPAT
2781 def_bool y
2782 depends on KEYS
2783endif2779endif
2784 2780
2785endmenu2781endmenu
arch/x86/include/asm/extable.h+1−0
@@ -29,6 +29,7 @@ struct pt_regs; · 28 unmodified lines
29 } while (0)29 } while (0)
30 30
31extern int fixup_exception(struct pt_regs *regs, int trapnr);31extern int fixup_exception(struct pt_regs *regs, int trapnr);
32extern int fixup_bug(struct pt_regs *regs, int trapnr);
32extern bool ex_has_fault_handler(unsigned long ip);33extern bool ex_has_fault_handler(unsigned long ip);
33extern void early_fixup_exception(struct pt_regs *regs, int trapnr);34extern void early_fixup_exception(struct pt_regs *regs, int trapnr);
34 35
arch/x86/kernel/cpu/cyrix.c+1−0
@@ -255,6 +255,7 @@ static void init_cyrix(struct cpuinfo_x86 *c) · 254 unmodified lines
255 break;255 break;
256 256
257 case 4: /* MediaGX/GXm or Geode GXM/GXLV/GX1 */257 case 4: /* MediaGX/GXm or Geode GXM/GXLV/GX1 */
258 case 11: /* GX1 with inverted Device ID */
258#ifdef CONFIG_PCI259#ifdef CONFIG_PCI
259 {260 {
260 u32 vendor, device;261 u32 vendor, device;
arch/x86/kernel/cpu/microcode/amd.c+8−8
@@ -320,7 +320,7 @@ void load_ucode_amd_ap(unsigned int cpuid_1_eax) · 319 unmodified lines
320}320}
321 321
322static enum ucode_state322static enum ucode_state
323load_microcode_amd(int cpu, u8 family, const u8 *data, size_t size);323load_microcode_amd(bool save, u8 family, const u8 *data, size_t size);
324 324
325int __init save_microcode_in_initrd_amd(unsigned int cpuid_1_eax)325int __init save_microcode_in_initrd_amd(unsigned int cpuid_1_eax)
326{326{
@@ -338,8 +338,7 @@ int __init save_microcode_in_initrd_amd(unsigned int cpuid_1_eax) · 11 unmodified lines
338 if (!desc.mc)338 if (!desc.mc)
339 return -EINVAL;339 return -EINVAL;
340 340
341 ret = load_microcode_amd(smp_processor_id(), x86_family(cpuid_1_eax),341 ret = load_microcode_amd(true, x86_family(cpuid_1_eax), desc.data, desc.size);
342 desc.data, desc.size);
343 if (ret != UCODE_OK)342 if (ret != UCODE_OK)
344 return -EINVAL;343 return -EINVAL;
345 344
@@ -675,7 +674,7 @@ static enum ucode_state __load_microcode_amd(u8 family, const u8 *data, · 329 unmodified lines
675}674}
676 675
677static enum ucode_state676static enum ucode_state
678load_microcode_amd(int cpu, u8 family, const u8 *data, size_t size)677load_microcode_amd(bool save, u8 family, const u8 *data, size_t size)
679{678{
680 enum ucode_state ret;679 enum ucode_state ret;
681 680
@@ -689,8 +688,8 @@ load_microcode_amd(int cpu, u8 family, const u8 *data, size_t size) · 7 unmodified lines
689 688
690#ifdef CONFIG_X86_32689#ifdef CONFIG_X86_32
691 /* save BSP's matching patch for early load */690 /* save BSP's matching patch for early load */
692 if (cpu_data(cpu).cpu_index == boot_cpu_data.cpu_index) {691 if (save) {
693 struct ucode_patch *p = find_patch(cpu);692 struct ucode_patch *p = find_patch(0);
694 if (p) {693 if (p) {
695 memset(amd_ucode_patch, 0, PATCH_MAX_SIZE);694 memset(amd_ucode_patch, 0, PATCH_MAX_SIZE);
696 memcpy(amd_ucode_patch, p->data, min_t(u32, ksize(p->data),695 memcpy(amd_ucode_patch, p->data, min_t(u32, ksize(p->data),
@@ -722,11 +721,12 @@ static enum ucode_state request_microcode_amd(int cpu, struct device *device, · 25 unmodified lines
722{721{
723 char fw_name[36] = "amd-ucode/microcode_amd.bin";722 char fw_name[36] = "amd-ucode/microcode_amd.bin";
724 struct cpuinfo_x86 *c = &cpu_data(cpu);723 struct cpuinfo_x86 *c = &cpu_data(cpu);
724 bool bsp = c->cpu_index == boot_cpu_data.cpu_index;
725 enum ucode_state ret = UCODE_NFOUND;725 enum ucode_state ret = UCODE_NFOUND;
726 const struct firmware *fw;726 const struct firmware *fw;
727 727
728 /* reload ucode container only on the boot cpu */728 /* reload ucode container only on the boot cpu */
729 if (!refresh_fw || c->cpu_index != boot_cpu_data.cpu_index)729 if (!refresh_fw || !bsp)
730 return UCODE_OK;730 return UCODE_OK;
731 731
732 if (c->x86 >= 0x15)732 if (c->x86 >= 0x15)
@@ -743,7 +743,7 @@ static enum ucode_state request_microcode_amd(int cpu, struct device *device, · 10 unmodified lines
743 goto fw_release;743 goto fw_release;
744 }744 }
745 745
746 ret = load_microcode_amd(cpu, c->x86, fw->data, fw->size);746 ret = load_microcode_amd(bsp, c->x86, fw->data, fw->size);
747 747
748 fw_release:748 fw_release:
749 release_firmware(fw);749 release_firmware(fw);
arch/x86/kernel/cpu/microcode/intel.c+3−0
@@ -619,6 +619,9 @@ int __init save_microcode_in_initrd_intel(void) · 618 unmodified lines
619 619
620 show_saved_mc();620 show_saved_mc();
621 621
622 /* initrd is going away, clear patch ptr. */
623 intel_ucode_patch = NULL;
624
622 return 0;625 return 0;
623}626}
624 627
arch/x86/kernel/kvm.c+1−1
@@ -161,8 +161,8 @@ void kvm_async_pf_task_wait(u32 token) · 160 unmodified lines
161 */161 */
162 rcu_irq_exit();162 rcu_irq_exit();
163 native_safe_halt();163 native_safe_halt();
164 rcu_irq_enter();
165 local_irq_disable();164 local_irq_disable();
165 rcu_irq_enter();
166 }166 }
167 }167 }
168 if (!n.halted)168 if (!n.halted)
arch/x86/kernel/process_32.c+1−1
@@ -78,7 +78,7 @@ void __show_regs(struct pt_regs *regs, int all) · 77 unmodified lines
78 78
79 printk(KERN_DEFAULT "EIP: %pS\n", (void *)regs->ip);79 printk(KERN_DEFAULT "EIP: %pS\n", (void *)regs->ip);
80 printk(KERN_DEFAULT "EFLAGS: %08lx CPU: %d\n", regs->flags,80 printk(KERN_DEFAULT "EFLAGS: %08lx CPU: %d\n", regs->flags,
81 smp_processor_id());81 raw_smp_processor_id());
82 82
83 printk(KERN_DEFAULT "EAX: %08lx EBX: %08lx ECX: %08lx EDX: %08lx\n",83 printk(KERN_DEFAULT "EAX: %08lx EBX: %08lx ECX: %08lx EDX: %08lx\n",
84 regs->ax, regs->bx, regs->cx, regs->dx);84 regs->ax, regs->bx, regs->cx, regs->dx);
arch/x86/kernel/sys_x86_64.c+2−2
@@ -144,7 +144,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, · 143 unmodified lines
144 addr = PAGE_ALIGN(addr);144 addr = PAGE_ALIGN(addr);
145 vma = find_vma(mm, addr);145 vma = find_vma(mm, addr);
146 if (end - len >= addr &&146 if (end - len >= addr &&
147 (!vma || addr + len <= vma->vm_start))147 (!vma || addr + len <= vm_start_gap(vma)))
148 return addr;148 return addr;
149 }149 }
150 150
@@ -187,7 +187,7 @@ arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, · 36 unmodified lines
187 addr = PAGE_ALIGN(addr);187 addr = PAGE_ALIGN(addr);
188 vma = find_vma(mm, addr);188 vma = find_vma(mm, addr);
189 if (TASK_SIZE - len >= addr &&189 if (TASK_SIZE - len >= addr &&
190 (!vma || addr + len <= vma->vm_start))190 (!vma || addr + len <= vm_start_gap(vma)))
191 return addr;191 return addr;
192 }192 }
193 193
arch/x86/kernel/traps.c+1−1
@@ -182,7 +182,7 @@ int is_valid_bugaddr(unsigned long addr) · 181 unmodified lines
182 return ud == INSN_UD0 || ud == INSN_UD2;182 return ud == INSN_UD0 || ud == INSN_UD2;
183}183}
184 184
185static int fixup_bug(struct pt_regs *regs, int trapnr)185int fixup_bug(struct pt_regs *regs, int trapnr)
186{186{
187 if (trapnr != X86_TRAP_UD)187 if (trapnr != X86_TRAP_UD)
188 return 0;188 return 0;
arch/x86/kvm/cpuid.c+11−9
@@ -780,18 +780,20 @@ out: · 779 unmodified lines
780static int move_to_next_stateful_cpuid_entry(struct kvm_vcpu *vcpu, int i)780static int move_to_next_stateful_cpuid_entry(struct kvm_vcpu *vcpu, int i)
781{781{
782 struct kvm_cpuid_entry2 *e = &vcpu->arch.cpuid_entries[i];782 struct kvm_cpuid_entry2 *e = &vcpu->arch.cpuid_entries[i];
783 int j, nent = vcpu->arch.cpuid_nent;783 struct kvm_cpuid_entry2 *ej;
784 int j = i;
785 int nent = vcpu->arch.cpuid_nent;
784 786
785 e->flags &= ~KVM_CPUID_FLAG_STATE_READ_NEXT;787 e->flags &= ~KVM_CPUID_FLAG_STATE_READ_NEXT;
786 /* when no next entry is found, the current entry[i] is reselected */788 /* when no next entry is found, the current entry[i] is reselected */
787 for (j = i + 1; ; j = (j + 1) % nent) {789 do {
788 struct kvm_cpuid_entry2 *ej = &vcpu->arch.cpuid_entries[j];790 j = (j + 1) % nent;
789 if (ej->function == e->function) {791 ej = &vcpu->arch.cpuid_entries[j];
790 ej->flags |= KVM_CPUID_FLAG_STATE_READ_NEXT;792 } while (ej->function != e->function);
791 return j;793
792 }794 ej->flags |= KVM_CPUID_FLAG_STATE_READ_NEXT;
793 }795
794 return 0; /* silence gcc, even though control never reaches here */796 return j;
795}797}
796 798
797/* find an entry with matching function, matching index (if needed), and that799/* find an entry with matching function, matching index (if needed), and that
arch/x86/kvm/lapic.c+4−1
@@ -1495,8 +1495,10 @@ EXPORT_SYMBOL_GPL(kvm_lapic_hv_timer_in_use); · 1494 unmodified lines
1495 1495
1496static void cancel_hv_timer(struct kvm_lapic *apic)1496static void cancel_hv_timer(struct kvm_lapic *apic)
1497{1497{
1498 preempt_disable();
1498 kvm_x86_ops->cancel_hv_timer(apic->vcpu);1499 kvm_x86_ops->cancel_hv_timer(apic->vcpu);
1499 apic->lapic_timer.hv_timer_in_use = false;1500 apic->lapic_timer.hv_timer_in_use = false;
1501 preempt_enable();
1500}1502}
1501 1503
1502static bool start_hv_timer(struct kvm_lapic *apic)1504static bool start_hv_timer(struct kvm_lapic *apic)
@@ -1934,7 +1936,8 @@ void kvm_lapic_reset(struct kvm_vcpu *vcpu, bool init_event) · 431 unmodified lines
1934 for (i = 0; i < KVM_APIC_LVT_NUM; i++)1936 for (i = 0; i < KVM_APIC_LVT_NUM; i++)
1935 kvm_lapic_set_reg(apic, APIC_LVTT + 0x10 * i, APIC_LVT_MASKED);1937 kvm_lapic_set_reg(apic, APIC_LVTT + 0x10 * i, APIC_LVT_MASKED);
1936 apic_update_lvtt(apic);1938 apic_update_lvtt(apic);
1937 if (kvm_check_has_quirk(vcpu->kvm, KVM_X86_QUIRK_LINT0_REENABLED))1939 if (kvm_vcpu_is_reset_bsp(vcpu) &&
1940 kvm_check_has_quirk(vcpu->kvm, KVM_X86_QUIRK_LINT0_REENABLED))
1938 kvm_lapic_set_reg(apic, APIC_LVT0,1941 kvm_lapic_set_reg(apic, APIC_LVT0,
1939 SET_APIC_DELIVERY_MODE(0, APIC_MODE_EXTINT));1942 SET_APIC_DELIVERY_MODE(0, APIC_MODE_EXTINT));
1940 apic_manage_nmi_watchdog(apic, kvm_lapic_get_reg(apic, APIC_LVT0));1943 apic_manage_nmi_watchdog(apic, kvm_lapic_get_reg(apic, APIC_LVT0));
arch/x86/kvm/mmu.c+5−2
@@ -3698,12 +3698,15 @@ static int kvm_arch_setup_async_pf(struct kvm_vcpu *vcpu, gva_t gva, gfn_t gfn) · 3697 unmodified lines
3698 return kvm_setup_async_pf(vcpu, gva, kvm_vcpu_gfn_to_hva(vcpu, gfn), &arch);3698 return kvm_setup_async_pf(vcpu, gva, kvm_vcpu_gfn_to_hva(vcpu, gfn), &arch);
3699}3699}
3700 3700
3701static bool can_do_async_pf(struct kvm_vcpu *vcpu)3701bool kvm_can_do_async_pf(struct kvm_vcpu *vcpu)
3702{3702{
3703 if (unlikely(!lapic_in_kernel(vcpu) ||3703 if (unlikely(!lapic_in_kernel(vcpu) ||
3704 kvm_event_needs_reinjection(vcpu)))3704 kvm_event_needs_reinjection(vcpu)))
3705 return false;3705 return false;
3706 3706
3707 if (is_guest_mode(vcpu))
3708 return false;
3709
3707 return kvm_x86_ops->interrupt_allowed(vcpu);3710 return kvm_x86_ops->interrupt_allowed(vcpu);
3708}3711}
3709 3712
@@ -3719,7 +3722,7 @@ static bool try_async_pf(struct kvm_vcpu *vcpu, bool prefault, gfn_t gfn, · 9 unmodified lines
3719 if (!async)3722 if (!async)
3720 return false; /* *pfn has correct page already */3723 return false; /* *pfn has correct page already */
3721 3724
3722 if (!prefault && can_do_async_pf(vcpu)) {3725 if (!prefault && kvm_can_do_async_pf(vcpu)) {
3723 trace_kvm_try_async_get_page(gva, gfn);3726 trace_kvm_try_async_get_page(gva, gfn);
3724 if (kvm_find_async_pf_gfn(vcpu, gfn)) {3727 if (kvm_find_async_pf_gfn(vcpu, gfn)) {
3725 trace_kvm_async_pf_doublefault(gva, gfn);3728 trace_kvm_async_pf_doublefault(gva, gfn);
arch/x86/kvm/mmu.h+1−0
@@ -76,6 +76,7 @@ int handle_mmio_page_fault(struct kvm_vcpu *vcpu, u64 addr, bool direct); · 75 unmodified lines
76void kvm_init_shadow_mmu(struct kvm_vcpu *vcpu);76void kvm_init_shadow_mmu(struct kvm_vcpu *vcpu);
77void kvm_init_shadow_ept_mmu(struct kvm_vcpu *vcpu, bool execonly,77void kvm_init_shadow_ept_mmu(struct kvm_vcpu *vcpu, bool execonly,
78 bool accessed_dirty);78 bool accessed_dirty);
79bool kvm_can_do_async_pf(struct kvm_vcpu *vcpu);
79 80
80static inline unsigned int kvm_mmu_available_pages(struct kvm *kvm)81static inline unsigned int kvm_mmu_available_pages(struct kvm *kvm)
81{82{
arch/x86/kvm/svm.c+12−14
@@ -1807,7 +1807,7 @@ static void svm_get_segment(struct kvm_vcpu *vcpu, · 1806 unmodified lines
1807 * AMD's VMCB does not have an explicit unusable field, so emulate it1807 * AMD's VMCB does not have an explicit unusable field, so emulate it
1808 * for cross vendor migration purposes by "not present"1808 * for cross vendor migration purposes by "not present"
1809 */1809 */
1810 var->unusable = !var->present || (var->type == 0);1810 var->unusable = !var->present;
1811 1811
1812 switch (seg) {1812 switch (seg) {
1813 case VCPU_SREG_TR:1813 case VCPU_SREG_TR:
@@ -1840,6 +1840,7 @@ static void svm_get_segment(struct kvm_vcpu *vcpu, · 26 unmodified lines
1840 */1840 */
1841 if (var->unusable)1841 if (var->unusable)
1842 var->db = 0;1842 var->db = 0;
1843 /* This is symmetric with svm_set_segment() */
1843 var->dpl = to_svm(vcpu)->vmcb->save.cpl;1844 var->dpl = to_svm(vcpu)->vmcb->save.cpl;
1844 break;1845 break;
1845 }1846 }
@@ -1980,18 +1981,14 @@ static void svm_set_segment(struct kvm_vcpu *vcpu, · 134 unmodified lines
1980 s->base = var->base;1981 s->base = var->base;
1981 s->limit = var->limit;1982 s->limit = var->limit;
1982 s->selector = var->selector;1983 s->selector = var->selector;
1983 if (var->unusable)1984 s->attrib = (var->type & SVM_SELECTOR_TYPE_MASK);
1984 s->attrib = 0;1985 s->attrib |= (var->s & 1) << SVM_SELECTOR_S_SHIFT;
1985 else {1986 s->attrib |= (var->dpl & 3) << SVM_SELECTOR_DPL_SHIFT;
1986 s->attrib = (var->type & SVM_SELECTOR_TYPE_MASK);1987 s->attrib |= ((var->present & 1) && !var->unusable) << SVM_SELECTOR_P_SHIFT;
1987 s->attrib |= (var->s & 1) << SVM_SELECTOR_S_SHIFT;1988 s->attrib |= (var->avl & 1) << SVM_SELECTOR_AVL_SHIFT;
1988 s->attrib |= (var->dpl & 3) << SVM_SELECTOR_DPL_SHIFT;1989 s->attrib |= (var->l & 1) << SVM_SELECTOR_L_SHIFT;
1989 s->attrib |= (var->present & 1) << SVM_SELECTOR_P_SHIFT;1990 s->attrib |= (var->db & 1) << SVM_SELECTOR_DB_SHIFT;
1990 s->attrib |= (var->avl & 1) << SVM_SELECTOR_AVL_SHIFT;1991 s->attrib |= (var->g & 1) << SVM_SELECTOR_G_SHIFT;
1991 s->attrib |= (var->l & 1) << SVM_SELECTOR_L_SHIFT;
1992 s->attrib |= (var->db & 1) << SVM_SELECTOR_DB_SHIFT;
1993 s->attrib |= (var->g & 1) << SVM_SELECTOR_G_SHIFT;
1994 }
1995 1992
1996 /*1993 /*
1997 * This is always accurate, except if SYSRET returned to a segment1994 * This is always accurate, except if SYSRET returned to a segment
@@ -2000,7 +1997,8 @@ static void svm_set_segment(struct kvm_vcpu *vcpu, · 2 unmodified lines
2000 * would entail passing the CPL to userspace and back.1997 * would entail passing the CPL to userspace and back.
2001 */1998 */
2002 if (seg == VCPU_SREG_SS)1999 if (seg == VCPU_SREG_SS)
2003 svm->vmcb->save.cpl = (s->attrib >> SVM_SELECTOR_DPL_SHIFT) & 3;2000 /* This is symmetric with svm_get_segment() */
2001 svm->vmcb->save.cpl = (var->dpl & 3);
2004 2002
2005 mark_dirty(svm->vmcb, VMCB_SEG);2003 mark_dirty(svm->vmcb, VMCB_SEG);
2006}2004}
arch/x86/kvm/vmx.c+63−86
@@ -2425,7 +2425,7 @@ static int nested_vmx_check_exception(struct kvm_vcpu *vcpu, unsigned nr) · 2424 unmodified lines
2425 if (!(vmcs12->exception_bitmap & (1u << nr)))2425 if (!(vmcs12->exception_bitmap & (1u << nr)))
2426 return 0;2426 return 0;
2427 2427
2428 nested_vmx_vmexit(vcpu, to_vmx(vcpu)->exit_reason,2428 nested_vmx_vmexit(vcpu, EXIT_REASON_EXCEPTION_NMI,
2429 vmcs_read32(VM_EXIT_INTR_INFO),2429 vmcs_read32(VM_EXIT_INTR_INFO),
2430 vmcs_readl(EXIT_QUALIFICATION));2430 vmcs_readl(EXIT_QUALIFICATION));
2431 return 1;2431 return 1;
@@ -6914,97 +6914,21 @@ static int get_vmx_mem_address(struct kvm_vcpu *vcpu, · 4482 unmodified lines
6914 return 0;6914 return 0;
6915}6915}
6916 6916
6917/*6917static int nested_vmx_get_vmptr(struct kvm_vcpu *vcpu, gpa_t *vmpointer)
6918 * This function performs the various checks including
6919 * - if it's 4KB aligned
6920 * - No bits beyond the physical address width are set
6921 * - Returns 0 on success or else 1
6922 * (Intel SDM Section 30.3)
6923 */
6924static int nested_vmx_check_vmptr(struct kvm_vcpu *vcpu, int exit_reason,
6925 gpa_t *vmpointer)
6926{6918{
6927 gva_t gva;6919 gva_t gva;
6928 gpa_t vmptr;
6929 struct x86_exception e;6920 struct x86_exception e;
6930 struct page *page;
6931 struct vcpu_vmx *vmx = to_vmx(vcpu);
6932 int maxphyaddr = cpuid_maxphyaddr(vcpu);
6933 6921
6934 if (get_vmx_mem_address(vcpu, vmcs_readl(EXIT_QUALIFICATION),6922 if (get_vmx_mem_address(vcpu, vmcs_readl(EXIT_QUALIFICATION),
6935 vmcs_read32(VMX_INSTRUCTION_INFO), false, &gva))6923 vmcs_read32(VMX_INSTRUCTION_INFO), false, &gva))
6936 return 1;6924 return 1;
6937 6925
6938 if (kvm_read_guest_virt(&vcpu->arch.emulate_ctxt, gva, &vmptr,6926 if (kvm_read_guest_virt(&vcpu->arch.emulate_ctxt, gva, vmpointer,
6939 sizeof(vmptr), &e)) {6927 sizeof(*vmpointer), &e)) {
6940 kvm_inject_page_fault(vcpu, &e);6928 kvm_inject_page_fault(vcpu, &e);
6941 return 1;6929 return 1;
6942 }6930 }
6943 6931
6944 switch (exit_reason) {
6945 case EXIT_REASON_VMON:
6946 /*
6947 * SDM 3: 24.11.5
6948 * The first 4 bytes of VMXON region contain the supported
6949 * VMCS revision identifier
6950 *
6951 * Note - IA32_VMX_BASIC[48] will never be 1
6952 * for the nested case;
6953 * which replaces physical address width with 32
6954 *
6955 */
6956 if (!PAGE_ALIGNED(vmptr) || (vmptr >> maxphyaddr)) {
6957 nested_vmx_failInvalid(vcpu);
6958 return kvm_skip_emulated_instruction(vcpu);
6959 }
6960
6961 page = nested_get_page(vcpu, vmptr);
6962 if (page == NULL) {
6963 nested_vmx_failInvalid(vcpu);
6964 return kvm_skip_emulated_instruction(vcpu);
6965 }
6966 if (*(u32 *)kmap(page) != VMCS12_REVISION) {
6967 kunmap(page);
6968 nested_release_page_clean(page);
6969 nested_vmx_failInvalid(vcpu);
6970 return kvm_skip_emulated_instruction(vcpu);
6971 }
6972 kunmap(page);
6973 nested_release_page_clean(page);
6974 vmx->nested.vmxon_ptr = vmptr;
6975 break;
6976 case EXIT_REASON_VMCLEAR:
6977 if (!PAGE_ALIGNED(vmptr) || (vmptr >> maxphyaddr)) {
6978 nested_vmx_failValid(vcpu,
6979 VMXERR_VMCLEAR_INVALID_ADDRESS);
6980 return kvm_skip_emulated_instruction(vcpu);
6981 }
6982
6983 if (vmptr == vmx->nested.vmxon_ptr) {
6984 nested_vmx_failValid(vcpu,
6985 VMXERR_VMCLEAR_VMXON_POINTER);
6986 return kvm_skip_emulated_instruction(vcpu);
6987 }
6988 break;
6989 case EXIT_REASON_VMPTRLD:
6990 if (!PAGE_ALIGNED(vmptr) || (vmptr >> maxphyaddr)) {
6991 nested_vmx_failValid(vcpu,
6992 VMXERR_VMPTRLD_INVALID_ADDRESS);
6993 return kvm_skip_emulated_instruction(vcpu);
6994 }
6995
6996 if (vmptr == vmx->nested.vmxon_ptr) {
6997 nested_vmx_failValid(vcpu,
6998 VMXERR_VMPTRLD_VMXON_POINTER);
6999 return kvm_skip_emulated_instruction(vcpu);
7000 }
7001 break;
7002 default:
7003 return 1; /* shouldn't happen */
7004 }
7005
7006 if (vmpointer)
7007 *vmpointer = vmptr;
7008 return 0;6932 return 0;
7009}6933}
7010 6934
@@ -7066,6 +6990,8 @@ out_msr_bitmap: · 55 unmodified lines
7066static int handle_vmon(struct kvm_vcpu *vcpu)6990static int handle_vmon(struct kvm_vcpu *vcpu)
7067{6991{
7068 int ret;6992 int ret;
6993 gpa_t vmptr;
6994 struct page *page;
7069 struct vcpu_vmx *vmx = to_vmx(vcpu);6995 struct vcpu_vmx *vmx = to_vmx(vcpu);
7070 const u64 VMXON_NEEDED_FEATURES = FEATURE_CONTROL_LOCKED6996 const u64 VMXON_NEEDED_FEATURES = FEATURE_CONTROL_LOCKED
7071 | FEATURE_CONTROL_VMXON_ENABLED_OUTSIDE_SMX;6997 | FEATURE_CONTROL_VMXON_ENABLED_OUTSIDE_SMX;
@@ -7095,9 +7021,37 @@ static int handle_vmon(struct kvm_vcpu *vcpu) · 23 unmodified lines
7095 return 1;7021 return 1;
7096 }7022 }
7097 7023
7098 if (nested_vmx_check_vmptr(vcpu, EXIT_REASON_VMON, NULL))7024 if (nested_vmx_get_vmptr(vcpu, &vmptr))
7099 return 1;7025 return 1;
7100 7026
7027 /*
7028 * SDM 3: 24.11.5
7029 * The first 4 bytes of VMXON region contain the supported
7030 * VMCS revision identifier
7031 *
7032 * Note - IA32_VMX_BASIC[48] will never be 1 for the nested case;
7033 * which replaces physical address width with 32
7034 */
7035 if (!PAGE_ALIGNED(vmptr) || (vmptr >> cpuid_maxphyaddr(vcpu))) {
7036 nested_vmx_failInvalid(vcpu);
7037 return kvm_skip_emulated_instruction(vcpu);
7038 }
7039
7040 page = nested_get_page(vcpu, vmptr);
7041 if (page == NULL) {
7042 nested_vmx_failInvalid(vcpu);
7043 return kvm_skip_emulated_instruction(vcpu);
7044 }
7045 if (*(u32 *)kmap(page) != VMCS12_REVISION) {
7046 kunmap(page);
7047 nested_release_page_clean(page);
7048 nested_vmx_failInvalid(vcpu);
7049 return kvm_skip_emulated_instruction(vcpu);
7050 }
7051 kunmap(page);
7052 nested_release_page_clean(page);
7053
7054 vmx->nested.vmxon_ptr = vmptr;
7101 ret = enter_vmx_operation(vcpu);7055 ret = enter_vmx_operation(vcpu);
7102 if (ret)7056 if (ret)
7103 return ret;7057 return ret;
@@ -7213,9 +7167,19 @@ static int handle_vmclear(struct kvm_vcpu *vcpu) · 109 unmodified lines
7213 if (!nested_vmx_check_permission(vcpu))7167 if (!nested_vmx_check_permission(vcpu))
7214 return 1;7168 return 1;
7215 7169
7216 if (nested_vmx_check_vmptr(vcpu, EXIT_REASON_VMCLEAR, &vmptr))7170 if (nested_vmx_get_vmptr(vcpu, &vmptr))
7217 return 1;7171 return 1;
7218 7172
7173 if (!PAGE_ALIGNED(vmptr) || (vmptr >> cpuid_maxphyaddr(vcpu))) {
7174 nested_vmx_failValid(vcpu, VMXERR_VMCLEAR_INVALID_ADDRESS);
7175 return kvm_skip_emulated_instruction(vcpu);
7176 }
7177
7178 if (vmptr == vmx->nested.vmxon_ptr) {
7179 nested_vmx_failValid(vcpu, VMXERR_VMCLEAR_VMXON_POINTER);
7180 return kvm_skip_emulated_instruction(vcpu);
7181 }
7182
7219 if (vmptr == vmx->nested.current_vmptr)7183 if (vmptr == vmx->nested.current_vmptr)
7220 nested_release_vmcs12(vmx);7184 nested_release_vmcs12(vmx);
7221 7185
@@ -7545,9 +7509,19 @@ static int handle_vmptrld(struct kvm_vcpu *vcpu) · 323 unmodified lines
7545 if (!nested_vmx_check_permission(vcpu))7509 if (!nested_vmx_check_permission(vcpu))
7546 return 1;7510 return 1;
7547 7511
7548 if (nested_vmx_check_vmptr(vcpu, EXIT_REASON_VMPTRLD, &vmptr))7512 if (nested_vmx_get_vmptr(vcpu, &vmptr))
7549 return 1;7513 return 1;
7550 7514
7515 if (!PAGE_ALIGNED(vmptr) || (vmptr >> cpuid_maxphyaddr(vcpu))) {
7516 nested_vmx_failValid(vcpu, VMXERR_VMPTRLD_INVALID_ADDRESS);
7517 return kvm_skip_emulated_instruction(vcpu);
7518 }
7519
7520 if (vmptr == vmx->nested.vmxon_ptr) {
7521 nested_vmx_failValid(vcpu, VMXERR_VMPTRLD_VMXON_POINTER);
7522 return kvm_skip_emulated_instruction(vcpu);
7523 }
7524
7551 if (vmx->nested.current_vmptr != vmptr) {7525 if (vmx->nested.current_vmptr != vmptr) {
7552 struct vmcs12 *new_vmcs12;7526 struct vmcs12 *new_vmcs12;
7553 struct page *page;7527 struct page *page;
@@ -7913,11 +7887,13 @@ static bool nested_vmx_exit_handled_cr(struct kvm_vcpu *vcpu, · 359 unmodified lines
7913{7887{
7914 unsigned long exit_qualification = vmcs_readl(EXIT_QUALIFICATION);7888 unsigned long exit_qualification = vmcs_readl(EXIT_QUALIFICATION);
7915 int cr = exit_qualification & 15;7889 int cr = exit_qualification & 15;
7916 int reg = (exit_qualification >> 8) & 15;7890 int reg;
7917 unsigned long val = kvm_register_readl(vcpu, reg);7891 unsigned long val;
7918 7892
7919 switch ((exit_qualification >> 4) & 3) {7893 switch ((exit_qualification >> 4) & 3) {
7920 case 0: /* mov to cr */7894 case 0: /* mov to cr */
7895 reg = (exit_qualification >> 8) & 15;
7896 val = kvm_register_readl(vcpu, reg);
7921 switch (cr) {7897 switch (cr) {
7922 case 0:7898 case 0:
7923 if (vmcs12->cr0_guest_host_mask &7899 if (vmcs12->cr0_guest_host_mask &
@@ -7972,6 +7948,7 @@ static bool nested_vmx_exit_handled_cr(struct kvm_vcpu *vcpu, · 48 unmodified lines
7972 * lmsw can change bits 1..3 of cr0, and only set bit 0 of7948 * lmsw can change bits 1..3 of cr0, and only set bit 0 of
7973 * cr0. Other attempted changes are ignored, with no exit.7949 * cr0. Other attempted changes are ignored, with no exit.
7974 */7950 */
7951 val = (exit_qualification >> LMSW_SOURCE_DATA_SHIFT) & 0x0f;
7975 if (vmcs12->cr0_guest_host_mask & 0xe &7952 if (vmcs12->cr0_guest_host_mask & 0xe &
7976 (val ^ vmcs12->cr0_read_shadow))7953 (val ^ vmcs12->cr0_read_shadow))
7977 return true;7954 return true;
arch/x86/kvm/x86.c+6−4
@@ -8394,10 +8394,13 @@ static inline bool kvm_vcpu_has_events(struct kvm_vcpu *vcpu) · 8393 unmodified lines
8394 if (vcpu->arch.pv.pv_unhalted)8394 if (vcpu->arch.pv.pv_unhalted)
8395 return true;8395 return true;
8396 8396
8397 if (atomic_read(&vcpu->arch.nmi_queued))8397 if (kvm_test_request(KVM_REQ_NMI, vcpu) ||
8398 (vcpu->arch.nmi_pending &&
8399 kvm_x86_ops->nmi_allowed(vcpu)))
8398 return true;8400 return true;
8399 8401
8400 if (kvm_test_request(KVM_REQ_SMI, vcpu))8402 if (kvm_test_request(KVM_REQ_SMI, vcpu) ||
8403 (vcpu->arch.smi_pending && !is_smm(vcpu)))
8401 return true;8404 return true;
8402 8405
8403 if (kvm_arch_interrupt_allowed(vcpu) &&8406 if (kvm_arch_interrupt_allowed(vcpu) &&
@@ -8604,8 +8607,7 @@ bool kvm_arch_can_inject_async_page_present(struct kvm_vcpu *vcpu) · 200 unmodified lines
8604 if (!(vcpu->arch.apf.msr_val & KVM_ASYNC_PF_ENABLED))8607 if (!(vcpu->arch.apf.msr_val & KVM_ASYNC_PF_ENABLED))
8605 return true;8608 return true;
8606 else8609 else
8607 return !kvm_event_needs_reinjection(vcpu) &&8610 return kvm_can_do_async_pf(vcpu);
8608 kvm_x86_ops->interrupt_allowed(vcpu);
8609}8611}
8610 8612
8611void kvm_arch_start_assignment(struct kvm *kvm)8613void kvm_arch_start_assignment(struct kvm *kvm)
arch/x86/mm/extable.c+3−0
@@ -162,6 +162,9 @@ void __init early_fixup_exception(struct pt_regs *regs, int trapnr) · 161 unmodified lines
162 if (fixup_exception(regs, trapnr))162 if (fixup_exception(regs, trapnr))
163 return;163 return;
164 164
165 if (fixup_bug(regs, trapnr))
166 return;
167
165fail:168fail:
166 early_printk("PANIC: early exception 0x%02x IP %lx:%lx error %lx cr2 0x%lx\n",169 early_printk("PANIC: early exception 0x%02x IP %lx:%lx error %lx cr2 0x%lx\n",
167 (unsigned)trapnr, (unsigned long)regs->cs, regs->ip,170 (unsigned)trapnr, (unsigned long)regs->cs, regs->ip,
arch/x86/mm/hugetlbpage.c+1−1
@@ -148,7 +148,7 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr, · 147 unmodified lines
148 addr = ALIGN(addr, huge_page_size(h));148 addr = ALIGN(addr, huge_page_size(h));
149 vma = find_vma(mm, addr);149 vma = find_vma(mm, addr);
150 if (TASK_SIZE - len >= addr &&150 if (TASK_SIZE - len >= addr &&
151 (!vma || addr + len <= vma->vm_start))151 (!vma || addr + len <= vm_start_gap(vma)))
152 return addr;152 return addr;
153 }153 }
154 if (mm->get_unmapped_area == arch_get_unmapped_area)154 if (mm->get_unmapped_area == arch_get_unmapped_area)
arch/x86/mm/init.c+3−3
@@ -161,16 +161,16 @@ static int page_size_mask; · 160 unmodified lines
161 161
162static void __init probe_page_size_mask(void)162static void __init probe_page_size_mask(void)
163{163{
164#if !defined(CONFIG_KMEMCHECK)
165 /*164 /*
166 * For CONFIG_KMEMCHECK or pagealloc debugging, identity mapping will165 * For CONFIG_KMEMCHECK or pagealloc debugging, identity mapping will
167 * use small pages.166 * use small pages.
168 * This will simplify cpa(), which otherwise needs to support splitting167 * This will simplify cpa(), which otherwise needs to support splitting
169 * large pages into small in interrupt context, etc.168 * large pages into small in interrupt context, etc.
170 */169 */
171 if (boot_cpu_has(X86_FEATURE_PSE) && !debug_pagealloc_enabled())170 if (boot_cpu_has(X86_FEATURE_PSE) && !debug_pagealloc_enabled() && !IS_ENABLED(CONFIG_KMEMCHECK))
172 page_size_mask |= 1 << PG_LEVEL_2M;171 page_size_mask |= 1 << PG_LEVEL_2M;
173#endif172 else
173 direct_gbpages = 0;
174 174
175 /* Enable PSE if available */175 /* Enable PSE if available */
176 if (boot_cpu_has(X86_FEATURE_PSE))176 if (boot_cpu_has(X86_FEATURE_PSE))
arch/x86/mm/pat.c+3−6
@@ -65,11 +65,9 @@ static int __init nopat(char *str) · 64 unmodified lines
65}65}
66early_param("nopat", nopat);66early_param("nopat", nopat);
67 67
68static bool __read_mostly __pat_initialized = false;
69
70bool pat_enabled(void)68bool pat_enabled(void)
71{69{
72 return __pat_initialized;70 return !!__pat_enabled;
73}71}
74EXPORT_SYMBOL_GPL(pat_enabled);72EXPORT_SYMBOL_GPL(pat_enabled);
75 73
@@ -227,14 +225,13 @@ static void pat_bsp_init(u64 pat) · 151 unmodified lines
227 }225 }
228 226
229 wrmsrl(MSR_IA32_CR_PAT, pat);227 wrmsrl(MSR_IA32_CR_PAT, pat);
230 __pat_initialized = true;
231 228
232 __init_cache_modes(pat);229 __init_cache_modes(pat);
233}230}
234 231
235static void pat_ap_init(u64 pat)232static void pat_ap_init(u64 pat)
236{233{
237 if (!this_cpu_has(X86_FEATURE_PAT)) {234 if (!boot_cpu_has(X86_FEATURE_PAT)) {
238 /*235 /*
239 * If this happens we are on a secondary CPU, but switched to236 * If this happens we are on a secondary CPU, but switched to
240 * PAT on the boot CPU. We have no way to undo PAT.237 * PAT on the boot CPU. We have no way to undo PAT.
@@ -309,7 +306,7 @@ void pat_init(void) · 68 unmodified lines
309 u64 pat;306 u64 pat;
310 struct cpuinfo_x86 *c = &boot_cpu_data;307 struct cpuinfo_x86 *c = &boot_cpu_data;
311 308
312 if (!__pat_enabled) {309 if (!pat_enabled()) {
313 init_cache_modes();310 init_cache_modes();
314 return;311 return;
315 }312 }
arch/x86/platform/efi/efi.c+4−2
@@ -828,9 +828,11 @@ static void __init kexec_enter_virtual_mode(void) · 827 unmodified lines
828 828
829 /*829 /*
830 * We don't do virtual mode, since we don't do runtime services, on830 * We don't do virtual mode, since we don't do runtime services, on
831 * non-native EFI831 * non-native EFI. With efi=old_map, we don't do runtime services in
832 * kexec kernel because in the initial boot something else might
833 * have been mapped at these virtual addresses.
832 */834 */
833 if (!efi_is_native()) {835 if (!efi_is_native() || efi_enabled(EFI_OLD_MEMMAP)) {
834 efi_memmap_unmap();836 efi_memmap_unmap();
835 clear_bit(EFI_RUNTIME_SERVICES, &efi.flags);837 clear_bit(EFI_RUNTIME_SERVICES, &efi.flags);
836 return;838 return;
arch/x86/platform/efi/efi_64.c+71−8
@@ -71,11 +71,13 @@ static void __init early_code_mapping_set_exec(int executable) · 70 unmodified lines
71 71
72pgd_t * __init efi_call_phys_prolog(void)72pgd_t * __init efi_call_phys_prolog(void)
73{73{
74 unsigned long vaddress;74 unsigned long vaddr, addr_pgd, addr_p4d, addr_pud;
75 pgd_t *save_pgd;75 pgd_t *save_pgd, *pgd_k, *pgd_efi;
76 p4d_t *p4d, *p4d_k, *p4d_efi;
77 pud_t *pud;
76 78
77 int pgd;79 int pgd;
78 int n_pgds;80 int n_pgds, i, j;
79 81
80 if (!efi_enabled(EFI_OLD_MEMMAP)) {82 if (!efi_enabled(EFI_OLD_MEMMAP)) {
81 save_pgd = (pgd_t *)read_cr3();83 save_pgd = (pgd_t *)read_cr3();
@@ -88,10 +90,49 @@ pgd_t * __init efi_call_phys_prolog(void) · 6 unmodified lines
88 n_pgds = DIV_ROUND_UP((max_pfn << PAGE_SHIFT), PGDIR_SIZE);90 n_pgds = DIV_ROUND_UP((max_pfn << PAGE_SHIFT), PGDIR_SIZE);
89 save_pgd = kmalloc_array(n_pgds, sizeof(*save_pgd), GFP_KERNEL);91 save_pgd = kmalloc_array(n_pgds, sizeof(*save_pgd), GFP_KERNEL);
90 92
93 /*
94 * Build 1:1 identity mapping for efi=old_map usage. Note that
95 * PAGE_OFFSET is PGDIR_SIZE aligned when KASLR is disabled, while
96 * it is PUD_SIZE ALIGNED with KASLR enabled. So for a given physical
97 * address X, the pud_index(X) != pud_index(__va(X)), we can only copy
98 * PUD entry of __va(X) to fill in pud entry of X to build 1:1 mapping.
99 * This means here we can only reuse the PMD tables of the direct mapping.
100 */
91 for (pgd = 0; pgd < n_pgds; pgd++) {101 for (pgd = 0; pgd < n_pgds; pgd++) {
92 save_pgd[pgd] = *pgd_offset_k(pgd * PGDIR_SIZE);102 addr_pgd = (unsigned long)(pgd * PGDIR_SIZE);
93 vaddress = (unsigned long)__va(pgd * PGDIR_SIZE);103 vaddr = (unsigned long)__va(pgd * PGDIR_SIZE);
94 set_pgd(pgd_offset_k(pgd * PGDIR_SIZE), *pgd_offset_k(vaddress));104 pgd_efi = pgd_offset_k(addr_pgd);
105 save_pgd[pgd] = *pgd_efi;
106
107 p4d = p4d_alloc(&init_mm, pgd_efi, addr_pgd);
108 if (!p4d) {
109 pr_err("Failed to allocate p4d table!\n");
110 goto out;
111 }
112
113 for (i = 0; i < PTRS_PER_P4D; i++) {
114 addr_p4d = addr_pgd + i * P4D_SIZE;
115 p4d_efi = p4d + p4d_index(addr_p4d);
116
117 pud = pud_alloc(&init_mm, p4d_efi, addr_p4d);
118 if (!pud) {
119 pr_err("Failed to allocate pud table!\n");
120 goto out;
121 }
122
123 for (j = 0; j < PTRS_PER_PUD; j++) {
124 addr_pud = addr_p4d + j * PUD_SIZE;
125
126 if (addr_pud > (max_pfn << PAGE_SHIFT))
127 break;
128
129 vaddr = (unsigned long)__va(addr_pud);
130
131 pgd_k = pgd_offset_k(vaddr);
132 p4d_k = p4d_offset(pgd_k, vaddr);
133 pud[j] = *pud_offset(p4d_k, vaddr);
134 }
135 }
95 }136 }
96out:137out:
97 __flush_tlb_all();138 __flush_tlb_all();
@@ -104,8 +145,11 @@ void __init efi_call_phys_epilog(pgd_t *save_pgd) · 6 unmodified lines
104 /*145 /*
105 * After the lock is released, the original page table is restored.146 * After the lock is released, the original page table is restored.
106 */147 */
107 int pgd_idx;148 int pgd_idx, i;
108 int nr_pgds;149 int nr_pgds;
150 pgd_t *pgd;
151 p4d_t *p4d;
152 pud_t *pud;
109 153
110 if (!efi_enabled(EFI_OLD_MEMMAP)) {154 if (!efi_enabled(EFI_OLD_MEMMAP)) {
111 write_cr3((unsigned long)save_pgd);155 write_cr3((unsigned long)save_pgd);
@@ -115,9 +159,28 @@ void __init efi_call_phys_epilog(pgd_t *save_pgd) · 3 unmodified lines
115 159
116 nr_pgds = DIV_ROUND_UP((max_pfn << PAGE_SHIFT) , PGDIR_SIZE);160 nr_pgds = DIV_ROUND_UP((max_pfn << PAGE_SHIFT) , PGDIR_SIZE);
117 161
118 for (pgd_idx = 0; pgd_idx < nr_pgds; pgd_idx++)162 for (pgd_idx = 0; pgd_idx < nr_pgds; pgd_idx++) {
163 pgd = pgd_offset_k(pgd_idx * PGDIR_SIZE);
119 set_pgd(pgd_offset_k(pgd_idx * PGDIR_SIZE), save_pgd[pgd_idx]);164 set_pgd(pgd_offset_k(pgd_idx * PGDIR_SIZE), save_pgd[pgd_idx]);
120 165
166 if (!(pgd_val(*pgd) & _PAGE_PRESENT))
167 continue;
168
169 for (i = 0; i < PTRS_PER_P4D; i++) {
170 p4d = p4d_offset(pgd,
171 pgd_idx * PGDIR_SIZE + i * P4D_SIZE);
172
173 if (!(p4d_val(*p4d) & _PAGE_PRESENT))
174 continue;
175
176 pud = (pud_t *)p4d_page_vaddr(*p4d);
177 pud_free(&init_mm, pud);
178 }
179
180 p4d = (p4d_t *)pgd_page_vaddr(*pgd);
181 p4d_free(&init_mm, p4d);
182 }
183
121 kfree(save_pgd);184 kfree(save_pgd);
122 185
123 __flush_tlb_all();186 __flush_tlb_all();
arch/x86/platform/efi/quirks.c+3−0
@@ -360,6 +360,9 @@ void __init efi_free_boot_services(void) · 359 unmodified lines
360 free_bootmem_late(start, size);360 free_bootmem_late(start, size);
361 }361 }
362 362
363 if (!num_entries)
364 return;
365
363 new_size = efi.memmap.desc_size * num_entries;366 new_size = efi.memmap.desc_size * num_entries;
364 new_phys = efi_memmap_alloc(num_entries);367 new_phys = efi_memmap_alloc(num_entries);
365 if (!new_phys) {368 if (!new_phys) {
arch/xtensa/include/asm/irq.h+2−1
@@ -29,7 +29,8 @@ static inline void variant_irq_disable(unsigned int irq) { } · 28 unmodified lines
29# define PLATFORM_NR_IRQS 029# define PLATFORM_NR_IRQS 0
30#endif30#endif
31#define XTENSA_NR_IRQS XCHAL_NUM_INTERRUPTS31#define XTENSA_NR_IRQS XCHAL_NUM_INTERRUPTS
32#define NR_IRQS (XTENSA_NR_IRQS + VARIANT_NR_IRQS + PLATFORM_NR_IRQS)32#define NR_IRQS (XTENSA_NR_IRQS + VARIANT_NR_IRQS + PLATFORM_NR_IRQS + 1)
33#define XTENSA_PIC_LINUX_IRQ(hwirq) ((hwirq) + 1)
33 34
34#if VARIANT_NR_IRQS == 035#if VARIANT_NR_IRQS == 0
35static inline void variant_init_irq(void) { }36static inline void variant_init_irq(void) { }
arch/xtensa/kernel/irq.c+0−5
@@ -34,11 +34,6 @@ asmlinkage void do_IRQ(int hwirq, struct pt_regs *regs) · 33 unmodified lines
34{34{
35 int irq = irq_find_mapping(NULL, hwirq);35 int irq = irq_find_mapping(NULL, hwirq);
36 36
37 if (hwirq >= NR_IRQS) {
38 printk(KERN_EMERG "%s: cannot handle IRQ %d\n",
39 __func__, hwirq);
40 }
41
42#ifdef CONFIG_DEBUG_STACKOVERFLOW37#ifdef CONFIG_DEBUG_STACKOVERFLOW
43 /* Debugging check for stack overflow: is there less than 1KB free? */38 /* Debugging check for stack overflow: is there less than 1KB free? */
44 {39 {
arch/xtensa/kernel/setup.c+1−2
@@ -593,8 +593,7 @@ c_show(struct seq_file *f, void *slot) · 592 unmodified lines
593 (ccount_freq/10000) % 100,593 (ccount_freq/10000) % 100,
594 loops_per_jiffy/(500000/HZ),594 loops_per_jiffy/(500000/HZ),
595 (loops_per_jiffy/(5000/HZ)) % 100);595 (loops_per_jiffy/(5000/HZ)) % 100);
596 596 seq_puts(f, "flags\t\t: "
597 seq_printf(f,"flags\t\t: "
598#if XCHAL_HAVE_NMI597#if XCHAL_HAVE_NMI
599 "nmi "598 "nmi "
600#endif599#endif
arch/xtensa/kernel/syscall.c+1−1
@@ -88,7 +88,7 @@ unsigned long arch_get_unmapped_area(struct file *filp, unsigned long addr, · 87 unmodified lines
88 /* At this point: (!vmm || addr < vmm->vm_end). */88 /* At this point: (!vmm || addr < vmm->vm_end). */
89 if (TASK_SIZE - len < addr)89 if (TASK_SIZE - len < addr)
90 return -ENOMEM;90 return -ENOMEM;
91 if (!vmm || addr + len <= vmm->vm_start)91 if (!vmm || addr + len <= vm_start_gap(vmm))
92 return addr;92 return addr;
93 addr = vmm->vm_end;93 addr = vmm->vm_end;
94 if (flags & MAP_SHARED)94 if (flags & MAP_SHARED)
arch/xtensa/kernel/vmlinux.lds.S+3−3
@@ -118,7 +118,7 @@ SECTIONS · 117 unmodified lines
118 SECTION_VECTOR (.KernelExceptionVector.text, KERNEL_VECTOR_VADDR)118 SECTION_VECTOR (.KernelExceptionVector.text, KERNEL_VECTOR_VADDR)
119 SECTION_VECTOR (.UserExceptionVector.literal, USER_VECTOR_VADDR - 4)119 SECTION_VECTOR (.UserExceptionVector.literal, USER_VECTOR_VADDR - 4)
120 SECTION_VECTOR (.UserExceptionVector.text, USER_VECTOR_VADDR)120 SECTION_VECTOR (.UserExceptionVector.text, USER_VECTOR_VADDR)
121 SECTION_VECTOR (.DoubleExceptionVector.literal, DOUBLEEXC_VECTOR_VADDR - 48)121 SECTION_VECTOR (.DoubleExceptionVector.literal, DOUBLEEXC_VECTOR_VADDR - 20)
122 SECTION_VECTOR (.DoubleExceptionVector.text, DOUBLEEXC_VECTOR_VADDR)122 SECTION_VECTOR (.DoubleExceptionVector.text, DOUBLEEXC_VECTOR_VADDR)
123#endif123#endif
124 124
@@ -306,13 +306,13 @@ SECTIONS · 181 unmodified lines
306 .UserExceptionVector.literal)306 .UserExceptionVector.literal)
307 SECTION_VECTOR (_DoubleExceptionVector_literal,307 SECTION_VECTOR (_DoubleExceptionVector_literal,
308 .DoubleExceptionVector.literal,308 .DoubleExceptionVector.literal,
309 DOUBLEEXC_VECTOR_VADDR - 48,309 DOUBLEEXC_VECTOR_VADDR - 20,
310 SIZEOF(.UserExceptionVector.text),310 SIZEOF(.UserExceptionVector.text),
311 .UserExceptionVector.text)311 .UserExceptionVector.text)
312 SECTION_VECTOR (_DoubleExceptionVector_text,312 SECTION_VECTOR (_DoubleExceptionVector_text,
313 .DoubleExceptionVector.text,313 .DoubleExceptionVector.text,
314 DOUBLEEXC_VECTOR_VADDR,314 DOUBLEEXC_VECTOR_VADDR,
315 48,315 20,
316 .DoubleExceptionVector.literal)316 .DoubleExceptionVector.literal)
317 317
318 . = (LOADADDR( .DoubleExceptionVector.text ) + SIZEOF( .DoubleExceptionVector.text ) + 3) & ~ 3;318 . = (LOADADDR( .DoubleExceptionVector.text ) + SIZEOF( .DoubleExceptionVector.text ) + 3) & ~ 3;
arch/xtensa/platforms/iss/simdisk.c+1−2
@@ -317,8 +317,7 @@ static int __init simdisk_init(void) · 316 unmodified lines
317 if (simdisk_count > MAX_SIMDISK_COUNT)317 if (simdisk_count > MAX_SIMDISK_COUNT)
318 simdisk_count = MAX_SIMDISK_COUNT;318 simdisk_count = MAX_SIMDISK_COUNT;
319 319
320 sddev = kmalloc(simdisk_count * sizeof(struct simdisk),320 sddev = kmalloc_array(simdisk_count, sizeof(*sddev), GFP_KERNEL);
321 GFP_KERNEL);
322 if (sddev == NULL)321 if (sddev == NULL)
323 goto out_unregister;322 goto out_unregister;
324 323
arch/xtensa/platforms/xtfpga/include/platform/hardware.h+4−2
@@ -24,16 +24,18 @@ · 23 unmodified lines
24 24
25/* Interrupt configuration. */25/* Interrupt configuration. */
26 26
27#define PLATFORM_NR_IRQS 1027#define PLATFORM_NR_IRQS 0
28 28
29/* Default assignment of LX60 devices to external interrupts. */29/* Default assignment of LX60 devices to external interrupts. */
30 30
31#ifdef CONFIG_XTENSA_MX31#ifdef CONFIG_XTENSA_MX
32#define DUART16552_INTNUM XCHAL_EXTINT3_NUM32#define DUART16552_INTNUM XCHAL_EXTINT3_NUM
33#define OETH_IRQ XCHAL_EXTINT4_NUM33#define OETH_IRQ XCHAL_EXTINT4_NUM
34#define C67X00_IRQ XCHAL_EXTINT8_NUM
34#else35#else
35#define DUART16552_INTNUM XCHAL_EXTINT0_NUM36#define DUART16552_INTNUM XCHAL_EXTINT0_NUM
36#define OETH_IRQ XCHAL_EXTINT1_NUM37#define OETH_IRQ XCHAL_EXTINT1_NUM
38#define C67X00_IRQ XCHAL_EXTINT5_NUM
37#endif39#endif
38 40
39/*41/*
@@ -63,5 +65,5 @@ · 23 unmodified lines
63 65
64#define C67X00_PADDR (XCHAL_KIO_PADDR + 0x0D0D0000)66#define C67X00_PADDR (XCHAL_KIO_PADDR + 0x0D0D0000)
65#define C67X00_SIZE 0x1067#define C67X00_SIZE 0x10
66#define C67X00_IRQ 568
67#endif /* __XTENSA_XTAVNET_HARDWARE_H */69#endif /* __XTENSA_XTAVNET_HARDWARE_H */
arch/xtensa/platforms/xtfpga/setup.c+5−5
@@ -175,8 +175,8 @@ static struct resource ethoc_res[] = { · 174 unmodified lines
175 .flags = IORESOURCE_MEM,175 .flags = IORESOURCE_MEM,
176 },176 },
177 [2] = { /* IRQ number */177 [2] = { /* IRQ number */
178 .start = OETH_IRQ,178 .start = XTENSA_PIC_LINUX_IRQ(OETH_IRQ),
179 .end = OETH_IRQ,179 .end = XTENSA_PIC_LINUX_IRQ(OETH_IRQ),
180 .flags = IORESOURCE_IRQ,180 .flags = IORESOURCE_IRQ,
181 },181 },
182};182};
@@ -213,8 +213,8 @@ static struct resource c67x00_res[] = { · 30 unmodified lines
213 .flags = IORESOURCE_MEM,213 .flags = IORESOURCE_MEM,
214 },214 },
215 [1] = { /* IRQ number */215 [1] = { /* IRQ number */
216 .start = C67X00_IRQ,216 .start = XTENSA_PIC_LINUX_IRQ(C67X00_IRQ),
217 .end = C67X00_IRQ,217 .end = XTENSA_PIC_LINUX_IRQ(C67X00_IRQ),
218 .flags = IORESOURCE_IRQ,218 .flags = IORESOURCE_IRQ,
219 },219 },
220};220};
@@ -247,7 +247,7 @@ static struct resource serial_resource = { · 26 unmodified lines
247static struct plat_serial8250_port serial_platform_data[] = {247static struct plat_serial8250_port serial_platform_data[] = {
248 [0] = {248 [0] = {
249 .mapbase = DUART16552_PADDR,249 .mapbase = DUART16552_PADDR,
250 .irq = DUART16552_INTNUM,250 .irq = XTENSA_PIC_LINUX_IRQ(DUART16552_INTNUM),
251 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |251 .flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST |
252 UPF_IOREMAP,252 UPF_IOREMAP,
253 .iotype = XCHAL_HAVE_BE ? UPIO_MEM32BE : UPIO_MEM32,253 .iotype = XCHAL_HAVE_BE ? UPIO_MEM32BE : UPIO_MEM32,
block/bfq-cgroup.c+93−23
@@ -52,7 +52,7 @@ BFQG_FLAG_FNS(idling) · 51 unmodified lines
52BFQG_FLAG_FNS(empty)52BFQG_FLAG_FNS(empty)
53#undef BFQG_FLAG_FNS53#undef BFQG_FLAG_FNS
54 54
55/* This should be called with the queue_lock held. */55/* This should be called with the scheduler lock held. */
56static void bfqg_stats_update_group_wait_time(struct bfqg_stats *stats)56static void bfqg_stats_update_group_wait_time(struct bfqg_stats *stats)
57{57{
58 unsigned long long now;58 unsigned long long now;
@@ -67,7 +67,7 @@ static void bfqg_stats_update_group_wait_time(struct bfqg_stats *stats) · 8 unmodified lines
67 bfqg_stats_clear_waiting(stats);67 bfqg_stats_clear_waiting(stats);
68}68}
69 69
70/* This should be called with the queue_lock held. */70/* This should be called with the scheduler lock held. */
71static void bfqg_stats_set_start_group_wait_time(struct bfq_group *bfqg,71static void bfqg_stats_set_start_group_wait_time(struct bfq_group *bfqg,
72 struct bfq_group *curr_bfqg)72 struct bfq_group *curr_bfqg)
73{73{
@@ -81,7 +81,7 @@ static void bfqg_stats_set_start_group_wait_time(struct bfq_group *bfqg, · 7 unmodified lines
81 bfqg_stats_mark_waiting(stats);81 bfqg_stats_mark_waiting(stats);
82}82}
83 83
84/* This should be called with the queue_lock held. */84/* This should be called with the scheduler lock held. */
85static void bfqg_stats_end_empty_time(struct bfqg_stats *stats)85static void bfqg_stats_end_empty_time(struct bfqg_stats *stats)
86{86{
87 unsigned long long now;87 unsigned long long now;
@@ -203,12 +203,30 @@ struct bfq_group *bfqq_group(struct bfq_queue *bfqq) · 115 unmodified lines
203 203
204static void bfqg_get(struct bfq_group *bfqg)204static void bfqg_get(struct bfq_group *bfqg)
205{205{
206 return blkg_get(bfqg_to_blkg(bfqg));206 bfqg->ref++;
207}207}
208 208
209void bfqg_put(struct bfq_group *bfqg)209void bfqg_put(struct bfq_group *bfqg)
210{210{
211 return blkg_put(bfqg_to_blkg(bfqg));211 bfqg->ref--;
212
213 if (bfqg->ref == 0)
214 kfree(bfqg);
215}
216
217static void bfqg_and_blkg_get(struct bfq_group *bfqg)
218{
219 /* see comments in bfq_bic_update_cgroup for why refcounting bfqg */
220 bfqg_get(bfqg);
221
222 blkg_get(bfqg_to_blkg(bfqg));
223}
224
225void bfqg_and_blkg_put(struct bfq_group *bfqg)
226{
227 bfqg_put(bfqg);
228
229 blkg_put(bfqg_to_blkg(bfqg));
212}230}
213 231
214void bfqg_stats_update_io_add(struct bfq_group *bfqg, struct bfq_queue *bfqq,232void bfqg_stats_update_io_add(struct bfq_group *bfqg, struct bfq_queue *bfqq,
@@ -312,7 +330,11 @@ void bfq_init_entity(struct bfq_entity *entity, struct bfq_group *bfqg) · 97 unmodified lines
312 if (bfqq) {330 if (bfqq) {
313 bfqq->ioprio = bfqq->new_ioprio;331 bfqq->ioprio = bfqq->new_ioprio;
314 bfqq->ioprio_class = bfqq->new_ioprio_class;332 bfqq->ioprio_class = bfqq->new_ioprio_class;
315 bfqg_get(bfqg);333 /*
334 * Make sure that bfqg and its associated blkg do not
335 * disappear before entity.
336 */
337 bfqg_and_blkg_get(bfqg);
316 }338 }
317 entity->parent = bfqg->my_entity; /* NULL for root group */339 entity->parent = bfqg->my_entity; /* NULL for root group */
318 entity->sched_data = &bfqg->sched_data;340 entity->sched_data = &bfqg->sched_data;
@@ -399,6 +421,8 @@ struct blkg_policy_data *bfq_pd_alloc(gfp_t gfp, int node) · 80 unmodified lines
399 return NULL;421 return NULL;
400 }422 }
401 423
424 /* see comments in bfq_bic_update_cgroup for why refcounting */
425 bfqg_get(bfqg);
402 return &bfqg->pd;426 return &bfqg->pd;
403}427}
404 428
@@ -426,7 +450,7 @@ void bfq_pd_free(struct blkg_policy_data *pd) · 21 unmodified lines
426 struct bfq_group *bfqg = pd_to_bfqg(pd);450 struct bfq_group *bfqg = pd_to_bfqg(pd);
427 451
428 bfqg_stats_exit(&bfqg->stats);452 bfqg_stats_exit(&bfqg->stats);
429 return kfree(bfqg);453 bfqg_put(bfqg);
430}454}
431 455
432void bfq_pd_reset_stats(struct blkg_policy_data *pd)456void bfq_pd_reset_stats(struct blkg_policy_data *pd)
@@ -496,9 +520,10 @@ struct bfq_group *bfq_find_set_group(struct bfq_data *bfqd, · 63 unmodified lines
496 * Move @bfqq to @bfqg, deactivating it from its old group and reactivating520 * Move @bfqq to @bfqg, deactivating it from its old group and reactivating
497 * it on the new one. Avoid putting the entity on the old group idle tree.521 * it on the new one. Avoid putting the entity on the old group idle tree.
498 *522 *
499 * Must be called under the queue lock; the cgroup owning @bfqg must523 * Must be called under the scheduler lock, to make sure that the blkg
500 * not disappear (by now this just means that we are called under524 * owning @bfqg does not disappear (see comments in
501 * rcu_read_lock()).525 * bfq_bic_update_cgroup on guaranteeing the consistency of blkg
526 * objects).
502 */527 */
503void bfq_bfqq_move(struct bfq_data *bfqd, struct bfq_queue *bfqq,528void bfq_bfqq_move(struct bfq_data *bfqd, struct bfq_queue *bfqq,
504 struct bfq_group *bfqg)529 struct bfq_group *bfqg)
@@ -519,16 +544,12 @@ void bfq_bfqq_move(struct bfq_data *bfqd, struct bfq_queue *bfqq, · 14 unmodified lines
519 bfq_deactivate_bfqq(bfqd, bfqq, false, false);544 bfq_deactivate_bfqq(bfqd, bfqq, false, false);
520 else if (entity->on_st)545 else if (entity->on_st)
521 bfq_put_idle_entity(bfq_entity_service_tree(entity), entity);546 bfq_put_idle_entity(bfq_entity_service_tree(entity), entity);
522 bfqg_put(bfqq_group(bfqq));547 bfqg_and_blkg_put(bfqq_group(bfqq));
523 548
524 /*
525 * Here we use a reference to bfqg. We don't need a refcounter
526 * as the cgroup reference will not be dropped, so that its
527 * destroy() callback will not be invoked.
528 */
529 entity->parent = bfqg->my_entity;549 entity->parent = bfqg->my_entity;
530 entity->sched_data = &bfqg->sched_data;550 entity->sched_data = &bfqg->sched_data;
531 bfqg_get(bfqg);551 /* pin down bfqg and its associated blkg */
552 bfqg_and_blkg_get(bfqg);
532 553
533 if (bfq_bfqq_busy(bfqq)) {554 if (bfq_bfqq_busy(bfqq)) {
534 bfq_pos_tree_add_move(bfqd, bfqq);555 bfq_pos_tree_add_move(bfqd, bfqq);
@@ -545,8 +566,9 @@ void bfq_bfqq_move(struct bfq_data *bfqd, struct bfq_queue *bfqq, · 10 unmodified lines
545 * @bic: the bic to move.566 * @bic: the bic to move.
546 * @blkcg: the blk-cgroup to move to.567 * @blkcg: the blk-cgroup to move to.
547 *568 *
548 * Move bic to blkcg, assuming that bfqd->queue is locked; the caller569 * Move bic to blkcg, assuming that bfqd->lock is held; which makes
549 * has to make sure that the reference to cgroup is valid across the call.570 * sure that the reference to cgroup is valid across the call (see
571 * comments in bfq_bic_update_cgroup on this issue)
550 *572 *
551 * NOTE: an alternative approach might have been to store the current573 * NOTE: an alternative approach might have been to store the current
552 * cgroup in bfqq and getting a reference to it, reducing the lookup574 * cgroup in bfqq and getting a reference to it, reducing the lookup
@@ -604,6 +626,57 @@ void bfq_bic_update_cgroup(struct bfq_io_cq *bic, struct bio *bio) · 51 unmodified lines
604 goto out;626 goto out;
605 627
606 bfqg = __bfq_bic_change_cgroup(bfqd, bic, bio_blkcg(bio));628 bfqg = __bfq_bic_change_cgroup(bfqd, bic, bio_blkcg(bio));
629 /*
630 * Update blkg_path for bfq_log_* functions. We cache this
631 * path, and update it here, for the following
632 * reasons. Operations on blkg objects in blk-cgroup are
633 * protected with the request_queue lock, and not with the
634 * lock that protects the instances of this scheduler
635 * (bfqd->lock). This exposes BFQ to the following sort of
636 * race.
637 *
638 * The blkg_lookup performed in bfq_get_queue, protected
639 * through rcu, may happen to return the address of a copy of
640 * the original blkg. If this is the case, then the
641 * bfqg_and_blkg_get performed in bfq_get_queue, to pin down
642 * the blkg, is useless: it does not prevent blk-cgroup code
643 * from destroying both the original blkg and all objects
644 * directly or indirectly referred by the copy of the
645 * blkg.
646 *
647 * On the bright side, destroy operations on a blkg invoke, as
648 * a first step, hooks of the scheduler associated with the
649 * blkg. And these hooks are executed with bfqd->lock held for
650 * BFQ. As a consequence, for any blkg associated with the
651 * request queue this instance of the scheduler is attached
652 * to, we are guaranteed that such a blkg is not destroyed, and
653 * that all the pointers it contains are consistent, while we
654 * are holding bfqd->lock. A blkg_lookup performed with
655 * bfqd->lock held then returns a fully consistent blkg, which
656 * remains consistent until this lock is held.
657 *
658 * Thanks to the last fact, and to the fact that: (1) bfqg has
659 * been obtained through a blkg_lookup in the above
660 * assignment, and (2) bfqd->lock is being held, here we can
661 * safely use the policy data for the involved blkg (i.e., the
662 * field bfqg->pd) to get to the blkg associated with bfqg,
663 * and then we can safely use any field of blkg. After we
664 * release bfqd->lock, even just getting blkg through this
665 * bfqg may cause dangling references to be traversed, as
666 * bfqg->pd may not exist any more.
667 *
668 * In view of the above facts, here we cache, in the bfqg, any
669 * blkg data we may need for this bic, and for its associated
670 * bfq_queue. As of now, we need to cache only the path of the
671 * blkg, which is used in the bfq_log_* functions.
672 *
673 * Finally, note that bfqg itself needs to be protected from
674 * destruction on the blkg_free of the original blkg (which
675 * invokes bfq_pd_free). We use an additional private
676 * refcounter for bfqg, to let it disappear only after no
677 * bfq_queue refers to it any longer.
678 */
679 blkg_path(bfqg_to_blkg(bfqg), bfqg->blkg_path, sizeof(bfqg->blkg_path));
607 bic->blkcg_serial_nr = serial_nr;680 bic->blkcg_serial_nr = serial_nr;
608out:681out:
609 rcu_read_unlock();682 rcu_read_unlock();
@@ -640,8 +713,6 @@ static void bfq_reparent_leaf_entity(struct bfq_data *bfqd, · 30 unmodified lines
640 * @bfqd: the device data structure with the root group.713 * @bfqd: the device data structure with the root group.
641 * @bfqg: the group to move from.714 * @bfqg: the group to move from.
642 * @st: the service tree with the entities.715 * @st: the service tree with the entities.
643 *
644 * Needs queue_lock to be taken and reference to be valid over the call.
645 */716 */
646static void bfq_reparent_active_entities(struct bfq_data *bfqd,717static void bfq_reparent_active_entities(struct bfq_data *bfqd,
647 struct bfq_group *bfqg,718 struct bfq_group *bfqg,
@@ -692,8 +763,7 @@ void bfq_pd_offline(struct blkg_policy_data *pd) · 44 unmodified lines
692 /*763 /*
693 * The idle tree may still contain bfq_queues belonging764 * The idle tree may still contain bfq_queues belonging
694 * to exited task because they never migrated to a different765 * to exited task because they never migrated to a different
695 * cgroup from the one being destroyed now. No one else766 * cgroup from the one being destroyed now.
696 * can access them so it's safe to act without any lock.
697 */767 */
698 bfq_flush_idle_tree(st);768 bfq_flush_idle_tree(st);
699 769
block/bfq-iosched.c+1−1
@@ -3665,7 +3665,7 @@ void bfq_put_queue(struct bfq_queue *bfqq) · 3664 unmodified lines
3665 3665
3666 kmem_cache_free(bfq_pool, bfqq);3666 kmem_cache_free(bfq_pool, bfqq);
3667#ifdef CONFIG_BFQ_GROUP_IOSCHED3667#ifdef CONFIG_BFQ_GROUP_IOSCHED
3668 bfqg_put(bfqg);3668 bfqg_and_blkg_put(bfqg);
3669#endif3669#endif
3670}3670}
3671 3671
block/bfq-iosched.h+11−12
@@ -759,6 +759,12 @@ struct bfq_group { · 758 unmodified lines
759 /* must be the first member */759 /* must be the first member */
760 struct blkg_policy_data pd;760 struct blkg_policy_data pd;
761 761
762 /* cached path for this blkg (see comments in bfq_bic_update_cgroup) */
763 char blkg_path[128];
764
765 /* reference counter (see comments in bfq_bic_update_cgroup) */
766 int ref;
767
762 struct bfq_entity entity;768 struct bfq_entity entity;
763 struct bfq_sched_data sched_data;769 struct bfq_sched_data sched_data;
764 770
@@ -838,7 +844,7 @@ struct bfq_group *bfq_find_set_group(struct bfq_data *bfqd, · 73 unmodified lines
838struct blkcg_gq *bfqg_to_blkg(struct bfq_group *bfqg);844struct blkcg_gq *bfqg_to_blkg(struct bfq_group *bfqg);
839struct bfq_group *bfqq_group(struct bfq_queue *bfqq);845struct bfq_group *bfqq_group(struct bfq_queue *bfqq);
840struct bfq_group *bfq_create_group_hierarchy(struct bfq_data *bfqd, int node);846struct bfq_group *bfq_create_group_hierarchy(struct bfq_data *bfqd, int node);
841void bfqg_put(struct bfq_group *bfqg);847void bfqg_and_blkg_put(struct bfq_group *bfqg);
842 848
843#ifdef CONFIG_BFQ_GROUP_IOSCHED849#ifdef CONFIG_BFQ_GROUP_IOSCHED
844extern struct cftype bfq_blkcg_legacy_files[];850extern struct cftype bfq_blkcg_legacy_files[];
@@ -910,20 +916,13 @@ void bfq_add_bfqq_busy(struct bfq_data *bfqd, struct bfq_queue *bfqq); · 65 unmodified lines
910struct bfq_group *bfqq_group(struct bfq_queue *bfqq);916struct bfq_group *bfqq_group(struct bfq_queue *bfqq);
911 917
912#define bfq_log_bfqq(bfqd, bfqq, fmt, args...) do { \918#define bfq_log_bfqq(bfqd, bfqq, fmt, args...) do { \
913 char __pbuf[128]; \919 blk_add_trace_msg((bfqd)->queue, "bfq%d%c %s " fmt, (bfqq)->pid,\
914 \
915 blkg_path(bfqg_to_blkg(bfqq_group(bfqq)), __pbuf, sizeof(__pbuf)); \
916 blk_add_trace_msg((bfqd)->queue, "bfq%d%c %s " fmt, (bfqq)->pid, \
917 bfq_bfqq_sync((bfqq)) ? 'S' : 'A', \920 bfq_bfqq_sync((bfqq)) ? 'S' : 'A', \
918 __pbuf, ##args); \921 bfqq_group(bfqq)->blkg_path, ##args); \
919} while (0)922} while (0)
920 923
921#define bfq_log_bfqg(bfqd, bfqg, fmt, args...) do { \924#define bfq_log_bfqg(bfqd, bfqg, fmt, args...) \
922 char __pbuf[128]; \925 blk_add_trace_msg((bfqd)->queue, "%s " fmt, (bfqg)->blkg_path, ##args)
923 \
924 blkg_path(bfqg_to_blkg(bfqg), __pbuf, sizeof(__pbuf)); \
925 blk_add_trace_msg((bfqd)->queue, "%s " fmt, __pbuf, ##args); \
926} while (0)
927 926
928#else /* CONFIG_BFQ_GROUP_IOSCHED */927#else /* CONFIG_BFQ_GROUP_IOSCHED */
929 928
block/bio-integrity.c+3−0
@@ -175,6 +175,9 @@ bool bio_integrity_enabled(struct bio *bio) · 174 unmodified lines
175 if (bio_op(bio) != REQ_OP_READ && bio_op(bio) != REQ_OP_WRITE)175 if (bio_op(bio) != REQ_OP_READ && bio_op(bio) != REQ_OP_WRITE)
176 return false;176 return false;
177 177
178 if (!bio_sectors(bio))
179 return false;
180
178 /* Already protected? */181 /* Already protected? */
179 if (bio_integrity(bio))182 if (bio_integrity(bio))
180 return false;183 return false;
block/blk-cgroup.c+1−1
@@ -74,7 +74,7 @@ static void blkg_free(struct blkcg_gq *blkg) · 73 unmodified lines
74 blkcg_policy[i]->pd_free_fn(blkg->pd[i]);74 blkcg_policy[i]->pd_free_fn(blkg->pd[i]);
75 75
76 if (blkg->blkcg != &blkcg_root)76 if (blkg->blkcg != &blkcg_root)
77 blk_exit_rl(&blkg->rl);77 blk_exit_rl(blkg->q, &blkg->rl);
78 78
79 blkg_rwstat_exit(&blkg->stat_ios);79 blkg_rwstat_exit(&blkg->stat_ios);
80 blkg_rwstat_exit(&blkg->stat_bytes);80 blkg_rwstat_exit(&blkg->stat_bytes);
block/blk-core.c+8−2
@@ -648,13 +648,19 @@ int blk_init_rl(struct request_list *rl, struct request_queue *q, · 647 unmodified lines
648 if (!rl->rq_pool)648 if (!rl->rq_pool)
649 return -ENOMEM;649 return -ENOMEM;
650 650
651 if (rl != &q->root_rl)
652 WARN_ON_ONCE(!blk_get_queue(q));
653
651 return 0;654 return 0;
652}655}
653 656
654void blk_exit_rl(struct request_list *rl)657void blk_exit_rl(struct request_queue *q, struct request_list *rl)
655{658{
656 if (rl->rq_pool)659 if (rl->rq_pool) {
657 mempool_destroy(rl->rq_pool);660 mempool_destroy(rl->rq_pool);
661 if (rl != &q->root_rl)
662 blk_put_queue(q);
663 }
658}664}
659 665
660struct request_queue *blk_alloc_queue(gfp_t gfp_mask)666struct request_queue *blk_alloc_queue(gfp_t gfp_mask)
block/blk-mq.c+26−9
@@ -1461,22 +1461,28 @@ static blk_qc_t request_to_qc_t(struct blk_mq_hw_ctx *hctx, struct request *rq) · 1460 unmodified lines
1461 return blk_tag_to_qc_t(rq->internal_tag, hctx->queue_num, true);1461 return blk_tag_to_qc_t(rq->internal_tag, hctx->queue_num, true);
1462}1462}
1463 1463
1464static void __blk_mq_try_issue_directly(struct request *rq, blk_qc_t *cookie,1464static void __blk_mq_try_issue_directly(struct blk_mq_hw_ctx *hctx,
1465 bool may_sleep)1465 struct request *rq,
1466 blk_qc_t *cookie, bool may_sleep)
1466{1467{
1467 struct request_queue *q = rq->q;1468 struct request_queue *q = rq->q;
1468 struct blk_mq_queue_data bd = {1469 struct blk_mq_queue_data bd = {
1469 .rq = rq,1470 .rq = rq,
1470 .last = true,1471 .last = true,
1471 };1472 };
1472 struct blk_mq_hw_ctx *hctx;
1473 blk_qc_t new_cookie;1473 blk_qc_t new_cookie;
1474 int ret;1474 int ret;
1475 bool run_queue = true;
1476
1477 if (blk_mq_hctx_stopped(hctx)) {
1478 run_queue = false;
1479 goto insert;
1480 }
1475 1481
1476 if (q->elevator)1482 if (q->elevator)
1477 goto insert;1483 goto insert;
1478 1484
1479 if (!blk_mq_get_driver_tag(rq, &hctx, false))1485 if (!blk_mq_get_driver_tag(rq, NULL, false))
1480 goto insert;1486 goto insert;
1481 1487
1482 new_cookie = request_to_qc_t(hctx, rq);1488 new_cookie = request_to_qc_t(hctx, rq);
@@ -1500,7 +1506,7 @@ static void __blk_mq_try_issue_directly(struct request *rq, blk_qc_t *cookie, · 17 unmodified lines
1500 1506
1501 __blk_mq_requeue_request(rq);1507 __blk_mq_requeue_request(rq);
1502insert:1508insert:
1503 blk_mq_sched_insert_request(rq, false, true, false, may_sleep);1509 blk_mq_sched_insert_request(rq, false, run_queue, false, may_sleep);
1504}1510}
1505 1511
1506static void blk_mq_try_issue_directly(struct blk_mq_hw_ctx *hctx,1512static void blk_mq_try_issue_directly(struct blk_mq_hw_ctx *hctx,
@@ -1508,7 +1514,7 @@ static void blk_mq_try_issue_directly(struct blk_mq_hw_ctx *hctx, · 1 unmodified line
1508{1514{
1509 if (!(hctx->flags & BLK_MQ_F_BLOCKING)) {1515 if (!(hctx->flags & BLK_MQ_F_BLOCKING)) {
1510 rcu_read_lock();1516 rcu_read_lock();
1511 __blk_mq_try_issue_directly(rq, cookie, false);1517 __blk_mq_try_issue_directly(hctx, rq, cookie, false);
1512 rcu_read_unlock();1518 rcu_read_unlock();
1513 } else {1519 } else {
1514 unsigned int srcu_idx;1520 unsigned int srcu_idx;
@@ -1516,7 +1522,7 @@ static void blk_mq_try_issue_directly(struct blk_mq_hw_ctx *hctx, · 1 unmodified line
1516 might_sleep();1522 might_sleep();
1517 1523
1518 srcu_idx = srcu_read_lock(&hctx->queue_rq_srcu);1524 srcu_idx = srcu_read_lock(&hctx->queue_rq_srcu);
1519 __blk_mq_try_issue_directly(rq, cookie, true);1525 __blk_mq_try_issue_directly(hctx, rq, cookie, true);
1520 srcu_read_unlock(&hctx->queue_rq_srcu, srcu_idx);1526 srcu_read_unlock(&hctx->queue_rq_srcu, srcu_idx);
1521 }1527 }
1522}1528}
@@ -1619,9 +1625,12 @@ static blk_qc_t blk_mq_make_request(struct request_queue *q, struct bio *bio) · 96 unmodified lines
1619 1625
1620 blk_mq_put_ctx(data.ctx);1626 blk_mq_put_ctx(data.ctx);
1621 1627
1622 if (same_queue_rq)1628 if (same_queue_rq) {
1629 data.hctx = blk_mq_map_queue(q,
1630 same_queue_rq->mq_ctx->cpu);
1623 blk_mq_try_issue_directly(data.hctx, same_queue_rq,1631 blk_mq_try_issue_directly(data.hctx, same_queue_rq,
1624 &cookie);1632 &cookie);
1633 }
1625 } else if (q->nr_hw_queues > 1 && is_sync) {1634 } else if (q->nr_hw_queues > 1 && is_sync) {
1626 blk_mq_put_ctx(data.ctx);1635 blk_mq_put_ctx(data.ctx);
1627 blk_mq_bio_to_request(rq, bio);1636 blk_mq_bio_to_request(rq, bio);
@@ -2641,7 +2650,8 @@ int blk_mq_update_nr_requests(struct request_queue *q, unsigned int nr) · 1013 unmodified lines
2641 return ret;2650 return ret;
2642}2651}
2643 2652
2644void blk_mq_update_nr_hw_queues(struct blk_mq_tag_set *set, int nr_hw_queues)2653static void __blk_mq_update_nr_hw_queues(struct blk_mq_tag_set *set,
2654 int nr_hw_queues)
2645{2655{
2646 struct request_queue *q;2656 struct request_queue *q;
2647 2657
@@ -2665,6 +2675,13 @@ void blk_mq_update_nr_hw_queues(struct blk_mq_tag_set *set, int nr_hw_queues) · 17 unmodified lines
2665 list_for_each_entry(q, &set->tag_list, tag_set_list)2675 list_for_each_entry(q, &set->tag_list, tag_set_list)
2666 blk_mq_unfreeze_queue(q);2676 blk_mq_unfreeze_queue(q);
2667}2677}
2678
2679void blk_mq_update_nr_hw_queues(struct blk_mq_tag_set *set, int nr_hw_queues)
2680{
2681 mutex_lock(&set->tag_list_lock);
2682 __blk_mq_update_nr_hw_queues(set, nr_hw_queues);
2683 mutex_unlock(&set->tag_list_lock);
2684}
2668EXPORT_SYMBOL_GPL(blk_mq_update_nr_hw_queues);2685EXPORT_SYMBOL_GPL(blk_mq_update_nr_hw_queues);
2669 2686
2670/* Enable polling stats and return whether they were already enabled. */2687/* Enable polling stats and return whether they were already enabled. */
block/blk-sysfs.c+23−13
@@ -777,24 +777,25 @@ static void blk_free_queue_rcu(struct rcu_head *rcu_head) · 776 unmodified lines
777}777}
778 778
779/**779/**
780 * blk_release_queue: - release a &struct request_queue when it is no longer needed780 * __blk_release_queue - release a request queue when it is no longer needed
781 * @kobj: the kobj belonging to the request queue to be released781 * @work: pointer to the release_work member of the request queue to be released
782 *782 *
783 * Description:783 * Description:
784 * blk_release_queue is the pair to blk_init_queue() or784 * blk_release_queue is the counterpart of blk_init_queue(). It should be
785 * blk_queue_make_request(). It should be called when a request queue is785 * called when a request queue is being released; typically when a block
786 * being released; typically when a block device is being de-registered.786 * device is being de-registered. Its primary task it to free the queue
787 * Currently, its primary task it to free all the &struct request787 * itself.
788 * structures that were allocated to the queue and the queue itself.
789 *788 *
790 * Note:789 * Notes:
791 * The low level driver must have finished any outstanding requests first790 * The low level driver must have finished any outstanding requests first
792 * via blk_cleanup_queue().791 * via blk_cleanup_queue().
793 **/792 *
794static void blk_release_queue(struct kobject *kobj)793 * Although blk_release_queue() may be called with preemption disabled,
794 * __blk_release_queue() may sleep.
795 */
796static void __blk_release_queue(struct work_struct *work)
795{797{
796 struct request_queue *q =798 struct request_queue *q = container_of(work, typeof(*q), release_work);
797 container_of(kobj, struct request_queue, kobj);
798 799
799 if (test_bit(QUEUE_FLAG_POLL_STATS, &q->queue_flags))800 if (test_bit(QUEUE_FLAG_POLL_STATS, &q->queue_flags))
800 blk_stat_remove_callback(q, q->poll_cb);801 blk_stat_remove_callback(q, q->poll_cb);
@@ -809,7 +810,7 @@ static void blk_release_queue(struct kobject *kobj) · 8 unmodified lines
809 810
810 blk_free_queue_stats(q->stats);811 blk_free_queue_stats(q->stats);
811 812
812 blk_exit_rl(&q->root_rl);813 blk_exit_rl(q, &q->root_rl);
813 814
814 if (q->queue_tags)815 if (q->queue_tags)
815 __blk_queue_free_tags(q);816 __blk_queue_free_tags(q);
@@ -834,6 +835,15 @@ static void blk_release_queue(struct kobject *kobj) · 18 unmodified lines
834 call_rcu(&q->rcu_head, blk_free_queue_rcu);835 call_rcu(&q->rcu_head, blk_free_queue_rcu);
835}836}
836 837
838static void blk_release_queue(struct kobject *kobj)
839{
840 struct request_queue *q =
841 container_of(kobj, struct request_queue, kobj);
842
843 INIT_WORK(&q->release_work, __blk_release_queue);
844 schedule_work(&q->release_work);
845}
846
837static const struct sysfs_ops queue_sysfs_ops = {847static const struct sysfs_ops queue_sysfs_ops = {
838 .show = queue_attr_show,848 .show = queue_attr_show,
839 .store = queue_attr_store,849 .store = queue_attr_store,
block/blk-throttle.c+18−4
@@ -27,6 +27,13 @@ static int throtl_quantum = 32; · 26 unmodified lines
27#define MIN_THROTL_IOPS (10)27#define MIN_THROTL_IOPS (10)
28#define DFL_LATENCY_TARGET (-1L)28#define DFL_LATENCY_TARGET (-1L)
29#define DFL_IDLE_THRESHOLD (0)29#define DFL_IDLE_THRESHOLD (0)
30#define DFL_HD_BASELINE_LATENCY (4000L) /* 4ms */
31#define LATENCY_FILTERED_SSD (0)
32/*
33 * For HD, very small latency comes from sequential IO. Such IO is helpless to
34 * help determine if its IO is impacted by others, hence we ignore the IO
35 */
36#define LATENCY_FILTERED_HD (1000L) /* 1ms */
30 37
31#define SKIP_LATENCY (((u64)1) << BLK_STAT_RES_SHIFT)38#define SKIP_LATENCY (((u64)1) << BLK_STAT_RES_SHIFT)
32 39
@@ -212,6 +219,7 @@ struct throtl_data · 179 unmodified lines
212 struct avg_latency_bucket avg_buckets[LATENCY_BUCKET_SIZE];219 struct avg_latency_bucket avg_buckets[LATENCY_BUCKET_SIZE];
213 struct latency_bucket __percpu *latency_buckets;220 struct latency_bucket __percpu *latency_buckets;
214 unsigned long last_calculate_time;221 unsigned long last_calculate_time;
222 unsigned long filtered_latency;
215 223
216 bool track_bio_latency;224 bool track_bio_latency;
217};225};
@@ -698,7 +706,7 @@ static void throtl_dequeue_tg(struct throtl_grp *tg) · 480 unmodified lines
698static void throtl_schedule_pending_timer(struct throtl_service_queue *sq,706static void throtl_schedule_pending_timer(struct throtl_service_queue *sq,
699 unsigned long expires)707 unsigned long expires)
700{708{
701 unsigned long max_expire = jiffies + 8 * sq_to_tg(sq)->td->throtl_slice;709 unsigned long max_expire = jiffies + 8 * sq_to_td(sq)->throtl_slice;
702 710
703 /*711 /*
704 * Since we are adjusting the throttle limit dynamically, the sleep712 * Since we are adjusting the throttle limit dynamically, the sleep
@@ -2281,7 +2289,7 @@ void blk_throtl_bio_endio(struct bio *bio) · 1576 unmodified lines
2281 throtl_track_latency(tg->td, blk_stat_size(&bio->bi_issue_stat),2289 throtl_track_latency(tg->td, blk_stat_size(&bio->bi_issue_stat),
2282 bio_op(bio), lat);2290 bio_op(bio), lat);
2283 2291
2284 if (tg->latency_target) {2292 if (tg->latency_target && lat >= tg->td->filtered_latency) {
2285 int bucket;2293 int bucket;
2286 unsigned int threshold;2294 unsigned int threshold;
2287 2295
@@ -2417,14 +2425,20 @@ void blk_throtl_exit(struct request_queue *q) · 129 unmodified lines
2417void blk_throtl_register_queue(struct request_queue *q)2425void blk_throtl_register_queue(struct request_queue *q)
2418{2426{
2419 struct throtl_data *td;2427 struct throtl_data *td;
2428 int i;
2420 2429
2421 td = q->td;2430 td = q->td;
2422 BUG_ON(!td);2431 BUG_ON(!td);
2423 2432
2424 if (blk_queue_nonrot(q))2433 if (blk_queue_nonrot(q)) {
2425 td->throtl_slice = DFL_THROTL_SLICE_SSD;2434 td->throtl_slice = DFL_THROTL_SLICE_SSD;
2426 else2435 td->filtered_latency = LATENCY_FILTERED_SSD;
2436 } else {
2427 td->throtl_slice = DFL_THROTL_SLICE_HD;2437 td->throtl_slice = DFL_THROTL_SLICE_HD;
2438 td->filtered_latency = LATENCY_FILTERED_HD;
2439 for (i = 0; i < LATENCY_BUCKET_SIZE; i++)
2440 td->avg_buckets[i].latency = DFL_HD_BASELINE_LATENCY;
2441 }
2428#ifndef CONFIG_BLK_DEV_THROTTLING_LOW2442#ifndef CONFIG_BLK_DEV_THROTTLING_LOW
2429 /* if no low limit, use previous default */2443 /* if no low limit, use previous default */
2430 td->throtl_slice = DFL_THROTL_SLICE_HD;2444 td->throtl_slice = DFL_THROTL_SLICE_HD;
block/blk.h+1−1
@@ -59,7 +59,7 @@ void blk_free_flush_queue(struct blk_flush_queue *q); · 58 unmodified lines
59 59
60int blk_init_rl(struct request_list *rl, struct request_queue *q,60int blk_init_rl(struct request_list *rl, struct request_queue *q,
61 gfp_t gfp_mask);61 gfp_t gfp_mask);
62void blk_exit_rl(struct request_list *rl);62void blk_exit_rl(struct request_queue *q, struct request_list *rl);
63void blk_rq_bio_prep(struct request_queue *q, struct request *rq,63void blk_rq_bio_prep(struct request_queue *q, struct request *rq,
64 struct bio *bio);64 struct bio *bio);
65void blk_queue_bypass_start(struct request_queue *q);65void blk_queue_bypass_start(struct request_queue *q);
block/cfq-iosched.c+15−2
@@ -38,9 +38,13 @@ static const u64 cfq_target_latency = (u64)NSEC_PER_SEC * 3/10; /* 300 ms */ · 37 unmodified lines
38static const int cfq_hist_divisor = 4;38static const int cfq_hist_divisor = 4;
39 39
40/*40/*
41 * offset from end of service tree41 * offset from end of queue service tree for idle class
42 */42 */
43#define CFQ_IDLE_DELAY (NSEC_PER_SEC / 5)43#define CFQ_IDLE_DELAY (NSEC_PER_SEC / 5)
44/* offset from end of group service tree under time slice mode */
45#define CFQ_SLICE_MODE_GROUP_DELAY (NSEC_PER_SEC / 5)
46/* offset from end of group service under IOPS mode */
47#define CFQ_IOPS_MODE_GROUP_DELAY (HZ / 5)
44 48
45/*49/*
46 * below this threshold, we consider thinktime immediate50 * below this threshold, we consider thinktime immediate
@@ -1362,6 +1366,14 @@ cfq_group_service_tree_add(struct cfq_rb_root *st, struct cfq_group *cfqg) · 1315 unmodified lines
1362 cfqg->vfraction = max_t(unsigned, vfr, 1);1366 cfqg->vfraction = max_t(unsigned, vfr, 1);
1363}1367}
1364 1368
1369static inline u64 cfq_get_cfqg_vdisktime_delay(struct cfq_data *cfqd)
1370{
1371 if (!iops_mode(cfqd))
1372 return CFQ_SLICE_MODE_GROUP_DELAY;
1373 else
1374 return CFQ_IOPS_MODE_GROUP_DELAY;
1375}
1376
1365static void1377static void
1366cfq_group_notify_queue_add(struct cfq_data *cfqd, struct cfq_group *cfqg)1378cfq_group_notify_queue_add(struct cfq_data *cfqd, struct cfq_group *cfqg)
1367{1379{
@@ -1381,7 +1393,8 @@ cfq_group_notify_queue_add(struct cfq_data *cfqd, struct cfq_group *cfqg) · 13 unmodified lines
1381 n = rb_last(&st->rb);1393 n = rb_last(&st->rb);
1382 if (n) {1394 if (n) {
1383 __cfqg = rb_entry_cfqg(n);1395 __cfqg = rb_entry_cfqg(n);
1384 cfqg->vdisktime = __cfqg->vdisktime + CFQ_IDLE_DELAY;1396 cfqg->vdisktime = __cfqg->vdisktime +
1397 cfq_get_cfqg_vdisktime_delay(cfqd);
1385 } else1398 } else
1386 cfqg->vdisktime = st->min_vdisktime;1399 cfqg->vdisktime = st->min_vdisktime;
1387 cfq_group_service_tree_add(st, cfqg);1400 cfq_group_service_tree_add(st, cfqg);
crypto/asymmetric_keys/public_key.c+1−1
@@ -141,7 +141,7 @@ int public_key_verify_signature(const struct public_key *pkey, · 140 unmodified lines
141 * signature and returns that to us.141 * signature and returns that to us.
142 */142 */
143 ret = crypto_akcipher_verify(req);143 ret = crypto_akcipher_verify(req);
144 if (ret == -EINPROGRESS) {144 if ((ret == -EINPROGRESS) || (ret == -EBUSY)) {
145 wait_for_completion(&compl.completion);145 wait_for_completion(&compl.completion);
146 ret = compl.err;146 ret = compl.err;
147 }147 }
crypto/asymmetric_keys/verify_pefile.c+2−2
@@ -381,7 +381,7 @@ static int pefile_digest_pe(const void *pebuf, unsigned int pelen, · 380 unmodified lines
381 }381 }
382 382
383error:383error:
384 kfree(desc);384 kzfree(desc);
385error_no_desc:385error_no_desc:
386 crypto_free_shash(tfm);386 crypto_free_shash(tfm);
387 kleave(" = %d", ret);387 kleave(" = %d", ret);
@@ -450,6 +450,6 @@ int verify_pefile_signature(const void *pebuf, unsigned pelen, · 62 unmodified lines
450 ret = pefile_digest_pe(pebuf, pelen, &ctx);450 ret = pefile_digest_pe(pebuf, pelen, &ctx);
451 451
452error:452error:
453 kfree(ctx.digest);453 kzfree(ctx.digest);
454 return ret;454 return ret;
455}455}
crypto/asymmetric_keys/x509_cert_parser.c+1−0
@@ -102,6 +102,7 @@ struct x509_certificate *x509_cert_parse(const void *data, size_t datalen) · 101 unmodified lines
102 }102 }
103 }103 }
104 104
105 ret = -ENOMEM;
105 cert->pub->key = kmemdup(ctx->key, ctx->key_size, GFP_KERNEL);106 cert->pub->key = kmemdup(ctx->key, ctx->key_size, GFP_KERNEL);
106 if (!cert->pub->key)107 if (!cert->pub->key)
107 goto error_decode;108 goto error_decode;
crypto/drbg.c+2−3
@@ -1767,9 +1767,8 @@ static int drbg_kcapi_sym_ctr(struct drbg_state *drbg, · 1766 unmodified lines
1767 break;1767 break;
1768 case -EINPROGRESS:1768 case -EINPROGRESS:
1769 case -EBUSY:1769 case -EBUSY:
1770 ret = wait_for_completion_interruptible(1770 wait_for_completion(&drbg->ctr_completion);
1771 &drbg->ctr_completion);1771 if (!drbg->ctr_async_err) {
1772 if (!ret && !drbg->ctr_async_err) {
1773 reinit_completion(&drbg->ctr_completion);1772 reinit_completion(&drbg->ctr_completion);
1774 break;1773 break;
1775 }1774 }
crypto/gcm.c+2−4
@@ -152,10 +152,8 @@ static int crypto_gcm_setkey(struct crypto_aead *aead, const u8 *key, · 151 unmodified lines
152 152
153 err = crypto_skcipher_encrypt(&data->req);153 err = crypto_skcipher_encrypt(&data->req);
154 if (err == -EINPROGRESS || err == -EBUSY) {154 if (err == -EINPROGRESS || err == -EBUSY) {
155 err = wait_for_completion_interruptible(155 wait_for_completion(&data->result.completion);
156 &data->result.completion);156 err = data->result.err;
157 if (!err)
158 err = data->result.err;
159 }157 }
160 158
161 if (err)159 if (err)
drivers/acpi/acpica/tbutils.c+25−13
@@ -416,13 +416,18 @@ acpi_tb_get_table(struct acpi_table_desc *table_desc, · 415 unmodified lines
416 }416 }
417 }417 }
418 418
419 table_desc->validation_count++;419 if (table_desc->validation_count < ACPI_MAX_TABLE_VALIDATIONS) {
420 if (table_desc->validation_count == 0) {420 table_desc->validation_count++;
421 ACPI_ERROR((AE_INFO,421
422 "Table %p, Validation count is zero after increment\n",422 /*
423 table_desc));423 * Detect validation_count overflows to ensure that the warning
424 table_desc->validation_count--;424 * message will only be printed once.
425 return_ACPI_STATUS(AE_LIMIT);425 */
426 if (table_desc->validation_count >= ACPI_MAX_TABLE_VALIDATIONS) {
427 ACPI_WARNING((AE_INFO,
428 "Table %p, Validation count overflows\n",
429 table_desc));
430 }
426 }431 }
427 432
428 *out_table = table_desc->pointer;433 *out_table = table_desc->pointer;
@@ -449,13 +454,20 @@ void acpi_tb_put_table(struct acpi_table_desc *table_desc) · 20 unmodified lines
449 454
450 ACPI_FUNCTION_TRACE(acpi_tb_put_table);455 ACPI_FUNCTION_TRACE(acpi_tb_put_table);
451 456
452 if (table_desc->validation_count == 0) {457 if (table_desc->validation_count < ACPI_MAX_TABLE_VALIDATIONS) {
453 ACPI_WARNING((AE_INFO,458 table_desc->validation_count--;
454 "Table %p, Validation count is zero before decrement\n",459
455 table_desc));460 /*
456 return_VOID;461 * Detect validation_count underflows to ensure that the warning
462 * message will only be printed once.
463 */
464 if (table_desc->validation_count >= ACPI_MAX_TABLE_VALIDATIONS) {
465 ACPI_WARNING((AE_INFO,
466 "Table %p, Validation count underflows\n",
467 table_desc));
468 return_VOID;
469 }
457 }470 }
458 table_desc->validation_count--;
459 471
460 if (table_desc->validation_count == 0) {472 if (table_desc->validation_count == 0) {
461 473
drivers/acpi/acpica/utresrc.c+0−9
@@ -474,15 +474,6 @@ acpi_ut_walk_aml_resources(struct acpi_walk_state *walk_state, · 473 unmodified lines
474 return_ACPI_STATUS(AE_AML_NO_RESOURCE_END_TAG);474 return_ACPI_STATUS(AE_AML_NO_RESOURCE_END_TAG);
475 }475 }
476 476
477 /*
478 * The end_tag opcode must be followed by a zero byte.
479 * Although this byte is technically defined to be a checksum,
480 * in practice, all ASL compilers set this byte to zero.
481 */
482 if (*(aml + 1) != 0) {
483 return_ACPI_STATUS(AE_AML_NO_RESOURCE_END_TAG);
484 }
485
486 /* Return the pointer to the end_tag if requested */477 /* Return the pointer to the end_tag if requested */
487 478
488 if (!user_function) {479 if (!user_function) {
drivers/acpi/arm64/iort.c+14−8
@@ -666,14 +666,6 @@ static const struct iommu_ops *iort_iommu_xlate(struct device *dev, · 665 unmodified lines
666 int ret = -ENODEV;666 int ret = -ENODEV;
667 struct fwnode_handle *iort_fwnode;667 struct fwnode_handle *iort_fwnode;
668 668
669 /*
670 * If we already translated the fwspec there
671 * is nothing left to do, return the iommu_ops.
672 */
673 ops = iort_fwspec_iommu_ops(dev->iommu_fwspec);
674 if (ops)
675 return ops;
676
677 if (node) {669 if (node) {
678 iort_fwnode = iort_get_fwnode(node);670 iort_fwnode = iort_get_fwnode(node);
679 if (!iort_fwnode)671 if (!iort_fwnode)
@@ -735,6 +727,14 @@ const struct iommu_ops *iort_iommu_configure(struct device *dev) · 55 unmodified lines
735 u32 streamid = 0;727 u32 streamid = 0;
736 int err;728 int err;
737 729
730 /*
731 * If we already translated the fwspec there
732 * is nothing left to do, return the iommu_ops.
733 */
734 ops = iort_fwspec_iommu_ops(dev->iommu_fwspec);
735 if (ops)
736 return ops;
737
738 if (dev_is_pci(dev)) {738 if (dev_is_pci(dev)) {
739 struct pci_bus *bus = to_pci_dev(dev)->bus;739 struct pci_bus *bus = to_pci_dev(dev)->bus;
740 u32 rid;740 u32 rid;
@@ -782,6 +782,12 @@ const struct iommu_ops *iort_iommu_configure(struct device *dev) · 41 unmodified lines
782 if (err)782 if (err)
783 ops = ERR_PTR(err);783 ops = ERR_PTR(err);
784 784
785 /* Ignore all other errors apart from EPROBE_DEFER */
786 if (IS_ERR(ops) && (PTR_ERR(ops) != -EPROBE_DEFER)) {
787 dev_dbg(dev, "Adding to IOMMU failed: %ld\n", PTR_ERR(ops));
788 ops = NULL;
789 }
790
785 return ops;791 return ops;
786}792}
787 793
drivers/acpi/battery.c+1−1
@@ -782,7 +782,7 @@ static int acpi_battery_update(struct acpi_battery *battery, bool resume) · 781 unmodified lines
782 if ((battery->state & ACPI_BATTERY_STATE_CRITICAL) ||782 if ((battery->state & ACPI_BATTERY_STATE_CRITICAL) ||
783 (test_bit(ACPI_BATTERY_ALARM_PRESENT, &battery->flags) &&783 (test_bit(ACPI_BATTERY_ALARM_PRESENT, &battery->flags) &&
784 (battery->capacity_now <= battery->alarm)))784 (battery->capacity_now <= battery->alarm)))
785 pm_wakeup_hard_event(&battery->device->dev);785 pm_wakeup_event(&battery->device->dev, 0);
786 786
787 return result;787 return result;
788}788}
drivers/acpi/button.c+3−4
@@ -113,7 +113,7 @@ struct acpi_button { · 112 unmodified lines
113 113
114static BLOCKING_NOTIFIER_HEAD(acpi_lid_notifier);114static BLOCKING_NOTIFIER_HEAD(acpi_lid_notifier);
115static struct acpi_device *lid_device;115static struct acpi_device *lid_device;
116static u8 lid_init_state = ACPI_BUTTON_LID_INIT_OPEN;116static u8 lid_init_state = ACPI_BUTTON_LID_INIT_METHOD;
117 117
118static unsigned long lid_report_interval __read_mostly = 500;118static unsigned long lid_report_interval __read_mostly = 500;
119module_param(lid_report_interval, ulong, 0644);119module_param(lid_report_interval, ulong, 0644);
@@ -217,7 +217,7 @@ static int acpi_lid_notify_state(struct acpi_device *device, int state) · 97 unmodified lines
217 }217 }
218 218
219 if (state)219 if (state)
220 pm_wakeup_hard_event(&device->dev);220 pm_wakeup_event(&device->dev, 0);
221 221
222 ret = blocking_notifier_call_chain(&acpi_lid_notifier, state, device);222 ret = blocking_notifier_call_chain(&acpi_lid_notifier, state, device);
223 if (ret == NOTIFY_DONE)223 if (ret == NOTIFY_DONE)
@@ -402,7 +402,7 @@ static void acpi_button_notify(struct acpi_device *device, u32 event) · 178 unmodified lines
402 } else {402 } else {
403 int keycode;403 int keycode;
404 404
405 pm_wakeup_hard_event(&device->dev);405 pm_wakeup_event(&device->dev, 0);
406 if (button->suspended)406 if (button->suspended)
407 break;407 break;
408 408
@@ -534,7 +534,6 @@ static int acpi_button_add(struct acpi_device *device) · 125 unmodified lines
534 lid_device = device;534 lid_device = device;
535 }535 }
536 536
537 device_init_wakeup(&device->dev, true);
538 printk(KERN_INFO PREFIX "%s [%s]\n", name, acpi_device_bid(device));537 printk(KERN_INFO PREFIX "%s [%s]\n", name, acpi_device_bid(device));
539 return 0;538 return 0;
540 539
drivers/acpi/device_pm.c+1−2
@@ -24,7 +24,6 @@ · 23 unmodified lines
24#include <linux/pm_qos.h>24#include <linux/pm_qos.h>
25#include <linux/pm_domain.h>25#include <linux/pm_domain.h>
26#include <linux/pm_runtime.h>26#include <linux/pm_runtime.h>
27#include <linux/suspend.h>
28 27
29#include "internal.h"28#include "internal.h"
30 29
@@ -400,7 +399,7 @@ static void acpi_pm_notify_handler(acpi_handle handle, u32 val, void *not_used) · 369 unmodified lines
400 mutex_lock(&acpi_pm_notifier_lock);399 mutex_lock(&acpi_pm_notifier_lock);
401 400
402 if (adev->wakeup.flags.notifier_present) {401 if (adev->wakeup.flags.notifier_present) {
403 pm_wakeup_ws_event(adev->wakeup.ws, 0, true);402 __pm_wakeup_event(adev->wakeup.ws, 0);
404 if (adev->wakeup.context.work.func)403 if (adev->wakeup.context.work.func)
405 queue_pm_work(&adev->wakeup.context.work);404 queue_pm_work(&adev->wakeup.context.work);
406 }405 }
drivers/acpi/scan.c+2−2
@@ -1371,8 +1371,8 @@ int acpi_dma_configure(struct device *dev, enum dev_dma_attr attr) · 1370 unmodified lines
1371 iort_set_dma_mask(dev);1371 iort_set_dma_mask(dev);
1372 1372
1373 iommu = iort_iommu_configure(dev);1373 iommu = iort_iommu_configure(dev);
1374 if (IS_ERR(iommu))1374 if (IS_ERR(iommu) && PTR_ERR(iommu) == -EPROBE_DEFER)
1375 return PTR_ERR(iommu);1375 return -EPROBE_DEFER;
1376 1376
1377 size = max(dev->coherent_dma_mask, dev->coherent_dma_mask + 1);1377 size = max(dev->coherent_dma_mask, dev->coherent_dma_mask + 1);
1378 /*1378 /*
drivers/acpi/sleep.c+0−28
@@ -663,40 +663,14 @@ static int acpi_freeze_prepare(void) · 662 unmodified lines
663 acpi_os_wait_events_complete();663 acpi_os_wait_events_complete();
664 if (acpi_sci_irq_valid())664 if (acpi_sci_irq_valid())
665 enable_irq_wake(acpi_sci_irq);665 enable_irq_wake(acpi_sci_irq);
666
667 return 0;666 return 0;
668}667}
669 668
670static void acpi_freeze_wake(void)
671{
672 /*
673 * If IRQD_WAKEUP_ARMED is not set for the SCI at this point, it means
674 * that the SCI has triggered while suspended, so cancel the wakeup in
675 * case it has not been a wakeup event (the GPEs will be checked later).
676 */
677 if (acpi_sci_irq_valid() &&
678 !irqd_is_wakeup_armed(irq_get_irq_data(acpi_sci_irq)))
679 pm_system_cancel_wakeup();
680}
681
682static void acpi_freeze_sync(void)
683{
684 /*
685 * Process all pending events in case there are any wakeup ones.
686 *
687 * The EC driver uses the system workqueue, so that one needs to be
688 * flushed too.
689 */
690 acpi_os_wait_events_complete();
691 flush_scheduled_work();
692}
693
694static void acpi_freeze_restore(void)669static void acpi_freeze_restore(void)
695{670{
696 acpi_disable_wakeup_devices(ACPI_STATE_S0);671 acpi_disable_wakeup_devices(ACPI_STATE_S0);
697 if (acpi_sci_irq_valid())672 if (acpi_sci_irq_valid())
698 disable_irq_wake(acpi_sci_irq);673 disable_irq_wake(acpi_sci_irq);
699
700 acpi_enable_all_runtime_gpes();674 acpi_enable_all_runtime_gpes();
701}675}
702 676
@@ -708,8 +682,6 @@ static void acpi_freeze_end(void) · 5 unmodified lines
708static const struct platform_freeze_ops acpi_freeze_ops = {682static const struct platform_freeze_ops acpi_freeze_ops = {
709 .begin = acpi_freeze_begin,683 .begin = acpi_freeze_begin,
710 .prepare = acpi_freeze_prepare,684 .prepare = acpi_freeze_prepare,
711 .wake = acpi_freeze_wake,
712 .sync = acpi_freeze_sync,
713 .restore = acpi_freeze_restore,685 .restore = acpi_freeze_restore,
714 .end = acpi_freeze_end,686 .end = acpi_freeze_end,
715};687};
drivers/acpi/sysfs.c+5−2
@@ -333,14 +333,17 @@ static ssize_t acpi_table_show(struct file *filp, struct kobject *kobj, · 332 unmodified lines
333 container_of(bin_attr, struct acpi_table_attr, attr);333 container_of(bin_attr, struct acpi_table_attr, attr);
334 struct acpi_table_header *table_header = NULL;334 struct acpi_table_header *table_header = NULL;
335 acpi_status status;335 acpi_status status;
336 ssize_t rc;
336 337
337 status = acpi_get_table(table_attr->name, table_attr->instance,338 status = acpi_get_table(table_attr->name, table_attr->instance,
338 &table_header);339 &table_header);
339 if (ACPI_FAILURE(status))340 if (ACPI_FAILURE(status))
340 return -ENODEV;341 return -ENODEV;
341 342
342 return memory_read_from_buffer(buf, count, &offset,343 rc = memory_read_from_buffer(buf, count, &offset, table_header,
343 table_header, table_header->length);344 table_header->length);
345 acpi_put_table(table_header);
346 return rc;
344}347}
345 348
346static int acpi_table_attr_init(struct kobject *tables_obj,349static int acpi_table_attr_init(struct kobject *tables_obj,
drivers/ata/ahci.c+38−0
@@ -1364,6 +1364,40 @@ static inline void ahci_gtf_filter_workaround(struct ata_host *host) · 1363 unmodified lines
1364{}1364{}
1365#endif1365#endif
1366 1366
1367/*
1368 * On the Acer Aspire Switch Alpha 12, sometimes all SATA ports are detected
1369 * as DUMMY, or detected but eventually get a "link down" and never get up
1370 * again. When this happens, CAP.NP may hold a value of 0x00 or 0x01, and the
1371 * port_map may hold a value of 0x00.
1372 *
1373 * Overriding CAP.NP to 0x02 and the port_map to 0x7 will reveal all 3 ports
1374 * and can significantly reduce the occurrence of the problem.
1375 *
1376 * https://bugzilla.kernel.org/show_bug.cgi?id=189471
1377 */
1378static void acer_sa5_271_workaround(struct ahci_host_priv *hpriv,
1379 struct pci_dev *pdev)
1380{
1381 static const struct dmi_system_id sysids[] = {
1382 {
1383 .ident = "Acer Switch Alpha 12",
1384 .matches = {
1385 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
1386 DMI_MATCH(DMI_PRODUCT_NAME, "Switch SA5-271")
1387 },
1388 },
1389 { }
1390 };
1391
1392 if (dmi_check_system(sysids)) {
1393 dev_info(&pdev->dev, "enabling Acer Switch Alpha 12 workaround\n");
1394 if ((hpriv->saved_cap & 0xC734FF00) == 0xC734FF00) {
1395 hpriv->port_map = 0x7;
1396 hpriv->cap = 0xC734FF02;
1397 }
1398 }
1399}
1400
1367#ifdef CONFIG_ARM641401#ifdef CONFIG_ARM64
1368/*1402/*
1369 * Due to ERRATA#22536, ThunderX needs to handle HOST_IRQ_STAT differently.1403 * Due to ERRATA#22536, ThunderX needs to handle HOST_IRQ_STAT differently.
@@ -1636,6 +1670,10 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) · 266 unmodified lines
1636 "online status unreliable, applying workaround\n");1670 "online status unreliable, applying workaround\n");
1637 }1671 }
1638 1672
1673
1674 /* Acer SA5-271 workaround modifies private_data */
1675 acer_sa5_271_workaround(hpriv, pdev);
1676
1639 /* CAP.NP sometimes indicate the index of the last enabled1677 /* CAP.NP sometimes indicate the index of the last enabled
1640 * port, at other times, that of the last possible port, so1678 * port, at other times, that of the last possible port, so
1641 * determining the maximum port number requires looking at1679 * determining the maximum port number requires looking at
drivers/ata/libahci_platform.c+3−2
@@ -514,8 +514,9 @@ int ahci_platform_init_host(struct platform_device *pdev, · 513 unmodified lines
514 514
515 irq = platform_get_irq(pdev, 0);515 irq = platform_get_irq(pdev, 0);
516 if (irq <= 0) {516 if (irq <= 0) {
517 dev_err(dev, "no irq\n");517 if (irq != -EPROBE_DEFER)
518 return -EINVAL;518 dev_err(dev, "no irq\n");
519 return irq;
519 }520 }
520 521
521 hpriv->irq = irq;522 hpriv->irq = irq;
drivers/ata/libata-core.c+1−1
@@ -6800,7 +6800,7 @@ static int __init ata_parse_force_one(char **cur, · 6799 unmodified lines
6800 }6800 }
6801 6801
6802 force_ent->port = simple_strtoul(id, &endp, 10);6802 force_ent->port = simple_strtoul(id, &endp, 10);
6803 if (p == endp || *endp != '\0') {6803 if (id == endp || *endp != '\0') {
6804 *reason = "invalid port/link";6804 *reason = "invalid port/link";
6805 return -EINVAL;6805 return -EINVAL;
6806 }6806 }
drivers/ata/sata_mv.c+8−5
@@ -4067,7 +4067,6 @@ static int mv_platform_probe(struct platform_device *pdev) · 4066 unmodified lines
4067 struct ata_host *host;4067 struct ata_host *host;
4068 struct mv_host_priv *hpriv;4068 struct mv_host_priv *hpriv;
4069 struct resource *res;4069 struct resource *res;
4070 void __iomem *mmio;
4071 int n_ports = 0, irq = 0;4070 int n_ports = 0, irq = 0;
4072 int rc;4071 int rc;
4073 int port;4072 int port;
@@ -4086,9 +4085,8 @@ static int mv_platform_probe(struct platform_device *pdev) · 12 unmodified lines
4086 * Get the register base first4085 * Get the register base first
4087 */4086 */
4088 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);4087 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
4089 mmio = devm_ioremap_resource(&pdev->dev, res);4088 if (res == NULL)
4090 if (IS_ERR(mmio))4089 return -EINVAL;
4091 return PTR_ERR(mmio);
4092 4090
4093 /* allocate host */4091 /* allocate host */
4094 if (pdev->dev.of_node) {4092 if (pdev->dev.of_node) {
@@ -4132,7 +4130,12 @@ static int mv_platform_probe(struct platform_device *pdev) · 37 unmodified lines
4132 hpriv->board_idx = chip_soc;4130 hpriv->board_idx = chip_soc;
4133 4131
4134 host->iomap = NULL;4132 host->iomap = NULL;
4135 hpriv->base = mmio - SATAHC0_REG_BASE;4133 hpriv->base = devm_ioremap(&pdev->dev, res->start,
4134 resource_size(res));
4135 if (!hpriv->base)
4136 return -ENOMEM;
4137
4138 hpriv->base -= SATAHC0_REG_BASE;
4136 4139
4137 hpriv->clk = clk_get(&pdev->dev, NULL);4140 hpriv->clk = clk_get(&pdev->dev, NULL);
4138 if (IS_ERR(hpriv->clk))4141 if (IS_ERR(hpriv->clk))
drivers/ata/sata_rcar.c+12−3
@@ -890,7 +890,10 @@ static int sata_rcar_probe(struct platform_device *pdev) · 889 unmodified lines
890 dev_err(&pdev->dev, "failed to get access to sata clock\n");890 dev_err(&pdev->dev, "failed to get access to sata clock\n");
891 return PTR_ERR(priv->clk);891 return PTR_ERR(priv->clk);
892 }892 }
893 clk_prepare_enable(priv->clk);893
894 ret = clk_prepare_enable(priv->clk);
895 if (ret)
896 return ret;
894 897
895 host = ata_host_alloc(&pdev->dev, 1);898 host = ata_host_alloc(&pdev->dev, 1);
896 if (!host) {899 if (!host) {
@@ -970,8 +973,11 @@ static int sata_rcar_resume(struct device *dev) · 73 unmodified lines
970 struct ata_host *host = dev_get_drvdata(dev);973 struct ata_host *host = dev_get_drvdata(dev);
971 struct sata_rcar_priv *priv = host->private_data;974 struct sata_rcar_priv *priv = host->private_data;
972 void __iomem *base = priv->base;975 void __iomem *base = priv->base;
976 int ret;
973 977
974 clk_prepare_enable(priv->clk);978 ret = clk_prepare_enable(priv->clk);
979 if (ret)
980 return ret;
975 981
976 /* ack and mask */982 /* ack and mask */
977 iowrite32(0, base + SATAINTSTAT_REG);983 iowrite32(0, base + SATAINTSTAT_REG);
@@ -988,8 +994,11 @@ static int sata_rcar_restore(struct device *dev) · 10 unmodified lines
988{994{
989 struct ata_host *host = dev_get_drvdata(dev);995 struct ata_host *host = dev_get_drvdata(dev);
990 struct sata_rcar_priv *priv = host->private_data;996 struct sata_rcar_priv *priv = host->private_data;
997 int ret;
991 998
992 clk_prepare_enable(priv->clk);999 ret = clk_prepare_enable(priv->clk);
1000 if (ret)
1001 return ret;
993 1002
994 sata_rcar_setup_port(host);1003 sata_rcar_setup_port(host);
995 1004
drivers/base/power/main.c+5−0
@@ -1091,6 +1091,11 @@ static int __device_suspend_noirq(struct device *dev, pm_message_t state, bool a · 1090 unmodified lines
1091 if (async_error)1091 if (async_error)
1092 goto Complete;1092 goto Complete;
1093 1093
1094 if (pm_wakeup_pending()) {
1095 async_error = -EBUSY;
1096 goto Complete;
1097 }
1098
1094 if (dev->power.syscore || dev->power.direct_complete)1099 if (dev->power.syscore || dev->power.direct_complete)
1095 goto Complete;1100 goto Complete;
1096 1101
drivers/base/power/wakeup.c+6−12
@@ -28,8 +28,8 @@ bool events_check_enabled __read_mostly; · 27 unmodified lines
28/* First wakeup IRQ seen by the kernel in the last cycle. */28/* First wakeup IRQ seen by the kernel in the last cycle. */
29unsigned int pm_wakeup_irq __read_mostly;29unsigned int pm_wakeup_irq __read_mostly;
30 30
31/* If greater than 0 and the system is suspending, terminate the suspend. */31/* If set and the system is suspending, terminate the suspend. */
32static atomic_t pm_abort_suspend __read_mostly;32static bool pm_abort_suspend __read_mostly;
33 33
34/*34/*
35 * Combined counters of registered wakeup events and wakeup events in progress.35 * Combined counters of registered wakeup events and wakeup events in progress.
@@ -855,26 +855,20 @@ bool pm_wakeup_pending(void) · 819 unmodified lines
855 pm_print_active_wakeup_sources();855 pm_print_active_wakeup_sources();
856 }856 }
857 857
858 return ret || atomic_read(&pm_abort_suspend) > 0;858 return ret || pm_abort_suspend;
859}859}
860 860
861void pm_system_wakeup(void)861void pm_system_wakeup(void)
862{862{
863 atomic_inc(&pm_abort_suspend);863 pm_abort_suspend = true;
864 freeze_wake();864 freeze_wake();
865}865}
866EXPORT_SYMBOL_GPL(pm_system_wakeup);866EXPORT_SYMBOL_GPL(pm_system_wakeup);
867 867
868void pm_system_cancel_wakeup(void)868void pm_wakeup_clear(void)
869{
870 atomic_dec(&pm_abort_suspend);
871}
872
873void pm_wakeup_clear(bool reset)
874{869{
870 pm_abort_suspend = false;
875 pm_wakeup_irq = 0;871 pm_wakeup_irq = 0;
876 if (reset)
877 atomic_set(&pm_abort_suspend, 0);
878}872}
879 873
880void pm_system_irq_wakeup(unsigned int irq_number)874void pm_system_irq_wakeup(unsigned int irq_number)
drivers/block/loop.c+3−0
@@ -608,6 +608,9 @@ static int loop_switch(struct loop_device *lo, struct file *file) · 607 unmodified lines
608 */608 */
609static int loop_flush(struct loop_device *lo)609static int loop_flush(struct loop_device *lo)
610{610{
611 /* loop not yet configured, no running thread, nothing to flush */
612 if (lo->lo_state != Lo_bound)
613 return 0;
611 return loop_switch(lo, NULL);614 return loop_switch(lo, NULL);
612}615}
613 616
drivers/block/nbd.c+5−10
@@ -937,14 +937,6 @@ static int nbd_reconnect_socket(struct nbd_device *nbd, unsigned long arg) · 936 unmodified lines
937 return -ENOSPC;937 return -ENOSPC;
938}938}
939 939
940/* Reset all properties of an NBD device */
941static void nbd_reset(struct nbd_device *nbd)
942{
943 nbd->config = NULL;
944 nbd->tag_set.timeout = 0;
945 queue_flag_clear_unlocked(QUEUE_FLAG_DISCARD, nbd->disk->queue);
946}
947
948static void nbd_bdev_reset(struct block_device *bdev)940static void nbd_bdev_reset(struct block_device *bdev)
949{941{
950 if (bdev->bd_openers > 1)942 if (bdev->bd_openers > 1)
@@ -1029,7 +1021,11 @@ static void nbd_config_put(struct nbd_device *nbd) · 78 unmodified lines
1029 }1021 }
1030 kfree(config->socks);1022 kfree(config->socks);
1031 }1023 }
1032 nbd_reset(nbd);1024 kfree(nbd->config);
1025 nbd->config = NULL;
1026
1027 nbd->tag_set.timeout = 0;
1028 queue_flag_clear_unlocked(QUEUE_FLAG_DISCARD, nbd->disk->queue);
1033 1029
1034 mutex_unlock(&nbd->config_lock);1030 mutex_unlock(&nbd->config_lock);
1035 nbd_put(nbd);1031 nbd_put(nbd);
@@ -1483,7 +1479,6 @@ static int nbd_dev_add(int index) · 447 unmodified lines
1483 disk->fops = &nbd_fops;1479 disk->fops = &nbd_fops;
1484 disk->private_data = nbd;1480 disk->private_data = nbd;
1485 sprintf(disk->disk_name, "nbd%d", index);1481 sprintf(disk->disk_name, "nbd%d", index);
1486 nbd_reset(nbd);
1487 add_disk(disk);1482 add_disk(disk);
1488 nbd_total_devices++;1483 nbd_total_devices++;
1489 return index;1484 return index;
drivers/block/rbd.c+2−0
@@ -4023,6 +4023,7 @@ static void rbd_queue_workfn(struct work_struct *work) · 4022 unmodified lines
4023 4023
4024 switch (req_op(rq)) {4024 switch (req_op(rq)) {
4025 case REQ_OP_DISCARD:4025 case REQ_OP_DISCARD:
4026 case REQ_OP_WRITE_ZEROES:
4026 op_type = OBJ_OP_DISCARD;4027 op_type = OBJ_OP_DISCARD;
4027 break;4028 break;
4028 case REQ_OP_WRITE:4029 case REQ_OP_WRITE:
@@ -4420,6 +4421,7 @@ static int rbd_init_disk(struct rbd_device *rbd_dev) · 391 unmodified lines
4420 q->limits.discard_granularity = segment_size;4421 q->limits.discard_granularity = segment_size;
4421 q->limits.discard_alignment = segment_size;4422 q->limits.discard_alignment = segment_size;
4422 blk_queue_max_discard_sectors(q, segment_size / SECTOR_SIZE);4423 blk_queue_max_discard_sectors(q, segment_size / SECTOR_SIZE);
4424 blk_queue_max_write_zeroes_sectors(q, segment_size / SECTOR_SIZE);
4423 4425
4424 if (!ceph_test_opt(rbd_dev->rbd_client->client, NOCRC))4426 if (!ceph_test_opt(rbd_dev->rbd_client->client, NOCRC))
4425 q->backing_dev_info->capabilities |= BDI_CAP_STABLE_WRITES;4427 q->backing_dev_info->capabilities |= BDI_CAP_STABLE_WRITES;
drivers/char/mem.c+1−1
@@ -343,7 +343,7 @@ static int mmap_mem(struct file *file, struct vm_area_struct *vma) · 342 unmodified lines
343 phys_addr_t offset = (phys_addr_t)vma->vm_pgoff << PAGE_SHIFT;343 phys_addr_t offset = (phys_addr_t)vma->vm_pgoff << PAGE_SHIFT;
344 344
345 /* It's illegal to wrap around the end of the physical address space. */345 /* It's illegal to wrap around the end of the physical address space. */
346 if (offset + (phys_addr_t)size < offset)346 if (offset + (phys_addr_t)size - 1 < offset)
347 return -EINVAL;347 return -EINVAL;
348 348
349 if (!valid_mmap_phys_addr_range(vma->vm_pgoff, size))349 if (!valid_mmap_phys_addr_range(vma->vm_pgoff, size))
drivers/char/pcmcia/cm4040_cs.c+3−3
@@ -374,7 +374,7 @@ static ssize_t cm4040_write(struct file *filp, const char __user *buf, · 373 unmodified lines
374 374
375 rc = write_sync_reg(SCR_HOST_TO_READER_START, dev);375 rc = write_sync_reg(SCR_HOST_TO_READER_START, dev);
376 if (rc <= 0) {376 if (rc <= 0) {
377 DEBUGP(5, dev, "write_sync_reg c=%.2Zx\n", rc);377 DEBUGP(5, dev, "write_sync_reg c=%.2zx\n", rc);
378 DEBUGP(2, dev, "<- cm4040_write (failed)\n");378 DEBUGP(2, dev, "<- cm4040_write (failed)\n");
379 if (rc == -ERESTARTSYS)379 if (rc == -ERESTARTSYS)
380 return rc;380 return rc;
@@ -387,7 +387,7 @@ static ssize_t cm4040_write(struct file *filp, const char __user *buf, · 6 unmodified lines
387 for (i = 0; i < bytes_to_write; i++) {387 for (i = 0; i < bytes_to_write; i++) {
388 rc = wait_for_bulk_out_ready(dev);388 rc = wait_for_bulk_out_ready(dev);
389 if (rc <= 0) {389 if (rc <= 0) {
390 DEBUGP(5, dev, "wait_for_bulk_out_ready rc=%.2Zx\n",390 DEBUGP(5, dev, "wait_for_bulk_out_ready rc=%.2zx\n",
391 rc);391 rc);
392 DEBUGP(2, dev, "<- cm4040_write (failed)\n");392 DEBUGP(2, dev, "<- cm4040_write (failed)\n");
393 if (rc == -ERESTARTSYS)393 if (rc == -ERESTARTSYS)
@@ -403,7 +403,7 @@ static ssize_t cm4040_write(struct file *filp, const char __user *buf, · 9 unmodified lines
403 rc = write_sync_reg(SCR_HOST_TO_READER_DONE, dev);403 rc = write_sync_reg(SCR_HOST_TO_READER_DONE, dev);
404 404
405 if (rc <= 0) {405 if (rc <= 0) {
406 DEBUGP(5, dev, "write_sync_reg c=%.2Zx\n", rc);406 DEBUGP(5, dev, "write_sync_reg c=%.2zx\n", rc);
407 DEBUGP(2, dev, "<- cm4040_write (failed)\n");407 DEBUGP(2, dev, "<- cm4040_write (failed)\n");
408 if (rc == -ERESTARTSYS)408 if (rc == -ERESTARTSYS)
409 return rc;409 return rc;
drivers/char/random.c+44−3
@@ -1,6 +1,9 @@
1/*1/*
2 * random.c -- A strong random number generator2 * random.c -- A strong random number generator
3 *3 *
4 * Copyright (C) 2017 Jason A. Donenfeld <Jason@zx2c4.com>. All
5 * Rights Reserved.
6 *
4 * Copyright Matt Mackall <mpm@selenic.com>, 2003, 2004, 20057 * Copyright Matt Mackall <mpm@selenic.com>, 2003, 2004, 2005
5 *8 *
6 * Copyright Theodore Ts'o, 1994, 1995, 1996, 1997, 1998, 1999. All9 * Copyright Theodore Ts'o, 1994, 1995, 1996, 1997, 1998, 1999. All
@@ -762,6 +765,8 @@ static DECLARE_WAIT_QUEUE_HEAD(crng_init_wait); · 755 unmodified lines
762static struct crng_state **crng_node_pool __read_mostly;765static struct crng_state **crng_node_pool __read_mostly;
763#endif766#endif
764 767
768static void invalidate_batched_entropy(void);
769
765static void crng_initialize(struct crng_state *crng)770static void crng_initialize(struct crng_state *crng)
766{771{
767 int i;772 int i;
@@ -799,6 +804,7 @@ static int crng_fast_load(const char *cp, size_t len) · 31 unmodified lines
799 cp++; crng_init_cnt++; len--;804 cp++; crng_init_cnt++; len--;
800 }805 }
801 if (crng_init_cnt >= CRNG_INIT_CNT_THRESH) {806 if (crng_init_cnt >= CRNG_INIT_CNT_THRESH) {
807 invalidate_batched_entropy();
802 crng_init = 1;808 crng_init = 1;
803 wake_up_interruptible(&crng_init_wait);809 wake_up_interruptible(&crng_init_wait);
804 pr_notice("random: fast init done\n");810 pr_notice("random: fast init done\n");
@@ -836,6 +842,7 @@ static void crng_reseed(struct crng_state *crng, struct entropy_store *r) · 31 unmodified lines
836 memzero_explicit(&buf, sizeof(buf));842 memzero_explicit(&buf, sizeof(buf));
837 crng->init_time = jiffies;843 crng->init_time = jiffies;
838 if (crng == &primary_crng && crng_init < 2) {844 if (crng == &primary_crng && crng_init < 2) {
845 invalidate_batched_entropy();
839 crng_init = 2;846 crng_init = 2;
840 process_random_ready_list();847 process_random_ready_list();
841 wake_up_interruptible(&crng_init_wait);848 wake_up_interruptible(&crng_init_wait);
@@ -1097,12 +1104,16 @@ static void add_interrupt_bench(cycles_t start) · 255 unmodified lines
1097static __u32 get_reg(struct fast_pool *f, struct pt_regs *regs)1104static __u32 get_reg(struct fast_pool *f, struct pt_regs *regs)
1098{1105{
1099 __u32 *ptr = (__u32 *) regs;1106 __u32 *ptr = (__u32 *) regs;
1107 unsigned int idx;
1100 1108
1101 if (regs == NULL)1109 if (regs == NULL)
1102 return 0;1110 return 0;
1103 if (f->reg_idx >= sizeof(struct pt_regs) / sizeof(__u32))1111 idx = READ_ONCE(f->reg_idx);
1104 f->reg_idx = 0;1112 if (idx >= sizeof(struct pt_regs) / sizeof(__u32))
1105 return *(ptr + f->reg_idx++);1113 idx = 0;
1114 ptr += idx++;
1115 WRITE_ONCE(f->reg_idx, idx);
1116 return *ptr;
1106}1117}
1107 1118
1108void add_interrupt_randomness(int irq, int irq_flags)1119void add_interrupt_randomness(int irq, int irq_flags)
@@ -2019,6 +2030,7 @@ struct batched_entropy { · 910 unmodified lines
2019 };2030 };
2020 unsigned int position;2031 unsigned int position;
2021};2032};
2033static rwlock_t batched_entropy_reset_lock = __RW_LOCK_UNLOCKED(batched_entropy_reset_lock);
2022 2034
2023/*2035/*
2024 * Get a random word for internal kernel use only. The quality of the random2036 * Get a random word for internal kernel use only. The quality of the random
@@ -2029,6 +2041,8 @@ static DEFINE_PER_CPU(struct batched_entropy, batched_entropy_u64); · 4 unmodified lines
2029u64 get_random_u64(void)2041u64 get_random_u64(void)
2030{2042{
2031 u64 ret;2043 u64 ret;
2044 bool use_lock = crng_init < 2;
2045 unsigned long flags;
2032 struct batched_entropy *batch;2046 struct batched_entropy *batch;
2033 2047
2034#if BITS_PER_LONG == 642048#if BITS_PER_LONG == 64
@@ -2041,11 +2055,15 @@ u64 get_random_u64(void) · 6 unmodified lines
2041#endif2055#endif
2042 2056
2043 batch = &get_cpu_var(batched_entropy_u64);2057 batch = &get_cpu_var(batched_entropy_u64);
2058 if (use_lock)
2059 read_lock_irqsave(&batched_entropy_reset_lock, flags);
2044 if (batch->position % ARRAY_SIZE(batch->entropy_u64) == 0) {2060 if (batch->position % ARRAY_SIZE(batch->entropy_u64) == 0) {
2045 extract_crng((u8 *)batch->entropy_u64);2061 extract_crng((u8 *)batch->entropy_u64);
2046 batch->position = 0;2062 batch->position = 0;
2047 }2063 }
2048 ret = batch->entropy_u64[batch->position++];2064 ret = batch->entropy_u64[batch->position++];
2065 if (use_lock)
2066 read_unlock_irqrestore(&batched_entropy_reset_lock, flags);
2049 put_cpu_var(batched_entropy_u64);2067 put_cpu_var(batched_entropy_u64);
2050 return ret;2068 return ret;
2051}2069}
@@ -2055,22 +2073,45 @@ static DEFINE_PER_CPU(struct batched_entropy, batched_entropy_u32); · 3 unmodified lines
2055u32 get_random_u32(void)2073u32 get_random_u32(void)
2056{2074{
2057 u32 ret;2075 u32 ret;
2076 bool use_lock = crng_init < 2;
2077 unsigned long flags;
2058 struct batched_entropy *batch;2078 struct batched_entropy *batch;
2059 2079
2060 if (arch_get_random_int(&ret))2080 if (arch_get_random_int(&ret))
2061 return ret;2081 return ret;
2062 2082
2063 batch = &get_cpu_var(batched_entropy_u32);2083 batch = &get_cpu_var(batched_entropy_u32);
2084 if (use_lock)
2085 read_lock_irqsave(&batched_entropy_reset_lock, flags);
2064 if (batch->position % ARRAY_SIZE(batch->entropy_u32) == 0) {2086 if (batch->position % ARRAY_SIZE(batch->entropy_u32) == 0) {
2065 extract_crng((u8 *)batch->entropy_u32);2087 extract_crng((u8 *)batch->entropy_u32);
2066 batch->position = 0;2088 batch->position = 0;
2067 }2089 }
2068 ret = batch->entropy_u32[batch->position++];2090 ret = batch->entropy_u32[batch->position++];
2091 if (use_lock)
2092 read_unlock_irqrestore(&batched_entropy_reset_lock, flags);
2069 put_cpu_var(batched_entropy_u32);2093 put_cpu_var(batched_entropy_u32);
2070 return ret;2094 return ret;
2071}2095}
2072EXPORT_SYMBOL(get_random_u32);2096EXPORT_SYMBOL(get_random_u32);
2073 2097
2098/* It's important to invalidate all potential batched entropy that might
2099 * be stored before the crng is initialized, which we can do lazily by
2100 * simply resetting the counter to zero so that it's re-extracted on the
2101 * next usage. */
2102static void invalidate_batched_entropy(void)
2103{
2104 int cpu;
2105 unsigned long flags;
2106
2107 write_lock_irqsave(&batched_entropy_reset_lock, flags);
2108 for_each_possible_cpu (cpu) {
2109 per_cpu_ptr(&batched_entropy_u32, cpu)->position = 0;
2110 per_cpu_ptr(&batched_entropy_u64, cpu)->position = 0;
2111 }
2112 write_unlock_irqrestore(&batched_entropy_reset_lock, flags);
2113}
2114
2074/**2115/**
2075 * randomize_page - Generate a random, page aligned address2116 * randomize_page - Generate a random, page aligned address
2076 * @start: The smallest acceptable address the caller will take.2117 * @start: The smallest acceptable address the caller will take.
drivers/cpufreq/cpufreq.c+1−0
@@ -2468,6 +2468,7 @@ int cpufreq_register_driver(struct cpufreq_driver *driver_data) · 2467 unmodified lines
2468 if (!(cpufreq_driver->flags & CPUFREQ_STICKY) &&2468 if (!(cpufreq_driver->flags & CPUFREQ_STICKY) &&
2469 list_empty(&cpufreq_policy_list)) {2469 list_empty(&cpufreq_policy_list)) {
2470 /* if all ->init() calls failed, unregister */2470 /* if all ->init() calls failed, unregister */
2471 ret = -ENODEV;
2471 pr_debug("%s: No CPU initialized for driver %s\n", __func__,2472 pr_debug("%s: No CPU initialized for driver %s\n", __func__,
2472 driver_data->name);2473 driver_data->name);
2473 goto err_if_unreg;2474 goto err_if_unreg;
drivers/cpufreq/cpufreq_conservative.c+2−2
@@ -185,8 +185,8 @@ static ssize_t store_down_threshold(struct gov_attr_set *attr_set, · 184 unmodified lines
185 int ret;185 int ret;
186 ret = sscanf(buf, "%u", &input);186 ret = sscanf(buf, "%u", &input);
187 187
188 /* cannot be lower than 11 otherwise freq will not fall */188 /* cannot be lower than 1 otherwise freq will not fall */
189 if (ret != 1 || input < 11 || input > 100 ||189 if (ret != 1 || input < 1 || input > 100 ||
190 input >= dbs_data->up_threshold)190 input >= dbs_data->up_threshold)
191 return -EINVAL;191 return -EINVAL;
192 192
drivers/cpufreq/intel_pstate.c+3−2
@@ -571,9 +571,10 @@ static inline void update_turbo_state(void) · 570 unmodified lines
571static int min_perf_pct_min(void)571static int min_perf_pct_min(void)
572{572{
573 struct cpudata *cpu = all_cpu_data[0];573 struct cpudata *cpu = all_cpu_data[0];
574 int turbo_pstate = cpu->pstate.turbo_pstate;
574 575
575 return DIV_ROUND_UP(cpu->pstate.min_pstate * 100,576 return turbo_pstate ?
576 cpu->pstate.turbo_pstate);577 DIV_ROUND_UP(cpu->pstate.min_pstate * 100, turbo_pstate) : 0;
577}578}
578 579
579static s16 intel_pstate_get_epb(struct cpudata *cpu_data)580static s16 intel_pstate_get_epb(struct cpudata *cpu_data)
drivers/cpufreq/kirkwood-cpufreq.c+16−3
@@ -127,7 +127,12 @@ static int kirkwood_cpufreq_probe(struct platform_device *pdev) · 126 unmodified lines
127 return PTR_ERR(priv.cpu_clk);127 return PTR_ERR(priv.cpu_clk);
128 }128 }
129 129
130 clk_prepare_enable(priv.cpu_clk);130 err = clk_prepare_enable(priv.cpu_clk);
131 if (err) {
132 dev_err(priv.dev, "Unable to prepare cpuclk\n");
133 return err;
134 }
135
131 kirkwood_freq_table[0].frequency = clk_get_rate(priv.cpu_clk) / 1000;136 kirkwood_freq_table[0].frequency = clk_get_rate(priv.cpu_clk) / 1000;
132 137
133 priv.ddr_clk = of_clk_get_by_name(np, "ddrclk");138 priv.ddr_clk = of_clk_get_by_name(np, "ddrclk");
@@ -137,7 +142,11 @@ static int kirkwood_cpufreq_probe(struct platform_device *pdev) · 3 unmodified lines
137 goto out_cpu;142 goto out_cpu;
138 }143 }
139 144
140 clk_prepare_enable(priv.ddr_clk);145 err = clk_prepare_enable(priv.ddr_clk);
146 if (err) {
147 dev_err(priv.dev, "Unable to prepare ddrclk\n");
148 goto out_cpu;
149 }
141 kirkwood_freq_table[1].frequency = clk_get_rate(priv.ddr_clk) / 1000;150 kirkwood_freq_table[1].frequency = clk_get_rate(priv.ddr_clk) / 1000;
142 151
143 priv.powersave_clk = of_clk_get_by_name(np, "powersave");152 priv.powersave_clk = of_clk_get_by_name(np, "powersave");
@@ -146,7 +155,11 @@ static int kirkwood_cpufreq_probe(struct platform_device *pdev) · 2 unmodified lines
146 err = PTR_ERR(priv.powersave_clk);155 err = PTR_ERR(priv.powersave_clk);
147 goto out_ddr;156 goto out_ddr;
148 }157 }
149 clk_prepare_enable(priv.powersave_clk);158 err = clk_prepare_enable(priv.powersave_clk);
159 if (err) {
160 dev_err(priv.dev, "Unable to prepare powersave clk\n");
161 goto out_ddr;
162 }
150 163
151 of_node_put(np);164 of_node_put(np);
152 np = NULL;165 np = NULL;
drivers/cpuidle/dt_idle_states.c+3−1
@@ -180,8 +180,10 @@ int dt_init_idle_driver(struct cpuidle_driver *drv, · 179 unmodified lines
180 if (!state_node)180 if (!state_node)
181 break;181 break;
182 182
183 if (!of_device_is_available(state_node))183 if (!of_device_is_available(state_node)) {
184 of_node_put(state_node);
184 continue;185 continue;
186 }
185 187
186 if (!idle_state_valid(state_node, i, cpumask)) {188 if (!idle_state_valid(state_node, i, cpumask)) {
187 pr_warn("%s idle state not valid, bailing out\n",189 pr_warn("%s idle state not valid, bailing out\n",
drivers/dax/super.c+7−2
@@ -210,9 +210,12 @@ EXPORT_SYMBOL_GPL(kill_dax); · 209 unmodified lines
210static struct inode *dax_alloc_inode(struct super_block *sb)210static struct inode *dax_alloc_inode(struct super_block *sb)
211{211{
212 struct dax_device *dax_dev;212 struct dax_device *dax_dev;
213 struct inode *inode;
213 214
214 dax_dev = kmem_cache_alloc(dax_cache, GFP_KERNEL);215 dax_dev = kmem_cache_alloc(dax_cache, GFP_KERNEL);
215 return &dax_dev->inode;216 inode = &dax_dev->inode;
217 inode->i_rdev = 0;
218 return inode;
216}219}
217 220
218static struct dax_device *to_dax_dev(struct inode *inode)221static struct dax_device *to_dax_dev(struct inode *inode)
@@ -227,7 +230,8 @@ static void dax_i_callback(struct rcu_head *head) · 8 unmodified lines
227 230
228 kfree(dax_dev->host);231 kfree(dax_dev->host);
229 dax_dev->host = NULL;232 dax_dev->host = NULL;
230 ida_simple_remove(&dax_minor_ida, MINOR(inode->i_rdev));233 if (inode->i_rdev)
234 ida_simple_remove(&dax_minor_ida, MINOR(inode->i_rdev));
231 kmem_cache_free(dax_cache, dax_dev);235 kmem_cache_free(dax_cache, dax_dev);
232}236}
233 237
@@ -423,6 +427,7 @@ static void init_once(void *_dax_dev) · 189 unmodified lines
423 struct dax_device *dax_dev = _dax_dev;427 struct dax_device *dax_dev = _dax_dev;
424 struct inode *inode = &dax_dev->inode;428 struct inode *inode = &dax_dev->inode;
425 429
430 memset(dax_dev, 0, sizeof(*dax_dev));
426 inode_init_once(inode);431 inode_init_once(inode);
427}432}
428 433
drivers/devfreq/event/exynos-nocp.c+5−1
@@ -267,7 +267,11 @@ static int exynos_nocp_probe(struct platform_device *pdev) · 266 unmodified lines
267 }267 }
268 platform_set_drvdata(pdev, nocp);268 platform_set_drvdata(pdev, nocp);
269 269
270 clk_prepare_enable(nocp->clk);270 ret = clk_prepare_enable(nocp->clk);
271 if (ret) {
272 dev_err(&pdev->dev, "failed to prepare ppmu clock\n");
273 return ret;
274 }
271 275
272 pr_info("exynos-nocp: new NoC Probe device registered: %s\n",276 pr_info("exynos-nocp: new NoC Probe device registered: %s\n",
273 dev_name(dev));277 dev_name(dev));
drivers/devfreq/event/exynos-ppmu.c+6−2
@@ -44,7 +44,7 @@ struct exynos_ppmu { · 43 unmodified lines
44 { "ppmu-event2-"#name, PPMU_PMNCNT2 }, \44 { "ppmu-event2-"#name, PPMU_PMNCNT2 }, \
45 { "ppmu-event3-"#name, PPMU_PMNCNT3 }45 { "ppmu-event3-"#name, PPMU_PMNCNT3 }
46 46
47struct __exynos_ppmu_events {47static struct __exynos_ppmu_events {
48 char *name;48 char *name;
49 int id;49 int id;
50} ppmu_events[] = {50} ppmu_events[] = {
@@ -648,7 +648,11 @@ static int exynos_ppmu_probe(struct platform_device *pdev) · 597 unmodified lines
648 dev_name(&pdev->dev), desc[i].name);648 dev_name(&pdev->dev), desc[i].name);
649 }649 }
650 650
651 clk_prepare_enable(info->ppmu.clk);651 ret = clk_prepare_enable(info->ppmu.clk);
652 if (ret) {
653 dev_err(&pdev->dev, "failed to prepare ppmu clock\n");
654 return ret;
655 }
652 656
653 return 0;657 return 0;
654}658}
drivers/dma/ep93xx_dma.c+35−4
@@ -201,6 +201,7 @@ struct ep93xx_dma_engine { · 200 unmodified lines
201 struct dma_device dma_dev;201 struct dma_device dma_dev;
202 bool m2m;202 bool m2m;
203 int (*hw_setup)(struct ep93xx_dma_chan *);203 int (*hw_setup)(struct ep93xx_dma_chan *);
204 void (*hw_synchronize)(struct ep93xx_dma_chan *);
204 void (*hw_shutdown)(struct ep93xx_dma_chan *);205 void (*hw_shutdown)(struct ep93xx_dma_chan *);
205 void (*hw_submit)(struct ep93xx_dma_chan *);206 void (*hw_submit)(struct ep93xx_dma_chan *);
206 int (*hw_interrupt)(struct ep93xx_dma_chan *);207 int (*hw_interrupt)(struct ep93xx_dma_chan *);
@@ -323,6 +324,8 @@ static int m2p_hw_setup(struct ep93xx_dma_chan *edmac) · 116 unmodified lines
323 | M2P_CONTROL_ENABLE;324 | M2P_CONTROL_ENABLE;
324 m2p_set_control(edmac, control);325 m2p_set_control(edmac, control);
325 326
327 edmac->buffer = 0;
328
326 return 0;329 return 0;
327}330}
328 331
@@ -331,21 +334,27 @@ static inline u32 m2p_channel_state(struct ep93xx_dma_chan *edmac) · 2 unmodified lines
331 return (readl(edmac->regs + M2P_STATUS) >> 4) & 0x3;334 return (readl(edmac->regs + M2P_STATUS) >> 4) & 0x3;
332}335}
333 336
334static void m2p_hw_shutdown(struct ep93xx_dma_chan *edmac)337static void m2p_hw_synchronize(struct ep93xx_dma_chan *edmac)
335{338{
339 unsigned long flags;
336 u32 control;340 u32 control;
337 341
342 spin_lock_irqsave(&edmac->lock, flags);
338 control = readl(edmac->regs + M2P_CONTROL);343 control = readl(edmac->regs + M2P_CONTROL);
339 control &= ~(M2P_CONTROL_STALLINT | M2P_CONTROL_NFBINT);344 control &= ~(M2P_CONTROL_STALLINT | M2P_CONTROL_NFBINT);
340 m2p_set_control(edmac, control);345 m2p_set_control(edmac, control);
346 spin_unlock_irqrestore(&edmac->lock, flags);
341 347
342 while (m2p_channel_state(edmac) >= M2P_STATE_ON)348 while (m2p_channel_state(edmac) >= M2P_STATE_ON)
343 cpu_relax();349 schedule();
350}
344 351
352static void m2p_hw_shutdown(struct ep93xx_dma_chan *edmac)
353{
345 m2p_set_control(edmac, 0);354 m2p_set_control(edmac, 0);
346 355
347 while (m2p_channel_state(edmac) == M2P_STATE_STALL)356 while (m2p_channel_state(edmac) != M2P_STATE_IDLE)
348 cpu_relax();357 dev_warn(chan2dev(edmac), "M2P: Not yet IDLE\n");
349}358}
350 359
351static void m2p_fill_desc(struct ep93xx_dma_chan *edmac)360static void m2p_fill_desc(struct ep93xx_dma_chan *edmac)
@@ -1160,6 +1169,26 @@ fail: · 808 unmodified lines
1160 return NULL;1169 return NULL;
1161}1170}
1162 1171
1172/**
1173 * ep93xx_dma_synchronize - Synchronizes the termination of transfers to the
1174 * current context.
1175 * @chan: channel
1176 *
1177 * Synchronizes the DMA channel termination to the current context. When this
1178 * function returns it is guaranteed that all transfers for previously issued
1179 * descriptors have stopped and and it is safe to free the memory associated
1180 * with them. Furthermore it is guaranteed that all complete callback functions
1181 * for a previously submitted descriptor have finished running and it is safe to
1182 * free resources accessed from within the complete callbacks.
1183 */
1184static void ep93xx_dma_synchronize(struct dma_chan *chan)
1185{
1186 struct ep93xx_dma_chan *edmac = to_ep93xx_dma_chan(chan);
1187
1188 if (edmac->edma->hw_synchronize)
1189 edmac->edma->hw_synchronize(edmac);
1190}
1191
1163/**1192/**
1164 * ep93xx_dma_terminate_all - terminate all transactions1193 * ep93xx_dma_terminate_all - terminate all transactions
1165 * @chan: channel1194 * @chan: channel
@@ -1323,6 +1352,7 @@ static int __init ep93xx_dma_probe(struct platform_device *pdev) · 157 unmodified lines
1323 dma_dev->device_prep_slave_sg = ep93xx_dma_prep_slave_sg;1352 dma_dev->device_prep_slave_sg = ep93xx_dma_prep_slave_sg;
1324 dma_dev->device_prep_dma_cyclic = ep93xx_dma_prep_dma_cyclic;1353 dma_dev->device_prep_dma_cyclic = ep93xx_dma_prep_dma_cyclic;
1325 dma_dev->device_config = ep93xx_dma_slave_config;1354 dma_dev->device_config = ep93xx_dma_slave_config;
1355 dma_dev->device_synchronize = ep93xx_dma_synchronize;
1326 dma_dev->device_terminate_all = ep93xx_dma_terminate_all;1356 dma_dev->device_terminate_all = ep93xx_dma_terminate_all;
1327 dma_dev->device_issue_pending = ep93xx_dma_issue_pending;1357 dma_dev->device_issue_pending = ep93xx_dma_issue_pending;
1328 dma_dev->device_tx_status = ep93xx_dma_tx_status;1358 dma_dev->device_tx_status = ep93xx_dma_tx_status;
@@ -1340,6 +1370,7 @@ static int __init ep93xx_dma_probe(struct platform_device *pdev) · 11 unmodified lines
1340 } else {1370 } else {
1341 dma_cap_set(DMA_PRIVATE, dma_dev->cap_mask);1371 dma_cap_set(DMA_PRIVATE, dma_dev->cap_mask);
1342 1372
1373 edma->hw_synchronize = m2p_hw_synchronize;
1343 edma->hw_setup = m2p_hw_setup;1374 edma->hw_setup = m2p_hw_setup;
1344 edma->hw_shutdown = m2p_hw_shutdown;1375 edma->hw_shutdown = m2p_hw_shutdown;
1345 edma->hw_submit = m2p_hw_submit;1376 edma->hw_submit = m2p_hw_submit;
drivers/dma/mv_xor_v2.c+44−65
@@ -161,6 +161,7 @@ struct mv_xor_v2_device { · 160 unmodified lines
161 struct mv_xor_v2_sw_desc *sw_desq;161 struct mv_xor_v2_sw_desc *sw_desq;
162 int desc_size;162 int desc_size;
163 unsigned int npendings;163 unsigned int npendings;
164 unsigned int hw_queue_idx;
164};165};
165 166
166/**167/**
@@ -213,18 +214,6 @@ static void mv_xor_v2_set_data_buffers(struct mv_xor_v2_device *xor_dev, · 46 unmodified lines
213 }214 }
214}215}
215 216
216/*
217 * Return the next available index in the DESQ.
218 */
219static int mv_xor_v2_get_desq_write_ptr(struct mv_xor_v2_device *xor_dev)
220{
221 /* read the index for the next available descriptor in the DESQ */
222 u32 reg = readl(xor_dev->dma_base + MV_XOR_V2_DMA_DESQ_ALLOC_OFF);
223
224 return ((reg >> MV_XOR_V2_DMA_DESQ_ALLOC_WRPTR_SHIFT)
225 & MV_XOR_V2_DMA_DESQ_ALLOC_WRPTR_MASK);
226}
227
228/*217/*
229 * notify the engine of new descriptors, and update the available index.218 * notify the engine of new descriptors, and update the available index.
230 */219 */
@@ -257,22 +246,6 @@ static int mv_xor_v2_set_desc_size(struct mv_xor_v2_device *xor_dev) · 26 unmodified lines
257 return MV_XOR_V2_EXT_DESC_SIZE;246 return MV_XOR_V2_EXT_DESC_SIZE;
258}247}
259 248
260/*
261 * Set the IMSG threshold
262 */
263static inline
264void mv_xor_v2_set_imsg_thrd(struct mv_xor_v2_device *xor_dev, int thrd_val)
265{
266 u32 reg;
267
268 reg = readl(xor_dev->dma_base + MV_XOR_V2_DMA_IMSG_THRD_OFF);
269
270 reg &= (~MV_XOR_V2_DMA_IMSG_THRD_MASK << MV_XOR_V2_DMA_IMSG_THRD_SHIFT);
271 reg |= (thrd_val << MV_XOR_V2_DMA_IMSG_THRD_SHIFT);
272
273 writel(reg, xor_dev->dma_base + MV_XOR_V2_DMA_IMSG_THRD_OFF);
274}
275
276static irqreturn_t mv_xor_v2_interrupt_handler(int irq, void *data)249static irqreturn_t mv_xor_v2_interrupt_handler(int irq, void *data)
277{250{
278 struct mv_xor_v2_device *xor_dev = data;251 struct mv_xor_v2_device *xor_dev = data;
@@ -288,12 +261,6 @@ static irqreturn_t mv_xor_v2_interrupt_handler(int irq, void *data) · 9 unmodified lines
288 if (!ndescs)261 if (!ndescs)
289 return IRQ_NONE;262 return IRQ_NONE;
290 263
291 /*
292 * Update IMSG threshold, to disable new IMSG interrupts until
293 * end of the tasklet
294 */
295 mv_xor_v2_set_imsg_thrd(xor_dev, MV_XOR_V2_DESC_NUM);
296
297 /* schedule a tasklet to handle descriptors callbacks */264 /* schedule a tasklet to handle descriptors callbacks */
298 tasklet_schedule(&xor_dev->irq_tasklet);265 tasklet_schedule(&xor_dev->irq_tasklet);
299 266
@@ -306,7 +273,6 @@ static irqreturn_t mv_xor_v2_interrupt_handler(int irq, void *data) · 6 unmodified lines
306static dma_cookie_t273static dma_cookie_t
307mv_xor_v2_tx_submit(struct dma_async_tx_descriptor *tx)274mv_xor_v2_tx_submit(struct dma_async_tx_descriptor *tx)
308{275{
309 int desq_ptr;
310 void *dest_hw_desc;276 void *dest_hw_desc;
311 dma_cookie_t cookie;277 dma_cookie_t cookie;
312 struct mv_xor_v2_sw_desc *sw_desc =278 struct mv_xor_v2_sw_desc *sw_desc =
@@ -322,15 +288,15 @@ mv_xor_v2_tx_submit(struct dma_async_tx_descriptor *tx) · 9 unmodified lines
322 spin_lock_bh(&xor_dev->lock);288 spin_lock_bh(&xor_dev->lock);
323 cookie = dma_cookie_assign(tx);289 cookie = dma_cookie_assign(tx);
324 290
325 /* get the next available slot in the DESQ */
326 desq_ptr = mv_xor_v2_get_desq_write_ptr(xor_dev);
327
328 /* copy the HW descriptor from the SW descriptor to the DESQ */291 /* copy the HW descriptor from the SW descriptor to the DESQ */
329 dest_hw_desc = xor_dev->hw_desq_virt + desq_ptr;292 dest_hw_desc = xor_dev->hw_desq_virt + xor_dev->hw_queue_idx;
330 293
331 memcpy(dest_hw_desc, &sw_desc->hw_desc, xor_dev->desc_size);294 memcpy(dest_hw_desc, &sw_desc->hw_desc, xor_dev->desc_size);
332 295
333 xor_dev->npendings++;296 xor_dev->npendings++;
297 xor_dev->hw_queue_idx++;
298 if (xor_dev->hw_queue_idx >= MV_XOR_V2_DESC_NUM)
299 xor_dev->hw_queue_idx = 0;
334 300
335 spin_unlock_bh(&xor_dev->lock);301 spin_unlock_bh(&xor_dev->lock);
336 302
@@ -344,6 +310,7 @@ static struct mv_xor_v2_sw_desc * · 7 unmodified lines
344mv_xor_v2_prep_sw_desc(struct mv_xor_v2_device *xor_dev)310mv_xor_v2_prep_sw_desc(struct mv_xor_v2_device *xor_dev)
345{311{
346 struct mv_xor_v2_sw_desc *sw_desc;312 struct mv_xor_v2_sw_desc *sw_desc;
313 bool found = false;
347 314
348 /* Lock the channel */315 /* Lock the channel */
349 spin_lock_bh(&xor_dev->lock);316 spin_lock_bh(&xor_dev->lock);
@@ -355,19 +322,23 @@ mv_xor_v2_prep_sw_desc(struct mv_xor_v2_device *xor_dev) · 5 unmodified lines
355 return NULL;322 return NULL;
356 }323 }
357 324
358 /* get a free SW descriptor from the SW DESQ */325 list_for_each_entry(sw_desc, &xor_dev->free_sw_desc, free_list) {
359 sw_desc = list_first_entry(&xor_dev->free_sw_desc,326 if (async_tx_test_ack(&sw_desc->async_tx)) {
360 struct mv_xor_v2_sw_desc, free_list);327 found = true;
328 break;
329 }
330 }
331
332 if (!found) {
333 spin_unlock_bh(&xor_dev->lock);
334 return NULL;
335 }
336
361 list_del(&sw_desc->free_list);337 list_del(&sw_desc->free_list);
362 338
363 /* Release the channel */339 /* Release the channel */
364 spin_unlock_bh(&xor_dev->lock);340 spin_unlock_bh(&xor_dev->lock);
365 341
366 /* set the async tx descriptor */
367 dma_async_tx_descriptor_init(&sw_desc->async_tx, &xor_dev->dmachan);
368 sw_desc->async_tx.tx_submit = mv_xor_v2_tx_submit;
369 async_tx_ack(&sw_desc->async_tx);
370
371 return sw_desc;342 return sw_desc;
372}343}
373 344
@@ -389,6 +360,8 @@ mv_xor_v2_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dest, · 15 unmodified lines
389 __func__, len, &src, &dest, flags);360 __func__, len, &src, &dest, flags);
390 361
391 sw_desc = mv_xor_v2_prep_sw_desc(xor_dev);362 sw_desc = mv_xor_v2_prep_sw_desc(xor_dev);
363 if (!sw_desc)
364 return NULL;
392 365
393 sw_desc->async_tx.flags = flags;366 sw_desc->async_tx.flags = flags;
394 367
@@ -443,6 +416,8 @@ mv_xor_v2_prep_dma_xor(struct dma_chan *chan, dma_addr_t dest, dma_addr_t *src, · 48 unmodified lines
443 __func__, src_cnt, len, &dest, flags);416 __func__, src_cnt, len, &dest, flags);
444 417
445 sw_desc = mv_xor_v2_prep_sw_desc(xor_dev);418 sw_desc = mv_xor_v2_prep_sw_desc(xor_dev);
419 if (!sw_desc)
420 return NULL;
446 421
447 sw_desc->async_tx.flags = flags;422 sw_desc->async_tx.flags = flags;
448 423
@@ -491,6 +466,8 @@ mv_xor_v2_prep_dma_interrupt(struct dma_chan *chan, unsigned long flags) · 42 unmodified lines
491 container_of(chan, struct mv_xor_v2_device, dmachan);466 container_of(chan, struct mv_xor_v2_device, dmachan);
492 467
493 sw_desc = mv_xor_v2_prep_sw_desc(xor_dev);468 sw_desc = mv_xor_v2_prep_sw_desc(xor_dev);
469 if (!sw_desc)
470 return NULL;
494 471
495 /* set the HW descriptor */472 /* set the HW descriptor */
496 hw_descriptor = &sw_desc->hw_desc;473 hw_descriptor = &sw_desc->hw_desc;
@@ -554,7 +531,6 @@ static void mv_xor_v2_tasklet(unsigned long data) · 57 unmodified lines
554{531{
555 struct mv_xor_v2_device *xor_dev = (struct mv_xor_v2_device *) data;532 struct mv_xor_v2_device *xor_dev = (struct mv_xor_v2_device *) data;
556 int pending_ptr, num_of_pending, i;533 int pending_ptr, num_of_pending, i;
557 struct mv_xor_v2_descriptor *next_pending_hw_desc = NULL;
558 struct mv_xor_v2_sw_desc *next_pending_sw_desc = NULL;534 struct mv_xor_v2_sw_desc *next_pending_sw_desc = NULL;
559 535
560 dev_dbg(xor_dev->dmadev.dev, "%s %d\n", __func__, __LINE__);536 dev_dbg(xor_dev->dmadev.dev, "%s %d\n", __func__, __LINE__);
@@ -562,17 +538,10 @@ static void mv_xor_v2_tasklet(unsigned long data) · 1 unmodified line
562 /* get the pending descriptors parameters */538 /* get the pending descriptors parameters */
563 num_of_pending = mv_xor_v2_get_pending_params(xor_dev, &pending_ptr);539 num_of_pending = mv_xor_v2_get_pending_params(xor_dev, &pending_ptr);
564 540
565 /* next HW descriptor */
566 next_pending_hw_desc = xor_dev->hw_desq_virt + pending_ptr;
567
568 /* loop over free descriptors */541 /* loop over free descriptors */
569 for (i = 0; i < num_of_pending; i++) {542 for (i = 0; i < num_of_pending; i++) {
570 543 struct mv_xor_v2_descriptor *next_pending_hw_desc =
571 if (pending_ptr > MV_XOR_V2_DESC_NUM)544 xor_dev->hw_desq_virt + pending_ptr;
572 pending_ptr = 0;
573
574 if (next_pending_sw_desc != NULL)
575 next_pending_hw_desc++;
576 545
577 /* get the SW descriptor related to the HW descriptor */546 /* get the SW descriptor related to the HW descriptor */
578 next_pending_sw_desc =547 next_pending_sw_desc =
@@ -608,15 +577,14 @@ static void mv_xor_v2_tasklet(unsigned long data) · 29 unmodified lines
608 577
609 /* increment the next descriptor */578 /* increment the next descriptor */
610 pending_ptr++;579 pending_ptr++;
580 if (pending_ptr >= MV_XOR_V2_DESC_NUM)
581 pending_ptr = 0;
611 }582 }
612 583
613 if (num_of_pending != 0) {584 if (num_of_pending != 0) {
614 /* free the descriptores */585 /* free the descriptores */
615 mv_xor_v2_free_desc_from_desq(xor_dev, num_of_pending);586 mv_xor_v2_free_desc_from_desq(xor_dev, num_of_pending);
616 }587 }
617
618 /* Update IMSG threshold, to enable new IMSG interrupts */
619 mv_xor_v2_set_imsg_thrd(xor_dev, 0);
620}588}
621 589
622/*590/*
@@ -648,9 +616,6 @@ static int mv_xor_v2_descq_init(struct mv_xor_v2_device *xor_dev) · 25 unmodified lines
648 writel((xor_dev->hw_desq & 0xFFFF00000000) >> 32,616 writel((xor_dev->hw_desq & 0xFFFF00000000) >> 32,
649 xor_dev->dma_base + MV_XOR_V2_DMA_DESQ_BAHR_OFF);617 xor_dev->dma_base + MV_XOR_V2_DMA_DESQ_BAHR_OFF);
650 618
651 /* enable the DMA engine */
652 writel(0, xor_dev->dma_base + MV_XOR_V2_DMA_DESQ_STOP_OFF);
653
654 /*619 /*
655 * This is a temporary solution, until we activate the620 * This is a temporary solution, until we activate the
656 * SMMU. Set the attributes for reading & writing data buffers621 * SMMU. Set the attributes for reading & writing data buffers
@@ -694,6 +659,9 @@ static int mv_xor_v2_descq_init(struct mv_xor_v2_device *xor_dev) · 37 unmodified lines
694 reg |= MV_XOR_V2_GLOB_PAUSE_AXI_TIME_DIS_VAL;659 reg |= MV_XOR_V2_GLOB_PAUSE_AXI_TIME_DIS_VAL;
695 writel(reg, xor_dev->glob_base + MV_XOR_V2_GLOB_PAUSE);660 writel(reg, xor_dev->glob_base + MV_XOR_V2_GLOB_PAUSE);
696 661
662 /* enable the DMA engine */
663 writel(0, xor_dev->dma_base + MV_XOR_V2_DMA_DESQ_STOP_OFF);
664
697 return 0;665 return 0;
698}666}
699 667
@@ -725,6 +693,10 @@ static int mv_xor_v2_probe(struct platform_device *pdev) · 25 unmodified lines
725 693
726 platform_set_drvdata(pdev, xor_dev);694 platform_set_drvdata(pdev, xor_dev);
727 695
696 ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(40));
697 if (ret)
698 return ret;
699
728 xor_dev->clk = devm_clk_get(&pdev->dev, NULL);700 xor_dev->clk = devm_clk_get(&pdev->dev, NULL);
729 if (IS_ERR(xor_dev->clk) && PTR_ERR(xor_dev->clk) == -EPROBE_DEFER)701 if (IS_ERR(xor_dev->clk) && PTR_ERR(xor_dev->clk) == -EPROBE_DEFER)
730 return -EPROBE_DEFER;702 return -EPROBE_DEFER;
@@ -785,8 +757,15 @@ static int mv_xor_v2_probe(struct platform_device *pdev) · 54 unmodified lines
785 757
786 /* add all SW descriptors to the free list */758 /* add all SW descriptors to the free list */
787 for (i = 0; i < MV_XOR_V2_DESC_NUM; i++) {759 for (i = 0; i < MV_XOR_V2_DESC_NUM; i++) {
788 xor_dev->sw_desq[i].idx = i;760 struct mv_xor_v2_sw_desc *sw_desc =
789 list_add(&xor_dev->sw_desq[i].free_list,761 xor_dev->sw_desq + i;
762 sw_desc->idx = i;
763 dma_async_tx_descriptor_init(&sw_desc->async_tx,
764 &xor_dev->dmachan);
765 sw_desc->async_tx.tx_submit = mv_xor_v2_tx_submit;
766 async_tx_ack(&sw_desc->async_tx);
767
768 list_add(&sw_desc->free_list,
790 &xor_dev->free_sw_desc);769 &xor_dev->free_sw_desc);
791 }770 }
792 771
drivers/dma/pl330.c+2−1
@@ -3008,7 +3008,8 @@ static int pl330_remove(struct amba_device *adev) · 3007 unmodified lines
3008 3008
3009 for (i = 0; i < AMBA_NR_IRQS; i++) {3009 for (i = 0; i < AMBA_NR_IRQS; i++) {
3010 irq = adev->irq[i];3010 irq = adev->irq[i];
3011 devm_free_irq(&adev->dev, irq, pl330);3011 if (irq)
3012 devm_free_irq(&adev->dev, irq, pl330);
3012 }3013 }
3013 3014
3014 dma_async_device_unregister(&pl330->ddma);3015 dma_async_device_unregister(&pl330->ddma);
drivers/dma/sh/rcar-dmac.c+3−0
@@ -1287,6 +1287,9 @@ static unsigned int rcar_dmac_chan_get_residue(struct rcar_dmac_chan *chan, · 1286 unmodified lines
1287 if (desc->hwdescs.use) {1287 if (desc->hwdescs.use) {
1288 dptr = (rcar_dmac_chan_read(chan, RCAR_DMACHCRB) &1288 dptr = (rcar_dmac_chan_read(chan, RCAR_DMACHCRB) &
1289 RCAR_DMACHCRB_DPTR_MASK) >> RCAR_DMACHCRB_DPTR_SHIFT;1289 RCAR_DMACHCRB_DPTR_MASK) >> RCAR_DMACHCRB_DPTR_SHIFT;
1290 if (dptr == 0)
1291 dptr = desc->nchunks;
1292 dptr--;
1290 WARN_ON(dptr >= desc->nchunks);1293 WARN_ON(dptr >= desc->nchunks);
1291 } else {1294 } else {
1292 running = desc->running;1295 running = desc->running;
drivers/dma/sh/usb-dmac.c+1−1
@@ -117,7 +117,7 @@ struct usb_dmac { · 116 unmodified lines
117#define USB_DMASWR 0x0008117#define USB_DMASWR 0x0008
118#define USB_DMASWR_SWR (1 << 0)118#define USB_DMASWR_SWR (1 << 0)
119#define USB_DMAOR 0x0060119#define USB_DMAOR 0x0060
120#define USB_DMAOR_AE (1 << 2)120#define USB_DMAOR_AE (1 << 1)
121#define USB_DMAOR_DME (1 << 0)121#define USB_DMAOR_DME (1 << 0)
122 122
123#define USB_DMASAR 0x0000123#define USB_DMASAR 0x0000
drivers/firmware/dmi-id.c+2−0
@@ -47,6 +47,7 @@ DEFINE_DMI_ATTR_WITH_SHOW(product_name, 0444, DMI_PRODUCT_NAME); · 46 unmodified lines
47DEFINE_DMI_ATTR_WITH_SHOW(product_version, 0444, DMI_PRODUCT_VERSION);47DEFINE_DMI_ATTR_WITH_SHOW(product_version, 0444, DMI_PRODUCT_VERSION);
48DEFINE_DMI_ATTR_WITH_SHOW(product_serial, 0400, DMI_PRODUCT_SERIAL);48DEFINE_DMI_ATTR_WITH_SHOW(product_serial, 0400, DMI_PRODUCT_SERIAL);
49DEFINE_DMI_ATTR_WITH_SHOW(product_uuid, 0400, DMI_PRODUCT_UUID);49DEFINE_DMI_ATTR_WITH_SHOW(product_uuid, 0400, DMI_PRODUCT_UUID);
50DEFINE_DMI_ATTR_WITH_SHOW(product_family, 0444, DMI_PRODUCT_FAMILY);
50DEFINE_DMI_ATTR_WITH_SHOW(board_vendor, 0444, DMI_BOARD_VENDOR);51DEFINE_DMI_ATTR_WITH_SHOW(board_vendor, 0444, DMI_BOARD_VENDOR);
51DEFINE_DMI_ATTR_WITH_SHOW(board_name, 0444, DMI_BOARD_NAME);52DEFINE_DMI_ATTR_WITH_SHOW(board_name, 0444, DMI_BOARD_NAME);
52DEFINE_DMI_ATTR_WITH_SHOW(board_version, 0444, DMI_BOARD_VERSION);53DEFINE_DMI_ATTR_WITH_SHOW(board_version, 0444, DMI_BOARD_VERSION);
@@ -191,6 +192,7 @@ static void __init dmi_id_init_attr_table(void) · 138 unmodified lines
191 ADD_DMI_ATTR(product_version, DMI_PRODUCT_VERSION);192 ADD_DMI_ATTR(product_version, DMI_PRODUCT_VERSION);
192 ADD_DMI_ATTR(product_serial, DMI_PRODUCT_SERIAL);193 ADD_DMI_ATTR(product_serial, DMI_PRODUCT_SERIAL);
193 ADD_DMI_ATTR(product_uuid, DMI_PRODUCT_UUID);194 ADD_DMI_ATTR(product_uuid, DMI_PRODUCT_UUID);
195 ADD_DMI_ATTR(product_family, DMI_PRODUCT_FAMILY);
194 ADD_DMI_ATTR(board_vendor, DMI_BOARD_VENDOR);196 ADD_DMI_ATTR(board_vendor, DMI_BOARD_VENDOR);
195 ADD_DMI_ATTR(board_name, DMI_BOARD_NAME);197 ADD_DMI_ATTR(board_name, DMI_BOARD_NAME);
196 ADD_DMI_ATTR(board_version, DMI_BOARD_VERSION);198 ADD_DMI_ATTR(board_version, DMI_BOARD_VERSION);
drivers/firmware/dmi_scan.c+38−12
@@ -144,7 +144,7 @@ static int __init dmi_walk_early(void (*decode)(const struct dmi_header *, · 143 unmodified lines
144 144
145 buf = dmi_early_remap(dmi_base, orig_dmi_len);145 buf = dmi_early_remap(dmi_base, orig_dmi_len);
146 if (buf == NULL)146 if (buf == NULL)
147 return -1;147 return -ENOMEM;
148 148
149 dmi_decode_table(buf, decode, NULL);149 dmi_decode_table(buf, decode, NULL);
150 150
@@ -178,7 +178,7 @@ static void __init dmi_save_ident(const struct dmi_header *dm, int slot, · 27 unmodified lines
178 const char *d = (const char *) dm;178 const char *d = (const char *) dm;
179 const char *p;179 const char *p;
180 180
181 if (dmi_ident[slot])181 if (dmi_ident[slot] || dm->length <= string)
182 return;182 return;
183 183
184 p = dmi_string(dm, d[string]);184 p = dmi_string(dm, d[string]);
@@ -191,13 +191,14 @@ static void __init dmi_save_ident(const struct dmi_header *dm, int slot, · 6 unmodified lines
191static void __init dmi_save_uuid(const struct dmi_header *dm, int slot,191static void __init dmi_save_uuid(const struct dmi_header *dm, int slot,
192 int index)192 int index)
193{193{
194 const u8 *d = (u8 *) dm + index;194 const u8 *d;
195 char *s;195 char *s;
196 int is_ff = 1, is_00 = 1, i;196 int is_ff = 1, is_00 = 1, i;
197 197
198 if (dmi_ident[slot])198 if (dmi_ident[slot] || dm->length <= index + 16)
199 return;199 return;
200 200
201 d = (u8 *) dm + index;
201 for (i = 0; i < 16 && (is_ff || is_00); i++) {202 for (i = 0; i < 16 && (is_ff || is_00); i++) {
202 if (d[i] != 0x00)203 if (d[i] != 0x00)
203 is_00 = 0;204 is_00 = 0;
@@ -228,16 +229,17 @@ static void __init dmi_save_uuid(const struct dmi_header *dm, int slot, · 24 unmodified lines
228static void __init dmi_save_type(const struct dmi_header *dm, int slot,229static void __init dmi_save_type(const struct dmi_header *dm, int slot,
229 int index)230 int index)
230{231{
231 const u8 *d = (u8 *) dm + index;232 const u8 *d;
232 char *s;233 char *s;
233 234
234 if (dmi_ident[slot])235 if (dmi_ident[slot] || dm->length <= index)
235 return;236 return;
236 237
237 s = dmi_alloc(4);238 s = dmi_alloc(4);
238 if (!s)239 if (!s)
239 return;240 return;
240 241
242 d = (u8 *) dm + index;
241 sprintf(s, "%u", *d & 0x7F);243 sprintf(s, "%u", *d & 0x7F);
242 dmi_ident[slot] = s;244 dmi_ident[slot] = s;
243}245}
@@ -278,9 +280,13 @@ static void __init dmi_save_devices(const struct dmi_header *dm) · 34 unmodified lines
278 280
279static void __init dmi_save_oem_strings_devices(const struct dmi_header *dm)281static void __init dmi_save_oem_strings_devices(const struct dmi_header *dm)
280{282{
281 int i, count = *(u8 *)(dm + 1);283 int i, count;
282 struct dmi_device *dev;284 struct dmi_device *dev;
283 285
286 if (dm->length < 0x05)
287 return;
288
289 count = *(u8 *)(dm + 1);
284 for (i = 1; i <= count; i++) {290 for (i = 1; i <= count; i++) {
285 const char *devname = dmi_string(dm, i);291 const char *devname = dmi_string(dm, i);
286 292
@@ -353,6 +359,9 @@ static void __init dmi_save_extended_devices(const struct dmi_header *dm) · 66 unmodified lines
353 const char *name;359 const char *name;
354 const u8 *d = (u8 *)dm;360 const u8 *d = (u8 *)dm;
355 361
362 if (dm->length < 0x0B)
363 return;
364
356 /* Skip disabled device */365 /* Skip disabled device */
357 if ((d[0x5] & 0x80) == 0)366 if ((d[0x5] & 0x80) == 0)
358 return;367 return;
@@ -387,7 +396,7 @@ static void __init save_mem_devices(const struct dmi_header *dm, void *v) · 28 unmodified lines
387 const char *d = (const char *)dm;396 const char *d = (const char *)dm;
388 static int nr;397 static int nr;
389 398
390 if (dm->type != DMI_ENTRY_MEM_DEVICE)399 if (dm->type != DMI_ENTRY_MEM_DEVICE || dm->length < 0x12)
391 return;400 return;
392 if (nr >= dmi_memdev_nr) {401 if (nr >= dmi_memdev_nr) {
393 pr_warn(FW_BUG "Too many DIMM entries in SMBIOS table\n");402 pr_warn(FW_BUG "Too many DIMM entries in SMBIOS table\n");
@@ -430,6 +439,7 @@ static void __init dmi_decode(const struct dmi_header *dm, void *dummy) · 36 unmodified lines
430 dmi_save_ident(dm, DMI_PRODUCT_VERSION, 6);439 dmi_save_ident(dm, DMI_PRODUCT_VERSION, 6);
431 dmi_save_ident(dm, DMI_PRODUCT_SERIAL, 7);440 dmi_save_ident(dm, DMI_PRODUCT_SERIAL, 7);
432 dmi_save_uuid(dm, DMI_PRODUCT_UUID, 8);441 dmi_save_uuid(dm, DMI_PRODUCT_UUID, 8);
442 dmi_save_ident(dm, DMI_PRODUCT_FAMILY, 26);
433 break;443 break;
434 case 2: /* Base Board Information */444 case 2: /* Base Board Information */
435 dmi_save_ident(dm, DMI_BOARD_VENDOR, 4);445 dmi_save_ident(dm, DMI_BOARD_VENDOR, 4);
@@ -648,6 +658,21 @@ void __init dmi_scan_machine(void) · 212 unmodified lines
648 if (p == NULL)658 if (p == NULL)
649 goto error;659 goto error;
650 660
661 /*
662 * Same logic as above, look for a 64-bit entry point
663 * first, and if not found, fall back to 32-bit entry point.
664 */
665 memcpy_fromio(buf, p, 16);
666 for (q = p + 16; q < p + 0x10000; q += 16) {
667 memcpy_fromio(buf + 16, q, 16);
668 if (!dmi_smbios3_present(buf)) {
669 dmi_available = 1;
670 dmi_early_unmap(p, 0x10000);
671 goto out;
672 }
673 memcpy(buf, buf + 16, 16);
674 }
675
651 /*676 /*
652 * Iterate over all possible DMI header addresses q.677 * Iterate over all possible DMI header addresses q.
653 * Maintain the 32 bytes around q in buf. On the678 * Maintain the 32 bytes around q in buf. On the
@@ -658,7 +683,7 @@ void __init dmi_scan_machine(void) · 4 unmodified lines
658 memset(buf, 0, 16);683 memset(buf, 0, 16);
659 for (q = p; q < p + 0x10000; q += 16) {684 for (q = p; q < p + 0x10000; q += 16) {
660 memcpy_fromio(buf + 16, q, 16);685 memcpy_fromio(buf + 16, q, 16);
661 if (!dmi_smbios3_present(buf) || !dmi_present(buf)) {686 if (!dmi_present(buf)) {
662 dmi_available = 1;687 dmi_available = 1;
663 dmi_early_unmap(p, 0x10000);688 dmi_early_unmap(p, 0x10000);
664 goto out;689 goto out;
@@ -992,7 +1017,8 @@ EXPORT_SYMBOL(dmi_get_date); · 327 unmodified lines
992 * @decode: Callback function1017 * @decode: Callback function
993 * @private_data: Private data to be passed to the callback function1018 * @private_data: Private data to be passed to the callback function
994 *1019 *
995 * Returns -1 when the DMI table can't be reached, 0 on success.1020 * Returns 0 on success, -ENXIO if DMI is not selected or not present,
1021 * or a different negative error code if DMI walking fails.
996 */1022 */
997int dmi_walk(void (*decode)(const struct dmi_header *, void *),1023int dmi_walk(void (*decode)(const struct dmi_header *, void *),
998 void *private_data)1024 void *private_data)
@@ -1000,11 +1026,11 @@ int dmi_walk(void (*decode)(const struct dmi_header *, void *), · 1 unmodified line
1000 u8 *buf;1026 u8 *buf;
1001 1027
1002 if (!dmi_available)1028 if (!dmi_available)
1003 return -1;1029 return -ENXIO;
1004 1030
1005 buf = dmi_remap(dmi_base, dmi_len);1031 buf = dmi_remap(dmi_base, dmi_len);
1006 if (buf == NULL)1032 if (buf == NULL)
1007 return -1;1033 return -ENOMEM;
1008 1034
1009 dmi_decode_table(buf, decode, private_data);1035 dmi_decode_table(buf, decode, private_data);
1010 1036
drivers/firmware/efi/efi-bgrt.c+27−0
@@ -27,6 +27,26 @@ struct bmp_header { · 26 unmodified lines
27 u32 size;27 u32 size;
28} __packed;28} __packed;
29 29
30static bool efi_bgrt_addr_valid(u64 addr)
31{
32 efi_memory_desc_t *md;
33
34 for_each_efi_memory_desc(md) {
35 u64 size;
36 u64 end;
37
38 if (md->type != EFI_BOOT_SERVICES_DATA)
39 continue;
40
41 size = md->num_pages << EFI_PAGE_SHIFT;
42 end = md->phys_addr + size;
43 if (addr >= md->phys_addr && addr < end)
44 return true;
45 }
46
47 return false;
48}
49
30void __init efi_bgrt_init(struct acpi_table_header *table)50void __init efi_bgrt_init(struct acpi_table_header *table)
31{51{
32 void *image;52 void *image;
@@ -36,6 +56,9 @@ void __init efi_bgrt_init(struct acpi_table_header *table) · 3 unmodified lines
36 if (acpi_disabled)56 if (acpi_disabled)
37 return;57 return;
38 58
59 if (!efi_enabled(EFI_MEMMAP))
60 return;
61
39 if (table->length < sizeof(bgrt_tab)) {62 if (table->length < sizeof(bgrt_tab)) {
40 pr_notice("Ignoring BGRT: invalid length %u (expected %zu)\n",63 pr_notice("Ignoring BGRT: invalid length %u (expected %zu)\n",
41 table->length, sizeof(bgrt_tab));64 table->length, sizeof(bgrt_tab));
@@ -62,6 +85,10 @@ void __init efi_bgrt_init(struct acpi_table_header *table) · 20 unmodified lines
62 goto out;85 goto out;
63 }86 }
64 87
88 if (!efi_bgrt_addr_valid(bgrt->image_address)) {
89 pr_notice("Ignoring BGRT: invalid image address\n");
90 goto out;
91 }
65 image = early_memremap(bgrt->image_address, sizeof(bmp_header));92 image = early_memremap(bgrt->image_address, sizeof(bmp_header));
66 if (!image) {93 if (!image) {
67 pr_notice("Ignoring BGRT: failed to map image header memory\n");94 pr_notice("Ignoring BGRT: failed to map image header memory\n");
drivers/firmware/efi/libstub/secureboot.c+2−2
@@ -16,10 +16,10 @@ · 15 unmodified lines
16 16
17/* BIOS variables */17/* BIOS variables */
18static const efi_guid_t efi_variable_guid = EFI_GLOBAL_VARIABLE_GUID;18static const efi_guid_t efi_variable_guid = EFI_GLOBAL_VARIABLE_GUID;
19static const efi_char16_t const efi_SecureBoot_name[] = {19static const efi_char16_t efi_SecureBoot_name[] = {
20 'S', 'e', 'c', 'u', 'r', 'e', 'B', 'o', 'o', 't', 020 'S', 'e', 'c', 'u', 'r', 'e', 'B', 'o', 'o', 't', 0
21};21};
22static const efi_char16_t const efi_SetupMode_name[] = {22static const efi_char16_t efi_SetupMode_name[] = {
23 'S', 'e', 't', 'u', 'p', 'M', 'o', 'd', 'e', 023 'S', 'e', 't', 'u', 'p', 'M', 'o', 'd', 'e', 0
24};24};
25 25
drivers/firmware/google/vpd.c+4−4
@@ -136,12 +136,12 @@ static int vpd_section_attrib_add(const u8 *key, s32 key_len, · 135 unmodified lines
136 info->value = value;136 info->value = value;
137 137
138 INIT_LIST_HEAD(&info->list);138 INIT_LIST_HEAD(&info->list);
139 list_add_tail(&info->list, &sec->attribs);
140 139
141 ret = sysfs_create_bin_file(sec->kobj, &info->bin_attr);140 ret = sysfs_create_bin_file(sec->kobj, &info->bin_attr);
142 if (ret)141 if (ret)
143 goto free_info_key;142 goto free_info_key;
144 143
144 list_add_tail(&info->list, &sec->attribs);
145 return 0;145 return 0;
146 146
147free_info_key:147free_info_key:
@@ -158,8 +158,8 @@ static void vpd_section_attrib_destroy(struct vpd_section *sec) · 10 unmodified lines
158 struct vpd_attrib_info *temp;158 struct vpd_attrib_info *temp;
159 159
160 list_for_each_entry_safe(info, temp, &sec->attribs, list) {160 list_for_each_entry_safe(info, temp, &sec->attribs, list) {
161 kfree(info->key);
162 sysfs_remove_bin_file(sec->kobj, &info->bin_attr);161 sysfs_remove_bin_file(sec->kobj, &info->bin_attr);
162 kfree(info->key);
163 kfree(info);163 kfree(info);
164 }164 }
165}165}
@@ -244,7 +244,7 @@ static int vpd_section_destroy(struct vpd_section *sec) · 78 unmodified lines
244{244{
245 if (sec->enabled) {245 if (sec->enabled) {
246 vpd_section_attrib_destroy(sec);246 vpd_section_attrib_destroy(sec);
247 kobject_del(sec->kobj);247 kobject_put(sec->kobj);
248 sysfs_remove_bin_file(vpd_kobj, &sec->bin_attr);248 sysfs_remove_bin_file(vpd_kobj, &sec->bin_attr);
249 kfree(sec->raw_name);249 kfree(sec->raw_name);
250 iounmap(sec->baseaddr);250 iounmap(sec->baseaddr);
@@ -331,7 +331,7 @@ static void __exit vpd_platform_exit(void) · 80 unmodified lines
331{331{
332 vpd_section_destroy(&ro_vpd);332 vpd_section_destroy(&ro_vpd);
333 vpd_section_destroy(&rw_vpd);333 vpd_section_destroy(&rw_vpd);
334 kobject_del(vpd_kobj);334 kobject_put(vpd_kobj);
335}335}
336 336
337module_init(vpd_platform_init);337module_init(vpd_platform_init);
drivers/gpio/gpio-aspeed.c+3−0
@@ -646,6 +646,9 @@ static int enable_debounce(struct gpio_chip *chip, unsigned int offset, · 645 unmodified lines
646 int rc;646 int rc;
647 int i;647 int i;
648 648
649 if (!gpio->clk)
650 return -EINVAL;
651
649 rc = usecs_to_cycles(gpio, usecs, &requested_cycles);652 rc = usecs_to_cycles(gpio, usecs, &requested_cycles);
650 if (rc < 0) {653 if (rc < 0) {
651 dev_warn(chip->parent, "Failed to convert %luus to cycles at %luHz: %d\n",654 dev_warn(chip->parent, "Failed to convert %luus to cycles at %luHz: %d\n",
drivers/gpio/gpio-crystalcove.c+36−18
@@ -90,8 +90,18 @@ static inline int to_reg(int gpio, enum ctrl_register reg_type) · 89 unmodified lines
90{90{
91 int reg;91 int reg;
92 92
93 if (gpio == 94)93 if (gpio >= CRYSTALCOVE_GPIO_NUM) {
94 return GPIOPANELCTL;94 /*
95 * Virtual GPIO called from ACPI, for now we only support
96 * the panel ctl.
97 */
98 switch (gpio) {
99 case 0x5e:
100 return GPIOPANELCTL;
101 default:
102 return -EOPNOTSUPP;
103 }
104 }
95 105
96 if (reg_type == CTRL_IN) {106 if (reg_type == CTRL_IN) {
97 if (gpio < 8)107 if (gpio < 8)
@@ -130,36 +140,36 @@ static void crystalcove_update_irq_ctrl(struct crystalcove_gpio *cg, int gpio) · 32 unmodified lines
130static int crystalcove_gpio_dir_in(struct gpio_chip *chip, unsigned gpio)140static int crystalcove_gpio_dir_in(struct gpio_chip *chip, unsigned gpio)
131{141{
132 struct crystalcove_gpio *cg = gpiochip_get_data(chip);142 struct crystalcove_gpio *cg = gpiochip_get_data(chip);
143 int reg = to_reg(gpio, CTRL_OUT);
133 144
134 if (gpio > CRYSTALCOVE_VGPIO_NUM)145 if (reg < 0)
135 return 0;146 return 0;
136 147
137 return regmap_write(cg->regmap, to_reg(gpio, CTRL_OUT),148 return regmap_write(cg->regmap, reg, CTLO_INPUT_SET);
138 CTLO_INPUT_SET);
139}149}
140 150
141static int crystalcove_gpio_dir_out(struct gpio_chip *chip, unsigned gpio,151static int crystalcove_gpio_dir_out(struct gpio_chip *chip, unsigned gpio,
142 int value)152 int value)
143{153{
144 struct crystalcove_gpio *cg = gpiochip_get_data(chip);154 struct crystalcove_gpio *cg = gpiochip_get_data(chip);
155 int reg = to_reg(gpio, CTRL_OUT);
145 156
146 if (gpio > CRYSTALCOVE_VGPIO_NUM)157 if (reg < 0)
147 return 0;158 return 0;
148 159
149 return regmap_write(cg->regmap, to_reg(gpio, CTRL_OUT),160 return regmap_write(cg->regmap, reg, CTLO_OUTPUT_SET | value);
150 CTLO_OUTPUT_SET | value);
151}161}
152 162
153static int crystalcove_gpio_get(struct gpio_chip *chip, unsigned gpio)163static int crystalcove_gpio_get(struct gpio_chip *chip, unsigned gpio)
154{164{
155 struct crystalcove_gpio *cg = gpiochip_get_data(chip);165 struct crystalcove_gpio *cg = gpiochip_get_data(chip);
156 int ret;
157 unsigned int val;166 unsigned int val;
167 int ret, reg = to_reg(gpio, CTRL_IN);
158 168
159 if (gpio > CRYSTALCOVE_VGPIO_NUM)169 if (reg < 0)
160 return 0;170 return 0;
161 171
162 ret = regmap_read(cg->regmap, to_reg(gpio, CTRL_IN), &val);172 ret = regmap_read(cg->regmap, reg, &val);
163 if (ret)173 if (ret)
164 return ret;174 return ret;
165 175
@@ -170,14 +180,15 @@ static void crystalcove_gpio_set(struct gpio_chip *chip, · 4 unmodified lines
170 unsigned gpio, int value)180 unsigned gpio, int value)
171{181{
172 struct crystalcove_gpio *cg = gpiochip_get_data(chip);182 struct crystalcove_gpio *cg = gpiochip_get_data(chip);
183 int reg = to_reg(gpio, CTRL_OUT);
173 184
174 if (gpio > CRYSTALCOVE_VGPIO_NUM)185 if (reg < 0)
175 return;186 return;
176 187
177 if (value)188 if (value)
178 regmap_update_bits(cg->regmap, to_reg(gpio, CTRL_OUT), 1, 1);189 regmap_update_bits(cg->regmap, reg, 1, 1);
179 else190 else
180 regmap_update_bits(cg->regmap, to_reg(gpio, CTRL_OUT), 1, 0);191 regmap_update_bits(cg->regmap, reg, 1, 0);
181}192}
182 193
183static int crystalcove_irq_type(struct irq_data *data, unsigned type)194static int crystalcove_irq_type(struct irq_data *data, unsigned type)
@@ -185,6 +196,9 @@ static int crystalcove_irq_type(struct irq_data *data, unsigned type) · 1 unmodified line
185 struct crystalcove_gpio *cg =196 struct crystalcove_gpio *cg =
186 gpiochip_get_data(irq_data_get_irq_chip_data(data));197 gpiochip_get_data(irq_data_get_irq_chip_data(data));
187 198
199 if (data->hwirq >= CRYSTALCOVE_GPIO_NUM)
200 return 0;
201
188 switch (type) {202 switch (type) {
189 case IRQ_TYPE_NONE:203 case IRQ_TYPE_NONE:
190 cg->intcnt_value = CTLI_INTCNT_DIS;204 cg->intcnt_value = CTLI_INTCNT_DIS;
@@ -235,8 +249,10 @@ static void crystalcove_irq_unmask(struct irq_data *data) · 44 unmodified lines
235 struct crystalcove_gpio *cg =249 struct crystalcove_gpio *cg =
236 gpiochip_get_data(irq_data_get_irq_chip_data(data));250 gpiochip_get_data(irq_data_get_irq_chip_data(data));
237 251
238 cg->set_irq_mask = false;252 if (data->hwirq < CRYSTALCOVE_GPIO_NUM) {
239 cg->update |= UPDATE_IRQ_MASK;253 cg->set_irq_mask = false;
254 cg->update |= UPDATE_IRQ_MASK;
255 }
240}256}
241 257
242static void crystalcove_irq_mask(struct irq_data *data)258static void crystalcove_irq_mask(struct irq_data *data)
@@ -244,8 +260,10 @@ static void crystalcove_irq_mask(struct irq_data *data) · 1 unmodified line
244 struct crystalcove_gpio *cg =260 struct crystalcove_gpio *cg =
245 gpiochip_get_data(irq_data_get_irq_chip_data(data));261 gpiochip_get_data(irq_data_get_irq_chip_data(data));
246 262
247 cg->set_irq_mask = true;263 if (data->hwirq < CRYSTALCOVE_GPIO_NUM) {
248 cg->update |= UPDATE_IRQ_MASK;264 cg->set_irq_mask = true;
265 cg->update |= UPDATE_IRQ_MASK;
266 }
249}267}
250 268
251static struct irq_chip crystalcove_irqchip = {269static struct irq_chip crystalcove_irqchip = {
drivers/gpio/gpio-mvebu.c+8−1
@@ -747,7 +747,7 @@ static int mvebu_pwm_probe(struct platform_device *pdev, · 746 unmodified lines
747 set = U32_MAX;747 set = U32_MAX;
748 else748 else
749 return -EINVAL;749 return -EINVAL;
750 writel_relaxed(0, mvebu_gpioreg_blink_counter_select(mvchip));750 writel_relaxed(set, mvebu_gpioreg_blink_counter_select(mvchip));
751 751
752 mvpwm = devm_kzalloc(dev, sizeof(struct mvebu_pwm), GFP_KERNEL);752 mvpwm = devm_kzalloc(dev, sizeof(struct mvebu_pwm), GFP_KERNEL);
753 if (!mvpwm)753 if (!mvpwm)
@@ -768,6 +768,13 @@ static int mvebu_pwm_probe(struct platform_device *pdev, · 14 unmodified lines
768 mvpwm->chip.dev = dev;768 mvpwm->chip.dev = dev;
769 mvpwm->chip.ops = &mvebu_pwm_ops;769 mvpwm->chip.ops = &mvebu_pwm_ops;
770 mvpwm->chip.npwm = mvchip->chip.ngpio;770 mvpwm->chip.npwm = mvchip->chip.ngpio;
771 /*
772 * There may already be some PWM allocated, so we can't force
773 * mvpwm->chip.base to a fixed point like mvchip->chip.base.
774 * So, we let pwmchip_add() do the numbering and take the next free
775 * region.
776 */
777 mvpwm->chip.base = -1;
771 778
772 spin_lock_init(&mvpwm->lock);779 spin_lock_init(&mvpwm->lock);
773 780
drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c+5−5
@@ -220,9 +220,9 @@ static void amdgpu_vram_mgr_debug(struct ttm_mem_type_manager *man, · 219 unmodified lines
220}220}
221 221
222const struct ttm_mem_type_manager_func amdgpu_vram_mgr_func = {222const struct ttm_mem_type_manager_func amdgpu_vram_mgr_func = {
223 amdgpu_vram_mgr_init,223 .init = amdgpu_vram_mgr_init,
224 amdgpu_vram_mgr_fini,224 .takedown = amdgpu_vram_mgr_fini,
225 amdgpu_vram_mgr_new,225 .get_node = amdgpu_vram_mgr_new,
226 amdgpu_vram_mgr_del,226 .put_node = amdgpu_vram_mgr_del,
227 amdgpu_vram_mgr_debug227 .debug = amdgpu_vram_mgr_debug
228};228};
drivers/gpu/drm/amd/amdgpu/dce_v10_0.c+5−2
@@ -1207,8 +1207,11 @@ static void dce_v10_0_program_watermarks(struct amdgpu_device *adev, · 1206 unmodified lines
1207 u32 tmp, wm_mask, lb_vblank_lead_lines = 0;1207 u32 tmp, wm_mask, lb_vblank_lead_lines = 0;
1208 1208
1209 if (amdgpu_crtc->base.enabled && num_heads && mode) {1209 if (amdgpu_crtc->base.enabled && num_heads && mode) {
1210 active_time = 1000000UL * (u32)mode->crtc_hdisplay / (u32)mode->clock;1210 active_time = (u32) div_u64((u64)mode->crtc_hdisplay * 1000000,
1211 line_time = min((u32) (1000000UL * (u32)mode->crtc_htotal / (u32)mode->clock), (u32)65535);1211 (u32)mode->clock);
1212 line_time = (u32) div_u64((u64)mode->crtc_htotal * 1000000,
1213 (u32)mode->clock);
1214 line_time = min(line_time, (u32)65535);
1212 1215
1213 /* watermark for high clocks */1216 /* watermark for high clocks */
1214 if (adev->pm.dpm_enabled) {1217 if (adev->pm.dpm_enabled) {
drivers/gpu/drm/amd/amdgpu/dce_v11_0.c+5−2
@@ -1176,8 +1176,11 @@ static void dce_v11_0_program_watermarks(struct amdgpu_device *adev, · 1175 unmodified lines
1176 u32 tmp, wm_mask, lb_vblank_lead_lines = 0;1176 u32 tmp, wm_mask, lb_vblank_lead_lines = 0;
1177 1177
1178 if (amdgpu_crtc->base.enabled && num_heads && mode) {1178 if (amdgpu_crtc->base.enabled && num_heads && mode) {
1179 active_time = 1000000UL * (u32)mode->crtc_hdisplay / (u32)mode->clock;1179 active_time = (u32) div_u64((u64)mode->crtc_hdisplay * 1000000,
1180 line_time = min((u32) (1000000UL * (u32)mode->crtc_htotal / (u32)mode->clock), (u32)65535);1180 (u32)mode->clock);
1181 line_time = (u32) div_u64((u64)mode->crtc_htotal * 1000000,
1182 (u32)mode->clock);
1183 line_time = min(line_time, (u32)65535);
1181 1184
1182 /* watermark for high clocks */1185 /* watermark for high clocks */
1183 if (adev->pm.dpm_enabled) {1186 if (adev->pm.dpm_enabled) {
drivers/gpu/drm/amd/amdgpu/dce_v6_0.c+5−2
@@ -983,8 +983,11 @@ static void dce_v6_0_program_watermarks(struct amdgpu_device *adev, · 982 unmodified lines
983 fixed20_12 a, b, c;983 fixed20_12 a, b, c;
984 984
985 if (amdgpu_crtc->base.enabled && num_heads && mode) {985 if (amdgpu_crtc->base.enabled && num_heads && mode) {
986 active_time = 1000000UL * (u32)mode->crtc_hdisplay / (u32)mode->clock;986 active_time = (u32) div_u64((u64)mode->crtc_hdisplay * 1000000,
987 line_time = min((u32) (1000000UL * (u32)mode->crtc_htotal / (u32)mode->clock), (u32)65535);987 (u32)mode->clock);
988 line_time = (u32) div_u64((u64)mode->crtc_htotal * 1000000,
989 (u32)mode->clock);
990 line_time = min(line_time, (u32)65535);
988 priority_a_cnt = 0;991 priority_a_cnt = 0;
989 priority_b_cnt = 0;992 priority_b_cnt = 0;
990 993
drivers/gpu/drm/amd/amdgpu/dce_v8_0.c+5−2
@@ -1091,8 +1091,11 @@ static void dce_v8_0_program_watermarks(struct amdgpu_device *adev, · 1090 unmodified lines
1091 u32 tmp, wm_mask, lb_vblank_lead_lines = 0;1091 u32 tmp, wm_mask, lb_vblank_lead_lines = 0;
1092 1092
1093 if (amdgpu_crtc->base.enabled && num_heads && mode) {1093 if (amdgpu_crtc->base.enabled && num_heads && mode) {
1094 active_time = 1000000UL * (u32)mode->crtc_hdisplay / (u32)mode->clock;1094 active_time = (u32) div_u64((u64)mode->crtc_hdisplay * 1000000,
1095 line_time = min((u32) (1000000UL * (u32)mode->crtc_htotal / (u32)mode->clock), (u32)65535);1095 (u32)mode->clock);
1096 line_time = (u32) div_u64((u64)mode->crtc_htotal * 1000000,
1097 (u32)mode->clock);
1098 line_time = min(line_time, (u32)65535);
1096 1099
1097 /* watermark for high clocks */1100 /* watermark for high clocks */
1098 if (adev->pm.dpm_enabled) {1101 if (adev->pm.dpm_enabled) {
drivers/gpu/drm/amd/amdgpu/vce_v3_0.c+68−27
@@ -77,13 +77,26 @@ static int vce_v3_0_set_clockgating_state(void *handle, · 76 unmodified lines
77static uint64_t vce_v3_0_ring_get_rptr(struct amdgpu_ring *ring)77static uint64_t vce_v3_0_ring_get_rptr(struct amdgpu_ring *ring)
78{78{
79 struct amdgpu_device *adev = ring->adev;79 struct amdgpu_device *adev = ring->adev;
80 u32 v;
81
82 mutex_lock(&adev->grbm_idx_mutex);
83 if (adev->vce.harvest_config == 0 ||
84 adev->vce.harvest_config == AMDGPU_VCE_HARVEST_VCE1)
85 WREG32(mmGRBM_GFX_INDEX, GET_VCE_INSTANCE(0));
86 else if (adev->vce.harvest_config == AMDGPU_VCE_HARVEST_VCE0)
87 WREG32(mmGRBM_GFX_INDEX, GET_VCE_INSTANCE(1));
80 88
81 if (ring == &adev->vce.ring[0])89 if (ring == &adev->vce.ring[0])
82 return RREG32(mmVCE_RB_RPTR);90 v = RREG32(mmVCE_RB_RPTR);
83 else if (ring == &adev->vce.ring[1])91 else if (ring == &adev->vce.ring[1])
84 return RREG32(mmVCE_RB_RPTR2);92 v = RREG32(mmVCE_RB_RPTR2);
85 else93 else
86 return RREG32(mmVCE_RB_RPTR3);94 v = RREG32(mmVCE_RB_RPTR3);
95
96 WREG32(mmGRBM_GFX_INDEX, mmGRBM_GFX_INDEX_DEFAULT);
97 mutex_unlock(&adev->grbm_idx_mutex);
98
99 return v;
87}100}
88 101
89/**102/**
@@ -96,13 +109,26 @@ static uint64_t vce_v3_0_ring_get_rptr(struct amdgpu_ring *ring) · 6 unmodified lines
96static uint64_t vce_v3_0_ring_get_wptr(struct amdgpu_ring *ring)109static uint64_t vce_v3_0_ring_get_wptr(struct amdgpu_ring *ring)
97{110{
98 struct amdgpu_device *adev = ring->adev;111 struct amdgpu_device *adev = ring->adev;
112 u32 v;
113
114 mutex_lock(&adev->grbm_idx_mutex);
115 if (adev->vce.harvest_config == 0 ||
116 adev->vce.harvest_config == AMDGPU_VCE_HARVEST_VCE1)
117 WREG32(mmGRBM_GFX_INDEX, GET_VCE_INSTANCE(0));
118 else if (adev->vce.harvest_config == AMDGPU_VCE_HARVEST_VCE0)
119 WREG32(mmGRBM_GFX_INDEX, GET_VCE_INSTANCE(1));
99 120
100 if (ring == &adev->vce.ring[0])121 if (ring == &adev->vce.ring[0])
101 return RREG32(mmVCE_RB_WPTR);122 v = RREG32(mmVCE_RB_WPTR);
102 else if (ring == &adev->vce.ring[1])123 else if (ring == &adev->vce.ring[1])
103 return RREG32(mmVCE_RB_WPTR2);124 v = RREG32(mmVCE_RB_WPTR2);
104 else125 else
105 return RREG32(mmVCE_RB_WPTR3);126 v = RREG32(mmVCE_RB_WPTR3);
127
128 WREG32(mmGRBM_GFX_INDEX, mmGRBM_GFX_INDEX_DEFAULT);
129 mutex_unlock(&adev->grbm_idx_mutex);
130
131 return v;
106}132}
107 133
108/**134/**
@@ -116,12 +142,22 @@ static void vce_v3_0_ring_set_wptr(struct amdgpu_ring *ring) · 7 unmodified lines
116{142{
117 struct amdgpu_device *adev = ring->adev;143 struct amdgpu_device *adev = ring->adev;
118 144
145 mutex_lock(&adev->grbm_idx_mutex);
146 if (adev->vce.harvest_config == 0 ||
147 adev->vce.harvest_config == AMDGPU_VCE_HARVEST_VCE1)
148 WREG32(mmGRBM_GFX_INDEX, GET_VCE_INSTANCE(0));
149 else if (adev->vce.harvest_config == AMDGPU_VCE_HARVEST_VCE0)
150 WREG32(mmGRBM_GFX_INDEX, GET_VCE_INSTANCE(1));
151
119 if (ring == &adev->vce.ring[0])152 if (ring == &adev->vce.ring[0])
120 WREG32(mmVCE_RB_WPTR, lower_32_bits(ring->wptr));153 WREG32(mmVCE_RB_WPTR, lower_32_bits(ring->wptr));
121 else if (ring == &adev->vce.ring[1])154 else if (ring == &adev->vce.ring[1])
122 WREG32(mmVCE_RB_WPTR2, lower_32_bits(ring->wptr));155 WREG32(mmVCE_RB_WPTR2, lower_32_bits(ring->wptr));
123 else156 else
124 WREG32(mmVCE_RB_WPTR3, lower_32_bits(ring->wptr));157 WREG32(mmVCE_RB_WPTR3, lower_32_bits(ring->wptr));
158
159 WREG32(mmGRBM_GFX_INDEX, mmGRBM_GFX_INDEX_DEFAULT);
160 mutex_unlock(&adev->grbm_idx_mutex);
125}161}
126 162
127static void vce_v3_0_override_vce_clock_gating(struct amdgpu_device *adev, bool override)163static void vce_v3_0_override_vce_clock_gating(struct amdgpu_device *adev, bool override)
@@ -231,33 +267,38 @@ static int vce_v3_0_start(struct amdgpu_device *adev) · 103 unmodified lines
231 struct amdgpu_ring *ring;267 struct amdgpu_ring *ring;
232 int idx, r;268 int idx, r;
233 269
234 ring = &adev->vce.ring[0];
235 WREG32(mmVCE_RB_RPTR, lower_32_bits(ring->wptr));
236 WREG32(mmVCE_RB_WPTR, lower_32_bits(ring->wptr));
237 WREG32(mmVCE_RB_BASE_LO, ring->gpu_addr);
238 WREG32(mmVCE_RB_BASE_HI, upper_32_bits(ring->gpu_addr));
239 WREG32(mmVCE_RB_SIZE, ring->ring_size / 4);
240
241 ring = &adev->vce.ring[1];
242 WREG32(mmVCE_RB_RPTR2, lower_32_bits(ring->wptr));
243 WREG32(mmVCE_RB_WPTR2, lower_32_bits(ring->wptr));
244 WREG32(mmVCE_RB_BASE_LO2, ring->gpu_addr);
245 WREG32(mmVCE_RB_BASE_HI2, upper_32_bits(ring->gpu_addr));
246 WREG32(mmVCE_RB_SIZE2, ring->ring_size / 4);
247
248 ring = &adev->vce.ring[2];
249 WREG32(mmVCE_RB_RPTR3, lower_32_bits(ring->wptr));
250 WREG32(mmVCE_RB_WPTR3, lower_32_bits(ring->wptr));
251 WREG32(mmVCE_RB_BASE_LO3, ring->gpu_addr);
252 WREG32(mmVCE_RB_BASE_HI3, upper_32_bits(ring->gpu_addr));
253 WREG32(mmVCE_RB_SIZE3, ring->ring_size / 4);
254
255 mutex_lock(&adev->grbm_idx_mutex);270 mutex_lock(&adev->grbm_idx_mutex);
256 for (idx = 0; idx < 2; ++idx) {271 for (idx = 0; idx < 2; ++idx) {
257 if (adev->vce.harvest_config & (1 << idx))272 if (adev->vce.harvest_config & (1 << idx))
258 continue;273 continue;
259 274
260 WREG32(mmGRBM_GFX_INDEX, GET_VCE_INSTANCE(idx));275 WREG32(mmGRBM_GFX_INDEX, GET_VCE_INSTANCE(idx));
276
277 /* Program instance 0 reg space for two instances or instance 0 case
278 program instance 1 reg space for only instance 1 available case */
279 if (idx != 1 || adev->vce.harvest_config == AMDGPU_VCE_HARVEST_VCE0) {
280 ring = &adev->vce.ring[0];
281 WREG32(mmVCE_RB_RPTR, lower_32_bits(ring->wptr));
282 WREG32(mmVCE_RB_WPTR, lower_32_bits(ring->wptr));
283 WREG32(mmVCE_RB_BASE_LO, ring->gpu_addr);
284 WREG32(mmVCE_RB_BASE_HI, upper_32_bits(ring->gpu_addr));
285 WREG32(mmVCE_RB_SIZE, ring->ring_size / 4);
286
287 ring = &adev->vce.ring[1];
288 WREG32(mmVCE_RB_RPTR2, lower_32_bits(ring->wptr));
289 WREG32(mmVCE_RB_WPTR2, lower_32_bits(ring->wptr));
290 WREG32(mmVCE_RB_BASE_LO2, ring->gpu_addr);
291 WREG32(mmVCE_RB_BASE_HI2, upper_32_bits(ring->gpu_addr));
292 WREG32(mmVCE_RB_SIZE2, ring->ring_size / 4);
293
294 ring = &adev->vce.ring[2];
295 WREG32(mmVCE_RB_RPTR3, lower_32_bits(ring->wptr));
296 WREG32(mmVCE_RB_WPTR3, lower_32_bits(ring->wptr));
297 WREG32(mmVCE_RB_BASE_LO3, ring->gpu_addr);
298 WREG32(mmVCE_RB_BASE_HI3, upper_32_bits(ring->gpu_addr));
299 WREG32(mmVCE_RB_SIZE3, ring->ring_size / 4);
300 }
301
261 vce_v3_0_mc_resume(adev, idx);302 vce_v3_0_mc_resume(adev, idx);
262 WREG32_FIELD(VCE_STATUS, JOB_BUSY, 1);303 WREG32_FIELD(VCE_STATUS, JOB_BUSY, 1);
263 304
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_thermal.c+10−10
@@ -709,17 +709,17 @@ static int tf_vega10_thermal_disable_alert(struct pp_hwmgr *hwmgr, · 708 unmodified lines
709 709
710static struct phm_master_table_item710static struct phm_master_table_item
711vega10_thermal_start_thermal_controller_master_list[] = {711vega10_thermal_start_thermal_controller_master_list[] = {
712 {NULL, tf_vega10_thermal_initialize},712 { .tableFunction = tf_vega10_thermal_initialize },
713 {NULL, tf_vega10_thermal_set_temperature_range},713 { .tableFunction = tf_vega10_thermal_set_temperature_range },
714 {NULL, tf_vega10_thermal_enable_alert},714 { .tableFunction = tf_vega10_thermal_enable_alert },
715/* We should restrict performance levels to low before we halt the SMC.715/* We should restrict performance levels to low before we halt the SMC.
716 * On the other hand we are still in boot state when we do this716 * On the other hand we are still in boot state when we do this
717 * so it would be pointless.717 * so it would be pointless.
718 * If this assumption changes we have to revisit this table.718 * If this assumption changes we have to revisit this table.
719 */719 */
720 {NULL, tf_vega10_thermal_setup_fan_table},720 { .tableFunction = tf_vega10_thermal_setup_fan_table },
721 {NULL, tf_vega10_thermal_start_smc_fan_control},721 { .tableFunction = tf_vega10_thermal_start_smc_fan_control },
722 {NULL, NULL}722 { }
723};723};
724 724
725static struct phm_master_table_header725static struct phm_master_table_header
@@ -731,10 +731,10 @@ vega10_thermal_start_thermal_controller_master = { · 5 unmodified lines
731 731
732static struct phm_master_table_item732static struct phm_master_table_item
733vega10_thermal_set_temperature_range_master_list[] = {733vega10_thermal_set_temperature_range_master_list[] = {
734 {NULL, tf_vega10_thermal_disable_alert},734 { .tableFunction = tf_vega10_thermal_disable_alert },
735 {NULL, tf_vega10_thermal_set_temperature_range},735 { .tableFunction = tf_vega10_thermal_set_temperature_range },
736 {NULL, tf_vega10_thermal_enable_alert},736 { .tableFunction = tf_vega10_thermal_enable_alert },
737 {NULL, NULL}737 { }
738};738};
739 739
740struct phm_master_table_header740struct phm_master_table_header
drivers/gpu/drm/bridge/synopsys/Kconfig+1−0
@@ -1,6 +1,7 @@
1config DRM_DW_HDMI1config DRM_DW_HDMI
2 tristate2 tristate
3 select DRM_KMS_HELPER3 select DRM_KMS_HELPER
4 select REGMAP_MMIO
4 5
5config DRM_DW_HDMI_AHB_AUDIO6config DRM_DW_HDMI_AHB_AUDIO
6 tristate "Synopsys Designware AHB Audio interface"7 tristate "Synopsys Designware AHB Audio interface"
drivers/gpu/drm/drm_atomic_helper.c+11−0
@@ -508,6 +508,8 @@ drm_atomic_helper_check_modeset(struct drm_device *dev, · 507 unmodified lines
508 bool has_connectors =508 bool has_connectors =
509 !!new_crtc_state->connector_mask;509 !!new_crtc_state->connector_mask;
510 510
511 WARN_ON(!drm_modeset_is_locked(&crtc->mutex));
512
511 if (!drm_mode_equal(&old_crtc_state->mode, &new_crtc_state->mode)) {513 if (!drm_mode_equal(&old_crtc_state->mode, &new_crtc_state->mode)) {
512 DRM_DEBUG_ATOMIC("[CRTC:%d:%s] mode changed\n",514 DRM_DEBUG_ATOMIC("[CRTC:%d:%s] mode changed\n",
513 crtc->base.id, crtc->name);515 crtc->base.id, crtc->name);
@@ -551,6 +553,8 @@ drm_atomic_helper_check_modeset(struct drm_device *dev, · 37 unmodified lines
551 for_each_oldnew_connector_in_state(state, connector, old_connector_state, new_connector_state, i) {553 for_each_oldnew_connector_in_state(state, connector, old_connector_state, new_connector_state, i) {
552 const struct drm_connector_helper_funcs *funcs = connector->helper_private;554 const struct drm_connector_helper_funcs *funcs = connector->helper_private;
553 555
556 WARN_ON(!drm_modeset_is_locked(&dev->mode_config.connection_mutex));
557
554 /*558 /*
555 * This only sets crtc->connectors_changed for routing changes,559 * This only sets crtc->connectors_changed for routing changes,
556 * drivers must set crtc->connectors_changed themselves when560 * drivers must set crtc->connectors_changed themselves when
@@ -650,6 +654,8 @@ drm_atomic_helper_check_planes(struct drm_device *dev, · 93 unmodified lines
650 for_each_oldnew_plane_in_state(state, plane, old_plane_state, new_plane_state, i) {654 for_each_oldnew_plane_in_state(state, plane, old_plane_state, new_plane_state, i) {
651 const struct drm_plane_helper_funcs *funcs;655 const struct drm_plane_helper_funcs *funcs;
652 656
657 WARN_ON(!drm_modeset_is_locked(&plane->mutex));
658
653 funcs = plane->helper_private;659 funcs = plane->helper_private;
654 660
655 drm_atomic_helper_plane_changed(state, old_plane_state, new_plane_state, plane);661 drm_atomic_helper_plane_changed(state, old_plane_state, new_plane_state, plane);
@@ -2663,7 +2669,12 @@ int drm_atomic_helper_resume(struct drm_device *dev, · 2007 unmodified lines
2663 2669
2664 drm_modeset_acquire_init(&ctx, 0);2670 drm_modeset_acquire_init(&ctx, 0);
2665 while (1) {2671 while (1) {
2672 err = drm_modeset_lock_all_ctx(dev, &ctx);
2673 if (err)
2674 goto out;
2675
2666 err = drm_atomic_helper_commit_duplicated_state(state, &ctx);2676 err = drm_atomic_helper_commit_duplicated_state(state, &ctx);
2677out:
2667 if (err != -EDEADLK)2678 if (err != -EDEADLK)
2668 break;2679 break;
2669 2680
drivers/gpu/drm/drm_dp_helper.c+83−0
@@ -1208,3 +1208,86 @@ int drm_dp_stop_crc(struct drm_dp_aux *aux) · 1207 unmodified lines
1208 return 0;1208 return 0;
1209}1209}
1210EXPORT_SYMBOL(drm_dp_stop_crc);1210EXPORT_SYMBOL(drm_dp_stop_crc);
1211
1212struct dpcd_quirk {
1213 u8 oui[3];
1214 bool is_branch;
1215 u32 quirks;
1216};
1217
1218#define OUI(first, second, third) { (first), (second), (third) }
1219
1220static const struct dpcd_quirk dpcd_quirk_list[] = {
1221 /* Analogix 7737 needs reduced M and N at HBR2 link rates */
1222 { OUI(0x00, 0x22, 0xb9), true, BIT(DP_DPCD_QUIRK_LIMITED_M_N) },
1223};
1224
1225#undef OUI
1226
1227/*
1228 * Get a bit mask of DPCD quirks for the sink/branch device identified by
1229 * ident. The quirk data is shared but it's up to the drivers to act on the
1230 * data.
1231 *
1232 * For now, only the OUI (first three bytes) is used, but this may be extended
1233 * to device identification string and hardware/firmware revisions later.
1234 */
1235static u32
1236drm_dp_get_quirks(const struct drm_dp_dpcd_ident *ident, bool is_branch)
1237{
1238 const struct dpcd_quirk *quirk;
1239 u32 quirks = 0;
1240 int i;
1241
1242 for (i = 0; i < ARRAY_SIZE(dpcd_quirk_list); i++) {
1243 quirk = &dpcd_quirk_list[i];
1244
1245 if (quirk->is_branch != is_branch)
1246 continue;
1247
1248 if (memcmp(quirk->oui, ident->oui, sizeof(ident->oui)) != 0)
1249 continue;
1250
1251 quirks |= quirk->quirks;
1252 }
1253
1254 return quirks;
1255}
1256
1257/**
1258 * drm_dp_read_desc - read sink/branch descriptor from DPCD
1259 * @aux: DisplayPort AUX channel
1260 * @desc: Device decriptor to fill from DPCD
1261 * @is_branch: true for branch devices, false for sink devices
1262 *
1263 * Read DPCD 0x400 (sink) or 0x500 (branch) into @desc. Also debug log the
1264 * identification.
1265 *
1266 * Returns 0 on success or a negative error code on failure.
1267 */
1268int drm_dp_read_desc(struct drm_dp_aux *aux, struct drm_dp_desc *desc,
1269 bool is_branch)
1270{
1271 struct drm_dp_dpcd_ident *ident = &desc->ident;
1272 unsigned int offset = is_branch ? DP_BRANCH_OUI : DP_SINK_OUI;
1273 int ret, dev_id_len;
1274
1275 ret = drm_dp_dpcd_read(aux, offset, ident, sizeof(*ident));
1276 if (ret < 0)
1277 return ret;
1278
1279 desc->quirks = drm_dp_get_quirks(ident, is_branch);
1280
1281 dev_id_len = strnlen(ident->device_id, sizeof(ident->device_id));
1282
1283 DRM_DEBUG_KMS("DP %s: OUI %*phD dev-ID %*pE HW-rev %d.%d SW-rev %d.%d quirks 0x%04x\n",
1284 is_branch ? "branch" : "sink",
1285 (int)sizeof(ident->oui), ident->oui,
1286 dev_id_len, ident->device_id,
1287 ident->hw_rev >> 4, ident->hw_rev & 0xf,
1288 ident->sw_major_rev, ident->sw_minor_rev,
1289 desc->quirks);
1290
1291 return 0;
1292}
1293EXPORT_SYMBOL(drm_dp_read_desc);
drivers/gpu/drm/drm_drv.c+6−1
@@ -358,7 +358,12 @@ EXPORT_SYMBOL(drm_put_dev); · 357 unmodified lines
358void drm_unplug_dev(struct drm_device *dev)358void drm_unplug_dev(struct drm_device *dev)
359{359{
360 /* for a USB device */360 /* for a USB device */
361 drm_dev_unregister(dev);361 if (drm_core_check_feature(dev, DRIVER_MODESET))
362 drm_modeset_unregister_all(dev);
363
364 drm_minor_unregister(dev, DRM_MINOR_PRIMARY);
365 drm_minor_unregister(dev, DRM_MINOR_RENDER);
366 drm_minor_unregister(dev, DRM_MINOR_CONTROL);
362 367
363 mutex_lock(&drm_global_mutex);368 mutex_lock(&drm_global_mutex);
364 369
drivers/gpu/drm/exynos/exynos_drm_drv.c+1−7
@@ -82,14 +82,9 @@ err_file_priv_free: · 81 unmodified lines
82 return ret;82 return ret;
83}83}
84 84
85static void exynos_drm_preclose(struct drm_device *dev,
86 struct drm_file *file)
87{
88 exynos_drm_subdrv_close(dev, file);
89}
90
91static void exynos_drm_postclose(struct drm_device *dev, struct drm_file *file)85static void exynos_drm_postclose(struct drm_device *dev, struct drm_file *file)
92{86{
87 exynos_drm_subdrv_close(dev, file);
93 kfree(file->driver_priv);88 kfree(file->driver_priv);
94 file->driver_priv = NULL;89 file->driver_priv = NULL;
95}90}
@@ -145,7 +140,6 @@ static struct drm_driver exynos_drm_driver = { · 49 unmodified lines
145 .driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME140 .driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME
146 | DRIVER_ATOMIC | DRIVER_RENDER,141 | DRIVER_ATOMIC | DRIVER_RENDER,
147 .open = exynos_drm_open,142 .open = exynos_drm_open,
148 .preclose = exynos_drm_preclose,
149 .lastclose = exynos_drm_lastclose,143 .lastclose = exynos_drm_lastclose,
150 .postclose = exynos_drm_postclose,144 .postclose = exynos_drm_postclose,
151 .gem_free_object_unlocked = exynos_drm_gem_free_object,145 .gem_free_object_unlocked = exynos_drm_gem_free_object,
drivers/gpu/drm/exynos/exynos_drm_drv.h+1−4
@@ -160,12 +160,9 @@ struct exynos_drm_clk { · 159 unmodified lines
160 * drm framework doesn't support multiple irq yet.160 * drm framework doesn't support multiple irq yet.
161 * we can refer to the crtc to current hardware interrupt occurred through161 * we can refer to the crtc to current hardware interrupt occurred through
162 * this pipe value.162 * this pipe value.
163 * @enabled: if the crtc is enabled or not
164 * @event: vblank event that is currently queued for flip
165 * @wait_update: wait all pending planes updates to finish
166 * @pending_update: number of pending plane updates in this crtc
167 * @ops: pointer to callbacks for exynos drm specific functionality163 * @ops: pointer to callbacks for exynos drm specific functionality
168 * @ctx: A pointer to the crtc's implementation specific context164 * @ctx: A pointer to the crtc's implementation specific context
165 * @pipe_clk: A pointer to the crtc's pipeline clock.
169 */166 */
170struct exynos_drm_crtc {167struct exynos_drm_crtc {
171 struct drm_crtc base;168 struct drm_crtc base;
drivers/gpu/drm/exynos/exynos_drm_dsi.c+9−17
@@ -1633,7 +1633,6 @@ static int exynos_dsi_parse_dt(struct exynos_dsi *dsi) · 1632 unmodified lines
1633{1633{
1634 struct device *dev = dsi->dev;1634 struct device *dev = dsi->dev;
1635 struct device_node *node = dev->of_node;1635 struct device_node *node = dev->of_node;
1636 struct device_node *ep;
1637 int ret;1636 int ret;
1638 1637
1639 ret = exynos_dsi_of_read_u32(node, "samsung,pll-clock-frequency",1638 ret = exynos_dsi_of_read_u32(node, "samsung,pll-clock-frequency",
@@ -1641,32 +1640,21 @@ static int exynos_dsi_parse_dt(struct exynos_dsi *dsi) · 1 unmodified line
1641 if (ret < 0)1640 if (ret < 0)
1642 return ret;1641 return ret;
1643 1642
1644 ep = of_graph_get_endpoint_by_regs(node, DSI_PORT_OUT, 0);1643 ret = exynos_dsi_of_read_u32(node, "samsung,burst-clock-frequency",
1645 if (!ep) {
1646 dev_err(dev, "no output port with endpoint specified\n");
1647 return -EINVAL;
1648 }
1649
1650 ret = exynos_dsi_of_read_u32(ep, "samsung,burst-clock-frequency",
1651 &dsi->burst_clk_rate);1644 &dsi->burst_clk_rate);
1652 if (ret < 0)1645 if (ret < 0)
1653 goto end;1646 return ret;
1654 1647
1655 ret = exynos_dsi_of_read_u32(ep, "samsung,esc-clock-frequency",1648 ret = exynos_dsi_of_read_u32(node, "samsung,esc-clock-frequency",
1656 &dsi->esc_clk_rate);1649 &dsi->esc_clk_rate);
1657 if (ret < 0)1650 if (ret < 0)
1658 goto end;1651 return ret;
1659
1660 of_node_put(ep);
1661 1652
1662 dsi->bridge_node = of_graph_get_remote_node(node, DSI_PORT_OUT, 0);1653 dsi->bridge_node = of_graph_get_remote_node(node, DSI_PORT_OUT, 0);
1663 if (!dsi->bridge_node)1654 if (!dsi->bridge_node)
1664 return -EINVAL;1655 return -EINVAL;
1665 1656
1666end:1657 return 0;
1667 of_node_put(ep);
1668
1669 return ret;
1670}1658}
1671 1659
1672static int exynos_dsi_bind(struct device *dev, struct device *master,1660static int exynos_dsi_bind(struct device *dev, struct device *master,
@@ -1817,6 +1805,10 @@ static int exynos_dsi_probe(struct platform_device *pdev) · 144 unmodified lines
1817 1805
1818static int exynos_dsi_remove(struct platform_device *pdev)1806static int exynos_dsi_remove(struct platform_device *pdev)
1819{1807{
1808 struct exynos_dsi *dsi = platform_get_drvdata(pdev);
1809
1810 of_node_put(dsi->bridge_node);
1811
1820 pm_runtime_disable(&pdev->dev);1812 pm_runtime_disable(&pdev->dev);
1821 1813
1822 component_del(&pdev->dev, &exynos_dsi_component_ops);1814 component_del(&pdev->dev, &exynos_dsi_component_ops);
drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c+1−1
@@ -760,7 +760,7 @@ static int dsi_parse_dt(struct platform_device *pdev, struct dw_dsi *dsi) · 759 unmodified lines
760 * Get the endpoint node. In our case, dsi has one output port1760 * Get the endpoint node. In our case, dsi has one output port1
761 * to which the external HDMI bridge is connected.761 * to which the external HDMI bridge is connected.
762 */762 */
763 ret = drm_of_find_panel_or_bridge(np, 0, 0, NULL, &dsi->bridge);763 ret = drm_of_find_panel_or_bridge(np, 1, 0, NULL, &dsi->bridge);
764 if (ret)764 if (ret)
765 return ret;765 return ret;
766 766
drivers/gpu/drm/i915/gvt/execlist.c+20−10
@@ -779,8 +779,26 @@ static void init_vgpu_execlist(struct intel_vgpu *vgpu, int ring_id) · 778 unmodified lines
779 vgpu_vreg(vgpu, ctx_status_ptr_reg) = ctx_status_ptr.dw;779 vgpu_vreg(vgpu, ctx_status_ptr_reg) = ctx_status_ptr.dw;
780}780}
781 781
782static void clean_workloads(struct intel_vgpu *vgpu, unsigned long engine_mask)
783{
784 struct drm_i915_private *dev_priv = vgpu->gvt->dev_priv;
785 struct intel_engine_cs *engine;
786 struct intel_vgpu_workload *pos, *n;
787 unsigned int tmp;
788
789 /* free the unsubmited workloads in the queues. */
790 for_each_engine_masked(engine, dev_priv, engine_mask, tmp) {
791 list_for_each_entry_safe(pos, n,
792 &vgpu->workload_q_head[engine->id], list) {
793 list_del_init(&pos->list);
794 free_workload(pos);
795 }
796 }
797}
798
782void intel_vgpu_clean_execlist(struct intel_vgpu *vgpu)799void intel_vgpu_clean_execlist(struct intel_vgpu *vgpu)
783{800{
801 clean_workloads(vgpu, ALL_ENGINES);
784 kmem_cache_destroy(vgpu->workloads);802 kmem_cache_destroy(vgpu->workloads);
785}803}
786 804
@@ -811,17 +829,9 @@ void intel_vgpu_reset_execlist(struct intel_vgpu *vgpu, · 24 unmodified lines
811{829{
812 struct drm_i915_private *dev_priv = vgpu->gvt->dev_priv;830 struct drm_i915_private *dev_priv = vgpu->gvt->dev_priv;
813 struct intel_engine_cs *engine;831 struct intel_engine_cs *engine;
814 struct intel_vgpu_workload *pos, *n;
815 unsigned int tmp;832 unsigned int tmp;
816 833
817 for_each_engine_masked(engine, dev_priv, engine_mask, tmp) {834 clean_workloads(vgpu, engine_mask);
818 /* free the unsubmited workload in the queue */835 for_each_engine_masked(engine, dev_priv, engine_mask, tmp)
819 list_for_each_entry_safe(pos, n,
820 &vgpu->workload_q_head[engine->id], list) {
821 list_del_init(&pos->list);
822 free_workload(pos);
823 }
824
825 init_vgpu_execlist(vgpu, engine->id);836 init_vgpu_execlist(vgpu, engine->id);
826 }
827}837}
drivers/gpu/drm/i915/gvt/handlers.c+21−9
@@ -1366,18 +1366,28 @@ static int skl_misc_ctl_write(struct intel_vgpu *vgpu, unsigned int offset, · 1365 unmodified lines
1366 void *p_data, unsigned int bytes)1366 void *p_data, unsigned int bytes)
1367{1367{
1368 struct drm_i915_private *dev_priv = vgpu->gvt->dev_priv;1368 struct drm_i915_private *dev_priv = vgpu->gvt->dev_priv;
1369 i915_reg_t reg = {.reg = offset};1369 u32 v = *(u32 *)p_data;
1370
1371 if (!IS_SKYLAKE(dev_priv) && !IS_KABYLAKE(dev_priv))
1372 return intel_vgpu_default_mmio_write(vgpu,
1373 offset, p_data, bytes);
1370 1374
1371 switch (offset) {1375 switch (offset) {
1372 case 0x4ddc:1376 case 0x4ddc:
1373 vgpu_vreg(vgpu, offset) = 0x8000003c;1377 /* bypass WaCompressedResourceSamplerPbeMediaNewHashMode */
1374 /* WaCompressedResourceSamplerPbeMediaNewHashMode:skl */1378 vgpu_vreg(vgpu, offset) = v & ~(1 << 31);
1375 I915_WRITE(reg, vgpu_vreg(vgpu, offset));
1376 break;1379 break;
1377 case 0x42080:1380 case 0x42080:
1378 vgpu_vreg(vgpu, offset) = 0x8000;1381 /* bypass WaCompressedResourceDisplayNewHashMode */
1379 /* WaCompressedResourceDisplayNewHashMode:skl */1382 vgpu_vreg(vgpu, offset) = v & ~(1 << 15);
1380 I915_WRITE(reg, vgpu_vreg(vgpu, offset));1383 break;
1384 case 0xe194:
1385 /* bypass WaCompressedResourceSamplerPbeMediaNewHashMode */
1386 vgpu_vreg(vgpu, offset) = v & ~(1 << 8);
1387 break;
1388 case 0x7014:
1389 /* bypass WaCompressedResourceSamplerPbeMediaNewHashMode */
1390 vgpu_vreg(vgpu, offset) = v & ~(1 << 13);
1381 break;1391 break;
1382 default:1392 default:
1383 return -EINVAL;1393 return -EINVAL;
@@ -1634,7 +1644,8 @@ static int init_generic_mmio_info(struct intel_gvt *gvt) · 250 unmodified lines
1634 MMIO_DFH(GAM_ECOCHK, D_ALL, F_CMD_ACCESS, NULL, NULL);1644 MMIO_DFH(GAM_ECOCHK, D_ALL, F_CMD_ACCESS, NULL, NULL);
1635 MMIO_DFH(GEN7_COMMON_SLICE_CHICKEN1, D_ALL, F_MODE_MASK | F_CMD_ACCESS,1645 MMIO_DFH(GEN7_COMMON_SLICE_CHICKEN1, D_ALL, F_MODE_MASK | F_CMD_ACCESS,
1636 NULL, NULL);1646 NULL, NULL);
1637 MMIO_DFH(COMMON_SLICE_CHICKEN2, D_ALL, F_MODE_MASK | F_CMD_ACCESS, NULL, NULL);1647 MMIO_DFH(COMMON_SLICE_CHICKEN2, D_ALL, F_MODE_MASK | F_CMD_ACCESS, NULL,
1648 skl_misc_ctl_write);
1638 MMIO_DFH(0x9030, D_ALL, F_CMD_ACCESS, NULL, NULL);1649 MMIO_DFH(0x9030, D_ALL, F_CMD_ACCESS, NULL, NULL);
1639 MMIO_DFH(0x20a0, D_ALL, F_CMD_ACCESS, NULL, NULL);1650 MMIO_DFH(0x20a0, D_ALL, F_CMD_ACCESS, NULL, NULL);
1640 MMIO_DFH(0x2420, D_ALL, F_CMD_ACCESS, NULL, NULL);1651 MMIO_DFH(0x2420, D_ALL, F_CMD_ACCESS, NULL, NULL);
@@ -2568,7 +2579,8 @@ static int init_broadwell_mmio_info(struct intel_gvt *gvt) · 927 unmodified lines
2568 MMIO_D(0x6e570, D_BDW_PLUS);2579 MMIO_D(0x6e570, D_BDW_PLUS);
2569 MMIO_D(0x65f10, D_BDW_PLUS);2580 MMIO_D(0x65f10, D_BDW_PLUS);
2570 2581
2571 MMIO_DFH(0xe194, D_BDW_PLUS, F_MODE_MASK | F_CMD_ACCESS, NULL, NULL);2582 MMIO_DFH(0xe194, D_BDW_PLUS, F_MODE_MASK | F_CMD_ACCESS, NULL,
2583 skl_misc_ctl_write);
2572 MMIO_DFH(0xe188, D_BDW_PLUS, F_MODE_MASK | F_CMD_ACCESS, NULL, NULL);2584 MMIO_DFH(0xe188, D_BDW_PLUS, F_MODE_MASK | F_CMD_ACCESS, NULL, NULL);
2573 MMIO_DFH(HALF_SLICE_CHICKEN2, D_BDW_PLUS, F_MODE_MASK | F_CMD_ACCESS, NULL, NULL);2585 MMIO_DFH(HALF_SLICE_CHICKEN2, D_BDW_PLUS, F_MODE_MASK | F_CMD_ACCESS, NULL, NULL);
2574 MMIO_DFH(0x2580, D_BDW_PLUS, F_MODE_MASK | F_CMD_ACCESS, NULL, NULL);2586 MMIO_DFH(0x2580, D_BDW_PLUS, F_MODE_MASK | F_CMD_ACCESS, NULL, NULL);
drivers/gpu/drm/i915/i915_drv.c+9−4
@@ -1235,6 +1235,15 @@ int i915_driver_load(struct pci_dev *pdev, const struct pci_device_id *ent) · 1234 unmodified lines
1235 goto out_fini;1235 goto out_fini;
1236 1236
1237 pci_set_drvdata(pdev, &dev_priv->drm);1237 pci_set_drvdata(pdev, &dev_priv->drm);
1238 /*
1239 * Disable the system suspend direct complete optimization, which can
1240 * leave the device suspended skipping the driver's suspend handlers
1241 * if the device was already runtime suspended. This is needed due to
1242 * the difference in our runtime and system suspend sequence and
1243 * becaue the HDA driver may require us to enable the audio power
1244 * domain during system suspend.
1245 */
1246 pdev->dev_flags |= PCI_DEV_FLAGS_NEEDS_RESUME;
1238 1247
1239 ret = i915_driver_init_early(dev_priv, ent);1248 ret = i915_driver_init_early(dev_priv, ent);
1240 if (ret < 0)1249 if (ret < 0)
@@ -1272,10 +1281,6 @@ int i915_driver_load(struct pci_dev *pdev, const struct pci_device_id *ent) · 31 unmodified lines
1272 1281
1273 dev_priv->ipc_enabled = false;1282 dev_priv->ipc_enabled = false;
1274 1283
1275 /* Everything is in place, we can now relax! */
1276 DRM_INFO("Initialized %s %d.%d.%d %s for %s on minor %d\n",
1277 driver.name, driver.major, driver.minor, driver.patchlevel,
1278 driver.date, pci_name(pdev), dev_priv->drm.primary->index);
1279 if (IS_ENABLED(CONFIG_DRM_I915_DEBUG))1284 if (IS_ENABLED(CONFIG_DRM_I915_DEBUG))
1280 DRM_INFO("DRM_I915_DEBUG enabled\n");1285 DRM_INFO("DRM_I915_DEBUG enabled\n");
1281 if (IS_ENABLED(CONFIG_DRM_I915_DEBUG_GEM))1286 if (IS_ENABLED(CONFIG_DRM_I915_DEBUG_GEM))
drivers/gpu/drm/i915/i915_drv.h+12−1
@@ -562,7 +562,8 @@ struct intel_link_m_n { · 561 unmodified lines
562 562
563void intel_link_compute_m_n(int bpp, int nlanes,563void intel_link_compute_m_n(int bpp, int nlanes,
564 int pixel_clock, int link_clock,564 int pixel_clock, int link_clock,
565 struct intel_link_m_n *m_n);565 struct intel_link_m_n *m_n,
566 bool reduce_m_n);
566 567
567/* Interface history:568/* Interface history:
568 *569 *
@@ -2990,6 +2991,16 @@ static inline bool intel_scanout_needs_vtd_wa(struct drm_i915_private *dev_priv) · 2421 unmodified lines
2990 return false;2991 return false;
2991}2992}
2992 2993
2994static inline bool
2995intel_ggtt_update_needs_vtd_wa(struct drm_i915_private *dev_priv)
2996{
2997#ifdef CONFIG_INTEL_IOMMU
2998 if (IS_BROXTON(dev_priv) && intel_iommu_gfx_mapped)
2999 return true;
3000#endif
3001 return false;
3002}
3003
2993int intel_sanitize_enable_ppgtt(struct drm_i915_private *dev_priv,3004int intel_sanitize_enable_ppgtt(struct drm_i915_private *dev_priv,
2994 int enable_ppgtt);3005 int enable_ppgtt);
2995 3006
drivers/gpu/drm/i915/i915_gem.c+4−0
@@ -3298,6 +3298,10 @@ int i915_gem_wait_for_idle(struct drm_i915_private *i915, unsigned int flags) · 3297 unmodified lines
3298{3298{
3299 int ret;3299 int ret;
3300 3300
3301 /* If the device is asleep, we have no requests outstanding */
3302 if (!READ_ONCE(i915->gt.awake))
3303 return 0;
3304
3301 if (flags & I915_WAIT_LOCKED) {3305 if (flags & I915_WAIT_LOCKED) {
3302 struct i915_gem_timeline *tl;3306 struct i915_gem_timeline *tl;
3303 3307
drivers/gpu/drm/i915/i915_gem_gtt.c+106−2
@@ -2191,6 +2191,101 @@ static void gen8_ggtt_clear_range(struct i915_address_space *vm, · 2190 unmodified lines
2191 gen8_set_pte(&gtt_base[i], scratch_pte);2191 gen8_set_pte(&gtt_base[i], scratch_pte);
2192}2192}
2193 2193
2194static void bxt_vtd_ggtt_wa(struct i915_address_space *vm)
2195{
2196 struct drm_i915_private *dev_priv = vm->i915;
2197
2198 /*
2199 * Make sure the internal GAM fifo has been cleared of all GTT
2200 * writes before exiting stop_machine(). This guarantees that
2201 * any aperture accesses waiting to start in another process
2202 * cannot back up behind the GTT writes causing a hang.
2203 * The register can be any arbitrary GAM register.
2204 */
2205 POSTING_READ(GFX_FLSH_CNTL_GEN6);
2206}
2207
2208struct insert_page {
2209 struct i915_address_space *vm;
2210 dma_addr_t addr;
2211 u64 offset;
2212 enum i915_cache_level level;
2213};
2214
2215static int bxt_vtd_ggtt_insert_page__cb(void *_arg)
2216{
2217 struct insert_page *arg = _arg;
2218
2219 gen8_ggtt_insert_page(arg->vm, arg->addr, arg->offset, arg->level, 0);
2220 bxt_vtd_ggtt_wa(arg->vm);
2221
2222 return 0;
2223}
2224
2225static void bxt_vtd_ggtt_insert_page__BKL(struct i915_address_space *vm,
2226 dma_addr_t addr,
2227 u64 offset,
2228 enum i915_cache_level level,
2229 u32 unused)
2230{
2231 struct insert_page arg = { vm, addr, offset, level };
2232
2233 stop_machine(bxt_vtd_ggtt_insert_page__cb, &arg, NULL);
2234}
2235
2236struct insert_entries {
2237 struct i915_address_space *vm;
2238 struct sg_table *st;
2239 u64 start;
2240 enum i915_cache_level level;
2241};
2242
2243static int bxt_vtd_ggtt_insert_entries__cb(void *_arg)
2244{
2245 struct insert_entries *arg = _arg;
2246
2247 gen8_ggtt_insert_entries(arg->vm, arg->st, arg->start, arg->level, 0);
2248 bxt_vtd_ggtt_wa(arg->vm);
2249
2250 return 0;
2251}
2252
2253static void bxt_vtd_ggtt_insert_entries__BKL(struct i915_address_space *vm,
2254 struct sg_table *st,
2255 u64 start,
2256 enum i915_cache_level level,
2257 u32 unused)
2258{
2259 struct insert_entries arg = { vm, st, start, level };
2260
2261 stop_machine(bxt_vtd_ggtt_insert_entries__cb, &arg, NULL);
2262}
2263
2264struct clear_range {
2265 struct i915_address_space *vm;
2266 u64 start;
2267 u64 length;
2268};
2269
2270static int bxt_vtd_ggtt_clear_range__cb(void *_arg)
2271{
2272 struct clear_range *arg = _arg;
2273
2274 gen8_ggtt_clear_range(arg->vm, arg->start, arg->length);
2275 bxt_vtd_ggtt_wa(arg->vm);
2276
2277 return 0;
2278}
2279
2280static void bxt_vtd_ggtt_clear_range__BKL(struct i915_address_space *vm,
2281 u64 start,
2282 u64 length)
2283{
2284 struct clear_range arg = { vm, start, length };
2285
2286 stop_machine(bxt_vtd_ggtt_clear_range__cb, &arg, NULL);
2287}
2288
2194static void gen6_ggtt_clear_range(struct i915_address_space *vm,2289static void gen6_ggtt_clear_range(struct i915_address_space *vm,
2195 u64 start, u64 length)2290 u64 start, u64 length)
2196{2291{
@@ -2313,7 +2408,7 @@ static int aliasing_gtt_bind_vma(struct i915_vma *vma, · 116 unmodified lines
2313 appgtt->base.allocate_va_range) {2408 appgtt->base.allocate_va_range) {
2314 ret = appgtt->base.allocate_va_range(&appgtt->base,2409 ret = appgtt->base.allocate_va_range(&appgtt->base,
2315 vma->node.start,2410 vma->node.start,
2316 vma->node.size);2411 vma->size);
2317 if (ret)2412 if (ret)
2318 goto err_pages;2413 goto err_pages;
2319 }2414 }
@@ -2785,6 +2880,14 @@ static int gen8_gmch_probe(struct i915_ggtt *ggtt) · 465 unmodified lines
2785 2880
2786 ggtt->base.insert_entries = gen8_ggtt_insert_entries;2881 ggtt->base.insert_entries = gen8_ggtt_insert_entries;
2787 2882
2883 /* Serialize GTT updates with aperture access on BXT if VT-d is on. */
2884 if (intel_ggtt_update_needs_vtd_wa(dev_priv)) {
2885 ggtt->base.insert_entries = bxt_vtd_ggtt_insert_entries__BKL;
2886 ggtt->base.insert_page = bxt_vtd_ggtt_insert_page__BKL;
2887 if (ggtt->base.clear_range != nop_clear_range)
2888 ggtt->base.clear_range = bxt_vtd_ggtt_clear_range__BKL;
2889 }
2890
2788 ggtt->invalidate = gen6_ggtt_invalidate;2891 ggtt->invalidate = gen6_ggtt_invalidate;
2789 2892
2790 return ggtt_probe_common(ggtt, size);2893 return ggtt_probe_common(ggtt, size);
@@ -2997,7 +3100,8 @@ void i915_ggtt_enable_guc(struct drm_i915_private *i915) · 206 unmodified lines
2997 3100
2998void i915_ggtt_disable_guc(struct drm_i915_private *i915)3101void i915_ggtt_disable_guc(struct drm_i915_private *i915)
2999{3102{
3000 i915->ggtt.invalidate = gen6_ggtt_invalidate;3103 if (i915->ggtt.invalidate == guc_ggtt_invalidate)
3104 i915->ggtt.invalidate = gen6_ggtt_invalidate;
3001}3105}
3002 3106
3003void i915_gem_restore_gtt_mappings(struct drm_i915_private *dev_priv)3107void i915_gem_restore_gtt_mappings(struct drm_i915_private *dev_priv)
drivers/gpu/drm/i915/i915_gem_shrinker.c+0−5
@@ -59,9 +59,6 @@ static void i915_gem_shrinker_unlock(struct drm_device *dev, bool unlock) · 58 unmodified lines
59 return;59 return;
60 60
61 mutex_unlock(&dev->struct_mutex);61 mutex_unlock(&dev->struct_mutex);
62
63 /* expedite the RCU grace period to free some request slabs */
64 synchronize_rcu_expedited();
65}62}
66 63
67static bool any_vma_pinned(struct drm_i915_gem_object *obj)64static bool any_vma_pinned(struct drm_i915_gem_object *obj)
@@ -274,8 +271,6 @@ unsigned long i915_gem_shrink_all(struct drm_i915_private *dev_priv) · 206 unmodified lines
274 I915_SHRINK_ACTIVE);271 I915_SHRINK_ACTIVE);
275 intel_runtime_pm_put(dev_priv);272 intel_runtime_pm_put(dev_priv);
276 273
277 synchronize_rcu(); /* wait for our earlier RCU delayed slab frees */
278
279 return freed;274 return freed;
280}275}
281 276
drivers/gpu/drm/i915/i915_gem_tiling.c+1−1
@@ -278,7 +278,7 @@ i915_gem_object_set_tiling(struct drm_i915_gem_object *obj, · 277 unmodified lines
278 obj->mm.quirked = false;278 obj->mm.quirked = false;
279 }279 }
280 if (!i915_gem_object_is_tiled(obj)) {280 if (!i915_gem_object_is_tiled(obj)) {
281 GEM_BUG_ON(!obj->mm.quirked);281 GEM_BUG_ON(obj->mm.quirked);
282 __i915_gem_object_pin_pages(obj);282 __i915_gem_object_pin_pages(obj);
283 obj->mm.quirked = true;283 obj->mm.quirked = true;
284 }284 }
drivers/gpu/drm/i915/i915_irq.c+6−9
@@ -2953,7 +2953,6 @@ static void vlv_display_irq_postinstall(struct drm_i915_private *dev_priv) · 2952 unmodified lines
2953 u32 pipestat_mask;2953 u32 pipestat_mask;
2954 u32 enable_mask;2954 u32 enable_mask;
2955 enum pipe pipe;2955 enum pipe pipe;
2956 u32 val;
2957 2956
2958 pipestat_mask = PLANE_FLIP_DONE_INT_STATUS_VLV |2957 pipestat_mask = PLANE_FLIP_DONE_INT_STATUS_VLV |
2959 PIPE_CRC_DONE_INTERRUPT_STATUS;2958 PIPE_CRC_DONE_INTERRUPT_STATUS;
@@ -2964,18 +2963,16 @@ static void vlv_display_irq_postinstall(struct drm_i915_private *dev_priv) · 4 unmodified lines
2964 2963
2965 enable_mask = I915_DISPLAY_PORT_INTERRUPT |2964 enable_mask = I915_DISPLAY_PORT_INTERRUPT |
2966 I915_DISPLAY_PIPE_A_EVENT_INTERRUPT |2965 I915_DISPLAY_PIPE_A_EVENT_INTERRUPT |
2967 I915_DISPLAY_PIPE_B_EVENT_INTERRUPT;2966 I915_DISPLAY_PIPE_B_EVENT_INTERRUPT |
2967 I915_LPE_PIPE_A_INTERRUPT |
2968 I915_LPE_PIPE_B_INTERRUPT;
2969
2968 if (IS_CHERRYVIEW(dev_priv))2970 if (IS_CHERRYVIEW(dev_priv))
2969 enable_mask |= I915_DISPLAY_PIPE_C_EVENT_INTERRUPT;2971 enable_mask |= I915_DISPLAY_PIPE_C_EVENT_INTERRUPT |
2972 I915_LPE_PIPE_C_INTERRUPT;
2970 2973
2971 WARN_ON(dev_priv->irq_mask != ~0);2974 WARN_ON(dev_priv->irq_mask != ~0);
2972 2975
2973 val = (I915_LPE_PIPE_A_INTERRUPT |
2974 I915_LPE_PIPE_B_INTERRUPT |
2975 I915_LPE_PIPE_C_INTERRUPT);
2976
2977 enable_mask |= val;
2978
2979 dev_priv->irq_mask = ~enable_mask;2976 dev_priv->irq_mask = ~enable_mask;
2980 2977
2981 GEN5_IRQ_INIT(VLV_, dev_priv->irq_mask, enable_mask);2978 GEN5_IRQ_INIT(VLV_, dev_priv->irq_mask, enable_mask);
drivers/gpu/drm/i915/i915_pci.c+1−2
@@ -208,7 +208,7 @@ static const struct intel_device_info intel_ironlake_d_info = { · 207 unmodified lines
208static const struct intel_device_info intel_ironlake_m_info = {208static const struct intel_device_info intel_ironlake_m_info = {
209 GEN5_FEATURES,209 GEN5_FEATURES,
210 .platform = INTEL_IRONLAKE,210 .platform = INTEL_IRONLAKE,
211 .is_mobile = 1,211 .is_mobile = 1, .has_fbc = 1,
212};212};
213 213
214#define GEN6_FEATURES \214#define GEN6_FEATURES \
@@ -390,7 +390,6 @@ static const struct intel_device_info intel_skylake_gt3_info = { · 175 unmodified lines
390 .has_hw_contexts = 1, \390 .has_hw_contexts = 1, \
391 .has_logical_ring_contexts = 1, \391 .has_logical_ring_contexts = 1, \
392 .has_guc = 1, \392 .has_guc = 1, \
393 .has_decoupled_mmio = 1, \
394 .has_aliasing_ppgtt = 1, \393 .has_aliasing_ppgtt = 1, \
395 .has_full_ppgtt = 1, \394 .has_full_ppgtt = 1, \
396 .has_full_48bit_ppgtt = 1, \395 .has_full_48bit_ppgtt = 1, \
drivers/gpu/drm/i915/i915_pvinfo.h+2−6
@@ -36,10 +36,6 @@ · 35 unmodified lines
36#define VGT_VERSION_MAJOR 136#define VGT_VERSION_MAJOR 1
37#define VGT_VERSION_MINOR 037#define VGT_VERSION_MINOR 0
38 38
39#define INTEL_VGT_IF_VERSION_ENCODE(major, minor) ((major) << 16 | (minor))
40#define INTEL_VGT_IF_VERSION \
41 INTEL_VGT_IF_VERSION_ENCODE(VGT_VERSION_MAJOR, VGT_VERSION_MINOR)
42
43/*39/*
44 * notifications from guest to vgpu device model40 * notifications from guest to vgpu device model
45 */41 */
@@ -55,8 +51,8 @@ enum vgt_g2v_type { · 9 unmodified lines
55 51
56struct vgt_if {52struct vgt_if {
57 u64 magic; /* VGT_MAGIC */53 u64 magic; /* VGT_MAGIC */
58 uint16_t version_major;54 u16 version_major;
59 uint16_t version_minor;55 u16 version_minor;
60 u32 vgt_id; /* ID of vGT instance */56 u32 vgt_id; /* ID of vGT instance */
61 u32 rsv1[12]; /* pad to offset 0x40 */57 u32 rsv1[12]; /* pad to offset 0x40 */
62 /*58 /*
drivers/gpu/drm/i915/i915_reg.h+1−1
@@ -8280,7 +8280,7 @@ enum { · 8279 unmodified lines
8280 8280
8281/* MIPI DSI registers */8281/* MIPI DSI registers */
8282 8282
8283#define _MIPI_PORT(port, a, c) ((port) ? c : a) /* ports A and C only */8283#define _MIPI_PORT(port, a, c) (((port) == PORT_A) ? a : c) /* ports A and C only */
8284#define _MMIO_MIPI(port, a, c) _MMIO(_MIPI_PORT(port, a, c))8284#define _MMIO_MIPI(port, a, c) _MMIO(_MIPI_PORT(port, a, c))
8285 8285
8286#define MIPIO_TXESC_CLK_DIV1 _MMIO(0x160004)8286#define MIPIO_TXESC_CLK_DIV1 _MMIO(0x160004)
drivers/gpu/drm/i915/i915_vgpu.c+4−6
@@ -60,8 +60,8 @@ · 59 unmodified lines
60 */60 */
61void i915_check_vgpu(struct drm_i915_private *dev_priv)61void i915_check_vgpu(struct drm_i915_private *dev_priv)
62{62{
63 uint64_t magic;63 u64 magic;
64 uint32_t version;64 u16 version_major;
65 65
66 BUILD_BUG_ON(sizeof(struct vgt_if) != VGT_PVINFO_SIZE);66 BUILD_BUG_ON(sizeof(struct vgt_if) != VGT_PVINFO_SIZE);
67 67
@@ -69,10 +69,8 @@ void i915_check_vgpu(struct drm_i915_private *dev_priv) · 1 unmodified line
69 if (magic != VGT_MAGIC)69 if (magic != VGT_MAGIC)
70 return;70 return;
71 71
72 version = INTEL_VGT_IF_VERSION_ENCODE(72 version_major = __raw_i915_read16(dev_priv, vgtif_reg(version_major));
73 __raw_i915_read16(dev_priv, vgtif_reg(version_major)),73 if (version_major < VGT_VERSION_MAJOR) {
74 __raw_i915_read16(dev_priv, vgtif_reg(version_minor)));
75 if (version != INTEL_VGT_IF_VERSION) {
76 DRM_INFO("VGT interface version mismatch!\n");74 DRM_INFO("VGT interface version mismatch!\n");
77 return;75 return;
78 }76 }
drivers/gpu/drm/i915/intel_display.c+31−14
@@ -4598,7 +4598,7 @@ static void cpt_verify_modeset(struct drm_device *dev, int pipe) · 4597 unmodified lines
4598 4598
4599static int4599static int
4600skl_update_scaler(struct intel_crtc_state *crtc_state, bool force_detach,4600skl_update_scaler(struct intel_crtc_state *crtc_state, bool force_detach,
4601 unsigned scaler_user, int *scaler_id, unsigned int rotation,4601 unsigned int scaler_user, int *scaler_id,
4602 int src_w, int src_h, int dst_w, int dst_h)4602 int src_w, int src_h, int dst_w, int dst_h)
4603{4603{
4604 struct intel_crtc_scaler_state *scaler_state =4604 struct intel_crtc_scaler_state *scaler_state =
@@ -4607,9 +4607,12 @@ skl_update_scaler(struct intel_crtc_state *crtc_state, bool force_detach, · 2 unmodified lines
4607 to_intel_crtc(crtc_state->base.crtc);4607 to_intel_crtc(crtc_state->base.crtc);
4608 int need_scaling;4608 int need_scaling;
4609 4609
4610 need_scaling = drm_rotation_90_or_270(rotation) ?4610 /*
4611 (src_h != dst_w || src_w != dst_h):4611 * Src coordinates are already rotated by 270 degrees for
4612 (src_w != dst_w || src_h != dst_h);4612 * the 90/270 degree plane rotation cases (to match the
4613 * GTT mapping), hence no need to account for rotation here.
4614 */
4615 need_scaling = src_w != dst_w || src_h != dst_h;
4613 4616
4614 /*4617 /*
4615 * if plane is being disabled or scaler is no more required or force detach4618 * if plane is being disabled or scaler is no more required or force detach
@@ -4671,7 +4674,7 @@ int skl_update_scaler_crtc(struct intel_crtc_state *state) · 55 unmodified lines
4671 const struct drm_display_mode *adjusted_mode = &state->base.adjusted_mode;4674 const struct drm_display_mode *adjusted_mode = &state->base.adjusted_mode;
4672 4675
4673 return skl_update_scaler(state, !state->base.active, SKL_CRTC_INDEX,4676 return skl_update_scaler(state, !state->base.active, SKL_CRTC_INDEX,
4674 &state->scaler_state.scaler_id, DRM_ROTATE_0,4677 &state->scaler_state.scaler_id,
4675 state->pipe_src_w, state->pipe_src_h,4678 state->pipe_src_w, state->pipe_src_h,
4676 adjusted_mode->crtc_hdisplay, adjusted_mode->crtc_vdisplay);4679 adjusted_mode->crtc_hdisplay, adjusted_mode->crtc_vdisplay);
4677}4680}
@@ -4700,7 +4703,6 @@ static int skl_update_scaler_plane(struct intel_crtc_state *crtc_state, · 22 unmodified lines
4700 ret = skl_update_scaler(crtc_state, force_detach,4703 ret = skl_update_scaler(crtc_state, force_detach,
4701 drm_plane_index(&intel_plane->base),4704 drm_plane_index(&intel_plane->base),
4702 &plane_state->scaler_id,4705 &plane_state->scaler_id,
4703 plane_state->base.rotation,
4704 drm_rect_width(&plane_state->base.src) >> 16,4706 drm_rect_width(&plane_state->base.src) >> 16,
4705 drm_rect_height(&plane_state->base.src) >> 16,4707 drm_rect_height(&plane_state->base.src) >> 16,
4706 drm_rect_width(&plane_state->base.dst),4708 drm_rect_width(&plane_state->base.dst),
@@ -6101,7 +6103,7 @@ retry: · 1394 unmodified lines
6101 pipe_config->fdi_lanes = lane;6103 pipe_config->fdi_lanes = lane;
6102 6104
6103 intel_link_compute_m_n(pipe_config->pipe_bpp, lane, fdi_dotclock,6105 intel_link_compute_m_n(pipe_config->pipe_bpp, lane, fdi_dotclock,
6104 link_bw, &pipe_config->fdi_m_n);6106 link_bw, &pipe_config->fdi_m_n, false);
6105 6107
6106 ret = ironlake_check_fdi_lanes(dev, intel_crtc->pipe, pipe_config);6108 ret = ironlake_check_fdi_lanes(dev, intel_crtc->pipe, pipe_config);
6107 if (ret == -EINVAL && pipe_config->pipe_bpp > 6*3) {6109 if (ret == -EINVAL && pipe_config->pipe_bpp > 6*3) {
@@ -6277,7 +6279,8 @@ intel_reduce_m_n_ratio(uint32_t *num, uint32_t *den) · 169 unmodified lines
6277}6279}
6278 6280
6279static void compute_m_n(unsigned int m, unsigned int n,6281static void compute_m_n(unsigned int m, unsigned int n,
6280 uint32_t *ret_m, uint32_t *ret_n)6282 uint32_t *ret_m, uint32_t *ret_n,
6283 bool reduce_m_n)
6281{6284{
6282 /*6285 /*
6283 * Reduce M/N as much as possible without loss in precision. Several DP6286 * Reduce M/N as much as possible without loss in precision. Several DP
@@ -6285,9 +6288,11 @@ static void compute_m_n(unsigned int m, unsigned int n, · 1 unmodified line
6285 * values. The passed in values are more likely to have the least6288 * values. The passed in values are more likely to have the least
6286 * significant bits zero than M after rounding below, so do this first.6289 * significant bits zero than M after rounding below, so do this first.
6287 */6290 */
6288 while ((m & 1) == 0 && (n & 1) == 0) {6291 if (reduce_m_n) {
6289 m >>= 1;6292 while ((m & 1) == 0 && (n & 1) == 0) {
6290 n >>= 1;6293 m >>= 1;
6294 n >>= 1;
6295 }
6291 }6296 }
6292 6297
6293 *ret_n = min_t(unsigned int, roundup_pow_of_two(n), DATA_LINK_N_MAX);6298 *ret_n = min_t(unsigned int, roundup_pow_of_two(n), DATA_LINK_N_MAX);
@@ -6298,16 +6303,19 @@ static void compute_m_n(unsigned int m, unsigned int n, · 4 unmodified lines
6298void6303void
6299intel_link_compute_m_n(int bits_per_pixel, int nlanes,6304intel_link_compute_m_n(int bits_per_pixel, int nlanes,
6300 int pixel_clock, int link_clock,6305 int pixel_clock, int link_clock,
6301 struct intel_link_m_n *m_n)6306 struct intel_link_m_n *m_n,
6307 bool reduce_m_n)
6302{6308{
6303 m_n->tu = 64;6309 m_n->tu = 64;
6304 6310
6305 compute_m_n(bits_per_pixel * pixel_clock,6311 compute_m_n(bits_per_pixel * pixel_clock,
6306 link_clock * nlanes * 8,6312 link_clock * nlanes * 8,
6307 &m_n->gmch_m, &m_n->gmch_n);6313 &m_n->gmch_m, &m_n->gmch_n,
6314 reduce_m_n);
6308 6315
6309 compute_m_n(pixel_clock, link_clock,6316 compute_m_n(pixel_clock, link_clock,
6310 &m_n->link_m, &m_n->link_n);6317 &m_n->link_m, &m_n->link_n,
6318 reduce_m_n);
6311}6319}
6312 6320
6313static inline bool intel_panel_use_ssc(struct drm_i915_private *dev_priv)6321static inline bool intel_panel_use_ssc(struct drm_i915_private *dev_priv)
@@ -12197,6 +12205,15 @@ static void update_scanline_offset(struct intel_crtc *crtc) · 5883 unmodified lines
12197 * type. For DP ports it behaves like most other platforms, but on HDMI12205 * type. For DP ports it behaves like most other platforms, but on HDMI
12198 * there's an extra 1 line difference. So we need to add two instead of12206 * there's an extra 1 line difference. So we need to add two instead of
12199 * one to the value.12207 * one to the value.
12208 *
12209 * On VLV/CHV DSI the scanline counter would appear to increment
12210 * approx. 1/3 of a scanline before start of vblank. Unfortunately
12211 * that means we can't tell whether we're in vblank or not while
12212 * we're on that particular line. We must still set scanline_offset
12213 * to 1 so that the vblank timestamps come out correct when we query
12214 * the scanline counter from within the vblank interrupt handler.
12215 * However if queried just before the start of vblank we'll get an
12216 * answer that's slightly in the future.
12200 */12217 */
12201 if (IS_GEN2(dev_priv)) {12218 if (IS_GEN2(dev_priv)) {
12202 const struct drm_display_mode *adjusted_mode = &crtc->config->base.adjusted_mode;12219 const struct drm_display_mode *adjusted_mode = &crtc->config->base.adjusted_mode;
drivers/gpu/drm/i915/intel_dp.c+10−35
@@ -1507,37 +1507,6 @@ static void intel_dp_print_rates(struct intel_dp *intel_dp) · 1506 unmodified lines
1507 DRM_DEBUG_KMS("common rates: %s\n", str);1507 DRM_DEBUG_KMS("common rates: %s\n", str);
1508}1508}
1509 1509
1510bool
1511__intel_dp_read_desc(struct intel_dp *intel_dp, struct intel_dp_desc *desc)
1512{
1513 u32 base = drm_dp_is_branch(intel_dp->dpcd) ? DP_BRANCH_OUI :
1514 DP_SINK_OUI;
1515
1516 return drm_dp_dpcd_read(&intel_dp->aux, base, desc, sizeof(*desc)) ==
1517 sizeof(*desc);
1518}
1519
1520bool intel_dp_read_desc(struct intel_dp *intel_dp)
1521{
1522 struct intel_dp_desc *desc = &intel_dp->desc;
1523 bool oui_sup = intel_dp->dpcd[DP_DOWN_STREAM_PORT_COUNT] &
1524 DP_OUI_SUPPORT;
1525 int dev_id_len;
1526
1527 if (!__intel_dp_read_desc(intel_dp, desc))
1528 return false;
1529
1530 dev_id_len = strnlen(desc->device_id, sizeof(desc->device_id));
1531 DRM_DEBUG_KMS("DP %s: OUI %*phD%s dev-ID %*pE HW-rev %d.%d SW-rev %d.%d\n",
1532 drm_dp_is_branch(intel_dp->dpcd) ? "branch" : "sink",
1533 (int)sizeof(desc->oui), desc->oui, oui_sup ? "" : "(NS)",
1534 dev_id_len, desc->device_id,
1535 desc->hw_rev >> 4, desc->hw_rev & 0xf,
1536 desc->sw_major_rev, desc->sw_minor_rev);
1537
1538 return true;
1539}
1540
1541static int rate_to_index(int find, const int *rates)1510static int rate_to_index(int find, const int *rates)
1542{1511{
1543 int i = 0;1512 int i = 0;
@@ -1624,6 +1593,8 @@ intel_dp_compute_config(struct intel_encoder *encoder, · 80 unmodified lines
1624 int common_rates[DP_MAX_SUPPORTED_RATES] = {};1593 int common_rates[DP_MAX_SUPPORTED_RATES] = {};
1625 int common_len;1594 int common_len;
1626 uint8_t link_bw, rate_select;1595 uint8_t link_bw, rate_select;
1596 bool reduce_m_n = drm_dp_has_quirk(&intel_dp->desc,
1597 DP_DPCD_QUIRK_LIMITED_M_N);
1627 1598
1628 common_len = intel_dp_common_rates(intel_dp, common_rates);1599 common_len = intel_dp_common_rates(intel_dp, common_rates);
1629 1600
@@ -1753,7 +1724,8 @@ found: · 123 unmodified lines
1753 intel_link_compute_m_n(bpp, lane_count,1724 intel_link_compute_m_n(bpp, lane_count,
1754 adjusted_mode->crtc_clock,1725 adjusted_mode->crtc_clock,
1755 pipe_config->port_clock,1726 pipe_config->port_clock,
1756 &pipe_config->dp_m_n);1727 &pipe_config->dp_m_n,
1728 reduce_m_n);
1757 1729
1758 if (intel_connector->panel.downclock_mode != NULL &&1730 if (intel_connector->panel.downclock_mode != NULL &&
1759 dev_priv->drrs.type == SEAMLESS_DRRS_SUPPORT) {1731 dev_priv->drrs.type == SEAMLESS_DRRS_SUPPORT) {
@@ -1761,7 +1733,8 @@ found: · 1 unmodified line
1761 intel_link_compute_m_n(bpp, lane_count,1733 intel_link_compute_m_n(bpp, lane_count,
1762 intel_connector->panel.downclock_mode->clock,1734 intel_connector->panel.downclock_mode->clock,
1763 pipe_config->port_clock,1735 pipe_config->port_clock,
1764 &pipe_config->dp_m2_n2);1736 &pipe_config->dp_m2_n2,
1737 reduce_m_n);
1765 }1738 }
1766 1739
1767 /*1740 /*
@@ -3622,7 +3595,8 @@ intel_edp_init_dpcd(struct intel_dp *intel_dp) · 1854 unmodified lines
3622 if (!intel_dp_read_dpcd(intel_dp))3595 if (!intel_dp_read_dpcd(intel_dp))
3623 return false;3596 return false;
3624 3597
3625 intel_dp_read_desc(intel_dp);3598 drm_dp_read_desc(&intel_dp->aux, &intel_dp->desc,
3599 drm_dp_is_branch(intel_dp->dpcd));
3626 3600
3627 if (intel_dp->dpcd[DP_DPCD_REV] >= 0x11)3601 if (intel_dp->dpcd[DP_DPCD_REV] >= 0x11)
3628 dev_priv->no_aux_handshake = intel_dp->dpcd[DP_MAX_DOWNSPREAD] &3602 dev_priv->no_aux_handshake = intel_dp->dpcd[DP_MAX_DOWNSPREAD] &
@@ -4624,7 +4598,8 @@ intel_dp_long_pulse(struct intel_connector *intel_connector) · 995 unmodified lines
4624 4598
4625 intel_dp_print_rates(intel_dp);4599 intel_dp_print_rates(intel_dp);
4626 4600
4627 intel_dp_read_desc(intel_dp);4601 drm_dp_read_desc(&intel_dp->aux, &intel_dp->desc,
4602 drm_dp_is_branch(intel_dp->dpcd));
4628 4603
4629 intel_dp_configure_mst(intel_dp);4604 intel_dp_configure_mst(intel_dp);
4630 4605
drivers/gpu/drm/i915/intel_dp_mst.c+4−1
@@ -44,6 +44,8 @@ static bool intel_dp_mst_compute_config(struct intel_encoder *encoder, · 43 unmodified lines
44 int lane_count, slots;44 int lane_count, slots;
45 const struct drm_display_mode *adjusted_mode = &pipe_config->base.adjusted_mode;45 const struct drm_display_mode *adjusted_mode = &pipe_config->base.adjusted_mode;
46 int mst_pbn;46 int mst_pbn;
47 bool reduce_m_n = drm_dp_has_quirk(&intel_dp->desc,
48 DP_DPCD_QUIRK_LIMITED_M_N);
47 49
48 pipe_config->has_pch_encoder = false;50 pipe_config->has_pch_encoder = false;
49 bpp = 24;51 bpp = 24;
@@ -75,7 +77,8 @@ static bool intel_dp_mst_compute_config(struct intel_encoder *encoder, · 25 unmodified lines
75 intel_link_compute_m_n(bpp, lane_count,77 intel_link_compute_m_n(bpp, lane_count,
76 adjusted_mode->crtc_clock,78 adjusted_mode->crtc_clock,
77 pipe_config->port_clock,79 pipe_config->port_clock,
78 &pipe_config->dp_m_n);80 &pipe_config->dp_m_n,
81 reduce_m_n);
79 82
80 pipe_config->dp_m_n.tu = slots;83 pipe_config->dp_m_n.tu = slots;
81 84
drivers/gpu/drm/i915/intel_drv.h+1−12
@@ -906,14 +906,6 @@ enum link_m_n_set { · 905 unmodified lines
906 M2_N2906 M2_N2
907};907};
908 908
909struct intel_dp_desc {
910 u8 oui[3];
911 u8 device_id[6];
912 u8 hw_rev;
913 u8 sw_major_rev;
914 u8 sw_minor_rev;
915} __packed;
916
917struct intel_dp_compliance_data {909struct intel_dp_compliance_data {
918 unsigned long edid;910 unsigned long edid;
919 uint8_t video_pattern;911 uint8_t video_pattern;
@@ -957,7 +949,7 @@ struct intel_dp { · 37 unmodified lines
957 /* Max link BW for the sink as per DPCD registers */949 /* Max link BW for the sink as per DPCD registers */
958 int max_sink_link_bw;950 int max_sink_link_bw;
959 /* sink or branch descriptor */951 /* sink or branch descriptor */
960 struct intel_dp_desc desc;952 struct drm_dp_desc desc;
961 struct drm_dp_aux aux;953 struct drm_dp_aux aux;
962 enum intel_display_power_domain aux_power_domain;954 enum intel_display_power_domain aux_power_domain;
963 uint8_t train_set[4];955 uint8_t train_set[4];
@@ -1532,9 +1524,6 @@ static inline unsigned int intel_dp_unused_lane_mask(int lane_count) · 568 unmodified lines
1532}1524}
1533 1525
1534bool intel_dp_read_dpcd(struct intel_dp *intel_dp);1526bool intel_dp_read_dpcd(struct intel_dp *intel_dp);
1535bool __intel_dp_read_desc(struct intel_dp *intel_dp,
1536 struct intel_dp_desc *desc);
1537bool intel_dp_read_desc(struct intel_dp *intel_dp);
1538int intel_dp_link_required(int pixel_clock, int bpp);1527int intel_dp_link_required(int pixel_clock, int bpp);
1539int intel_dp_max_data_rate(int max_link_clock, int max_lanes);1528int intel_dp_max_data_rate(int max_link_clock, int max_lanes);
1540bool intel_digital_port_connected(struct drm_i915_private *dev_priv,1529bool intel_digital_port_connected(struct drm_i915_private *dev_priv,
drivers/gpu/drm/i915/intel_engine_cs.c+17−3
@@ -1075,6 +1075,22 @@ int intel_ring_workarounds_emit(struct drm_i915_gem_request *req) · 1074 unmodified lines
1075 return 0;1075 return 0;
1076}1076}
1077 1077
1078static bool ring_is_idle(struct intel_engine_cs *engine)
1079{
1080 struct drm_i915_private *dev_priv = engine->i915;
1081 bool idle = true;
1082
1083 intel_runtime_pm_get(dev_priv);
1084
1085 /* No bit for gen2, so assume the CS parser is idle */
1086 if (INTEL_GEN(dev_priv) > 2 && !(I915_READ_MODE(engine) & MODE_IDLE))
1087 idle = false;
1088
1089 intel_runtime_pm_put(dev_priv);
1090
1091 return idle;
1092}
1093
1078/**1094/**
1079 * intel_engine_is_idle() - Report if the engine has finished process all work1095 * intel_engine_is_idle() - Report if the engine has finished process all work
1080 * @engine: the intel_engine_cs1096 * @engine: the intel_engine_cs
@@ -1084,8 +1100,6 @@ int intel_ring_workarounds_emit(struct drm_i915_gem_request *req) · 3 unmodified lines
1084 */1100 */
1085bool intel_engine_is_idle(struct intel_engine_cs *engine)1101bool intel_engine_is_idle(struct intel_engine_cs *engine)
1086{1102{
1087 struct drm_i915_private *dev_priv = engine->i915;
1088
1089 /* Any inflight/incomplete requests? */1103 /* Any inflight/incomplete requests? */
1090 if (!i915_seqno_passed(intel_engine_get_seqno(engine),1104 if (!i915_seqno_passed(intel_engine_get_seqno(engine),
1091 intel_engine_last_submit(engine)))1105 intel_engine_last_submit(engine)))
@@ -1100,7 +1114,7 @@ bool intel_engine_is_idle(struct intel_engine_cs *engine) · 8 unmodified lines
1100 return false;1114 return false;
1101 1115
1102 /* Ring stopped? */1116 /* Ring stopped? */
1103 if (INTEL_GEN(dev_priv) > 2 && !(I915_READ_MODE(engine) & MODE_IDLE))1117 if (!ring_is_idle(engine))
1104 return false;1118 return false;
1105 1119
1106 return true;1120 return true;
drivers/gpu/drm/i915/intel_fbc.c+7−12
@@ -82,20 +82,10 @@ static unsigned int get_crtc_fence_y_offset(struct intel_crtc *crtc) · 81 unmodified lines
82static void intel_fbc_get_plane_source_size(struct intel_fbc_state_cache *cache,82static void intel_fbc_get_plane_source_size(struct intel_fbc_state_cache *cache,
83 int *width, int *height)83 int *width, int *height)
84{84{
85 int w, h;
86
87 if (drm_rotation_90_or_270(cache->plane.rotation)) {
88 w = cache->plane.src_h;
89 h = cache->plane.src_w;
90 } else {
91 w = cache->plane.src_w;
92 h = cache->plane.src_h;
93 }
94
95 if (width)85 if (width)
96 *width = w;86 *width = cache->plane.src_w;
97 if (height)87 if (height)
98 *height = h;88 *height = cache->plane.src_h;
99}89}
100 90
101static int intel_fbc_calculate_cfb_size(struct drm_i915_private *dev_priv,91static int intel_fbc_calculate_cfb_size(struct drm_i915_private *dev_priv,
@@ -746,6 +736,11 @@ static void intel_fbc_update_state_cache(struct intel_crtc *crtc, · 644 unmodified lines
746 cache->crtc.hsw_bdw_pixel_rate = crtc_state->pixel_rate;736 cache->crtc.hsw_bdw_pixel_rate = crtc_state->pixel_rate;
747 737
748 cache->plane.rotation = plane_state->base.rotation;738 cache->plane.rotation = plane_state->base.rotation;
739 /*
740 * Src coordinates are already rotated by 270 degrees for
741 * the 90/270 degree plane rotation cases (to match the
742 * GTT mapping), hence no need to account for rotation here.
743 */
749 cache->plane.src_w = drm_rect_width(&plane_state->base.src) >> 16;744 cache->plane.src_w = drm_rect_width(&plane_state->base.src) >> 16;
750 cache->plane.src_h = drm_rect_height(&plane_state->base.src) >> 16;745 cache->plane.src_h = drm_rect_height(&plane_state->base.src) >> 16;
751 cache->plane.visible = plane_state->base.visible;746 cache->plane.visible = plane_state->base.visible;
drivers/gpu/drm/i915/intel_lpe_audio.c+0−36
@@ -149,44 +149,10 @@ static void lpe_audio_platdev_destroy(struct drm_i915_private *dev_priv) · 148 unmodified lines
149 149
150static void lpe_audio_irq_unmask(struct irq_data *d)150static void lpe_audio_irq_unmask(struct irq_data *d)
151{151{
152 struct drm_i915_private *dev_priv = d->chip_data;
153 unsigned long irqflags;
154 u32 val = (I915_LPE_PIPE_A_INTERRUPT |
155 I915_LPE_PIPE_B_INTERRUPT);
156
157 if (IS_CHERRYVIEW(dev_priv))
158 val |= I915_LPE_PIPE_C_INTERRUPT;
159
160 spin_lock_irqsave(&dev_priv->irq_lock, irqflags);
161
162 dev_priv->irq_mask &= ~val;
163 I915_WRITE(VLV_IIR, val);
164 I915_WRITE(VLV_IIR, val);
165 I915_WRITE(VLV_IMR, dev_priv->irq_mask);
166 POSTING_READ(VLV_IMR);
167
168 spin_unlock_irqrestore(&dev_priv->irq_lock, irqflags);
169}152}
170 153
171static void lpe_audio_irq_mask(struct irq_data *d)154static void lpe_audio_irq_mask(struct irq_data *d)
172{155{
173 struct drm_i915_private *dev_priv = d->chip_data;
174 unsigned long irqflags;
175 u32 val = (I915_LPE_PIPE_A_INTERRUPT |
176 I915_LPE_PIPE_B_INTERRUPT);
177
178 if (IS_CHERRYVIEW(dev_priv))
179 val |= I915_LPE_PIPE_C_INTERRUPT;
180
181 spin_lock_irqsave(&dev_priv->irq_lock, irqflags);
182
183 dev_priv->irq_mask |= val;
184 I915_WRITE(VLV_IMR, dev_priv->irq_mask);
185 I915_WRITE(VLV_IIR, val);
186 I915_WRITE(VLV_IIR, val);
187 POSTING_READ(VLV_IIR);
188
189 spin_unlock_irqrestore(&dev_priv->irq_lock, irqflags);
190}156}
191 157
192static struct irq_chip lpe_audio_irqchip = {158static struct irq_chip lpe_audio_irqchip = {
@@ -330,8 +296,6 @@ void intel_lpe_audio_teardown(struct drm_i915_private *dev_priv) · 137 unmodified lines
330 296
331 desc = irq_to_desc(dev_priv->lpe_audio.irq);297 desc = irq_to_desc(dev_priv->lpe_audio.irq);
332 298
333 lpe_audio_irq_mask(&desc->irq_data);
334
335 lpe_audio_platdev_destroy(dev_priv);299 lpe_audio_platdev_destroy(dev_priv);
336 300
337 irq_free_desc(dev_priv->lpe_audio.irq);301 irq_free_desc(dev_priv->lpe_audio.irq);
drivers/gpu/drm/i915/intel_lrc.c+1−1
@@ -1989,7 +1989,7 @@ static int execlists_context_deferred_alloc(struct i915_gem_context *ctx, · 1988 unmodified lines
1989 1989
1990 ce->ring = ring;1990 ce->ring = ring;
1991 ce->state = vma;1991 ce->state = vma;
1992 ce->initialised = engine->init_context == NULL;1992 ce->initialised |= engine->init_context == NULL;
1993 1993
1994 return 0;1994 return 0;
1995 1995
drivers/gpu/drm/i915/intel_lspcon.c+1−1
@@ -240,7 +240,7 @@ bool lspcon_init(struct intel_digital_port *intel_dig_port) · 239 unmodified lines
240 return false;240 return false;
241 }241 }
242 242
243 intel_dp_read_desc(dp);243 drm_dp_read_desc(&dp->aux, &dp->desc, drm_dp_is_branch(dp->dpcd));
244 244
245 DRM_DEBUG_KMS("Success: LSPCON init\n");245 DRM_DEBUG_KMS("Success: LSPCON init\n");
246 return true;246 return true;
drivers/gpu/drm/i915/intel_pm.c+33−12
@@ -3373,20 +3373,26 @@ skl_plane_downscale_amount(const struct intel_crtc_state *cstate, · 3372 unmodified lines
3373 3373
3374 /* n.b., src is 16.16 fixed point, dst is whole integer */3374 /* n.b., src is 16.16 fixed point, dst is whole integer */
3375 if (plane->id == PLANE_CURSOR) {3375 if (plane->id == PLANE_CURSOR) {
3376 /*
3377 * Cursors only support 0/180 degree rotation,
3378 * hence no need to account for rotation here.
3379 */
3376 src_w = pstate->base.src_w;3380 src_w = pstate->base.src_w;
3377 src_h = pstate->base.src_h;3381 src_h = pstate->base.src_h;
3378 dst_w = pstate->base.crtc_w;3382 dst_w = pstate->base.crtc_w;
3379 dst_h = pstate->base.crtc_h;3383 dst_h = pstate->base.crtc_h;
3380 } else {3384 } else {
3385 /*
3386 * Src coordinates are already rotated by 270 degrees for
3387 * the 90/270 degree plane rotation cases (to match the
3388 * GTT mapping), hence no need to account for rotation here.
3389 */
3381 src_w = drm_rect_width(&pstate->base.src);3390 src_w = drm_rect_width(&pstate->base.src);
3382 src_h = drm_rect_height(&pstate->base.src);3391 src_h = drm_rect_height(&pstate->base.src);
3383 dst_w = drm_rect_width(&pstate->base.dst);3392 dst_w = drm_rect_width(&pstate->base.dst);
3384 dst_h = drm_rect_height(&pstate->base.dst);3393 dst_h = drm_rect_height(&pstate->base.dst);
3385 }3394 }
3386 3395
3387 if (drm_rotation_90_or_270(pstate->base.rotation))
3388 swap(dst_w, dst_h);
3389
3390 downscale_h = max(src_h / dst_h, (uint32_t)DRM_PLANE_HELPER_NO_SCALING);3396 downscale_h = max(src_h / dst_h, (uint32_t)DRM_PLANE_HELPER_NO_SCALING);
3391 downscale_w = max(src_w / dst_w, (uint32_t)DRM_PLANE_HELPER_NO_SCALING);3397 downscale_w = max(src_w / dst_w, (uint32_t)DRM_PLANE_HELPER_NO_SCALING);
3392 3398
@@ -3417,12 +3423,14 @@ skl_plane_relative_data_rate(const struct intel_crtc_state *cstate, · 24 unmodified lines
3417 if (y && format != DRM_FORMAT_NV12)3423 if (y && format != DRM_FORMAT_NV12)
3418 return 0;3424 return 0;
3419 3425
3426 /*
3427 * Src coordinates are already rotated by 270 degrees for
3428 * the 90/270 degree plane rotation cases (to match the
3429 * GTT mapping), hence no need to account for rotation here.
3430 */
3420 width = drm_rect_width(&intel_pstate->base.src) >> 16;3431 width = drm_rect_width(&intel_pstate->base.src) >> 16;
3421 height = drm_rect_height(&intel_pstate->base.src) >> 16;3432 height = drm_rect_height(&intel_pstate->base.src) >> 16;
3422 3433
3423 if (drm_rotation_90_or_270(pstate->rotation))
3424 swap(width, height);
3425
3426 /* for planar format */3434 /* for planar format */
3427 if (format == DRM_FORMAT_NV12) {3435 if (format == DRM_FORMAT_NV12) {
3428 if (y) /* y-plane data rate */3436 if (y) /* y-plane data rate */
@@ -3505,12 +3513,14 @@ skl_ddb_min_alloc(const struct drm_plane_state *pstate, · 76 unmodified lines
3505 fb->modifier != I915_FORMAT_MOD_Yf_TILED)3513 fb->modifier != I915_FORMAT_MOD_Yf_TILED)
3506 return 8;3514 return 8;
3507 3515
3516 /*
3517 * Src coordinates are already rotated by 270 degrees for
3518 * the 90/270 degree plane rotation cases (to match the
3519 * GTT mapping), hence no need to account for rotation here.
3520 */
3508 src_w = drm_rect_width(&intel_pstate->base.src) >> 16;3521 src_w = drm_rect_width(&intel_pstate->base.src) >> 16;
3509 src_h = drm_rect_height(&intel_pstate->base.src) >> 16;3522 src_h = drm_rect_height(&intel_pstate->base.src) >> 16;
3510 3523
3511 if (drm_rotation_90_or_270(pstate->rotation))
3512 swap(src_w, src_h);
3513
3514 /* Halve UV plane width and height for NV12 */3524 /* Halve UV plane width and height for NV12 */
3515 if (fb->format->format == DRM_FORMAT_NV12 && !y) {3525 if (fb->format->format == DRM_FORMAT_NV12 && !y) {
3516 src_w /= 2;3526 src_w /= 2;
@@ -3794,13 +3804,15 @@ static int skl_compute_plane_wm(const struct drm_i915_private *dev_priv, · 277 unmodified lines
3794 width = intel_pstate->base.crtc_w;3804 width = intel_pstate->base.crtc_w;
3795 height = intel_pstate->base.crtc_h;3805 height = intel_pstate->base.crtc_h;
3796 } else {3806 } else {
3807 /*
3808 * Src coordinates are already rotated by 270 degrees for
3809 * the 90/270 degree plane rotation cases (to match the
3810 * GTT mapping), hence no need to account for rotation here.
3811 */
3797 width = drm_rect_width(&intel_pstate->base.src) >> 16;3812 width = drm_rect_width(&intel_pstate->base.src) >> 16;
3798 height = drm_rect_height(&intel_pstate->base.src) >> 16;3813 height = drm_rect_height(&intel_pstate->base.src) >> 16;
3799 }3814 }
3800 3815
3801 if (drm_rotation_90_or_270(pstate->rotation))
3802 swap(width, height);
3803
3804 cpp = fb->format->cpp[0];3816 cpp = fb->format->cpp[0];
3805 plane_pixel_rate = skl_adjusted_plane_pixel_rate(cstate, intel_pstate);3817 plane_pixel_rate = skl_adjusted_plane_pixel_rate(cstate, intel_pstate);
3806 3818
@@ -4335,10 +4347,18 @@ skl_compute_wm(struct drm_atomic_state *state) · 528 unmodified lines
4335 struct drm_crtc_state *cstate;4347 struct drm_crtc_state *cstate;
4336 struct intel_atomic_state *intel_state = to_intel_atomic_state(state);4348 struct intel_atomic_state *intel_state = to_intel_atomic_state(state);
4337 struct skl_wm_values *results = &intel_state->wm_results;4349 struct skl_wm_values *results = &intel_state->wm_results;
4350 struct drm_device *dev = state->dev;
4338 struct skl_pipe_wm *pipe_wm;4351 struct skl_pipe_wm *pipe_wm;
4339 bool changed = false;4352 bool changed = false;
4340 int ret, i;4353 int ret, i;
4341 4354
4355 /*
4356 * When we distrust bios wm we always need to recompute to set the
4357 * expected DDB allocations for each CRTC.
4358 */
4359 if (to_i915(dev)->wm.distrust_bios_wm)
4360 changed = true;
4361
4342 /*4362 /*
4343 * If this transaction isn't actually touching any CRTC's, don't4363 * If this transaction isn't actually touching any CRTC's, don't
4344 * bother with watermark calculation. Note that if we pass this4364 * bother with watermark calculation. Note that if we pass this
@@ -4349,6 +4369,7 @@ skl_compute_wm(struct drm_atomic_state *state) · 4 unmodified lines
4349 */4369 */
4350 for_each_new_crtc_in_state(state, crtc, cstate, i)4370 for_each_new_crtc_in_state(state, crtc, cstate, i)
4351 changed = true;4371 changed = true;
4372
4352 if (!changed)4373 if (!changed)
4353 return 0;4374 return 0;
4354 4375
drivers/gpu/drm/i915/intel_psr.c+3−2
@@ -435,8 +435,9 @@ static bool intel_psr_match_conditions(struct intel_dp *intel_dp) · 434 unmodified lines
435 }435 }
436 436
437 /* PSR2 is restricted to work with panel resolutions upto 3200x2000 */437 /* PSR2 is restricted to work with panel resolutions upto 3200x2000 */
438 if (intel_crtc->config->pipe_src_w > 3200 ||438 if (dev_priv->psr.psr2_support &&
439 intel_crtc->config->pipe_src_h > 2000) {439 (intel_crtc->config->pipe_src_w > 3200 ||
440 intel_crtc->config->pipe_src_h > 2000)) {
440 dev_priv->psr.psr2_support = false;441 dev_priv->psr.psr2_support = false;
441 return false;442 return false;
442 }443 }
drivers/gpu/drm/i915/intel_sprite.c+21−0
@@ -83,10 +83,13 @@ int intel_usecs_to_scanlines(const struct drm_display_mode *adjusted_mode, · 82 unmodified lines
83 */83 */
84void intel_pipe_update_start(struct intel_crtc *crtc)84void intel_pipe_update_start(struct intel_crtc *crtc)
85{85{
86 struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
86 const struct drm_display_mode *adjusted_mode = &crtc->config->base.adjusted_mode;87 const struct drm_display_mode *adjusted_mode = &crtc->config->base.adjusted_mode;
87 long timeout = msecs_to_jiffies_timeout(1);88 long timeout = msecs_to_jiffies_timeout(1);
88 int scanline, min, max, vblank_start;89 int scanline, min, max, vblank_start;
89 wait_queue_head_t *wq = drm_crtc_vblank_waitqueue(&crtc->base);90 wait_queue_head_t *wq = drm_crtc_vblank_waitqueue(&crtc->base);
91 bool need_vlv_dsi_wa = (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) &&
92 intel_crtc_has_type(crtc->config, INTEL_OUTPUT_DSI);
90 DEFINE_WAIT(wait);93 DEFINE_WAIT(wait);
91 94
92 vblank_start = adjusted_mode->crtc_vblank_start;95 vblank_start = adjusted_mode->crtc_vblank_start;
@@ -139,6 +142,24 @@ void intel_pipe_update_start(struct intel_crtc *crtc) · 46 unmodified lines
139 142
140 drm_crtc_vblank_put(&crtc->base);143 drm_crtc_vblank_put(&crtc->base);
141 144
145 /*
146 * On VLV/CHV DSI the scanline counter would appear to
147 * increment approx. 1/3 of a scanline before start of vblank.
148 * The registers still get latched at start of vblank however.
149 * This means we must not write any registers on the first
150 * line of vblank (since not the whole line is actually in
151 * vblank). And unfortunately we can't use the interrupt to
152 * wait here since it will fire too soon. We could use the
153 * frame start interrupt instead since it will fire after the
154 * critical scanline, but that would require more changes
155 * in the interrupt code. So for now we'll just do the nasty
156 * thing and poll for the bad scanline to pass us by.
157 *
158 * FIXME figure out if BXT+ DSI suffers from this as well
159 */
160 while (need_vlv_dsi_wa && scanline == vblank_start)
161 scanline = intel_get_crtc_scanline(crtc);
162
142 crtc->debug.scanline_start = scanline;163 crtc->debug.scanline_start = scanline;
143 crtc->debug.start_vbl_time = ktime_get();164 crtc->debug.start_vbl_time = ktime_get();
144 crtc->debug.start_vbl_count = intel_crtc_get_vblank_counter(crtc);165 crtc->debug.start_vbl_count = intel_crtc_get_vblank_counter(crtc);
drivers/gpu/drm/i915/intel_uc.h+0−2
@@ -59,8 +59,6 @@ struct drm_i915_gem_request; · 58 unmodified lines
59 * available in the work queue (note, the queue is shared,59 * available in the work queue (note, the queue is shared,
60 * not per-engine). It is OK for this to be nonzero, but60 * not per-engine). It is OK for this to be nonzero, but
61 * it should not be huge!61 * it should not be huge!
62 * q_fail: failed to enqueue a work item. This should never happen,
63 * because we check for space beforehand.
64 * b_fail: failed to ring the doorbell. This should never happen, unless62 * b_fail: failed to ring the doorbell. This should never happen, unless
65 * somehow the hardware misbehaves, or maybe if the GuC firmware63 * somehow the hardware misbehaves, or maybe if the GuC firmware
66 * crashes? We probably need to reset the GPU to recover.64 * crashes? We probably need to reset the GPU to recover.
drivers/gpu/drm/i915/selftests/i915_gem_context.c+5−3
@@ -320,7 +320,7 @@ static unsigned long max_dwords(struct drm_i915_gem_object *obj) · 319 unmodified lines
320static int igt_ctx_exec(void *arg)320static int igt_ctx_exec(void *arg)
321{321{
322 struct drm_i915_private *i915 = arg;322 struct drm_i915_private *i915 = arg;
323 struct drm_i915_gem_object *obj;323 struct drm_i915_gem_object *obj = NULL;
324 struct drm_file *file;324 struct drm_file *file;
325 IGT_TIMEOUT(end_time);325 IGT_TIMEOUT(end_time);
326 LIST_HEAD(objects);326 LIST_HEAD(objects);
@@ -359,7 +359,7 @@ static int igt_ctx_exec(void *arg) · 32 unmodified lines
359 }359 }
360 360
361 for_each_engine(engine, i915, id) {361 for_each_engine(engine, i915, id) {
362 if (dw == 0) {362 if (!obj) {
363 obj = create_test_object(ctx, file, &objects);363 obj = create_test_object(ctx, file, &objects);
364 if (IS_ERR(obj)) {364 if (IS_ERR(obj)) {
365 err = PTR_ERR(obj);365 err = PTR_ERR(obj);
@@ -376,8 +376,10 @@ static int igt_ctx_exec(void *arg) · 10 unmodified lines
376 goto out_unlock;376 goto out_unlock;
377 }377 }
378 378
379 if (++dw == max_dwords(obj))379 if (++dw == max_dwords(obj)) {
380 obj = NULL;
380 dw = 0;381 dw = 0;
382 }
381 ndwords++;383 ndwords++;
382 }384 }
383 ncontexts++;385 ncontexts++;
drivers/gpu/drm/imx/imx-ldb.c+1−1
@@ -673,7 +673,7 @@ static int imx_ldb_bind(struct device *dev, struct device *master, void *data) · 672 unmodified lines
673 ret = drm_of_find_panel_or_bridge(child,673 ret = drm_of_find_panel_or_bridge(child,
674 imx_ldb->lvds_mux ? 4 : 2, 0,674 imx_ldb->lvds_mux ? 4 : 2, 0,
675 &channel->panel, &channel->bridge);675 &channel->panel, &channel->bridge);
676 if (ret)676 if (ret && ret != -ENODEV)
677 return ret;677 return ret;
678 678
679 /* panel ddc only if there is no bridge */679 /* panel ddc only if there is no bridge */
drivers/gpu/drm/mediatek/mtk_dsi.c+6−9
@@ -19,6 +19,7 @@ · 18 unmodified lines
19#include <drm/drm_of.h>19#include <drm/drm_of.h>
20#include <linux/clk.h>20#include <linux/clk.h>
21#include <linux/component.h>21#include <linux/component.h>
22#include <linux/iopoll.h>
22#include <linux/irq.h>23#include <linux/irq.h>
23#include <linux/of.h>24#include <linux/of.h>
24#include <linux/of_platform.h>25#include <linux/of_platform.h>
@@ -900,16 +901,12 @@ static int mtk_dsi_host_detach(struct mipi_dsi_host *host, · 875 unmodified lines
900 901
901static void mtk_dsi_wait_for_idle(struct mtk_dsi *dsi)902static void mtk_dsi_wait_for_idle(struct mtk_dsi *dsi)
902{903{
903 u32 timeout_ms = 500000; /* total 1s ~ 2s timeout */904 int ret;
904 905 u32 val;
905 while (timeout_ms--) {
906 if (!(readl(dsi->regs + DSI_INTSTA) & DSI_BUSY))
907 break;
908
909 usleep_range(2, 4);
910 }
911 906
912 if (timeout_ms == 0) {907 ret = readl_poll_timeout(dsi->regs + DSI_INTSTA, val, !(val & DSI_BUSY),
908 4, 2000000);
909 if (ret) {
913 DRM_WARN("polling dsi wait not busy timeout!\n");910 DRM_WARN("polling dsi wait not busy timeout!\n");
914 911
915 mtk_dsi_enable(dsi);912 mtk_dsi_enable(dsi);
drivers/gpu/drm/mediatek/mtk_hdmi.c+1−1
@@ -1062,7 +1062,7 @@ static int mtk_hdmi_setup_vendor_specific_infoframe(struct mtk_hdmi *hdmi, · 1061 unmodified lines
1062 }1062 }
1063 1063
1064 err = hdmi_vendor_infoframe_pack(&frame, buffer, sizeof(buffer));1064 err = hdmi_vendor_infoframe_pack(&frame, buffer, sizeof(buffer));
1065 if (err) {1065 if (err < 0) {
1066 dev_err(hdmi->dev, "Failed to pack vendor infoframe: %zd\n",1066 dev_err(hdmi->dev, "Failed to pack vendor infoframe: %zd\n",
1067 err);1067 err);
1068 return err;1068 return err;
drivers/gpu/drm/meson/meson_drv.c+15−5
@@ -152,7 +152,7 @@ static struct regmap_config meson_regmap_config = { · 151 unmodified lines
152 .max_register = 0x1000,152 .max_register = 0x1000,
153};153};
154 154
155static int meson_drv_bind(struct device *dev)155static int meson_drv_bind_master(struct device *dev, bool has_components)
156{156{
157 struct platform_device *pdev = to_platform_device(dev);157 struct platform_device *pdev = to_platform_device(dev);
158 struct meson_drm *priv;158 struct meson_drm *priv;
@@ -233,10 +233,12 @@ static int meson_drv_bind(struct device *dev) · 74 unmodified lines
233 if (ret)233 if (ret)
234 goto free_drm;234 goto free_drm;
235 235
236 ret = component_bind_all(drm->dev, drm);236 if (has_components) {
237 if (ret) {237 ret = component_bind_all(drm->dev, drm);
238 dev_err(drm->dev, "Couldn't bind all components\n");238 if (ret) {
239 goto free_drm;239 dev_err(drm->dev, "Couldn't bind all components\n");
240 goto free_drm;
241 }
240 }242 }
241 243
242 ret = meson_plane_create(priv);244 ret = meson_plane_create(priv);
@@ -276,6 +278,11 @@ free_drm: · 33 unmodified lines
276 return ret;278 return ret;
277}279}
278 280
281static int meson_drv_bind(struct device *dev)
282{
283 return meson_drv_bind_master(dev, true);
284}
285
279static void meson_drv_unbind(struct device *dev)286static void meson_drv_unbind(struct device *dev)
280{287{
281 struct drm_device *drm = dev_get_drvdata(dev);288 struct drm_device *drm = dev_get_drvdata(dev);
@@ -357,6 +364,9 @@ static int meson_drv_probe(struct platform_device *pdev) · 75 unmodified lines
357 count += meson_probe_remote(pdev, &match, np, remote);364 count += meson_probe_remote(pdev, &match, np, remote);
358 }365 }
359 366
367 if (count && !match)
368 return meson_drv_bind_master(&pdev->dev, false);
369
360 /* If some endpoints were found, initialize the nodes */370 /* If some endpoints were found, initialize the nodes */
361 if (count) {371 if (count) {
362 dev_info(&pdev->dev, "Queued %d outputs on vpu\n", count);372 dev_info(&pdev->dev, "Queued %d outputs on vpu\n", count);
drivers/gpu/drm/mgag200/mgag200_mode.c+8−1
@@ -1173,7 +1173,10 @@ static int mga_crtc_mode_set(struct drm_crtc *crtc, · 1172 unmodified lines
1173 1173
1174 1174
1175 if (IS_G200_SE(mdev)) {1175 if (IS_G200_SE(mdev)) {
1176 if (mdev->unique_rev_id >= 0x02) {1176 if (mdev->unique_rev_id >= 0x04) {
1177 WREG8(MGAREG_CRTCEXT_INDEX, 0x06);
1178 WREG8(MGAREG_CRTCEXT_DATA, 0);
1179 } else if (mdev->unique_rev_id >= 0x02) {
1177 u8 hi_pri_lvl;1180 u8 hi_pri_lvl;
1178 u32 bpp;1181 u32 bpp;
1179 u32 mb;1182 u32 mb;
@@ -1639,6 +1642,10 @@ static int mga_vga_mode_valid(struct drm_connector *connector, · 459 unmodified lines
1639 if (mga_vga_calculate_mode_bandwidth(mode, bpp)1642 if (mga_vga_calculate_mode_bandwidth(mode, bpp)
1640 > (30100 * 1024))1643 > (30100 * 1024))
1641 return MODE_BANDWIDTH;1644 return MODE_BANDWIDTH;
1645 } else {
1646 if (mga_vga_calculate_mode_bandwidth(mode, bpp)
1647 > (55000 * 1024))
1648 return MODE_BANDWIDTH;
1642 }1649 }
1643 } else if (mdev->type == G200_WB) {1650 } else if (mdev->type == G200_WB) {
1644 if (mode->hdisplay > 1280)1651 if (mode->hdisplay > 1280)
drivers/gpu/drm/msm/Kconfig+1−0
@@ -13,6 +13,7 @@ config DRM_MSM · 12 unmodified lines
13 select QCOM_SCM13 select QCOM_SCM
14 select SND_SOC_HDMI_CODEC if SND_SOC14 select SND_SOC_HDMI_CODEC if SND_SOC
15 select SYNC_FILE15 select SYNC_FILE
16 select PM_OPP
16 default y17 default y
17 help18 help
18 DRM/KMS driver for MSM/snapdragon.19 DRM/KMS driver for MSM/snapdragon.
drivers/gpu/drm/msm/mdp/mdp5/mdp5_mdss.c+1−1
@@ -116,7 +116,7 @@ static int mdss_hw_irqdomain_map(struct irq_domain *d, unsigned int irq, · 115 unmodified lines
116 return 0;116 return 0;
117}117}
118 118
119static struct irq_domain_ops mdss_hw_irqdomain_ops = {119static const struct irq_domain_ops mdss_hw_irqdomain_ops = {
120 .map = mdss_hw_irqdomain_map,120 .map = mdss_hw_irqdomain_map,
121 .xlate = irq_domain_xlate_onecell,121 .xlate = irq_domain_xlate_onecell,
122};122};
drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c+7−2
@@ -225,9 +225,10 @@ mdp5_plane_duplicate_state(struct drm_plane *plane) · 224 unmodified lines
225 225
226 mdp5_state = kmemdup(to_mdp5_plane_state(plane->state),226 mdp5_state = kmemdup(to_mdp5_plane_state(plane->state),
227 sizeof(*mdp5_state), GFP_KERNEL);227 sizeof(*mdp5_state), GFP_KERNEL);
228 if (!mdp5_state)
229 return NULL;
228 230
229 if (mdp5_state && mdp5_state->base.fb)231 __drm_atomic_helper_plane_duplicate_state(plane, &mdp5_state->base);
230 drm_framebuffer_reference(mdp5_state->base.fb);
231 232
232 return &mdp5_state->base;233 return &mdp5_state->base;
233}234}
@@ -444,6 +445,10 @@ static int mdp5_plane_atomic_check_with_state(struct drm_crtc_state *crtc_state, · 210 unmodified lines
444 mdp5_pipe_release(state->state, old_hwpipe);445 mdp5_pipe_release(state->state, old_hwpipe);
445 mdp5_pipe_release(state->state, old_right_hwpipe);446 mdp5_pipe_release(state->state, old_right_hwpipe);
446 }447 }
448 } else {
449 mdp5_pipe_release(state->state, mdp5_state->hwpipe);
450 mdp5_pipe_release(state->state, mdp5_state->r_hwpipe);
451 mdp5_state->hwpipe = mdp5_state->r_hwpipe = NULL;
447 }452 }
448 453
449 return 0;454 return 0;
drivers/gpu/drm/msm/msm_drv.c+1−0
@@ -830,6 +830,7 @@ static struct drm_driver msm_driver = { · 829 unmodified lines
830 .prime_fd_to_handle = drm_gem_prime_fd_to_handle,830 .prime_fd_to_handle = drm_gem_prime_fd_to_handle,
831 .gem_prime_export = drm_gem_prime_export,831 .gem_prime_export = drm_gem_prime_export,
832 .gem_prime_import = drm_gem_prime_import,832 .gem_prime_import = drm_gem_prime_import,
833 .gem_prime_res_obj = msm_gem_prime_res_obj,
833 .gem_prime_pin = msm_gem_prime_pin,834 .gem_prime_pin = msm_gem_prime_pin,
834 .gem_prime_unpin = msm_gem_prime_unpin,835 .gem_prime_unpin = msm_gem_prime_unpin,
835 .gem_prime_get_sg_table = msm_gem_prime_get_sg_table,836 .gem_prime_get_sg_table = msm_gem_prime_get_sg_table,
drivers/gpu/drm/msm/msm_drv.h+1−0
@@ -224,6 +224,7 @@ struct sg_table *msm_gem_prime_get_sg_table(struct drm_gem_object *obj); · 223 unmodified lines
224void *msm_gem_prime_vmap(struct drm_gem_object *obj);224void *msm_gem_prime_vmap(struct drm_gem_object *obj);
225void msm_gem_prime_vunmap(struct drm_gem_object *obj, void *vaddr);225void msm_gem_prime_vunmap(struct drm_gem_object *obj, void *vaddr);
226int msm_gem_prime_mmap(struct drm_gem_object *obj, struct vm_area_struct *vma);226int msm_gem_prime_mmap(struct drm_gem_object *obj, struct vm_area_struct *vma);
227struct reservation_object *msm_gem_prime_res_obj(struct drm_gem_object *obj);
227struct drm_gem_object *msm_gem_prime_import_sg_table(struct drm_device *dev,228struct drm_gem_object *msm_gem_prime_import_sg_table(struct drm_device *dev,
228 struct dma_buf_attachment *attach, struct sg_table *sg);229 struct dma_buf_attachment *attach, struct sg_table *sg);
229int msm_gem_prime_pin(struct drm_gem_object *obj);230int msm_gem_prime_pin(struct drm_gem_object *obj);
drivers/gpu/drm/msm/msm_fence.c+2−8
@@ -99,8 +99,8 @@ void msm_update_fence(struct msm_fence_context *fctx, uint32_t fence) · 98 unmodified lines
99}99}
100 100
101struct msm_fence {101struct msm_fence {
102 struct msm_fence_context *fctx;
103 struct dma_fence base;102 struct dma_fence base;
103 struct msm_fence_context *fctx;
104};104};
105 105
106static inline struct msm_fence *to_msm_fence(struct dma_fence *fence)106static inline struct msm_fence *to_msm_fence(struct dma_fence *fence)
@@ -130,19 +130,13 @@ static bool msm_fence_signaled(struct dma_fence *fence) · 23 unmodified lines
130 return fence_completed(f->fctx, f->base.seqno);130 return fence_completed(f->fctx, f->base.seqno);
131}131}
132 132
133static void msm_fence_release(struct dma_fence *fence)
134{
135 struct msm_fence *f = to_msm_fence(fence);
136 kfree_rcu(f, base.rcu);
137}
138
139static const struct dma_fence_ops msm_fence_ops = {133static const struct dma_fence_ops msm_fence_ops = {
140 .get_driver_name = msm_fence_get_driver_name,134 .get_driver_name = msm_fence_get_driver_name,
141 .get_timeline_name = msm_fence_get_timeline_name,135 .get_timeline_name = msm_fence_get_timeline_name,
142 .enable_signaling = msm_fence_enable_signaling,136 .enable_signaling = msm_fence_enable_signaling,
143 .signaled = msm_fence_signaled,137 .signaled = msm_fence_signaled,
144 .wait = dma_fence_default_wait,138 .wait = dma_fence_default_wait,
145 .release = msm_fence_release,139 .release = dma_fence_free,
146};140};
147 141
148struct dma_fence *142struct dma_fence *
drivers/gpu/drm/msm/msm_gem.c+6−0
@@ -758,6 +758,8 @@ static int msm_gem_new_impl(struct drm_device *dev, · 757 unmodified lines
758 struct msm_gem_object *msm_obj;758 struct msm_gem_object *msm_obj;
759 bool use_vram = false;759 bool use_vram = false;
760 760
761 WARN_ON(!mutex_is_locked(&dev->struct_mutex));
762
761 switch (flags & MSM_BO_CACHE_MASK) {763 switch (flags & MSM_BO_CACHE_MASK) {
762 case MSM_BO_UNCACHED:764 case MSM_BO_UNCACHED:
763 case MSM_BO_CACHED:765 case MSM_BO_CACHED:
@@ -853,7 +855,11 @@ struct drm_gem_object *msm_gem_import(struct drm_device *dev, · 89 unmodified lines
853 855
854 size = PAGE_ALIGN(dmabuf->size);856 size = PAGE_ALIGN(dmabuf->size);
855 857
858 /* Take mutex so we can modify the inactive list in msm_gem_new_impl */
859 mutex_lock(&dev->struct_mutex);
856 ret = msm_gem_new_impl(dev, size, MSM_BO_WC, dmabuf->resv, &obj);860 ret = msm_gem_new_impl(dev, size, MSM_BO_WC, dmabuf->resv, &obj);
861 mutex_unlock(&dev->struct_mutex);
862
857 if (ret)863 if (ret)
858 goto fail;864 goto fail;
859 865
drivers/gpu/drm/msm/msm_gem_prime.c+7−0
@@ -70,3 +70,10 @@ void msm_gem_prime_unpin(struct drm_gem_object *obj) · 69 unmodified lines
70 if (!obj->import_attach)70 if (!obj->import_attach)
71 msm_gem_put_pages(obj);71 msm_gem_put_pages(obj);
72}72}
73
74struct reservation_object *msm_gem_prime_res_obj(struct drm_gem_object *obj)
75{
76 struct msm_gem_object *msm_obj = to_msm_bo(obj);
77
78 return msm_obj->resv;
79}
drivers/gpu/drm/msm/msm_gem_submit.c+7−7
@@ -410,12 +410,11 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data, · 409 unmodified lines
410 if (!in_fence)410 if (!in_fence)
411 return -EINVAL;411 return -EINVAL;
412 412
413 /* TODO if we get an array-fence due to userspace merging multiple413 /*
414 * fences, we need a way to determine if all the backing fences414 * Wait if the fence is from a foreign context, or if the fence
415 * are from our own context..415 * array contains any fence from a foreign context.
416 */416 */
417 417 if (!dma_fence_match_context(in_fence, gpu->fctx->context)) {
418 if (in_fence->context != gpu->fctx->context) {
419 ret = dma_fence_wait(in_fence, true);418 ret = dma_fence_wait(in_fence, true);
420 if (ret)419 if (ret)
421 return ret;420 return ret;
@@ -496,8 +495,9 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data, · 74 unmodified lines
496 goto out;495 goto out;
497 }496 }
498 497
499 if ((submit_cmd.size + submit_cmd.submit_offset) >=498 if (!submit_cmd.size ||
500 msm_obj->base.size) {499 ((submit_cmd.size + submit_cmd.submit_offset) >
500 msm_obj->base.size)) {
501 DRM_ERROR("invalid cmdstream size: %u\n", submit_cmd.size);501 DRM_ERROR("invalid cmdstream size: %u\n", submit_cmd.size);
502 ret = -EINVAL;502 ret = -EINVAL;
503 goto out;503 goto out;
drivers/gpu/drm/msm/msm_gpu.c+2−2
@@ -549,9 +549,9 @@ static int get_clocks(struct platform_device *pdev, struct msm_gpu *gpu) · 548 unmodified lines
549 gpu->grp_clks[i] = get_clock(dev, name);549 gpu->grp_clks[i] = get_clock(dev, name);
550 550
551 /* Remember the key clocks that we need to control later */551 /* Remember the key clocks that we need to control later */
552 if (!strcmp(name, "core"))552 if (!strcmp(name, "core") || !strcmp(name, "core_clk"))
553 gpu->core_clk = gpu->grp_clks[i];553 gpu->core_clk = gpu->grp_clks[i];
554 else if (!strcmp(name, "rbbmtimer"))554 else if (!strcmp(name, "rbbmtimer") || !strcmp(name, "rbbmtimer_clk"))
555 gpu->rbbmtimer_clk = gpu->grp_clks[i];555 gpu->rbbmtimer_clk = gpu->grp_clks[i];
556 556
557 ++i;557 ++i;
drivers/gpu/drm/mxsfb/mxsfb_crtc.c+42−0
@@ -35,6 +35,13 @@ · 34 unmodified lines
35#include "mxsfb_drv.h"35#include "mxsfb_drv.h"
36#include "mxsfb_regs.h"36#include "mxsfb_regs.h"
37 37
38#define MXS_SET_ADDR 0x4
39#define MXS_CLR_ADDR 0x8
40#define MODULE_CLKGATE BIT(30)
41#define MODULE_SFTRST BIT(31)
42/* 1 second delay should be plenty of time for block reset */
43#define RESET_TIMEOUT 1000000
44
38static u32 set_hsync_pulse_width(struct mxsfb_drm_private *mxsfb, u32 val)45static u32 set_hsync_pulse_width(struct mxsfb_drm_private *mxsfb, u32 val)
39{46{
40 return (val & mxsfb->devdata->hs_wdth_mask) <<47 return (val & mxsfb->devdata->hs_wdth_mask) <<
@@ -159,6 +166,36 @@ static void mxsfb_disable_controller(struct mxsfb_drm_private *mxsfb) · 118 unmodified lines
159 clk_disable_unprepare(mxsfb->clk_disp_axi);166 clk_disable_unprepare(mxsfb->clk_disp_axi);
160}167}
161 168
169/*
170 * Clear the bit and poll it cleared. This is usually called with
171 * a reset address and mask being either SFTRST(bit 31) or CLKGATE
172 * (bit 30).
173 */
174static int clear_poll_bit(void __iomem *addr, u32 mask)
175{
176 u32 reg;
177
178 writel(mask, addr + MXS_CLR_ADDR);
179 return readl_poll_timeout(addr, reg, !(reg & mask), 0, RESET_TIMEOUT);
180}
181
182static int mxsfb_reset_block(void __iomem *reset_addr)
183{
184 int ret;
185
186 ret = clear_poll_bit(reset_addr, MODULE_SFTRST);
187 if (ret)
188 return ret;
189
190 writel(MODULE_CLKGATE, reset_addr + MXS_CLR_ADDR);
191
192 ret = clear_poll_bit(reset_addr, MODULE_SFTRST);
193 if (ret)
194 return ret;
195
196 return clear_poll_bit(reset_addr, MODULE_CLKGATE);
197}
198
162static void mxsfb_crtc_mode_set_nofb(struct mxsfb_drm_private *mxsfb)199static void mxsfb_crtc_mode_set_nofb(struct mxsfb_drm_private *mxsfb)
163{200{
164 struct drm_display_mode *m = &mxsfb->pipe.crtc.state->adjusted_mode;201 struct drm_display_mode *m = &mxsfb->pipe.crtc.state->adjusted_mode;
@@ -173,6 +210,11 @@ static void mxsfb_crtc_mode_set_nofb(struct mxsfb_drm_private *mxsfb) · 8 unmodified lines
173 */210 */
174 mxsfb_enable_axi_clk(mxsfb);211 mxsfb_enable_axi_clk(mxsfb);
175 212
213 /* Mandatory eLCDIF reset as per the Reference Manual */
214 err = mxsfb_reset_block(mxsfb->base);
215 if (err)
216 return;
217
176 /* Clear the FIFOs */218 /* Clear the FIFOs */
177 writel(CTRL1_FIFO_CLEAR, mxsfb->base + LCDC_CTRL1 + REG_SET);219 writel(CTRL1_FIFO_CLEAR, mxsfb->base + LCDC_CTRL1 + REG_SET);
178 220
drivers/gpu/drm/nouveau/include/nvkm/subdev/timer.h+1−0
@@ -4,6 +4,7 @@ · 3 unmodified lines
4 4
5struct nvkm_alarm {5struct nvkm_alarm {
6 struct list_head head;6 struct list_head head;
7 struct list_head exec;
7 u64 timestamp;8 u64 timestamp;
8 void (*func)(struct nvkm_alarm *);9 void (*func)(struct nvkm_alarm *);
9};10};
drivers/gpu/drm/nouveau/nouveau_drm.c+17−21
@@ -80,7 +80,7 @@ int nouveau_modeset = -1; · 79 unmodified lines
80module_param_named(modeset, nouveau_modeset, int, 0400);80module_param_named(modeset, nouveau_modeset, int, 0400);
81 81
82MODULE_PARM_DESC(runpm, "disable (0), force enable (1), optimus only default (-1)");82MODULE_PARM_DESC(runpm, "disable (0), force enable (1), optimus only default (-1)");
83int nouveau_runtime_pm = -1;83static int nouveau_runtime_pm = -1;
84module_param_named(runpm, nouveau_runtime_pm, int, 0400);84module_param_named(runpm, nouveau_runtime_pm, int, 0400);
85 85
86static struct drm_driver driver_stub;86static struct drm_driver driver_stub;
@@ -495,7 +495,7 @@ nouveau_drm_load(struct drm_device *dev, unsigned long flags) · 408 unmodified lines
495 nouveau_fbcon_init(dev);495 nouveau_fbcon_init(dev);
496 nouveau_led_init(dev);496 nouveau_led_init(dev);
497 497
498 if (nouveau_runtime_pm != 0) {498 if (nouveau_pmops_runtime()) {
499 pm_runtime_use_autosuspend(dev->dev);499 pm_runtime_use_autosuspend(dev->dev);
500 pm_runtime_set_autosuspend_delay(dev->dev, 5000);500 pm_runtime_set_autosuspend_delay(dev->dev, 5000);
501 pm_runtime_set_active(dev->dev);501 pm_runtime_set_active(dev->dev);
@@ -527,7 +527,7 @@ nouveau_drm_unload(struct drm_device *dev) · 25 unmodified lines
527{527{
528 struct nouveau_drm *drm = nouveau_drm(dev);528 struct nouveau_drm *drm = nouveau_drm(dev);
529 529
530 if (nouveau_runtime_pm != 0) {530 if (nouveau_pmops_runtime()) {
531 pm_runtime_get_sync(dev->dev);531 pm_runtime_get_sync(dev->dev);
532 pm_runtime_forbid(dev->dev);532 pm_runtime_forbid(dev->dev);
533 }533 }
@@ -726,6 +726,14 @@ nouveau_pmops_thaw(struct device *dev) · 192 unmodified lines
726 return nouveau_do_resume(drm_dev, false);726 return nouveau_do_resume(drm_dev, false);
727}727}
728 728
729bool
730nouveau_pmops_runtime()
731{
732 if (nouveau_runtime_pm == -1)
733 return nouveau_is_optimus() || nouveau_is_v1_dsm();
734 return nouveau_runtime_pm == 1;
735}
736
729static int737static int
730nouveau_pmops_runtime_suspend(struct device *dev)738nouveau_pmops_runtime_suspend(struct device *dev)
731{739{
@@ -733,14 +741,7 @@ nouveau_pmops_runtime_suspend(struct device *dev) · 1 unmodified line
733 struct drm_device *drm_dev = pci_get_drvdata(pdev);741 struct drm_device *drm_dev = pci_get_drvdata(pdev);
734 int ret;742 int ret;
735 743
736 if (nouveau_runtime_pm == 0) {744 if (!nouveau_pmops_runtime()) {
737 pm_runtime_forbid(dev);
738 return -EBUSY;
739 }
740
741 /* are we optimus enabled? */
742 if (nouveau_runtime_pm == -1 && !nouveau_is_optimus() && !nouveau_is_v1_dsm()) {
743 DRM_DEBUG_DRIVER("failing to power off - not optimus\n");
744 pm_runtime_forbid(dev);745 pm_runtime_forbid(dev);
745 return -EBUSY;746 return -EBUSY;
746 }747 }
@@ -765,8 +766,10 @@ nouveau_pmops_runtime_resume(struct device *dev) · 18 unmodified lines
765 struct nvif_device *device = &nouveau_drm(drm_dev)->client.device;766 struct nvif_device *device = &nouveau_drm(drm_dev)->client.device;
766 int ret;767 int ret;
767 768
768 if (nouveau_runtime_pm == 0)769 if (!nouveau_pmops_runtime()) {
769 return -EINVAL;770 pm_runtime_forbid(dev);
771 return -EBUSY;
772 }
770 773
771 pci_set_power_state(pdev, PCI_D0);774 pci_set_power_state(pdev, PCI_D0);
772 pci_restore_state(pdev);775 pci_restore_state(pdev);
@@ -796,14 +799,7 @@ nouveau_pmops_runtime_idle(struct device *dev) · 23 unmodified lines
796 struct nouveau_drm *drm = nouveau_drm(drm_dev);799 struct nouveau_drm *drm = nouveau_drm(drm_dev);
797 struct drm_crtc *crtc;800 struct drm_crtc *crtc;
798 801
799 if (nouveau_runtime_pm == 0) {802 if (!nouveau_pmops_runtime()) {
800 pm_runtime_forbid(dev);
801 return -EBUSY;
802 }
803
804 /* are we optimus enabled? */
805 if (nouveau_runtime_pm == -1 && !nouveau_is_optimus() && !nouveau_is_v1_dsm()) {
806 DRM_DEBUG_DRIVER("failing to power off - not optimus\n");
807 pm_runtime_forbid(dev);803 pm_runtime_forbid(dev);
808 return -EBUSY;804 return -EBUSY;
809 }805 }
drivers/gpu/drm/nouveau/nouveau_drv.h+1−2
@@ -108,8 +108,6 @@ nouveau_cli(struct drm_file *fpriv) · 107 unmodified lines
108#include <nvif/object.h>108#include <nvif/object.h>
109#include <nvif/device.h>109#include <nvif/device.h>
110 110
111extern int nouveau_runtime_pm;
112
113struct nouveau_drm {111struct nouveau_drm {
114 struct nouveau_cli client;112 struct nouveau_cli client;
115 struct drm_device *dev;113 struct drm_device *dev;
@@ -195,6 +193,7 @@ nouveau_drm(struct drm_device *dev) · 79 unmodified lines
195 193
196int nouveau_pmops_suspend(struct device *);194int nouveau_pmops_suspend(struct device *);
197int nouveau_pmops_resume(struct device *);195int nouveau_pmops_resume(struct device *);
196bool nouveau_pmops_runtime(void);
198 197
199#include <nvkm/core/tegra.h>198#include <nvkm/core/tegra.h>
200 199
drivers/gpu/drm/nouveau/nouveau_vga.c+2−11
@@ -87,7 +87,7 @@ void · 86 unmodified lines
87nouveau_vga_init(struct nouveau_drm *drm)87nouveau_vga_init(struct nouveau_drm *drm)
88{88{
89 struct drm_device *dev = drm->dev;89 struct drm_device *dev = drm->dev;
90 bool runtime = false;90 bool runtime = nouveau_pmops_runtime();
91 91
92 /* only relevant for PCI devices */92 /* only relevant for PCI devices */
93 if (!dev->pdev)93 if (!dev->pdev)
@@ -99,10 +99,6 @@ nouveau_vga_init(struct nouveau_drm *drm) · 5 unmodified lines
99 if (pci_is_thunderbolt_attached(dev->pdev))99 if (pci_is_thunderbolt_attached(dev->pdev))
100 return;100 return;
101 101
102 if (nouveau_runtime_pm == 1)
103 runtime = true;
104 if ((nouveau_runtime_pm == -1) && (nouveau_is_optimus() || nouveau_is_v1_dsm()))
105 runtime = true;
106 vga_switcheroo_register_client(dev->pdev, &nouveau_switcheroo_ops, runtime);102 vga_switcheroo_register_client(dev->pdev, &nouveau_switcheroo_ops, runtime);
107 103
108 if (runtime && nouveau_is_v1_dsm() && !nouveau_is_optimus())104 if (runtime && nouveau_is_v1_dsm() && !nouveau_is_optimus())
@@ -113,18 +109,13 @@ void · 4 unmodified lines
113nouveau_vga_fini(struct nouveau_drm *drm)109nouveau_vga_fini(struct nouveau_drm *drm)
114{110{
115 struct drm_device *dev = drm->dev;111 struct drm_device *dev = drm->dev;
116 bool runtime = false;112 bool runtime = nouveau_pmops_runtime();
117 113
118 vga_client_register(dev->pdev, NULL, NULL, NULL);114 vga_client_register(dev->pdev, NULL, NULL, NULL);
119 115
120 if (pci_is_thunderbolt_attached(dev->pdev))116 if (pci_is_thunderbolt_attached(dev->pdev))
121 return;117 return;
122 118
123 if (nouveau_runtime_pm == 1)
124 runtime = true;
125 if ((nouveau_runtime_pm == -1) && (nouveau_is_optimus() || nouveau_is_v1_dsm()))
126 runtime = true;
127
128 vga_switcheroo_unregister_client(dev->pdev);119 vga_switcheroo_unregister_client(dev->pdev);
129 if (runtime && nouveau_is_v1_dsm() && !nouveau_is_optimus())120 if (runtime && nouveau_is_v1_dsm() && !nouveau_is_optimus())
130 vga_switcheroo_fini_domain_pm_ops(drm->dev->dev);121 vga_switcheroo_fini_domain_pm_ops(drm->dev->dev);
drivers/gpu/drm/nouveau/nv50_display.c+2−1
@@ -2107,7 +2107,8 @@ nv50_head_atomic_check(struct drm_crtc *crtc, struct drm_crtc_state *state) · 2106 unmodified lines
2107 asyc->set.dither = true;2107 asyc->set.dither = true;
2108 }2108 }
2109 } else {2109 } else {
2110 asyc->set.mask = ~0;2110 if (asyc)
2111 asyc->set.mask = ~0;
2111 asyh->set.mask = ~0;2112 asyh->set.mask = ~0;
2112 }2113 }
2113 2114
drivers/gpu/drm/nouveau/nvkm/subdev/timer/base.c+4−3
@@ -50,7 +50,8 @@ nvkm_timer_alarm_trigger(struct nvkm_timer *tmr) · 49 unmodified lines
50 /* Move to completed list. We'll drop the lock before50 /* Move to completed list. We'll drop the lock before
51 * executing the callback so it can reschedule itself.51 * executing the callback so it can reschedule itself.
52 */52 */
53 list_move_tail(&alarm->head, &exec);53 list_del_init(&alarm->head);
54 list_add(&alarm->exec, &exec);
54 }55 }
55 56
56 /* Shut down interrupt if no more pending alarms. */57 /* Shut down interrupt if no more pending alarms. */
@@ -59,8 +60,8 @@ nvkm_timer_alarm_trigger(struct nvkm_timer *tmr) · 2 unmodified lines
59 spin_unlock_irqrestore(&tmr->lock, flags);60 spin_unlock_irqrestore(&tmr->lock, flags);
60 61
61 /* Execute completed callbacks. */62 /* Execute completed callbacks. */
62 list_for_each_entry_safe(alarm, atemp, &exec, head) {63 list_for_each_entry_safe(alarm, atemp, &exec, exec) {
63 list_del_init(&alarm->head);64 list_del(&alarm->exec);
64 alarm->func(alarm);65 alarm->func(alarm);
65 }66 }
66}67}
drivers/gpu/drm/radeon/cik.c+5−2
@@ -9267,8 +9267,11 @@ static void dce8_program_watermarks(struct radeon_device *rdev, · 9266 unmodified lines
9267 u32 tmp, wm_mask;9267 u32 tmp, wm_mask;
9268 9268
9269 if (radeon_crtc->base.enabled && num_heads && mode) {9269 if (radeon_crtc->base.enabled && num_heads && mode) {
9270 active_time = 1000000UL * (u32)mode->crtc_hdisplay / (u32)mode->clock;9270 active_time = (u32) div_u64((u64)mode->crtc_hdisplay * 1000000,
9271 line_time = min((u32) (1000000UL * (u32)mode->crtc_htotal / (u32)mode->clock), (u32)65535);9271 (u32)mode->clock);
9272 line_time = (u32) div_u64((u64)mode->crtc_htotal * 1000000,
9273 (u32)mode->clock);
9274 line_time = min(line_time, (u32)65535);
9272 9275
9273 /* watermark for high clocks */9276 /* watermark for high clocks */
9274 if ((rdev->pm.pm_method == PM_METHOD_DPM) &&9277 if ((rdev->pm.pm_method == PM_METHOD_DPM) &&
drivers/gpu/drm/radeon/evergreen.c+5−2
@@ -2266,8 +2266,11 @@ static void evergreen_program_watermarks(struct radeon_device *rdev, · 2265 unmodified lines
2266 fixed20_12 a, b, c;2266 fixed20_12 a, b, c;
2267 2267
2268 if (radeon_crtc->base.enabled && num_heads && mode) {2268 if (radeon_crtc->base.enabled && num_heads && mode) {
2269 active_time = 1000000UL * (u32)mode->crtc_hdisplay / (u32)mode->clock;2269 active_time = (u32) div_u64((u64)mode->crtc_hdisplay * 1000000,
2270 line_time = min((u32) (1000000UL * (u32)mode->crtc_htotal / (u32)mode->clock), (u32)65535);2270 (u32)mode->clock);
2271 line_time = (u32) div_u64((u64)mode->crtc_htotal * 1000000,
2272 (u32)mode->clock);
2273 line_time = min(line_time, (u32)65535);
2271 priority_a_cnt = 0;2274 priority_a_cnt = 0;
2272 priority_b_cnt = 0;2275 priority_b_cnt = 0;
2273 dram_channels = evergreen_get_number_of_dram_channels(rdev);2276 dram_channels = evergreen_get_number_of_dram_channels(rdev);
drivers/gpu/drm/radeon/radeon_uvd.c+1−1
@@ -621,7 +621,7 @@ static int radeon_uvd_cs_reloc(struct radeon_cs_parser *p, · 620 unmodified lines
621 }621 }
622 622
623 /* TODO: is this still necessary on NI+ ? */623 /* TODO: is this still necessary on NI+ ? */
624 if ((cmd == 0 || cmd == 1 || cmd == 0x3) &&624 if ((cmd == 0 || cmd == 0x3) &&
625 (start >> 28) != (p->rdev->uvd.gpu_addr >> 28)) {625 (start >> 28) != (p->rdev->uvd.gpu_addr >> 28)) {
626 DRM_ERROR("msg/fb buffer %LX-%LX out of 256MB segment!\n",626 DRM_ERROR("msg/fb buffer %LX-%LX out of 256MB segment!\n",
627 start, end);627 start, end);
drivers/gpu/drm/radeon/si.c+5−2
@@ -2284,8 +2284,11 @@ static void dce6_program_watermarks(struct radeon_device *rdev, · 2283 unmodified lines
2284 fixed20_12 a, b, c;2284 fixed20_12 a, b, c;
2285 2285
2286 if (radeon_crtc->base.enabled && num_heads && mode) {2286 if (radeon_crtc->base.enabled && num_heads && mode) {
2287 active_time = 1000000UL * (u32)mode->crtc_hdisplay / (u32)mode->clock;2287 active_time = (u32) div_u64((u64)mode->crtc_hdisplay * 1000000,
2288 line_time = min((u32) (1000000UL * (u32)mode->crtc_htotal / (u32)mode->clock), (u32)65535);2288 (u32)mode->clock);
2289 line_time = (u32) div_u64((u64)mode->crtc_htotal * 1000000,
2290 (u32)mode->clock);
2291 line_time = min(line_time, (u32)65535);
2289 priority_a_cnt = 0;2292 priority_a_cnt = 0;
2290 priority_b_cnt = 0;2293 priority_b_cnt = 0;
2291 2294
drivers/gpu/drm/rockchip/analogix_dp-rockchip.c+0−12
@@ -245,8 +245,6 @@ rockchip_dp_drm_encoder_atomic_check(struct drm_encoder *encoder, · 244 unmodified lines
245 struct drm_connector_state *conn_state)245 struct drm_connector_state *conn_state)
246{246{
247 struct rockchip_crtc_state *s = to_rockchip_crtc_state(crtc_state);247 struct rockchip_crtc_state *s = to_rockchip_crtc_state(crtc_state);
248 struct rockchip_dp_device *dp = to_dp(encoder);
249 int ret;
250 248
251 /*249 /*
252 * The hardware IC designed that VOP must output the RGB10 video250 * The hardware IC designed that VOP must output the RGB10 video
@@ -258,16 +256,6 @@ rockchip_dp_drm_encoder_atomic_check(struct drm_encoder *encoder, · 5 unmodified lines
258 256
259 s->output_mode = ROCKCHIP_OUT_MODE_AAAA;257 s->output_mode = ROCKCHIP_OUT_MODE_AAAA;
260 s->output_type = DRM_MODE_CONNECTOR_eDP;258 s->output_type = DRM_MODE_CONNECTOR_eDP;
261 if (dp->data->chip_type == RK3399_EDP) {
262 /*
263 * For RK3399, VOP Lit must code the out mode to RGB888,
264 * VOP Big must code the out mode to RGB10.
265 */
266 ret = drm_of_encoder_active_endpoint_id(dp->dev->of_node,
267 encoder);
268 if (ret > 0)
269 s->output_mode = ROCKCHIP_OUT_MODE_P888;
270 }
271 259
272 return 0;260 return 0;
273}261}
drivers/gpu/drm/rockchip/cdn-dp-core.c+2−7
@@ -615,7 +615,6 @@ static void cdn_dp_encoder_enable(struct drm_encoder *encoder) · 614 unmodified lines
615{615{
616 struct cdn_dp_device *dp = encoder_to_dp(encoder);616 struct cdn_dp_device *dp = encoder_to_dp(encoder);
617 int ret, val;617 int ret, val;
618 struct rockchip_crtc_state *state;
619 618
620 ret = drm_of_encoder_active_endpoint_id(dp->dev->of_node, encoder);619 ret = drm_of_encoder_active_endpoint_id(dp->dev->of_node, encoder);
621 if (ret < 0) {620 if (ret < 0) {
@@ -625,14 +624,10 @@ static void cdn_dp_encoder_enable(struct drm_encoder *encoder) · 3 unmodified lines
625 624
626 DRM_DEV_DEBUG_KMS(dp->dev, "vop %s output to cdn-dp\n",625 DRM_DEV_DEBUG_KMS(dp->dev, "vop %s output to cdn-dp\n",
627 (ret) ? "LIT" : "BIG");626 (ret) ? "LIT" : "BIG");
628 state = to_rockchip_crtc_state(encoder->crtc->state);627 if (ret)
629 if (ret) {
630 val = DP_SEL_VOP_LIT | (DP_SEL_VOP_LIT << 16);628 val = DP_SEL_VOP_LIT | (DP_SEL_VOP_LIT << 16);
631 state->output_mode = ROCKCHIP_OUT_MODE_P888;629 else
632 } else {
633 val = DP_SEL_VOP_LIT << 16;630 val = DP_SEL_VOP_LIT << 16;
634 state->output_mode = ROCKCHIP_OUT_MODE_AAAA;
635 }
636 631
637 ret = cdn_dp_grf_write(dp, GRF_SOC_CON9, val);632 ret = cdn_dp_grf_write(dp, GRF_SOC_CON9, val);
638 if (ret)633 if (ret)
drivers/gpu/drm/rockchip/rockchip_drm_vop.c+8−0
@@ -875,6 +875,7 @@ static bool vop_crtc_mode_fixup(struct drm_crtc *crtc, · 874 unmodified lines
875static void vop_crtc_enable(struct drm_crtc *crtc)875static void vop_crtc_enable(struct drm_crtc *crtc)
876{876{
877 struct vop *vop = to_vop(crtc);877 struct vop *vop = to_vop(crtc);
878 const struct vop_data *vop_data = vop->data;
878 struct rockchip_crtc_state *s = to_rockchip_crtc_state(crtc->state);879 struct rockchip_crtc_state *s = to_rockchip_crtc_state(crtc->state);
879 struct drm_display_mode *adjusted_mode = &crtc->state->adjusted_mode;880 struct drm_display_mode *adjusted_mode = &crtc->state->adjusted_mode;
880 u16 hsync_len = adjusted_mode->hsync_end - adjusted_mode->hsync_start;881 u16 hsync_len = adjusted_mode->hsync_end - adjusted_mode->hsync_start;
@@ -967,6 +968,13 @@ static void vop_crtc_enable(struct drm_crtc *crtc) · 86 unmodified lines
967 DRM_DEV_ERROR(vop->dev, "unsupported connector_type [%d]\n",968 DRM_DEV_ERROR(vop->dev, "unsupported connector_type [%d]\n",
968 s->output_type);969 s->output_type);
969 }970 }
971
972 /*
973 * if vop is not support RGB10 output, need force RGB10 to RGB888.
974 */
975 if (s->output_mode == ROCKCHIP_OUT_MODE_AAAA &&
976 !(vop_data->feature & VOP_FEATURE_OUTPUT_RGB10))
977 s->output_mode = ROCKCHIP_OUT_MODE_P888;
970 VOP_CTRL_SET(vop, out_mode, s->output_mode);978 VOP_CTRL_SET(vop, out_mode, s->output_mode);
971 979
972 VOP_CTRL_SET(vop, htotal_pw, (htotal << 16) | hsync_len);980 VOP_CTRL_SET(vop, htotal_pw, (htotal << 16) | hsync_len);
drivers/gpu/drm/rockchip/rockchip_drm_vop.h+3−0
@@ -142,6 +142,9 @@ struct vop_data { · 141 unmodified lines
142 const struct vop_intr *intr;142 const struct vop_intr *intr;
143 const struct vop_win_data *win;143 const struct vop_win_data *win;
144 unsigned int win_size;144 unsigned int win_size;
145
146#define VOP_FEATURE_OUTPUT_RGB10 BIT(0)
147 u64 feature;
145};148};
146 149
147/* interrupt define */150/* interrupt define */
drivers/gpu/drm/rockchip/rockchip_vop_reg.c+2−0
@@ -275,6 +275,7 @@ static const struct vop_intr rk3288_vop_intr = { · 274 unmodified lines
275static const struct vop_data rk3288_vop = {275static const struct vop_data rk3288_vop = {
276 .init_table = rk3288_init_reg_table,276 .init_table = rk3288_init_reg_table,
277 .table_size = ARRAY_SIZE(rk3288_init_reg_table),277 .table_size = ARRAY_SIZE(rk3288_init_reg_table),
278 .feature = VOP_FEATURE_OUTPUT_RGB10,
278 .intr = &rk3288_vop_intr,279 .intr = &rk3288_vop_intr,
279 .ctrl = &rk3288_ctrl_data,280 .ctrl = &rk3288_ctrl_data,
280 .win = rk3288_vop_win_data,281 .win = rk3288_vop_win_data,
@@ -343,6 +344,7 @@ static const struct vop_reg_data rk3399_init_reg_table[] = { · 62 unmodified lines
343static const struct vop_data rk3399_vop_big = {344static const struct vop_data rk3399_vop_big = {
344 .init_table = rk3399_init_reg_table,345 .init_table = rk3399_init_reg_table,
345 .table_size = ARRAY_SIZE(rk3399_init_reg_table),346 .table_size = ARRAY_SIZE(rk3399_init_reg_table),
347 .feature = VOP_FEATURE_OUTPUT_RGB10,
346 .intr = &rk3399_vop_intr,348 .intr = &rk3399_vop_intr,
347 .ctrl = &rk3399_ctrl_data,349 .ctrl = &rk3399_ctrl_data,
348 /*350 /*
drivers/gpu/drm/tegra/drm.c+5−17
@@ -451,18 +451,6 @@ fail: · 450 unmodified lines
451 451
452 452
453#ifdef CONFIG_DRM_TEGRA_STAGING453#ifdef CONFIG_DRM_TEGRA_STAGING
454static struct tegra_drm_context *
455tegra_drm_file_get_context(struct tegra_drm_file *file, u32 id)
456{
457 struct tegra_drm_context *context;
458
459 mutex_lock(&file->lock);
460 context = idr_find(&file->contexts, id);
461 mutex_unlock(&file->lock);
462
463 return context;
464}
465
466static int tegra_gem_create(struct drm_device *drm, void *data,454static int tegra_gem_create(struct drm_device *drm, void *data,
467 struct drm_file *file)455 struct drm_file *file)
468{456{
@@ -551,7 +539,7 @@ static int tegra_client_open(struct tegra_drm_file *fpriv, · 82 unmodified lines
551 if (err < 0)539 if (err < 0)
552 return err;540 return err;
553 541
554 err = idr_alloc(&fpriv->contexts, context, 0, 0, GFP_KERNEL);542 err = idr_alloc(&fpriv->contexts, context, 1, 0, GFP_KERNEL);
555 if (err < 0) {543 if (err < 0) {
556 client->ops->close_channel(context);544 client->ops->close_channel(context);
557 return err;545 return err;
@@ -606,7 +594,7 @@ static int tegra_close_channel(struct drm_device *drm, void *data, · 48 unmodified lines
606 594
607 mutex_lock(&fpriv->lock);595 mutex_lock(&fpriv->lock);
608 596
609 context = tegra_drm_file_get_context(fpriv, args->context);597 context = idr_find(&fpriv->contexts, args->context);
610 if (!context) {598 if (!context) {
611 err = -EINVAL;599 err = -EINVAL;
612 goto unlock;600 goto unlock;
@@ -631,7 +619,7 @@ static int tegra_get_syncpt(struct drm_device *drm, void *data, · 18 unmodified lines
631 619
632 mutex_lock(&fpriv->lock);620 mutex_lock(&fpriv->lock);
633 621
634 context = tegra_drm_file_get_context(fpriv, args->context);622 context = idr_find(&fpriv->contexts, args->context);
635 if (!context) {623 if (!context) {
636 err = -ENODEV;624 err = -ENODEV;
637 goto unlock;625 goto unlock;
@@ -660,7 +648,7 @@ static int tegra_submit(struct drm_device *drm, void *data, · 22 unmodified lines
660 648
661 mutex_lock(&fpriv->lock);649 mutex_lock(&fpriv->lock);
662 650
663 context = tegra_drm_file_get_context(fpriv, args->context);651 context = idr_find(&fpriv->contexts, args->context);
664 if (!context) {652 if (!context) {
665 err = -ENODEV;653 err = -ENODEV;
666 goto unlock;654 goto unlock;
@@ -685,7 +673,7 @@ static int tegra_get_syncpt_base(struct drm_device *drm, void *data, · 18 unmodified lines
685 673
686 mutex_lock(&fpriv->lock);674 mutex_lock(&fpriv->lock);
687 675
688 context = tegra_drm_file_get_context(fpriv, args->context);676 context = idr_find(&fpriv->contexts, args->context);
689 if (!context) {677 if (!context) {
690 err = -ENODEV;678 err = -ENODEV;
691 goto unlock;679 goto unlock;
drivers/gpu/drm/vmwgfx/vmwgfx_drv.h+2−2
@@ -41,9 +41,9 @@ · 40 unmodified lines
41#include <drm/ttm/ttm_module.h>41#include <drm/ttm/ttm_module.h>
42#include "vmwgfx_fence.h"42#include "vmwgfx_fence.h"
43 43
44#define VMWGFX_DRIVER_DATE "20170221"44#define VMWGFX_DRIVER_DATE "20170607"
45#define VMWGFX_DRIVER_MAJOR 245#define VMWGFX_DRIVER_MAJOR 2
46#define VMWGFX_DRIVER_MINOR 1246#define VMWGFX_DRIVER_MINOR 13
47#define VMWGFX_DRIVER_PATCHLEVEL 047#define VMWGFX_DRIVER_PATCHLEVEL 0
48#define VMWGFX_FILE_PAGE_OFFSET 0x0010000048#define VMWGFX_FILE_PAGE_OFFSET 0x00100000
49#define VMWGFX_FIFO_STATIC_SIZE (1024*1024)49#define VMWGFX_FIFO_STATIC_SIZE (1024*1024)
drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c+2−0
@@ -368,6 +368,8 @@ static void *vmw_local_fifo_reserve(struct vmw_private *dev_priv, · 367 unmodified lines
368 return fifo_state->static_buffer;368 return fifo_state->static_buffer;
369 else {369 else {
370 fifo_state->dynamic_buffer = vmalloc(bytes);370 fifo_state->dynamic_buffer = vmalloc(bytes);
371 if (!fifo_state->dynamic_buffer)
372 goto out_err;
371 return fifo_state->dynamic_buffer;373 return fifo_state->dynamic_buffer;
372 }374 }
373 }375 }
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c+1−114
@@ -274,108 +274,6 @@ void vmw_kms_cursor_post_execbuf(struct vmw_private *dev_priv) · 273 unmodified lines
274}274}
275 275
276 276
277
278/**
279 * vmw_du_cursor_plane_update() - Update cursor image and location
280 *
281 * @plane: plane object to update
282 * @crtc: owning CRTC of @plane
283 * @fb: framebuffer to flip onto plane
284 * @crtc_x: x offset of plane on crtc
285 * @crtc_y: y offset of plane on crtc
286 * @crtc_w: width of plane rectangle on crtc
287 * @crtc_h: height of plane rectangle on crtc
288 * @src_x: Not used
289 * @src_y: Not used
290 * @src_w: Not used
291 * @src_h: Not used
292 *
293 *
294 * RETURNS:
295 * Zero on success, error code on failure
296 */
297int vmw_du_cursor_plane_update(struct drm_plane *plane,
298 struct drm_crtc *crtc,
299 struct drm_framebuffer *fb,
300 int crtc_x, int crtc_y,
301 unsigned int crtc_w,
302 unsigned int crtc_h,
303 uint32_t src_x, uint32_t src_y,
304 uint32_t src_w, uint32_t src_h)
305{
306 struct vmw_private *dev_priv = vmw_priv(crtc->dev);
307 struct vmw_display_unit *du = vmw_crtc_to_du(crtc);
308 struct vmw_surface *surface = NULL;
309 struct vmw_dma_buffer *dmabuf = NULL;
310 s32 hotspot_x, hotspot_y;
311 int ret;
312
313 hotspot_x = du->hotspot_x + fb->hot_x;
314 hotspot_y = du->hotspot_y + fb->hot_y;
315
316 /* A lot of the code assumes this */
317 if (crtc_w != 64 || crtc_h != 64) {
318 ret = -EINVAL;
319 goto out;
320 }
321
322 if (vmw_framebuffer_to_vfb(fb)->dmabuf)
323 dmabuf = vmw_framebuffer_to_vfbd(fb)->buffer;
324 else
325 surface = vmw_framebuffer_to_vfbs(fb)->surface;
326
327 if (surface && !surface->snooper.image) {
328 DRM_ERROR("surface not suitable for cursor\n");
329 ret = -EINVAL;
330 goto out;
331 }
332
333 /* setup new image */
334 ret = 0;
335 if (surface) {
336 /* vmw_user_surface_lookup takes one reference */
337 du->cursor_surface = surface;
338
339 du->cursor_age = du->cursor_surface->snooper.age;
340
341 ret = vmw_cursor_update_image(dev_priv, surface->snooper.image,
342 64, 64, hotspot_x, hotspot_y);
343 } else if (dmabuf) {
344 /* vmw_user_surface_lookup takes one reference */
345 du->cursor_dmabuf = dmabuf;
346
347 ret = vmw_cursor_update_dmabuf(dev_priv, dmabuf, crtc_w, crtc_h,
348 hotspot_x, hotspot_y);
349 } else {
350 vmw_cursor_update_position(dev_priv, false, 0, 0);
351 goto out;
352 }
353
354 if (!ret) {
355 du->cursor_x = crtc_x + du->set_gui_x;
356 du->cursor_y = crtc_y + du->set_gui_y;
357
358 vmw_cursor_update_position(dev_priv, true,
359 du->cursor_x + hotspot_x,
360 du->cursor_y + hotspot_y);
361 }
362
363out:
364 return ret;
365}
366
367
368int vmw_du_cursor_plane_disable(struct drm_plane *plane)
369{
370 if (plane->fb) {
371 drm_framebuffer_unreference(plane->fb);
372 plane->fb = NULL;
373 }
374
375 return -EINVAL;
376}
377
378
379void vmw_du_cursor_plane_destroy(struct drm_plane *plane)277void vmw_du_cursor_plane_destroy(struct drm_plane *plane)
380{278{
381 vmw_cursor_update_position(plane->dev->dev_private, false, 0, 0);279 vmw_cursor_update_position(plane->dev->dev_private, false, 0, 0);
@@ -472,18 +370,6 @@ vmw_du_cursor_plane_prepare_fb(struct drm_plane *plane, · 90 unmodified lines
472}370}
473 371
474 372
475void
476vmw_du_cursor_plane_atomic_disable(struct drm_plane *plane,
477 struct drm_plane_state *old_state)
478{
479 struct drm_crtc *crtc = plane->state->crtc ?: old_state->crtc;
480 struct vmw_private *dev_priv = vmw_priv(crtc->dev);
481
482 drm_atomic_set_fb_for_plane(plane->state, NULL);
483 vmw_cursor_update_position(dev_priv, false, 0, 0);
484}
485
486
487void373void
488vmw_du_cursor_plane_atomic_update(struct drm_plane *plane,374vmw_du_cursor_plane_atomic_update(struct drm_plane *plane,
489 struct drm_plane_state *old_state)375 struct drm_plane_state *old_state)
@@ -1498,6 +1384,7 @@ vmw_kms_new_framebuffer(struct vmw_private *dev_priv, · 1008 unmodified lines
1498 */1384 */
1499 if (vmw_kms_srf_ok(dev_priv, mode_cmd->width, mode_cmd->height) &&1385 if (vmw_kms_srf_ok(dev_priv, mode_cmd->width, mode_cmd->height) &&
1500 dmabuf && only_2d &&1386 dmabuf && only_2d &&
1387 mode_cmd->width > 64 && /* Don't create a proxy for cursor */
1501 dev_priv->active_display_unit == vmw_du_screen_target) {1388 dev_priv->active_display_unit == vmw_du_screen_target) {
1502 ret = vmw_create_dmabuf_proxy(dev_priv->dev, mode_cmd,1389 ret = vmw_create_dmabuf_proxy(dev_priv->dev, mode_cmd,
1503 dmabuf, &surface);1390 dmabuf, &surface);
drivers/gpu/drm/vmwgfx/vmwgfx_kms.h+0−15
@@ -256,10 +256,6 @@ int vmw_du_crtc_gamma_set(struct drm_crtc *crtc, · 255 unmodified lines
256 u16 *r, u16 *g, u16 *b,256 u16 *r, u16 *g, u16 *b,
257 uint32_t size,257 uint32_t size,
258 struct drm_modeset_acquire_ctx *ctx);258 struct drm_modeset_acquire_ctx *ctx);
259int vmw_du_crtc_cursor_set2(struct drm_crtc *crtc, struct drm_file *file_priv,
260 uint32_t handle, uint32_t width, uint32_t height,
261 int32_t hot_x, int32_t hot_y);
262int vmw_du_crtc_cursor_move(struct drm_crtc *crtc, int x, int y);
263int vmw_du_connector_set_property(struct drm_connector *connector,259int vmw_du_connector_set_property(struct drm_connector *connector,
264 struct drm_property *property,260 struct drm_property *property,
265 uint64_t val);261 uint64_t val);
@@ -339,15 +335,6 @@ void vmw_kms_create_implicit_placement_property(struct vmw_private *dev_priv, · 73 unmodified lines
339/* Universal Plane Helpers */335/* Universal Plane Helpers */
340void vmw_du_primary_plane_destroy(struct drm_plane *plane);336void vmw_du_primary_plane_destroy(struct drm_plane *plane);
341void vmw_du_cursor_plane_destroy(struct drm_plane *plane);337void vmw_du_cursor_plane_destroy(struct drm_plane *plane);
342int vmw_du_cursor_plane_disable(struct drm_plane *plane);
343int vmw_du_cursor_plane_update(struct drm_plane *plane,
344 struct drm_crtc *crtc,
345 struct drm_framebuffer *fb,
346 int crtc_x, int crtc_y,
347 unsigned int crtc_w,
348 unsigned int crtc_h,
349 uint32_t src_x, uint32_t src_y,
350 uint32_t src_w, uint32_t src_h);
351 338
352/* Atomic Helpers */339/* Atomic Helpers */
353int vmw_du_primary_plane_atomic_check(struct drm_plane *plane,340int vmw_du_primary_plane_atomic_check(struct drm_plane *plane,
@@ -356,8 +343,6 @@ int vmw_du_cursor_plane_atomic_check(struct drm_plane *plane, · 2 unmodified lines
356 struct drm_plane_state *state);343 struct drm_plane_state *state);
357void vmw_du_cursor_plane_atomic_update(struct drm_plane *plane,344void vmw_du_cursor_plane_atomic_update(struct drm_plane *plane,
358 struct drm_plane_state *old_state);345 struct drm_plane_state *old_state);
359void vmw_du_cursor_plane_atomic_disable(struct drm_plane *plane,
360 struct drm_plane_state *old_state);
361int vmw_du_cursor_plane_prepare_fb(struct drm_plane *plane,346int vmw_du_cursor_plane_prepare_fb(struct drm_plane *plane,
362 struct drm_plane_state *new_state);347 struct drm_plane_state *new_state);
363void vmw_du_plane_cleanup_fb(struct drm_plane *plane,348void vmw_du_plane_cleanup_fb(struct drm_plane *plane,
drivers/gpu/drm/vmwgfx/vmwgfx_stdu.c+22−5
@@ -56,6 +56,8 @@ enum stdu_content_type { · 55 unmodified lines
56 * @right: Right side of bounding box.56 * @right: Right side of bounding box.
57 * @top: Top side of bounding box.57 * @top: Top side of bounding box.
58 * @bottom: Bottom side of bounding box.58 * @bottom: Bottom side of bounding box.
59 * @fb_left: Left side of the framebuffer/content bounding box
60 * @fb_top: Top of the framebuffer/content bounding box
59 * @buf: DMA buffer when DMA-ing between buffer and screen targets.61 * @buf: DMA buffer when DMA-ing between buffer and screen targets.
60 * @sid: Surface ID when copying between surface and screen targets.62 * @sid: Surface ID when copying between surface and screen targets.
61 */63 */
@@ -63,6 +65,7 @@ struct vmw_stdu_dirty { · 1 unmodified line
63 struct vmw_kms_dirty base;65 struct vmw_kms_dirty base;
64 SVGA3dTransferType transfer;66 SVGA3dTransferType transfer;
65 s32 left, right, top, bottom;67 s32 left, right, top, bottom;
68 s32 fb_left, fb_top;
66 u32 pitch;69 u32 pitch;
67 union {70 union {
68 struct vmw_dma_buffer *buf;71 struct vmw_dma_buffer *buf;
@@ -647,7 +650,7 @@ static void vmw_stdu_dmabuf_fifo_commit(struct vmw_kms_dirty *dirty) · 578 unmodified lines
647 *650 *
648 * @dirty: The closure structure.651 * @dirty: The closure structure.
649 *652 *
650 * This function calculates the bounding box for all the incoming clips653 * This function calculates the bounding box for all the incoming clips.
651 */654 */
652static void vmw_stdu_dmabuf_cpu_clip(struct vmw_kms_dirty *dirty)655static void vmw_stdu_dmabuf_cpu_clip(struct vmw_kms_dirty *dirty)
653{656{
@@ -656,11 +659,19 @@ static void vmw_stdu_dmabuf_cpu_clip(struct vmw_kms_dirty *dirty) · 2 unmodified lines
656 659
657 dirty->num_hits = 1;660 dirty->num_hits = 1;
658 661
659 /* Calculate bounding box */662 /* Calculate destination bounding box */
660 ddirty->left = min_t(s32, ddirty->left, dirty->unit_x1);663 ddirty->left = min_t(s32, ddirty->left, dirty->unit_x1);
661 ddirty->top = min_t(s32, ddirty->top, dirty->unit_y1);664 ddirty->top = min_t(s32, ddirty->top, dirty->unit_y1);
662 ddirty->right = max_t(s32, ddirty->right, dirty->unit_x2);665 ddirty->right = max_t(s32, ddirty->right, dirty->unit_x2);
663 ddirty->bottom = max_t(s32, ddirty->bottom, dirty->unit_y2);666 ddirty->bottom = max_t(s32, ddirty->bottom, dirty->unit_y2);
667
668 /*
669 * Calculate content bounding box. We only need the top-left
670 * coordinate because width and height will be the same as the
671 * destination bounding box above
672 */
673 ddirty->fb_left = min_t(s32, ddirty->fb_left, dirty->fb_x);
674 ddirty->fb_top = min_t(s32, ddirty->fb_top, dirty->fb_y);
664}675}
665 676
666 677
@@ -697,11 +708,11 @@ static void vmw_stdu_dmabuf_cpu_commit(struct vmw_kms_dirty *dirty) · 30 unmodified lines
697 /* Assume we are blitting from Host (display_srf) to Guest (dmabuf) */708 /* Assume we are blitting from Host (display_srf) to Guest (dmabuf) */
698 src_pitch = stdu->display_srf->base_size.width * stdu->cpp;709 src_pitch = stdu->display_srf->base_size.width * stdu->cpp;
699 src = ttm_kmap_obj_virtual(&stdu->host_map, &not_used);710 src = ttm_kmap_obj_virtual(&stdu->host_map, &not_used);
700 src += dirty->unit_y1 * src_pitch + dirty->unit_x1 * stdu->cpp;711 src += ddirty->top * src_pitch + ddirty->left * stdu->cpp;
701 712
702 dst_pitch = ddirty->pitch;713 dst_pitch = ddirty->pitch;
703 dst = ttm_kmap_obj_virtual(&stdu->guest_map, &not_used);714 dst = ttm_kmap_obj_virtual(&stdu->guest_map, &not_used);
704 dst += dirty->fb_y * dst_pitch + dirty->fb_x * stdu->cpp;715 dst += ddirty->fb_top * dst_pitch + ddirty->fb_left * stdu->cpp;
705 716
706 717
707 /* Figure out the real direction */718 /* Figure out the real direction */
@@ -760,7 +771,7 @@ static void vmw_stdu_dmabuf_cpu_commit(struct vmw_kms_dirty *dirty) · 52 unmodified lines
760 }771 }
761 772
762out_cleanup:773out_cleanup:
763 ddirty->left = ddirty->top = S32_MAX;774 ddirty->left = ddirty->top = ddirty->fb_left = ddirty->fb_top = S32_MAX;
764 ddirty->right = ddirty->bottom = S32_MIN;775 ddirty->right = ddirty->bottom = S32_MIN;
765}776}
766 777
@@ -812,6 +823,7 @@ int vmw_kms_stdu_dma(struct vmw_private *dev_priv, · 45 unmodified lines
812 SVGA3D_READ_HOST_VRAM;823 SVGA3D_READ_HOST_VRAM;
813 ddirty.left = ddirty.top = S32_MAX;824 ddirty.left = ddirty.top = S32_MAX;
814 ddirty.right = ddirty.bottom = S32_MIN;825 ddirty.right = ddirty.bottom = S32_MIN;
826 ddirty.fb_left = ddirty.fb_top = S32_MAX;
815 ddirty.pitch = vfb->base.pitches[0];827 ddirty.pitch = vfb->base.pitches[0];
816 ddirty.buf = buf;828 ddirty.buf = buf;
817 ddirty.base.fifo_commit = vmw_stdu_dmabuf_fifo_commit;829 ddirty.base.fifo_commit = vmw_stdu_dmabuf_fifo_commit;
@@ -1355,6 +1367,11 @@ vmw_stdu_primary_plane_atomic_update(struct drm_plane *plane, · 537 unmodified lines
1355 DRM_ERROR("Failed to bind surface to STDU.\n");1367 DRM_ERROR("Failed to bind surface to STDU.\n");
1356 else1368 else
1357 crtc->primary->fb = plane->state->fb;1369 crtc->primary->fb = plane->state->fb;
1370
1371 ret = vmw_stdu_update_st(dev_priv, stdu);
1372
1373 if (ret)
1374 DRM_ERROR("Failed to update STDU.\n");
1358}1375}
1359 1376
1360 1377
drivers/gpu/drm/vmwgfx/vmwgfx_surface.c+15−8
@@ -1274,11 +1274,14 @@ int vmw_gb_surface_define_ioctl(struct drm_device *dev, void *data, · 1273 unmodified lines
1274 struct ttm_object_file *tfile = vmw_fpriv(file_priv)->tfile;1274 struct ttm_object_file *tfile = vmw_fpriv(file_priv)->tfile;
1275 int ret;1275 int ret;
1276 uint32_t size;1276 uint32_t size;
1277 uint32_t backup_handle;1277 uint32_t backup_handle = 0;
1278 1278
1279 if (req->multisample_count != 0)1279 if (req->multisample_count != 0)
1280 return -EINVAL;1280 return -EINVAL;
1281 1281
1282 if (req->mip_levels > DRM_VMW_MAX_MIP_LEVELS)
1283 return -EINVAL;
1284
1282 if (unlikely(vmw_user_surface_size == 0))1285 if (unlikely(vmw_user_surface_size == 0))
1283 vmw_user_surface_size = ttm_round_pot(sizeof(*user_srf)) +1286 vmw_user_surface_size = ttm_round_pot(sizeof(*user_srf)) +
1284 128;1287 128;
@@ -1314,12 +1317,16 @@ int vmw_gb_surface_define_ioctl(struct drm_device *dev, void *data, · 29 unmodified lines
1314 ret = vmw_user_dmabuf_lookup(tfile, req->buffer_handle,1317 ret = vmw_user_dmabuf_lookup(tfile, req->buffer_handle,
1315 &res->backup,1318 &res->backup,
1316 &user_srf->backup_base);1319 &user_srf->backup_base);
1317 if (ret == 0 && res->backup->base.num_pages * PAGE_SIZE <1320 if (ret == 0) {
1318 res->backup_size) {1321 if (res->backup->base.num_pages * PAGE_SIZE <
1319 DRM_ERROR("Surface backup buffer is too small.\n");1322 res->backup_size) {
1320 vmw_dmabuf_unreference(&res->backup);1323 DRM_ERROR("Surface backup buffer is too small.\n");
1321 ret = -EINVAL;1324 vmw_dmabuf_unreference(&res->backup);
1322 goto out_unlock;1325 ret = -EINVAL;
1326 goto out_unlock;
1327 } else {
1328 backup_handle = req->buffer_handle;
1329 }
1323 }1330 }
1324 } else if (req->drm_surface_flags & drm_vmw_surface_flag_create_buffer)1331 } else if (req->drm_surface_flags & drm_vmw_surface_flag_create_buffer)
1325 ret = vmw_user_dmabuf_alloc(dev_priv, tfile,1332 ret = vmw_user_dmabuf_alloc(dev_priv, tfile,
@@ -1491,7 +1498,7 @@ int vmw_surface_gb_priv_define(struct drm_device *dev, · 165 unmodified lines
1491 dev_priv->stdu_max_height);1498 dev_priv->stdu_max_height);
1492 1499
1493 if (size.width > max_width || size.height > max_height) {1500 if (size.width > max_width || size.height > max_height) {
1494 DRM_ERROR("%ux%u\n, exeeds max surface size %ux%u",1501 DRM_ERROR("%ux%u\n, exceeds max surface size %ux%u",
1495 size.width, size.height,1502 size.width, size.height,
1496 max_width, max_height);1503 max_width, max_height);
1497 return -EINVAL;1504 return -EINVAL;
drivers/gpu/host1x/dev.c+1−1
@@ -172,7 +172,7 @@ static int host1x_probe(struct platform_device *pdev) · 171 unmodified lines
172 172
173 host->rst = devm_reset_control_get(&pdev->dev, "host1x");173 host->rst = devm_reset_control_get(&pdev->dev, "host1x");
174 if (IS_ERR(host->rst)) {174 if (IS_ERR(host->rst)) {
175 err = PTR_ERR(host->clk);175 err = PTR_ERR(host->rst);
176 dev_err(&pdev->dev, "failed to get reset: %d\n", err);176 dev_err(&pdev->dev, "failed to get reset: %d\n", err);
177 return err;177 return err;
178 }178 }
drivers/gpu/ipu-v3/ipu-common.c+8−7
@@ -725,15 +725,16 @@ void ipu_set_ic_src_mux(struct ipu_soc *ipu, int csi_id, bool vdi) · 724 unmodified lines
725 spin_lock_irqsave(&ipu->lock, flags);725 spin_lock_irqsave(&ipu->lock, flags);
726 726
727 val = ipu_cm_read(ipu, IPU_CONF);727 val = ipu_cm_read(ipu, IPU_CONF);
728 if (vdi) {728 if (vdi)
729 val |= IPU_CONF_IC_INPUT;729 val |= IPU_CONF_IC_INPUT;
730 } else {730 else
731 val &= ~IPU_CONF_IC_INPUT;731 val &= ~IPU_CONF_IC_INPUT;
732 if (csi_id == 1)732
733 val |= IPU_CONF_CSI_SEL;733 if (csi_id == 1)
734 else734 val |= IPU_CONF_CSI_SEL;
735 val &= ~IPU_CONF_CSI_SEL;735 else
736 }736 val &= ~IPU_CONF_CSI_SEL;
737
737 ipu_cm_write(ipu, val, IPU_CONF);738 ipu_cm_write(ipu, val, IPU_CONF);
738 739
739 spin_unlock_irqrestore(&ipu->lock, flags);740 spin_unlock_irqrestore(&ipu->lock, flags);
drivers/gpu/ipu-v3/ipu-pre.c+5−8
@@ -131,8 +131,6 @@ int ipu_pre_get(struct ipu_pre *pre) · 130 unmodified lines
131 if (pre->in_use)131 if (pre->in_use)
132 return -EBUSY;132 return -EBUSY;
133 133
134 clk_prepare_enable(pre->clk_axi);
135
136 /* first get the engine out of reset and remove clock gating */134 /* first get the engine out of reset and remove clock gating */
137 writel(0, pre->regs + IPU_PRE_CTRL);135 writel(0, pre->regs + IPU_PRE_CTRL);
138 136
@@ -149,12 +147,7 @@ int ipu_pre_get(struct ipu_pre *pre) · 10 unmodified lines
149 147
150void ipu_pre_put(struct ipu_pre *pre)148void ipu_pre_put(struct ipu_pre *pre)
151{149{
152 u32 val;150 writel(IPU_PRE_CTRL_SFTRST, pre->regs + IPU_PRE_CTRL);
153
154 val = IPU_PRE_CTRL_SFTRST | IPU_PRE_CTRL_CLKGATE;
155 writel(val, pre->regs + IPU_PRE_CTRL);
156
157 clk_disable_unprepare(pre->clk_axi);
158 151
159 pre->in_use = false;152 pre->in_use = false;
160}153}
@@ -249,6 +242,8 @@ static int ipu_pre_probe(struct platform_device *pdev) · 88 unmodified lines
249 if (!pre->buffer_virt)242 if (!pre->buffer_virt)
250 return -ENOMEM;243 return -ENOMEM;
251 244
245 clk_prepare_enable(pre->clk_axi);
246
252 pre->dev = dev;247 pre->dev = dev;
253 platform_set_drvdata(pdev, pre);248 platform_set_drvdata(pdev, pre);
254 mutex_lock(&ipu_pre_list_mutex);249 mutex_lock(&ipu_pre_list_mutex);
@@ -268,6 +263,8 @@ static int ipu_pre_remove(struct platform_device *pdev) · 13 unmodified lines
268 available_pres--;263 available_pres--;
269 mutex_unlock(&ipu_pre_list_mutex);264 mutex_unlock(&ipu_pre_list_mutex);
270 265
266 clk_disable_unprepare(pre->clk_axi);
267
271 if (pre->buffer_virt)268 if (pre->buffer_virt)
272 gen_pool_free(pre->iram, (unsigned long)pre->buffer_virt,269 gen_pool_free(pre->iram, (unsigned long)pre->buffer_virt,
273 IPU_PRE_MAX_WIDTH * IPU_PRE_NUM_SCANLINES * 4);270 IPU_PRE_MAX_WIDTH * IPU_PRE_NUM_SCANLINES * 4);
drivers/hid/Kconfig+4−2
@@ -275,10 +275,12 @@ config HID_EMS_FF · 274 unmodified lines
275 - Trio Linker Plus II275 - Trio Linker Plus II
276 276
277config HID_ELECOM277config HID_ELECOM
278 tristate "ELECOM BM084 bluetooth mouse"278 tristate "ELECOM HID devices"
279 depends on HID279 depends on HID
280 ---help---280 ---help---
281 Support for the ELECOM BM084 (bluetooth mouse).281 Support for ELECOM devices:
282 - BM084 Bluetooth Mouse
283 - DEFT Trackball (Wired and wireless)
282 284
283config HID_ELO285config HID_ELO
284 tristate "ELO USB 4000/4500 touchscreen"286 tristate "ELO USB 4000/4500 touchscreen"
drivers/hid/hid-asus.c+12−0
@@ -69,6 +69,7 @@ MODULE_DESCRIPTION("Asus HID Keyboard and TouchPad"); · 68 unmodified lines
69#define QUIRK_IS_MULTITOUCH BIT(3)69#define QUIRK_IS_MULTITOUCH BIT(3)
70#define QUIRK_NO_CONSUMER_USAGES BIT(4)70#define QUIRK_NO_CONSUMER_USAGES BIT(4)
71#define QUIRK_USE_KBD_BACKLIGHT BIT(5)71#define QUIRK_USE_KBD_BACKLIGHT BIT(5)
72#define QUIRK_T100_KEYBOARD BIT(6)
72 73
73#define I2C_KEYBOARD_QUIRKS (QUIRK_FIX_NOTEBOOK_REPORT | \74#define I2C_KEYBOARD_QUIRKS (QUIRK_FIX_NOTEBOOK_REPORT | \
74 QUIRK_NO_INIT_REPORTS | \75 QUIRK_NO_INIT_REPORTS | \
@@ -536,6 +537,8 @@ static void asus_remove(struct hid_device *hdev) · 461 unmodified lines
536 drvdata->kbd_backlight->removed = true;537 drvdata->kbd_backlight->removed = true;
537 cancel_work_sync(&drvdata->kbd_backlight->work);538 cancel_work_sync(&drvdata->kbd_backlight->work);
538 }539 }
540
541 hid_hw_stop(hdev);
539}542}
540 543
541static __u8 *asus_report_fixup(struct hid_device *hdev, __u8 *rdesc,544static __u8 *asus_report_fixup(struct hid_device *hdev, __u8 *rdesc,
@@ -548,6 +551,12 @@ static __u8 *asus_report_fixup(struct hid_device *hdev, __u8 *rdesc, · 6 unmodified lines
548 hid_info(hdev, "Fixing up Asus notebook report descriptor\n");551 hid_info(hdev, "Fixing up Asus notebook report descriptor\n");
549 rdesc[55] = 0xdd;552 rdesc[55] = 0xdd;
550 }553 }
554 if (drvdata->quirks & QUIRK_T100_KEYBOARD &&
555 *rsize == 76 && rdesc[73] == 0x81 && rdesc[74] == 0x01) {
556 hid_info(hdev, "Fixing up Asus T100 keyb report descriptor\n");
557 rdesc[74] &= ~HID_MAIN_ITEM_CONSTANT;
558 }
559
551 return rdesc;560 return rdesc;
552}561}
553 562
@@ -560,6 +569,9 @@ static const struct hid_device_id asus_devices[] = { · 6 unmodified lines
560 USB_DEVICE_ID_ASUSTEK_ROG_KEYBOARD1) },569 USB_DEVICE_ID_ASUSTEK_ROG_KEYBOARD1) },
561 { HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK,570 { HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK,
562 USB_DEVICE_ID_ASUSTEK_ROG_KEYBOARD2), QUIRK_USE_KBD_BACKLIGHT },571 USB_DEVICE_ID_ASUSTEK_ROG_KEYBOARD2), QUIRK_USE_KBD_BACKLIGHT },
572 { HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK,
573 USB_DEVICE_ID_ASUSTEK_T100_KEYBOARD),
574 QUIRK_T100_KEYBOARD | QUIRK_NO_CONSUMER_USAGES },
563 { }575 { }
564};576};
565MODULE_DEVICE_TABLE(hid, asus_devices);577MODULE_DEVICE_TABLE(hid, asus_devices);
drivers/hid/hid-core.c+224−61
@@ -826,11 +826,35 @@ static int hid_scan_report(struct hid_device *hid) · 825 unmodified lines
826 * hid-rmi should take care of them,826 * hid-rmi should take care of them,
827 * not hid-generic827 * not hid-generic
828 */828 */
829 if (IS_ENABLED(CONFIG_HID_RMI))829 hid->group = HID_GROUP_RMI;
830 hid->group = HID_GROUP_RMI;
831 break;830 break;
832 }831 }
833 832
833 /* fall back to generic driver in case specific driver doesn't exist */
834 switch (hid->group) {
835 case HID_GROUP_MULTITOUCH_WIN_8:
836 /* fall-through */
837 case HID_GROUP_MULTITOUCH:
838 if (!IS_ENABLED(CONFIG_HID_MULTITOUCH))
839 hid->group = HID_GROUP_GENERIC;
840 break;
841 case HID_GROUP_SENSOR_HUB:
842 if (!IS_ENABLED(CONFIG_HID_SENSOR_HUB))
843 hid->group = HID_GROUP_GENERIC;
844 break;
845 case HID_GROUP_RMI:
846 if (!IS_ENABLED(CONFIG_HID_RMI))
847 hid->group = HID_GROUP_GENERIC;
848 break;
849 case HID_GROUP_WACOM:
850 if (!IS_ENABLED(CONFIG_HID_WACOM))
851 hid->group = HID_GROUP_GENERIC;
852 break;
853 case HID_GROUP_LOGITECH_DJ_DEVICE:
854 if (!IS_ENABLED(CONFIG_HID_LOGITECH_DJ))
855 hid->group = HID_GROUP_GENERIC;
856 break;
857 }
834 vfree(parser);858 vfree(parser);
835 return 0;859 return 0;
836}860}
@@ -1763,15 +1787,23 @@ EXPORT_SYMBOL_GPL(hid_disconnect); · 926 unmodified lines
1763 * used as a driver. See hid_scan_report().1787 * used as a driver. See hid_scan_report().
1764 */1788 */
1765static const struct hid_device_id hid_have_special_driver[] = {1789static const struct hid_device_id hid_have_special_driver[] = {
1790#if IS_ENABLED(CONFIG_HID_A4TECH)
1766 { HID_USB_DEVICE(USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_WCP32PU) },1791 { HID_USB_DEVICE(USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_WCP32PU) },
1767 { HID_USB_DEVICE(USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_X5_005D) },1792 { HID_USB_DEVICE(USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_X5_005D) },
1768 { HID_USB_DEVICE(USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_RP_649) },1793 { HID_USB_DEVICE(USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_RP_649) },
1794#endif
1795#if IS_ENABLED(CONFIG_HID_ACCUTOUCH)
1796 { HID_USB_DEVICE(USB_VENDOR_ID_ELO, USB_DEVICE_ID_ELO_ACCUTOUCH_2216) },
1797#endif
1798#if IS_ENABLED(CONFIG_HID_ACRUX)
1769 { HID_USB_DEVICE(USB_VENDOR_ID_ACRUX, 0x0802) },1799 { HID_USB_DEVICE(USB_VENDOR_ID_ACRUX, 0x0802) },
1770 { HID_USB_DEVICE(USB_VENDOR_ID_ACRUX, 0xf705) },1800 { HID_USB_DEVICE(USB_VENDOR_ID_ACRUX, 0xf705) },
1801#endif
1802#if IS_ENABLED(CONFIG_HID_ALPS)
1771 { HID_DEVICE(HID_BUS_ANY, HID_GROUP_ANY, USB_VENDOR_ID_ALPS_JP, HID_DEVICE_ID_ALPS_U1_DUAL) },1803 { HID_DEVICE(HID_BUS_ANY, HID_GROUP_ANY, USB_VENDOR_ID_ALPS_JP, HID_DEVICE_ID_ALPS_U1_DUAL) },
1804#endif
1805#if IS_ENABLED(CONFIG_HID_APPLE)
1772 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MIGHTYMOUSE) },1806 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MIGHTYMOUSE) },
1773 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGICMOUSE) },
1774 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGICTRACKPAD) },
1775 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_ANSI) },1807 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_ANSI) },
1776 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_ISO) },1808 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_ISO) },
1777 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER_ANSI) },1809 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER_ANSI) },
@@ -1792,11 +1824,6 @@ static const struct hid_device_id hid_have_special_driver[] = { · 14 unmodified lines
1792 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_ANSI) },1824 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_ANSI) },
1793 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_ISO) },1825 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_ISO) },
1794 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_JIS) },1826 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER4_HF_JIS) },
1795 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_IRCONTROL) },
1796 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_IRCONTROL2) },
1797 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_IRCONTROL3) },
1798 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_IRCONTROL4) },
1799 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_IRCONTROL5) },
1800 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_ANSI) },1827 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_ANSI) },
1801 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_ISO) },1828 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_ISO) },
1802 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_JIS) },1829 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_JIS) },
@@ -1851,59 +1878,100 @@ static const struct hid_device_id hid_have_special_driver[] = { · 48 unmodified lines
1851 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_ANSI) },1878 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_ANSI) },
1852 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY) },1879 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY) },
1853 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY) },1880 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY) },
1881#endif
1882#if IS_ENABLED(CONFIG_HID_APPLEIR)
1883 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_IRCONTROL) },
1884 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_IRCONTROL2) },
1885 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_IRCONTROL3) },
1886 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_IRCONTROL4) },
1887 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_IRCONTROL5) },
1888#endif
1889#if IS_ENABLED(CONFIG_HID_ASUS)
1854 { HID_I2C_DEVICE(USB_VENDOR_ID_ASUSTEK, USB_DEVICE_ID_ASUSTEK_I2C_KEYBOARD) },1890 { HID_I2C_DEVICE(USB_VENDOR_ID_ASUSTEK, USB_DEVICE_ID_ASUSTEK_I2C_KEYBOARD) },
1855 { HID_I2C_DEVICE(USB_VENDOR_ID_ASUSTEK, USB_DEVICE_ID_ASUSTEK_I2C_TOUCHPAD) },1891 { HID_I2C_DEVICE(USB_VENDOR_ID_ASUSTEK, USB_DEVICE_ID_ASUSTEK_I2C_TOUCHPAD) },
1856 { HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK, USB_DEVICE_ID_ASUSTEK_ROG_KEYBOARD1) },1892 { HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK, USB_DEVICE_ID_ASUSTEK_ROG_KEYBOARD1) },
1857 { HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK, USB_DEVICE_ID_ASUSTEK_ROG_KEYBOARD2) },1893 { HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK, USB_DEVICE_ID_ASUSTEK_ROG_KEYBOARD2) },
1894 { HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK, USB_DEVICE_ID_ASUSTEK_T100_KEYBOARD) },
1895#endif
1896#if IS_ENABLED(CONFIG_HID_AUREAL)
1858 { HID_USB_DEVICE(USB_VENDOR_ID_AUREAL, USB_DEVICE_ID_AUREAL_W01RN) },1897 { HID_USB_DEVICE(USB_VENDOR_ID_AUREAL, USB_DEVICE_ID_AUREAL_W01RN) },
1898#endif
1899#if IS_ENABLED(CONFIG_HID_BELKIN)
1859 { HID_USB_DEVICE(USB_VENDOR_ID_BELKIN, USB_DEVICE_ID_FLIP_KVM) },1900 { HID_USB_DEVICE(USB_VENDOR_ID_BELKIN, USB_DEVICE_ID_FLIP_KVM) },
1901 { HID_USB_DEVICE(USB_VENDOR_ID_LABTEC, USB_DEVICE_ID_LABTEC_WIRELESS_KEYBOARD) },
1902#endif
1903#if IS_ENABLED(CONFIG_HID_BETOP_FF)
1860 { HID_USB_DEVICE(USB_VENDOR_ID_BETOP_2185BFM, 0x2208) },1904 { HID_USB_DEVICE(USB_VENDOR_ID_BETOP_2185BFM, 0x2208) },
1861 { HID_USB_DEVICE(USB_VENDOR_ID_BETOP_2185PC, 0x5506) },1905 { HID_USB_DEVICE(USB_VENDOR_ID_BETOP_2185PC, 0x5506) },
1862 { HID_USB_DEVICE(USB_VENDOR_ID_BETOP_2185V2PC, 0x1850) },1906 { HID_USB_DEVICE(USB_VENDOR_ID_BETOP_2185V2PC, 0x1850) },
1863 { HID_USB_DEVICE(USB_VENDOR_ID_BETOP_2185V2BFM, 0x5500) },1907 { HID_USB_DEVICE(USB_VENDOR_ID_BETOP_2185V2BFM, 0x5500) },
1864 { HID_USB_DEVICE(USB_VENDOR_ID_BTC, USB_DEVICE_ID_BTC_EMPREX_REMOTE) },1908#endif
1865 { HID_USB_DEVICE(USB_VENDOR_ID_BTC, USB_DEVICE_ID_BTC_EMPREX_REMOTE_2) },1909#if IS_ENABLED(CONFIG_HID_CHERRY)
1866 { HID_USB_DEVICE(USB_VENDOR_ID_CHERRY, USB_DEVICE_ID_CHERRY_CYMOTION) },1910 { HID_USB_DEVICE(USB_VENDOR_ID_CHERRY, USB_DEVICE_ID_CHERRY_CYMOTION) },
1867 { HID_USB_DEVICE(USB_VENDOR_ID_CHERRY, USB_DEVICE_ID_CHERRY_CYMOTION_SOLAR) },1911 { HID_USB_DEVICE(USB_VENDOR_ID_CHERRY, USB_DEVICE_ID_CHERRY_CYMOTION_SOLAR) },
1912#endif
1913#if IS_ENABLED(CONFIG_HID_CHICONY)
1868 { HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_TACTICAL_PAD) },1914 { HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_TACTICAL_PAD) },
1869 { HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_WIRELESS) },
1870 { HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_WIRELESS2) },1915 { HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_WIRELESS2) },
1871 { HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_AK1D) },1916 { HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_AK1D) },
1872 { HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_ACER_SWITCH12) },1917 { HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_ACER_SWITCH12) },
1918 { HID_USB_DEVICE(USB_VENDOR_ID_JESS, USB_DEVICE_ID_JESS_ZEN_AIO_KBD) },
1919#endif
1920#if IS_ENABLED(CONFIG_HID_CMEDIA)
1921 { HID_USB_DEVICE(USB_VENDOR_ID_CMEDIA, USB_DEVICE_ID_CM6533) },
1922#endif
1923#if IS_ENABLED(CONFIG_HID_CORSAIR)
1873 { HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_K90) },1924 { HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_K90) },
1874 { HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_SCIMITAR_PRO_RGB) },1925 { HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_SCIMITAR_PRO_RGB) },
1875 { HID_USB_DEVICE(USB_VENDOR_ID_CREATIVELABS, USB_DEVICE_ID_PRODIKEYS_PCMIDI) },1926#endif
1927#if IS_ENABLED(CONFIG_HID_CP2112)
1876 { HID_USB_DEVICE(USB_VENDOR_ID_CYGNAL, USB_DEVICE_ID_CYGNAL_CP2112) },1928 { HID_USB_DEVICE(USB_VENDOR_ID_CYGNAL, USB_DEVICE_ID_CYGNAL_CP2112) },
1929#endif
1930#if IS_ENABLED(CONFIG_HID_CYPRESS)
1877 { HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_BARCODE_1) },1931 { HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_BARCODE_1) },
1878 { HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_BARCODE_2) },1932 { HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_BARCODE_2) },
1879 { HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_BARCODE_3) },1933 { HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_BARCODE_3) },
1880 { HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_BARCODE_4) },1934 { HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_BARCODE_4) },
1881 { HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_MOUSE) },1935 { HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_MOUSE) },
1882 { HID_USB_DEVICE(USB_VENDOR_ID_DELCOM, USB_DEVICE_ID_DELCOM_VISUAL_IND) },1936#endif
1937#if IS_ENABLED(CONFIG_HID_DRAGONRISE)
1883 { HID_USB_DEVICE(USB_VENDOR_ID_DRAGONRISE, 0x0006) },1938 { HID_USB_DEVICE(USB_VENDOR_ID_DRAGONRISE, 0x0006) },
1884 { HID_USB_DEVICE(USB_VENDOR_ID_DRAGONRISE, 0x0011) },1939 { HID_USB_DEVICE(USB_VENDOR_ID_DRAGONRISE, 0x0011) },
1885#if IS_ENABLED(CONFIG_HID_MAYFLASH)
1886 { HID_USB_DEVICE(USB_VENDOR_ID_DRAGONRISE, USB_DEVICE_ID_DRAGONRISE_PS3) },
1887 { HID_USB_DEVICE(USB_VENDOR_ID_DRAGONRISE, USB_DEVICE_ID_DRAGONRISE_DOLPHINBAR) },
1888 { HID_USB_DEVICE(USB_VENDOR_ID_DRAGONRISE, USB_DEVICE_ID_DRAGONRISE_GAMECUBE1) },
1889 { HID_USB_DEVICE(USB_VENDOR_ID_DRAGONRISE, USB_DEVICE_ID_DRAGONRISE_GAMECUBE2) },
1890#endif1940#endif
1891 { HID_USB_DEVICE(USB_VENDOR_ID_DREAM_CHEEKY, USB_DEVICE_ID_DREAM_CHEEKY_WN) },1941#if IS_ENABLED(CONFIG_HID_ELECOM)
1892 { HID_USB_DEVICE(USB_VENDOR_ID_DREAM_CHEEKY, USB_DEVICE_ID_DREAM_CHEEKY_FA) },
1893 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_BM084) },1942 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_BM084) },
1943 { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_DEFT_WIRED) },
1944 { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_DEFT_WIRELESS) },
1945#endif
1946#if IS_ENABLED(CONFIG_HID_ELO)
1894 { HID_USB_DEVICE(USB_VENDOR_ID_ELO, 0x0009) },1947 { HID_USB_DEVICE(USB_VENDOR_ID_ELO, 0x0009) },
1895 { HID_USB_DEVICE(USB_VENDOR_ID_ELO, 0x0030) },1948 { HID_USB_DEVICE(USB_VENDOR_ID_ELO, 0x0030) },
1896 { HID_USB_DEVICE(USB_VENDOR_ID_ELO, USB_DEVICE_ID_ELO_ACCUTOUCH_2216) },1949#endif
1950#if IS_ENABLED(CONFIG_HID_EMS_FF)
1897 { HID_USB_DEVICE(USB_VENDOR_ID_EMS, USB_DEVICE_ID_EMS_TRIO_LINKER_PLUS_II) },1951 { HID_USB_DEVICE(USB_VENDOR_ID_EMS, USB_DEVICE_ID_EMS_TRIO_LINKER_PLUS_II) },
1952#endif
1953#if IS_ENABLED(CONFIG_HID_EZKEY)
1898 { HID_USB_DEVICE(USB_VENDOR_ID_EZKEY, USB_DEVICE_ID_BTC_8193) },1954 { HID_USB_DEVICE(USB_VENDOR_ID_EZKEY, USB_DEVICE_ID_BTC_8193) },
1899 { HID_USB_DEVICE(USB_VENDOR_ID_GAMERON, USB_DEVICE_ID_GAMERON_DUAL_PSX_ADAPTOR) },1955#endif
1900 { HID_USB_DEVICE(USB_VENDOR_ID_GAMERON, USB_DEVICE_ID_GAMERON_DUAL_PCS_ADAPTOR) },1956#if IS_ENABLED(CONFIG_HID_GEMBIRD)
1901 { HID_USB_DEVICE(USB_VENDOR_ID_GEMBIRD, USB_DEVICE_ID_GEMBIRD_JPD_DUALFORCE2) },1957 { HID_USB_DEVICE(USB_VENDOR_ID_GEMBIRD, USB_DEVICE_ID_GEMBIRD_JPD_DUALFORCE2) },
1902 { HID_USB_DEVICE(USB_VENDOR_ID_GREENASIA, 0x0003) },1958#endif
1959#if IS_ENABLED(CONFIG_HID_GFRM)
1960 { HID_BLUETOOTH_DEVICE(0x58, 0x2000) },
1961 { HID_BLUETOOTH_DEVICE(0x471, 0x2210) },
1962#endif
1963#if IS_ENABLED(CONFIG_HID_GREENASIA)
1903 { HID_USB_DEVICE(USB_VENDOR_ID_GREENASIA, 0x0012) },1964 { HID_USB_DEVICE(USB_VENDOR_ID_GREENASIA, 0x0012) },
1965#endif
1966#if IS_ENABLED(CONFIG_HID_GT683R)
1967 { HID_USB_DEVICE(USB_VENDOR_ID_MSI, USB_DEVICE_ID_MSI_GT683R_LED_PANEL) },
1968#endif
1969#if IS_ENABLED(CONFIG_HID_GYRATION)
1904 { HID_USB_DEVICE(USB_VENDOR_ID_GYRATION, USB_DEVICE_ID_GYRATION_REMOTE) },1970 { HID_USB_DEVICE(USB_VENDOR_ID_GYRATION, USB_DEVICE_ID_GYRATION_REMOTE) },
1905 { HID_USB_DEVICE(USB_VENDOR_ID_GYRATION, USB_DEVICE_ID_GYRATION_REMOTE_2) },1971 { HID_USB_DEVICE(USB_VENDOR_ID_GYRATION, USB_DEVICE_ID_GYRATION_REMOTE_2) },
1906 { HID_USB_DEVICE(USB_VENDOR_ID_GYRATION, USB_DEVICE_ID_GYRATION_REMOTE_3) },1972 { HID_USB_DEVICE(USB_VENDOR_ID_GYRATION, USB_DEVICE_ID_GYRATION_REMOTE_3) },
1973#endif
1974#if IS_ENABLED(CONFIG_HID_HOLTEK)
1907 { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK, USB_DEVICE_ID_HOLTEK_ON_LINE_GRIP) },1975 { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK, USB_DEVICE_ID_HOLTEK_ON_LINE_GRIP) },
1908 { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_KEYBOARD) },1976 { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_KEYBOARD) },
1909 { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A04A) },1977 { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A04A) },
@@ -1912,12 +1980,17 @@ static const struct hid_device_id hid_have_special_driver[] = { · 2 unmodified lines
1912 { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A072) },1980 { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A072) },
1913 { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A081) },1981 { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A081) },
1914 { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A0C2) },1982 { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A0C2) },
1915 { HID_USB_DEVICE(USB_VENDOR_ID_HUION, USB_DEVICE_ID_HUION_TABLET) },1983#endif
1916 { HID_USB_DEVICE(USB_VENDOR_ID_JESS, USB_DEVICE_ID_JESS_ZEN_AIO_KBD) },1984#if IS_ENABLED(CONFIG_HID_ICADE)
1917 { HID_USB_DEVICE(USB_VENDOR_ID_JESS2, USB_DEVICE_ID_JESS2_COLOR_RUMBLE_PAD) },
1918 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ION, USB_DEVICE_ID_ICADE) },1985 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ION, USB_DEVICE_ID_ICADE) },
1986#endif
1987#if IS_ENABLED(CONFIG_HID_KENSINGTON)
1919 { HID_USB_DEVICE(USB_VENDOR_ID_KENSINGTON, USB_DEVICE_ID_KS_SLIMBLADE) },1988 { HID_USB_DEVICE(USB_VENDOR_ID_KENSINGTON, USB_DEVICE_ID_KS_SLIMBLADE) },
1989#endif
1990#if IS_ENABLED(CONFIG_HID_KEYTOUCH)
1920 { HID_USB_DEVICE(USB_VENDOR_ID_KEYTOUCH, USB_DEVICE_ID_KEYTOUCH_IEC) },1991 { HID_USB_DEVICE(USB_VENDOR_ID_KEYTOUCH, USB_DEVICE_ID_KEYTOUCH_IEC) },
1992#endif
1993#if IS_ENABLED(CONFIG_HID_KYE)
1921 { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_GENIUS_GILA_GAMING_MOUSE) },1994 { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_GENIUS_GILA_GAMING_MOUSE) },
1922 { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_GENIUS_MANTICORE) },1995 { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_GENIUS_MANTICORE) },
1923 { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_GENIUS_GX_IMPERATOR) },1996 { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_GENIUS_GX_IMPERATOR) },
@@ -1927,21 +2000,29 @@ static const struct hid_device_id hid_have_special_driver[] = { · 3 unmodified lines
1927 { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_MOUSEPEN_I608X_V2) },2000 { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_MOUSEPEN_I608X_V2) },
1928 { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_EASYPEN_M610X) },2001 { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_EASYPEN_M610X) },
1929 { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_PENSKETCH_M912) },2002 { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_PENSKETCH_M912) },
1930 { HID_USB_DEVICE(USB_VENDOR_ID_LABTEC, USB_DEVICE_ID_LABTEC_WIRELESS_KEYBOARD) },2003#endif
2004#if IS_ENABLED(CONFIG_HID_LCPOWER)
1931 { HID_USB_DEVICE(USB_VENDOR_ID_LCPOWER, USB_DEVICE_ID_LCPOWER_LC1000 ) },2005 { HID_USB_DEVICE(USB_VENDOR_ID_LCPOWER, USB_DEVICE_ID_LCPOWER_LC1000 ) },
2006#endif
2007#if IS_ENABLED(CONFIG_HID_LED)
2008 { HID_USB_DEVICE(USB_VENDOR_ID_DELCOM, USB_DEVICE_ID_DELCOM_VISUAL_IND) },
2009 { HID_USB_DEVICE(USB_VENDOR_ID_DREAM_CHEEKY, USB_DEVICE_ID_DREAM_CHEEKY_WN) },
2010 { HID_USB_DEVICE(USB_VENDOR_ID_DREAM_CHEEKY, USB_DEVICE_ID_DREAM_CHEEKY_FA) },
2011 { HID_USB_DEVICE(USB_VENDOR_ID_MICROCHIP, USB_DEVICE_ID_LUXAFOR) },
2012 { HID_USB_DEVICE(USB_VENDOR_ID_RISO_KAGAKU, USB_DEVICE_ID_RI_KA_WEBMAIL) },
2013 { HID_USB_DEVICE(USB_VENDOR_ID_THINGM, USB_DEVICE_ID_BLINK1) },
2014#endif
1932#if IS_ENABLED(CONFIG_HID_LENOVO)2015#if IS_ENABLED(CONFIG_HID_LENOVO)
1933 { HID_USB_DEVICE(USB_VENDOR_ID_LENOVO, USB_DEVICE_ID_LENOVO_TPKBD) },2016 { HID_USB_DEVICE(USB_VENDOR_ID_LENOVO, USB_DEVICE_ID_LENOVO_TPKBD) },
1934 { HID_USB_DEVICE(USB_VENDOR_ID_LENOVO, USB_DEVICE_ID_LENOVO_CUSBKBD) },2017 { HID_USB_DEVICE(USB_VENDOR_ID_LENOVO, USB_DEVICE_ID_LENOVO_CUSBKBD) },
1935 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LENOVO, USB_DEVICE_ID_LENOVO_CBTKBD) },2018 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LENOVO, USB_DEVICE_ID_LENOVO_CBTKBD) },
1936 { HID_USB_DEVICE(USB_VENDOR_ID_LENOVO, USB_DEVICE_ID_LENOVO_TPPRODOCK) },2019 { HID_USB_DEVICE(USB_VENDOR_ID_LENOVO, USB_DEVICE_ID_LENOVO_TPPRODOCK) },
1937#endif2020#endif
1938 { HID_USB_DEVICE(USB_VENDOR_ID_LG, USB_DEVICE_ID_LG_MELFAS_MT) },2021#if IS_ENABLED(CONFIG_HID_LOGITECH)
1939 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_MX3000_RECEIVER) },2022 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_MX3000_RECEIVER) },
1940 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_S510_RECEIVER) },2023 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_S510_RECEIVER) },
1941 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_S510_RECEIVER_2) },2024 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_S510_RECEIVER_2) },
1942 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_RECEIVER) },2025 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_RECEIVER) },
1943 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_PS3) },
1944 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_T651) },
1945 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_DINOVO_DESKTOP) },2026 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_DINOVO_DESKTOP) },
1946 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_DINOVO_EDGE) },2027 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_DINOVO_EDGE) },
1947 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_DINOVO_MINI) },2028 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_DINOVO_MINI) },
@@ -1954,7 +2035,6 @@ static const struct hid_device_id hid_have_special_driver[] = { · 6 unmodified lines
1954 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_RUMBLEPAD) },2035 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_RUMBLEPAD) },
1955 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_RUMBLEPAD2_2) },2036 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_RUMBLEPAD2_2) },
1956 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_G29_WHEEL) },2037 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_G29_WHEEL) },
1957 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_G920_WHEEL) },
1958 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_WINGMAN_F3D) },2038 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_WINGMAN_F3D) },
1959 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_WINGMAN_FFG ) },2039 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_WINGMAN_FFG ) },
1960 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_FORCE3D_PRO) },2040 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_FORCE3D_PRO) },
@@ -1966,17 +2046,30 @@ static const struct hid_device_id hid_have_special_driver[] = { · 5 unmodified lines
1966 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_DFGT_WHEEL) },2046 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_DFGT_WHEEL) },
1967 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_G25_WHEEL) },2047 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_G25_WHEEL) },
1968 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_G27_WHEEL) },2048 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_G27_WHEEL) },
1969#if IS_ENABLED(CONFIG_HID_LOGITECH_DJ)
1970 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_UNIFYING_RECEIVER) },
1971 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_UNIFYING_RECEIVER_2) },
1972#endif
1973 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_WII_WHEEL) },2049 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_WII_WHEEL) },
1974 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_RUMBLEPAD2) },2050 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_RUMBLEPAD2) },
1975 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_SPACETRAVELLER) },2051 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_SPACETRAVELLER) },
1976 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_SPACENAVIGATOR) },2052 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_SPACENAVIGATOR) },
1977 { HID_USB_DEVICE(USB_VENDOR_ID_MICROCHIP, USB_DEVICE_ID_PICOLCD) },2053#endif
1978 { HID_USB_DEVICE(USB_VENDOR_ID_MICROCHIP, USB_DEVICE_ID_PICOLCD_BOOTLOADER) },2054#if IS_ENABLED(CONFIG_HID_LOGITECH_HIDPP)
1979 { HID_USB_DEVICE(USB_VENDOR_ID_MICROCHIP, USB_DEVICE_ID_LUXAFOR) },2055 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_T651) },
2056 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_G920_WHEEL) },
2057#endif
2058#if IS_ENABLED(CONFIG_HID_LOGITECH_DJ)
2059 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_UNIFYING_RECEIVER) },
2060 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_UNIFYING_RECEIVER_2) },
2061#endif
2062#if IS_ENABLED(CONFIG_HID_MAGICMOUSE)
2063 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGICMOUSE) },
2064 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGICTRACKPAD) },
2065#endif
2066#if IS_ENABLED(CONFIG_HID_MAYFLASH)
2067 { HID_USB_DEVICE(USB_VENDOR_ID_DRAGONRISE, USB_DEVICE_ID_DRAGONRISE_PS3) },
2068 { HID_USB_DEVICE(USB_VENDOR_ID_DRAGONRISE, USB_DEVICE_ID_DRAGONRISE_DOLPHINBAR) },
2069 { HID_USB_DEVICE(USB_VENDOR_ID_DRAGONRISE, USB_DEVICE_ID_DRAGONRISE_GAMECUBE1) },
2070 { HID_USB_DEVICE(USB_VENDOR_ID_DRAGONRISE, USB_DEVICE_ID_DRAGONRISE_GAMECUBE2) },
2071#endif
2072#if IS_ENABLED(CONFIG_HID_MICROSOFT)
1980 { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_COMFORT_MOUSE_4500) },2073 { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_COMFORT_MOUSE_4500) },
1981 { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_COMFORT_KEYBOARD) },2074 { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_COMFORT_KEYBOARD) },
1982 { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_SIDEWINDER_GV) },2075 { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_SIDEWINDER_GV) },
@@ -1992,9 +2085,22 @@ static const struct hid_device_id hid_have_special_driver[] = { · 9 unmodified lines
1992 { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_DIGITAL_MEDIA_600) },2085 { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_DIGITAL_MEDIA_600) },
1993 { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_DIGITAL_MEDIA_3KV1) },2086 { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_DIGITAL_MEDIA_3KV1) },
1994 { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_POWER_COVER) },2087 { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_POWER_COVER) },
2088 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_PRESENTER_8K_BT) },
2089#endif
2090#if IS_ENABLED(CONFIG_HID_MONTEREY)
1995 { HID_USB_DEVICE(USB_VENDOR_ID_MONTEREY, USB_DEVICE_ID_GENIUS_KB29E) },2091 { HID_USB_DEVICE(USB_VENDOR_ID_MONTEREY, USB_DEVICE_ID_GENIUS_KB29E) },
1996 { HID_USB_DEVICE(USB_VENDOR_ID_MSI, USB_DEVICE_ID_MSI_GT683R_LED_PANEL) },2092#endif
2093#if IS_ENABLED(CONFIG_HID_MULTITOUCH)
2094 { HID_USB_DEVICE(USB_VENDOR_ID_LG, USB_DEVICE_ID_LG_MELFAS_MT) },
2095#endif
2096#if IS_ENABLED(CONFIG_HID_WIIMOTE)
2097 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO, USB_DEVICE_ID_NINTENDO_WIIMOTE) },
2098 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO, USB_DEVICE_ID_NINTENDO_WIIMOTE2) },
2099#endif
2100#if IS_ENABLED(CONFIG_HID_NTI)
1997 { HID_USB_DEVICE(USB_VENDOR_ID_NTI, USB_DEVICE_ID_USB_SUN) },2101 { HID_USB_DEVICE(USB_VENDOR_ID_NTI, USB_DEVICE_ID_USB_SUN) },
2102#endif
2103#if IS_ENABLED(CONFIG_HID_NTRIG)
1998 { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN) },2104 { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN) },
1999 { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_1) },2105 { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_1) },
2000 { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_2) },2106 { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_2) },
@@ -2014,13 +2120,41 @@ static const struct hid_device_id hid_have_special_driver[] = { · 13 unmodified lines
2014 { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_16) },2120 { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_16) },
2015 { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_17) },2121 { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_17) },
2016 { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_18) },2122 { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_18) },
2123#endif
2124#if IS_ENABLED(CONFIG_HID_ORTEK)
2017 { HID_USB_DEVICE(USB_VENDOR_ID_ORTEK, USB_DEVICE_ID_ORTEK_PKB1700) },2125 { HID_USB_DEVICE(USB_VENDOR_ID_ORTEK, USB_DEVICE_ID_ORTEK_PKB1700) },
2018 { HID_USB_DEVICE(USB_VENDOR_ID_ORTEK, USB_DEVICE_ID_ORTEK_WKB2000) },2126 { HID_USB_DEVICE(USB_VENDOR_ID_ORTEK, USB_DEVICE_ID_ORTEK_WKB2000) },
2127 { HID_USB_DEVICE(USB_VENDOR_ID_SKYCABLE, USB_DEVICE_ID_SKYCABLE_WIRELESS_PRESENTER) },
2128#endif
2129#if IS_ENABLED(CONFIG_HID_PANTHERLORD)
2130 { HID_USB_DEVICE(USB_VENDOR_ID_GAMERON, USB_DEVICE_ID_GAMERON_DUAL_PSX_ADAPTOR) },
2131 { HID_USB_DEVICE(USB_VENDOR_ID_GAMERON, USB_DEVICE_ID_GAMERON_DUAL_PCS_ADAPTOR) },
2132 { HID_USB_DEVICE(USB_VENDOR_ID_GREENASIA, 0x0003) },
2133 { HID_USB_DEVICE(USB_VENDOR_ID_JESS2, USB_DEVICE_ID_JESS2_COLOR_RUMBLE_PAD) },
2134#endif
2135#if IS_ENABLED(CONFIG_HID_PENMOUNT)
2019 { HID_USB_DEVICE(USB_VENDOR_ID_PENMOUNT, USB_DEVICE_ID_PENMOUNT_6000) },2136 { HID_USB_DEVICE(USB_VENDOR_ID_PENMOUNT, USB_DEVICE_ID_PENMOUNT_6000) },
2137#endif
2138#if IS_ENABLED(CONFIG_HID_PETALYNX)
2020 { HID_USB_DEVICE(USB_VENDOR_ID_PETALYNX, USB_DEVICE_ID_PETALYNX_MAXTER_REMOTE) },2139 { HID_USB_DEVICE(USB_VENDOR_ID_PETALYNX, USB_DEVICE_ID_PETALYNX_MAXTER_REMOTE) },
2140#endif
2141#if IS_ENABLED(CONFIG_HID_PICOLCD)
2142 { HID_USB_DEVICE(USB_VENDOR_ID_MICROCHIP, USB_DEVICE_ID_PICOLCD) },
2143 { HID_USB_DEVICE(USB_VENDOR_ID_MICROCHIP, USB_DEVICE_ID_PICOLCD_BOOTLOADER) },
2144#endif
2145#if IS_ENABLED(CONFIG_HID_PLANTRONICS)
2021 { HID_USB_DEVICE(USB_VENDOR_ID_PLANTRONICS, HID_ANY_ID) },2146 { HID_USB_DEVICE(USB_VENDOR_ID_PLANTRONICS, HID_ANY_ID) },
2147#endif
2148#if IS_ENABLED(CONFIG_HID_PRIMAX)
2022 { HID_USB_DEVICE(USB_VENDOR_ID_PRIMAX, USB_DEVICE_ID_PRIMAX_KEYBOARD) },2149 { HID_USB_DEVICE(USB_VENDOR_ID_PRIMAX, USB_DEVICE_ID_PRIMAX_KEYBOARD) },
2023 { HID_USB_DEVICE(USB_VENDOR_ID_RISO_KAGAKU, USB_DEVICE_ID_RI_KA_WEBMAIL) },2150#endif
2151#if IS_ENABLED(CONFIG_HID_PRODIKEYS)
2152 { HID_USB_DEVICE(USB_VENDOR_ID_CREATIVELABS, USB_DEVICE_ID_PRODIKEYS_PCMIDI) },
2153#endif
2154#if IS_ENABLED(CONFIG_HID_RMI)
2155 { HID_USB_DEVICE(USB_VENDOR_ID_LENOVO, USB_DEVICE_ID_LENOVO_X1_COVER) },
2156 { HID_USB_DEVICE(USB_VENDOR_ID_RAZER, USB_DEVICE_ID_RAZER_BLADE_14) },
2157#endif
2024#if IS_ENABLED(CONFIG_HID_ROCCAT)2158#if IS_ENABLED(CONFIG_HID_ROCCAT)
2025 { HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_ARVO) },2159 { HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_ARVO) },
2026 { HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_ISKU) },2160 { HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_ISKU) },
@@ -2048,9 +2182,21 @@ static const struct hid_device_id hid_have_special_driver[] = { · 21 unmodified lines
2048 { HID_USB_DEVICE(USB_VENDOR_ID_MADCATZ, USB_DEVICE_ID_MADCATZ_RAT5) },2182 { HID_USB_DEVICE(USB_VENDOR_ID_MADCATZ, USB_DEVICE_ID_MADCATZ_RAT5) },
2049 { HID_USB_DEVICE(USB_VENDOR_ID_MADCATZ, USB_DEVICE_ID_MADCATZ_RAT9) },2183 { HID_USB_DEVICE(USB_VENDOR_ID_MADCATZ, USB_DEVICE_ID_MADCATZ_RAT9) },
2050#endif2184#endif
2185#if IS_ENABLED(CONFIG_HID_SAMSUNG)
2051 { HID_USB_DEVICE(USB_VENDOR_ID_SAMSUNG, USB_DEVICE_ID_SAMSUNG_IR_REMOTE) },2186 { HID_USB_DEVICE(USB_VENDOR_ID_SAMSUNG, USB_DEVICE_ID_SAMSUNG_IR_REMOTE) },
2052 { HID_USB_DEVICE(USB_VENDOR_ID_SAMSUNG, USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD_MOUSE) },2187 { HID_USB_DEVICE(USB_VENDOR_ID_SAMSUNG, USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD_MOUSE) },
2053 { HID_USB_DEVICE(USB_VENDOR_ID_SKYCABLE, USB_DEVICE_ID_SKYCABLE_WIRELESS_PRESENTER) },2188#endif
2189#if IS_ENABLED(CONFIG_HID_SMARTJOYPLUS)
2190 { HID_USB_DEVICE(USB_VENDOR_ID_PLAYDOTCOM, USB_DEVICE_ID_PLAYDOTCOM_EMS_USBII) },
2191 { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_SMARTJOY_PLUS) },
2192 { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_SUPER_JOY_BOX_3) },
2193 { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_DUAL_USB_JOYPAD) },
2194 { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP_LTD, USB_DEVICE_ID_SUPER_JOY_BOX_3_PRO) },
2195 { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP_LTD, USB_DEVICE_ID_SUPER_DUAL_BOX_PRO) },
2196 { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP_LTD, USB_DEVICE_ID_SUPER_JOY_BOX_5_PRO) },
2197#endif
2198#if IS_ENABLED(CONFIG_HID_SONY)
2199 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_PS3) },
2054 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SMK, USB_DEVICE_ID_SMK_PS3_BDREMOTE) },2200 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SMK, USB_DEVICE_ID_SMK_PS3_BDREMOTE) },
2055 { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_BUZZ_CONTROLLER) },2201 { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_BUZZ_CONTROLLER) },
2056 { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_WIRELESS_BUZZ_CONTROLLER) },2202 { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_WIRELESS_BUZZ_CONTROLLER) },
@@ -2069,9 +2215,17 @@ static const struct hid_device_id hid_have_special_driver[] = { · 12 unmodified lines
2069 { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_VAIO_VGX_MOUSE) },2215 { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_VAIO_VGX_MOUSE) },
2070 { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_VAIO_VGP_MOUSE) },2216 { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_VAIO_VGP_MOUSE) },
2071 { HID_USB_DEVICE(USB_VENDOR_ID_SINO_LITE, USB_DEVICE_ID_SINO_LITE_CONTROLLER) },2217 { HID_USB_DEVICE(USB_VENDOR_ID_SINO_LITE, USB_DEVICE_ID_SINO_LITE_CONTROLLER) },
2218#endif
2219#if IS_ENABLED(CONFIG_HID_SPEEDLINK)
2220 { HID_USB_DEVICE(USB_VENDOR_ID_X_TENSIONS, USB_DEVICE_ID_SPEEDLINK_VAD_CEZANNE) },
2221#endif
2222#if IS_ENABLED(CONFIG_HID_STEELSERIES)
2072 { HID_USB_DEVICE(USB_VENDOR_ID_STEELSERIES, USB_DEVICE_ID_STEELSERIES_SRWS1) },2223 { HID_USB_DEVICE(USB_VENDOR_ID_STEELSERIES, USB_DEVICE_ID_STEELSERIES_SRWS1) },
2224#endif
2225#if IS_ENABLED(CONFIG_HID_SUNPLUS)
2073 { HID_USB_DEVICE(USB_VENDOR_ID_SUNPLUS, USB_DEVICE_ID_SUNPLUS_WDESKTOP) },2226 { HID_USB_DEVICE(USB_VENDOR_ID_SUNPLUS, USB_DEVICE_ID_SUNPLUS_WDESKTOP) },
2074 { HID_USB_DEVICE(USB_VENDOR_ID_THINGM, USB_DEVICE_ID_BLINK1) },2227#endif
2228#if IS_ENABLED(CONFIG_HID_THRUSTMASTER)
2075 { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb300) },2229 { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb300) },
2076 { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb304) },2230 { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb304) },
2077 { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb323) },2231 { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb323) },
@@ -2080,12 +2234,25 @@ static const struct hid_device_id hid_have_special_driver[] = { · 2 unmodified lines
2080 { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb653) },2234 { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb653) },
2081 { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb654) },2235 { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb654) },
2082 { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb65a) },2236 { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb65a) },
2237#endif
2238#if IS_ENABLED(CONFIG_HID_TIVO)
2083 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_TIVO, USB_DEVICE_ID_TIVO_SLIDE_BT) },2239 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_TIVO, USB_DEVICE_ID_TIVO_SLIDE_BT) },
2084 { HID_USB_DEVICE(USB_VENDOR_ID_TIVO, USB_DEVICE_ID_TIVO_SLIDE) },2240 { HID_USB_DEVICE(USB_VENDOR_ID_TIVO, USB_DEVICE_ID_TIVO_SLIDE) },
2085 { HID_USB_DEVICE(USB_VENDOR_ID_TIVO, USB_DEVICE_ID_TIVO_SLIDE_PRO) },2241 { HID_USB_DEVICE(USB_VENDOR_ID_TIVO, USB_DEVICE_ID_TIVO_SLIDE_PRO) },
2242#endif
2243#if IS_ENABLED(CONFIG_HID_TOPSEED)
2244 { HID_USB_DEVICE(USB_VENDOR_ID_BTC, USB_DEVICE_ID_BTC_EMPREX_REMOTE) },
2245 { HID_USB_DEVICE(USB_VENDOR_ID_BTC, USB_DEVICE_ID_BTC_EMPREX_REMOTE_2) },
2246 { HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_WIRELESS) },
2086 { HID_USB_DEVICE(USB_VENDOR_ID_TOPSEED, USB_DEVICE_ID_TOPSEED_CYBERLINK) },2247 { HID_USB_DEVICE(USB_VENDOR_ID_TOPSEED, USB_DEVICE_ID_TOPSEED_CYBERLINK) },
2087 { HID_USB_DEVICE(USB_VENDOR_ID_TOPSEED2, USB_DEVICE_ID_TOPSEED2_RF_COMBO) },2248 { HID_USB_DEVICE(USB_VENDOR_ID_TOPSEED2, USB_DEVICE_ID_TOPSEED2_RF_COMBO) },
2249#endif
2250#if IS_ENABLED(CONFIG_HID_TWINHAN)
2088 { HID_USB_DEVICE(USB_VENDOR_ID_TWINHAN, USB_DEVICE_ID_TWINHAN_IR_REMOTE) },2251 { HID_USB_DEVICE(USB_VENDOR_ID_TWINHAN, USB_DEVICE_ID_TWINHAN_IR_REMOTE) },
2252#endif
2253#if IS_ENABLED(CONFIG_HID_UCLOGIC)
2254 { HID_USB_DEVICE(USB_VENDOR_ID_HUION, USB_DEVICE_ID_HUION_TABLET) },
2255 { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_HUION_TABLET) },
2089 { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_PF1209) },2256 { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_PF1209) },
2090 { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_WP4030U) },2257 { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_WP4030U) },
2091 { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_WP5540U) },2258 { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_WP5540U) },
@@ -2093,20 +2260,17 @@ static const struct hid_device_id hid_have_special_driver[] = { · 1 unmodified line
2093 { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_WP1062) },2260 { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_WP1062) },
2094 { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_WIRELESS_TABLET_TWHL850) },2261 { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_WIRELESS_TABLET_TWHL850) },
2095 { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_TWHA60) },2262 { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_TABLET_TWHA60) },
2096 { HID_USB_DEVICE(USB_VENDOR_ID_THQ, USB_DEVICE_ID_THQ_PS3_UDRAW) },
2097 { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_YIYNOVA_TABLET) },2263 { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_YIYNOVA_TABLET) },
2098 { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UGEE_TABLET_81) },2264 { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UGEE_TABLET_81) },
2099 { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UGEE_TABLET_45) },2265 { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UGEE_TABLET_45) },
2100 { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_DRAWIMAGE_G3) },2266 { HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_DRAWIMAGE_G3) },
2101 { HID_USB_DEVICE(USB_VENDOR_ID_UGTIZER, USB_DEVICE_ID_UGTIZER_TABLET_GP0610) },
2102 { HID_USB_DEVICE(USB_VENDOR_ID_UGEE, USB_DEVICE_ID_UGEE_TABLET_EX07S) },2267 { HID_USB_DEVICE(USB_VENDOR_ID_UGEE, USB_DEVICE_ID_UGEE_TABLET_EX07S) },
2103 { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_SMARTJOY_PLUS) },2268 { HID_USB_DEVICE(USB_VENDOR_ID_UGTIZER, USB_DEVICE_ID_UGTIZER_TABLET_GP0610) },
2104 { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_SUPER_JOY_BOX_3) },2269#endif
2105 { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_DUAL_USB_JOYPAD) },2270#if IS_ENABLED(CONFIG_HID_UDRAW_PS3)
2106 { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP_LTD, USB_DEVICE_ID_SUPER_JOY_BOX_3_PRO) },2271 { HID_USB_DEVICE(USB_VENDOR_ID_THQ, USB_DEVICE_ID_THQ_PS3_UDRAW) },
2107 { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP_LTD, USB_DEVICE_ID_SUPER_DUAL_BOX_PRO) },2272#endif
2108 { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP_LTD, USB_DEVICE_ID_SUPER_JOY_BOX_5_PRO) },2273#if IS_ENABLED(CONFIG_HID_WALTOP)
2109 { HID_USB_DEVICE(USB_VENDOR_ID_PLAYDOTCOM, USB_DEVICE_ID_PLAYDOTCOM_EMS_USBII) },
2110 { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_SLIM_TABLET_5_8_INCH) },2274 { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_SLIM_TABLET_5_8_INCH) },
2111 { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_SLIM_TABLET_12_1_INCH) },2275 { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_SLIM_TABLET_12_1_INCH) },
2112 { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_Q_PAD) },2276 { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_Q_PAD) },
@@ -2114,19 +2278,18 @@ static const struct hid_device_id hid_have_special_driver[] = { · 1 unmodified line
2114 { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_MEDIA_TABLET_10_6_INCH) },2278 { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_MEDIA_TABLET_10_6_INCH) },
2115 { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_MEDIA_TABLET_14_1_INCH) },2279 { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_MEDIA_TABLET_14_1_INCH) },
2116 { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_SIRIUS_BATTERY_FREE_TABLET) },2280 { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_SIRIUS_BATTERY_FREE_TABLET) },
2117 { HID_USB_DEVICE(USB_VENDOR_ID_X_TENSIONS, USB_DEVICE_ID_SPEEDLINK_VAD_CEZANNE) },2281#endif
2282#if IS_ENABLED(CONFIG_HID_XINMO)
2118 { HID_USB_DEVICE(USB_VENDOR_ID_XIN_MO, USB_DEVICE_ID_XIN_MO_DUAL_ARCADE) },2283 { HID_USB_DEVICE(USB_VENDOR_ID_XIN_MO, USB_DEVICE_ID_XIN_MO_DUAL_ARCADE) },
2119 { HID_USB_DEVICE(USB_VENDOR_ID_XIN_MO, USB_DEVICE_ID_THT_2P_ARCADE) },2284 { HID_USB_DEVICE(USB_VENDOR_ID_XIN_MO, USB_DEVICE_ID_THT_2P_ARCADE) },
2285#endif
2286#if IS_ENABLED(CONFIG_HID_ZEROPLUS)
2120 { HID_USB_DEVICE(USB_VENDOR_ID_ZEROPLUS, 0x0005) },2287 { HID_USB_DEVICE(USB_VENDOR_ID_ZEROPLUS, 0x0005) },
2121 { HID_USB_DEVICE(USB_VENDOR_ID_ZEROPLUS, 0x0030) },2288 { HID_USB_DEVICE(USB_VENDOR_ID_ZEROPLUS, 0x0030) },
2289#endif
2290#if IS_ENABLED(CONFIG_HID_ZYDACRON)
2122 { HID_USB_DEVICE(USB_VENDOR_ID_ZYDACRON, USB_DEVICE_ID_ZYDACRON_REMOTE_CONTROL) },2291 { HID_USB_DEVICE(USB_VENDOR_ID_ZYDACRON, USB_DEVICE_ID_ZYDACRON_REMOTE_CONTROL) },
2123 2292#endif
2124 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_PRESENTER_8K_BT) },
2125 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO, USB_DEVICE_ID_NINTENDO_WIIMOTE) },
2126 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO, USB_DEVICE_ID_NINTENDO_WIIMOTE2) },
2127 { HID_USB_DEVICE(USB_VENDOR_ID_RAZER, USB_DEVICE_ID_RAZER_BLADE_14) },
2128 { HID_USB_DEVICE(USB_VENDOR_ID_CMEDIA, USB_DEVICE_ID_CM6533) },
2129 { HID_USB_DEVICE(USB_VENDOR_ID_LENOVO, USB_DEVICE_ID_LENOVO_X1_COVER) },
2130 { }2293 { }
2131};2294};
2132 2295
drivers/hid/hid-elecom.c+53−9
@@ -1,10 +1,8 @@
1/*1/*
2 * HID driver for Elecom BM084 (bluetooth mouse).2 * HID driver for ELECOM devices.
3 * Removes a non-existing horizontal wheel from
4 * the HID descriptor.
5 * (This module is based on "hid-ortek".)
6 *
7 * Copyright (c) 2010 Richard Nauber <Richard.Nauber@gmail.com>3 * Copyright (c) 2010 Richard Nauber <Richard.Nauber@gmail.com>
4 * Copyright (c) 2016 Yuxuan Shui <yshuiv7@gmail.com>
5 * Copyright (c) 2017 Diego Elio Pettenò <flameeyes@flameeyes.eu>
8 */6 */
9 7
10/*8/*
@@ -23,15 +21,61 @@ · 12 unmodified lines
23static __u8 *elecom_report_fixup(struct hid_device *hdev, __u8 *rdesc,21static __u8 *elecom_report_fixup(struct hid_device *hdev, __u8 *rdesc,
24 unsigned int *rsize)22 unsigned int *rsize)
25{23{
26 if (*rsize >= 48 && rdesc[46] == 0x05 && rdesc[47] == 0x0c) {24 switch (hdev->product) {
27 hid_info(hdev, "Fixing up Elecom BM084 report descriptor\n");25 case USB_DEVICE_ID_ELECOM_BM084:
28 rdesc[47] = 0x00;26 /* The BM084 Bluetooth mouse includes a non-existing horizontal
27 * wheel in the HID descriptor. */
28 if (*rsize >= 48 && rdesc[46] == 0x05 && rdesc[47] == 0x0c) {
29 hid_info(hdev, "Fixing up Elecom BM084 report descriptor\n");
30 rdesc[47] = 0x00;
31 }
32 break;
33 case USB_DEVICE_ID_ELECOM_DEFT_WIRED:
34 case USB_DEVICE_ID_ELECOM_DEFT_WIRELESS:
35 /* The DEFT trackball has eight buttons, but its descriptor only
36 * reports five, disabling the three Fn buttons on the top of
37 * the mouse.
38 *
39 * Apply the following diff to the descriptor:
40 *
41 * Collection (Physical), Collection (Physical),
42 * Report ID (1), Report ID (1),
43 * Report Count (5), -> Report Count (8),
44 * Report Size (1), Report Size (1),
45 * Usage Page (Button), Usage Page (Button),
46 * Usage Minimum (01h), Usage Minimum (01h),
47 * Usage Maximum (05h), -> Usage Maximum (08h),
48 * Logical Minimum (0), Logical Minimum (0),
49 * Logical Maximum (1), Logical Maximum (1),
50 * Input (Variable), Input (Variable),
51 * Report Count (1), -> Report Count (0),
52 * Report Size (3), Report Size (3),
53 * Input (Constant), Input (Constant),
54 * Report Size (16), Report Size (16),
55 * Report Count (2), Report Count (2),
56 * Usage Page (Desktop), Usage Page (Desktop),
57 * Usage (X), Usage (X),
58 * Usage (Y), Usage (Y),
59 * Logical Minimum (-32768), Logical Minimum (-32768),
60 * Logical Maximum (32767), Logical Maximum (32767),
61 * Input (Variable, Relative), Input (Variable, Relative),
62 * End Collection, End Collection,
63 */
64 if (*rsize == 213 && rdesc[13] == 5 && rdesc[21] == 5) {
65 hid_info(hdev, "Fixing up Elecom DEFT Fn buttons\n");
66 rdesc[13] = 8; /* Button/Variable Report Count */
67 rdesc[21] = 8; /* Button/Variable Usage Maximum */
68 rdesc[29] = 0; /* Button/Constant Report Count */
69 }
70 break;
29 }71 }
30 return rdesc;72 return rdesc;
31}73}
32 74
33static const struct hid_device_id elecom_devices[] = {75static const struct hid_device_id elecom_devices[] = {
34 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_BM084)},76 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_BM084) },
77 { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_DEFT_WIRED) },
78 { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_DEFT_WIRELESS) },
35 { }79 { }
36};80};
37MODULE_DEVICE_TABLE(hid, elecom_devices);81MODULE_DEVICE_TABLE(hid, elecom_devices);
drivers/hid/hid-ids.h+3−0
@@ -173,6 +173,7 @@ · 172 unmodified lines
173#define USB_VENDOR_ID_ASUSTEK 0x0b05173#define USB_VENDOR_ID_ASUSTEK 0x0b05
174#define USB_DEVICE_ID_ASUSTEK_LCM 0x1726174#define USB_DEVICE_ID_ASUSTEK_LCM 0x1726
175#define USB_DEVICE_ID_ASUSTEK_LCM2 0x175b175#define USB_DEVICE_ID_ASUSTEK_LCM2 0x175b
176#define USB_DEVICE_ID_ASUSTEK_T100_KEYBOARD 0x17e0
176#define USB_DEVICE_ID_ASUSTEK_I2C_KEYBOARD 0x8585177#define USB_DEVICE_ID_ASUSTEK_I2C_KEYBOARD 0x8585
177#define USB_DEVICE_ID_ASUSTEK_I2C_TOUCHPAD 0x0101178#define USB_DEVICE_ID_ASUSTEK_I2C_TOUCHPAD 0x0101
178#define USB_DEVICE_ID_ASUSTEK_ROG_KEYBOARD1 0x1854179#define USB_DEVICE_ID_ASUSTEK_ROG_KEYBOARD1 0x1854
@@ -358,6 +359,8 @@ · 179 unmodified lines
358 359
359#define USB_VENDOR_ID_ELECOM 0x056e360#define USB_VENDOR_ID_ELECOM 0x056e
360#define USB_DEVICE_ID_ELECOM_BM084 0x0061361#define USB_DEVICE_ID_ELECOM_BM084 0x0061
362#define USB_DEVICE_ID_ELECOM_DEFT_WIRED 0x00fe
363#define USB_DEVICE_ID_ELECOM_DEFT_WIRELESS 0x00ff
361 364
362#define USB_VENDOR_ID_DREAM_CHEEKY 0x1d34365#define USB_VENDOR_ID_DREAM_CHEEKY 0x1d34
363#define USB_DEVICE_ID_DREAM_CHEEKY_WN 0x0004366#define USB_DEVICE_ID_DREAM_CHEEKY_WN 0x0004
drivers/hid/hid-magicmouse.c+8−7
@@ -349,6 +349,7 @@ static int magicmouse_raw_event(struct hid_device *hdev, · 348 unmodified lines
349 349
350 if (input->id.product == USB_DEVICE_ID_APPLE_MAGICMOUSE) {350 if (input->id.product == USB_DEVICE_ID_APPLE_MAGICMOUSE) {
351 magicmouse_emit_buttons(msc, clicks & 3);351 magicmouse_emit_buttons(msc, clicks & 3);
352 input_mt_report_pointer_emulation(input, true);
352 input_report_rel(input, REL_X, x);353 input_report_rel(input, REL_X, x);
353 input_report_rel(input, REL_Y, y);354 input_report_rel(input, REL_Y, y);
354 } else { /* USB_DEVICE_ID_APPLE_MAGICTRACKPAD */355 } else { /* USB_DEVICE_ID_APPLE_MAGICTRACKPAD */
@@ -388,16 +389,16 @@ static int magicmouse_setup_input(struct input_dev *input, struct hid_device *hd · 33 unmodified lines
388 __clear_bit(BTN_RIGHT, input->keybit);389 __clear_bit(BTN_RIGHT, input->keybit);
389 __clear_bit(BTN_MIDDLE, input->keybit);390 __clear_bit(BTN_MIDDLE, input->keybit);
390 __set_bit(BTN_MOUSE, input->keybit);391 __set_bit(BTN_MOUSE, input->keybit);
391 __set_bit(BTN_TOOL_FINGER, input->keybit);
392 __set_bit(BTN_TOOL_DOUBLETAP, input->keybit);
393 __set_bit(BTN_TOOL_TRIPLETAP, input->keybit);
394 __set_bit(BTN_TOOL_QUADTAP, input->keybit);
395 __set_bit(BTN_TOOL_QUINTTAP, input->keybit);
396 __set_bit(BTN_TOUCH, input->keybit);
397 __set_bit(INPUT_PROP_POINTER, input->propbit);
398 __set_bit(INPUT_PROP_BUTTONPAD, input->propbit);392 __set_bit(INPUT_PROP_BUTTONPAD, input->propbit);
399 }393 }
400 394
395 __set_bit(BTN_TOOL_FINGER, input->keybit);
396 __set_bit(BTN_TOOL_DOUBLETAP, input->keybit);
397 __set_bit(BTN_TOOL_TRIPLETAP, input->keybit);
398 __set_bit(BTN_TOOL_QUADTAP, input->keybit);
399 __set_bit(BTN_TOOL_QUINTTAP, input->keybit);
400 __set_bit(BTN_TOUCH, input->keybit);
401 __set_bit(INPUT_PROP_POINTER, input->propbit);
401 402
402 __set_bit(EV_ABS, input->evbit);403 __set_bit(EV_ABS, input->evbit);
403 404
drivers/hid/i2c-hid/i2c-hid.c+13−0
@@ -897,6 +897,15 @@ static int i2c_hid_acpi_pdata(struct i2c_client *client, · 896 unmodified lines
897 return 0;897 return 0;
898}898}
899 899
900static void i2c_hid_acpi_fix_up_power(struct device *dev)
901{
902 acpi_handle handle = ACPI_HANDLE(dev);
903 struct acpi_device *adev;
904
905 if (handle && acpi_bus_get_device(handle, &adev) == 0)
906 acpi_device_fix_up_power(adev);
907}
908
900static const struct acpi_device_id i2c_hid_acpi_match[] = {909static const struct acpi_device_id i2c_hid_acpi_match[] = {
901 {"ACPI0C50", 0 },910 {"ACPI0C50", 0 },
902 {"PNP0C50", 0 },911 {"PNP0C50", 0 },
@@ -909,6 +918,8 @@ static inline int i2c_hid_acpi_pdata(struct i2c_client *client, · 6 unmodified lines
909{918{
910 return -ENODEV;919 return -ENODEV;
911}920}
921
922static inline void i2c_hid_acpi_fix_up_power(struct device *dev) {}
912#endif923#endif
913 924
914#ifdef CONFIG_OF925#ifdef CONFIG_OF
@@ -1030,6 +1041,8 @@ static int i2c_hid_probe(struct i2c_client *client, · 115 unmodified lines
1030 if (ret < 0)1041 if (ret < 0)
1031 goto err_regulator;1042 goto err_regulator;
1032 1043
1044 i2c_hid_acpi_fix_up_power(&client->dev);
1045
1033 pm_runtime_get_noresume(&client->dev);1046 pm_runtime_get_noresume(&client->dev);
1034 pm_runtime_set_active(&client->dev);1047 pm_runtime_set_active(&client->dev);
1035 pm_runtime_enable(&client->dev);1048 pm_runtime_enable(&client->dev);
drivers/hid/wacom_wac.c+23−22
@@ -1571,37 +1571,38 @@ static int wacom_tpc_irq(struct wacom_wac *wacom, size_t len) · 1570 unmodified lines
1571{1571{
1572 unsigned char *data = wacom->data;1572 unsigned char *data = wacom->data;
1573 1573
1574 if (wacom->pen_input)1574 if (wacom->pen_input) {
1575 dev_dbg(wacom->pen_input->dev.parent,1575 dev_dbg(wacom->pen_input->dev.parent,
1576 "%s: received report #%d\n", __func__, data[0]);1576 "%s: received report #%d\n", __func__, data[0]);
1577 else if (wacom->touch_input)1577
1578 if (len == WACOM_PKGLEN_PENABLED ||
1579 data[0] == WACOM_REPORT_PENABLED)
1580 return wacom_tpc_pen(wacom);
1581 }
1582 else if (wacom->touch_input) {
1578 dev_dbg(wacom->touch_input->dev.parent,1583 dev_dbg(wacom->touch_input->dev.parent,
1579 "%s: received report #%d\n", __func__, data[0]);1584 "%s: received report #%d\n", __func__, data[0]);
1580 1585
1581 switch (len) {1586 switch (len) {
1582 case WACOM_PKGLEN_TPC1FG:1587 case WACOM_PKGLEN_TPC1FG:
1583 return wacom_tpc_single_touch(wacom, len);1588 return wacom_tpc_single_touch(wacom, len);
1584 1589
1585 case WACOM_PKGLEN_TPC2FG:1590 case WACOM_PKGLEN_TPC2FG:
1586 return wacom_tpc_mt_touch(wacom);1591 return wacom_tpc_mt_touch(wacom);
1587 1592
1588 case WACOM_PKGLEN_PENABLED:1593 default:
1589 return wacom_tpc_pen(wacom);1594 switch (data[0]) {
1595 case WACOM_REPORT_TPC1FG:
1596 case WACOM_REPORT_TPCHID:
1597 case WACOM_REPORT_TPCST:
1598 case WACOM_REPORT_TPC1FGE:
1599 return wacom_tpc_single_touch(wacom, len);
1590 1600
1591 default:1601 case WACOM_REPORT_TPCMT:
1592 switch (data[0]) {1602 case WACOM_REPORT_TPCMT2:
1593 case WACOM_REPORT_TPC1FG:1603 return wacom_mt_touch(wacom);
1594 case WACOM_REPORT_TPCHID:
1595 case WACOM_REPORT_TPCST:
1596 case WACOM_REPORT_TPC1FGE:
1597 return wacom_tpc_single_touch(wacom, len);
1598
1599 case WACOM_REPORT_TPCMT:
1600 case WACOM_REPORT_TPCMT2:
1601 return wacom_mt_touch(wacom);
1602 1604
1603 case WACOM_REPORT_PENABLED:1605 }
1604 return wacom_tpc_pen(wacom);
1605 }1606 }
1606 }1607 }
1607 1608
drivers/hsi/clients/ssi_protocol.c+1−1
@@ -1066,7 +1066,7 @@ static void ssip_pn_setup(struct net_device *dev) · 1065 unmodified lines
1066 dev->addr_len = 1;1066 dev->addr_len = 1;
1067 dev->tx_queue_len = SSIP_TXQUEUE_LEN;1067 dev->tx_queue_len = SSIP_TXQUEUE_LEN;
1068 1068
1069 dev->destructor = free_netdev;1069 dev->needs_free_netdev = true;
1070 dev->header_ops = &phonet_header_ops;1070 dev->header_ops = &phonet_header_ops;
1071}1071}
1072 1072
drivers/hwmon/Kconfig+1−0
@@ -343,6 +343,7 @@ config SENSORS_ASB100 · 342 unmodified lines
343 343
344config SENSORS_ASPEED344config SENSORS_ASPEED
345 tristate "ASPEED AST2400/AST2500 PWM and Fan tach driver"345 tristate "ASPEED AST2400/AST2500 PWM and Fan tach driver"
346 select REGMAP
346 help347 help
347 This driver provides support for ASPEED AST2400/AST2500 PWM348 This driver provides support for ASPEED AST2400/AST2500 PWM
348 and Fan Tacho controllers.349 and Fan Tacho controllers.
drivers/hwmon/aspeed-pwm-tacho.c+35−30
@@ -7,6 +7,7 @@ · 6 unmodified lines
7 */7 */
8 8
9#include <linux/clk.h>9#include <linux/clk.h>
10#include <linux/errno.h>
10#include <linux/gpio/consumer.h>11#include <linux/gpio/consumer.h>
11#include <linux/delay.h>12#include <linux/delay.h>
12#include <linux/hwmon.h>13#include <linux/hwmon.h>
@@ -494,7 +495,7 @@ static u32 aspeed_get_fan_tach_ch_measure_period(struct aspeed_pwm_tacho_data · 481 unmodified lines
494 return clk / (clk_unit * div_h * div_l * tacho_div * tacho_unit);495 return clk / (clk_unit * div_h * div_l * tacho_div * tacho_unit);
495}496}
496 497
497static u32 aspeed_get_fan_tach_ch_rpm(struct aspeed_pwm_tacho_data *priv,498static int aspeed_get_fan_tach_ch_rpm(struct aspeed_pwm_tacho_data *priv,
498 u8 fan_tach_ch)499 u8 fan_tach_ch)
499{500{
500 u32 raw_data, tach_div, clk_source, sec, val;501 u32 raw_data, tach_div, clk_source, sec, val;
@@ -510,6 +511,9 @@ static u32 aspeed_get_fan_tach_ch_rpm(struct aspeed_pwm_tacho_data *priv, · 9 unmodified lines
510 msleep(sec);511 msleep(sec);
511 512
512 regmap_read(priv->regmap, ASPEED_PTCR_RESULT, &val);513 regmap_read(priv->regmap, ASPEED_PTCR_RESULT, &val);
514 if (!(val & RESULT_STATUS_MASK))
515 return -ETIMEDOUT;
516
513 raw_data = val & RESULT_VALUE_MASK;517 raw_data = val & RESULT_VALUE_MASK;
514 tach_div = priv->type_fan_tach_clock_division[type];518 tach_div = priv->type_fan_tach_clock_division[type];
515 tach_div = 0x4 << (tach_div * 2);519 tach_div = 0x4 << (tach_div * 2);
@@ -561,12 +565,14 @@ static ssize_t show_rpm(struct device *dev, struct device_attribute *attr, · 45 unmodified lines
561{565{
562 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);566 struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
563 int index = sensor_attr->index;567 int index = sensor_attr->index;
564 u32 rpm;568 int rpm;
565 struct aspeed_pwm_tacho_data *priv = dev_get_drvdata(dev);569 struct aspeed_pwm_tacho_data *priv = dev_get_drvdata(dev);
566 570
567 rpm = aspeed_get_fan_tach_ch_rpm(priv, index);571 rpm = aspeed_get_fan_tach_ch_rpm(priv, index);
572 if (rpm < 0)
573 return rpm;
568 574
569 return sprintf(buf, "%u\n", rpm);575 return sprintf(buf, "%d\n", rpm);
570}576}
571 577
572static umode_t pwm_is_visible(struct kobject *kobj,578static umode_t pwm_is_visible(struct kobject *kobj,
@@ -591,24 +597,23 @@ static umode_t fan_dev_is_visible(struct kobject *kobj, · 18 unmodified lines
591 return a->mode;597 return a->mode;
592}598}
593 599
594static SENSOR_DEVICE_ATTR(pwm0, 0644,
595 show_pwm, set_pwm, 0);
596static SENSOR_DEVICE_ATTR(pwm1, 0644,600static SENSOR_DEVICE_ATTR(pwm1, 0644,
597 show_pwm, set_pwm, 1);601 show_pwm, set_pwm, 0);
598static SENSOR_DEVICE_ATTR(pwm2, 0644,602static SENSOR_DEVICE_ATTR(pwm2, 0644,
599 show_pwm, set_pwm, 2);603 show_pwm, set_pwm, 1);
600static SENSOR_DEVICE_ATTR(pwm3, 0644,604static SENSOR_DEVICE_ATTR(pwm3, 0644,
601 show_pwm, set_pwm, 3);605 show_pwm, set_pwm, 2);
602static SENSOR_DEVICE_ATTR(pwm4, 0644,606static SENSOR_DEVICE_ATTR(pwm4, 0644,
603 show_pwm, set_pwm, 4);607 show_pwm, set_pwm, 3);
604static SENSOR_DEVICE_ATTR(pwm5, 0644,608static SENSOR_DEVICE_ATTR(pwm5, 0644,
605 show_pwm, set_pwm, 5);609 show_pwm, set_pwm, 4);
606static SENSOR_DEVICE_ATTR(pwm6, 0644,610static SENSOR_DEVICE_ATTR(pwm6, 0644,
607 show_pwm, set_pwm, 6);611 show_pwm, set_pwm, 5);
608static SENSOR_DEVICE_ATTR(pwm7, 0644,612static SENSOR_DEVICE_ATTR(pwm7, 0644,
613 show_pwm, set_pwm, 6);
614static SENSOR_DEVICE_ATTR(pwm8, 0644,
609 show_pwm, set_pwm, 7);615 show_pwm, set_pwm, 7);
610static struct attribute *pwm_dev_attrs[] = {616static struct attribute *pwm_dev_attrs[] = {
611 &sensor_dev_attr_pwm0.dev_attr.attr,
612 &sensor_dev_attr_pwm1.dev_attr.attr,617 &sensor_dev_attr_pwm1.dev_attr.attr,
613 &sensor_dev_attr_pwm2.dev_attr.attr,618 &sensor_dev_attr_pwm2.dev_attr.attr,
614 &sensor_dev_attr_pwm3.dev_attr.attr,619 &sensor_dev_attr_pwm3.dev_attr.attr,
@@ -616,6 +621,7 @@ static struct attribute *pwm_dev_attrs[] = { · 1 unmodified line
616 &sensor_dev_attr_pwm5.dev_attr.attr,621 &sensor_dev_attr_pwm5.dev_attr.attr,
617 &sensor_dev_attr_pwm6.dev_attr.attr,622 &sensor_dev_attr_pwm6.dev_attr.attr,
618 &sensor_dev_attr_pwm7.dev_attr.attr,623 &sensor_dev_attr_pwm7.dev_attr.attr,
624 &sensor_dev_attr_pwm8.dev_attr.attr,
619 NULL,625 NULL,
620};626};
621 627
@@ -624,40 +630,39 @@ static const struct attribute_group pwm_dev_group = { · 2 unmodified lines
624 .is_visible = pwm_is_visible,630 .is_visible = pwm_is_visible,
625};631};
626 632
627static SENSOR_DEVICE_ATTR(fan0_input, 0444,
628 show_rpm, NULL, 0);
629static SENSOR_DEVICE_ATTR(fan1_input, 0444,633static SENSOR_DEVICE_ATTR(fan1_input, 0444,
630 show_rpm, NULL, 1);634 show_rpm, NULL, 0);
631static SENSOR_DEVICE_ATTR(fan2_input, 0444,635static SENSOR_DEVICE_ATTR(fan2_input, 0444,
632 show_rpm, NULL, 2);636 show_rpm, NULL, 1);
633static SENSOR_DEVICE_ATTR(fan3_input, 0444,637static SENSOR_DEVICE_ATTR(fan3_input, 0444,
634 show_rpm, NULL, 3);638 show_rpm, NULL, 2);
635static SENSOR_DEVICE_ATTR(fan4_input, 0444,639static SENSOR_DEVICE_ATTR(fan4_input, 0444,
636 show_rpm, NULL, 4);640 show_rpm, NULL, 3);
637static SENSOR_DEVICE_ATTR(fan5_input, 0444,641static SENSOR_DEVICE_ATTR(fan5_input, 0444,
638 show_rpm, NULL, 5);642 show_rpm, NULL, 4);
639static SENSOR_DEVICE_ATTR(fan6_input, 0444,643static SENSOR_DEVICE_ATTR(fan6_input, 0444,
640 show_rpm, NULL, 6);644 show_rpm, NULL, 5);
641static SENSOR_DEVICE_ATTR(fan7_input, 0444,645static SENSOR_DEVICE_ATTR(fan7_input, 0444,
642 show_rpm, NULL, 7);646 show_rpm, NULL, 6);
643static SENSOR_DEVICE_ATTR(fan8_input, 0444,647static SENSOR_DEVICE_ATTR(fan8_input, 0444,
644 show_rpm, NULL, 8);648 show_rpm, NULL, 7);
645static SENSOR_DEVICE_ATTR(fan9_input, 0444,649static SENSOR_DEVICE_ATTR(fan9_input, 0444,
646 show_rpm, NULL, 9);650 show_rpm, NULL, 8);
647static SENSOR_DEVICE_ATTR(fan10_input, 0444,651static SENSOR_DEVICE_ATTR(fan10_input, 0444,
648 show_rpm, NULL, 10);652 show_rpm, NULL, 9);
649static SENSOR_DEVICE_ATTR(fan11_input, 0444,653static SENSOR_DEVICE_ATTR(fan11_input, 0444,
650 show_rpm, NULL, 11);654 show_rpm, NULL, 10);
651static SENSOR_DEVICE_ATTR(fan12_input, 0444,655static SENSOR_DEVICE_ATTR(fan12_input, 0444,
652 show_rpm, NULL, 12);656 show_rpm, NULL, 11);
653static SENSOR_DEVICE_ATTR(fan13_input, 0444,657static SENSOR_DEVICE_ATTR(fan13_input, 0444,
654 show_rpm, NULL, 13);658 show_rpm, NULL, 12);
655static SENSOR_DEVICE_ATTR(fan14_input, 0444,659static SENSOR_DEVICE_ATTR(fan14_input, 0444,
656 show_rpm, NULL, 14);660 show_rpm, NULL, 13);
657static SENSOR_DEVICE_ATTR(fan15_input, 0444,661static SENSOR_DEVICE_ATTR(fan15_input, 0444,
662 show_rpm, NULL, 14);
663static SENSOR_DEVICE_ATTR(fan16_input, 0444,
658 show_rpm, NULL, 15);664 show_rpm, NULL, 15);
659static struct attribute *fan_dev_attrs[] = {665static struct attribute *fan_dev_attrs[] = {
660 &sensor_dev_attr_fan0_input.dev_attr.attr,
661 &sensor_dev_attr_fan1_input.dev_attr.attr,666 &sensor_dev_attr_fan1_input.dev_attr.attr,
662 &sensor_dev_attr_fan2_input.dev_attr.attr,667 &sensor_dev_attr_fan2_input.dev_attr.attr,
663 &sensor_dev_attr_fan3_input.dev_attr.attr,668 &sensor_dev_attr_fan3_input.dev_attr.attr,
@@ -673,6 +678,7 @@ static struct attribute *fan_dev_attrs[] = { · 9 unmodified lines
673 &sensor_dev_attr_fan13_input.dev_attr.attr,678 &sensor_dev_attr_fan13_input.dev_attr.attr,
674 &sensor_dev_attr_fan14_input.dev_attr.attr,679 &sensor_dev_attr_fan14_input.dev_attr.attr,
675 &sensor_dev_attr_fan15_input.dev_attr.attr,680 &sensor_dev_attr_fan15_input.dev_attr.attr,
681 &sensor_dev_attr_fan16_input.dev_attr.attr,
676 NULL682 NULL
677};683};
678 684
@@ -802,7 +808,6 @@ static int aspeed_pwm_tacho_probe(struct platform_device *pdev) · 123 unmodified lines
802 if (ret)808 if (ret)
803 return ret;809 return ret;
804 }810 }
805 of_node_put(np);
806 811
807 priv->groups[0] = &pwm_dev_group;812 priv->groups[0] = &pwm_dev_group;
808 priv->groups[1] = &fan_dev_group;813 priv->groups[1] = &fan_dev_group;
drivers/i2c/busses/i2c-ismt.c+1−1
@@ -584,7 +584,7 @@ static int ismt_access(struct i2c_adapter *adap, u16 addr, · 583 unmodified lines
584 584
585 /* unmap the data buffer */585 /* unmap the data buffer */
586 if (dma_size != 0)586 if (dma_size != 0)
587 dma_unmap_single(&adap->dev, dma_addr, dma_size, dma_direction);587 dma_unmap_single(dev, dma_addr, dma_size, dma_direction);
588 588
589 if (unlikely(!time_left)) {589 if (unlikely(!time_left)) {
590 dev_err(dev, "completion wait timed out\n");590 dev_err(dev, "completion wait timed out\n");
drivers/i2c/busses/i2c-rcar.c+1−1
@@ -319,7 +319,7 @@ static void rcar_i2c_dma_unmap(struct rcar_i2c_priv *priv) · 318 unmodified lines
319 rcar_i2c_write(priv, ICFBSCR, TCYC06);319 rcar_i2c_write(priv, ICFBSCR, TCYC06);
320 320
321 dma_unmap_single(chan->device->dev, sg_dma_address(&priv->sg),321 dma_unmap_single(chan->device->dev, sg_dma_address(&priv->sg),
322 priv->msg->len, priv->dma_direction);322 sg_dma_len(&priv->sg), priv->dma_direction);
323 323
324 priv->dma_direction = DMA_NONE;324 priv->dma_direction = DMA_NONE;
325}325}
drivers/iio/adc/bcm_iproc_adc.c+4−4
@@ -143,7 +143,7 @@ static void iproc_adc_reg_dump(struct iio_dev *indio_dev) · 142 unmodified lines
143 iproc_adc_dbg_reg(dev, adc_priv, IPROC_SOFT_BYPASS_DATA);143 iproc_adc_dbg_reg(dev, adc_priv, IPROC_SOFT_BYPASS_DATA);
144}144}
145 145
146static irqreturn_t iproc_adc_interrupt_handler(int irq, void *data)146static irqreturn_t iproc_adc_interrupt_thread(int irq, void *data)
147{147{
148 u32 channel_intr_status;148 u32 channel_intr_status;
149 u32 intr_status;149 u32 intr_status;
@@ -167,7 +167,7 @@ static irqreturn_t iproc_adc_interrupt_handler(int irq, void *data) · 17 unmodified lines
167 return IRQ_NONE;167 return IRQ_NONE;
168}168}
169 169
170static irqreturn_t iproc_adc_interrupt_thread(int irq, void *data)170static irqreturn_t iproc_adc_interrupt_handler(int irq, void *data)
171{171{
172 irqreturn_t retval = IRQ_NONE;172 irqreturn_t retval = IRQ_NONE;
173 struct iproc_adc_priv *adc_priv;173 struct iproc_adc_priv *adc_priv;
@@ -181,7 +181,7 @@ static irqreturn_t iproc_adc_interrupt_thread(int irq, void *data) · 7 unmodified lines
181 adc_priv = iio_priv(indio_dev);181 adc_priv = iio_priv(indio_dev);
182 182
183 regmap_read(adc_priv->regmap, IPROC_INTERRUPT_STATUS, &intr_status);183 regmap_read(adc_priv->regmap, IPROC_INTERRUPT_STATUS, &intr_status);
184 dev_dbg(&indio_dev->dev, "iproc_adc_interrupt_thread(),INTRPT_STS:%x\n",184 dev_dbg(&indio_dev->dev, "iproc_adc_interrupt_handler(),INTRPT_STS:%x\n",
185 intr_status);185 intr_status);
186 186
187 intr_channels = (intr_status & IPROC_ADC_INTR_MASK) >> IPROC_ADC_INTR;187 intr_channels = (intr_status & IPROC_ADC_INTR_MASK) >> IPROC_ADC_INTR;
@@ -566,8 +566,8 @@ static int iproc_adc_probe(struct platform_device *pdev) · 378 unmodified lines
566 }566 }
567 567
568 ret = devm_request_threaded_irq(&pdev->dev, adc_priv->irqno,568 ret = devm_request_threaded_irq(&pdev->dev, adc_priv->irqno,
569 iproc_adc_interrupt_thread,
570 iproc_adc_interrupt_handler,569 iproc_adc_interrupt_handler,
570 iproc_adc_interrupt_thread,
571 IRQF_SHARED, "iproc-adc", indio_dev);571 IRQF_SHARED, "iproc-adc", indio_dev);
572 if (ret) {572 if (ret) {
573 dev_err(&pdev->dev, "request_irq error %d\n", ret);573 dev_err(&pdev->dev, "request_irq error %d\n", ret);
drivers/iio/adc/max9611.c+5−5
@@ -438,10 +438,10 @@ static ssize_t max9611_shunt_resistor_show(struct device *dev, · 437 unmodified lines
438 struct max9611_dev *max9611 = iio_priv(dev_to_iio_dev(dev));438 struct max9611_dev *max9611 = iio_priv(dev_to_iio_dev(dev));
439 unsigned int i, r;439 unsigned int i, r;
440 440
441 i = max9611->shunt_resistor_uohm / 1000;441 i = max9611->shunt_resistor_uohm / 1000000;
442 r = max9611->shunt_resistor_uohm % 1000;442 r = max9611->shunt_resistor_uohm % 1000000;
443 443
444 return sprintf(buf, "%u.%03u\n", i, r);444 return sprintf(buf, "%u.%06u\n", i, r);
445}445}
446 446
447static IIO_DEVICE_ATTR(in_power_shunt_resistor, 0444,447static IIO_DEVICE_ATTR(in_power_shunt_resistor, 0444,
@@ -536,8 +536,8 @@ static int max9611_probe(struct i2c_client *client, · 88 unmodified lines
536 int ret;536 int ret;
537 537
538 indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*max9611));538 indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*max9611));
539 if (IS_ERR(indio_dev))539 if (!indio_dev)
540 return PTR_ERR(indio_dev);540 return -ENOMEM;
541 541
542 i2c_set_clientdata(client, indio_dev);542 i2c_set_clientdata(client, indio_dev);
543 543
drivers/iio/adc/meson_saradc.c+2−2
@@ -468,13 +468,13 @@ static void meson_sar_adc_unlock(struct iio_dev *indio_dev) · 467 unmodified lines
468static void meson_sar_adc_clear_fifo(struct iio_dev *indio_dev)468static void meson_sar_adc_clear_fifo(struct iio_dev *indio_dev)
469{469{
470 struct meson_sar_adc_priv *priv = iio_priv(indio_dev);470 struct meson_sar_adc_priv *priv = iio_priv(indio_dev);
471 int count;471 unsigned int count, tmp;
472 472
473 for (count = 0; count < MESON_SAR_ADC_MAX_FIFO_SIZE; count++) {473 for (count = 0; count < MESON_SAR_ADC_MAX_FIFO_SIZE; count++) {
474 if (!meson_sar_adc_get_fifo_count(indio_dev))474 if (!meson_sar_adc_get_fifo_count(indio_dev))
475 break;475 break;
476 476
477 regmap_read(priv->regmap, MESON_SAR_ADC_FIFO_RD, 0);477 regmap_read(priv->regmap, MESON_SAR_ADC_FIFO_RD, &tmp);
478 }478 }
479}479}
480 480
drivers/iio/adc/mxs-lradc-adc.c+5−2
@@ -718,9 +718,12 @@ static int mxs_lradc_adc_probe(struct platform_device *pdev) · 717 unmodified lines
718 adc->dev = dev;718 adc->dev = dev;
719 719
720 iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);720 iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
721 if (!iores)
722 return -EINVAL;
723
721 adc->base = devm_ioremap(dev, iores->start, resource_size(iores));724 adc->base = devm_ioremap(dev, iores->start, resource_size(iores));
722 if (IS_ERR(adc->base))725 if (!adc->base)
723 return PTR_ERR(adc->base);726 return -ENOMEM;
724 727
725 init_completion(&adc->completion);728 init_completion(&adc->completion);
726 spin_lock_init(&adc->lock);729 spin_lock_init(&adc->lock);
drivers/iio/adc/sun4i-gpadc-iio.c+24−14
@@ -105,6 +105,8 @@ struct sun4i_gpadc_iio { · 104 unmodified lines
105 bool no_irq;105 bool no_irq;
106 /* prevents concurrent reads of temperature and ADC */106 /* prevents concurrent reads of temperature and ADC */
107 struct mutex mutex;107 struct mutex mutex;
108 struct thermal_zone_device *tzd;
109 struct device *sensor_device;
108};110};
109 111
110#define SUN4I_GPADC_ADC_CHANNEL(_channel, _name) { \112#define SUN4I_GPADC_ADC_CHANNEL(_channel, _name) { \
@@ -502,7 +504,6 @@ static int sun4i_gpadc_probe_dt(struct platform_device *pdev, · 391 unmodified lines
502{504{
503 struct sun4i_gpadc_iio *info = iio_priv(indio_dev);505 struct sun4i_gpadc_iio *info = iio_priv(indio_dev);
504 const struct of_device_id *of_dev;506 const struct of_device_id *of_dev;
505 struct thermal_zone_device *tzd;
506 struct resource *mem;507 struct resource *mem;
507 void __iomem *base;508 void __iomem *base;
508 int ret;509 int ret;
@@ -532,13 +533,14 @@ static int sun4i_gpadc_probe_dt(struct platform_device *pdev, · 23 unmodified lines
532 if (!IS_ENABLED(CONFIG_THERMAL_OF))533 if (!IS_ENABLED(CONFIG_THERMAL_OF))
533 return 0;534 return 0;
534 535
535 tzd = devm_thermal_zone_of_sensor_register(&pdev->dev, 0, info,536 info->sensor_device = &pdev->dev;
536 &sun4i_ts_tz_ops);537 info->tzd = thermal_zone_of_sensor_register(info->sensor_device, 0,
537 if (IS_ERR(tzd))538 info, &sun4i_ts_tz_ops);
539 if (IS_ERR(info->tzd))
538 dev_err(&pdev->dev, "could not register thermal sensor: %ld\n",540 dev_err(&pdev->dev, "could not register thermal sensor: %ld\n",
539 PTR_ERR(tzd));541 PTR_ERR(info->tzd));
540 542
541 return PTR_ERR_OR_ZERO(tzd);543 return PTR_ERR_OR_ZERO(info->tzd);
542}544}
543 545
544static int sun4i_gpadc_probe_mfd(struct platform_device *pdev,546static int sun4i_gpadc_probe_mfd(struct platform_device *pdev,
@@ -584,15 +586,15 @@ static int sun4i_gpadc_probe_mfd(struct platform_device *pdev, · 39 unmodified lines
584 * of_node, and the device from this driver as third argument to586 * of_node, and the device from this driver as third argument to
585 * return the temperature.587 * return the temperature.
586 */588 */
587 struct thermal_zone_device *tzd;589 info->sensor_device = pdev->dev.parent;
588 tzd = devm_thermal_zone_of_sensor_register(pdev->dev.parent, 0,590 info->tzd = thermal_zone_of_sensor_register(info->sensor_device,
589 info,591 0, info,
590 &sun4i_ts_tz_ops);592 &sun4i_ts_tz_ops);
591 if (IS_ERR(tzd)) {593 if (IS_ERR(info->tzd)) {
592 dev_err(&pdev->dev,594 dev_err(&pdev->dev,
593 "could not register thermal sensor: %ld\n",595 "could not register thermal sensor: %ld\n",
594 PTR_ERR(tzd));596 PTR_ERR(info->tzd));
595 return PTR_ERR(tzd);597 return PTR_ERR(info->tzd);
596 }598 }
597 } else {599 } else {
598 indio_dev->num_channels =600 indio_dev->num_channels =
@@ -688,7 +690,13 @@ static int sun4i_gpadc_remove(struct platform_device *pdev) · 89 unmodified lines
688 690
689 pm_runtime_put(&pdev->dev);691 pm_runtime_put(&pdev->dev);
690 pm_runtime_disable(&pdev->dev);692 pm_runtime_disable(&pdev->dev);
691 if (!info->no_irq && IS_ENABLED(CONFIG_THERMAL_OF))693
694 if (!IS_ENABLED(CONFIG_THERMAL_OF))
695 return 0;
696
697 thermal_zone_of_sensor_unregister(info->sensor_device, info->tzd);
698
699 if (!info->no_irq)
692 iio_map_array_unregister(indio_dev);700 iio_map_array_unregister(indio_dev);
693 701
694 return 0;702 return 0;
@@ -700,6 +708,7 @@ static const struct platform_device_id sun4i_gpadc_id[] = { · 5 unmodified lines
700 { "sun6i-a31-gpadc-iio", (kernel_ulong_t)&sun6i_gpadc_data },708 { "sun6i-a31-gpadc-iio", (kernel_ulong_t)&sun6i_gpadc_data },
701 { /* sentinel */ },709 { /* sentinel */ },
702};710};
711MODULE_DEVICE_TABLE(platform, sun4i_gpadc_id);
703 712
704static struct platform_driver sun4i_gpadc_driver = {713static struct platform_driver sun4i_gpadc_driver = {
705 .driver = {714 .driver = {
@@ -711,6 +720,7 @@ static struct platform_driver sun4i_gpadc_driver = { · 5 unmodified lines
711 .probe = sun4i_gpadc_probe,720 .probe = sun4i_gpadc_probe,
712 .remove = sun4i_gpadc_remove,721 .remove = sun4i_gpadc_remove,
713};722};
723MODULE_DEVICE_TABLE(of, sun4i_gpadc_of_id);
714 724
715module_platform_driver(sun4i_gpadc_driver);725module_platform_driver(sun4i_gpadc_driver);
716 726
drivers/iio/adc/ti_am335x_adc.c+1−1
@@ -614,7 +614,7 @@ static int tiadc_probe(struct platform_device *pdev) · 613 unmodified lines
614 return -EINVAL;614 return -EINVAL;
615 }615 }
616 616
617 indio_dev = devm_iio_device_alloc(&pdev->dev, sizeof(*indio_dev));617 indio_dev = devm_iio_device_alloc(&pdev->dev, sizeof(*adc_dev));
618 if (indio_dev == NULL) {618 if (indio_dev == NULL) {
619 dev_err(&pdev->dev, "failed to allocate iio device\n");619 dev_err(&pdev->dev, "failed to allocate iio device\n");
620 return -ENOMEM;620 return -ENOMEM;
drivers/iio/buffer/industrialio-buffer-dma.c+1−0
@@ -14,6 +14,7 @@ · 13 unmodified lines
14#include <linux/sched.h>14#include <linux/sched.h>
15#include <linux/poll.h>15#include <linux/poll.h>
16#include <linux/iio/buffer.h>16#include <linux/iio/buffer.h>
17#include <linux/iio/buffer_impl.h>
17#include <linux/iio/buffer-dma.h>18#include <linux/iio/buffer-dma.h>
18#include <linux/dma-mapping.h>19#include <linux/dma-mapping.h>
19#include <linux/sizes.h>20#include <linux/sizes.h>
drivers/iio/buffer/industrialio-buffer-dmaengine.c+1−0
@@ -14,6 +14,7 @@ · 13 unmodified lines
14 14
15#include <linux/iio/iio.h>15#include <linux/iio/iio.h>
16#include <linux/iio/buffer.h>16#include <linux/iio/buffer.h>
17#include <linux/iio/buffer_impl.h>
17#include <linux/iio/buffer-dma.h>18#include <linux/iio/buffer-dma.h>
18#include <linux/iio/buffer-dmaengine.h>19#include <linux/iio/buffer-dmaengine.h>
19 20
drivers/iio/imu/inv_mpu6050/inv_mpu_core.c+36−3
@@ -41,6 +41,7 @@ static const int accel_scale[] = {598, 1196, 2392, 4785}; · 40 unmodified lines
41static const struct inv_mpu6050_reg_map reg_set_6500 = {41static const struct inv_mpu6050_reg_map reg_set_6500 = {
42 .sample_rate_div = INV_MPU6050_REG_SAMPLE_RATE_DIV,42 .sample_rate_div = INV_MPU6050_REG_SAMPLE_RATE_DIV,
43 .lpf = INV_MPU6050_REG_CONFIG,43 .lpf = INV_MPU6050_REG_CONFIG,
44 .accel_lpf = INV_MPU6500_REG_ACCEL_CONFIG_2,
44 .user_ctrl = INV_MPU6050_REG_USER_CTRL,45 .user_ctrl = INV_MPU6050_REG_USER_CTRL,
45 .fifo_en = INV_MPU6050_REG_FIFO_EN,46 .fifo_en = INV_MPU6050_REG_FIFO_EN,
46 .gyro_config = INV_MPU6050_REG_GYRO_CONFIG,47 .gyro_config = INV_MPU6050_REG_GYRO_CONFIG,
@@ -210,6 +211,37 @@ int inv_mpu6050_set_power_itg(struct inv_mpu6050_state *st, bool power_on) · 163 unmodified lines
210}211}
211EXPORT_SYMBOL_GPL(inv_mpu6050_set_power_itg);212EXPORT_SYMBOL_GPL(inv_mpu6050_set_power_itg);
212 213
214/**
215 * inv_mpu6050_set_lpf_regs() - set low pass filter registers, chip dependent
216 *
217 * MPU60xx/MPU9150 use only 1 register for accelerometer + gyroscope
218 * MPU6500 and above have a dedicated register for accelerometer
219 */
220static int inv_mpu6050_set_lpf_regs(struct inv_mpu6050_state *st,
221 enum inv_mpu6050_filter_e val)
222{
223 int result;
224
225 result = regmap_write(st->map, st->reg->lpf, val);
226 if (result)
227 return result;
228
229 switch (st->chip_type) {
230 case INV_MPU6050:
231 case INV_MPU6000:
232 case INV_MPU9150:
233 /* old chips, nothing to do */
234 result = 0;
235 break;
236 default:
237 /* set accel lpf */
238 result = regmap_write(st->map, st->reg->accel_lpf, val);
239 break;
240 }
241
242 return result;
243}
244
213/**245/**
214 * inv_mpu6050_init_config() - Initialize hardware, disable FIFO.246 * inv_mpu6050_init_config() - Initialize hardware, disable FIFO.
215 *247 *
@@ -233,8 +265,7 @@ static int inv_mpu6050_init_config(struct iio_dev *indio_dev) · 17 unmodified lines
233 if (result)265 if (result)
234 return result;266 return result;
235 267
236 d = INV_MPU6050_FILTER_20HZ;268 result = inv_mpu6050_set_lpf_regs(st, INV_MPU6050_FILTER_20HZ);
237 result = regmap_write(st->map, st->reg->lpf, d);
238 if (result)269 if (result)
239 return result;270 return result;
240 271
@@ -537,6 +568,8 @@ error_write_raw: · 296 unmodified lines
537 * would be alising. This function basically search for the568 * would be alising. This function basically search for the
538 * correct low pass parameters based on the fifo rate, e.g,569 * correct low pass parameters based on the fifo rate, e.g,
539 * sampling frequency.570 * sampling frequency.
571 *
572 * lpf is set automatically when setting sampling rate to avoid any aliases.
540 */573 */
541static int inv_mpu6050_set_lpf(struct inv_mpu6050_state *st, int rate)574static int inv_mpu6050_set_lpf(struct inv_mpu6050_state *st, int rate)
542{575{
@@ -552,7 +585,7 @@ static int inv_mpu6050_set_lpf(struct inv_mpu6050_state *st, int rate) · 9 unmodified lines
552 while ((h < hz[i]) && (i < ARRAY_SIZE(d) - 1))585 while ((h < hz[i]) && (i < ARRAY_SIZE(d) - 1))
553 i++;586 i++;
554 data = d[i];587 data = d[i];
555 result = regmap_write(st->map, st->reg->lpf, data);588 result = inv_mpu6050_set_lpf_regs(st, data);
556 if (result)589 if (result)
557 return result;590 return result;
558 st->chip_config.lpf = data;591 st->chip_config.lpf = data;
drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h+3−0
@@ -28,6 +28,7 @@ · 27 unmodified lines
28 * struct inv_mpu6050_reg_map - Notable registers.28 * struct inv_mpu6050_reg_map - Notable registers.
29 * @sample_rate_div: Divider applied to gyro output rate.29 * @sample_rate_div: Divider applied to gyro output rate.
30 * @lpf: Configures internal low pass filter.30 * @lpf: Configures internal low pass filter.
31 * @accel_lpf: Configures accelerometer low pass filter.
31 * @user_ctrl: Enables/resets the FIFO.32 * @user_ctrl: Enables/resets the FIFO.
32 * @fifo_en: Determines which data will appear in FIFO.33 * @fifo_en: Determines which data will appear in FIFO.
33 * @gyro_config: gyro config register.34 * @gyro_config: gyro config register.
@@ -47,6 +48,7 @@ · 13 unmodified lines
47struct inv_mpu6050_reg_map {48struct inv_mpu6050_reg_map {
48 u8 sample_rate_div;49 u8 sample_rate_div;
49 u8 lpf;50 u8 lpf;
51 u8 accel_lpf;
50 u8 user_ctrl;52 u8 user_ctrl;
51 u8 fifo_en;53 u8 fifo_en;
52 u8 gyro_config;54 u8 gyro_config;
@@ -188,6 +190,7 @@ struct inv_mpu6050_state { · 135 unmodified lines
188#define INV_MPU6050_FIFO_THRESHOLD 500190#define INV_MPU6050_FIFO_THRESHOLD 500
189 191
190/* mpu6500 registers */192/* mpu6500 registers */
193#define INV_MPU6500_REG_ACCEL_CONFIG_2 0x1D
191#define INV_MPU6500_REG_ACCEL_OFFSET 0x77194#define INV_MPU6500_REG_ACCEL_OFFSET 0x77
192 195
193/* delay time in milliseconds */196/* delay time in milliseconds */
drivers/iio/industrialio-trigger.c+2−1
@@ -451,7 +451,8 @@ static ssize_t iio_trigger_write_current(struct device *dev, · 450 unmodified lines
451 return len;451 return len;
452 452
453out_trigger_put:453out_trigger_put:
454 iio_trigger_put(trig);454 if (trig)
455 iio_trigger_put(trig);
455 return ret;456 return ret;
456}457}
457 458
drivers/iio/light/ltr501.c+2−2
@@ -74,9 +74,9 @@ static const int int_time_mapping[] = {100000, 50000, 200000, 400000}; · 73 unmodified lines
74static const struct reg_field reg_field_it =74static const struct reg_field reg_field_it =
75 REG_FIELD(LTR501_ALS_MEAS_RATE, 3, 4);75 REG_FIELD(LTR501_ALS_MEAS_RATE, 3, 4);
76static const struct reg_field reg_field_als_intr =76static const struct reg_field reg_field_als_intr =
77 REG_FIELD(LTR501_INTR, 0, 0);
78static const struct reg_field reg_field_ps_intr =
79 REG_FIELD(LTR501_INTR, 1, 1);77 REG_FIELD(LTR501_INTR, 1, 1);
78static const struct reg_field reg_field_ps_intr =
79 REG_FIELD(LTR501_INTR, 0, 0);
80static const struct reg_field reg_field_als_rate =80static const struct reg_field reg_field_als_rate =
81 REG_FIELD(LTR501_ALS_MEAS_RATE, 0, 2);81 REG_FIELD(LTR501_ALS_MEAS_RATE, 0, 2);
82static const struct reg_field reg_field_ps_rate =82static const struct reg_field reg_field_ps_rate =
drivers/iio/proximity/as3935.c+6−8
@@ -40,9 +40,9 @@ · 39 unmodified lines
40#define AS3935_AFE_PWR_BIT BIT(0)40#define AS3935_AFE_PWR_BIT BIT(0)
41 41
42#define AS3935_INT 0x0342#define AS3935_INT 0x03
43#define AS3935_INT_MASK 0x0743#define AS3935_INT_MASK 0x0f
44#define AS3935_EVENT_INT BIT(3)44#define AS3935_EVENT_INT BIT(3)
45#define AS3935_NOISE_INT BIT(1)45#define AS3935_NOISE_INT BIT(0)
46 46
47#define AS3935_DATA 0x0747#define AS3935_DATA 0x07
48#define AS3935_DATA_MASK 0x3F48#define AS3935_DATA_MASK 0x3F
@@ -215,7 +215,7 @@ static irqreturn_t as3935_trigger_handler(int irq, void *private) · 166 unmodified lines
215 215
216 st->buffer[0] = val & AS3935_DATA_MASK;216 st->buffer[0] = val & AS3935_DATA_MASK;
217 iio_push_to_buffers_with_timestamp(indio_dev, &st->buffer,217 iio_push_to_buffers_with_timestamp(indio_dev, &st->buffer,
218 pf->timestamp);218 iio_get_time_ns(indio_dev));
219err_read:219err_read:
220 iio_trigger_notify_done(indio_dev->trig);220 iio_trigger_notify_done(indio_dev->trig);
221 221
@@ -244,7 +244,7 @@ static void as3935_event_work(struct work_struct *work) · 22 unmodified lines
244 244
245 switch (val) {245 switch (val) {
246 case AS3935_EVENT_INT:246 case AS3935_EVENT_INT:
247 iio_trigger_poll(st->trig);247 iio_trigger_poll_chained(st->trig);
248 break;248 break;
249 case AS3935_NOISE_INT:249 case AS3935_NOISE_INT:
250 dev_warn(&st->spi->dev, "noise level is too high\n");250 dev_warn(&st->spi->dev, "noise level is too high\n");
@@ -269,8 +269,6 @@ static irqreturn_t as3935_interrupt_handler(int irq, void *private) · 18 unmodified lines
269 269
270static void calibrate_as3935(struct as3935_state *st)270static void calibrate_as3935(struct as3935_state *st)
271{271{
272 mutex_lock(&st->lock);
273
274 /* mask disturber interrupt bit */272 /* mask disturber interrupt bit */
275 as3935_write(st, AS3935_INT, BIT(5));273 as3935_write(st, AS3935_INT, BIT(5));
276 274
@@ -280,8 +278,6 @@ static void calibrate_as3935(struct as3935_state *st) · 3 unmodified lines
280 278
281 mdelay(2);279 mdelay(2);
282 as3935_write(st, AS3935_TUNE_CAP, (st->tune_cap / TUNE_CAP_DIV));280 as3935_write(st, AS3935_TUNE_CAP, (st->tune_cap / TUNE_CAP_DIV));
283
284 mutex_unlock(&st->lock);
285}281}
286 282
287#ifdef CONFIG_PM_SLEEP283#ifdef CONFIG_PM_SLEEP
@@ -318,6 +314,8 @@ static int as3935_resume(struct device *dev) · 30 unmodified lines
318 val &= ~AS3935_AFE_PWR_BIT;314 val &= ~AS3935_AFE_PWR_BIT;
319 ret = as3935_write(st, AS3935_AFE_GAIN, val);315 ret = as3935_write(st, AS3935_AFE_GAIN, val);
320 316
317 calibrate_as3935(st);
318
321err_resume:319err_resume:
322 mutex_unlock(&st->lock);320 mutex_unlock(&st->lock);
323 321
drivers/infiniband/core/addr.c+1−9
@@ -449,12 +449,7 @@ static int addr6_resolve(struct sockaddr_in6 *src_in, · 448 unmodified lines
449 return ret;449 return ret;
450 450
451 rt = (struct rt6_info *)dst;451 rt = (struct rt6_info *)dst;
452 if (ipv6_addr_any(&fl6.saddr)) {452 if (ipv6_addr_any(&src_in->sin6_addr)) {
453 ret = ipv6_dev_get_saddr(addr->net, ip6_dst_idev(dst)->dev,
454 &fl6.daddr, 0, &fl6.saddr);
455 if (ret)
456 goto put;
457
458 src_in->sin6_family = AF_INET6;453 src_in->sin6_family = AF_INET6;
459 src_in->sin6_addr = fl6.saddr;454 src_in->sin6_addr = fl6.saddr;
460 }455 }
@@ -471,9 +466,6 @@ static int addr6_resolve(struct sockaddr_in6 *src_in, · 10 unmodified lines
471 466
472 *pdst = dst;467 *pdst = dst;
473 return 0;468 return 0;
474put:
475 dst_release(dst);
476 return ret;
477}469}
478#else470#else
479static int addr6_resolve(struct sockaddr_in6 *src_in,471static int addr6_resolve(struct sockaddr_in6 *src_in,
drivers/infiniband/core/cm.c+2−2
@@ -1429,7 +1429,7 @@ static void cm_format_paths_from_req(struct cm_req_msg *req_msg, · 1428 unmodified lines
1429 primary_path->packet_life_time =1429 primary_path->packet_life_time =
1430 cm_req_get_primary_local_ack_timeout(req_msg);1430 cm_req_get_primary_local_ack_timeout(req_msg);
1431 primary_path->packet_life_time -= (primary_path->packet_life_time > 0);1431 primary_path->packet_life_time -= (primary_path->packet_life_time > 0);
1432 sa_path_set_service_id(primary_path, req_msg->service_id);1432 primary_path->service_id = req_msg->service_id;
1433 1433
1434 if (req_msg->alt_local_lid) {1434 if (req_msg->alt_local_lid) {
1435 alt_path->dgid = req_msg->alt_local_gid;1435 alt_path->dgid = req_msg->alt_local_gid;
@@ -1452,7 +1452,7 @@ static void cm_format_paths_from_req(struct cm_req_msg *req_msg, · 16 unmodified lines
1452 alt_path->packet_life_time =1452 alt_path->packet_life_time =
1453 cm_req_get_alt_local_ack_timeout(req_msg);1453 cm_req_get_alt_local_ack_timeout(req_msg);
1454 alt_path->packet_life_time -= (alt_path->packet_life_time > 0);1454 alt_path->packet_life_time -= (alt_path->packet_life_time > 0);
1455 sa_path_set_service_id(alt_path, req_msg->service_id);1455 alt_path->service_id = req_msg->service_id;
1456 }1456 }
1457}1457}
1458 1458
drivers/infiniband/core/cma.c+6−7
@@ -1140,7 +1140,7 @@ static void cma_save_ib_info(struct sockaddr *src_addr, · 1139 unmodified lines
1140 ib->sib_pkey = path->pkey;1140 ib->sib_pkey = path->pkey;
1141 ib->sib_flowinfo = path->flow_label;1141 ib->sib_flowinfo = path->flow_label;
1142 memcpy(&ib->sib_addr, &path->sgid, 16);1142 memcpy(&ib->sib_addr, &path->sgid, 16);
1143 ib->sib_sid = sa_path_get_service_id(path);1143 ib->sib_sid = path->service_id;
1144 ib->sib_scope_id = 0;1144 ib->sib_scope_id = 0;
1145 } else {1145 } else {
1146 ib->sib_pkey = listen_ib->sib_pkey;1146 ib->sib_pkey = listen_ib->sib_pkey;
@@ -1274,8 +1274,7 @@ static int cma_save_req_info(const struct ib_cm_event *ib_event, · 127 unmodified lines
1274 memcpy(&req->local_gid, &req_param->primary_path->sgid,1274 memcpy(&req->local_gid, &req_param->primary_path->sgid,
1275 sizeof(req->local_gid));1275 sizeof(req->local_gid));
1276 req->has_gid = true;1276 req->has_gid = true;
1277 req->service_id =1277 req->service_id = req_param->primary_path->service_id;
1278 sa_path_get_service_id(req_param->primary_path);
1279 req->pkey = be16_to_cpu(req_param->primary_path->pkey);1278 req->pkey = be16_to_cpu(req_param->primary_path->pkey);
1280 if (req->pkey != req_param->bth_pkey)1279 if (req->pkey != req_param->bth_pkey)
1281 pr_warn_ratelimited("RDMA CMA: got different BTH P_Key (0x%x) and primary path P_Key (0x%x)\n"1280 pr_warn_ratelimited("RDMA CMA: got different BTH P_Key (0x%x) and primary path P_Key (0x%x)\n"
@@ -1827,7 +1826,8 @@ static struct rdma_id_private *cma_new_conn_id(struct rdma_cm_id *listen_id, · 545 unmodified lines
1827 struct rdma_route *rt;1826 struct rdma_route *rt;
1828 const sa_family_t ss_family = listen_id->route.addr.src_addr.ss_family;1827 const sa_family_t ss_family = listen_id->route.addr.src_addr.ss_family;
1829 struct sa_path_rec *path = ib_event->param.req_rcvd.primary_path;1828 struct sa_path_rec *path = ib_event->param.req_rcvd.primary_path;
1830 const __be64 service_id = sa_path_get_service_id(path);1829 const __be64 service_id =
1830 ib_event->param.req_rcvd.primary_path->service_id;
1831 int ret;1831 int ret;
1832 1832
1833 id = rdma_create_id(listen_id->route.addr.dev_addr.net,1833 id = rdma_create_id(listen_id->route.addr.dev_addr.net,
@@ -2345,9 +2345,8 @@ static int cma_query_ib_route(struct rdma_id_private *id_priv, int timeout_ms, · 511 unmodified lines
2345 path_rec.pkey = cpu_to_be16(ib_addr_get_pkey(dev_addr));2345 path_rec.pkey = cpu_to_be16(ib_addr_get_pkey(dev_addr));
2346 path_rec.numb_path = 1;2346 path_rec.numb_path = 1;
2347 path_rec.reversible = 1;2347 path_rec.reversible = 1;
2348 sa_path_set_service_id(&path_rec,2348 path_rec.service_id = rdma_get_service_id(&id_priv->id,
2349 rdma_get_service_id(&id_priv->id,2349 cma_dst_addr(id_priv));
2350 cma_dst_addr(id_priv)));
2351 2350
2352 comp_mask = IB_SA_PATH_REC_DGID | IB_SA_PATH_REC_SGID |2351 comp_mask = IB_SA_PATH_REC_DGID | IB_SA_PATH_REC_SGID |
2353 IB_SA_PATH_REC_PKEY | IB_SA_PATH_REC_NUMB_PATH |2352 IB_SA_PATH_REC_PKEY | IB_SA_PATH_REC_NUMB_PATH |
drivers/infiniband/core/core_priv.h+10−0
@@ -169,6 +169,16 @@ void ib_mad_cleanup(void); · 168 unmodified lines
169int ib_sa_init(void);169int ib_sa_init(void);
170void ib_sa_cleanup(void);170void ib_sa_cleanup(void);
171 171
172int ibnl_init(void);
173void ibnl_cleanup(void);
174
175/**
176 * Check if there are any listeners to the netlink group
177 * @group: the netlink group ID
178 * Returns 0 on success or a negative for no listeners.
179 */
180int ibnl_chk_listeners(unsigned int group);
181
172int ib_nl_handle_resolve_resp(struct sk_buff *skb,182int ib_nl_handle_resolve_resp(struct sk_buff *skb,
173 struct netlink_callback *cb);183 struct netlink_callback *cb);
174int ib_nl_handle_set_timeout(struct sk_buff *skb,184int ib_nl_handle_set_timeout(struct sk_buff *skb,
drivers/infiniband/core/netlink.c+1−1
@@ -37,6 +37,7 @@ · 36 unmodified lines
37#include <net/net_namespace.h>37#include <net/net_namespace.h>
38#include <net/sock.h>38#include <net/sock.h>
39#include <rdma/rdma_netlink.h>39#include <rdma/rdma_netlink.h>
40#include "core_priv.h"
40 41
41struct ibnl_client {42struct ibnl_client {
42 struct list_head list;43 struct list_head list;
@@ -55,7 +56,6 @@ int ibnl_chk_listeners(unsigned int group) · 12 unmodified lines
55 return -1;56 return -1;
56 return 0;57 return 0;
57}58}
58EXPORT_SYMBOL(ibnl_chk_listeners);
59 59
60int ibnl_add_client(int index, int nops,60int ibnl_add_client(int index, int nops,
61 const struct ibnl_client_cbs cb_table[])61 const struct ibnl_client_cbs cb_table[])
drivers/infiniband/core/sa_query.c+3−3
@@ -194,7 +194,7 @@ static u32 tid; · 193 unmodified lines
194 .field_name = "sa_path_rec:" #field194 .field_name = "sa_path_rec:" #field
195 195
196static const struct ib_field path_rec_table[] = {196static const struct ib_field path_rec_table[] = {
197 { PATH_REC_FIELD(ib.service_id),197 { PATH_REC_FIELD(service_id),
198 .offset_words = 0,198 .offset_words = 0,
199 .offset_bits = 0,199 .offset_bits = 0,
200 .size_bits = 64 },200 .size_bits = 64 },
@@ -296,7 +296,7 @@ static const struct ib_field path_rec_table[] = { · 95 unmodified lines
296 .field_name = "sa_path_rec:" #field296 .field_name = "sa_path_rec:" #field
297 297
298static const struct ib_field opa_path_rec_table[] = {298static const struct ib_field opa_path_rec_table[] = {
299 { OPA_PATH_REC_FIELD(opa.service_id),299 { OPA_PATH_REC_FIELD(service_id),
300 .offset_words = 0,300 .offset_words = 0,
301 .offset_bits = 0,301 .offset_bits = 0,
302 .size_bits = 64 },302 .size_bits = 64 },
@@ -774,7 +774,7 @@ static void ib_nl_set_path_rec_attrs(struct sk_buff *skb, · 471 unmodified lines
774 774
775 /* Now build the attributes */775 /* Now build the attributes */
776 if (comp_mask & IB_SA_PATH_REC_SERVICE_ID) {776 if (comp_mask & IB_SA_PATH_REC_SERVICE_ID) {
777 val64 = be64_to_cpu(sa_path_get_service_id(sa_rec));777 val64 = be64_to_cpu(sa_rec->service_id);
778 nla_put(skb, RDMA_NLA_F_MANDATORY | LS_NLA_TYPE_SERVICE_ID,778 nla_put(skb, RDMA_NLA_F_MANDATORY | LS_NLA_TYPE_SERVICE_ID,
779 sizeof(val64), &val64);779 sizeof(val64), &val64);
780 }780 }
drivers/infiniband/core/umem.c+1−1
@@ -58,7 +58,7 @@ static void __ib_umem_release(struct ib_device *dev, struct ib_umem *umem, int d · 57 unmodified lines
58 for_each_sg(umem->sg_head.sgl, sg, umem->npages, i) {58 for_each_sg(umem->sg_head.sgl, sg, umem->npages, i) {
59 59
60 page = sg_page(sg);60 page = sg_page(sg);
61 if (umem->writable && dirty)61 if (!PageDirty(page) && umem->writable && dirty)
62 set_page_dirty_lock(page);62 set_page_dirty_lock(page);
63 put_page(page);63 put_page(page);
64 }64 }
drivers/infiniband/core/umem_odp.c+5−1
@@ -321,11 +321,15 @@ int ib_umem_odp_get(struct ib_ucontext *context, struct ib_umem *umem, · 320 unmodified lines
321 struct vm_area_struct *vma;321 struct vm_area_struct *vma;
322 struct hstate *h;322 struct hstate *h;
323 323
324 down_read(&mm->mmap_sem);
324 vma = find_vma(mm, ib_umem_start(umem));325 vma = find_vma(mm, ib_umem_start(umem));
325 if (!vma || !is_vm_hugetlb_page(vma))326 if (!vma || !is_vm_hugetlb_page(vma)) {
327 up_read(&mm->mmap_sem);
326 return -EINVAL;328 return -EINVAL;
329 }
327 h = hstate_vma(vma);330 h = hstate_vma(vma);
328 umem->page_shift = huge_page_shift(h);331 umem->page_shift = huge_page_shift(h);
332 up_read(&mm->mmap_sem);
329 umem->hugetlb = 1;333 umem->hugetlb = 1;
330 } else {334 } else {
331 umem->hugetlb = 0;335 umem->hugetlb = 0;
drivers/infiniband/core/uverbs_marshall.c+4−4
@@ -96,11 +96,11 @@ void ib_copy_qp_attr_to_user(struct ib_uverbs_qp_attr *dst, · 95 unmodified lines
96}96}
97EXPORT_SYMBOL(ib_copy_qp_attr_to_user);97EXPORT_SYMBOL(ib_copy_qp_attr_to_user);
98 98
99void __ib_copy_path_rec_to_user(struct ib_user_path_rec *dst,99static void __ib_copy_path_rec_to_user(struct ib_user_path_rec *dst,
100 struct sa_path_rec *src)100 struct sa_path_rec *src)
101{101{
102 memcpy(dst->dgid, src->dgid.raw, sizeof src->dgid);102 memcpy(dst->dgid, src->dgid.raw, sizeof(src->dgid));
103 memcpy(dst->sgid, src->sgid.raw, sizeof src->sgid);103 memcpy(dst->sgid, src->sgid.raw, sizeof(src->sgid));
104 104
105 dst->dlid = htons(ntohl(sa_path_get_dlid(src)));105 dst->dlid = htons(ntohl(sa_path_get_dlid(src)));
106 dst->slid = htons(ntohl(sa_path_get_slid(src)));106 dst->slid = htons(ntohl(sa_path_get_slid(src)));
drivers/infiniband/hw/bnxt_re/bnxt_re.h+4−0
@@ -56,6 +56,10 @@ · 55 unmodified lines
56#define BNXT_RE_MAX_SRQC_COUNT (64 * 1024)56#define BNXT_RE_MAX_SRQC_COUNT (64 * 1024)
57#define BNXT_RE_MAX_CQ_COUNT (64 * 1024)57#define BNXT_RE_MAX_CQ_COUNT (64 * 1024)
58 58
59#define BNXT_RE_UD_QP_HW_STALL 0x400000
60
61#define BNXT_RE_RQ_WQE_THRESHOLD 32
62
59struct bnxt_re_work {63struct bnxt_re_work {
60 struct work_struct work;64 struct work_struct work;
61 unsigned long event;65 unsigned long event;
drivers/infiniband/hw/bnxt_re/ib_verbs.c+347−124
@@ -61,6 +61,48 @@ · 60 unmodified lines
61#include "ib_verbs.h"61#include "ib_verbs.h"
62#include <rdma/bnxt_re-abi.h>62#include <rdma/bnxt_re-abi.h>
63 63
64static int __from_ib_access_flags(int iflags)
65{
66 int qflags = 0;
67
68 if (iflags & IB_ACCESS_LOCAL_WRITE)
69 qflags |= BNXT_QPLIB_ACCESS_LOCAL_WRITE;
70 if (iflags & IB_ACCESS_REMOTE_READ)
71 qflags |= BNXT_QPLIB_ACCESS_REMOTE_READ;
72 if (iflags & IB_ACCESS_REMOTE_WRITE)
73 qflags |= BNXT_QPLIB_ACCESS_REMOTE_WRITE;
74 if (iflags & IB_ACCESS_REMOTE_ATOMIC)
75 qflags |= BNXT_QPLIB_ACCESS_REMOTE_ATOMIC;
76 if (iflags & IB_ACCESS_MW_BIND)
77 qflags |= BNXT_QPLIB_ACCESS_MW_BIND;
78 if (iflags & IB_ZERO_BASED)
79 qflags |= BNXT_QPLIB_ACCESS_ZERO_BASED;
80 if (iflags & IB_ACCESS_ON_DEMAND)
81 qflags |= BNXT_QPLIB_ACCESS_ON_DEMAND;
82 return qflags;
83};
84
85static enum ib_access_flags __to_ib_access_flags(int qflags)
86{
87 enum ib_access_flags iflags = 0;
88
89 if (qflags & BNXT_QPLIB_ACCESS_LOCAL_WRITE)
90 iflags |= IB_ACCESS_LOCAL_WRITE;
91 if (qflags & BNXT_QPLIB_ACCESS_REMOTE_WRITE)
92 iflags |= IB_ACCESS_REMOTE_WRITE;
93 if (qflags & BNXT_QPLIB_ACCESS_REMOTE_READ)
94 iflags |= IB_ACCESS_REMOTE_READ;
95 if (qflags & BNXT_QPLIB_ACCESS_REMOTE_ATOMIC)
96 iflags |= IB_ACCESS_REMOTE_ATOMIC;
97 if (qflags & BNXT_QPLIB_ACCESS_MW_BIND)
98 iflags |= IB_ACCESS_MW_BIND;
99 if (qflags & BNXT_QPLIB_ACCESS_ZERO_BASED)
100 iflags |= IB_ZERO_BASED;
101 if (qflags & BNXT_QPLIB_ACCESS_ON_DEMAND)
102 iflags |= IB_ACCESS_ON_DEMAND;
103 return iflags;
104};
105
64static int bnxt_re_build_sgl(struct ib_sge *ib_sg_list,106static int bnxt_re_build_sgl(struct ib_sge *ib_sg_list,
65 struct bnxt_qplib_sge *sg_list, int num)107 struct bnxt_qplib_sge *sg_list, int num)
66{108{
@@ -149,8 +191,8 @@ int bnxt_re_query_device(struct ib_device *ibdev, · 82 unmodified lines
149 ib_attr->max_total_mcast_qp_attach = 0;191 ib_attr->max_total_mcast_qp_attach = 0;
150 ib_attr->max_ah = dev_attr->max_ah;192 ib_attr->max_ah = dev_attr->max_ah;
151 193
152 ib_attr->max_fmr = dev_attr->max_fmr;194 ib_attr->max_fmr = 0;
153 ib_attr->max_map_per_fmr = 1; /* ? */195 ib_attr->max_map_per_fmr = 0;
154 196
155 ib_attr->max_srq = dev_attr->max_srq;197 ib_attr->max_srq = dev_attr->max_srq;
156 ib_attr->max_srq_wr = dev_attr->max_srq_wqes;198 ib_attr->max_srq_wr = dev_attr->max_srq_wqes;
@@ -410,6 +452,158 @@ enum rdma_link_layer bnxt_re_get_link_layer(struct ib_device *ibdev, · 253 unmodified lines
410 return IB_LINK_LAYER_ETHERNET;452 return IB_LINK_LAYER_ETHERNET;
411}453}
412 454
455#define BNXT_RE_FENCE_PBL_SIZE DIV_ROUND_UP(BNXT_RE_FENCE_BYTES, PAGE_SIZE)
456
457static void bnxt_re_create_fence_wqe(struct bnxt_re_pd *pd)
458{
459 struct bnxt_re_fence_data *fence = &pd->fence;
460 struct ib_mr *ib_mr = &fence->mr->ib_mr;
461 struct bnxt_qplib_swqe *wqe = &fence->bind_wqe;
462
463 memset(wqe, 0, sizeof(*wqe));
464 wqe->type = BNXT_QPLIB_SWQE_TYPE_BIND_MW;
465 wqe->wr_id = BNXT_QPLIB_FENCE_WRID;
466 wqe->flags |= BNXT_QPLIB_SWQE_FLAGS_SIGNAL_COMP;
467 wqe->flags |= BNXT_QPLIB_SWQE_FLAGS_UC_FENCE;
468 wqe->bind.zero_based = false;
469 wqe->bind.parent_l_key = ib_mr->lkey;
470 wqe->bind.va = (u64)(unsigned long)fence->va;
471 wqe->bind.length = fence->size;
472 wqe->bind.access_cntl = __from_ib_access_flags(IB_ACCESS_REMOTE_READ);
473 wqe->bind.mw_type = SQ_BIND_MW_TYPE_TYPE1;
474
475 /* Save the initial rkey in fence structure for now;
476 * wqe->bind.r_key will be set at (re)bind time.
477 */
478 fence->bind_rkey = ib_inc_rkey(fence->mw->rkey);
479}
480
481static int bnxt_re_bind_fence_mw(struct bnxt_qplib_qp *qplib_qp)
482{
483 struct bnxt_re_qp *qp = container_of(qplib_qp, struct bnxt_re_qp,
484 qplib_qp);
485 struct ib_pd *ib_pd = qp->ib_qp.pd;
486 struct bnxt_re_pd *pd = container_of(ib_pd, struct bnxt_re_pd, ib_pd);
487 struct bnxt_re_fence_data *fence = &pd->fence;
488 struct bnxt_qplib_swqe *fence_wqe = &fence->bind_wqe;
489 struct bnxt_qplib_swqe wqe;
490 int rc;
491
492 memcpy(&wqe, fence_wqe, sizeof(wqe));
493 wqe.bind.r_key = fence->bind_rkey;
494 fence->bind_rkey = ib_inc_rkey(fence->bind_rkey);
495
496 dev_dbg(rdev_to_dev(qp->rdev),
497 "Posting bind fence-WQE: rkey: %#x QP: %d PD: %p\n",
498 wqe.bind.r_key, qp->qplib_qp.id, pd);
499 rc = bnxt_qplib_post_send(&qp->qplib_qp, &wqe);
500 if (rc) {
501 dev_err(rdev_to_dev(qp->rdev), "Failed to bind fence-WQE\n");
502 return rc;
503 }
504 bnxt_qplib_post_send_db(&qp->qplib_qp);
505
506 return rc;
507}
508
509static void bnxt_re_destroy_fence_mr(struct bnxt_re_pd *pd)
510{
511 struct bnxt_re_fence_data *fence = &pd->fence;
512 struct bnxt_re_dev *rdev = pd->rdev;
513 struct device *dev = &rdev->en_dev->pdev->dev;
514 struct bnxt_re_mr *mr = fence->mr;
515
516 if (fence->mw) {
517 bnxt_re_dealloc_mw(fence->mw);
518 fence->mw = NULL;
519 }
520 if (mr) {
521 if (mr->ib_mr.rkey)
522 bnxt_qplib_dereg_mrw(&rdev->qplib_res, &mr->qplib_mr,
523 true);
524 if (mr->ib_mr.lkey)
525 bnxt_qplib_free_mrw(&rdev->qplib_res, &mr->qplib_mr);
526 kfree(mr);
527 fence->mr = NULL;
528 }
529 if (fence->dma_addr) {
530 dma_unmap_single(dev, fence->dma_addr, BNXT_RE_FENCE_BYTES,
531 DMA_BIDIRECTIONAL);
532 fence->dma_addr = 0;
533 }
534}
535
536static int bnxt_re_create_fence_mr(struct bnxt_re_pd *pd)
537{
538 int mr_access_flags = IB_ACCESS_LOCAL_WRITE | IB_ACCESS_MW_BIND;
539 struct bnxt_re_fence_data *fence = &pd->fence;
540 struct bnxt_re_dev *rdev = pd->rdev;
541 struct device *dev = &rdev->en_dev->pdev->dev;
542 struct bnxt_re_mr *mr = NULL;
543 dma_addr_t dma_addr = 0;
544 struct ib_mw *mw;
545 u64 pbl_tbl;
546 int rc;
547
548 dma_addr = dma_map_single(dev, fence->va, BNXT_RE_FENCE_BYTES,
549 DMA_BIDIRECTIONAL);
550 rc = dma_mapping_error(dev, dma_addr);
551 if (rc) {
552 dev_err(rdev_to_dev(rdev), "Failed to dma-map fence-MR-mem\n");
553 rc = -EIO;
554 fence->dma_addr = 0;
555 goto fail;
556 }
557 fence->dma_addr = dma_addr;
558
559 /* Allocate a MR */
560 mr = kzalloc(sizeof(*mr), GFP_KERNEL);
561 if (!mr) {
562 rc = -ENOMEM;
563 goto fail;
564 }
565 fence->mr = mr;
566 mr->rdev = rdev;
567 mr->qplib_mr.pd = &pd->qplib_pd;
568 mr->qplib_mr.type = CMDQ_ALLOCATE_MRW_MRW_FLAGS_PMR;
569 mr->qplib_mr.flags = __from_ib_access_flags(mr_access_flags);
570 rc = bnxt_qplib_alloc_mrw(&rdev->qplib_res, &mr->qplib_mr);
571 if (rc) {
572 dev_err(rdev_to_dev(rdev), "Failed to alloc fence-HW-MR\n");
573 goto fail;
574 }
575
576 /* Register MR */
577 mr->ib_mr.lkey = mr->qplib_mr.lkey;
578 mr->qplib_mr.va = (u64)(unsigned long)fence->va;
579 mr->qplib_mr.total_size = BNXT_RE_FENCE_BYTES;
580 pbl_tbl = dma_addr;
581 rc = bnxt_qplib_reg_mr(&rdev->qplib_res, &mr->qplib_mr, &pbl_tbl,
582 BNXT_RE_FENCE_PBL_SIZE, false);
583 if (rc) {
584 dev_err(rdev_to_dev(rdev), "Failed to register fence-MR\n");
585 goto fail;
586 }
587 mr->ib_mr.rkey = mr->qplib_mr.rkey;
588
589 /* Create a fence MW only for kernel consumers */
590 mw = bnxt_re_alloc_mw(&pd->ib_pd, IB_MW_TYPE_1, NULL);
591 if (!mw) {
592 dev_err(rdev_to_dev(rdev),
593 "Failed to create fence-MW for PD: %p\n", pd);
594 rc = -EINVAL;
595 goto fail;
596 }
597 fence->mw = mw;
598
599 bnxt_re_create_fence_wqe(pd);
600 return 0;
601
602fail:
603 bnxt_re_destroy_fence_mr(pd);
604 return rc;
605}
606
413/* Protection Domains */607/* Protection Domains */
414int bnxt_re_dealloc_pd(struct ib_pd *ib_pd)608int bnxt_re_dealloc_pd(struct ib_pd *ib_pd)
415{609{
@@ -417,6 +611,7 @@ int bnxt_re_dealloc_pd(struct ib_pd *ib_pd) · 1 unmodified line
417 struct bnxt_re_dev *rdev = pd->rdev;611 struct bnxt_re_dev *rdev = pd->rdev;
418 int rc;612 int rc;
419 613
614 bnxt_re_destroy_fence_mr(pd);
420 if (ib_pd->uobject && pd->dpi.dbr) {615 if (ib_pd->uobject && pd->dpi.dbr) {
421 struct ib_ucontext *ib_uctx = ib_pd->uobject->context;616 struct ib_ucontext *ib_uctx = ib_pd->uobject->context;
422 struct bnxt_re_ucontext *ucntx;617 struct bnxt_re_ucontext *ucntx;
@@ -498,6 +693,10 @@ struct ib_pd *bnxt_re_alloc_pd(struct ib_device *ibdev, · 75 unmodified lines
498 }693 }
499 }694 }
500 695
696 if (!udata)
697 if (bnxt_re_create_fence_mr(pd))
698 dev_warn(rdev_to_dev(rdev),
699 "Failed to create Fence-MR\n");
501 return &pd->ib_pd;700 return &pd->ib_pd;
502dbfail:701dbfail:
503 (void)bnxt_qplib_dealloc_pd(&rdev->qplib_res, &rdev->qplib_res.pd_tbl,702 (void)bnxt_qplib_dealloc_pd(&rdev->qplib_res, &rdev->qplib_res.pd_tbl,
@@ -849,12 +1048,16 @@ static struct bnxt_re_qp *bnxt_re_create_shadow_qp · 345 unmodified lines
849 /* Shadow QP SQ depth should be same as QP1 RQ depth */1048 /* Shadow QP SQ depth should be same as QP1 RQ depth */
850 qp->qplib_qp.sq.max_wqe = qp1_qp->rq.max_wqe;1049 qp->qplib_qp.sq.max_wqe = qp1_qp->rq.max_wqe;
851 qp->qplib_qp.sq.max_sge = 2;1050 qp->qplib_qp.sq.max_sge = 2;
1051 /* Q full delta can be 1 since it is internal QP */
1052 qp->qplib_qp.sq.q_full_delta = 1;
852 1053
853 qp->qplib_qp.scq = qp1_qp->scq;1054 qp->qplib_qp.scq = qp1_qp->scq;
854 qp->qplib_qp.rcq = qp1_qp->rcq;1055 qp->qplib_qp.rcq = qp1_qp->rcq;
855 1056
856 qp->qplib_qp.rq.max_wqe = qp1_qp->rq.max_wqe;1057 qp->qplib_qp.rq.max_wqe = qp1_qp->rq.max_wqe;
857 qp->qplib_qp.rq.max_sge = qp1_qp->rq.max_sge;1058 qp->qplib_qp.rq.max_sge = qp1_qp->rq.max_sge;
1059 /* Q full delta can be 1 since it is internal QP */
1060 qp->qplib_qp.rq.q_full_delta = 1;
858 1061
859 qp->qplib_qp.mtu = qp1_qp->mtu;1062 qp->qplib_qp.mtu = qp1_qp->mtu;
860 1063
@@ -917,10 +1120,6 @@ struct ib_qp *bnxt_re_create_qp(struct ib_pd *ib_pd, · 56 unmodified lines
917 qp->qplib_qp.sig_type = ((qp_init_attr->sq_sig_type ==1120 qp->qplib_qp.sig_type = ((qp_init_attr->sq_sig_type ==
918 IB_SIGNAL_ALL_WR) ? true : false);1121 IB_SIGNAL_ALL_WR) ? true : false);
919 1122
920 entries = roundup_pow_of_two(qp_init_attr->cap.max_send_wr + 1);
921 qp->qplib_qp.sq.max_wqe = min_t(u32, entries,
922 dev_attr->max_qp_wqes + 1);
923
924 qp->qplib_qp.sq.max_sge = qp_init_attr->cap.max_send_sge;1123 qp->qplib_qp.sq.max_sge = qp_init_attr->cap.max_send_sge;
925 if (qp->qplib_qp.sq.max_sge > dev_attr->max_qp_sges)1124 if (qp->qplib_qp.sq.max_sge > dev_attr->max_qp_sges)
926 qp->qplib_qp.sq.max_sge = dev_attr->max_qp_sges;1125 qp->qplib_qp.sq.max_sge = dev_attr->max_qp_sges;
@@ -959,6 +1158,9 @@ struct ib_qp *bnxt_re_create_qp(struct ib_pd *ib_pd, · 32 unmodified lines
959 qp->qplib_qp.rq.max_wqe = min_t(u32, entries,1158 qp->qplib_qp.rq.max_wqe = min_t(u32, entries,
960 dev_attr->max_qp_wqes + 1);1159 dev_attr->max_qp_wqes + 1);
961 1160
1161 qp->qplib_qp.rq.q_full_delta = qp->qplib_qp.rq.max_wqe -
1162 qp_init_attr->cap.max_recv_wr;
1163
962 qp->qplib_qp.rq.max_sge = qp_init_attr->cap.max_recv_sge;1164 qp->qplib_qp.rq.max_sge = qp_init_attr->cap.max_recv_sge;
963 if (qp->qplib_qp.rq.max_sge > dev_attr->max_qp_sges)1165 if (qp->qplib_qp.rq.max_sge > dev_attr->max_qp_sges)
964 qp->qplib_qp.rq.max_sge = dev_attr->max_qp_sges;1166 qp->qplib_qp.rq.max_sge = dev_attr->max_qp_sges;
@@ -967,6 +1169,12 @@ struct ib_qp *bnxt_re_create_qp(struct ib_pd *ib_pd, · 2 unmodified lines
967 qp->qplib_qp.mtu = ib_mtu_enum_to_int(iboe_get_mtu(rdev->netdev->mtu));1169 qp->qplib_qp.mtu = ib_mtu_enum_to_int(iboe_get_mtu(rdev->netdev->mtu));
968 1170
969 if (qp_init_attr->qp_type == IB_QPT_GSI) {1171 if (qp_init_attr->qp_type == IB_QPT_GSI) {
1172 /* Allocate 1 more than what's provided */
1173 entries = roundup_pow_of_two(qp_init_attr->cap.max_send_wr + 1);
1174 qp->qplib_qp.sq.max_wqe = min_t(u32, entries,
1175 dev_attr->max_qp_wqes + 1);
1176 qp->qplib_qp.sq.q_full_delta = qp->qplib_qp.sq.max_wqe -
1177 qp_init_attr->cap.max_send_wr;
970 qp->qplib_qp.rq.max_sge = dev_attr->max_qp_sges;1178 qp->qplib_qp.rq.max_sge = dev_attr->max_qp_sges;
971 if (qp->qplib_qp.rq.max_sge > dev_attr->max_qp_sges)1179 if (qp->qplib_qp.rq.max_sge > dev_attr->max_qp_sges)
972 qp->qplib_qp.rq.max_sge = dev_attr->max_qp_sges;1180 qp->qplib_qp.rq.max_sge = dev_attr->max_qp_sges;
@@ -1006,6 +1214,22 @@ struct ib_qp *bnxt_re_create_qp(struct ib_pd *ib_pd, · 33 unmodified lines
1006 }1214 }
1007 1215
1008 } else {1216 } else {
1217 /* Allocate 128 + 1 more than what's provided */
1218 entries = roundup_pow_of_two(qp_init_attr->cap.max_send_wr +
1219 BNXT_QPLIB_RESERVED_QP_WRS + 1);
1220 qp->qplib_qp.sq.max_wqe = min_t(u32, entries,
1221 dev_attr->max_qp_wqes +
1222 BNXT_QPLIB_RESERVED_QP_WRS + 1);
1223 qp->qplib_qp.sq.q_full_delta = BNXT_QPLIB_RESERVED_QP_WRS + 1;
1224
1225 /*
1226 * Reserving one slot for Phantom WQE. Application can
1227 * post one extra entry in this case. But allowing this to avoid
1228 * unexpected Queue full condition
1229 */
1230
1231 qp->qplib_qp.sq.q_full_delta -= 1;
1232
1009 qp->qplib_qp.max_rd_atomic = dev_attr->max_qp_rd_atom;1233 qp->qplib_qp.max_rd_atomic = dev_attr->max_qp_rd_atom;
1010 qp->qplib_qp.max_dest_rd_atomic = dev_attr->max_qp_init_rd_atom;1234 qp->qplib_qp.max_dest_rd_atomic = dev_attr->max_qp_init_rd_atom;
1011 if (udata) {1235 if (udata) {
@@ -1025,6 +1249,7 @@ struct ib_qp *bnxt_re_create_qp(struct ib_pd *ib_pd, · 13 unmodified lines
1025 1249
1026 qp->ib_qp.qp_num = qp->qplib_qp.id;1250 qp->ib_qp.qp_num = qp->qplib_qp.id;
1027 spin_lock_init(&qp->sq_lock);1251 spin_lock_init(&qp->sq_lock);
1252 spin_lock_init(&qp->rq_lock);
1028 1253
1029 if (udata) {1254 if (udata) {
1030 struct bnxt_re_qp_resp resp;1255 struct bnxt_re_qp_resp resp;
@@ -1129,48 +1354,6 @@ static enum ib_mtu __to_ib_mtu(u32 mtu) · 98 unmodified lines
1129 }1354 }
1130}1355}
1131 1356
1132static int __from_ib_access_flags(int iflags)
1133{
1134 int qflags = 0;
1135
1136 if (iflags & IB_ACCESS_LOCAL_WRITE)
1137 qflags |= BNXT_QPLIB_ACCESS_LOCAL_WRITE;
1138 if (iflags & IB_ACCESS_REMOTE_READ)
1139 qflags |= BNXT_QPLIB_ACCESS_REMOTE_READ;
1140 if (iflags & IB_ACCESS_REMOTE_WRITE)
1141 qflags |= BNXT_QPLIB_ACCESS_REMOTE_WRITE;
1142 if (iflags & IB_ACCESS_REMOTE_ATOMIC)
1143 qflags |= BNXT_QPLIB_ACCESS_REMOTE_ATOMIC;
1144 if (iflags & IB_ACCESS_MW_BIND)
1145 qflags |= BNXT_QPLIB_ACCESS_MW_BIND;
1146 if (iflags & IB_ZERO_BASED)
1147 qflags |= BNXT_QPLIB_ACCESS_ZERO_BASED;
1148 if (iflags & IB_ACCESS_ON_DEMAND)
1149 qflags |= BNXT_QPLIB_ACCESS_ON_DEMAND;
1150 return qflags;
1151};
1152
1153static enum ib_access_flags __to_ib_access_flags(int qflags)
1154{
1155 enum ib_access_flags iflags = 0;
1156
1157 if (qflags & BNXT_QPLIB_ACCESS_LOCAL_WRITE)
1158 iflags |= IB_ACCESS_LOCAL_WRITE;
1159 if (qflags & BNXT_QPLIB_ACCESS_REMOTE_WRITE)
1160 iflags |= IB_ACCESS_REMOTE_WRITE;
1161 if (qflags & BNXT_QPLIB_ACCESS_REMOTE_READ)
1162 iflags |= IB_ACCESS_REMOTE_READ;
1163 if (qflags & BNXT_QPLIB_ACCESS_REMOTE_ATOMIC)
1164 iflags |= IB_ACCESS_REMOTE_ATOMIC;
1165 if (qflags & BNXT_QPLIB_ACCESS_MW_BIND)
1166 iflags |= IB_ACCESS_MW_BIND;
1167 if (qflags & BNXT_QPLIB_ACCESS_ZERO_BASED)
1168 iflags |= IB_ZERO_BASED;
1169 if (qflags & BNXT_QPLIB_ACCESS_ON_DEMAND)
1170 iflags |= IB_ACCESS_ON_DEMAND;
1171 return iflags;
1172};
1173
1174static int bnxt_re_modify_shadow_qp(struct bnxt_re_dev *rdev,1357static int bnxt_re_modify_shadow_qp(struct bnxt_re_dev *rdev,
1175 struct bnxt_re_qp *qp1_qp,1358 struct bnxt_re_qp *qp1_qp,
1176 int qp_attr_mask)1359 int qp_attr_mask)
@@ -1378,11 +1561,21 @@ int bnxt_re_modify_qp(struct ib_qp *ib_qp, struct ib_qp_attr *qp_attr, · 201 unmodified lines
1378 entries = roundup_pow_of_two(qp_attr->cap.max_send_wr);1561 entries = roundup_pow_of_two(qp_attr->cap.max_send_wr);
1379 qp->qplib_qp.sq.max_wqe = min_t(u32, entries,1562 qp->qplib_qp.sq.max_wqe = min_t(u32, entries,
1380 dev_attr->max_qp_wqes + 1);1563 dev_attr->max_qp_wqes + 1);
1564 qp->qplib_qp.sq.q_full_delta = qp->qplib_qp.sq.max_wqe -
1565 qp_attr->cap.max_send_wr;
1566 /*
1567 * Reserving one slot for Phantom WQE. Some application can
1568 * post one extra entry in this case. Allowing this to avoid
1569 * unexpected Queue full condition
1570 */
1571 qp->qplib_qp.sq.q_full_delta -= 1;
1381 qp->qplib_qp.sq.max_sge = qp_attr->cap.max_send_sge;1572 qp->qplib_qp.sq.max_sge = qp_attr->cap.max_send_sge;
1382 if (qp->qplib_qp.rq.max_wqe) {1573 if (qp->qplib_qp.rq.max_wqe) {
1383 entries = roundup_pow_of_two(qp_attr->cap.max_recv_wr);1574 entries = roundup_pow_of_two(qp_attr->cap.max_recv_wr);
1384 qp->qplib_qp.rq.max_wqe =1575 qp->qplib_qp.rq.max_wqe =
1385 min_t(u32, entries, dev_attr->max_qp_wqes + 1);1576 min_t(u32, entries, dev_attr->max_qp_wqes + 1);
1577 qp->qplib_qp.rq.q_full_delta = qp->qplib_qp.rq.max_wqe -
1578 qp_attr->cap.max_recv_wr;
1386 qp->qplib_qp.rq.max_sge = qp_attr->cap.max_recv_sge;1579 qp->qplib_qp.rq.max_sge = qp_attr->cap.max_recv_sge;
1387 } else {1580 } else {
1388 /* SRQ was used prior, just ignore the RQ caps */1581 /* SRQ was used prior, just ignore the RQ caps */
@@ -1883,6 +2076,22 @@ static int bnxt_re_copy_wr_payload(struct bnxt_re_dev *rdev, · 494 unmodified lines
1883 return payload_sz;2076 return payload_sz;
1884}2077}
1885 2078
2079static void bnxt_ud_qp_hw_stall_workaround(struct bnxt_re_qp *qp)
2080{
2081 if ((qp->ib_qp.qp_type == IB_QPT_UD ||
2082 qp->ib_qp.qp_type == IB_QPT_GSI ||
2083 qp->ib_qp.qp_type == IB_QPT_RAW_ETHERTYPE) &&
2084 qp->qplib_qp.wqe_cnt == BNXT_RE_UD_QP_HW_STALL) {
2085 int qp_attr_mask;
2086 struct ib_qp_attr qp_attr;
2087
2088 qp_attr_mask = IB_QP_STATE;
2089 qp_attr.qp_state = IB_QPS_RTS;
2090 bnxt_re_modify_qp(&qp->ib_qp, &qp_attr, qp_attr_mask, NULL);
2091 qp->qplib_qp.wqe_cnt = 0;
2092 }
2093}
2094
1886static int bnxt_re_post_send_shadow_qp(struct bnxt_re_dev *rdev,2095static int bnxt_re_post_send_shadow_qp(struct bnxt_re_dev *rdev,
1887 struct bnxt_re_qp *qp,2096 struct bnxt_re_qp *qp,
1888 struct ib_send_wr *wr)2097 struct ib_send_wr *wr)
@@ -1928,6 +2137,7 @@ bad: · 39 unmodified lines
1928 wr = wr->next;2137 wr = wr->next;
1929 }2138 }
1930 bnxt_qplib_post_send_db(&qp->qplib_qp);2139 bnxt_qplib_post_send_db(&qp->qplib_qp);
2140 bnxt_ud_qp_hw_stall_workaround(qp);
1931 spin_unlock_irqrestore(&qp->sq_lock, flags);2141 spin_unlock_irqrestore(&qp->sq_lock, flags);
1932 return rc;2142 return rc;
1933}2143}
@@ -2024,6 +2234,7 @@ bad: · 90 unmodified lines
2024 wr = wr->next;2234 wr = wr->next;
2025 }2235 }
2026 bnxt_qplib_post_send_db(&qp->qplib_qp);2236 bnxt_qplib_post_send_db(&qp->qplib_qp);
2237 bnxt_ud_qp_hw_stall_workaround(qp);
2027 spin_unlock_irqrestore(&qp->sq_lock, flags);2238 spin_unlock_irqrestore(&qp->sq_lock, flags);
2028 2239
2029 return rc;2240 return rc;
@@ -2071,7 +2282,10 @@ int bnxt_re_post_recv(struct ib_qp *ib_qp, struct ib_recv_wr *wr, · 41 unmodified lines
2071 struct bnxt_re_qp *qp = container_of(ib_qp, struct bnxt_re_qp, ib_qp);2282 struct bnxt_re_qp *qp = container_of(ib_qp, struct bnxt_re_qp, ib_qp);
2072 struct bnxt_qplib_swqe wqe;2283 struct bnxt_qplib_swqe wqe;
2073 int rc = 0, payload_sz = 0;2284 int rc = 0, payload_sz = 0;
2285 unsigned long flags;
2286 u32 count = 0;
2074 2287
2288 spin_lock_irqsave(&qp->rq_lock, flags);
2075 while (wr) {2289 while (wr) {
2076 /* House keeping */2290 /* House keeping */
2077 memset(&wqe, 0, sizeof(wqe));2291 memset(&wqe, 0, sizeof(wqe));
@@ -2100,9 +2314,21 @@ int bnxt_re_post_recv(struct ib_qp *ib_qp, struct ib_recv_wr *wr, · 22 unmodified lines
2100 *bad_wr = wr;2314 *bad_wr = wr;
2101 break;2315 break;
2102 }2316 }
2317
2318 /* Ring DB if the RQEs posted reaches a threshold value */
2319 if (++count >= BNXT_RE_RQ_WQE_THRESHOLD) {
2320 bnxt_qplib_post_recv_db(&qp->qplib_qp);
2321 count = 0;
2322 }
2323
2103 wr = wr->next;2324 wr = wr->next;
2104 }2325 }
2105 bnxt_qplib_post_recv_db(&qp->qplib_qp);2326
2327 if (count)
2328 bnxt_qplib_post_recv_db(&qp->qplib_qp);
2329
2330 spin_unlock_irqrestore(&qp->rq_lock, flags);
2331
2106 return rc;2332 return rc;
2107}2333}
2108 2334
@@ -2643,12 +2869,36 @@ static void bnxt_re_process_res_ud_wc(struct ib_wc *wc, · 534 unmodified lines
2643 wc->opcode = IB_WC_RECV_RDMA_WITH_IMM;2869 wc->opcode = IB_WC_RECV_RDMA_WITH_IMM;
2644}2870}
2645 2871
2872static int send_phantom_wqe(struct bnxt_re_qp *qp)
2873{
2874 struct bnxt_qplib_qp *lib_qp = &qp->qplib_qp;
2875 unsigned long flags;
2876 int rc = 0;
2877
2878 spin_lock_irqsave(&qp->sq_lock, flags);
2879
2880 rc = bnxt_re_bind_fence_mw(lib_qp);
2881 if (!rc) {
2882 lib_qp->sq.phantom_wqe_cnt++;
2883 dev_dbg(&lib_qp->sq.hwq.pdev->dev,
2884 "qp %#x sq->prod %#x sw_prod %#x phantom_wqe_cnt %d\n",
2885 lib_qp->id, lib_qp->sq.hwq.prod,
2886 HWQ_CMP(lib_qp->sq.hwq.prod, &lib_qp->sq.hwq),
2887 lib_qp->sq.phantom_wqe_cnt);
2888 }
2889
2890 spin_unlock_irqrestore(&qp->sq_lock, flags);
2891 return rc;
2892}
2893
2646int bnxt_re_poll_cq(struct ib_cq *ib_cq, int num_entries, struct ib_wc *wc)2894int bnxt_re_poll_cq(struct ib_cq *ib_cq, int num_entries, struct ib_wc *wc)
2647{2895{
2648 struct bnxt_re_cq *cq = container_of(ib_cq, struct bnxt_re_cq, ib_cq);2896 struct bnxt_re_cq *cq = container_of(ib_cq, struct bnxt_re_cq, ib_cq);
2649 struct bnxt_re_qp *qp;2897 struct bnxt_re_qp *qp;
2650 struct bnxt_qplib_cqe *cqe;2898 struct bnxt_qplib_cqe *cqe;
2651 int i, ncqe, budget;2899 int i, ncqe, budget;
2900 struct bnxt_qplib_q *sq;
2901 struct bnxt_qplib_qp *lib_qp;
2652 u32 tbl_idx;2902 u32 tbl_idx;
2653 struct bnxt_re_sqp_entries *sqp_entry = NULL;2903 struct bnxt_re_sqp_entries *sqp_entry = NULL;
2654 unsigned long flags;2904 unsigned long flags;
@@ -2661,7 +2911,21 @@ int bnxt_re_poll_cq(struct ib_cq *ib_cq, int num_entries, struct ib_wc *wc) · 6 unmodified lines
2661 }2911 }
2662 cqe = &cq->cql[0];2912 cqe = &cq->cql[0];
2663 while (budget) {2913 while (budget) {
2664 ncqe = bnxt_qplib_poll_cq(&cq->qplib_cq, cqe, budget);2914 lib_qp = NULL;
2915 ncqe = bnxt_qplib_poll_cq(&cq->qplib_cq, cqe, budget, &lib_qp);
2916 if (lib_qp) {
2917 sq = &lib_qp->sq;
2918 if (sq->send_phantom) {
2919 qp = container_of(lib_qp,
2920 struct bnxt_re_qp, qplib_qp);
2921 if (send_phantom_wqe(qp) == -ENOMEM)
2922 dev_err(rdev_to_dev(cq->rdev),
2923 "Phantom failed! Scheduled to send again\n");
2924 else
2925 sq->send_phantom = false;
2926 }
2927 }
2928
2665 if (!ncqe)2929 if (!ncqe)
2666 break;2930 break;
2667 2931
@@ -2822,6 +3086,12 @@ int bnxt_re_dereg_mr(struct ib_mr *ib_mr) · 154 unmodified lines
2822 struct bnxt_re_dev *rdev = mr->rdev;3086 struct bnxt_re_dev *rdev = mr->rdev;
2823 int rc;3087 int rc;
2824 3088
3089 rc = bnxt_qplib_free_mrw(&rdev->qplib_res, &mr->qplib_mr);
3090 if (rc) {
3091 dev_err(rdev_to_dev(rdev), "Dereg MR failed: %#x\n", rc);
3092 return rc;
3093 }
3094
2825 if (mr->npages && mr->pages) {3095 if (mr->npages && mr->pages) {
2826 rc = bnxt_qplib_free_fast_reg_page_list(&rdev->qplib_res,3096 rc = bnxt_qplib_free_fast_reg_page_list(&rdev->qplib_res,
2827 &mr->qplib_frpl);3097 &mr->qplib_frpl);
@@ -2829,8 +3099,6 @@ int bnxt_re_dereg_mr(struct ib_mr *ib_mr) · 1 unmodified line
2829 mr->npages = 0;3099 mr->npages = 0;
2830 mr->pages = NULL;3100 mr->pages = NULL;
2831 }3101 }
2832 rc = bnxt_qplib_free_mrw(&rdev->qplib_res, &mr->qplib_mr);
2833
2834 if (!IS_ERR_OR_NULL(mr->ib_umem))3102 if (!IS_ERR_OR_NULL(mr->ib_umem))
2835 ib_umem_release(mr->ib_umem);3103 ib_umem_release(mr->ib_umem);
2836 3104
@@ -2914,97 +3182,52 @@ fail: · 77 unmodified lines
2914 return ERR_PTR(rc);3182 return ERR_PTR(rc);
2915}3183}
2916 3184
2917/* Fast Memory Regions */3185struct ib_mw *bnxt_re_alloc_mw(struct ib_pd *ib_pd, enum ib_mw_type type,
2918struct ib_fmr *bnxt_re_alloc_fmr(struct ib_pd *ib_pd, int mr_access_flags,3186 struct ib_udata *udata)
2919 struct ib_fmr_attr *fmr_attr)
2920{3187{
2921 struct bnxt_re_pd *pd = container_of(ib_pd, struct bnxt_re_pd, ib_pd);3188 struct bnxt_re_pd *pd = container_of(ib_pd, struct bnxt_re_pd, ib_pd);
2922 struct bnxt_re_dev *rdev = pd->rdev;3189 struct bnxt_re_dev *rdev = pd->rdev;
2923 struct bnxt_re_fmr *fmr;3190 struct bnxt_re_mw *mw;
2924 int rc;3191 int rc;
2925 3192
2926 if (fmr_attr->max_pages > MAX_PBL_LVL_2_PGS ||3193 mw = kzalloc(sizeof(*mw), GFP_KERNEL);
2927 fmr_attr->max_maps > rdev->dev_attr.max_map_per_fmr) {3194 if (!mw)
2928 dev_err(rdev_to_dev(rdev), "Allocate FMR exceeded Max limit");
2929 return ERR_PTR(-ENOMEM);3195 return ERR_PTR(-ENOMEM);
2930 }3196 mw->rdev = rdev;
2931 fmr = kzalloc(sizeof(*fmr), GFP_KERNEL);3197 mw->qplib_mw.pd = &pd->qplib_pd;
2932 if (!fmr)
2933 return ERR_PTR(-ENOMEM);
2934
2935 fmr->rdev = rdev;
2936 fmr->qplib_fmr.pd = &pd->qplib_pd;
2937 fmr->qplib_fmr.type = CMDQ_ALLOCATE_MRW_MRW_FLAGS_PMR;
2938 3198
2939 rc = bnxt_qplib_alloc_mrw(&rdev->qplib_res, &fmr->qplib_fmr);3199 mw->qplib_mw.type = (type == IB_MW_TYPE_1 ?
2940 if (rc)3200 CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE1 :
3201 CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2B);
3202 rc = bnxt_qplib_alloc_mrw(&rdev->qplib_res, &mw->qplib_mw);
3203 if (rc) {
3204 dev_err(rdev_to_dev(rdev), "Allocate MW failed!");
2941 goto fail;3205 goto fail;
3206 }
3207 mw->ib_mw.rkey = mw->qplib_mw.rkey;
2942 3208
2943 fmr->qplib_fmr.flags = __from_ib_access_flags(mr_access_flags);3209 atomic_inc(&rdev->mw_count);
2944 fmr->ib_fmr.lkey = fmr->qplib_fmr.lkey;3210 return &mw->ib_mw;
2945 fmr->ib_fmr.rkey = fmr->ib_fmr.lkey;
2946 3211
2947 atomic_inc(&rdev->mr_count);
2948 return &fmr->ib_fmr;
2949fail:3212fail:
2950 kfree(fmr);3213 kfree(mw);
2951 return ERR_PTR(rc);3214 return ERR_PTR(rc);
2952}3215}
2953 3216
2954int bnxt_re_map_phys_fmr(struct ib_fmr *ib_fmr, u64 *page_list, int list_len,3217int bnxt_re_dealloc_mw(struct ib_mw *ib_mw)
2955 u64 iova)
2956{3218{
2957 struct bnxt_re_fmr *fmr = container_of(ib_fmr, struct bnxt_re_fmr,3219 struct bnxt_re_mw *mw = container_of(ib_mw, struct bnxt_re_mw, ib_mw);
2958 ib_fmr);3220 struct bnxt_re_dev *rdev = mw->rdev;
2959 struct bnxt_re_dev *rdev = fmr->rdev;
2960 int rc;3221 int rc;
2961 3222
2962 fmr->qplib_fmr.va = iova;3223 rc = bnxt_qplib_free_mrw(&rdev->qplib_res, &mw->qplib_mw);
2963 fmr->qplib_fmr.total_size = list_len * PAGE_SIZE;3224 if (rc) {
2964 3225 dev_err(rdev_to_dev(rdev), "Free MW failed: %#x\n", rc);
2965 rc = bnxt_qplib_reg_mr(&rdev->qplib_res, &fmr->qplib_fmr, page_list,3226 return rc;
2966 list_len, true);
2967 if (rc)
2968 dev_err(rdev_to_dev(rdev), "Failed to map FMR for lkey = 0x%x!",
2969 fmr->ib_fmr.lkey);
2970 return rc;
2971}
2972
2973int bnxt_re_unmap_fmr(struct list_head *fmr_list)
2974{
2975 struct bnxt_re_dev *rdev;
2976 struct bnxt_re_fmr *fmr;
2977 struct ib_fmr *ib_fmr;
2978 int rc = 0;
2979
2980 /* Validate each FMRs inside the fmr_list */
2981 list_for_each_entry(ib_fmr, fmr_list, list) {
2982 fmr = container_of(ib_fmr, struct bnxt_re_fmr, ib_fmr);
2983 rdev = fmr->rdev;
2984
2985 if (rdev) {
2986 rc = bnxt_qplib_dereg_mrw(&rdev->qplib_res,
2987 &fmr->qplib_fmr, true);
2988 if (rc)
2989 break;
2990 }
2991 }3227 }
2992 return rc;
2993}
2994
2995int bnxt_re_dealloc_fmr(struct ib_fmr *ib_fmr)
2996{
2997 struct bnxt_re_fmr *fmr = container_of(ib_fmr, struct bnxt_re_fmr,
2998 ib_fmr);
2999 struct bnxt_re_dev *rdev = fmr->rdev;
3000 int rc;
3001 3228
3002 rc = bnxt_qplib_free_mrw(&rdev->qplib_res, &fmr->qplib_fmr);3229 kfree(mw);
3003 if (rc)3230 atomic_dec(&rdev->mw_count);
3004 dev_err(rdev_to_dev(rdev), "Failed to free FMR");
3005
3006 kfree(fmr);
3007 atomic_dec(&rdev->mr_count);
3008 return rc;3231 return rc;
3009}3232}
3010 3233
drivers/infiniband/hw/bnxt_re/ib_verbs.h+16−6
@@ -44,11 +44,23 @@ struct bnxt_re_gid_ctx { · 43 unmodified lines
44 u32 refcnt;44 u32 refcnt;
45};45};
46 46
47#define BNXT_RE_FENCE_BYTES 64
48struct bnxt_re_fence_data {
49 u32 size;
50 u8 va[BNXT_RE_FENCE_BYTES];
51 dma_addr_t dma_addr;
52 struct bnxt_re_mr *mr;
53 struct ib_mw *mw;
54 struct bnxt_qplib_swqe bind_wqe;
55 u32 bind_rkey;
56};
57
47struct bnxt_re_pd {58struct bnxt_re_pd {
48 struct bnxt_re_dev *rdev;59 struct bnxt_re_dev *rdev;
49 struct ib_pd ib_pd;60 struct ib_pd ib_pd;
50 struct bnxt_qplib_pd qplib_pd;61 struct bnxt_qplib_pd qplib_pd;
51 struct bnxt_qplib_dpi dpi;62 struct bnxt_qplib_dpi dpi;
63 struct bnxt_re_fence_data fence;
52};64};
53 65
54struct bnxt_re_ah {66struct bnxt_re_ah {
@@ -62,6 +74,7 @@ struct bnxt_re_qp { · 7 unmodified lines
62 struct bnxt_re_dev *rdev;74 struct bnxt_re_dev *rdev;
63 struct ib_qp ib_qp;75 struct ib_qp ib_qp;
64 spinlock_t sq_lock; /* protect sq */76 spinlock_t sq_lock; /* protect sq */
77 spinlock_t rq_lock; /* protect rq */
65 struct bnxt_qplib_qp qplib_qp;78 struct bnxt_qplib_qp qplib_qp;
66 struct ib_umem *sumem;79 struct ib_umem *sumem;
67 struct ib_umem *rumem;80 struct ib_umem *rumem;
@@ -181,12 +194,9 @@ int bnxt_re_map_mr_sg(struct ib_mr *ib_mr, struct scatterlist *sg, int sg_nents, · 113 unmodified lines
181struct ib_mr *bnxt_re_alloc_mr(struct ib_pd *ib_pd, enum ib_mr_type mr_type,194struct ib_mr *bnxt_re_alloc_mr(struct ib_pd *ib_pd, enum ib_mr_type mr_type,
182 u32 max_num_sg);195 u32 max_num_sg);
183int bnxt_re_dereg_mr(struct ib_mr *mr);196int bnxt_re_dereg_mr(struct ib_mr *mr);
184struct ib_fmr *bnxt_re_alloc_fmr(struct ib_pd *pd, int mr_access_flags,197struct ib_mw *bnxt_re_alloc_mw(struct ib_pd *ib_pd, enum ib_mw_type type,
185 struct ib_fmr_attr *fmr_attr);198 struct ib_udata *udata);
186int bnxt_re_map_phys_fmr(struct ib_fmr *fmr, u64 *page_list, int list_len,199int bnxt_re_dealloc_mw(struct ib_mw *mw);
187 u64 iova);
188int bnxt_re_unmap_fmr(struct list_head *fmr_list);
189int bnxt_re_dealloc_fmr(struct ib_fmr *fmr);
190struct ib_mr *bnxt_re_reg_user_mr(struct ib_pd *pd, u64 start, u64 length,200struct ib_mr *bnxt_re_reg_user_mr(struct ib_pd *pd, u64 start, u64 length,
191 u64 virt_addr, int mr_access_flags,201 u64 virt_addr, int mr_access_flags,
192 struct ib_udata *udata);202 struct ib_udata *udata);
drivers/infiniband/hw/bnxt_re/main.c+0−4
@@ -507,10 +507,6 @@ static int bnxt_re_register_ib(struct bnxt_re_dev *rdev) · 506 unmodified lines
507 ibdev->dereg_mr = bnxt_re_dereg_mr;507 ibdev->dereg_mr = bnxt_re_dereg_mr;
508 ibdev->alloc_mr = bnxt_re_alloc_mr;508 ibdev->alloc_mr = bnxt_re_alloc_mr;
509 ibdev->map_mr_sg = bnxt_re_map_mr_sg;509 ibdev->map_mr_sg = bnxt_re_map_mr_sg;
510 ibdev->alloc_fmr = bnxt_re_alloc_fmr;
511 ibdev->map_phys_fmr = bnxt_re_map_phys_fmr;
512 ibdev->unmap_fmr = bnxt_re_unmap_fmr;
513 ibdev->dealloc_fmr = bnxt_re_dealloc_fmr;
514 510
515 ibdev->reg_user_mr = bnxt_re_reg_user_mr;511 ibdev->reg_user_mr = bnxt_re_reg_user_mr;
516 ibdev->alloc_ucontext = bnxt_re_alloc_ucontext;512 ibdev->alloc_ucontext = bnxt_re_alloc_ucontext;
drivers/infiniband/hw/bnxt_re/qplib_fp.c+199−185
@@ -284,7 +284,7 @@ int bnxt_qplib_create_qp1(struct bnxt_qplib_res *res, struct bnxt_qplib_qp *qp) · 283 unmodified lines
284{284{
285 struct bnxt_qplib_rcfw *rcfw = res->rcfw;285 struct bnxt_qplib_rcfw *rcfw = res->rcfw;
286 struct cmdq_create_qp1 req;286 struct cmdq_create_qp1 req;
287 struct creq_create_qp1_resp *resp;287 struct creq_create_qp1_resp resp;
288 struct bnxt_qplib_pbl *pbl;288 struct bnxt_qplib_pbl *pbl;
289 struct bnxt_qplib_q *sq = &qp->sq;289 struct bnxt_qplib_q *sq = &qp->sq;
290 struct bnxt_qplib_q *rq = &qp->rq;290 struct bnxt_qplib_q *rq = &qp->rq;
@@ -394,31 +394,12 @@ int bnxt_qplib_create_qp1(struct bnxt_qplib_res *res, struct bnxt_qplib_qp *qp) · 103 unmodified lines
394 394
395 req.pd_id = cpu_to_le32(qp->pd->id);395 req.pd_id = cpu_to_le32(qp->pd->id);
396 396
397 resp = (struct creq_create_qp1_resp *)397 rc = bnxt_qplib_rcfw_send_message(rcfw, (void *)&req,
398 bnxt_qplib_rcfw_send_message(rcfw, (void *)&req,398 (void *)&resp, NULL, 0);
399 NULL, 0);399 if (rc)
400 if (!resp) {
401 dev_err(&res->pdev->dev, "QPLIB: FP: CREATE_QP1 send failed");
402 rc = -EINVAL;
403 goto fail;
404 }
405 if (!bnxt_qplib_rcfw_wait_for_resp(rcfw, le16_to_cpu(req.cookie))) {
406 /* Cmd timed out */
407 dev_err(&rcfw->pdev->dev, "QPLIB: FP: CREATE_QP1 timed out");
408 rc = -ETIMEDOUT;
409 goto fail;
410 }
411 if (resp->status ||
412 le16_to_cpu(resp->cookie) != le16_to_cpu(req.cookie)) {
413 dev_err(&rcfw->pdev->dev, "QPLIB: FP: CREATE_QP1 failed ");
414 dev_err(&rcfw->pdev->dev,
415 "QPLIB: with status 0x%x cmdq 0x%x resp 0x%x",
416 resp->status, le16_to_cpu(req.cookie),
417 le16_to_cpu(resp->cookie));
418 rc = -EINVAL;
419 goto fail;400 goto fail;
420 }401
421 qp->id = le32_to_cpu(resp->xid);402 qp->id = le32_to_cpu(resp.xid);
422 qp->cur_qp_state = CMDQ_MODIFY_QP_NEW_STATE_RESET;403 qp->cur_qp_state = CMDQ_MODIFY_QP_NEW_STATE_RESET;
423 sq->flush_in_progress = false;404 sq->flush_in_progress = false;
424 rq->flush_in_progress = false;405 rq->flush_in_progress = false;
@@ -442,7 +423,7 @@ int bnxt_qplib_create_qp(struct bnxt_qplib_res *res, struct bnxt_qplib_qp *qp) · 17 unmodified lines
442 struct bnxt_qplib_rcfw *rcfw = res->rcfw;423 struct bnxt_qplib_rcfw *rcfw = res->rcfw;
443 struct sq_send *hw_sq_send_hdr, **hw_sq_send_ptr;424 struct sq_send *hw_sq_send_hdr, **hw_sq_send_ptr;
444 struct cmdq_create_qp req;425 struct cmdq_create_qp req;
445 struct creq_create_qp_resp *resp;426 struct creq_create_qp_resp resp;
446 struct bnxt_qplib_pbl *pbl;427 struct bnxt_qplib_pbl *pbl;
447 struct sq_psn_search **psn_search_ptr;428 struct sq_psn_search **psn_search_ptr;
448 unsigned long int psn_search, poff = 0;429 unsigned long int psn_search, poff = 0;
@@ -627,31 +608,12 @@ int bnxt_qplib_create_qp(struct bnxt_qplib_res *res, struct bnxt_qplib_qp *qp) · 178 unmodified lines
627 }608 }
628 req.pd_id = cpu_to_le32(qp->pd->id);609 req.pd_id = cpu_to_le32(qp->pd->id);
629 610
630 resp = (struct creq_create_qp_resp *)611 rc = bnxt_qplib_rcfw_send_message(rcfw, (void *)&req,
631 bnxt_qplib_rcfw_send_message(rcfw, (void *)&req,612 (void *)&resp, NULL, 0);
632 NULL, 0);613 if (rc)
633 if (!resp) {
634 dev_err(&rcfw->pdev->dev, "QPLIB: FP: CREATE_QP send failed");
635 rc = -EINVAL;
636 goto fail;
637 }
638 if (!bnxt_qplib_rcfw_wait_for_resp(rcfw, le16_to_cpu(req.cookie))) {
639 /* Cmd timed out */
640 dev_err(&rcfw->pdev->dev, "QPLIB: FP: CREATE_QP timed out");
641 rc = -ETIMEDOUT;
642 goto fail;
643 }
644 if (resp->status ||
645 le16_to_cpu(resp->cookie) != le16_to_cpu(req.cookie)) {
646 dev_err(&rcfw->pdev->dev, "QPLIB: FP: CREATE_QP failed ");
647 dev_err(&rcfw->pdev->dev,
648 "QPLIB: with status 0x%x cmdq 0x%x resp 0x%x",
649 resp->status, le16_to_cpu(req.cookie),
650 le16_to_cpu(resp->cookie));
651 rc = -EINVAL;
652 goto fail;614 goto fail;
653 }615
654 qp->id = le32_to_cpu(resp->xid);616 qp->id = le32_to_cpu(resp.xid);
655 qp->cur_qp_state = CMDQ_MODIFY_QP_NEW_STATE_RESET;617 qp->cur_qp_state = CMDQ_MODIFY_QP_NEW_STATE_RESET;
656 sq->flush_in_progress = false;618 sq->flush_in_progress = false;
657 rq->flush_in_progress = false;619 rq->flush_in_progress = false;
@@ -769,10 +731,11 @@ int bnxt_qplib_modify_qp(struct bnxt_qplib_res *res, struct bnxt_qplib_qp *qp) · 111 unmodified lines
769{731{
770 struct bnxt_qplib_rcfw *rcfw = res->rcfw;732 struct bnxt_qplib_rcfw *rcfw = res->rcfw;
771 struct cmdq_modify_qp req;733 struct cmdq_modify_qp req;
772 struct creq_modify_qp_resp *resp;734 struct creq_modify_qp_resp resp;
773 u16 cmd_flags = 0, pkey;735 u16 cmd_flags = 0, pkey;
774 u32 temp32[4];736 u32 temp32[4];
775 u32 bmask;737 u32 bmask;
738 int rc;
776 739
777 RCFW_CMD_PREP(req, MODIFY_QP, cmd_flags);740 RCFW_CMD_PREP(req, MODIFY_QP, cmd_flags);
778 741
@@ -862,27 +825,10 @@ int bnxt_qplib_modify_qp(struct bnxt_qplib_res *res, struct bnxt_qplib_qp *qp) · 83 unmodified lines
862 825
863 req.vlan_pcp_vlan_dei_vlan_id = cpu_to_le16(qp->vlan_id);826 req.vlan_pcp_vlan_dei_vlan_id = cpu_to_le16(qp->vlan_id);
864 827
865 resp = (struct creq_modify_qp_resp *)828 rc = bnxt_qplib_rcfw_send_message(rcfw, (void *)&req,
866 bnxt_qplib_rcfw_send_message(rcfw, (void *)&req,829 (void *)&resp, NULL, 0);
867 NULL, 0);830 if (rc)
868 if (!resp) {831 return rc;
869 dev_err(&rcfw->pdev->dev, "QPLIB: FP: MODIFY_QP send failed");
870 return -EINVAL;
871 }
872 if (!bnxt_qplib_rcfw_wait_for_resp(rcfw, le16_to_cpu(req.cookie))) {
873 /* Cmd timed out */
874 dev_err(&rcfw->pdev->dev, "QPLIB: FP: MODIFY_QP timed out");
875 return -ETIMEDOUT;
876 }
877 if (resp->status ||
878 le16_to_cpu(resp->cookie) != le16_to_cpu(req.cookie)) {
879 dev_err(&rcfw->pdev->dev, "QPLIB: FP: MODIFY_QP failed ");
880 dev_err(&rcfw->pdev->dev,
881 "QPLIB: with status 0x%x cmdq 0x%x resp 0x%x",
882 resp->status, le16_to_cpu(req.cookie),
883 le16_to_cpu(resp->cookie));
884 return -EINVAL;
885 }
886 qp->cur_qp_state = qp->state;832 qp->cur_qp_state = qp->state;
887 return 0;833 return 0;
888}834}
@@ -891,37 +837,26 @@ int bnxt_qplib_query_qp(struct bnxt_qplib_res *res, struct bnxt_qplib_qp *qp) · 2 unmodified lines
891{837{
892 struct bnxt_qplib_rcfw *rcfw = res->rcfw;838 struct bnxt_qplib_rcfw *rcfw = res->rcfw;
893 struct cmdq_query_qp req;839 struct cmdq_query_qp req;
894 struct creq_query_qp_resp *resp;840 struct creq_query_qp_resp resp;
841 struct bnxt_qplib_rcfw_sbuf *sbuf;
895 struct creq_query_qp_resp_sb *sb;842 struct creq_query_qp_resp_sb *sb;
896 u16 cmd_flags = 0;843 u16 cmd_flags = 0;
897 u32 temp32[4];844 u32 temp32[4];
898 int i;845 int i, rc = 0;
899 846
900 RCFW_CMD_PREP(req, QUERY_QP, cmd_flags);847 RCFW_CMD_PREP(req, QUERY_QP, cmd_flags);
901 848
849 sbuf = bnxt_qplib_rcfw_alloc_sbuf(rcfw, sizeof(*sb));
850 if (!sbuf)
851 return -ENOMEM;
852 sb = sbuf->sb;
853
902 req.qp_cid = cpu_to_le32(qp->id);854 req.qp_cid = cpu_to_le32(qp->id);
903 req.resp_size = sizeof(*sb) / BNXT_QPLIB_CMDQE_UNITS;855 req.resp_size = sizeof(*sb) / BNXT_QPLIB_CMDQE_UNITS;
904 resp = (struct creq_query_qp_resp *)856 rc = bnxt_qplib_rcfw_send_message(rcfw, (void *)&req, (void *)&resp,
905 bnxt_qplib_rcfw_send_message(rcfw, (void *)&req,857 (void *)sbuf, 0);
906 (void **)&sb, 0);858 if (rc)
907 if (!resp) {859 goto bail;
908 dev_err(&rcfw->pdev->dev, "QPLIB: FP: QUERY_QP send failed");
909 return -EINVAL;
910 }
911 if (!bnxt_qplib_rcfw_wait_for_resp(rcfw, le16_to_cpu(req.cookie))) {
912 /* Cmd timed out */
913 dev_err(&rcfw->pdev->dev, "QPLIB: FP: QUERY_QP timed out");
914 return -ETIMEDOUT;
915 }
916 if (resp->status ||
917 le16_to_cpu(resp->cookie) != le16_to_cpu(req.cookie)) {
918 dev_err(&rcfw->pdev->dev, "QPLIB: FP: QUERY_QP failed ");
919 dev_err(&rcfw->pdev->dev,
920 "QPLIB: with status 0x%x cmdq 0x%x resp 0x%x",
921 resp->status, le16_to_cpu(req.cookie),
922 le16_to_cpu(resp->cookie));
923 return -EINVAL;
924 }
925 /* Extract the context from the side buffer */860 /* Extract the context from the side buffer */
926 qp->state = sb->en_sqd_async_notify_state &861 qp->state = sb->en_sqd_async_notify_state &
927 CREQ_QUERY_QP_RESP_SB_STATE_MASK;862 CREQ_QUERY_QP_RESP_SB_STATE_MASK;
@@ -976,7 +911,9 @@ int bnxt_qplib_query_qp(struct bnxt_qplib_res *res, struct bnxt_qplib_qp *qp) · 48 unmodified lines
976 qp->dest_qpn = le32_to_cpu(sb->dest_qp_id);911 qp->dest_qpn = le32_to_cpu(sb->dest_qp_id);
977 memcpy(qp->smac, sb->src_mac, 6);912 memcpy(qp->smac, sb->src_mac, 6);
978 qp->vlan_id = le16_to_cpu(sb->vlan_pcp_vlan_dei_vlan_id);913 qp->vlan_id = le16_to_cpu(sb->vlan_pcp_vlan_dei_vlan_id);
979 return 0;914bail:
915 bnxt_qplib_rcfw_free_sbuf(rcfw, sbuf);
916 return rc;
980}917}
981 918
982static void __clean_cq(struct bnxt_qplib_cq *cq, u64 qp)919static void __clean_cq(struct bnxt_qplib_cq *cq, u64 qp)
@@ -1021,34 +958,18 @@ int bnxt_qplib_destroy_qp(struct bnxt_qplib_res *res, · 38 unmodified lines
1021{958{
1022 struct bnxt_qplib_rcfw *rcfw = res->rcfw;959 struct bnxt_qplib_rcfw *rcfw = res->rcfw;
1023 struct cmdq_destroy_qp req;960 struct cmdq_destroy_qp req;
1024 struct creq_destroy_qp_resp *resp;961 struct creq_destroy_qp_resp resp;
1025 unsigned long flags;962 unsigned long flags;
1026 u16 cmd_flags = 0;963 u16 cmd_flags = 0;
964 int rc;
1027 965
1028 RCFW_CMD_PREP(req, DESTROY_QP, cmd_flags);966 RCFW_CMD_PREP(req, DESTROY_QP, cmd_flags);
1029 967
1030 req.qp_cid = cpu_to_le32(qp->id);968 req.qp_cid = cpu_to_le32(qp->id);
1031 resp = (struct creq_destroy_qp_resp *)969 rc = bnxt_qplib_rcfw_send_message(rcfw, (void *)&req,
1032 bnxt_qplib_rcfw_send_message(rcfw, (void *)&req,970 (void *)&resp, NULL, 0);
1033 NULL, 0);971 if (rc)
1034 if (!resp) {972 return rc;
1035 dev_err(&rcfw->pdev->dev, "QPLIB: FP: DESTROY_QP send failed");
1036 return -EINVAL;
1037 }
1038 if (!bnxt_qplib_rcfw_wait_for_resp(rcfw, le16_to_cpu(req.cookie))) {
1039 /* Cmd timed out */
1040 dev_err(&rcfw->pdev->dev, "QPLIB: FP: DESTROY_QP timed out");
1041 return -ETIMEDOUT;
1042 }
1043 if (resp->status ||
1044 le16_to_cpu(resp->cookie) != le16_to_cpu(req.cookie)) {
1045 dev_err(&rcfw->pdev->dev, "QPLIB: FP: DESTROY_QP failed ");
1046 dev_err(&rcfw->pdev->dev,
1047 "QPLIB: with status 0x%x cmdq 0x%x resp 0x%x",
1048 resp->status, le16_to_cpu(req.cookie),
1049 le16_to_cpu(resp->cookie));
1050 return -EINVAL;
1051 }
1052 973
1053 /* Must walk the associated CQs to nullified the QP ptr */974 /* Must walk the associated CQs to nullified the QP ptr */
1054 spin_lock_irqsave(&qp->scq->hwq.lock, flags);975 spin_lock_irqsave(&qp->scq->hwq.lock, flags);
@@ -1162,8 +1083,12 @@ int bnxt_qplib_post_send(struct bnxt_qplib_qp *qp, · 107 unmodified lines
1162 rc = -EINVAL;1083 rc = -EINVAL;
1163 goto done;1084 goto done;
1164 }1085 }
1165 if (HWQ_CMP((sq->hwq.prod + 1), &sq->hwq) ==1086
1166 HWQ_CMP(sq->hwq.cons, &sq->hwq)) {1087 if (bnxt_qplib_queue_full(sq)) {
1088 dev_err(&sq->hwq.pdev->dev,
1089 "QPLIB: prod = %#x cons = %#x qdepth = %#x delta = %#x",
1090 sq->hwq.prod, sq->hwq.cons, sq->hwq.max_elements,
1091 sq->q_full_delta);
1167 rc = -ENOMEM;1092 rc = -ENOMEM;
1168 goto done;1093 goto done;
1169 }1094 }
@@ -1373,6 +1298,9 @@ int bnxt_qplib_post_send(struct bnxt_qplib_qp *qp, · 203 unmodified lines
1373 }1298 }
1374 1299
1375 sq->hwq.prod++;1300 sq->hwq.prod++;
1301
1302 qp->wqe_cnt++;
1303
1376done:1304done:
1377 return rc;1305 return rc;
1378}1306}
@@ -1411,8 +1339,7 @@ int bnxt_qplib_post_recv(struct bnxt_qplib_qp *qp, · 32 unmodified lines
1411 rc = -EINVAL;1339 rc = -EINVAL;
1412 goto done;1340 goto done;
1413 }1341 }
1414 if (HWQ_CMP((rq->hwq.prod + 1), &rq->hwq) ==1342 if (bnxt_qplib_queue_full(rq)) {
1415 HWQ_CMP(rq->hwq.cons, &rq->hwq)) {
1416 dev_err(&rq->hwq.pdev->dev,1343 dev_err(&rq->hwq.pdev->dev,
1417 "QPLIB: FP: QP (0x%x) RQ is full!", qp->id);1344 "QPLIB: FP: QP (0x%x) RQ is full!", qp->id);
1418 rc = -EINVAL;1345 rc = -EINVAL;
@@ -1483,7 +1410,7 @@ int bnxt_qplib_create_cq(struct bnxt_qplib_res *res, struct bnxt_qplib_cq *cq) · 64 unmodified lines
1483{1410{
1484 struct bnxt_qplib_rcfw *rcfw = res->rcfw;1411 struct bnxt_qplib_rcfw *rcfw = res->rcfw;
1485 struct cmdq_create_cq req;1412 struct cmdq_create_cq req;
1486 struct creq_create_cq_resp *resp;1413 struct creq_create_cq_resp resp;
1487 struct bnxt_qplib_pbl *pbl;1414 struct bnxt_qplib_pbl *pbl;
1488 u16 cmd_flags = 0;1415 u16 cmd_flags = 0;
1489 int rc;1416 int rc;
@@ -1525,30 +1452,12 @@ int bnxt_qplib_create_cq(struct bnxt_qplib_res *res, struct bnxt_qplib_cq *cq) · 35 unmodified lines
1525 (cq->cnq_hw_ring_id & CMDQ_CREATE_CQ_CNQ_ID_MASK) <<1452 (cq->cnq_hw_ring_id & CMDQ_CREATE_CQ_CNQ_ID_MASK) <<
1526 CMDQ_CREATE_CQ_CNQ_ID_SFT);1453 CMDQ_CREATE_CQ_CNQ_ID_SFT);
1527 1454
1528 resp = (struct creq_create_cq_resp *)1455 rc = bnxt_qplib_rcfw_send_message(rcfw, (void *)&req,
1529 bnxt_qplib_rcfw_send_message(rcfw, (void *)&req,1456 (void *)&resp, NULL, 0);
1530 NULL, 0);1457 if (rc)
1531 if (!resp) {
1532 dev_err(&rcfw->pdev->dev, "QPLIB: FP: CREATE_CQ send failed");
1533 return -EINVAL;
1534 }
1535 if (!bnxt_qplib_rcfw_wait_for_resp(rcfw, le16_to_cpu(req.cookie))) {
1536 /* Cmd timed out */
1537 dev_err(&rcfw->pdev->dev, "QPLIB: FP: CREATE_CQ timed out");
1538 rc = -ETIMEDOUT;
1539 goto fail;
1540 }
1541 if (resp->status ||
1542 le16_to_cpu(resp->cookie) != le16_to_cpu(req.cookie)) {
1543 dev_err(&rcfw->pdev->dev, "QPLIB: FP: CREATE_CQ failed ");
1544 dev_err(&rcfw->pdev->dev,
1545 "QPLIB: with status 0x%x cmdq 0x%x resp 0x%x",
1546 resp->status, le16_to_cpu(req.cookie),
1547 le16_to_cpu(resp->cookie));
1548 rc = -EINVAL;
1549 goto fail;1458 goto fail;
1550 }1459
1551 cq->id = le32_to_cpu(resp->xid);1460 cq->id = le32_to_cpu(resp.xid);
1552 cq->dbr_base = res->dpi_tbl.dbr_bar_reg_iomem;1461 cq->dbr_base = res->dpi_tbl.dbr_bar_reg_iomem;
1553 cq->period = BNXT_QPLIB_QUEUE_START_PERIOD;1462 cq->period = BNXT_QPLIB_QUEUE_START_PERIOD;
1554 init_waitqueue_head(&cq->waitq);1463 init_waitqueue_head(&cq->waitq);
@@ -1566,33 +1475,17 @@ int bnxt_qplib_destroy_cq(struct bnxt_qplib_res *res, struct bnxt_qplib_cq *cq) · 11 unmodified lines
1566{1475{
1567 struct bnxt_qplib_rcfw *rcfw = res->rcfw;1476 struct bnxt_qplib_rcfw *rcfw = res->rcfw;
1568 struct cmdq_destroy_cq req;1477 struct cmdq_destroy_cq req;
1569 struct creq_destroy_cq_resp *resp;1478 struct creq_destroy_cq_resp resp;
1570 u16 cmd_flags = 0;1479 u16 cmd_flags = 0;
1480 int rc;
1571 1481
1572 RCFW_CMD_PREP(req, DESTROY_CQ, cmd_flags);1482 RCFW_CMD_PREP(req, DESTROY_CQ, cmd_flags);
1573 1483
1574 req.cq_cid = cpu_to_le32(cq->id);1484 req.cq_cid = cpu_to_le32(cq->id);
1575 resp = (struct creq_destroy_cq_resp *)1485 rc = bnxt_qplib_rcfw_send_message(rcfw, (void *)&req,
1576 bnxt_qplib_rcfw_send_message(rcfw, (void *)&req,1486 (void *)&resp, NULL, 0);
1577 NULL, 0);1487 if (rc)
1578 if (!resp) {1488 return rc;
1579 dev_err(&rcfw->pdev->dev, "QPLIB: FP: DESTROY_CQ send failed");
1580 return -EINVAL;
1581 }
1582 if (!bnxt_qplib_rcfw_wait_for_resp(rcfw, le16_to_cpu(req.cookie))) {
1583 /* Cmd timed out */
1584 dev_err(&rcfw->pdev->dev, "QPLIB: FP: DESTROY_CQ timed out");
1585 return -ETIMEDOUT;
1586 }
1587 if (resp->status ||
1588 le16_to_cpu(resp->cookie) != le16_to_cpu(req.cookie)) {
1589 dev_err(&rcfw->pdev->dev, "QPLIB: FP: DESTROY_CQ failed ");
1590 dev_err(&rcfw->pdev->dev,
1591 "QPLIB: with status 0x%x cmdq 0x%x resp 0x%x",
1592 resp->status, le16_to_cpu(req.cookie),
1593 le16_to_cpu(resp->cookie));
1594 return -EINVAL;
1595 }
1596 bnxt_qplib_free_hwq(res->pdev, &cq->hwq);1489 bnxt_qplib_free_hwq(res->pdev, &cq->hwq);
1597 return 0;1490 return 0;
1598}1491}
@@ -1664,14 +1557,113 @@ static int __flush_rq(struct bnxt_qplib_q *rq, struct bnxt_qplib_qp *qp, · 65 unmodified lines
1664 return rc;1557 return rc;
1665}1558}
1666 1559
1560/* Note: SQE is valid from sw_sq_cons up to cqe_sq_cons (exclusive)
1561 * CQE is track from sw_cq_cons to max_element but valid only if VALID=1
1562 */
1563static int do_wa9060(struct bnxt_qplib_qp *qp, struct bnxt_qplib_cq *cq,
1564 u32 cq_cons, u32 sw_sq_cons, u32 cqe_sq_cons)
1565{
1566 struct bnxt_qplib_q *sq = &qp->sq;
1567 struct bnxt_qplib_swq *swq;
1568 u32 peek_sw_cq_cons, peek_raw_cq_cons, peek_sq_cons_idx;
1569 struct cq_base *peek_hwcqe, **peek_hw_cqe_ptr;
1570 struct cq_req *peek_req_hwcqe;
1571 struct bnxt_qplib_qp *peek_qp;
1572 struct bnxt_qplib_q *peek_sq;
1573 int i, rc = 0;
1574
1575 /* Normal mode */
1576 /* Check for the psn_search marking before completing */
1577 swq = &sq->swq[sw_sq_cons];
1578 if (swq->psn_search &&
1579 le32_to_cpu(swq->psn_search->flags_next_psn) & 0x80000000) {
1580 /* Unmark */
1581 swq->psn_search->flags_next_psn = cpu_to_le32
1582 (le32_to_cpu(swq->psn_search->flags_next_psn)
1583 & ~0x80000000);
1584 dev_dbg(&cq->hwq.pdev->dev,
1585 "FP: Process Req cq_cons=0x%x qp=0x%x sq cons sw=0x%x cqe=0x%x marked!\n",
1586 cq_cons, qp->id, sw_sq_cons, cqe_sq_cons);
1587 sq->condition = true;
1588 sq->send_phantom = true;
1589
1590 /* TODO: Only ARM if the previous SQE is ARMALL */
1591 bnxt_qplib_arm_cq(cq, DBR_DBR_TYPE_CQ_ARMALL);
1592
1593 rc = -EAGAIN;
1594 goto out;
1595 }
1596 if (sq->condition) {
1597 /* Peek at the completions */
1598 peek_raw_cq_cons = cq->hwq.cons;
1599 peek_sw_cq_cons = cq_cons;
1600 i = cq->hwq.max_elements;
1601 while (i--) {
1602 peek_sw_cq_cons = HWQ_CMP((peek_sw_cq_cons), &cq->hwq);
1603 peek_hw_cqe_ptr = (struct cq_base **)cq->hwq.pbl_ptr;
1604 peek_hwcqe = &peek_hw_cqe_ptr[CQE_PG(peek_sw_cq_cons)]
1605 [CQE_IDX(peek_sw_cq_cons)];
1606 /* If the next hwcqe is VALID */
1607 if (CQE_CMP_VALID(peek_hwcqe, peek_raw_cq_cons,
1608 cq->hwq.max_elements)) {
1609 /* If the next hwcqe is a REQ */
1610 if ((peek_hwcqe->cqe_type_toggle &
1611 CQ_BASE_CQE_TYPE_MASK) ==
1612 CQ_BASE_CQE_TYPE_REQ) {
1613 peek_req_hwcqe = (struct cq_req *)
1614 peek_hwcqe;
1615 peek_qp = (struct bnxt_qplib_qp *)
1616 ((unsigned long)
1617 le64_to_cpu
1618 (peek_req_hwcqe->qp_handle));
1619 peek_sq = &peek_qp->sq;
1620 peek_sq_cons_idx = HWQ_CMP(le16_to_cpu(
1621 peek_req_hwcqe->sq_cons_idx) - 1
1622 , &sq->hwq);
1623 /* If the hwcqe's sq's wr_id matches */
1624 if (peek_sq == sq &&
1625 sq->swq[peek_sq_cons_idx].wr_id ==
1626 BNXT_QPLIB_FENCE_WRID) {
1627 /*
1628 * Unbreak only if the phantom
1629 * comes back
1630 */
1631 dev_dbg(&cq->hwq.pdev->dev,
1632 "FP:Got Phantom CQE");
1633 sq->condition = false;
1634 sq->single = true;
1635 rc = 0;
1636 goto out;
1637 }
1638 }
1639 /* Valid but not the phantom, so keep looping */
1640 } else {
1641 /* Not valid yet, just exit and wait */
1642 rc = -EINVAL;
1643 goto out;
1644 }
1645 peek_sw_cq_cons++;
1646 peek_raw_cq_cons++;
1647 }
1648 dev_err(&cq->hwq.pdev->dev,
1649 "Should not have come here! cq_cons=0x%x qp=0x%x sq cons sw=0x%x hw=0x%x",
1650 cq_cons, qp->id, sw_sq_cons, cqe_sq_cons);
1651 rc = -EINVAL;
1652 }
1653out:
1654 return rc;
1655}
1656
1667static int bnxt_qplib_cq_process_req(struct bnxt_qplib_cq *cq,1657static int bnxt_qplib_cq_process_req(struct bnxt_qplib_cq *cq,
1668 struct cq_req *hwcqe,1658 struct cq_req *hwcqe,
1669 struct bnxt_qplib_cqe **pcqe, int *budget)1659 struct bnxt_qplib_cqe **pcqe, int *budget,
1660 u32 cq_cons, struct bnxt_qplib_qp **lib_qp)
1670{1661{
1671 struct bnxt_qplib_qp *qp;1662 struct bnxt_qplib_qp *qp;
1672 struct bnxt_qplib_q *sq;1663 struct bnxt_qplib_q *sq;
1673 struct bnxt_qplib_cqe *cqe;1664 struct bnxt_qplib_cqe *cqe;
1674 u32 sw_cons, cqe_cons;1665 u32 sw_sq_cons, cqe_sq_cons;
1666 struct bnxt_qplib_swq *swq;
1675 int rc = 0;1667 int rc = 0;
1676 1668
1677 qp = (struct bnxt_qplib_qp *)((unsigned long)1669 qp = (struct bnxt_qplib_qp *)((unsigned long)
@@ -1683,13 +1675,13 @@ static int bnxt_qplib_cq_process_req(struct bnxt_qplib_cq *cq, · 5 unmodified lines
1683 }1675 }
1684 sq = &qp->sq;1676 sq = &qp->sq;
1685 1677
1686 cqe_cons = HWQ_CMP(le16_to_cpu(hwcqe->sq_cons_idx), &sq->hwq);1678 cqe_sq_cons = HWQ_CMP(le16_to_cpu(hwcqe->sq_cons_idx), &sq->hwq);
1687 if (cqe_cons > sq->hwq.max_elements) {1679 if (cqe_sq_cons > sq->hwq.max_elements) {
1688 dev_err(&cq->hwq.pdev->dev,1680 dev_err(&cq->hwq.pdev->dev,
1689 "QPLIB: FP: CQ Process req reported ");1681 "QPLIB: FP: CQ Process req reported ");
1690 dev_err(&cq->hwq.pdev->dev,1682 dev_err(&cq->hwq.pdev->dev,
1691 "QPLIB: sq_cons_idx 0x%x which exceeded max 0x%x",1683 "QPLIB: sq_cons_idx 0x%x which exceeded max 0x%x",
1692 cqe_cons, sq->hwq.max_elements);1684 cqe_sq_cons, sq->hwq.max_elements);
1693 return -EINVAL;1685 return -EINVAL;
1694 }1686 }
1695 /* If we were in the middle of flushing the SQ, continue */1687 /* If we were in the middle of flushing the SQ, continue */
@@ -1698,53 +1690,74 @@ static int bnxt_qplib_cq_process_req(struct bnxt_qplib_cq *cq, · 2 unmodified lines
1698 1690
1699 /* Require to walk the sq's swq to fabricate CQEs for all previously1691 /* Require to walk the sq's swq to fabricate CQEs for all previously
1700 * signaled SWQEs due to CQE aggregation from the current sq cons1692 * signaled SWQEs due to CQE aggregation from the current sq cons
1701 * to the cqe_cons1693 * to the cqe_sq_cons
1702 */1694 */
1703 cqe = *pcqe;1695 cqe = *pcqe;
1704 while (*budget) {1696 while (*budget) {
1705 sw_cons = HWQ_CMP(sq->hwq.cons, &sq->hwq);1697 sw_sq_cons = HWQ_CMP(sq->hwq.cons, &sq->hwq);
1706 if (sw_cons == cqe_cons)1698 if (sw_sq_cons == cqe_sq_cons)
1699 /* Done */
1707 break;1700 break;
1701
1702 swq = &sq->swq[sw_sq_cons];
1708 memset(cqe, 0, sizeof(*cqe));1703 memset(cqe, 0, sizeof(*cqe));
1709 cqe->opcode = CQ_BASE_CQE_TYPE_REQ;1704 cqe->opcode = CQ_BASE_CQE_TYPE_REQ;
1710 cqe->qp_handle = (u64)(unsigned long)qp;1705 cqe->qp_handle = (u64)(unsigned long)qp;
1711 cqe->src_qp = qp->id;1706 cqe->src_qp = qp->id;
1712 cqe->wr_id = sq->swq[sw_cons].wr_id;1707 cqe->wr_id = swq->wr_id;
1713 cqe->type = sq->swq[sw_cons].type;1708 if (cqe->wr_id == BNXT_QPLIB_FENCE_WRID)
1709 goto skip;
1710 cqe->type = swq->type;
1714 1711
1715 /* For the last CQE, check for status. For errors, regardless1712 /* For the last CQE, check for status. For errors, regardless
1716 * of the request being signaled or not, it must complete with1713 * of the request being signaled or not, it must complete with
1717 * the hwcqe error status1714 * the hwcqe error status
1718 */1715 */
1719 if (HWQ_CMP((sw_cons + 1), &sq->hwq) == cqe_cons &&1716 if (HWQ_CMP((sw_sq_cons + 1), &sq->hwq) == cqe_sq_cons &&
1720 hwcqe->status != CQ_REQ_STATUS_OK) {1717 hwcqe->status != CQ_REQ_STATUS_OK) {
1721 cqe->status = hwcqe->status;1718 cqe->status = hwcqe->status;
1722 dev_err(&cq->hwq.pdev->dev,1719 dev_err(&cq->hwq.pdev->dev,
1723 "QPLIB: FP: CQ Processed Req ");1720 "QPLIB: FP: CQ Processed Req ");
1724 dev_err(&cq->hwq.pdev->dev,1721 dev_err(&cq->hwq.pdev->dev,
1725 "QPLIB: wr_id[%d] = 0x%llx with status 0x%x",1722 "QPLIB: wr_id[%d] = 0x%llx with status 0x%x",
1726 sw_cons, cqe->wr_id, cqe->status);1723 sw_sq_cons, cqe->wr_id, cqe->status);
1727 cqe++;1724 cqe++;
1728 (*budget)--;1725 (*budget)--;
1729 sq->flush_in_progress = true;1726 sq->flush_in_progress = true;
1730 /* Must block new posting of SQ and RQ */1727 /* Must block new posting of SQ and RQ */
1731 qp->state = CMDQ_MODIFY_QP_NEW_STATE_ERR;1728 qp->state = CMDQ_MODIFY_QP_NEW_STATE_ERR;
1729 sq->condition = false;
1730 sq->single = false;
1732 } else {1731 } else {
1733 if (sq->swq[sw_cons].flags &1732 if (swq->flags & SQ_SEND_FLAGS_SIGNAL_COMP) {
1734 SQ_SEND_FLAGS_SIGNAL_COMP) {1733 /* Before we complete, do WA 9060 */
1734 if (do_wa9060(qp, cq, cq_cons, sw_sq_cons,
1735 cqe_sq_cons)) {
1736 *lib_qp = qp;
1737 goto out;
1738 }
1735 cqe->status = CQ_REQ_STATUS_OK;1739 cqe->status = CQ_REQ_STATUS_OK;
1736 cqe++;1740 cqe++;
1737 (*budget)--;1741 (*budget)--;
1738 }1742 }
1739 }1743 }
1744skip:
1740 sq->hwq.cons++;1745 sq->hwq.cons++;
1746 if (sq->single)
1747 break;
1741 }1748 }
1749out:
1742 *pcqe = cqe;1750 *pcqe = cqe;
1743 if (!*budget && HWQ_CMP(sq->hwq.cons, &sq->hwq) != cqe_cons) {1751 if (HWQ_CMP(sq->hwq.cons, &sq->hwq) != cqe_sq_cons) {
1744 /* Out of budget */1752 /* Out of budget */
1745 rc = -EAGAIN;1753 rc = -EAGAIN;
1746 goto done;1754 goto done;
1747 }1755 }
1756 /*
1757 * Back to normal completion mode only after it has completed all of
1758 * the WC for this CQE
1759 */
1760 sq->single = false;
1748 if (!sq->flush_in_progress)1761 if (!sq->flush_in_progress)
1749 goto done;1762 goto done;
1750flush:1763flush:
@@ -2074,7 +2087,7 @@ static int bnxt_qplib_cq_process_cutoff(struct bnxt_qplib_cq *cq, · 323 unmodified lines
2074}2087}
2075 2088
2076int bnxt_qplib_poll_cq(struct bnxt_qplib_cq *cq, struct bnxt_qplib_cqe *cqe,2089int bnxt_qplib_poll_cq(struct bnxt_qplib_cq *cq, struct bnxt_qplib_cqe *cqe,
2077 int num_cqes)2090 int num_cqes, struct bnxt_qplib_qp **lib_qp)
2078{2091{
2079 struct cq_base *hw_cqe, **hw_cqe_ptr;2092 struct cq_base *hw_cqe, **hw_cqe_ptr;
2080 unsigned long flags;2093 unsigned long flags;
@@ -2099,7 +2112,8 @@ int bnxt_qplib_poll_cq(struct bnxt_qplib_cq *cq, struct bnxt_qplib_cqe *cqe, · 18 unmodified lines
2099 case CQ_BASE_CQE_TYPE_REQ:2112 case CQ_BASE_CQE_TYPE_REQ:
2100 rc = bnxt_qplib_cq_process_req(cq,2113 rc = bnxt_qplib_cq_process_req(cq,
2101 (struct cq_req *)hw_cqe,2114 (struct cq_req *)hw_cqe,
2102 &cqe, &budget);2115 &cqe, &budget,
2116 sw_cons, lib_qp);
2103 break;2117 break;
2104 case CQ_BASE_CQE_TYPE_RES_RC:2118 case CQ_BASE_CQE_TYPE_RES_RC:
2105 rc = bnxt_qplib_cq_process_res_rc(cq,2119 rc = bnxt_qplib_cq_process_res_rc(cq,
drivers/infiniband/hw/bnxt_re/qplib_fp.h+17−1
@@ -88,6 +88,7 @@ struct bnxt_qplib_swq { · 87 unmodified lines
88 88
89struct bnxt_qplib_swqe {89struct bnxt_qplib_swqe {
90 /* General */90 /* General */
91#define BNXT_QPLIB_FENCE_WRID 0x46454E43 /* "FENC" */
91 u64 wr_id;92 u64 wr_id;
92 u8 reqs_type;93 u8 reqs_type;
93 u8 type;94 u8 type;
@@ -216,9 +217,16 @@ struct bnxt_qplib_q { · 122 unmodified lines
216 struct scatterlist *sglist;217 struct scatterlist *sglist;
217 u32 nmap;218 u32 nmap;
218 u32 max_wqe;219 u32 max_wqe;
220 u16 q_full_delta;
219 u16 max_sge;221 u16 max_sge;
220 u32 psn;222 u32 psn;
221 bool flush_in_progress;223 bool flush_in_progress;
224 bool condition;
225 bool single;
226 bool send_phantom;
227 u32 phantom_wqe_cnt;
228 u32 phantom_cqe_cnt;
229 u32 next_cq_cons;
222};230};
223 231
224struct bnxt_qplib_qp {232struct bnxt_qplib_qp {
@@ -242,6 +250,7 @@ struct bnxt_qplib_qp { · 17 unmodified lines
242 u8 timeout;250 u8 timeout;
243 u8 retry_cnt;251 u8 retry_cnt;
244 u8 rnr_retry;252 u8 rnr_retry;
253 u64 wqe_cnt;
245 u32 min_rnr_timer;254 u32 min_rnr_timer;
246 u32 max_rd_atomic;255 u32 max_rd_atomic;
247 u32 max_dest_rd_atomic;256 u32 max_dest_rd_atomic;
@@ -301,6 +310,13 @@ struct bnxt_qplib_qp { · 53 unmodified lines
301 (!!((hdr)->cqe_type_toggle & CQ_BASE_TOGGLE) == \310 (!!((hdr)->cqe_type_toggle & CQ_BASE_TOGGLE) == \
302 !((raw_cons) & (cp_bit)))311 !((raw_cons) & (cp_bit)))
303 312
313static inline bool bnxt_qplib_queue_full(struct bnxt_qplib_q *qplib_q)
314{
315 return HWQ_CMP((qplib_q->hwq.prod + qplib_q->q_full_delta),
316 &qplib_q->hwq) == HWQ_CMP(qplib_q->hwq.cons,
317 &qplib_q->hwq);
318}
319
304struct bnxt_qplib_cqe {320struct bnxt_qplib_cqe {
305 u8 status;321 u8 status;
306 u8 type;322 u8 type;
@@ -432,7 +448,7 @@ int bnxt_qplib_post_recv(struct bnxt_qplib_qp *qp, · 125 unmodified lines
432int bnxt_qplib_create_cq(struct bnxt_qplib_res *res, struct bnxt_qplib_cq *cq);448int bnxt_qplib_create_cq(struct bnxt_qplib_res *res, struct bnxt_qplib_cq *cq);
433int bnxt_qplib_destroy_cq(struct bnxt_qplib_res *res, struct bnxt_qplib_cq *cq);449int bnxt_qplib_destroy_cq(struct bnxt_qplib_res *res, struct bnxt_qplib_cq *cq);
434int bnxt_qplib_poll_cq(struct bnxt_qplib_cq *cq, struct bnxt_qplib_cqe *cqe,450int bnxt_qplib_poll_cq(struct bnxt_qplib_cq *cq, struct bnxt_qplib_cqe *cqe,
435 int num);451 int num, struct bnxt_qplib_qp **qp);
436void bnxt_qplib_req_notify_cq(struct bnxt_qplib_cq *cq, u32 arm_type);452void bnxt_qplib_req_notify_cq(struct bnxt_qplib_cq *cq, u32 arm_type);
437void bnxt_qplib_free_nq(struct bnxt_qplib_nq *nq);453void bnxt_qplib_free_nq(struct bnxt_qplib_nq *nq);
438int bnxt_qplib_alloc_nq(struct pci_dev *pdev, struct bnxt_qplib_nq *nq);454int bnxt_qplib_alloc_nq(struct pci_dev *pdev, struct bnxt_qplib_nq *nq);
drivers/infiniband/hw/bnxt_re/qplib_rcfw.c+164−150
@@ -39,72 +39,55 @@ · 38 unmodified lines
39#include <linux/spinlock.h>39#include <linux/spinlock.h>
40#include <linux/pci.h>40#include <linux/pci.h>
41#include <linux/prefetch.h>41#include <linux/prefetch.h>
42#include <linux/delay.h>
43
42#include "roce_hsi.h"44#include "roce_hsi.h"
43#include "qplib_res.h"45#include "qplib_res.h"
44#include "qplib_rcfw.h"46#include "qplib_rcfw.h"
45static void bnxt_qplib_service_creq(unsigned long data);47static void bnxt_qplib_service_creq(unsigned long data);
46 48
47/* Hardware communication channel */49/* Hardware communication channel */
48int bnxt_qplib_rcfw_wait_for_resp(struct bnxt_qplib_rcfw *rcfw, u16 cookie)50static int __wait_for_resp(struct bnxt_qplib_rcfw *rcfw, u16 cookie)
49{51{
50 u16 cbit;52 u16 cbit;
51 int rc;53 int rc;
52 54
53 cookie &= RCFW_MAX_COOKIE_VALUE;
54 cbit = cookie % RCFW_MAX_OUTSTANDING_CMD;55 cbit = cookie % RCFW_MAX_OUTSTANDING_CMD;
55 if (!test_bit(cbit, rcfw->cmdq_bitmap))
56 dev_warn(&rcfw->pdev->dev,
57 "QPLIB: CMD bit %d for cookie 0x%x is not set?",
58 cbit, cookie);
59
60 rc = wait_event_timeout(rcfw->waitq,56 rc = wait_event_timeout(rcfw->waitq,
61 !test_bit(cbit, rcfw->cmdq_bitmap),57 !test_bit(cbit, rcfw->cmdq_bitmap),
62 msecs_to_jiffies(RCFW_CMD_WAIT_TIME_MS));58 msecs_to_jiffies(RCFW_CMD_WAIT_TIME_MS));
63 if (!rc) {59 return rc ? 0 : -ETIMEDOUT;
64 dev_warn(&rcfw->pdev->dev,
65 "QPLIB: Bono Error: timeout %d msec, msg {0x%x}\n",
66 RCFW_CMD_WAIT_TIME_MS, cookie);
67 }
68
69 return rc;
70};60};
71 61
72int bnxt_qplib_rcfw_block_for_resp(struct bnxt_qplib_rcfw *rcfw, u16 cookie)62static int __block_for_resp(struct bnxt_qplib_rcfw *rcfw, u16 cookie)
73{63{
74 u32 count = -1;64 u32 count = RCFW_BLOCKED_CMD_WAIT_COUNT;
75 u16 cbit;65 u16 cbit;
76 66
77 cookie &= RCFW_MAX_COOKIE_VALUE;
78 cbit = cookie % RCFW_MAX_OUTSTANDING_CMD;67 cbit = cookie % RCFW_MAX_OUTSTANDING_CMD;
79 if (!test_bit(cbit, rcfw->cmdq_bitmap))68 if (!test_bit(cbit, rcfw->cmdq_bitmap))
80 goto done;69 goto done;
81 do {70 do {
71 mdelay(1); /* 1m sec */
82 bnxt_qplib_service_creq((unsigned long)rcfw);72 bnxt_qplib_service_creq((unsigned long)rcfw);
83 } while (test_bit(cbit, rcfw->cmdq_bitmap) && --count);73 } while (test_bit(cbit, rcfw->cmdq_bitmap) && --count);
84done:74done:
85 return count;75 return count ? 0 : -ETIMEDOUT;
86};76};
87 77
88void *bnxt_qplib_rcfw_send_message(struct bnxt_qplib_rcfw *rcfw,78static int __send_message(struct bnxt_qplib_rcfw *rcfw, struct cmdq_base *req,
89 struct cmdq_base *req, void **crsbe,79 struct creq_base *resp, void *sb, u8 is_block)
90 u8 is_block)
91{80{
92 struct bnxt_qplib_crsq *crsq = &rcfw->crsq;
93 struct bnxt_qplib_cmdqe *cmdqe, **cmdq_ptr;81 struct bnxt_qplib_cmdqe *cmdqe, **cmdq_ptr;
94 struct bnxt_qplib_hwq *cmdq = &rcfw->cmdq;82 struct bnxt_qplib_hwq *cmdq = &rcfw->cmdq;
95 struct bnxt_qplib_hwq *crsb = &rcfw->crsb;83 struct bnxt_qplib_crsq *crsqe;
96 struct bnxt_qplib_crsqe *crsqe = NULL;
97 struct bnxt_qplib_crsbe **crsb_ptr;
98 u32 sw_prod, cmdq_prod;84 u32 sw_prod, cmdq_prod;
99 u8 retry_cnt = 0xFF;
100 dma_addr_t dma_addr;
101 unsigned long flags;85 unsigned long flags;
102 u32 size, opcode;86 u32 size, opcode;
103 u16 cookie, cbit;87 u16 cookie, cbit;
104 int pg, idx;88 int pg, idx;
105 u8 *preq;89 u8 *preq;
106 90
107retry:
108 opcode = req->opcode;91 opcode = req->opcode;
109 if (!test_bit(FIRMWARE_INITIALIZED_FLAG, &rcfw->flags) &&92 if (!test_bit(FIRMWARE_INITIALIZED_FLAG, &rcfw->flags) &&
110 (opcode != CMDQ_BASE_OPCODE_QUERY_FUNC &&93 (opcode != CMDQ_BASE_OPCODE_QUERY_FUNC &&
@@ -112,63 +95,50 @@ retry: · 1 unmodified line
112 dev_err(&rcfw->pdev->dev,95 dev_err(&rcfw->pdev->dev,
113 "QPLIB: RCFW not initialized, reject opcode 0x%x",96 "QPLIB: RCFW not initialized, reject opcode 0x%x",
114 opcode);97 opcode);
115 return NULL;98 return -EINVAL;
116 }99 }
117 100
118 if (test_bit(FIRMWARE_INITIALIZED_FLAG, &rcfw->flags) &&101 if (test_bit(FIRMWARE_INITIALIZED_FLAG, &rcfw->flags) &&
119 opcode == CMDQ_BASE_OPCODE_INITIALIZE_FW) {102 opcode == CMDQ_BASE_OPCODE_INITIALIZE_FW) {
120 dev_err(&rcfw->pdev->dev, "QPLIB: RCFW already initialized!");103 dev_err(&rcfw->pdev->dev, "QPLIB: RCFW already initialized!");
121 return NULL;104 return -EINVAL;
122 }105 }
123 106
124 /* Cmdq are in 16-byte units, each request can consume 1 or more107 /* Cmdq are in 16-byte units, each request can consume 1 or more
125 * cmdqe108 * cmdqe
126 */109 */
127 spin_lock_irqsave(&cmdq->lock, flags);110 spin_lock_irqsave(&cmdq->lock, flags);
128 if (req->cmd_size > cmdq->max_elements -111 if (req->cmd_size >= HWQ_FREE_SLOTS(cmdq)) {
129 ((HWQ_CMP(cmdq->prod, cmdq) - HWQ_CMP(cmdq->cons, cmdq)) &
130 (cmdq->max_elements - 1))) {
131 dev_err(&rcfw->pdev->dev, "QPLIB: RCFW: CMDQ is full!");112 dev_err(&rcfw->pdev->dev, "QPLIB: RCFW: CMDQ is full!");
132 spin_unlock_irqrestore(&cmdq->lock, flags);113 spin_unlock_irqrestore(&cmdq->lock, flags);
133 114 return -EAGAIN;
134 if (!retry_cnt--)
135 return NULL;
136 goto retry;
137 }115 }
138 116
139 retry_cnt = 0xFF;
140 117
141 cookie = atomic_inc_return(&rcfw->seq_num) & RCFW_MAX_COOKIE_VALUE;118 cookie = rcfw->seq_num & RCFW_MAX_COOKIE_VALUE;
142 cbit = cookie % RCFW_MAX_OUTSTANDING_CMD;119 cbit = cookie % RCFW_MAX_OUTSTANDING_CMD;
143 if (is_block)120 if (is_block)
144 cookie |= RCFW_CMD_IS_BLOCKING;121 cookie |= RCFW_CMD_IS_BLOCKING;
122
123 set_bit(cbit, rcfw->cmdq_bitmap);
145 req->cookie = cpu_to_le16(cookie);124 req->cookie = cpu_to_le16(cookie);
146 if (test_and_set_bit(cbit, rcfw->cmdq_bitmap)) {125 crsqe = &rcfw->crsqe_tbl[cbit];
147 dev_err(&rcfw->pdev->dev,126 if (crsqe->resp) {
148 "QPLIB: RCFW MAX outstanding cmd reached!");
149 atomic_dec(&rcfw->seq_num);
150 spin_unlock_irqrestore(&cmdq->lock, flags);127 spin_unlock_irqrestore(&cmdq->lock, flags);
151 128 return -EBUSY;
152 if (!retry_cnt--)
153 return NULL;
154 goto retry;
155 }129 }
156 /* Reserve a resp buffer slot if requested */130 memset(resp, 0, sizeof(*resp));
157 if (req->resp_size && crsbe) {131 crsqe->resp = (struct creq_qp_event *)resp;
158 spin_lock(&crsb->lock);132 crsqe->resp->cookie = req->cookie;
159 sw_prod = HWQ_CMP(crsb->prod, crsb);133 crsqe->req_size = req->cmd_size;
160 crsb_ptr = (struct bnxt_qplib_crsbe **)crsb->pbl_ptr;134 if (req->resp_size && sb) {
161 *crsbe = (void *)&crsb_ptr[get_crsb_pg(sw_prod)]135 struct bnxt_qplib_rcfw_sbuf *sbuf = sb;
162 [get_crsb_idx(sw_prod)];136
163 bnxt_qplib_crsb_dma_next(crsb->pbl_dma_ptr, sw_prod, &dma_addr);137 req->resp_addr = cpu_to_le64(sbuf->dma_addr);
164 req->resp_addr = cpu_to_le64(dma_addr);138 req->resp_size = (sbuf->size + BNXT_QPLIB_CMDQE_UNITS - 1) /
165 crsb->prod++;139 BNXT_QPLIB_CMDQE_UNITS;
166 spin_unlock(&crsb->lock);
167
168 req->resp_size = (sizeof(struct bnxt_qplib_crsbe) +
169 BNXT_QPLIB_CMDQE_UNITS - 1) /
170 BNXT_QPLIB_CMDQE_UNITS;
171 }140 }
141
172 cmdq_ptr = (struct bnxt_qplib_cmdqe **)cmdq->pbl_ptr;142 cmdq_ptr = (struct bnxt_qplib_cmdqe **)cmdq->pbl_ptr;
173 preq = (u8 *)req;143 preq = (u8 *)req;
174 size = req->cmd_size * BNXT_QPLIB_CMDQE_UNITS;144 size = req->cmd_size * BNXT_QPLIB_CMDQE_UNITS;
@@ -190,23 +160,24 @@ retry: · 15 unmodified lines
190 preq += min_t(u32, size, sizeof(*cmdqe));160 preq += min_t(u32, size, sizeof(*cmdqe));
191 size -= min_t(u32, size, sizeof(*cmdqe));161 size -= min_t(u32, size, sizeof(*cmdqe));
192 cmdq->prod++;162 cmdq->prod++;
163 rcfw->seq_num++;
193 } while (size > 0);164 } while (size > 0);
194 165
166 rcfw->seq_num++;
167
195 cmdq_prod = cmdq->prod;168 cmdq_prod = cmdq->prod;
196 if (rcfw->flags & FIRMWARE_FIRST_FLAG) {169 if (rcfw->flags & FIRMWARE_FIRST_FLAG) {
197 /* The very first doorbell write is required to set this flag170 /* The very first doorbell write
198 * which prompts the FW to reset its internal pointers171 * is required to set this flag
172 * which prompts the FW to reset
173 * its internal pointers
199 */174 */
200 cmdq_prod |= FIRMWARE_FIRST_FLAG;175 cmdq_prod |= FIRMWARE_FIRST_FLAG;
201 rcfw->flags &= ~FIRMWARE_FIRST_FLAG;176 rcfw->flags &= ~FIRMWARE_FIRST_FLAG;
202 }177 }
203 sw_prod = HWQ_CMP(crsq->prod, crsq);
204 crsqe = &crsq->crsq[sw_prod];
205 memset(crsqe, 0, sizeof(*crsqe));
206 crsq->prod++;
207 crsqe->req_size = req->cmd_size;
208 178
209 /* ring CMDQ DB */179 /* ring CMDQ DB */
180 wmb();
210 writel(cmdq_prod, rcfw->cmdq_bar_reg_iomem +181 writel(cmdq_prod, rcfw->cmdq_bar_reg_iomem +
211 rcfw->cmdq_bar_reg_prod_off);182 rcfw->cmdq_bar_reg_prod_off);
212 writel(RCFW_CMDQ_TRIG_VAL, rcfw->cmdq_bar_reg_iomem +183 writel(RCFW_CMDQ_TRIG_VAL, rcfw->cmdq_bar_reg_iomem +
@@ -214,9 +185,56 @@ retry: · 1 unmodified line
214done:185done:
215 spin_unlock_irqrestore(&cmdq->lock, flags);186 spin_unlock_irqrestore(&cmdq->lock, flags);
216 /* Return the CREQ response pointer */187 /* Return the CREQ response pointer */
217 return crsqe ? &crsqe->qp_event : NULL;188 return 0;
218}189}
219 190
191int bnxt_qplib_rcfw_send_message(struct bnxt_qplib_rcfw *rcfw,
192 struct cmdq_base *req,
193 struct creq_base *resp,
194 void *sb, u8 is_block)
195{
196 struct creq_qp_event *evnt = (struct creq_qp_event *)resp;
197 u16 cookie;
198 u8 opcode, retry_cnt = 0xFF;
199 int rc = 0;
200
201 do {
202 opcode = req->opcode;
203 rc = __send_message(rcfw, req, resp, sb, is_block);
204 cookie = le16_to_cpu(req->cookie) & RCFW_MAX_COOKIE_VALUE;
205 if (!rc)
206 break;
207
208 if (!retry_cnt || (rc != -EAGAIN && rc != -EBUSY)) {
209 /* send failed */
210 dev_err(&rcfw->pdev->dev, "QPLIB: cmdq[%#x]=%#x send failed",
211 cookie, opcode);
212 return rc;
213 }
214 is_block ? mdelay(1) : usleep_range(500, 1000);
215
216 } while (retry_cnt--);
217
218 if (is_block)
219 rc = __block_for_resp(rcfw, cookie);
220 else
221 rc = __wait_for_resp(rcfw, cookie);
222 if (rc) {
223 /* timed out */
224 dev_err(&rcfw->pdev->dev, "QPLIB: cmdq[%#x]=%#x timedout (%d)msec",
225 cookie, opcode, RCFW_CMD_WAIT_TIME_MS);
226 return rc;
227 }
228
229 if (evnt->status) {
230 /* failed with status */
231 dev_err(&rcfw->pdev->dev, "QPLIB: cmdq[%#x]=%#x status %#x",
232 cookie, opcode, evnt->status);
233 rc = -EFAULT;
234 }
235
236 return rc;
237}
220/* Completions */238/* Completions */
221static int bnxt_qplib_process_func_event(struct bnxt_qplib_rcfw *rcfw,239static int bnxt_qplib_process_func_event(struct bnxt_qplib_rcfw *rcfw,
222 struct creq_func_event *func_event)240 struct creq_func_event *func_event)
@@ -260,12 +278,12 @@ static int bnxt_qplib_process_func_event(struct bnxt_qplib_rcfw *rcfw, · 37 unmodified lines
260static int bnxt_qplib_process_qp_event(struct bnxt_qplib_rcfw *rcfw,278static int bnxt_qplib_process_qp_event(struct bnxt_qplib_rcfw *rcfw,
261 struct creq_qp_event *qp_event)279 struct creq_qp_event *qp_event)
262{280{
263 struct bnxt_qplib_crsq *crsq = &rcfw->crsq;
264 struct bnxt_qplib_hwq *cmdq = &rcfw->cmdq;281 struct bnxt_qplib_hwq *cmdq = &rcfw->cmdq;
265 struct bnxt_qplib_crsqe *crsqe;282 struct bnxt_qplib_crsq *crsqe;
266 u16 cbit, cookie, blocked = 0;
267 unsigned long flags;283 unsigned long flags;
268 u32 sw_cons;284 u16 cbit, blocked = 0;
285 u16 cookie;
286 __le16 mcookie;
269 287
270 switch (qp_event->event) {288 switch (qp_event->event) {
271 case CREQ_QP_EVENT_EVENT_QP_ERROR_NOTIFICATION:289 case CREQ_QP_EVENT_EVENT_QP_ERROR_NOTIFICATION:
@@ -275,24 +293,31 @@ static int bnxt_qplib_process_qp_event(struct bnxt_qplib_rcfw *rcfw, · 3 unmodified lines
275 default:293 default:
276 /* Command Response */294 /* Command Response */
277 spin_lock_irqsave(&cmdq->lock, flags);295 spin_lock_irqsave(&cmdq->lock, flags);
278 sw_cons = HWQ_CMP(crsq->cons, crsq);296 cookie = le16_to_cpu(qp_event->cookie);
279 crsqe = &crsq->crsq[sw_cons];297 mcookie = qp_event->cookie;
280 crsq->cons++;
281 memcpy(&crsqe->qp_event, qp_event, sizeof(crsqe->qp_event));
282
283 cookie = le16_to_cpu(crsqe->qp_event.cookie);
284 blocked = cookie & RCFW_CMD_IS_BLOCKING;298 blocked = cookie & RCFW_CMD_IS_BLOCKING;
285 cookie &= RCFW_MAX_COOKIE_VALUE;299 cookie &= RCFW_MAX_COOKIE_VALUE;
286 cbit = cookie % RCFW_MAX_OUTSTANDING_CMD;300 cbit = cookie % RCFW_MAX_OUTSTANDING_CMD;
301 crsqe = &rcfw->crsqe_tbl[cbit];
302 if (crsqe->resp &&
303 crsqe->resp->cookie == mcookie) {
304 memcpy(crsqe->resp, qp_event, sizeof(*qp_event));
305 crsqe->resp = NULL;
306 } else {
307 dev_err(&rcfw->pdev->dev,
308 "QPLIB: CMD %s resp->cookie = %#x, evnt->cookie = %#x",
309 crsqe->resp ? "mismatch" : "collision",
310 crsqe->resp ? crsqe->resp->cookie : 0, mcookie);
311 }
287 if (!test_and_clear_bit(cbit, rcfw->cmdq_bitmap))312 if (!test_and_clear_bit(cbit, rcfw->cmdq_bitmap))
288 dev_warn(&rcfw->pdev->dev,313 dev_warn(&rcfw->pdev->dev,
289 "QPLIB: CMD bit %d was not requested", cbit);314 "QPLIB: CMD bit %d was not requested", cbit);
290
291 cmdq->cons += crsqe->req_size;315 cmdq->cons += crsqe->req_size;
292 spin_unlock_irqrestore(&cmdq->lock, flags);316 crsqe->req_size = 0;
317
293 if (!blocked)318 if (!blocked)
294 wake_up(&rcfw->waitq);319 wake_up(&rcfw->waitq);
295 break;320 spin_unlock_irqrestore(&cmdq->lock, flags);
296 }321 }
297 return 0;322 return 0;
298}323}
@@ -305,12 +330,12 @@ static void bnxt_qplib_service_creq(unsigned long data) · 6 unmodified lines
305 struct creq_base *creqe, **creq_ptr;330 struct creq_base *creqe, **creq_ptr;
306 u32 sw_cons, raw_cons;331 u32 sw_cons, raw_cons;
307 unsigned long flags;332 unsigned long flags;
308 u32 type;333 u32 type, budget = CREQ_ENTRY_POLL_BUDGET;
309 334
310 /* Service the CREQ until empty */335 /* Service the CREQ until budget is over */
311 spin_lock_irqsave(&creq->lock, flags);336 spin_lock_irqsave(&creq->lock, flags);
312 raw_cons = creq->cons;337 raw_cons = creq->cons;
313 while (1) {338 while (budget > 0) {
314 sw_cons = HWQ_CMP(raw_cons, creq);339 sw_cons = HWQ_CMP(raw_cons, creq);
315 creq_ptr = (struct creq_base **)creq->pbl_ptr;340 creq_ptr = (struct creq_base **)creq->pbl_ptr;
316 creqe = &creq_ptr[get_creq_pg(sw_cons)][get_creq_idx(sw_cons)];341 creqe = &creq_ptr[get_creq_pg(sw_cons)][get_creq_idx(sw_cons)];
@@ -320,15 +345,9 @@ static void bnxt_qplib_service_creq(unsigned long data) · 3 unmodified lines
320 type = creqe->type & CREQ_BASE_TYPE_MASK;345 type = creqe->type & CREQ_BASE_TYPE_MASK;
321 switch (type) {346 switch (type) {
322 case CREQ_BASE_TYPE_QP_EVENT:347 case CREQ_BASE_TYPE_QP_EVENT:
323 if (!bnxt_qplib_process_qp_event348 bnxt_qplib_process_qp_event
324 (rcfw, (struct creq_qp_event *)creqe))349 (rcfw, (struct creq_qp_event *)creqe);
325 rcfw->creq_qp_event_processed++;350 rcfw->creq_qp_event_processed++;
326 else {
327 dev_warn(&rcfw->pdev->dev, "QPLIB: crsqe with");
328 dev_warn(&rcfw->pdev->dev,
329 "QPLIB: type = 0x%x not handled",
330 type);
331 }
332 break;351 break;
333 case CREQ_BASE_TYPE_FUNC_EVENT:352 case CREQ_BASE_TYPE_FUNC_EVENT:
334 if (!bnxt_qplib_process_func_event353 if (!bnxt_qplib_process_func_event
@@ -346,7 +365,9 @@ static void bnxt_qplib_service_creq(unsigned long data) · 11 unmodified lines
346 break;365 break;
347 }366 }
348 raw_cons++;367 raw_cons++;
368 budget--;
349 }369 }
370
350 if (creq->cons != raw_cons) {371 if (creq->cons != raw_cons) {
351 creq->cons = raw_cons;372 creq->cons = raw_cons;
352 CREQ_DB_REARM(rcfw->creq_bar_reg_iomem, raw_cons,373 CREQ_DB_REARM(rcfw->creq_bar_reg_iomem, raw_cons,
@@ -375,23 +396,16 @@ static irqreturn_t bnxt_qplib_creq_irq(int irq, void *dev_instance) · 22 unmodified lines
375/* RCFW */396/* RCFW */
376int bnxt_qplib_deinit_rcfw(struct bnxt_qplib_rcfw *rcfw)397int bnxt_qplib_deinit_rcfw(struct bnxt_qplib_rcfw *rcfw)
377{398{
378 struct creq_deinitialize_fw_resp *resp;
379 struct cmdq_deinitialize_fw req;399 struct cmdq_deinitialize_fw req;
400 struct creq_deinitialize_fw_resp resp;
380 u16 cmd_flags = 0;401 u16 cmd_flags = 0;
402 int rc;
381 403
382 RCFW_CMD_PREP(req, DEINITIALIZE_FW, cmd_flags);404 RCFW_CMD_PREP(req, DEINITIALIZE_FW, cmd_flags);
383 resp = (struct creq_deinitialize_fw_resp *)405 rc = bnxt_qplib_rcfw_send_message(rcfw, (void *)&req, (void *)&resp,
384 bnxt_qplib_rcfw_send_message(rcfw, (void *)&req,406 NULL, 0);
385 NULL, 0);407 if (rc)
386 if (!resp)408 return rc;
387 return -EINVAL;
388
389 if (!bnxt_qplib_rcfw_wait_for_resp(rcfw, le16_to_cpu(req.cookie)))
390 return -ETIMEDOUT;
391
392 if (resp->status ||
393 le16_to_cpu(resp->cookie) != le16_to_cpu(req.cookie))
394 return -EFAULT;
395 409
396 clear_bit(FIRMWARE_INITIALIZED_FLAG, &rcfw->flags);410 clear_bit(FIRMWARE_INITIALIZED_FLAG, &rcfw->flags);
397 return 0;411 return 0;
@@ -417,9 +431,10 @@ static int __get_pbl_pg_idx(struct bnxt_qplib_pbl *pbl) · 19 unmodified lines
417int bnxt_qplib_init_rcfw(struct bnxt_qplib_rcfw *rcfw,431int bnxt_qplib_init_rcfw(struct bnxt_qplib_rcfw *rcfw,
418 struct bnxt_qplib_ctx *ctx, int is_virtfn)432 struct bnxt_qplib_ctx *ctx, int is_virtfn)
419{433{
420 struct creq_initialize_fw_resp *resp;
421 struct cmdq_initialize_fw req;434 struct cmdq_initialize_fw req;
435 struct creq_initialize_fw_resp resp;
422 u16 cmd_flags = 0, level;436 u16 cmd_flags = 0, level;
437 int rc;
423 438
424 RCFW_CMD_PREP(req, INITIALIZE_FW, cmd_flags);439 RCFW_CMD_PREP(req, INITIALIZE_FW, cmd_flags);
425 440
@@ -482,37 +497,19 @@ int bnxt_qplib_init_rcfw(struct bnxt_qplib_rcfw *rcfw, · 56 unmodified lines
482 497
483skip_ctx_setup:498skip_ctx_setup:
484 req.stat_ctx_id = cpu_to_le32(ctx->stats.fw_id);499 req.stat_ctx_id = cpu_to_le32(ctx->stats.fw_id);
485 resp = (struct creq_initialize_fw_resp *)500 rc = bnxt_qplib_rcfw_send_message(rcfw, (void *)&req, (void *)&resp,
486 bnxt_qplib_rcfw_send_message(rcfw, (void *)&req,501 NULL, 0);
487 NULL, 0);502 if (rc)
488 if (!resp) {503 return rc;
489 dev_err(&rcfw->pdev->dev,
490 "QPLIB: RCFW: INITIALIZE_FW send failed");
491 return -EINVAL;
492 }
493 if (!bnxt_qplib_rcfw_wait_for_resp(rcfw, le16_to_cpu(req.cookie))) {
494 /* Cmd timed out */
495 dev_err(&rcfw->pdev->dev,
496 "QPLIB: RCFW: INITIALIZE_FW timed out");
497 return -ETIMEDOUT;
498 }
499 if (resp->status ||
500 le16_to_cpu(resp->cookie) != le16_to_cpu(req.cookie)) {
501 dev_err(&rcfw->pdev->dev,
502 "QPLIB: RCFW: INITIALIZE_FW failed");
503 return -EINVAL;
504 }
505 set_bit(FIRMWARE_INITIALIZED_FLAG, &rcfw->flags);504 set_bit(FIRMWARE_INITIALIZED_FLAG, &rcfw->flags);
506 return 0;505 return 0;
507}506}
508 507
509void bnxt_qplib_free_rcfw_channel(struct bnxt_qplib_rcfw *rcfw)508void bnxt_qplib_free_rcfw_channel(struct bnxt_qplib_rcfw *rcfw)
510{509{
511 bnxt_qplib_free_hwq(rcfw->pdev, &rcfw->crsb);510 kfree(rcfw->crsqe_tbl);
512 kfree(rcfw->crsq.crsq);
513 bnxt_qplib_free_hwq(rcfw->pdev, &rcfw->cmdq);511 bnxt_qplib_free_hwq(rcfw->pdev, &rcfw->cmdq);
514 bnxt_qplib_free_hwq(rcfw->pdev, &rcfw->creq);512 bnxt_qplib_free_hwq(rcfw->pdev, &rcfw->creq);
515
516 rcfw->pdev = NULL;513 rcfw->pdev = NULL;
517}514}
518 515
@@ -539,21 +536,11 @@ int bnxt_qplib_alloc_rcfw_channel(struct pci_dev *pdev, · 20 unmodified lines
539 goto fail;536 goto fail;
540 }537 }
541 538
542 rcfw->crsq.max_elements = rcfw->cmdq.max_elements;539 rcfw->crsqe_tbl = kcalloc(rcfw->cmdq.max_elements,
543 rcfw->crsq.crsq = kcalloc(rcfw->crsq.max_elements,540 sizeof(*rcfw->crsqe_tbl), GFP_KERNEL);
544 sizeof(*rcfw->crsq.crsq), GFP_KERNEL);541 if (!rcfw->crsqe_tbl)
545 if (!rcfw->crsq.crsq)
546 goto fail;542 goto fail;
547 543
548 rcfw->crsb.max_elements = BNXT_QPLIB_CRSBE_MAX_CNT;
549 if (bnxt_qplib_alloc_init_hwq(rcfw->pdev, &rcfw->crsb, NULL, 0,
550 &rcfw->crsb.max_elements,
551 BNXT_QPLIB_CRSBE_UNITS, 0, PAGE_SIZE,
552 HWQ_TYPE_CTX)) {
553 dev_err(&rcfw->pdev->dev,
554 "QPLIB: HW channel CRSB allocation failed");
555 goto fail;
556 }
557 return 0;544 return 0;
558 545
559fail:546fail:
@@ -606,7 +593,7 @@ int bnxt_qplib_enable_rcfw_channel(struct pci_dev *pdev, · 46 unmodified lines
606 int rc;593 int rc;
607 594
608 /* General */595 /* General */
609 atomic_set(&rcfw->seq_num, 0);596 rcfw->seq_num = 0;
610 rcfw->flags = FIRMWARE_FIRST_FLAG;597 rcfw->flags = FIRMWARE_FIRST_FLAG;
611 bmap_size = BITS_TO_LONGS(RCFW_MAX_OUTSTANDING_CMD *598 bmap_size = BITS_TO_LONGS(RCFW_MAX_OUTSTANDING_CMD *
612 sizeof(unsigned long));599 sizeof(unsigned long));
@@ -636,10 +623,6 @@ int bnxt_qplib_enable_rcfw_channel(struct pci_dev *pdev, · 23 unmodified lines
636 623
637 rcfw->cmdq_bar_reg_trig_off = RCFW_COMM_TRIG_OFFSET;624 rcfw->cmdq_bar_reg_trig_off = RCFW_COMM_TRIG_OFFSET;
638 625
639 /* CRSQ */
640 rcfw->crsq.prod = 0;
641 rcfw->crsq.cons = 0;
642
643 /* CREQ */626 /* CREQ */
644 rcfw->creq_bar_reg = RCFW_COMM_CONS_PCI_BAR_REGION;627 rcfw->creq_bar_reg = RCFW_COMM_CONS_PCI_BAR_REGION;
645 res_base = pci_resource_start(pdev, rcfw->creq_bar_reg);628 res_base = pci_resource_start(pdev, rcfw->creq_bar_reg);
@@ -692,3 +675,34 @@ int bnxt_qplib_enable_rcfw_channel(struct pci_dev *pdev, · 46 unmodified lines
692 __iowrite32_copy(rcfw->cmdq_bar_reg_iomem, &init, sizeof(init) / 4);675 __iowrite32_copy(rcfw->cmdq_bar_reg_iomem, &init, sizeof(init) / 4);
693 return 0;676 return 0;
694}677}
678
679struct bnxt_qplib_rcfw_sbuf *bnxt_qplib_rcfw_alloc_sbuf(
680 struct bnxt_qplib_rcfw *rcfw,
681 u32 size)
682{
683 struct bnxt_qplib_rcfw_sbuf *sbuf;
684
685 sbuf = kzalloc(sizeof(*sbuf), GFP_ATOMIC);
686 if (!sbuf)
687 return NULL;
688
689 sbuf->size = size;
690 sbuf->sb = dma_zalloc_coherent(&rcfw->pdev->dev, sbuf->size,
691 &sbuf->dma_addr, GFP_ATOMIC);
692 if (!sbuf->sb)
693 goto bail;
694
695 return sbuf;
696bail:
697 kfree(sbuf);
698 return NULL;
699}
700
701void bnxt_qplib_rcfw_free_sbuf(struct bnxt_qplib_rcfw *rcfw,
702 struct bnxt_qplib_rcfw_sbuf *sbuf)
703{
704 if (sbuf->sb)
705 dma_free_coherent(&rcfw->pdev->dev, sbuf->size,
706 sbuf->sb, sbuf->dma_addr);
707 kfree(sbuf);
708}
drivers/infiniband/hw/bnxt_re/qplib_rcfw.h+20−41
@@ -73,6 +73,7 @@ · 72 unmodified lines
73#define RCFW_MAX_OUTSTANDING_CMD BNXT_QPLIB_CMDQE_MAX_CNT73#define RCFW_MAX_OUTSTANDING_CMD BNXT_QPLIB_CMDQE_MAX_CNT
74#define RCFW_MAX_COOKIE_VALUE 0x7FFF74#define RCFW_MAX_COOKIE_VALUE 0x7FFF
75#define RCFW_CMD_IS_BLOCKING 0x800075#define RCFW_CMD_IS_BLOCKING 0x8000
76#define RCFW_BLOCKED_CMD_WAIT_COUNT 0x4E20
76 77
77/* Cmdq contains a fix number of a 16-Byte slots */78/* Cmdq contains a fix number of a 16-Byte slots */
78struct bnxt_qplib_cmdqe {79struct bnxt_qplib_cmdqe {
@@ -94,32 +95,6 @@ struct bnxt_qplib_crsbe { · 15 unmodified lines
94 u8 data[1024];95 u8 data[1024];
95};96};
96 97
97/* CRSQ SB */
98#define BNXT_QPLIB_CRSBE_MAX_CNT 4
99#define BNXT_QPLIB_CRSBE_UNITS sizeof(struct bnxt_qplib_crsbe)
100#define BNXT_QPLIB_CRSBE_CNT_PER_PG (PAGE_SIZE / BNXT_QPLIB_CRSBE_UNITS)
101
102#define MAX_CRSB_IDX (BNXT_QPLIB_CRSBE_MAX_CNT - 1)
103#define MAX_CRSB_IDX_PER_PG (BNXT_QPLIB_CRSBE_CNT_PER_PG - 1)
104
105static inline u32 get_crsb_pg(u32 val)
106{
107 return (val & ~MAX_CRSB_IDX_PER_PG) / BNXT_QPLIB_CRSBE_CNT_PER_PG;
108}
109
110static inline u32 get_crsb_idx(u32 val)
111{
112 return val & MAX_CRSB_IDX_PER_PG;
113}
114
115static inline void bnxt_qplib_crsb_dma_next(dma_addr_t *pg_map_arr,
116 u32 prod, dma_addr_t *dma_addr)
117{
118 *dma_addr = pg_map_arr[(prod) / BNXT_QPLIB_CRSBE_CNT_PER_PG];
119 *dma_addr += ((prod) % BNXT_QPLIB_CRSBE_CNT_PER_PG) *
120 BNXT_QPLIB_CRSBE_UNITS;
121}
122
123/* CREQ */98/* CREQ */
124/* Allocate 1 per QP for async error notification for now */99/* Allocate 1 per QP for async error notification for now */
125#define BNXT_QPLIB_CREQE_MAX_CNT (64 * 1024)100#define BNXT_QPLIB_CREQE_MAX_CNT (64 * 1024)
@@ -158,17 +133,19 @@ static inline u32 get_creq_idx(u32 val) · 32 unmodified lines
158#define CREQ_DB(db, raw_cons, cp_bit) \133#define CREQ_DB(db, raw_cons, cp_bit) \
159 writel(CREQ_DB_CP_FLAGS | ((raw_cons) & ((cp_bit) - 1)), db)134 writel(CREQ_DB_CP_FLAGS | ((raw_cons) & ((cp_bit) - 1)), db)
160 135
136#define CREQ_ENTRY_POLL_BUDGET 0x100
137
161/* HWQ */138/* HWQ */
162struct bnxt_qplib_crsqe {139
163 struct creq_qp_event qp_event;140struct bnxt_qplib_crsq {
141 struct creq_qp_event *resp;
164 u32 req_size;142 u32 req_size;
165};143};
166 144
167struct bnxt_qplib_crsq {145struct bnxt_qplib_rcfw_sbuf {
168 struct bnxt_qplib_crsqe *crsq;146 void *sb;
169 u32 prod;147 dma_addr_t dma_addr;
170 u32 cons;148 u32 size;
171 u32 max_elements;
172};149};
173 150
174/* RCFW Communication Channels */151/* RCFW Communication Channels */
@@ -185,7 +162,7 @@ struct bnxt_qplib_rcfw { · 10 unmodified lines
185 wait_queue_head_t waitq;162 wait_queue_head_t waitq;
186 int (*aeq_handler)(struct bnxt_qplib_rcfw *,163 int (*aeq_handler)(struct bnxt_qplib_rcfw *,
187 struct creq_func_event *);164 struct creq_func_event *);
188 atomic_t seq_num;165 u32 seq_num;
189 166
190 /* Bar region info */167 /* Bar region info */
191 void __iomem *cmdq_bar_reg_iomem;168 void __iomem *cmdq_bar_reg_iomem;
@@ -203,8 +180,7 @@ struct bnxt_qplib_rcfw { · 11 unmodified lines
203 180
204 /* Actual Cmd and Resp Queues */181 /* Actual Cmd and Resp Queues */
205 struct bnxt_qplib_hwq cmdq;182 struct bnxt_qplib_hwq cmdq;
206 struct bnxt_qplib_crsq crsq;183 struct bnxt_qplib_crsq *crsqe_tbl;
207 struct bnxt_qplib_hwq crsb;
208};184};
209 185
210void bnxt_qplib_free_rcfw_channel(struct bnxt_qplib_rcfw *rcfw);186void bnxt_qplib_free_rcfw_channel(struct bnxt_qplib_rcfw *rcfw);
@@ -219,11 +195,14 @@ int bnxt_qplib_enable_rcfw_channel(struct pci_dev *pdev, · 8 unmodified lines
219 (struct bnxt_qplib_rcfw *,195 (struct bnxt_qplib_rcfw *,
220 struct creq_func_event *));196 struct creq_func_event *));
221 197
222int bnxt_qplib_rcfw_block_for_resp(struct bnxt_qplib_rcfw *rcfw, u16 cookie);198struct bnxt_qplib_rcfw_sbuf *bnxt_qplib_rcfw_alloc_sbuf(
223int bnxt_qplib_rcfw_wait_for_resp(struct bnxt_qplib_rcfw *rcfw, u16 cookie);199 struct bnxt_qplib_rcfw *rcfw,
224void *bnxt_qplib_rcfw_send_message(struct bnxt_qplib_rcfw *rcfw,200 u32 size);
225 struct cmdq_base *req, void **crsbe,201void bnxt_qplib_rcfw_free_sbuf(struct bnxt_qplib_rcfw *rcfw,
226 u8 is_block);202 struct bnxt_qplib_rcfw_sbuf *sbuf);
203int bnxt_qplib_rcfw_send_message(struct bnxt_qplib_rcfw *rcfw,
204 struct cmdq_base *req, struct creq_base *resp,
205 void *sbuf, u8 is_block);
227 206
228int bnxt_qplib_deinit_rcfw(struct bnxt_qplib_rcfw *rcfw);207int bnxt_qplib_deinit_rcfw(struct bnxt_qplib_rcfw *rcfw);
229int bnxt_qplib_init_rcfw(struct bnxt_qplib_rcfw *rcfw,208int bnxt_qplib_init_rcfw(struct bnxt_qplib_rcfw *rcfw,
drivers/infiniband/hw/bnxt_re/qplib_res.h+4−0
@@ -48,6 +48,10 @@ extern const struct bnxt_qplib_gid bnxt_qplib_gid_zero; · 47 unmodified lines
48 48
49#define HWQ_CMP(idx, hwq) ((idx) & ((hwq)->max_elements - 1))49#define HWQ_CMP(idx, hwq) ((idx) & ((hwq)->max_elements - 1))
50 50
51#define HWQ_FREE_SLOTS(hwq) (hwq->max_elements - \
52 ((HWQ_CMP(hwq->prod, hwq)\
53 - HWQ_CMP(hwq->cons, hwq))\
54 & (hwq->max_elements - 1)))
51enum bnxt_qplib_hwq_type {55enum bnxt_qplib_hwq_type {
52 HWQ_TYPE_CTX,56 HWQ_TYPE_CTX,
53 HWQ_TYPE_QUEUE,57 HWQ_TYPE_QUEUE,
drivers/infiniband/hw/bnxt_re/qplib_sp.c+83−250
@@ -55,37 +55,30 @@ int bnxt_qplib_get_dev_attr(struct bnxt_qplib_rcfw *rcfw, · 54 unmodified lines
55 struct bnxt_qplib_dev_attr *attr)55 struct bnxt_qplib_dev_attr *attr)
56{56{
57 struct cmdq_query_func req;57 struct cmdq_query_func req;
58 struct creq_query_func_resp *resp;58 struct creq_query_func_resp resp;
59 struct bnxt_qplib_rcfw_sbuf *sbuf;
59 struct creq_query_func_resp_sb *sb;60 struct creq_query_func_resp_sb *sb;
60 u16 cmd_flags = 0;61 u16 cmd_flags = 0;
61 u32 temp;62 u32 temp;
62 u8 *tqm_alloc;63 u8 *tqm_alloc;
63 int i;64 int i, rc = 0;
64 65
65 RCFW_CMD_PREP(req, QUERY_FUNC, cmd_flags);66 RCFW_CMD_PREP(req, QUERY_FUNC, cmd_flags);
66 67
67 req.resp_size = sizeof(*sb) / BNXT_QPLIB_CMDQE_UNITS;68 sbuf = bnxt_qplib_rcfw_alloc_sbuf(rcfw, sizeof(*sb));
68 resp = (struct creq_query_func_resp *)69 if (!sbuf) {
69 bnxt_qplib_rcfw_send_message(rcfw, (void *)&req, (void **)&sb,
70 0);
71 if (!resp) {
72 dev_err(&rcfw->pdev->dev, "QPLIB: SP: QUERY_FUNC send failed");
73 return -EINVAL;
74 }
75 if (!bnxt_qplib_rcfw_wait_for_resp(rcfw, le16_to_cpu(req.cookie))) {
76 /* Cmd timed out */
77 dev_err(&rcfw->pdev->dev, "QPLIB: SP: QUERY_FUNC timed out");
78 return -ETIMEDOUT;
79 }
80 if (resp->status ||
81 le16_to_cpu(resp->cookie) != le16_to_cpu(req.cookie)) {
82 dev_err(&rcfw->pdev->dev, "QPLIB: SP: QUERY_FUNC failed ");
83 dev_err(&rcfw->pdev->dev,70 dev_err(&rcfw->pdev->dev,
84 "QPLIB: with status 0x%x cmdq 0x%x resp 0x%x",71 "QPLIB: SP: QUERY_FUNC alloc side buffer failed");
85 resp->status, le16_to_cpu(req.cookie),72 return -ENOMEM;
86 le16_to_cpu(resp->cookie));
87 return -EINVAL;
88 }73 }
74
75 sb = sbuf->sb;
76 req.resp_size = sizeof(*sb) / BNXT_QPLIB_CMDQE_UNITS;
77 rc = bnxt_qplib_rcfw_send_message(rcfw, (void *)&req, (void *)&resp,
78 (void *)sbuf, 0);
79 if (rc)
80 goto bail;
81
89 /* Extract the context from the side buffer */82 /* Extract the context from the side buffer */
90 attr->max_qp = le32_to_cpu(sb->max_qp);83 attr->max_qp = le32_to_cpu(sb->max_qp);
91 attr->max_qp_rd_atom =84 attr->max_qp_rd_atom =
@@ -95,6 +88,11 @@ int bnxt_qplib_get_dev_attr(struct bnxt_qplib_rcfw *rcfw, · 3 unmodified lines
95 sb->max_qp_init_rd_atom > BNXT_QPLIB_MAX_OUT_RD_ATOM ?88 sb->max_qp_init_rd_atom > BNXT_QPLIB_MAX_OUT_RD_ATOM ?
96 BNXT_QPLIB_MAX_OUT_RD_ATOM : sb->max_qp_init_rd_atom;89 BNXT_QPLIB_MAX_OUT_RD_ATOM : sb->max_qp_init_rd_atom;
97 attr->max_qp_wqes = le16_to_cpu(sb->max_qp_wr);90 attr->max_qp_wqes = le16_to_cpu(sb->max_qp_wr);
91 /*
92 * 128 WQEs needs to be reserved for the HW (8916). Prevent
93 * reporting the max number
94 */
95 attr->max_qp_wqes -= BNXT_QPLIB_RESERVED_QP_WRS;
98 attr->max_qp_sges = sb->max_sge;96 attr->max_qp_sges = sb->max_sge;
99 attr->max_cq = le32_to_cpu(sb->max_cq);97 attr->max_cq = le32_to_cpu(sb->max_cq);
100 attr->max_cq_wqes = le32_to_cpu(sb->max_cqe);98 attr->max_cq_wqes = le32_to_cpu(sb->max_cqe);
@@ -130,7 +128,10 @@ int bnxt_qplib_get_dev_attr(struct bnxt_qplib_rcfw *rcfw, · 29 unmodified lines
130 attr->tqm_alloc_reqs[i * 4 + 2] = *(++tqm_alloc);128 attr->tqm_alloc_reqs[i * 4 + 2] = *(++tqm_alloc);
131 attr->tqm_alloc_reqs[i * 4 + 3] = *(++tqm_alloc);129 attr->tqm_alloc_reqs[i * 4 + 3] = *(++tqm_alloc);
132 }130 }
133 return 0;131
132bail:
133 bnxt_qplib_rcfw_free_sbuf(rcfw, sbuf);
134 return rc;
134}135}
135 136
136/* SGID */137/* SGID */
@@ -178,8 +179,9 @@ int bnxt_qplib_del_sgid(struct bnxt_qplib_sgid_tbl *sgid_tbl, · 41 unmodified lines
178 /* Remove GID from the SGID table */179 /* Remove GID from the SGID table */
179 if (update) {180 if (update) {
180 struct cmdq_delete_gid req;181 struct cmdq_delete_gid req;
181 struct creq_delete_gid_resp *resp;182 struct creq_delete_gid_resp resp;
182 u16 cmd_flags = 0;183 u16 cmd_flags = 0;
184 int rc;
183 185
184 RCFW_CMD_PREP(req, DELETE_GID, cmd_flags);186 RCFW_CMD_PREP(req, DELETE_GID, cmd_flags);
185 if (sgid_tbl->hw_id[index] == 0xFFFF) {187 if (sgid_tbl->hw_id[index] == 0xFFFF) {
@@ -188,31 +190,10 @@ int bnxt_qplib_del_sgid(struct bnxt_qplib_sgid_tbl *sgid_tbl, · 2 unmodified lines
188 return -EINVAL;190 return -EINVAL;
189 }191 }
190 req.gid_index = cpu_to_le16(sgid_tbl->hw_id[index]);192 req.gid_index = cpu_to_le16(sgid_tbl->hw_id[index]);
191 resp = (struct creq_delete_gid_resp *)193 rc = bnxt_qplib_rcfw_send_message(rcfw, (void *)&req,
192 bnxt_qplib_rcfw_send_message(rcfw, (void *)&req, NULL,194 (void *)&resp, NULL, 0);
193 0);195 if (rc)
194 if (!resp) {196 return rc;
195 dev_err(&res->pdev->dev,
196 "QPLIB: SP: DELETE_GID send failed");
197 return -EINVAL;
198 }
199 if (!bnxt_qplib_rcfw_wait_for_resp(rcfw,
200 le16_to_cpu(req.cookie))) {
201 /* Cmd timed out */
202 dev_err(&res->pdev->dev,
203 "QPLIB: SP: DELETE_GID timed out");
204 return -ETIMEDOUT;
205 }
206 if (resp->status ||
207 le16_to_cpu(resp->cookie) != le16_to_cpu(req.cookie)) {
208 dev_err(&res->pdev->dev,
209 "QPLIB: SP: DELETE_GID failed ");
210 dev_err(&res->pdev->dev,
211 "QPLIB: with status 0x%x cmdq 0x%x resp 0x%x",
212 resp->status, le16_to_cpu(req.cookie),
213 le16_to_cpu(resp->cookie));
214 return -EINVAL;
215 }
216 }197 }
217 memcpy(&sgid_tbl->tbl[index], &bnxt_qplib_gid_zero,198 memcpy(&sgid_tbl->tbl[index], &bnxt_qplib_gid_zero,
218 sizeof(bnxt_qplib_gid_zero));199 sizeof(bnxt_qplib_gid_zero));
@@ -234,7 +215,7 @@ int bnxt_qplib_add_sgid(struct bnxt_qplib_sgid_tbl *sgid_tbl, · 15 unmodified lines
234 struct bnxt_qplib_res,215 struct bnxt_qplib_res,
235 sgid_tbl);216 sgid_tbl);
236 struct bnxt_qplib_rcfw *rcfw = res->rcfw;217 struct bnxt_qplib_rcfw *rcfw = res->rcfw;
237 int i, free_idx, rc = 0;218 int i, free_idx;
238 219
239 if (!sgid_tbl) {220 if (!sgid_tbl) {
240 dev_err(&res->pdev->dev, "QPLIB: SGID table not allocated");221 dev_err(&res->pdev->dev, "QPLIB: SGID table not allocated");
@@ -266,10 +247,11 @@ int bnxt_qplib_add_sgid(struct bnxt_qplib_sgid_tbl *sgid_tbl, · 25 unmodified lines
266 }247 }
267 if (update) {248 if (update) {
268 struct cmdq_add_gid req;249 struct cmdq_add_gid req;
269 struct creq_add_gid_resp *resp;250 struct creq_add_gid_resp resp;
270 u16 cmd_flags = 0;251 u16 cmd_flags = 0;
271 u32 temp32[4];252 u32 temp32[4];
272 u16 temp16[3];253 u16 temp16[3];
254 int rc;
273 255
274 RCFW_CMD_PREP(req, ADD_GID, cmd_flags);256 RCFW_CMD_PREP(req, ADD_GID, cmd_flags);
275 257
@@ -290,31 +272,11 @@ int bnxt_qplib_add_sgid(struct bnxt_qplib_sgid_tbl *sgid_tbl, · 14 unmodified lines
290 req.src_mac[1] = cpu_to_be16(temp16[1]);272 req.src_mac[1] = cpu_to_be16(temp16[1]);
291 req.src_mac[2] = cpu_to_be16(temp16[2]);273 req.src_mac[2] = cpu_to_be16(temp16[2]);
292 274
293 resp = (struct creq_add_gid_resp *)275 rc = bnxt_qplib_rcfw_send_message(rcfw, (void *)&req,
294 bnxt_qplib_rcfw_send_message(rcfw, (void *)&req,276 (void *)&resp, NULL, 0);
295 NULL, 0);277 if (rc)
296 if (!resp) {278 return rc;
297 dev_err(&res->pdev->dev,279 sgid_tbl->hw_id[free_idx] = le32_to_cpu(resp.xid);
298 "QPLIB: SP: ADD_GID send failed");
299 return -EINVAL;
300 }
301 if (!bnxt_qplib_rcfw_wait_for_resp(rcfw,
302 le16_to_cpu(req.cookie))) {
303 /* Cmd timed out */
304 dev_err(&res->pdev->dev,
305 "QPIB: SP: ADD_GID timed out");
306 return -ETIMEDOUT;
307 }
308 if (resp->status ||
309 le16_to_cpu(resp->cookie) != le16_to_cpu(req.cookie)) {
310 dev_err(&res->pdev->dev, "QPLIB: SP: ADD_GID failed ");
311 dev_err(&res->pdev->dev,
312 "QPLIB: with status 0x%x cmdq 0x%x resp 0x%x",
313 resp->status, le16_to_cpu(req.cookie),
314 le16_to_cpu(resp->cookie));
315 return -EINVAL;
316 }
317 sgid_tbl->hw_id[free_idx] = le32_to_cpu(resp->xid);
318 }280 }
319 /* Add GID to the sgid_tbl */281 /* Add GID to the sgid_tbl */
320 memcpy(&sgid_tbl->tbl[free_idx], gid, sizeof(*gid));282 memcpy(&sgid_tbl->tbl[free_idx], gid, sizeof(*gid));
@@ -325,7 +287,7 @@ int bnxt_qplib_add_sgid(struct bnxt_qplib_sgid_tbl *sgid_tbl, · 4 unmodified lines
325 287
326 *index = free_idx;288 *index = free_idx;
327 /* unlock */289 /* unlock */
328 return rc;290 return 0;
329}291}
330 292
331/* pkeys */293/* pkeys */
@@ -422,10 +384,11 @@ int bnxt_qplib_create_ah(struct bnxt_qplib_res *res, struct bnxt_qplib_ah *ah) · 90 unmodified lines
422{384{
423 struct bnxt_qplib_rcfw *rcfw = res->rcfw;385 struct bnxt_qplib_rcfw *rcfw = res->rcfw;
424 struct cmdq_create_ah req;386 struct cmdq_create_ah req;
425 struct creq_create_ah_resp *resp;387 struct creq_create_ah_resp resp;
426 u16 cmd_flags = 0;388 u16 cmd_flags = 0;
427 u32 temp32[4];389 u32 temp32[4];
428 u16 temp16[3];390 u16 temp16[3];
391 int rc;
429 392
430 RCFW_CMD_PREP(req, CREATE_AH, cmd_flags);393 RCFW_CMD_PREP(req, CREATE_AH, cmd_flags);
431 394
@@ -450,28 +413,12 @@ int bnxt_qplib_create_ah(struct bnxt_qplib_res *res, struct bnxt_qplib_ah *ah) · 18 unmodified lines
450 req.dest_mac[1] = cpu_to_le16(temp16[1]);413 req.dest_mac[1] = cpu_to_le16(temp16[1]);
451 req.dest_mac[2] = cpu_to_le16(temp16[2]);414 req.dest_mac[2] = cpu_to_le16(temp16[2]);
452 415
453 resp = (struct creq_create_ah_resp *)416 rc = bnxt_qplib_rcfw_send_message(rcfw, (void *)&req, (void *)&resp,
454 bnxt_qplib_rcfw_send_message(rcfw, (void *)&req,417 NULL, 1);
455 NULL, 1);418 if (rc)
456 if (!resp) {419 return rc;
457 dev_err(&rcfw->pdev->dev, "QPLIB: SP: CREATE_AH send failed");420
458 return -EINVAL;421 ah->id = le32_to_cpu(resp.xid);
459 }
460 if (!bnxt_qplib_rcfw_block_for_resp(rcfw, le16_to_cpu(req.cookie))) {
461 /* Cmd timed out */
462 dev_err(&rcfw->pdev->dev, "QPLIB: SP: CREATE_AH timed out");
463 return -ETIMEDOUT;
464 }
465 if (resp->status ||
466 le16_to_cpu(resp->cookie) != le16_to_cpu(req.cookie)) {
467 dev_err(&rcfw->pdev->dev, "QPLIB: SP: CREATE_AH failed ");
468 dev_err(&rcfw->pdev->dev,
469 "QPLIB: with status 0x%x cmdq 0x%x resp 0x%x",
470 resp->status, le16_to_cpu(req.cookie),
471 le16_to_cpu(resp->cookie));
472 return -EINVAL;
473 }
474 ah->id = le32_to_cpu(resp->xid);
475 return 0;422 return 0;
476}423}
477 424
@@ -479,35 +426,19 @@ int bnxt_qplib_destroy_ah(struct bnxt_qplib_res *res, struct bnxt_qplib_ah *ah) · 1 unmodified line
479{426{
480 struct bnxt_qplib_rcfw *rcfw = res->rcfw;427 struct bnxt_qplib_rcfw *rcfw = res->rcfw;
481 struct cmdq_destroy_ah req;428 struct cmdq_destroy_ah req;
482 struct creq_destroy_ah_resp *resp;429 struct creq_destroy_ah_resp resp;
483 u16 cmd_flags = 0;430 u16 cmd_flags = 0;
431 int rc;
484 432
485 /* Clean up the AH table in the device */433 /* Clean up the AH table in the device */
486 RCFW_CMD_PREP(req, DESTROY_AH, cmd_flags);434 RCFW_CMD_PREP(req, DESTROY_AH, cmd_flags);
487 435
488 req.ah_cid = cpu_to_le32(ah->id);436 req.ah_cid = cpu_to_le32(ah->id);
489 437
490 resp = (struct creq_destroy_ah_resp *)438 rc = bnxt_qplib_rcfw_send_message(rcfw, (void *)&req, (void *)&resp,
491 bnxt_qplib_rcfw_send_message(rcfw, (void *)&req,439 NULL, 1);
492 NULL, 1);440 if (rc)
493 if (!resp) {441 return rc;
494 dev_err(&rcfw->pdev->dev, "QPLIB: SP: DESTROY_AH send failed");
495 return -EINVAL;
496 }
497 if (!bnxt_qplib_rcfw_block_for_resp(rcfw, le16_to_cpu(req.cookie))) {
498 /* Cmd timed out */
499 dev_err(&rcfw->pdev->dev, "QPLIB: SP: DESTROY_AH timed out");
500 return -ETIMEDOUT;
501 }
502 if (resp->status ||
503 le16_to_cpu(resp->cookie) != le16_to_cpu(req.cookie)) {
504 dev_err(&rcfw->pdev->dev, "QPLIB: SP: DESTROY_AH failed ");
505 dev_err(&rcfw->pdev->dev,
506 "QPLIB: with status 0x%x cmdq 0x%x resp 0x%x",
507 resp->status, le16_to_cpu(req.cookie),
508 le16_to_cpu(resp->cookie));
509 return -EINVAL;
510 }
511 return 0;442 return 0;
512}443}
513 444
@@ -516,8 +447,9 @@ int bnxt_qplib_free_mrw(struct bnxt_qplib_res *res, struct bnxt_qplib_mrw *mrw) · 2 unmodified lines
516{447{
517 struct bnxt_qplib_rcfw *rcfw = res->rcfw;448 struct bnxt_qplib_rcfw *rcfw = res->rcfw;
518 struct cmdq_deallocate_key req;449 struct cmdq_deallocate_key req;
519 struct creq_deallocate_key_resp *resp;450 struct creq_deallocate_key_resp resp;
520 u16 cmd_flags = 0;451 u16 cmd_flags = 0;
452 int rc;
521 453
522 if (mrw->lkey == 0xFFFFFFFF) {454 if (mrw->lkey == 0xFFFFFFFF) {
523 dev_info(&res->pdev->dev,455 dev_info(&res->pdev->dev,
@@ -536,27 +468,11 @@ int bnxt_qplib_free_mrw(struct bnxt_qplib_res *res, struct bnxt_qplib_mrw *mrw) · 12 unmodified lines
536 else468 else
537 req.key = cpu_to_le32(mrw->lkey);469 req.key = cpu_to_le32(mrw->lkey);
538 470
539 resp = (struct creq_deallocate_key_resp *)471 rc = bnxt_qplib_rcfw_send_message(rcfw, (void *)&req, (void *)&resp,
540 bnxt_qplib_rcfw_send_message(rcfw, (void *)&req,472 NULL, 0);
541 NULL, 0);473 if (rc)
542 if (!resp) {474 return rc;
543 dev_err(&res->pdev->dev, "QPLIB: SP: FREE_MR send failed");475
544 return -EINVAL;
545 }
546 if (!bnxt_qplib_rcfw_wait_for_resp(rcfw, le16_to_cpu(req.cookie))) {
547 /* Cmd timed out */
548 dev_err(&res->pdev->dev, "QPLIB: SP: FREE_MR timed out");
549 return -ETIMEDOUT;
550 }
551 if (resp->status ||
552 le16_to_cpu(resp->cookie) != le16_to_cpu(req.cookie)) {
553 dev_err(&res->pdev->dev, "QPLIB: SP: FREE_MR failed ");
554 dev_err(&res->pdev->dev,
555 "QPLIB: with status 0x%x cmdq 0x%x resp 0x%x",
556 resp->status, le16_to_cpu(req.cookie),
557 le16_to_cpu(resp->cookie));
558 return -EINVAL;
559 }
560 /* Free the qplib's MRW memory */476 /* Free the qplib's MRW memory */
561 if (mrw->hwq.max_elements)477 if (mrw->hwq.max_elements)
562 bnxt_qplib_free_hwq(res->pdev, &mrw->hwq);478 bnxt_qplib_free_hwq(res->pdev, &mrw->hwq);
@@ -568,9 +484,10 @@ int bnxt_qplib_alloc_mrw(struct bnxt_qplib_res *res, struct bnxt_qplib_mrw *mrw) · 5 unmodified lines
568{484{
569 struct bnxt_qplib_rcfw *rcfw = res->rcfw;485 struct bnxt_qplib_rcfw *rcfw = res->rcfw;
570 struct cmdq_allocate_mrw req;486 struct cmdq_allocate_mrw req;
571 struct creq_allocate_mrw_resp *resp;487 struct creq_allocate_mrw_resp resp;
572 u16 cmd_flags = 0;488 u16 cmd_flags = 0;
573 unsigned long tmp;489 unsigned long tmp;
490 int rc;
574 491
575 RCFW_CMD_PREP(req, ALLOCATE_MRW, cmd_flags);492 RCFW_CMD_PREP(req, ALLOCATE_MRW, cmd_flags);
576 493
@@ -584,33 +501,17 @@ int bnxt_qplib_alloc_mrw(struct bnxt_qplib_res *res, struct bnxt_qplib_mrw *mrw) · 7 unmodified lines
584 tmp = (unsigned long)mrw;501 tmp = (unsigned long)mrw;
585 req.mrw_handle = cpu_to_le64(tmp);502 req.mrw_handle = cpu_to_le64(tmp);
586 503
587 resp = (struct creq_allocate_mrw_resp *)504 rc = bnxt_qplib_rcfw_send_message(rcfw, (void *)&req,
588 bnxt_qplib_rcfw_send_message(rcfw, (void *)&req,505 (void *)&resp, NULL, 0);
589 NULL, 0);506 if (rc)
590 if (!resp) {507 return rc;
591 dev_err(&rcfw->pdev->dev, "QPLIB: SP: ALLOC_MRW send failed");508
592 return -EINVAL;
593 }
594 if (!bnxt_qplib_rcfw_wait_for_resp(rcfw, le16_to_cpu(req.cookie))) {
595 /* Cmd timed out */
596 dev_err(&rcfw->pdev->dev, "QPLIB: SP: ALLOC_MRW timed out");
597 return -ETIMEDOUT;
598 }
599 if (resp->status ||
600 le16_to_cpu(resp->cookie) != le16_to_cpu(req.cookie)) {
601 dev_err(&rcfw->pdev->dev, "QPLIB: SP: ALLOC_MRW failed ");
602 dev_err(&rcfw->pdev->dev,
603 "QPLIB: with status 0x%x cmdq 0x%x resp 0x%x",
604 resp->status, le16_to_cpu(req.cookie),
605 le16_to_cpu(resp->cookie));
606 return -EINVAL;
607 }
608 if ((mrw->type == CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE1) ||509 if ((mrw->type == CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE1) ||
609 (mrw->type == CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2A) ||510 (mrw->type == CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2A) ||
610 (mrw->type == CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2B))511 (mrw->type == CMDQ_ALLOCATE_MRW_MRW_FLAGS_MW_TYPE2B))
611 mrw->rkey = le32_to_cpu(resp->xid);512 mrw->rkey = le32_to_cpu(resp.xid);
612 else513 else
613 mrw->lkey = le32_to_cpu(resp->xid);514 mrw->lkey = le32_to_cpu(resp.xid);
614 return 0;515 return 0;
615}516}
616 517
@@ -619,40 +520,17 @@ int bnxt_qplib_dereg_mrw(struct bnxt_qplib_res *res, struct bnxt_qplib_mrw *mrw, · 2 unmodified lines
619{520{
620 struct bnxt_qplib_rcfw *rcfw = res->rcfw;521 struct bnxt_qplib_rcfw *rcfw = res->rcfw;
621 struct cmdq_deregister_mr req;522 struct cmdq_deregister_mr req;
622 struct creq_deregister_mr_resp *resp;523 struct creq_deregister_mr_resp resp;
623 u16 cmd_flags = 0;524 u16 cmd_flags = 0;
624 int rc;525 int rc;
625 526
626 RCFW_CMD_PREP(req, DEREGISTER_MR, cmd_flags);527 RCFW_CMD_PREP(req, DEREGISTER_MR, cmd_flags);
627 528
628 req.lkey = cpu_to_le32(mrw->lkey);529 req.lkey = cpu_to_le32(mrw->lkey);
629 resp = (struct creq_deregister_mr_resp *)530 rc = bnxt_qplib_rcfw_send_message(rcfw, (void *)&req,
630 bnxt_qplib_rcfw_send_message(rcfw, (void *)&req,531 (void *)&resp, NULL, block);
631 NULL, block);532 if (rc)
632 if (!resp) {533 return rc;
633 dev_err(&rcfw->pdev->dev, "QPLIB: SP: DEREG_MR send failed");
634 return -EINVAL;
635 }
636 if (block)
637 rc = bnxt_qplib_rcfw_block_for_resp(rcfw,
638 le16_to_cpu(req.cookie));
639 else
640 rc = bnxt_qplib_rcfw_wait_for_resp(rcfw,
641 le16_to_cpu(req.cookie));
642 if (!rc) {
643 /* Cmd timed out */
644 dev_err(&res->pdev->dev, "QPLIB: SP: DEREG_MR timed out");
645 return -ETIMEDOUT;
646 }
647 if (resp->status ||
648 le16_to_cpu(resp->cookie) != le16_to_cpu(req.cookie)) {
649 dev_err(&rcfw->pdev->dev, "QPLIB: SP: DEREG_MR failed ");
650 dev_err(&rcfw->pdev->dev,
651 "QPLIB: with status 0x%x cmdq 0x%x resp 0x%x",
652 resp->status, le16_to_cpu(req.cookie),
653 le16_to_cpu(resp->cookie));
654 return -EINVAL;
655 }
656 534
657 /* Free the qplib's MR memory */535 /* Free the qplib's MR memory */
658 if (mrw->hwq.max_elements) {536 if (mrw->hwq.max_elements) {
@@ -669,7 +547,7 @@ int bnxt_qplib_reg_mr(struct bnxt_qplib_res *res, struct bnxt_qplib_mrw *mr, · 10 unmodified lines
669{547{
670 struct bnxt_qplib_rcfw *rcfw = res->rcfw;548 struct bnxt_qplib_rcfw *rcfw = res->rcfw;
671 struct cmdq_register_mr req;549 struct cmdq_register_mr req;
672 struct creq_register_mr_resp *resp;550 struct creq_register_mr_resp resp;
673 u16 cmd_flags = 0, level;551 u16 cmd_flags = 0, level;
674 int pg_ptrs, pages, i, rc;552 int pg_ptrs, pages, i, rc;
675 dma_addr_t **pbl_ptr;553 dma_addr_t **pbl_ptr;
@@ -730,36 +608,11 @@ int bnxt_qplib_reg_mr(struct bnxt_qplib_res *res, struct bnxt_qplib_mrw *mr, · 54 unmodified lines
730 req.key = cpu_to_le32(mr->lkey);608 req.key = cpu_to_le32(mr->lkey);
731 req.mr_size = cpu_to_le64(mr->total_size);609 req.mr_size = cpu_to_le64(mr->total_size);
732 610
733 resp = (struct creq_register_mr_resp *)611 rc = bnxt_qplib_rcfw_send_message(rcfw, (void *)&req,
734 bnxt_qplib_rcfw_send_message(rcfw, (void *)&req,612 (void *)&resp, NULL, block);
735 NULL, block);613 if (rc)
736 if (!resp) {
737 dev_err(&res->pdev->dev, "SP: REG_MR send failed");
738 rc = -EINVAL;
739 goto fail;
740 }
741 if (block)
742 rc = bnxt_qplib_rcfw_block_for_resp(rcfw,
743 le16_to_cpu(req.cookie));
744 else
745 rc = bnxt_qplib_rcfw_wait_for_resp(rcfw,
746 le16_to_cpu(req.cookie));
747 if (!rc) {
748 /* Cmd timed out */
749 dev_err(&res->pdev->dev, "SP: REG_MR timed out");
750 rc = -ETIMEDOUT;
751 goto fail;
752 }
753 if (resp->status ||
754 le16_to_cpu(resp->cookie) != le16_to_cpu(req.cookie)) {
755 dev_err(&res->pdev->dev, "QPLIB: SP: REG_MR failed ");
756 dev_err(&res->pdev->dev,
757 "QPLIB: SP: with status 0x%x cmdq 0x%x resp 0x%x",
758 resp->status, le16_to_cpu(req.cookie),
759 le16_to_cpu(resp->cookie));
760 rc = -EINVAL;
761 goto fail;614 goto fail;
762 }615
763 return 0;616 return 0;
764 617
765fail:618fail:
@@ -804,35 +657,15 @@ int bnxt_qplib_map_tc2cos(struct bnxt_qplib_res *res, u16 *cids) · 38 unmodified lines
804{657{
805 struct bnxt_qplib_rcfw *rcfw = res->rcfw;658 struct bnxt_qplib_rcfw *rcfw = res->rcfw;
806 struct cmdq_map_tc_to_cos req;659 struct cmdq_map_tc_to_cos req;
807 struct creq_map_tc_to_cos_resp *resp;660 struct creq_map_tc_to_cos_resp resp;
808 u16 cmd_flags = 0;661 u16 cmd_flags = 0;
809 int tleft;662 int rc = 0;
810 663
811 RCFW_CMD_PREP(req, MAP_TC_TO_COS, cmd_flags);664 RCFW_CMD_PREP(req, MAP_TC_TO_COS, cmd_flags);
812 req.cos0 = cpu_to_le16(cids[0]);665 req.cos0 = cpu_to_le16(cids[0]);
813 req.cos1 = cpu_to_le16(cids[1]);666 req.cos1 = cpu_to_le16(cids[1]);
814 667
815 resp = bnxt_qplib_rcfw_send_message(rcfw, (void *)&req, NULL, 0);668 rc = bnxt_qplib_rcfw_send_message(rcfw, (void *)&req,
816 if (!resp) {669 (void *)&resp, NULL, 0);
817 dev_err(&res->pdev->dev, "QPLIB: SP: MAP_TC2COS send failed");
818 return -EINVAL;
819 }
820
821 tleft = bnxt_qplib_rcfw_block_for_resp(rcfw, le16_to_cpu(req.cookie));
822 if (!tleft) {
823 dev_err(&res->pdev->dev, "QPLIB: SP: MAP_TC2COS timed out");
824 return -ETIMEDOUT;
825 }
826
827 if (resp->status ||
828 le16_to_cpu(resp->cookie) != le16_to_cpu(req.cookie)) {
829 dev_err(&res->pdev->dev, "QPLIB: SP: MAP_TC2COS failed ");
830 dev_err(&res->pdev->dev,
831 "QPLIB: with status 0x%x cmdq 0x%x resp 0x%x",
832 resp->status, le16_to_cpu(req.cookie),
833 le16_to_cpu(resp->cookie));
834 return -EINVAL;
835 }
836
837 return 0;670 return 0;
838}671}
drivers/infiniband/hw/bnxt_re/qplib_sp.h+2−0
@@ -40,6 +40,8 @@ · 39 unmodified lines
40#ifndef __BNXT_QPLIB_SP_H__40#ifndef __BNXT_QPLIB_SP_H__
41#define __BNXT_QPLIB_SP_H__41#define __BNXT_QPLIB_SP_H__
42 42
43#define BNXT_QPLIB_RESERVED_QP_WRS 128
44
43struct bnxt_qplib_dev_attr {45struct bnxt_qplib_dev_attr {
44 char fw_ver[32];46 char fw_ver[32];
45 u16 max_sgid;47 u16 max_sgid;
drivers/infiniband/hw/cxgb4/cm.c+7−2
@@ -488,6 +488,7 @@ static int _put_ep_safe(struct c4iw_dev *dev, struct sk_buff *skb) · 487 unmodified lines
488 488
489 ep = *((struct c4iw_ep **)(skb->cb + 2 * sizeof(void *)));489 ep = *((struct c4iw_ep **)(skb->cb + 2 * sizeof(void *)));
490 release_ep_resources(ep);490 release_ep_resources(ep);
491 kfree_skb(skb);
491 return 0;492 return 0;
492}493}
493 494
@@ -498,6 +499,7 @@ static int _put_pass_ep_safe(struct c4iw_dev *dev, struct sk_buff *skb) · 4 unmodified lines
498 ep = *((struct c4iw_ep **)(skb->cb + 2 * sizeof(void *)));499 ep = *((struct c4iw_ep **)(skb->cb + 2 * sizeof(void *)));
499 c4iw_put_ep(&ep->parent_ep->com);500 c4iw_put_ep(&ep->parent_ep->com);
500 release_ep_resources(ep);501 release_ep_resources(ep);
502 kfree_skb(skb);
501 return 0;503 return 0;
502}504}
503 505
@@ -569,11 +571,13 @@ static void abort_arp_failure(void *handle, struct sk_buff *skb) · 65 unmodified lines
569 571
570 pr_debug("%s rdev %p\n", __func__, rdev);572 pr_debug("%s rdev %p\n", __func__, rdev);
571 req->cmd = CPL_ABORT_NO_RST;573 req->cmd = CPL_ABORT_NO_RST;
574 skb_get(skb);
572 ret = c4iw_ofld_send(rdev, skb);575 ret = c4iw_ofld_send(rdev, skb);
573 if (ret) {576 if (ret) {
574 __state_set(&ep->com, DEAD);577 __state_set(&ep->com, DEAD);
575 queue_arp_failure_cpl(ep, skb, FAKE_CPL_PUT_EP_SAFE);578 queue_arp_failure_cpl(ep, skb, FAKE_CPL_PUT_EP_SAFE);
576 }579 } else
580 kfree_skb(skb);
577}581}
578 582
579static int send_flowc(struct c4iw_ep *ep)583static int send_flowc(struct c4iw_ep *ep)
@@ -2517,7 +2521,8 @@ static int pass_accept_req(struct c4iw_dev *dev, struct sk_buff *skb) · 1937 unmodified lines
2517 goto reject;2521 goto reject;
2518 }2522 }
2519 2523
2520 hdrs = sizeof(struct iphdr) + sizeof(struct tcphdr) +2524 hdrs = ((iptype == 4) ? sizeof(struct iphdr) : sizeof(struct ipv6hdr)) +
2525 sizeof(struct tcphdr) +
2521 ((enable_tcp_timestamps && req->tcpopt.tstamp) ? 12 : 0);2526 ((enable_tcp_timestamps && req->tcpopt.tstamp) ? 12 : 0);
2522 if (peer_mss && child_ep->mtu > (peer_mss + hdrs))2527 if (peer_mss && child_ep->mtu > (peer_mss + hdrs))
2523 child_ep->mtu = peer_mss + hdrs;2528 child_ep->mtu = peer_mss + hdrs;
drivers/infiniband/hw/cxgb4/device.c+8−4
@@ -767,7 +767,7 @@ void c4iw_release_dev_ucontext(struct c4iw_rdev *rdev, · 766 unmodified lines
767 kfree(entry);767 kfree(entry);
768 }768 }
769 769
770 list_for_each_safe(pos, nxt, &uctx->qpids) {770 list_for_each_safe(pos, nxt, &uctx->cqids) {
771 entry = list_entry(pos, struct c4iw_qid_list, entry);771 entry = list_entry(pos, struct c4iw_qid_list, entry);
772 list_del_init(&entry->entry);772 list_del_init(&entry->entry);
773 kfree(entry);773 kfree(entry);
@@ -880,13 +880,15 @@ static int c4iw_rdev_open(struct c4iw_rdev *rdev) · 106 unmodified lines
880 rdev->free_workq = create_singlethread_workqueue("iw_cxgb4_free");880 rdev->free_workq = create_singlethread_workqueue("iw_cxgb4_free");
881 if (!rdev->free_workq) {881 if (!rdev->free_workq) {
882 err = -ENOMEM;882 err = -ENOMEM;
883 goto err_free_status_page;883 goto err_free_status_page_and_wr_log;
884 }884 }
885 885
886 rdev->status_page->db_off = 0;886 rdev->status_page->db_off = 0;
887 887
888 return 0;888 return 0;
889err_free_status_page:889err_free_status_page_and_wr_log:
890 if (c4iw_wr_log && rdev->wr_log)
891 kfree(rdev->wr_log);
890 free_page((unsigned long)rdev->status_page);892 free_page((unsigned long)rdev->status_page);
891destroy_ocqp_pool:893destroy_ocqp_pool:
892 c4iw_ocqp_pool_destroy(rdev);894 c4iw_ocqp_pool_destroy(rdev);
@@ -903,9 +905,11 @@ static void c4iw_rdev_close(struct c4iw_rdev *rdev) · 10 unmodified lines
903{905{
904 destroy_workqueue(rdev->free_workq);906 destroy_workqueue(rdev->free_workq);
905 kfree(rdev->wr_log);907 kfree(rdev->wr_log);
908 c4iw_release_dev_ucontext(rdev, &rdev->uctx);
906 free_page((unsigned long)rdev->status_page);909 free_page((unsigned long)rdev->status_page);
907 c4iw_pblpool_destroy(rdev);910 c4iw_pblpool_destroy(rdev);
908 c4iw_rqtpool_destroy(rdev);911 c4iw_rqtpool_destroy(rdev);
912 c4iw_ocqp_pool_destroy(rdev);
909 c4iw_destroy_resource(&rdev->resource);913 c4iw_destroy_resource(&rdev->resource);
910}914}
911 915
@@ -971,7 +975,7 @@ static struct c4iw_dev *c4iw_alloc(const struct cxgb4_lld_info *infop) · 59 unmodified lines
971 devp->rdev.lldi.sge_egrstatuspagesize);975 devp->rdev.lldi.sge_egrstatuspagesize);
972 976
973 devp->rdev.hw_queue.t4_eq_status_entries =977 devp->rdev.hw_queue.t4_eq_status_entries =
974 devp->rdev.lldi.sge_ingpadboundary > 64 ? 2 : 1;978 devp->rdev.lldi.sge_egrstatuspagesize / 64;
975 devp->rdev.hw_queue.t4_max_eq_size = 65520;979 devp->rdev.hw_queue.t4_max_eq_size = 65520;
976 devp->rdev.hw_queue.t4_max_iq_size = 65520;980 devp->rdev.hw_queue.t4_max_iq_size = 65520;
977 devp->rdev.hw_queue.t4_max_rq_size = 8192 -981 devp->rdev.hw_queue.t4_max_rq_size = 8192 -
drivers/infiniband/hw/hfi1/chip.c+50−17
@@ -6312,25 +6312,38 @@ static void handle_8051_request(struct hfi1_pportdata *ppd) · 6311 unmodified lines
6312 }6312 }
6313}6313}
6314 6314
6315static void write_global_credit(struct hfi1_devdata *dd,6315/*
6316 u8 vau, u16 total, u16 shared)6316 * Set up allocation unit vaulue.
6317 */
6318void set_up_vau(struct hfi1_devdata *dd, u8 vau)
6317{6319{
6318 write_csr(dd, SEND_CM_GLOBAL_CREDIT,6320 u64 reg = read_csr(dd, SEND_CM_GLOBAL_CREDIT);
6319 ((u64)total <<6321
6320 SEND_CM_GLOBAL_CREDIT_TOTAL_CREDIT_LIMIT_SHIFT) |6322 /* do not modify other values in the register */
6321 ((u64)shared <<6323 reg &= ~SEND_CM_GLOBAL_CREDIT_AU_SMASK;
6322 SEND_CM_GLOBAL_CREDIT_SHARED_LIMIT_SHIFT) |6324 reg |= (u64)vau << SEND_CM_GLOBAL_CREDIT_AU_SHIFT;
6323 ((u64)vau << SEND_CM_GLOBAL_CREDIT_AU_SHIFT));6325 write_csr(dd, SEND_CM_GLOBAL_CREDIT, reg);
6324}6326}
6325 6327
6326/*6328/*
6327 * Set up initial VL15 credits of the remote. Assumes the rest of6329 * Set up initial VL15 credits of the remote. Assumes the rest of
6328 * the CM credit registers are zero from a previous global or credit reset .6330 * the CM credit registers are zero from a previous global or credit reset.
6331 * Shared limit for VL15 will always be 0.
6329 */6332 */
6330void set_up_vl15(struct hfi1_devdata *dd, u8 vau, u16 vl15buf)6333void set_up_vl15(struct hfi1_devdata *dd, u16 vl15buf)
6331{6334{
6332 /* leave shared count at zero for both global and VL15 */6335 u64 reg = read_csr(dd, SEND_CM_GLOBAL_CREDIT);
6333 write_global_credit(dd, vau, vl15buf, 0);6336
6337 /* set initial values for total and shared credit limit */
6338 reg &= ~(SEND_CM_GLOBAL_CREDIT_TOTAL_CREDIT_LIMIT_SMASK |
6339 SEND_CM_GLOBAL_CREDIT_SHARED_LIMIT_SMASK);
6340
6341 /*
6342 * Set total limit to be equal to VL15 credits.
6343 * Leave shared limit at 0.
6344 */
6345 reg |= (u64)vl15buf << SEND_CM_GLOBAL_CREDIT_TOTAL_CREDIT_LIMIT_SHIFT;
6346 write_csr(dd, SEND_CM_GLOBAL_CREDIT, reg);
6334 6347
6335 write_csr(dd, SEND_CM_CREDIT_VL15, (u64)vl15buf6348 write_csr(dd, SEND_CM_CREDIT_VL15, (u64)vl15buf
6336 << SEND_CM_CREDIT_VL15_DEDICATED_LIMIT_VL_SHIFT);6349 << SEND_CM_CREDIT_VL15_DEDICATED_LIMIT_VL_SHIFT);
@@ -6348,9 +6361,11 @@ void reset_link_credits(struct hfi1_devdata *dd) · 11 unmodified lines
6348 for (i = 0; i < TXE_NUM_DATA_VL; i++)6361 for (i = 0; i < TXE_NUM_DATA_VL; i++)
6349 write_csr(dd, SEND_CM_CREDIT_VL + (8 * i), 0);6362 write_csr(dd, SEND_CM_CREDIT_VL + (8 * i), 0);
6350 write_csr(dd, SEND_CM_CREDIT_VL15, 0);6363 write_csr(dd, SEND_CM_CREDIT_VL15, 0);
6351 write_global_credit(dd, 0, 0, 0);6364 write_csr(dd, SEND_CM_GLOBAL_CREDIT, 0);
6352 /* reset the CM block */6365 /* reset the CM block */
6353 pio_send_control(dd, PSC_CM_RESET);6366 pio_send_control(dd, PSC_CM_RESET);
6367 /* reset cached value */
6368 dd->vl15buf_cached = 0;
6354}6369}
6355 6370
6356/* convert a vCU to a CU */6371/* convert a vCU to a CU */
@@ -6839,24 +6854,35 @@ void handle_link_up(struct work_struct *work) · 482 unmodified lines
6839{6854{
6840 struct hfi1_pportdata *ppd = container_of(work, struct hfi1_pportdata,6855 struct hfi1_pportdata *ppd = container_of(work, struct hfi1_pportdata,
6841 link_up_work);6856 link_up_work);
6857 struct hfi1_devdata *dd = ppd->dd;
6858
6842 set_link_state(ppd, HLS_UP_INIT);6859 set_link_state(ppd, HLS_UP_INIT);
6843 6860
6844 /* cache the read of DC_LCB_STS_ROUND_TRIP_LTP_CNT */6861 /* cache the read of DC_LCB_STS_ROUND_TRIP_LTP_CNT */
6845 read_ltp_rtt(ppd->dd);6862 read_ltp_rtt(dd);
6846 /*6863 /*
6847 * OPA specifies that certain counters are cleared on a transition6864 * OPA specifies that certain counters are cleared on a transition
6848 * to link up, so do that.6865 * to link up, so do that.
6849 */6866 */
6850 clear_linkup_counters(ppd->dd);6867 clear_linkup_counters(dd);
6851 /*6868 /*
6852 * And (re)set link up default values.6869 * And (re)set link up default values.
6853 */6870 */
6854 set_linkup_defaults(ppd);6871 set_linkup_defaults(ppd);
6855 6872
6873 /*
6874 * Set VL15 credits. Use cached value from verify cap interrupt.
6875 * In case of quick linkup or simulator, vl15 value will be set by
6876 * handle_linkup_change. VerifyCap interrupt handler will not be
6877 * called in those scenarios.
6878 */
6879 if (!(quick_linkup || dd->icode == ICODE_FUNCTIONAL_SIMULATOR))
6880 set_up_vl15(dd, dd->vl15buf_cached);
6881
6856 /* enforce link speed enabled */6882 /* enforce link speed enabled */
6857 if ((ppd->link_speed_active & ppd->link_speed_enabled) == 0) {6883 if ((ppd->link_speed_active & ppd->link_speed_enabled) == 0) {
6858 /* oops - current speed is not enabled, bounce */6884 /* oops - current speed is not enabled, bounce */
6859 dd_dev_err(ppd->dd,6885 dd_dev_err(dd,
6860 "Link speed active 0x%x is outside enabled 0x%x, downing link\n",6886 "Link speed active 0x%x is outside enabled 0x%x, downing link\n",
6861 ppd->link_speed_active, ppd->link_speed_enabled);6887 ppd->link_speed_active, ppd->link_speed_enabled);
6862 set_link_down_reason(ppd, OPA_LINKDOWN_REASON_SPEED_POLICY, 0,6888 set_link_down_reason(ppd, OPA_LINKDOWN_REASON_SPEED_POLICY, 0,
@@ -7357,7 +7383,14 @@ void handle_verify_cap(struct work_struct *work) · 494 unmodified lines
7357 */7383 */
7358 if (vau == 0)7384 if (vau == 0)
7359 vau = 1;7385 vau = 1;
7360 set_up_vl15(dd, vau, vl15buf);7386 set_up_vau(dd, vau);
7387
7388 /*
7389 * Set VL15 credits to 0 in global credit register. Cache remote VL15
7390 * credits value and wait for link-up interrupt ot set it.
7391 */
7392 set_up_vl15(dd, 0);
7393 dd->vl15buf_cached = vl15buf;
7361 7394
7362 /* set up the LCB CRC mode */7395 /* set up the LCB CRC mode */
7363 crc_mask = ppd->port_crc_mode_enabled & partner_supported_crc;7396 crc_mask = ppd->port_crc_mode_enabled & partner_supported_crc;
drivers/infiniband/hw/hfi1/chip_registers.h+2−0
@@ -839,7 +839,9 @@ · 838 unmodified lines
839#define SEND_CM_CTRL_FORCE_CREDIT_MODE_SMASK 0x8ull839#define SEND_CM_CTRL_FORCE_CREDIT_MODE_SMASK 0x8ull
840#define SEND_CM_CTRL_RESETCSR 0x0000000000000020ull840#define SEND_CM_CTRL_RESETCSR 0x0000000000000020ull
841#define SEND_CM_GLOBAL_CREDIT (TXE + 0x000000000508)841#define SEND_CM_GLOBAL_CREDIT (TXE + 0x000000000508)
842#define SEND_CM_GLOBAL_CREDIT_AU_MASK 0x7ull
842#define SEND_CM_GLOBAL_CREDIT_AU_SHIFT 16843#define SEND_CM_GLOBAL_CREDIT_AU_SHIFT 16
844#define SEND_CM_GLOBAL_CREDIT_AU_SMASK 0x70000ull
843#define SEND_CM_GLOBAL_CREDIT_RESETCSR 0x0000094000030000ull845#define SEND_CM_GLOBAL_CREDIT_RESETCSR 0x0000094000030000ull
844#define SEND_CM_GLOBAL_CREDIT_SHARED_LIMIT_MASK 0xFFFFull846#define SEND_CM_GLOBAL_CREDIT_SHARED_LIMIT_MASK 0xFFFFull
845#define SEND_CM_GLOBAL_CREDIT_SHARED_LIMIT_SHIFT 0847#define SEND_CM_GLOBAL_CREDIT_SHARED_LIMIT_SHIFT 0
drivers/infiniband/hw/hfi1/hfi.h+10−1
@@ -1045,6 +1045,14 @@ struct hfi1_devdata { · 1044 unmodified lines
1045 /* initial vl15 credits to use */1045 /* initial vl15 credits to use */
1046 u16 vl15_init;1046 u16 vl15_init;
1047 1047
1048 /*
1049 * Cached value for vl15buf, read during verify cap interrupt. VL15
1050 * credits are to be kept at 0 and set when handling the link-up
1051 * interrupt. This removes the possibility of receiving VL15 MAD
1052 * packets before this HFI is ready.
1053 */
1054 u16 vl15buf_cached;
1055
1048 /* Misc small ints */1056 /* Misc small ints */
1049 u8 n_krcv_queues;1057 u8 n_krcv_queues;
1050 u8 qos_shift;1058 u8 qos_shift;
@@ -1598,7 +1606,8 @@ int hfi1_rcvbuf_validate(u32 size, u8 type, u16 *encode); · 547 unmodified lines
1598int fm_get_table(struct hfi1_pportdata *ppd, int which, void *t);1606int fm_get_table(struct hfi1_pportdata *ppd, int which, void *t);
1599int fm_set_table(struct hfi1_pportdata *ppd, int which, void *t);1607int fm_set_table(struct hfi1_pportdata *ppd, int which, void *t);
1600 1608
1601void set_up_vl15(struct hfi1_devdata *dd, u8 vau, u16 vl15buf);1609void set_up_vau(struct hfi1_devdata *dd, u8 vau);
1610void set_up_vl15(struct hfi1_devdata *dd, u16 vl15buf);
1602void reset_link_credits(struct hfi1_devdata *dd);1611void reset_link_credits(struct hfi1_devdata *dd);
1603void assign_remote_cm_au_table(struct hfi1_devdata *dd, u8 vcu);1612void assign_remote_cm_au_table(struct hfi1_devdata *dd, u8 vcu);
1604 1613
drivers/infiniband/hw/hfi1/intr.c+2−1
@@ -130,7 +130,8 @@ void handle_linkup_change(struct hfi1_devdata *dd, u32 linkup) · 129 unmodified lines
130 * the remote values. Both sides must be using the values.130 * the remote values. Both sides must be using the values.
131 */131 */
132 if (quick_linkup || dd->icode == ICODE_FUNCTIONAL_SIMULATOR) {132 if (quick_linkup || dd->icode == ICODE_FUNCTIONAL_SIMULATOR) {
133 set_up_vl15(dd, dd->vau, dd->vl15_init);133 set_up_vau(dd, dd->vau);
134 set_up_vl15(dd, dd->vl15_init);
134 assign_remote_cm_au_table(dd, dd->vcu);135 assign_remote_cm_au_table(dd, dd->vcu);
135 }136 }
136 137
drivers/infiniband/hw/hfi1/pcie.c+2−2
@@ -207,8 +207,8 @@ int hfi1_pcie_ddinit(struct hfi1_devdata *dd, struct pci_dev *pdev) · 206 unmodified lines
207 /*207 /*
208 * Save BARs and command to rewrite after device reset.208 * Save BARs and command to rewrite after device reset.
209 */209 */
210 dd->pcibar0 = addr;210 pci_read_config_dword(dd->pcidev, PCI_BASE_ADDRESS_0, &dd->pcibar0);
211 dd->pcibar1 = addr >> 32;211 pci_read_config_dword(dd->pcidev, PCI_BASE_ADDRESS_1, &dd->pcibar1);
212 pci_read_config_dword(dd->pcidev, PCI_ROM_ADDRESS, &dd->pci_rom);212 pci_read_config_dword(dd->pcidev, PCI_ROM_ADDRESS, &dd->pci_rom);
213 pci_read_config_word(dd->pcidev, PCI_COMMAND, &dd->pci_command);213 pci_read_config_word(dd->pcidev, PCI_COMMAND, &dd->pci_command);
214 pcie_capability_read_word(dd->pcidev, PCI_EXP_DEVCTL, &dd->pcie_devctl);214 pcie_capability_read_word(dd->pcidev, PCI_EXP_DEVCTL, &dd->pcie_devctl);
drivers/infiniband/hw/hfi1/rc.c+4−1
@@ -2159,8 +2159,11 @@ send_last: · 2158 unmodified lines
2159 ret = hfi1_rvt_get_rwqe(qp, 1);2159 ret = hfi1_rvt_get_rwqe(qp, 1);
2160 if (ret < 0)2160 if (ret < 0)
2161 goto nack_op_err;2161 goto nack_op_err;
2162 if (!ret)2162 if (!ret) {
2163 /* peer will send again */
2164 rvt_put_ss(&qp->r_sge);
2163 goto rnr_nak;2165 goto rnr_nak;
2166 }
2164 wc.ex.imm_data = ohdr->u.rc.imm_data;2167 wc.ex.imm_data = ohdr->u.rc.imm_data;
2165 wc.wc_flags = IB_WC_WITH_IMM;2168 wc.wc_flags = IB_WC_WITH_IMM;
2166 goto send_last;2169 goto send_last;
drivers/infiniband/hw/hfi1/sysfs.c+2−1
@@ -196,7 +196,8 @@ static const struct sysfs_ops port_cc_sysfs_ops = { · 195 unmodified lines
196};196};
197 197
198static struct attribute *port_cc_default_attributes[] = {198static struct attribute *port_cc_default_attributes[] = {
199 &cc_prescan_attr.attr199 &cc_prescan_attr.attr,
200 NULL
200};201};
201 202
202static struct kobj_type port_cc_ktype = {203static struct kobj_type port_cc_ktype = {
drivers/infiniband/hw/i40iw/i40iw_cm.c+1−2
@@ -784,7 +784,6 @@ static void i40iw_build_mpa_v2(struct i40iw_cm_node *cm_node, · 783 unmodified lines
784 }784 }
785 785
786 ctrl_ird |= IETF_PEER_TO_PEER;786 ctrl_ird |= IETF_PEER_TO_PEER;
787 ctrl_ird |= IETF_FLPDU_ZERO_LEN;
788 787
789 switch (mpa_key) {788 switch (mpa_key) {
790 case MPA_KEY_REQUEST:789 case MPA_KEY_REQUEST:
@@ -2446,8 +2445,8 @@ static void i40iw_handle_rcv_mpa(struct i40iw_cm_node *cm_node, · 1655 unmodified lines
2446 } else {2445 } else {
2447 type = I40IW_CM_EVENT_CONNECTED;2446 type = I40IW_CM_EVENT_CONNECTED;
2448 cm_node->state = I40IW_CM_STATE_OFFLOADED;2447 cm_node->state = I40IW_CM_STATE_OFFLOADED;
2449 i40iw_send_ack(cm_node);
2450 }2448 }
2449 i40iw_send_ack(cm_node);
2451 break;2450 break;
2452 default:2451 default:
2453 pr_err("%s wrong cm_node state =%d\n", __func__, cm_node->state);2452 pr_err("%s wrong cm_node state =%d\n", __func__, cm_node->state);
drivers/infiniband/hw/i40iw/i40iw_ctrl.c+1−11
@@ -285,28 +285,20 @@ void i40iw_change_l2params(struct i40iw_sc_vsi *vsi, struct i40iw_l2params *l2pa · 284 unmodified lines
285 struct i40iw_sc_dev *dev = vsi->dev;285 struct i40iw_sc_dev *dev = vsi->dev;
286 struct i40iw_sc_qp *qp = NULL;286 struct i40iw_sc_qp *qp = NULL;
287 bool qs_handle_change = false;287 bool qs_handle_change = false;
288 bool mss_change = false;
289 unsigned long flags;288 unsigned long flags;
290 u16 qs_handle;289 u16 qs_handle;
291 int i;290 int i;
292 291
293 if (vsi->mss != l2params->mss) {292 vsi->mss = l2params->mss;
294 mss_change = true;
295 vsi->mss = l2params->mss;
296 }
297 293
298 i40iw_fill_qos_list(l2params->qs_handle_list);294 i40iw_fill_qos_list(l2params->qs_handle_list);
299 for (i = 0; i < I40IW_MAX_USER_PRIORITY; i++) {295 for (i = 0; i < I40IW_MAX_USER_PRIORITY; i++) {
300 qs_handle = l2params->qs_handle_list[i];296 qs_handle = l2params->qs_handle_list[i];
301 if (vsi->qos[i].qs_handle != qs_handle)297 if (vsi->qos[i].qs_handle != qs_handle)
302 qs_handle_change = true;298 qs_handle_change = true;
303 else if (!mss_change)
304 continue; /* no MSS nor qs handle change */
305 spin_lock_irqsave(&vsi->qos[i].lock, flags);299 spin_lock_irqsave(&vsi->qos[i].lock, flags);
306 qp = i40iw_get_qp(&vsi->qos[i].qplist, qp);300 qp = i40iw_get_qp(&vsi->qos[i].qplist, qp);
307 while (qp) {301 while (qp) {
308 if (mss_change)
309 i40iw_qp_mss_modify(dev, qp);
310 if (qs_handle_change) {302 if (qs_handle_change) {
311 qp->qs_handle = qs_handle;303 qp->qs_handle = qs_handle;
312 /* issue cqp suspend command */304 /* issue cqp suspend command */
@@ -2395,7 +2387,6 @@ static enum i40iw_status_code i40iw_sc_qp_modify( · 2082 unmodified lines
2395 2387
2396 set_64bit_val(wqe,2388 set_64bit_val(wqe,
2397 8,2389 8,
2398 LS_64(info->new_mss, I40IW_CQPSQ_QP_NEWMSS) |
2399 LS_64(term_len, I40IW_CQPSQ_QP_TERMLEN));2390 LS_64(term_len, I40IW_CQPSQ_QP_TERMLEN));
2400 2391
2401 set_64bit_val(wqe, 16, qp->hw_host_ctx_pa);2392 set_64bit_val(wqe, 16, qp->hw_host_ctx_pa);
@@ -2410,7 +2401,6 @@ static enum i40iw_status_code i40iw_sc_qp_modify( · 8 unmodified lines
2410 LS_64(info->cq_num_valid, I40IW_CQPSQ_QP_CQNUMVALID) |2401 LS_64(info->cq_num_valid, I40IW_CQPSQ_QP_CQNUMVALID) |
2411 LS_64(info->force_loopback, I40IW_CQPSQ_QP_FORCELOOPBACK) |2402 LS_64(info->force_loopback, I40IW_CQPSQ_QP_FORCELOOPBACK) |
2412 LS_64(qp->qp_type, I40IW_CQPSQ_QP_QPTYPE) |2403 LS_64(qp->qp_type, I40IW_CQPSQ_QP_QPTYPE) |
2413 LS_64(info->mss_change, I40IW_CQPSQ_QP_MSSCHANGE) |
2414 LS_64(info->static_rsrc, I40IW_CQPSQ_QP_STATRSRC) |2404 LS_64(info->static_rsrc, I40IW_CQPSQ_QP_STATRSRC) |
2415 LS_64(info->remove_hash_idx, I40IW_CQPSQ_QP_REMOVEHASHENTRY) |2405 LS_64(info->remove_hash_idx, I40IW_CQPSQ_QP_REMOVEHASHENTRY) |
2416 LS_64(term_actions, I40IW_CQPSQ_QP_TERMACT) |2406 LS_64(term_actions, I40IW_CQPSQ_QP_TERMACT) |
drivers/infiniband/hw/i40iw/i40iw_main.c+13−7
@@ -1319,13 +1319,13 @@ static enum i40iw_status_code i40iw_initialize_dev(struct i40iw_device *iwdev, · 1318 unmodified lines
1319 status = i40iw_obj_aligned_mem(iwdev, &mem, I40IW_QUERY_FPM_BUF_SIZE,1319 status = i40iw_obj_aligned_mem(iwdev, &mem, I40IW_QUERY_FPM_BUF_SIZE,
1320 I40IW_FPM_QUERY_BUF_ALIGNMENT_MASK);1320 I40IW_FPM_QUERY_BUF_ALIGNMENT_MASK);
1321 if (status)1321 if (status)
1322 goto exit;1322 goto error;
1323 info.fpm_query_buf_pa = mem.pa;1323 info.fpm_query_buf_pa = mem.pa;
1324 info.fpm_query_buf = mem.va;1324 info.fpm_query_buf = mem.va;
1325 status = i40iw_obj_aligned_mem(iwdev, &mem, I40IW_COMMIT_FPM_BUF_SIZE,1325 status = i40iw_obj_aligned_mem(iwdev, &mem, I40IW_COMMIT_FPM_BUF_SIZE,
1326 I40IW_FPM_COMMIT_BUF_ALIGNMENT_MASK);1326 I40IW_FPM_COMMIT_BUF_ALIGNMENT_MASK);
1327 if (status)1327 if (status)
1328 goto exit;1328 goto error;
1329 info.fpm_commit_buf_pa = mem.pa;1329 info.fpm_commit_buf_pa = mem.pa;
1330 info.fpm_commit_buf = mem.va;1330 info.fpm_commit_buf = mem.va;
1331 info.hmc_fn_id = ldev->fid;1331 info.hmc_fn_id = ldev->fid;
@@ -1347,11 +1347,9 @@ static enum i40iw_status_code i40iw_initialize_dev(struct i40iw_device *iwdev, · 15 unmodified lines
1347 info.exception_lan_queue = 1;1347 info.exception_lan_queue = 1;
1348 info.vchnl_send = i40iw_virtchnl_send;1348 info.vchnl_send = i40iw_virtchnl_send;
1349 status = i40iw_device_init(&iwdev->sc_dev, &info);1349 status = i40iw_device_init(&iwdev->sc_dev, &info);
1350exit:1350
1351 if (status) {1351 if (status)
1352 kfree(iwdev->hmc_info_mem);1352 goto error;
1353 iwdev->hmc_info_mem = NULL;
1354 }
1355 memset(&vsi_info, 0, sizeof(vsi_info));1353 memset(&vsi_info, 0, sizeof(vsi_info));
1356 vsi_info.dev = &iwdev->sc_dev;1354 vsi_info.dev = &iwdev->sc_dev;
1357 vsi_info.back_vsi = (void *)iwdev;1355 vsi_info.back_vsi = (void *)iwdev;
@@ -1362,11 +1360,19 @@ exit: · 4 unmodified lines
1362 memset(&stats_info, 0, sizeof(stats_info));1360 memset(&stats_info, 0, sizeof(stats_info));
1363 stats_info.fcn_id = ldev->fid;1361 stats_info.fcn_id = ldev->fid;
1364 stats_info.pestat = kzalloc(sizeof(*stats_info.pestat), GFP_KERNEL);1362 stats_info.pestat = kzalloc(sizeof(*stats_info.pestat), GFP_KERNEL);
1363 if (!stats_info.pestat) {
1364 status = I40IW_ERR_NO_MEMORY;
1365 goto error;
1366 }
1365 stats_info.stats_initialize = true;1367 stats_info.stats_initialize = true;
1366 if (stats_info.pestat)1368 if (stats_info.pestat)
1367 i40iw_vsi_stats_init(&iwdev->vsi, &stats_info);1369 i40iw_vsi_stats_init(&iwdev->vsi, &stats_info);
1368 }1370 }
1369 return status;1371 return status;
1372error:
1373 kfree(iwdev->hmc_info_mem);
1374 iwdev->hmc_info_mem = NULL;
1375 return status;
1370}1376}
1371 1377
1372/**1378/**
drivers/infiniband/hw/i40iw/i40iw_osdep.h+0−1
@@ -199,7 +199,6 @@ void i40iw_cqp_spawn_worker(struct i40iw_sc_dev *dev, · 198 unmodified lines
199 struct i40iw_virtchnl_work_info *work_info, u32 iw_vf_idx);199 struct i40iw_virtchnl_work_info *work_info, u32 iw_vf_idx);
200void *i40iw_remove_head(struct list_head *list);200void *i40iw_remove_head(struct list_head *list);
201void i40iw_qp_suspend_resume(struct i40iw_sc_dev *dev, struct i40iw_sc_qp *qp, bool suspend);201void i40iw_qp_suspend_resume(struct i40iw_sc_dev *dev, struct i40iw_sc_qp *qp, bool suspend);
202void i40iw_qp_mss_modify(struct i40iw_sc_dev *dev, struct i40iw_sc_qp *qp);
203 202
204void i40iw_term_modify_qp(struct i40iw_sc_qp *qp, u8 next_state, u8 term, u8 term_len);203void i40iw_term_modify_qp(struct i40iw_sc_qp *qp, u8 next_state, u8 term, u8 term_len);
205void i40iw_terminate_done(struct i40iw_sc_qp *qp, int timeout_occurred);204void i40iw_terminate_done(struct i40iw_sc_qp *qp, int timeout_occurred);
drivers/infiniband/hw/i40iw/i40iw_type.h+0−2
@@ -541,7 +541,6 @@ struct i40iw_create_qp_info { · 540 unmodified lines
541struct i40iw_modify_qp_info {541struct i40iw_modify_qp_info {
542 u64 rx_win0;542 u64 rx_win0;
543 u64 rx_win1;543 u64 rx_win1;
544 u16 new_mss;
545 u8 next_iwarp_state;544 u8 next_iwarp_state;
546 u8 termlen;545 u8 termlen;
547 bool ord_valid;546 bool ord_valid;
@@ -554,7 +553,6 @@ struct i40iw_modify_qp_info { · 6 unmodified lines
554 bool dont_send_term;553 bool dont_send_term;
555 bool dont_send_fin;554 bool dont_send_fin;
556 bool cached_var_valid;555 bool cached_var_valid;
557 bool mss_change;
558 bool force_loopback;556 bool force_loopback;
559};557};
560 558
drivers/infiniband/hw/i40iw/i40iw_utils.c+0−17
@@ -756,23 +756,6 @@ void i40iw_qp_suspend_resume(struct i40iw_sc_dev *dev, struct i40iw_sc_qp *qp, b · 755 unmodified lines
756 i40iw_pr_err("CQP-OP QP Suspend/Resume fail");756 i40iw_pr_err("CQP-OP QP Suspend/Resume fail");
757}757}
758 758
759/**
760 * i40iw_qp_mss_modify - modify mss for qp
761 * @dev: hardware control device structure
762 * @qp: hardware control qp
763 */
764void i40iw_qp_mss_modify(struct i40iw_sc_dev *dev, struct i40iw_sc_qp *qp)
765{
766 struct i40iw_device *iwdev = (struct i40iw_device *)dev->back_dev;
767 struct i40iw_qp *iwqp = (struct i40iw_qp *)qp->back_qp;
768 struct i40iw_modify_qp_info info;
769
770 memset(&info, 0, sizeof(info));
771 info.mss_change = true;
772 info.new_mss = qp->vsi->mss;
773 i40iw_hw_modify_qp(iwdev, iwqp, &info, false);
774}
775
776/**759/**
777 * i40iw_term_modify_qp - modify qp for term message760 * i40iw_term_modify_qp - modify qp for term message
778 * @qp: hardware control qp761 * @qp: hardware control qp
drivers/infiniband/hw/i40iw/i40iw_virtchnl.c+1−4
@@ -443,10 +443,7 @@ enum i40iw_status_code i40iw_vchnl_recv_pf(struct i40iw_sc_dev *dev, · 442 unmodified lines
443 if (!dev->vchnl_up)443 if (!dev->vchnl_up)
444 return I40IW_ERR_NOT_READY;444 return I40IW_ERR_NOT_READY;
445 if (vchnl_msg->iw_op_code == I40IW_VCHNL_OP_GET_VER) {445 if (vchnl_msg->iw_op_code == I40IW_VCHNL_OP_GET_VER) {
446 if (vchnl_msg->iw_op_ver != I40IW_VCHNL_OP_GET_VER_V0)446 vchnl_pf_send_get_ver_resp(dev, vf_id, vchnl_msg);
447 vchnl_pf_send_get_ver_resp(dev, vf_id, vchnl_msg);
448 else
449 vchnl_pf_send_get_ver_resp(dev, vf_id, vchnl_msg);
450 return I40IW_SUCCESS;447 return I40IW_SUCCESS;
451 }448 }
452 for (iw_vf_idx = 0; iw_vf_idx < I40IW_MAX_PE_ENABLED_VF_COUNT; iw_vf_idx++) {449 for (iw_vf_idx = 0; iw_vf_idx < I40IW_MAX_PE_ENABLED_VF_COUNT; iw_vf_idx++) {
drivers/infiniband/hw/mlx4/mad.c+1−0
@@ -1578,6 +1578,7 @@ static void mlx4_ib_multiplex_mad(struct mlx4_ib_demux_pv_ctx *ctx, struct ib_wc · 1577 unmodified lines
1578 if (port < 0)1578 if (port < 0)
1579 return;1579 return;
1580 ah.av.ib.port_pd = cpu_to_be32(port << 24 | (be32_to_cpu(ah.av.ib.port_pd) & 0xffffff));1580 ah.av.ib.port_pd = cpu_to_be32(port << 24 | (be32_to_cpu(ah.av.ib.port_pd) & 0xffffff));
1581 ah.ibah.type = rdma_ah_find_type(&dev->ib_dev, port);
1581 1582
1582 mlx4_ib_query_ah(&ah.ibah, &ah_attr);1583 mlx4_ib_query_ah(&ah.ibah, &ah_attr);
1583 if (rdma_ah_get_ah_flags(&ah_attr) & IB_AH_GRH)1584 if (rdma_ah_get_ah_flags(&ah_attr) & IB_AH_GRH)
drivers/infiniband/hw/mlx5/main.c+18−2
@@ -2979,6 +2979,18 @@ error_0: · 2978 unmodified lines
2979 return ret;2979 return ret;
2980}2980}
2981 2981
2982static u8 mlx5_get_umr_fence(u8 umr_fence_cap)
2983{
2984 switch (umr_fence_cap) {
2985 case MLX5_CAP_UMR_FENCE_NONE:
2986 return MLX5_FENCE_MODE_NONE;
2987 case MLX5_CAP_UMR_FENCE_SMALL:
2988 return MLX5_FENCE_MODE_INITIATOR_SMALL;
2989 default:
2990 return MLX5_FENCE_MODE_STRONG_ORDERING;
2991 }
2992}
2993
2982static int create_dev_resources(struct mlx5_ib_resources *devr)2994static int create_dev_resources(struct mlx5_ib_resources *devr)
2983{2995{
2984 struct ib_srq_init_attr attr;2996 struct ib_srq_init_attr attr;
@@ -3680,8 +3692,10 @@ static void *mlx5_ib_add(struct mlx5_core_dev *mdev) · 695 unmodified lines
3680 dev->ib_dev.check_mr_status = mlx5_ib_check_mr_status;3692 dev->ib_dev.check_mr_status = mlx5_ib_check_mr_status;
3681 dev->ib_dev.get_port_immutable = mlx5_port_immutable;3693 dev->ib_dev.get_port_immutable = mlx5_port_immutable;
3682 dev->ib_dev.get_dev_fw_str = get_dev_fw_str;3694 dev->ib_dev.get_dev_fw_str = get_dev_fw_str;
3683 dev->ib_dev.alloc_rdma_netdev = mlx5_ib_alloc_rdma_netdev;3695 if (MLX5_CAP_GEN(mdev, ipoib_enhanced_offloads)) {
3684 dev->ib_dev.free_rdma_netdev = mlx5_ib_free_rdma_netdev;3696 dev->ib_dev.alloc_rdma_netdev = mlx5_ib_alloc_rdma_netdev;
3697 dev->ib_dev.free_rdma_netdev = mlx5_ib_free_rdma_netdev;
3698 }
3685 if (mlx5_core_is_pf(mdev)) {3699 if (mlx5_core_is_pf(mdev)) {
3686 dev->ib_dev.get_vf_config = mlx5_ib_get_vf_config;3700 dev->ib_dev.get_vf_config = mlx5_ib_get_vf_config;
3687 dev->ib_dev.set_vf_link_state = mlx5_ib_set_vf_link_state;3701 dev->ib_dev.set_vf_link_state = mlx5_ib_set_vf_link_state;
@@ -3693,6 +3707,8 @@ static void *mlx5_ib_add(struct mlx5_core_dev *mdev) · 5 unmodified lines
3693 3707
3694 mlx5_ib_internal_fill_odp_caps(dev);3708 mlx5_ib_internal_fill_odp_caps(dev);
3695 3709
3710 dev->umr_fence = mlx5_get_umr_fence(MLX5_CAP_GEN(mdev, umr_fence));
3711
3696 if (MLX5_CAP_GEN(mdev, imaicl)) {3712 if (MLX5_CAP_GEN(mdev, imaicl)) {
3697 dev->ib_dev.alloc_mw = mlx5_ib_alloc_mw;3713 dev->ib_dev.alloc_mw = mlx5_ib_alloc_mw;
3698 dev->ib_dev.dealloc_mw = mlx5_ib_dealloc_mw;3714 dev->ib_dev.dealloc_mw = mlx5_ib_dealloc_mw;
drivers/infiniband/hw/mlx5/mlx5_ib.h+2−1
@@ -349,7 +349,7 @@ struct mlx5_ib_qp { · 348 unmodified lines
349 struct mlx5_ib_wq rq;349 struct mlx5_ib_wq rq;
350 350
351 u8 sq_signal_bits;351 u8 sq_signal_bits;
352 u8 fm_cache;352 u8 next_fence;
353 struct mlx5_ib_wq sq;353 struct mlx5_ib_wq sq;
354 354
355 /* serialize qp state modifications355 /* serialize qp state modifications
@@ -654,6 +654,7 @@ struct mlx5_ib_dev { · 298 unmodified lines
654 struct mlx5_ib_port *port;654 struct mlx5_ib_port *port;
655 struct mlx5_sq_bfreg bfreg;655 struct mlx5_sq_bfreg bfreg;
656 struct mlx5_sq_bfreg fp_bfreg;656 struct mlx5_sq_bfreg fp_bfreg;
657 u8 umr_fence;
657};658};
658 659
659static inline struct mlx5_ib_cq *to_mibcq(struct mlx5_core_cq *mcq)660static inline struct mlx5_ib_cq *to_mibcq(struct mlx5_core_cq *mcq)
drivers/infiniband/hw/mlx5/qp.c+23−36
@@ -3738,24 +3738,6 @@ static void dump_wqe(struct mlx5_ib_qp *qp, int idx, int size_16) · 3737 unmodified lines
3738 }3738 }
3739}3739}
3740 3740
3741static u8 get_fence(u8 fence, struct ib_send_wr *wr)
3742{
3743 if (unlikely(wr->opcode == IB_WR_LOCAL_INV &&
3744 wr->send_flags & IB_SEND_FENCE))
3745 return MLX5_FENCE_MODE_STRONG_ORDERING;
3746
3747 if (unlikely(fence)) {
3748 if (wr->send_flags & IB_SEND_FENCE)
3749 return MLX5_FENCE_MODE_SMALL_AND_FENCE;
3750 else
3751 return fence;
3752 } else if (unlikely(wr->send_flags & IB_SEND_FENCE)) {
3753 return MLX5_FENCE_MODE_FENCE;
3754 }
3755
3756 return 0;
3757}
3758
3759static int begin_wqe(struct mlx5_ib_qp *qp, void **seg,3741static int begin_wqe(struct mlx5_ib_qp *qp, void **seg,
3760 struct mlx5_wqe_ctrl_seg **ctrl,3742 struct mlx5_wqe_ctrl_seg **ctrl,
3761 struct ib_send_wr *wr, unsigned *idx,3743 struct ib_send_wr *wr, unsigned *idx,
@@ -3784,8 +3766,7 @@ static int begin_wqe(struct mlx5_ib_qp *qp, void **seg, · 22 unmodified lines
3784static void finish_wqe(struct mlx5_ib_qp *qp,3766static void finish_wqe(struct mlx5_ib_qp *qp,
3785 struct mlx5_wqe_ctrl_seg *ctrl,3767 struct mlx5_wqe_ctrl_seg *ctrl,
3786 u8 size, unsigned idx, u64 wr_id,3768 u8 size, unsigned idx, u64 wr_id,
3787 int nreq, u8 fence, u8 next_fence,3769 int nreq, u8 fence, u32 mlx5_opcode)
3788 u32 mlx5_opcode)
3789{3770{
3790 u8 opmod = 0;3771 u8 opmod = 0;
3791 3772
@@ -3793,7 +3774,6 @@ static void finish_wqe(struct mlx5_ib_qp *qp, · 1 unmodified line
3793 mlx5_opcode | ((u32)opmod << 24));3774 mlx5_opcode | ((u32)opmod << 24));
3794 ctrl->qpn_ds = cpu_to_be32(size | (qp->trans_qp.base.mqp.qpn << 8));3775 ctrl->qpn_ds = cpu_to_be32(size | (qp->trans_qp.base.mqp.qpn << 8));
3795 ctrl->fm_ce_se |= fence;3776 ctrl->fm_ce_se |= fence;
3796 qp->fm_cache = next_fence;
3797 if (unlikely(qp->wq_sig))3777 if (unlikely(qp->wq_sig))
3798 ctrl->signature = wq_sig(ctrl);3778 ctrl->signature = wq_sig(ctrl);
3799 3779
@@ -3853,7 +3833,6 @@ int mlx5_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, · 53 unmodified lines
3853 goto out;3833 goto out;
3854 }3834 }
3855 3835
3856 fence = qp->fm_cache;
3857 num_sge = wr->num_sge;3836 num_sge = wr->num_sge;
3858 if (unlikely(num_sge > qp->sq.max_gs)) {3837 if (unlikely(num_sge > qp->sq.max_gs)) {
3859 mlx5_ib_warn(dev, "\n");3838 mlx5_ib_warn(dev, "\n");
@@ -3870,6 +3849,19 @@ int mlx5_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, · 10 unmodified lines
3870 goto out;3849 goto out;
3871 }3850 }
3872 3851
3852 if (wr->opcode == IB_WR_LOCAL_INV ||
3853 wr->opcode == IB_WR_REG_MR) {
3854 fence = dev->umr_fence;
3855 next_fence = MLX5_FENCE_MODE_INITIATOR_SMALL;
3856 } else if (wr->send_flags & IB_SEND_FENCE) {
3857 if (qp->next_fence)
3858 fence = MLX5_FENCE_MODE_SMALL_AND_FENCE;
3859 else
3860 fence = MLX5_FENCE_MODE_FENCE;
3861 } else {
3862 fence = qp->next_fence;
3863 }
3864
3873 switch (ibqp->qp_type) {3865 switch (ibqp->qp_type) {
3874 case IB_QPT_XRC_INI:3866 case IB_QPT_XRC_INI:
3875 xrc = seg;3867 xrc = seg;
@@ -3896,7 +3888,6 @@ int mlx5_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, · 20 unmodified lines
3896 goto out;3888 goto out;
3897 3889
3898 case IB_WR_LOCAL_INV:3890 case IB_WR_LOCAL_INV:
3899 next_fence = MLX5_FENCE_MODE_INITIATOR_SMALL;
3900 qp->sq.wr_data[idx] = IB_WR_LOCAL_INV;3891 qp->sq.wr_data[idx] = IB_WR_LOCAL_INV;
3901 ctrl->imm = cpu_to_be32(wr->ex.invalidate_rkey);3892 ctrl->imm = cpu_to_be32(wr->ex.invalidate_rkey);
3902 set_linv_wr(qp, &seg, &size);3893 set_linv_wr(qp, &seg, &size);
@@ -3904,7 +3895,6 @@ int mlx5_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, · 1 unmodified line
3904 break;3895 break;
3905 3896
3906 case IB_WR_REG_MR:3897 case IB_WR_REG_MR:
3907 next_fence = MLX5_FENCE_MODE_INITIATOR_SMALL;
3908 qp->sq.wr_data[idx] = IB_WR_REG_MR;3898 qp->sq.wr_data[idx] = IB_WR_REG_MR;
3909 ctrl->imm = cpu_to_be32(reg_wr(wr)->key);3899 ctrl->imm = cpu_to_be32(reg_wr(wr)->key);
3910 err = set_reg_wr(qp, reg_wr(wr), &seg, &size);3900 err = set_reg_wr(qp, reg_wr(wr), &seg, &size);
@@ -3927,9 +3917,8 @@ int mlx5_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, · 16 unmodified lines
3927 goto out;3917 goto out;
3928 }3918 }
3929 3919
3930 finish_wqe(qp, ctrl, size, idx, wr->wr_id,3920 finish_wqe(qp, ctrl, size, idx, wr->wr_id, nreq,
3931 nreq, get_fence(fence, wr),3921 fence, MLX5_OPCODE_UMR);
3932 next_fence, MLX5_OPCODE_UMR);
3933 /*3922 /*
3934 * SET_PSV WQEs are not signaled and solicited3923 * SET_PSV WQEs are not signaled and solicited
3935 * on error3924 * on error
@@ -3954,9 +3943,8 @@ int mlx5_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, · 18 unmodified lines
3954 goto out;3943 goto out;
3955 }3944 }
3956 3945
3957 finish_wqe(qp, ctrl, size, idx, wr->wr_id,3946 finish_wqe(qp, ctrl, size, idx, wr->wr_id, nreq,
3958 nreq, get_fence(fence, wr),3947 fence, MLX5_OPCODE_SET_PSV);
3959 next_fence, MLX5_OPCODE_SET_PSV);
3960 err = begin_wqe(qp, &seg, &ctrl, wr,3948 err = begin_wqe(qp, &seg, &ctrl, wr,
3961 &idx, &size, nreq);3949 &idx, &size, nreq);
3962 if (err) {3950 if (err) {
@@ -3966,7 +3954,6 @@ int mlx5_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, · 3 unmodified lines
3966 goto out;3954 goto out;
3967 }3955 }
3968 3956
3969 next_fence = MLX5_FENCE_MODE_INITIATOR_SMALL;
3970 err = set_psv_wr(&sig_handover_wr(wr)->sig_attrs->wire,3957 err = set_psv_wr(&sig_handover_wr(wr)->sig_attrs->wire,
3971 mr->sig->psv_wire.psv_idx, &seg,3958 mr->sig->psv_wire.psv_idx, &seg,
3972 &size);3959 &size);
@@ -3976,9 +3963,9 @@ int mlx5_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, · 3 unmodified lines
3976 goto out;3963 goto out;
3977 }3964 }
3978 3965
3979 finish_wqe(qp, ctrl, size, idx, wr->wr_id,3966 finish_wqe(qp, ctrl, size, idx, wr->wr_id, nreq,
3980 nreq, get_fence(fence, wr),3967 fence, MLX5_OPCODE_SET_PSV);
3981 next_fence, MLX5_OPCODE_SET_PSV);3968 qp->next_fence = MLX5_FENCE_MODE_INITIATOR_SMALL;
3982 num_sge = 0;3969 num_sge = 0;
3983 goto skip_psv;3970 goto skip_psv;
3984 3971
@@ -4089,8 +4076,8 @@ int mlx5_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, · 104 unmodified lines
4089 }4076 }
4090 }4077 }
4091 4078
4092 finish_wqe(qp, ctrl, size, idx, wr->wr_id, nreq,4079 qp->next_fence = next_fence;
4093 get_fence(fence, wr), next_fence,4080 finish_wqe(qp, ctrl, size, idx, wr->wr_id, nreq, fence,
4094 mlx5_ib_opcode[wr->opcode]);4081 mlx5_ib_opcode[wr->opcode]);
4095skip_psv:4082skip_psv:
4096 if (0)4083 if (0)
drivers/infiniband/hw/nes/nes_cm.c+1−2
@@ -610,7 +610,6 @@ static void build_mpa_v2(struct nes_cm_node *cm_node, · 609 unmodified lines
610 ctrl_ord = cm_node->ord_size & IETF_NO_IRD_ORD;610 ctrl_ord = cm_node->ord_size & IETF_NO_IRD_ORD;
611 }611 }
612 ctrl_ird |= IETF_PEER_TO_PEER;612 ctrl_ird |= IETF_PEER_TO_PEER;
613 ctrl_ird |= IETF_FLPDU_ZERO_LEN;
614 613
615 switch (mpa_key) {614 switch (mpa_key) {
616 case MPA_KEY_REQUEST:615 case MPA_KEY_REQUEST:
@@ -1826,7 +1825,7 @@ static void handle_rcv_mpa(struct nes_cm_node *cm_node, struct sk_buff *skb) · 1209 unmodified lines
1826 type = NES_CM_EVENT_CONNECTED;1825 type = NES_CM_EVENT_CONNECTED;
1827 cm_node->state = NES_CM_STATE_TSA;1826 cm_node->state = NES_CM_STATE_TSA;
1828 }1827 }
1829 1828 send_ack(cm_node, NULL);
1830 break;1829 break;
1831 default:1830 default:
1832 WARN_ON(1);1831 WARN_ON(1);
drivers/infiniband/hw/qedr/qedr.h+4−1
@@ -58,7 +58,10 @@ · 57 unmodified lines
58#define QEDR_MSG_QP " QP"58#define QEDR_MSG_QP " QP"
59#define QEDR_MSG_GSI " GSI"59#define QEDR_MSG_GSI " GSI"
60 60
61#define QEDR_CQ_MAGIC_NUMBER (0x11223344)61#define QEDR_CQ_MAGIC_NUMBER (0x11223344)
62
63#define FW_PAGE_SIZE (RDMA_RING_PAGE_SIZE)
64#define FW_PAGE_SHIFT (12)
62 65
63struct qedr_dev;66struct qedr_dev;
64 67
drivers/infiniband/hw/qedr/qedr_cm.c+6−4
@@ -270,11 +270,13 @@ static inline int qedr_gsi_build_header(struct qedr_dev *dev, · 269 unmodified lines
270 return rc;270 return rc;
271 }271 }
272 272
273 vlan_id = rdma_vlan_dev_vlan_id(sgid_attr.ndev);273 if (sgid_attr.ndev) {
274 if (vlan_id < VLAN_CFI_MASK)274 vlan_id = rdma_vlan_dev_vlan_id(sgid_attr.ndev);
275 has_vlan = true;275 if (vlan_id < VLAN_CFI_MASK)
276 if (sgid_attr.ndev)276 has_vlan = true;
277
277 dev_put(sgid_attr.ndev);278 dev_put(sgid_attr.ndev);
279 }
278 280
279 if (!memcmp(&sgid, &zgid, sizeof(sgid))) {281 if (!memcmp(&sgid, &zgid, sizeof(sgid))) {
280 DP_ERR(dev, "gsi post send: GID not found GID index %d\n",282 DP_ERR(dev, "gsi post send: GID not found GID index %d\n",
drivers/infiniband/hw/qedr/verbs.c+41−27
@@ -653,14 +653,15 @@ static int qedr_prepare_pbl_tbl(struct qedr_dev *dev, · 652 unmodified lines
653 653
654static void qedr_populate_pbls(struct qedr_dev *dev, struct ib_umem *umem,654static void qedr_populate_pbls(struct qedr_dev *dev, struct ib_umem *umem,
655 struct qedr_pbl *pbl,655 struct qedr_pbl *pbl,
656 struct qedr_pbl_info *pbl_info)656 struct qedr_pbl_info *pbl_info, u32 pg_shift)
657{657{
658 int shift, pg_cnt, pages, pbe_cnt, total_num_pbes = 0;658 int shift, pg_cnt, pages, pbe_cnt, total_num_pbes = 0;
659 u32 fw_pg_cnt, fw_pg_per_umem_pg;
659 struct qedr_pbl *pbl_tbl;660 struct qedr_pbl *pbl_tbl;
660 struct scatterlist *sg;661 struct scatterlist *sg;
661 struct regpair *pbe;662 struct regpair *pbe;
663 u64 pg_addr;
662 int entry;664 int entry;
663 u32 addr;
664 665
665 if (!pbl_info->num_pbes)666 if (!pbl_info->num_pbes)
666 return;667 return;
@@ -683,29 +684,35 @@ static void qedr_populate_pbls(struct qedr_dev *dev, struct ib_umem *umem, · 16 unmodified lines
683 684
684 shift = umem->page_shift;685 shift = umem->page_shift;
685 686
687 fw_pg_per_umem_pg = BIT(umem->page_shift - pg_shift);
688
686 for_each_sg(umem->sg_head.sgl, sg, umem->nmap, entry) {689 for_each_sg(umem->sg_head.sgl, sg, umem->nmap, entry) {
687 pages = sg_dma_len(sg) >> shift;690 pages = sg_dma_len(sg) >> shift;
691 pg_addr = sg_dma_address(sg);
688 for (pg_cnt = 0; pg_cnt < pages; pg_cnt++) {692 for (pg_cnt = 0; pg_cnt < pages; pg_cnt++) {
689 /* store the page address in pbe */693 for (fw_pg_cnt = 0; fw_pg_cnt < fw_pg_per_umem_pg;) {
690 pbe->lo = cpu_to_le32(sg_dma_address(sg) +694 pbe->lo = cpu_to_le32(pg_addr);
691 (pg_cnt << shift));695 pbe->hi = cpu_to_le32(upper_32_bits(pg_addr));
692 addr = upper_32_bits(sg_dma_address(sg) +696
693 (pg_cnt << shift));697 pg_addr += BIT(pg_shift);
694 pbe->hi = cpu_to_le32(addr);698 pbe_cnt++;
695 pbe_cnt++;699 total_num_pbes++;
696 total_num_pbes++;700 pbe++;
697 pbe++;701
698 702 if (total_num_pbes == pbl_info->num_pbes)
699 if (total_num_pbes == pbl_info->num_pbes)703 return;
700 return;704
701 705 /* If the given pbl is full storing the pbes,
702 /* If the given pbl is full storing the pbes,706 * move to next pbl.
703 * move to next pbl.707 */
704 */708 if (pbe_cnt ==
705 if (pbe_cnt == (pbl_info->pbl_size / sizeof(u64))) {709 (pbl_info->pbl_size / sizeof(u64))) {
706 pbl_tbl++;710 pbl_tbl++;
707 pbe = (struct regpair *)pbl_tbl->va;711 pbe = (struct regpair *)pbl_tbl->va;
708 pbe_cnt = 0;712 pbe_cnt = 0;
713 }
714
715 fw_pg_cnt++;
709 }716 }
710 }717 }
711 }718 }
@@ -754,7 +761,7 @@ static inline int qedr_init_user_queue(struct ib_ucontext *ib_ctx, · 42 unmodified lines
754 u64 buf_addr, size_t buf_len,761 u64 buf_addr, size_t buf_len,
755 int access, int dmasync)762 int access, int dmasync)
756{763{
757 int page_cnt;764 u32 fw_pages;
758 int rc;765 int rc;
759 766
760 q->buf_addr = buf_addr;767 q->buf_addr = buf_addr;
@@ -766,8 +773,10 @@ static inline int qedr_init_user_queue(struct ib_ucontext *ib_ctx, · 5 unmodified lines
766 return PTR_ERR(q->umem);773 return PTR_ERR(q->umem);
767 }774 }
768 775
769 page_cnt = ib_umem_page_count(q->umem);776 fw_pages = ib_umem_page_count(q->umem) <<
770 rc = qedr_prepare_pbl_tbl(dev, &q->pbl_info, page_cnt, 0);777 (q->umem->page_shift - FW_PAGE_SHIFT);
778
779 rc = qedr_prepare_pbl_tbl(dev, &q->pbl_info, fw_pages, 0);
771 if (rc)780 if (rc)
772 goto err0;781 goto err0;
773 782
@@ -777,7 +786,8 @@ static inline int qedr_init_user_queue(struct ib_ucontext *ib_ctx, · 3 unmodified lines
777 goto err0;786 goto err0;
778 }787 }
779 788
780 qedr_populate_pbls(dev, q->umem, q->pbl_tbl, &q->pbl_info);789 qedr_populate_pbls(dev, q->umem, q->pbl_tbl, &q->pbl_info,
790 FW_PAGE_SHIFT);
781 791
782 return 0;792 return 0;
783 793
@@ -2226,7 +2236,7 @@ struct ib_mr *qedr_reg_user_mr(struct ib_pd *ibpd, u64 start, u64 len, · 1442 unmodified lines
2226 goto err1;2236 goto err1;
2227 2237
2228 qedr_populate_pbls(dev, mr->umem, mr->info.pbl_table,2238 qedr_populate_pbls(dev, mr->umem, mr->info.pbl_table,
2229 &mr->info.pbl_info);2239 &mr->info.pbl_info, mr->umem->page_shift);
2230 2240
2231 rc = dev->ops->rdma_alloc_tid(dev->rdma_ctx, &mr->hw_mr.itid);2241 rc = dev->ops->rdma_alloc_tid(dev->rdma_ctx, &mr->hw_mr.itid);
2232 if (rc) {2242 if (rc) {
@@ -3209,6 +3219,10 @@ static int process_req(struct qedr_dev *dev, struct qedr_qp *qp, · 976 unmodified lines
3209 case IB_WC_REG_MR:3219 case IB_WC_REG_MR:
3210 qp->wqe_wr_id[qp->sq.cons].mr->info.completed++;3220 qp->wqe_wr_id[qp->sq.cons].mr->info.completed++;
3211 break;3221 break;
3222 case IB_WC_RDMA_READ:
3223 case IB_WC_SEND:
3224 wc->byte_len = qp->wqe_wr_id[qp->sq.cons].bytes_len;
3225 break;
3212 default:3226 default:
3213 break;3227 break;
3214 }3228 }
drivers/infiniband/hw/qib/qib_rc.c+3−1
@@ -1956,8 +1956,10 @@ send_last: · 1955 unmodified lines
1956 ret = qib_get_rwqe(qp, 1);1956 ret = qib_get_rwqe(qp, 1);
1957 if (ret < 0)1957 if (ret < 0)
1958 goto nack_op_err;1958 goto nack_op_err;
1959 if (!ret)1959 if (!ret) {
1960 rvt_put_ss(&qp->r_sge);
1960 goto rnr_nak;1961 goto rnr_nak;
1962 }
1961 wc.ex.imm_data = ohdr->u.rc.imm_data;1963 wc.ex.imm_data = ohdr->u.rc.imm_data;
1962 hdrsize += 4;1964 hdrsize += 4;
1963 wc.wc_flags = IB_WC_WITH_IMM;1965 wc.wc_flags = IB_WC_WITH_IMM;
drivers/infiniband/sw/rxe/rxe.h+4−1
@@ -68,6 +68,7 @@ · 67 unmodified lines
68static inline u32 rxe_crc32(struct rxe_dev *rxe,68static inline u32 rxe_crc32(struct rxe_dev *rxe,
69 u32 crc, void *next, size_t len)69 u32 crc, void *next, size_t len)
70{70{
71 u32 retval;
71 int err;72 int err;
72 73
73 SHASH_DESC_ON_STACK(shash, rxe->tfm);74 SHASH_DESC_ON_STACK(shash, rxe->tfm);
@@ -81,7 +82,9 @@ static inline u32 rxe_crc32(struct rxe_dev *rxe, · 7 unmodified lines
81 return crc32_le(crc, next, len);82 return crc32_le(crc, next, len);
82 }83 }
83 84
84 return *(u32 *)shash_desc_ctx(shash);85 retval = *(u32 *)shash_desc_ctx(shash);
86 barrier_data(shash_desc_ctx(shash));
87 return retval;
85}88}
86 89
87int rxe_set_mtu(struct rxe_dev *rxe, unsigned int dev_mtu);90int rxe_set_mtu(struct rxe_dev *rxe, unsigned int dev_mtu);
drivers/infiniband/sw/rxe/rxe_verbs.c+2−7
@@ -740,13 +740,8 @@ static int init_send_wqe(struct rxe_qp *qp, struct ib_send_wr *ibwr, · 739 unmodified lines
740 740
741 sge = ibwr->sg_list;741 sge = ibwr->sg_list;
742 for (i = 0; i < num_sge; i++, sge++) {742 for (i = 0; i < num_sge; i++, sge++) {
743 if (qp->is_user && copy_from_user(p, (__user void *)743 memcpy(p, (void *)(uintptr_t)sge->addr,
744 (uintptr_t)sge->addr, sge->length))744 sge->length);
745 return -EFAULT;
746
747 else if (!qp->is_user)
748 memcpy(p, (void *)(uintptr_t)sge->addr,
749 sge->length);
750 745
751 p += sge->length;746 p += sge->length;
752 }747 }
drivers/infiniband/ulp/ipoib/ipoib_ethtool.c+1−1
@@ -178,7 +178,7 @@ static inline int ib_speed_enum_to_int(int speed) · 177 unmodified lines
178static int ipoib_get_link_ksettings(struct net_device *netdev,178static int ipoib_get_link_ksettings(struct net_device *netdev,
179 struct ethtool_link_ksettings *cmd)179 struct ethtool_link_ksettings *cmd)
180{180{
181 struct ipoib_dev_priv *priv = netdev_priv(netdev);181 struct ipoib_dev_priv *priv = ipoib_priv(netdev);
182 struct ib_port_attr attr;182 struct ib_port_attr attr;
183 int ret, speed, width;183 int ret, speed, width;
184 184
drivers/infiniband/ulp/ipoib/ipoib_ib.c+0−1
@@ -863,7 +863,6 @@ dev_stop: · 862 unmodified lines
863 set_bit(IPOIB_STOP_REAPER, &priv->flags);863 set_bit(IPOIB_STOP_REAPER, &priv->flags);
864 cancel_delayed_work(&priv->ah_reap_task);864 cancel_delayed_work(&priv->ah_reap_task);
865 set_bit(IPOIB_FLAG_INITIALIZED, &priv->flags);865 set_bit(IPOIB_FLAG_INITIALIZED, &priv->flags);
866 napi_enable(&priv->napi);
867 ipoib_ib_dev_stop(dev);866 ipoib_ib_dev_stop(dev);
868 return -1;867 return -1;
869}868}
drivers/infiniband/ulp/ipoib/ipoib_main.c+14−3
@@ -1590,12 +1590,14 @@ static void ipoib_neigh_hash_uninit(struct net_device *dev) · 1589 unmodified lines
1590 wait_for_completion(&priv->ntbl.deleted);1590 wait_for_completion(&priv->ntbl.deleted);
1591}1591}
1592 1592
1593void ipoib_dev_uninit_default(struct net_device *dev)1593static void ipoib_dev_uninit_default(struct net_device *dev)
1594{1594{
1595 struct ipoib_dev_priv *priv = ipoib_priv(dev);1595 struct ipoib_dev_priv *priv = ipoib_priv(dev);
1596 1596
1597 ipoib_transport_dev_cleanup(dev);1597 ipoib_transport_dev_cleanup(dev);
1598 1598
1599 netif_napi_del(&priv->napi);
1600
1599 ipoib_cm_dev_cleanup(dev);1601 ipoib_cm_dev_cleanup(dev);
1600 1602
1601 kfree(priv->rx_ring);1603 kfree(priv->rx_ring);
@@ -1649,6 +1651,7 @@ out_rx_ring_cleanup: · 47 unmodified lines
1649 kfree(priv->rx_ring);1651 kfree(priv->rx_ring);
1650 1652
1651out:1653out:
1654 netif_napi_del(&priv->napi);
1652 return -ENOMEM;1655 return -ENOMEM;
1653}1656}
1654 1657
@@ -2237,6 +2240,7 @@ event_failed: · 582 unmodified lines
2237 2240
2238device_init_failed:2241device_init_failed:
2239 free_netdev(priv->dev);2242 free_netdev(priv->dev);
2243 kfree(priv);
2240 2244
2241alloc_mem_failed:2245alloc_mem_failed:
2242 return ERR_PTR(result);2246 return ERR_PTR(result);
@@ -2277,7 +2281,7 @@ static void ipoib_add_one(struct ib_device *device) · 34 unmodified lines
2277 2281
2278static void ipoib_remove_one(struct ib_device *device, void *client_data)2282static void ipoib_remove_one(struct ib_device *device, void *client_data)
2279{2283{
2280 struct ipoib_dev_priv *priv, *tmp;2284 struct ipoib_dev_priv *priv, *tmp, *cpriv, *tcpriv;
2281 struct list_head *dev_list = client_data;2285 struct list_head *dev_list = client_data;
2282 2286
2283 if (!dev_list)2287 if (!dev_list)
@@ -2300,7 +2304,14 @@ static void ipoib_remove_one(struct ib_device *device, void *client_data) · 16 unmodified lines
2300 flush_workqueue(priv->wq);2304 flush_workqueue(priv->wq);
2301 2305
2302 unregister_netdev(priv->dev);2306 unregister_netdev(priv->dev);
2303 free_netdev(priv->dev);2307 if (device->free_rdma_netdev)
2308 device->free_rdma_netdev(priv->dev);
2309 else
2310 free_netdev(priv->dev);
2311
2312 list_for_each_entry_safe(cpriv, tcpriv, &priv->child_intfs, list)
2313 kfree(cpriv);
2314
2304 kfree(priv);2315 kfree(priv);
2305 }2316 }
2306 2317
drivers/infiniband/ulp/ipoib/ipoib_vlan.c+7−4
@@ -133,13 +133,13 @@ int ipoib_vlan_add(struct net_device *pdev, unsigned short pkey) · 132 unmodified lines
133 snprintf(intf_name, sizeof intf_name, "%s.%04x",133 snprintf(intf_name, sizeof intf_name, "%s.%04x",
134 ppriv->dev->name, pkey);134 ppriv->dev->name, pkey);
135 135
136 if (!rtnl_trylock())
137 return restart_syscall();
138
136 priv = ipoib_intf_alloc(ppriv->ca, ppriv->port, intf_name);139 priv = ipoib_intf_alloc(ppriv->ca, ppriv->port, intf_name);
137 if (!priv)140 if (!priv)
138 return -ENOMEM;141 return -ENOMEM;
139 142
140 if (!rtnl_trylock())
141 return restart_syscall();
142
143 down_write(&ppriv->vlan_rwsem);143 down_write(&ppriv->vlan_rwsem);
144 144
145 /*145 /*
@@ -167,8 +167,10 @@ out: · 21 unmodified lines
167 167
168 rtnl_unlock();168 rtnl_unlock();
169 169
170 if (result)170 if (result) {
171 free_netdev(priv->dev);171 free_netdev(priv->dev);
172 kfree(priv);
173 }
172 174
173 return result;175 return result;
174}176}
@@ -209,6 +211,7 @@ int ipoib_vlan_delete(struct net_device *pdev, unsigned short pkey) · 34 unmodified lines
209 211
210 if (dev) {212 if (dev) {
211 free_netdev(dev);213 free_netdev(dev);
214 kfree(priv);
212 return 0;215 return 0;
213 }216 }
214 217
drivers/infiniband/ulp/srp/ib_srp.c+2−2
@@ -320,7 +320,7 @@ static int srp_new_cm_id(struct srp_rdma_ch *ch) · 319 unmodified lines
320 ch->path.sgid = target->sgid;320 ch->path.sgid = target->sgid;
321 ch->path.dgid = target->orig_dgid;321 ch->path.dgid = target->orig_dgid;
322 ch->path.pkey = target->pkey;322 ch->path.pkey = target->pkey;
323 sa_path_set_service_id(&ch->path, target->service_id);323 ch->path.service_id = target->service_id;
324 324
325 return 0;325 return 0;
326}326}
@@ -575,7 +575,7 @@ static int srp_create_ch_ib(struct srp_rdma_ch *ch) · 248 unmodified lines
575 return 0;575 return 0;
576 576
577err_qp:577err_qp:
578 srp_destroy_qp(ch, qp);578 ib_destroy_qp(qp);
579 579
580err_send_cq:580err_send_cq:
581 ib_free_cq(send_cq);581 ib_free_cq(send_cq);
drivers/input/keyboard/tm2-touchkey.c+1−1
@@ -213,7 +213,7 @@ static int tm2_touchkey_probe(struct i2c_client *client, · 212 unmodified lines
213 /* led device */213 /* led device */
214 touchkey->led_dev.name = TM2_TOUCHKEY_DEV_NAME;214 touchkey->led_dev.name = TM2_TOUCHKEY_DEV_NAME;
215 touchkey->led_dev.brightness = LED_FULL;215 touchkey->led_dev.brightness = LED_FULL;
216 touchkey->led_dev.max_brightness = LED_FULL;216 touchkey->led_dev.max_brightness = LED_ON;
217 touchkey->led_dev.brightness_set = tm2_touchkey_led_brightness_set;217 touchkey->led_dev.brightness_set = tm2_touchkey_led_brightness_set;
218 218
219 error = devm_led_classdev_register(&client->dev, &touchkey->led_dev);219 error = devm_led_classdev_register(&client->dev, &touchkey->led_dev);
drivers/input/misc/axp20x-pek.c+37−7
@@ -256,6 +256,42 @@ static int axp20x_pek_probe_input_device(struct axp20x_pek *axp20x_pek, · 255 unmodified lines
256 return 0;256 return 0;
257}257}
258 258
259#ifdef CONFIG_ACPI
260static bool axp20x_pek_should_register_input(struct axp20x_pek *axp20x_pek,
261 struct platform_device *pdev)
262{
263 unsigned long long hrv = 0;
264 acpi_status status;
265
266 if (IS_ENABLED(CONFIG_INPUT_SOC_BUTTON_ARRAY) &&
267 axp20x_pek->axp20x->variant == AXP288_ID) {
268 status = acpi_evaluate_integer(ACPI_HANDLE(pdev->dev.parent),
269 "_HRV", NULL, &hrv);
270 if (ACPI_FAILURE(status))
271 dev_err(&pdev->dev, "Failed to get PMIC hardware revision\n");
272
273 /*
274 * On Cherry Trail platforms (hrv == 3), do not register the
275 * input device if there is an "INTCFD9" or "ACPI0011" gpio
276 * button ACPI device, as that handles the power button too,
277 * and otherwise we end up reporting all presses twice.
278 */
279 if (hrv == 3 && (acpi_dev_present("INTCFD9", NULL, -1) ||
280 acpi_dev_present("ACPI0011", NULL, -1)))
281 return false;
282
283 }
284
285 return true;
286}
287#else
288static bool axp20x_pek_should_register_input(struct axp20x_pek *axp20x_pek,
289 struct platform_device *pdev)
290{
291 return true;
292}
293#endif
294
259static int axp20x_pek_probe(struct platform_device *pdev)295static int axp20x_pek_probe(struct platform_device *pdev)
260{296{
261 struct axp20x_pek *axp20x_pek;297 struct axp20x_pek *axp20x_pek;
@@ -268,13 +304,7 @@ static int axp20x_pek_probe(struct platform_device *pdev) · 6 unmodified lines
268 304
269 axp20x_pek->axp20x = dev_get_drvdata(pdev->dev.parent);305 axp20x_pek->axp20x = dev_get_drvdata(pdev->dev.parent);
270 306
271 /*307 if (axp20x_pek_should_register_input(axp20x_pek, pdev)) {
272 * Do not register the input device if there is an "INTCFD9"
273 * gpio button ACPI device, that handles the power button too,
274 * and otherwise we end up reporting all presses twice.
275 */
276 if (!acpi_dev_found("INTCFD9") ||
277 !IS_ENABLED(CONFIG_INPUT_SOC_BUTTON_ARRAY)) {
278 error = axp20x_pek_probe_input_device(axp20x_pek, pdev);308 error = axp20x_pek_probe_input_device(axp20x_pek, pdev);
279 if (error)309 if (error)
280 return error;310 return error;
drivers/input/mouse/elantech.c+16−0
@@ -1118,8 +1118,10 @@ static int elantech_get_resolution_v4(struct psmouse *psmouse, · 1117 unmodified lines
1118 * Asus UX32VD 0x361f02 00, 15, 0e clickpad1118 * Asus UX32VD 0x361f02 00, 15, 0e clickpad
1119 * Avatar AVIU-145A2 0x361f00 ? clickpad1119 * Avatar AVIU-145A2 0x361f00 ? clickpad
1120 * Fujitsu LIFEBOOK E544 0x470f00 d0, 12, 09 2 hw buttons1120 * Fujitsu LIFEBOOK E544 0x470f00 d0, 12, 09 2 hw buttons
1121 * Fujitsu LIFEBOOK E546 0x470f00 50, 12, 09 2 hw buttons
1121 * Fujitsu LIFEBOOK E547 0x470f00 50, 12, 09 2 hw buttons1122 * Fujitsu LIFEBOOK E547 0x470f00 50, 12, 09 2 hw buttons
1122 * Fujitsu LIFEBOOK E554 0x570f01 40, 14, 0c 2 hw buttons1123 * Fujitsu LIFEBOOK E554 0x570f01 40, 14, 0c 2 hw buttons
1124 * Fujitsu LIFEBOOK E557 0x570f01 40, 14, 0c 2 hw buttons
1123 * Fujitsu T725 0x470f01 05, 12, 09 2 hw buttons1125 * Fujitsu T725 0x470f01 05, 12, 09 2 hw buttons
1124 * Fujitsu H730 0x570f00 c0, 14, 0c 3 hw buttons (**)1126 * Fujitsu H730 0x570f00 c0, 14, 0c 3 hw buttons (**)
1125 * Gigabyte U2442 0x450f01 58, 17, 0c 2 hw buttons1127 * Gigabyte U2442 0x450f01 58, 17, 0c 2 hw buttons
@@ -1524,6 +1526,13 @@ static const struct dmi_system_id elantech_dmi_force_crc_enabled[] = { · 398 unmodified lines
1524 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK E544"),1526 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK E544"),
1525 },1527 },
1526 },1528 },
1529 {
1530 /* Fujitsu LIFEBOOK E546 does not work with crc_enabled == 0 */
1531 .matches = {
1532 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
1533 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK E546"),
1534 },
1535 },
1527 {1536 {
1528 /* Fujitsu LIFEBOOK E547 does not work with crc_enabled == 0 */1537 /* Fujitsu LIFEBOOK E547 does not work with crc_enabled == 0 */
1529 .matches = {1538 .matches = {
@@ -1545,6 +1554,13 @@ static const struct dmi_system_id elantech_dmi_force_crc_enabled[] = { · 15 unmodified lines
1545 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK E556"),1554 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK E556"),
1546 },1555 },
1547 },1556 },
1557 {
1558 /* Fujitsu LIFEBOOK E557 does not work with crc_enabled == 0 */
1559 .matches = {
1560 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
1561 DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK E557"),
1562 },
1563 },
1548 {1564 {
1549 /* Fujitsu LIFEBOOK U745 does not work with crc_enabled == 0 */1565 /* Fujitsu LIFEBOOK U745 does not work with crc_enabled == 0 */
1550 .matches = {1566 .matches = {
drivers/input/mouse/synaptics.c+28−9
@@ -176,6 +176,12 @@ static const char * const smbus_pnp_ids[] = { · 175 unmodified lines
176 NULL176 NULL
177};177};
178 178
179static const char * const forcepad_pnp_ids[] = {
180 "SYN300D",
181 "SYN3014",
182 NULL
183};
184
179/*185/*
180 * Send a command to the synpatics touchpad by special commands186 * Send a command to the synpatics touchpad by special commands
181 */187 */
@@ -397,6 +403,8 @@ static int synaptics_query_hardware(struct psmouse *psmouse, · 215 unmodified lines
397{403{
398 int error;404 int error;
399 405
406 memset(info, 0, sizeof(*info));
407
400 error = synaptics_identify(psmouse, info);408 error = synaptics_identify(psmouse, info);
401 if (error)409 if (error)
402 return error;410 return error;
@@ -480,13 +488,6 @@ static const struct min_max_quirk min_max_pnpid_table[] = { · 77 unmodified lines
480 { }488 { }
481};489};
482 490
483/* This list has been kindly provided by Synaptics. */
484static const char * const forcepad_pnp_ids[] = {
485 "SYN300D",
486 "SYN3014",
487 NULL
488};
489
490/*****************************************************************************491/*****************************************************************************
491 * Synaptics communications functions492 * Synaptics communications functions
492 ****************************************************************************/493 ****************************************************************************/
@@ -1687,7 +1688,8 @@ enum { · 1194 unmodified lines
1687 SYNAPTICS_INTERTOUCH_ON,1688 SYNAPTICS_INTERTOUCH_ON,
1688};1689};
1689 1690
1690static int synaptics_intertouch = SYNAPTICS_INTERTOUCH_NOT_SET;1691static int synaptics_intertouch = IS_ENABLED(CONFIG_RMI4_SMB) ?
1692 SYNAPTICS_INTERTOUCH_NOT_SET : SYNAPTICS_INTERTOUCH_OFF;
1691module_param_named(synaptics_intertouch, synaptics_intertouch, int, 0644);1693module_param_named(synaptics_intertouch, synaptics_intertouch, int, 0644);
1692MODULE_PARM_DESC(synaptics_intertouch, "Use a secondary bus for the Synaptics device.");1694MODULE_PARM_DESC(synaptics_intertouch, "Use a secondary bus for the Synaptics device.");
1693 1695
@@ -1737,8 +1739,16 @@ static int synaptics_setup_intertouch(struct psmouse *psmouse, · 43 unmodified lines
1737 1739
1738 if (synaptics_intertouch == SYNAPTICS_INTERTOUCH_NOT_SET) {1740 if (synaptics_intertouch == SYNAPTICS_INTERTOUCH_NOT_SET) {
1739 if (!psmouse_matches_pnp_id(psmouse, topbuttonpad_pnp_ids) &&1741 if (!psmouse_matches_pnp_id(psmouse, topbuttonpad_pnp_ids) &&
1740 !psmouse_matches_pnp_id(psmouse, smbus_pnp_ids))1742 !psmouse_matches_pnp_id(psmouse, smbus_pnp_ids)) {
1743
1744 if (!psmouse_matches_pnp_id(psmouse, forcepad_pnp_ids))
1745 psmouse_info(psmouse,
1746 "Your touchpad (%s) says it can support a different bus. "
1747 "If i2c-hid and hid-rmi are not used, you might want to try setting psmouse.synaptics_intertouch to 1 and report this to linux-input@vger.kernel.org.\n",
1748 psmouse->ps2dev.serio->firmware_id);
1749
1741 return -ENXIO;1750 return -ENXIO;
1751 }
1742 }1752 }
1743 1753
1744 psmouse_info(psmouse, "Trying to set up SMBus access\n");1754 psmouse_info(psmouse, "Trying to set up SMBus access\n");
@@ -1810,6 +1820,15 @@ int synaptics_init(struct psmouse *psmouse) · 65 unmodified lines
1810 }1820 }
1811 1821
1812 if (SYN_CAP_INTERTOUCH(info.ext_cap_0c)) {1822 if (SYN_CAP_INTERTOUCH(info.ext_cap_0c)) {
1823 if ((!IS_ENABLED(CONFIG_RMI4_SMB) ||
1824 !IS_ENABLED(CONFIG_MOUSE_PS2_SYNAPTICS_SMBUS)) &&
1825 /* Forcepads need F21, which is not ready */
1826 !psmouse_matches_pnp_id(psmouse, forcepad_pnp_ids)) {
1827 psmouse_warn(psmouse,
1828 "The touchpad can support a better bus than the too old PS/2 protocol. "
1829 "Make sure MOUSE_PS2_SYNAPTICS_SMBUS and RMI4_SMB are enabled to get a better touchpad experience.\n");
1830 }
1831
1813 error = synaptics_setup_intertouch(psmouse, &info, true);1832 error = synaptics_setup_intertouch(psmouse, &info, true);
1814 if (!error)1833 if (!error)
1815 return PSMOUSE_SYNAPTICS_SMBUS;1834 return PSMOUSE_SYNAPTICS_SMBUS;
drivers/input/rmi4/rmi_f03.c+1−1
@@ -146,7 +146,7 @@ static int rmi_f03_register_pt(struct f03_data *f03) · 145 unmodified lines
146 if (!serio)146 if (!serio)
147 return -ENOMEM;147 return -ENOMEM;
148 148
149 serio->id.type = SERIO_8042;149 serio->id.type = SERIO_PS_PSTHRU;
150 serio->write = rmi_f03_pt_write;150 serio->write = rmi_f03_pt_write;
151 serio->port_data = f03;151 serio->port_data = f03;
152 152
drivers/input/touchscreen/silead.c+3−0
@@ -526,6 +526,7 @@ static int __maybe_unused silead_ts_suspend(struct device *dev) · 525 unmodified lines
526{526{
527 struct i2c_client *client = to_i2c_client(dev);527 struct i2c_client *client = to_i2c_client(dev);
528 528
529 disable_irq(client->irq);
529 silead_ts_set_power(client, SILEAD_POWER_OFF);530 silead_ts_set_power(client, SILEAD_POWER_OFF);
530 return 0;531 return 0;
531}532}
@@ -551,6 +552,8 @@ static int __maybe_unused silead_ts_resume(struct device *dev) · 19 unmodified lines
551 return -ENODEV;552 return -ENODEV;
552 }553 }
553 554
555 enable_irq(client->irq);
556
554 return 0;557 return 0;
555}558}
556 559
drivers/iommu/of_iommu.c+7−0
@@ -118,6 +118,7 @@ static const struct iommu_ops · 117 unmodified lines
118 118
119 ops = iommu_ops_from_fwnode(fwnode);119 ops = iommu_ops_from_fwnode(fwnode);
120 if ((ops && !ops->of_xlate) ||120 if ((ops && !ops->of_xlate) ||
121 !of_device_is_available(iommu_spec->np) ||
121 (!ops && !of_iommu_driver_present(iommu_spec->np)))122 (!ops && !of_iommu_driver_present(iommu_spec->np)))
122 return NULL;123 return NULL;
123 124
@@ -236,6 +237,12 @@ const struct iommu_ops *of_iommu_configure(struct device *dev, · 112 unmodified lines
236 ops = ERR_PTR(err);237 ops = ERR_PTR(err);
237 }238 }
238 239
240 /* Ignore all other errors apart from EPROBE_DEFER */
241 if (IS_ERR(ops) && (PTR_ERR(ops) != -EPROBE_DEFER)) {
242 dev_dbg(dev, "Adding to IOMMU failed: %ld\n", PTR_ERR(ops));
243 ops = NULL;
244 }
245
239 return ops;246 return ops;
240}247}
241 248
drivers/irqchip/irq-xtensa-mx.c+1−1
@@ -142,7 +142,7 @@ static struct irq_chip xtensa_mx_irq_chip = { · 141 unmodified lines
142int __init xtensa_mx_init_legacy(struct device_node *interrupt_parent)142int __init xtensa_mx_init_legacy(struct device_node *interrupt_parent)
143{143{
144 struct irq_domain *root_domain =144 struct irq_domain *root_domain =
145 irq_domain_add_legacy(NULL, NR_IRQS, 0, 0,145 irq_domain_add_legacy(NULL, NR_IRQS - 1, 1, 0,
146 &xtensa_mx_irq_domain_ops,146 &xtensa_mx_irq_domain_ops,
147 &xtensa_mx_irq_chip);147 &xtensa_mx_irq_chip);
148 irq_set_default_host(root_domain);148 irq_set_default_host(root_domain);
drivers/irqchip/irq-xtensa-pic.c+1−1
@@ -89,7 +89,7 @@ static struct irq_chip xtensa_irq_chip = { · 88 unmodified lines
89int __init xtensa_pic_init_legacy(struct device_node *interrupt_parent)89int __init xtensa_pic_init_legacy(struct device_node *interrupt_parent)
90{90{
91 struct irq_domain *root_domain =91 struct irq_domain *root_domain =
92 irq_domain_add_legacy(NULL, NR_IRQS, 0, 0,92 irq_domain_add_legacy(NULL, NR_IRQS - 1, 1, 0,
93 &xtensa_irq_domain_ops, &xtensa_irq_chip);93 &xtensa_irq_domain_ops, &xtensa_irq_chip);
94 irq_set_default_host(root_domain);94 irq_set_default_host(root_domain);
95 return 0;95 return 0;
drivers/isdn/i4l/isdn_ppp.c+1−1
@@ -2364,7 +2364,7 @@ static struct ippp_ccp_reset_state *isdn_ppp_ccp_reset_alloc_state(struct ippp_s · 2363 unmodified lines
2364 id);2364 id);
2365 return NULL;2365 return NULL;
2366 } else {2366 } else {
2367 rs = kzalloc(sizeof(struct ippp_ccp_reset_state), GFP_KERNEL);2367 rs = kzalloc(sizeof(struct ippp_ccp_reset_state), GFP_ATOMIC);
2368 if (!rs)2368 if (!rs)
2369 return NULL;2369 return NULL;
2370 rs->state = CCPResetIdle;2370 rs->state = CCPResetIdle;
drivers/isdn/mISDN/stack.c+1−1
@@ -75,7 +75,7 @@ send_socklist(struct mISDN_sock_list *sl, struct sk_buff *skb) · 74 unmodified lines
75 if (sk->sk_state != MISDN_BOUND)75 if (sk->sk_state != MISDN_BOUND)
76 continue;76 continue;
77 if (!cskb)77 if (!cskb)
78 cskb = skb_copy(skb, GFP_KERNEL);78 cskb = skb_copy(skb, GFP_ATOMIC);
79 if (!cskb) {79 if (!cskb) {
80 printk(KERN_WARNING "%s no skb\n", __func__);80 printk(KERN_WARNING "%s no skb\n", __func__);
81 break;81 break;
drivers/leds/leds-bcm6328.c+2−2
@@ -242,7 +242,7 @@ static int bcm6328_hwled(struct device *dev, struct device_node *nc, u32 reg, · 241 unmodified lines
242 242
243 spin_lock_irqsave(lock, flags);243 spin_lock_irqsave(lock, flags);
244 val = bcm6328_led_read(addr);244 val = bcm6328_led_read(addr);
245 val |= (BIT(reg) << (((sel % 4) * 4) + 16));245 val |= (BIT(reg % 4) << (((sel % 4) * 4) + 16));
246 bcm6328_led_write(addr, val);246 bcm6328_led_write(addr, val);
247 spin_unlock_irqrestore(lock, flags);247 spin_unlock_irqrestore(lock, flags);
248 }248 }
@@ -269,7 +269,7 @@ static int bcm6328_hwled(struct device *dev, struct device_node *nc, u32 reg, · 20 unmodified lines
269 269
270 spin_lock_irqsave(lock, flags);270 spin_lock_irqsave(lock, flags);
271 val = bcm6328_led_read(addr);271 val = bcm6328_led_read(addr);
272 val |= (BIT(reg) << ((sel % 4) * 4));272 val |= (BIT(reg % 4) << ((sel % 4) * 4));
273 bcm6328_led_write(addr, val);273 bcm6328_led_write(addr, val);
274 spin_unlock_irqrestore(lock, flags);274 spin_unlock_irqrestore(lock, flags);
275 }275 }
drivers/leds/trigger/ledtrig-heartbeat.c+0−31
@@ -20,7 +20,6 @@ · 19 unmodified lines
20#include <linux/sched/loadavg.h>20#include <linux/sched/loadavg.h>
21#include <linux/leds.h>21#include <linux/leds.h>
22#include <linux/reboot.h>22#include <linux/reboot.h>
23#include <linux/suspend.h>
24#include "../leds.h"23#include "../leds.h"
25 24
26static int panic_heartbeats;25static int panic_heartbeats;
@@ -163,30 +162,6 @@ static struct led_trigger heartbeat_led_trigger = { · 136 unmodified lines
163 .deactivate = heartbeat_trig_deactivate,162 .deactivate = heartbeat_trig_deactivate,
164};163};
165 164
166static int heartbeat_pm_notifier(struct notifier_block *nb,
167 unsigned long pm_event, void *unused)
168{
169 int rc;
170
171 switch (pm_event) {
172 case PM_SUSPEND_PREPARE:
173 case PM_HIBERNATION_PREPARE:
174 case PM_RESTORE_PREPARE:
175 led_trigger_unregister(&heartbeat_led_trigger);
176 break;
177 case PM_POST_SUSPEND:
178 case PM_POST_HIBERNATION:
179 case PM_POST_RESTORE:
180 rc = led_trigger_register(&heartbeat_led_trigger);
181 if (rc)
182 pr_err("could not re-register heartbeat trigger\n");
183 break;
184 default:
185 break;
186 }
187 return NOTIFY_DONE;
188}
189
190static int heartbeat_reboot_notifier(struct notifier_block *nb,165static int heartbeat_reboot_notifier(struct notifier_block *nb,
191 unsigned long code, void *unused)166 unsigned long code, void *unused)
192{167{
@@ -201,10 +176,6 @@ static int heartbeat_panic_notifier(struct notifier_block *nb, · 8 unmodified lines
201 return NOTIFY_DONE;176 return NOTIFY_DONE;
202}177}
203 178
204static struct notifier_block heartbeat_pm_nb = {
205 .notifier_call = heartbeat_pm_notifier,
206};
207
208static struct notifier_block heartbeat_reboot_nb = {179static struct notifier_block heartbeat_reboot_nb = {
209 .notifier_call = heartbeat_reboot_notifier,180 .notifier_call = heartbeat_reboot_notifier,
210};181};
@@ -221,14 +192,12 @@ static int __init heartbeat_trig_init(void) · 10 unmodified lines
221 atomic_notifier_chain_register(&panic_notifier_list,192 atomic_notifier_chain_register(&panic_notifier_list,
222 &heartbeat_panic_nb);193 &heartbeat_panic_nb);
223 register_reboot_notifier(&heartbeat_reboot_nb);194 register_reboot_notifier(&heartbeat_reboot_nb);
224 register_pm_notifier(&heartbeat_pm_nb);
225 }195 }
226 return rc;196 return rc;
227}197}
228 198
229static void __exit heartbeat_trig_exit(void)199static void __exit heartbeat_trig_exit(void)
230{200{
231 unregister_pm_notifier(&heartbeat_pm_nb);
232 unregister_reboot_notifier(&heartbeat_reboot_nb);201 unregister_reboot_notifier(&heartbeat_reboot_nb);
233 atomic_notifier_chain_unregister(&panic_notifier_list,202 atomic_notifier_chain_unregister(&panic_notifier_list,
234 &heartbeat_panic_nb);203 &heartbeat_panic_nb);
drivers/md/bitmap.c+4−4
@@ -485,10 +485,10 @@ void bitmap_print_sb(struct bitmap *bitmap) · 484 unmodified lines
485 pr_debug(" magic: %08x\n", le32_to_cpu(sb->magic));485 pr_debug(" magic: %08x\n", le32_to_cpu(sb->magic));
486 pr_debug(" version: %d\n", le32_to_cpu(sb->version));486 pr_debug(" version: %d\n", le32_to_cpu(sb->version));
487 pr_debug(" uuid: %08x.%08x.%08x.%08x\n",487 pr_debug(" uuid: %08x.%08x.%08x.%08x\n",
488 *(__u32 *)(sb->uuid+0),488 le32_to_cpu(*(__u32 *)(sb->uuid+0)),
489 *(__u32 *)(sb->uuid+4),489 le32_to_cpu(*(__u32 *)(sb->uuid+4)),
490 *(__u32 *)(sb->uuid+8),490 le32_to_cpu(*(__u32 *)(sb->uuid+8)),
491 *(__u32 *)(sb->uuid+12));491 le32_to_cpu(*(__u32 *)(sb->uuid+12)));
492 pr_debug(" events: %llu\n",492 pr_debug(" events: %llu\n",
493 (unsigned long long) le64_to_cpu(sb->events));493 (unsigned long long) le64_to_cpu(sb->events));
494 pr_debug("events cleared: %llu\n",494 pr_debug("events cleared: %llu\n",
drivers/md/dm-bufio.c+1−1
@@ -1334,7 +1334,7 @@ int dm_bufio_issue_flush(struct dm_bufio_client *c) · 1333 unmodified lines
1334{1334{
1335 struct dm_io_request io_req = {1335 struct dm_io_request io_req = {
1336 .bi_op = REQ_OP_WRITE,1336 .bi_op = REQ_OP_WRITE,
1337 .bi_op_flags = REQ_PREFLUSH,1337 .bi_op_flags = REQ_PREFLUSH | REQ_SYNC,
1338 .mem.type = DM_IO_KMEM,1338 .mem.type = DM_IO_KMEM,
1339 .mem.ptr.addr = NULL,1339 .mem.ptr.addr = NULL,
1340 .client = c->dm_io,1340 .client = c->dm_io,
drivers/md/dm-integrity.c+8−22
@@ -783,7 +783,8 @@ static void write_journal(struct dm_integrity_c *ic, unsigned commit_start, unsi · 782 unmodified lines
783 for (i = 0; i < commit_sections; i++)783 for (i = 0; i < commit_sections; i++)
784 rw_section_mac(ic, commit_start + i, true);784 rw_section_mac(ic, commit_start + i, true);
785 }785 }
786 rw_journal(ic, REQ_OP_WRITE, REQ_FUA, commit_start, commit_sections, &io_comp);786 rw_journal(ic, REQ_OP_WRITE, REQ_FUA | REQ_SYNC, commit_start,
787 commit_sections, &io_comp);
787 } else {788 } else {
788 unsigned to_end;789 unsigned to_end;
789 io_comp.in_flight = (atomic_t)ATOMIC_INIT(2);790 io_comp.in_flight = (atomic_t)ATOMIC_INIT(2);
@@ -2374,21 +2375,6 @@ static void dm_integrity_set(struct dm_target *ti, struct dm_integrity_c *ic) · 1584 unmodified lines
2374 blk_queue_max_integrity_segments(disk->queue, UINT_MAX);2375 blk_queue_max_integrity_segments(disk->queue, UINT_MAX);
2375}2376}
2376 2377
2377/* FIXME: use new kvmalloc */
2378static void *dm_integrity_kvmalloc(size_t size, gfp_t gfp)
2379{
2380 void *ptr = NULL;
2381
2382 if (size <= PAGE_SIZE)
2383 ptr = kmalloc(size, GFP_KERNEL | gfp);
2384 if (!ptr && size <= KMALLOC_MAX_SIZE)
2385 ptr = kmalloc(size, GFP_KERNEL | __GFP_NOWARN | __GFP_NORETRY | gfp);
2386 if (!ptr)
2387 ptr = __vmalloc(size, GFP_KERNEL | gfp, PAGE_KERNEL);
2388
2389 return ptr;
2390}
2391
2392static void dm_integrity_free_page_list(struct dm_integrity_c *ic, struct page_list *pl)2378static void dm_integrity_free_page_list(struct dm_integrity_c *ic, struct page_list *pl)
2393{2379{
2394 unsigned i;2380 unsigned i;
@@ -2407,7 +2393,7 @@ static struct page_list *dm_integrity_alloc_page_list(struct dm_integrity_c *ic) · 12 unmodified lines
2407 struct page_list *pl;2393 struct page_list *pl;
2408 unsigned i;2394 unsigned i;
2409 2395
2410 pl = dm_integrity_kvmalloc(page_list_desc_size, __GFP_ZERO);2396 pl = kvmalloc(page_list_desc_size, GFP_KERNEL | __GFP_ZERO);
2411 if (!pl)2397 if (!pl)
2412 return NULL;2398 return NULL;
2413 2399
@@ -2437,7 +2423,7 @@ static struct scatterlist **dm_integrity_alloc_journal_scatterlist(struct dm_int · 23 unmodified lines
2437 struct scatterlist **sl;2423 struct scatterlist **sl;
2438 unsigned i;2424 unsigned i;
2439 2425
2440 sl = dm_integrity_kvmalloc(ic->journal_sections * sizeof(struct scatterlist *), __GFP_ZERO);2426 sl = kvmalloc(ic->journal_sections * sizeof(struct scatterlist *), GFP_KERNEL | __GFP_ZERO);
2441 if (!sl)2427 if (!sl)
2442 return NULL;2428 return NULL;
2443 2429
@@ -2453,7 +2439,7 @@ static struct scatterlist **dm_integrity_alloc_journal_scatterlist(struct dm_int · 9 unmodified lines
2453 2439
2454 n_pages = (end_index - start_index + 1);2440 n_pages = (end_index - start_index + 1);
2455 2441
2456 s = dm_integrity_kvmalloc(n_pages * sizeof(struct scatterlist), 0);2442 s = kvmalloc(n_pages * sizeof(struct scatterlist), GFP_KERNEL);
2457 if (!s) {2443 if (!s) {
2458 dm_integrity_free_journal_scatterlist(ic, sl);2444 dm_integrity_free_journal_scatterlist(ic, sl);
2459 return NULL;2445 return NULL;
@@ -2617,7 +2603,7 @@ static int create_journal(struct dm_integrity_c *ic, char **error) · 157 unmodified lines
2617 goto bad;2603 goto bad;
2618 }2604 }
2619 2605
2620 sg = dm_integrity_kvmalloc((ic->journal_pages + 1) * sizeof(struct scatterlist), 0);2606 sg = kvmalloc((ic->journal_pages + 1) * sizeof(struct scatterlist), GFP_KERNEL);
2621 if (!sg) {2607 if (!sg) {
2622 *error = "Unable to allocate sg list";2608 *error = "Unable to allocate sg list";
2623 r = -ENOMEM;2609 r = -ENOMEM;
@@ -2673,7 +2659,7 @@ static int create_journal(struct dm_integrity_c *ic, char **error) · 49 unmodified lines
2673 r = -ENOMEM;2659 r = -ENOMEM;
2674 goto bad;2660 goto bad;
2675 }2661 }
2676 ic->sk_requests = dm_integrity_kvmalloc(ic->journal_sections * sizeof(struct skcipher_request *), __GFP_ZERO);2662 ic->sk_requests = kvmalloc(ic->journal_sections * sizeof(struct skcipher_request *), GFP_KERNEL | __GFP_ZERO);
2677 if (!ic->sk_requests) {2663 if (!ic->sk_requests) {
2678 *error = "Unable to allocate sk requests";2664 *error = "Unable to allocate sk requests";
2679 r = -ENOMEM;2665 r = -ENOMEM;
@@ -2740,7 +2726,7 @@ retest_commit_id: · 60 unmodified lines
2740 r = -ENOMEM;2726 r = -ENOMEM;
2741 goto bad;2727 goto bad;
2742 }2728 }
2743 ic->journal_tree = dm_integrity_kvmalloc(journal_tree_size, 0);2729 ic->journal_tree = kvmalloc(journal_tree_size, GFP_KERNEL);
2744 if (!ic->journal_tree) {2730 if (!ic->journal_tree) {
2745 *error = "Could not allocate memory for journal tree";2731 *error = "Could not allocate memory for journal tree";
2746 r = -ENOMEM;2732 r = -ENOMEM;
drivers/md/dm-ioctl.c+3−2
@@ -1710,12 +1710,13 @@ static int copy_params(struct dm_ioctl __user *user, struct dm_ioctl *param_kern · 1709 unmodified lines
1710 }1710 }
1711 1711
1712 /*1712 /*
1713 * Try to avoid low memory issues when a device is suspended.1713 * Use __GFP_HIGH to avoid low memory issues when a device is
1714 * suspended and the ioctl is needed to resume it.
1714 * Use kmalloc() rather than vmalloc() when we can.1715 * Use kmalloc() rather than vmalloc() when we can.
1715 */1716 */
1716 dmi = NULL;1717 dmi = NULL;
1717 noio_flag = memalloc_noio_save();1718 noio_flag = memalloc_noio_save();
1718 dmi = kvmalloc(param_kernel->data_size, GFP_KERNEL);1719 dmi = kvmalloc(param_kernel->data_size, GFP_KERNEL | __GFP_HIGH);
1719 memalloc_noio_restore(noio_flag);1720 memalloc_noio_restore(noio_flag);
1720 1721
1721 if (!dmi) {1722 if (!dmi) {
drivers/md/dm-raid1.c+1−1
@@ -260,7 +260,7 @@ static int mirror_flush(struct dm_target *ti) · 259 unmodified lines
260 struct mirror *m;260 struct mirror *m;
261 struct dm_io_request io_req = {261 struct dm_io_request io_req = {
262 .bi_op = REQ_OP_WRITE,262 .bi_op = REQ_OP_WRITE,
263 .bi_op_flags = REQ_PREFLUSH,263 .bi_op_flags = REQ_PREFLUSH | REQ_SYNC,
264 .mem.type = DM_IO_KMEM,264 .mem.type = DM_IO_KMEM,
265 .mem.ptr.addr = NULL,265 .mem.ptr.addr = NULL,
266 .client = ms->io_client,266 .client = ms->io_client,
drivers/md/dm-snap-persistent.c+2−1
@@ -741,7 +741,8 @@ static void persistent_commit_exception(struct dm_exception_store *store, · 740 unmodified lines
741 /*741 /*
742 * Commit exceptions to disk.742 * Commit exceptions to disk.
743 */743 */
744 if (ps->valid && area_io(ps, REQ_OP_WRITE, REQ_PREFLUSH | REQ_FUA))744 if (ps->valid && area_io(ps, REQ_OP_WRITE,
745 REQ_PREFLUSH | REQ_FUA | REQ_SYNC))
745 ps->valid = 0;746 ps->valid = 0;
746 747
747 /*748 /*
drivers/md/dm-verity-target.c+2−2
@@ -166,7 +166,7 @@ static int verity_hash_init(struct dm_verity *v, struct ahash_request *req, · 165 unmodified lines
166 return r;166 return r;
167 }167 }
168 168
169 if (likely(v->version >= 1))169 if (likely(v->salt_size && (v->version >= 1)))
170 r = verity_hash_update(v, req, v->salt, v->salt_size, res);170 r = verity_hash_update(v, req, v->salt, v->salt_size, res);
171 171
172 return r;172 return r;
@@ -177,7 +177,7 @@ static int verity_hash_final(struct dm_verity *v, struct ahash_request *req, · 4 unmodified lines
177{177{
178 int r;178 int r;
179 179
180 if (unlikely(!v->version)) {180 if (unlikely(v->salt_size && (!v->version))) {
181 r = verity_hash_update(v, req, v->salt, v->salt_size, res);181 r = verity_hash_update(v, req, v->salt, v->salt_size, res);
182 182
183 if (r < 0) {183 if (r < 0) {
drivers/md/dm.c+1−1
@@ -1657,7 +1657,7 @@ static struct mapped_device *alloc_dev(int minor) · 1656 unmodified lines
1657 1657
1658 bio_init(&md->flush_bio, NULL, 0);1658 bio_init(&md->flush_bio, NULL, 0);
1659 md->flush_bio.bi_bdev = md->bdev;1659 md->flush_bio.bi_bdev = md->bdev;
1660 md->flush_bio.bi_opf = REQ_OP_WRITE | REQ_PREFLUSH;1660 md->flush_bio.bi_opf = REQ_OP_WRITE | REQ_PREFLUSH | REQ_SYNC;
1661 1661
1662 dm_stats_init(&md->stats);1662 dm_stats_init(&md->stats);
1663 1663
drivers/md/md-cluster.c+3−1
@@ -1311,8 +1311,10 @@ static int add_new_disk(struct mddev *mddev, struct md_rdev *rdev) · 1310 unmodified lines
1311 cmsg.raid_slot = cpu_to_le32(rdev->desc_nr);1311 cmsg.raid_slot = cpu_to_le32(rdev->desc_nr);
1312 lock_comm(cinfo, 1);1312 lock_comm(cinfo, 1);
1313 ret = __sendmsg(cinfo, &cmsg);1313 ret = __sendmsg(cinfo, &cmsg);
1314 if (ret)1314 if (ret) {
1315 unlock_comm(cinfo);
1315 return ret;1316 return ret;
1317 }
1316 cinfo->no_new_dev_lockres->flags |= DLM_LKF_NOQUEUE;1318 cinfo->no_new_dev_lockres->flags |= DLM_LKF_NOQUEUE;
1317 ret = dlm_lock_sync(cinfo->no_new_dev_lockres, DLM_LOCK_EX);1319 ret = dlm_lock_sync(cinfo->no_new_dev_lockres, DLM_LOCK_EX);
1318 cinfo->no_new_dev_lockres->flags &= ~DLM_LKF_NOQUEUE;1320 cinfo->no_new_dev_lockres->flags &= ~DLM_LKF_NOQUEUE;
drivers/md/md.c+13−5
@@ -765,7 +765,7 @@ void md_super_write(struct mddev *mddev, struct md_rdev *rdev, · 764 unmodified lines
765 test_bit(FailFast, &rdev->flags) &&765 test_bit(FailFast, &rdev->flags) &&
766 !test_bit(LastDev, &rdev->flags))766 !test_bit(LastDev, &rdev->flags))
767 ff = MD_FAILFAST;767 ff = MD_FAILFAST;
768 bio->bi_opf = REQ_OP_WRITE | REQ_PREFLUSH | REQ_FUA | ff;768 bio->bi_opf = REQ_OP_WRITE | REQ_SYNC | REQ_PREFLUSH | REQ_FUA | ff;
769 769
770 atomic_inc(&mddev->pending_writes);770 atomic_inc(&mddev->pending_writes);
771 submit_bio(bio);771 submit_bio(bio);
@@ -5174,6 +5174,18 @@ static void mddev_delayed_delete(struct work_struct *ws) · 4402 unmodified lines
5174 5174
5175static void no_op(struct percpu_ref *r) {}5175static void no_op(struct percpu_ref *r) {}
5176 5176
5177int mddev_init_writes_pending(struct mddev *mddev)
5178{
5179 if (mddev->writes_pending.percpu_count_ptr)
5180 return 0;
5181 if (percpu_ref_init(&mddev->writes_pending, no_op, 0, GFP_KERNEL) < 0)
5182 return -ENOMEM;
5183 /* We want to start with the refcount at zero */
5184 percpu_ref_put(&mddev->writes_pending);
5185 return 0;
5186}
5187EXPORT_SYMBOL_GPL(mddev_init_writes_pending);
5188
5177static int md_alloc(dev_t dev, char *name)5189static int md_alloc(dev_t dev, char *name)
5178{5190{
5179 /*5191 /*
@@ -5239,10 +5251,6 @@ static int md_alloc(dev_t dev, char *name) · 59 unmodified lines
5239 blk_queue_make_request(mddev->queue, md_make_request);5251 blk_queue_make_request(mddev->queue, md_make_request);
5240 blk_set_stacking_limits(&mddev->queue->limits);5252 blk_set_stacking_limits(&mddev->queue->limits);
5241 5253
5242 if (percpu_ref_init(&mddev->writes_pending, no_op, 0, GFP_KERNEL) < 0)
5243 goto abort;
5244 /* We want to start with the refcount at zero */
5245 percpu_ref_put(&mddev->writes_pending);
5246 disk = alloc_disk(1 << shift);5254 disk = alloc_disk(1 << shift);
5247 if (!disk) {5255 if (!disk) {
5248 blk_cleanup_queue(mddev->queue);5256 blk_cleanup_queue(mddev->queue);
drivers/md/md.h+1−0
@@ -648,6 +648,7 @@ extern void md_unregister_thread(struct md_thread **threadp); · 647 unmodified lines
648extern void md_wakeup_thread(struct md_thread *thread);648extern void md_wakeup_thread(struct md_thread *thread);
649extern void md_check_recovery(struct mddev *mddev);649extern void md_check_recovery(struct mddev *mddev);
650extern void md_reap_sync_thread(struct mddev *mddev);650extern void md_reap_sync_thread(struct mddev *mddev);
651extern int mddev_init_writes_pending(struct mddev *mddev);
651extern void md_write_start(struct mddev *mddev, struct bio *bi);652extern void md_write_start(struct mddev *mddev, struct bio *bi);
652extern void md_write_inc(struct mddev *mddev, struct bio *bi);653extern void md_write_inc(struct mddev *mddev, struct bio *bi);
653extern void md_write_end(struct mddev *mddev);654extern void md_write_end(struct mddev *mddev);
drivers/md/raid1.c+2−0
@@ -3063,6 +3063,8 @@ static int raid1_run(struct mddev *mddev) · 3062 unmodified lines
3063 mdname(mddev));3063 mdname(mddev));
3064 return -EIO;3064 return -EIO;
3065 }3065 }
3066 if (mddev_init_writes_pending(mddev) < 0)
3067 return -ENOMEM;
3066 /*3068 /*
3067 * copy the already verified devices into our private RAID13069 * copy the already verified devices into our private RAID1
3068 * bookkeeping area. [whatever we allocate in run(),3070 * bookkeeping area. [whatever we allocate in run(),
drivers/md/raid10.c+3−0
@@ -3611,6 +3611,9 @@ static int raid10_run(struct mddev *mddev) · 3610 unmodified lines
3611 int first = 1;3611 int first = 1;
3612 bool discard_supported = false;3612 bool discard_supported = false;
3613 3613
3614 if (mddev_init_writes_pending(mddev) < 0)
3615 return -ENOMEM;
3616
3614 if (mddev->private == NULL) {3617 if (mddev->private == NULL) {
3615 conf = setup_conf(mddev);3618 conf = setup_conf(mddev);
3616 if (IS_ERR(conf))3619 if (IS_ERR(conf))
drivers/md/raid5-cache.c+2−2
@@ -1782,7 +1782,7 @@ static int r5l_log_write_empty_meta_block(struct r5l_log *log, sector_t pos, · 1781 unmodified lines
1782 mb->checksum = cpu_to_le32(crc32c_le(log->uuid_checksum,1782 mb->checksum = cpu_to_le32(crc32c_le(log->uuid_checksum,
1783 mb, PAGE_SIZE));1783 mb, PAGE_SIZE));
1784 if (!sync_page_io(log->rdev, pos, PAGE_SIZE, page, REQ_OP_WRITE,1784 if (!sync_page_io(log->rdev, pos, PAGE_SIZE, page, REQ_OP_WRITE,
1785 REQ_FUA, false)) {1785 REQ_SYNC | REQ_FUA, false)) {
1786 __free_page(page);1786 __free_page(page);
1787 return -EIO;1787 return -EIO;
1788 }1788 }
@@ -2388,7 +2388,7 @@ r5c_recovery_rewrite_data_only_stripes(struct r5l_log *log, · 599 unmodified lines
2388 mb->checksum = cpu_to_le32(crc32c_le(log->uuid_checksum,2388 mb->checksum = cpu_to_le32(crc32c_le(log->uuid_checksum,
2389 mb, PAGE_SIZE));2389 mb, PAGE_SIZE));
2390 sync_page_io(log->rdev, ctx->pos, PAGE_SIZE, page,2390 sync_page_io(log->rdev, ctx->pos, PAGE_SIZE, page,
2391 REQ_OP_WRITE, REQ_FUA, false);2391 REQ_OP_WRITE, REQ_SYNC | REQ_FUA, false);
2392 sh->log_start = ctx->pos;2392 sh->log_start = ctx->pos;
2393 list_add_tail(&sh->r5c, &log->stripe_in_journal_list);2393 list_add_tail(&sh->r5c, &log->stripe_in_journal_list);
2394 atomic_inc(&log->stripe_in_journal_count);2394 atomic_inc(&log->stripe_in_journal_count);
drivers/md/raid5-ppl.c+2−2
@@ -907,8 +907,8 @@ static int ppl_write_empty_header(struct ppl_log *log) · 906 unmodified lines
907 pplhdr->checksum = cpu_to_le32(~crc32c_le(~0, pplhdr, PAGE_SIZE));907 pplhdr->checksum = cpu_to_le32(~crc32c_le(~0, pplhdr, PAGE_SIZE));
908 908
909 if (!sync_page_io(rdev, rdev->ppl.sector - rdev->data_offset,909 if (!sync_page_io(rdev, rdev->ppl.sector - rdev->data_offset,
910 PPL_HEADER_SIZE, page, REQ_OP_WRITE | REQ_FUA, 0,910 PPL_HEADER_SIZE, page, REQ_OP_WRITE | REQ_SYNC |
911 false)) {911 REQ_FUA, 0, false)) {
912 md_error(rdev->mddev, rdev);912 md_error(rdev->mddev, rdev);
913 ret = -EIO;913 ret = -EIO;
914 }914 }
drivers/md/raid5.c+17−4
@@ -4085,10 +4085,15 @@ static void handle_parity_checks5(struct r5conf *conf, struct stripe_head *sh, · 4084 unmodified lines
4085 set_bit(STRIPE_INSYNC, &sh->state);4085 set_bit(STRIPE_INSYNC, &sh->state);
4086 else {4086 else {
4087 atomic64_add(STRIPE_SECTORS, &conf->mddev->resync_mismatches);4087 atomic64_add(STRIPE_SECTORS, &conf->mddev->resync_mismatches);
4088 if (test_bit(MD_RECOVERY_CHECK, &conf->mddev->recovery))4088 if (test_bit(MD_RECOVERY_CHECK, &conf->mddev->recovery)) {
4089 /* don't try to repair!! */4089 /* don't try to repair!! */
4090 set_bit(STRIPE_INSYNC, &sh->state);4090 set_bit(STRIPE_INSYNC, &sh->state);
4091 else {4091 pr_warn_ratelimited("%s: mismatch sector in range "
4092 "%llu-%llu\n", mdname(conf->mddev),
4093 (unsigned long long) sh->sector,
4094 (unsigned long long) sh->sector +
4095 STRIPE_SECTORS);
4096 } else {
4092 sh->check_state = check_state_compute_run;4097 sh->check_state = check_state_compute_run;
4093 set_bit(STRIPE_COMPUTE_RUN, &sh->state);4098 set_bit(STRIPE_COMPUTE_RUN, &sh->state);
4094 set_bit(STRIPE_OP_COMPUTE_BLK, &s->ops_request);4099 set_bit(STRIPE_OP_COMPUTE_BLK, &s->ops_request);
@@ -4237,10 +4242,15 @@ static void handle_parity_checks6(struct r5conf *conf, struct stripe_head *sh, · 142 unmodified lines
4237 }4242 }
4238 } else {4243 } else {
4239 atomic64_add(STRIPE_SECTORS, &conf->mddev->resync_mismatches);4244 atomic64_add(STRIPE_SECTORS, &conf->mddev->resync_mismatches);
4240 if (test_bit(MD_RECOVERY_CHECK, &conf->mddev->recovery))4245 if (test_bit(MD_RECOVERY_CHECK, &conf->mddev->recovery)) {
4241 /* don't try to repair!! */4246 /* don't try to repair!! */
4242 set_bit(STRIPE_INSYNC, &sh->state);4247 set_bit(STRIPE_INSYNC, &sh->state);
4243 else {4248 pr_warn_ratelimited("%s: mismatch sector in range "
4249 "%llu-%llu\n", mdname(conf->mddev),
4250 (unsigned long long) sh->sector,
4251 (unsigned long long) sh->sector +
4252 STRIPE_SECTORS);
4253 } else {
4244 int *target = &sh->ops.target;4254 int *target = &sh->ops.target;
4245 4255
4246 sh->ops.target = -1;4256 sh->ops.target = -1;
@@ -7108,6 +7118,9 @@ static int raid5_run(struct mddev *mddev) · 2861 unmodified lines
7108 long long min_offset_diff = 0;7118 long long min_offset_diff = 0;
7109 int first = 1;7119 int first = 1;
7110 7120
7121 if (mddev_init_writes_pending(mddev) < 0)
7122 return -ENOMEM;
7123
7111 if (mddev->recovery_cp != MaxSector)7124 if (mddev->recovery_cp != MaxSector)
7112 pr_notice("md/raid:%s: not clean -- starting background reconstruction\n",7125 pr_notice("md/raid:%s: not clean -- starting background reconstruction\n",
7113 mdname(mddev));7126 mdname(mddev));
drivers/media/cec/cec-api.c+1−7
@@ -272,16 +272,10 @@ static long cec_receive(struct cec_adapter *adap, struct cec_fh *fh, · 271 unmodified lines
272 bool block, struct cec_msg __user *parg)272 bool block, struct cec_msg __user *parg)
273{273{
274 struct cec_msg msg = {};274 struct cec_msg msg = {};
275 long err = 0;275 long err;
276 276
277 if (copy_from_user(&msg, parg, sizeof(msg)))277 if (copy_from_user(&msg, parg, sizeof(msg)))
278 return -EFAULT;278 return -EFAULT;
279 mutex_lock(&adap->lock);
280 if (!adap->is_configured && fh->mode_follower < CEC_MODE_MONITOR)
281 err = -ENONET;
282 mutex_unlock(&adap->lock);
283 if (err)
284 return err;
285 279
286 err = cec_receive_msg(fh, &msg, block);280 err = cec_receive_msg(fh, &msg, block);
287 if (err)281 if (err)
drivers/media/platform/mtk-vcodec/vdec/vdec_h264_if.c+4−4
@@ -493,10 +493,10 @@ static int vdec_h264_get_param(unsigned long h_vdec, · 492 unmodified lines
493}493}
494 494
495static struct vdec_common_if vdec_h264_if = {495static struct vdec_common_if vdec_h264_if = {
496 vdec_h264_init,496 .init = vdec_h264_init,
497 vdec_h264_decode,497 .decode = vdec_h264_decode,
498 vdec_h264_get_param,498 .get_param = vdec_h264_get_param,
499 vdec_h264_deinit,499 .deinit = vdec_h264_deinit,
500};500};
501 501
502struct vdec_common_if *get_h264_dec_comm_if(void);502struct vdec_common_if *get_h264_dec_comm_if(void);
drivers/media/platform/mtk-vcodec/vdec/vdec_vp8_if.c+4−4
@@ -620,10 +620,10 @@ static void vdec_vp8_deinit(unsigned long h_vdec) · 619 unmodified lines
620}620}
621 621
622static struct vdec_common_if vdec_vp8_if = {622static struct vdec_common_if vdec_vp8_if = {
623 vdec_vp8_init,623 .init = vdec_vp8_init,
624 vdec_vp8_decode,624 .decode = vdec_vp8_decode,
625 vdec_vp8_get_param,625 .get_param = vdec_vp8_get_param,
626 vdec_vp8_deinit,626 .deinit = vdec_vp8_deinit,
627};627};
628 628
629struct vdec_common_if *get_vp8_dec_comm_if(void);629struct vdec_common_if *get_vp8_dec_comm_if(void);
drivers/media/platform/mtk-vcodec/vdec/vdec_vp9_if.c+4−4
@@ -979,10 +979,10 @@ static int vdec_vp9_get_param(unsigned long h_vdec, · 978 unmodified lines
979}979}
980 980
981static struct vdec_common_if vdec_vp9_if = {981static struct vdec_common_if vdec_vp9_if = {
982 vdec_vp9_init,982 .init = vdec_vp9_init,
983 vdec_vp9_decode,983 .decode = vdec_vp9_decode,
984 vdec_vp9_get_param,984 .get_param = vdec_vp9_get_param,
985 vdec_vp9_deinit,985 .deinit = vdec_vp9_deinit,
986};986};
987 987
988struct vdec_common_if *get_vp9_dec_comm_if(void);988struct vdec_common_if *get_vp9_dec_comm_if(void);
drivers/memory/atmel-ebi.c+1−1
@@ -581,7 +581,7 @@ static int atmel_ebi_probe(struct platform_device *pdev) · 580 unmodified lines
581 return of_platform_populate(np, NULL, NULL, dev);581 return of_platform_populate(np, NULL, NULL, dev);
582}582}
583 583
584static int atmel_ebi_resume(struct device *dev)584static __maybe_unused int atmel_ebi_resume(struct device *dev)
585{585{
586 struct atmel_ebi *ebi = dev_get_drvdata(dev);586 struct atmel_ebi *ebi = dev_get_drvdata(dev);
587 struct atmel_ebi_dev *ebid;587 struct atmel_ebi_dev *ebid;
drivers/misc/cxl/file.c+2−5
@@ -159,11 +159,8 @@ static long afu_ioctl_start_work(struct cxl_context *ctx, · 158 unmodified lines
159 159
160 /* Do this outside the status_mutex to avoid a circular dependency with160 /* Do this outside the status_mutex to avoid a circular dependency with
161 * the locking in cxl_mmap_fault() */161 * the locking in cxl_mmap_fault() */
162 if (copy_from_user(&work, uwork,162 if (copy_from_user(&work, uwork, sizeof(work)))
163 sizeof(struct cxl_ioctl_start_work))) {163 return -EFAULT;
164 rc = -EFAULT;
165 goto out;
166 }
167 164
168 mutex_lock(&ctx->status_mutex);165 mutex_lock(&ctx->status_mutex);
169 if (ctx->status != OPENED) {166 if (ctx->status != OPENED) {
drivers/misc/cxl/native.c+11−3
@@ -1302,13 +1302,16 @@ int cxl_native_register_psl_err_irq(struct cxl *adapter) · 1301 unmodified lines
1302 1302
1303void cxl_native_release_psl_err_irq(struct cxl *adapter)1303void cxl_native_release_psl_err_irq(struct cxl *adapter)
1304{1304{
1305 if (adapter->native->err_virq != irq_find_mapping(NULL, adapter->native->err_hwirq))1305 if (adapter->native->err_virq == 0 ||
1306 adapter->native->err_virq !=
1307 irq_find_mapping(NULL, adapter->native->err_hwirq))
1306 return;1308 return;
1307 1309
1308 cxl_p1_write(adapter, CXL_PSL_ErrIVTE, 0x0000000000000000);1310 cxl_p1_write(adapter, CXL_PSL_ErrIVTE, 0x0000000000000000);
1309 cxl_unmap_irq(adapter->native->err_virq, adapter);1311 cxl_unmap_irq(adapter->native->err_virq, adapter);
1310 cxl_ops->release_one_irq(adapter, adapter->native->err_hwirq);1312 cxl_ops->release_one_irq(adapter, adapter->native->err_hwirq);
1311 kfree(adapter->irq_name);1313 kfree(adapter->irq_name);
1314 adapter->native->err_virq = 0;
1312}1315}
1313 1316
1314int cxl_native_register_serr_irq(struct cxl_afu *afu)1317int cxl_native_register_serr_irq(struct cxl_afu *afu)
@@ -1346,13 +1349,15 @@ int cxl_native_register_serr_irq(struct cxl_afu *afu) · 31 unmodified lines
1346 1349
1347void cxl_native_release_serr_irq(struct cxl_afu *afu)1350void cxl_native_release_serr_irq(struct cxl_afu *afu)
1348{1351{
1349 if (afu->serr_virq != irq_find_mapping(NULL, afu->serr_hwirq))1352 if (afu->serr_virq == 0 ||
1353 afu->serr_virq != irq_find_mapping(NULL, afu->serr_hwirq))
1350 return;1354 return;
1351 1355
1352 cxl_p1n_write(afu, CXL_PSL_SERR_An, 0x0000000000000000);1356 cxl_p1n_write(afu, CXL_PSL_SERR_An, 0x0000000000000000);
1353 cxl_unmap_irq(afu->serr_virq, afu);1357 cxl_unmap_irq(afu->serr_virq, afu);
1354 cxl_ops->release_one_irq(afu->adapter, afu->serr_hwirq);1358 cxl_ops->release_one_irq(afu->adapter, afu->serr_hwirq);
1355 kfree(afu->err_irq_name);1359 kfree(afu->err_irq_name);
1360 afu->serr_virq = 0;
1356}1361}
1357 1362
1358int cxl_native_register_psl_irq(struct cxl_afu *afu)1363int cxl_native_register_psl_irq(struct cxl_afu *afu)
@@ -1375,12 +1380,15 @@ int cxl_native_register_psl_irq(struct cxl_afu *afu) · 16 unmodified lines
1375 1380
1376void cxl_native_release_psl_irq(struct cxl_afu *afu)1381void cxl_native_release_psl_irq(struct cxl_afu *afu)
1377{1382{
1378 if (afu->native->psl_virq != irq_find_mapping(NULL, afu->native->psl_hwirq))1383 if (afu->native->psl_virq == 0 ||
1384 afu->native->psl_virq !=
1385 irq_find_mapping(NULL, afu->native->psl_hwirq))
1379 return;1386 return;
1380 1387
1381 cxl_unmap_irq(afu->native->psl_virq, afu);1388 cxl_unmap_irq(afu->native->psl_virq, afu);
1382 cxl_ops->release_one_irq(afu->adapter, afu->native->psl_hwirq);1389 cxl_ops->release_one_irq(afu->adapter, afu->native->psl_hwirq);
1383 kfree(afu->psl_irq_name);1390 kfree(afu->psl_irq_name);
1391 afu->native->psl_virq = 0;
1384}1392}
1385 1393
1386static void recover_psl_err(struct cxl_afu *afu, u64 errstat)1394static void recover_psl_err(struct cxl_afu *afu, u64 errstat)
drivers/misc/mei/bus.c+3−1
@@ -763,8 +763,10 @@ static ssize_t modalias_show(struct device *dev, struct device_attribute *a, · 762 unmodified lines
763{763{
764 struct mei_cl_device *cldev = to_mei_cl_device(dev);764 struct mei_cl_device *cldev = to_mei_cl_device(dev);
765 const uuid_le *uuid = mei_me_cl_uuid(cldev->me_cl);765 const uuid_le *uuid = mei_me_cl_uuid(cldev->me_cl);
766 u8 version = mei_me_cl_ver(cldev->me_cl);
766 767
767 return scnprintf(buf, PAGE_SIZE, "mei:%s:%pUl:", cldev->name, uuid);768 return scnprintf(buf, PAGE_SIZE, "mei:%s:%pUl:%02X:",
769 cldev->name, uuid, version);
768}770}
769static DEVICE_ATTR_RO(modalias);771static DEVICE_ATTR_RO(modalias);
770 772
drivers/misc/sgi-xp/xp.h+11−1
@@ -309,6 +309,9 @@ static inline enum xp_retval · 308 unmodified lines
309xpc_send(short partid, int ch_number, u32 flags, void *payload,309xpc_send(short partid, int ch_number, u32 flags, void *payload,
310 u16 payload_size)310 u16 payload_size)
311{311{
312 if (!xpc_interface.send)
313 return xpNotLoaded;
314
312 return xpc_interface.send(partid, ch_number, flags, payload,315 return xpc_interface.send(partid, ch_number, flags, payload,
313 payload_size);316 payload_size);
314}317}
@@ -317,6 +320,9 @@ static inline enum xp_retval · 2 unmodified lines
317xpc_send_notify(short partid, int ch_number, u32 flags, void *payload,320xpc_send_notify(short partid, int ch_number, u32 flags, void *payload,
318 u16 payload_size, xpc_notify_func func, void *key)321 u16 payload_size, xpc_notify_func func, void *key)
319{322{
323 if (!xpc_interface.send_notify)
324 return xpNotLoaded;
325
320 return xpc_interface.send_notify(partid, ch_number, flags, payload,326 return xpc_interface.send_notify(partid, ch_number, flags, payload,
321 payload_size, func, key);327 payload_size, func, key);
322}328}
@@ -324,12 +330,16 @@ xpc_send_notify(short partid, int ch_number, u32 flags, void *payload, · 1 unmodified line
324static inline void330static inline void
325xpc_received(short partid, int ch_number, void *payload)331xpc_received(short partid, int ch_number, void *payload)
326{332{
327 return xpc_interface.received(partid, ch_number, payload);333 if (xpc_interface.received)
334 xpc_interface.received(partid, ch_number, payload);
328}335}
329 336
330static inline enum xp_retval337static inline enum xp_retval
331xpc_partid_to_nasids(short partid, void *nasids)338xpc_partid_to_nasids(short partid, void *nasids)
332{339{
340 if (!xpc_interface.partid_to_nasids)
341 return xpNotLoaded;
342
333 return xpc_interface.partid_to_nasids(partid, nasids);343 return xpc_interface.partid_to_nasids(partid, nasids);
334}344}
335 345
drivers/misc/sgi-xp/xp_main.c+7−29
@@ -69,23 +69,9 @@ struct xpc_registration xpc_registrations[XPC_MAX_NCHANNELS]; · 68 unmodified lines
69EXPORT_SYMBOL_GPL(xpc_registrations);69EXPORT_SYMBOL_GPL(xpc_registrations);
70 70
71/*71/*
72 * Initialize the XPC interface to indicate that XPC isn't loaded.72 * Initialize the XPC interface to NULL to indicate that XPC isn't loaded.
73 */73 */
74static enum xp_retval74struct xpc_interface xpc_interface = { };
75xpc_notloaded(void)
76{
77 return xpNotLoaded;
78}
79
80struct xpc_interface xpc_interface = {
81 (void (*)(int))xpc_notloaded,
82 (void (*)(int))xpc_notloaded,
83 (enum xp_retval(*)(short, int, u32, void *, u16))xpc_notloaded,
84 (enum xp_retval(*)(short, int, u32, void *, u16, xpc_notify_func,
85 void *))xpc_notloaded,
86 (void (*)(short, int, void *))xpc_notloaded,
87 (enum xp_retval(*)(short, void *))xpc_notloaded
88};
89EXPORT_SYMBOL_GPL(xpc_interface);75EXPORT_SYMBOL_GPL(xpc_interface);
90 76
91/*77/*
@@ -115,17 +101,7 @@ EXPORT_SYMBOL_GPL(xpc_set_interface); · 23 unmodified lines
115void101void
116xpc_clear_interface(void)102xpc_clear_interface(void)
117{103{
118 xpc_interface.connect = (void (*)(int))xpc_notloaded;104 memset(&xpc_interface, 0, sizeof(xpc_interface));
119 xpc_interface.disconnect = (void (*)(int))xpc_notloaded;
120 xpc_interface.send = (enum xp_retval(*)(short, int, u32, void *, u16))
121 xpc_notloaded;
122 xpc_interface.send_notify = (enum xp_retval(*)(short, int, u32, void *,
123 u16, xpc_notify_func,
124 void *))xpc_notloaded;
125 xpc_interface.received = (void (*)(short, int, void *))
126 xpc_notloaded;
127 xpc_interface.partid_to_nasids = (enum xp_retval(*)(short, void *))
128 xpc_notloaded;
129}105}
130EXPORT_SYMBOL_GPL(xpc_clear_interface);106EXPORT_SYMBOL_GPL(xpc_clear_interface);
131 107
@@ -188,7 +164,8 @@ xpc_connect(int ch_number, xpc_channel_func func, void *key, u16 payload_size, · 56 unmodified lines
188 164
189 mutex_unlock(&registration->mutex);165 mutex_unlock(&registration->mutex);
190 166
191 xpc_interface.connect(ch_number);167 if (xpc_interface.connect)
168 xpc_interface.connect(ch_number);
192 169
193 return xpSuccess;170 return xpSuccess;
194}171}
@@ -237,7 +214,8 @@ xpc_disconnect(int ch_number) · 42 unmodified lines
237 registration->assigned_limit = 0;214 registration->assigned_limit = 0;
238 registration->idle_limit = 0;215 registration->idle_limit = 0;
239 216
240 xpc_interface.disconnect(ch_number);217 if (xpc_interface.disconnect)
218 xpc_interface.disconnect(ch_number);
241 219
242 mutex_unlock(&registration->mutex);220 mutex_unlock(&registration->mutex);
243 221
drivers/mmc/host/meson-gx-mmc.c+9−0
@@ -210,6 +210,15 @@ static void meson_mmc_get_transfer_mode(struct mmc_host *mmc, · 209 unmodified lines
210 int i;210 int i;
211 bool use_desc_chain_mode = true;211 bool use_desc_chain_mode = true;
212 212
213 /*
214 * Broken SDIO with AP6255-based WiFi on Khadas VIM Pro has been
215 * reported. For some strange reason this occurs in descriptor
216 * chain mode only. So let's fall back to bounce buffer mode
217 * for command SD_IO_RW_EXTENDED.
218 */
219 if (mrq->cmd->opcode == SD_IO_RW_EXTENDED)
220 return;
221
213 for_each_sg(data->sg, sg, data->sg_len, i)222 for_each_sg(data->sg, sg, data->sg_len, i)
214 /* check for 8 byte alignment */223 /* check for 8 byte alignment */
215 if (sg->offset & 7) {224 if (sg->offset & 7) {
drivers/mtd/nand/nand_base.c+35−11
@@ -202,7 +202,7 @@ static int nand_ooblayout_free_lp_hamming(struct mtd_info *mtd, int section, · 201 unmodified lines
202 return 0;202 return 0;
203}203}
204 204
205const struct mtd_ooblayout_ops nand_ooblayout_lp_hamming_ops = {205static const struct mtd_ooblayout_ops nand_ooblayout_lp_hamming_ops = {
206 .ecc = nand_ooblayout_ecc_lp_hamming,206 .ecc = nand_ooblayout_ecc_lp_hamming,
207 .free = nand_ooblayout_free_lp_hamming,207 .free = nand_ooblayout_free_lp_hamming,
208};208};
@@ -4361,7 +4361,7 @@ int nand_scan_ident(struct mtd_info *mtd, int maxchips, · 4152 unmodified lines
4361 /* Initialize the ->data_interface field. */4361 /* Initialize the ->data_interface field. */
4362 ret = nand_init_data_interface(chip);4362 ret = nand_init_data_interface(chip);
4363 if (ret)4363 if (ret)
4364 return ret;4364 goto err_nand_init;
4365 4365
4366 /*4366 /*
4367 * Setup the data interface correctly on the chip and controller side.4367 * Setup the data interface correctly on the chip and controller side.
@@ -4373,7 +4373,7 @@ int nand_scan_ident(struct mtd_info *mtd, int maxchips, · 5 unmodified lines
4373 */4373 */
4374 ret = nand_setup_data_interface(chip);4374 ret = nand_setup_data_interface(chip);
4375 if (ret)4375 if (ret)
4376 return ret;4376 goto err_nand_init;
4377 4377
4378 nand_maf_id = chip->id.data[0];4378 nand_maf_id = chip->id.data[0];
4379 nand_dev_id = chip->id.data[1];4379 nand_dev_id = chip->id.data[1];
@@ -4404,6 +4404,12 @@ int nand_scan_ident(struct mtd_info *mtd, int maxchips, · 24 unmodified lines
4404 mtd->size = i * chip->chipsize;4404 mtd->size = i * chip->chipsize;
4405 4405
4406 return 0;4406 return 0;
4407
4408err_nand_init:
4409 /* Free manufacturer priv data. */
4410 nand_manufacturer_cleanup(chip);
4411
4412 return ret;
4407}4413}
4408EXPORT_SYMBOL(nand_scan_ident);4414EXPORT_SYMBOL(nand_scan_ident);
4409 4415
@@ -4574,18 +4580,23 @@ int nand_scan_tail(struct mtd_info *mtd) · 164 unmodified lines
4574 4580
4575 /* New bad blocks should be marked in OOB, flash-based BBT, or both */4581 /* New bad blocks should be marked in OOB, flash-based BBT, or both */
4576 if (WARN_ON((chip->bbt_options & NAND_BBT_NO_OOB_BBM) &&4582 if (WARN_ON((chip->bbt_options & NAND_BBT_NO_OOB_BBM) &&
4577 !(chip->bbt_options & NAND_BBT_USE_FLASH)))4583 !(chip->bbt_options & NAND_BBT_USE_FLASH))) {
4578 return -EINVAL;4584 ret = -EINVAL;
4585 goto err_ident;
4586 }
4579 4587
4580 if (invalid_ecc_page_accessors(chip)) {4588 if (invalid_ecc_page_accessors(chip)) {
4581 pr_err("Invalid ECC page accessors setup\n");4589 pr_err("Invalid ECC page accessors setup\n");
4582 return -EINVAL;4590 ret = -EINVAL;
4591 goto err_ident;
4583 }4592 }
4584 4593
4585 if (!(chip->options & NAND_OWN_BUFFERS)) {4594 if (!(chip->options & NAND_OWN_BUFFERS)) {
4586 nbuf = kzalloc(sizeof(*nbuf), GFP_KERNEL);4595 nbuf = kzalloc(sizeof(*nbuf), GFP_KERNEL);
4587 if (!nbuf)4596 if (!nbuf) {
4588 return -ENOMEM;4597 ret = -ENOMEM;
4598 goto err_ident;
4599 }
4589 4600
4590 nbuf->ecccalc = kmalloc(mtd->oobsize, GFP_KERNEL);4601 nbuf->ecccalc = kmalloc(mtd->oobsize, GFP_KERNEL);
4591 if (!nbuf->ecccalc) {4602 if (!nbuf->ecccalc) {
@@ -4608,8 +4619,10 @@ int nand_scan_tail(struct mtd_info *mtd) · 16 unmodified lines
4608 4619
4609 chip->buffers = nbuf;4620 chip->buffers = nbuf;
4610 } else {4621 } else {
4611 if (!chip->buffers)4622 if (!chip->buffers) {
4612 return -ENOMEM;4623 ret = -ENOMEM;
4624 goto err_ident;
4625 }
4613 }4626 }
4614 4627
4615 /* Set the internal oob buffer location, just after the page data */4628 /* Set the internal oob buffer location, just after the page data */
@@ -4842,7 +4855,11 @@ int nand_scan_tail(struct mtd_info *mtd) · 226 unmodified lines
4842 return 0;4855 return 0;
4843 4856
4844 /* Build bad block table */4857 /* Build bad block table */
4845 return chip->scan_bbt(mtd);4858 ret = chip->scan_bbt(mtd);
4859 if (ret)
4860 goto err_free;
4861 return 0;
4862
4846err_free:4863err_free:
4847 if (nbuf) {4864 if (nbuf) {
4848 kfree(nbuf->databuf);4865 kfree(nbuf->databuf);
@@ -4850,6 +4867,13 @@ err_free: · 1 unmodified line
4850 kfree(nbuf->ecccalc);4867 kfree(nbuf->ecccalc);
4851 kfree(nbuf);4868 kfree(nbuf);
4852 }4869 }
4870
4871err_ident:
4872 /* Clean up nand_scan_ident(). */
4873
4874 /* Free manufacturer priv data. */
4875 nand_manufacturer_cleanup(chip);
4876
4853 return ret;4877 return ret;
4854}4878}
4855EXPORT_SYMBOL(nand_scan_tail);4879EXPORT_SYMBOL(nand_scan_tail);
drivers/mtd/nand/nand_ids.c+0−1
@@ -6,7 +6,6 @@ · 5 unmodified lines
6 * published by the Free Software Foundation.6 * published by the Free Software Foundation.
7 *7 *
8 */8 */
9#include <linux/module.h>
10#include <linux/mtd/nand.h>9#include <linux/mtd/nand.h>
11#include <linux/sizes.h>10#include <linux/sizes.h>
12 11
drivers/mtd/nand/nand_samsung.c+3−0
@@ -84,6 +84,9 @@ static void samsung_nand_decode_id(struct nand_chip *chip) · 83 unmodified lines
84 case 7:84 case 7:
85 chip->ecc_strength_ds = 60;85 chip->ecc_strength_ds = 60;
86 break;86 break;
87 default:
88 WARN(1, "Could not decode ECC info");
89 chip->ecc_step_ds = 0;
87 }90 }
88 }91 }
89 } else {92 } else {
drivers/mtd/nand/tango_nand.c+16−7
@@ -55,10 +55,10 @@ · 54 unmodified lines
55 * byte 1 for other packets in the page (PKT_N, for N > 0)55 * byte 1 for other packets in the page (PKT_N, for N > 0)
56 * ERR_COUNT_PKT_N is the max error count over all but the first packet.56 * ERR_COUNT_PKT_N is the max error count over all but the first packet.
57 */57 */
58#define DECODE_OK_PKT_0(v) ((v) & BIT(7))
59#define DECODE_OK_PKT_N(v) ((v) & BIT(15))
60#define ERR_COUNT_PKT_0(v) (((v) >> 0) & 0x3f)58#define ERR_COUNT_PKT_0(v) (((v) >> 0) & 0x3f)
61#define ERR_COUNT_PKT_N(v) (((v) >> 8) & 0x3f)59#define ERR_COUNT_PKT_N(v) (((v) >> 8) & 0x3f)
60#define DECODE_FAIL_PKT_0(v) (((v) & BIT(7)) == 0)
61#define DECODE_FAIL_PKT_N(v) (((v) & BIT(15)) == 0)
62 62
63/* Offsets relative to pbus_base */63/* Offsets relative to pbus_base */
64#define PBUS_CS_CTRL 0x83c64#define PBUS_CS_CTRL 0x83c
@@ -193,6 +193,8 @@ static int check_erased_page(struct nand_chip *chip, u8 *buf) · 128 unmodified lines
193 chip->ecc.strength);193 chip->ecc.strength);
194 if (res < 0)194 if (res < 0)
195 mtd->ecc_stats.failed++;195 mtd->ecc_stats.failed++;
196 else
197 mtd->ecc_stats.corrected += res;
196 198
197 bitflips = max(res, bitflips);199 bitflips = max(res, bitflips);
198 buf += pkt_size;200 buf += pkt_size;
@@ -202,9 +204,11 @@ static int check_erased_page(struct nand_chip *chip, u8 *buf) · 3 unmodified lines
202 return bitflips;204 return bitflips;
203}205}
204 206
205static int decode_error_report(struct tango_nfc *nfc)207static int decode_error_report(struct nand_chip *chip)
206{208{
207 u32 status, res;209 u32 status, res;
210 struct mtd_info *mtd = nand_to_mtd(chip);
211 struct tango_nfc *nfc = to_tango_nfc(chip->controller);
208 212
209 status = readl_relaxed(nfc->reg_base + NFC_XFER_STATUS);213 status = readl_relaxed(nfc->reg_base + NFC_XFER_STATUS);
210 if (status & PAGE_IS_EMPTY)214 if (status & PAGE_IS_EMPTY)
@@ -212,10 +216,14 @@ static int decode_error_report(struct tango_nfc *nfc) · 1 unmodified line
212 216
213 res = readl_relaxed(nfc->mem_base + ERROR_REPORT);217 res = readl_relaxed(nfc->mem_base + ERROR_REPORT);
214 218
215 if (DECODE_OK_PKT_0(res) && DECODE_OK_PKT_N(res))219 if (DECODE_FAIL_PKT_0(res) || DECODE_FAIL_PKT_N(res))
216 return max(ERR_COUNT_PKT_0(res), ERR_COUNT_PKT_N(res));220 return -EBADMSG;
221
222 /* ERR_COUNT_PKT_N is max, not sum, but that's all we have */
223 mtd->ecc_stats.corrected +=
224 ERR_COUNT_PKT_0(res) + ERR_COUNT_PKT_N(res);
217 225
218 return -EBADMSG;226 return max(ERR_COUNT_PKT_0(res), ERR_COUNT_PKT_N(res));
219}227}
220 228
221static void tango_dma_callback(void *arg)229static void tango_dma_callback(void *arg)
@@ -282,7 +290,7 @@ static int tango_read_page(struct mtd_info *mtd, struct nand_chip *chip, · 60 unmodified lines
282 if (err)290 if (err)
283 return err;291 return err;
284 292
285 res = decode_error_report(nfc);293 res = decode_error_report(chip);
286 if (res < 0) {294 if (res < 0) {
287 chip->ecc.read_oob_raw(mtd, chip, page);295 chip->ecc.read_oob_raw(mtd, chip, page);
288 res = check_erased_page(chip, buf);296 res = check_erased_page(chip, buf);
@@ -663,6 +671,7 @@ static const struct of_device_id tango_nand_ids[] = { · 374 unmodified lines
663 { .compatible = "sigma,smp8758-nand" },671 { .compatible = "sigma,smp8758-nand" },
664 { /* sentinel */ }672 { /* sentinel */ }
665};673};
674MODULE_DEVICE_TABLE(of, tango_nand_ids);
666 675
667static struct platform_driver tango_nand_driver = {676static struct platform_driver tango_nand_driver = {
668 .probe = tango_nand_probe,677 .probe = tango_nand_probe,
drivers/net/bonding/bond_3ad.c+27−0
@@ -90,10 +90,13 @@ enum ad_link_speed_type { · 89 unmodified lines
90 AD_LINK_SPEED_100MBPS,90 AD_LINK_SPEED_100MBPS,
91 AD_LINK_SPEED_1000MBPS,91 AD_LINK_SPEED_1000MBPS,
92 AD_LINK_SPEED_2500MBPS,92 AD_LINK_SPEED_2500MBPS,
93 AD_LINK_SPEED_5000MBPS,
93 AD_LINK_SPEED_10000MBPS,94 AD_LINK_SPEED_10000MBPS,
95 AD_LINK_SPEED_14000MBPS,
94 AD_LINK_SPEED_20000MBPS,96 AD_LINK_SPEED_20000MBPS,
95 AD_LINK_SPEED_25000MBPS,97 AD_LINK_SPEED_25000MBPS,
96 AD_LINK_SPEED_40000MBPS,98 AD_LINK_SPEED_40000MBPS,
99 AD_LINK_SPEED_50000MBPS,
97 AD_LINK_SPEED_56000MBPS,100 AD_LINK_SPEED_56000MBPS,
98 AD_LINK_SPEED_100000MBPS,101 AD_LINK_SPEED_100000MBPS,
99};102};
@@ -259,10 +262,13 @@ static inline int __check_agg_selection_timer(struct port *port) · 159 unmodified lines
259 * %AD_LINK_SPEED_100MBPS,262 * %AD_LINK_SPEED_100MBPS,
260 * %AD_LINK_SPEED_1000MBPS,263 * %AD_LINK_SPEED_1000MBPS,
261 * %AD_LINK_SPEED_2500MBPS,264 * %AD_LINK_SPEED_2500MBPS,
265 * %AD_LINK_SPEED_5000MBPS,
262 * %AD_LINK_SPEED_10000MBPS266 * %AD_LINK_SPEED_10000MBPS
267 * %AD_LINK_SPEED_14000MBPS,
263 * %AD_LINK_SPEED_20000MBPS268 * %AD_LINK_SPEED_20000MBPS
264 * %AD_LINK_SPEED_25000MBPS269 * %AD_LINK_SPEED_25000MBPS
265 * %AD_LINK_SPEED_40000MBPS270 * %AD_LINK_SPEED_40000MBPS
271 * %AD_LINK_SPEED_50000MBPS
266 * %AD_LINK_SPEED_56000MBPS272 * %AD_LINK_SPEED_56000MBPS
267 * %AD_LINK_SPEED_100000MBPS273 * %AD_LINK_SPEED_100000MBPS
268 */274 */
@@ -296,10 +302,18 @@ static u16 __get_link_speed(struct port *port) · 27 unmodified lines
296 speed = AD_LINK_SPEED_2500MBPS;302 speed = AD_LINK_SPEED_2500MBPS;
297 break;303 break;
298 304
305 case SPEED_5000:
306 speed = AD_LINK_SPEED_5000MBPS;
307 break;
308
299 case SPEED_10000:309 case SPEED_10000:
300 speed = AD_LINK_SPEED_10000MBPS;310 speed = AD_LINK_SPEED_10000MBPS;
301 break;311 break;
302 312
313 case SPEED_14000:
314 speed = AD_LINK_SPEED_14000MBPS;
315 break;
316
303 case SPEED_20000:317 case SPEED_20000:
304 speed = AD_LINK_SPEED_20000MBPS;318 speed = AD_LINK_SPEED_20000MBPS;
305 break;319 break;
@@ -312,6 +326,10 @@ static u16 __get_link_speed(struct port *port) · 6 unmodified lines
312 speed = AD_LINK_SPEED_40000MBPS;326 speed = AD_LINK_SPEED_40000MBPS;
313 break;327 break;
314 328
329 case SPEED_50000:
330 speed = AD_LINK_SPEED_50000MBPS;
331 break;
332
315 case SPEED_56000:333 case SPEED_56000:
316 speed = AD_LINK_SPEED_56000MBPS;334 speed = AD_LINK_SPEED_56000MBPS;
317 break;335 break;
@@ -707,9 +725,15 @@ static u32 __get_agg_bandwidth(struct aggregator *aggregator) · 389 unmodified lines
707 case AD_LINK_SPEED_2500MBPS:725 case AD_LINK_SPEED_2500MBPS:
708 bandwidth = nports * 2500;726 bandwidth = nports * 2500;
709 break;727 break;
728 case AD_LINK_SPEED_5000MBPS:
729 bandwidth = nports * 5000;
730 break;
710 case AD_LINK_SPEED_10000MBPS:731 case AD_LINK_SPEED_10000MBPS:
711 bandwidth = nports * 10000;732 bandwidth = nports * 10000;
712 break;733 break;
734 case AD_LINK_SPEED_14000MBPS:
735 bandwidth = nports * 14000;
736 break;
713 case AD_LINK_SPEED_20000MBPS:737 case AD_LINK_SPEED_20000MBPS:
714 bandwidth = nports * 20000;738 bandwidth = nports * 20000;
715 break;739 break;
@@ -719,6 +743,9 @@ static u32 __get_agg_bandwidth(struct aggregator *aggregator) · 3 unmodified lines
719 case AD_LINK_SPEED_40000MBPS:743 case AD_LINK_SPEED_40000MBPS:
720 bandwidth = nports * 40000;744 bandwidth = nports * 40000;
721 break;745 break;
746 case AD_LINK_SPEED_50000MBPS:
747 bandwidth = nports * 50000;
748 break;
722 case AD_LINK_SPEED_56000MBPS:749 case AD_LINK_SPEED_56000MBPS:
723 bandwidth = nports * 56000;750 bandwidth = nports * 56000;
724 break;751 break;
drivers/net/bonding/bond_main.c+3−3
@@ -4192,7 +4192,6 @@ static void bond_destructor(struct net_device *bond_dev) · 4191 unmodified lines
4192 struct bonding *bond = netdev_priv(bond_dev);4192 struct bonding *bond = netdev_priv(bond_dev);
4193 if (bond->wq)4193 if (bond->wq)
4194 destroy_workqueue(bond->wq);4194 destroy_workqueue(bond->wq);
4195 free_netdev(bond_dev);
4196}4195}
4197 4196
4198void bond_setup(struct net_device *bond_dev)4197void bond_setup(struct net_device *bond_dev)
@@ -4212,7 +4211,8 @@ void bond_setup(struct net_device *bond_dev) · 13 unmodified lines
4212 bond_dev->netdev_ops = &bond_netdev_ops;4211 bond_dev->netdev_ops = &bond_netdev_ops;
4213 bond_dev->ethtool_ops = &bond_ethtool_ops;4212 bond_dev->ethtool_ops = &bond_ethtool_ops;
4214 4213
4215 bond_dev->destructor = bond_destructor;4214 bond_dev->needs_free_netdev = true;
4215 bond_dev->priv_destructor = bond_destructor;
4216 4216
4217 SET_NETDEV_DEVTYPE(bond_dev, &bond_type);4217 SET_NETDEV_DEVTYPE(bond_dev, &bond_type);
4218 4218
@@ -4736,7 +4736,7 @@ int bond_create(struct net *net, const char *name) · 517 unmodified lines
4736 4736
4737 rtnl_unlock();4737 rtnl_unlock();
4738 if (res < 0)4738 if (res < 0)
4739 bond_destructor(bond_dev);4739 free_netdev(bond_dev);
4740 return res;4740 return res;
4741}4741}
4742 4742
drivers/net/caif/caif_hsi.c+1−1
@@ -1121,7 +1121,7 @@ static void cfhsi_setup(struct net_device *dev) · 1120 unmodified lines
1121 dev->flags = IFF_POINTOPOINT | IFF_NOARP;1121 dev->flags = IFF_POINTOPOINT | IFF_NOARP;
1122 dev->mtu = CFHSI_MAX_CAIF_FRAME_SZ;1122 dev->mtu = CFHSI_MAX_CAIF_FRAME_SZ;
1123 dev->priv_flags |= IFF_NO_QUEUE;1123 dev->priv_flags |= IFF_NO_QUEUE;
1124 dev->destructor = free_netdev;1124 dev->needs_free_netdev = true;
1125 dev->netdev_ops = &cfhsi_netdevops;1125 dev->netdev_ops = &cfhsi_netdevops;
1126 for (i = 0; i < CFHSI_PRIO_LAST; ++i)1126 for (i = 0; i < CFHSI_PRIO_LAST; ++i)
1127 skb_queue_head_init(&cfhsi->qhead[i]);1127 skb_queue_head_init(&cfhsi->qhead[i]);
drivers/net/caif/caif_serial.c+1−1
@@ -428,7 +428,7 @@ static void caifdev_setup(struct net_device *dev) · 427 unmodified lines
428 dev->flags = IFF_POINTOPOINT | IFF_NOARP;428 dev->flags = IFF_POINTOPOINT | IFF_NOARP;
429 dev->mtu = CAIF_MAX_MTU;429 dev->mtu = CAIF_MAX_MTU;
430 dev->priv_flags |= IFF_NO_QUEUE;430 dev->priv_flags |= IFF_NO_QUEUE;
431 dev->destructor = free_netdev;431 dev->needs_free_netdev = true;
432 skb_queue_head_init(&serdev->head);432 skb_queue_head_init(&serdev->head);
433 serdev->common.link_select = CAIF_LINK_LOW_LATENCY;433 serdev->common.link_select = CAIF_LINK_LOW_LATENCY;
434 serdev->common.use_frag = true;434 serdev->common.use_frag = true;
drivers/net/caif/caif_spi.c+1−1
@@ -712,7 +712,7 @@ static void cfspi_setup(struct net_device *dev) · 711 unmodified lines
712 dev->flags = IFF_NOARP | IFF_POINTOPOINT;712 dev->flags = IFF_NOARP | IFF_POINTOPOINT;
713 dev->priv_flags |= IFF_NO_QUEUE;713 dev->priv_flags |= IFF_NO_QUEUE;
714 dev->mtu = SPI_MAX_PAYLOAD_SIZE;714 dev->mtu = SPI_MAX_PAYLOAD_SIZE;
715 dev->destructor = free_netdev;715 dev->needs_free_netdev = true;
716 skb_queue_head_init(&cfspi->qhead);716 skb_queue_head_init(&cfspi->qhead);
717 skb_queue_head_init(&cfspi->chead);717 skb_queue_head_init(&cfspi->chead);
718 cfspi->cfdev.link_select = CAIF_LINK_HIGH_BANDW;718 cfspi->cfdev.link_select = CAIF_LINK_HIGH_BANDW;
drivers/net/caif/caif_virtio.c+1−1
@@ -617,7 +617,7 @@ static void cfv_netdev_setup(struct net_device *netdev) · 616 unmodified lines
617 netdev->tx_queue_len = 100;617 netdev->tx_queue_len = 100;
618 netdev->flags = IFF_POINTOPOINT | IFF_NOARP;618 netdev->flags = IFF_POINTOPOINT | IFF_NOARP;
619 netdev->mtu = CFV_DEF_MTU_SIZE;619 netdev->mtu = CFV_DEF_MTU_SIZE;
620 netdev->destructor = free_netdev;620 netdev->needs_free_netdev = true;
621}621}
622 622
623/* Create debugfs counters for the device */623/* Create debugfs counters for the device */
drivers/net/can/dev.c+3−0
@@ -391,6 +391,9 @@ void can_change_state(struct net_device *dev, struct can_frame *cf, · 390 unmodified lines
391 can_update_state_error_stats(dev, new_state);391 can_update_state_error_stats(dev, new_state);
392 priv->state = new_state;392 priv->state = new_state;
393 393
394 if (!cf)
395 return;
396
394 if (unlikely(new_state == CAN_STATE_BUS_OFF)) {397 if (unlikely(new_state == CAN_STATE_BUS_OFF)) {
395 cf->can_id |= CAN_ERR_BUSOFF;398 cf->can_id |= CAN_ERR_BUSOFF;
396 return;399 return;
drivers/net/can/peak_canfd/peak_canfd.c+1−1
@@ -489,7 +489,7 @@ int peak_canfd_handle_msgs_list(struct peak_canfd_priv *priv, · 488 unmodified lines
489 struct pucan_rx_msg *msg_list, int msg_count)489 struct pucan_rx_msg *msg_list, int msg_count)
490{490{
491 void *msg_ptr = msg_list;491 void *msg_ptr = msg_list;
492 int i, msg_size;492 int i, msg_size = 0;
493 493
494 for (i = 0; i < msg_count; i++) {494 for (i = 0; i < msg_count; i++) {
495 msg_size = peak_canfd_handle_msg(priv, msg_ptr);495 msg_size = peak_canfd_handle_msg(priv, msg_ptr);
drivers/net/can/slcan.c+3−4
@@ -417,7 +417,7 @@ static int slc_open(struct net_device *dev) · 416 unmodified lines
417static void slc_free_netdev(struct net_device *dev)417static void slc_free_netdev(struct net_device *dev)
418{418{
419 int i = dev->base_addr;419 int i = dev->base_addr;
420 free_netdev(dev);420
421 slcan_devs[i] = NULL;421 slcan_devs[i] = NULL;
422}422}
423 423
@@ -436,7 +436,8 @@ static const struct net_device_ops slc_netdev_ops = { · 12 unmodified lines
436static void slc_setup(struct net_device *dev)436static void slc_setup(struct net_device *dev)
437{437{
438 dev->netdev_ops = &slc_netdev_ops;438 dev->netdev_ops = &slc_netdev_ops;
439 dev->destructor = slc_free_netdev;439 dev->needs_free_netdev = true;
440 dev->priv_destructor = slc_free_netdev;
440 441
441 dev->hard_header_len = 0;442 dev->hard_header_len = 0;
442 dev->addr_len = 0;443 dev->addr_len = 0;
@@ -761,8 +762,6 @@ static void __exit slcan_exit(void) · 318 unmodified lines
761 if (sl->tty) {762 if (sl->tty) {
762 printk(KERN_ERR "%s: tty discipline still running\n",763 printk(KERN_ERR "%s: tty discipline still running\n",
763 dev->name);764 dev->name);
764 /* Intentionally leak the control block. */
765 dev->destructor = NULL;
766 }765 }
767 766
768 unregister_netdev(dev);767 unregister_netdev(dev);
drivers/net/can/usb/gs_usb.c+2−0
@@ -265,6 +265,8 @@ static int gs_cmd_reset(struct gs_usb *gsusb, struct gs_can *gsdev) · 264 unmodified lines
265 sizeof(*dm),265 sizeof(*dm),
266 1000);266 1000);
267 267
268 kfree(dm);
269
268 return rc;270 return rc;
269}271}
270 272
drivers/net/can/usb/peak_usb/pcan_usb_core.c+1−3
@@ -908,8 +908,6 @@ static int peak_usb_probe(struct usb_interface *intf, · 907 unmodified lines
908 const struct peak_usb_adapter *peak_usb_adapter = NULL;908 const struct peak_usb_adapter *peak_usb_adapter = NULL;
909 int i, err = -ENOMEM;909 int i, err = -ENOMEM;
910 910
911 usb_dev = interface_to_usbdev(intf);
912
913 /* get corresponding PCAN-USB adapter */911 /* get corresponding PCAN-USB adapter */
914 for (i = 0; i < ARRAY_SIZE(peak_usb_adapters_list); i++)912 for (i = 0; i < ARRAY_SIZE(peak_usb_adapters_list); i++)
915 if (peak_usb_adapters_list[i]->device_id == usb_id_product) {913 if (peak_usb_adapters_list[i]->device_id == usb_id_product) {
@@ -920,7 +918,7 @@ static int peak_usb_probe(struct usb_interface *intf, · 4 unmodified lines
920 if (!peak_usb_adapter) {918 if (!peak_usb_adapter) {
921 /* should never come except device_id bad usage in this file */919 /* should never come except device_id bad usage in this file */
922 pr_err("%s: didn't find device id. 0x%x in devices list\n",920 pr_err("%s: didn't find device id. 0x%x in devices list\n",
923 PCAN_USB_DRIVER_NAME, usb_dev->descriptor.idProduct);921 PCAN_USB_DRIVER_NAME, usb_id_product);
924 return -ENODEV;922 return -ENODEV;
925 }923 }
926 924
drivers/net/can/vcan.c+2−2
@@ -152,7 +152,7 @@ static const struct net_device_ops vcan_netdev_ops = { · 151 unmodified lines
152static void vcan_setup(struct net_device *dev)152static void vcan_setup(struct net_device *dev)
153{153{
154 dev->type = ARPHRD_CAN;154 dev->type = ARPHRD_CAN;
155 dev->mtu = CAN_MTU;155 dev->mtu = CANFD_MTU;
156 dev->hard_header_len = 0;156 dev->hard_header_len = 0;
157 dev->addr_len = 0;157 dev->addr_len = 0;
158 dev->tx_queue_len = 0;158 dev->tx_queue_len = 0;
@@ -163,7 +163,7 @@ static void vcan_setup(struct net_device *dev) · 4 unmodified lines
163 dev->flags |= IFF_ECHO;163 dev->flags |= IFF_ECHO;
164 164
165 dev->netdev_ops = &vcan_netdev_ops;165 dev->netdev_ops = &vcan_netdev_ops;
166 dev->destructor = free_netdev;166 dev->needs_free_netdev = true;
167}167}
168 168
169static struct rtnl_link_ops vcan_link_ops __read_mostly = {169static struct rtnl_link_ops vcan_link_ops __read_mostly = {
drivers/net/can/vxcan.c+2−2
@@ -150,13 +150,13 @@ static const struct net_device_ops vxcan_netdev_ops = { · 149 unmodified lines
150static void vxcan_setup(struct net_device *dev)150static void vxcan_setup(struct net_device *dev)
151{151{
152 dev->type = ARPHRD_CAN;152 dev->type = ARPHRD_CAN;
153 dev->mtu = CAN_MTU;153 dev->mtu = CANFD_MTU;
154 dev->hard_header_len = 0;154 dev->hard_header_len = 0;
155 dev->addr_len = 0;155 dev->addr_len = 0;
156 dev->tx_queue_len = 0;156 dev->tx_queue_len = 0;
157 dev->flags = (IFF_NOARP|IFF_ECHO);157 dev->flags = (IFF_NOARP|IFF_ECHO);
158 dev->netdev_ops = &vxcan_netdev_ops;158 dev->netdev_ops = &vxcan_netdev_ops;
159 dev->destructor = free_netdev;159 dev->needs_free_netdev = true;
160}160}
161 161
162/* forward declaration for rtnl_create_link() */162/* forward declaration for rtnl_create_link() */
drivers/net/dsa/mv88e6xxx/global2.h+3−3
@@ -114,13 +114,13 @@ static inline int mv88e6xxx_g2_set_eeprom16(struct mv88e6xxx_chip *chip, · 113 unmodified lines
114 return -EOPNOTSUPP;114 return -EOPNOTSUPP;
115}115}
116 116
117int mv88e6xxx_g2_pvt_write(struct mv88e6xxx_chip *chip, int src_dev,117static inline int mv88e6xxx_g2_pvt_write(struct mv88e6xxx_chip *chip,
118 int src_port, u16 data)118 int src_dev, int src_port, u16 data)
119{119{
120 return -EOPNOTSUPP;120 return -EOPNOTSUPP;
121}121}
122 122
123int mv88e6xxx_g2_misc_4_bit_port(struct mv88e6xxx_chip *chip)123static inline int mv88e6xxx_g2_misc_4_bit_port(struct mv88e6xxx_chip *chip)
124{124{
125 return -EOPNOTSUPP;125 return -EOPNOTSUPP;
126}126}
drivers/net/dummy.c+2−2
@@ -328,7 +328,6 @@ static void dummy_free_netdev(struct net_device *dev) · 327 unmodified lines
328 struct dummy_priv *priv = netdev_priv(dev);328 struct dummy_priv *priv = netdev_priv(dev);
329 329
330 kfree(priv->vfinfo);330 kfree(priv->vfinfo);
331 free_netdev(dev);
332}331}
333 332
334static void dummy_setup(struct net_device *dev)333static void dummy_setup(struct net_device *dev)
@@ -338,7 +337,8 @@ static void dummy_setup(struct net_device *dev) · 3 unmodified lines
338 /* Initialize the device structure. */337 /* Initialize the device structure. */
339 dev->netdev_ops = &dummy_netdev_ops;338 dev->netdev_ops = &dummy_netdev_ops;
340 dev->ethtool_ops = &dummy_ethtool_ops;339 dev->ethtool_ops = &dummy_ethtool_ops;
341 dev->destructor = dummy_free_netdev;340 dev->needs_free_netdev = true;
341 dev->priv_destructor = dummy_free_netdev;
342 342
343 /* Fill in device structure with ethernet-generic values. */343 /* Fill in device structure with ethernet-generic values. */
344 dev->flags |= IFF_NOARP;344 dev->flags |= IFF_NOARP;
drivers/net/ethernet/amazon/ena/ena_com.c+21−14
@@ -61,6 +61,8 @@ · 60 unmodified lines
61 61
62#define ENA_MMIO_READ_TIMEOUT 0xFFFFFFFF62#define ENA_MMIO_READ_TIMEOUT 0xFFFFFFFF
63 63
64#define ENA_REGS_ADMIN_INTR_MASK 1
65
64/*****************************************************************************/66/*****************************************************************************/
65/*****************************************************************************/67/*****************************************************************************/
66/*****************************************************************************/68/*****************************************************************************/
@@ -232,11 +234,9 @@ static struct ena_comp_ctx *__ena_com_submit_admin_cmd(struct ena_com_admin_queu · 165 unmodified lines
232 tail_masked = admin_queue->sq.tail & queue_size_mask;234 tail_masked = admin_queue->sq.tail & queue_size_mask;
233 235
234 /* In case of queue FULL */236 /* In case of queue FULL */
235 cnt = admin_queue->sq.tail - admin_queue->sq.head;237 cnt = atomic_read(&admin_queue->outstanding_cmds);
236 if (cnt >= admin_queue->q_depth) {238 if (cnt >= admin_queue->q_depth) {
237 pr_debug("admin queue is FULL (tail %d head %d depth: %d)\n",239 pr_debug("admin queue is full.\n");
238 admin_queue->sq.tail, admin_queue->sq.head,
239 admin_queue->q_depth);
240 admin_queue->stats.out_of_space++;240 admin_queue->stats.out_of_space++;
241 return ERR_PTR(-ENOSPC);241 return ERR_PTR(-ENOSPC);
242 }242 }
@@ -508,15 +508,20 @@ static int ena_com_comp_status_to_errno(u8 comp_status) · 265 unmodified lines
508static int ena_com_wait_and_process_admin_cq_polling(struct ena_comp_ctx *comp_ctx,508static int ena_com_wait_and_process_admin_cq_polling(struct ena_comp_ctx *comp_ctx,
509 struct ena_com_admin_queue *admin_queue)509 struct ena_com_admin_queue *admin_queue)
510{510{
511 unsigned long flags;511 unsigned long flags, timeout;
512 u32 start_time;
513 int ret;512 int ret;
514 513
515 start_time = ((u32)jiffies_to_usecs(jiffies));514 timeout = jiffies + ADMIN_CMD_TIMEOUT_US;
515
516 while (1) {
517 spin_lock_irqsave(&admin_queue->q_lock, flags);
518 ena_com_handle_admin_completion(admin_queue);
519 spin_unlock_irqrestore(&admin_queue->q_lock, flags);
520
521 if (comp_ctx->status != ENA_CMD_SUBMITTED)
522 break;
516 523
517 while (comp_ctx->status == ENA_CMD_SUBMITTED) {524 if (time_is_before_jiffies(timeout)) {
518 if ((((u32)jiffies_to_usecs(jiffies)) - start_time) >
519 ADMIN_CMD_TIMEOUT_US) {
520 pr_err("Wait for completion (polling) timeout\n");525 pr_err("Wait for completion (polling) timeout\n");
521 /* ENA didn't have any completion */526 /* ENA didn't have any completion */
522 spin_lock_irqsave(&admin_queue->q_lock, flags);527 spin_lock_irqsave(&admin_queue->q_lock, flags);
@@ -528,10 +533,6 @@ static int ena_com_wait_and_process_admin_cq_polling(struct ena_comp_ctx *comp_c · 5 unmodified lines
528 goto err;533 goto err;
529 }534 }
530 535
531 spin_lock_irqsave(&admin_queue->q_lock, flags);
532 ena_com_handle_admin_completion(admin_queue);
533 spin_unlock_irqrestore(&admin_queue->q_lock, flags);
534
535 msleep(100);536 msleep(100);
536 }537 }
537 538
@@ -1455,6 +1456,12 @@ void ena_com_admin_destroy(struct ena_com_dev *ena_dev) · 917 unmodified lines
1455 1456
1456void ena_com_set_admin_polling_mode(struct ena_com_dev *ena_dev, bool polling)1457void ena_com_set_admin_polling_mode(struct ena_com_dev *ena_dev, bool polling)
1457{1458{
1459 u32 mask_value = 0;
1460
1461 if (polling)
1462 mask_value = ENA_REGS_ADMIN_INTR_MASK;
1463
1464 writel(mask_value, ena_dev->reg_bar + ENA_REGS_INTR_MASK_OFF);
1458 ena_dev->admin_queue.polling = polling;1465 ena_dev->admin_queue.polling = polling;
1459}1466}
1460 1467
drivers/net/ethernet/amazon/ena/ena_ethtool.c+1−1
@@ -80,7 +80,6 @@ static const struct ena_stats ena_stats_tx_strings[] = { · 79 unmodified lines
80 ENA_STAT_TX_ENTRY(tx_poll),80 ENA_STAT_TX_ENTRY(tx_poll),
81 ENA_STAT_TX_ENTRY(doorbells),81 ENA_STAT_TX_ENTRY(doorbells),
82 ENA_STAT_TX_ENTRY(prepare_ctx_err),82 ENA_STAT_TX_ENTRY(prepare_ctx_err),
83 ENA_STAT_TX_ENTRY(missing_tx_comp),
84 ENA_STAT_TX_ENTRY(bad_req_id),83 ENA_STAT_TX_ENTRY(bad_req_id),
85};84};
86 85
@@ -94,6 +93,7 @@ static const struct ena_stats ena_stats_rx_strings[] = { · 7 unmodified lines
94 ENA_STAT_RX_ENTRY(dma_mapping_err),93 ENA_STAT_RX_ENTRY(dma_mapping_err),
95 ENA_STAT_RX_ENTRY(bad_desc_num),94 ENA_STAT_RX_ENTRY(bad_desc_num),
96 ENA_STAT_RX_ENTRY(rx_copybreak_pkt),95 ENA_STAT_RX_ENTRY(rx_copybreak_pkt),
96 ENA_STAT_RX_ENTRY(empty_rx_ring),
97};97};
98 98
99static const struct ena_stats ena_stats_ena_com_strings[] = {99static const struct ena_stats ena_stats_ena_com_strings[] = {
drivers/net/ethernet/amazon/ena/ena_netdev.c+132−47
@@ -190,6 +190,7 @@ static void ena_init_io_rings(struct ena_adapter *adapter) · 189 unmodified lines
190 rxr->sgl_size = adapter->max_rx_sgl_size;190 rxr->sgl_size = adapter->max_rx_sgl_size;
191 rxr->smoothed_interval =191 rxr->smoothed_interval =
192 ena_com_get_nonadaptive_moderation_interval_rx(ena_dev);192 ena_com_get_nonadaptive_moderation_interval_rx(ena_dev);
193 rxr->empty_rx_queue = 0;
193 }194 }
194}195}
195 196
@@ -1078,6 +1079,26 @@ inline void ena_adjust_intr_moderation(struct ena_ring *rx_ring, · 882 unmodified lines
1078 rx_ring->per_napi_bytes = 0;1079 rx_ring->per_napi_bytes = 0;
1079}1080}
1080 1081
1082static inline void ena_unmask_interrupt(struct ena_ring *tx_ring,
1083 struct ena_ring *rx_ring)
1084{
1085 struct ena_eth_io_intr_reg intr_reg;
1086
1087 /* Update intr register: rx intr delay,
1088 * tx intr delay and interrupt unmask
1089 */
1090 ena_com_update_intr_reg(&intr_reg,
1091 rx_ring->smoothed_interval,
1092 tx_ring->smoothed_interval,
1093 true);
1094
1095 /* It is a shared MSI-X.
1096 * Tx and Rx CQ have pointer to it.
1097 * So we use one of them to reach the intr reg
1098 */
1099 ena_com_unmask_intr(rx_ring->ena_com_io_cq, &intr_reg);
1100}
1101
1081static inline void ena_update_ring_numa_node(struct ena_ring *tx_ring,1102static inline void ena_update_ring_numa_node(struct ena_ring *tx_ring,
1082 struct ena_ring *rx_ring)1103 struct ena_ring *rx_ring)
1083{1104{
@@ -1108,7 +1129,6 @@ static int ena_io_poll(struct napi_struct *napi, int budget) · 24 unmodified lines
1108{1129{
1109 struct ena_napi *ena_napi = container_of(napi, struct ena_napi, napi);1130 struct ena_napi *ena_napi = container_of(napi, struct ena_napi, napi);
1110 struct ena_ring *tx_ring, *rx_ring;1131 struct ena_ring *tx_ring, *rx_ring;
1111 struct ena_eth_io_intr_reg intr_reg;
1112 1132
1113 u32 tx_work_done;1133 u32 tx_work_done;
1114 u32 rx_work_done;1134 u32 rx_work_done;
@@ -1149,22 +1169,9 @@ static int ena_io_poll(struct napi_struct *napi, int budget) · 34 unmodified lines
1149 if (ena_com_get_adaptive_moderation_enabled(rx_ring->ena_dev))1169 if (ena_com_get_adaptive_moderation_enabled(rx_ring->ena_dev))
1150 ena_adjust_intr_moderation(rx_ring, tx_ring);1170 ena_adjust_intr_moderation(rx_ring, tx_ring);
1151 1171
1152 /* Update intr register: rx intr delay,1172 ena_unmask_interrupt(tx_ring, rx_ring);
1153 * tx intr delay and interrupt unmask
1154 */
1155 ena_com_update_intr_reg(&intr_reg,
1156 rx_ring->smoothed_interval,
1157 tx_ring->smoothed_interval,
1158 true);
1159
1160 /* It is a shared MSI-X.
1161 * Tx and Rx CQ have pointer to it.
1162 * So we use one of them to reach the intr reg
1163 */
1164 ena_com_unmask_intr(rx_ring->ena_com_io_cq, &intr_reg);
1165 }1173 }
1166 1174
1167
1168 ena_update_ring_numa_node(tx_ring, rx_ring);1175 ena_update_ring_numa_node(tx_ring, rx_ring);
1169 1176
1170 ret = rx_work_done;1177 ret = rx_work_done;
@@ -1485,6 +1492,11 @@ static int ena_up_complete(struct ena_adapter *adapter) · 314 unmodified lines
1485 1492
1486 ena_napi_enable_all(adapter);1493 ena_napi_enable_all(adapter);
1487 1494
1495 /* Enable completion queues interrupt */
1496 for (i = 0; i < adapter->num_queues; i++)
1497 ena_unmask_interrupt(&adapter->tx_ring[i],
1498 &adapter->rx_ring[i]);
1499
1488 /* schedule napi in case we had pending packets1500 /* schedule napi in case we had pending packets
1489 * from the last time we disable napi1501 * from the last time we disable napi
1490 */1502 */
@@ -1532,6 +1544,7 @@ static int ena_create_io_tx_queue(struct ena_adapter *adapter, int qid) · 41 unmodified lines
1532 "Failed to get TX queue handlers. TX queue num %d rc: %d\n",1544 "Failed to get TX queue handlers. TX queue num %d rc: %d\n",
1533 qid, rc);1545 qid, rc);
1534 ena_com_destroy_io_queue(ena_dev, ena_qid);1546 ena_com_destroy_io_queue(ena_dev, ena_qid);
1547 return rc;
1535 }1548 }
1536 1549
1537 ena_com_update_numa_node(tx_ring->ena_com_io_cq, ctx.numa_node);1550 ena_com_update_numa_node(tx_ring->ena_com_io_cq, ctx.numa_node);
@@ -1596,6 +1609,7 @@ static int ena_create_io_rx_queue(struct ena_adapter *adapter, int qid) · 58 unmodified lines
1596 "Failed to get RX queue handlers. RX queue num %d rc: %d\n",1609 "Failed to get RX queue handlers. RX queue num %d rc: %d\n",
1597 qid, rc);1610 qid, rc);
1598 ena_com_destroy_io_queue(ena_dev, ena_qid);1611 ena_com_destroy_io_queue(ena_dev, ena_qid);
1612 return rc;
1599 }1613 }
1600 1614
1601 ena_com_update_numa_node(rx_ring->ena_com_io_cq, ctx.numa_node);1615 ena_com_update_numa_node(rx_ring->ena_com_io_cq, ctx.numa_node);
@@ -1981,6 +1995,7 @@ static netdev_tx_t ena_start_xmit(struct sk_buff *skb, struct net_device *dev) · 379 unmodified lines
1981 1995
1982 tx_info->tx_descs = nb_hw_desc;1996 tx_info->tx_descs = nb_hw_desc;
1983 tx_info->last_jiffies = jiffies;1997 tx_info->last_jiffies = jiffies;
1998 tx_info->print_once = 0;
1984 1999
1985 tx_ring->next_to_use = ENA_TX_RING_IDX_NEXT(next_to_use,2000 tx_ring->next_to_use = ENA_TX_RING_IDX_NEXT(next_to_use,
1986 tx_ring->ring_size);2001 tx_ring->ring_size);
@@ -2550,13 +2565,44 @@ err: · 563 unmodified lines
2550 "Reset attempt failed. Can not reset the device\n");2565 "Reset attempt failed. Can not reset the device\n");
2551}2566}
2552 2567
2553static void check_for_missing_tx_completions(struct ena_adapter *adapter)2568static int check_missing_comp_in_queue(struct ena_adapter *adapter,
2569 struct ena_ring *tx_ring)
2554{2570{
2555 struct ena_tx_buffer *tx_buf;2571 struct ena_tx_buffer *tx_buf;
2556 unsigned long last_jiffies;2572 unsigned long last_jiffies;
2573 u32 missed_tx = 0;
2574 int i;
2575
2576 for (i = 0; i < tx_ring->ring_size; i++) {
2577 tx_buf = &tx_ring->tx_buffer_info[i];
2578 last_jiffies = tx_buf->last_jiffies;
2579 if (unlikely(last_jiffies &&
2580 time_is_before_jiffies(last_jiffies + TX_TIMEOUT))) {
2581 if (!tx_buf->print_once)
2582 netif_notice(adapter, tx_err, adapter->netdev,
2583 "Found a Tx that wasn't completed on time, qid %d, index %d.\n",
2584 tx_ring->qid, i);
2585
2586 tx_buf->print_once = 1;
2587 missed_tx++;
2588
2589 if (unlikely(missed_tx > MAX_NUM_OF_TIMEOUTED_PACKETS)) {
2590 netif_err(adapter, tx_err, adapter->netdev,
2591 "The number of lost tx completions is above the threshold (%d > %d). Reset the device\n",
2592 missed_tx, MAX_NUM_OF_TIMEOUTED_PACKETS);
2593 set_bit(ENA_FLAG_TRIGGER_RESET, &adapter->flags);
2594 return -EIO;
2595 }
2596 }
2597 }
2598
2599 return 0;
2600}
2601
2602static void check_for_missing_tx_completions(struct ena_adapter *adapter)
2603{
2557 struct ena_ring *tx_ring;2604 struct ena_ring *tx_ring;
2558 int i, j, budget;2605 int i, budget, rc;
2559 u32 missed_tx;
2560 2606
2561 /* Make sure the driver doesn't turn the device in other process */2607 /* Make sure the driver doesn't turn the device in other process */
2562 smp_rmb();2608 smp_rmb();
@@ -2572,31 +2618,9 @@ static void check_for_missing_tx_completions(struct ena_adapter *adapter) · 9 unmodified lines
2572 for (i = adapter->last_monitored_tx_qid; i < adapter->num_queues; i++) {2618 for (i = adapter->last_monitored_tx_qid; i < adapter->num_queues; i++) {
2573 tx_ring = &adapter->tx_ring[i];2619 tx_ring = &adapter->tx_ring[i];
2574 2620
2575 for (j = 0; j < tx_ring->ring_size; j++) {2621 rc = check_missing_comp_in_queue(adapter, tx_ring);
2576 tx_buf = &tx_ring->tx_buffer_info[j];2622 if (unlikely(rc))
2577 last_jiffies = tx_buf->last_jiffies;2623 return;
2578 if (unlikely(last_jiffies && time_is_before_jiffies(last_jiffies + TX_TIMEOUT))) {
2579 netif_notice(adapter, tx_err, adapter->netdev,
2580 "Found a Tx that wasn't completed on time, qid %d, index %d.\n",
2581 tx_ring->qid, j);
2582
2583 u64_stats_update_begin(&tx_ring->syncp);
2584 missed_tx = tx_ring->tx_stats.missing_tx_comp++;
2585 u64_stats_update_end(&tx_ring->syncp);
2586
2587 /* Clear last jiffies so the lost buffer won't
2588 * be counted twice.
2589 */
2590 tx_buf->last_jiffies = 0;
2591
2592 if (unlikely(missed_tx > MAX_NUM_OF_TIMEOUTED_PACKETS)) {
2593 netif_err(adapter, tx_err, adapter->netdev,
2594 "The number of lost tx completion is above the threshold (%d > %d). Reset the device\n",
2595 missed_tx, MAX_NUM_OF_TIMEOUTED_PACKETS);
2596 set_bit(ENA_FLAG_TRIGGER_RESET, &adapter->flags);
2597 }
2598 }
2599 }
2600 2624
2601 budget--;2625 budget--;
2602 if (!budget)2626 if (!budget)
@@ -2606,6 +2630,58 @@ static void check_for_missing_tx_completions(struct ena_adapter *adapter) · 3 unmodified lines
2606 adapter->last_monitored_tx_qid = i % adapter->num_queues;2630 adapter->last_monitored_tx_qid = i % adapter->num_queues;
2607}2631}
2608 2632
2633/* trigger napi schedule after 2 consecutive detections */
2634#define EMPTY_RX_REFILL 2
2635/* For the rare case where the device runs out of Rx descriptors and the
2636 * napi handler failed to refill new Rx descriptors (due to a lack of memory
2637 * for example).
2638 * This case will lead to a deadlock:
2639 * The device won't send interrupts since all the new Rx packets will be dropped
2640 * The napi handler won't allocate new Rx descriptors so the device will be
2641 * able to send new packets.
2642 *
2643 * This scenario can happen when the kernel's vm.min_free_kbytes is too small.
2644 * It is recommended to have at least 512MB, with a minimum of 128MB for
2645 * constrained environment).
2646 *
2647 * When such a situation is detected - Reschedule napi
2648 */
2649static void check_for_empty_rx_ring(struct ena_adapter *adapter)
2650{
2651 struct ena_ring *rx_ring;
2652 int i, refill_required;
2653
2654 if (!test_bit(ENA_FLAG_DEV_UP, &adapter->flags))
2655 return;
2656
2657 if (test_bit(ENA_FLAG_TRIGGER_RESET, &adapter->flags))
2658 return;
2659
2660 for (i = 0; i < adapter->num_queues; i++) {
2661 rx_ring = &adapter->rx_ring[i];
2662
2663 refill_required =
2664 ena_com_sq_empty_space(rx_ring->ena_com_io_sq);
2665 if (unlikely(refill_required == (rx_ring->ring_size - 1))) {
2666 rx_ring->empty_rx_queue++;
2667
2668 if (rx_ring->empty_rx_queue >= EMPTY_RX_REFILL) {
2669 u64_stats_update_begin(&rx_ring->syncp);
2670 rx_ring->rx_stats.empty_rx_ring++;
2671 u64_stats_update_end(&rx_ring->syncp);
2672
2673 netif_err(adapter, drv, adapter->netdev,
2674 "trigger refill for ring %d\n", i);
2675
2676 napi_schedule(rx_ring->napi);
2677 rx_ring->empty_rx_queue = 0;
2678 }
2679 } else {
2680 rx_ring->empty_rx_queue = 0;
2681 }
2682 }
2683}
2684
2609/* Check for keep alive expiration */2685/* Check for keep alive expiration */
2610static void check_for_missing_keep_alive(struct ena_adapter *adapter)2686static void check_for_missing_keep_alive(struct ena_adapter *adapter)
2611{2687{
@@ -2660,6 +2736,8 @@ static void ena_timer_service(unsigned long data) · 48 unmodified lines
2660 2736
2661 check_for_missing_tx_completions(adapter);2737 check_for_missing_tx_completions(adapter);
2662 2738
2739 check_for_empty_rx_ring(adapter);
2740
2663 if (debug_area)2741 if (debug_area)
2664 ena_dump_stats_to_buf(adapter, debug_area);2742 ena_dump_stats_to_buf(adapter, debug_area);
2665 2743
@@ -2840,6 +2918,11 @@ static void ena_release_bars(struct ena_com_dev *ena_dev, struct pci_dev *pdev) · 174 unmodified lines
2840{2918{
2841 int release_bars;2919 int release_bars;
2842 2920
2921 if (ena_dev->mem_bar)
2922 devm_iounmap(&pdev->dev, ena_dev->mem_bar);
2923
2924 devm_iounmap(&pdev->dev, ena_dev->reg_bar);
2925
2843 release_bars = pci_select_bars(pdev, IORESOURCE_MEM) & ENA_BAR_MASK;2926 release_bars = pci_select_bars(pdev, IORESOURCE_MEM) & ENA_BAR_MASK;
2844 pci_release_selected_regions(pdev, release_bars);2927 pci_release_selected_regions(pdev, release_bars);
2845}2928}
@@ -2927,8 +3010,9 @@ static int ena_probe(struct pci_dev *pdev, const struct pci_device_id *ent) · 81 unmodified lines
2927 goto err_free_ena_dev;3010 goto err_free_ena_dev;
2928 }3011 }
2929 3012
2930 ena_dev->reg_bar = ioremap(pci_resource_start(pdev, ENA_REG_BAR),3013 ena_dev->reg_bar = devm_ioremap(&pdev->dev,
2931 pci_resource_len(pdev, ENA_REG_BAR));3014 pci_resource_start(pdev, ENA_REG_BAR),
3015 pci_resource_len(pdev, ENA_REG_BAR));
2932 if (!ena_dev->reg_bar) {3016 if (!ena_dev->reg_bar) {
2933 dev_err(&pdev->dev, "failed to remap regs bar\n");3017 dev_err(&pdev->dev, "failed to remap regs bar\n");
2934 rc = -EFAULT;3018 rc = -EFAULT;
@@ -2948,8 +3032,9 @@ static int ena_probe(struct pci_dev *pdev, const struct pci_device_id *ent) · 13 unmodified lines
2948 ena_set_push_mode(pdev, ena_dev, &get_feat_ctx);3032 ena_set_push_mode(pdev, ena_dev, &get_feat_ctx);
2949 3033
2950 if (ena_dev->tx_mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_DEV) {3034 if (ena_dev->tx_mem_queue_type == ENA_ADMIN_PLACEMENT_POLICY_DEV) {
2951 ena_dev->mem_bar = ioremap_wc(pci_resource_start(pdev, ENA_MEM_BAR),3035 ena_dev->mem_bar = devm_ioremap_wc(&pdev->dev,
2952 pci_resource_len(pdev, ENA_MEM_BAR));3036 pci_resource_start(pdev, ENA_MEM_BAR),
3037 pci_resource_len(pdev, ENA_MEM_BAR));
2953 if (!ena_dev->mem_bar) {3038 if (!ena_dev->mem_bar) {
2954 rc = -EFAULT;3039 rc = -EFAULT;
2955 goto err_device_destroy;3040 goto err_device_destroy;
drivers/net/ethernet/amazon/ena/ena_netdev.h+15−3
@@ -45,7 +45,7 @@ · 44 unmodified lines
45 45
46#define DRV_MODULE_VER_MAJOR 146#define DRV_MODULE_VER_MAJOR 1
47#define DRV_MODULE_VER_MINOR 147#define DRV_MODULE_VER_MINOR 1
48#define DRV_MODULE_VER_SUBMINOR 248#define DRV_MODULE_VER_SUBMINOR 7
49 49
50#define DRV_MODULE_NAME "ena"50#define DRV_MODULE_NAME "ena"
51#ifndef DRV_MODULE_VERSION51#ifndef DRV_MODULE_VERSION
@@ -146,7 +146,18 @@ struct ena_tx_buffer { · 94 unmodified lines
146 u32 tx_descs;146 u32 tx_descs;
147 /* num of buffers used by this skb */147 /* num of buffers used by this skb */
148 u32 num_of_bufs;148 u32 num_of_bufs;
149 /* Save the last jiffies to detect missing tx packets */149
150 /* Used for detect missing tx packets to limit the number of prints */
151 u32 print_once;
152 /* Save the last jiffies to detect missing tx packets
153 *
154 * sets to non zero value on ena_start_xmit and set to zero on
155 * napi and timer_Service_routine.
156 *
157 * while this value is not protected by lock,
158 * a given packet is not expected to be handled by ena_start_xmit
159 * and by napi/timer_service at the same time.
160 */
150 unsigned long last_jiffies;161 unsigned long last_jiffies;
151 struct ena_com_buf bufs[ENA_PKT_MAX_BUFS];162 struct ena_com_buf bufs[ENA_PKT_MAX_BUFS];
152} ____cacheline_aligned;163} ____cacheline_aligned;
@@ -170,7 +181,6 @@ struct ena_stats_tx { · 17 unmodified lines
170 u64 napi_comp;181 u64 napi_comp;
171 u64 tx_poll;182 u64 tx_poll;
172 u64 doorbells;183 u64 doorbells;
173 u64 missing_tx_comp;
174 u64 bad_req_id;184 u64 bad_req_id;
175};185};
176 186
@@ -184,6 +194,7 @@ struct ena_stats_rx { · 7 unmodified lines
184 u64 dma_mapping_err;194 u64 dma_mapping_err;
185 u64 bad_desc_num;195 u64 bad_desc_num;
186 u64 rx_copybreak_pkt;196 u64 rx_copybreak_pkt;
197 u64 empty_rx_ring;
187};198};
188 199
189struct ena_ring {200struct ena_ring {
@@ -231,6 +242,7 @@ struct ena_ring { · 41 unmodified lines
231 struct ena_stats_tx tx_stats;242 struct ena_stats_tx tx_stats;
232 struct ena_stats_rx rx_stats;243 struct ena_stats_rx rx_stats;
233 };244 };
245 int empty_rx_queue;
234} ____cacheline_aligned;246} ____cacheline_aligned;
235 247
236struct ena_stats_dev {248struct ena_stats_dev {
drivers/net/ethernet/amd/xgbe/xgbe-desc.c+2−3
@@ -324,7 +324,7 @@ static int xgbe_map_rx_buffer(struct xgbe_prv_data *pdata, · 323 unmodified lines
324 struct xgbe_ring *ring,324 struct xgbe_ring *ring,
325 struct xgbe_ring_data *rdata)325 struct xgbe_ring_data *rdata)
326{326{
327 int order, ret;327 int ret;
328 328
329 if (!ring->rx_hdr_pa.pages) {329 if (!ring->rx_hdr_pa.pages) {
330 ret = xgbe_alloc_pages(pdata, &ring->rx_hdr_pa, GFP_ATOMIC, 0);330 ret = xgbe_alloc_pages(pdata, &ring->rx_hdr_pa, GFP_ATOMIC, 0);
@@ -333,9 +333,8 @@ static int xgbe_map_rx_buffer(struct xgbe_prv_data *pdata, · 2 unmodified lines
333 }333 }
334 334
335 if (!ring->rx_buf_pa.pages) {335 if (!ring->rx_buf_pa.pages) {
336 order = max_t(int, PAGE_ALLOC_COSTLY_ORDER - 1, 0);
337 ret = xgbe_alloc_pages(pdata, &ring->rx_buf_pa, GFP_ATOMIC,336 ret = xgbe_alloc_pages(pdata, &ring->rx_buf_pa, GFP_ATOMIC,
338 order);337 PAGE_ALLOC_COSTLY_ORDER);
339 if (ret)338 if (ret)
340 return ret;339 return ret;
341 }340 }
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_utils.h+0−3
@@ -193,9 +193,6 @@ int hw_atl_utils_hw_get_regs(struct aq_hw_s *self, · 192 unmodified lines
193 struct aq_hw_caps_s *aq_hw_caps,193 struct aq_hw_caps_s *aq_hw_caps,
194 u32 *regs_buff);194 u32 *regs_buff);
195 195
196int hw_atl_utils_hw_get_settings(struct aq_hw_s *self,
197 struct ethtool_cmd *cmd);
198
199int hw_atl_utils_hw_set_power(struct aq_hw_s *self,196int hw_atl_utils_hw_set_power(struct aq_hw_s *self,
200 unsigned int power_state);197 unsigned int power_state);
201 198
drivers/net/ethernet/broadcom/bcmsysport.c+5−2
@@ -2026,9 +2026,12 @@ static int bcm_sysport_probe(struct platform_device *pdev) · 2025 unmodified lines
2026 priv->num_rx_desc_words = params->num_rx_desc_words;2026 priv->num_rx_desc_words = params->num_rx_desc_words;
2027 2027
2028 priv->irq0 = platform_get_irq(pdev, 0);2028 priv->irq0 = platform_get_irq(pdev, 0);
2029 if (!priv->is_lite)2029 if (!priv->is_lite) {
2030 priv->irq1 = platform_get_irq(pdev, 1);2030 priv->irq1 = platform_get_irq(pdev, 1);
2031 priv->wol_irq = platform_get_irq(pdev, 2);2031 priv->wol_irq = platform_get_irq(pdev, 2);
2032 } else {
2033 priv->wol_irq = platform_get_irq(pdev, 1);
2034 }
2032 if (priv->irq0 <= 0 || (priv->irq1 <= 0 && !priv->is_lite)) {2035 if (priv->irq0 <= 0 || (priv->irq1 <= 0 && !priv->is_lite)) {
2033 dev_err(&pdev->dev, "invalid interrupts\n");2036 dev_err(&pdev->dev, "invalid interrupts\n");
2034 ret = -EINVAL;2037 ret = -EINVAL;
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c+16−5
@@ -1926,7 +1926,7 @@ u16 bnx2x_select_queue(struct net_device *dev, struct sk_buff *skb, · 1925 unmodified lines
1926 }1926 }
1927 1927
1928 /* select a non-FCoE queue */1928 /* select a non-FCoE queue */
1929 return fallback(dev, skb) % BNX2X_NUM_ETH_QUEUES(bp);1929 return fallback(dev, skb) % (BNX2X_NUM_ETH_QUEUES(bp) * bp->max_cos);
1930}1930}
1931 1931
1932void bnx2x_set_num_queues(struct bnx2x *bp)1932void bnx2x_set_num_queues(struct bnx2x *bp)
@@ -3883,15 +3883,26 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev) · 1950 unmodified lines
3883 /* when transmitting in a vf, start bd must hold the ethertype3883 /* when transmitting in a vf, start bd must hold the ethertype
3884 * for fw to enforce it3884 * for fw to enforce it
3885 */3885 */
3886 u16 vlan_tci = 0;
3886#ifndef BNX2X_STOP_ON_ERROR3887#ifndef BNX2X_STOP_ON_ERROR
3887 if (IS_VF(bp))3888 if (IS_VF(bp)) {
3888#endif3889#endif
3889 tx_start_bd->vlan_or_ethertype =3890 /* Still need to consider inband vlan for enforced */
3890 cpu_to_le16(ntohs(eth->h_proto));3891 if (__vlan_get_tag(skb, &vlan_tci)) {
3892 tx_start_bd->vlan_or_ethertype =
3893 cpu_to_le16(ntohs(eth->h_proto));
3894 } else {
3895 tx_start_bd->bd_flags.as_bitfield |=
3896 (X_ETH_INBAND_VLAN <<
3897 ETH_TX_BD_FLAGS_VLAN_MODE_SHIFT);
3898 tx_start_bd->vlan_or_ethertype =
3899 cpu_to_le16(vlan_tci);
3900 }
3891#ifndef BNX2X_STOP_ON_ERROR3901#ifndef BNX2X_STOP_ON_ERROR
3892 else3902 } else {
3893 /* used by FW for packet accounting */3903 /* used by FW for packet accounting */
3894 tx_start_bd->vlan_or_ethertype = cpu_to_le16(pkt_prod);3904 tx_start_bd->vlan_or_ethertype = cpu_to_le16(pkt_prod);
3905 }
3895#endif3906#endif
3896 }3907 }
3897 3908
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c+13−2
@@ -901,6 +901,8 @@ static void bnx2x_vf_flr(struct bnx2x *bp, struct bnx2x_virtf *vf) · 900 unmodified lines
901 /* release VF resources */901 /* release VF resources */
902 bnx2x_vf_free_resc(bp, vf);902 bnx2x_vf_free_resc(bp, vf);
903 903
904 vf->malicious = false;
905
904 /* re-open the mailbox */906 /* re-open the mailbox */
905 bnx2x_vf_enable_mbx(bp, vf->abs_vfid);907 bnx2x_vf_enable_mbx(bp, vf->abs_vfid);
906 return;908 return;
@@ -1822,9 +1824,11 @@ get_vf: · 915 unmodified lines
1822 vf->abs_vfid, qidx);1824 vf->abs_vfid, qidx);
1823 bnx2x_vf_handle_rss_update_eqe(bp, vf);1825 bnx2x_vf_handle_rss_update_eqe(bp, vf);
1824 case EVENT_RING_OPCODE_VF_FLR:1826 case EVENT_RING_OPCODE_VF_FLR:
1825 case EVENT_RING_OPCODE_MALICIOUS_VF:
1826 /* Do nothing for now */1827 /* Do nothing for now */
1827 return 0;1828 return 0;
1829 case EVENT_RING_OPCODE_MALICIOUS_VF:
1830 vf->malicious = true;
1831 return 0;
1828 }1832 }
1829 1833
1830 return 0;1834 return 0;
@@ -1905,6 +1909,13 @@ void bnx2x_iov_adjust_stats_req(struct bnx2x *bp) · 74 unmodified lines
1905 continue;1909 continue;
1906 }1910 }
1907 1911
1912 if (vf->malicious) {
1913 DP_AND((BNX2X_MSG_IOV | BNX2X_MSG_STATS),
1914 "vf %d malicious so no stats for it\n",
1915 vf->abs_vfid);
1916 continue;
1917 }
1918
1908 DP_AND((BNX2X_MSG_IOV | BNX2X_MSG_STATS),1919 DP_AND((BNX2X_MSG_IOV | BNX2X_MSG_STATS),
1909 "add addresses for vf %d\n", vf->abs_vfid);1920 "add addresses for vf %d\n", vf->abs_vfid);
1910 for_each_vfq(vf, j) {1921 for_each_vfq(vf, j) {
@@ -3042,7 +3053,7 @@ void bnx2x_vf_pci_dealloc(struct bnx2x *bp) · 1131 unmodified lines
3042{3053{
3043 BNX2X_PCI_FREE(bp->vf2pf_mbox, bp->vf2pf_mbox_mapping,3054 BNX2X_PCI_FREE(bp->vf2pf_mbox, bp->vf2pf_mbox_mapping,
3044 sizeof(struct bnx2x_vf_mbx_msg));3055 sizeof(struct bnx2x_vf_mbx_msg));
3045 BNX2X_PCI_FREE(bp->vf2pf_mbox, bp->pf2vf_bulletin_mapping,3056 BNX2X_PCI_FREE(bp->pf2vf_bulletin, bp->pf2vf_bulletin_mapping,
3046 sizeof(union pf_vf_bulletin));3057 sizeof(union pf_vf_bulletin));
3047}3058}
3048 3059
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h+1−0
@@ -141,6 +141,7 @@ struct bnx2x_virtf { · 140 unmodified lines
141#define VF_RESET 3 /* VF FLR'd, pending cleanup */141#define VF_RESET 3 /* VF FLR'd, pending cleanup */
142 142
143 bool flr_clnup_stage; /* true during flr cleanup */143 bool flr_clnup_stage; /* true during flr cleanup */
144 bool malicious; /* true if FW indicated so, until FLR */
144 145
145 /* dma */146 /* dma */
146 dma_addr_t fw_stat_map;147 dma_addr_t fw_stat_map;
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c+18−9
@@ -2196,10 +2196,14 @@ static int cxgb_up(struct adapter *adap) · 2195 unmodified lines
2196 if (err)2196 if (err)
2197 goto irq_err;2197 goto irq_err;
2198 }2198 }
2199
2200 mutex_lock(&uld_mutex);
2199 enable_rx(adap);2201 enable_rx(adap);
2200 t4_sge_start(adap);2202 t4_sge_start(adap);
2201 t4_intr_enable(adap);2203 t4_intr_enable(adap);
2202 adap->flags |= FULL_INIT_DONE;2204 adap->flags |= FULL_INIT_DONE;
2205 mutex_unlock(&uld_mutex);
2206
2203 notify_ulds(adap, CXGB4_STATE_UP);2207 notify_ulds(adap, CXGB4_STATE_UP);
2204#if IS_ENABLED(CONFIG_IPV6)2208#if IS_ENABLED(CONFIG_IPV6)
2205 update_clip(adap);2209 update_clip(adap);
@@ -2771,6 +2775,9 @@ void t4_fatal_err(struct adapter *adap) · 565 unmodified lines
2771{2775{
2772 int port;2776 int port;
2773 2777
2778 if (pci_channel_offline(adap->pdev))
2779 return;
2780
2774 /* Disable the SGE since ULDs are going to free resources that2781 /* Disable the SGE since ULDs are going to free resources that
2775 * could be exposed to the adapter. RDMA MWs for example...2782 * could be exposed to the adapter. RDMA MWs for example...
2776 */2783 */
@@ -3882,9 +3889,10 @@ static pci_ers_result_t eeh_err_detected(struct pci_dev *pdev, · 1105 unmodified lines
3882 spin_lock(&adap->stats_lock);3889 spin_lock(&adap->stats_lock);
3883 for_each_port(adap, i) {3890 for_each_port(adap, i) {
3884 struct net_device *dev = adap->port[i];3891 struct net_device *dev = adap->port[i];
3885 3892 if (dev) {
3886 netif_device_detach(dev);3893 netif_device_detach(dev);
3887 netif_carrier_off(dev);3894 netif_carrier_off(dev);
3895 }
3888 }3896 }
3889 spin_unlock(&adap->stats_lock);3897 spin_unlock(&adap->stats_lock);
3890 disable_interrupts(adap);3898 disable_interrupts(adap);
@@ -3963,12 +3971,13 @@ static void eeh_resume(struct pci_dev *pdev) · 72 unmodified lines
3963 rtnl_lock();3971 rtnl_lock();
3964 for_each_port(adap, i) {3972 for_each_port(adap, i) {
3965 struct net_device *dev = adap->port[i];3973 struct net_device *dev = adap->port[i];
3966 3974 if (dev) {
3967 if (netif_running(dev)) {3975 if (netif_running(dev)) {
3968 link_start(dev);3976 link_start(dev);
3969 cxgb_set_rxmode(dev);3977 cxgb_set_rxmode(dev);
3978 }
3979 netif_device_attach(dev);
3970 }3980 }
3971 netif_device_attach(dev);
3972 }3981 }
3973 rtnl_unlock();3982 rtnl_unlock();
3974}3983}
@@ -4516,7 +4525,7 @@ static void dummy_setup(struct net_device *dev) · 541 unmodified lines
4516 /* Initialize the device structure. */4525 /* Initialize the device structure. */
4517 dev->netdev_ops = &cxgb4_mgmt_netdev_ops;4526 dev->netdev_ops = &cxgb4_mgmt_netdev_ops;
4518 dev->ethtool_ops = &cxgb4_mgmt_ethtool_ops;4527 dev->ethtool_ops = &cxgb4_mgmt_ethtool_ops;
4519 dev->destructor = free_netdev;4528 dev->needs_free_netdev = true;
4520}4529}
4521 4530
4522static int config_mgmt_dev(struct pci_dev *pdev)4531static int config_mgmt_dev(struct pci_dev *pdev)
drivers/net/ethernet/chelsio/cxgb4/t4_hw.c+7−2
@@ -4557,8 +4557,13 @@ void t4_intr_enable(struct adapter *adapter) · 4556 unmodified lines
4557 */4557 */
4558void t4_intr_disable(struct adapter *adapter)4558void t4_intr_disable(struct adapter *adapter)
4559{4559{
4560 u32 whoami = t4_read_reg(adapter, PL_WHOAMI_A);4560 u32 whoami, pf;
4561 u32 pf = CHELSIO_CHIP_VERSION(adapter->params.chip) <= CHELSIO_T5 ?4561
4562 if (pci_channel_offline(adapter->pdev))
4563 return;
4564
4565 whoami = t4_read_reg(adapter, PL_WHOAMI_A);
4566 pf = CHELSIO_CHIP_VERSION(adapter->params.chip) <= CHELSIO_T5 ?
4562 SOURCEPF_G(whoami) : T6_SOURCEPF_G(whoami);4567 SOURCEPF_G(whoami) : T6_SOURCEPF_G(whoami);
4563 4568
4564 t4_write_reg(adapter, MYPF_REG(PL_PF_INT_ENABLE_A), 0);4569 t4_write_reg(adapter, MYPF_REG(PL_PF_INT_ENABLE_A), 0);
drivers/net/ethernet/chelsio/cxgb4/t4fw_version.h+3−3
@@ -37,7 +37,7 @@ · 36 unmodified lines
37 37
38#define T4FW_VERSION_MAJOR 0x0138#define T4FW_VERSION_MAJOR 0x01
39#define T4FW_VERSION_MINOR 0x1039#define T4FW_VERSION_MINOR 0x10
40#define T4FW_VERSION_MICRO 0x2B40#define T4FW_VERSION_MICRO 0x2D
41#define T4FW_VERSION_BUILD 0x0041#define T4FW_VERSION_BUILD 0x00
42 42
43#define T4FW_MIN_VERSION_MAJOR 0x0143#define T4FW_MIN_VERSION_MAJOR 0x01
@@ -46,7 +46,7 @@ · 2 unmodified lines
46 46
47#define T5FW_VERSION_MAJOR 0x0147#define T5FW_VERSION_MAJOR 0x01
48#define T5FW_VERSION_MINOR 0x1048#define T5FW_VERSION_MINOR 0x10
49#define T5FW_VERSION_MICRO 0x2B49#define T5FW_VERSION_MICRO 0x2D
50#define T5FW_VERSION_BUILD 0x0050#define T5FW_VERSION_BUILD 0x00
51 51
52#define T5FW_MIN_VERSION_MAJOR 0x0052#define T5FW_MIN_VERSION_MAJOR 0x00
@@ -55,7 +55,7 @@ · 2 unmodified lines
55 55
56#define T6FW_VERSION_MAJOR 0x0156#define T6FW_VERSION_MAJOR 0x01
57#define T6FW_VERSION_MINOR 0x1057#define T6FW_VERSION_MINOR 0x10
58#define T6FW_VERSION_MICRO 0x2B58#define T6FW_VERSION_MICRO 0x2D
59#define T6FW_VERSION_BUILD 0x0059#define T6FW_VERSION_BUILD 0x00
60 60
61#define T6FW_MIN_VERSION_MAJOR 0x0061#define T6FW_MIN_VERSION_MAJOR 0x00
drivers/net/ethernet/ethoc.c+2−1
@@ -739,6 +739,8 @@ static int ethoc_open(struct net_device *dev) · 738 unmodified lines
739 if (ret)739 if (ret)
740 return ret;740 return ret;
741 741
742 napi_enable(&priv->napi);
743
742 ethoc_init_ring(priv, dev->mem_start);744 ethoc_init_ring(priv, dev->mem_start);
743 ethoc_reset(priv);745 ethoc_reset(priv);
744 746
@@ -754,7 +756,6 @@ static int ethoc_open(struct net_device *dev) · 9 unmodified lines
754 priv->old_duplex = -1;756 priv->old_duplex = -1;
755 757
756 phy_start(dev->phydev);758 phy_start(dev->phydev);
757 napi_enable(&priv->napi);
758 759
759 if (netif_msg_ifup(priv)) {760 if (netif_msg_ifup(priv)) {
760 dev_info(&dev->dev, "I/O: %08lx Memory: %08lx-%08lx\n",761 dev_info(&dev->dev, "I/O: %08lx Memory: %08lx-%08lx\n",
drivers/net/ethernet/freescale/fsl_pq_mdio.c+8−1
@@ -381,7 +381,7 @@ static int fsl_pq_mdio_probe(struct platform_device *pdev) · 380 unmodified lines
381{381{
382 const struct of_device_id *id =382 const struct of_device_id *id =
383 of_match_device(fsl_pq_mdio_match, &pdev->dev);383 of_match_device(fsl_pq_mdio_match, &pdev->dev);
384 const struct fsl_pq_mdio_data *data = id->data;384 const struct fsl_pq_mdio_data *data;
385 struct device_node *np = pdev->dev.of_node;385 struct device_node *np = pdev->dev.of_node;
386 struct resource res;386 struct resource res;
387 struct device_node *tbi;387 struct device_node *tbi;
@@ -389,6 +389,13 @@ static int fsl_pq_mdio_probe(struct platform_device *pdev) · 1 unmodified line
389 struct mii_bus *new_bus;389 struct mii_bus *new_bus;
390 int err;390 int err;
391 391
392 if (!id) {
393 dev_err(&pdev->dev, "Failed to match device\n");
394 return -ENODEV;
395 }
396
397 data = id->data;
398
392 dev_dbg(&pdev->dev, "found %s compatible node\n", id->compatible);399 dev_dbg(&pdev->dev, "found %s compatible node\n", id->compatible);
393 400
394 new_bus = mdiobus_alloc_size(sizeof(*priv));401 new_bus = mdiobus_alloc_size(sizeof(*priv));
drivers/net/ethernet/ibm/emac/core.c+40−27
@@ -343,6 +343,7 @@ static int emac_reset(struct emac_instance *dev) · 342 unmodified lines
343{343{
344 struct emac_regs __iomem *p = dev->emacp;344 struct emac_regs __iomem *p = dev->emacp;
345 int n = 20;345 int n = 20;
346 bool __maybe_unused try_internal_clock = false;
346 347
347 DBG(dev, "reset" NL);348 DBG(dev, "reset" NL);
348 349
@@ -355,6 +356,7 @@ static int emac_reset(struct emac_instance *dev) · 6 unmodified lines
355 }356 }
356 357
357#ifdef CONFIG_PPC_DCR_NATIVE358#ifdef CONFIG_PPC_DCR_NATIVE
359do_retry:
358 /*360 /*
359 * PPC460EX/GT Embedded Processor Advanced User's Manual361 * PPC460EX/GT Embedded Processor Advanced User's Manual
360 * section 28.10.1 Mode Register 0 (EMACx_MR0) states:362 * section 28.10.1 Mode Register 0 (EMACx_MR0) states:
@@ -362,10 +364,19 @@ static int emac_reset(struct emac_instance *dev) · 1 unmodified line
362 * of the EMAC. If none is present, select the internal clock364 * of the EMAC. If none is present, select the internal clock
363 * (SDR0_ETH_CFG[EMACx_PHY_CLK] = 1).365 * (SDR0_ETH_CFG[EMACx_PHY_CLK] = 1).
364 * After a soft reset, select the external clock.366 * After a soft reset, select the external clock.
367 *
368 * The AR8035-A PHY Meraki MR24 does not provide a TX Clk if the
369 * ethernet cable is not attached. This causes the reset to timeout
370 * and the PHY detection code in emac_init_phy() is unable to
371 * communicate and detect the AR8035-A PHY. As a result, the emac
372 * driver bails out early and the user has no ethernet.
373 * In order to stay compatible with existing configurations, the
374 * driver will temporarily switch to the internal clock, after
375 * the first reset fails.
365 */376 */
366 if (emac_has_feature(dev, EMAC_FTR_460EX_PHY_CLK_FIX)) {377 if (emac_has_feature(dev, EMAC_FTR_460EX_PHY_CLK_FIX)) {
367 if (dev->phy_address == 0xffffffff &&378 if (try_internal_clock || (dev->phy_address == 0xffffffff &&
368 dev->phy_map == 0xffffffff) {379 dev->phy_map == 0xffffffff)) {
369 /* No PHY: select internal loop clock before reset */380 /* No PHY: select internal loop clock before reset */
370 dcri_clrset(SDR0, SDR0_ETH_CFG,381 dcri_clrset(SDR0, SDR0_ETH_CFG,
371 0, SDR0_ETH_CFG_ECS << dev->cell_index);382 0, SDR0_ETH_CFG_ECS << dev->cell_index);
@@ -383,8 +394,15 @@ static int emac_reset(struct emac_instance *dev) · 11 unmodified lines
383 394
384#ifdef CONFIG_PPC_DCR_NATIVE395#ifdef CONFIG_PPC_DCR_NATIVE
385 if (emac_has_feature(dev, EMAC_FTR_460EX_PHY_CLK_FIX)) {396 if (emac_has_feature(dev, EMAC_FTR_460EX_PHY_CLK_FIX)) {
386 if (dev->phy_address == 0xffffffff &&397 if (!n && !try_internal_clock) {
387 dev->phy_map == 0xffffffff) {398 /* first attempt has timed out. */
399 n = 20;
400 try_internal_clock = true;
401 goto do_retry;
402 }
403
404 if (try_internal_clock || (dev->phy_address == 0xffffffff &&
405 dev->phy_map == 0xffffffff)) {
388 /* No PHY: restore external clock source after reset */406 /* No PHY: restore external clock source after reset */
389 dcri_clrset(SDR0, SDR0_ETH_CFG,407 dcri_clrset(SDR0, SDR0_ETH_CFG,
390 SDR0_ETH_CFG_ECS << dev->cell_index, 0);408 SDR0_ETH_CFG_ECS << dev->cell_index, 0);
@@ -2460,20 +2478,24 @@ static int emac_mii_bus_reset(struct mii_bus *bus) · 2069 unmodified lines
2460 return emac_reset(dev);2478 return emac_reset(dev);
2461}2479}
2462 2480
2481static int emac_mdio_phy_start_aneg(struct mii_phy *phy,
2482 struct phy_device *phy_dev)
2483{
2484 phy_dev->autoneg = phy->autoneg;
2485 phy_dev->speed = phy->speed;
2486 phy_dev->duplex = phy->duplex;
2487 phy_dev->advertising = phy->advertising;
2488 return phy_start_aneg(phy_dev);
2489}
2490
2463static int emac_mdio_setup_aneg(struct mii_phy *phy, u32 advertise)2491static int emac_mdio_setup_aneg(struct mii_phy *phy, u32 advertise)
2464{2492{
2465 struct net_device *ndev = phy->dev;2493 struct net_device *ndev = phy->dev;
2466 struct emac_instance *dev = netdev_priv(ndev);2494 struct emac_instance *dev = netdev_priv(ndev);
2467 2495
2468 dev->phy.autoneg = AUTONEG_ENABLE;
2469 dev->phy.speed = SPEED_1000;
2470 dev->phy.duplex = DUPLEX_FULL;
2471 dev->phy.advertising = advertise;
2472 phy->autoneg = AUTONEG_ENABLE;2496 phy->autoneg = AUTONEG_ENABLE;
2473 phy->speed = dev->phy.speed;
2474 phy->duplex = dev->phy.duplex;
2475 phy->advertising = advertise;2497 phy->advertising = advertise;
2476 return phy_start_aneg(dev->phy_dev);2498 return emac_mdio_phy_start_aneg(phy, dev->phy_dev);
2477}2499}
2478 2500
2479static int emac_mdio_setup_forced(struct mii_phy *phy, int speed, int fd)2501static int emac_mdio_setup_forced(struct mii_phy *phy, int speed, int fd)
@@ -2481,13 +2503,10 @@ static int emac_mdio_setup_forced(struct mii_phy *phy, int speed, int fd) · 1 unmodified line
2481 struct net_device *ndev = phy->dev;2503 struct net_device *ndev = phy->dev;
2482 struct emac_instance *dev = netdev_priv(ndev);2504 struct emac_instance *dev = netdev_priv(ndev);
2483 2505
2484 dev->phy.autoneg = AUTONEG_DISABLE;
2485 dev->phy.speed = speed;
2486 dev->phy.duplex = fd;
2487 phy->autoneg = AUTONEG_DISABLE;2506 phy->autoneg = AUTONEG_DISABLE;
2488 phy->speed = speed;2507 phy->speed = speed;
2489 phy->duplex = fd;2508 phy->duplex = fd;
2490 return phy_start_aneg(dev->phy_dev);2509 return emac_mdio_phy_start_aneg(phy, dev->phy_dev);
2491}2510}
2492 2511
2493static int emac_mdio_poll_link(struct mii_phy *phy)2512static int emac_mdio_poll_link(struct mii_phy *phy)
@@ -2509,16 +2528,17 @@ static int emac_mdio_read_link(struct mii_phy *phy) · 15 unmodified lines
2509{2528{
2510 struct net_device *ndev = phy->dev;2529 struct net_device *ndev = phy->dev;
2511 struct emac_instance *dev = netdev_priv(ndev);2530 struct emac_instance *dev = netdev_priv(ndev);
2531 struct phy_device *phy_dev = dev->phy_dev;
2512 int res;2532 int res;
2513 2533
2514 res = phy_read_status(dev->phy_dev);2534 res = phy_read_status(phy_dev);
2515 if (res)2535 if (res)
2516 return res;2536 return res;
2517 2537
2518 dev->phy.speed = phy->speed;2538 phy->speed = phy_dev->speed;
2519 dev->phy.duplex = phy->duplex;2539 phy->duplex = phy_dev->duplex;
2520 dev->phy.pause = phy->pause;2540 phy->pause = phy_dev->pause;
2521 dev->phy.asym_pause = phy->asym_pause;2541 phy->asym_pause = phy_dev->asym_pause;
2522 return 0;2542 return 0;
2523}2543}
2524 2544
@@ -2528,13 +2548,6 @@ static int emac_mdio_init_phy(struct mii_phy *phy) · 3 unmodified lines
2528 struct emac_instance *dev = netdev_priv(ndev);2548 struct emac_instance *dev = netdev_priv(ndev);
2529 2549
2530 phy_start(dev->phy_dev);2550 phy_start(dev->phy_dev);
2531 dev->phy.autoneg = phy->autoneg;
2532 dev->phy.speed = phy->speed;
2533 dev->phy.duplex = phy->duplex;
2534 dev->phy.advertising = phy->advertising;
2535 dev->phy.pause = phy->pause;
2536 dev->phy.asym_pause = phy->asym_pause;
2537
2538 return phy_init_hw(dev->phy_dev);2551 return phy_init_hw(dev->phy_dev);
2539}2552}
2540 2553
drivers/net/ethernet/ibm/ibmvnic.c+7−1
@@ -81,7 +81,7 @@ · 80 unmodified lines
81static const char ibmvnic_driver_name[] = "ibmvnic";81static const char ibmvnic_driver_name[] = "ibmvnic";
82static const char ibmvnic_driver_string[] = "IBM System i/p Virtual NIC Driver";82static const char ibmvnic_driver_string[] = "IBM System i/p Virtual NIC Driver";
83 83
84MODULE_AUTHOR("Santiago Leon <santi_leon@yahoo.com>");84MODULE_AUTHOR("Santiago Leon");
85MODULE_DESCRIPTION("IBM System i/p Virtual NIC Driver");85MODULE_DESCRIPTION("IBM System i/p Virtual NIC Driver");
86MODULE_LICENSE("GPL");86MODULE_LICENSE("GPL");
87MODULE_VERSION(IBMVNIC_DRIVER_VERSION);87MODULE_VERSION(IBMVNIC_DRIVER_VERSION);
@@ -1468,6 +1468,11 @@ static void ibmvnic_netpoll_controller(struct net_device *dev) · 1380 unmodified lines
1468}1468}
1469#endif1469#endif
1470 1470
1471static int ibmvnic_change_mtu(struct net_device *netdev, int new_mtu)
1472{
1473 return -EOPNOTSUPP;
1474}
1475
1471static const struct net_device_ops ibmvnic_netdev_ops = {1476static const struct net_device_ops ibmvnic_netdev_ops = {
1472 .ndo_open = ibmvnic_open,1477 .ndo_open = ibmvnic_open,
1473 .ndo_stop = ibmvnic_close,1478 .ndo_stop = ibmvnic_close,
@@ -1479,6 +1484,7 @@ static const struct net_device_ops ibmvnic_netdev_ops = { · 5 unmodified lines
1479#ifdef CONFIG_NET_POLL_CONTROLLER1484#ifdef CONFIG_NET_POLL_CONTROLLER
1480 .ndo_poll_controller = ibmvnic_netpoll_controller,1485 .ndo_poll_controller = ibmvnic_netpoll_controller,
1481#endif1486#endif
1487 .ndo_change_mtu = ibmvnic_change_mtu,
1482};1488};
1483 1489
1484/* ethtool functions */1490/* ethtool functions */
drivers/net/ethernet/intel/i40e/i40e.h+1−0
@@ -399,6 +399,7 @@ struct i40e_pf { · 398 unmodified lines
399#define I40E_FLAG_RX_CSUM_ENABLED BIT_ULL(1)399#define I40E_FLAG_RX_CSUM_ENABLED BIT_ULL(1)
400#define I40E_FLAG_MSI_ENABLED BIT_ULL(2)400#define I40E_FLAG_MSI_ENABLED BIT_ULL(2)
401#define I40E_FLAG_MSIX_ENABLED BIT_ULL(3)401#define I40E_FLAG_MSIX_ENABLED BIT_ULL(3)
402#define I40E_FLAG_HW_ATR_EVICT_ENABLED BIT_ULL(4)
402#define I40E_FLAG_RSS_ENABLED BIT_ULL(6)403#define I40E_FLAG_RSS_ENABLED BIT_ULL(6)
403#define I40E_FLAG_VMDQ_ENABLED BIT_ULL(7)404#define I40E_FLAG_VMDQ_ENABLED BIT_ULL(7)
404#define I40E_FLAG_IWARP_ENABLED BIT_ULL(10)405#define I40E_FLAG_IWARP_ENABLED BIT_ULL(10)
drivers/net/ethernet/intel/i40e/i40e_ethtool.c+2−2
@@ -224,7 +224,7 @@ static const struct i40e_priv_flags i40e_gstrings_priv_flags[] = { · 223 unmodified lines
224 I40E_PRIV_FLAG("LinkPolling", I40E_FLAG_LINK_POLLING_ENABLED, 0),224 I40E_PRIV_FLAG("LinkPolling", I40E_FLAG_LINK_POLLING_ENABLED, 0),
225 I40E_PRIV_FLAG("flow-director-atr", I40E_FLAG_FD_ATR_ENABLED, 0),225 I40E_PRIV_FLAG("flow-director-atr", I40E_FLAG_FD_ATR_ENABLED, 0),
226 I40E_PRIV_FLAG("veb-stats", I40E_FLAG_VEB_STATS_ENABLED, 0),226 I40E_PRIV_FLAG("veb-stats", I40E_FLAG_VEB_STATS_ENABLED, 0),
227 I40E_PRIV_FLAG("hw-atr-eviction", I40E_FLAG_HW_ATR_EVICT_CAPABLE, 0),227 I40E_PRIV_FLAG("hw-atr-eviction", I40E_FLAG_HW_ATR_EVICT_ENABLED, 0),
228 I40E_PRIV_FLAG("legacy-rx", I40E_FLAG_LEGACY_RX, 0),228 I40E_PRIV_FLAG("legacy-rx", I40E_FLAG_LEGACY_RX, 0),
229};229};
230 230
@@ -4092,7 +4092,7 @@ flags_complete: · 3861 unmodified lines
4092 4092
4093 /* Only allow ATR evict on hardware that is capable of handling it */4093 /* Only allow ATR evict on hardware that is capable of handling it */
4094 if (pf->flags & I40E_FLAG_HW_ATR_EVICT_CAPABLE)4094 if (pf->flags & I40E_FLAG_HW_ATR_EVICT_CAPABLE)
4095 pf->flags &= ~I40E_FLAG_HW_ATR_EVICT_CAPABLE;4095 pf->flags &= ~I40E_FLAG_HW_ATR_EVICT_ENABLED;
4096 4096
4097 if (changed_flags & I40E_FLAG_TRUE_PROMISC_SUPPORT) {4097 if (changed_flags & I40E_FLAG_TRUE_PROMISC_SUPPORT) {
4098 u16 sw_flags = 0, valid_flags = 0;4098 u16 sw_flags = 0, valid_flags = 0;
drivers/net/ethernet/intel/i40e/i40e_main.c+22−21
@@ -295,7 +295,7 @@ struct i40e_vsi *i40e_find_vsi_from_id(struct i40e_pf *pf, u16 id) · 294 unmodified lines
295 **/295 **/
296void i40e_service_event_schedule(struct i40e_pf *pf)296void i40e_service_event_schedule(struct i40e_pf *pf)
297{297{
298 if (!test_bit(__I40E_VSI_DOWN, pf->state) &&298 if (!test_bit(__I40E_DOWN, pf->state) &&
299 !test_bit(__I40E_RESET_RECOVERY_PENDING, pf->state))299 !test_bit(__I40E_RESET_RECOVERY_PENDING, pf->state))
300 queue_work(i40e_wq, &pf->service_task);300 queue_work(i40e_wq, &pf->service_task);
301}301}
@@ -3611,7 +3611,7 @@ static irqreturn_t i40e_intr(int irq, void *data) · 3309 unmodified lines
3611 * this is not a performance path and napi_schedule()3611 * this is not a performance path and napi_schedule()
3612 * can deal with rescheduling.3612 * can deal with rescheduling.
3613 */3613 */
3614 if (!test_bit(__I40E_VSI_DOWN, pf->state))3614 if (!test_bit(__I40E_DOWN, pf->state))
3615 napi_schedule_irqoff(&q_vector->napi);3615 napi_schedule_irqoff(&q_vector->napi);
3616 }3616 }
3617 3617
@@ -3687,7 +3687,7 @@ static irqreturn_t i40e_intr(int irq, void *data) · 69 unmodified lines
3687enable_intr:3687enable_intr:
3688 /* re-enable interrupt causes */3688 /* re-enable interrupt causes */
3689 wr32(hw, I40E_PFINT_ICR0_ENA, ena_mask);3689 wr32(hw, I40E_PFINT_ICR0_ENA, ena_mask);
3690 if (!test_bit(__I40E_VSI_DOWN, pf->state)) {3690 if (!test_bit(__I40E_DOWN, pf->state)) {
3691 i40e_service_event_schedule(pf);3691 i40e_service_event_schedule(pf);
3692 i40e_irq_dynamic_enable_icr0(pf, false);3692 i40e_irq_dynamic_enable_icr0(pf, false);
3693 }3693 }
@@ -6203,7 +6203,7 @@ static void i40e_fdir_reinit_subtask(struct i40e_pf *pf) · 2509 unmodified lines
6203{6203{
6204 6204
6205 /* if interface is down do nothing */6205 /* if interface is down do nothing */
6206 if (test_bit(__I40E_VSI_DOWN, pf->state))6206 if (test_bit(__I40E_DOWN, pf->state))
6207 return;6207 return;
6208 6208
6209 if (test_bit(__I40E_FD_FLUSH_REQUESTED, pf->state))6209 if (test_bit(__I40E_FD_FLUSH_REQUESTED, pf->state))
@@ -6344,7 +6344,7 @@ static void i40e_watchdog_subtask(struct i40e_pf *pf) · 134 unmodified lines
6344 int i;6344 int i;
6345 6345
6346 /* if interface is down do nothing */6346 /* if interface is down do nothing */
6347 if (test_bit(__I40E_VSI_DOWN, pf->state) ||6347 if (test_bit(__I40E_DOWN, pf->state) ||
6348 test_bit(__I40E_CONFIG_BUSY, pf->state))6348 test_bit(__I40E_CONFIG_BUSY, pf->state))
6349 return;6349 return;
6350 6350
@@ -6399,9 +6399,9 @@ static void i40e_reset_subtask(struct i40e_pf *pf) · 48 unmodified lines
6399 reset_flags |= BIT(__I40E_GLOBAL_RESET_REQUESTED);6399 reset_flags |= BIT(__I40E_GLOBAL_RESET_REQUESTED);
6400 clear_bit(__I40E_GLOBAL_RESET_REQUESTED, pf->state);6400 clear_bit(__I40E_GLOBAL_RESET_REQUESTED, pf->state);
6401 }6401 }
6402 if (test_bit(__I40E_VSI_DOWN_REQUESTED, pf->state)) {6402 if (test_bit(__I40E_DOWN_REQUESTED, pf->state)) {
6403 reset_flags |= BIT(__I40E_VSI_DOWN_REQUESTED);6403 reset_flags |= BIT(__I40E_DOWN_REQUESTED);
6404 clear_bit(__I40E_VSI_DOWN_REQUESTED, pf->state);6404 clear_bit(__I40E_DOWN_REQUESTED, pf->state);
6405 }6405 }
6406 6406
6407 /* If there's a recovery already waiting, it takes6407 /* If there's a recovery already waiting, it takes
@@ -6415,7 +6415,7 @@ static void i40e_reset_subtask(struct i40e_pf *pf) · 7 unmodified lines
6415 6415
6416 /* If we're already down or resetting, just bail */6416 /* If we're already down or resetting, just bail */
6417 if (reset_flags &&6417 if (reset_flags &&
6418 !test_bit(__I40E_VSI_DOWN, pf->state) &&6418 !test_bit(__I40E_DOWN, pf->state) &&
6419 !test_bit(__I40E_CONFIG_BUSY, pf->state)) {6419 !test_bit(__I40E_CONFIG_BUSY, pf->state)) {
6420 rtnl_lock();6420 rtnl_lock();
6421 i40e_do_reset(pf, reset_flags, true);6421 i40e_do_reset(pf, reset_flags, true);
@@ -7002,7 +7002,7 @@ static void i40e_rebuild(struct i40e_pf *pf, bool reinit, bool lock_acquired) · 580 unmodified lines
7002 u32 val;7002 u32 val;
7003 int v;7003 int v;
7004 7004
7005 if (test_bit(__I40E_VSI_DOWN, pf->state))7005 if (test_bit(__I40E_DOWN, pf->state))
7006 goto clear_recovery;7006 goto clear_recovery;
7007 dev_dbg(&pf->pdev->dev, "Rebuilding internal switch\n");7007 dev_dbg(&pf->pdev->dev, "Rebuilding internal switch\n");
7008 7008
@@ -8821,11 +8821,12 @@ static int i40e_sw_init(struct i40e_pf *pf) · 1812 unmodified lines
8821 (pf->hw.aq.api_min_ver > 4))) {8821 (pf->hw.aq.api_min_ver > 4))) {
8822 /* Supported in FW API version higher than 1.4 */8822 /* Supported in FW API version higher than 1.4 */
8823 pf->flags |= I40E_FLAG_GENEVE_OFFLOAD_CAPABLE;8823 pf->flags |= I40E_FLAG_GENEVE_OFFLOAD_CAPABLE;
8824 pf->flags = I40E_FLAG_HW_ATR_EVICT_CAPABLE;
8825 } else {
8826 pf->flags = I40E_FLAG_HW_ATR_EVICT_CAPABLE;
8827 }8824 }
8828 8825
8826 /* Enable HW ATR eviction if possible */
8827 if (pf->flags & I40E_FLAG_HW_ATR_EVICT_CAPABLE)
8828 pf->flags |= I40E_FLAG_HW_ATR_EVICT_ENABLED;
8829
8829 pf->eeprom_version = 0xDEAD;8830 pf->eeprom_version = 0xDEAD;
8830 pf->lan_veb = I40E_NO_VEB;8831 pf->lan_veb = I40E_NO_VEB;
8831 pf->lan_vsi = I40E_NO_VSI;8832 pf->lan_vsi = I40E_NO_VSI;
@@ -9767,7 +9768,7 @@ int i40e_vsi_release(struct i40e_vsi *vsi) · 935 unmodified lines
9767 return -ENODEV;9768 return -ENODEV;
9768 }9769 }
9769 if (vsi == pf->vsi[pf->lan_vsi] &&9770 if (vsi == pf->vsi[pf->lan_vsi] &&
9770 !test_bit(__I40E_VSI_DOWN, pf->state)) {9771 !test_bit(__I40E_DOWN, pf->state)) {
9771 dev_info(&pf->pdev->dev, "Can't remove PF VSI\n");9772 dev_info(&pf->pdev->dev, "Can't remove PF VSI\n");
9772 return -ENODEV;9773 return -ENODEV;
9773 }9774 }
@@ -11003,7 +11004,7 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent) · 1229 unmodified lines
11003 }11004 }
11004 pf->next_vsi = 0;11005 pf->next_vsi = 0;
11005 pf->pdev = pdev;11006 pf->pdev = pdev;
11006 set_bit(__I40E_VSI_DOWN, pf->state);11007 set_bit(__I40E_DOWN, pf->state);
11007 11008
11008 hw = &pf->hw;11009 hw = &pf->hw;
11009 hw->back = pf;11010 hw->back = pf;
@@ -11293,7 +11294,7 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent) · 283 unmodified lines
11293 * before setting up the misc vector or we get a race and the vector11294 * before setting up the misc vector or we get a race and the vector
11294 * ends up disabled forever.11295 * ends up disabled forever.
11295 */11296 */
11296 clear_bit(__I40E_VSI_DOWN, pf->state);11297 clear_bit(__I40E_DOWN, pf->state);
11297 11298
11298 /* In case of MSIX we are going to setup the misc vector right here11299 /* In case of MSIX we are going to setup the misc vector right here
11299 * to handle admin queue events etc. In case of legacy and MSI11300 * to handle admin queue events etc. In case of legacy and MSI
@@ -11448,7 +11449,7 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent) · 148 unmodified lines
11448 11449
11449 /* Unwind what we've done if something failed in the setup */11450 /* Unwind what we've done if something failed in the setup */
11450err_vsis:11451err_vsis:
11451 set_bit(__I40E_VSI_DOWN, pf->state);11452 set_bit(__I40E_DOWN, pf->state);
11452 i40e_clear_interrupt_scheme(pf);11453 i40e_clear_interrupt_scheme(pf);
11453 kfree(pf->vsi);11454 kfree(pf->vsi);
11454err_switch_setup:11455err_switch_setup:
@@ -11500,7 +11501,7 @@ static void i40e_remove(struct pci_dev *pdev) · 45 unmodified lines
11500 11501
11501 /* no more scheduling of any task */11502 /* no more scheduling of any task */
11502 set_bit(__I40E_SUSPENDED, pf->state);11503 set_bit(__I40E_SUSPENDED, pf->state);
11503 set_bit(__I40E_VSI_DOWN, pf->state);11504 set_bit(__I40E_DOWN, pf->state);
11504 if (pf->service_timer.data)11505 if (pf->service_timer.data)
11505 del_timer_sync(&pf->service_timer);11506 del_timer_sync(&pf->service_timer);
11506 if (pf->service_task.func)11507 if (pf->service_task.func)
@@ -11740,7 +11741,7 @@ static void i40e_shutdown(struct pci_dev *pdev) · 233 unmodified lines
11740 struct i40e_hw *hw = &pf->hw;11741 struct i40e_hw *hw = &pf->hw;
11741 11742
11742 set_bit(__I40E_SUSPENDED, pf->state);11743 set_bit(__I40E_SUSPENDED, pf->state);
11743 set_bit(__I40E_VSI_DOWN, pf->state);11744 set_bit(__I40E_DOWN, pf->state);
11744 rtnl_lock();11745 rtnl_lock();
11745 i40e_prep_for_reset(pf, true);11746 i40e_prep_for_reset(pf, true);
11746 rtnl_unlock();11747 rtnl_unlock();
@@ -11789,7 +11790,7 @@ static int i40e_suspend(struct pci_dev *pdev, pm_message_t state) · 42 unmodified lines
11789 int retval = 0;11790 int retval = 0;
11790 11791
11791 set_bit(__I40E_SUSPENDED, pf->state);11792 set_bit(__I40E_SUSPENDED, pf->state);
11792 set_bit(__I40E_VSI_DOWN, pf->state);11793 set_bit(__I40E_DOWN, pf->state);
11793 11794
11794 if (pf->wol_en && (pf->flags & I40E_FLAG_WOL_MC_MAGIC_PKT_WAKE))11795 if (pf->wol_en && (pf->flags & I40E_FLAG_WOL_MC_MAGIC_PKT_WAKE))
11795 i40e_enable_mc_magic_wake(pf);11796 i40e_enable_mc_magic_wake(pf);
@@ -11841,7 +11842,7 @@ static int i40e_resume(struct pci_dev *pdev) · 45 unmodified lines
11841 11842
11842 /* handling the reset will rebuild the device state */11843 /* handling the reset will rebuild the device state */
11843 if (test_and_clear_bit(__I40E_SUSPENDED, pf->state)) {11844 if (test_and_clear_bit(__I40E_SUSPENDED, pf->state)) {
11844 clear_bit(__I40E_VSI_DOWN, pf->state);11845 clear_bit(__I40E_DOWN, pf->state);
11845 rtnl_lock();11846 rtnl_lock();
11846 i40e_reset_and_rebuild(pf, false, true);11847 i40e_reset_and_rebuild(pf, false, true);
11847 rtnl_unlock();11848 rtnl_unlock();
drivers/net/ethernet/intel/i40e/i40e_txrx.c+4−3
@@ -1854,7 +1854,8 @@ static struct sk_buff *i40e_build_skb(struct i40e_ring *rx_ring, · 1853 unmodified lines
1854#if (PAGE_SIZE < 8192)1854#if (PAGE_SIZE < 8192)
1855 unsigned int truesize = i40e_rx_pg_size(rx_ring) / 2;1855 unsigned int truesize = i40e_rx_pg_size(rx_ring) / 2;
1856#else1856#else
1857 unsigned int truesize = SKB_DATA_ALIGN(size);1857 unsigned int truesize = SKB_DATA_ALIGN(sizeof(struct skb_shared_info)) +
1858 SKB_DATA_ALIGN(I40E_SKB_PAD + size);
1858#endif1859#endif
1859 struct sk_buff *skb;1860 struct sk_buff *skb;
1860 1861
@@ -2340,7 +2341,7 @@ static void i40e_atr(struct i40e_ring *tx_ring, struct sk_buff *skb, · 479 unmodified lines
2340 /* Due to lack of space, no more new filters can be programmed */2341 /* Due to lack of space, no more new filters can be programmed */
2341 if (th->syn && (pf->flags & I40E_FLAG_FD_ATR_AUTO_DISABLED))2342 if (th->syn && (pf->flags & I40E_FLAG_FD_ATR_AUTO_DISABLED))
2342 return;2343 return;
2343 if (pf->flags & I40E_FLAG_HW_ATR_EVICT_CAPABLE) {2344 if (pf->flags & I40E_FLAG_HW_ATR_EVICT_ENABLED) {
2344 /* HW ATR eviction will take care of removing filters on FIN2345 /* HW ATR eviction will take care of removing filters on FIN
2345 * and RST packets.2346 * and RST packets.
2346 */2347 */
@@ -2402,7 +2403,7 @@ static void i40e_atr(struct i40e_ring *tx_ring, struct sk_buff *skb, · 55 unmodified lines
2402 I40E_TXD_FLTR_QW1_CNTINDEX_SHIFT) &2403 I40E_TXD_FLTR_QW1_CNTINDEX_SHIFT) &
2403 I40E_TXD_FLTR_QW1_CNTINDEX_MASK;2404 I40E_TXD_FLTR_QW1_CNTINDEX_MASK;
2404 2405
2405 if (pf->flags & I40E_FLAG_HW_ATR_EVICT_CAPABLE)2406 if (pf->flags & I40E_FLAG_HW_ATR_EVICT_ENABLED)
2406 dtype_cmd |= I40E_TXD_FLTR_QW1_ATR_MASK;2407 dtype_cmd |= I40E_TXD_FLTR_QW1_ATR_MASK;
2407 2408
2408 fdir_desc->qindex_flex_ptype_vsi = cpu_to_le32(flex_ptype);2409 fdir_desc->qindex_flex_ptype_vsi = cpu_to_le32(flex_ptype);
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c+2−0
@@ -3017,10 +3017,12 @@ int i40e_ndo_set_vf_port_vlan(struct net_device *netdev, int vf_id, · 3016 unmodified lines
3017 VLAN_VID_MASK));3017 VLAN_VID_MASK));
3018 }3018 }
3019 3019
3020 spin_unlock_bh(&vsi->mac_filter_hash_lock);
3020 if (vlan_id || qos)3021 if (vlan_id || qos)
3021 ret = i40e_vsi_add_pvid(vsi, vlanprio);3022 ret = i40e_vsi_add_pvid(vsi, vlanprio);
3022 else3023 else
3023 i40e_vsi_remove_pvid(vsi);3024 i40e_vsi_remove_pvid(vsi);
3025 spin_lock_bh(&vsi->mac_filter_hash_lock);
3024 3026
3025 if (vlan_id) {3027 if (vlan_id) {
3026 dev_info(&pf->pdev->dev, "Setting VLAN %d, QOS 0x%x on VF %d\n",3028 dev_info(&pf->pdev->dev, "Setting VLAN %d, QOS 0x%x on VF %d\n",
drivers/net/ethernet/intel/i40evf/i40e_txrx.c+2−1
@@ -1190,7 +1190,8 @@ static struct sk_buff *i40e_build_skb(struct i40e_ring *rx_ring, · 1189 unmodified lines
1190#if (PAGE_SIZE < 8192)1190#if (PAGE_SIZE < 8192)
1191 unsigned int truesize = i40e_rx_pg_size(rx_ring) / 2;1191 unsigned int truesize = i40e_rx_pg_size(rx_ring) / 2;
1192#else1192#else
1193 unsigned int truesize = SKB_DATA_ALIGN(size);1193 unsigned int truesize = SKB_DATA_ALIGN(sizeof(struct skb_shared_info)) +
1194 SKB_DATA_ALIGN(I40E_SKB_PAD + size);
1194#endif1195#endif
1195 struct sk_buff *skb;1196 struct sk_buff *skb;
1196 1197
drivers/net/ethernet/marvell/mvpp2.c+33−43
@@ -3719,7 +3719,7 @@ static void mvpp2_bm_bufs_get_addrs(struct device *dev, struct mvpp2 *priv, · 3718 unmodified lines
3719 dma_addr_t *dma_addr,3719 dma_addr_t *dma_addr,
3720 phys_addr_t *phys_addr)3720 phys_addr_t *phys_addr)
3721{3721{
3722 int cpu = smp_processor_id();3722 int cpu = get_cpu();
3723 3723
3724 *dma_addr = mvpp2_percpu_read(priv, cpu,3724 *dma_addr = mvpp2_percpu_read(priv, cpu,
3725 MVPP2_BM_PHY_ALLOC_REG(bm_pool->id));3725 MVPP2_BM_PHY_ALLOC_REG(bm_pool->id));
@@ -3740,6 +3740,8 @@ static void mvpp2_bm_bufs_get_addrs(struct device *dev, struct mvpp2 *priv, · 14 unmodified lines
3740 if (sizeof(phys_addr_t) == 8)3740 if (sizeof(phys_addr_t) == 8)
3741 *phys_addr |= (u64)phys_addr_highbits << 32;3741 *phys_addr |= (u64)phys_addr_highbits << 32;
3742 }3742 }
3743
3744 put_cpu();
3743}3745}
3744 3746
3745/* Free all buffers from the pool */3747/* Free all buffers from the pool */
@@ -3920,18 +3922,12 @@ static inline u32 mvpp2_bm_cookie_pool_set(u32 cookie, int pool) · 174 unmodified lines
3920 return bm;3922 return bm;
3921}3923}
3922 3924
3923/* Get pool number from a BM cookie */
3924static inline int mvpp2_bm_cookie_pool_get(unsigned long cookie)
3925{
3926 return (cookie >> MVPP2_BM_COOKIE_POOL_OFFS) & 0xFF;
3927}
3928
3929/* Release buffer to BM */3925/* Release buffer to BM */
3930static inline void mvpp2_bm_pool_put(struct mvpp2_port *port, int pool,3926static inline void mvpp2_bm_pool_put(struct mvpp2_port *port, int pool,
3931 dma_addr_t buf_dma_addr,3927 dma_addr_t buf_dma_addr,
3932 phys_addr_t buf_phys_addr)3928 phys_addr_t buf_phys_addr)
3933{3929{
3934 int cpu = smp_processor_id();3930 int cpu = get_cpu();
3935 3931
3936 if (port->priv->hw_version == MVPP22) {3932 if (port->priv->hw_version == MVPP22) {
3937 u32 val = 0;3933 u32 val = 0;
@@ -3958,15 +3954,15 @@ static inline void mvpp2_bm_pool_put(struct mvpp2_port *port, int pool, · 20 unmodified lines
3958 MVPP2_BM_VIRT_RLS_REG, buf_phys_addr);3954 MVPP2_BM_VIRT_RLS_REG, buf_phys_addr);
3959 mvpp2_percpu_write(port->priv, cpu,3955 mvpp2_percpu_write(port->priv, cpu,
3960 MVPP2_BM_PHY_RLS_REG(pool), buf_dma_addr);3956 MVPP2_BM_PHY_RLS_REG(pool), buf_dma_addr);
3957
3958 put_cpu();
3961}3959}
3962 3960
3963/* Refill BM pool */3961/* Refill BM pool */
3964static void mvpp2_pool_refill(struct mvpp2_port *port, u32 bm,3962static void mvpp2_pool_refill(struct mvpp2_port *port, int pool,
3965 dma_addr_t dma_addr,3963 dma_addr_t dma_addr,
3966 phys_addr_t phys_addr)3964 phys_addr_t phys_addr)
3967{3965{
3968 int pool = mvpp2_bm_cookie_pool_get(bm);
3969
3970 mvpp2_bm_pool_put(port, pool, dma_addr, phys_addr);3966 mvpp2_bm_pool_put(port, pool, dma_addr, phys_addr);
3971}3967}
3972 3968
@@ -4186,8 +4182,6 @@ static void mvpp22_port_mii_set(struct mvpp2_port *port) · 213 unmodified lines
4186{4182{
4187 u32 val;4183 u32 val;
4188 4184
4189 return;
4190
4191 /* Only GOP port 0 has an XLG MAC */4185 /* Only GOP port 0 has an XLG MAC */
4192 if (port->gop_id == 0) {4186 if (port->gop_id == 0) {
4193 val = readl(port->base + MVPP22_XLG_CTRL3_REG);4187 val = readl(port->base + MVPP22_XLG_CTRL3_REG);
@@ -4515,21 +4509,6 @@ static void mvpp2_rxq_offset_set(struct mvpp2_port *port, · 321 unmodified lines
4515 mvpp2_write(port->priv, MVPP2_RXQ_CONFIG_REG(prxq), val);4509 mvpp2_write(port->priv, MVPP2_RXQ_CONFIG_REG(prxq), val);
4516}4510}
4517 4511
4518/* Obtain BM cookie information from descriptor */
4519static u32 mvpp2_bm_cookie_build(struct mvpp2_port *port,
4520 struct mvpp2_rx_desc *rx_desc)
4521{
4522 int cpu = smp_processor_id();
4523 int pool;
4524
4525 pool = (mvpp2_rxdesc_status_get(port, rx_desc) &
4526 MVPP2_RXD_BM_POOL_ID_MASK) >>
4527 MVPP2_RXD_BM_POOL_ID_OFFS;
4528
4529 return ((pool & 0xFF) << MVPP2_BM_COOKIE_POOL_OFFS) |
4530 ((cpu & 0xFF) << MVPP2_BM_COOKIE_CPU_OFFS);
4531}
4532
4533/* Tx descriptors helper methods */4512/* Tx descriptors helper methods */
4534 4513
4535/* Get pointer to next Tx descriptor to be processed (send) by HW */4514/* Get pointer to next Tx descriptor to be processed (send) by HW */
@@ -4757,7 +4736,7 @@ static void mvpp2_txp_max_tx_size_set(struct mvpp2_port *port) · 221 unmodified lines
4757static void mvpp2_rx_pkts_coal_set(struct mvpp2_port *port,4736static void mvpp2_rx_pkts_coal_set(struct mvpp2_port *port,
4758 struct mvpp2_rx_queue *rxq)4737 struct mvpp2_rx_queue *rxq)
4759{4738{
4760 int cpu = smp_processor_id();4739 int cpu = get_cpu();
4761 4740
4762 if (rxq->pkts_coal > MVPP2_OCCUPIED_THRESH_MASK)4741 if (rxq->pkts_coal > MVPP2_OCCUPIED_THRESH_MASK)
4763 rxq->pkts_coal = MVPP2_OCCUPIED_THRESH_MASK;4742 rxq->pkts_coal = MVPP2_OCCUPIED_THRESH_MASK;
@@ -4765,6 +4744,8 @@ static void mvpp2_rx_pkts_coal_set(struct mvpp2_port *port, · 1 unmodified line
4765 mvpp2_percpu_write(port->priv, cpu, MVPP2_RXQ_NUM_REG, rxq->id);4744 mvpp2_percpu_write(port->priv, cpu, MVPP2_RXQ_NUM_REG, rxq->id);
4766 mvpp2_percpu_write(port->priv, cpu, MVPP2_RXQ_THRESH_REG,4745 mvpp2_percpu_write(port->priv, cpu, MVPP2_RXQ_THRESH_REG,
4767 rxq->pkts_coal);4746 rxq->pkts_coal);
4747
4748 put_cpu();
4768}4749}
4769 4750
4770static u32 mvpp2_usec_to_cycles(u32 usec, unsigned long clk_hz)4751static u32 mvpp2_usec_to_cycles(u32 usec, unsigned long clk_hz)
@@ -4945,7 +4926,7 @@ static int mvpp2_rxq_init(struct mvpp2_port *port, · 174 unmodified lines
4945 mvpp2_write(port->priv, MVPP2_RXQ_STATUS_REG(rxq->id), 0);4926 mvpp2_write(port->priv, MVPP2_RXQ_STATUS_REG(rxq->id), 0);
4946 4927
4947 /* Set Rx descriptors queue starting address - indirect access */4928 /* Set Rx descriptors queue starting address - indirect access */
4948 cpu = smp_processor_id();4929 cpu = get_cpu();
4949 mvpp2_percpu_write(port->priv, cpu, MVPP2_RXQ_NUM_REG, rxq->id);4930 mvpp2_percpu_write(port->priv, cpu, MVPP2_RXQ_NUM_REG, rxq->id);
4950 if (port->priv->hw_version == MVPP21)4931 if (port->priv->hw_version == MVPP21)
4951 rxq_dma = rxq->descs_dma;4932 rxq_dma = rxq->descs_dma;
@@ -4954,6 +4935,7 @@ static int mvpp2_rxq_init(struct mvpp2_port *port, · 2 unmodified lines
4954 mvpp2_percpu_write(port->priv, cpu, MVPP2_RXQ_DESC_ADDR_REG, rxq_dma);4935 mvpp2_percpu_write(port->priv, cpu, MVPP2_RXQ_DESC_ADDR_REG, rxq_dma);
4955 mvpp2_percpu_write(port->priv, cpu, MVPP2_RXQ_DESC_SIZE_REG, rxq->size);4936 mvpp2_percpu_write(port->priv, cpu, MVPP2_RXQ_DESC_SIZE_REG, rxq->size);
4956 mvpp2_percpu_write(port->priv, cpu, MVPP2_RXQ_INDEX_REG, 0);4937 mvpp2_percpu_write(port->priv, cpu, MVPP2_RXQ_INDEX_REG, 0);
4938 put_cpu();
4957 4939
4958 /* Set Offset */4940 /* Set Offset */
4959 mvpp2_rxq_offset_set(port, rxq->id, NET_SKB_PAD);4941 mvpp2_rxq_offset_set(port, rxq->id, NET_SKB_PAD);
@@ -4980,9 +4962,13 @@ static void mvpp2_rxq_drop_pkts(struct mvpp2_port *port, · 20 unmodified lines
4980 4962
4981 for (i = 0; i < rx_received; i++) {4963 for (i = 0; i < rx_received; i++) {
4982 struct mvpp2_rx_desc *rx_desc = mvpp2_rxq_next_desc_get(rxq);4964 struct mvpp2_rx_desc *rx_desc = mvpp2_rxq_next_desc_get(rxq);
4983 u32 bm = mvpp2_bm_cookie_build(port, rx_desc);4965 u32 status = mvpp2_rxdesc_status_get(port, rx_desc);
4966 int pool;
4967
4968 pool = (status & MVPP2_RXD_BM_POOL_ID_MASK) >>
4969 MVPP2_RXD_BM_POOL_ID_OFFS;
4984 4970
4985 mvpp2_pool_refill(port, bm,4971 mvpp2_pool_refill(port, pool,
4986 mvpp2_rxdesc_dma_addr_get(port, rx_desc),4972 mvpp2_rxdesc_dma_addr_get(port, rx_desc),
4987 mvpp2_rxdesc_cookie_get(port, rx_desc));4973 mvpp2_rxdesc_cookie_get(port, rx_desc));
4988 }4974 }
@@ -5012,10 +4998,11 @@ static void mvpp2_rxq_deinit(struct mvpp2_port *port, · 23 unmodified lines
5012 * free descriptor number4998 * free descriptor number
5013 */4999 */
5014 mvpp2_write(port->priv, MVPP2_RXQ_STATUS_REG(rxq->id), 0);5000 mvpp2_write(port->priv, MVPP2_RXQ_STATUS_REG(rxq->id), 0);
5015 cpu = smp_processor_id();5001 cpu = get_cpu();
5016 mvpp2_percpu_write(port->priv, cpu, MVPP2_RXQ_NUM_REG, rxq->id);5002 mvpp2_percpu_write(port->priv, cpu, MVPP2_RXQ_NUM_REG, rxq->id);
5017 mvpp2_percpu_write(port->priv, cpu, MVPP2_RXQ_DESC_ADDR_REG, 0);5003 mvpp2_percpu_write(port->priv, cpu, MVPP2_RXQ_DESC_ADDR_REG, 0);
5018 mvpp2_percpu_write(port->priv, cpu, MVPP2_RXQ_DESC_SIZE_REG, 0);5004 mvpp2_percpu_write(port->priv, cpu, MVPP2_RXQ_DESC_SIZE_REG, 0);
5005 put_cpu();
5019}5006}
5020 5007
5021/* Create and initialize a Tx queue */5008/* Create and initialize a Tx queue */
@@ -5038,7 +5025,7 @@ static int mvpp2_txq_init(struct mvpp2_port *port, · 16 unmodified lines
5038 txq->last_desc = txq->size - 1;5025 txq->last_desc = txq->size - 1;
5039 5026
5040 /* Set Tx descriptors queue starting address - indirect access */5027 /* Set Tx descriptors queue starting address - indirect access */
5041 cpu = smp_processor_id();5028 cpu = get_cpu();
5042 mvpp2_percpu_write(port->priv, cpu, MVPP2_TXQ_NUM_REG, txq->id);5029 mvpp2_percpu_write(port->priv, cpu, MVPP2_TXQ_NUM_REG, txq->id);
5043 mvpp2_percpu_write(port->priv, cpu, MVPP2_TXQ_DESC_ADDR_REG,5030 mvpp2_percpu_write(port->priv, cpu, MVPP2_TXQ_DESC_ADDR_REG,
5044 txq->descs_dma);5031 txq->descs_dma);
@@ -5063,6 +5050,7 @@ static int mvpp2_txq_init(struct mvpp2_port *port, · 18 unmodified lines
5063 mvpp2_percpu_write(port->priv, cpu, MVPP2_TXQ_PREF_BUF_REG,5050 mvpp2_percpu_write(port->priv, cpu, MVPP2_TXQ_PREF_BUF_REG,
5064 MVPP2_PREF_BUF_PTR(desc) | MVPP2_PREF_BUF_SIZE_16 |5051 MVPP2_PREF_BUF_PTR(desc) | MVPP2_PREF_BUF_SIZE_16 |
5065 MVPP2_PREF_BUF_THRESH(desc_per_txq / 2));5052 MVPP2_PREF_BUF_THRESH(desc_per_txq / 2));
5053 put_cpu();
5066 5054
5067 /* WRR / EJP configuration - indirect access */5055 /* WRR / EJP configuration - indirect access */
5068 tx_port_num = mvpp2_egress_port(port);5056 tx_port_num = mvpp2_egress_port(port);
@@ -5133,10 +5121,11 @@ static void mvpp2_txq_deinit(struct mvpp2_port *port, · 64 unmodified lines
5133 mvpp2_write(port->priv, MVPP2_TXQ_SCHED_TOKEN_CNTR_REG(txq->id), 0);5121 mvpp2_write(port->priv, MVPP2_TXQ_SCHED_TOKEN_CNTR_REG(txq->id), 0);
5134 5122
5135 /* Set Tx descriptors queue starting address and size */5123 /* Set Tx descriptors queue starting address and size */
5136 cpu = smp_processor_id();5124 cpu = get_cpu();
5137 mvpp2_percpu_write(port->priv, cpu, MVPP2_TXQ_NUM_REG, txq->id);5125 mvpp2_percpu_write(port->priv, cpu, MVPP2_TXQ_NUM_REG, txq->id);
5138 mvpp2_percpu_write(port->priv, cpu, MVPP2_TXQ_DESC_ADDR_REG, 0);5126 mvpp2_percpu_write(port->priv, cpu, MVPP2_TXQ_DESC_ADDR_REG, 0);
5139 mvpp2_percpu_write(port->priv, cpu, MVPP2_TXQ_DESC_SIZE_REG, 0);5127 mvpp2_percpu_write(port->priv, cpu, MVPP2_TXQ_DESC_SIZE_REG, 0);
5128 put_cpu();
5140}5129}
5141 5130
5142/* Cleanup Tx ports */5131/* Cleanup Tx ports */
@@ -5146,7 +5135,7 @@ static void mvpp2_txq_clean(struct mvpp2_port *port, struct mvpp2_tx_queue *txq) · 3 unmodified lines
5146 int delay, pending, cpu;5135 int delay, pending, cpu;
5147 u32 val;5136 u32 val;
5148 5137
5149 cpu = smp_processor_id();5138 cpu = get_cpu();
5150 mvpp2_percpu_write(port->priv, cpu, MVPP2_TXQ_NUM_REG, txq->id);5139 mvpp2_percpu_write(port->priv, cpu, MVPP2_TXQ_NUM_REG, txq->id);
5151 val = mvpp2_percpu_read(port->priv, cpu, MVPP2_TXQ_PREF_BUF_REG);5140 val = mvpp2_percpu_read(port->priv, cpu, MVPP2_TXQ_PREF_BUF_REG);
5152 val |= MVPP2_TXQ_DRAIN_EN_MASK;5141 val |= MVPP2_TXQ_DRAIN_EN_MASK;
@@ -5173,6 +5162,7 @@ static void mvpp2_txq_clean(struct mvpp2_port *port, struct mvpp2_tx_queue *txq) · 20 unmodified lines
5173 5162
5174 val &= ~MVPP2_TXQ_DRAIN_EN_MASK;5163 val &= ~MVPP2_TXQ_DRAIN_EN_MASK;
5175 mvpp2_percpu_write(port->priv, cpu, MVPP2_TXQ_PREF_BUF_REG, val);5164 mvpp2_percpu_write(port->priv, cpu, MVPP2_TXQ_PREF_BUF_REG, val);
5165 put_cpu();
5176 5166
5177 for_each_present_cpu(cpu) {5167 for_each_present_cpu(cpu) {
5178 txq_pcpu = per_cpu_ptr(txq->pcpu, cpu);5168 txq_pcpu = per_cpu_ptr(txq->pcpu, cpu);
@@ -5420,7 +5410,7 @@ static void mvpp2_rx_csum(struct mvpp2_port *port, u32 status, · 241 unmodified lines
5420 5410
5421/* Reuse skb if possible, or allocate a new skb and add it to BM pool */5411/* Reuse skb if possible, or allocate a new skb and add it to BM pool */
5422static int mvpp2_rx_refill(struct mvpp2_port *port,5412static int mvpp2_rx_refill(struct mvpp2_port *port,
5423 struct mvpp2_bm_pool *bm_pool, u32 bm)5413 struct mvpp2_bm_pool *bm_pool, int pool)
5424{5414{
5425 dma_addr_t dma_addr;5415 dma_addr_t dma_addr;
5426 phys_addr_t phys_addr;5416 phys_addr_t phys_addr;
@@ -5432,7 +5422,7 @@ static int mvpp2_rx_refill(struct mvpp2_port *port, · 5 unmodified lines
5432 if (!buf)5422 if (!buf)
5433 return -ENOMEM;5423 return -ENOMEM;
5434 5424
5435 mvpp2_pool_refill(port, bm, dma_addr, phys_addr);5425 mvpp2_pool_refill(port, pool, dma_addr, phys_addr);
5436 5426
5437 return 0;5427 return 0;
5438}5428}
@@ -5490,7 +5480,7 @@ static int mvpp2_rx(struct mvpp2_port *port, int rx_todo, · 51 unmodified lines
5490 unsigned int frag_size;5480 unsigned int frag_size;
5491 dma_addr_t dma_addr;5481 dma_addr_t dma_addr;
5492 phys_addr_t phys_addr;5482 phys_addr_t phys_addr;
5493 u32 bm, rx_status;5483 u32 rx_status;
5494 int pool, rx_bytes, err;5484 int pool, rx_bytes, err;
5495 void *data;5485 void *data;
5496 5486
@@ -5502,8 +5492,8 @@ static int mvpp2_rx(struct mvpp2_port *port, int rx_todo, · 5 unmodified lines
5502 phys_addr = mvpp2_rxdesc_cookie_get(port, rx_desc);5492 phys_addr = mvpp2_rxdesc_cookie_get(port, rx_desc);
5503 data = (void *)phys_to_virt(phys_addr);5493 data = (void *)phys_to_virt(phys_addr);
5504 5494
5505 bm = mvpp2_bm_cookie_build(port, rx_desc);5495 pool = (rx_status & MVPP2_RXD_BM_POOL_ID_MASK) >>
5506 pool = mvpp2_bm_cookie_pool_get(bm);5496 MVPP2_RXD_BM_POOL_ID_OFFS;
5507 bm_pool = &port->priv->bm_pools[pool];5497 bm_pool = &port->priv->bm_pools[pool];
5508 5498
5509 /* In case of an error, release the requested buffer pointer5499 /* In case of an error, release the requested buffer pointer
@@ -5516,7 +5506,7 @@ err_drop_frame: · 6 unmodified lines
5516 dev->stats.rx_errors++;5506 dev->stats.rx_errors++;
5517 mvpp2_rx_error(port, rx_desc);5507 mvpp2_rx_error(port, rx_desc);
5518 /* Return the buffer to the pool */5508 /* Return the buffer to the pool */
5519 mvpp2_pool_refill(port, bm, dma_addr, phys_addr);5509 mvpp2_pool_refill(port, pool, dma_addr, phys_addr);
5520 continue;5510 continue;
5521 }5511 }
5522 5512
@@ -5531,7 +5521,7 @@ err_drop_frame: · 8 unmodified lines
5531 goto err_drop_frame;5521 goto err_drop_frame;
5532 }5522 }
5533 5523
5534 err = mvpp2_rx_refill(port, bm_pool, bm);5524 err = mvpp2_rx_refill(port, bm_pool, pool);
5535 if (err) {5525 if (err) {
5536 netdev_err(port->dev, "failed to refill BM pools\n");5526 netdev_err(port->dev, "failed to refill BM pools\n");
5537 goto err_drop_frame;5527 goto err_drop_frame;
drivers/net/ethernet/mellanox/mlx4/en_ethtool.c+0−5
@@ -1562,11 +1562,6 @@ static int mlx4_en_flow_replace(struct net_device *dev, · 1561 unmodified lines
1562 qpn = priv->drop_qp.qpn;1562 qpn = priv->drop_qp.qpn;
1563 else if (cmd->fs.ring_cookie & EN_ETHTOOL_QP_ATTACH) {1563 else if (cmd->fs.ring_cookie & EN_ETHTOOL_QP_ATTACH) {
1564 qpn = cmd->fs.ring_cookie & (EN_ETHTOOL_QP_ATTACH - 1);1564 qpn = cmd->fs.ring_cookie & (EN_ETHTOOL_QP_ATTACH - 1);
1565 if (qpn < priv->rss_map.base_qpn ||
1566 qpn >= priv->rss_map.base_qpn + priv->rx_ring_num) {
1567 en_warn(priv, "rxnfc: QP (0x%x) doesn't exist\n", qpn);
1568 return -EINVAL;
1569 }
1570 } else {1565 } else {
1571 if (cmd->fs.ring_cookie >= priv->rx_ring_num) {1566 if (cmd->fs.ring_cookie >= priv->rx_ring_num) {
1572 en_warn(priv, "rxnfc: RX ring (%llu) doesn't exist\n",1567 en_warn(priv, "rxnfc: RX ring (%llu) doesn't exist\n",
drivers/net/ethernet/mellanox/mlx4/mcg.c+11−4
@@ -35,6 +35,7 @@ · 34 unmodified lines
35#include <linux/etherdevice.h>35#include <linux/etherdevice.h>
36 36
37#include <linux/mlx4/cmd.h>37#include <linux/mlx4/cmd.h>
38#include <linux/mlx4/qp.h>
38#include <linux/export.h>39#include <linux/export.h>
39 40
40#include "mlx4.h"41#include "mlx4.h"
@@ -985,16 +986,21 @@ int mlx4_flow_attach(struct mlx4_dev *dev, · 944 unmodified lines
985 if (IS_ERR(mailbox))986 if (IS_ERR(mailbox))
986 return PTR_ERR(mailbox);987 return PTR_ERR(mailbox);
987 988
989 if (!mlx4_qp_lookup(dev, rule->qpn)) {
990 mlx4_err_rule(dev, "QP doesn't exist\n", rule);
991 ret = -EINVAL;
992 goto out;
993 }
994
988 trans_rule_ctrl_to_hw(rule, mailbox->buf);995 trans_rule_ctrl_to_hw(rule, mailbox->buf);
989 996
990 size += sizeof(struct mlx4_net_trans_rule_hw_ctrl);997 size += sizeof(struct mlx4_net_trans_rule_hw_ctrl);
991 998
992 list_for_each_entry(cur, &rule->list, list) {999 list_for_each_entry(cur, &rule->list, list) {
993 ret = parse_trans_rule(dev, cur, mailbox->buf + size);1000 ret = parse_trans_rule(dev, cur, mailbox->buf + size);
994 if (ret < 0) {1001 if (ret < 0)
995 mlx4_free_cmd_mailbox(dev, mailbox);1002 goto out;
996 return ret;1003
997 }
998 size += ret;1004 size += ret;
999 }1005 }
1000 1006
@@ -1021,6 +1027,7 @@ int mlx4_flow_attach(struct mlx4_dev *dev, · 20 unmodified lines
1021 }1027 }
1022 }1028 }
1023 1029
1030out:
1024 mlx4_free_cmd_mailbox(dev, mailbox);1031 mlx4_free_cmd_mailbox(dev, mailbox);
1025 1032
1026 return ret;1033 return ret;
drivers/net/ethernet/mellanox/mlx4/qp.c+19−0
@@ -384,6 +384,19 @@ static void mlx4_qp_free_icm(struct mlx4_dev *dev, int qpn) · 383 unmodified lines
384 __mlx4_qp_free_icm(dev, qpn);384 __mlx4_qp_free_icm(dev, qpn);
385}385}
386 386
387struct mlx4_qp *mlx4_qp_lookup(struct mlx4_dev *dev, u32 qpn)
388{
389 struct mlx4_qp_table *qp_table = &mlx4_priv(dev)->qp_table;
390 struct mlx4_qp *qp;
391
392 spin_lock(&qp_table->lock);
393
394 qp = __mlx4_qp_lookup(dev, qpn);
395
396 spin_unlock(&qp_table->lock);
397 return qp;
398}
399
387int mlx4_qp_alloc(struct mlx4_dev *dev, int qpn, struct mlx4_qp *qp, gfp_t gfp)400int mlx4_qp_alloc(struct mlx4_dev *dev, int qpn, struct mlx4_qp *qp, gfp_t gfp)
388{401{
389 struct mlx4_priv *priv = mlx4_priv(dev);402 struct mlx4_priv *priv = mlx4_priv(dev);
@@ -471,6 +484,12 @@ int mlx4_update_qp(struct mlx4_dev *dev, u32 qpn, · 81 unmodified lines
471 }484 }
472 485
473 if (attr & MLX4_UPDATE_QP_QOS_VPORT) {486 if (attr & MLX4_UPDATE_QP_QOS_VPORT) {
487 if (!(dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_QOS_VPP)) {
488 mlx4_warn(dev, "Granular QoS per VF is not enabled\n");
489 err = -EOPNOTSUPP;
490 goto out;
491 }
492
474 qp_mask |= 1ULL << MLX4_UPD_QP_MASK_QOS_VPP;493 qp_mask |= 1ULL << MLX4_UPD_QP_MASK_QOS_VPP;
475 cmd->qp_context.qos_vport = params->qos_vport;494 cmd->qp_context.qos_vport = params->qos_vport;
476 }495 }
drivers/net/ethernet/mellanox/mlx4/resource_tracker.c+11−5
@@ -5255,6 +5255,13 @@ void mlx4_delete_all_resources_for_slave(struct mlx4_dev *dev, int slave) · 5254 unmodified lines
5255 mutex_unlock(&priv->mfunc.master.res_tracker.slave_list[slave].mutex);5255 mutex_unlock(&priv->mfunc.master.res_tracker.slave_list[slave].mutex);
5256}5256}
5257 5257
5258static void update_qos_vpp(struct mlx4_update_qp_context *ctx,
5259 struct mlx4_vf_immed_vlan_work *work)
5260{
5261 ctx->qp_mask |= cpu_to_be64(1ULL << MLX4_UPD_QP_MASK_QOS_VPP);
5262 ctx->qp_context.qos_vport = work->qos_vport;
5263}
5264
5258void mlx4_vf_immed_vlan_work_handler(struct work_struct *_work)5265void mlx4_vf_immed_vlan_work_handler(struct work_struct *_work)
5259{5266{
5260 struct mlx4_vf_immed_vlan_work *work =5267 struct mlx4_vf_immed_vlan_work *work =
@@ -5369,11 +5376,10 @@ void mlx4_vf_immed_vlan_work_handler(struct work_struct *_work) · 108 unmodified lines
5369 qp->sched_queue & 0xC7;5376 qp->sched_queue & 0xC7;
5370 upd_context->qp_context.pri_path.sched_queue |=5377 upd_context->qp_context.pri_path.sched_queue |=
5371 ((work->qos & 0x7) << 3);5378 ((work->qos & 0x7) << 3);
5372 upd_context->qp_mask |=5379
5373 cpu_to_be64(1ULL <<5380 if (dev->caps.flags2 &
5374 MLX4_UPD_QP_MASK_QOS_VPP);5381 MLX4_DEV_CAP_FLAG2_QOS_VPP)
5375 upd_context->qp_context.qos_vport =5382 update_qos_vpp(upd_context, work);
5376 work->qos_vport;
5377 }5383 }
5378 5384
5379 err = mlx4_cmd(dev, mailbox->dma,5385 err = mlx4_cmd(dev, mailbox->dma,
drivers/net/ethernet/mellanox/mlx5/core/en.h+5−3
@@ -458,13 +458,15 @@ struct mlx5e_mpw_info { · 457 unmodified lines
458 458
459struct mlx5e_rx_am_stats {459struct mlx5e_rx_am_stats {
460 int ppms; /* packets per msec */460 int ppms; /* packets per msec */
461 int bpms; /* bytes per msec */
461 int epms; /* events per msec */462 int epms; /* events per msec */
462};463};
463 464
464struct mlx5e_rx_am_sample {465struct mlx5e_rx_am_sample {
465 ktime_t time;466 ktime_t time;
466 unsigned int pkt_ctr;467 u32 pkt_ctr;
467 u16 event_ctr;468 u32 byte_ctr;
469 u16 event_ctr;
468};470};
469 471
470struct mlx5e_rx_am { /* Adaptive Moderation */472struct mlx5e_rx_am { /* Adaptive Moderation */
drivers/net/ethernet/mellanox/mlx5/core/en_rx_am.c+26−19
@@ -183,28 +183,27 @@ static void mlx5e_am_exit_parking(struct mlx5e_rx_am *am) · 182 unmodified lines
183 mlx5e_am_step(am);183 mlx5e_am_step(am);
184}184}
185 185
186#define IS_SIGNIFICANT_DIFF(val, ref) \
187 (((100 * abs((val) - (ref))) / (ref)) > 10) /* more than 10% difference */
188
186static int mlx5e_am_stats_compare(struct mlx5e_rx_am_stats *curr,189static int mlx5e_am_stats_compare(struct mlx5e_rx_am_stats *curr,
187 struct mlx5e_rx_am_stats *prev)190 struct mlx5e_rx_am_stats *prev)
188{191{
189 int diff;192 if (!prev->bpms)
190 193 return curr->bpms ? MLX5E_AM_STATS_BETTER :
191 if (!prev->ppms)
192 return curr->ppms ? MLX5E_AM_STATS_BETTER :
193 MLX5E_AM_STATS_SAME;194 MLX5E_AM_STATS_SAME;
194 195
195 diff = curr->ppms - prev->ppms;196 if (IS_SIGNIFICANT_DIFF(curr->bpms, prev->bpms))
196 if (((100 * abs(diff)) / prev->ppms) > 10) /* more than 10% diff */197 return (curr->bpms > prev->bpms) ? MLX5E_AM_STATS_BETTER :
197 return (diff > 0) ? MLX5E_AM_STATS_BETTER :198 MLX5E_AM_STATS_WORSE;
198 MLX5E_AM_STATS_WORSE;
199 199
200 if (!prev->epms)200 if (IS_SIGNIFICANT_DIFF(curr->ppms, prev->ppms))
201 return curr->epms ? MLX5E_AM_STATS_WORSE :201 return (curr->ppms > prev->ppms) ? MLX5E_AM_STATS_BETTER :
202 MLX5E_AM_STATS_SAME;202 MLX5E_AM_STATS_WORSE;
203 203
204 diff = curr->epms - prev->epms;204 if (IS_SIGNIFICANT_DIFF(curr->epms, prev->epms))
205 if (((100 * abs(diff)) / prev->epms) > 10) /* more than 10% diff */205 return (curr->epms < prev->epms) ? MLX5E_AM_STATS_BETTER :
206 return (diff < 0) ? MLX5E_AM_STATS_BETTER :206 MLX5E_AM_STATS_WORSE;
207 MLX5E_AM_STATS_WORSE;
208 207
209 return MLX5E_AM_STATS_SAME;208 return MLX5E_AM_STATS_SAME;
210}209}
@@ -266,10 +265,13 @@ static void mlx5e_am_sample(struct mlx5e_rq *rq, · 55 unmodified lines
266{265{
267 s->time = ktime_get();266 s->time = ktime_get();
268 s->pkt_ctr = rq->stats.packets;267 s->pkt_ctr = rq->stats.packets;
268 s->byte_ctr = rq->stats.bytes;
269 s->event_ctr = rq->cq.event_ctr;269 s->event_ctr = rq->cq.event_ctr;
270}270}
271 271
272#define MLX5E_AM_NEVENTS 64272#define MLX5E_AM_NEVENTS 64
273#define BITS_PER_TYPE(type) (sizeof(type) * BITS_PER_BYTE)
274#define BIT_GAP(bits, end, start) ((((end) - (start)) + BIT_ULL(bits)) & (BIT_ULL(bits) - 1))
273 275
274static void mlx5e_am_calc_stats(struct mlx5e_rx_am_sample *start,276static void mlx5e_am_calc_stats(struct mlx5e_rx_am_sample *start,
275 struct mlx5e_rx_am_sample *end,277 struct mlx5e_rx_am_sample *end,
@@ -277,13 +279,17 @@ static void mlx5e_am_calc_stats(struct mlx5e_rx_am_sample *start, · 1 unmodified line
277{279{
278 /* u32 holds up to 71 minutes, should be enough */280 /* u32 holds up to 71 minutes, should be enough */
279 u32 delta_us = ktime_us_delta(end->time, start->time);281 u32 delta_us = ktime_us_delta(end->time, start->time);
280 unsigned int npkts = end->pkt_ctr - start->pkt_ctr;282 u32 npkts = BIT_GAP(BITS_PER_TYPE(u32), end->pkt_ctr, start->pkt_ctr);
283 u32 nbytes = BIT_GAP(BITS_PER_TYPE(u32), end->byte_ctr,
284 start->byte_ctr);
281 285
282 if (!delta_us)286 if (!delta_us)
283 return;287 return;
284 288
285 curr_stats->ppms = (npkts * USEC_PER_MSEC) / delta_us;289 curr_stats->ppms = DIV_ROUND_UP(npkts * USEC_PER_MSEC, delta_us);
286 curr_stats->epms = (MLX5E_AM_NEVENTS * USEC_PER_MSEC) / delta_us;290 curr_stats->bpms = DIV_ROUND_UP(nbytes * USEC_PER_MSEC, delta_us);
291 curr_stats->epms = DIV_ROUND_UP(MLX5E_AM_NEVENTS * USEC_PER_MSEC,
292 delta_us);
287}293}
288 294
289void mlx5e_rx_am_work(struct work_struct *work)295void mlx5e_rx_am_work(struct work_struct *work)
@@ -308,7 +314,8 @@ void mlx5e_rx_am(struct mlx5e_rq *rq) · 18 unmodified lines
308 314
309 switch (am->state) {315 switch (am->state) {
310 case MLX5E_AM_MEASURE_IN_PROGRESS:316 case MLX5E_AM_MEASURE_IN_PROGRESS:
311 nevents = rq->cq.event_ctr - am->start_sample.event_ctr;317 nevents = BIT_GAP(BITS_PER_TYPE(u16), rq->cq.event_ctr,
318 am->start_sample.event_ctr);
312 if (nevents < MLX5E_AM_NEVENTS)319 if (nevents < MLX5E_AM_NEVENTS)
313 break;320 break;
314 mlx5e_am_sample(rq, &end_sample);321 mlx5e_am_sample(rq, &end_sample);
drivers/net/ethernet/mellanox/mlx5/core/en_stats.h+2−9
@@ -417,20 +417,13 @@ struct mlx5e_stats { · 416 unmodified lines
417};417};
418 418
419static const struct counter_desc mlx5e_pme_status_desc[] = {419static const struct counter_desc mlx5e_pme_status_desc[] = {
420 { "module_plug", 0 },
421 { "module_unplug", 8 },420 { "module_unplug", 8 },
422};421};
423 422
424static const struct counter_desc mlx5e_pme_error_desc[] = {423static const struct counter_desc mlx5e_pme_error_desc[] = {
425 { "module_pwr_budget_exd", 0 }, /* power budget exceed */424 { "module_bus_stuck", 16 }, /* bus stuck (I2C or data shorted) */
426 { "module_long_range", 8 }, /* long range for non MLNX cable */425 { "module_high_temp", 48 }, /* high temperature */
427 { "module_bus_stuck", 16 }, /* bus stuck (I2C or data shorted) */
428 { "module_no_eeprom", 24 }, /* no eeprom/retry time out */
429 { "module_enforce_part", 32 }, /* enforce part number list */
430 { "module_unknown_id", 40 }, /* unknown identifier */
431 { "module_high_temp", 48 }, /* high temperature */
432 { "module_bad_shorted", 56 }, /* bad or shorted cable/module */426 { "module_bad_shorted", 56 }, /* bad or shorted cable/module */
433 { "module_unknown_status", 64 },
434};427};
435 428
436#endif /* __MLX5_EN_STATS_H__ */429#endif /* __MLX5_EN_STATS_H__ */
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c+1−1
@@ -862,7 +862,7 @@ struct mlx5_flow_table *mlx5_create_vport_flow_table(struct mlx5_flow_namespace · 861 unmodified lines
862 ft_attr.level = level;862 ft_attr.level = level;
863 ft_attr.prio = prio;863 ft_attr.prio = prio;
864 864
865 return __mlx5_create_flow_table(ns, &ft_attr, FS_FT_OP_MOD_NORMAL, 0);865 return __mlx5_create_flow_table(ns, &ft_attr, FS_FT_OP_MOD_NORMAL, vport);
866}866}
867 867
868struct mlx5_flow_table*868struct mlx5_flow_table*
drivers/net/ethernet/mellanox/mlx5/core/health.c+5−6
@@ -275,10 +275,8 @@ static void poll_health(unsigned long data) · 274 unmodified lines
275 struct mlx5_core_health *health = &dev->priv.health;275 struct mlx5_core_health *health = &dev->priv.health;
276 u32 count;276 u32 count;
277 277
278 if (dev->state == MLX5_DEVICE_STATE_INTERNAL_ERROR) {278 if (dev->state == MLX5_DEVICE_STATE_INTERNAL_ERROR)
279 mod_timer(&health->timer, get_next_poll_jiffies());279 goto out;
280 return;
281 }
282 280
283 count = ioread32be(health->health_counter);281 count = ioread32be(health->health_counter);
284 if (count == health->prev)282 if (count == health->prev)
@@ -290,8 +288,6 @@ static void poll_health(unsigned long data) · 5 unmodified lines
290 if (health->miss_counter == MAX_MISSES) {288 if (health->miss_counter == MAX_MISSES) {
291 dev_err(&dev->pdev->dev, "device's health compromised - reached miss count\n");289 dev_err(&dev->pdev->dev, "device's health compromised - reached miss count\n");
292 print_health_info(dev);290 print_health_info(dev);
293 } else {
294 mod_timer(&health->timer, get_next_poll_jiffies());
295 }291 }
296 292
297 if (in_fatal(dev) && !health->sick) {293 if (in_fatal(dev) && !health->sick) {
@@ -305,6 +301,9 @@ static void poll_health(unsigned long data) · 7 unmodified lines
305 "new health works are not permitted at this stage\n");301 "new health works are not permitted at this stage\n");
306 spin_unlock(&health->wq_lock);302 spin_unlock(&health->wq_lock);
307 }303 }
304
305out:
306 mod_timer(&health->timer, get_next_poll_jiffies());
308}307}
309 308
310void mlx5_start_health_poll(struct mlx5_core_dev *dev)309void mlx5_start_health_poll(struct mlx5_core_dev *dev)
drivers/net/ethernet/mellanox/mlx5/core/main.c+6−5
@@ -537,8 +537,10 @@ static int handle_hca_cap(struct mlx5_core_dev *dev) · 536 unmodified lines
537 /* disable cmdif checksum */537 /* disable cmdif checksum */
538 MLX5_SET(cmd_hca_cap, set_hca_cap, cmdif_checksum, 0);538 MLX5_SET(cmd_hca_cap, set_hca_cap, cmdif_checksum, 0);
539 539
540 /* If the HCA supports 4K UARs use it */540 /* Enable 4K UAR only when HCA supports it and page size is bigger
541 if (MLX5_CAP_GEN_MAX(dev, uar_4k))541 * than 4K.
542 */
543 if (MLX5_CAP_GEN_MAX(dev, uar_4k) && PAGE_SIZE > 4096)
542 MLX5_SET(cmd_hca_cap, set_hca_cap, uar_4k, 1);544 MLX5_SET(cmd_hca_cap, set_hca_cap, uar_4k, 1);
543 545
544 MLX5_SET(cmd_hca_cap, set_hca_cap, log_uar_page_sz, PAGE_SHIFT - 12);546 MLX5_SET(cmd_hca_cap, set_hca_cap, log_uar_page_sz, PAGE_SHIFT - 12);
@@ -621,10 +623,9 @@ static int mlx5_irq_set_affinity_hint(struct mlx5_core_dev *mdev, int i) · 76 unmodified lines
621 cpumask_set_cpu(cpumask_local_spread(i, priv->numa_node),623 cpumask_set_cpu(cpumask_local_spread(i, priv->numa_node),
622 priv->irq_info[i].mask);624 priv->irq_info[i].mask);
623 625
624#ifdef CONFIG_SMP626 if (IS_ENABLED(CONFIG_SMP) &&
625 if (irq_set_affinity_hint(irq, priv->irq_info[i].mask))627 irq_set_affinity_hint(irq, priv->irq_info[i].mask))
626 mlx5_core_warn(mdev, "irq_set_affinity_hint failed, irq 0x%.4x", irq);628 mlx5_core_warn(mdev, "irq_set_affinity_hint failed, irq 0x%.4x", irq);
627#endif
628 629
629 return 0;630 return 0;
630}631}
drivers/net/ethernet/qlogic/qed/qed_debug.c+1−1
@@ -2956,7 +2956,7 @@ static u32 qed_grc_dump_ctx_data(struct qed_hwfn *p_hwfn, · 2955 unmodified lines
2956 qed_wr(p_hwfn,2956 qed_wr(p_hwfn,
2957 p_ptt,2957 p_ptt,
2958 s_storm_defs[storm_id].cm_ctx_wr_addr,2958 s_storm_defs[storm_id].cm_ctx_wr_addr,
2959 BIT(9) | lid);2959 (i << 9) | lid);
2960 *(dump_buf + offset) = qed_rd(p_hwfn,2960 *(dump_buf + offset) = qed_rd(p_hwfn,
2961 p_ptt,2961 p_ptt,
2962 rd_reg_addr);2962 rd_reg_addr);
drivers/net/ethernet/qlogic/qed/qed_main.c+2−1
@@ -1730,7 +1730,8 @@ void qed_get_protocol_stats(struct qed_dev *cdev, · 1729 unmodified lines
1730 qed_get_protocol_stats_iscsi(cdev, &stats->iscsi_stats);1730 qed_get_protocol_stats_iscsi(cdev, &stats->iscsi_stats);
1731 break;1731 break;
1732 default:1732 default:
1733 DP_ERR(cdev, "Invalid protocol type = %d\n", type);1733 DP_VERBOSE(cdev, QED_MSG_SP,
1734 "Invalid protocol type = %d\n", type);
1734 return;1735 return;
1735 }1736 }
1736}1737}
drivers/net/ethernet/qlogic/qlcnic/qlcnic.h+24−2
@@ -1824,22 +1824,44 @@ struct qlcnic_hardware_ops { · 1823 unmodified lines
1824 u32 (*get_cap_size)(void *, int);1824 u32 (*get_cap_size)(void *, int);
1825 void (*set_sys_info)(void *, int, u32);1825 void (*set_sys_info)(void *, int, u32);
1826 void (*store_cap_mask)(void *, u32);1826 void (*store_cap_mask)(void *, u32);
1827 bool (*encap_rx_offload) (struct qlcnic_adapter *adapter);
1828 bool (*encap_tx_offload) (struct qlcnic_adapter *adapter);
1827};1829};
1828 1830
1829extern struct qlcnic_nic_template qlcnic_vf_ops;1831extern struct qlcnic_nic_template qlcnic_vf_ops;
1830 1832
1831static inline bool qlcnic_encap_tx_offload(struct qlcnic_adapter *adapter)1833static inline bool qlcnic_83xx_encap_tx_offload(struct qlcnic_adapter *adapter)
1832{1834{
1833 return adapter->ahw->extra_capability[0] &1835 return adapter->ahw->extra_capability[0] &
1834 QLCNIC_83XX_FW_CAPAB_ENCAP_TX_OFFLOAD;1836 QLCNIC_83XX_FW_CAPAB_ENCAP_TX_OFFLOAD;
1835}1837}
1836 1838
1837static inline bool qlcnic_encap_rx_offload(struct qlcnic_adapter *adapter)1839static inline bool qlcnic_83xx_encap_rx_offload(struct qlcnic_adapter *adapter)
1838{1840{
1839 return adapter->ahw->extra_capability[0] &1841 return adapter->ahw->extra_capability[0] &
1840 QLCNIC_83XX_FW_CAPAB_ENCAP_RX_OFFLOAD;1842 QLCNIC_83XX_FW_CAPAB_ENCAP_RX_OFFLOAD;
1841}1843}
1842 1844
1845static inline bool qlcnic_82xx_encap_tx_offload(struct qlcnic_adapter *adapter)
1846{
1847 return false;
1848}
1849
1850static inline bool qlcnic_82xx_encap_rx_offload(struct qlcnic_adapter *adapter)
1851{
1852 return false;
1853}
1854
1855static inline bool qlcnic_encap_rx_offload(struct qlcnic_adapter *adapter)
1856{
1857 return adapter->ahw->hw_ops->encap_rx_offload(adapter);
1858}
1859
1860static inline bool qlcnic_encap_tx_offload(struct qlcnic_adapter *adapter)
1861{
1862 return adapter->ahw->hw_ops->encap_tx_offload(adapter);
1863}
1864
1843static inline int qlcnic_start_firmware(struct qlcnic_adapter *adapter)1865static inline int qlcnic_start_firmware(struct qlcnic_adapter *adapter)
1844{1866{
1845 return adapter->nic_ops->start_firmware(adapter);1867 return adapter->nic_ops->start_firmware(adapter);
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c+2−0
@@ -242,6 +242,8 @@ static struct qlcnic_hardware_ops qlcnic_83xx_hw_ops = { · 241 unmodified lines
242 .get_cap_size = qlcnic_83xx_get_cap_size,242 .get_cap_size = qlcnic_83xx_get_cap_size,
243 .set_sys_info = qlcnic_83xx_set_sys_info,243 .set_sys_info = qlcnic_83xx_set_sys_info,
244 .store_cap_mask = qlcnic_83xx_store_cap_mask,244 .store_cap_mask = qlcnic_83xx_store_cap_mask,
245 .encap_rx_offload = qlcnic_83xx_encap_rx_offload,
246 .encap_tx_offload = qlcnic_83xx_encap_tx_offload,
245};247};
246 248
247static struct qlcnic_nic_template qlcnic_83xx_ops = {249static struct qlcnic_nic_template qlcnic_83xx_ops = {
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c+1−1
@@ -341,7 +341,7 @@ qlcnic_pcie_sem_lock(struct qlcnic_adapter *adapter, int sem, u32 id_reg) · 340 unmodified lines
341 }341 }
342 return -EIO;342 return -EIO;
343 }343 }
344 usleep_range(1000, 1500);344 udelay(1200);
345 }345 }
346 346
347 if (id_reg)347 if (id_reg)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c+2−0
@@ -632,6 +632,8 @@ static struct qlcnic_hardware_ops qlcnic_hw_ops = { · 631 unmodified lines
632 .get_cap_size = qlcnic_82xx_get_cap_size,632 .get_cap_size = qlcnic_82xx_get_cap_size,
633 .set_sys_info = qlcnic_82xx_set_sys_info,633 .set_sys_info = qlcnic_82xx_set_sys_info,
634 .store_cap_mask = qlcnic_82xx_store_cap_mask,634 .store_cap_mask = qlcnic_82xx_store_cap_mask,
635 .encap_rx_offload = qlcnic_82xx_encap_rx_offload,
636 .encap_tx_offload = qlcnic_82xx_encap_tx_offload,
635};637};
636 638
637static int qlcnic_check_multi_tx_capability(struct qlcnic_adapter *adapter)639static int qlcnic_check_multi_tx_capability(struct qlcnic_adapter *adapter)
drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c+2−0
@@ -77,6 +77,8 @@ static struct qlcnic_hardware_ops qlcnic_sriov_vf_hw_ops = { · 76 unmodified lines
77 .free_mac_list = qlcnic_sriov_vf_free_mac_list,77 .free_mac_list = qlcnic_sriov_vf_free_mac_list,
78 .enable_sds_intr = qlcnic_83xx_enable_sds_intr,78 .enable_sds_intr = qlcnic_83xx_enable_sds_intr,
79 .disable_sds_intr = qlcnic_83xx_disable_sds_intr,79 .disable_sds_intr = qlcnic_83xx_disable_sds_intr,
80 .encap_rx_offload = qlcnic_83xx_encap_rx_offload,
81 .encap_tx_offload = qlcnic_83xx_encap_tx_offload,
80};82};
81 83
82static struct qlcnic_nic_template qlcnic_sriov_vf_ops = {84static struct qlcnic_nic_template qlcnic_sriov_vf_ops = {
drivers/net/ethernet/qualcomm/emac/emac-mac.c+1−1
@@ -931,7 +931,7 @@ int emac_mac_up(struct emac_adapter *adpt) · 930 unmodified lines
931 emac_mac_config(adpt);931 emac_mac_config(adpt);
932 emac_mac_rx_descs_refill(adpt, &adpt->rx_q);932 emac_mac_rx_descs_refill(adpt, &adpt->rx_q);
933 933
934 adpt->phydev->irq = PHY_IGNORE_INTERRUPT;934 adpt->phydev->irq = PHY_POLL;
935 ret = phy_connect_direct(netdev, adpt->phydev, emac_adjust_link,935 ret = phy_connect_direct(netdev, adpt->phydev, emac_adjust_link,
936 PHY_INTERFACE_MODE_SGMII);936 PHY_INTERFACE_MODE_SGMII);
937 if (ret) {937 if (ret) {
drivers/net/ethernet/qualcomm/emac/emac-phy.c+4−71
@@ -13,15 +13,11 @@ · 12 unmodified lines
13/* Qualcomm Technologies, Inc. EMAC PHY Controller driver.13/* Qualcomm Technologies, Inc. EMAC PHY Controller driver.
14 */14 */
15 15
16#include <linux/module.h>
17#include <linux/of.h>
18#include <linux/of_net.h>
19#include <linux/of_mdio.h>16#include <linux/of_mdio.h>
20#include <linux/phy.h>17#include <linux/phy.h>
21#include <linux/iopoll.h>18#include <linux/iopoll.h>
22#include <linux/acpi.h>19#include <linux/acpi.h>
23#include "emac.h"20#include "emac.h"
24#include "emac-mac.h"
25 21
26/* EMAC base register offsets */22/* EMAC base register offsets */
27#define EMAC_MDIO_CTRL 0x00141423#define EMAC_MDIO_CTRL 0x001414
@@ -52,62 +48,10 @@ · 24 unmodified lines
52 48
53#define MDIO_WAIT_TIMES 100049#define MDIO_WAIT_TIMES 1000
54 50
55#define EMAC_LINK_SPEED_DEFAULT (\
56 EMAC_LINK_SPEED_10_HALF |\
57 EMAC_LINK_SPEED_10_FULL |\
58 EMAC_LINK_SPEED_100_HALF |\
59 EMAC_LINK_SPEED_100_FULL |\
60 EMAC_LINK_SPEED_1GB_FULL)
61
62/**
63 * emac_phy_mdio_autopoll_disable() - disable mdio autopoll
64 * @adpt: the emac adapter
65 *
66 * The autopoll feature takes over the MDIO bus. In order for
67 * the PHY driver to be able to talk to the PHY over the MDIO
68 * bus, we need to temporarily disable the autopoll feature.
69 */
70static int emac_phy_mdio_autopoll_disable(struct emac_adapter *adpt)
71{
72 u32 val;
73
74 /* disable autopoll */
75 emac_reg_update32(adpt->base + EMAC_MDIO_CTRL, MDIO_AP_EN, 0);
76
77 /* wait for any mdio polling to complete */
78 if (!readl_poll_timeout(adpt->base + EMAC_MDIO_CTRL, val,
79 !(val & MDIO_BUSY), 100, MDIO_WAIT_TIMES * 100))
80 return 0;
81
82 /* failed to disable; ensure it is enabled before returning */
83 emac_reg_update32(adpt->base + EMAC_MDIO_CTRL, 0, MDIO_AP_EN);
84
85 return -EBUSY;
86}
87
88/**
89 * emac_phy_mdio_autopoll_disable() - disable mdio autopoll
90 * @adpt: the emac adapter
91 *
92 * The EMAC has the ability to poll the external PHY on the MDIO
93 * bus for link state changes. This eliminates the need for the
94 * driver to poll the phy. If if the link state does change,
95 * the EMAC issues an interrupt on behalf of the PHY.
96 */
97static void emac_phy_mdio_autopoll_enable(struct emac_adapter *adpt)
98{
99 emac_reg_update32(adpt->base + EMAC_MDIO_CTRL, 0, MDIO_AP_EN);
100}
101
102static int emac_mdio_read(struct mii_bus *bus, int addr, int regnum)51static int emac_mdio_read(struct mii_bus *bus, int addr, int regnum)
103{52{
104 struct emac_adapter *adpt = bus->priv;53 struct emac_adapter *adpt = bus->priv;
105 u32 reg;54 u32 reg;
106 int ret;
107
108 ret = emac_phy_mdio_autopoll_disable(adpt);
109 if (ret)
110 return ret;
111 55
112 emac_reg_update32(adpt->base + EMAC_PHY_STS, PHY_ADDR_BMSK,56 emac_reg_update32(adpt->base + EMAC_PHY_STS, PHY_ADDR_BMSK,
113 (addr << PHY_ADDR_SHFT));57 (addr << PHY_ADDR_SHFT));
@@ -122,24 +66,15 @@ static int emac_mdio_read(struct mii_bus *bus, int addr, int regnum) · 8 unmodified lines
122 if (readl_poll_timeout(adpt->base + EMAC_MDIO_CTRL, reg,66 if (readl_poll_timeout(adpt->base + EMAC_MDIO_CTRL, reg,
123 !(reg & (MDIO_START | MDIO_BUSY)),67 !(reg & (MDIO_START | MDIO_BUSY)),
124 100, MDIO_WAIT_TIMES * 100))68 100, MDIO_WAIT_TIMES * 100))
125 ret = -EIO;69 return -EIO;
126 else
127 ret = (reg >> MDIO_DATA_SHFT) & MDIO_DATA_BMSK;
128 70
129 emac_phy_mdio_autopoll_enable(adpt);71 return (reg >> MDIO_DATA_SHFT) & MDIO_DATA_BMSK;
130
131 return ret;
132}72}
133 73
134static int emac_mdio_write(struct mii_bus *bus, int addr, int regnum, u16 val)74static int emac_mdio_write(struct mii_bus *bus, int addr, int regnum, u16 val)
135{75{
136 struct emac_adapter *adpt = bus->priv;76 struct emac_adapter *adpt = bus->priv;
137 u32 reg;77 u32 reg;
138 int ret;
139
140 ret = emac_phy_mdio_autopoll_disable(adpt);
141 if (ret)
142 return ret;
143 78
144 emac_reg_update32(adpt->base + EMAC_PHY_STS, PHY_ADDR_BMSK,79 emac_reg_update32(adpt->base + EMAC_PHY_STS, PHY_ADDR_BMSK,
145 (addr << PHY_ADDR_SHFT));80 (addr << PHY_ADDR_SHFT));
@@ -155,11 +90,9 @@ static int emac_mdio_write(struct mii_bus *bus, int addr, int regnum, u16 val) · 9 unmodified lines
155 if (readl_poll_timeout(adpt->base + EMAC_MDIO_CTRL, reg,90 if (readl_poll_timeout(adpt->base + EMAC_MDIO_CTRL, reg,
156 !(reg & (MDIO_START | MDIO_BUSY)), 100,91 !(reg & (MDIO_START | MDIO_BUSY)), 100,
157 MDIO_WAIT_TIMES * 100))92 MDIO_WAIT_TIMES * 100))
158 ret = -EIO;93 return -EIO;
159 94
160 emac_phy_mdio_autopoll_enable(adpt);95 return 0;
161
162 return ret;
163}96}
164 97
165/* Configure the MDIO bus and connect the external PHY */98/* Configure the MDIO bus and connect the external PHY */
drivers/net/ethernet/qualcomm/emac/emac.c+1−21
@@ -50,19 +50,7 @@ · 49 unmodified lines
50#define DMAR_DLY_CNT_DEF 1550#define DMAR_DLY_CNT_DEF 15
51#define DMAW_DLY_CNT_DEF 451#define DMAW_DLY_CNT_DEF 4
52 52
53#define IMR_NORMAL_MASK (\53#define IMR_NORMAL_MASK (ISR_ERROR | ISR_OVER | ISR_TX_PKT)
54 ISR_ERROR |\
55 ISR_GPHY_LINK |\
56 ISR_TX_PKT |\
57 GPHY_WAKEUP_INT)
58
59#define IMR_EXTENDED_MASK (\
60 SW_MAN_INT |\
61 ISR_OVER |\
62 ISR_ERROR |\
63 ISR_GPHY_LINK |\
64 ISR_TX_PKT |\
65 GPHY_WAKEUP_INT)
66 54
67#define ISR_TX_PKT (\55#define ISR_TX_PKT (\
68 TX_PKT_INT |\56 TX_PKT_INT |\
@@ -70,10 +58,6 @@ · 1 unmodified line
70 TX_PKT_INT2 |\58 TX_PKT_INT2 |\
71 TX_PKT_INT3)59 TX_PKT_INT3)
72 60
73#define ISR_GPHY_LINK (\
74 GPHY_LINK_UP_INT |\
75 GPHY_LINK_DOWN_INT)
76
77#define ISR_OVER (\61#define ISR_OVER (\
78 RFD0_UR_INT |\62 RFD0_UR_INT |\
79 RFD1_UR_INT |\63 RFD1_UR_INT |\
@@ -187,10 +171,6 @@ irqreturn_t emac_isr(int _irq, void *data) · 107 unmodified lines
187 if (status & ISR_OVER)171 if (status & ISR_OVER)
188 net_warn_ratelimited("warning: TX/RX overflow\n");172 net_warn_ratelimited("warning: TX/RX overflow\n");
189 173
190 /* link event */
191 if (status & ISR_GPHY_LINK)
192 phy_mac_interrupt(adpt->phydev, !!(status & GPHY_LINK_UP_INT));
193
194exit:174exit:
195 /* enable the interrupt */175 /* enable the interrupt */
196 writel(irq->mask, adpt->base + EMAC_INT_MASK);176 writel(irq->mask, adpt->base + EMAC_INT_MASK);
drivers/net/ethernet/renesas/ravb_main.c+12−12
@@ -230,18 +230,6 @@ static void ravb_ring_free(struct net_device *ndev, int q) · 229 unmodified lines
230 int ring_size;230 int ring_size;
231 int i;231 int i;
232 232
233 /* Free RX skb ringbuffer */
234 if (priv->rx_skb[q]) {
235 for (i = 0; i < priv->num_rx_ring[q]; i++)
236 dev_kfree_skb(priv->rx_skb[q][i]);
237 }
238 kfree(priv->rx_skb[q]);
239 priv->rx_skb[q] = NULL;
240
241 /* Free aligned TX buffers */
242 kfree(priv->tx_align[q]);
243 priv->tx_align[q] = NULL;
244
245 if (priv->rx_ring[q]) {233 if (priv->rx_ring[q]) {
246 for (i = 0; i < priv->num_rx_ring[q]; i++) {234 for (i = 0; i < priv->num_rx_ring[q]; i++) {
247 struct ravb_ex_rx_desc *desc = &priv->rx_ring[q][i];235 struct ravb_ex_rx_desc *desc = &priv->rx_ring[q][i];
@@ -270,6 +258,18 @@ static void ravb_ring_free(struct net_device *ndev, int q) · 22 unmodified lines
270 priv->tx_ring[q] = NULL;258 priv->tx_ring[q] = NULL;
271 }259 }
272 260
261 /* Free RX skb ringbuffer */
262 if (priv->rx_skb[q]) {
263 for (i = 0; i < priv->num_rx_ring[q]; i++)
264 dev_kfree_skb(priv->rx_skb[q][i]);
265 }
266 kfree(priv->rx_skb[q]);
267 priv->rx_skb[q] = NULL;
268
269 /* Free aligned TX buffers */
270 kfree(priv->tx_align[q]);
271 priv->tx_align[q] = NULL;
272
273 /* Free TX skb ringbuffer.273 /* Free TX skb ringbuffer.
274 * SKBs are freed by ravb_tx_free() call above.274 * SKBs are freed by ravb_tx_free() call above.
275 */275 */
drivers/net/ethernet/stmicro/stmmac/altr_tse_pcs.c+5−1
@@ -37,6 +37,7 @@ · 36 unmodified lines
37#define TSE_PCS_CONTROL_AN_EN_MASK BIT(12)37#define TSE_PCS_CONTROL_AN_EN_MASK BIT(12)
38#define TSE_PCS_CONTROL_REG 0x0038#define TSE_PCS_CONTROL_REG 0x00
39#define TSE_PCS_CONTROL_RESTART_AN_MASK BIT(9)39#define TSE_PCS_CONTROL_RESTART_AN_MASK BIT(9)
40#define TSE_PCS_CTRL_AUTONEG_SGMII 0x1140
40#define TSE_PCS_IF_MODE_REG 0x2841#define TSE_PCS_IF_MODE_REG 0x28
41#define TSE_PCS_LINK_TIMER_0_REG 0x2442#define TSE_PCS_LINK_TIMER_0_REG 0x24
42#define TSE_PCS_LINK_TIMER_1_REG 0x2643#define TSE_PCS_LINK_TIMER_1_REG 0x26
@@ -65,6 +66,7 @@ · 22 unmodified lines
65#define TSE_PCS_SW_RESET_TIMEOUT 10066#define TSE_PCS_SW_RESET_TIMEOUT 100
66#define TSE_PCS_USE_SGMII_AN_MASK BIT(1)67#define TSE_PCS_USE_SGMII_AN_MASK BIT(1)
67#define TSE_PCS_USE_SGMII_ENA BIT(0)68#define TSE_PCS_USE_SGMII_ENA BIT(0)
69#define TSE_PCS_IF_USE_SGMII 0x03
68 70
69#define SGMII_ADAPTER_CTRL_REG 0x0071#define SGMII_ADAPTER_CTRL_REG 0x00
70#define SGMII_ADAPTER_DISABLE 0x000172#define SGMII_ADAPTER_DISABLE 0x0001
@@ -101,7 +103,9 @@ int tse_pcs_init(void __iomem *base, struct tse_pcs *pcs) · 30 unmodified lines
101{103{
102 int ret = 0;104 int ret = 0;
103 105
104 writew(TSE_PCS_USE_SGMII_ENA, base + TSE_PCS_IF_MODE_REG);106 writew(TSE_PCS_IF_USE_SGMII, base + TSE_PCS_IF_MODE_REG);
107
108 writew(TSE_PCS_CTRL_AUTONEG_SGMII, base + TSE_PCS_CONTROL_REG);
105 109
106 writew(TSE_PCS_SGMII_LINK_TIMER_0, base + TSE_PCS_LINK_TIMER_0_REG);110 writew(TSE_PCS_SGMII_LINK_TIMER_0, base + TSE_PCS_LINK_TIMER_0_REG);
107 writew(TSE_PCS_SGMII_LINK_TIMER_1, base + TSE_PCS_LINK_TIMER_1_REG);111 writew(TSE_PCS_SGMII_LINK_TIMER_1, base + TSE_PCS_LINK_TIMER_1_REG);
drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c+7−4
@@ -214,13 +214,13 @@ static int dwmac4_wrback_get_tx_timestamp_status(struct dma_desc *p) · 213 unmodified lines
214{214{
215 /* Context type from W/B descriptor must be zero */215 /* Context type from W/B descriptor must be zero */
216 if (le32_to_cpu(p->des3) & TDES3_CONTEXT_TYPE)216 if (le32_to_cpu(p->des3) & TDES3_CONTEXT_TYPE)
217 return -EINVAL;217 return 0;
218 218
219 /* Tx Timestamp Status is 1 so des0 and des1'll have valid values */219 /* Tx Timestamp Status is 1 so des0 and des1'll have valid values */
220 if (le32_to_cpu(p->des3) & TDES3_TIMESTAMP_STATUS)220 if (le32_to_cpu(p->des3) & TDES3_TIMESTAMP_STATUS)
221 return 0;221 return 1;
222 222
223 return 1;223 return 0;
224}224}
225 225
226static inline u64 dwmac4_get_timestamp(void *desc, u32 ats)226static inline u64 dwmac4_get_timestamp(void *desc, u32 ats)
@@ -282,7 +282,10 @@ static int dwmac4_wrback_get_rx_timestamp_status(void *desc, u32 ats) · 55 unmodified lines
282 }282 }
283 }283 }
284exit:284exit:
285 return ret;285 if (likely(ret == 0))
286 return 1;
287
288 return 0;
286}289}
287 290
288static void dwmac4_rd_init_rx_desc(struct dma_desc *p, int disable_rx_ic,291static void dwmac4_rd_init_rx_desc(struct dma_desc *p, int disable_rx_ic,
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c+21−11
@@ -434,14 +434,14 @@ static void stmmac_get_tx_hwtstamp(struct stmmac_priv *priv, · 433 unmodified lines
434 return;434 return;
435 435
436 /* check tx tstamp status */436 /* check tx tstamp status */
437 if (!priv->hw->desc->get_tx_timestamp_status(p)) {437 if (priv->hw->desc->get_tx_timestamp_status(p)) {
438 /* get the valid tstamp */438 /* get the valid tstamp */
439 ns = priv->hw->desc->get_timestamp(p, priv->adv_ts);439 ns = priv->hw->desc->get_timestamp(p, priv->adv_ts);
440 440
441 memset(&shhwtstamp, 0, sizeof(struct skb_shared_hwtstamps));441 memset(&shhwtstamp, 0, sizeof(struct skb_shared_hwtstamps));
442 shhwtstamp.hwtstamp = ns_to_ktime(ns);442 shhwtstamp.hwtstamp = ns_to_ktime(ns);
443 443
444 netdev_info(priv->dev, "get valid TX hw timestamp %llu\n", ns);444 netdev_dbg(priv->dev, "get valid TX hw timestamp %llu\n", ns);
445 /* pass tstamp to stack */445 /* pass tstamp to stack */
446 skb_tstamp_tx(skb, &shhwtstamp);446 skb_tstamp_tx(skb, &shhwtstamp);
447 }447 }
@@ -468,19 +468,19 @@ static void stmmac_get_rx_hwtstamp(struct stmmac_priv *priv, struct dma_desc *p, · 20 unmodified lines
468 return;468 return;
469 469
470 /* Check if timestamp is available */470 /* Check if timestamp is available */
471 if (!priv->hw->desc->get_rx_timestamp_status(p, priv->adv_ts)) {471 if (priv->hw->desc->get_rx_timestamp_status(p, priv->adv_ts)) {
472 /* For GMAC4, the valid timestamp is from CTX next desc. */472 /* For GMAC4, the valid timestamp is from CTX next desc. */
473 if (priv->plat->has_gmac4)473 if (priv->plat->has_gmac4)
474 ns = priv->hw->desc->get_timestamp(np, priv->adv_ts);474 ns = priv->hw->desc->get_timestamp(np, priv->adv_ts);
475 else475 else
476 ns = priv->hw->desc->get_timestamp(p, priv->adv_ts);476 ns = priv->hw->desc->get_timestamp(p, priv->adv_ts);
477 477
478 netdev_info(priv->dev, "get valid RX hw timestamp %llu\n", ns);478 netdev_dbg(priv->dev, "get valid RX hw timestamp %llu\n", ns);
479 shhwtstamp = skb_hwtstamps(skb);479 shhwtstamp = skb_hwtstamps(skb);
480 memset(shhwtstamp, 0, sizeof(struct skb_shared_hwtstamps));480 memset(shhwtstamp, 0, sizeof(struct skb_shared_hwtstamps));
481 shhwtstamp->hwtstamp = ns_to_ktime(ns);481 shhwtstamp->hwtstamp = ns_to_ktime(ns);
482 } else {482 } else {
483 netdev_err(priv->dev, "cannot get RX hw timestamp\n");483 netdev_dbg(priv->dev, "cannot get RX hw timestamp\n");
484 }484 }
485}485}
486 486
@@ -546,7 +546,10 @@ static int stmmac_hwtstamp_ioctl(struct net_device *dev, struct ifreq *ifr) · 59 unmodified lines
546 /* PTP v1, UDP, any kind of event packet */546 /* PTP v1, UDP, any kind of event packet */
547 config.rx_filter = HWTSTAMP_FILTER_PTP_V1_L4_EVENT;547 config.rx_filter = HWTSTAMP_FILTER_PTP_V1_L4_EVENT;
548 /* take time stamp for all event messages */548 /* take time stamp for all event messages */
549 snap_type_sel = PTP_TCR_SNAPTYPSEL_1;549 if (priv->plat->has_gmac4)
550 snap_type_sel = PTP_GMAC4_TCR_SNAPTYPSEL_1;
551 else
552 snap_type_sel = PTP_TCR_SNAPTYPSEL_1;
550 553
551 ptp_over_ipv4_udp = PTP_TCR_TSIPV4ENA;554 ptp_over_ipv4_udp = PTP_TCR_TSIPV4ENA;
552 ptp_over_ipv6_udp = PTP_TCR_TSIPV6ENA;555 ptp_over_ipv6_udp = PTP_TCR_TSIPV6ENA;
@@ -578,7 +581,10 @@ static int stmmac_hwtstamp_ioctl(struct net_device *dev, struct ifreq *ifr) · 25 unmodified lines
578 config.rx_filter = HWTSTAMP_FILTER_PTP_V2_L4_EVENT;581 config.rx_filter = HWTSTAMP_FILTER_PTP_V2_L4_EVENT;
579 ptp_v2 = PTP_TCR_TSVER2ENA;582 ptp_v2 = PTP_TCR_TSVER2ENA;
580 /* take time stamp for all event messages */583 /* take time stamp for all event messages */
581 snap_type_sel = PTP_TCR_SNAPTYPSEL_1;584 if (priv->plat->has_gmac4)
585 snap_type_sel = PTP_GMAC4_TCR_SNAPTYPSEL_1;
586 else
587 snap_type_sel = PTP_TCR_SNAPTYPSEL_1;
582 588
583 ptp_over_ipv4_udp = PTP_TCR_TSIPV4ENA;589 ptp_over_ipv4_udp = PTP_TCR_TSIPV4ENA;
584 ptp_over_ipv6_udp = PTP_TCR_TSIPV6ENA;590 ptp_over_ipv6_udp = PTP_TCR_TSIPV6ENA;
@@ -612,7 +618,10 @@ static int stmmac_hwtstamp_ioctl(struct net_device *dev, struct ifreq *ifr) · 27 unmodified lines
612 config.rx_filter = HWTSTAMP_FILTER_PTP_V2_EVENT;618 config.rx_filter = HWTSTAMP_FILTER_PTP_V2_EVENT;
613 ptp_v2 = PTP_TCR_TSVER2ENA;619 ptp_v2 = PTP_TCR_TSVER2ENA;
614 /* take time stamp for all event messages */620 /* take time stamp for all event messages */
615 snap_type_sel = PTP_TCR_SNAPTYPSEL_1;621 if (priv->plat->has_gmac4)
622 snap_type_sel = PTP_GMAC4_TCR_SNAPTYPSEL_1;
623 else
624 snap_type_sel = PTP_TCR_SNAPTYPSEL_1;
616 625
617 ptp_over_ipv4_udp = PTP_TCR_TSIPV4ENA;626 ptp_over_ipv4_udp = PTP_TCR_TSIPV4ENA;
618 ptp_over_ipv6_udp = PTP_TCR_TSIPV6ENA;627 ptp_over_ipv6_udp = PTP_TCR_TSIPV6ENA;
@@ -1208,7 +1217,7 @@ static int init_dma_rx_desc_rings(struct net_device *dev, gfp_t flags) · 589 unmodified lines
1208 u32 rx_count = priv->plat->rx_queues_to_use;1217 u32 rx_count = priv->plat->rx_queues_to_use;
1209 unsigned int bfsize = 0;1218 unsigned int bfsize = 0;
1210 int ret = -ENOMEM;1219 int ret = -ENOMEM;
1211 u32 queue;1220 int queue;
1212 int i;1221 int i;
1213 1222
1214 if (priv->hw->mode->set_16kib_bfsize)1223 if (priv->hw->mode->set_16kib_bfsize)
@@ -2724,7 +2733,7 @@ static void stmmac_tso_allocator(struct stmmac_priv *priv, unsigned int des, · 1509 unmodified lines
2724 2733
2725 priv->hw->desc->prepare_tso_tx_desc(desc, 0, buff_size,2734 priv->hw->desc->prepare_tso_tx_desc(desc, 0, buff_size,
2726 0, 1,2735 0, 1,
2727 (last_segment) && (buff_size < TSO_MAX_BUFF_SIZE),2736 (last_segment) && (tmp_len <= TSO_MAX_BUFF_SIZE),
2728 0, 0);2737 0, 0);
2729 2738
2730 tmp_len -= TSO_MAX_BUFF_SIZE;2739 tmp_len -= TSO_MAX_BUFF_SIZE;
@@ -2947,7 +2956,8 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev) · 216 unmodified lines
2947 int i, csum_insertion = 0, is_jumbo = 0;2956 int i, csum_insertion = 0, is_jumbo = 0;
2948 u32 queue = skb_get_queue_mapping(skb);2957 u32 queue = skb_get_queue_mapping(skb);
2949 int nfrags = skb_shinfo(skb)->nr_frags;2958 int nfrags = skb_shinfo(skb)->nr_frags;
2950 unsigned int entry, first_entry;2959 int entry;
2960 unsigned int first_entry;
2951 struct dma_desc *desc, *first;2961 struct dma_desc *desc, *first;
2952 struct stmmac_tx_queue *tx_q;2962 struct stmmac_tx_queue *tx_q;
2953 unsigned int enh_desc;2963 unsigned int enh_desc;
drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.h+2−1
@@ -59,7 +59,8 @@ · 58 unmodified lines
59/* Enable Snapshot for Messages Relevant to Master */59/* Enable Snapshot for Messages Relevant to Master */
60#define PTP_TCR_TSMSTRENA BIT(15)60#define PTP_TCR_TSMSTRENA BIT(15)
61/* Select PTP packets for Taking Snapshots */61/* Select PTP packets for Taking Snapshots */
62#define PTP_TCR_SNAPTYPSEL_1 GENMASK(17, 16)62#define PTP_TCR_SNAPTYPSEL_1 BIT(16)
63#define PTP_GMAC4_TCR_SNAPTYPSEL_1 GENMASK(17, 16)
63/* Enable MAC address for PTP Frame Filtering */64/* Enable MAC address for PTP Frame Filtering */
64#define PTP_TCR_TSENMACADDR BIT(18)65#define PTP_TCR_TSENMACADDR BIT(18)
65 66
drivers/net/geneve.c+2−2
@@ -1007,7 +1007,7 @@ static void geneve_setup(struct net_device *dev) · 1006 unmodified lines
1007 1007
1008 dev->netdev_ops = &geneve_netdev_ops;1008 dev->netdev_ops = &geneve_netdev_ops;
1009 dev->ethtool_ops = &geneve_ethtool_ops;1009 dev->ethtool_ops = &geneve_ethtool_ops;
1010 dev->destructor = free_netdev;1010 dev->needs_free_netdev = true;
1011 1011
1012 SET_NETDEV_DEVTYPE(dev, &geneve_type);1012 SET_NETDEV_DEVTYPE(dev, &geneve_type);
1013 1013
@@ -1133,7 +1133,7 @@ static int geneve_configure(struct net *net, struct net_device *dev, · 119 unmodified lines
1133 1133
1134 /* make enough headroom for basic scenario */1134 /* make enough headroom for basic scenario */
1135 encap_len = GENEVE_BASE_HLEN + ETH_HLEN;1135 encap_len = GENEVE_BASE_HLEN + ETH_HLEN;
1136 if (ip_tunnel_info_af(info) == AF_INET) {1136 if (!metadata && ip_tunnel_info_af(info) == AF_INET) {
1137 encap_len += sizeof(struct iphdr);1137 encap_len += sizeof(struct iphdr);
1138 dev->max_mtu -= sizeof(struct iphdr);1138 dev->max_mtu -= sizeof(struct iphdr);
1139 } else {1139 } else {
drivers/net/gtp.c+1−1
@@ -611,7 +611,7 @@ static const struct net_device_ops gtp_netdev_ops = { · 610 unmodified lines
611static void gtp_link_setup(struct net_device *dev)611static void gtp_link_setup(struct net_device *dev)
612{612{
613 dev->netdev_ops = &gtp_netdev_ops;613 dev->netdev_ops = &gtp_netdev_ops;
614 dev->destructor = free_netdev;614 dev->needs_free_netdev = true;
615 615
616 dev->hard_header_len = 0;616 dev->hard_header_len = 0;
617 dev->addr_len = 0;617 dev->addr_len = 0;
drivers/net/hamradio/6pack.c+1−1
@@ -311,7 +311,7 @@ static void sp_setup(struct net_device *dev) · 310 unmodified lines
311{311{
312 /* Finish setting up the DEVICE info. */312 /* Finish setting up the DEVICE info. */
313 dev->netdev_ops = &sp_netdev_ops;313 dev->netdev_ops = &sp_netdev_ops;
314 dev->destructor = free_netdev;314 dev->needs_free_netdev = true;
315 dev->mtu = SIXP_MTU;315 dev->mtu = SIXP_MTU;
316 dev->hard_header_len = AX25_MAX_HEADER_LEN;316 dev->hard_header_len = AX25_MAX_HEADER_LEN;
317 dev->header_ops = &ax25_header_ops;317 dev->header_ops = &ax25_header_ops;
drivers/net/hamradio/bpqether.c+1−1
@@ -476,7 +476,7 @@ static const struct net_device_ops bpq_netdev_ops = { · 475 unmodified lines
476static void bpq_setup(struct net_device *dev)476static void bpq_setup(struct net_device *dev)
477{477{
478 dev->netdev_ops = &bpq_netdev_ops;478 dev->netdev_ops = &bpq_netdev_ops;
479 dev->destructor = free_netdev;479 dev->needs_free_netdev = true;
480 480
481 memcpy(dev->broadcast, &ax25_bcast, AX25_ADDR_LEN);481 memcpy(dev->broadcast, &ax25_bcast, AX25_ADDR_LEN);
482 memcpy(dev->dev_addr, &ax25_defaddr, AX25_ADDR_LEN);482 memcpy(dev->dev_addr, &ax25_defaddr, AX25_ADDR_LEN);
drivers/net/hamradio/hdlcdrv.c+2−0
@@ -576,6 +576,8 @@ static int hdlcdrv_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) · 575 unmodified lines
576 case HDLCDRVCTL_CALIBRATE:576 case HDLCDRVCTL_CALIBRATE:
577 if(!capable(CAP_SYS_RAWIO))577 if(!capable(CAP_SYS_RAWIO))
578 return -EPERM;578 return -EPERM;
579 if (s->par.bitrate <= 0)
580 return -EINVAL;
579 if (bi.data.calibrate > INT_MAX / s->par.bitrate)581 if (bi.data.calibrate > INT_MAX / s->par.bitrate)
580 return -EINVAL;582 return -EINVAL;
581 s->hdlctx.calibrate = bi.data.calibrate * s->par.bitrate / 16;583 s->hdlctx.calibrate = bi.data.calibrate * s->par.bitrate / 16;
drivers/net/hyperv/hyperv_net.h+3−2
@@ -171,6 +171,8 @@ struct rndis_device { · 170 unmodified lines
171 spinlock_t request_lock;171 spinlock_t request_lock;
172 struct list_head req_list;172 struct list_head req_list;
173 173
174 struct work_struct mcast_work;
175
174 u8 hw_mac_adr[ETH_ALEN];176 u8 hw_mac_adr[ETH_ALEN];
175 u8 rss_key[NETVSC_HASH_KEYLEN];177 u8 rss_key[NETVSC_HASH_KEYLEN];
176 u16 ind_table[ITAB_NUM];178 u16 ind_table[ITAB_NUM];
@@ -201,6 +203,7 @@ int rndis_filter_open(struct netvsc_device *nvdev); · 24 unmodified lines
201int rndis_filter_close(struct netvsc_device *nvdev);203int rndis_filter_close(struct netvsc_device *nvdev);
202int rndis_filter_device_add(struct hv_device *dev,204int rndis_filter_device_add(struct hv_device *dev,
203 struct netvsc_device_info *info);205 struct netvsc_device_info *info);
206void rndis_filter_update(struct netvsc_device *nvdev);
204void rndis_filter_device_remove(struct hv_device *dev,207void rndis_filter_device_remove(struct hv_device *dev,
205 struct netvsc_device *nvdev);208 struct netvsc_device *nvdev);
206int rndis_filter_set_rss_param(struct rndis_device *rdev,209int rndis_filter_set_rss_param(struct rndis_device *rdev,
@@ -211,7 +214,6 @@ int rndis_filter_receive(struct net_device *ndev, · 4 unmodified lines
211 struct vmbus_channel *channel,214 struct vmbus_channel *channel,
212 void *data, u32 buflen);215 void *data, u32 buflen);
213 216
214int rndis_filter_set_packet_filter(struct rndis_device *dev, u32 new_filter);
215int rndis_filter_set_device_mac(struct net_device *ndev, char *mac);217int rndis_filter_set_device_mac(struct net_device *ndev, char *mac);
216 218
217void netvsc_switch_datapath(struct net_device *nv_dev, bool vf);219void netvsc_switch_datapath(struct net_device *nv_dev, bool vf);
@@ -696,7 +698,6 @@ struct net_device_context { · 478 unmodified lines
696 /* list protection */698 /* list protection */
697 spinlock_t lock;699 spinlock_t lock;
698 700
699 struct work_struct work;
700 u32 msg_enable; /* debug level */701 u32 msg_enable; /* debug level */
701 702
702 u32 tx_checksum_mask;703 u32 tx_checksum_mask;
drivers/net/hyperv/netvsc_drv.c+18−36
@@ -56,37 +56,12 @@ static int debug = -1; · 55 unmodified lines
56module_param(debug, int, S_IRUGO);56module_param(debug, int, S_IRUGO);
57MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)");57MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)");
58 58
59static void do_set_multicast(struct work_struct *w)
60{
61 struct net_device_context *ndevctx =
62 container_of(w, struct net_device_context, work);
63 struct hv_device *device_obj = ndevctx->device_ctx;
64 struct net_device *ndev = hv_get_drvdata(device_obj);
65 struct netvsc_device *nvdev = rcu_dereference(ndevctx->nvdev);
66 struct rndis_device *rdev;
67
68 if (!nvdev)
69 return;
70
71 rdev = nvdev->extension;
72 if (rdev == NULL)
73 return;
74
75 if (ndev->flags & IFF_PROMISC)
76 rndis_filter_set_packet_filter(rdev,
77 NDIS_PACKET_TYPE_PROMISCUOUS);
78 else
79 rndis_filter_set_packet_filter(rdev,
80 NDIS_PACKET_TYPE_BROADCAST |
81 NDIS_PACKET_TYPE_ALL_MULTICAST |
82 NDIS_PACKET_TYPE_DIRECTED);
83}
84
85static void netvsc_set_multicast_list(struct net_device *net)59static void netvsc_set_multicast_list(struct net_device *net)
86{60{
87 struct net_device_context *net_device_ctx = netdev_priv(net);61 struct net_device_context *net_device_ctx = netdev_priv(net);
62 struct netvsc_device *nvdev = rtnl_dereference(net_device_ctx->nvdev);
88 63
89 schedule_work(&net_device_ctx->work);64 rndis_filter_update(nvdev);
90}65}
91 66
92static int netvsc_open(struct net_device *net)67static int netvsc_open(struct net_device *net)
@@ -123,8 +98,6 @@ static int netvsc_close(struct net_device *net) · 30 unmodified lines
123 98
124 netif_tx_disable(net);99 netif_tx_disable(net);
125 100
126 /* Make sure netvsc_set_multicast_list doesn't re-enable filter! */
127 cancel_work_sync(&net_device_ctx->work);
128 ret = rndis_filter_close(nvdev);101 ret = rndis_filter_close(nvdev);
129 if (ret != 0) {102 if (ret != 0) {
130 netdev_err(net, "unable to close device (ret %d).\n", ret);103 netdev_err(net, "unable to close device (ret %d).\n", ret);
@@ -1028,7 +1001,7 @@ static const struct { · 897 unmodified lines
1028static int netvsc_get_sset_count(struct net_device *dev, int string_set)1001static int netvsc_get_sset_count(struct net_device *dev, int string_set)
1029{1002{
1030 struct net_device_context *ndc = netdev_priv(dev);1003 struct net_device_context *ndc = netdev_priv(dev);
1031 struct netvsc_device *nvdev = rcu_dereference(ndc->nvdev);1004 struct netvsc_device *nvdev = rtnl_dereference(ndc->nvdev);
1032 1005
1033 if (!nvdev)1006 if (!nvdev)
1034 return -ENODEV;1007 return -ENODEV;
@@ -1158,11 +1131,22 @@ netvsc_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *info, · 123 unmodified lines
1158}1131}
1159 1132
1160#ifdef CONFIG_NET_POLL_CONTROLLER1133#ifdef CONFIG_NET_POLL_CONTROLLER
1161static void netvsc_poll_controller(struct net_device *net)1134static void netvsc_poll_controller(struct net_device *dev)
1162{1135{
1163 /* As netvsc_start_xmit() works synchronous we don't have to1136 struct net_device_context *ndc = netdev_priv(dev);
1164 * trigger anything here.1137 struct netvsc_device *ndev;
1165 */1138 int i;
1139
1140 rcu_read_lock();
1141 ndev = rcu_dereference(ndc->nvdev);
1142 if (ndev) {
1143 for (i = 0; i < ndev->num_chn; i++) {
1144 struct netvsc_channel *nvchan = &ndev->chan_table[i];
1145
1146 napi_schedule(&nvchan->napi);
1147 }
1148 }
1149 rcu_read_unlock();
1166}1150}
1167#endif1151#endif
1168 1152
@@ -1552,7 +1536,6 @@ static int netvsc_probe(struct hv_device *dev, · 383 unmodified lines
1552 hv_set_drvdata(dev, net);1536 hv_set_drvdata(dev, net);
1553 1537
1554 INIT_DELAYED_WORK(&net_device_ctx->dwork, netvsc_link_change);1538 INIT_DELAYED_WORK(&net_device_ctx->dwork, netvsc_link_change);
1555 INIT_WORK(&net_device_ctx->work, do_set_multicast);
1556 1539
1557 spin_lock_init(&net_device_ctx->lock);1540 spin_lock_init(&net_device_ctx->lock);
1558 INIT_LIST_HEAD(&net_device_ctx->reconfig_events);1541 INIT_LIST_HEAD(&net_device_ctx->reconfig_events);
@@ -1622,7 +1605,6 @@ static int netvsc_remove(struct hv_device *dev) · 63 unmodified lines
1622 netif_device_detach(net);1605 netif_device_detach(net);
1623 1606
1624 cancel_delayed_work_sync(&ndev_ctx->dwork);1607 cancel_delayed_work_sync(&ndev_ctx->dwork);
1625 cancel_work_sync(&ndev_ctx->work);
1626 1608
1627 /*1609 /*
1628 * Call to the vsc driver to let it know that the device is being1610 * Call to the vsc driver to let it know that the device is being
drivers/net/hyperv/rndis_filter.c+29−1
@@ -31,6 +31,7 @@ · 30 unmodified lines
31 31
32#include "hyperv_net.h"32#include "hyperv_net.h"
33 33
34static void rndis_set_multicast(struct work_struct *w);
34 35
35#define RNDIS_EXT_LEN PAGE_SIZE36#define RNDIS_EXT_LEN PAGE_SIZE
36struct rndis_request {37struct rndis_request {
@@ -76,6 +77,7 @@ static struct rndis_device *get_rndis_device(void) · 39 unmodified lines
76 spin_lock_init(&device->request_lock);77 spin_lock_init(&device->request_lock);
77 78
78 INIT_LIST_HEAD(&device->req_list);79 INIT_LIST_HEAD(&device->req_list);
80 INIT_WORK(&device->mcast_work, rndis_set_multicast);
79 81
80 device->state = RNDIS_DEV_UNINITIALIZED;82 device->state = RNDIS_DEV_UNINITIALIZED;
81 83
@@ -815,7 +817,8 @@ static int rndis_filter_query_link_speed(struct rndis_device *dev) · 733 unmodified lines
815 return ret;817 return ret;
816}818}
817 819
818int rndis_filter_set_packet_filter(struct rndis_device *dev, u32 new_filter)820static int rndis_filter_set_packet_filter(struct rndis_device *dev,
821 u32 new_filter)
819{822{
820 struct rndis_request *request;823 struct rndis_request *request;
821 struct rndis_set_request *set;824 struct rndis_set_request *set;
@@ -846,6 +849,28 @@ int rndis_filter_set_packet_filter(struct rndis_device *dev, u32 new_filter) · 24 unmodified lines
846 return ret;849 return ret;
847}850}
848 851
852static void rndis_set_multicast(struct work_struct *w)
853{
854 struct rndis_device *rdev
855 = container_of(w, struct rndis_device, mcast_work);
856
857 if (rdev->ndev->flags & IFF_PROMISC)
858 rndis_filter_set_packet_filter(rdev,
859 NDIS_PACKET_TYPE_PROMISCUOUS);
860 else
861 rndis_filter_set_packet_filter(rdev,
862 NDIS_PACKET_TYPE_BROADCAST |
863 NDIS_PACKET_TYPE_ALL_MULTICAST |
864 NDIS_PACKET_TYPE_DIRECTED);
865}
866
867void rndis_filter_update(struct netvsc_device *nvdev)
868{
869 struct rndis_device *rdev = nvdev->extension;
870
871 schedule_work(&rdev->mcast_work);
872}
873
849static int rndis_filter_init_device(struct rndis_device *dev)874static int rndis_filter_init_device(struct rndis_device *dev)
850{875{
851 struct rndis_request *request;876 struct rndis_request *request;
@@ -973,6 +998,9 @@ static int rndis_filter_close_device(struct rndis_device *dev) · 121 unmodified lines
973 if (dev->state != RNDIS_DEV_DATAINITIALIZED)998 if (dev->state != RNDIS_DEV_DATAINITIALIZED)
974 return 0;999 return 0;
975 1000
1001 /* Make sure rndis_set_multicast doesn't re-enable filter! */
1002 cancel_work_sync(&dev->mcast_work);
1003
976 ret = rndis_filter_set_packet_filter(dev, 0);1004 ret = rndis_filter_set_packet_filter(dev, 0);
977 if (ret == -ENODEV)1005 if (ret == -ENODEV)
978 ret = 0;1006 ret = 0;
drivers/net/ifb.c+2−2
@@ -207,7 +207,6 @@ static void ifb_dev_free(struct net_device *dev) · 206 unmodified lines
207 __skb_queue_purge(&txp->tq);207 __skb_queue_purge(&txp->tq);
208 }208 }
209 kfree(dp->tx_private);209 kfree(dp->tx_private);
210 free_netdev(dev);
211}210}
212 211
213static void ifb_setup(struct net_device *dev)212static void ifb_setup(struct net_device *dev)
@@ -230,7 +229,8 @@ static void ifb_setup(struct net_device *dev) · 16 unmodified lines
230 dev->priv_flags &= ~IFF_TX_SKB_SHARING;229 dev->priv_flags &= ~IFF_TX_SKB_SHARING;
231 netif_keep_dst(dev);230 netif_keep_dst(dev);
232 eth_hw_addr_random(dev);231 eth_hw_addr_random(dev);
233 dev->destructor = ifb_dev_free;232 dev->needs_free_netdev = true;
233 dev->priv_destructor = ifb_dev_free;
234}234}
235 235
236static netdev_tx_t ifb_xmit(struct sk_buff *skb, struct net_device *dev)236static netdev_tx_t ifb_xmit(struct sk_buff *skb, struct net_device *dev)
drivers/net/ipvlan/ipvlan_main.c+1−1
@@ -632,7 +632,7 @@ void ipvlan_link_setup(struct net_device *dev) · 631 unmodified lines
632 dev->priv_flags &= ~(IFF_XMIT_DST_RELEASE | IFF_TX_SKB_SHARING);632 dev->priv_flags &= ~(IFF_XMIT_DST_RELEASE | IFF_TX_SKB_SHARING);
633 dev->priv_flags |= IFF_UNICAST_FLT | IFF_NO_QUEUE;633 dev->priv_flags |= IFF_UNICAST_FLT | IFF_NO_QUEUE;
634 dev->netdev_ops = &ipvlan_netdev_ops;634 dev->netdev_ops = &ipvlan_netdev_ops;
635 dev->destructor = free_netdev;635 dev->needs_free_netdev = true;
636 dev->header_ops = &ipvlan_header_ops;636 dev->header_ops = &ipvlan_header_ops;
637 dev->ethtool_ops = &ipvlan_ethtool_ops;637 dev->ethtool_ops = &ipvlan_ethtool_ops;
638}638}
drivers/net/loopback.c+2−2
@@ -159,7 +159,6 @@ static void loopback_dev_free(struct net_device *dev) · 158 unmodified lines
159{159{
160 dev_net(dev)->loopback_dev = NULL;160 dev_net(dev)->loopback_dev = NULL;
161 free_percpu(dev->lstats);161 free_percpu(dev->lstats);
162 free_netdev(dev);
163}162}
164 163
165static const struct net_device_ops loopback_ops = {164static const struct net_device_ops loopback_ops = {
@@ -196,7 +195,8 @@ static void loopback_setup(struct net_device *dev) · 30 unmodified lines
196 dev->ethtool_ops = &loopback_ethtool_ops;195 dev->ethtool_ops = &loopback_ethtool_ops;
197 dev->header_ops = &eth_header_ops;196 dev->header_ops = &eth_header_ops;
198 dev->netdev_ops = &loopback_ops;197 dev->netdev_ops = &loopback_ops;
199 dev->destructor = loopback_dev_free;198 dev->needs_free_netdev = true;
199 dev->priv_destructor = loopback_dev_free;
200}200}
201 201
202/* Setup and register the loopback device. */202/* Setup and register the loopback device. */
drivers/net/macsec.c+2−2
@@ -2996,7 +2996,6 @@ static void macsec_free_netdev(struct net_device *dev) · 2995 unmodified lines
2996 free_percpu(macsec->secy.tx_sc.stats);2996 free_percpu(macsec->secy.tx_sc.stats);
2997 2997
2998 dev_put(real_dev);2998 dev_put(real_dev);
2999 free_netdev(dev);
3000}2999}
3001 3000
3002static void macsec_setup(struct net_device *dev)3001static void macsec_setup(struct net_device *dev)
@@ -3006,7 +3005,8 @@ static void macsec_setup(struct net_device *dev) · 3 unmodified lines
3006 dev->max_mtu = ETH_MAX_MTU;3005 dev->max_mtu = ETH_MAX_MTU;
3007 dev->priv_flags |= IFF_NO_QUEUE;3006 dev->priv_flags |= IFF_NO_QUEUE;
3008 dev->netdev_ops = &macsec_netdev_ops;3007 dev->netdev_ops = &macsec_netdev_ops;
3009 dev->destructor = macsec_free_netdev;3008 dev->needs_free_netdev = true;
3009 dev->priv_destructor = macsec_free_netdev;
3010 SET_NETDEV_DEVTYPE(dev, &macsec_type);3010 SET_NETDEV_DEVTYPE(dev, &macsec_type);
3011 3011
3012 eth_zero_addr(dev->broadcast);3012 eth_zero_addr(dev->broadcast);
drivers/net/macvlan.c+1−1
@@ -1092,7 +1092,7 @@ void macvlan_common_setup(struct net_device *dev) · 1091 unmodified lines
1092 netif_keep_dst(dev);1092 netif_keep_dst(dev);
1093 dev->priv_flags |= IFF_UNICAST_FLT;1093 dev->priv_flags |= IFF_UNICAST_FLT;
1094 dev->netdev_ops = &macvlan_netdev_ops;1094 dev->netdev_ops = &macvlan_netdev_ops;
1095 dev->destructor = free_netdev;1095 dev->needs_free_netdev = true;
1096 dev->header_ops = &macvlan_hard_header_ops;1096 dev->header_ops = &macvlan_hard_header_ops;
1097 dev->ethtool_ops = &macvlan_ethtool_ops;1097 dev->ethtool_ops = &macvlan_ethtool_ops;
1098}1098}
drivers/net/netconsole.c+1−1
@@ -358,7 +358,7 @@ static ssize_t enabled_store(struct config_item *item, · 357 unmodified lines
358 if (err)358 if (err)
359 goto out_unlock;359 goto out_unlock;
360 360
361 pr_info("netconsole: network logging started\n");361 pr_info("network logging started\n");
362 } else { /* false */362 } else { /* false */
363 /* We need to disable the netconsole before cleaning it up363 /* We need to disable the netconsole before cleaning it up
364 * otherwise we might end up in write_msg() with364 * otherwise we might end up in write_msg() with
drivers/net/nlmon.c+1−1
@@ -113,7 +113,7 @@ static void nlmon_setup(struct net_device *dev) · 112 unmodified lines
113 113
114 dev->netdev_ops = &nlmon_ops;114 dev->netdev_ops = &nlmon_ops;
115 dev->ethtool_ops = &nlmon_ethtool_ops;115 dev->ethtool_ops = &nlmon_ethtool_ops;
116 dev->destructor = free_netdev;116 dev->needs_free_netdev = true;
117 117
118 dev->features = NETIF_F_SG | NETIF_F_FRAGLIST |118 dev->features = NETIF_F_SG | NETIF_F_FRAGLIST |
119 NETIF_F_HIGHDMA | NETIF_F_LLTX;119 NETIF_F_HIGHDMA | NETIF_F_LLTX;
drivers/net/phy/Kconfig+1−0
@@ -127,6 +127,7 @@ config MDIO_THUNDER · 126 unmodified lines
127 tristate "ThunderX SOCs MDIO buses"127 tristate "ThunderX SOCs MDIO buses"
128 depends on 64BIT128 depends on 64BIT
129 depends on PCI129 depends on PCI
130 depends on !(MDIO_DEVICE=y && PHYLIB=m)
130 select MDIO_CAVIUM131 select MDIO_CAVIUM
131 help132 help
132 This driver supports the MDIO interfaces found on Cavium133 This driver supports the MDIO interfaces found on Cavium
drivers/net/phy/marvell.c+0−2
@@ -1127,8 +1127,6 @@ static int marvell_read_status_page(struct phy_device *phydev, int page) · 1126 unmodified lines
1127 if (adv < 0)1127 if (adv < 0)
1128 return adv;1128 return adv;
1129 1129
1130 lpa &= adv;
1131
1132 if (status & MII_M1011_PHY_STATUS_FULLDUPLEX)1130 if (status & MII_M1011_PHY_STATUS_FULLDUPLEX)
1133 phydev->duplex = DUPLEX_FULL;1131 phydev->duplex = DUPLEX_FULL;
1134 else1132 else
drivers/net/phy/mdio_bus.c+13−0
@@ -658,6 +658,18 @@ static int mdio_bus_match(struct device *dev, struct device_driver *drv) · 657 unmodified lines
658 return 0;658 return 0;
659}659}
660 660
661static int mdio_uevent(struct device *dev, struct kobj_uevent_env *env)
662{
663 int rc;
664
665 /* Some devices have extra OF data and an OF-style MODALIAS */
666 rc = of_device_uevent_modalias(dev, env);
667 if (rc != -ENODEV)
668 return rc;
669
670 return 0;
671}
672
661#ifdef CONFIG_PM673#ifdef CONFIG_PM
662static int mdio_bus_suspend(struct device *dev)674static int mdio_bus_suspend(struct device *dev)
663{675{
@@ -708,6 +720,7 @@ static const struct dev_pm_ops mdio_bus_pm_ops = { · 44 unmodified lines
708struct bus_type mdio_bus_type = {720struct bus_type mdio_bus_type = {
709 .name = "mdio_bus",721 .name = "mdio_bus",
710 .match = mdio_bus_match,722 .match = mdio_bus_match,
723 .uevent = mdio_uevent,
711 .pm = MDIO_BUS_PM_OPS,724 .pm = MDIO_BUS_PM_OPS,
712};725};
713EXPORT_SYMBOL(mdio_bus_type);726EXPORT_SYMBOL(mdio_bus_type);
drivers/net/phy/micrel.c+28−14
@@ -268,23 +268,12 @@ out: · 267 unmodified lines
268 return ret;268 return ret;
269}269}
270 270
271static int kszphy_config_init(struct phy_device *phydev)271/* Some config bits need to be set again on resume, handle them here. */
272static int kszphy_config_reset(struct phy_device *phydev)
272{273{
273 struct kszphy_priv *priv = phydev->priv;274 struct kszphy_priv *priv = phydev->priv;
274 const struct kszphy_type *type;
275 int ret;275 int ret;
276 276
277 if (!priv)
278 return 0;
279
280 type = priv->type;
281
282 if (type->has_broadcast_disable)
283 kszphy_broadcast_disable(phydev);
284
285 if (type->has_nand_tree_disable)
286 kszphy_nand_tree_disable(phydev);
287
288 if (priv->rmii_ref_clk_sel) {277 if (priv->rmii_ref_clk_sel) {
289 ret = kszphy_rmii_clk_sel(phydev, priv->rmii_ref_clk_sel_val);278 ret = kszphy_rmii_clk_sel(phydev, priv->rmii_ref_clk_sel_val);
290 if (ret) {279 if (ret) {
@@ -295,11 +284,30 @@ static int kszphy_config_init(struct phy_device *phydev) · 4 unmodified lines
295 }284 }
296 285
297 if (priv->led_mode >= 0)286 if (priv->led_mode >= 0)
298 kszphy_setup_led(phydev, type->led_mode_reg, priv->led_mode);287 kszphy_setup_led(phydev, priv->type->led_mode_reg, priv->led_mode);
299 288
300 return 0;289 return 0;
301}290}
302 291
292static int kszphy_config_init(struct phy_device *phydev)
293{
294 struct kszphy_priv *priv = phydev->priv;
295 const struct kszphy_type *type;
296
297 if (!priv)
298 return 0;
299
300 type = priv->type;
301
302 if (type->has_broadcast_disable)
303 kszphy_broadcast_disable(phydev);
304
305 if (type->has_nand_tree_disable)
306 kszphy_nand_tree_disable(phydev);
307
308 return kszphy_config_reset(phydev);
309}
310
303static int ksz8041_config_init(struct phy_device *phydev)311static int ksz8041_config_init(struct phy_device *phydev)
304{312{
305 struct device_node *of_node = phydev->mdio.dev.of_node;313 struct device_node *of_node = phydev->mdio.dev.of_node;
@@ -700,8 +708,14 @@ static int kszphy_suspend(struct phy_device *phydev) · 394 unmodified lines
700 708
701static int kszphy_resume(struct phy_device *phydev)709static int kszphy_resume(struct phy_device *phydev)
702{710{
711 int ret;
712
703 genphy_resume(phydev);713 genphy_resume(phydev);
704 714
715 ret = kszphy_config_reset(phydev);
716 if (ret)
717 return ret;
718
705 /* Enable PHY Interrupts */719 /* Enable PHY Interrupts */
706 if (phy_interrupt_is_valid(phydev)) {720 if (phy_interrupt_is_valid(phydev)) {
707 phydev->interrupts = PHY_INTERRUPT_ENABLED;721 phydev->interrupts = PHY_INTERRUPT_ENABLED;
drivers/net/phy/phy.c+3−1
@@ -54,6 +54,8 @@ static const char *phy_speed_to_str(int speed) · 53 unmodified lines
54 return "5Gbps";54 return "5Gbps";
55 case SPEED_10000:55 case SPEED_10000:
56 return "10Gbps";56 return "10Gbps";
57 case SPEED_14000:
58 return "14Gbps";
57 case SPEED_20000:59 case SPEED_20000:
58 return "20Gbps";60 return "20Gbps";
59 case SPEED_25000:61 case SPEED_25000:
@@ -241,7 +243,7 @@ static const struct phy_setting settings[] = { · 181 unmodified lines
241 * phy_lookup_setting - lookup a PHY setting243 * phy_lookup_setting - lookup a PHY setting
242 * @speed: speed to match244 * @speed: speed to match
243 * @duplex: duplex to match245 * @duplex: duplex to match
244 * @feature: allowed link modes246 * @features: allowed link modes
245 * @exact: an exact match is required247 * @exact: an exact match is required
246 *248 *
247 * Search the settings array for a setting that matches the speed and249 * Search the settings array for a setting that matches the speed and
drivers/net/slip/slip.c+3−4
@@ -629,7 +629,7 @@ static void sl_uninit(struct net_device *dev) · 628 unmodified lines
629static void sl_free_netdev(struct net_device *dev)629static void sl_free_netdev(struct net_device *dev)
630{630{
631 int i = dev->base_addr;631 int i = dev->base_addr;
632 free_netdev(dev);632
633 slip_devs[i] = NULL;633 slip_devs[i] = NULL;
634}634}
635 635
@@ -651,7 +651,8 @@ static const struct net_device_ops sl_netdev_ops = { · 15 unmodified lines
651static void sl_setup(struct net_device *dev)651static void sl_setup(struct net_device *dev)
652{652{
653 dev->netdev_ops = &sl_netdev_ops;653 dev->netdev_ops = &sl_netdev_ops;
654 dev->destructor = sl_free_netdev;654 dev->needs_free_netdev = true;
655 dev->priv_destructor = sl_free_netdev;
655 656
656 dev->hard_header_len = 0;657 dev->hard_header_len = 0;
657 dev->addr_len = 0;658 dev->addr_len = 0;
@@ -1369,8 +1370,6 @@ static void __exit slip_exit(void) · 711 unmodified lines
1369 if (sl->tty) {1370 if (sl->tty) {
1370 printk(KERN_ERR "%s: tty discipline still running\n",1371 printk(KERN_ERR "%s: tty discipline still running\n",
1371 dev->name);1372 dev->name);
1372 /* Intentionally leak the control block. */
1373 dev->destructor = NULL;
1374 }1373 }
1375 1374
1376 unregister_netdev(dev);1375 unregister_netdev(dev);
drivers/net/team/team.c+2−2
@@ -1643,7 +1643,6 @@ static void team_destructor(struct net_device *dev) · 1642 unmodified lines
1643 struct team *team = netdev_priv(dev);1643 struct team *team = netdev_priv(dev);
1644 1644
1645 free_percpu(team->pcpu_stats);1645 free_percpu(team->pcpu_stats);
1646 free_netdev(dev);
1647}1646}
1648 1647
1649static int team_open(struct net_device *dev)1648static int team_open(struct net_device *dev)
@@ -2079,7 +2078,8 @@ static void team_setup(struct net_device *dev) · 429 unmodified lines
2079 2078
2080 dev->netdev_ops = &team_netdev_ops;2079 dev->netdev_ops = &team_netdev_ops;
2081 dev->ethtool_ops = &team_ethtool_ops;2080 dev->ethtool_ops = &team_ethtool_ops;
2082 dev->destructor = team_destructor;2081 dev->needs_free_netdev = true;
2082 dev->priv_destructor = team_destructor;
2083 dev->priv_flags &= ~(IFF_XMIT_DST_RELEASE | IFF_TX_SKB_SHARING);2083 dev->priv_flags &= ~(IFF_XMIT_DST_RELEASE | IFF_TX_SKB_SHARING);
2084 dev->priv_flags |= IFF_NO_QUEUE;2084 dev->priv_flags |= IFF_NO_QUEUE;
2085 dev->priv_flags |= IFF_TEAM;2085 dev->priv_flags |= IFF_TEAM;
drivers/net/tun.c+2−2
@@ -1560,7 +1560,6 @@ static void tun_free_netdev(struct net_device *dev) · 1559 unmodified lines
1560 free_percpu(tun->pcpu_stats);1560 free_percpu(tun->pcpu_stats);
1561 tun_flow_uninit(tun);1561 tun_flow_uninit(tun);
1562 security_tun_dev_free_security(tun->security);1562 security_tun_dev_free_security(tun->security);
1563 free_netdev(dev);
1564}1563}
1565 1564
1566static void tun_setup(struct net_device *dev)1565static void tun_setup(struct net_device *dev)
@@ -1571,7 +1570,8 @@ static void tun_setup(struct net_device *dev) · 4 unmodified lines
1571 tun->group = INVALID_GID;1570 tun->group = INVALID_GID;
1572 1571
1573 dev->ethtool_ops = &tun_ethtool_ops;1572 dev->ethtool_ops = &tun_ethtool_ops;
1574 dev->destructor = tun_free_netdev;1573 dev->needs_free_netdev = true;
1574 dev->priv_destructor = tun_free_netdev;
1575 /* We prefer our own queue length */1575 /* We prefer our own queue length */
1576 dev->tx_queue_len = TUN_READQ_SIZE;1576 dev->tx_queue_len = TUN_READQ_SIZE;
1577}1577}
drivers/net/usb/cdc-phonet.c+1−1
@@ -298,7 +298,7 @@ static void usbpn_setup(struct net_device *dev) · 297 unmodified lines
298 dev->addr_len = 1;298 dev->addr_len = 1;
299 dev->tx_queue_len = 3;299 dev->tx_queue_len = 3;
300 300
301 dev->destructor = free_netdev;301 dev->needs_free_netdev = true;
302}302}
303 303
304/*304/*
drivers/net/usb/qmi_wwan.c+5−1
@@ -123,7 +123,7 @@ static void qmimux_setup(struct net_device *dev) · 122 unmodified lines
123 dev->addr_len = 0;123 dev->addr_len = 0;
124 dev->flags = IFF_POINTOPOINT | IFF_NOARP | IFF_MULTICAST;124 dev->flags = IFF_POINTOPOINT | IFF_NOARP | IFF_MULTICAST;
125 dev->netdev_ops = &qmimux_netdev_ops;125 dev->netdev_ops = &qmimux_netdev_ops;
126 dev->destructor = free_netdev;126 dev->needs_free_netdev = true;
127}127}
128 128
129static struct net_device *qmimux_find_dev(struct usbnet *dev, u8 mux_id)129static struct net_device *qmimux_find_dev(struct usbnet *dev, u8 mux_id)
@@ -1192,6 +1192,8 @@ static const struct usb_device_id products[] = { · 1062 unmodified lines
1192 {QMI_FIXED_INTF(0x1199, 0x9056, 8)}, /* Sierra Wireless Modem */1192 {QMI_FIXED_INTF(0x1199, 0x9056, 8)}, /* Sierra Wireless Modem */
1193 {QMI_FIXED_INTF(0x1199, 0x9057, 8)},1193 {QMI_FIXED_INTF(0x1199, 0x9057, 8)},
1194 {QMI_FIXED_INTF(0x1199, 0x9061, 8)}, /* Sierra Wireless Modem */1194 {QMI_FIXED_INTF(0x1199, 0x9061, 8)}, /* Sierra Wireless Modem */
1195 {QMI_FIXED_INTF(0x1199, 0x9063, 8)}, /* Sierra Wireless EM7305 */
1196 {QMI_FIXED_INTF(0x1199, 0x9063, 10)}, /* Sierra Wireless EM7305 */
1195 {QMI_FIXED_INTF(0x1199, 0x9071, 8)}, /* Sierra Wireless MC74xx */1197 {QMI_FIXED_INTF(0x1199, 0x9071, 8)}, /* Sierra Wireless MC74xx */
1196 {QMI_FIXED_INTF(0x1199, 0x9071, 10)}, /* Sierra Wireless MC74xx */1198 {QMI_FIXED_INTF(0x1199, 0x9071, 10)}, /* Sierra Wireless MC74xx */
1197 {QMI_FIXED_INTF(0x1199, 0x9079, 8)}, /* Sierra Wireless EM74xx */1199 {QMI_FIXED_INTF(0x1199, 0x9079, 8)}, /* Sierra Wireless EM74xx */
@@ -1206,6 +1208,8 @@ static const struct usb_device_id products[] = { · 8 unmodified lines
1206 {QMI_FIXED_INTF(0x1bc7, 0x1100, 3)}, /* Telit ME910 */1208 {QMI_FIXED_INTF(0x1bc7, 0x1100, 3)}, /* Telit ME910 */
1207 {QMI_FIXED_INTF(0x1bc7, 0x1200, 5)}, /* Telit LE920 */1209 {QMI_FIXED_INTF(0x1bc7, 0x1200, 5)}, /* Telit LE920 */
1208 {QMI_QUIRK_SET_DTR(0x1bc7, 0x1201, 2)}, /* Telit LE920, LE920A4 */1210 {QMI_QUIRK_SET_DTR(0x1bc7, 0x1201, 2)}, /* Telit LE920, LE920A4 */
1211 {QMI_FIXED_INTF(0x1c9e, 0x9801, 3)}, /* Telewell TW-3G HSPA+ */
1212 {QMI_FIXED_INTF(0x1c9e, 0x9803, 4)}, /* Telewell TW-3G HSPA+ */
1209 {QMI_FIXED_INTF(0x1c9e, 0x9b01, 3)}, /* XS Stick W100-2 from 4G Systems */1213 {QMI_FIXED_INTF(0x1c9e, 0x9b01, 3)}, /* XS Stick W100-2 from 4G Systems */
1210 {QMI_FIXED_INTF(0x0b3c, 0xc000, 4)}, /* Olivetti Olicard 100 */1214 {QMI_FIXED_INTF(0x0b3c, 0xc000, 4)}, /* Olivetti Olicard 100 */
1211 {QMI_FIXED_INTF(0x0b3c, 0xc001, 4)}, /* Olivetti Olicard 120 */1215 {QMI_FIXED_INTF(0x0b3c, 0xc001, 4)}, /* Olivetti Olicard 120 */
drivers/net/usb/r8152.c+2−0
@@ -4368,6 +4368,8 @@ static u8 rtl_get_version(struct usb_interface *intf) · 4367 unmodified lines
4368 break;4368 break;
4369 }4369 }
4370 4370
4371 dev_dbg(&intf->dev, "Detected version 0x%04x\n", version);
4372
4371 return version;4373 return version;
4372}4374}
4373 4375
drivers/net/veth.c+2−2
@@ -222,7 +222,6 @@ static int veth_dev_init(struct net_device *dev) · 221 unmodified lines
222static void veth_dev_free(struct net_device *dev)222static void veth_dev_free(struct net_device *dev)
223{223{
224 free_percpu(dev->vstats);224 free_percpu(dev->vstats);
225 free_netdev(dev);
226}225}
227 226
228#ifdef CONFIG_NET_POLL_CONTROLLER227#ifdef CONFIG_NET_POLL_CONTROLLER
@@ -317,7 +316,8 @@ static void veth_setup(struct net_device *dev) · 88 unmodified lines
317 NETIF_F_HW_VLAN_STAG_TX |316 NETIF_F_HW_VLAN_STAG_TX |
318 NETIF_F_HW_VLAN_CTAG_RX |317 NETIF_F_HW_VLAN_CTAG_RX |
319 NETIF_F_HW_VLAN_STAG_RX);318 NETIF_F_HW_VLAN_STAG_RX);
320 dev->destructor = veth_dev_free;319 dev->needs_free_netdev = true;
320 dev->priv_destructor = veth_dev_free;
321 dev->max_mtu = ETH_MAX_MTU;321 dev->max_mtu = ETH_MAX_MTU;
322 322
323 dev->hw_features = VETH_FEATURES;323 dev->hw_features = VETH_FEATURES;
drivers/net/virtio_net.c+3−2
@@ -869,7 +869,7 @@ static unsigned int get_mergeable_buf_len(struct receive_queue *rq, · 868 unmodified lines
869 unsigned int len;869 unsigned int len;
870 870
871 len = hdr_len + clamp_t(unsigned int, ewma_pkt_len_read(avg_pkt_len),871 len = hdr_len + clamp_t(unsigned int, ewma_pkt_len_read(avg_pkt_len),
872 rq->min_buf_len - hdr_len, PAGE_SIZE - hdr_len);872 rq->min_buf_len, PAGE_SIZE - hdr_len);
873 return ALIGN(len, L1_CACHE_BYTES);873 return ALIGN(len, L1_CACHE_BYTES);
874}874}
875 875
@@ -2144,7 +2144,8 @@ static unsigned int mergeable_min_buf_len(struct virtnet_info *vi, struct virtqu · 1268 unmodified lines
2144 unsigned int buf_len = hdr_len + ETH_HLEN + VLAN_HLEN + packet_len;2144 unsigned int buf_len = hdr_len + ETH_HLEN + VLAN_HLEN + packet_len;
2145 unsigned int min_buf_len = DIV_ROUND_UP(buf_len, rq_size);2145 unsigned int min_buf_len = DIV_ROUND_UP(buf_len, rq_size);
2146 2146
2147 return max(min_buf_len, hdr_len);2147 return max(max(min_buf_len, hdr_len) - hdr_len,
2148 (unsigned int)GOOD_PACKET_LEN);
2148}2149}
2149 2150
2150static int virtnet_find_vqs(struct virtnet_info *vi)2151static int virtnet_find_vqs(struct virtnet_info *vi)
drivers/net/vrf.c+33−5
@@ -36,12 +36,14 @@ · 35 unmodified lines
36#include <net/addrconf.h>36#include <net/addrconf.h>
37#include <net/l3mdev.h>37#include <net/l3mdev.h>
38#include <net/fib_rules.h>38#include <net/fib_rules.h>
39#include <net/netns/generic.h>
39 40
40#define DRV_NAME "vrf"41#define DRV_NAME "vrf"
41#define DRV_VERSION "1.0"42#define DRV_VERSION "1.0"
42 43
43#define FIB_RULE_PREF 1000 /* default preference for FIB rules */44#define FIB_RULE_PREF 1000 /* default preference for FIB rules */
44static bool add_fib_rules = true;45
46static unsigned int vrf_net_id;
45 47
46struct net_vrf {48struct net_vrf {
47 struct rtable __rcu *rth;49 struct rtable __rcu *rth;
@@ -1348,7 +1350,7 @@ static void vrf_setup(struct net_device *dev) · 1300 unmodified lines
1348 dev->netdev_ops = &vrf_netdev_ops;1350 dev->netdev_ops = &vrf_netdev_ops;
1349 dev->l3mdev_ops = &vrf_l3mdev_ops;1351 dev->l3mdev_ops = &vrf_l3mdev_ops;
1350 dev->ethtool_ops = &vrf_ethtool_ops;1352 dev->ethtool_ops = &vrf_ethtool_ops;
1351 dev->destructor = free_netdev;1353 dev->needs_free_netdev = true;
1352 1354
1353 /* Fill in device structure with ethernet-generic values. */1355 /* Fill in device structure with ethernet-generic values. */
1354 eth_hw_addr_random(dev);1356 eth_hw_addr_random(dev);
@@ -1394,6 +1396,8 @@ static int vrf_newlink(struct net *src_net, struct net_device *dev, · 39 unmodified lines
1394 struct nlattr *tb[], struct nlattr *data[])1396 struct nlattr *tb[], struct nlattr *data[])
1395{1397{
1396 struct net_vrf *vrf = netdev_priv(dev);1398 struct net_vrf *vrf = netdev_priv(dev);
1399 bool *add_fib_rules;
1400 struct net *net;
1397 int err;1401 int err;
1398 1402
1399 if (!data || !data[IFLA_VRF_TABLE])1403 if (!data || !data[IFLA_VRF_TABLE])
@@ -1409,13 +1413,15 @@ static int vrf_newlink(struct net *src_net, struct net_device *dev, · 9 unmodified lines
1409 if (err)1413 if (err)
1410 goto out;1414 goto out;
1411 1415
1412 if (add_fib_rules) {1416 net = dev_net(dev);
1417 add_fib_rules = net_generic(net, vrf_net_id);
1418 if (*add_fib_rules) {
1413 err = vrf_add_fib_rules(dev);1419 err = vrf_add_fib_rules(dev);
1414 if (err) {1420 if (err) {
1415 unregister_netdevice(dev);1421 unregister_netdevice(dev);
1416 goto out;1422 goto out;
1417 }1423 }
1418 add_fib_rules = false;1424 *add_fib_rules = false;
1419 }1425 }
1420 1426
1421out:1427out:
@@ -1498,16 +1504,38 @@ static struct notifier_block vrf_notifier_block __read_mostly = { · 76 unmodified lines
1498 .notifier_call = vrf_device_event,1504 .notifier_call = vrf_device_event,
1499};1505};
1500 1506
1507/* Initialize per network namespace state */
1508static int __net_init vrf_netns_init(struct net *net)
1509{
1510 bool *add_fib_rules = net_generic(net, vrf_net_id);
1511
1512 *add_fib_rules = true;
1513
1514 return 0;
1515}
1516
1517static struct pernet_operations vrf_net_ops __net_initdata = {
1518 .init = vrf_netns_init,
1519 .id = &vrf_net_id,
1520 .size = sizeof(bool),
1521};
1522
1501static int __init vrf_init_module(void)1523static int __init vrf_init_module(void)
1502{1524{
1503 int rc;1525 int rc;
1504 1526
1505 register_netdevice_notifier(&vrf_notifier_block);1527 register_netdevice_notifier(&vrf_notifier_block);
1506 1528
1507 rc = rtnl_link_register(&vrf_link_ops);1529 rc = register_pernet_subsys(&vrf_net_ops);
1508 if (rc < 0)1530 if (rc < 0)
1509 goto error;1531 goto error;
1510 1532
1533 rc = rtnl_link_register(&vrf_link_ops);
1534 if (rc < 0) {
1535 unregister_pernet_subsys(&vrf_net_ops);
1536 goto error;
1537 }
1538
1511 return 0;1539 return 0;
1512 1540
1513error:1541error:
drivers/net/vsockmon.c+1−1
@@ -135,7 +135,7 @@ static void vsockmon_setup(struct net_device *dev) · 134 unmodified lines
135 135
136 dev->netdev_ops = &vsockmon_ops;136 dev->netdev_ops = &vsockmon_ops;
137 dev->ethtool_ops = &vsockmon_ethtool_ops;137 dev->ethtool_ops = &vsockmon_ethtool_ops;
138 dev->destructor = free_netdev;138 dev->needs_free_netdev = true;
139 139
140 dev->features = NETIF_F_SG | NETIF_F_FRAGLIST |140 dev->features = NETIF_F_SG | NETIF_F_FRAGLIST |
141 NETIF_F_HIGHDMA | NETIF_F_LLTX;141 NETIF_F_HIGHDMA | NETIF_F_LLTX;
drivers/net/vxlan.c+31−10
@@ -59,6 +59,8 @@ static const u8 all_zeros_mac[ETH_ALEN + 2]; · 58 unmodified lines
59 59
60static int vxlan_sock_add(struct vxlan_dev *vxlan);60static int vxlan_sock_add(struct vxlan_dev *vxlan);
61 61
62static void vxlan_vs_del_dev(struct vxlan_dev *vxlan);
63
62/* per-network namespace private data for this module */64/* per-network namespace private data for this module */
63struct vxlan_net {65struct vxlan_net {
64 struct list_head vxlan_list;66 struct list_head vxlan_list;
@@ -740,6 +742,22 @@ static void vxlan_fdb_destroy(struct vxlan_dev *vxlan, struct vxlan_fdb *f) · 675 unmodified lines
740 call_rcu(&f->rcu, vxlan_fdb_free);742 call_rcu(&f->rcu, vxlan_fdb_free);
741}743}
742 744
745static void vxlan_dst_free(struct rcu_head *head)
746{
747 struct vxlan_rdst *rd = container_of(head, struct vxlan_rdst, rcu);
748
749 dst_cache_destroy(&rd->dst_cache);
750 kfree(rd);
751}
752
753static void vxlan_fdb_dst_destroy(struct vxlan_dev *vxlan, struct vxlan_fdb *f,
754 struct vxlan_rdst *rd)
755{
756 list_del_rcu(&rd->list);
757 vxlan_fdb_notify(vxlan, f, rd, RTM_DELNEIGH);
758 call_rcu(&rd->rcu, vxlan_dst_free);
759}
760
743static int vxlan_fdb_parse(struct nlattr *tb[], struct vxlan_dev *vxlan,761static int vxlan_fdb_parse(struct nlattr *tb[], struct vxlan_dev *vxlan,
744 union vxlan_addr *ip, __be16 *port, __be32 *src_vni,762 union vxlan_addr *ip, __be16 *port, __be32 *src_vni,
745 __be32 *vni, u32 *ifindex)763 __be32 *vni, u32 *ifindex)
@@ -864,9 +882,7 @@ static int __vxlan_fdb_delete(struct vxlan_dev *vxlan, · 118 unmodified lines
864 * otherwise destroy the fdb entry882 * otherwise destroy the fdb entry
865 */883 */
866 if (rd && !list_is_singular(&f->remotes)) {884 if (rd && !list_is_singular(&f->remotes)) {
867 list_del_rcu(&rd->list);885 vxlan_fdb_dst_destroy(vxlan, f, rd);
868 vxlan_fdb_notify(vxlan, f, rd, RTM_DELNEIGH);
869 kfree_rcu(rd, rcu);
870 goto out;886 goto out;
871 }887 }
872 888
@@ -1067,6 +1083,8 @@ static void vxlan_sock_release(struct vxlan_dev *vxlan) · 194 unmodified lines
1067 rcu_assign_pointer(vxlan->vn4_sock, NULL);1083 rcu_assign_pointer(vxlan->vn4_sock, NULL);
1068 synchronize_net();1084 synchronize_net();
1069 1085
1086 vxlan_vs_del_dev(vxlan);
1087
1070 if (__vxlan_sock_release_prep(sock4)) {1088 if (__vxlan_sock_release_prep(sock4)) {
1071 udp_tunnel_sock_release(sock4->sock);1089 udp_tunnel_sock_release(sock4->sock);
1072 kfree(sock4);1090 kfree(sock4);
@@ -2342,6 +2360,15 @@ static void vxlan_cleanup(unsigned long arg) · 1269 unmodified lines
2342 mod_timer(&vxlan->age_timer, next_timer);2360 mod_timer(&vxlan->age_timer, next_timer);
2343}2361}
2344 2362
2363static void vxlan_vs_del_dev(struct vxlan_dev *vxlan)
2364{
2365 struct vxlan_net *vn = net_generic(vxlan->net, vxlan_net_id);
2366
2367 spin_lock(&vn->sock_lock);
2368 hlist_del_init_rcu(&vxlan->hlist);
2369 spin_unlock(&vn->sock_lock);
2370}
2371
2345static void vxlan_vs_add_dev(struct vxlan_sock *vs, struct vxlan_dev *vxlan)2372static void vxlan_vs_add_dev(struct vxlan_sock *vs, struct vxlan_dev *vxlan)
2346{2373{
2347 struct vxlan_net *vn = net_generic(vxlan->net, vxlan_net_id);2374 struct vxlan_net *vn = net_generic(vxlan->net, vxlan_net_id);
@@ -2584,7 +2611,7 @@ static void vxlan_setup(struct net_device *dev) · 236 unmodified lines
2584 eth_hw_addr_random(dev);2611 eth_hw_addr_random(dev);
2585 ether_setup(dev);2612 ether_setup(dev);
2586 2613
2587 dev->destructor = free_netdev;2614 dev->needs_free_netdev = true;
2588 SET_NETDEV_DEVTYPE(dev, &vxlan_type);2615 SET_NETDEV_DEVTYPE(dev, &vxlan_type);
2589 2616
2590 dev->features |= NETIF_F_LLTX;2617 dev->features |= NETIF_F_LLTX;
@@ -3286,15 +3313,9 @@ static int vxlan_changelink(struct net_device *dev, struct nlattr *tb[], · 695 unmodified lines
3286static void vxlan_dellink(struct net_device *dev, struct list_head *head)3313static void vxlan_dellink(struct net_device *dev, struct list_head *head)
3287{3314{
3288 struct vxlan_dev *vxlan = netdev_priv(dev);3315 struct vxlan_dev *vxlan = netdev_priv(dev);
3289 struct vxlan_net *vn = net_generic(vxlan->net, vxlan_net_id);
3290 3316
3291 vxlan_flush(vxlan, true);3317 vxlan_flush(vxlan, true);
3292 3318
3293 spin_lock(&vn->sock_lock);
3294 if (!hlist_unhashed(&vxlan->hlist))
3295 hlist_del_rcu(&vxlan->hlist);
3296 spin_unlock(&vn->sock_lock);
3297
3298 gro_cells_destroy(&vxlan->gro_cells);3319 gro_cells_destroy(&vxlan->gro_cells);
3299 list_del(&vxlan->next);3320 list_del(&vxlan->next);
3300 unregister_netdevice_queue(dev, head);3321 unregister_netdevice_queue(dev, head);
drivers/net/wan/dlci.c+1−1
@@ -475,7 +475,7 @@ static void dlci_setup(struct net_device *dev) · 474 unmodified lines
475 dev->flags = 0;475 dev->flags = 0;
476 dev->header_ops = &dlci_header_ops;476 dev->header_ops = &dlci_header_ops;
477 dev->netdev_ops = &dlci_netdev_ops;477 dev->netdev_ops = &dlci_netdev_ops;
478 dev->destructor = free_netdev;478 dev->needs_free_netdev = true;
479 479
480 dlp->receive = dlci_receive;480 dlp->receive = dlci_receive;
481 481
drivers/net/wan/hdlc_fr.c+1−1
@@ -1106,7 +1106,7 @@ static int fr_add_pvc(struct net_device *frad, unsigned int dlci, int type) · 1105 unmodified lines
1106 return -EIO;1106 return -EIO;
1107 }1107 }
1108 1108
1109 dev->destructor = free_netdev;1109 dev->needs_free_netdev = true;
1110 *get_dev_p(pvc, type) = dev;1110 *get_dev_p(pvc, type) = dev;
1111 if (!used) {1111 if (!used) {
1112 state(hdlc)->dce_changed = 1;1112 state(hdlc)->dce_changed = 1;
drivers/net/wan/lapbether.c+1−1
@@ -306,7 +306,7 @@ static const struct net_device_ops lapbeth_netdev_ops = { · 305 unmodified lines
306static void lapbeth_setup(struct net_device *dev)306static void lapbeth_setup(struct net_device *dev)
307{307{
308 dev->netdev_ops = &lapbeth_netdev_ops;308 dev->netdev_ops = &lapbeth_netdev_ops;
309 dev->destructor = free_netdev;309 dev->needs_free_netdev = true;
310 dev->type = ARPHRD_X25;310 dev->type = ARPHRD_X25;
311 dev->hard_header_len = 3;311 dev->hard_header_len = 3;
312 dev->mtu = 1000;312 dev->mtu = 1000;
drivers/net/wireless/ath/ath6kl/main.c+1−1
@@ -1287,7 +1287,7 @@ void init_netdev(struct net_device *dev) · 1286 unmodified lines
1287 struct ath6kl *ar = ath6kl_priv(dev);1287 struct ath6kl *ar = ath6kl_priv(dev);
1288 1288
1289 dev->netdev_ops = &ath6kl_netdev_ops;1289 dev->netdev_ops = &ath6kl_netdev_ops;
1290 dev->destructor = free_netdev;1290 dev->needs_free_netdev = true;
1291 dev->watchdog_timeo = ATH6KL_TX_TIMEOUT;1291 dev->watchdog_timeo = ATH6KL_TX_TIMEOUT;
1292 1292
1293 dev->needed_headroom = ETH_HLEN;1293 dev->needed_headroom = ETH_HLEN;
drivers/net/wireless/ath/wcn36xx/main.c+2−0
@@ -1271,6 +1271,8 @@ static int wcn36xx_remove(struct platform_device *pdev) · 1270 unmodified lines
1271 qcom_smem_state_put(wcn->tx_enable_state);1271 qcom_smem_state_put(wcn->tx_enable_state);
1272 qcom_smem_state_put(wcn->tx_rings_empty_state);1272 qcom_smem_state_put(wcn->tx_rings_empty_state);
1273 1273
1274 rpmsg_destroy_ept(wcn->smd_channel);
1275
1274 iounmap(wcn->dxe_base);1276 iounmap(wcn->dxe_base);
1275 iounmap(wcn->ccu_base);1277 iounmap(wcn->ccu_base);
1276 1278
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c+0−1
@@ -5225,7 +5225,6 @@ void brcmf_cfg80211_free_netdev(struct net_device *ndev) · 5224 unmodified lines
5225 5225
5226 if (vif)5226 if (vif)
5227 brcmf_free_vif(vif);5227 brcmf_free_vif(vif);
5228 free_netdev(ndev);
5229}5228}
5230 5229
5231static bool brcmf_is_linkup(const struct brcmf_event_msg *e)5230static bool brcmf_is_linkup(const struct brcmf_event_msg *e)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c+2−1
@@ -624,7 +624,8 @@ struct brcmf_if *brcmf_add_if(struct brcmf_pub *drvr, s32 bsscfgidx, s32 ifidx, · 623 unmodified lines
624 if (!ndev)624 if (!ndev)
625 return ERR_PTR(-ENOMEM);625 return ERR_PTR(-ENOMEM);
626 626
627 ndev->destructor = brcmf_cfg80211_free_netdev;627 ndev->needs_free_netdev = true;
628 ndev->priv_destructor = brcmf_cfg80211_free_netdev;
628 ifp = netdev_priv(ndev);629 ifp = netdev_priv(ndev);
629 ifp->ndev = ndev;630 ifp->ndev = ndev;
630 /* store mapping ifidx to bsscfgidx */631 /* store mapping ifidx to bsscfgidx */
drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c+1−1
@@ -3422,7 +3422,7 @@ static int brcmf_sdio_bus_preinit(struct device *dev) · 3421 unmodified lines
3422 /* otherwise, set txglomalign */3422 /* otherwise, set txglomalign */
3423 value = sdiodev->settings->bus.sdio.sd_sgentry_align;3423 value = sdiodev->settings->bus.sdio.sd_sgentry_align;
3424 /* SDIO ADMA requires at least 32 bit alignment */3424 /* SDIO ADMA requires at least 32 bit alignment */
3425 value = max_t(u32, value, 4);3425 value = max_t(u32, value, ALIGNMENT);
3426 err = brcmf_iovar_data_set(dev, "bus:txglomalign", &value,3426 err = brcmf_iovar_data_set(dev, "bus:txglomalign", &value,
3427 sizeof(u32));3427 sizeof(u32));
3428 }3428 }
drivers/net/wireless/intel/iwlwifi/iwl-7000.c+2−2
@@ -79,8 +79,8 @@ · 78 unmodified lines
79/* Lowest firmware API version supported */79/* Lowest firmware API version supported */
80#define IWL7260_UCODE_API_MIN 1780#define IWL7260_UCODE_API_MIN 17
81#define IWL7265_UCODE_API_MIN 1781#define IWL7265_UCODE_API_MIN 17
82#define IWL7265D_UCODE_API_MIN 1782#define IWL7265D_UCODE_API_MIN 22
83#define IWL3168_UCODE_API_MIN 2083#define IWL3168_UCODE_API_MIN 22
84 84
85/* NVM versions */85/* NVM versions */
86#define IWL7260_NVM_VERSION 0x0a1d86#define IWL7260_NVM_VERSION 0x0a1d
drivers/net/wireless/intel/iwlwifi/iwl-8000.c+2−2
@@ -74,8 +74,8 @@ · 73 unmodified lines
74#define IWL8265_UCODE_API_MAX 3074#define IWL8265_UCODE_API_MAX 30
75 75
76/* Lowest firmware API version supported */76/* Lowest firmware API version supported */
77#define IWL8000_UCODE_API_MIN 1777#define IWL8000_UCODE_API_MIN 22
78#define IWL8265_UCODE_API_MIN 2078#define IWL8265_UCODE_API_MIN 22
79 79
80/* NVM versions */80/* NVM versions */
81#define IWL8000_NVM_VERSION 0x0a1d81#define IWL8000_NVM_VERSION 0x0a1d
drivers/net/wireless/intel/iwlwifi/iwl-prph.h+1−0
@@ -370,6 +370,7 @@ · 369 unmodified lines
370#define MON_DMARB_RD_DATA_ADDR (0xa03c5c)370#define MON_DMARB_RD_DATA_ADDR (0xa03c5c)
371 371
372#define DBGC_IN_SAMPLE (0xa03c00)372#define DBGC_IN_SAMPLE (0xa03c00)
373#define DBGC_OUT_CTRL (0xa03c0c)
373 374
374/* enable the ID buf for read */375/* enable the ID buf for read */
375#define WFPM_PS_CTL_CLR 0xA0300C376#define WFPM_PS_CTL_CLR 0xA0300C
drivers/net/wireless/intel/iwlwifi/mvm/fw-api-rs.h+5−0
@@ -307,6 +307,11 @@ enum { · 306 unmodified lines
307/* Bit 1-3: LQ command color. Used to match responses to LQ commands */307/* Bit 1-3: LQ command color. Used to match responses to LQ commands */
308#define LQ_FLAG_COLOR_POS 1308#define LQ_FLAG_COLOR_POS 1
309#define LQ_FLAG_COLOR_MSK (7 << LQ_FLAG_COLOR_POS)309#define LQ_FLAG_COLOR_MSK (7 << LQ_FLAG_COLOR_POS)
310#define LQ_FLAG_COLOR_GET(_f) (((_f) & LQ_FLAG_COLOR_MSK) >>\
311 LQ_FLAG_COLOR_POS)
312#define LQ_FLAGS_COLOR_INC(_c) ((((_c) + 1) << LQ_FLAG_COLOR_POS) &\
313 LQ_FLAG_COLOR_MSK)
314#define LQ_FLAG_COLOR_SET(_f, _c) ((_c) | ((_f) & ~LQ_FLAG_COLOR_MSK))
310 315
311/* Bit 4-5: Tx RTS BW Signalling316/* Bit 4-5: Tx RTS BW Signalling
312 * (0) No RTS BW signalling317 * (0) No RTS BW signalling
drivers/net/wireless/intel/iwlwifi/mvm/fw-api-tx.h+3−0
@@ -519,8 +519,11 @@ struct agg_tx_status { · 518 unmodified lines
519 * bit-7 invalid rate indication519 * bit-7 invalid rate indication
520 */520 */
521#define TX_RES_INIT_RATE_INDEX_MSK 0x0f521#define TX_RES_INIT_RATE_INDEX_MSK 0x0f
522#define TX_RES_RATE_TABLE_COLOR_POS 4
522#define TX_RES_RATE_TABLE_COLOR_MSK 0x70523#define TX_RES_RATE_TABLE_COLOR_MSK 0x70
523#define TX_RES_INV_RATE_INDEX_MSK 0x80524#define TX_RES_INV_RATE_INDEX_MSK 0x80
525#define TX_RES_RATE_TABLE_COL_GET(_f) (((_f) & TX_RES_RATE_TABLE_COLOR_MSK) >>\
526 TX_RES_RATE_TABLE_COLOR_POS)
524 527
525#define IWL_MVM_TX_RES_GET_TID(_ra_tid) ((_ra_tid) & 0x0f)528#define IWL_MVM_TX_RES_GET_TID(_ra_tid) ((_ra_tid) & 0x0f)
526#define IWL_MVM_TX_RES_GET_RA(_ra_tid) ((_ra_tid) >> 4)529#define IWL_MVM_TX_RES_GET_RA(_ra_tid) ((_ra_tid) >> 4)
drivers/net/wireless/intel/iwlwifi/mvm/fw-dbg.c+1−11
@@ -1002,14 +1002,6 @@ int iwl_mvm_fw_dbg_collect_trig(struct iwl_mvm *mvm, · 1001 unmodified lines
1002 return 0;1002 return 0;
1003}1003}
1004 1004
1005static inline void iwl_mvm_restart_early_start(struct iwl_mvm *mvm)
1006{
1007 if (mvm->cfg->device_family == IWL_DEVICE_FAMILY_7000)
1008 iwl_clear_bits_prph(mvm->trans, MON_BUFF_SAMPLE_CTL, 0x100);
1009 else
1010 iwl_write_prph(mvm->trans, DBGC_IN_SAMPLE, 1);
1011}
1012
1013int iwl_mvm_start_fw_dbg_conf(struct iwl_mvm *mvm, u8 conf_id)1005int iwl_mvm_start_fw_dbg_conf(struct iwl_mvm *mvm, u8 conf_id)
1014{1006{
1015 u8 *ptr;1007 u8 *ptr;
@@ -1023,10 +1015,8 @@ int iwl_mvm_start_fw_dbg_conf(struct iwl_mvm *mvm, u8 conf_id) · 7 unmodified lines
1023 /* EARLY START - firmware's configuration is hard coded */1015 /* EARLY START - firmware's configuration is hard coded */
1024 if ((!mvm->fw->dbg_conf_tlv[conf_id] ||1016 if ((!mvm->fw->dbg_conf_tlv[conf_id] ||
1025 !mvm->fw->dbg_conf_tlv[conf_id]->num_of_hcmds) &&1017 !mvm->fw->dbg_conf_tlv[conf_id]->num_of_hcmds) &&
1026 conf_id == FW_DBG_START_FROM_ALIVE) {1018 conf_id == FW_DBG_START_FROM_ALIVE)
1027 iwl_mvm_restart_early_start(mvm);
1028 return 0;1019 return 0;
1029 }
1030 1020
1031 if (!mvm->fw->dbg_conf_tlv[conf_id])1021 if (!mvm->fw->dbg_conf_tlv[conf_id])
1032 return -EINVAL;1022 return -EINVAL;
drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c+1−1
@@ -1040,7 +1040,7 @@ static int iwl_mvm_mac_ctxt_send_beacon(struct iwl_mvm *mvm, · 1039 unmodified lines
1040 struct iwl_mac_beacon_cmd_v6 beacon_cmd_v6;1040 struct iwl_mac_beacon_cmd_v6 beacon_cmd_v6;
1041 struct iwl_mac_beacon_cmd_v7 beacon_cmd;1041 struct iwl_mac_beacon_cmd_v7 beacon_cmd;
1042 } u = {};1042 } u = {};
1043 struct iwl_mac_beacon_cmd beacon_cmd;1043 struct iwl_mac_beacon_cmd beacon_cmd = {};
1044 struct ieee80211_tx_info *info;1044 struct ieee80211_tx_info *info;
1045 u32 beacon_skb_len;1045 u32 beacon_skb_len;
1046 u32 rate, tx_flags;1046 u32 rate, tx_flags;
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h+5−1
@@ -1730,8 +1730,11 @@ int iwl_mvm_find_free_queue(struct iwl_mvm *mvm, u8 sta_id, u8 minq, u8 maxq); · 1729 unmodified lines
1730 */1730 */
1731static inline u32 iwl_mvm_flushable_queues(struct iwl_mvm *mvm)1731static inline u32 iwl_mvm_flushable_queues(struct iwl_mvm *mvm)
1732{1732{
1733 u32 cmd_queue = iwl_mvm_is_dqa_supported(mvm) ? IWL_MVM_DQA_CMD_QUEUE :
1734 IWL_MVM_CMD_QUEUE;
1735
1733 return ((BIT(mvm->cfg->base_params->num_of_queues) - 1) &1736 return ((BIT(mvm->cfg->base_params->num_of_queues) - 1) &
1734 ~BIT(IWL_MVM_CMD_QUEUE));1737 ~BIT(cmd_queue));
1735}1738}
1736 1739
1737static inline1740static inline
@@ -1753,6 +1756,7 @@ static inline void iwl_mvm_stop_device(struct iwl_mvm *mvm) · 15 unmodified lines
1753 if (!iwl_mvm_has_new_tx_api(mvm))1756 if (!iwl_mvm_has_new_tx_api(mvm))
1754 iwl_free_fw_paging(mvm);1757 iwl_free_fw_paging(mvm);
1755 mvm->ucode_loaded = false;1758 mvm->ucode_loaded = false;
1759 mvm->fw_dbg_conf = FW_DBG_INVALID;
1756 iwl_trans_stop_device(mvm->trans);1760 iwl_trans_stop_device(mvm->trans);
1757}1761}
1758 1762
drivers/net/wireless/intel/iwlwifi/mvm/ops.c+24−8
@@ -1149,21 +1149,37 @@ static void iwl_mvm_fw_error_dump_wk(struct work_struct *work) · 1148 unmodified lines
1149 1149
1150 mutex_lock(&mvm->mutex);1150 mutex_lock(&mvm->mutex);
1151 1151
1152 /* stop recording */
1153 if (mvm->cfg->device_family == IWL_DEVICE_FAMILY_7000) {1152 if (mvm->cfg->device_family == IWL_DEVICE_FAMILY_7000) {
1153 /* stop recording */
1154 iwl_set_bits_prph(mvm->trans, MON_BUFF_SAMPLE_CTL, 0x100);1154 iwl_set_bits_prph(mvm->trans, MON_BUFF_SAMPLE_CTL, 0x100);
1155
1156 iwl_mvm_fw_error_dump(mvm);
1157
1158 /* start recording again if the firmware is not crashed */
1159 if (!test_bit(STATUS_FW_ERROR, &mvm->trans->status) &&
1160 mvm->fw->dbg_dest_tlv)
1161 iwl_clear_bits_prph(mvm->trans,
1162 MON_BUFF_SAMPLE_CTL, 0x100);
1155 } else {1163 } else {
1164 u32 in_sample = iwl_read_prph(mvm->trans, DBGC_IN_SAMPLE);
1165 u32 out_ctrl = iwl_read_prph(mvm->trans, DBGC_OUT_CTRL);
1166
1167 /* stop recording */
1156 iwl_write_prph(mvm->trans, DBGC_IN_SAMPLE, 0);1168 iwl_write_prph(mvm->trans, DBGC_IN_SAMPLE, 0);
1157 /* wait before we collect the data till the DBGC stop */
1158 udelay(100);1169 udelay(100);
1159 }1170 iwl_write_prph(mvm->trans, DBGC_OUT_CTRL, 0);
1171 /* wait before we collect the data till the DBGC stop */
1172 udelay(500);
1160 1173
1161 iwl_mvm_fw_error_dump(mvm);1174 iwl_mvm_fw_error_dump(mvm);
1162 1175
1163 /* start recording again if the firmware is not crashed */1176 /* start recording again if the firmware is not crashed */
1164 WARN_ON_ONCE((!test_bit(STATUS_FW_ERROR, &mvm->trans->status)) &&1177 if (!test_bit(STATUS_FW_ERROR, &mvm->trans->status) &&
1165 mvm->fw->dbg_dest_tlv &&1178 mvm->fw->dbg_dest_tlv) {
1166 iwl_mvm_start_fw_dbg_conf(mvm, mvm->fw_dbg_conf));1179 iwl_write_prph(mvm->trans, DBGC_IN_SAMPLE, in_sample);
1180 iwl_write_prph(mvm->trans, DBGC_OUT_CTRL, out_ctrl);
1181 }
1182 }
1167 1183
1168 mutex_unlock(&mvm->mutex);1184 mutex_unlock(&mvm->mutex);
1169 1185
drivers/net/wireless/intel/iwlwifi/mvm/rs.c+11−35
@@ -2,7 +2,7 @@ · 1 unmodified line
2 *2 *
3 * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved.3 * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved.
4 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH4 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
5 * Copyright(c) 2016 Intel Deutschland GmbH5 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
6 *6 *
7 * This program is free software; you can redistribute it and/or modify it7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of version 2 of the GNU General Public License as8 * under the terms of version 2 of the GNU General Public License as
@@ -1083,34 +1083,6 @@ static void rs_get_lower_rate_down_column(struct iwl_lq_sta *lq_sta, · 1074 unmodified lines
1083 rs_get_lower_rate_in_column(lq_sta, rate);1083 rs_get_lower_rate_in_column(lq_sta, rate);
1084}1084}
1085 1085
1086/* Check if both rates are identical
1087 * allow_ant_mismatch enables matching a SISO rate on ANT_A or ANT_B
1088 * with a rate indicating STBC/BFER and ANT_AB.
1089 */
1090static inline bool rs_rate_equal(struct rs_rate *a,
1091 struct rs_rate *b,
1092 bool allow_ant_mismatch)
1093
1094{
1095 bool ant_match = (a->ant == b->ant) && (a->stbc == b->stbc) &&
1096 (a->bfer == b->bfer);
1097
1098 if (allow_ant_mismatch) {
1099 if (a->stbc || a->bfer) {
1100 WARN_ONCE(a->ant != ANT_AB, "stbc %d bfer %d ant %d",
1101 a->stbc, a->bfer, a->ant);
1102 ant_match |= (b->ant == ANT_A || b->ant == ANT_B);
1103 } else if (b->stbc || b->bfer) {
1104 WARN_ONCE(b->ant != ANT_AB, "stbc %d bfer %d ant %d",
1105 b->stbc, b->bfer, b->ant);
1106 ant_match |= (a->ant == ANT_A || a->ant == ANT_B);
1107 }
1108 }
1109
1110 return (a->type == b->type) && (a->bw == b->bw) && (a->sgi == b->sgi) &&
1111 (a->ldpc == b->ldpc) && (a->index == b->index) && ant_match;
1112}
1113
1114/* Check if both rates share the same column */1086/* Check if both rates share the same column */
1115static inline bool rs_rate_column_match(struct rs_rate *a,1087static inline bool rs_rate_column_match(struct rs_rate *a,
1116 struct rs_rate *b)1088 struct rs_rate *b)
@@ -1182,12 +1154,12 @@ void iwl_mvm_rs_tx_status(struct iwl_mvm *mvm, struct ieee80211_sta *sta, · 65 unmodified lines
1182 u32 lq_hwrate;1154 u32 lq_hwrate;
1183 struct rs_rate lq_rate, tx_resp_rate;1155 struct rs_rate lq_rate, tx_resp_rate;
1184 struct iwl_scale_tbl_info *curr_tbl, *other_tbl, *tmp_tbl;1156 struct iwl_scale_tbl_info *curr_tbl, *other_tbl, *tmp_tbl;
1185 u8 reduced_txp = (uintptr_t)info->status.status_driver_data[0];1157 u32 tlc_info = (uintptr_t)info->status.status_driver_data[0];
1158 u8 reduced_txp = tlc_info & RS_DRV_DATA_TXP_MSK;
1159 u8 lq_color = RS_DRV_DATA_LQ_COLOR_GET(tlc_info);
1186 u32 tx_resp_hwrate = (uintptr_t)info->status.status_driver_data[1];1160 u32 tx_resp_hwrate = (uintptr_t)info->status.status_driver_data[1];
1187 struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta);1161 struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta);
1188 struct iwl_lq_sta *lq_sta = &mvmsta->lq_sta;1162 struct iwl_lq_sta *lq_sta = &mvmsta->lq_sta;
1189 bool allow_ant_mismatch = fw_has_api(&mvm->fw->ucode_capa,
1190 IWL_UCODE_TLV_API_LQ_SS_PARAMS);
1191 1163
1192 /* Treat uninitialized rate scaling data same as non-existing. */1164 /* Treat uninitialized rate scaling data same as non-existing. */
1193 if (!lq_sta) {1165 if (!lq_sta) {
@@ -1262,10 +1234,10 @@ void iwl_mvm_rs_tx_status(struct iwl_mvm *mvm, struct ieee80211_sta *sta, · 68 unmodified lines
1262 rs_rate_from_ucode_rate(lq_hwrate, info->band, &lq_rate);1234 rs_rate_from_ucode_rate(lq_hwrate, info->band, &lq_rate);
1263 1235
1264 /* Here we actually compare this rate to the latest LQ command */1236 /* Here we actually compare this rate to the latest LQ command */
1265 if (!rs_rate_equal(&tx_resp_rate, &lq_rate, allow_ant_mismatch)) {1237 if (lq_color != LQ_FLAG_COLOR_GET(table->flags)) {
1266 IWL_DEBUG_RATE(mvm,1238 IWL_DEBUG_RATE(mvm,
1267 "initial tx resp rate 0x%x does not match 0x%x\n",1239 "tx resp color 0x%x does not match 0x%x\n",
1268 tx_resp_hwrate, lq_hwrate);1240 lq_color, LQ_FLAG_COLOR_GET(table->flags));
1269 1241
1270 /*1242 /*
1271 * Since rates mis-match, the last LQ command may have failed.1243 * Since rates mis-match, the last LQ command may have failed.
@@ -3326,6 +3298,7 @@ static void rs_build_rates_table(struct iwl_mvm *mvm, · 2054 unmodified lines
3326 u8 valid_tx_ant = 0;3298 u8 valid_tx_ant = 0;
3327 struct iwl_lq_cmd *lq_cmd = &lq_sta->lq;3299 struct iwl_lq_cmd *lq_cmd = &lq_sta->lq;
3328 bool toggle_ant = false;3300 bool toggle_ant = false;
3301 u32 color;
3329 3302
3330 memcpy(&rate, initial_rate, sizeof(rate));3303 memcpy(&rate, initial_rate, sizeof(rate));
3331 3304
@@ -3380,6 +3353,9 @@ static void rs_build_rates_table(struct iwl_mvm *mvm, · 48 unmodified lines
3380 num_rates, num_retries, valid_tx_ant,3353 num_rates, num_retries, valid_tx_ant,
3381 toggle_ant);3354 toggle_ant);
3382 3355
3356 /* update the color of the LQ command (as a counter at bits 1-3) */
3357 color = LQ_FLAGS_COLOR_INC(LQ_FLAG_COLOR_GET(lq_cmd->flags));
3358 lq_cmd->flags = LQ_FLAG_COLOR_SET(lq_cmd->flags, color);
3383}3359}
3384 3360
3385struct rs_bfer_active_iter_data {3361struct rs_bfer_active_iter_data {
drivers/net/wireless/intel/iwlwifi/mvm/rs.h+15−0
@@ -2,6 +2,7 @@ · 1 unmodified line
2 *2 *
3 * Copyright(c) 2003 - 2014 Intel Corporation. All rights reserved.3 * Copyright(c) 2003 - 2014 Intel Corporation. All rights reserved.
4 * Copyright(c) 2015 Intel Mobile Communications GmbH4 * Copyright(c) 2015 Intel Mobile Communications GmbH
5 * Copyright(c) 2017 Intel Deutschland GmbH
5 *6 *
6 * This program is free software; you can redistribute it and/or modify it7 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of version 2 of the GNU General Public License as8 * under the terms of version 2 of the GNU General Public License as
@@ -357,6 +358,20 @@ struct iwl_lq_sta { · 349 unmodified lines
357 } pers;358 } pers;
358};359};
359 360
361/* ieee80211_tx_info's status_driver_data[0] is packed with lq color and txp
362 * Note, it's iwlmvm <-> mac80211 interface.
363 * bits 0-7: reduced tx power
364 * bits 8-10: LQ command's color
365 */
366#define RS_DRV_DATA_TXP_MSK 0xff
367#define RS_DRV_DATA_LQ_COLOR_POS 8
368#define RS_DRV_DATA_LQ_COLOR_MSK (7 << RS_DRV_DATA_LQ_COLOR_POS)
369#define RS_DRV_DATA_LQ_COLOR_GET(_f) (((_f) & RS_DRV_DATA_LQ_COLOR_MSK) >>\
370 RS_DRV_DATA_LQ_COLOR_POS)
371#define RS_DRV_DATA_PACK(_c, _p) ((void *)(uintptr_t)\
372 (((uintptr_t)_p) |\
373 ((_c) << RS_DRV_DATA_LQ_COLOR_POS)))
374
360/* Initialize station's rate scaling information after adding station */375/* Initialize station's rate scaling information after adding station */
361void iwl_mvm_rs_rate_init(struct iwl_mvm *mvm, struct ieee80211_sta *sta,376void iwl_mvm_rs_rate_init(struct iwl_mvm *mvm, struct ieee80211_sta *sta,
362 enum nl80211_band band, bool init);377 enum nl80211_band band, bool init);
drivers/net/wireless/intel/iwlwifi/mvm/sta.c+17−9
@@ -2120,7 +2120,8 @@ int iwl_mvm_add_mcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif) · 2119 unmodified lines
2120 if (!iwl_mvm_is_dqa_supported(mvm))2120 if (!iwl_mvm_is_dqa_supported(mvm))
2121 return 0;2121 return 0;
2122 2122
2123 if (WARN_ON(vif->type != NL80211_IFTYPE_AP))2123 if (WARN_ON(vif->type != NL80211_IFTYPE_AP &&
2124 vif->type != NL80211_IFTYPE_ADHOC))
2124 return -ENOTSUPP;2125 return -ENOTSUPP;
2125 2126
2126 /*2127 /*
@@ -2155,6 +2156,16 @@ int iwl_mvm_add_mcast_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif) · 28 unmodified lines
2155 mvmvif->cab_queue = queue;2156 mvmvif->cab_queue = queue;
2156 } else if (!fw_has_api(&mvm->fw->ucode_capa,2157 } else if (!fw_has_api(&mvm->fw->ucode_capa,
2157 IWL_UCODE_TLV_API_STA_TYPE)) {2158 IWL_UCODE_TLV_API_STA_TYPE)) {
2159 /*
2160 * In IBSS, ieee80211_check_queues() sets the cab_queue to be
2161 * invalid, so make sure we use the queue we want.
2162 * Note that this is done here as we want to avoid making DQA
2163 * changes in mac80211 layer.
2164 */
2165 if (vif->type == NL80211_IFTYPE_ADHOC) {
2166 vif->cab_queue = IWL_MVM_DQA_GCAST_QUEUE;
2167 mvmvif->cab_queue = vif->cab_queue;
2168 }
2158 iwl_mvm_enable_txq(mvm, vif->cab_queue, vif->cab_queue, 0,2169 iwl_mvm_enable_txq(mvm, vif->cab_queue, vif->cab_queue, 0,
2159 &cfg, timeout);2170 &cfg, timeout);
2160 }2171 }
@@ -3321,18 +3332,15 @@ int iwl_mvm_remove_sta_key(struct iwl_mvm *mvm, · 1160 unmodified lines
3321 3332
3322 /* Get the station from the mvm local station table */3333 /* Get the station from the mvm local station table */
3323 mvm_sta = iwl_mvm_get_key_sta(mvm, vif, sta);3334 mvm_sta = iwl_mvm_get_key_sta(mvm, vif, sta);
3324 if (!mvm_sta) {3335 if (mvm_sta)
3325 IWL_ERR(mvm, "Failed to find station\n");3336 sta_id = mvm_sta->sta_id;
3326 return -EINVAL;
3327 }
3328 sta_id = mvm_sta->sta_id;
3329 3337
3330 IWL_DEBUG_WEP(mvm, "mvm remove dynamic key: idx=%d sta=%d\n",3338 IWL_DEBUG_WEP(mvm, "mvm remove dynamic key: idx=%d sta=%d\n",
3331 keyconf->keyidx, sta_id);3339 keyconf->keyidx, sta_id);
3332 3340
3333 if (keyconf->cipher == WLAN_CIPHER_SUITE_AES_CMAC ||3341 if (mvm_sta && (keyconf->cipher == WLAN_CIPHER_SUITE_AES_CMAC ||
3334 keyconf->cipher == WLAN_CIPHER_SUITE_BIP_GMAC_128 ||3342 keyconf->cipher == WLAN_CIPHER_SUITE_BIP_GMAC_128 ||
3335 keyconf->cipher == WLAN_CIPHER_SUITE_BIP_GMAC_256)3343 keyconf->cipher == WLAN_CIPHER_SUITE_BIP_GMAC_256))
3336 return iwl_mvm_send_sta_igtk(mvm, keyconf, sta_id, true);3344 return iwl_mvm_send_sta_igtk(mvm, keyconf, sta_id, true);
3337 3345
3338 if (!__test_and_clear_bit(keyconf->hw_key_idx, mvm->fw_key_table)) {3346 if (!__test_and_clear_bit(keyconf->hw_key_idx, mvm->fw_key_table)) {
drivers/net/wireless/intel/iwlwifi/mvm/sta.h+2−0
@@ -313,6 +313,7 @@ enum iwl_mvm_agg_state { · 312 unmodified lines
313 * This is basically (last acked packet++).313 * This is basically (last acked packet++).
314 * @rate_n_flags: Rate at which Tx was attempted. Holds the data between the314 * @rate_n_flags: Rate at which Tx was attempted. Holds the data between the
315 * Tx response (TX_CMD), and the block ack notification (COMPRESSED_BA).315 * Tx response (TX_CMD), and the block ack notification (COMPRESSED_BA).
316 * @lq_color: the color of the LQ command as it appears in tx response.
316 * @amsdu_in_ampdu_allowed: true if A-MSDU in A-MPDU is allowed.317 * @amsdu_in_ampdu_allowed: true if A-MSDU in A-MPDU is allowed.
317 * @state: state of the BA agreement establishment / tear down.318 * @state: state of the BA agreement establishment / tear down.
318 * @txq_id: Tx queue used by the BA session / DQA319 * @txq_id: Tx queue used by the BA session / DQA
@@ -331,6 +332,7 @@ struct iwl_mvm_tid_data { · 12 unmodified lines
331 u16 next_reclaimed;332 u16 next_reclaimed;
332 /* The rest is Tx AGG related */333 /* The rest is Tx AGG related */
333 u32 rate_n_flags;334 u32 rate_n_flags;
335 u8 lq_color;
334 bool amsdu_in_ampdu_allowed;336 bool amsdu_in_ampdu_allowed;
335 enum iwl_mvm_agg_state state;337 enum iwl_mvm_agg_state state;
336 u16 txq_id;338 u16 txq_id;
drivers/net/wireless/intel/iwlwifi/mvm/tt.c+5−3
@@ -790,11 +790,13 @@ static int iwl_mvm_tcool_set_cur_state(struct thermal_cooling_device *cdev, · 789 unmodified lines
790 struct iwl_mvm *mvm = (struct iwl_mvm *)(cdev->devdata);790 struct iwl_mvm *mvm = (struct iwl_mvm *)(cdev->devdata);
791 int ret;791 int ret;
792 792
793 if (!mvm->ucode_loaded || !(mvm->cur_ucode == IWL_UCODE_REGULAR))
794 return -EIO;
795
796 mutex_lock(&mvm->mutex);793 mutex_lock(&mvm->mutex);
797 794
795 if (!mvm->ucode_loaded || !(mvm->cur_ucode == IWL_UCODE_REGULAR)) {
796 ret = -EIO;
797 goto unlock;
798 }
799
798 if (new_state >= ARRAY_SIZE(iwl_mvm_cdev_budgets)) {800 if (new_state >= ARRAY_SIZE(iwl_mvm_cdev_budgets)) {
799 ret = -EINVAL;801 ret = -EINVAL;
800 goto unlock;802 goto unlock;
drivers/net/wireless/intel/iwlwifi/mvm/tx.c+11−1
@@ -1323,6 +1323,7 @@ static void iwl_mvm_rx_tx_cmd_single(struct iwl_mvm *mvm, · 1322 unmodified lines
1323 struct iwl_mvm_sta *mvmsta;1323 struct iwl_mvm_sta *mvmsta;
1324 struct sk_buff_head skbs;1324 struct sk_buff_head skbs;
1325 u8 skb_freed = 0;1325 u8 skb_freed = 0;
1326 u8 lq_color;
1326 u16 next_reclaimed, seq_ctl;1327 u16 next_reclaimed, seq_ctl;
1327 bool is_ndp = false;1328 bool is_ndp = false;
1328 1329
@@ -1405,8 +1406,9 @@ static void iwl_mvm_rx_tx_cmd_single(struct iwl_mvm *mvm, · 76 unmodified lines
1405 info->status.tx_time =1406 info->status.tx_time =
1406 le16_to_cpu(tx_resp->wireless_media_time);1407 le16_to_cpu(tx_resp->wireless_media_time);
1407 BUILD_BUG_ON(ARRAY_SIZE(info->status.status_driver_data) < 1);1408 BUILD_BUG_ON(ARRAY_SIZE(info->status.status_driver_data) < 1);
1409 lq_color = TX_RES_RATE_TABLE_COL_GET(tx_resp->tlc_info);
1408 info->status.status_driver_data[0] =1410 info->status.status_driver_data[0] =
1409 (void *)(uintptr_t)tx_resp->reduced_tpc;1411 RS_DRV_DATA_PACK(lq_color, tx_resp->reduced_tpc);
1410 1412
1411 ieee80211_tx_status(mvm->hw, skb);1413 ieee80211_tx_status(mvm->hw, skb);
1412 }1414 }
@@ -1638,6 +1640,9 @@ static void iwl_mvm_rx_tx_cmd_agg(struct iwl_mvm *mvm, · 225 unmodified lines
1638 le32_to_cpu(tx_resp->initial_rate);1640 le32_to_cpu(tx_resp->initial_rate);
1639 mvmsta->tid_data[tid].tx_time =1641 mvmsta->tid_data[tid].tx_time =
1640 le16_to_cpu(tx_resp->wireless_media_time);1642 le16_to_cpu(tx_resp->wireless_media_time);
1643 mvmsta->tid_data[tid].lq_color =
1644 (tx_resp->tlc_info & TX_RES_RATE_TABLE_COLOR_MSK) >>
1645 TX_RES_RATE_TABLE_COLOR_POS;
1641 }1646 }
1642 1647
1643 rcu_read_unlock();1648 rcu_read_unlock();
@@ -1707,6 +1712,11 @@ static void iwl_mvm_tx_reclaim(struct iwl_mvm *mvm, int sta_id, int tid, · 63 unmodified lines
1707 iwl_mvm_check_ratid_empty(mvm, sta, tid);1712 iwl_mvm_check_ratid_empty(mvm, sta, tid);
1708 1713
1709 freed = 0;1714 freed = 0;
1715
1716 /* pack lq color from tid_data along the reduced txp */
1717 ba_info->status.status_driver_data[0] =
1718 RS_DRV_DATA_PACK(tid_data->lq_color,
1719 ba_info->status.status_driver_data[0]);
1710 ba_info->status.status_driver_data[1] = (void *)(uintptr_t)rate;1720 ba_info->status.status_driver_data[1] = (void *)(uintptr_t)rate;
1711 1721
1712 skb_queue_walk(&reclaimed_skbs, skb) {1722 skb_queue_walk(&reclaimed_skbs, skb) {
drivers/net/wireless/intel/iwlwifi/pcie/trans.c+4−2
@@ -2803,7 +2803,8 @@ static struct iwl_trans_dump_data · 2802 unmodified lines
2803#ifdef CONFIG_PM_SLEEP2803#ifdef CONFIG_PM_SLEEP
2804static int iwl_trans_pcie_suspend(struct iwl_trans *trans)2804static int iwl_trans_pcie_suspend(struct iwl_trans *trans)
2805{2805{
2806 if (trans->runtime_pm_mode == IWL_PLAT_PM_MODE_D0I3)2806 if (trans->runtime_pm_mode == IWL_PLAT_PM_MODE_D0I3 &&
2807 (trans->system_pm_mode == IWL_PLAT_PM_MODE_D0I3))
2807 return iwl_pci_fw_enter_d0i3(trans);2808 return iwl_pci_fw_enter_d0i3(trans);
2808 2809
2809 return 0;2810 return 0;
@@ -2811,7 +2812,8 @@ static int iwl_trans_pcie_suspend(struct iwl_trans *trans) · 1 unmodified line
2811 2812
2812static void iwl_trans_pcie_resume(struct iwl_trans *trans)2813static void iwl_trans_pcie_resume(struct iwl_trans *trans)
2813{2814{
2814 if (trans->runtime_pm_mode == IWL_PLAT_PM_MODE_D0I3)2815 if (trans->runtime_pm_mode == IWL_PLAT_PM_MODE_D0I3 &&
2816 (trans->system_pm_mode == IWL_PLAT_PM_MODE_D0I3))
2815 iwl_pci_fw_exit_d0i3(trans);2817 iwl_pci_fw_exit_d0i3(trans);
2816}2818}
2817#endif /* CONFIG_PM_SLEEP */2819#endif /* CONFIG_PM_SLEEP */
drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c+6−3
@@ -906,7 +906,7 @@ int iwl_trans_pcie_dyn_txq_alloc(struct iwl_trans *trans, · 905 unmodified lines
906 906
907 if (WARN_ON(iwl_rx_packet_payload_len(hcmd.resp_pkt) != sizeof(*rsp))) {907 if (WARN_ON(iwl_rx_packet_payload_len(hcmd.resp_pkt) != sizeof(*rsp))) {
908 ret = -EINVAL;908 ret = -EINVAL;
909 goto error;909 goto error_free_resp;
910 }910 }
911 911
912 rsp = (void *)hcmd.resp_pkt->data;912 rsp = (void *)hcmd.resp_pkt->data;
@@ -915,13 +915,13 @@ int iwl_trans_pcie_dyn_txq_alloc(struct iwl_trans *trans, · 2 unmodified lines
915 if (qid > ARRAY_SIZE(trans_pcie->txq)) {915 if (qid > ARRAY_SIZE(trans_pcie->txq)) {
916 WARN_ONCE(1, "queue index %d unsupported", qid);916 WARN_ONCE(1, "queue index %d unsupported", qid);
917 ret = -EIO;917 ret = -EIO;
918 goto error;918 goto error_free_resp;
919 }919 }
920 920
921 if (test_and_set_bit(qid, trans_pcie->queue_used)) {921 if (test_and_set_bit(qid, trans_pcie->queue_used)) {
922 WARN_ONCE(1, "queue %d already used", qid);922 WARN_ONCE(1, "queue %d already used", qid);
923 ret = -EIO;923 ret = -EIO;
924 goto error;924 goto error_free_resp;
925 }925 }
926 926
927 txq->id = qid;927 txq->id = qid;
@@ -934,8 +934,11 @@ int iwl_trans_pcie_dyn_txq_alloc(struct iwl_trans *trans, · 6 unmodified lines
934 (txq->write_ptr) | (qid << 16));934 (txq->write_ptr) | (qid << 16));
935 IWL_DEBUG_TX_QUEUES(trans, "Activate queue %d\n", qid);935 IWL_DEBUG_TX_QUEUES(trans, "Activate queue %d\n", qid);
936 936
937 iwl_free_resp(&hcmd);
937 return qid;938 return qid;
938 939
940error_free_resp:
941 iwl_free_resp(&hcmd);
939error:942error:
940 iwl_pcie_gen2_txq_free_memory(trans, txq);943 iwl_pcie_gen2_txq_free_memory(trans, txq);
941 return ret;944 return ret;
drivers/net/wireless/intersil/hostap/hostap_main.c+1−1
@@ -73,7 +73,7 @@ struct net_device * hostap_add_interface(struct local_info *local, · 72 unmodified lines
73 dev->mem_end = mdev->mem_end;73 dev->mem_end = mdev->mem_end;
74 74
75 hostap_setup_dev(dev, local, type);75 hostap_setup_dev(dev, local, type);
76 dev->destructor = free_netdev;76 dev->needs_free_netdev = true;
77 77
78 sprintf(dev->name, "%s%s", prefix, name);78 sprintf(dev->name, "%s%s", prefix, name);
79 if (!rtnl_locked)79 if (!rtnl_locked)
drivers/net/wireless/mac80211_hwsim.c+1−1
@@ -2861,7 +2861,7 @@ static const struct net_device_ops hwsim_netdev_ops = { · 2860 unmodified lines
2861static void hwsim_mon_setup(struct net_device *dev)2861static void hwsim_mon_setup(struct net_device *dev)
2862{2862{
2863 dev->netdev_ops = &hwsim_netdev_ops;2863 dev->netdev_ops = &hwsim_netdev_ops;
2864 dev->destructor = free_netdev;2864 dev->needs_free_netdev = true;
2865 ether_setup(dev);2865 ether_setup(dev);
2866 dev->priv_flags |= IFF_NO_QUEUE;2866 dev->priv_flags |= IFF_NO_QUEUE;
2867 dev->type = ARPHRD_IEEE80211_RADIOTAP;2867 dev->type = ARPHRD_IEEE80211_RADIOTAP;
drivers/net/wireless/marvell/mwifiex/main.c+1−1
@@ -1280,7 +1280,7 @@ void mwifiex_init_priv_params(struct mwifiex_private *priv, · 1279 unmodified lines
1280 struct net_device *dev)1280 struct net_device *dev)
1281{1281{
1282 dev->netdev_ops = &mwifiex_netdev_ops;1282 dev->netdev_ops = &mwifiex_netdev_ops;
1283 dev->destructor = free_netdev;1283 dev->needs_free_netdev = true;
1284 /* Initialize private structure */1284 /* Initialize private structure */
1285 priv->current_key_index = 0;1285 priv->current_key_index = 0;
1286 priv->media_connected = false;1286 priv->media_connected = false;
drivers/nvme/host/core.c+14−7
@@ -56,7 +56,7 @@ MODULE_PARM_DESC(max_retries, "max number of retries a command may have"); · 55 unmodified lines
56static int nvme_char_major;56static int nvme_char_major;
57module_param(nvme_char_major, int, 0);57module_param(nvme_char_major, int, 0);
58 58
59static unsigned long default_ps_max_latency_us = 25000;59static unsigned long default_ps_max_latency_us = 100000;
60module_param(default_ps_max_latency_us, ulong, 0644);60module_param(default_ps_max_latency_us, ulong, 0644);
61MODULE_PARM_DESC(default_ps_max_latency_us,61MODULE_PARM_DESC(default_ps_max_latency_us,
62 "max power saving latency for new devices; use PM QOS to change per device");62 "max power saving latency for new devices; use PM QOS to change per device");
@@ -1342,7 +1342,7 @@ static void nvme_configure_apst(struct nvme_ctrl *ctrl) · 1279 unmodified lines
1342 * transitioning between power states. Therefore, when running1342 * transitioning between power states. Therefore, when running
1343 * in any given state, we will enter the next lower-power1343 * in any given state, we will enter the next lower-power
1344 * non-operational state after waiting 50 * (enlat + exlat)1344 * non-operational state after waiting 50 * (enlat + exlat)
1345 * microseconds, as long as that state's total latency is under1345 * microseconds, as long as that state's exit latency is under
1346 * the requested maximum latency.1346 * the requested maximum latency.
1347 *1347 *
1348 * We will not autonomously enter any non-operational state for1348 * We will not autonomously enter any non-operational state for
@@ -1387,7 +1387,7 @@ static void nvme_configure_apst(struct nvme_ctrl *ctrl) · 38 unmodified lines
1387 * lowest-power state, not the number of states.1387 * lowest-power state, not the number of states.
1388 */1388 */
1389 for (state = (int)ctrl->npss; state >= 0; state--) {1389 for (state = (int)ctrl->npss; state >= 0; state--) {
1390 u64 total_latency_us, transition_ms;1390 u64 total_latency_us, exit_latency_us, transition_ms;
1391 1391
1392 if (target)1392 if (target)
1393 table->entries[state] = target;1393 table->entries[state] = target;
@@ -1408,12 +1408,15 @@ static void nvme_configure_apst(struct nvme_ctrl *ctrl) · 14 unmodified lines
1408 NVME_PS_FLAGS_NON_OP_STATE))1408 NVME_PS_FLAGS_NON_OP_STATE))
1409 continue;1409 continue;
1410 1410
1411 total_latency_us =1411 exit_latency_us =
1412 (u64)le32_to_cpu(ctrl->psd[state].entry_lat) +1412 (u64)le32_to_cpu(ctrl->psd[state].exit_lat);
1413 + le32_to_cpu(ctrl->psd[state].exit_lat);1413 if (exit_latency_us > ctrl->ps_max_latency_us)
1414 if (total_latency_us > ctrl->ps_max_latency_us)
1415 continue;1414 continue;
1416 1415
1416 total_latency_us =
1417 exit_latency_us +
1418 le32_to_cpu(ctrl->psd[state].entry_lat);
1419
1417 /*1420 /*
1418 * This state is good. Use it as the APST idle1421 * This state is good. Use it as the APST idle
1419 * target for higher power states.1422 * target for higher power states.
@@ -2438,6 +2441,10 @@ void nvme_kill_queues(struct nvme_ctrl *ctrl) · 1018 unmodified lines
2438 struct nvme_ns *ns;2441 struct nvme_ns *ns;
2439 2442
2440 mutex_lock(&ctrl->namespaces_mutex);2443 mutex_lock(&ctrl->namespaces_mutex);
2444
2445 /* Forcibly start all queues to avoid having stuck requests */
2446 blk_mq_start_hw_queues(ctrl->admin_q);
2447
2441 list_for_each_entry(ns, &ctrl->namespaces, list) {2448 list_for_each_entry(ns, &ctrl->namespaces, list) {
2442 /*2449 /*
2443 * Revalidating a dead namespace sets capacity to 0. This will2450 * Revalidating a dead namespace sets capacity to 0. This will
drivers/nvme/host/fc.c+18−2
@@ -1139,6 +1139,7 @@ nvme_fc_xmt_disconnect_assoc(struct nvme_fc_ctrl *ctrl) · 1138 unmodified lines
1139/* *********************** NVME Ctrl Routines **************************** */1139/* *********************** NVME Ctrl Routines **************************** */
1140 1140
1141static void __nvme_fc_final_op_cleanup(struct request *rq);1141static void __nvme_fc_final_op_cleanup(struct request *rq);
1142static void nvme_fc_error_recovery(struct nvme_fc_ctrl *ctrl, char *errmsg);
1142 1143
1143static int1144static int
1144nvme_fc_reinit_request(void *data, struct request *rq)1145nvme_fc_reinit_request(void *data, struct request *rq)
@@ -1265,7 +1266,7 @@ nvme_fc_fcpio_done(struct nvmefc_fcp_req *req) · 120 unmodified lines
1265 struct nvme_command *sqe = &op->cmd_iu.sqe;1266 struct nvme_command *sqe = &op->cmd_iu.sqe;
1266 __le16 status = cpu_to_le16(NVME_SC_SUCCESS << 1);1267 __le16 status = cpu_to_le16(NVME_SC_SUCCESS << 1);
1267 union nvme_result result;1268 union nvme_result result;
1268 bool complete_rq;1269 bool complete_rq, terminate_assoc = true;
1269 1270
1270 /*1271 /*
1271 * WARNING:1272 * WARNING:
@@ -1294,6 +1295,14 @@ nvme_fc_fcpio_done(struct nvmefc_fcp_req *req) · 22 unmodified lines
1294 * fabricate a CQE, the following fields will not be set as they1295 * fabricate a CQE, the following fields will not be set as they
1295 * are not referenced:1296 * are not referenced:
1296 * cqe.sqid, cqe.sqhd, cqe.command_id1297 * cqe.sqid, cqe.sqhd, cqe.command_id
1298 *
1299 * Failure or error of an individual i/o, in a transport
1300 * detected fashion unrelated to the nvme completion status,
1301 * potentially cause the initiator and target sides to get out
1302 * of sync on SQ head/tail (aka outstanding io count allowed).
1303 * Per FC-NVME spec, failure of an individual command requires
1304 * the connection to be terminated, which in turn requires the
1305 * association to be terminated.
1297 */1306 */
1298 1307
1299 fc_dma_sync_single_for_cpu(ctrl->lport->dev, op->fcp_req.rspdma,1308 fc_dma_sync_single_for_cpu(ctrl->lport->dev, op->fcp_req.rspdma,
@@ -1359,6 +1368,8 @@ nvme_fc_fcpio_done(struct nvmefc_fcp_req *req) · 59 unmodified lines
1359 goto done;1368 goto done;
1360 }1369 }
1361 1370
1371 terminate_assoc = false;
1372
1362done:1373done:
1363 if (op->flags & FCOP_FLAGS_AEN) {1374 if (op->flags & FCOP_FLAGS_AEN) {
1364 nvme_complete_async_event(&queue->ctrl->ctrl, status, &result);1375 nvme_complete_async_event(&queue->ctrl->ctrl, status, &result);
@@ -1366,7 +1377,7 @@ done: · 1 unmodified line
1366 atomic_set(&op->state, FCPOP_STATE_IDLE);1377 atomic_set(&op->state, FCPOP_STATE_IDLE);
1367 op->flags = FCOP_FLAGS_AEN; /* clear other flags */1378 op->flags = FCOP_FLAGS_AEN; /* clear other flags */
1368 nvme_fc_ctrl_put(ctrl);1379 nvme_fc_ctrl_put(ctrl);
1369 return;1380 goto check_error;
1370 }1381 }
1371 1382
1372 complete_rq = __nvme_fc_fcpop_chk_teardowns(ctrl, op);1383 complete_rq = __nvme_fc_fcpop_chk_teardowns(ctrl, op);
@@ -1379,6 +1390,10 @@ done: · 6 unmodified lines
1379 nvme_end_request(rq, status, result);1390 nvme_end_request(rq, status, result);
1380 } else1391 } else
1381 __nvme_fc_final_op_cleanup(rq);1392 __nvme_fc_final_op_cleanup(rq);
1393
1394check_error:
1395 if (terminate_assoc)
1396 nvme_fc_error_recovery(ctrl, "transport detected io error");
1382}1397}
1383 1398
1384static int1399static int
@@ -2791,6 +2806,7 @@ nvme_fc_init_ctrl(struct device *dev, struct nvmf_ctrl_options *opts, · 1406 unmodified lines
2791 ctrl->ctrl.opts = NULL;2806 ctrl->ctrl.opts = NULL;
2792 /* initiate nvme ctrl ref counting teardown */2807 /* initiate nvme ctrl ref counting teardown */
2793 nvme_uninit_ctrl(&ctrl->ctrl);2808 nvme_uninit_ctrl(&ctrl->ctrl);
2809 nvme_put_ctrl(&ctrl->ctrl);
2794 2810
2795 /* as we're past the point where we transition to the ref2811 /* as we're past the point where we transition to the ref
2796 * counting teardown path, if we return a bad pointer here,2812 * counting teardown path, if we return a bad pointer here,
drivers/nvme/host/pci.c+6−7
@@ -1367,7 +1367,7 @@ static bool nvme_should_reset(struct nvme_dev *dev, u32 csts) · 1366 unmodified lines
1367 bool nssro = dev->subsystem && (csts & NVME_CSTS_NSSRO);1367 bool nssro = dev->subsystem && (csts & NVME_CSTS_NSSRO);
1368 1368
1369 /* If there is a reset ongoing, we shouldn't reset again. */1369 /* If there is a reset ongoing, we shouldn't reset again. */
1370 if (work_busy(&dev->reset_work))1370 if (dev->ctrl.state == NVME_CTRL_RESETTING)
1371 return false;1371 return false;
1372 1372
1373 /* We shouldn't reset unless the controller is on fatal error state1373 /* We shouldn't reset unless the controller is on fatal error state
@@ -1903,7 +1903,7 @@ static void nvme_reset_work(struct work_struct *work) · 529 unmodified lines
1903 bool was_suspend = !!(dev->ctrl.ctrl_config & NVME_CC_SHN_NORMAL);1903 bool was_suspend = !!(dev->ctrl.ctrl_config & NVME_CC_SHN_NORMAL);
1904 int result = -ENODEV;1904 int result = -ENODEV;
1905 1905
1906 if (WARN_ON(dev->ctrl.state == NVME_CTRL_RESETTING))1906 if (WARN_ON(dev->ctrl.state != NVME_CTRL_RESETTING))
1907 goto out;1907 goto out;
1908 1908
1909 /*1909 /*
@@ -1913,9 +1913,6 @@ static void nvme_reset_work(struct work_struct *work) · 3 unmodified lines
1913 if (dev->ctrl.ctrl_config & NVME_CC_ENABLE)1913 if (dev->ctrl.ctrl_config & NVME_CC_ENABLE)
1914 nvme_dev_disable(dev, false);1914 nvme_dev_disable(dev, false);
1915 1915
1916 if (!nvme_change_ctrl_state(&dev->ctrl, NVME_CTRL_RESETTING))
1917 goto out;
1918
1919 result = nvme_pci_enable(dev);1916 result = nvme_pci_enable(dev);
1920 if (result)1917 if (result)
1921 goto out;1918 goto out;
@@ -2009,8 +2006,8 @@ static int nvme_reset(struct nvme_dev *dev) · 87 unmodified lines
2009{2006{
2010 if (!dev->ctrl.admin_q || blk_queue_dying(dev->ctrl.admin_q))2007 if (!dev->ctrl.admin_q || blk_queue_dying(dev->ctrl.admin_q))
2011 return -ENODEV;2008 return -ENODEV;
2012 if (work_busy(&dev->reset_work))2009 if (!nvme_change_ctrl_state(&dev->ctrl, NVME_CTRL_RESETTING))
2013 return -ENODEV;2010 return -EBUSY;
2014 if (!queue_work(nvme_workq, &dev->reset_work))2011 if (!queue_work(nvme_workq, &dev->reset_work))
2015 return -EBUSY;2012 return -EBUSY;
2016 return 0;2013 return 0;
@@ -2136,6 +2133,7 @@ static int nvme_probe(struct pci_dev *pdev, const struct pci_device_id *id) · 119 unmodified lines
2136 if (result)2133 if (result)
2137 goto release_pools;2134 goto release_pools;
2138 2135
2136 nvme_change_ctrl_state(&dev->ctrl, NVME_CTRL_RESETTING);
2139 dev_info(dev->ctrl.device, "pci function %s\n", dev_name(&pdev->dev));2137 dev_info(dev->ctrl.device, "pci function %s\n", dev_name(&pdev->dev));
2140 2138
2141 queue_work(nvme_workq, &dev->reset_work);2139 queue_work(nvme_workq, &dev->reset_work);
@@ -2179,6 +2177,7 @@ static void nvme_remove(struct pci_dev *pdev) · 37 unmodified lines
2179 2177
2180 nvme_change_ctrl_state(&dev->ctrl, NVME_CTRL_DELETING);2178 nvme_change_ctrl_state(&dev->ctrl, NVME_CTRL_DELETING);
2181 2179
2180 cancel_work_sync(&dev->reset_work);
2182 pci_set_drvdata(pdev, NULL);2181 pci_set_drvdata(pdev, NULL);
2183 2182
2184 if (!pci_device_is_present(pdev)) {2183 if (!pci_device_is_present(pdev)) {
drivers/nvme/host/rdma.c+29−15
@@ -753,28 +753,26 @@ static void nvme_rdma_reconnect_ctrl_work(struct work_struct *work) · 752 unmodified lines
753 if (ret)753 if (ret)
754 goto requeue;754 goto requeue;
755 755
756 blk_mq_start_stopped_hw_queues(ctrl->ctrl.admin_q, true);
757
758 ret = nvmf_connect_admin_queue(&ctrl->ctrl);756 ret = nvmf_connect_admin_queue(&ctrl->ctrl);
759 if (ret)757 if (ret)
760 goto stop_admin_q;758 goto requeue;
761 759
762 set_bit(NVME_RDMA_Q_LIVE, &ctrl->queues[0].flags);760 set_bit(NVME_RDMA_Q_LIVE, &ctrl->queues[0].flags);
763 761
764 ret = nvme_enable_ctrl(&ctrl->ctrl, ctrl->cap);762 ret = nvme_enable_ctrl(&ctrl->ctrl, ctrl->cap);
765 if (ret)763 if (ret)
766 goto stop_admin_q;764 goto requeue;
767 765
768 nvme_start_keep_alive(&ctrl->ctrl);766 nvme_start_keep_alive(&ctrl->ctrl);
769 767
770 if (ctrl->queue_count > 1) {768 if (ctrl->queue_count > 1) {
771 ret = nvme_rdma_init_io_queues(ctrl);769 ret = nvme_rdma_init_io_queues(ctrl);
772 if (ret)770 if (ret)
773 goto stop_admin_q;771 goto requeue;
774 772
775 ret = nvme_rdma_connect_io_queues(ctrl);773 ret = nvme_rdma_connect_io_queues(ctrl);
776 if (ret)774 if (ret)
777 goto stop_admin_q;775 goto requeue;
778 }776 }
779 777
780 changed = nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_LIVE);778 changed = nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_LIVE);
@@ -782,7 +780,6 @@ static void nvme_rdma_reconnect_ctrl_work(struct work_struct *work) · 1 unmodified line
782 ctrl->ctrl.opts->nr_reconnects = 0;780 ctrl->ctrl.opts->nr_reconnects = 0;
783 781
784 if (ctrl->queue_count > 1) {782 if (ctrl->queue_count > 1) {
785 nvme_start_queues(&ctrl->ctrl);
786 nvme_queue_scan(&ctrl->ctrl);783 nvme_queue_scan(&ctrl->ctrl);
787 nvme_queue_async_events(&ctrl->ctrl);784 nvme_queue_async_events(&ctrl->ctrl);
788 }785 }
@@ -791,8 +788,6 @@ static void nvme_rdma_reconnect_ctrl_work(struct work_struct *work) · 2 unmodified lines
791 788
792 return;789 return;
793 790
794stop_admin_q:
795 blk_mq_stop_hw_queues(ctrl->ctrl.admin_q);
796requeue:791requeue:
797 dev_info(ctrl->ctrl.device, "Failed reconnect attempt %d\n",792 dev_info(ctrl->ctrl.device, "Failed reconnect attempt %d\n",
798 ctrl->ctrl.opts->nr_reconnects);793 ctrl->ctrl.opts->nr_reconnects);
@@ -823,6 +818,13 @@ static void nvme_rdma_error_recovery_work(struct work_struct *work) · 24 unmodified lines
823 blk_mq_tagset_busy_iter(&ctrl->admin_tag_set,818 blk_mq_tagset_busy_iter(&ctrl->admin_tag_set,
824 nvme_cancel_request, &ctrl->ctrl);819 nvme_cancel_request, &ctrl->ctrl);
825 820
821 /*
822 * queues are not a live anymore, so restart the queues to fail fast
823 * new IO
824 */
825 blk_mq_start_stopped_hw_queues(ctrl->ctrl.admin_q, true);
826 nvme_start_queues(&ctrl->ctrl);
827
826 nvme_rdma_reconnect_or_remove(ctrl);828 nvme_rdma_reconnect_or_remove(ctrl);
827}829}
828 830
@@ -1433,7 +1435,7 @@ nvme_rdma_timeout(struct request *rq, bool reserved) · 604 unmodified lines
1433/*1435/*
1434 * We cannot accept any other command until the Connect command has completed.1436 * We cannot accept any other command until the Connect command has completed.
1435 */1437 */
1436static inline bool nvme_rdma_queue_is_ready(struct nvme_rdma_queue *queue,1438static inline int nvme_rdma_queue_is_ready(struct nvme_rdma_queue *queue,
1437 struct request *rq)1439 struct request *rq)
1438{1440{
1439 if (unlikely(!test_bit(NVME_RDMA_Q_LIVE, &queue->flags))) {1441 if (unlikely(!test_bit(NVME_RDMA_Q_LIVE, &queue->flags))) {
@@ -1441,11 +1443,22 @@ static inline bool nvme_rdma_queue_is_ready(struct nvme_rdma_queue *queue, · 1 unmodified line
1441 1443
1442 if (!blk_rq_is_passthrough(rq) ||1444 if (!blk_rq_is_passthrough(rq) ||
1443 cmd->common.opcode != nvme_fabrics_command ||1445 cmd->common.opcode != nvme_fabrics_command ||
1444 cmd->fabrics.fctype != nvme_fabrics_type_connect)1446 cmd->fabrics.fctype != nvme_fabrics_type_connect) {
1445 return false;1447 /*
1448 * reconnecting state means transport disruption, which
1449 * can take a long time and even might fail permanently,
1450 * so we can't let incoming I/O be requeued forever.
1451 * fail it fast to allow upper layers a chance to
1452 * failover.
1453 */
1454 if (queue->ctrl->ctrl.state == NVME_CTRL_RECONNECTING)
1455 return -EIO;
1456 else
1457 return -EAGAIN;
1458 }
1446 }1459 }
1447 1460
1448 return true;1461 return 0;
1449}1462}
1450 1463
1451static int nvme_rdma_queue_rq(struct blk_mq_hw_ctx *hctx,1464static int nvme_rdma_queue_rq(struct blk_mq_hw_ctx *hctx,
@@ -1463,8 +1476,9 @@ static int nvme_rdma_queue_rq(struct blk_mq_hw_ctx *hctx, · 11 unmodified lines
1463 1476
1464 WARN_ON_ONCE(rq->tag < 0);1477 WARN_ON_ONCE(rq->tag < 0);
1465 1478
1466 if (!nvme_rdma_queue_is_ready(queue, rq))1479 ret = nvme_rdma_queue_is_ready(queue, rq);
1467 return BLK_MQ_RQ_QUEUE_BUSY;1480 if (unlikely(ret))
1481 goto err;
1468 1482
1469 dev = queue->device->dev;1483 dev = queue->device->dev;
1470 ib_dma_sync_single_for_cpu(dev, sqe->dma,1484 ib_dma_sync_single_for_cpu(dev, sqe->dma,
drivers/of/device.c+2−2
@@ -144,8 +144,8 @@ int of_dma_configure(struct device *dev, struct device_node *np) · 143 unmodified lines
144 coherent ? " " : " not ");144 coherent ? " " : " not ");
145 145
146 iommu = of_iommu_configure(dev, np);146 iommu = of_iommu_configure(dev, np);
147 if (IS_ERR(iommu))147 if (IS_ERR(iommu) && PTR_ERR(iommu) == -EPROBE_DEFER)
148 return PTR_ERR(iommu);148 return -EPROBE_DEFER;
149 149
150 dev_dbg(dev, "device is%sbehind an iommu\n",150 dev_dbg(dev, "device is%sbehind an iommu\n",
151 iommu ? " " : " not ");151 iommu ? " " : " not ");
drivers/pci/access.c+6−6
@@ -896,7 +896,7 @@ int pci_read_config_byte(const struct pci_dev *dev, int where, u8 *val) · 895 unmodified lines
896{896{
897 if (pci_dev_is_disconnected(dev)) {897 if (pci_dev_is_disconnected(dev)) {
898 *val = ~0;898 *val = ~0;
899 return -ENODEV;899 return PCIBIOS_DEVICE_NOT_FOUND;
900 }900 }
901 return pci_bus_read_config_byte(dev->bus, dev->devfn, where, val);901 return pci_bus_read_config_byte(dev->bus, dev->devfn, where, val);
902}902}
@@ -906,7 +906,7 @@ int pci_read_config_word(const struct pci_dev *dev, int where, u16 *val) · 3 unmodified lines
906{906{
907 if (pci_dev_is_disconnected(dev)) {907 if (pci_dev_is_disconnected(dev)) {
908 *val = ~0;908 *val = ~0;
909 return -ENODEV;909 return PCIBIOS_DEVICE_NOT_FOUND;
910 }910 }
911 return pci_bus_read_config_word(dev->bus, dev->devfn, where, val);911 return pci_bus_read_config_word(dev->bus, dev->devfn, where, val);
912}912}
@@ -917,7 +917,7 @@ int pci_read_config_dword(const struct pci_dev *dev, int where, · 4 unmodified lines
917{917{
918 if (pci_dev_is_disconnected(dev)) {918 if (pci_dev_is_disconnected(dev)) {
919 *val = ~0;919 *val = ~0;
920 return -ENODEV;920 return PCIBIOS_DEVICE_NOT_FOUND;
921 }921 }
922 return pci_bus_read_config_dword(dev->bus, dev->devfn, where, val);922 return pci_bus_read_config_dword(dev->bus, dev->devfn, where, val);
923}923}
@@ -926,7 +926,7 @@ EXPORT_SYMBOL(pci_read_config_dword); · 2 unmodified lines
926int pci_write_config_byte(const struct pci_dev *dev, int where, u8 val)926int pci_write_config_byte(const struct pci_dev *dev, int where, u8 val)
927{927{
928 if (pci_dev_is_disconnected(dev))928 if (pci_dev_is_disconnected(dev))
929 return -ENODEV;929 return PCIBIOS_DEVICE_NOT_FOUND;
930 return pci_bus_write_config_byte(dev->bus, dev->devfn, where, val);930 return pci_bus_write_config_byte(dev->bus, dev->devfn, where, val);
931}931}
932EXPORT_SYMBOL(pci_write_config_byte);932EXPORT_SYMBOL(pci_write_config_byte);
@@ -934,7 +934,7 @@ EXPORT_SYMBOL(pci_write_config_byte); · 1 unmodified line
934int pci_write_config_word(const struct pci_dev *dev, int where, u16 val)934int pci_write_config_word(const struct pci_dev *dev, int where, u16 val)
935{935{
936 if (pci_dev_is_disconnected(dev))936 if (pci_dev_is_disconnected(dev))
937 return -ENODEV;937 return PCIBIOS_DEVICE_NOT_FOUND;
938 return pci_bus_write_config_word(dev->bus, dev->devfn, where, val);938 return pci_bus_write_config_word(dev->bus, dev->devfn, where, val);
939}939}
940EXPORT_SYMBOL(pci_write_config_word);940EXPORT_SYMBOL(pci_write_config_word);
@@ -943,7 +943,7 @@ int pci_write_config_dword(const struct pci_dev *dev, int where, · 2 unmodified lines
943 u32 val)943 u32 val)
944{944{
945 if (pci_dev_is_disconnected(dev))945 if (pci_dev_is_disconnected(dev))
946 return -ENODEV;946 return PCIBIOS_DEVICE_NOT_FOUND;
947 return pci_bus_write_config_dword(dev->bus, dev->devfn, where, val);947 return pci_bus_write_config_dword(dev->bus, dev->devfn, where, val);
948}948}
949EXPORT_SYMBOL(pci_write_config_dword);949EXPORT_SYMBOL(pci_write_config_dword);
drivers/pci/endpoint/functions/Kconfig+1−0
@@ -5,6 +5,7 @@ · 4 unmodified lines
5config PCI_EPF_TEST5config PCI_EPF_TEST
6 tristate "PCI Endpoint Test driver"6 tristate "PCI Endpoint Test driver"
7 depends on PCI_ENDPOINT7 depends on PCI_ENDPOINT
8 select CRC32
8 help9 help
9 Enable this configuration option to enable the test driver10 Enable this configuration option to enable the test driver
10 for PCI Endpoint.11 for PCI Endpoint.
drivers/perf/arm_pmu_acpi.c+11−0
@@ -29,6 +29,17 @@ static int arm_pmu_acpi_register_irq(int cpu) · 28 unmodified lines
29 return -EINVAL;29 return -EINVAL;
30 30
31 gsi = gicc->performance_interrupt;31 gsi = gicc->performance_interrupt;
32
33 /*
34 * Per the ACPI spec, the MADT cannot describe a PMU that doesn't
35 * have an interrupt. QEMU advertises this by using a GSI of zero,
36 * which is not known to be valid on any hardware despite being
37 * valid per the spec. Take the pragmatic approach and reject a
38 * GSI of zero for now.
39 */
40 if (!gsi)
41 return 0;
42
32 if (gicc->flags & ACPI_MADT_PERFORMANCE_IRQ_MODE)43 if (gicc->flags & ACPI_MADT_PERFORMANCE_IRQ_MODE)
33 trigger = ACPI_EDGE_SENSITIVE;44 trigger = ACPI_EDGE_SENSITIVE;
34 else45 else
drivers/phy/phy-qcom-qmp.c+7−7
@@ -844,7 +844,7 @@ static int qcom_qmp_phy_vreg_init(struct device *dev) · 843 unmodified lines
844 int num = qmp->cfg->num_vregs;844 int num = qmp->cfg->num_vregs;
845 int i;845 int i;
846 846
847 qmp->vregs = devm_kcalloc(dev, num, sizeof(qmp->vregs), GFP_KERNEL);847 qmp->vregs = devm_kcalloc(dev, num, sizeof(*qmp->vregs), GFP_KERNEL);
848 if (!qmp->vregs)848 if (!qmp->vregs)
849 return -ENOMEM;849 return -ENOMEM;
850 850
@@ -983,16 +983,16 @@ int qcom_qmp_phy_create(struct device *dev, struct device_node *np, int id) · 132 unmodified lines
983 * Resources are indexed as: tx -> 0; rx -> 1; pcs -> 2.983 * Resources are indexed as: tx -> 0; rx -> 1; pcs -> 2.
984 */984 */
985 qphy->tx = of_iomap(np, 0);985 qphy->tx = of_iomap(np, 0);
986 if (IS_ERR(qphy->tx))986 if (!qphy->tx)
987 return PTR_ERR(qphy->tx);987 return -ENOMEM;
988 988
989 qphy->rx = of_iomap(np, 1);989 qphy->rx = of_iomap(np, 1);
990 if (IS_ERR(qphy->rx))990 if (!qphy->rx)
991 return PTR_ERR(qphy->rx);991 return -ENOMEM;
992 992
993 qphy->pcs = of_iomap(np, 2);993 qphy->pcs = of_iomap(np, 2);
994 if (IS_ERR(qphy->pcs))994 if (!qphy->pcs)
995 return PTR_ERR(qphy->pcs);995 return -ENOMEM;
996 996
997 /*997 /*
998 * Get PHY's Pipe clock, if any. USB3 and PCIe are PIPE3998 * Get PHY's Pipe clock, if any. USB3 and PCIe are PIPE3
drivers/pinctrl/core.c+3−17
@@ -680,30 +680,16 @@ EXPORT_SYMBOL_GPL(pinctrl_generic_remove_group); · 679 unmodified lines
680 * pinctrl_generic_free_groups() - removes all pin groups680 * pinctrl_generic_free_groups() - removes all pin groups
681 * @pctldev: pin controller device681 * @pctldev: pin controller device
682 *682 *
683 * Note that the caller must take care of locking.683 * Note that the caller must take care of locking. The pinctrl groups
684 * are allocated with devm_kzalloc() so no need to free them here.
684 */685 */
685static void pinctrl_generic_free_groups(struct pinctrl_dev *pctldev)686static void pinctrl_generic_free_groups(struct pinctrl_dev *pctldev)
686{687{
687 struct radix_tree_iter iter;688 struct radix_tree_iter iter;
688 struct group_desc *group;
689 unsigned long *indices;
690 void **slot;689 void **slot;
691 int i = 0;
692
693 indices = devm_kzalloc(pctldev->dev, sizeof(*indices) *
694 pctldev->num_groups, GFP_KERNEL);
695 if (!indices)
696 return;
697 690
698 radix_tree_for_each_slot(slot, &pctldev->pin_group_tree, &iter, 0)691 radix_tree_for_each_slot(slot, &pctldev->pin_group_tree, &iter, 0)
699 indices[i++] = iter.index;692 radix_tree_delete(&pctldev->pin_group_tree, iter.index);
700
701 for (i = 0; i < pctldev->num_groups; i++) {
702 group = radix_tree_lookup(&pctldev->pin_group_tree,
703 indices[i]);
704 radix_tree_delete(&pctldev->pin_group_tree, indices[i]);
705 devm_kfree(pctldev->dev, group);
706 }
707 693
708 pctldev->num_groups = 0;694 pctldev->num_groups = 0;
709}695}
drivers/pinctrl/freescale/pinctrl-mxs.c+12−4
@@ -194,6 +194,16 @@ static int mxs_pinctrl_get_func_groups(struct pinctrl_dev *pctldev, · 193 unmodified lines
194 return 0;194 return 0;
195}195}
196 196
197static void mxs_pinctrl_rmwl(u32 value, u32 mask, u8 shift, void __iomem *reg)
198{
199 u32 tmp;
200
201 tmp = readl(reg);
202 tmp &= ~(mask << shift);
203 tmp |= value << shift;
204 writel(tmp, reg);
205}
206
197static int mxs_pinctrl_set_mux(struct pinctrl_dev *pctldev, unsigned selector,207static int mxs_pinctrl_set_mux(struct pinctrl_dev *pctldev, unsigned selector,
198 unsigned group)208 unsigned group)
199{209{
@@ -211,8 +221,7 @@ static int mxs_pinctrl_set_mux(struct pinctrl_dev *pctldev, unsigned selector, · 11 unmodified lines
211 reg += bank * 0x20 + pin / 16 * 0x10;221 reg += bank * 0x20 + pin / 16 * 0x10;
212 shift = pin % 16 * 2;222 shift = pin % 16 * 2;
213 223
214 writel(0x3 << shift, reg + CLR);224 mxs_pinctrl_rmwl(g->muxsel[i], 0x3, shift, reg);
215 writel(g->muxsel[i] << shift, reg + SET);
216 }225 }
217 226
218 return 0;227 return 0;
@@ -279,8 +288,7 @@ static int mxs_pinconf_group_set(struct pinctrl_dev *pctldev, · 60 unmodified lines
279 /* mA */288 /* mA */
280 if (config & MA_PRESENT) {289 if (config & MA_PRESENT) {
281 shift = pin % 8 * 4;290 shift = pin % 8 * 4;
282 writel(0x3 << shift, reg + CLR);291 mxs_pinctrl_rmwl(ma, 0x3, shift, reg);
283 writel(ma << shift, reg + SET);
284 }292 }
285 293
286 /* vol */294 /* vol */
drivers/pinctrl/intel/pinctrl-cherryview.c+19−5
@@ -1539,15 +1539,29 @@ static void chv_gpio_irq_handler(struct irq_desc *desc) · 1538 unmodified lines
1539 * is not listed below.1539 * is not listed below.
1540 */1540 */
1541static const struct dmi_system_id chv_no_valid_mask[] = {1541static const struct dmi_system_id chv_no_valid_mask[] = {
1542 /* See https://bugzilla.kernel.org/show_bug.cgi?id=194945 */
1542 {1543 {
1543 /* See https://bugzilla.kernel.org/show_bug.cgi?id=194945 */1544 .ident = "Intel_Strago based Chromebooks (All models)",
1544 .ident = "Acer Chromebook (CYAN)",
1545 .matches = {1545 .matches = {
1546 DMI_MATCH(DMI_SYS_VENDOR, "GOOGLE"),1546 DMI_MATCH(DMI_SYS_VENDOR, "GOOGLE"),
1547 DMI_MATCH(DMI_PRODUCT_NAME, "Edgar"),1547 DMI_MATCH(DMI_PRODUCT_FAMILY, "Intel_Strago"),
1548 DMI_MATCH(DMI_BIOS_DATE, "05/21/2016"),
1549 },1548 },
1550 }1549 },
1550 {
1551 .ident = "Acer Chromebook R11 (Cyan)",
1552 .matches = {
1553 DMI_MATCH(DMI_SYS_VENDOR, "GOOGLE"),
1554 DMI_MATCH(DMI_PRODUCT_NAME, "Cyan"),
1555 },
1556 },
1557 {
1558 .ident = "Samsung Chromebook 3 (Celes)",
1559 .matches = {
1560 DMI_MATCH(DMI_SYS_VENDOR, "GOOGLE"),
1561 DMI_MATCH(DMI_PRODUCT_NAME, "Celes"),
1562 },
1563 },
1564 {}
1551};1565};
1552 1566
1553static int chv_gpio_probe(struct chv_pinctrl *pctrl, int irq)1567static int chv_gpio_probe(struct chv_pinctrl *pctrl, int irq)
drivers/pinctrl/pinconf-generic.c+0−3
@@ -35,7 +35,6 @@ static const struct pin_config_item conf_items[] = { · 34 unmodified lines
35 PCONFDUMP(PIN_CONFIG_BIAS_PULL_PIN_DEFAULT,35 PCONFDUMP(PIN_CONFIG_BIAS_PULL_PIN_DEFAULT,
36 "input bias pull to pin specific state", NULL, false),36 "input bias pull to pin specific state", NULL, false),
37 PCONFDUMP(PIN_CONFIG_BIAS_PULL_UP, "input bias pull up", NULL, false),37 PCONFDUMP(PIN_CONFIG_BIAS_PULL_UP, "input bias pull up", NULL, false),
38 PCONFDUMP(PIN_CONFIG_BIDIRECTIONAL, "bi-directional pin operations", NULL, false),
39 PCONFDUMP(PIN_CONFIG_DRIVE_OPEN_DRAIN, "output drive open drain", NULL, false),38 PCONFDUMP(PIN_CONFIG_DRIVE_OPEN_DRAIN, "output drive open drain", NULL, false),
40 PCONFDUMP(PIN_CONFIG_DRIVE_OPEN_SOURCE, "output drive open source", NULL, false),39 PCONFDUMP(PIN_CONFIG_DRIVE_OPEN_SOURCE, "output drive open source", NULL, false),
41 PCONFDUMP(PIN_CONFIG_DRIVE_PUSH_PULL, "output drive push pull", NULL, false),40 PCONFDUMP(PIN_CONFIG_DRIVE_PUSH_PULL, "output drive push pull", NULL, false),
@@ -161,7 +160,6 @@ static const struct pinconf_generic_params dt_params[] = { · 119 unmodified lines
161 { "bias-pull-up", PIN_CONFIG_BIAS_PULL_UP, 1 },160 { "bias-pull-up", PIN_CONFIG_BIAS_PULL_UP, 1 },
162 { "bias-pull-pin-default", PIN_CONFIG_BIAS_PULL_PIN_DEFAULT, 1 },161 { "bias-pull-pin-default", PIN_CONFIG_BIAS_PULL_PIN_DEFAULT, 1 },
163 { "bias-pull-down", PIN_CONFIG_BIAS_PULL_DOWN, 1 },162 { "bias-pull-down", PIN_CONFIG_BIAS_PULL_DOWN, 1 },
164 { "bi-directional", PIN_CONFIG_BIDIRECTIONAL, 1 },
165 { "drive-open-drain", PIN_CONFIG_DRIVE_OPEN_DRAIN, 0 },163 { "drive-open-drain", PIN_CONFIG_DRIVE_OPEN_DRAIN, 0 },
166 { "drive-open-source", PIN_CONFIG_DRIVE_OPEN_SOURCE, 0 },164 { "drive-open-source", PIN_CONFIG_DRIVE_OPEN_SOURCE, 0 },
167 { "drive-push-pull", PIN_CONFIG_DRIVE_PUSH_PULL, 0 },165 { "drive-push-pull", PIN_CONFIG_DRIVE_PUSH_PULL, 0 },
@@ -174,7 +172,6 @@ static const struct pinconf_generic_params dt_params[] = { · 6 unmodified lines
174 { "input-schmitt-enable", PIN_CONFIG_INPUT_SCHMITT_ENABLE, 1 },172 { "input-schmitt-enable", PIN_CONFIG_INPUT_SCHMITT_ENABLE, 1 },
175 { "low-power-disable", PIN_CONFIG_LOW_POWER_MODE, 0 },173 { "low-power-disable", PIN_CONFIG_LOW_POWER_MODE, 0 },
176 { "low-power-enable", PIN_CONFIG_LOW_POWER_MODE, 1 },174 { "low-power-enable", PIN_CONFIG_LOW_POWER_MODE, 1 },
177 { "output-enable", PIN_CONFIG_OUTPUT, 1, },
178 { "output-high", PIN_CONFIG_OUTPUT, 1, },175 { "output-high", PIN_CONFIG_OUTPUT, 1, },
179 { "output-low", PIN_CONFIG_OUTPUT, 0, },176 { "output-low", PIN_CONFIG_OUTPUT, 0, },
180 { "power-source", PIN_CONFIG_POWER_SOURCE, 0 },177 { "power-source", PIN_CONFIG_POWER_SOURCE, 0 },
drivers/pinctrl/pinmux.c+4−17
@@ -826,30 +826,17 @@ EXPORT_SYMBOL_GPL(pinmux_generic_remove_function); · 825 unmodified lines
826 * pinmux_generic_free_functions() - removes all functions826 * pinmux_generic_free_functions() - removes all functions
827 * @pctldev: pin controller device827 * @pctldev: pin controller device
828 *828 *
829 * Note that the caller must take care of locking.829 * Note that the caller must take care of locking. The pinctrl
830 * functions are allocated with devm_kzalloc() so no need to free
831 * them here.
830 */832 */
831void pinmux_generic_free_functions(struct pinctrl_dev *pctldev)833void pinmux_generic_free_functions(struct pinctrl_dev *pctldev)
832{834{
833 struct radix_tree_iter iter;835 struct radix_tree_iter iter;
834 struct function_desc *function;
835 unsigned long *indices;
836 void **slot;836 void **slot;
837 int i = 0;
838
839 indices = devm_kzalloc(pctldev->dev, sizeof(*indices) *
840 pctldev->num_functions, GFP_KERNEL);
841 if (!indices)
842 return;
843 837
844 radix_tree_for_each_slot(slot, &pctldev->pin_function_tree, &iter, 0)838 radix_tree_for_each_slot(slot, &pctldev->pin_function_tree, &iter, 0)
845 indices[i++] = iter.index;839 radix_tree_delete(&pctldev->pin_function_tree, iter.index);
846
847 for (i = 0; i < pctldev->num_functions; i++) {
848 function = radix_tree_lookup(&pctldev->pin_function_tree,
849 indices[i]);
850 radix_tree_delete(&pctldev->pin_function_tree, indices[i]);
851 devm_kfree(pctldev->dev, function);
852 }
853 840
854 pctldev->num_functions = 0;841 pctldev->num_functions = 0;
855}842}
drivers/pinctrl/sunxi/pinctrl-sun8i-a83t.c+1−1
@@ -394,7 +394,7 @@ static const struct sunxi_desc_pin sun8i_a83t_pins[] = { · 393 unmodified lines
394 SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 18),394 SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 18),
395 SUNXI_FUNCTION(0x0, "gpio_in"),395 SUNXI_FUNCTION(0x0, "gpio_in"),
396 SUNXI_FUNCTION(0x1, "gpio_out"),396 SUNXI_FUNCTION(0x1, "gpio_out"),
397 SUNXI_FUNCTION(0x3, "owa")), /* DOUT */397 SUNXI_FUNCTION(0x3, "spdif")), /* DOUT */
398 SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 19),398 SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 19),
399 SUNXI_FUNCTION(0x0, "gpio_in"),399 SUNXI_FUNCTION(0x0, "gpio_in"),
400 SUNXI_FUNCTION(0x1, "gpio_out")),400 SUNXI_FUNCTION(0x1, "gpio_out")),
drivers/platform/goldfish/goldfish_pipe.c+1−1
@@ -704,7 +704,7 @@ static int get_free_pipe_id_locked(struct goldfish_pipe_dev *dev) · 703 unmodified lines
704 /* Reallocate the array */704 /* Reallocate the array */
705 u32 new_capacity = 2 * dev->pipes_capacity;705 u32 new_capacity = 2 * dev->pipes_capacity;
706 struct goldfish_pipe **pipes =706 struct goldfish_pipe **pipes =
707 kcalloc(new_capacity, sizeof(*pipes), GFP_KERNEL);707 kcalloc(new_capacity, sizeof(*pipes), GFP_ATOMIC);
708 if (!pipes)708 if (!pipes)
709 return -ENOMEM;709 return -ENOMEM;
710 memcpy(pipes, dev->pipes, sizeof(*pipes) * dev->pipes_capacity);710 memcpy(pipes, dev->pipes, sizeof(*pipes) * dev->pipes_capacity);
drivers/platform/x86/intel_telemetry_debugfs.c+7−9
@@ -97,11 +97,9 @@ · 96 unmodified lines
97 } \97 } \
98}98}
99 99
100#ifdef CONFIG_PM_SLEEP
101static u8 suspend_prep_ok;100static u8 suspend_prep_ok;
102static u32 suspend_shlw_ctr_temp, suspend_deep_ctr_temp;101static u32 suspend_shlw_ctr_temp, suspend_deep_ctr_temp;
103static u64 suspend_shlw_res_temp, suspend_deep_res_temp;102static u64 suspend_shlw_res_temp, suspend_deep_res_temp;
104#endif
105 103
106struct telemetry_susp_stats {104struct telemetry_susp_stats {
107 u32 shlw_swake_ctr;105 u32 shlw_swake_ctr;
@@ -807,7 +805,6 @@ static const struct file_operations telem_ioss_trc_verb_ops = { · 699 unmodified lines
807 .release = single_release,805 .release = single_release,
808};806};
809 807
810#ifdef CONFIG_PM_SLEEP
811static int pm_suspend_prep_cb(void)808static int pm_suspend_prep_cb(void)
812{809{
813 struct telemetry_evtlog evtlog[TELEM_MAX_OS_ALLOCATED_EVENTS];810 struct telemetry_evtlog evtlog[TELEM_MAX_OS_ALLOCATED_EVENTS];
@@ -937,7 +934,6 @@ static int pm_notification(struct notifier_block *this, · 123 unmodified lines
937static struct notifier_block pm_notifier = {934static struct notifier_block pm_notifier = {
938 .notifier_call = pm_notification,935 .notifier_call = pm_notification,
939};936};
940#endif /* CONFIG_PM_SLEEP */
941 937
942static int __init telemetry_debugfs_init(void)938static int __init telemetry_debugfs_init(void)
943{939{
@@ -960,14 +956,13 @@ static int __init telemetry_debugfs_init(void) · 16 unmodified lines
960 if (err < 0)956 if (err < 0)
961 return -EINVAL;957 return -EINVAL;
962 958
963
964#ifdef CONFIG_PM_SLEEP
965 register_pm_notifier(&pm_notifier);959 register_pm_notifier(&pm_notifier);
966#endif /* CONFIG_PM_SLEEP */
967 960
968 debugfs_conf->telemetry_dbg_dir = debugfs_create_dir("telemetry", NULL);961 debugfs_conf->telemetry_dbg_dir = debugfs_create_dir("telemetry", NULL);
969 if (!debugfs_conf->telemetry_dbg_dir)962 if (!debugfs_conf->telemetry_dbg_dir) {
970 return -ENOMEM;963 err = -ENOMEM;
964 goto out_pm;
965 }
971 966
972 f = debugfs_create_file("pss_info", S_IFREG | S_IRUGO,967 f = debugfs_create_file("pss_info", S_IFREG | S_IRUGO,
973 debugfs_conf->telemetry_dbg_dir, NULL,968 debugfs_conf->telemetry_dbg_dir, NULL,
@@ -1014,6 +1009,8 @@ static int __init telemetry_debugfs_init(void) · 40 unmodified lines
1014out:1009out:
1015 debugfs_remove_recursive(debugfs_conf->telemetry_dbg_dir);1010 debugfs_remove_recursive(debugfs_conf->telemetry_dbg_dir);
1016 debugfs_conf->telemetry_dbg_dir = NULL;1011 debugfs_conf->telemetry_dbg_dir = NULL;
1012out_pm:
1013 unregister_pm_notifier(&pm_notifier);
1017 1014
1018 return err;1015 return err;
1019}1016}
@@ -1022,6 +1019,7 @@ static void __exit telemetry_debugfs_exit(void) · 2 unmodified lines
1022{1019{
1023 debugfs_remove_recursive(debugfs_conf->telemetry_dbg_dir);1020 debugfs_remove_recursive(debugfs_conf->telemetry_dbg_dir);
1024 debugfs_conf->telemetry_dbg_dir = NULL;1021 debugfs_conf->telemetry_dbg_dir = NULL;
1022 unregister_pm_notifier(&pm_notifier);
1025}1023}
1026 1024
1027late_initcall(telemetry_debugfs_init);1025late_initcall(telemetry_debugfs_init);
drivers/reset/hisilicon/hi6220_reset.c+2−0
@@ -155,3 +155,5 @@ static int __init hi6220_reset_init(void) · 154 unmodified lines
155}155}
156 156
157postcore_initcall(hi6220_reset_init);157postcore_initcall(hi6220_reset_init);
158
159MODULE_LICENSE("GPL v2");
drivers/s390/cio/vfio_ccw_ops.c+6−6
@@ -70,14 +70,14 @@ static ssize_t name_show(struct kobject *kobj, struct device *dev, char *buf) · 69 unmodified lines
70{70{
71 return sprintf(buf, "I/O subchannel (Non-QDIO)\n");71 return sprintf(buf, "I/O subchannel (Non-QDIO)\n");
72}72}
73MDEV_TYPE_ATTR_RO(name);73static MDEV_TYPE_ATTR_RO(name);
74 74
75static ssize_t device_api_show(struct kobject *kobj, struct device *dev,75static ssize_t device_api_show(struct kobject *kobj, struct device *dev,
76 char *buf)76 char *buf)
77{77{
78 return sprintf(buf, "%s\n", VFIO_DEVICE_API_CCW_STRING);78 return sprintf(buf, "%s\n", VFIO_DEVICE_API_CCW_STRING);
79}79}
80MDEV_TYPE_ATTR_RO(device_api);80static MDEV_TYPE_ATTR_RO(device_api);
81 81
82static ssize_t available_instances_show(struct kobject *kobj,82static ssize_t available_instances_show(struct kobject *kobj,
83 struct device *dev, char *buf)83 struct device *dev, char *buf)
@@ -86,7 +86,7 @@ static ssize_t available_instances_show(struct kobject *kobj, · 2 unmodified lines
86 86
87 return sprintf(buf, "%d\n", atomic_read(&private->avail));87 return sprintf(buf, "%d\n", atomic_read(&private->avail));
88}88}
89MDEV_TYPE_ATTR_RO(available_instances);89static MDEV_TYPE_ATTR_RO(available_instances);
90 90
91static struct attribute *mdev_types_attrs[] = {91static struct attribute *mdev_types_attrs[] = {
92 &mdev_type_attr_name.attr,92 &mdev_type_attr_name.attr,
@@ -100,7 +100,7 @@ static struct attribute_group mdev_type_group = { · 7 unmodified lines
100 .attrs = mdev_types_attrs,100 .attrs = mdev_types_attrs,
101};101};
102 102
103struct attribute_group *mdev_type_groups[] = {103static struct attribute_group *mdev_type_groups[] = {
104 &mdev_type_group,104 &mdev_type_group,
105 NULL,105 NULL,
106};106};
@@ -152,7 +152,7 @@ static int vfio_ccw_mdev_open(struct mdev_device *mdev) · 45 unmodified lines
152 &events, &private->nb);152 &events, &private->nb);
153}153}
154 154
155void vfio_ccw_mdev_release(struct mdev_device *mdev)155static void vfio_ccw_mdev_release(struct mdev_device *mdev)
156{156{
157 struct vfio_ccw_private *private =157 struct vfio_ccw_private *private =
158 dev_get_drvdata(mdev_parent_dev(mdev));158 dev_get_drvdata(mdev_parent_dev(mdev));
@@ -233,7 +233,7 @@ static int vfio_ccw_mdev_get_region_info(struct vfio_region_info *info, · 74 unmodified lines
233 }233 }
234}234}
235 235
236int vfio_ccw_mdev_get_irq_info(struct vfio_irq_info *info)236static int vfio_ccw_mdev_get_irq_info(struct vfio_irq_info *info)
237{237{
238 if (info->index != VFIO_CCW_IO_IRQ_INDEX)238 if (info->index != VFIO_CCW_IO_IRQ_INDEX)
239 return -EINVAL;239 return -EINVAL;
drivers/s390/crypto/ap_bus.c+24−14
@@ -668,10 +668,28 @@ static int ap_device_probe(struct device *dev) · 667 unmodified lines
668 struct ap_driver *ap_drv = to_ap_drv(dev->driver);668 struct ap_driver *ap_drv = to_ap_drv(dev->driver);
669 int rc;669 int rc;
670 670
671 /* Add queue/card to list of active queues/cards */
672 spin_lock_bh(&ap_list_lock);
673 if (is_card_dev(dev))
674 list_add(&to_ap_card(dev)->list, &ap_card_list);
675 else
676 list_add(&to_ap_queue(dev)->list,
677 &to_ap_queue(dev)->card->queues);
678 spin_unlock_bh(&ap_list_lock);
679
671 ap_dev->drv = ap_drv;680 ap_dev->drv = ap_drv;
672 rc = ap_drv->probe ? ap_drv->probe(ap_dev) : -ENODEV;681 rc = ap_drv->probe ? ap_drv->probe(ap_dev) : -ENODEV;
673 if (rc)682
683 if (rc) {
684 spin_lock_bh(&ap_list_lock);
685 if (is_card_dev(dev))
686 list_del_init(&to_ap_card(dev)->list);
687 else
688 list_del_init(&to_ap_queue(dev)->list);
689 spin_unlock_bh(&ap_list_lock);
674 ap_dev->drv = NULL;690 ap_dev->drv = NULL;
691 }
692
675 return rc;693 return rc;
676}694}
677 695
@@ -680,14 +698,17 @@ static int ap_device_remove(struct device *dev) · 2 unmodified lines
680 struct ap_device *ap_dev = to_ap_dev(dev);698 struct ap_device *ap_dev = to_ap_dev(dev);
681 struct ap_driver *ap_drv = ap_dev->drv;699 struct ap_driver *ap_drv = ap_dev->drv;
682 700
701 if (ap_drv->remove)
702 ap_drv->remove(ap_dev);
703
704 /* Remove queue/card from list of active queues/cards */
683 spin_lock_bh(&ap_list_lock);705 spin_lock_bh(&ap_list_lock);
684 if (is_card_dev(dev))706 if (is_card_dev(dev))
685 list_del_init(&to_ap_card(dev)->list);707 list_del_init(&to_ap_card(dev)->list);
686 else708 else
687 list_del_init(&to_ap_queue(dev)->list);709 list_del_init(&to_ap_queue(dev)->list);
688 spin_unlock_bh(&ap_list_lock);710 spin_unlock_bh(&ap_list_lock);
689 if (ap_drv->remove)711
690 ap_drv->remove(ap_dev);
691 return 0;712 return 0;
692}713}
693 714
@@ -1056,10 +1077,6 @@ static void ap_scan_bus(struct work_struct *unused) · 362 unmodified lines
1056 }1077 }
1057 /* get it and thus adjust reference counter */1078 /* get it and thus adjust reference counter */
1058 get_device(&ac->ap_dev.device);1079 get_device(&ac->ap_dev.device);
1059 /* Add card device to card list */
1060 spin_lock_bh(&ap_list_lock);
1061 list_add(&ac->list, &ap_card_list);
1062 spin_unlock_bh(&ap_list_lock);
1063 }1080 }
1064 /* now create the new queue device */1081 /* now create the new queue device */
1065 aq = ap_queue_create(qid, type);1082 aq = ap_queue_create(qid, type);
@@ -1070,10 +1087,6 @@ static void ap_scan_bus(struct work_struct *unused) · 4 unmodified lines
1070 aq->ap_dev.device.parent = &ac->ap_dev.device;1087 aq->ap_dev.device.parent = &ac->ap_dev.device;
1071 dev_set_name(&aq->ap_dev.device,1088 dev_set_name(&aq->ap_dev.device,
1072 "%02x.%04x", id, dom);1089 "%02x.%04x", id, dom);
1073 /* Add queue device to card queue list */
1074 spin_lock_bh(&ap_list_lock);
1075 list_add(&aq->list, &ac->queues);
1076 spin_unlock_bh(&ap_list_lock);
1077 /* Start with a device reset */1090 /* Start with a device reset */
1078 spin_lock_bh(&aq->lock);1091 spin_lock_bh(&aq->lock);
1079 ap_wait(ap_sm_event(aq, AP_EVENT_POLL));1092 ap_wait(ap_sm_event(aq, AP_EVENT_POLL));
@@ -1081,9 +1094,6 @@ static void ap_scan_bus(struct work_struct *unused) · 1 unmodified line
1081 /* Register device */1094 /* Register device */
1082 rc = device_register(&aq->ap_dev.device);1095 rc = device_register(&aq->ap_dev.device);
1083 if (rc) {1096 if (rc) {
1084 spin_lock_bh(&ap_list_lock);
1085 list_del_init(&aq->list);
1086 spin_unlock_bh(&ap_list_lock);
1087 put_device(&aq->ap_dev.device);1097 put_device(&aq->ap_dev.device);
1088 continue;1098 continue;
1089 }1099 }
drivers/s390/crypto/ap_card.c+8−1
@@ -160,7 +160,14 @@ static struct device_type ap_card_type = { · 159 unmodified lines
160 160
161static void ap_card_device_release(struct device *dev)161static void ap_card_device_release(struct device *dev)
162{162{
163 kfree(to_ap_card(dev));163 struct ap_card *ac = to_ap_card(dev);
164
165 if (!list_empty(&ac->list)) {
166 spin_lock_bh(&ap_list_lock);
167 list_del_init(&ac->list);
168 spin_unlock_bh(&ap_list_lock);
169 }
170 kfree(ac);
164}171}
165 172
166struct ap_card *ap_card_create(int id, int queue_depth, int device_type,173struct ap_card *ap_card_create(int id, int queue_depth, int device_type,
drivers/s390/crypto/ap_queue.c+8−1
@@ -584,7 +584,14 @@ static struct device_type ap_queue_type = { · 583 unmodified lines
584 584
585static void ap_queue_device_release(struct device *dev)585static void ap_queue_device_release(struct device *dev)
586{586{
587 kfree(to_ap_queue(dev));587 struct ap_queue *aq = to_ap_queue(dev);
588
589 if (!list_empty(&aq->list)) {
590 spin_lock_bh(&ap_list_lock);
591 list_del_init(&aq->list);
592 spin_unlock_bh(&ap_list_lock);
593 }
594 kfree(aq);
588}595}
589 596
590struct ap_queue *ap_queue_create(ap_qid_t qid, int device_type)597struct ap_queue *ap_queue_create(ap_qid_t qid, int device_type)
drivers/s390/net/netiucv.c+2−2
@@ -1954,7 +1954,6 @@ static void netiucv_free_netdevice(struct net_device *dev) · 1953 unmodified lines
1954 privptr->conn = NULL; privptr->fsm = NULL;1954 privptr->conn = NULL; privptr->fsm = NULL;
1955 /* privptr gets freed by free_netdev() */1955 /* privptr gets freed by free_netdev() */
1956 }1956 }
1957 free_netdev(dev);

13 more lines aren’t shown here.

drivers/scsi/bnx2fc/bnx2fc.h+1−0

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

drivers/scsi/bnx2fc/bnx2fc_fcoe.c+8−2

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

drivers/scsi/cxgbi/cxgb4i/cxgb4i.c+0−1

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

drivers/scsi/cxgbi/libcxgbi.c+40−14

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

drivers/scsi/cxgbi/libcxgbi.h+9−8

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

drivers/scsi/device_handler/scsi_dh_rdac.c+4−6

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

drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c+23−4

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

drivers/scsi/lpfc/lpfc_crtn.h+1−1

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

drivers/scsi/lpfc/lpfc_ct.c+3−2

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

drivers/scsi/lpfc/lpfc_nportdisc.c+5−2

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

drivers/scsi/lpfc/lpfc_nvmet.c+2−2

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

drivers/scsi/qedi/qedi.h+2−1

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

drivers/scsi/qedi/qedi_fw.c+2−0

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

drivers/scsi/qedi/qedi_iscsi.c+6−1

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

drivers/scsi/qedi/qedi_main.c+13−12

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

drivers/scsi/qla2xxx/qla_bsg.c+5−4

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

drivers/scsi/qla2xxx/qla_dbg.c+2−2

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

drivers/scsi/qla2xxx/qla_def.h+1−0

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

drivers/scsi/qla2xxx/qla_init.c+4−1

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

drivers/scsi/qla2xxx/qla_inline.h+7−19

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

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

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

drivers/scsi/qla2xxx/qla_mbx.c+2−11

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

drivers/scsi/qla2xxx/qla_os.c+29−17

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

drivers/scsi/qla2xxx/qla_target.c+5−3

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

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

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

drivers/scsi/scsi_debug.c+1−1

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

drivers/staging/ccree/Kconfig+1−1

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

drivers/staging/ccree/ssi_buffer_mgr.c+2−1

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

drivers/staging/iio/cdc/ad7152.c+1−5

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

drivers/staging/lustre/lustre/lov/lov_pack.c+0−9

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

drivers/staging/rtl8188eu/os_dep/mon.c+1−1

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

drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c+2−1

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

drivers/staging/rtl8723bs/os_dep/os_intfs.c+0−2

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

drivers/staging/rtl8723bs/os_dep/osdep_service.c+1−1

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

drivers/target/iscsi/iscsi_target.c+24−6

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

drivers/target/iscsi/iscsi_target_erl0.c+5−1

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

drivers/target/iscsi/iscsi_target_erl0.h+1−1

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

drivers/target/iscsi/iscsi_target_login.c+4−0

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

drivers/target/iscsi/iscsi_target_nego.c+132−62

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

drivers/target/target_core_transport.c+18−5

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

drivers/target/target_core_user.c+33−13

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

drivers/tty/tty_port.c+0−2

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

drivers/usb/chipidea/core.c+4−1

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

drivers/usb/chipidea/debug.c+2−1

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

drivers/usb/chipidea/udc.c+6−2

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

drivers/usb/chipidea/usbmisc_imx.c+32−9

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

drivers/usb/dwc2/params.c+2−0

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

drivers/usb/gadget/composite.c+5−6

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

drivers/usb/gadget/function/f_mass_storage.c+11−2

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

drivers/usb/gadget/function/f_phonet.c+1−1

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

drivers/usb/gadget/legacy/inode.c+6−3

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

drivers/usb/gadget/udc/dummy_hcd.c+4−9

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

drivers/usb/gadget/udc/net2280.c+1−8

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

drivers/usb/gadget/udc/renesas_usb3.c+32−13

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

drivers/usb/host/xhci-mem.c+5−2

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

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

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

drivers/usb/musb/musb_dsps.c+5−0

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

drivers/video/fbdev/core/fbmon.c+1−1

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

drivers/video/fbdev/smscufx.c+3−2

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

drivers/video/fbdev/udlfb.c+5−4

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

drivers/video/fbdev/via/viafbdev.c+3−5

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

drivers/virtio/virtio_balloon.c+7−0

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

drivers/xen/privcmd.c+2−2

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

fs/btrfs/ctree.h+2−2

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

fs/btrfs/dir-item.c+1−1

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

fs/btrfs/disk-io.c+6−4

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

fs/btrfs/extent-tree.c+4−3

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

fs/btrfs/extent_io.c+123−3

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

fs/btrfs/hash.c+4−1

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

fs/btrfs/inode.c+3−3

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

fs/ceph/acl.c+1−0

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

fs/ceph/export.c+4−0

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

fs/ceph/inode.c+2−3

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

fs/ceph/mds_client.c+1−3

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

fs/configfs/item.c+8−0

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

fs/configfs/symlink.c+1−2

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

fs/dax.c+23−0

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

fs/dcache.c+4−6

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

fs/ext4/acl.c+4−0

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

fs/ext4/ext4.h+0−2

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

fs/ext4/extents.c+42−43

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

fs/ext4/file.c+16−38

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

fs/ext4/inline.c+2−3

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

fs/ext4/inode.c+22−8

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

fs/ext4/mballoc.c+14−9

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

fs/ext4/namei.c+5−8

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

fs/ext4/super.c+8−9

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

fs/ext4/xattr.c+8−0

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

fs/f2fs/f2fs.h+4−1

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

fs/gfs2/log.c+1−1

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

fs/hugetlbfs/inode.c+1−1

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

fs/jbd2/transaction.c+6−0

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

fs/namespace.c+2−0

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

fs/nfs/flexfilelayout/flexfilelayout.c+1−0

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

fs/nfs/internal.h+0−2

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

fs/nfs/namespace.c+1−1

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

fs/nfs/nfs42proc.c+1−1

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

fs/nfs/nfs4client.c+0−1

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

fs/nfs/pnfs.c+17−8

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

fs/nfs/pnfs.h+10−0

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

fs/nfs/super.c+3−2

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

fs/nfsd/nfs3xdr.c+6−17

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

fs/nfsd/nfs4proc.c+6−7

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

fs/nfsd/nfsxdr.c+3−10

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

fs/ntfs/namei.c+1−1

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

fs/ocfs2/export.c+1−1

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

fs/overlayfs/Kconfig+1−0

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

fs/overlayfs/copy_up.c+17−7

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

fs/overlayfs/dir.c+47−14

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

fs/overlayfs/inode.c+11−1

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

fs/overlayfs/namei.c+5−11

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

fs/overlayfs/overlayfs.h+14−2

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

fs/overlayfs/ovl_entry.h+2−0

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

fs/overlayfs/super.c+17−1

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

fs/overlayfs/util.c+64−8

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

fs/proc/base.c+1−1

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

fs/proc/task_mmu.c+0−4

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

fs/quota/dquot.c+16−0

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

fs/read_write.c+1−1

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

fs/reiserfs/journal.c+2−2

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

fs/stat.c+1−0

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

fs/ufs/balloc.c+38−10

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

fs/ufs/inode.c+41−28

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

fs/ufs/super.c+60−27

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

fs/ufs/ufs_fs.h+3−4

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

fs/ufs/util.c+8−9

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

fs/ufs/util.h+9−10

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

fs/userfaultfd.c+21−8

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

fs/xfs/xfs_buf.c+26−12

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

fs/xfs/xfs_buf.h+2−3

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

fs/xfs/xfs_icache.c+2−3

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

include/acpi/actbl.h+14−0

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

include/drm/drm_dp_helper.h+51−0

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

include/linux/blkdev.h+2−0

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

include/linux/cgroup-defs.h+1−0

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

include/linux/cgroup.h+20−0

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

include/linux/compiler-clang.h+8−0

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

include/linux/configfs.h+2−1

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

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

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

include/linux/dmi.h+1−1

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

include/linux/elevator.h+1−1

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

include/linux/gfp.h+1−1

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

include/linux/gpio/machine.h+7−0

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

include/linux/irqchip/arm-gic-v3.h+4−0

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

include/linux/irqchip/arm-gic.h+25−3

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

include/linux/jiffies.h+5−1

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

include/linux/key.h+0−1

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

include/linux/memblock.h+8−0

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

include/linux/mlx4/qp.h+1−0

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

include/linux/mlx5/mlx5_ifc.h+9−1

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

include/linux/mm.h+36−28

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

include/linux/mmzone.h+1−0

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

include/linux/mod_devicetable.h+1−0

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

include/linux/netdevice.h+10−5

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

include/linux/pinctrl/pinconf-generic.h+0−3

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

include/linux/quotaops.h+6−0

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

include/linux/srcu.h+0−2

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

include/linux/sunrpc/svc.h+2−1

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

include/linux/suspend.h+2−5

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

include/media/cec.h+1−1

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

include/net/ipv6.h+1−0

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

include/net/tcp.h+1−1

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

include/rdma/ib_sa.h+3−22

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

include/rdma/rdma_netlink.h+0−10

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

include/target/iscsi/iscsi_target_core.h+1−0

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

include/uapi/linux/ethtool.h+4−2

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

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

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

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

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

kernel/cgroup/cgroup.c+5−0

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

kernel/cgroup/cpuset.c+2−2

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

kernel/cpu.c+2−2

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

kernel/events/core.c+21−0

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

kernel/irq/manage.c+3−1

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

kernel/livepatch/Kconfig+1−0

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

kernel/power/process.c+1−1

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

kernel/power/suspend.c+4−25

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

kernel/printk/printk.c+10−36

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

kernel/rcu/srcu.c+2−3

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

kernel/rcu/srcutiny.c+4−3

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

kernel/rcu/srcutree.c+2−3

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

kernel/sched/core.c+1−1

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

kernel/sched/cpufreq_schedutil.c+0−3

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

kernel/sched/fair.c+1−1

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

kernel/time/alarmtimer.c+11−3

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

kernel/time/tick-broadcast.c+3−1

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

kernel/time/tick-internal.h+0−2

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

lib/libcrc32c.c+4−2

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

mm/gup.c+8−17

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

mm/huge_memory.c+7−1

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

mm/hugetlb.c+5−0

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

mm/ksm.c+1−2

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

mm/memblock.c+23−0

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

mm/memory-failure.c+6−7

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

mm/memory.c+30−48

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

mm/mlock.c+3−2

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

mm/mmap.c+89−60

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

mm/page_alloc.c+25−12

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

mm/slub.c+4−2

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

mm/swap_cgroup.c+3−0

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

mm/util.c+5−2

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

mm/vmpressure.c+3−3

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

net/8021q/vlan_dev.c+2−2

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

net/batman-adv/distributed-arp-table.c+3−2

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

net/batman-adv/routing.c+1−1

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

net/batman-adv/soft-interface.c+2−3

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

net/bluetooth/6lowpan.c+1−1

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

net/bridge/br_device.c+1−1

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

net/bridge/br_netlink.c+1−1

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

net/bridge/br_stp_if.c+2−1

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

net/caif/caif_socket.c+4−0

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

net/caif/cfpkt_skbuff.c+1−5

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

net/caif/chnl_net.c+2−2

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

net/can/af_can.c+1−2

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

net/core/dev.c+30−12

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

net/core/devlink.c+6−2

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

net/core/dst.c+14−0

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

net/core/rtnetlink.c+2−1

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

net/core/skbuff.c+4−1

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

net/decnet/netfilter/dn_rtmsg.c+3−1

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

net/dsa/dsa.c+47−0

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

net/dsa/dsa2.c+3−1

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

net/dsa/legacy.c+0−47

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

net/hsr/hsr_device.c+2−2

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

net/hsr/hsr_forward.c+1−2

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

net/hsr/hsr_framereg.c+7−2

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

net/hsr/hsr_framereg.h+1−1

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

net/ieee802154/6lowpan/core.c+1−1

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

net/ipv4/af_inet.c+1−1

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

net/ipv4/icmp.c+6−2

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

net/ipv4/igmp.c+13−8

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

net/ipv4/ip_tunnel.c+2−2

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

net/ipv4/ipmr.c+16−18

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

net/ipv4/tcp.c+4−2

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

net/ipv4/tcp_cong.c+1−0

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

net/ipv6/calipso.c+5−1

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

net/ipv6/icmp.c+1−1

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

net/ipv6/ila/ila_xlat.c+1−0

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

net/ipv6/ip6_gre.c+5−4

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

net/ipv6/ip6_offload.c+3−1

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

net/ipv6/ip6_tunnel.c+7−4

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

net/ipv6/ip6_vti.c+4−4

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

net/ipv6/ip6mr.c+1−1

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

net/ipv6/ping.c+1−1

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

net/ipv6/proc.c+1−1

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

net/ipv6/raw.c+1−1

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

net/ipv6/route.c+1−0

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

net/ipv6/sit.c+3−3

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

net/ipv6/xfrm6_mode_ro.c+2−0

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

net/ipv6/xfrm6_mode_transport.c+2−0

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

net/irda/irlan/irlan_eth.c+1−1

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

net/l2tp/l2tp_eth.c+8−7

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

net/mac80211/agg-tx.c+52−76

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

net/mac80211/cfg.c+2−0

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

net/mac80211/ht.c+12−4

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

net/mac80211/ieee80211_i.h+5−11

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

net/mac80211/iface.c+5−13

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

net/mac80211/mlme.c+31−31

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

net/mac80211/rx.c+5−1

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

net/mac80211/sta_info.c+1−1

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

net/mac80211/sta_info.h+2−0

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

net/mac80211/wpa.c+5−4

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

net/mac802154/iface.c+3−4

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

net/mpls/af_mpls.c+1−1

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

net/netfilter/nf_conntrack_netlink.c+6−1

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

net/netfilter/nf_conntrack_proto_sctp.c+6−3

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

net/netfilter/nf_nat_core.c+1−1

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

net/netfilter/nft_set_rbtree.c+11−11

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

net/netlink/af_netlink.c+3−1

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

net/openvswitch/vport-internal_dev.c+2−2

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

net/phonet/pep-gprs.c+1−1

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

net/sched/act_pedit.c+3−1

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

net/sched/act_police.c+3−5

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

net/sctp/socket.c+2−2

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

net/sunrpc/xprtrdma/backchannel.c+2−4

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

net/sunrpc/xprtsock.c+6−1

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

net/tipc/msg.c+1−1

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

net/unix/af_unix.c+6−1

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

scripts/gdb/linux/dmesg.py+5−4

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

security/keys/Kconfig+5−1

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

security/keys/dh.c+184−116

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

security/keys/encrypted-keys/encrypted.c+74−130

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

security/keys/gc.c+1−3

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

security/keys/key.c+6−10

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

security/keys/keyctl.c+11−5

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

security/keys/keyring.c+6−6

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

security/keys/process_keys.c+4−3

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

security/keys/trusted.c+22−28

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

security/keys/user_defined.c+12−4

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

security/selinux/hooks.c+2−3

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

sound/core/timer.c+5−2

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

sound/pci/hda/patch_realtek.c+8−7

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

sound/soc/atmel/atmel-classd.c+9−0

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

sound/soc/codecs/da7213.c+1−1

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

sound/soc/codecs/rt286.c+7−0

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

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

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

sound/soc/intel/skylake/skl-sst-ipc.c+5−0

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

sound/soc/intel/skylake/skl-topology.c+1−1

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

sound/soc/intel/skylake/skl.c+88−74

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

sound/soc/intel/skylake/skl.h+3−1

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

sound/soc/sh/rcar/adg.c+4−2

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

sound/soc/sh/rcar/cmd.c+1−0

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

sound/soc/sh/rcar/core.c+51−0

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

sound/soc/sh/rcar/gen.c+1−0

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

sound/soc/sh/rcar/rsnd.h+2−0

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

sound/soc/sh/rcar/src.c+10−2

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

sound/soc/sh/rcar/ssi.c+15−3

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

sound/soc/sh/rcar/ssiu.c+2−1

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

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

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

sound/usb/mixer_us16x08.c+12−7

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

tools/objtool/builtin-check.c+2−1

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

tools/perf/Documentation/perf-probe.txt+6−2

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

tools/perf/Documentation/perf-script-perl.txt+1−1

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

tools/perf/Documentation/perf-script-python.txt+9−14

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

tools/perf/Makefile.config+19−19

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

tools/perf/Makefile.perf+1−1

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

tools/perf/arch/Build+1−1

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

tools/perf/arch/common.c+1−0

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

tools/perf/builtin-stat.c+4−1

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

tools/perf/builtin-trace.c+4−0

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

tools/perf/pmu-events/Build+2−2

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

tools/perf/tests/Build+1−1

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

tools/perf/tests/bp_signal.c+14−0

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

tools/perf/tests/builtin-test.c+7−0

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

tools/perf/tests/code-reading.c+19−1

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

tools/perf/tests/task-exit.c+1−1

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

tools/perf/tests/tests.h+3−0

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

tools/perf/util/annotate.c+43−29

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

tools/perf/util/build-id.c+0−45

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

tools/perf/util/build-id.h+0−1

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

tools/perf/util/dso.c+94−6

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

tools/perf/util/dso.h+9−0

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

tools/perf/util/evsel.c+12−0

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

tools/perf/util/header.c+11−3

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

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

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

tools/perf/util/scripting-engines/trace-event-python.c+1−1

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

tools/perf/util/symbol-elf.c+3−38

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

tools/perf/util/symbol.c+0−4

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

tools/perf/util/unwind-libdw.c+17−1

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

tools/testing/selftests/bpf/bpf_endian.h+30−11

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

usr/Kconfig+1−0

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

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

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

virt/kvm/arm/mmu.c+3−0

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

virt/kvm/arm/vgic/vgic-mmio-v2.c+14−2

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

virt/kvm/arm/vgic/vgic-v2.c+25−3

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

virt/kvm/arm/vgic/vgic-v3.c+33−14

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

virt/kvm/arm/vgic/vgic.h+8−4

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