History

Merge branch 'for-4.11/libnvdimm' into for-4.12/dax

Dan Williams committed 9 years ago

Commit bfca9ac2 parents 92a3fa0 11e63f6733 files · +9347 −5710Browse files

Unified · Split

733 files
  1. Documentation/cgroup-v2.txt +6 −5
  2. Documentation/devicetree/bindings/arm/marvell/cp110-system-controller0.txt +3 −3
  3. Documentation/devicetree/bindings/display/exynos/exynos_dsim.txt +0 −1
  4. Documentation/devicetree/bindings/display/exynos/samsung-fimd.txt +0 −1
  5. Documentation/devicetree/bindings/mmc/rockchip-dw-mshc.txt +1 −1
  6. Documentation/devicetree/bindings/phy/brcm,nsp-usb3-phy.txt +0 −39
  7. Documentation/devicetree/bindings/powerpc/4xx/emac.txt +60 −2
  8. Documentation/extcon/intel-int3496.txt +5 −0
  9. Documentation/gcc-plugins.txt +2 −2
  10. Documentation/networking/ip-sysctl.txt +2 −1
  11. MAINTAINERS +2 −16
  12. Makefile +1 −1
  13. arch/arm/boot/dts/am335x-pcm-953.dtsi +2 −2
  14. arch/arm/boot/dts/am57xx-idk-common.dtsi +7 −7
  15. arch/arm/boot/dts/bcm5301x.dtsi +2 −2
  16. arch/arm/boot/dts/bcm953012k.dts +2 −3
  17. arch/arm/boot/dts/bcm958522er.dts +1 −0
  18. arch/arm/boot/dts/bcm958525er.dts +1 −0
  19. arch/arm/boot/dts/bcm958525xmc.dts +1 −0
  20. arch/arm/boot/dts/bcm958622hr.dts +1 −0
  21. arch/arm/boot/dts/bcm958623hr.dts +1 −0
  22. arch/arm/boot/dts/bcm958625hr.dts +1 −0
  23. arch/arm/boot/dts/bcm988312hr.dts +1 −0
  24. arch/arm/boot/dts/imx6sx-udoo-neo.dtsi +0 −5
  25. arch/arm/boot/dts/sama5d2.dtsi +1 −1
  26. arch/arm/boot/dts/ste-dbx5x0.dtsi +19 −0
  27. arch/arm/boot/dts/ste-href.dtsi +0 −9
  28. arch/arm/boot/dts/ste-snowball.dts +0 −9
  29. arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts +1 −1
  30. arch/arm/boot/dts/sun8i-a23-a33.dtsi +1 −1
  31. arch/arm/boot/dts/sun8i-reference-design-tablet.dtsi +0 −7
  32. arch/arm/configs/omap2plus_defconfig +1 −0
  33. arch/arm/mach-at91/pm.c +17 −1
  34. arch/arm/mach-omap2/Makefile +0 −3
  35. arch/arm/mach-omap2/gpmc-nand.c +0 −154
  36. arch/arm/mach-omap2/gpmc-onenand.c +6 −4
  37. arch/arm/mach-omap2/omap-headsmp.S +2 −1
  38. arch/arm/mach-omap2/omap_hwmod_3xxx_data.c +37 −8
  39. arch/arm/tools/syscall.tbl +1 −0
  40. arch/arm64/Kconfig +4 −0
  41. arch/arm64/boot/dts/broadcom/ns2.dtsi +11 −0
  42. arch/arm64/include/asm/cpufeature.h +1 −1
  43. arch/arm64/include/asm/unistd.h +1 −1
  44. arch/arm64/include/asm/unistd32.h +8 −0
  45. arch/arm64/kernel/cpuidle.c +1 −1
  46. arch/arm64/kernel/kaslr.c +7 −3
  47. arch/arm64/kernel/probes/kprobes.c +0 −6
  48. arch/arm64/mm/kasan_init.c +1 −1
  49. arch/openrisc/include/asm/cmpxchg.h +6 −2
  50. arch/openrisc/include/asm/uaccess.h +1 −1
  51. arch/openrisc/kernel/or32_ksyms.c +4 −0
  52. arch/openrisc/kernel/process.c +1 −0
  53. arch/parisc/include/asm/cacheflush.h +2 −21
  54. arch/parisc/include/asm/uaccess.h +2 −1
  55. arch/parisc/include/uapi/asm/unistd.h +2 −1
  56. arch/parisc/kernel/cache.c +22 −0
  57. arch/parisc/kernel/module.c +8 −0
  58. arch/parisc/kernel/perf.c +49 −45
  59. arch/parisc/kernel/process.c +2 −0
  60. arch/parisc/kernel/syscall_table.S +1 −0
  61. arch/powerpc/boot/zImage.lds.S +1 −0
  62. arch/powerpc/crypto/crc32c-vpmsum_glue.c +1 −1
  63. arch/powerpc/include/asm/bitops.h +4 −0
  64. arch/powerpc/include/asm/mce.h +107 −1
  65. arch/powerpc/include/asm/systbl.h +1 −0
  66. arch/powerpc/include/asm/unistd.h +1 −1
  67. arch/powerpc/include/uapi/asm/unistd.h +1 −0
  68. arch/powerpc/kernel/cputable.c +3 −0
  69. arch/powerpc/kernel/idle_book3s.S +17 −3
  70. arch/powerpc/kernel/mce.c +86 −2
  71. arch/powerpc/kernel/mce_power.c +237 −0
  72. arch/powerpc/mm/init_64.c +1 −2
  73. arch/powerpc/perf/core-book3s.c +2 −0
  74. arch/powerpc/perf/isa207-common.c +36 −7
  75. arch/powerpc/perf/isa207-common.h +1 −0
  76. arch/powerpc/platforms/powernv/opal.c +6 −15
  77. arch/powerpc/platforms/powernv/pci-ioda.c +15 −5
  78. arch/powerpc/platforms/pseries/lpar.c +3 −1
  79. arch/x86/events/core.c +14 −2
  80. arch/x86/include/asm/pgtable-3level.h +0 −3
  81. arch/x86/include/asm/pgtable.h +1 −1
  82. arch/x86/include/asm/pmem.h +31 −11
  83. arch/x86/kernel/acpi/boot.c +7 −2
  84. arch/x86/kernel/apic/apic.c +7 −19
  85. arch/x86/kernel/cpu/intel_rdt_rdtgroup.c +1 −1
  86. arch/x86/kernel/head64.c +1 −0
  87. arch/x86/kernel/nmi.c +2 −4
  88. arch/x86/kernel/tsc.c +2 −0
  89. arch/x86/kernel/unwind_frame.c +30 −6
  90. arch/x86/mm/kasan_init_64.c +1 −0
  91. arch/x86/mm/mpx.c +1 −1
  92. arch/x86/platform/intel-mid/device_libs/Makefile +1 −0
  93. arch/x86/platform/intel-mid/device_libs/platform_mrfld_power_btn.c +82 −0
  94. arch/x86/platform/intel-mid/device_libs/platform_mrfld_wdt.c +1 −1
  95. arch/x86/platform/intel-mid/mfld.c +4 −11
  96. block/bio.c +9 −3
  97. block/blk-core.c +18 −12
  98. block/blk-mq-tag.c +3 −0
  99. block/blk-mq.c +6 −14
  100. block/blk-stat.c +2 −2
  101. crypto/af_alg.c +5 −4
  102. crypto/algif_hash.c +5 −4
  103. drivers/acpi/acpi_processor.c +42 −15
  104. drivers/acpi/bus.c +0 −1
  105. drivers/acpi/nfit/core.c +5 −1
  106. drivers/acpi/processor_core.c +22 −111
  107. drivers/acpi/spcr.c +1 −1
  108. drivers/ata/ahci_qoriq.c +4 −2
  109. drivers/ata/libata-sff.c +0 −1
  110. drivers/ata/libata-transport.c +3 −6
  111. drivers/auxdisplay/img-ascii-lcd.c +1 −0
  112. drivers/base/core.c +0 −5
  113. drivers/bluetooth/Kconfig +2 −1
  114. drivers/char/hw_random/amd-rng.c +34 −8
  115. drivers/char/hw_random/geode-rng.c +35 −15
  116. drivers/char/hw_random/omap-rng.c +14 −2
  117. drivers/char/ppdev.c +9 −2
  118. drivers/clk/clk.c +2 −1
  119. drivers/clk/rockchip/clk-rk3036.c +8 −1
  120. drivers/clk/sunxi-ng/Kconfig +1 −0
  121. drivers/clk/sunxi-ng/ccu-sun50i-a64.c +1 −1
  122. drivers/clk/sunxi-ng/ccu-sun6i-a31.c +1 −1
  123. drivers/clk/sunxi-ng/ccu_mp.c +8 −0
  124. drivers/clk/sunxi-ng/ccu_nkmp.c +1 −1
  125. drivers/clocksource/tcb_clksrc.c +1 −15
  126. drivers/cpufreq/cpufreq.c +8 −3
  127. drivers/cpufreq/intel_pstate.c +79 −148
  128. drivers/cpuidle/sysfs.c +12 −0
  129. drivers/crypto/ccp/ccp-dev.c +4 −1
  130. drivers/crypto/ccp/ccp-dmaengine.c +1 −0
  131. drivers/crypto/s5p-sss.c +85 −47
  132. drivers/dax/Kconfig +1 −0
  133. drivers/dax/dax.c +37 −9
  134. drivers/extcon/Kconfig +1 −1
  135. drivers/extcon/extcon-intel-int3496.c +28 −11
  136. drivers/gpio/gpio-altera-a10sr.c +1 −1
  137. drivers/gpio/gpio-altera.c +11 −15
  138. drivers/gpio/gpio-mcp23s08.c +60 −5
  139. drivers/gpio/gpio-mockup.c +3 −4
  140. drivers/gpio/gpio-xgene.c +3 −10
  141. drivers/gpu/drm/amd/acp/Makefile +0 −2
  142. drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +2 −0
  143. drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +4 −4
  144. drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +1 −0
  145. drivers/gpu/drm/amd/amdgpu/si_dpm.c +10 −0
  146. drivers/gpu/drm/amd/amdgpu/vi.c +1 −1
  147. drivers/gpu/drm/amd/powerplay/hwmgr/smu7_clockpowergating.c +1 −1
  148. drivers/gpu/drm/arm/malidp_crtc.c +1 −2
  149. drivers/gpu/drm/arm/malidp_hw.c +1 −1
  150. drivers/gpu/drm/arm/malidp_planes.c +16 −2
  151. drivers/gpu/drm/arm/malidp_regs.h +1 −0
  152. drivers/gpu/drm/drm_fb_helper.c +3 −3
  153. drivers/gpu/drm/exynos/exynos5433_drm_decon.c +82 −5
  154. drivers/gpu/drm/exynos/exynos7_drm_decon.c +1 −0
  155. drivers/gpu/drm/exynos/exynos_drm_crtc.c +16 −13
  156. drivers/gpu/drm/exynos/exynos_drm_crtc.h +2 −0
  157. drivers/gpu/drm/exynos/exynos_drm_dsi.c +7 −17
  158. drivers/gpu/drm/exynos/exynos_drm_fimc.c +1 −1
  159. drivers/gpu/drm/exynos/exynos_drm_fimd.c +5 −17
  160. drivers/gpu/drm/exynos/exynos_drm_gem.c +1 −1
  161. drivers/gpu/drm/exynos/exynos_drm_gsc.c +1 −1
  162. drivers/gpu/drm/exynos/exynos_drm_ipp.c +11 −11
  163. drivers/gpu/drm/exynos/exynos_drm_rotator.c +1 −1
  164. drivers/gpu/drm/exynos/exynos_drm_vidi.c +1 −0
  165. drivers/gpu/drm/exynos/exynos_mixer.c +1 −0
  166. drivers/gpu/drm/i915/gvt/aperture_gm.c +4 −4
  167. drivers/gpu/drm/i915/gvt/cmd_parser.c +72 −37
  168. drivers/gpu/drm/i915/gvt/debug.h +8 −0
  169. drivers/gpu/drm/i915/gvt/edid.c +6 −7
  170. drivers/gpu/drm/i915/gvt/execlist.c +13 −16
  171. drivers/gpu/drm/i915/gvt/gtt.c +36 −38
  172. drivers/gpu/drm/i915/gvt/gvt.h +1 −1
  173. drivers/gpu/drm/i915/gvt/handlers.c +30 −15
  174. drivers/gpu/drm/i915/gvt/kvmgt.c +23 −14
  175. drivers/gpu/drm/i915/gvt/mmio.c +19 −19
  176. drivers/gpu/drm/i915/gvt/mmio.h +3 −0
  177. drivers/gpu/drm/i915/gvt/opregion.c +5 −5
  178. drivers/gpu/drm/i915/gvt/render.c +1 −1
  179. drivers/gpu/drm/i915/gvt/sched_policy.c +2 −2
  180. drivers/gpu/drm/i915/gvt/scheduler.c +60 −46
  181. drivers/gpu/drm/i915/i915_drv.c +3 −4
  182. drivers/gpu/drm/i915/i915_drv.h +3 −3
  183. drivers/gpu/drm/i915/i915_gem.c +115 −6
  184. drivers/gpu/drm/i915/i915_gem_context.c +0 −1
  185. drivers/gpu/drm/i915/i915_gem_context.h +0 −3
  186. drivers/gpu/drm/i915/i915_gem_evict.c +4 −4
  187. drivers/gpu/drm/i915/i915_gem_execbuffer.c +2 −50
  188. drivers/gpu/drm/i915/i915_gem_object.h +3 −0
  189. drivers/gpu/drm/i915/i915_gem_shrinker.c +1 −1
  190. drivers/gpu/drm/i915/i915_irq.c +38 −45
  191. drivers/gpu/drm/i915/i915_vma.c +37 −20
  192. drivers/gpu/drm/i915/intel_csr.c +0 −1
  193. drivers/gpu/drm/i915/intel_display.c +32 −35
  194. drivers/gpu/drm/i915/intel_engine_cs.c +2 −0
  195. drivers/gpu/drm/i915/intel_fbdev.c +4 −6
  196. drivers/gpu/drm/i915/intel_gvt.c +5 −0
  197. drivers/gpu/drm/i915/intel_hdmi.c +21 −3
  198. drivers/gpu/drm/i915/intel_hotplug.c +8 −6
  199. drivers/gpu/drm/i915/intel_lrc.c +2 −1
  200. drivers/gpu/drm/i915/intel_pm.c +16 −7
  201. drivers/gpu/drm/i915/intel_ringbuffer.h +3 −0
  202. drivers/gpu/drm/i915/intel_sprite.c +0 −3
  203. drivers/gpu/drm/i915/intel_uncore.c +6 −7
  204. drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c +0 −3
  205. drivers/gpu/drm/radeon/si_dpm.c +10 −0
  206. drivers/gpu/drm/tilcdc/tilcdc_crtc.c +24 −13
  207. drivers/hid/Kconfig +3 −2
  208. drivers/hid/hid-chicony.c +1 −0
  209. drivers/hid/hid-core.c +2 −0
  210. drivers/hid/hid-corsair.c +47 −0
  211. drivers/hid/hid-ids.h +4 −0
  212. drivers/hid/hid-sony.c +2 −0
  213. drivers/hid/usbhid/hid-quirks.c +3 −0
  214. drivers/hid/wacom_sys.c +3 −1
  215. drivers/hid/wacom_wac.c +6 −4
  216. drivers/hv/channel.c +12 −13
  217. drivers/hv/channel_mgmt.c +5 −22
  218. drivers/hv/hv_fcopy.c +0 −4
  219. drivers/hv/hv_kvp.c +0 −4
  220. drivers/hv/hv_snapshot.c +0 −4
  221. drivers/hv/hv_util.c +2 −0
  222. drivers/hv/hv_utils_transport.c +8 −4
  223. drivers/hv/hv_utils_transport.h +1 −0
  224. drivers/hv/vmbus_drv.c +5 −1
  225. drivers/hwmon/asus_atk0110.c +3 −0
  226. drivers/hwmon/it87.c +19 −5
  227. drivers/hwmon/max31790.c +1 −1
  228. drivers/hwtracing/intel_th/core.c +3 −1
  229. drivers/hwtracing/intel_th/pci.c +10 −0
  230. drivers/iio/adc/ti_am335x_adc.c +12 −1
  231. drivers/iio/common/hid-sensors/hid-sensor-trigger.c +3 −3
  232. drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c +2 −2
  233. drivers/iio/magnetometer/ak8974.c +2 −2
  234. drivers/infiniband/core/cq.c +8 −2
  235. drivers/infiniband/core/device.c +21 −8
  236. drivers/infiniband/hw/i40iw/i40iw_utils.c +8 −0
  237. drivers/infiniband/hw/ocrdma/ocrdma_verbs.c +1 −1
  238. drivers/infiniband/hw/qib/qib_iba7322.c +1 −1
  239. drivers/infiniband/hw/vmw_pvrdma/pvrdma.h +3 −0
  240. drivers/infiniband/hw/vmw_pvrdma/pvrdma_dev_api.h +1 −1
  241. drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c +13 −4
  242. drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c +18 −24
  243. drivers/infiniband/sw/rdmavt/mmap.c +2 −2
  244. drivers/infiniband/sw/rxe/Kconfig +1 −1
  245. drivers/infiniband/sw/rxe/rxe_mmap.c +2 −2
  246. drivers/infiniband/sw/rxe/rxe_req.c +1 −1
  247. drivers/infiniband/sw/rxe/rxe_resp.c +4 −5
  248. drivers/infiniband/ulp/iser/iscsi_iser.h +2 −0
  249. drivers/infiniband/ulp/iser/iser_verbs.c +5 −3
  250. drivers/input/joystick/iforce/iforce-usb.c +3 −0
  251. drivers/input/misc/cm109.c +4 −0
  252. drivers/input/misc/ims-pcu.c +4 −0
  253. drivers/input/misc/yealink.c +4 −0
  254. drivers/input/mouse/alps.c +52 −20
  255. drivers/input/mouse/alps.h +11 −0
  256. drivers/input/mouse/elan_i2c_core.c +11 −9
  257. drivers/input/rmi4/rmi_f30.c +4 −0
  258. drivers/input/serio/i8042-x86ia64io.h +14 −0
  259. drivers/input/tablet/hanwang.c +3 −0
  260. drivers/input/tablet/kbtab.c +3 −0
  261. drivers/input/touchscreen/sur40.c +3 −0
  262. drivers/iommu/amd_iommu.c +1 −1
  263. drivers/iommu/arm-smmu-v3.c +1 −1
  264. drivers/iommu/arm-smmu.c +1 −1
  265. drivers/iommu/exynos-iommu.c +7 −1
  266. drivers/iommu/intel-iommu.c +2 −2
  267. drivers/iommu/io-pgtable-arm-v7s.c +5 −1
  268. drivers/iommu/io-pgtable-arm.c +5 −1
  269. drivers/iommu/iommu.c +3 −2
  270. drivers/isdn/gigaset/bas-gigaset.c +3 −0
  271. drivers/macintosh/macio_asic.c +1 −0
  272. drivers/md/dm.c +16 −13
  273. drivers/md/md-cluster.c +1 −1
  274. drivers/md/md.c +11 −16
  275. drivers/md/md.h +0 −6
  276. drivers/md/raid1.c +24 −5
  277. drivers/md/raid10.c +36 −8
  278. drivers/md/raid5.c +2 −3
  279. drivers/media/platform/coda/imx-vdoa.c +1 −1
  280. drivers/media/platform/exynos-gsc/gsc-core.c +0 −2
  281. drivers/media/platform/sti/bdisp/bdisp-v4l2.c +1 −1
  282. drivers/media/usb/dvb-usb/dvb-usb-firmware.c +12 −10
  283. drivers/memory/omap-gpmc.c +1 −3
  284. drivers/misc/cxl/pci.c +6 −7
  285. drivers/misc/mei/bus-fixup.c +2 −12
  286. drivers/misc/mei/init.c +6 −2
  287. drivers/misc/vmw_vmci/vmci_guest.c +2 −2
  288. drivers/mmc/core/block.c +3 −4
  289. drivers/mmc/core/mmc.c +1 −1
  290. drivers/mmc/host/mtk-sd.c +2 −2
  291. drivers/mmc/host/sdhci-of-arasan.c +5 −9
  292. drivers/mmc/host/sdhci-of-at91.c +19 −0
  293. drivers/mmc/host/sdhci-pci-core.c +4 −0
  294. drivers/mmc/host/sdhci.c +3 −1
  295. drivers/mmc/host/ushc.c +3 −0
  296. drivers/net/ethernet/amd/xgbe/xgbe-common.h +16 −14
  297. drivers/net/ethernet/amd/xgbe/xgbe-dev.c +11 −9
  298. drivers/net/ethernet/amd/xgbe/xgbe-drv.c +65 −47
  299. drivers/net/ethernet/aquantia/atlantic/aq_main.c +1 −0
  300. drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c +1 −1
  301. drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0_internal.h +1 −0
  302. drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0_internal.h +1 −0
  303. drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +30 −6
  304. drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c +16 −8
  305. drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h +1 −0
  306. drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c +28 −12
  307. drivers/net/ethernet/broadcom/bnxt/bnxt.c +18 −7
  308. drivers/net/ethernet/broadcom/bnxt/bnxt.h +1 −0
  309. drivers/net/ethernet/broadcom/bnxt/bnxt_dcb.c +1 −1
  310. drivers/net/ethernet/broadcom/genet/bcmgenet.c +151 −61
  311. drivers/net/ethernet/broadcom/genet/bcmgenet.h +11 −5
  312. drivers/net/ethernet/broadcom/genet/bcmmii.c +0 −15
  313. drivers/net/ethernet/brocade/bna/bnad_debugfs.c +1 −1
  314. drivers/net/ethernet/cavium/liquidio/lio_main.c +55 −55
  315. drivers/net/ethernet/cavium/liquidio/lio_vf_main.c +55 −49
  316. drivers/net/ethernet/cavium/liquidio/octeon_config.h +3 −3
  317. drivers/net/ethernet/cavium/liquidio/octeon_droq.c +2 −15
  318. drivers/net/ethernet/cavium/liquidio/octeon_droq.h +2 −2
  319. drivers/net/ethernet/cavium/liquidio/octeon_main.h +0 −42
  320. drivers/net/ethernet/cavium/liquidio/octeon_network.h +27 −16
  321. drivers/net/ethernet/cavium/thunder/nic.h +1 −0
  322. drivers/net/ethernet/cavium/thunder/nicvf_main.c +11 −1
  323. drivers/net/ethernet/cavium/thunder/nicvf_queues.c +145 −39
  324. drivers/net/ethernet/cavium/thunder/nicvf_queues.h +3 −1
  325. drivers/net/ethernet/cavium/thunder/thunder_bgx.c +45 −19
  326. drivers/net/ethernet/cavium/thunder/thunder_bgx.h +0 −1
  327. drivers/net/ethernet/ibm/emac/core.c +17 −8
  328. drivers/net/ethernet/ibm/ibmvnic.c +36 −9
  329. drivers/net/ethernet/ibm/ibmvnic.h +1 −0
  330. drivers/net/ethernet/mellanox/mlx4/cmd.c +11 −0
  331. drivers/net/ethernet/mellanox/mlx4/main.c +11 −0
  332. drivers/net/ethernet/mellanox/mlx5/core/Kconfig +1 −0
  333. drivers/net/ethernet/mellanox/mlx5/core/cmd.c +4 −0
  334. drivers/net/ethernet/mellanox/mlx5/core/en.h +0 −4
  335. drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c +5 −5
  336. drivers/net/ethernet/mellanox/mlx5/core/en_main.c +4 −4
  337. drivers/net/ethernet/mellanox/mlx5/core/en_rep.c +0 −2
  338. drivers/net/ethernet/mellanox/mlx5/core/en_rx.c +4 −0
  339. drivers/net/ethernet/mellanox/mlx5/core/en_selftest.c +1 −4
  340. drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +67 −38
  341. drivers/net/ethernet/mellanox/mlx5/core/en_tx.c +3 −2
  342. drivers/net/ethernet/mellanox/mlx5/core/eswitch.h +6 −0
  343. drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c +22 −0
  344. drivers/net/ethernet/mellanox/mlx5/core/fs_core.c +1 −1
  345. drivers/net/ethernet/mellanox/mlx5/core/main.c +4 −3
  346. drivers/net/ethernet/mellanox/mlxsw/reg.h +2 −2
  347. drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c +2 −2
  348. drivers/net/ethernet/qlogic/qed/qed_cxt.c +2 −1
  349. drivers/net/ethernet/qlogic/qed/qed_dev.c +2 −3
  350. drivers/net/ethernet/qlogic/qed/qed_iscsi.c +31 −0
  351. drivers/net/ethernet/qlogic/qed/qed_ll2.c +8 −5
  352. drivers/net/ethernet/qlogic/qed/qed_ooo.c +2 −0
  353. drivers/net/ethernet/sfc/efx.c +1 −1
  354. drivers/net/ethernet/smsc/smc91x.c +25 −22
  355. drivers/net/ethernet/ti/Kconfig +8 −2
  356. drivers/net/ethernet/ti/Makefile +1 −1
  357. drivers/net/fjes/fjes_main.c +72 −6
  358. drivers/net/hyperv/hyperv_net.h +2 −1
  359. drivers/net/hyperv/netvsc.c +7 −8
  360. drivers/net/hyperv/netvsc_drv.c +3 −8
  361. drivers/net/phy/marvell.c +0 −15
  362. drivers/net/phy/phy_device.c +1 −1
  363. drivers/net/phy/spi_ks8995.c +2 −1
  364. drivers/net/team/team.c +1 −0
  365. drivers/net/tun.c +17 −4
  366. drivers/net/usb/qmi_wwan.c +6 −0
  367. drivers/net/usb/r8152.c +17 −7
  368. drivers/net/vrf.c +5 −2
  369. drivers/net/vxlan.c +40 −33
  370. drivers/net/wan/fsl_ucc_hdlc.c +2 −2
  371. drivers/net/wimax/i2400m/usb.c +3 −0
  372. drivers/net/wireless/ath/ath10k/hw.c +1 −1
  373. drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +3 −2
  374. drivers/net/wireless/intel/iwlwifi/mvm/sta.c +6 −5
  375. drivers/net/wireless/intel/iwlwifi/mvm/sta.h +1 −1
  376. drivers/net/wireless/intel/iwlwifi/mvm/tx.c +18 −23
  377. drivers/net/wireless/marvell/mwifiex/main.c +7 −4
  378. drivers/net/wireless/marvell/mwifiex/pcie.c +19 −19
  379. drivers/net/xen-netback/interface.c +17 −9
  380. drivers/net/xen-netback/netback.c +1 −1
  381. drivers/net/xen-netback/xenbus.c +10 −10
  382. drivers/nvdimm/bus.c +6 −0
  383. drivers/nvdimm/claim.c +9 −1
  384. drivers/nvdimm/dimm_devs.c +11 −66
  385. drivers/nvme/host/rdma.c +14 −14
  386. drivers/nvme/target/core.c +10 −1
  387. drivers/nvme/target/loop.c +51 −39
  388. drivers/nvme/target/nvmet.h +1 −0
  389. drivers/nvme/target/rdma.c +3 −5
  390. drivers/parport/share.c +4 −2
  391. drivers/phy/Kconfig +1 −8
  392. drivers/phy/Makefile +0 −1
  393. drivers/phy/phy-bcm-nsp-usb3.c +0 −177
  394. drivers/phy/phy-exynos-pcie.c +2 −2
  395. drivers/platform/x86/asus-nb-wmi.c +2 −47
  396. drivers/platform/x86/asus-wmi.c +17 −5
  397. drivers/platform/x86/asus-wmi.h +0 −1
  398. drivers/platform/x86/fujitsu-laptop.c +222 −229
  399. drivers/remoteproc/Kconfig +3 −3
  400. drivers/scsi/Kconfig +2 −3
  401. drivers/scsi/aacraid/src.c +1 −1
  402. drivers/scsi/hpsa.c +32 −21
  403. drivers/scsi/hpsa.h +1 −0
  404. drivers/scsi/hpsa_cmd.h +2 −0
  405. drivers/scsi/libiscsi.c +25 −1
  406. drivers/scsi/lpfc/lpfc.h +3 −1
  407. drivers/scsi/lpfc/lpfc_attr.c +10 −3
  408. drivers/scsi/lpfc/lpfc_crtn.h +3 −1
  409. drivers/scsi/lpfc/lpfc_ct.c +1 −1
  410. drivers/scsi/lpfc/lpfc_debugfs.c +0 −22
  411. drivers/scsi/lpfc/lpfc_els.c +14 −8
  412. drivers/scsi/lpfc/lpfc_hbadisc.c +13 −11
  413. drivers/scsi/lpfc/lpfc_hw4.h +2 −2
  414. drivers/scsi/lpfc/lpfc_init.c +92 −43
  415. drivers/scsi/lpfc/lpfc_mem.c +1 −1
  416. drivers/scsi/lpfc/lpfc_nvme.c +82 −25
  417. drivers/scsi/lpfc/lpfc_nvme.h +1 −0
  418. drivers/scsi/lpfc/lpfc_nvmet.c +35 −8
  419. drivers/scsi/lpfc/lpfc_scsi.c +2 −2
  420. drivers/scsi/lpfc/lpfc_sli.c +59 −9
  421. drivers/scsi/lpfc/lpfc_sli4.h +6 −0
  422. drivers/scsi/lpfc/lpfc_version.h +1 −1
  423. drivers/scsi/megaraid/megaraid_sas.h +2 −2
  424. drivers/scsi/megaraid/megaraid_sas_base.c +12 −5
  425. drivers/scsi/megaraid/megaraid_sas_fusion.c +2 −2
  426. drivers/scsi/mpt3sas/mpt3sas_base.h +0 −3
  427. drivers/scsi/mpt3sas/mpt3sas_scsih.c +2 −17
  428. drivers/scsi/qedf/qedf_dbg.h +8 −5
  429. drivers/scsi/qedf/qedf_fip.c +1 −1
  430. drivers/scsi/qedf/qedf_io.c +2 −2
  431. drivers/scsi/qedf/qedf_main.c +2 −2
  432. drivers/scsi/qedi/qedi_debugfs.c +8 −8
  433. drivers/scsi/qedi/qedi_fw.c +2 −2
  434. drivers/scsi/qedi/qedi_gbl.h +7 −1
  435. drivers/scsi/qedi/qedi_iscsi.c +4 −4
  436. drivers/scsi/qedi/qedi_main.c +1 −1
  437. drivers/scsi/qla2xxx/Kconfig +1 −0
  438. drivers/scsi/qla2xxx/qla_attr.c +1 −3
  439. drivers/scsi/qla2xxx/qla_dbg.c +4 −8
  440. drivers/scsi/qla2xxx/qla_dbg.h +1 −0
  441. drivers/scsi/qla2xxx/qla_def.h +50 −6
  442. drivers/scsi/qla2xxx/qla_dfs.c +103 −4
  443. drivers/scsi/qla2xxx/qla_gbl.h +14 −4
  444. drivers/scsi/qla2xxx/qla_init.c +31 −54
  445. drivers/scsi/qla2xxx/qla_iocb.c +6 −7
  446. drivers/scsi/qla2xxx/qla_isr.c +33 −8
  447. drivers/scsi/qla2xxx/qla_mbx.c +268 −36
  448. drivers/scsi/qla2xxx/qla_mid.c +8 −6
  449. drivers/scsi/qla2xxx/qla_os.c +22 −1
  450. drivers/scsi/qla2xxx/qla_target.c +470 −278
  451. drivers/scsi/qla2xxx/qla_target.h +33 −6
  452. drivers/scsi/qla2xxx/qla_version.h +3 −3
  453. drivers/scsi/qla2xxx/tcm_qla2xxx.c +33 −16
  454. drivers/scsi/scsi_lib.c +10 −4
  455. drivers/scsi/scsi_priv.h +0 −3
  456. drivers/scsi/sd.c +17 −0
  457. drivers/scsi/storvsc_drv.c +17 −10
  458. drivers/scsi/ufs/ufs.h +8 −14
  459. drivers/scsi/ufs/ufshcd.c +174 −59
  460. drivers/scsi/ufs/ufshcd.h +15 −0
  461. drivers/scsi/vmw_pvscsi.c +1 −1
  462. drivers/staging/lustre/lnet/lnet/lib-socket.c +2 −2
  463. drivers/target/target_core_alua.c +38 −44
  464. drivers/target/target_core_configfs.c +4 −0
  465. drivers/target/target_core_pscsi.c +14 −36
  466. drivers/target/target_core_sbc.c +8 −2
  467. drivers/target/target_core_tpg.c +2 −1
  468. drivers/target/target_core_transport.c +1 −2
  469. drivers/target/target_core_user.c +123 −29
  470. drivers/tty/serial/8250/8250_dw.c +7 −2
  471. drivers/tty/serial/amba-pl011.c +1 −1
  472. drivers/tty/serial/st-asc.c +6 −5
  473. drivers/tty/tty_ldisc.c +21 −71
  474. drivers/usb/class/usbtmc.c +15 −3
  475. drivers/usb/core/config.c +10 −0
  476. drivers/usb/core/hub.c +1 −1
  477. drivers/usb/core/quirks.c +8 −0
  478. drivers/usb/dwc3/gadget.c +17 −4
  479. drivers/usb/gadget/function/f_acm.c +3 −1
  480. drivers/usb/gadget/function/f_hid.c +4 −4
  481. drivers/usb/gadget/function/f_uvc.c +9 −1
  482. drivers/usb/gadget/udc/pch_udc.c +0 −1
  483. drivers/usb/misc/idmouse.c +3 −0
  484. drivers/usb/misc/lvstest.c +4 −0
  485. drivers/usb/misc/uss720.c +5 −0
  486. drivers/usb/musb/musb_core.c +1 −1
  487. drivers/usb/musb/musb_cppi41.c +21 −2
  488. drivers/usb/musb/musb_dsps.c +4 −1
  489. drivers/usb/serial/option.c +16 −1
  490. drivers/usb/serial/qcserial.c +2 −0
  491. drivers/usb/wusbcore/wa-hc.c +3 −0
  492. drivers/uwb/hwa-rc.c +3 −0
  493. drivers/uwb/i1480/dfu/usb.c +3 −0
  494. drivers/vfio/vfio.c +5 −3
  495. drivers/vfio/vfio_iommu_type1.c +3 −4
  496. drivers/vhost/vsock.c +41 −0
  497. drivers/xen/gntdev.c +6 −5
  498. drivers/xen/xen-acpi-processor.c +27 −9
  499. fs/afs/callback.c +4 −3
  500. fs/afs/cmservice.c +5 −6
  501. fs/afs/file.c +16 −4
  502. fs/afs/fsclient.c +50 −27
  503. fs/afs/inode.c +22 −20
  504. fs/afs/internal.h +13 −10
  505. fs/afs/misc.c +2 −0
  506. fs/afs/mntpt.c +0 −53
  507. fs/afs/rxrpc.c +84 −65
  508. fs/afs/security.c +7 −2
  509. fs/afs/server.c +3 −3
  510. fs/afs/vlocation.c +9 −7
  511. fs/afs/write.c +54 −22
  512. fs/btrfs/extent_io.c +2 −1
  513. fs/btrfs/inode.c +14 −0
  514. fs/crypto/crypto.c +1 −9
  515. fs/crypto/fname.c +1 −1
  516. fs/crypto/fscrypt_private.h +0 −4
  517. fs/crypto/keyinfo.c +9 −43
  518. fs/crypto/policy.c +0 −7
  519. fs/dlm/lowcomms.c +1 −1
  520. fs/ext4/inline.c +2 −3
  521. fs/ext4/inode.c +1 −1
  522. fs/ext4/move_extent.c +1 −1
  523. fs/ext4/super.c +4 −6
  524. fs/ext4/xattr.c +31 −34
  525. fs/f2fs/debug.c +1 −0
  526. fs/f2fs/dir.c +1 −1
  527. fs/f2fs/f2fs.h +2 −0
  528. fs/f2fs/node.c +77 −86
  529. fs/f2fs/segment.c +6 −0
  530. fs/fs-writeback.c +21 −14
  531. fs/gfs2/incore.h +1 −1
  532. fs/jbd2/journal.c +11 −11
  533. fs/jbd2/revoke.c +1 −0
  534. fs/kernfs/file.c +2 −1
  535. fs/nfs/callback.c +2 −2
  536. fs/nfs/client.c +24 −1
  537. fs/nfs/filelayout/filelayoutdev.c +7 −1
  538. fs/nfs/flexfilelayout/flexfilelayout.h +13 −1
  539. fs/nfs/flexfilelayout/flexfilelayoutdev.c +3 −2
  540. fs/nfs/internal.h +2 −0
  541. fs/nfs/nfs4client.c +2 −2
  542. fs/nfs/nfs4proc.c +4 −7
  543. fs/nfs/nfs4xdr.c +1 −1
  544. fs/nfs/pnfs.h +1 −1
  545. fs/nfs/pnfs_nfs.c +25 −6
  546. fs/nfs/write.c +4 −2
  547. fs/ocfs2/cluster/tcp.c +1 −1
  548. fs/xfs/libxfs/xfs_dir2_priv.h +2 −0
  549. fs/xfs/libxfs/xfs_dir2_sf.c +87 −0
  550. fs/xfs/libxfs/xfs_inode_fork.c +23 −3
  551. fs/xfs/libxfs/xfs_inode_fork.h +1 −1
  552. fs/xfs/xfs_dir2_readdir.c +0 −11
  553. fs/xfs/xfs_inode.c +9 −3
  554. include/crypto/if_alg.h +1 −1
  555. include/linux/acpi.h +1 −4
  556. include/linux/ccp.h +1 −1
  557. include/linux/dccp.h +1 −0
  558. include/linux/device.h +0 −1
  559. include/linux/errqueue.h +2 −0
  560. include/linux/filter.h +12 −4
  561. include/linux/fscrypt_common.h +0 −1
  562. include/linux/gpio/consumer.h +0 −16
  563. include/linux/hwmon.h +1 −0
  564. include/linux/hyperv.h +7 −3
  565. include/linux/iio/sw_device.h +1 −1
  566. include/linux/iommu.h +13 −5
  567. include/linux/kasan.h +1 −0
  568. include/linux/list_nulls.h +5 −0
  569. include/linux/mlx4/device.h +1 −0
  570. include/linux/net.h +1 −1
  571. include/linux/omap-gpmc.h +3 −13
  572. include/linux/phy.h +4 −0
  573. include/linux/rculist_nulls.h +14 −0
  574. include/linux/reset.h +2 −7
  575. include/linux/usb/quirks.h +6 −0
  576. include/linux/virtio_vsock.h +3 −0
  577. include/net/af_vsock.h +3 −0
  578. include/net/inet_common.h +2 −1
  579. include/net/inet_connection_sock.h +1 −1
  580. include/net/netfilter/nf_conntrack.h +1 −1
  581. include/net/netfilter/nf_tables.h +29 −1
  582. include/net/netfilter/nf_tables_ipv6.h +4 −2
  583. include/net/sctp/structs.h +5 −3
  584. include/net/sock.h +6 −3
  585. include/rdma/ib_verbs.h +17 −13
  586. include/scsi/libiscsi.h +1 −0
  587. include/scsi/scsi_device.h +4 −0
  588. include/target/target_core_backend.h +6 −1
  589. include/target/target_core_base.h +1 −1
  590. include/uapi/asm-generic/unistd.h +3 −1
  591. include/uapi/drm/omap_drm.h +19 −19
  592. include/uapi/linux/btrfs.h +0 −27
  593. include/uapi/linux/packet_diag.h +1 −1
  594. include/uapi/rdma/mlx5-abi.h +2 −1
  595. include/video/exynos5433_decon.h +12 −0
  596. kernel/audit.c +394 −245
  597. kernel/audit.h +2 −7
  598. kernel/auditsc.c +3 −3
  599. kernel/bpf/hashtab.c +146 −107
  600. kernel/bpf/lpm_trie.c +6 −0
  601. kernel/cgroup/cgroup-v1.c +1 −1
  602. kernel/cgroup/pids.c +1 −1
  603. kernel/cpu.c +14 −14
  604. kernel/events/core.c +48 −16
  605. kernel/futex.c +13 −9
  606. kernel/locking/rwsem-spinlock.c +11 −5
  607. kernel/memremap.c +0 −4
  608. kernel/sched/cpufreq_schedutil.c +7 −13
  609. kernel/sched/deadline.c +57 −6
  610. kernel/sched/loadavg.c +12 −8
  611. kernel/workqueue.c +1 −0
  612. mm/gup.c +1 −1
  613. mm/memory_hotplug.c +5 −1
  614. mm/percpu-vm.c +3 −4
  615. mm/percpu.c +4 −1
  616. mm/swap_slots.c +0 −2
  617. mm/vmalloc.c +2 −1
  618. mm/z3fold.c +1 −0
  619. net/atm/svc.c +3 −2
  620. net/ax25/af_ax25.c +2 −1
  621. net/batman-adv/bat_iv_ogm.c +11 −0
  622. net/batman-adv/bat_v.c +11 −3
  623. net/batman-adv/fragmentation.c +13 −7
  624. net/batman-adv/gateway_common.c +5 −0
  625. net/batman-adv/soft-interface.c +0 −1
  626. net/batman-adv/types.h +2 −0
  627. net/bluetooth/l2cap_sock.c +1 −1
  628. net/bluetooth/rfcomm/sock.c +2 −1
  629. net/bluetooth/sco.c +1 −1
  630. net/bridge/br_fdb.c +1 −1
  631. net/bridge/br_input.c +1 −0
  632. net/bridge/br_netfilter_hooks.c +7 −26
  633. net/bridge/br_private.h +0 −9
  634. net/ceph/messenger.c +6 −0
  635. net/core/dev.c +1 −0
  636. net/core/net-sysfs.c +3 −3
  637. net/core/netclassid_cgroup.c +16 −16
  638. net/core/skbuff.c +36 −19
  639. net/core/sock.c +68 −54
  640. net/dccp/ccids/ccid2.c +1 −0
  641. net/dccp/ipv4.c +2 −1
  642. net/dccp/ipv6.c +5 −3
  643. net/dccp/minisocks.c +16 −8
  644. net/decnet/af_decnet.c +3 −2
  645. net/ipv4/af_inet.c +6 −3
  646. net/ipv4/fib_frontend.c +2 −1
  647. net/ipv4/inet_connection_sock.c +1 −1
  648. net/ipv4/ip_fragment.c +17 −8
  649. net/ipv4/ip_output.c +1 −1
  650. net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c +4 −0
  651. net/ipv4/netfilter/nf_nat_l3proto_ipv4.c +0 −5
  652. net/ipv4/netfilter/nft_masq_ipv4.c +4 −4
  653. net/ipv4/netfilter/nft_redir_ipv4.c +4 −4
  654. net/ipv4/tcp.c +2 −1
  655. net/ipv4/tcp_input.c +1 −1
  656. net/ipv4/tcp_ipv4.c +7 −3
  657. net/ipv4/tcp_minisocks.c +1 −0
  658. net/ipv4/tcp_timer.c +4 −2
  659. net/ipv6/af_inet6.c +5 −5
  660. net/ipv6/ip6_fib.c +2 −0
  661. net/ipv6/ip6_offload.c +3 −1
  662. net/ipv6/ip6_output.c +7 −2
  663. net/ipv6/ip6_vti.c +6 −2
  664. net/ipv6/netfilter/nft_masq_ipv6.c +4 −4
  665. net/ipv6/netfilter/nft_redir_ipv6.c +4 −4
  666. net/ipv6/route.c +8 −5
  667. net/ipv6/tcp_ipv6.c +5 −3
  668. net/ipv6/udp.c +1 −1
  669. net/irda/af_irda.c +3 −2
  670. net/iucv/af_iucv.c +1 −1
  671. net/llc/af_llc.c +3 −1
  672. net/mpls/af_mpls.c +11 −2
  673. net/netfilter/nf_conntrack_core.c +5 −1
  674. net/netfilter/nf_nat_proto_sctp.c +12 −1
  675. net/netfilter/nf_tables_api.c +0 −4
  676. net/netfilter/nft_ct.c +12 −9
  677. net/netfilter/nft_meta.c +21 −19
  678. net/netfilter/nft_nat.c +4 −4
  679. net/netfilter/nft_set_bitmap.c +79 −86
  680. net/netlink/af_netlink.c +41 −0
  681. net/netlink/genetlink.c +3 −1
  682. net/netrom/af_netrom.c +2 −1
  683. net/nfc/llcp_sock.c +1 −1
  684. net/openvswitch/flow_netlink.c +3 −1
  685. net/phonet/pep.c +4 −2
  686. net/phonet/socket.c +2 −2
  687. net/rds/connection.c +1 −0
  688. net/rds/ib_cm.c +36 −11
  689. net/rds/rds.h +3 −3
  690. net/rds/tcp.c +21 −17
  691. net/rds/tcp.h +1 −1
  692. net/rds/tcp_listen.c +8 −3
  693. net/rose/af_rose.c +2 −1
  694. net/rxrpc/conn_event.c +4 −0
  695. net/rxrpc/input.c +19 −8
  696. net/rxrpc/recvmsg.c +2 −2
  697. net/rxrpc/sendmsg.c +31 −18
  698. net/sched/act_connmark.c +3 −0
  699. net/sched/act_skbmod.c +0 −1
  700. net/sched/sch_dsmark.c +8 −2
  701. net/sctp/associola.c +2 −4
  702. net/sctp/ipv6.c +3 −2
  703. net/sctp/output.c +3 −4
  704. net/sctp/outqueue.c +5 −6
  705. net/sctp/protocol.c +3 −2
  706. net/sctp/socket.c +2 −2
  707. net/smc/af_smc.c +1 −1
  708. net/socket.c +15 −3
  709. net/sunrpc/xprtrdma/verbs.c +2 −1
  710. net/tipc/socket.c +5 −3
  711. net/tipc/subscr.c +6 −1
  712. net/unix/af_unix.c +3 −2
  713. net/unix/garbage.c +9 −8
  714. net/vmw_vsock/af_vsock.c +16 −1
  715. net/vmw_vsock/virtio_transport.c +42 −0
  716. net/vmw_vsock/virtio_transport_common.c +7 −0
  717. net/wireless/nl80211.c +56 −71
  718. net/x25/af_x25.c +2 −1
  719. net/xfrm/xfrm_policy.c +9 −10
  720. sound/core/seq/seq_clientmgr.c +1 −0
  721. sound/core/seq/seq_fifo.c +3 −0
  722. sound/core/seq/seq_memory.c +13 −4
  723. sound/core/seq/seq_memory.h +1 −0
  724. sound/pci/ctxfi/cthw20k1.c +1 −1
  725. sound/pci/hda/patch_conexant.c +11 −0
  726. sound/pci/hda/patch_realtek.c +15 −1
  727. sound/x86/Kconfig +2 −1
  728. tools/include/uapi/linux/bpf_perf_event.h +18 −0
  729. tools/perf/util/symbol.c +1 −1
  730. tools/testing/selftests/bpf/Makefile +11 −8
  731. tools/testing/selftests/bpf/test_maps.c +26 −3
  732. tools/testing/selftests/bpf/test_verifier.c +4 −0
  733. tools/testing/selftests/powerpc/include/vsx_asm.h +24 −24
Documentation/cgroup-v2.txt+6−5
@@ -1142,16 +1142,17 @@ used by the kernel. · 1141 unmodified lines
11421142
11431143 pids.max
11441144
1145− A read-write single value file which exists on non-root cgroups. The
1146− default is "max".
1145+ A read-write single value file which exists on non-root
1146+ cgroups. The default is "max".
11471147
1148− Hard limit of number of processes.
1148+ Hard limit of number of processes.
11491149
11501150 pids.current
11511151
1152− A read-only single value file which exists on all cgroups.
1152+ A read-only single value file which exists on all cgroups.
11531153
1154− The number of processes currently in the cgroup and its descendants.
1154+ The number of processes currently in the cgroup and its
1155+ descendants.
11551156
11561157 Organisational operations are not blocked by cgroup policies, so it is
11571158 possible to have pids.current > pids.max. This can be done by either
Documentation/devicetree/bindings/arm/marvell/cp110-system-controller0.txt+3−3
@@ -45,7 +45,7 @@ The following clocks are available: · 44 unmodified lines
4545 - 1 15 SATA
4646 - 1 16 SATA USB
4747 - 1 17 Main
48− - 1 18 SD/MMC
48+ - 1 18 SD/MMC/GOP
4949 - 1 21 Slow IO (SPI, NOR, BootROM, I2C, UART)
5050 - 1 22 USB3H0
5151 - 1 23 USB3H1
@@ -65,7 +65,7 @@ Required properties: · 13 unmodified lines
6565 "cpm-audio", "cpm-communit", "cpm-nand", "cpm-ppv2", "cpm-sdio",
6666 "cpm-mg-domain", "cpm-mg-core", "cpm-xor1", "cpm-xor0", "cpm-gop-dp", "none",
6767 "cpm-pcie_x10", "cpm-pcie_x11", "cpm-pcie_x4", "cpm-pcie-xor", "cpm-sata",
68− "cpm-sata-usb", "cpm-main", "cpm-sd-mmc", "none", "none", "cpm-slow-io",
68+ "cpm-sata-usb", "cpm-main", "cpm-sd-mmc-gop", "none", "none", "cpm-slow-io",
6969 "cpm-usb3h0", "cpm-usb3h1", "cpm-usb3dev", "cpm-eip150", "cpm-eip197";
7070
7171 Example:
@@ -78,6 +78,6 @@ Example: · 6 unmodified lines
7878 gate-clock-output-names = "cpm-audio", "cpm-communit", "cpm-nand", "cpm-ppv2", "cpm-sdio",
7979 "cpm-mg-domain", "cpm-mg-core", "cpm-xor1", "cpm-xor0", "cpm-gop-dp", "none",
8080 "cpm-pcie_x10", "cpm-pcie_x11", "cpm-pcie_x4", "cpm-pcie-xor", "cpm-sata",
81− "cpm-sata-usb", "cpm-main", "cpm-sd-mmc", "none", "none", "cpm-slow-io",
81+ "cpm-sata-usb", "cpm-main", "cpm-sd-mmc-gop", "none", "none", "cpm-slow-io",
8282 "cpm-usb3h0", "cpm-usb3h1", "cpm-usb3dev", "cpm-eip150", "cpm-eip197";
8383 };
Documentation/devicetree/bindings/display/exynos/exynos_dsim.txt+0−1
@@ -4,7 +4,6 @@ Required properties: · 3 unmodified lines
44 - compatible: value should be one of the following
55 "samsung,exynos3250-mipi-dsi" /* for Exynos3250/3472 SoCs */
66 "samsung,exynos4210-mipi-dsi" /* for Exynos4 SoCs */
7− "samsung,exynos4415-mipi-dsi" /* for Exynos4415 SoC */
87 "samsung,exynos5410-mipi-dsi" /* for Exynos5410/5420/5440 SoCs */
98 "samsung,exynos5422-mipi-dsi" /* for Exynos5422/5800 SoCs */
109 "samsung,exynos5433-mipi-dsi" /* for Exynos5433 SoCs */
Documentation/devicetree/bindings/display/exynos/samsung-fimd.txt+0−1
@@ -11,7 +11,6 @@ Required properties: · 10 unmodified lines
1111 "samsung,s5pv210-fimd"; /* for S5PV210 SoC */
1212 "samsung,exynos3250-fimd"; /* for Exynos3250/3472 SoCs */
1313 "samsung,exynos4210-fimd"; /* for Exynos4 SoCs */
14− "samsung,exynos4415-fimd"; /* for Exynos4415 SoC */
1514 "samsung,exynos5250-fimd"; /* for Exynos5250 SoCs */
1615 "samsung,exynos5420-fimd"; /* for Exynos5420/5422/5800 SoCs */
1716
Documentation/devicetree/bindings/mmc/rockchip-dw-mshc.txt+1−1
@@ -13,7 +13,7 @@ Required Properties: · 12 unmodified lines
1313 - "rockchip,rk2928-dw-mshc": for Rockchip RK2928 and following,
1414 before RK3288
1515 - "rockchip,rk3288-dw-mshc": for Rockchip RK3288
16− - "rockchip,rk1108-dw-mshc", "rockchip,rk3288-dw-mshc": for Rockchip RK1108
16+ - "rockchip,rv1108-dw-mshc", "rockchip,rk3288-dw-mshc": for Rockchip RV1108
1717 - "rockchip,rk3036-dw-mshc", "rockchip,rk3288-dw-mshc": for Rockchip RK3036
1818 - "rockchip,rk3368-dw-mshc", "rockchip,rk3288-dw-mshc": for Rockchip RK3368
1919 - "rockchip,rk3399-dw-mshc", "rockchip,rk3288-dw-mshc": for Rockchip RK3399
Documentation/devicetree/bindings/phy/brcm,nsp-usb3-phy.txt+0−39
@@ -1,39 +0,0 @@
1−Broadcom USB3 phy binding for northstar plus SoC
2−The USB3 phy is internal to the SoC and is accessed using mdio interface.
3−
4−Required mdio bus properties:
5−- reg: Should be 0x0 for SoC internal USB3 phy
6−- #address-cells: must be 1
7−- #size-cells: must be 0
8−
9−Required USB3 PHY properties:
10−- compatible: should be "brcm,nsp-usb3-phy"
11−- reg: USB3 Phy address on SoC internal MDIO bus and it should be 0x10.
12−- usb3-ctrl-syscon: handler of syscon node defining physical address
13− of usb3 control register.
14−- #phy-cells: must be 0
15−
16−Required usb3 control properties:
17−- compatible: should be "brcm,nsp-usb3-ctrl"
18−- reg: offset and length of the control registers
19−
20−Example:
21−
22− mdio@0 {
23− reg = <0x0>;
24− #address-cells = <1>;
25− #size-cells = <0>;
26−
27− usb3_phy: usb-phy@10 {
28− compatible = "brcm,nsp-usb3-phy";
29− reg = <0x10>;
30− usb3-ctrl-syscon = <&usb3_ctrl>;
31− #phy-cells = <0>;
32− status = "disabled";
33− };
34− };
35−
36− usb3_ctrl: syscon@104408 {
37− compatible = "brcm,nsp-usb3-ctrl", "syscon";
38− reg = <0x104408 0x3fc>;
39− };
Documentation/devicetree/bindings/powerpc/4xx/emac.txt+60−2
@@ -71,6 +71,9 @@ · 70 unmodified lines
7171 For Axon it can be absent, though my current driver
7272 doesn't handle phy-address yet so for now, keep
7373 0x00ffffff in it.
74+ - phy-handle : Used to describe configurations where a external PHY
75+ is used. Please refer to:
76+ Documentation/devicetree/bindings/net/ethernet.txt
7477 - rx-fifo-size-gige : 1 cell, Rx fifo size in bytes for 1000 Mb/sec
7578 operations (if absent the value is the same as
7679 rx-fifo-size). For Axon, either absent or 2048.
@@ -81,8 +84,22 @@ · 4 unmodified lines
8184 offload, phandle of the TAH device node.
8285 - tah-channel : 1 cell, optional. If appropriate, channel used on the
8386 TAH engine.
87+ - fixed-link : Fixed-link subnode describing a link to a non-MDIO
88+ managed entity. See
89+ Documentation/devicetree/bindings/net/fixed-link.txt
90+ for details.
91+ - mdio subnode : When the EMAC has a phy connected to its local
92+ mdio, which us supported by the kernel's network
93+ PHY library in drivers/net/phy, there must be device
94+ tree subnode with the following required properties:
95+ - #address-cells: Must be <1>.
96+ - #size-cells: Must be <0>.
8497
85− Example:
98+ For PHY definitions: Please refer to
99+ Documentation/devicetree/bindings/net/phy.txt and
100+ Documentation/devicetree/bindings/net/ethernet.txt
101+
102+ Examples:
86103
87104 EMAC0: ethernet@40000800 {
88105 device_type = "network";
@@ -104,6 +121,48 @@ · 15 unmodified lines
104121 zmii-channel = <0>;
105122 };
106123
124+ EMAC1: ethernet@ef600c00 {
125+ device_type = "network";
126+ compatible = "ibm,emac-apm821xx", "ibm,emac4sync";
127+ interrupt-parent = <&EMAC1>;
128+ interrupts = <0 1>;
129+ #interrupt-cells = <1>;
130+ #address-cells = <0>;
131+ #size-cells = <0>;
132+ interrupt-map = <0 &UIC2 0x10 IRQ_TYPE_LEVEL_HIGH /* Status */
133+ 1 &UIC2 0x14 IRQ_TYPE_LEVEL_HIGH /* Wake */>;
134+ reg = <0xef600c00 0x000000c4>;
135+ local-mac-address = [000000000000]; /* Filled in by U-Boot */
136+ mal-device = <&MAL0>;
137+ mal-tx-channel = <0>;
138+ mal-rx-channel = <0>;
139+ cell-index = <0>;
140+ max-frame-size = <9000>;
141+ rx-fifo-size = <16384>;
142+ tx-fifo-size = <2048>;
143+ fifo-entry-size = <10>;
144+ phy-mode = "rgmii";
145+ phy-handle = <&phy0>;
146+ phy-map = <0x00000000>;
147+ rgmii-device = <&RGMII0>;
148+ rgmii-channel = <0>;
149+ tah-device = <&TAH0>;
150+ tah-channel = <0>;
151+ has-inverted-stacr-oc;
152+ has-new-stacr-staopc;
153+
154+ mdio {
155+ #address-cells = <1>;
156+ #size-cells = <0>;
157+
158+ phy0: ethernet-phy@0 {
159+ compatible = "ethernet-phy-ieee802.3-c22";
160+ reg = <0>;
161+ };
162+ };
163+ };
164+
165+
107166 ii) McMAL node
108167
109168 Required properties:
@@ -145,4 +204,3 @@ · 35 unmodified lines
145204 - revision : as provided by the RGMII new version register if
146205 available.
147206 For Axon: 0x0000012a
148−
Documentation/extcon/intel-int3496.txt+5−0
@@ -20,3 +20,8 @@ Index 1: The output gpio for enabling Vbus output from the device to the otg · 19 unmodified lines
2020 Index 2: The output gpio for muxing of the data pins between the USB host and
2121 the USB peripheral controller, write 1 to mux to the peripheral
2222 controller
23+
24+There is a mapping between indices and GPIO connection IDs as follows
25+ id index 0
26+ vbus index 1
27+ mux index 2
Documentation/gcc-plugins.txt+2−2
@@ -18,8 +18,8 @@ because gcc versions 4.5 and 4.6 are compiled by a C compiler, · 17 unmodified lines
1818 gcc-4.7 can be compiled by a C or a C++ compiler,
1919 and versions 4.8+ can only be compiled by a C++ compiler.
2020
21−Currently the GCC plugin infrastructure supports only the x86, arm and arm64
22−architectures.
21+Currently the GCC plugin infrastructure supports only the x86, arm, arm64 and
22+powerpc architectures.
2323
2424 This infrastructure was ported from grsecurity [6] and PaX [7].
2525
Documentation/networking/ip-sysctl.txt+2−1
@@ -1006,7 +1006,8 @@ accept_redirects - BOOLEAN · 1005 unmodified lines
10061006 FALSE (router)
10071007
10081008 forwarding - BOOLEAN
1009− Enable IP forwarding on this interface.
1009+ Enable IP forwarding on this interface. This controls whether packets
1010+ received _on_ this interface can be forwarded.
10101011
10111012 mc_forwarding - BOOLEAN
10121013 Do multicast routing. The kernel needs to be compiled with CONFIG_MROUTE
MAINTAINERS+2−16
@@ -3216,7 +3216,6 @@ F: drivers/platform/chrome/ · 3215 unmodified lines
32163216
32173217 CISCO VIC ETHERNET NIC DRIVER
32183218 M: Christian Benvenuti <benve@cisco.com>
3219−M: Sujith Sankar <ssujith@cisco.com>
32203219 M: Govindarajulu Varadarajan <_govind@gmx.com>
32213220 M: Neel Patel <neepatel@cisco.com>
32223221 S: Supported
@@ -7773,13 +7772,6 @@ F: include/net/mac80211.h · 4550 unmodified lines
77737772 F: net/mac80211/
77747773 F: drivers/net/wireless/mac80211_hwsim.[ch]
77757774
7776−MACVLAN DRIVER
7777−M: Patrick McHardy <kaber@trash.net>
7778−L: netdev@vger.kernel.org
7779−S: Maintained
7780−F: drivers/net/macvlan.c
7781−F: include/linux/if_macvlan.h
7782−
77837775 MAILBOX API
77847776 M: Jassi Brar <jassisinghbrar@gmail.com>
77857777 L: linux-kernel@vger.kernel.org
@@ -7852,6 +7844,8 @@ F: drivers/net/ethernet/marvell/mvneta.* · 66 unmodified lines
78527844 MARVELL MWIFIEX WIRELESS DRIVER
78537845 M: Amitkumar Karwar <akarwar@marvell.com>
78547846 M: Nishant Sarmukadam <nishants@marvell.com>
7847+M: Ganapathi Bhat <gbhat@marvell.com>
7848+M: Xinming Hu <huxm@marvell.com>
78557849 L: linux-wireless@vger.kernel.org
78567850 S: Maintained
78577851 F: drivers/net/wireless/marvell/mwifiex/
@@ -13382,14 +13376,6 @@ W: https://linuxtv.org · 5524 unmodified lines
1338213376 S: Maintained
1338313377 F: drivers/media/platform/vivid/*
1338413378
13385−VLAN (802.1Q)
13386−M: Patrick McHardy <kaber@trash.net>
13387−L: netdev@vger.kernel.org
13388−S: Maintained
13389−F: drivers/net/macvlan.c
13390−F: include/linux/if_*vlan.h
13391−F: net/8021q/
13392−
1339313379 VLYNQ BUS
1339413380 M: Florian Fainelli <f.fainelli@gmail.com>
1339513381 L: openwrt-devel@lists.openwrt.org (subscribers-only)
Makefile+1−1
@@ -1,7 +1,7 @@
11 VERSION = 4
22 PATCHLEVEL = 11
33 SUBLEVEL = 0
4−EXTRAVERSION = -rc2
4+EXTRAVERSION = -rc4
55 NAME = Fearless Coyote
66
77 # *DOCUMENTATION*
arch/arm/boot/dts/am335x-pcm-953.dtsi+2−2
@@ -63,14 +63,14 @@ · 62 unmodified lines
6363 label = "home";
6464 linux,code = <KEY_HOME>;
6565 gpios = <&gpio3 7 GPIO_ACTIVE_HIGH>;
66− gpio-key,wakeup;
66+ wakeup-source;
6767 };
6868
6969 button@1 {
7070 label = "menu";
7171 linux,code = <KEY_MENU>;
7272 gpios = <&gpio3 8 GPIO_ACTIVE_HIGH>;
73− gpio-key,wakeup;
73+ wakeup-source;
7474 };
7575
7676 };
arch/arm/boot/dts/am57xx-idk-common.dtsi+7−7
@@ -315,6 +315,13 @@ · 314 unmodified lines
315315 /* ID & VBUS GPIOs provided in board dts */
316316 };
317317 };
318+
319+ tpic2810: tpic2810@60 {
320+ compatible = "ti,tpic2810";
321+ reg = <0x60>;
322+ gpio-controller;
323+ #gpio-cells = <2>;
324+ };
318325 };
319326
320327 &mcspi3 {
@@ -330,13 +337,6 @@ · 9 unmodified lines
330337 spi-max-frequency = <1000000>;
331338 spi-cpol;
332339 };
333−
334− tpic2810: tpic2810@60 {
335− compatible = "ti,tpic2810";
336− reg = <0x60>;
337− gpio-controller;
338− #gpio-cells = <2>;
339− };
340340 };
341341
342342 &uart3 {
arch/arm/boot/dts/bcm5301x.dtsi+2−2
@@ -66,14 +66,14 @@ · 65 unmodified lines
6666 timer@20200 {
6767 compatible = "arm,cortex-a9-global-timer";
6868 reg = <0x20200 0x100>;
69− interrupts = <GIC_PPI 11 IRQ_TYPE_LEVEL_HIGH>;
69+ interrupts = <GIC_PPI 11 IRQ_TYPE_EDGE_RISING>;
7070 clocks = <&periph_clk>;
7171 };
7272
7373 local-timer@20600 {
7474 compatible = "arm,cortex-a9-twd-timer";
7575 reg = <0x20600 0x100>;
76− interrupts = <GIC_PPI 13 IRQ_TYPE_LEVEL_HIGH>;
76+ interrupts = <GIC_PPI 13 IRQ_TYPE_EDGE_RISING>;
7777 clocks = <&periph_clk>;
7878 };
7979
arch/arm/boot/dts/bcm953012k.dts+2−3
@@ -48,15 +48,14 @@ · 47 unmodified lines
4848 };
4949
5050 memory {
51− reg = <0x00000000 0x10000000>;
51+ reg = <0x80000000 0x10000000>;
5252 };
5353 };
5454
5555 &uart0 {
56− clock-frequency = <62499840>;
56+ status = "okay";
5757 };
5858
5959 &uart1 {
60− clock-frequency = <62499840>;
6160 status = "okay";
6261 };
arch/arm/boot/dts/bcm958522er.dts+1−0
@@ -55,6 +55,7 @@ · 54 unmodified lines
5555 gpio-restart {
5656 compatible = "gpio-restart";
5757 gpios = <&gpioa 15 GPIO_ACTIVE_LOW>;
58+ open-source;
5859 priority = <200>;
5960 };
6061 };
arch/arm/boot/dts/bcm958525er.dts+1−0
@@ -55,6 +55,7 @@ · 54 unmodified lines
5555 gpio-restart {
5656 compatible = "gpio-restart";
5757 gpios = <&gpioa 15 GPIO_ACTIVE_LOW>;
58+ open-source;
5859 priority = <200>;
5960 };
6061 };
arch/arm/boot/dts/bcm958525xmc.dts+1−0
@@ -55,6 +55,7 @@ · 54 unmodified lines
5555 gpio-restart {
5656 compatible = "gpio-restart";
5757 gpios = <&gpioa 31 GPIO_ACTIVE_LOW>;
58+ open-source;
5859 priority = <200>;
5960 };
6061 };
arch/arm/boot/dts/bcm958622hr.dts+1−0
@@ -55,6 +55,7 @@ · 54 unmodified lines
5555 gpio-restart {
5656 compatible = "gpio-restart";
5757 gpios = <&gpioa 15 GPIO_ACTIVE_LOW>;
58+ open-source;
5859 priority = <200>;
5960 };
6061 };
arch/arm/boot/dts/bcm958623hr.dts+1−0
@@ -55,6 +55,7 @@ · 54 unmodified lines
5555 gpio-restart {
5656 compatible = "gpio-restart";
5757 gpios = <&gpioa 15 GPIO_ACTIVE_LOW>;
58+ open-source;
5859 priority = <200>;
5960 };
6061 };
arch/arm/boot/dts/bcm958625hr.dts+1−0
@@ -55,6 +55,7 @@ · 54 unmodified lines
5555 gpio-restart {
5656 compatible = "gpio-restart";
5757 gpios = <&gpioa 15 GPIO_ACTIVE_LOW>;
58+ open-source;
5859 priority = <200>;
5960 };
6061 };
arch/arm/boot/dts/bcm988312hr.dts+1−0
@@ -55,6 +55,7 @@ · 54 unmodified lines
5555 gpio-restart {
5656 compatible = "gpio-restart";
5757 gpios = <&gpioa 15 GPIO_ACTIVE_LOW>;
58+ open-source;
5859 priority = <200>;
5960 };
6061 };
arch/arm/boot/dts/imx6sx-udoo-neo.dtsi+0−5
@@ -121,11 +121,6 @@ · 120 unmodified lines
121121 };
122122 };
123123
124−&cpu0 {
125− arm-supply = <&sw1a_reg>;
126− soc-supply = <&sw1c_reg>;
127−};
128−
129124 &fec1 {
130125 pinctrl-names = "default";
131126 pinctrl-0 = <&pinctrl_enet1>;
arch/arm/boot/dts/sama5d2.dtsi+1−1
@@ -266,7 +266,7 @@ · 265 unmodified lines
266266 };
267267
268268 usb1: ohci@00400000 {
269− compatible = "atmel,sama5d2-ohci", "usb-ohci";
269+ compatible = "atmel,at91rm9200-ohci", "usb-ohci";
270270 reg = <0x00400000 0x100000>;
271271 interrupts = <41 IRQ_TYPE_LEVEL_HIGH 2>;
272272 clocks = <&uhphs_clk>, <&uhphs_clk>, <&uhpck>;
arch/arm/boot/dts/ste-dbx5x0.dtsi+19−0
@@ -14,6 +14,7 @@ · 13 unmodified lines
1414 #include <dt-bindings/mfd/dbx500-prcmu.h>
1515 #include <dt-bindings/arm/ux500_pm_domains.h>
1616 #include <dt-bindings/gpio/gpio.h>
17+#include <dt-bindings/clock/ste-ab8500.h>
1718 #include "skeleton.dtsi"
1819
1920 / {
@@ -603,6 +604,11 @@ · 583 unmodified lines
603604 interrupt-controller;
604605 #interrupt-cells = <2>;
605606
607+ ab8500_clock: clock-controller {
608+ compatible = "stericsson,ab8500-clk";
609+ #clock-cells = <1>;
610+ };
611+
606612 ab8500_gpio: ab8500-gpio {
607613 compatible = "stericsson,ab8500-gpio";
608614 gpio-controller;
@@ -686,6 +692,8 @@ · 77 unmodified lines
686692
687693 ab8500-pwm {
688694 compatible = "stericsson,ab8500-pwm";
695+ clocks = <&ab8500_clock AB8500_SYSCLK_INT>;
696+ clock-names = "intclk";
689697 };
690698
691699 ab8500-debugfs {
@@ -700,6 +708,9 @@ · 8 unmodified lines
700708 V-AMIC2-supply = <&ab8500_ldo_anamic2_reg>;
701709 V-DMIC-supply = <&ab8500_ldo_dmic_reg>;
702710
711+ clocks = <&ab8500_clock AB8500_SYSCLK_AUDIO>;
712+ clock-names = "audioclk";
713+
703714 stericsson,earpeice-cmv = <950>; /* Units in mV. */
704715 };
705716
@@ -1095,6 +1106,14 @@ · 389 unmodified lines
10951106 status = "disabled";
10961107 };
10971108
1109+ sound {
1110+ compatible = "stericsson,snd-soc-mop500";
1111+ stericsson,cpu-dai = <&msp1 &msp3>;
1112+ stericsson,audio-codec = <&codec>;
1113+ clocks = <&prcmu_clk PRCMU_SYSCLK>, <&ab8500_clock AB8500_SYSCLK_ULP>, <&ab8500_clock AB8500_SYSCLK_INT>;
1114+ clock-names = "sysclk", "ulpclk", "intclk";
1115+ };
1116+
10981117 msp0: msp@80123000 {
10991118 compatible = "stericsson,ux500-msp-i2s";
11001119 reg = <0x80123000 0x1000>;
arch/arm/boot/dts/ste-href.dtsi+0−9
@@ -186,15 +186,6 @@ · 185 unmodified lines
186186 status = "okay";
187187 };
188188
189− sound {
190− compatible = "stericsson,snd-soc-mop500";
191−
192− stericsson,cpu-dai = <&msp1 &msp3>;
193− stericsson,audio-codec = <&codec>;
194− clocks = <&prcmu_clk PRCMU_SYSCLK>;
195− clock-names = "sysclk";
196− };
197−
198189 msp0: msp@80123000 {
199190 pinctrl-names = "default";
200191 pinctrl-0 = <&msp0_default_mode>;
arch/arm/boot/dts/ste-snowball.dts+0−9
@@ -159,15 +159,6 @@ · 158 unmodified lines
159159 "", "", "", "", "", "", "", "";
160160 };
161161
162− sound {
163− compatible = "stericsson,snd-soc-mop500";
164−
165− stericsson,cpu-dai = <&msp1 &msp3>;
166− stericsson,audio-codec = <&codec>;
167− clocks = <&prcmu_clk PRCMU_SYSCLK>;
168− clock-names = "sysclk";
169− };
170−
171162 msp0: msp@80123000 {
172163 pinctrl-names = "default";
173164 pinctrl-0 = <&msp0_default_mode>;
arch/arm/boot/dts/sun7i-a20-lamobo-r1.dts+1−1
@@ -167,7 +167,7 @@ · 166 unmodified lines
167167 reg = <8>;
168168 label = "cpu";
169169 ethernet = <&gmac>;
170− phy-mode = "rgmii";
170+ phy-mode = "rgmii-txid";
171171 fixed-link {
172172 speed = <1000>;
173173 full-duplex;
arch/arm/boot/dts/sun8i-a23-a33.dtsi+1−1
@@ -495,7 +495,7 @@ · 494 unmodified lines
495495 resets = <&ccu RST_BUS_GPU>;
496496
497497 assigned-clocks = <&ccu CLK_GPU>;
498− assigned-clock-rates = <408000000>;
498+ assigned-clock-rates = <384000000>;
499499 };
500500
501501 gic: interrupt-controller@01c81000 {
arch/arm/boot/dts/sun8i-reference-design-tablet.dtsi+0−7
@@ -50,8 +50,6 @@ · 49 unmodified lines
5050
5151 backlight: backlight {
5252 compatible = "pwm-backlight";
53− pinctrl-names = "default";
54− pinctrl-0 = <&bl_en_pin>;
5553 pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>;
5654 brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>;
5755 default-brightness-level = <8>;
@@ -93,11 +91,6 @@ · 35 unmodified lines
9391 };
9492
9593 &pio {
96− bl_en_pin: bl_en_pin@0 {
97− pins = "PH6";
98− function = "gpio_in";
99− };
100−
10194 mmc0_cd_pin: mmc0_cd_pin@0 {
10295 pins = "PB4";
10396 function = "gpio_in";
arch/arm/configs/omap2plus_defconfig+1−0
@@ -188,6 +188,7 @@ CONFIG_WL12XX=m · 187 unmodified lines
188188 CONFIG_WL18XX=m
189189 CONFIG_WLCORE_SPI=m
190190 CONFIG_WLCORE_SDIO=m
191+CONFIG_INPUT_MOUSEDEV=m
191192 CONFIG_INPUT_JOYDEV=m
192193 CONFIG_INPUT_EVDEV=m
193194 CONFIG_KEYBOARD_ATKBD=m
arch/arm/mach-at91/pm.c+17−1
@@ -289,6 +289,22 @@ static void at91_ddr_standby(void) · 288 unmodified lines
289289 at91_ramc_write(1, AT91_DDRSDRC_LPR, saved_lpr1);
290290 }
291291
292+static void sama5d3_ddr_standby(void)
293+{
294+ u32 lpr0;
295+ u32 saved_lpr0;
296+
297+ saved_lpr0 = at91_ramc_read(0, AT91_DDRSDRC_LPR);
298+ lpr0 = saved_lpr0 & ~AT91_DDRSDRC_LPCB;
299+ lpr0 |= AT91_DDRSDRC_LPCB_POWER_DOWN;
300+
301+ at91_ramc_write(0, AT91_DDRSDRC_LPR, lpr0);
302+
303+ cpu_do_idle();
304+
305+ at91_ramc_write(0, AT91_DDRSDRC_LPR, saved_lpr0);
306+}
307+
292308 /* We manage both DDRAM/SDRAM controllers, we need more than one value to
293309 * remember.
294310 */
@@ -323,7 +339,7 @@ static const struct of_device_id const ramc_ids[] __initconst = { · 28 unmodified lines
323339 { .compatible = "atmel,at91rm9200-sdramc", .data = at91rm9200_standby },
324340 { .compatible = "atmel,at91sam9260-sdramc", .data = at91sam9_sdram_standby },
325341 { .compatible = "atmel,at91sam9g45-ddramc", .data = at91_ddr_standby },
326− { .compatible = "atmel,sama5d3-ddramc", .data = at91_ddr_standby },
342+ { .compatible = "atmel,sama5d3-ddramc", .data = sama5d3_ddr_standby },
327343 { /*sentinel*/ }
328344 };
329345
arch/arm/mach-omap2/Makefile+0−3
@@ -241,6 +241,3 @@ obj-$(CONFIG_MACH_OMAP2_TUSB6010) += usb-tusb6010.o · 240 unmodified lines
241241
242242 onenand-$(CONFIG_MTD_ONENAND_OMAP2) := gpmc-onenand.o
243243 obj-y += $(onenand-m) $(onenand-y)
244−
245−nand-$(CONFIG_MTD_NAND_OMAP2) := gpmc-nand.o
246−obj-y += $(nand-m) $(nand-y)
arch/arm/mach-omap2/gpmc-nand.c+0−154
@@ -1,154 +0,0 @@
1−/*
2− * gpmc-nand.c
3− *
4− * Copyright (C) 2009 Texas Instruments
5− * Vimal Singh <vimalsingh@ti.com>
6− *
7− * This program is free software; you can redistribute it and/or modify
8− * it under the terms of the GNU General Public License version 2 as
9− * published by the Free Software Foundation.
10− */
11−
12−#include <linux/kernel.h>
13−#include <linux/platform_device.h>
14−#include <linux/io.h>
15−#include <linux/omap-gpmc.h>
16−#include <linux/mtd/nand.h>
17−#include <linux/platform_data/mtd-nand-omap2.h>
18−
19−#include <asm/mach/flash.h>
20−
21−#include "soc.h"
22−
23−/* minimum size for IO mapping */
24−#define NAND_IO_SIZE 4
25−
26−static bool gpmc_hwecc_bch_capable(enum omap_ecc ecc_opt)
27−{
28− /* platforms which support all ECC schemes */
29− if (soc_is_am33xx() || soc_is_am43xx() || cpu_is_omap44xx() ||
30− soc_is_omap54xx() || soc_is_dra7xx())
31− return 1;
32−
33− if (ecc_opt == OMAP_ECC_BCH4_CODE_HW_DETECTION_SW ||
34− ecc_opt == OMAP_ECC_BCH8_CODE_HW_DETECTION_SW) {
35− if (cpu_is_omap24xx())
36− return 0;
37− else if (cpu_is_omap3630() && (GET_OMAP_REVISION() == 0))
38− return 0;
39− else
40− return 1;
41− }
42−
43− /* OMAP3xxx do not have ELM engine, so cannot support ECC schemes
44− * which require H/W based ECC error detection */
45− if ((cpu_is_omap34xx() || cpu_is_omap3630()) &&
46− ((ecc_opt == OMAP_ECC_BCH4_CODE_HW) ||
47− (ecc_opt == OMAP_ECC_BCH8_CODE_HW)))
48− return 0;
49−
50− /* legacy platforms support only HAM1 (1-bit Hamming) ECC scheme */
51− if (ecc_opt == OMAP_ECC_HAM1_CODE_HW ||
52− ecc_opt == OMAP_ECC_HAM1_CODE_SW)
53− return 1;
54− else
55− return 0;
56−}
57−
58−/* This function will go away once the device-tree convertion is complete */
59−static void gpmc_set_legacy(struct omap_nand_platform_data *gpmc_nand_data,
60− struct gpmc_settings *s)
61−{
62− /* Enable RD PIN Monitoring Reg */
63− if (gpmc_nand_data->dev_ready) {
64− s->wait_on_read = true;
65− s->wait_on_write = true;
66− }
67−
68− if (gpmc_nand_data->devsize == NAND_BUSWIDTH_16)
69− s->device_width = GPMC_DEVWIDTH_16BIT;
70− else
71− s->device_width = GPMC_DEVWIDTH_8BIT;
72−}
73−
74−int gpmc_nand_init(struct omap_nand_platform_data *gpmc_nand_data,
75− struct gpmc_timings *gpmc_t)
76−{
77− int err = 0;
78− struct gpmc_settings s;
79− struct platform_device *pdev;
80− struct resource gpmc_nand_res[] = {
81− { .flags = IORESOURCE_MEM, },
82− { .flags = IORESOURCE_IRQ, },
83− { .flags = IORESOURCE_IRQ, },
84− };
85−
86− BUG_ON(gpmc_nand_data->cs >= GPMC_CS_NUM);
87−
88− err = gpmc_cs_request(gpmc_nand_data->cs, NAND_IO_SIZE,
89− (unsigned long *)&gpmc_nand_res[0].start);
90− if (err < 0) {
91− pr_err("omap2-gpmc: Cannot request GPMC CS %d, error %d\n",
92− gpmc_nand_data->cs, err);
93− return err;
94− }
95− gpmc_nand_res[0].end = gpmc_nand_res[0].start + NAND_IO_SIZE - 1;
96− gpmc_nand_res[1].start = gpmc_get_client_irq(GPMC_IRQ_FIFOEVENTENABLE);
97− gpmc_nand_res[2].start = gpmc_get_client_irq(GPMC_IRQ_COUNT_EVENT);
98−
99− memset(&s, 0, sizeof(struct gpmc_settings));
100− gpmc_set_legacy(gpmc_nand_data, &s);
101−
102− s.device_nand = true;
103−
104− if (gpmc_t) {
105− err = gpmc_cs_set_timings(gpmc_nand_data->cs, gpmc_t, &s);
106− if (err < 0) {
107− pr_err("omap2-gpmc: Unable to set gpmc timings: %d\n",
108− err);
109− return err;
110− }
111− }
112−
113− err = gpmc_cs_program_settings(gpmc_nand_data->cs, &s);
114− if (err < 0)
115− goto out_free_cs;
116−
117− err = gpmc_configure(GPMC_CONFIG_WP, 0);
118− if (err < 0)
119− goto out_free_cs;
120−
121− if (!gpmc_hwecc_bch_capable(gpmc_nand_data->ecc_opt)) {
122− pr_err("omap2-nand: Unsupported NAND ECC scheme selected\n");
123− err = -EINVAL;
124− goto out_free_cs;
125− }
126−
127−
128− pdev = platform_device_alloc("omap2-nand", gpmc_nand_data->cs);
129− if (pdev) {
130− err = platform_device_add_resources(pdev, gpmc_nand_res,
131− ARRAY_SIZE(gpmc_nand_res));
132− if (!err)
133− pdev->dev.platform_data = gpmc_nand_data;
134− } else {
135− err = -ENOMEM;
136− }
137− if (err)
138− goto out_free_pdev;
139−
140− err = platform_device_add(pdev);
141− if (err) {
142− dev_err(&pdev->dev, "Unable to register NAND device\n");
143− goto out_free_pdev;
144− }
145−
146− return 0;
147−
148−out_free_pdev:
149− platform_device_put(pdev);
150−out_free_cs:
151− gpmc_cs_free(gpmc_nand_data->cs);
152−
153− return err;
154−}
arch/arm/mach-omap2/gpmc-onenand.c+6−4
@@ -367,7 +367,7 @@ static int gpmc_onenand_setup(void __iomem *onenand_base, int *freq_ptr) · 366 unmodified lines
367367 return ret;
368368 }
369369
370−void gpmc_onenand_init(struct omap_onenand_platform_data *_onenand_data)
370+int gpmc_onenand_init(struct omap_onenand_platform_data *_onenand_data)
371371 {
372372 int err;
373373 struct device *dev = &gpmc_onenand_device.dev;
@@ -393,15 +393,17 @@ void gpmc_onenand_init(struct omap_onenand_platform_data *_onenand_data) · 19 unmodified lines
393393 if (err < 0) {
394394 dev_err(dev, "Cannot request GPMC CS %d, error %d\n",
395395 gpmc_onenand_data->cs, err);
396− return;
396+ return err;
397397 }
398398
399399 gpmc_onenand_resource.end = gpmc_onenand_resource.start +
400400 ONENAND_IO_SIZE - 1;
401401
402− if (platform_device_register(&gpmc_onenand_device) < 0) {
402+ err = platform_device_register(&gpmc_onenand_device);
403+ if (err) {
403404 dev_err(dev, "Unable to register OneNAND device\n");
404405 gpmc_cs_free(gpmc_onenand_data->cs);
405− return;
406406 }
407+
408+ return err;
407409 }
arch/arm/mach-omap2/omap-headsmp.S+2−1
@@ -17,6 +17,7 @@ · 16 unmodified lines
1717
1818 #include <linux/linkage.h>
1919 #include <linux/init.h>
20+#include <asm/assembler.h>
2021
2122 #include "omap44xx.h"
2223
@@ -66,7 +67,7 @@ wait_2: ldr r2, =AUX_CORE_BOOT0_PA @ read from AuxCoreBoot0 · 43 unmodified lines
6667 cmp r0, r4
6768 bne wait_2
6869 ldr r12, =API_HYP_ENTRY
69− adr r0, hyp_boot
70+ badr r0, hyp_boot
7071 smc #0
7172 hyp_boot:
7273 b omap_secondary_startup
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c+37−8
@@ -2112,11 +2112,20 @@ static struct omap_hwmod_ocp_if omap3_l4_core__i2c3 = { · 2111 unmodified lines
21122112 };
21132113
21142114 /* L4 CORE -> SR1 interface */
2115+static struct omap_hwmod_addr_space omap3_sr1_addr_space[] = {
2116+ {
2117+ .pa_start = OMAP34XX_SR1_BASE,
2118+ .pa_end = OMAP34XX_SR1_BASE + SZ_1K - 1,
2119+ .flags = ADDR_TYPE_RT,
2120+ },
2121+ { },
2122+};
21152123
21162124 static struct omap_hwmod_ocp_if omap34xx_l4_core__sr1 = {
21172125 .master = &omap3xxx_l4_core_hwmod,
21182126 .slave = &omap34xx_sr1_hwmod,
21192127 .clk = "sr_l4_ick",
2128+ .addr = omap3_sr1_addr_space,
21202129 .user = OCP_USER_MPU,
21212130 };
21222131
@@ -2124,15 +2133,25 @@ static struct omap_hwmod_ocp_if omap36xx_l4_core__sr1 = { · 1 unmodified line
21242133 .master = &omap3xxx_l4_core_hwmod,
21252134 .slave = &omap36xx_sr1_hwmod,
21262135 .clk = "sr_l4_ick",
2136+ .addr = omap3_sr1_addr_space,
21272137 .user = OCP_USER_MPU,
21282138 };
21292139
21302140 /* L4 CORE -> SR1 interface */
2141+static struct omap_hwmod_addr_space omap3_sr2_addr_space[] = {
2142+ {
2143+ .pa_start = OMAP34XX_SR2_BASE,
2144+ .pa_end = OMAP34XX_SR2_BASE + SZ_1K - 1,
2145+ .flags = ADDR_TYPE_RT,
2146+ },
2147+ { },
2148+};
21312149
21322150 static struct omap_hwmod_ocp_if omap34xx_l4_core__sr2 = {
21332151 .master = &omap3xxx_l4_core_hwmod,
21342152 .slave = &omap34xx_sr2_hwmod,
21352153 .clk = "sr_l4_ick",
2154+ .addr = omap3_sr2_addr_space,
21362155 .user = OCP_USER_MPU,
21372156 };
21382157
@@ -2140,6 +2159,7 @@ static struct omap_hwmod_ocp_if omap36xx_l4_core__sr2 = { · 1 unmodified line
21402159 .master = &omap3xxx_l4_core_hwmod,
21412160 .slave = &omap36xx_sr2_hwmod,
21422161 .clk = "sr_l4_ick",
2162+ .addr = omap3_sr2_addr_space,
21432163 .user = OCP_USER_MPU,
21442164 };
21452165
@@ -3111,16 +3131,20 @@ static struct omap_hwmod_ocp_if *omap3xxx_dss_hwmod_ocp_ifs[] __initdata = { · 965 unmodified lines
31113131 * Return: 0 if device named @dev_name is not likely to be accessible,
31123132 * or 1 if it is likely to be accessible.
31133133 */
3114−static int __init omap3xxx_hwmod_is_hs_ip_block_usable(struct device_node *bus,
3115− const char *dev_name)
3134+static bool __init omap3xxx_hwmod_is_hs_ip_block_usable(struct device_node *bus,
3135+ const char *dev_name)
31163136 {
3137+ struct device_node *node;
3138+ bool available;
3139+
31173140 if (!bus)
3118− return (omap_type() == OMAP2_DEVICE_TYPE_GP) ? 1 : 0;
3141+ return omap_type() == OMAP2_DEVICE_TYPE_GP;
31193142
3120− if (of_device_is_available(of_find_node_by_name(bus, dev_name)))
3121− return 1;
3143+ node = of_get_child_by_name(bus, dev_name);
3144+ available = of_device_is_available(node);
3145+ of_node_put(node);
31223146
3123− return 0;
3147+ return available;
31243148 }
31253149
31263150 int __init omap3xxx_hwmod_init(void)
@@ -3189,15 +3213,20 @@ int __init omap3xxx_hwmod_init(void) · 62 unmodified lines
31893213
31903214 if (h_sham && omap3xxx_hwmod_is_hs_ip_block_usable(bus, "sham")) {
31913215 r = omap_hwmod_register_links(h_sham);
3192− if (r < 0)
3216+ if (r < 0) {
3217+ of_node_put(bus);
31933218 return r;
3219+ }
31943220 }
31953221
31963222 if (h_aes && omap3xxx_hwmod_is_hs_ip_block_usable(bus, "aes")) {
31973223 r = omap_hwmod_register_links(h_aes);
3198− if (r < 0)
3224+ if (r < 0) {
3225+ of_node_put(bus);
31993226 return r;
3227+ }
32003228 }
3229+ of_node_put(bus);
32013230
32023231 /*
32033232 * Register hwmod links specific to certain ES levels of a
arch/arm/tools/syscall.tbl+1−0
@@ -411,3 +411,4 @@ · 410 unmodified lines
411411 394 common pkey_mprotect sys_pkey_mprotect
412412 395 common pkey_alloc sys_pkey_alloc
413413 396 common pkey_free sys_pkey_free
414+397 common statx sys_statx
arch/arm64/Kconfig+4−0
@@ -1073,6 +1073,10 @@ config SYSVIPC_COMPAT · 1072 unmodified lines
10731073 def_bool y
10741074 depends on COMPAT && SYSVIPC
10751075
1076+config KEYS_COMPAT
1077+ def_bool y
1078+ depends on COMPAT && KEYS
1079+
10761080 endmenu
10771081
10781082 menu "Power management options"
arch/arm64/boot/dts/broadcom/ns2.dtsi+11−0
@@ -114,6 +114,7 @@ · 113 unmodified lines
114114 pcie0: pcie@20020000 {
115115 compatible = "brcm,iproc-pcie";
116116 reg = <0 0x20020000 0 0x1000>;
117+ dma-coherent;
117118
118119 #interrupt-cells = <1>;
119120 interrupt-map-mask = <0 0 0 0>;
@@ -144,6 +145,7 @@ · 24 unmodified lines
144145 pcie4: pcie@50020000 {
145146 compatible = "brcm,iproc-pcie";
146147 reg = <0 0x50020000 0 0x1000>;
148+ dma-coherent;
147149
148150 #interrupt-cells = <1>;
149151 interrupt-map-mask = <0 0 0 0>;
@@ -174,6 +176,7 @@ · 24 unmodified lines
174176 pcie8: pcie@60c00000 {
175177 compatible = "brcm,iproc-pcie-paxc";
176178 reg = <0 0x60c00000 0 0x1000>;
179+ dma-coherent;
177180 linux,pci-domain = <8>;
178181
179182 bus-range = <0x0 0x1>;
@@ -203,6 +206,7 @@ · 23 unmodified lines
203206 <0x61030000 0x100>;
204207 reg-names = "amac_base", "idm_base", "nicpm_base";
205208 interrupts = <GIC_SPI 341 IRQ_TYPE_LEVEL_HIGH>;
209+ dma-coherent;
206210 phy-handle = <&gphy0>;
207211 phy-mode = "rgmii";
208212 status = "disabled";
@@ -213,6 +217,7 @@ · 4 unmodified lines
213217 reg = <0x612c0000 0x445>; /* PDC FS0 regs */
214218 interrupts = <GIC_SPI 187 IRQ_TYPE_LEVEL_HIGH>;
215219 #mbox-cells = <1>;
220+ dma-coherent;
216221 brcm,rx-status-len = <32>;
217222 brcm,use-bcm-hdr;
218223 };
@@ -222,6 +227,7 @@ · 3 unmodified lines
222227 reg = <0x612e0000 0x445>; /* PDC FS1 regs */
223228 interrupts = <GIC_SPI 189 IRQ_TYPE_LEVEL_HIGH>;
224229 #mbox-cells = <1>;
230+ dma-coherent;
225231 brcm,rx-status-len = <32>;
226232 brcm,use-bcm-hdr;
227233 };
@@ -231,6 +237,7 @@ · 3 unmodified lines
231237 reg = <0x61300000 0x445>; /* PDC FS2 regs */
232238 interrupts = <GIC_SPI 191 IRQ_TYPE_LEVEL_HIGH>;
233239 #mbox-cells = <1>;
240+ dma-coherent;
234241 brcm,rx-status-len = <32>;
235242 brcm,use-bcm-hdr;
236243 };
@@ -240,6 +247,7 @@ · 3 unmodified lines
240247 reg = <0x61320000 0x445>; /* PDC FS3 regs */
241248 interrupts = <GIC_SPI 193 IRQ_TYPE_LEVEL_HIGH>;
242249 #mbox-cells = <1>;
250+ dma-coherent;
243251 brcm,rx-status-len = <32>;
244252 brcm,use-bcm-hdr;
245253 };
@@ -644,6 +652,7 @@ · 398 unmodified lines
644652 sata: ahci@663f2000 {
645653 compatible = "brcm,iproc-ahci", "generic-ahci";
646654 reg = <0x663f2000 0x1000>;
655+ dma-coherent;
647656 reg-names = "ahci";
648657 interrupts = <GIC_SPI 438 IRQ_TYPE_LEVEL_HIGH>;
649658 #address-cells = <1>;
@@ -667,6 +676,7 @@ · 17 unmodified lines
667676 compatible = "brcm,sdhci-iproc-cygnus";
668677 reg = <0x66420000 0x100>;
669678 interrupts = <GIC_SPI 421 IRQ_TYPE_LEVEL_HIGH>;
679+ dma-coherent;
670680 bus-width = <8>;
671681 clocks = <&genpll_sw BCM_NS2_GENPLL_SW_SDIO_CLK>;
672682 status = "disabled";
@@ -676,6 +686,7 @@ · 3 unmodified lines
676686 compatible = "brcm,sdhci-iproc-cygnus";
677687 reg = <0x66430000 0x100>;
678688 interrupts = <GIC_SPI 422 IRQ_TYPE_LEVEL_HIGH>;
689+ dma-coherent;
679690 bus-width = <8>;
680691 clocks = <&genpll_sw BCM_NS2_GENPLL_SW_SDIO_CLK>;
681692 status = "disabled";
arch/arm64/include/asm/cpufeature.h+1−1
@@ -251,7 +251,7 @@ static inline bool system_supports_fpsimd(void) · 250 unmodified lines
251251 static inline bool system_uses_ttbr0_pan(void)
252252 {
253253 return IS_ENABLED(CONFIG_ARM64_SW_TTBR0_PAN) &&
254− !cpus_have_cap(ARM64_HAS_PAN);
254+ !cpus_have_const_cap(ARM64_HAS_PAN);
255255 }
256256
257257 #endif /* __ASSEMBLY__ */
arch/arm64/include/asm/unistd.h+1−1
@@ -44,7 +44,7 @@ · 43 unmodified lines
4444 #define __ARM_NR_compat_cacheflush (__ARM_NR_COMPAT_BASE+2)
4545 #define __ARM_NR_compat_set_tls (__ARM_NR_COMPAT_BASE+5)
4646
47−#define __NR_compat_syscalls 394
47+#define __NR_compat_syscalls 398
4848 #endif
4949
5050 #define __ARCH_WANT_SYS_CLONE
arch/arm64/include/asm/unistd32.h+8−0
@@ -809,6 +809,14 @@ __SYSCALL(__NR_copy_file_range, sys_copy_file_range) · 808 unmodified lines
809809 __SYSCALL(__NR_preadv2, compat_sys_preadv2)
810810 #define __NR_pwritev2 393
811811 __SYSCALL(__NR_pwritev2, compat_sys_pwritev2)
812+#define __NR_pkey_mprotect 394
813+__SYSCALL(__NR_pkey_mprotect, sys_pkey_mprotect)
814+#define __NR_pkey_alloc 395
815+__SYSCALL(__NR_pkey_alloc, sys_pkey_alloc)
816+#define __NR_pkey_free 396
817+__SYSCALL(__NR_pkey_free, sys_pkey_free)
818+#define __NR_statx 397
819+__SYSCALL(__NR_statx, sys_statx)
812820
813821 /*
814822 * Please add new compat syscalls above this comment and update
arch/arm64/kernel/cpuidle.c+1−1
@@ -30,7 +30,7 @@ int arm_cpuidle_init(unsigned int cpu) · 29 unmodified lines
3030 }
3131
3232 /**
33− * cpu_suspend() - function to enter a low-power idle state
33+ * arm_cpuidle_suspend() - function to enter a low-power idle state
3434 * @arg: argument to pass to CPU suspend operations
3535 *
3636 * Return: 0 on success, -EOPNOTSUPP if CPU suspend hook not initialized, CPU
arch/arm64/kernel/kaslr.c+7−3
@@ -131,11 +131,15 @@ u64 __init kaslr_early_init(u64 dt_phys, u64 modulo_offset) · 130 unmodified lines
131131 /*
132132 * The kernel Image should not extend across a 1GB/32MB/512MB alignment
133133 * boundary (for 4KB/16KB/64KB granule kernels, respectively). If this
134− * happens, increase the KASLR offset by the size of the kernel image.
134+ * happens, increase the KASLR offset by the size of the kernel image
135+ * rounded up by SWAPPER_BLOCK_SIZE.
135136 */
136137 if ((((u64)_text + offset + modulo_offset) >> SWAPPER_TABLE_SHIFT) !=
137− (((u64)_end + offset + modulo_offset) >> SWAPPER_TABLE_SHIFT))
138− offset = (offset + (u64)(_end - _text)) & mask;
138+ (((u64)_end + offset + modulo_offset) >> SWAPPER_TABLE_SHIFT)) {
139+ u64 kimg_sz = _end - _text;
140+ offset = (offset + round_up(kimg_sz, SWAPPER_BLOCK_SIZE))
141+ & mask;
142+ }
139143
140144 if (IS_ENABLED(CONFIG_KASAN))
141145 /*
arch/arm64/kernel/probes/kprobes.c+0−6
@@ -372,12 +372,6 @@ int __kprobes kprobe_fault_handler(struct pt_regs *regs, unsigned int fsr) · 371 unmodified lines
372372 return 0;
373373 }
374374
375−int __kprobes kprobe_exceptions_notify(struct notifier_block *self,
376− unsigned long val, void *data)
377−{
378− return NOTIFY_DONE;
379−}
380−
381375 static void __kprobes kprobe_handler(struct pt_regs *regs)
382376 {
383377 struct kprobe *p, *cur_kprobe;
arch/arm64/mm/kasan_init.c+1−1
@@ -162,7 +162,7 @@ void __init kasan_init(void) · 161 unmodified lines
162162 clear_pgds(KASAN_SHADOW_START, KASAN_SHADOW_END);
163163
164164 vmemmap_populate(kimg_shadow_start, kimg_shadow_end,
165− pfn_to_nid(virt_to_pfn(_text)));
165+ pfn_to_nid(virt_to_pfn(lm_alias(_text))));
166166
167167 /*
168168 * vmemmap_populate() has populated the shadow region that covers the
arch/openrisc/include/asm/cmpxchg.h+6−2
@@ -77,7 +77,11 @@ static inline unsigned long __xchg(unsigned long val, volatile void *ptr, · 76 unmodified lines
7777 return val;
7878 }
7979
80−#define xchg(ptr, with) \
81− ((typeof(*(ptr)))__xchg((unsigned long)(with), (ptr), sizeof(*(ptr))))
80+#define xchg(ptr, with) \
81+ ({ \
82+ (__typeof__(*(ptr))) __xchg((unsigned long)(with), \
83+ (ptr), \
84+ sizeof(*(ptr))); \
85+ })
8286
8387 #endif /* __ASM_OPENRISC_CMPXCHG_H */
arch/openrisc/include/asm/uaccess.h+1−1
@@ -211,7 +211,7 @@ do { \ · 210 unmodified lines
211211 case 1: __get_user_asm(x, ptr, retval, "l.lbz"); break; \
212212 case 2: __get_user_asm(x, ptr, retval, "l.lhz"); break; \
213213 case 4: __get_user_asm(x, ptr, retval, "l.lwz"); break; \
214− case 8: __get_user_asm2(x, ptr, retval); \
214+ case 8: __get_user_asm2(x, ptr, retval); break; \
215215 default: (x) = __get_user_bad(); \
216216 } \
217217 } while (0)
arch/openrisc/kernel/or32_ksyms.c+4−0
@@ -30,6 +30,7 @@ · 29 unmodified lines
3030 #include <asm/hardirq.h>
3131 #include <asm/delay.h>
3232 #include <asm/pgalloc.h>
33+#include <asm/pgtable.h>
3334
3435 #define DECLARE_EXPORT(name) extern void name(void); EXPORT_SYMBOL(name)
3536
@@ -42,6 +43,9 @@ DECLARE_EXPORT(__muldi3); · 6 unmodified lines
4243 DECLARE_EXPORT(__ashrdi3);
4344 DECLARE_EXPORT(__ashldi3);
4445 DECLARE_EXPORT(__lshrdi3);
46+DECLARE_EXPORT(__ucmpdi2);
4547
48+EXPORT_SYMBOL(empty_zero_page);
4649 EXPORT_SYMBOL(__copy_tofrom_user);
50+EXPORT_SYMBOL(__clear_user);
4751 EXPORT_SYMBOL(memset);
arch/openrisc/kernel/process.c+1−0
@@ -90,6 +90,7 @@ void arch_cpu_idle(void) · 89 unmodified lines
9090 }
9191
9292 void (*pm_power_off) (void) = machine_power_off;
93+EXPORT_SYMBOL(pm_power_off);
9394
9495 /*
9596 * When a process does an "exec", machine state like FPU and debug
arch/parisc/include/asm/cacheflush.h+2−21
@@ -43,28 +43,9 @@ static inline void flush_kernel_dcache_page(struct page *page) · 42 unmodified lines
4343
4444 #define flush_kernel_dcache_range(start,size) \
4545 flush_kernel_dcache_range_asm((start), (start)+(size));
46−/* vmap range flushes and invalidates. Architecturally, we don't need
47− * the invalidate, because the CPU should refuse to speculate once an
48− * area has been flushed, so invalidate is left empty */
49−static inline void flush_kernel_vmap_range(void *vaddr, int size)
50−{
51− unsigned long start = (unsigned long)vaddr;
52−
53− flush_kernel_dcache_range_asm(start, start + size);
54−}
55−static inline void invalidate_kernel_vmap_range(void *vaddr, int size)
56−{
57− unsigned long start = (unsigned long)vaddr;
58− void *cursor = vaddr;
5946
60− for ( ; cursor < vaddr + size; cursor += PAGE_SIZE) {
61− struct page *page = vmalloc_to_page(cursor);
62−
63− if (test_and_clear_bit(PG_dcache_dirty, &page->flags))
64− flush_kernel_dcache_page(page);
65− }
66− flush_kernel_dcache_range_asm(start, start + size);
67−}
47+void flush_kernel_vmap_range(void *vaddr, int size);
48+void invalidate_kernel_vmap_range(void *vaddr, int size);
6849
6950 #define flush_cache_vmap(start, end) flush_cache_all()
7051 #define flush_cache_vunmap(start, end) flush_cache_all()
arch/parisc/include/asm/uaccess.h+2−1
@@ -32,7 +32,8 @@ · 31 unmodified lines
3232 * that put_user is the same as __put_user, etc.
3333 */
3434
35−#define access_ok(type, uaddr, size) (1)
35+#define access_ok(type, uaddr, size) \
36+ ( (uaddr) == (uaddr) )
3637
3738 #define put_user __put_user
3839 #define get_user __get_user
arch/parisc/include/uapi/asm/unistd.h+2−1
@@ -362,8 +362,9 @@ · 361 unmodified lines
362362 #define __NR_copy_file_range (__NR_Linux + 346)
363363 #define __NR_preadv2 (__NR_Linux + 347)
364364 #define __NR_pwritev2 (__NR_Linux + 348)
365+#define __NR_statx (__NR_Linux + 349)
365366
366−#define __NR_Linux_syscalls (__NR_pwritev2 + 1)
367+#define __NR_Linux_syscalls (__NR_statx + 1)
367368
368369
369370 #define __IGNORE_select /* newselect */
arch/parisc/kernel/cache.c+22−0
@@ -616,3 +616,25 @@ flush_cache_page(struct vm_area_struct *vma, unsigned long vmaddr, unsigned long · 615 unmodified lines
616616 __flush_cache_page(vma, vmaddr, PFN_PHYS(pfn));
617617 }
618618 }
619+
620+void flush_kernel_vmap_range(void *vaddr, int size)
621+{
622+ unsigned long start = (unsigned long)vaddr;
623+
624+ if ((unsigned long)size > parisc_cache_flush_threshold)
625+ flush_data_cache();
626+ else
627+ flush_kernel_dcache_range_asm(start, start + size);
628+}
629+EXPORT_SYMBOL(flush_kernel_vmap_range);
630+
631+void invalidate_kernel_vmap_range(void *vaddr, int size)
632+{
633+ unsigned long start = (unsigned long)vaddr;
634+
635+ if ((unsigned long)size > parisc_cache_flush_threshold)
636+ flush_data_cache();
637+ else
638+ flush_kernel_dcache_range_asm(start, start + size);
639+}
640+EXPORT_SYMBOL(invalidate_kernel_vmap_range);
arch/parisc/kernel/module.c+8−0
@@ -620,6 +620,10 @@ int apply_relocate_add(Elf_Shdr *sechdrs, · 619 unmodified lines
620620 */
621621 *loc = fsel(val, addend);
622622 break;
623+ case R_PARISC_SECREL32:
624+ /* 32-bit section relative address. */
625+ *loc = fsel(val, addend);
626+ break;
623627 case R_PARISC_DPREL21L:
624628 /* left 21 bit of relative address */
625629 val = lrsel(val - dp, addend);
@@ -807,6 +811,10 @@ int apply_relocate_add(Elf_Shdr *sechdrs, · 181 unmodified lines
807811 */
808812 *loc = fsel(val, addend);
809813 break;
814+ case R_PARISC_SECREL32:
815+ /* 32-bit section relative address. */
816+ *loc = fsel(val, addend);
817+ break;
810818 case R_PARISC_FPTR64:
811819 /* 64-bit function address */
812820 if(in_local(me, (void *)(val + addend))) {
arch/parisc/kernel/perf.c+49−45
@@ -39,7 +39,7 @@ · 38 unmodified lines
3939 * the PDC INTRIGUE calls. This is done to eliminate bugs introduced
4040 * in various PDC revisions. The code is much more maintainable
4141 * and reliable this way vs having to debug on every version of PDC
42− * on every box.
42+ * on every box.
4343 */
4444
4545 #include <linux/capability.h>
@@ -195,8 +195,8 @@ static int perf_config(uint32_t *image_ptr); · 149 unmodified lines
195195 static int perf_release(struct inode *inode, struct file *file);
196196 static int perf_open(struct inode *inode, struct file *file);
197197 static ssize_t perf_read(struct file *file, char __user *buf, size_t cnt, loff_t *ppos);
198−static ssize_t perf_write(struct file *file, const char __user *buf, size_t count,
199− loff_t *ppos);
198+static ssize_t perf_write(struct file *file, const char __user *buf,
199+ size_t count, loff_t *ppos);
200200 static long perf_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
201201 static void perf_start_counters(void);
202202 static int perf_stop_counters(uint32_t *raddr);
@@ -222,7 +222,7 @@ extern void perf_intrigue_disable_perf_counters (void); · 19 unmodified lines
222222 /*
223223 * configure:
224224 *
225− * Configure the cpu with a given data image. First turn off the counters,
225+ * Configure the cpu with a given data image. First turn off the counters,
226226 * then download the image, then turn the counters back on.
227227 */
228228 static int perf_config(uint32_t *image_ptr)
@@ -234,7 +234,7 @@ static int perf_config(uint32_t *image_ptr) · 5 unmodified lines
234234 error = perf_stop_counters(raddr);
235235 if (error != 0) {
236236 printk("perf_config: perf_stop_counters = %ld\n", error);
237− return -EINVAL;
237+ return -EINVAL;
238238 }
239239
240240 printk("Preparing to write image\n");
@@ -242,7 +242,7 @@ printk("Preparing to write image\n"); · 1 unmodified line
242242 error = perf_write_image((uint64_t *)image_ptr);
243243 if (error != 0) {
244244 printk("perf_config: DOWNLOAD = %ld\n", error);
245− return -EINVAL;
245+ return -EINVAL;
246246 }
247247
248248 printk("Preparing to start counters\n");
@@ -254,7 +254,7 @@ printk("Preparing to start counters\n"); · 5 unmodified lines
254254 }
255255
256256 /*
257− * Open the device and initialize all of its memory. The device is only
257+ * Open the device and initialize all of its memory. The device is only
258258 * opened once, but can be "queried" by multiple processes that know its
259259 * file descriptor.
260260 */
@@ -298,19 +298,19 @@ static ssize_t perf_read(struct file *file, char __user *buf, size_t cnt, loff_t · 37 unmodified lines
298298 * called on the processor that the download should happen
299299 * on.
300300 */
301−static ssize_t perf_write(struct file *file, const char __user *buf, size_t count,
302− loff_t *ppos)
301+static ssize_t perf_write(struct file *file, const char __user *buf,
302+ size_t count, loff_t *ppos)
303303 {
304304 size_t image_size;
305305 uint32_t image_type;
306306 uint32_t interface_type;
307307 uint32_t test;
308308
309− if (perf_processor_interface == ONYX_INTF)
309+ if (perf_processor_interface == ONYX_INTF)
310310 image_size = PCXU_IMAGE_SIZE;
311− else if (perf_processor_interface == CUDA_INTF)
311+ else if (perf_processor_interface == CUDA_INTF)
312312 image_size = PCXW_IMAGE_SIZE;
313− else
313+ else
314314 return -EFAULT;
315315
316316 if (!capable(CAP_SYS_ADMIN))
@@ -330,22 +330,22 @@ static ssize_t perf_write(struct file *file, const char __user *buf, size_t coun · 13 unmodified lines
330330
331331 /* First check the machine type is correct for
332332 the requested image */
333− if (((perf_processor_interface == CUDA_INTF) &&
334− (interface_type != CUDA_INTF)) ||
335− ((perf_processor_interface == ONYX_INTF) &&
336− (interface_type != ONYX_INTF)))
333+ if (((perf_processor_interface == CUDA_INTF) &&
334+ (interface_type != CUDA_INTF)) ||
335+ ((perf_processor_interface == ONYX_INTF) &&
336+ (interface_type != ONYX_INTF)))
337337 return -EINVAL;
338338
339339 /* Next check to make sure the requested image
340340 is valid */
341− if (((interface_type == CUDA_INTF) &&
341+ if (((interface_type == CUDA_INTF) &&
342342 (test >= MAX_CUDA_IMAGES)) ||
343− ((interface_type == ONYX_INTF) &&
344− (test >= MAX_ONYX_IMAGES)))
343+ ((interface_type == ONYX_INTF) &&
344+ (test >= MAX_ONYX_IMAGES)))
345345 return -EINVAL;
346346
347347 /* Copy the image into the processor */
348− if (interface_type == CUDA_INTF)
348+ if (interface_type == CUDA_INTF)
349349 return perf_config(cuda_images[test]);
350350 else
351351 return perf_config(onyx_images[test]);
@@ -359,7 +359,7 @@ static ssize_t perf_write(struct file *file, const char __user *buf, size_t coun · 7 unmodified lines
359359 static void perf_patch_images(void)
360360 {
361361 #if 0 /* FIXME!! */
362−/*
362+/*
363363 * NOTE: this routine is VERY specific to the current TLB image.
364364 * If the image is changed, this routine might also need to be changed.
365365 */
@@ -367,9 +367,9 @@ static void perf_patch_images(void) · 1 unmodified line
367367 extern void $i_dtlb_miss_2_0();
368368 extern void PA2_0_iva();
369369
370− /*
370+ /*
371371 * We can only use the lower 32-bits, the upper 32-bits should be 0
372− * anyway given this is in the kernel
372+ * anyway given this is in the kernel
373373 */
374374 uint32_t itlb_addr = (uint32_t)&($i_itlb_miss_2_0);
375375 uint32_t dtlb_addr = (uint32_t)&($i_dtlb_miss_2_0);
@@ -377,21 +377,21 @@ static void perf_patch_images(void) · 1 unmodified line
377377
378378 if (perf_processor_interface == ONYX_INTF) {
379379 /* clear last 2 bytes */
380− onyx_images[TLBMISS][15] &= 0xffffff00;
380+ onyx_images[TLBMISS][15] &= 0xffffff00;
381381 /* set 2 bytes */
382382 onyx_images[TLBMISS][15] |= (0x000000ff&((dtlb_addr) >> 24));
383383 onyx_images[TLBMISS][16] = (dtlb_addr << 8)&0xffffff00;
384384 onyx_images[TLBMISS][17] = itlb_addr;
385385
386386 /* clear last 2 bytes */
387− onyx_images[TLBHANDMISS][15] &= 0xffffff00;
387+ onyx_images[TLBHANDMISS][15] &= 0xffffff00;
388388 /* set 2 bytes */
389389 onyx_images[TLBHANDMISS][15] |= (0x000000ff&((dtlb_addr) >> 24));
390390 onyx_images[TLBHANDMISS][16] = (dtlb_addr << 8)&0xffffff00;
391391 onyx_images[TLBHANDMISS][17] = itlb_addr;
392392
393393 /* clear last 2 bytes */
394− onyx_images[BIG_CPI][15] &= 0xffffff00;
394+ onyx_images[BIG_CPI][15] &= 0xffffff00;
395395 /* set 2 bytes */
396396 onyx_images[BIG_CPI][15] |= (0x000000ff&((dtlb_addr) >> 24));
397397 onyx_images[BIG_CPI][16] = (dtlb_addr << 8)&0xffffff00;
@@ -404,24 +404,24 @@ static void perf_patch_images(void) · 6 unmodified lines
404404
405405 } else if (perf_processor_interface == CUDA_INTF) {
406406 /* Cuda interface */
407− cuda_images[TLBMISS][16] =
407+ cuda_images[TLBMISS][16] =
408408 (cuda_images[TLBMISS][16]&0xffff0000) |
409409 ((dtlb_addr >> 8)&0x0000ffff);
410− cuda_images[TLBMISS][17] =
410+ cuda_images[TLBMISS][17] =
411411 ((dtlb_addr << 24)&0xff000000) | ((itlb_addr >> 16)&0x000000ff);
412412 cuda_images[TLBMISS][18] = (itlb_addr << 16)&0xffff0000;
413413
414− cuda_images[TLBHANDMISS][16] =
414+ cuda_images[TLBHANDMISS][16] =
415415 (cuda_images[TLBHANDMISS][16]&0xffff0000) |
416416 ((dtlb_addr >> 8)&0x0000ffff);
417− cuda_images[TLBHANDMISS][17] =
417+ cuda_images[TLBHANDMISS][17] =
418418 ((dtlb_addr << 24)&0xff000000) | ((itlb_addr >> 16)&0x000000ff);
419419 cuda_images[TLBHANDMISS][18] = (itlb_addr << 16)&0xffff0000;
420420
421− cuda_images[BIG_CPI][16] =
421+ cuda_images[BIG_CPI][16] =
422422 (cuda_images[BIG_CPI][16]&0xffff0000) |
423423 ((dtlb_addr >> 8)&0x0000ffff);
424− cuda_images[BIG_CPI][17] =
424+ cuda_images[BIG_CPI][17] =
425425 ((dtlb_addr << 24)&0xff000000) | ((itlb_addr >> 16)&0x000000ff);
426426 cuda_images[BIG_CPI][18] = (itlb_addr << 16)&0xffff0000;
427427 } else {
@@ -433,7 +433,7 @@ static void perf_patch_images(void) · 5 unmodified lines
433433
434434 /*
435435 * ioctl routine
436− * All routines effect the processor that they are executed on. Thus you
436+ * All routines effect the processor that they are executed on. Thus you
437437 * must be running on the processor that you wish to change.
438438 */
439439
@@ -459,7 +459,7 @@ static long perf_ioctl(struct file *file, unsigned int cmd, unsigned long arg) · 19 unmodified lines
459459 }
460460
461461 /* copy out the Counters */
462− if (copy_to_user((void __user *)arg, raddr,
462+ if (copy_to_user((void __user *)arg, raddr,
463463 sizeof (raddr)) != 0) {
464464 error = -EFAULT;
465465 break;
@@ -487,7 +487,7 @@ static const struct file_operations perf_fops = { · 21 unmodified lines
487487 .open = perf_open,
488488 .release = perf_release
489489 };
490−
490+
491491 static struct miscdevice perf_dev = {
492492 MISC_DYNAMIC_MINOR,
493493 PA_PERF_DEV,
@@ -595,7 +595,7 @@ static int perf_stop_counters(uint32_t *raddr) · 101 unmodified lines
595595 /* OR sticky2 (bit 1496) to counter2 bit 32 */
596596 tmp64 |= (userbuf[23] >> 8) & 0x0000000080000000;
597597 raddr[2] = (uint32_t)tmp64;
598−
598+
599599 /* Counter3 is bits 1497 to 1528 */
600600 tmp64 = (userbuf[23] >> 7) & 0x00000000ffffffff;
601601 /* OR sticky3 (bit 1529) to counter3 bit 32 */
@@ -617,7 +617,7 @@ static int perf_stop_counters(uint32_t *raddr) · 15 unmodified lines
617617 userbuf[22] = 0;
618618 userbuf[23] = 0;
619619
620− /*
620+ /*
621621 * Write back the zeroed bytes + the image given
622622 * the read was destructive.
623623 */
@@ -625,13 +625,13 @@ static int perf_stop_counters(uint32_t *raddr) · 1 unmodified line
625625 } else {
626626
627627 /*
628− * Read RDR-15 which contains the counters and sticky bits
628+ * Read RDR-15 which contains the counters and sticky bits
629629 */
630630 if (!perf_rdr_read_ubuf(15, userbuf)) {
631631 return -13;
632632 }
633633
634− /*
634+ /*
635635 * Clear out the counters
636636 */
637637 perf_rdr_clear(15);
@@ -644,7 +644,7 @@ static int perf_stop_counters(uint32_t *raddr) · 6 unmodified lines
644644 raddr[2] = (uint32_t)((userbuf[1] >> 32) & 0x00000000ffffffffUL);
645645 raddr[3] = (uint32_t)(userbuf[1] & 0x00000000ffffffffUL);
646646 }
647−
647+
648648 return 0;
649649 }
650650
@@ -682,7 +682,7 @@ static int perf_rdr_read_ubuf(uint32_t rdr_num, uint64_t *buffer) · 31 unmodified lines
682682 i = tentry->num_words;
683683 while (i--) {
684684 buffer[i] = 0;
685− }
685+ }
686686
687687 /* Check for bits an even number of 64 */
688688 if ((xbits = width & 0x03f) != 0) {
@@ -808,18 +808,22 @@ static int perf_write_image(uint64_t *memaddr) · 119 unmodified lines
808808 }
809809
810810 runway = ioremap_nocache(cpu_device->hpa.start, 4096);
811+ if (!runway) {
812+ pr_err("perf_write_image: ioremap failed!\n");
813+ return -ENOMEM;
814+ }
811815
812816 /* Merge intrigue bits into Runway STATUS 0 */
813817 tmp64 = __raw_readq(runway + RUNWAY_STATUS) & 0xffecfffffffffffful;
814− __raw_writeq(tmp64 | (*memaddr++ & 0x0013000000000000ul),
818+ __raw_writeq(tmp64 | (*memaddr++ & 0x0013000000000000ul),
815819 runway + RUNWAY_STATUS);
816−
820+
817821 /* Write RUNWAY DEBUG registers */
818822 for (i = 0; i < 8; i++) {
819823 __raw_writeq(*memaddr++, runway + RUNWAY_DEBUG);
820824 }
821825
822− return 0;
826+ return 0;
823827 }
824828
825829 /*
@@ -843,7 +847,7 @@ printk("perf_rdr_write\n"); · 17 unmodified lines
843847 perf_rdr_shift_out_U(rdr_num, buffer[i]);
844848 } else {
845849 perf_rdr_shift_out_W(rdr_num, buffer[i]);
846− }
850+ }
847851 }
848852 printk("perf_rdr_write done\n");
849853 }
arch/parisc/kernel/process.c+2−0
@@ -142,6 +142,8 @@ void machine_power_off(void) · 141 unmodified lines
142142
143143 printk(KERN_EMERG "System shut down completed.\n"
144144 "Please power this system off now.");
145+
146+ for (;;);
145147 }
146148
147149 void (*pm_power_off)(void) = machine_power_off;
arch/parisc/kernel/syscall_table.S+1−0
@@ -444,6 +444,7 @@ · 443 unmodified lines
444444 ENTRY_SAME(copy_file_range)
445445 ENTRY_COMP(preadv2)
446446 ENTRY_COMP(pwritev2)
447+ ENTRY_SAME(statx)
447448
448449
449450 .ifne (. - 90b) - (__NR_Linux_syscalls * (91b - 90b))
arch/powerpc/boot/zImage.lds.S+1−0
@@ -68,6 +68,7 @@ SECTIONS · 67 unmodified lines
6868 }
6969
7070 #ifdef CONFIG_PPC64_BOOT_WRAPPER
71+ . = ALIGN(256);
7172 .got :
7273 {
7374 __toc_start = .;
arch/powerpc/crypto/crc32c-vpmsum_glue.c+1−1
@@ -52,7 +52,7 @@ static int crc32c_vpmsum_cra_init(struct crypto_tfm *tfm) · 51 unmodified lines
5252 {
5353 u32 *key = crypto_tfm_ctx(tfm);
5454
55− *key = 0;
55+ *key = ~0;
5656
5757 return 0;
5858 }
arch/powerpc/include/asm/bitops.h+4−0
@@ -51,6 +51,10 @@ · 50 unmodified lines
5151 #define PPC_BIT(bit) (1UL << PPC_BITLSHIFT(bit))
5252 #define PPC_BITMASK(bs, be) ((PPC_BIT(bs) - PPC_BIT(be)) | PPC_BIT(bs))
5353
54+/* Put a PPC bit into a "normal" bit position */
55+#define PPC_BITEXTRACT(bits, ppc_bit, dst_bit) \
56+ ((((bits) >> PPC_BITLSHIFT(ppc_bit)) & 1) << (dst_bit))
57+
5458 #include <asm/barrier.h>
5559
5660 /* Macro for generating the ***_bits() functions */
arch/powerpc/include/asm/mce.h+107−1
@@ -66,6 +66,55 @@ · 65 unmodified lines
6666
6767 #define P8_DSISR_MC_SLB_ERRORS (P7_DSISR_MC_SLB_ERRORS | \
6868 P8_DSISR_MC_ERAT_MULTIHIT_SEC)
69+
70+/*
71+ * Machine Check bits on power9
72+ */
73+#define P9_SRR1_MC_LOADSTORE(srr1) (((srr1) >> PPC_BITLSHIFT(42)) & 1)
74+
75+#define P9_SRR1_MC_IFETCH(srr1) ( \
76+ PPC_BITEXTRACT(srr1, 45, 0) | \
77+ PPC_BITEXTRACT(srr1, 44, 1) | \
78+ PPC_BITEXTRACT(srr1, 43, 2) | \
79+ PPC_BITEXTRACT(srr1, 36, 3) )
80+
81+/* 0 is reserved */
82+#define P9_SRR1_MC_IFETCH_UE 1
83+#define P9_SRR1_MC_IFETCH_SLB_PARITY 2
84+#define P9_SRR1_MC_IFETCH_SLB_MULTIHIT 3
85+#define P9_SRR1_MC_IFETCH_ERAT_MULTIHIT 4
86+#define P9_SRR1_MC_IFETCH_TLB_MULTIHIT 5
87+#define P9_SRR1_MC_IFETCH_UE_TLB_RELOAD 6
88+/* 7 is reserved */
89+#define P9_SRR1_MC_IFETCH_LINK_TIMEOUT 8
90+#define P9_SRR1_MC_IFETCH_LINK_TABLEWALK_TIMEOUT 9
91+/* 10 ? */
92+#define P9_SRR1_MC_IFETCH_RA 11
93+#define P9_SRR1_MC_IFETCH_RA_TABLEWALK 12
94+#define P9_SRR1_MC_IFETCH_RA_ASYNC_STORE 13
95+#define P9_SRR1_MC_IFETCH_LINK_ASYNC_STORE_TIMEOUT 14
96+#define P9_SRR1_MC_IFETCH_RA_TABLEWALK_FOREIGN 15
97+
98+/* DSISR bits for machine check (On Power9) */
99+#define P9_DSISR_MC_UE (PPC_BIT(48))
100+#define P9_DSISR_MC_UE_TABLEWALK (PPC_BIT(49))
101+#define P9_DSISR_MC_LINK_LOAD_TIMEOUT (PPC_BIT(50))
102+#define P9_DSISR_MC_LINK_TABLEWALK_TIMEOUT (PPC_BIT(51))
103+#define P9_DSISR_MC_ERAT_MULTIHIT (PPC_BIT(52))
104+#define P9_DSISR_MC_TLB_MULTIHIT_MFTLB (PPC_BIT(53))
105+#define P9_DSISR_MC_USER_TLBIE (PPC_BIT(54))
106+#define P9_DSISR_MC_SLB_PARITY_MFSLB (PPC_BIT(55))
107+#define P9_DSISR_MC_SLB_MULTIHIT_MFSLB (PPC_BIT(56))
108+#define P9_DSISR_MC_RA_LOAD (PPC_BIT(57))
109+#define P9_DSISR_MC_RA_TABLEWALK (PPC_BIT(58))
110+#define P9_DSISR_MC_RA_TABLEWALK_FOREIGN (PPC_BIT(59))
111+#define P9_DSISR_MC_RA_FOREIGN (PPC_BIT(60))
112+
113+/* SLB error bits */
114+#define P9_DSISR_MC_SLB_ERRORS (P9_DSISR_MC_ERAT_MULTIHIT | \
115+ P9_DSISR_MC_SLB_PARITY_MFSLB | \
116+ P9_DSISR_MC_SLB_MULTIHIT_MFSLB)
117+
69118 enum MCE_Version {
70119 MCE_V1 = 1,
71120 };
@@ -93,6 +142,9 @@ enum MCE_ErrorType { · 21 unmodified lines
93142 MCE_ERROR_TYPE_SLB = 2,
94143 MCE_ERROR_TYPE_ERAT = 3,
95144 MCE_ERROR_TYPE_TLB = 4,
145+ MCE_ERROR_TYPE_USER = 5,
146+ MCE_ERROR_TYPE_RA = 6,
147+ MCE_ERROR_TYPE_LINK = 7,
96148 };
97149
98150 enum MCE_UeErrorType {
@@ -121,6 +173,32 @@ enum MCE_TlbErrorType { · 22 unmodified lines
121173 MCE_TLB_ERROR_MULTIHIT = 2,
122174 };
123175
176+enum MCE_UserErrorType {
177+ MCE_USER_ERROR_INDETERMINATE = 0,
178+ MCE_USER_ERROR_TLBIE = 1,
179+};
180+
181+enum MCE_RaErrorType {
182+ MCE_RA_ERROR_INDETERMINATE = 0,
183+ MCE_RA_ERROR_IFETCH = 1,
184+ MCE_RA_ERROR_PAGE_TABLE_WALK_IFETCH = 2,
185+ MCE_RA_ERROR_PAGE_TABLE_WALK_IFETCH_FOREIGN = 3,
186+ MCE_RA_ERROR_LOAD = 4,
187+ MCE_RA_ERROR_STORE = 5,
188+ MCE_RA_ERROR_PAGE_TABLE_WALK_LOAD_STORE = 6,
189+ MCE_RA_ERROR_PAGE_TABLE_WALK_LOAD_STORE_FOREIGN = 7,
190+ MCE_RA_ERROR_LOAD_STORE_FOREIGN = 8,
191+};
192+
193+enum MCE_LinkErrorType {
194+ MCE_LINK_ERROR_INDETERMINATE = 0,
195+ MCE_LINK_ERROR_IFETCH_TIMEOUT = 1,
196+ MCE_LINK_ERROR_PAGE_TABLE_WALK_IFETCH_TIMEOUT = 2,
197+ MCE_LINK_ERROR_LOAD_TIMEOUT = 3,
198+ MCE_LINK_ERROR_STORE_TIMEOUT = 4,
199+ MCE_LINK_ERROR_PAGE_TABLE_WALK_LOAD_STORE_TIMEOUT = 5,
200+};
201+
124202 struct machine_check_event {
125203 enum MCE_Version version:8; /* 0x00 */
126204 uint8_t in_use; /* 0x01 */
@@ -166,6 +244,30 @@ struct machine_check_event { · 39 unmodified lines
166244 uint64_t effective_address;
167245 uint8_t reserved_2[16];
168246 } tlb_error;
247+
248+ struct {
249+ enum MCE_UserErrorType user_error_type:8;
250+ uint8_t effective_address_provided;
251+ uint8_t reserved_1[6];
252+ uint64_t effective_address;
253+ uint8_t reserved_2[16];
254+ } user_error;
255+
256+ struct {
257+ enum MCE_RaErrorType ra_error_type:8;
258+ uint8_t effective_address_provided;
259+ uint8_t reserved_1[6];
260+ uint64_t effective_address;
261+ uint8_t reserved_2[16];
262+ } ra_error;
263+
264+ struct {
265+ enum MCE_LinkErrorType link_error_type:8;
266+ uint8_t effective_address_provided;
267+ uint8_t reserved_1[6];
268+ uint64_t effective_address;
269+ uint8_t reserved_2[16];
270+ } link_error;
169271 } u;
170272 };
171273
@@ -176,8 +278,12 @@ struct mce_error_info { · 4 unmodified lines
176278 enum MCE_SlbErrorType slb_error_type:8;
177279 enum MCE_EratErrorType erat_error_type:8;
178280 enum MCE_TlbErrorType tlb_error_type:8;
281+ enum MCE_UserErrorType user_error_type:8;
282+ enum MCE_RaErrorType ra_error_type:8;
283+ enum MCE_LinkErrorType link_error_type:8;
179284 } u;
180− uint8_t reserved[2];
285+ enum MCE_Severity severity:8;
286+ enum MCE_Initiator initiator:8;
181287 };
182288
183289 #define MAX_MC_EVT 100
arch/powerpc/include/asm/systbl.h+1−0
@@ -387,3 +387,4 @@ SYSCALL(copy_file_range) · 386 unmodified lines
387387 COMPAT_SYS_SPU(preadv2)
388388 COMPAT_SYS_SPU(pwritev2)
389389 SYSCALL(kexec_file_load)
390+SYSCALL(statx)
arch/powerpc/include/asm/unistd.h+1−1
@@ -12,7 +12,7 @@ · 11 unmodified lines
1212 #include <uapi/asm/unistd.h>
1313
1414
15−#define NR_syscalls 383
15+#define NR_syscalls 384
1616
1717 #define __NR__exit __NR_exit
1818
arch/powerpc/include/uapi/asm/unistd.h+1−0
@@ -393,5 +393,6 @@ · 392 unmodified lines
393393 #define __NR_preadv2 380
394394 #define __NR_pwritev2 381
395395 #define __NR_kexec_file_load 382
396+#define __NR_statx 383
396397
397398 #endif /* _UAPI_ASM_POWERPC_UNISTD_H_ */
arch/powerpc/kernel/cputable.c+3−0
@@ -77,6 +77,7 @@ extern void __flush_tlb_power8(unsigned int action); · 76 unmodified lines
7777 extern void __flush_tlb_power9(unsigned int action);
7878 extern long __machine_check_early_realmode_p7(struct pt_regs *regs);
7979 extern long __machine_check_early_realmode_p8(struct pt_regs *regs);
80+extern long __machine_check_early_realmode_p9(struct pt_regs *regs);
8081 #endif /* CONFIG_PPC64 */
8182 #if defined(CONFIG_E500)
8283 extern void __setup_cpu_e5500(unsigned long offset, struct cpu_spec* spec);
@@ -540,6 +541,7 @@ static struct cpu_spec __initdata cpu_specs[] = { · 457 unmodified lines
540541 .cpu_setup = __setup_cpu_power9,
541542 .cpu_restore = __restore_cpu_power9,
542543 .flush_tlb = __flush_tlb_power9,
544+ .machine_check_early = __machine_check_early_realmode_p9,
543545 .platform = "power9",
544546 },
545547 { /* Power9 */
@@ -559,6 +561,7 @@ static struct cpu_spec __initdata cpu_specs[] = { · 13 unmodified lines
559561 .cpu_setup = __setup_cpu_power9,
560562 .cpu_restore = __restore_cpu_power9,
561563 .flush_tlb = __flush_tlb_power9,
564+ .machine_check_early = __machine_check_early_realmode_p9,
562565 .platform = "power9",
563566 },
564567 { /* Cell Broadband Engine */
arch/powerpc/kernel/idle_book3s.S+17−3
@@ -449,9 +449,23 @@ END_FTR_SECTION_IFSET(CPU_FTR_ARCH_300) · 448 unmodified lines
449449 _GLOBAL(pnv_wakeup_tb_loss)
450450 ld r1,PACAR1(r13)
451451 /*
452− * Before entering any idle state, the NVGPRs are saved in the stack
453− * and they are restored before switching to the process context. Hence
454− * until they are restored, they are free to be used.
452+ * Before entering any idle state, the NVGPRs are saved in the stack.
453+ * If there was a state loss, or PACA_NAPSTATELOST was set, then the
454+ * NVGPRs are restored. If we are here, it is likely that state is lost,
455+ * but not guaranteed -- neither ISA207 nor ISA300 tests to reach
456+ * here are the same as the test to restore NVGPRS:
457+ * PACA_THREAD_IDLE_STATE test for ISA207, PSSCR test for ISA300,
458+ * and SRR1 test for restoring NVGPRs.
459+ *
460+ * We are about to clobber NVGPRs now, so set NAPSTATELOST to
461+ * guarantee they will always be restored. This might be tightened
462+ * with careful reading of specs (particularly for ISA300) but this
463+ * is already a slow wakeup path and it's simpler to be safe.
464+ */
465+ li r0,1
466+ stb r0,PACA_NAPSTATELOST(r13)
467+
468+ /*
455469 *
456470 * Save SRR1 and LR in NVGPRs as they might be clobbered in
457471 * opal_call() (called in CHECK_HMI_INTERRUPT). SRR1 is required
arch/powerpc/kernel/mce.c+86−2
@@ -58,6 +58,15 @@ static void mce_set_error_info(struct machine_check_event *mce, · 57 unmodified lines
5858 case MCE_ERROR_TYPE_TLB:
5959 mce->u.tlb_error.tlb_error_type = mce_err->u.tlb_error_type;
6060 break;
61+ case MCE_ERROR_TYPE_USER:
62+ mce->u.user_error.user_error_type = mce_err->u.user_error_type;
63+ break;
64+ case MCE_ERROR_TYPE_RA:
65+ mce->u.ra_error.ra_error_type = mce_err->u.ra_error_type;
66+ break;
67+ case MCE_ERROR_TYPE_LINK:
68+ mce->u.link_error.link_error_type = mce_err->u.link_error_type;
69+ break;
6170 case MCE_ERROR_TYPE_UNKNOWN:
6271 default:
6372 break;
@@ -90,13 +99,14 @@ void save_mce_event(struct pt_regs *regs, long handled, · 26 unmodified lines
9099 mce->gpr3 = regs->gpr[3];
91100 mce->in_use = 1;
92101
93− mce->initiator = MCE_INITIATOR_CPU;
94102 /* Mark it recovered if we have handled it and MSR(RI=1). */
95103 if (handled && (regs->msr & MSR_RI))
96104 mce->disposition = MCE_DISPOSITION_RECOVERED;
97105 else
98106 mce->disposition = MCE_DISPOSITION_NOT_RECOVERED;
99− mce->severity = MCE_SEV_ERROR_SYNC;
107+
108+ mce->initiator = mce_err->initiator;
109+ mce->severity = mce_err->severity;
100110
101111 /*
102112 * Populate the mce error_type and type-specific error_type.
@@ -115,6 +125,15 @@ void save_mce_event(struct pt_regs *regs, long handled, · 12 unmodified lines
115125 } else if (mce->error_type == MCE_ERROR_TYPE_ERAT) {
116126 mce->u.erat_error.effective_address_provided = true;
117127 mce->u.erat_error.effective_address = addr;
128+ } else if (mce->error_type == MCE_ERROR_TYPE_USER) {
129+ mce->u.user_error.effective_address_provided = true;
130+ mce->u.user_error.effective_address = addr;
131+ } else if (mce->error_type == MCE_ERROR_TYPE_RA) {
132+ mce->u.ra_error.effective_address_provided = true;
133+ mce->u.ra_error.effective_address = addr;
134+ } else if (mce->error_type == MCE_ERROR_TYPE_LINK) {
135+ mce->u.link_error.effective_address_provided = true;
136+ mce->u.link_error.effective_address = addr;
118137 } else if (mce->error_type == MCE_ERROR_TYPE_UE) {
119138 mce->u.ue_error.effective_address_provided = true;
120139 mce->u.ue_error.effective_address = addr;
@@ -239,6 +258,29 @@ void machine_check_print_event_info(struct machine_check_event *evt) · 118 unmodified lines
239258 "Parity",
240259 "Multihit",
241260 };
261+ static const char *mc_user_types[] = {
262+ "Indeterminate",
263+ "tlbie(l) invalid",
264+ };
265+ static const char *mc_ra_types[] = {
266+ "Indeterminate",
267+ "Instruction fetch (bad)",
268+ "Page table walk ifetch (bad)",
269+ "Page table walk ifetch (foreign)",
270+ "Load (bad)",
271+ "Store (bad)",
272+ "Page table walk Load/Store (bad)",
273+ "Page table walk Load/Store (foreign)",
274+ "Load/Store (foreign)",
275+ };
276+ static const char *mc_link_types[] = {
277+ "Indeterminate",
278+ "Instruction fetch (timeout)",
279+ "Page table walk ifetch (timeout)",
280+ "Load (timeout)",
281+ "Store (timeout)",
282+ "Page table walk Load/Store (timeout)",
283+ };
242284
243285 /* Print things out */
244286 if (evt->version != MCE_V1) {
@@ -315,6 +357,36 @@ void machine_check_print_event_info(struct machine_check_event *evt) · 70 unmodified lines
315357 printk("%s Effective address: %016llx\n",
316358 level, evt->u.tlb_error.effective_address);
317359 break;
360+ case MCE_ERROR_TYPE_USER:
361+ subtype = evt->u.user_error.user_error_type <
362+ ARRAY_SIZE(mc_user_types) ?
363+ mc_user_types[evt->u.user_error.user_error_type]
364+ : "Unknown";
365+ printk("%s Error type: User [%s]\n", level, subtype);
366+ if (evt->u.user_error.effective_address_provided)
367+ printk("%s Effective address: %016llx\n",
368+ level, evt->u.user_error.effective_address);
369+ break;
370+ case MCE_ERROR_TYPE_RA:
371+ subtype = evt->u.ra_error.ra_error_type <
372+ ARRAY_SIZE(mc_ra_types) ?
373+ mc_ra_types[evt->u.ra_error.ra_error_type]
374+ : "Unknown";
375+ printk("%s Error type: Real address [%s]\n", level, subtype);
376+ if (evt->u.ra_error.effective_address_provided)
377+ printk("%s Effective address: %016llx\n",
378+ level, evt->u.ra_error.effective_address);
379+ break;
380+ case MCE_ERROR_TYPE_LINK:
381+ subtype = evt->u.link_error.link_error_type <
382+ ARRAY_SIZE(mc_link_types) ?
383+ mc_link_types[evt->u.link_error.link_error_type]
384+ : "Unknown";
385+ printk("%s Error type: Link [%s]\n", level, subtype);
386+ if (evt->u.link_error.effective_address_provided)
387+ printk("%s Effective address: %016llx\n",
388+ level, evt->u.link_error.effective_address);
389+ break;
318390 default:
319391 case MCE_ERROR_TYPE_UNKNOWN:
320392 printk("%s Error type: Unknown\n", level);
@@ -341,6 +413,18 @@ uint64_t get_mce_fault_addr(struct machine_check_event *evt) · 20 unmodified lines
341413 if (evt->u.tlb_error.effective_address_provided)
342414 return evt->u.tlb_error.effective_address;
343415 break;
416+ case MCE_ERROR_TYPE_USER:
417+ if (evt->u.user_error.effective_address_provided)
418+ return evt->u.user_error.effective_address;
419+ break;
420+ case MCE_ERROR_TYPE_RA:
421+ if (evt->u.ra_error.effective_address_provided)
422+ return evt->u.ra_error.effective_address;
423+ break;
424+ case MCE_ERROR_TYPE_LINK:
425+ if (evt->u.link_error.effective_address_provided)
426+ return evt->u.link_error.effective_address;
427+ break;
344428 default:
345429 case MCE_ERROR_TYPE_UNKNOWN:
346430 break;
arch/powerpc/kernel/mce_power.c+237−0
@@ -116,6 +116,51 @@ static void flush_and_reload_slb(void) · 115 unmodified lines
116116 }
117117 #endif
118118
119+static void flush_erat(void)
120+{
121+ asm volatile(PPC_INVALIDATE_ERAT : : :"memory");
122+}
123+
124+#define MCE_FLUSH_SLB 1
125+#define MCE_FLUSH_TLB 2
126+#define MCE_FLUSH_ERAT 3
127+
128+static int mce_flush(int what)
129+{
130+#ifdef CONFIG_PPC_STD_MMU_64
131+ if (what == MCE_FLUSH_SLB) {
132+ flush_and_reload_slb();
133+ return 1;
134+ }
135+#endif
136+ if (what == MCE_FLUSH_ERAT) {
137+ flush_erat();
138+ return 1;
139+ }
140+ if (what == MCE_FLUSH_TLB) {
141+ if (cur_cpu_spec && cur_cpu_spec->flush_tlb) {
142+ cur_cpu_spec->flush_tlb(TLB_INVAL_SCOPE_GLOBAL);
143+ return 1;
144+ }
145+ }
146+
147+ return 0;
148+}
149+
150+static int mce_handle_flush_derrors(uint64_t dsisr, uint64_t slb, uint64_t tlb, uint64_t erat)
151+{
152+ if ((dsisr & slb) && mce_flush(MCE_FLUSH_SLB))
153+ dsisr &= ~slb;
154+ if ((dsisr & erat) && mce_flush(MCE_FLUSH_ERAT))
155+ dsisr &= ~erat;
156+ if ((dsisr & tlb) && mce_flush(MCE_FLUSH_TLB))
157+ dsisr &= ~tlb;
158+ /* Any other errors we don't understand? */
159+ if (dsisr)
160+ return 0;
161+ return 1;
162+}
163+
119164 static long mce_handle_derror(uint64_t dsisr, uint64_t slb_error_bits)
120165 {
121166 long handled = 1;
@@ -281,6 +326,9 @@ long __machine_check_early_realmode_p7(struct pt_regs *regs) · 159 unmodified lines
281326 long handled = 1;
282327 struct mce_error_info mce_error_info = { 0 };
283328
329+ mce_error_info.severity = MCE_SEV_ERROR_SYNC;
330+ mce_error_info.initiator = MCE_INITIATOR_CPU;
331+
284332 srr1 = regs->msr;
285333 nip = regs->nip;
286334
@@ -352,6 +400,9 @@ long __machine_check_early_realmode_p8(struct pt_regs *regs) · 65 unmodified lines
352400 long handled = 1;
353401 struct mce_error_info mce_error_info = { 0 };
354402
403+ mce_error_info.severity = MCE_SEV_ERROR_SYNC;
404+ mce_error_info.initiator = MCE_INITIATOR_CPU;
405+
355406 srr1 = regs->msr;
356407 nip = regs->nip;
357408
@@ -372,3 +423,189 @@ long __machine_check_early_realmode_p8(struct pt_regs *regs) · 14 unmodified lines
372423 save_mce_event(regs, handled, &mce_error_info, nip, addr);
373424 return handled;
374425 }
426+
427+static int mce_handle_derror_p9(struct pt_regs *regs)
428+{
429+ uint64_t dsisr = regs->dsisr;
430+
431+ return mce_handle_flush_derrors(dsisr,
432+ P9_DSISR_MC_SLB_PARITY_MFSLB |
433+ P9_DSISR_MC_SLB_MULTIHIT_MFSLB,
434+
435+ P9_DSISR_MC_TLB_MULTIHIT_MFTLB,
436+
437+ P9_DSISR_MC_ERAT_MULTIHIT);
438+}
439+
440+static int mce_handle_ierror_p9(struct pt_regs *regs)
441+{
442+ uint64_t srr1 = regs->msr;
443+
444+ switch (P9_SRR1_MC_IFETCH(srr1)) {
445+ case P9_SRR1_MC_IFETCH_SLB_PARITY:
446+ case P9_SRR1_MC_IFETCH_SLB_MULTIHIT:
447+ return mce_flush(MCE_FLUSH_SLB);
448+ case P9_SRR1_MC_IFETCH_TLB_MULTIHIT:
449+ return mce_flush(MCE_FLUSH_TLB);
450+ case P9_SRR1_MC_IFETCH_ERAT_MULTIHIT:
451+ return mce_flush(MCE_FLUSH_ERAT);
452+ default:
453+ return 0;
454+ }
455+}
456+
457+static void mce_get_derror_p9(struct pt_regs *regs,
458+ struct mce_error_info *mce_err, uint64_t *addr)
459+{
460+ uint64_t dsisr = regs->dsisr;
461+
462+ mce_err->severity = MCE_SEV_ERROR_SYNC;
463+ mce_err->initiator = MCE_INITIATOR_CPU;
464+
465+ if (dsisr & P9_DSISR_MC_USER_TLBIE)
466+ *addr = regs->nip;
467+ else
468+ *addr = regs->dar;
469+
470+ if (dsisr & P9_DSISR_MC_UE) {
471+ mce_err->error_type = MCE_ERROR_TYPE_UE;
472+ mce_err->u.ue_error_type = MCE_UE_ERROR_LOAD_STORE;
473+ } else if (dsisr & P9_DSISR_MC_UE_TABLEWALK) {
474+ mce_err->error_type = MCE_ERROR_TYPE_UE;
475+ mce_err->u.ue_error_type = MCE_UE_ERROR_PAGE_TABLE_WALK_LOAD_STORE;
476+ } else if (dsisr & P9_DSISR_MC_LINK_LOAD_TIMEOUT) {
477+ mce_err->error_type = MCE_ERROR_TYPE_LINK;
478+ mce_err->u.link_error_type = MCE_LINK_ERROR_LOAD_TIMEOUT;
479+ } else if (dsisr & P9_DSISR_MC_LINK_TABLEWALK_TIMEOUT) {
480+ mce_err->error_type = MCE_ERROR_TYPE_LINK;
481+ mce_err->u.link_error_type = MCE_LINK_ERROR_PAGE_TABLE_WALK_LOAD_STORE_TIMEOUT;
482+ } else if (dsisr & P9_DSISR_MC_ERAT_MULTIHIT) {
483+ mce_err->error_type = MCE_ERROR_TYPE_ERAT;
484+ mce_err->u.erat_error_type = MCE_ERAT_ERROR_MULTIHIT;
485+ } else if (dsisr & P9_DSISR_MC_TLB_MULTIHIT_MFTLB) {
486+ mce_err->error_type = MCE_ERROR_TYPE_TLB;
487+ mce_err->u.tlb_error_type = MCE_TLB_ERROR_MULTIHIT;
488+ } else if (dsisr & P9_DSISR_MC_USER_TLBIE) {
489+ mce_err->error_type = MCE_ERROR_TYPE_USER;
490+ mce_err->u.user_error_type = MCE_USER_ERROR_TLBIE;
491+ } else if (dsisr & P9_DSISR_MC_SLB_PARITY_MFSLB) {
492+ mce_err->error_type = MCE_ERROR_TYPE_SLB;
493+ mce_err->u.slb_error_type = MCE_SLB_ERROR_PARITY;
494+ } else if (dsisr & P9_DSISR_MC_SLB_MULTIHIT_MFSLB) {
495+ mce_err->error_type = MCE_ERROR_TYPE_SLB;
496+ mce_err->u.slb_error_type = MCE_SLB_ERROR_MULTIHIT;
497+ } else if (dsisr & P9_DSISR_MC_RA_LOAD) {
498+ mce_err->error_type = MCE_ERROR_TYPE_RA;
499+ mce_err->u.ra_error_type = MCE_RA_ERROR_LOAD;
500+ } else if (dsisr & P9_DSISR_MC_RA_TABLEWALK) {
501+ mce_err->error_type = MCE_ERROR_TYPE_RA;
502+ mce_err->u.ra_error_type = MCE_RA_ERROR_PAGE_TABLE_WALK_LOAD_STORE;
503+ } else if (dsisr & P9_DSISR_MC_RA_TABLEWALK_FOREIGN) {
504+ mce_err->error_type = MCE_ERROR_TYPE_RA;
505+ mce_err->u.ra_error_type = MCE_RA_ERROR_PAGE_TABLE_WALK_LOAD_STORE_FOREIGN;
506+ } else if (dsisr & P9_DSISR_MC_RA_FOREIGN) {
507+ mce_err->error_type = MCE_ERROR_TYPE_RA;
508+ mce_err->u.ra_error_type = MCE_RA_ERROR_LOAD_STORE_FOREIGN;
509+ }
510+}
511+
512+static void mce_get_ierror_p9(struct pt_regs *regs,
513+ struct mce_error_info *mce_err, uint64_t *addr)
514+{
515+ uint64_t srr1 = regs->msr;
516+
517+ switch (P9_SRR1_MC_IFETCH(srr1)) {
518+ case P9_SRR1_MC_IFETCH_RA_ASYNC_STORE:
519+ case P9_SRR1_MC_IFETCH_LINK_ASYNC_STORE_TIMEOUT:
520+ mce_err->severity = MCE_SEV_FATAL;
521+ break;
522+ default:
523+ mce_err->severity = MCE_SEV_ERROR_SYNC;
524+ break;
525+ }
526+
527+ mce_err->initiator = MCE_INITIATOR_CPU;
528+
529+ *addr = regs->nip;
530+
531+ switch (P9_SRR1_MC_IFETCH(srr1)) {
532+ case P9_SRR1_MC_IFETCH_UE:
533+ mce_err->error_type = MCE_ERROR_TYPE_UE;
534+ mce_err->u.ue_error_type = MCE_UE_ERROR_IFETCH;
535+ break;
536+ case P9_SRR1_MC_IFETCH_SLB_PARITY:
537+ mce_err->error_type = MCE_ERROR_TYPE_SLB;
538+ mce_err->u.slb_error_type = MCE_SLB_ERROR_PARITY;
539+ break;
540+ case P9_SRR1_MC_IFETCH_SLB_MULTIHIT:
541+ mce_err->error_type = MCE_ERROR_TYPE_SLB;
542+ mce_err->u.slb_error_type = MCE_SLB_ERROR_MULTIHIT;
543+ break;
544+ case P9_SRR1_MC_IFETCH_ERAT_MULTIHIT:
545+ mce_err->error_type = MCE_ERROR_TYPE_ERAT;
546+ mce_err->u.erat_error_type = MCE_ERAT_ERROR_MULTIHIT;
547+ break;
548+ case P9_SRR1_MC_IFETCH_TLB_MULTIHIT:
549+ mce_err->error_type = MCE_ERROR_TYPE_TLB;
550+ mce_err->u.tlb_error_type = MCE_TLB_ERROR_MULTIHIT;
551+ break;
552+ case P9_SRR1_MC_IFETCH_UE_TLB_RELOAD:
553+ mce_err->error_type = MCE_ERROR_TYPE_UE;
554+ mce_err->u.ue_error_type = MCE_UE_ERROR_PAGE_TABLE_WALK_IFETCH;
555+ break;
556+ case P9_SRR1_MC_IFETCH_LINK_TIMEOUT:
557+ mce_err->error_type = MCE_ERROR_TYPE_LINK;
558+ mce_err->u.link_error_type = MCE_LINK_ERROR_IFETCH_TIMEOUT;
559+ break;
560+ case P9_SRR1_MC_IFETCH_LINK_TABLEWALK_TIMEOUT:
561+ mce_err->error_type = MCE_ERROR_TYPE_LINK;
562+ mce_err->u.link_error_type = MCE_LINK_ERROR_PAGE_TABLE_WALK_IFETCH_TIMEOUT;
563+ break;
564+ case P9_SRR1_MC_IFETCH_RA:
565+ mce_err->error_type = MCE_ERROR_TYPE_RA;
566+ mce_err->u.ra_error_type = MCE_RA_ERROR_IFETCH;
567+ break;
568+ case P9_SRR1_MC_IFETCH_RA_TABLEWALK:
569+ mce_err->error_type = MCE_ERROR_TYPE_RA;
570+ mce_err->u.ra_error_type = MCE_RA_ERROR_PAGE_TABLE_WALK_IFETCH;
571+ break;
572+ case P9_SRR1_MC_IFETCH_RA_ASYNC_STORE:
573+ mce_err->error_type = MCE_ERROR_TYPE_RA;
574+ mce_err->u.ra_error_type = MCE_RA_ERROR_STORE;
575+ break;
576+ case P9_SRR1_MC_IFETCH_LINK_ASYNC_STORE_TIMEOUT:
577+ mce_err->error_type = MCE_ERROR_TYPE_LINK;
578+ mce_err->u.link_error_type = MCE_LINK_ERROR_STORE_TIMEOUT;
579+ break;
580+ case P9_SRR1_MC_IFETCH_RA_TABLEWALK_FOREIGN:
581+ mce_err->error_type = MCE_ERROR_TYPE_RA;
582+ mce_err->u.ra_error_type = MCE_RA_ERROR_PAGE_TABLE_WALK_IFETCH_FOREIGN;
583+ break;
584+ default:
585+ break;
586+ }
587+}
588+
589+long __machine_check_early_realmode_p9(struct pt_regs *regs)
590+{
591+ uint64_t nip, addr;
592+ long handled;
593+ struct mce_error_info mce_error_info = { 0 };
594+
595+ nip = regs->nip;
596+
597+ if (P9_SRR1_MC_LOADSTORE(regs->msr)) {
598+ handled = mce_handle_derror_p9(regs);
599+ mce_get_derror_p9(regs, &mce_error_info, &addr);
600+ } else {
601+ handled = mce_handle_ierror_p9(regs);
602+ mce_get_ierror_p9(regs, &mce_error_info, &addr);
603+ }
604+
605+ /* Handle UE error. */
606+ if (mce_error_info.error_type == MCE_ERROR_TYPE_UE)
607+ handled = mce_handle_ue_error(regs);
608+
609+ save_mce_event(regs, handled, &mce_error_info, nip, addr);
610+ return handled;
611+}
arch/powerpc/mm/init_64.c+1−2
@@ -397,8 +397,7 @@ static void early_check_vec5(void) · 396 unmodified lines
397397 void __init mmu_early_init_devtree(void)
398398 {
399399 /* Disable radix mode based on kernel command line. */
400− /* We don't yet have the machinery to do radix as a guest. */
401− if (disable_radix || !(mfmsr() & MSR_HV))
400+ if (disable_radix)
402401 cur_cpu_spec->mmu_features &= ~MMU_FTR_TYPE_RADIX;
403402
404403 /*
arch/powerpc/perf/core-book3s.c+2−0
@@ -188,6 +188,8 @@ static inline void perf_get_data_addr(struct pt_regs *regs, u64 *addrp) · 187 unmodified lines
188188 sdsync = POWER7P_MMCRA_SDAR_VALID;
189189 else if (ppmu->flags & PPMU_ALT_SIPR)
190190 sdsync = POWER6_MMCRA_SDSYNC;
191+ else if (ppmu->flags & PPMU_NO_SIAR)
192+ sdsync = MMCRA_SAMPLE_ENABLE;
191193 else
192194 sdsync = MMCRA_SDSYNC;
193195
arch/powerpc/perf/isa207-common.c+36−7
@@ -65,12 +65,41 @@ static bool is_event_valid(u64 event) · 64 unmodified lines
6565 return !(event & ~valid_mask);
6666 }
6767
68−static u64 mmcra_sdar_mode(u64 event)
68+static inline bool is_event_marked(u64 event)
6969 {
70− if (cpu_has_feature(CPU_FTR_ARCH_300) && !cpu_has_feature(CPU_FTR_POWER9_DD1))
71− return p9_SDAR_MODE(event) << MMCRA_SDAR_MODE_SHIFT;
70+ if (event & EVENT_IS_MARKED)
71+ return true;
72+
73+ return false;
74+}
7275
73− return MMCRA_SDAR_MODE_TLB;
76+static void mmcra_sdar_mode(u64 event, unsigned long *mmcra)
77+{
78+ /*
79+ * MMCRA[SDAR_MODE] specifices how the SDAR should be updated in
80+ * continous sampling mode.
81+ *
82+ * Incase of Power8:
83+ * MMCRA[SDAR_MODE] will be programmed as "0b01" for continous sampling
84+ * mode and will be un-changed when setting MMCRA[63] (Marked events).
85+ *
86+ * Incase of Power9:
87+ * Marked event: MMCRA[SDAR_MODE] will be set to 0b00 ('No Updates'),
88+ * or if group already have any marked events.
89+ * Non-Marked events (for DD1):
90+ * MMCRA[SDAR_MODE] will be set to 0b01
91+ * For rest
92+ * MMCRA[SDAR_MODE] will be set from event code.
93+ */
94+ if (cpu_has_feature(CPU_FTR_ARCH_300)) {
95+ if (is_event_marked(event) || (*mmcra & MMCRA_SAMPLE_ENABLE))
96+ *mmcra &= MMCRA_SDAR_MODE_NO_UPDATES;
97+ else if (!cpu_has_feature(CPU_FTR_POWER9_DD1))
98+ *mmcra |= p9_SDAR_MODE(event) << MMCRA_SDAR_MODE_SHIFT;
99+ else if (cpu_has_feature(CPU_FTR_POWER9_DD1))
100+ *mmcra |= MMCRA_SDAR_MODE_TLB;
101+ } else
102+ *mmcra |= MMCRA_SDAR_MODE_TLB;
74103 }
75104
76105 static u64 thresh_cmp_val(u64 value)
@@ -180,7 +209,7 @@ int isa207_get_constraint(u64 event, unsigned long *maskp, unsigned long *valp) · 103 unmodified lines
180209 value |= CNST_L1_QUAL_VAL(cache);
181210 }
182211
183− if (event & EVENT_IS_MARKED) {
212+ if (is_event_marked(event)) {
184213 mask |= CNST_SAMPLE_MASK;
185214 value |= CNST_SAMPLE_VAL(event >> EVENT_SAMPLE_SHIFT);
186215 }
@@ -276,7 +305,7 @@ int isa207_compute_mmcr(u64 event[], int n_ev, · 89 unmodified lines
276305 }
277306
278307 /* In continuous sampling mode, update SDAR on TLB miss */
279− mmcra |= mmcra_sdar_mode(event[i]);
308+ mmcra_sdar_mode(event[i], &mmcra);
280309
281310 if (event[i] & EVENT_IS_L1) {
282311 cache = event[i] >> EVENT_CACHE_SEL_SHIFT;
@@ -285,7 +314,7 @@ int isa207_compute_mmcr(u64 event[], int n_ev, · 2 unmodified lines
285314 mmcr1 |= (cache & 1) << MMCR1_DC_QUAL_SHIFT;
286315 }
287316
288− if (event[i] & EVENT_IS_MARKED) {
317+ if (is_event_marked(event[i])) {
289318 mmcra |= MMCRA_SAMPLE_ENABLE;
290319
291320 val = (event[i] >> EVENT_SAMPLE_SHIFT) & EVENT_SAMPLE_MASK;
arch/powerpc/perf/isa207-common.h+1−0
@@ -246,6 +246,7 @@ · 245 unmodified lines
246246 #define MMCRA_THR_CMP_SHIFT 32
247247 #define MMCRA_SDAR_MODE_SHIFT 42
248248 #define MMCRA_SDAR_MODE_TLB (1ull << MMCRA_SDAR_MODE_SHIFT)
249+#define MMCRA_SDAR_MODE_NO_UPDATES ~(0x3ull << MMCRA_SDAR_MODE_SHIFT)
249250 #define MMCRA_IFM_SHIFT 30
250251
251252 /* MMCR1 Threshold Compare bit constant for power9 */
arch/powerpc/platforms/powernv/opal.c+6−15
@@ -395,7 +395,6 @@ static int opal_recover_mce(struct pt_regs *regs, · 394 unmodified lines
395395 struct machine_check_event *evt)
396396 {
397397 int recovered = 0;
398− uint64_t ea = get_mce_fault_addr(evt);
399398
400399 if (!(regs->msr & MSR_RI)) {
401400 /* If MSR_RI isn't set, we cannot recover */
@@ -404,26 +403,18 @@ static int opal_recover_mce(struct pt_regs *regs, · 2 unmodified lines
404403 } else if (evt->disposition == MCE_DISPOSITION_RECOVERED) {
405404 /* Platform corrected itself */
406405 recovered = 1;
407− } else if (ea && !is_kernel_addr(ea)) {
406+ } else if (evt->severity == MCE_SEV_FATAL) {
407+ /* Fatal machine check */
408+ pr_err("Machine check interrupt is fatal\n");
409+ recovered = 0;
410+ } else if ((evt->severity == MCE_SEV_ERROR_SYNC) &&
411+ (user_mode(regs) && !is_global_init(current))) {
408412 /*
409− * Faulting address is not in kernel text. We should be fine.
410− * We need to find which process uses this address.
411413 * For now, kill the task if we have received exception when
412414 * in userspace.
413415 *
414416 * TODO: Queue up this address for hwpoisioning later.
415417 */
416− if (user_mode(regs) && !is_global_init(current)) {
417− _exception(SIGBUS, regs, BUS_MCEERR_AR, regs->nip);
418− recovered = 1;
419− } else
420− recovered = 0;
421− } else if (user_mode(regs) && !is_global_init(current) &&
422− evt->severity == MCE_SEV_ERROR_SYNC) {
423− /*
424− * If we have received a synchronous error when in userspace
425− * kill the task.
426− */
427418 _exception(SIGBUS, regs, BUS_MCEERR_AR, regs->nip);
428419 recovered = 1;
429420 }
arch/powerpc/platforms/powernv/pci-ioda.c+15−5
@@ -1775,17 +1775,20 @@ static u64 pnv_pci_ioda_dma_get_required_mask(struct pci_dev *pdev) · 1774 unmodified lines
17751775 }
17761776
17771777 static void pnv_ioda_setup_bus_dma(struct pnv_ioda_pe *pe,
1778− struct pci_bus *bus)
1778+ struct pci_bus *bus,
1779+ bool add_to_group)
17791780 {
17801781 struct pci_dev *dev;
17811782
17821783 list_for_each_entry(dev, &bus->devices, bus_list) {
17831784 set_iommu_table_base(&dev->dev, pe->table_group.tables[0]);
17841785 set_dma_offset(&dev->dev, pe->tce_bypass_base);
1785− iommu_add_device(&dev->dev);
1786+ if (add_to_group)
1787+ iommu_add_device(&dev->dev);
17861788
17871789 if ((pe->flags & PNV_IODA_PE_BUS_ALL) && dev->subordinate)
1788− pnv_ioda_setup_bus_dma(pe, dev->subordinate);
1790+ pnv_ioda_setup_bus_dma(pe, dev->subordinate,
1791+ add_to_group);
17891792 }
17901793 }
17911794
@@ -2191,7 +2194,7 @@ found: · 399 unmodified lines
21912194 set_iommu_table_base(&pe->pdev->dev, tbl);
21922195 iommu_add_device(&pe->pdev->dev);
21932196 } else if (pe->flags & (PNV_IODA_PE_BUS | PNV_IODA_PE_BUS_ALL))
2194− pnv_ioda_setup_bus_dma(pe, pe->pbus);
2197+ pnv_ioda_setup_bus_dma(pe, pe->pbus, true);
21952198
21962199 return;
21972200 fail:
@@ -2426,6 +2429,8 @@ static void pnv_ioda2_take_ownership(struct iommu_table_group *table_group) · 228 unmodified lines
24262429
24272430 pnv_pci_ioda2_set_bypass(pe, false);
24282431 pnv_pci_ioda2_unset_window(&pe->table_group, 0);
2432+ if (pe->pbus)
2433+ pnv_ioda_setup_bus_dma(pe, pe->pbus, false);
24292434 pnv_ioda2_table_free(tbl);
24302435 }
24312436
@@ -2435,6 +2440,8 @@ static void pnv_ioda2_release_ownership(struct iommu_table_group *table_group) · 3 unmodified lines
24352440 table_group);
24362441
24372442 pnv_pci_ioda2_setup_default_config(pe);
2443+ if (pe->pbus)
2444+ pnv_ioda_setup_bus_dma(pe, pe->pbus, false);
24382445 }
24392446
24402447 static struct iommu_table_group_ops pnv_pci_ioda2_ops = {
@@ -2624,6 +2631,9 @@ static long pnv_pci_ioda2_table_alloc_pages(int nid, __u64 bus_offset, · 183 unmodified lines
26242631 level_shift = entries_shift + 3;
26252632 level_shift = max_t(unsigned, level_shift, PAGE_SHIFT);
26262633
2634+ if ((level_shift - 3) * levels + page_shift >= 60)
2635+ return -EINVAL;
2636+
26272637 /* Allocate TCE table */
26282638 addr = pnv_pci_ioda2_table_do_alloc_pages(nid, level_shift,
26292639 levels, tce_table_size, &offset, &total_allocated);
@@ -2728,7 +2738,7 @@ static void pnv_pci_ioda2_setup_dma_pe(struct pnv_phb *phb, · 98 unmodified lines
27282738 if (pe->flags & PNV_IODA_PE_DEV)
27292739 iommu_add_device(&pe->pdev->dev);
27302740 else if (pe->flags & (PNV_IODA_PE_BUS | PNV_IODA_PE_BUS_ALL))
2731− pnv_ioda_setup_bus_dma(pe, pe->pbus);
2741+ pnv_ioda_setup_bus_dma(pe, pe->pbus, true);
27322742 }
27332743
27342744 #ifdef CONFIG_PCI_MSI
arch/powerpc/platforms/pseries/lpar.c+3−1
@@ -751,7 +751,9 @@ void __init hpte_init_pseries(void) · 750 unmodified lines
751751 mmu_hash_ops.flush_hash_range = pSeries_lpar_flush_hash_range;
752752 mmu_hash_ops.hpte_clear_all = pseries_hpte_clear_all;
753753 mmu_hash_ops.hugepage_invalidate = pSeries_lpar_hugepage_invalidate;
754− mmu_hash_ops.resize_hpt = pseries_lpar_resize_hpt;
754+
755+ if (firmware_has_feature(FW_FEATURE_HPT_RESIZE))
756+ mmu_hash_ops.resize_hpt = pseries_lpar_resize_hpt;
755757 }
756758
757759 void radix_init_pseries(void)
arch/x86/events/core.c+14−2
@@ -2101,8 +2101,8 @@ static int x86_pmu_event_init(struct perf_event *event) · 2100 unmodified lines
21012101
21022102 static void refresh_pce(void *ignored)
21032103 {
2104− if (current->mm)
2105− load_mm_cr4(current->mm);
2104+ if (current->active_mm)
2105+ load_mm_cr4(current->active_mm);
21062106 }
21072107
21082108 static void x86_pmu_event_mapped(struct perf_event *event)
@@ -2110,6 +2110,18 @@ static void x86_pmu_event_mapped(struct perf_event *event) · 1 unmodified line
21102110 if (!(event->hw.flags & PERF_X86_EVENT_RDPMC_ALLOWED))
21112111 return;
21122112
2113+ /*
2114+ * This function relies on not being called concurrently in two
2115+ * tasks in the same mm. Otherwise one task could observe
2116+ * perf_rdpmc_allowed > 1 and return all the way back to
2117+ * userspace with CR4.PCE clear while another task is still
2118+ * doing on_each_cpu_mask() to propagate CR4.PCE.
2119+ *
2120+ * For now, this can't happen because all callers hold mmap_sem
2121+ * for write. If this changes, we'll need a different solution.
2122+ */
2123+ lockdep_assert_held_exclusive(&current->mm->mmap_sem);
2124+
21132125 if (atomic_inc_return(&current->mm->context.perf_rdpmc_allowed) == 1)
21142126 on_each_cpu_mask(mm_cpumask(current->mm), refresh_pce, NULL, 1);
21152127 }
arch/x86/include/asm/pgtable-3level.h+0−3
@@ -121,12 +121,9 @@ static inline void native_pmd_clear(pmd_t *pmd) · 120 unmodified lines
121121 *(tmp + 1) = 0;
122122 }
123123
124−#if !defined(CONFIG_SMP) || (defined(CONFIG_HIGHMEM64G) && \
125− defined(CONFIG_PARAVIRT))
126124 static inline void native_pud_clear(pud_t *pudp)
127125 {
128126 }
129−#endif
130127
131128 static inline void pud_clear(pud_t *pudp)
132129 {
arch/x86/include/asm/pgtable.h+1−1
@@ -62,7 +62,7 @@ extern struct mm_struct *pgd_page_get_mm(struct page *page); · 61 unmodified lines
6262 # define set_pud(pudp, pud) native_set_pud(pudp, pud)
6363 #endif
6464
65−#ifndef __PAGETABLE_PMD_FOLDED
65+#ifndef __PAGETABLE_PUD_FOLDED
6666 #define pud_clear(pud) native_pud_clear(pud)
6767 #endif
6868
arch/x86/include/asm/pmem.h+31−11
@@ -55,7 +55,8 @@ static inline int arch_memcpy_from_pmem(void *dst, const void *src, size_t n) · 54 unmodified lines
5555 * @size: number of bytes to write back
5656 *
5757 * Write back a cache range using the CLWB (cache line write back)
58− * instruction.
58+ * instruction. Note that @size is internally rounded up to be cache
59+ * line size aligned.
5960 */
6061 static inline void arch_wb_cache_pmem(void *addr, size_t size)
6162 {
@@ -69,15 +70,6 @@ static inline void arch_wb_cache_pmem(void *addr, size_t size) · 7 unmodified lines
6970 clwb(p);
7071 }
7172
72−/*
73− * copy_from_iter_nocache() on x86 only uses non-temporal stores for iovec
74− * iterators, so for other types (bvec & kvec) we must do a cache write-back.
75− */
76−static inline bool __iter_needs_pmem_wb(struct iov_iter *i)
77−{
78− return iter_is_iovec(i) == false;
79−}
80−
8173 /**
8274 * arch_copy_from_iter_pmem - copy data from an iterator to PMEM
8375 * @addr: PMEM destination address
@@ -94,7 +86,35 @@ static inline size_t arch_copy_from_iter_pmem(void *addr, size_t bytes, · 10 unmodified lines
9486 /* TODO: skip the write-back by always using non-temporal stores */
9587 len = copy_from_iter_nocache(addr, bytes, i);
9688
97− if (__iter_needs_pmem_wb(i))
89+ /*
90+ * In the iovec case on x86_64 copy_from_iter_nocache() uses
91+ * non-temporal stores for the bulk of the transfer, but we need
92+ * to manually flush if the transfer is unaligned. A cached
93+ * memory copy is used when destination or size is not naturally
94+ * aligned. That is:
95+ * - Require 8-byte alignment when size is 8 bytes or larger.
96+ * - Require 4-byte alignment when size is 4 bytes.
97+ *
98+ * In the non-iovec case the entire destination needs to be
99+ * flushed.
100+ */
101+ if (iter_is_iovec(i)) {
102+ unsigned long flushed, dest = (unsigned long) addr;
103+
104+ if (bytes < 8) {
105+ if (!IS_ALIGNED(dest, 4) || (bytes != 4))
106+ arch_wb_cache_pmem(addr, 1);
107+ } else {
108+ if (!IS_ALIGNED(dest, 8)) {
109+ dest = ALIGN(dest, boot_cpu_data.x86_clflush_size);
110+ arch_wb_cache_pmem(addr, 1);
111+ }
112+
113+ flushed = dest - (unsigned long) addr;
114+ if (bytes > flushed && !IS_ALIGNED(bytes - flushed, 8))
115+ arch_wb_cache_pmem(addr + bytes - 1, 1);
116+ }
117+ } else
98118 arch_wb_cache_pmem(addr, bytes);
99119
100120 return len;
arch/x86/kernel/acpi/boot.c+7−2
@@ -179,10 +179,15 @@ static int acpi_register_lapic(int id, u32 acpiid, u8 enabled) · 178 unmodified lines
179179 return -EINVAL;
180180 }
181181
182+ if (!enabled) {
183+ ++disabled_cpus;
184+ return -EINVAL;
185+ }
186+
182187 if (boot_cpu_physical_apicid != -1U)
183188 ver = boot_cpu_apic_version;
184189
185− cpu = __generic_processor_info(id, ver, enabled);
190+ cpu = generic_processor_info(id, ver);
186191 if (cpu >= 0)
187192 early_per_cpu(x86_cpu_to_acpiid, cpu) = acpiid;
188193
@@ -710,7 +715,7 @@ static void __init acpi_set_irq_model_ioapic(void) · 521 unmodified lines
710715 #ifdef CONFIG_ACPI_HOTPLUG_CPU
711716 #include <acpi/processor.h>
712717
713−int acpi_map_cpu2node(acpi_handle handle, int cpu, int physid)
718+static int acpi_map_cpu2node(acpi_handle handle, int cpu, int physid)
714719 {
715720 #ifdef CONFIG_ACPI_NUMA
716721 int nid;
arch/x86/kernel/apic/apic.c+7−19
@@ -2063,7 +2063,7 @@ static int allocate_logical_cpuid(int apicid) · 2062 unmodified lines
20632063 return nr_logical_cpuids++;
20642064 }
20652065
2066−int __generic_processor_info(int apicid, int version, bool enabled)
2066+int generic_processor_info(int apicid, int version)
20672067 {
20682068 int cpu, max = nr_cpu_ids;
20692069 bool boot_cpu_detected = physid_isset(boot_cpu_physical_apicid,
@@ -2121,11 +2121,9 @@ int __generic_processor_info(int apicid, int version, bool enabled) · 51 unmodified lines
21212121 if (num_processors >= nr_cpu_ids) {
21222122 int thiscpu = max + disabled_cpus;
21232123
2124− if (enabled) {
2125− pr_warning("APIC: NR_CPUS/possible_cpus limit of %i "
2126− "reached. Processor %d/0x%x ignored.\n",
2127− max, thiscpu, apicid);
2128− }
2124+ pr_warning("APIC: NR_CPUS/possible_cpus limit of %i "
2125+ "reached. Processor %d/0x%x ignored.\n",
2126+ max, thiscpu, apicid);
21292127
21302128 disabled_cpus++;
21312129 return -EINVAL;
@@ -2177,23 +2175,13 @@ int __generic_processor_info(int apicid, int version, bool enabled) · 45 unmodified lines
21772175 apic->x86_32_early_logical_apicid(cpu);
21782176 #endif
21792177 set_cpu_possible(cpu, true);
2180−
2181− if (enabled) {
2182− num_processors++;
2183− physid_set(apicid, phys_cpu_present_map);
2184− set_cpu_present(cpu, true);
2185− } else {
2186− disabled_cpus++;
2187− }
2178+ physid_set(apicid, phys_cpu_present_map);
2179+ set_cpu_present(cpu, true);
2180+ num_processors++;
21882181
21892182 return cpu;
21902183 }
21912184
2192−int generic_processor_info(int apicid, int version)
2193−{
2194− return __generic_processor_info(apicid, version, true);
2195−}
2196−
21972185 int hard_smp_processor_id(void)
21982186 {
21992187 return read_apic_id();
arch/x86/kernel/cpu/intel_rdt_rdtgroup.c+1−1
@@ -727,7 +727,7 @@ void rdtgroup_kn_unlock(struct kernfs_node *kn) · 726 unmodified lines
727727 if (atomic_dec_and_test(&rdtgrp->waitcount) &&
728728 (rdtgrp->flags & RDT_DELETED)) {
729729 kernfs_unbreak_active_protection(kn);
730− kernfs_put(kn);
730+ kernfs_put(rdtgrp->kn);
731731 kfree(rdtgrp);
732732 } else {
733733 kernfs_unbreak_active_protection(kn);
arch/x86/kernel/head64.c+1−0
@@ -4,6 +4,7 @@ · 3 unmodified lines
44 * Copyright (C) 2000 Andrea Arcangeli <andrea@suse.de> SuSE
55 */
66
7+#define DISABLE_BRANCH_PROFILING
78 #include <linux/init.h>
89 #include <linux/linkage.h>
910 #include <linux/types.h>
arch/x86/kernel/nmi.c+2−4
@@ -166,11 +166,9 @@ int __register_nmi_handler(unsigned int type, struct nmiaction *action) · 165 unmodified lines
166166 spin_lock_irqsave(&desc->lock, flags);
167167
168168 /*
169− * most handlers of type NMI_UNKNOWN never return because
170− * they just assume the NMI is theirs. Just a sanity check
171− * to manage expectations
169+ * Indicate if there are multiple registrations on the
170+ * internal NMI handler call chains (SERR and IO_CHECK).
172171 */
173− WARN_ON_ONCE(type == NMI_UNKNOWN && !list_empty(&desc->head));
174172 WARN_ON_ONCE(type == NMI_SERR && !list_empty(&desc->head));
175173 WARN_ON_ONCE(type == NMI_IO_CHECK && !list_empty(&desc->head));
176174
arch/x86/kernel/tsc.c+2−0
@@ -1333,6 +1333,8 @@ static int __init init_tsc_clocksource(void) · 1332 unmodified lines
13331333 * the refined calibration and directly register it as a clocksource.
13341334 */
13351335 if (boot_cpu_has(X86_FEATURE_TSC_KNOWN_FREQ)) {
1336+ if (boot_cpu_has(X86_FEATURE_ART))
1337+ art_related_clocksource = &clocksource_tsc;
13361338 clocksource_register_khz(&clocksource_tsc, tsc_khz);
13371339 return 0;
13381340 }
arch/x86/kernel/unwind_frame.c+30−6
@@ -82,19 +82,43 @@ static size_t regs_size(struct pt_regs *regs) · 81 unmodified lines
8282 return sizeof(*regs);
8383 }
8484
85+#ifdef CONFIG_X86_32
86+#define GCC_REALIGN_WORDS 3
87+#else
88+#define GCC_REALIGN_WORDS 1
89+#endif
90+
8591 static bool is_last_task_frame(struct unwind_state *state)
8692 {
87− unsigned long bp = (unsigned long)state->bp;
88− unsigned long regs = (unsigned long)task_pt_regs(state->task);
93+ unsigned long *last_bp = (unsigned long *)task_pt_regs(state->task) - 2;
94+ unsigned long *aligned_bp = last_bp - GCC_REALIGN_WORDS;
8995
9096 /*
9197 * We have to check for the last task frame at two different locations
9298 * because gcc can occasionally decide to realign the stack pointer and
93− * change the offset of the stack frame by a word in the prologue of a
94− * function called by head/entry code.
99+ * change the offset of the stack frame in the prologue of a function
100+ * called by head/entry code. Examples:
101+ *
102+ * <start_secondary>:
103+ * push %edi
104+ * lea 0x8(%esp),%edi
105+ * and $0xfffffff8,%esp
106+ * pushl -0x4(%edi)
107+ * push %ebp
108+ * mov %esp,%ebp
109+ *
110+ * <x86_64_start_kernel>:
111+ * lea 0x8(%rsp),%r10
112+ * and $0xfffffffffffffff0,%rsp
113+ * pushq -0x8(%r10)
114+ * push %rbp
115+ * mov %rsp,%rbp
116+ *
117+ * Note that after aligning the stack, it pushes a duplicate copy of
118+ * the return address before pushing the frame pointer.
95119 */
96− return bp == regs - FRAME_HEADER_SIZE ||
97− bp == regs - FRAME_HEADER_SIZE - sizeof(long);
120+ return (state->bp == last_bp ||
121+ (state->bp == aligned_bp && *(aligned_bp+1) == *(last_bp+1)));
98122 }
99123
100124 /*
arch/x86/mm/kasan_init_64.c+1−0
@@ -1,3 +1,4 @@
1+#define DISABLE_BRANCH_PROFILING
12 #define pr_fmt(fmt) "kasan: " fmt
23 #include <linux/bootmem.h>
34 #include <linux/kasan.h>
arch/x86/mm/mpx.c+1−1
@@ -590,7 +590,7 @@ static unsigned long mpx_bd_entry_to_bt_addr(struct mm_struct *mm, · 589 unmodified lines
590590 * we might run off the end of the bounds table if we are on
591591 * a 64-bit kernel and try to get 8 bytes.
592592 */
593−int get_user_bd_entry(struct mm_struct *mm, unsigned long *bd_entry_ret,
593+static int get_user_bd_entry(struct mm_struct *mm, unsigned long *bd_entry_ret,
594594 long __user *bd_entry_ptr)
595595 {
596596 u32 bd_entry_32;
arch/x86/platform/intel-mid/device_libs/Makefile+1−0
@@ -26,5 +26,6 @@ obj-$(subst m,y,$(CONFIG_GPIO_PCA953X)) += platform_pcal9555a.o · 25 unmodified lines
2626 obj-$(subst m,y,$(CONFIG_GPIO_PCA953X)) += platform_tca6416.o
2727 # MISC Devices
2828 obj-$(subst m,y,$(CONFIG_KEYBOARD_GPIO)) += platform_gpio_keys.o
29+obj-$(subst m,y,$(CONFIG_INTEL_MID_POWER_BUTTON)) += platform_mrfld_power_btn.o
2930 obj-$(subst m,y,$(CONFIG_RTC_DRV_CMOS)) += platform_mrfld_rtc.o
3031 obj-$(subst m,y,$(CONFIG_INTEL_MID_WATCHDOG)) += platform_mrfld_wdt.o
arch/x86/platform/intel-mid/device_libs/platform_mrfld_power_btn.c+82−0
@@ -0,0 +1,82 @@
1+/*
2+ * Intel Merrifield power button support
3+ *
4+ * (C) Copyright 2017 Intel Corporation
5+ *
6+ * Author: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
7+ *
8+ * This program is free software; you can redistribute it and/or
9+ * modify it under the terms of the GNU General Public License
10+ * as published by the Free Software Foundation; version 2
11+ * of the License.
12+ */
13+
14+#include <linux/init.h>
15+#include <linux/ioport.h>
16+#include <linux/platform_device.h>
17+#include <linux/sfi.h>
18+
19+#include <asm/intel-mid.h>
20+#include <asm/intel_scu_ipc.h>
21+
22+static struct resource mrfld_power_btn_resources[] = {
23+ {
24+ .flags = IORESOURCE_IRQ,
25+ },
26+};
27+
28+static struct platform_device mrfld_power_btn_dev = {
29+ .name = "msic_power_btn",
30+ .id = PLATFORM_DEVID_NONE,
31+ .num_resources = ARRAY_SIZE(mrfld_power_btn_resources),
32+ .resource = mrfld_power_btn_resources,
33+};
34+
35+static int mrfld_power_btn_scu_status_change(struct notifier_block *nb,
36+ unsigned long code, void *data)
37+{
38+ if (code == SCU_DOWN) {
39+ platform_device_unregister(&mrfld_power_btn_dev);
40+ return 0;
41+ }
42+
43+ return platform_device_register(&mrfld_power_btn_dev);
44+}
45+
46+static struct notifier_block mrfld_power_btn_scu_notifier = {
47+ .notifier_call = mrfld_power_btn_scu_status_change,
48+};
49+
50+static int __init register_mrfld_power_btn(void)
51+{
52+ if (intel_mid_identify_cpu() != INTEL_MID_CPU_CHIP_TANGIER)
53+ return -ENODEV;
54+
55+ /*
56+ * We need to be sure that the SCU IPC is ready before
57+ * PMIC power button device can be registered:
58+ */
59+ intel_scu_notifier_add(&mrfld_power_btn_scu_notifier);
60+
61+ return 0;
62+}
63+arch_initcall(register_mrfld_power_btn);
64+
65+static void __init *mrfld_power_btn_platform_data(void *info)
66+{
67+ struct resource *res = mrfld_power_btn_resources;
68+ struct sfi_device_table_entry *pentry = info;
69+
70+ res->start = res->end = pentry->irq;
71+ return NULL;
72+}
73+
74+static const struct devs_id mrfld_power_btn_dev_id __initconst = {
75+ .name = "bcove_power_btn",
76+ .type = SFI_DEV_TYPE_IPC,
77+ .delay = 1,
78+ .msic = 1,
79+ .get_platform_data = &mrfld_power_btn_platform_data,
80+};
81+
82+sfi_device(mrfld_power_btn_dev_id);
arch/x86/platform/intel-mid/device_libs/platform_mrfld_wdt.c+1−1
@@ -19,7 +19,7 @@ · 18 unmodified lines
1919 #include <asm/intel_scu_ipc.h>
2020 #include <asm/io_apic.h>
2121
22−#define TANGIER_EXT_TIMER0_MSI 15
22+#define TANGIER_EXT_TIMER0_MSI 12
2323
2424 static struct platform_device wdt_dev = {
2525 .name = "intel_mid_wdt",
arch/x86/platform/intel-mid/mfld.c+4−11
@@ -17,16 +17,6 @@ · 16 unmodified lines
1717
1818 #include "intel_mid_weak_decls.h"
1919
20−static void penwell_arch_setup(void);
21−/* penwell arch ops */
22−static struct intel_mid_ops penwell_ops = {
23− .arch_setup = penwell_arch_setup,
24−};
25−
26−static void mfld_power_off(void)
27−{
28−}
29−
3020 static unsigned long __init mfld_calibrate_tsc(void)
3121 {
3222 unsigned long fast_calibrate;
@@ -63,9 +53,12 @@ static unsigned long __init mfld_calibrate_tsc(void) · 30 unmodified lines
6353 static void __init penwell_arch_setup(void)
6454 {
6555 x86_platform.calibrate_tsc = mfld_calibrate_tsc;
66− pm_power_off = mfld_power_off;
6756 }
6857
58+static struct intel_mid_ops penwell_ops = {
59+ .arch_setup = penwell_arch_setup,
60+};
61+
6962 void *get_penwell_ops(void)
7063 {
7164 return &penwell_ops;
block/bio.c+9−3
@@ -376,10 +376,14 @@ static void punt_bios_to_rescuer(struct bio_set *bs) · 375 unmodified lines
376376 bio_list_init(&punt);
377377 bio_list_init(&nopunt);
378378
379− while ((bio = bio_list_pop(current->bio_list)))
379+ while ((bio = bio_list_pop(&current->bio_list[0])))
380380 bio_list_add(bio->bi_pool == bs ? &punt : &nopunt, bio);
381+ current->bio_list[0] = nopunt;
381382
382− *current->bio_list = nopunt;
383+ bio_list_init(&nopunt);
384+ while ((bio = bio_list_pop(&current->bio_list[1])))
385+ bio_list_add(bio->bi_pool == bs ? &punt : &nopunt, bio);
386+ current->bio_list[1] = nopunt;
383387
384388 spin_lock(&bs->rescue_lock);
385389 bio_list_merge(&bs->rescue_list, &punt);
@@ -466,7 +470,9 @@ struct bio *bio_alloc_bioset(gfp_t gfp_mask, int nr_iovecs, struct bio_set *bs) · 80 unmodified lines
466470 * we retry with the original gfp_flags.
467471 */
468472
469− if (current->bio_list && !bio_list_empty(current->bio_list))
473+ if (current->bio_list &&
474+ (!bio_list_empty(&current->bio_list[0]) ||
475+ !bio_list_empty(&current->bio_list[1])))
470476 gfp_mask &= ~__GFP_DIRECT_RECLAIM;
471477
472478 p = mempool_alloc(bs->bio_pool, gfp_mask);
block/blk-core.c+18−12
@@ -1973,7 +1973,14 @@ end_io: · 1972 unmodified lines
19731973 */
19741974 blk_qc_t generic_make_request(struct bio *bio)
19751975 {
1976− struct bio_list bio_list_on_stack;
1976+ /*
1977+ * bio_list_on_stack[0] contains bios submitted by the current
1978+ * make_request_fn.
1979+ * bio_list_on_stack[1] contains bios that were submitted before
1980+ * the current make_request_fn, but that haven't been processed
1981+ * yet.
1982+ */
1983+ struct bio_list bio_list_on_stack[2];
19771984 blk_qc_t ret = BLK_QC_T_NONE;
19781985
19791986 if (!generic_make_request_checks(bio))
@@ -1990,7 +1997,7 @@ blk_qc_t generic_make_request(struct bio *bio) · 10 unmodified lines
19901997 * should be added at the tail
19911998 */
19921999 if (current->bio_list) {
1993− bio_list_add(current->bio_list, bio);
2000+ bio_list_add(&current->bio_list[0], bio);
19942001 goto out;
19952002 }
19962003
@@ -2009,18 +2016,17 @@ blk_qc_t generic_make_request(struct bio *bio) · 12 unmodified lines
20092016 * bio_list, and call into ->make_request() again.
20102017 */
20112018 BUG_ON(bio->bi_next);
2012− bio_list_init(&bio_list_on_stack);
2013− current->bio_list = &bio_list_on_stack;
2019+ bio_list_init(&bio_list_on_stack[0]);
2020+ current->bio_list = bio_list_on_stack;
20142021 do {
20152022 struct request_queue *q = bdev_get_queue(bio->bi_bdev);
20162023
20172024 if (likely(blk_queue_enter(q, false) == 0)) {
2018− struct bio_list hold;
20192025 struct bio_list lower, same;
20202026
20212027 /* Create a fresh bio_list for all subordinate requests */
2022− hold = bio_list_on_stack;
2023− bio_list_init(&bio_list_on_stack);
2028+ bio_list_on_stack[1] = bio_list_on_stack[0];
2029+ bio_list_init(&bio_list_on_stack[0]);
20242030 ret = q->make_request_fn(q, bio);
20252031
20262032 blk_queue_exit(q);
@@ -2030,19 +2036,19 @@ blk_qc_t generic_make_request(struct bio *bio) · 3 unmodified lines
20302036 */
20312037 bio_list_init(&lower);
20322038 bio_list_init(&same);
2033− while ((bio = bio_list_pop(&bio_list_on_stack)) != NULL)
2039+ while ((bio = bio_list_pop(&bio_list_on_stack[0])) != NULL)
20342040 if (q == bdev_get_queue(bio->bi_bdev))
20352041 bio_list_add(&same, bio);
20362042 else
20372043 bio_list_add(&lower, bio);
20382044 /* now assemble so we handle the lowest level first */
2039− bio_list_merge(&bio_list_on_stack, &lower);
2040− bio_list_merge(&bio_list_on_stack, &same);
2041− bio_list_merge(&bio_list_on_stack, &hold);
2045+ bio_list_merge(&bio_list_on_stack[0], &lower);
2046+ bio_list_merge(&bio_list_on_stack[0], &same);
2047+ bio_list_merge(&bio_list_on_stack[0], &bio_list_on_stack[1]);
20422048 } else {
20432049 bio_io_error(bio);
20442050 }
2045− bio = bio_list_pop(current->bio_list);
2051+ bio = bio_list_pop(&bio_list_on_stack[0]);
20462052 } while (bio);
20472053 current->bio_list = NULL; /* deactivate */
20482054
block/blk-mq-tag.c+3−0
@@ -295,6 +295,9 @@ int blk_mq_reinit_tagset(struct blk_mq_tag_set *set) · 294 unmodified lines
295295 for (i = 0; i < set->nr_hw_queues; i++) {
296296 struct blk_mq_tags *tags = set->tags[i];
297297
298+ if (!tags)
299+ continue;
300+
298301 for (j = 0; j < tags->nr_tags; j++) {
299302 if (!tags->static_rqs[j])
300303 continue;
block/blk-mq.c+6−14
@@ -697,17 +697,8 @@ static void blk_mq_check_expired(struct blk_mq_hw_ctx *hctx, · 696 unmodified lines
697697 {
698698 struct blk_mq_timeout_data *data = priv;
699699
700− if (!test_bit(REQ_ATOM_STARTED, &rq->atomic_flags)) {
701− /*
702− * If a request wasn't started before the queue was
703− * marked dying, kill it here or it'll go unnoticed.
704− */
705− if (unlikely(blk_queue_dying(rq->q))) {
706− rq->errors = -EIO;
707− blk_mq_end_request(rq, rq->errors);
708− }
700+ if (!test_bit(REQ_ATOM_STARTED, &rq->atomic_flags))
709701 return;
710− }
711702
712703 if (time_after_eq(jiffies, rq->deadline)) {
713704 if (!blk_mark_rq_complete(rq))
@@ -1434,7 +1425,8 @@ static blk_qc_t request_to_qc_t(struct blk_mq_hw_ctx *hctx, struct request *rq) · 720 unmodified lines
14341425 return blk_tag_to_qc_t(rq->internal_tag, hctx->queue_num, true);
14351426 }
14361427
1437−static void blk_mq_try_issue_directly(struct request *rq, blk_qc_t *cookie)
1428+static void blk_mq_try_issue_directly(struct request *rq, blk_qc_t *cookie,
1429+ bool may_sleep)
14381430 {
14391431 struct request_queue *q = rq->q;
14401432 struct blk_mq_queue_data bd = {
@@ -1475,7 +1467,7 @@ static void blk_mq_try_issue_directly(struct request *rq, blk_qc_t *cookie) · 34 unmodified lines
14751467 }
14761468
14771469 insert:
1478− blk_mq_sched_insert_request(rq, false, true, true, false);
1470+ blk_mq_sched_insert_request(rq, false, true, false, may_sleep);
14791471 }
14801472
14811473 /*
@@ -1569,11 +1561,11 @@ static blk_qc_t blk_mq_make_request(struct request_queue *q, struct bio *bio) · 87 unmodified lines
15691561
15701562 if (!(data.hctx->flags & BLK_MQ_F_BLOCKING)) {
15711563 rcu_read_lock();
1572− blk_mq_try_issue_directly(old_rq, &cookie);
1564+ blk_mq_try_issue_directly(old_rq, &cookie, false);
15731565 rcu_read_unlock();
15741566 } else {
15751567 srcu_idx = srcu_read_lock(&data.hctx->queue_rq_srcu);
1576− blk_mq_try_issue_directly(old_rq, &cookie);
1568+ blk_mq_try_issue_directly(old_rq, &cookie, true);
15771569 srcu_read_unlock(&data.hctx->queue_rq_srcu, srcu_idx);
15781570 }
15791571 goto done;
block/blk-stat.c+2−2
@@ -30,11 +30,11 @@ static void blk_stat_flush_batch(struct blk_rq_stat *stat) · 29 unmodified lines
3030
3131 static void blk_stat_sum(struct blk_rq_stat *dst, struct blk_rq_stat *src)
3232 {
33+ blk_stat_flush_batch(src);
34+
3335 if (!src->nr_samples)
3436 return;
3537
36− blk_stat_flush_batch(src);
37−
3838 dst->min = min(dst->min, src->min);
3939 dst->max = max(dst->max, src->max);
4040
crypto/af_alg.c+5−4
@@ -266,7 +266,7 @@ unlock: · 265 unmodified lines
266266 return err;
267267 }
268268
269−int af_alg_accept(struct sock *sk, struct socket *newsock)
269+int af_alg_accept(struct sock *sk, struct socket *newsock, bool kern)
270270 {
271271 struct alg_sock *ask = alg_sk(sk);
272272 const struct af_alg_type *type;
@@ -281,7 +281,7 @@ int af_alg_accept(struct sock *sk, struct socket *newsock) · 8 unmodified lines
281281 if (!type)
282282 goto unlock;
283283
284− sk2 = sk_alloc(sock_net(sk), PF_ALG, GFP_KERNEL, &alg_proto, 0);
284+ sk2 = sk_alloc(sock_net(sk), PF_ALG, GFP_KERNEL, &alg_proto, kern);
285285 err = -ENOMEM;
286286 if (!sk2)
287287 goto unlock;
@@ -323,9 +323,10 @@ unlock: · 35 unmodified lines
323323 }
324324 EXPORT_SYMBOL_GPL(af_alg_accept);
325325
326−static int alg_accept(struct socket *sock, struct socket *newsock, int flags)
326+static int alg_accept(struct socket *sock, struct socket *newsock, int flags,
327+ bool kern)
327328 {
328− return af_alg_accept(sock->sk, newsock);
329+ return af_alg_accept(sock->sk, newsock, kern);
329330 }
330331
331332 static const struct proto_ops alg_proto_ops = {
crypto/algif_hash.c+5−4
@@ -239,7 +239,8 @@ unlock: · 238 unmodified lines
239239 return err ?: len;
240240 }
241241
242−static int hash_accept(struct socket *sock, struct socket *newsock, int flags)
242+static int hash_accept(struct socket *sock, struct socket *newsock, int flags,
243+ bool kern)
243244 {
244245 struct sock *sk = sock->sk;
245246 struct alg_sock *ask = alg_sk(sk);
@@ -260,7 +261,7 @@ static int hash_accept(struct socket *sock, struct socket *newsock, int flags) · 14 unmodified lines
260261 if (err)
261262 return err;
262263
263− err = af_alg_accept(ask->parent, newsock);
264+ err = af_alg_accept(ask->parent, newsock, kern);
264265 if (err)
265266 return err;
266267
@@ -378,7 +379,7 @@ static int hash_recvmsg_nokey(struct socket *sock, struct msghdr *msg, · 111 unmodified lines
378379 }
379380
380381 static int hash_accept_nokey(struct socket *sock, struct socket *newsock,
381− int flags)
382+ int flags, bool kern)
382383 {
383384 int err;
384385
@@ -386,7 +387,7 @@ static int hash_accept_nokey(struct socket *sock, struct socket *newsock, · 1 unmodified line
386387 if (err)
387388 return err;
388389
389− return hash_accept(sock, newsock, flags);
390+ return hash_accept(sock, newsock, flags, kern);
390391 }
391392
392393 static struct proto_ops algif_hash_ops_nokey = {
drivers/acpi/acpi_processor.c+42−15
@@ -182,11 +182,6 @@ int __weak arch_register_cpu(int cpu) · 181 unmodified lines
182182
183183 void __weak arch_unregister_cpu(int cpu) {}
184184
185−int __weak acpi_map_cpu2node(acpi_handle handle, int cpu, int physid)
186−{
187− return -ENODEV;
188−}
189−
190185 static int acpi_processor_hotadd_init(struct acpi_processor *pr)
191186 {
192187 unsigned long long sta;
@@ -285,6 +280,13 @@ static int acpi_processor_get_info(struct acpi_device *device) · 92 unmodified lines
285280 pr->acpi_id = value;
286281 }
287282
283+ if (acpi_duplicate_processor_id(pr->acpi_id)) {
284+ dev_err(&device->dev,
285+ "Failed to get unique processor _UID (0x%x)\n",
286+ pr->acpi_id);
287+ return -ENODEV;
288+ }
289+
288290 pr->phys_id = acpi_get_phys_id(pr->handle, device_declaration,
289291 pr->acpi_id);
290292 if (invalid_phys_cpuid(pr->phys_id))
@@ -585,7 +587,7 @@ static struct acpi_scan_handler processor_container_handler = { · 294 unmodified lines
585587 static int nr_unique_ids __initdata;
586588
587589 /* The number of the duplicate processor IDs */
588−static int nr_duplicate_ids __initdata;
590+static int nr_duplicate_ids;
589591
590592 /* Used to store the unique processor IDs */
591593 static int unique_processor_ids[] __initdata = {
@@ -593,7 +595,7 @@ static int unique_processor_ids[] __initdata = { · 1 unmodified line
593595 };
594596
595597 /* Used to store the duplicate processor IDs */
596−static int duplicate_processor_ids[] __initdata = {
598+static int duplicate_processor_ids[] = {
597599 [0 ... NR_CPUS - 1] = -1,
598600 };
599601
@@ -638,28 +640,53 @@ static acpi_status __init acpi_processor_ids_walk(acpi_handle handle, · 38 unmodified lines
638640 void **rv)
639641 {
640642 acpi_status status;
643+ acpi_object_type acpi_type;
644+ unsigned long long uid;
641645 union acpi_object object = { 0 };
642646 struct acpi_buffer buffer = { sizeof(union acpi_object), &object };
643647
644− status = acpi_evaluate_object(handle, NULL, NULL, &buffer);
648+ status = acpi_get_type(handle, &acpi_type);
645649 if (ACPI_FAILURE(status))
646− acpi_handle_info(handle, "Not get the processor object\n");
647− else
648− processor_validated_ids_update(object.processor.proc_id);
650+ return false;
651+
652+ switch (acpi_type) {
653+ case ACPI_TYPE_PROCESSOR:
654+ status = acpi_evaluate_object(handle, NULL, NULL, &buffer);
655+ if (ACPI_FAILURE(status))
656+ goto err;
657+ uid = object.processor.proc_id;
658+ break;
659+
660+ case ACPI_TYPE_DEVICE:
661+ status = acpi_evaluate_integer(handle, "_UID", NULL, &uid);
662+ if (ACPI_FAILURE(status))
663+ goto err;
664+ break;
665+ default:
666+ goto err;
667+ }
668+
669+ processor_validated_ids_update(uid);
670+ return true;
671+
672+err:
673+ acpi_handle_info(handle, "Invalid processor object\n");
674+ return false;
649675
650− return AE_OK;
651676 }
652677
653−static void __init acpi_processor_check_duplicates(void)
678+void __init acpi_processor_check_duplicates(void)
654679 {
655− /* Search all processor nodes in ACPI namespace */
680+ /* check the correctness for all processors in ACPI namespace */
656681 acpi_walk_namespace(ACPI_TYPE_PROCESSOR, ACPI_ROOT_OBJECT,
657682 ACPI_UINT32_MAX,
658683 acpi_processor_ids_walk,
659684 NULL, NULL, NULL);
685+ acpi_get_devices(ACPI_PROCESSOR_DEVICE_HID, acpi_processor_ids_walk,
686+ NULL, NULL);
660687 }
661688
662−bool __init acpi_processor_validate_proc_id(int proc_id)
689+bool acpi_duplicate_processor_id(int proc_id)
663690 {
664691 int i;
665692
drivers/acpi/bus.c+0−1
@@ -1249,7 +1249,6 @@ static int __init acpi_init(void) · 1248 unmodified lines
12491249 acpi_wakeup_device_init();
12501250 acpi_debugger_init();
12511251 acpi_setup_sb_notify_handler();
1252− acpi_set_processor_mapping();
12531252 return 0;
12541253 }
12551254
drivers/acpi/nfit/core.c+5−1
@@ -1617,7 +1617,11 @@ static int cmp_map(const void *m0, const void *m1) · 1616 unmodified lines
16171617 const struct nfit_set_info_map *map0 = m0;
16181618 const struct nfit_set_info_map *map1 = m1;
16191619
1620− return map0->region_offset - map1->region_offset;
1620+ if (map0->region_offset < map1->region_offset)
1621+ return -1;
1622+ else if (map0->region_offset > map1->region_offset)
1623+ return 1;
1624+ return 0;
16211625 }
16221626
16231627 /* Retrieve the nth entry referencing this spa */
drivers/acpi/processor_core.c+22−111
@@ -32,12 +32,12 @@ static struct acpi_table_madt *get_madt_table(void) · 31 unmodified lines
3232 }
3333
3434 static int map_lapic_id(struct acpi_subtable_header *entry,
35− u32 acpi_id, phys_cpuid_t *apic_id, bool ignore_disabled)
35+ u32 acpi_id, phys_cpuid_t *apic_id)
3636 {
3737 struct acpi_madt_local_apic *lapic =
3838 container_of(entry, struct acpi_madt_local_apic, header);
3939
40− if (ignore_disabled && !(lapic->lapic_flags & ACPI_MADT_ENABLED))
40+ if (!(lapic->lapic_flags & ACPI_MADT_ENABLED))
4141 return -ENODEV;
4242
4343 if (lapic->processor_id != acpi_id)
@@ -48,13 +48,12 @@ static int map_lapic_id(struct acpi_subtable_header *entry, · 4 unmodified lines
4848 }
4949
5050 static int map_x2apic_id(struct acpi_subtable_header *entry,
51− int device_declaration, u32 acpi_id, phys_cpuid_t *apic_id,
52− bool ignore_disabled)
51+ int device_declaration, u32 acpi_id, phys_cpuid_t *apic_id)
5352 {
5453 struct acpi_madt_local_x2apic *apic =
5554 container_of(entry, struct acpi_madt_local_x2apic, header);
5655
57− if (ignore_disabled && !(apic->lapic_flags & ACPI_MADT_ENABLED))
56+ if (!(apic->lapic_flags & ACPI_MADT_ENABLED))
5857 return -ENODEV;
5958
6059 if (device_declaration && (apic->uid == acpi_id)) {
@@ -66,13 +65,12 @@ static int map_x2apic_id(struct acpi_subtable_header *entry, · 5 unmodified lines
6665 }
6766
6867 static int map_lsapic_id(struct acpi_subtable_header *entry,
69− int device_declaration, u32 acpi_id, phys_cpuid_t *apic_id,
70− bool ignore_disabled)
68+ int device_declaration, u32 acpi_id, phys_cpuid_t *apic_id)
7169 {
7270 struct acpi_madt_local_sapic *lsapic =
7371 container_of(entry, struct acpi_madt_local_sapic, header);
7472
75− if (ignore_disabled && !(lsapic->lapic_flags & ACPI_MADT_ENABLED))
73+ if (!(lsapic->lapic_flags & ACPI_MADT_ENABLED))
7674 return -ENODEV;
7775
7876 if (device_declaration) {
@@ -89,13 +87,12 @@ static int map_lsapic_id(struct acpi_subtable_header *entry, · 10 unmodified lines
8987 * Retrieve the ARM CPU physical identifier (MPIDR)
9088 */
9189 static int map_gicc_mpidr(struct acpi_subtable_header *entry,
92− int device_declaration, u32 acpi_id, phys_cpuid_t *mpidr,
93− bool ignore_disabled)
90+ int device_declaration, u32 acpi_id, phys_cpuid_t *mpidr)
9491 {
9592 struct acpi_madt_generic_interrupt *gicc =
9693 container_of(entry, struct acpi_madt_generic_interrupt, header);
9794
98− if (ignore_disabled && !(gicc->flags & ACPI_MADT_ENABLED))
95+ if (!(gicc->flags & ACPI_MADT_ENABLED))
9996 return -ENODEV;
10097
10198 /* device_declaration means Device object in DSDT, in the
@@ -112,7 +109,7 @@ static int map_gicc_mpidr(struct acpi_subtable_header *entry, · 10 unmodified lines
112109 }
113110
114111 static phys_cpuid_t map_madt_entry(struct acpi_table_madt *madt,
115− int type, u32 acpi_id, bool ignore_disabled)
112+ int type, u32 acpi_id)
116113 {
117114 unsigned long madt_end, entry;
118115 phys_cpuid_t phys_id = PHYS_CPUID_INVALID; /* CPU hardware ID */
@@ -130,20 +127,16 @@ static phys_cpuid_t map_madt_entry(struct acpi_table_madt *madt, · 11 unmodified lines
130127 struct acpi_subtable_header *header =
131128 (struct acpi_subtable_header *)entry;
132129 if (header->type == ACPI_MADT_TYPE_LOCAL_APIC) {
133− if (!map_lapic_id(header, acpi_id, &phys_id,
134− ignore_disabled))
130+ if (!map_lapic_id(header, acpi_id, &phys_id))
135131 break;
136132 } else if (header->type == ACPI_MADT_TYPE_LOCAL_X2APIC) {
137− if (!map_x2apic_id(header, type, acpi_id, &phys_id,
138− ignore_disabled))
133+ if (!map_x2apic_id(header, type, acpi_id, &phys_id))
139134 break;
140135 } else if (header->type == ACPI_MADT_TYPE_LOCAL_SAPIC) {
141− if (!map_lsapic_id(header, type, acpi_id, &phys_id,
142− ignore_disabled))
136+ if (!map_lsapic_id(header, type, acpi_id, &phys_id))
143137 break;
144138 } else if (header->type == ACPI_MADT_TYPE_GENERIC_INTERRUPT) {
145− if (!map_gicc_mpidr(header, type, acpi_id, &phys_id,
146− ignore_disabled))
139+ if (!map_gicc_mpidr(header, type, acpi_id, &phys_id))
147140 break;
148141 }
149142 entry += header->length;
@@ -161,15 +154,14 @@ phys_cpuid_t __init acpi_map_madt_entry(u32 acpi_id) · 11 unmodified lines
161154 if (!madt)
162155 return PHYS_CPUID_INVALID;
163156
164− rv = map_madt_entry(madt, 1, acpi_id, true);
157+ rv = map_madt_entry(madt, 1, acpi_id);
165158
166159 acpi_put_table((struct acpi_table_header *)madt);
167160
168161 return rv;
169162 }
170163
171−static phys_cpuid_t map_mat_entry(acpi_handle handle, int type, u32 acpi_id,
172− bool ignore_disabled)
164+static phys_cpuid_t map_mat_entry(acpi_handle handle, int type, u32 acpi_id)
173165 {
174166 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };
175167 union acpi_object *obj;
@@ -190,38 +182,30 @@ static phys_cpuid_t map_mat_entry(acpi_handle handle, int type, u32 acpi_id, · 14 unmodified lines
190182
191183 header = (struct acpi_subtable_header *)obj->buffer.pointer;
192184 if (header->type == ACPI_MADT_TYPE_LOCAL_APIC)
193− map_lapic_id(header, acpi_id, &phys_id, ignore_disabled);
185+ map_lapic_id(header, acpi_id, &phys_id);
194186 else if (header->type == ACPI_MADT_TYPE_LOCAL_SAPIC)
195− map_lsapic_id(header, type, acpi_id, &phys_id, ignore_disabled);
187+ map_lsapic_id(header, type, acpi_id, &phys_id);
196188 else if (header->type == ACPI_MADT_TYPE_LOCAL_X2APIC)
197− map_x2apic_id(header, type, acpi_id, &phys_id, ignore_disabled);
189+ map_x2apic_id(header, type, acpi_id, &phys_id);
198190 else if (header->type == ACPI_MADT_TYPE_GENERIC_INTERRUPT)
199− map_gicc_mpidr(header, type, acpi_id, &phys_id,
200− ignore_disabled);
191+ map_gicc_mpidr(header, type, acpi_id, &phys_id);
201192
202193 exit:
203194 kfree(buffer.pointer);
204195 return phys_id;
205196 }
206197
207−static phys_cpuid_t __acpi_get_phys_id(acpi_handle handle, int type,
208− u32 acpi_id, bool ignore_disabled)
198+phys_cpuid_t acpi_get_phys_id(acpi_handle handle, int type, u32 acpi_id)
209199 {
210200 phys_cpuid_t phys_id;
211201
212− phys_id = map_mat_entry(handle, type, acpi_id, ignore_disabled);
202+ phys_id = map_mat_entry(handle, type, acpi_id);
213203 if (invalid_phys_cpuid(phys_id))
214− phys_id = map_madt_entry(get_madt_table(), type, acpi_id,
215− ignore_disabled);
204+ phys_id = map_madt_entry(get_madt_table(), type, acpi_id);
216205
217206 return phys_id;
218207 }
219208
220−phys_cpuid_t acpi_get_phys_id(acpi_handle handle, int type, u32 acpi_id)
221−{
222− return __acpi_get_phys_id(handle, type, acpi_id, true);
223−}
224−
225209 int acpi_map_cpuid(phys_cpuid_t phys_id, u32 acpi_id)
226210 {
227211 #ifdef CONFIG_SMP
@@ -278,79 +262,6 @@ int acpi_get_cpuid(acpi_handle handle, int type, u32 acpi_id) · 50 unmodified lines
278262 }
279263 EXPORT_SYMBOL_GPL(acpi_get_cpuid);
280264
281−#ifdef CONFIG_ACPI_HOTPLUG_CPU
282−static bool __init
283−map_processor(acpi_handle handle, phys_cpuid_t *phys_id, int *cpuid)
284−{
285− int type, id;
286− u32 acpi_id;
287− acpi_status status;
288− acpi_object_type acpi_type;
289− unsigned long long tmp;
290− union acpi_object object = { 0 };
291− struct acpi_buffer buffer = { sizeof(union acpi_object), &object };
292−
293− status = acpi_get_type(handle, &acpi_type);
294− if (ACPI_FAILURE(status))
295− return false;
296−
297− switch (acpi_type) {
298− case ACPI_TYPE_PROCESSOR:
299− status = acpi_evaluate_object(handle, NULL, NULL, &buffer);
300− if (ACPI_FAILURE(status))
301− return false;
302− acpi_id = object.processor.proc_id;
303−
304− /* validate the acpi_id */
305− if(acpi_processor_validate_proc_id(acpi_id))
306− return false;
307− break;
308− case ACPI_TYPE_DEVICE:
309− status = acpi_evaluate_integer(handle, "_UID", NULL, &tmp);
310− if (ACPI_FAILURE(status))
311− return false;
312− acpi_id = tmp;
313− break;
314− default:
315− return false;
316− }
317−
318− type = (acpi_type == ACPI_TYPE_DEVICE) ? 1 : 0;
319−
320− *phys_id = __acpi_get_phys_id(handle, type, acpi_id, false);
321− id = acpi_map_cpuid(*phys_id, acpi_id);
322−
323− if (id < 0)
324− return false;
325− *cpuid = id;
326− return true;
327−}
328−
329−static acpi_status __init
330−set_processor_node_mapping(acpi_handle handle, u32 lvl, void *context,
331− void **rv)
332−{
333− phys_cpuid_t phys_id;
334− int cpu_id;
335−
336− if (!map_processor(handle, &phys_id, &cpu_id))
337− return AE_ERROR;
338−
339− acpi_map_cpu2node(handle, cpu_id, phys_id);
340− return AE_OK;
341−}
342−
343−void __init acpi_set_processor_mapping(void)
344−{
345− /* Set persistent cpu <-> node mapping for all processors. */
346− acpi_walk_namespace(ACPI_TYPE_PROCESSOR, ACPI_ROOT_OBJECT,
347− ACPI_UINT32_MAX, set_processor_node_mapping,
348− NULL, NULL, NULL);
349−}
350−#else
351−void __init acpi_set_processor_mapping(void) {}
352−#endif /* CONFIG_ACPI_HOTPLUG_CPU */
353−
354265 #ifdef CONFIG_ACPI_HOTPLUG_IOAPIC
355266 static int get_ioapic_id(struct acpi_subtable_header *entry, u32 gsi_base,
356267 u64 *phys_addr, int *ioapic_id)
drivers/acpi/spcr.c+1−1
@@ -30,7 +30,7 @@ static bool qdf2400_erratum_44_present(struct acpi_table_header *h) · 29 unmodified lines
3030 return true;
3131
3232 if (!memcmp(h->oem_table_id, "QDF2400 ", ACPI_OEM_TABLE_ID_SIZE) &&
33− h->oem_revision == 0)
33+ h->oem_revision == 1)
3434 return true;
3535
3636 return false;
drivers/ata/ahci_qoriq.c+4−2
@@ -177,7 +177,8 @@ static int ahci_qoriq_phy_init(struct ahci_host_priv *hpriv) · 176 unmodified lines
177177 case AHCI_LS1043A:
178178 if (!qpriv->ecc_addr)
179179 return -EINVAL;
180− writel(ECC_DIS_ARMV8_CH2, qpriv->ecc_addr);
180+ writel(readl(qpriv->ecc_addr) | ECC_DIS_ARMV8_CH2,
181+ qpriv->ecc_addr);
181182 writel(AHCI_PORT_PHY_1_CFG, reg_base + PORT_PHY1);
182183 writel(AHCI_PORT_TRANS_CFG, reg_base + PORT_TRANS);
183184 if (qpriv->is_dmacoherent)
@@ -194,7 +195,8 @@ static int ahci_qoriq_phy_init(struct ahci_host_priv *hpriv) · 10 unmodified lines
194195 case AHCI_LS1046A:
195196 if (!qpriv->ecc_addr)
196197 return -EINVAL;
197− writel(ECC_DIS_ARMV8_CH2, qpriv->ecc_addr);
198+ writel(readl(qpriv->ecc_addr) | ECC_DIS_ARMV8_CH2,
199+ qpriv->ecc_addr);
198200 writel(AHCI_PORT_PHY_1_CFG, reg_base + PORT_PHY1);
199201 writel(AHCI_PORT_TRANS_CFG, reg_base + PORT_TRANS);
200202 if (qpriv->is_dmacoherent)
drivers/ata/libata-sff.c+0−1
@@ -1482,7 +1482,6 @@ unsigned int ata_sff_qc_issue(struct ata_queued_cmd *qc) · 1481 unmodified lines
14821482 break;
14831483
14841484 default:
1485− WARN_ON_ONCE(1);
14861485 return AC_ERR_SYSTEM;
14871486 }
14881487
drivers/ata/libata-transport.c+3−6
@@ -224,7 +224,6 @@ static DECLARE_TRANSPORT_CLASS(ata_port_class, · 223 unmodified lines
224224
225225 static void ata_tport_release(struct device *dev)
226226 {
227− put_device(dev->parent);
228227 }
229228
230229 /**
@@ -284,7 +283,7 @@ int ata_tport_add(struct device *parent, · 53 unmodified lines
284283 device_initialize(dev);
285284 dev->type = &ata_port_type;
286285
287− dev->parent = get_device(parent);
286+ dev->parent = parent;
288287 dev->release = ata_tport_release;
289288 dev_set_name(dev, "ata%d", ap->print_id);
290289 transport_setup_device(dev);
@@ -348,7 +347,6 @@ static DECLARE_TRANSPORT_CLASS(ata_link_class, · 57 unmodified lines
348347
349348 static void ata_tlink_release(struct device *dev)
350349 {
351− put_device(dev->parent);
352350 }
353351
354352 /**
@@ -410,7 +408,7 @@ int ata_tlink_add(struct ata_link *link) · 55 unmodified lines
410408 int error;
411409
412410 device_initialize(dev);
413− dev->parent = get_device(&ap->tdev);
411+ dev->parent = &ap->tdev;
414412 dev->release = ata_tlink_release;
415413 if (ata_is_host_link(link))
416414 dev_set_name(dev, "link%d", ap->print_id);
@@ -589,7 +587,6 @@ static DECLARE_TRANSPORT_CLASS(ata_dev_class, · 172 unmodified lines
589587
590588 static void ata_tdev_release(struct device *dev)
591589 {
592− put_device(dev->parent);
593590 }
594591
595592 /**
@@ -662,7 +659,7 @@ static int ata_tdev_add(struct ata_device *ata_dev) · 66 unmodified lines
662659 int error;
663660
664661 device_initialize(dev);
665− dev->parent = get_device(&link->tdev);
662+ dev->parent = &link->tdev;
666663 dev->release = ata_tdev_release;
667664 if (ata_is_host_link(link))
668665 dev_set_name(dev, "dev%d.%d", ap->print_id,ata_dev->devno);
drivers/auxdisplay/img-ascii-lcd.c+1−0
@@ -218,6 +218,7 @@ static const struct of_device_id img_ascii_lcd_matches[] = { · 217 unmodified lines
218218 { .compatible = "img,boston-lcd", .data = &boston_config },
219219 { .compatible = "mti,malta-lcd", .data = &malta_config },
220220 { .compatible = "mti,sead3-lcd", .data = &sead3_config },
221+ { /* sentinel */ }
221222 };
222223
223224 /**
drivers/base/core.c+0−5
@@ -639,11 +639,6 @@ int lock_device_hotplug_sysfs(void) · 638 unmodified lines
639639 return restart_syscall();
640640 }
641641
642−void assert_held_device_hotplug(void)
643−{
644− lockdep_assert_held(&device_hotplug_lock);
645−}
646−
647642 #ifdef CONFIG_BLOCK
648643 static inline int device_is_not_partition(struct device *dev)
649644 {
drivers/bluetooth/Kconfig+2−1
@@ -344,7 +344,8 @@ config BT_WILINK · 343 unmodified lines
344344
345345 config BT_QCOMSMD
346346 tristate "Qualcomm SMD based HCI support"
347− depends on (QCOM_SMD && QCOM_WCNSS_CTRL) || COMPILE_TEST
347+ depends on QCOM_SMD || (COMPILE_TEST && QCOM_SMD=n)
348+ depends on QCOM_WCNSS_CTRL || (COMPILE_TEST && QCOM_WCNSS_CTRL=n)
348349 select BT_QCA
349350 help
350351 Qualcomm SMD based HCI driver.
drivers/char/hw_random/amd-rng.c+34−8
@@ -55,6 +55,7 @@ MODULE_DEVICE_TABLE(pci, pci_tbl); · 54 unmodified lines
5555 struct amd768_priv {
5656 void __iomem *iobase;
5757 struct pci_dev *pcidev;
58+ u32 pmbase;
5859 };
5960
6061 static int amd_rng_read(struct hwrng *rng, void *buf, size_t max, bool wait)
@@ -148,33 +149,58 @@ found: · 87 unmodified lines
148149 if (pmbase == 0)
149150 return -EIO;
150151
151− priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
152+ priv = kzalloc(sizeof(*priv), GFP_KERNEL);
152153 if (!priv)
153154 return -ENOMEM;
154155
155− if (!devm_request_region(&pdev->dev, pmbase + PMBASE_OFFSET,
156− PMBASE_SIZE, DRV_NAME)) {
156+ if (!request_region(pmbase + PMBASE_OFFSET, PMBASE_SIZE, DRV_NAME)) {
157157 dev_err(&pdev->dev, DRV_NAME " region 0x%x already in use!\n",
158158 pmbase + 0xF0);
159− return -EBUSY;
159+ err = -EBUSY;
160+ goto out;
160161 }
161162
162− priv->iobase = devm_ioport_map(&pdev->dev, pmbase + PMBASE_OFFSET,
163− PMBASE_SIZE);
163+ priv->iobase = ioport_map(pmbase + PMBASE_OFFSET, PMBASE_SIZE);
164164 if (!priv->iobase) {
165165 pr_err(DRV_NAME "Cannot map ioport\n");
166− return -ENOMEM;
166+ err = -EINVAL;
167+ goto err_iomap;
167168 }
168169
169170 amd_rng.priv = (unsigned long)priv;
171+ priv->pmbase = pmbase;
170172 priv->pcidev = pdev;
171173
172174 pr_info(DRV_NAME " detected\n");
173− return devm_hwrng_register(&pdev->dev, &amd_rng);
175+ err = hwrng_register(&amd_rng);
176+ if (err) {
177+ pr_err(DRV_NAME " registering failed (%d)\n", err);
178+ goto err_hwrng;
179+ }
180+ return 0;
181+
182+err_hwrng:
183+ ioport_unmap(priv->iobase);
184+err_iomap:
185+ release_region(pmbase + PMBASE_OFFSET, PMBASE_SIZE);
186+out:
187+ kfree(priv);
188+ return err;
174189 }
175190
176191 static void __exit mod_exit(void)
177192 {
193+ struct amd768_priv *priv;
194+
195+ priv = (struct amd768_priv *)amd_rng.priv;
196+
197+ hwrng_unregister(&amd_rng);
198+
199+ ioport_unmap(priv->iobase);
200+
201+ release_region(priv->pmbase + PMBASE_OFFSET, PMBASE_SIZE);
202+
203+ kfree(priv);
178204 }
179205
180206 module_init(mod_init);
drivers/char/hw_random/geode-rng.c+35−15
@@ -31,6 +31,9 @@ · 30 unmodified lines
3131 #include <linux/module.h>
3232 #include <linux/pci.h>
3333
34+
35+#define PFX KBUILD_MODNAME ": "
36+
3437 #define GEODE_RNG_DATA_REG 0x50
3538 #define GEODE_RNG_STATUS_REG 0x54
3639
@@ -82,6 +85,7 @@ static struct hwrng geode_rng = { · 45 unmodified lines
8285
8386 static int __init mod_init(void)
8487 {
88+ int err = -ENODEV;
8589 struct pci_dev *pdev = NULL;
8690 const struct pci_device_id *ent;
8791 void __iomem *mem;
@@ -89,27 +93,43 @@ static int __init mod_init(void) · 1 unmodified line
8993
9094 for_each_pci_dev(pdev) {
9195 ent = pci_match_id(pci_tbl, pdev);
92− if (ent) {
93− rng_base = pci_resource_start(pdev, 0);
94− if (rng_base == 0)
95− return -ENODEV;
96−
97− mem = devm_ioremap(&pdev->dev, rng_base, 0x58);
98− if (!mem)
99− return -ENOMEM;
100− geode_rng.priv = (unsigned long)mem;
101−
102− pr_info("AMD Geode RNG detected\n");
103− return devm_hwrng_register(&pdev->dev, &geode_rng);
104− }
96+ if (ent)
97+ goto found;
10598 }
106−
10799 /* Device not found. */
108− return -ENODEV;
100+ goto out;
101+
102+found:
103+ rng_base = pci_resource_start(pdev, 0);
104+ if (rng_base == 0)
105+ goto out;
106+ err = -ENOMEM;
107+ mem = ioremap(rng_base, 0x58);
108+ if (!mem)
109+ goto out;
110+ geode_rng.priv = (unsigned long)mem;
111+
112+ pr_info("AMD Geode RNG detected\n");
113+ err = hwrng_register(&geode_rng);
114+ if (err) {
115+ pr_err(PFX "RNG registering failed (%d)\n",
116+ err);
117+ goto err_unmap;
118+ }
119+out:
120+ return err;
121+
122+err_unmap:
123+ iounmap(mem);
124+ goto out;
109125 }
110126
111127 static void __exit mod_exit(void)
112128 {
129+ void __iomem *mem = (void __iomem *)geode_rng.priv;
130+
131+ hwrng_unregister(&geode_rng);
132+ iounmap(mem);
113133 }
114134
115135 module_init(mod_init);
drivers/char/hw_random/omap-rng.c+14−2
@@ -397,9 +397,8 @@ static int of_get_omap_rng_device_details(struct omap_rng_dev *priv, · 396 unmodified lines
397397 irq, err);
398398 return err;
399399 }
400− omap_rng_write(priv, RNG_INTMASK_REG, RNG_SHUTDOWN_OFLO_MASK);
401400
402− priv->clk = of_clk_get(pdev->dev.of_node, 0);
401+ priv->clk = devm_clk_get(&pdev->dev, NULL);
403402 if (IS_ERR(priv->clk) && PTR_ERR(priv->clk) == -EPROBE_DEFER)
404403 return -EPROBE_DEFER;
405404 if (!IS_ERR(priv->clk)) {
@@ -408,6 +407,19 @@ static int of_get_omap_rng_device_details(struct omap_rng_dev *priv, · 2 unmodified lines
408407 dev_err(&pdev->dev, "unable to enable the clk, "
409408 "err = %d\n", err);
410409 }
410+
411+ /*
412+ * On OMAP4, enabling the shutdown_oflo interrupt is
413+ * done in the interrupt mask register. There is no
414+ * such register on EIP76, and it's enabled by the
415+ * same bit in the control register
416+ */
417+ if (priv->pdata->regs[RNG_INTMASK_REG])
418+ omap_rng_write(priv, RNG_INTMASK_REG,
419+ RNG_SHUTDOWN_OFLO_MASK);
420+ else
421+ omap_rng_write(priv, RNG_CONTROL_REG,
422+ RNG_SHUTDOWN_OFLO_MASK);
411423 }
412424 return 0;
413425 }
drivers/char/ppdev.c+9−2
@@ -84,11 +84,14 @@ struct pp_struct { · 83 unmodified lines
8484 struct ieee1284_info state;
8585 struct ieee1284_info saved_state;
8686 long default_inactivity;
87+ int index;
8788 };
8889
8990 /* should we use PARDEVICE_MAX here? */
9091 static struct device *devices[PARPORT_MAX];
9192
93+static DEFINE_IDA(ida_index);
94+
9295 /* pp_struct.flags bitfields */
9396 #define PP_CLAIMED (1<<0)
9497 #define PP_EXCL (1<<1)
@@ -290,7 +293,7 @@ static int register_device(int minor, struct pp_struct *pp) · 195 unmodified lines
290293 struct pardevice *pdev = NULL;
291294 char *name;
292295 struct pardev_cb ppdev_cb;
293− int rc = 0;
296+ int rc = 0, index;
294297
295298 name = kasprintf(GFP_KERNEL, CHRDEV "%x", minor);
296299 if (name == NULL)
@@ -303,20 +306,23 @@ static int register_device(int minor, struct pp_struct *pp) · 6 unmodified lines
303306 goto err;
304307 }
305308
309+ index = ida_simple_get(&ida_index, 0, 0, GFP_KERNEL);
306310 memset(&ppdev_cb, 0, sizeof(ppdev_cb));
307311 ppdev_cb.irq_func = pp_irq;
308312 ppdev_cb.flags = (pp->flags & PP_EXCL) ? PARPORT_FLAG_EXCL : 0;
309313 ppdev_cb.private = pp;
310− pdev = parport_register_dev_model(port, name, &ppdev_cb, minor);
314+ pdev = parport_register_dev_model(port, name, &ppdev_cb, index);
311315 parport_put_port(port);
312316
313317 if (!pdev) {
314318 pr_warn("%s: failed to register device!\n", name);
315319 rc = -ENXIO;
320+ ida_simple_remove(&ida_index, index);
316321 goto err;
317322 }
318323
319324 pp->pdev = pdev;
325+ pp->index = index;
320326 dev_dbg(&pdev->dev, "registered pardevice\n");
321327 err:
322328 kfree(name);
@@ -755,6 +761,7 @@ static int pp_release(struct inode *inode, struct file *file) · 432 unmodified lines
755761
756762 if (pp->pdev) {
757763 parport_unregister_device(pp->pdev);
764+ ida_simple_remove(&ida_index, pp->index);
758765 pp->pdev = NULL;
759766 pr_debug(CHRDEV "%x: unregistered pardevice\n", minor);
760767 }
drivers/clk/clk.c+2−1
@@ -2502,7 +2502,7 @@ struct clk *__clk_create_clk(struct clk_hw *hw, const char *dev_id, · 2501 unmodified lines
25022502
25032503 clk->core = hw->core;
25042504 clk->dev_id = dev_id;
2505− clk->con_id = con_id;
2505+ clk->con_id = kstrdup_const(con_id, GFP_KERNEL);
25062506 clk->max_rate = ULONG_MAX;
25072507
25082508 clk_prepare_lock();
@@ -2518,6 +2518,7 @@ void __clk_free_clk(struct clk *clk) · 9 unmodified lines
25182518 hlist_del(&clk->clks_node);
25192519 clk_prepare_unlock();
25202520
2521+ kfree_const(clk->con_id);
25212522 kfree(clk);
25222523 }
25232524
drivers/clk/rockchip/clk-rk3036.c+8−1
@@ -127,7 +127,7 @@ PNAME(mux_ddrphy_p) = { "dpll_ddr", "gpll_ddr" }; · 126 unmodified lines
127127 PNAME(mux_pll_src_3plls_p) = { "apll", "dpll", "gpll" };
128128 PNAME(mux_timer_p) = { "xin24m", "pclk_peri_src" };
129129
130−PNAME(mux_pll_src_apll_dpll_gpll_usb480m_p) = { "apll", "dpll", "gpll" "usb480m" };
130+PNAME(mux_pll_src_apll_dpll_gpll_usb480m_p) = { "apll", "dpll", "gpll", "usb480m" };
131131
132132 PNAME(mux_mmc_src_p) = { "apll", "dpll", "gpll", "xin24m" };
133133 PNAME(mux_i2s_pre_p) = { "i2s_src", "i2s_frac", "ext_i2s", "xin12m" };
@@ -450,6 +450,13 @@ static void __init rk3036_clk_init(struct device_node *np) · 316 unmodified lines
450450 return;
451451 }
452452
453+ /*
454+ * Make uart_pll_clk a child of the gpll, as all other sources are
455+ * not that usable / stable.
456+ */
457+ writel_relaxed(HIWORD_UPDATE(0x2, 0x3, 10),
458+ reg_base + RK2928_CLKSEL_CON(13));
459+
453460 ctx = rockchip_clk_init(np, reg_base, CLK_NR_CLKS);
454461 if (IS_ERR(ctx)) {
455462 pr_err("%s: rockchip clk init failed\n", __func__);
drivers/clk/sunxi-ng/Kconfig+1−0
@@ -80,6 +80,7 @@ config SUN6I_A31_CCU · 79 unmodified lines
8080 select SUNXI_CCU_DIV
8181 select SUNXI_CCU_NK
8282 select SUNXI_CCU_NKM
83+ select SUNXI_CCU_NKMP
8384 select SUNXI_CCU_NM
8485 select SUNXI_CCU_MP
8586 select SUNXI_CCU_PHASE
drivers/clk/sunxi-ng/ccu-sun50i-a64.c+1−1
@@ -566,7 +566,7 @@ static SUNXI_CCU_M_WITH_GATE(gpu_clk, "gpu", "pll-gpu", · 565 unmodified lines
566566 0x1a0, 0, 3, BIT(31), CLK_SET_RATE_PARENT);
567567
568568 /* Fixed Factor clocks */
569−static CLK_FIXED_FACTOR(osc12M_clk, "osc12M", "osc24M", 1, 2, 0);
569+static CLK_FIXED_FACTOR(osc12M_clk, "osc12M", "osc24M", 2, 1, 0);
570570
571571 /* We hardcode the divider to 4 for now */
572572 static CLK_FIXED_FACTOR(pll_audio_clk, "pll-audio",
drivers/clk/sunxi-ng/ccu-sun6i-a31.c+1−1
@@ -608,7 +608,7 @@ static SUNXI_CCU_M_WITH_MUX_GATE(hdmi_clk, "hdmi", lcd_ch1_parents, · 607 unmodified lines
608608 0x150, 0, 4, 24, 2, BIT(31),
609609 CLK_SET_RATE_PARENT);
610610
611−static SUNXI_CCU_GATE(hdmi_ddc_clk, "hdmi-ddc", "osc24M", 0x150, BIT(31), 0);
611+static SUNXI_CCU_GATE(hdmi_ddc_clk, "hdmi-ddc", "osc24M", 0x150, BIT(30), 0);
612612
613613 static SUNXI_CCU_GATE(ps_clk, "ps", "lcd1-ch1", 0x140, BIT(31), 0);
614614
drivers/clk/sunxi-ng/ccu_mp.c+8−0
@@ -85,6 +85,10 @@ static unsigned long ccu_mp_recalc_rate(struct clk_hw *hw, · 84 unmodified lines
8585 unsigned int m, p;
8686 u32 reg;
8787
88+ /* Adjust parent_rate according to pre-dividers */
89+ ccu_mux_helper_adjust_parent_for_prediv(&cmp->common, &cmp->mux,
90+ -1, &parent_rate);
91+
8892 reg = readl(cmp->common.base + cmp->common.reg);
8993
9094 m = reg >> cmp->m.shift;
@@ -117,6 +121,10 @@ static int ccu_mp_set_rate(struct clk_hw *hw, unsigned long rate, · 26 unmodified lines
117121 unsigned int m, p;
118122 u32 reg;
119123
124+ /* Adjust parent_rate according to pre-dividers */
125+ ccu_mux_helper_adjust_parent_for_prediv(&cmp->common, &cmp->mux,
126+ -1, &parent_rate);
127+
120128 max_m = cmp->m.max ?: 1 << cmp->m.width;
121129 max_p = cmp->p.max ?: 1 << ((1 << cmp->p.width) - 1);
122130
drivers/clk/sunxi-ng/ccu_nkmp.c+1−1
@@ -107,7 +107,7 @@ static unsigned long ccu_nkmp_recalc_rate(struct clk_hw *hw, · 106 unmodified lines
107107 p = reg >> nkmp->p.shift;
108108 p &= (1 << nkmp->p.width) - 1;
109109
110− return parent_rate * n * k >> p / m;
110+ return (parent_rate * n * k >> p) / m;
111111 }
112112
113113 static long ccu_nkmp_round_rate(struct clk_hw *hw, unsigned long rate,
drivers/clocksource/tcb_clksrc.c+1−15
@@ -10,7 +10,6 @@ · 9 unmodified lines
1010 #include <linux/io.h>
1111 #include <linux/platform_device.h>
1212 #include <linux/atmel_tc.h>
13−#include <linux/sched_clock.h>
1413
1514
1615 /*
@@ -57,14 +56,9 @@ static u64 tc_get_cycles(struct clocksource *cs) · 40 unmodified lines
5756 return (upper << 16) | lower;
5857 }
5958
60−static u32 tc_get_cv32(void)
61−{
62− return __raw_readl(tcaddr + ATMEL_TC_REG(0, CV));
63−}
64−
6559 static u64 tc_get_cycles32(struct clocksource *cs)
6660 {
67− return tc_get_cv32();
61+ return __raw_readl(tcaddr + ATMEL_TC_REG(0, CV));
6862 }
6963
7064 static struct clocksource clksrc = {
@@ -75,11 +69,6 @@ static struct clocksource clksrc = { · 4 unmodified lines
7569 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
7670 };
7771
78−static u64 notrace tc_read_sched_clock(void)
79−{
80− return tc_get_cv32();
81−}
82−
8372 #ifdef CONFIG_GENERIC_CLOCKEVENTS
8473
8574 struct tc_clkevt_device {
@@ -350,9 +339,6 @@ static int __init tcb_clksrc_init(void) · 264 unmodified lines
350339 clksrc.read = tc_get_cycles32;
351340 /* setup ony channel 0 */
352341 tcb_setup_single_chan(tc, best_divisor_idx);
353−
354− /* register sched_clock on chips with single 32 bit counter */
355− sched_clock_register(tc_read_sched_clock, 32, divided_rate);
356342 } else {
357343 /* tclib will give us three clocks no matter what the
358344 * underlying platform supports.
drivers/cpufreq/cpufreq.c+8−3
@@ -680,9 +680,11 @@ static ssize_t show_cpuinfo_cur_freq(struct cpufreq_policy *policy, · 679 unmodified lines
680680 char *buf)
681681 {
682682 unsigned int cur_freq = __cpufreq_get(policy);
683− if (!cur_freq)
684− return sprintf(buf, "<unknown>");
685− return sprintf(buf, "%u\n", cur_freq);
683+
684+ if (cur_freq)
685+ return sprintf(buf, "%u\n", cur_freq);
686+
687+ return sprintf(buf, "<unknown>\n");
686688 }
687689
688690 /**
@@ -1182,6 +1184,9 @@ static int cpufreq_online(unsigned int cpu) · 493 unmodified lines
11821184 for_each_cpu(j, policy->related_cpus)
11831185 per_cpu(cpufreq_cpu_data, j) = policy;
11841186 write_unlock_irqrestore(&cpufreq_driver_lock, flags);
1187+ } else {
1188+ policy->min = policy->user_policy.min;
1189+ policy->max = policy->user_policy.max;
11851190 }
11861191
11871192 if (cpufreq_driver->get && !cpufreq_driver->setpolicy) {
drivers/cpufreq/intel_pstate.c+79−148
@@ -84,6 +84,11 @@ static inline u64 div_ext_fp(u64 x, u64 y) · 83 unmodified lines
8484 return div64_u64(x << EXT_FRAC_BITS, y);
8585 }
8686
87+static inline int32_t percent_ext_fp(int percent)
88+{
89+ return div_ext_fp(percent, 100);
90+}
91+
8792 /**
8893 * struct sample - Store performance sample
8994 * @core_avg_perf: Ratio of APERF/MPERF which is the actual average
@@ -359,9 +364,7 @@ static bool driver_registered __read_mostly; · 269 unmodified lines
359364 static bool acpi_ppc;
360365 #endif
361366
362−static struct perf_limits performance_limits;
363−static struct perf_limits powersave_limits;
364−static struct perf_limits *limits;
367+static struct perf_limits global;
365368
366369 static void intel_pstate_init_limits(struct perf_limits *limits)
367370 {
@@ -372,14 +375,6 @@ static void intel_pstate_init_limits(struct perf_limits *limits) · 4 unmodified lines
372375 limits->max_sysfs_pct = 100;
373376 }
374377
375−static void intel_pstate_set_performance_limits(struct perf_limits *limits)
376−{
377− intel_pstate_init_limits(limits);
378− limits->min_perf_pct = 100;
379− limits->min_perf = int_ext_tofp(1);
380− limits->min_sysfs_pct = 100;
381−}
382−
383378 static DEFINE_MUTEX(intel_pstate_driver_lock);
384379 static DEFINE_MUTEX(intel_pstate_limits_lock);
385380
@@ -502,7 +497,7 @@ static void intel_pstate_init_acpi_perf_limits(struct cpufreq_policy *policy) · 116 unmodified lines
502497 * correct max turbo frequency based on the turbo state.
503498 * Also need to convert to MHz as _PSS freq is in MHz.
504499 */
505− if (!limits->turbo_disabled)
500+ if (!global.turbo_disabled)
506501 cpu->acpi_perf_data.states[0].core_frequency =
507502 policy->cpuinfo.max_freq / 1000;
508503 cpu->valid_pss_table = true;
@@ -621,7 +616,7 @@ static inline void update_turbo_state(void) · 112 unmodified lines
621616
622617 cpu = all_cpu_data[0];
623618 rdmsrl(MSR_IA32_MISC_ENABLE, misc_en);
624− limits->turbo_disabled =
619+ global.turbo_disabled =
625620 (misc_en & MSR_IA32_MISC_ENABLE_TURBO_DISABLE ||
626621 cpu->pstate.max_pstate == cpu->pstate.turbo_pstate);
627622 }
@@ -845,12 +840,11 @@ static struct freq_attr *hwp_cpufreq_attrs[] = { · 217 unmodified lines
845840
846841 static void intel_pstate_hwp_set(struct cpufreq_policy *policy)
847842 {
848− int min, hw_min, max, hw_max, cpu, range, adj_range;
849− struct perf_limits *perf_limits = limits;
843+ int min, hw_min, max, hw_max, cpu;
844+ struct perf_limits *perf_limits = &global;
850845 u64 value, cap;
851846
852847 for_each_cpu(cpu, policy->cpus) {
853− int max_perf_pct, min_perf_pct;
854848 struct cpudata *cpu_data = all_cpu_data[cpu];
855849 s16 epp;
856850
@@ -859,24 +853,22 @@ static void intel_pstate_hwp_set(struct cpufreq_policy *policy) · 2 unmodified lines
859853
860854 rdmsrl_on_cpu(cpu, MSR_HWP_CAPABILITIES, &cap);
861855 hw_min = HWP_LOWEST_PERF(cap);
862− if (limits->no_turbo)
856+ if (global.no_turbo)
863857 hw_max = HWP_GUARANTEED_PERF(cap);
864858 else
865859 hw_max = HWP_HIGHEST_PERF(cap);
866− range = hw_max - hw_min;
867860
868− max_perf_pct = perf_limits->max_perf_pct;
869− min_perf_pct = perf_limits->min_perf_pct;
861+ max = fp_ext_toint(hw_max * perf_limits->max_perf);
862+ if (cpu_data->policy == CPUFREQ_POLICY_PERFORMANCE)
863+ min = max;
864+ else
865+ min = fp_ext_toint(hw_max * perf_limits->min_perf);
870866
871867 rdmsrl_on_cpu(cpu, MSR_HWP_REQUEST, &value);
872− adj_range = min_perf_pct * range / 100;
873− min = hw_min + adj_range;
868+
874869 value &= ~HWP_MIN_PERF(~0L);
875870 value |= HWP_MIN_PERF(min);
876871
877− adj_range = max_perf_pct * range / 100;
878− max = hw_min + adj_range;
879−
880872 value &= ~HWP_MAX_PERF(~0L);
881873 value |= HWP_MAX_PERF(max);
882874
@@ -969,26 +961,18 @@ static int intel_pstate_resume(struct cpufreq_policy *policy) · 86 unmodified lines
969961 }
970962
971963 static void intel_pstate_update_policies(void)
972− __releases(&intel_pstate_limits_lock)
973− __acquires(&intel_pstate_limits_lock)
974964 {
975− struct perf_limits *saved_limits = limits;
976965 int cpu;
977966
978− mutex_unlock(&intel_pstate_limits_lock);
979−
980967 for_each_possible_cpu(cpu)
981968 cpufreq_update_policy(cpu);
982−
983− mutex_lock(&intel_pstate_limits_lock);
984−
985− limits = saved_limits;
986969 }
987970
988971 /************************** debugfs begin ************************/
989972 static int pid_param_set(void *data, u64 val)
990973 {
991974 *(u32 *)data = val;
975+ pid_params.sample_rate_ns = pid_params.sample_rate_ms * NSEC_PER_MSEC;
992976 intel_pstate_reset_all_pid();
993977 return 0;
994978 }
@@ -1060,7 +1044,7 @@ static void intel_pstate_debug_hide_params(void) · 65 unmodified lines
10601044 static ssize_t show_##file_name \
10611045 (struct kobject *kobj, struct attribute *attr, char *buf) \
10621046 { \
1063− return sprintf(buf, "%u\n", limits->object); \
1047+ return sprintf(buf, "%u\n", global.object); \
10641048 }
10651049
10661050 static ssize_t intel_pstate_show_status(char *buf);
@@ -1151,10 +1135,10 @@ static ssize_t show_no_turbo(struct kobject *kobj, · 84 unmodified lines
11511135 }
11521136
11531137 update_turbo_state();
1154− if (limits->turbo_disabled)
1155− ret = sprintf(buf, "%u\n", limits->turbo_disabled);
1138+ if (global.turbo_disabled)
1139+ ret = sprintf(buf, "%u\n", global.turbo_disabled);
11561140 else
1157− ret = sprintf(buf, "%u\n", limits->no_turbo);
1141+ ret = sprintf(buf, "%u\n", global.no_turbo);
11581142
11591143 mutex_unlock(&intel_pstate_driver_lock);
11601144
@@ -1181,19 +1165,19 @@ static ssize_t store_no_turbo(struct kobject *a, struct attribute *b, · 20 unmodified lines
11811165 mutex_lock(&intel_pstate_limits_lock);
11821166
11831167 update_turbo_state();
1184− if (limits->turbo_disabled) {
1168+ if (global.turbo_disabled) {
11851169 pr_warn("Turbo disabled by BIOS or unavailable on processor\n");
11861170 mutex_unlock(&intel_pstate_limits_lock);
11871171 mutex_unlock(&intel_pstate_driver_lock);
11881172 return -EPERM;
11891173 }
11901174
1191− limits->no_turbo = clamp_t(int, input, 0, 1);
1192−
1193− intel_pstate_update_policies();
1175+ global.no_turbo = clamp_t(int, input, 0, 1);
11941176
11951177 mutex_unlock(&intel_pstate_limits_lock);
11961178
1179+ intel_pstate_update_policies();
1180+
11971181 mutex_unlock(&intel_pstate_driver_lock);
11981182
11991183 return count;
@@ -1218,19 +1202,16 @@ static ssize_t store_max_perf_pct(struct kobject *a, struct attribute *b, · 18 unmodified lines
12181202
12191203 mutex_lock(&intel_pstate_limits_lock);
12201204
1221− limits->max_sysfs_pct = clamp_t(int, input, 0 , 100);
1222− limits->max_perf_pct = min(limits->max_policy_pct,
1223− limits->max_sysfs_pct);
1224− limits->max_perf_pct = max(limits->min_policy_pct,
1225− limits->max_perf_pct);
1226− limits->max_perf_pct = max(limits->min_perf_pct,
1227− limits->max_perf_pct);
1228− limits->max_perf = div_ext_fp(limits->max_perf_pct, 100);
1229−
1230− intel_pstate_update_policies();
1205+ global.max_sysfs_pct = clamp_t(int, input, 0 , 100);
1206+ global.max_perf_pct = min(global.max_policy_pct, global.max_sysfs_pct);
1207+ global.max_perf_pct = max(global.min_policy_pct, global.max_perf_pct);
1208+ global.max_perf_pct = max(global.min_perf_pct, global.max_perf_pct);
1209+ global.max_perf = percent_ext_fp(global.max_perf_pct);
12311210
12321211 mutex_unlock(&intel_pstate_limits_lock);
12331212
1213+ intel_pstate_update_policies();
1214+
12341215 mutex_unlock(&intel_pstate_driver_lock);
12351216
12361217 return count;
@@ -1255,19 +1236,16 @@ static ssize_t store_min_perf_pct(struct kobject *a, struct attribute *b, · 18 unmodified lines
12551236
12561237 mutex_lock(&intel_pstate_limits_lock);
12571238
1258− limits->min_sysfs_pct = clamp_t(int, input, 0 , 100);
1259− limits->min_perf_pct = max(limits->min_policy_pct,
1260− limits->min_sysfs_pct);
1261− limits->min_perf_pct = min(limits->max_policy_pct,
1262− limits->min_perf_pct);
1263− limits->min_perf_pct = min(limits->max_perf_pct,
1264− limits->min_perf_pct);
1265− limits->min_perf = div_ext_fp(limits->min_perf_pct, 100);
1266−
1267− intel_pstate_update_policies();
1239+ global.min_sysfs_pct = clamp_t(int, input, 0 , 100);
1240+ global.min_perf_pct = max(global.min_policy_pct, global.min_sysfs_pct);
1241+ global.min_perf_pct = min(global.max_policy_pct, global.min_perf_pct);
1242+ global.min_perf_pct = min(global.max_perf_pct, global.min_perf_pct);
1243+ global.min_perf = percent_ext_fp(global.min_perf_pct);
12681244
12691245 mutex_unlock(&intel_pstate_limits_lock);
12701246
1247+ intel_pstate_update_policies();
1248+
12711249 mutex_unlock(&intel_pstate_driver_lock);
12721250
12731251 return count;
@@ -1387,7 +1365,7 @@ static u64 atom_get_val(struct cpudata *cpudata, int pstate) · 113 unmodified lines
13871365 u32 vid;
13881366
13891367 val = (u64)pstate << 8;
1390− if (limits->no_turbo && !limits->turbo_disabled)
1368+ if (global.no_turbo && !global.turbo_disabled)
13911369 val |= (u64)1 << 32;
13921370
13931371 vid_fp = cpudata->vid.min + mul_fp(
@@ -1557,7 +1535,7 @@ static u64 core_get_val(struct cpudata *cpudata, int pstate) · 163 unmodified lines
15571535 u64 val;
15581536
15591537 val = (u64)pstate << 8;
1560− if (limits->no_turbo && !limits->turbo_disabled)
1538+ if (global.no_turbo && !global.turbo_disabled)
15611539 val |= (u64)1 << 32;
15621540
15631541 return val;
@@ -1683,9 +1661,9 @@ static void intel_pstate_get_min_max(struct cpudata *cpu, int *min, int *max) · 119 unmodified lines
16831661 int max_perf = cpu->pstate.turbo_pstate;
16841662 int max_perf_adj;
16851663 int min_perf;
1686− struct perf_limits *perf_limits = limits;
1664+ struct perf_limits *perf_limits = &global;
16871665
1688− if (limits->no_turbo || limits->turbo_disabled)
1666+ if (global.no_turbo || global.turbo_disabled)
16891667 max_perf = cpu->pstate.max_pstate;
16901668
16911669 if (per_cpu_limits)
@@ -1820,7 +1798,7 @@ static inline int32_t get_target_pstate_use_cpu_load(struct cpudata *cpu) · 128 unmodified lines
18201798
18211799 sample->busy_scaled = busy_frac * 100;
18221800
1823− target = limits->no_turbo || limits->turbo_disabled ?
1801+ target = global.no_turbo || global.turbo_disabled ?
18241802 cpu->pstate.max_pstate : cpu->pstate.turbo_pstate;
18251803 target += target >> 2;
18261804 target = mul_fp(target, busy_frac);
@@ -2080,36 +2058,34 @@ static void intel_pstate_clear_update_util_hook(unsigned int cpu) · 253 unmodified lines
20802058 static void intel_pstate_update_perf_limits(struct cpufreq_policy *policy,
20812059 struct perf_limits *limits)
20822060 {
2061+ int32_t max_policy_perf, min_policy_perf;
20832062
2084− limits->max_policy_pct = DIV_ROUND_UP(policy->max * 100,
2085− policy->cpuinfo.max_freq);
2086− limits->max_policy_pct = clamp_t(int, limits->max_policy_pct, 0, 100);
2063+ max_policy_perf = div_ext_fp(policy->max, policy->cpuinfo.max_freq);
2064+ max_policy_perf = clamp_t(int32_t, max_policy_perf, 0, int_ext_tofp(1));
20872065 if (policy->max == policy->min) {
2088− limits->min_policy_pct = limits->max_policy_pct;
2066+ min_policy_perf = max_policy_perf;
20892067 } else {
2090− limits->min_policy_pct = DIV_ROUND_UP(policy->min * 100,
2091− policy->cpuinfo.max_freq);
2092− limits->min_policy_pct = clamp_t(int, limits->min_policy_pct,
2093− 0, 100);
2068+ min_policy_perf = div_ext_fp(policy->min,
2069+ policy->cpuinfo.max_freq);
2070+ min_policy_perf = clamp_t(int32_t, min_policy_perf,
2071+ 0, max_policy_perf);
20942072 }
20952073
2096− /* Normalize user input to [min_policy_pct, max_policy_pct] */
2097− limits->min_perf_pct = max(limits->min_policy_pct,
2098− limits->min_sysfs_pct);
2099− limits->min_perf_pct = min(limits->max_policy_pct,
2100− limits->min_perf_pct);
2101− limits->max_perf_pct = min(limits->max_policy_pct,
2102− limits->max_sysfs_pct);
2103− limits->max_perf_pct = max(limits->min_policy_pct,
2104− limits->max_perf_pct);
2105−
2106− /* Make sure min_perf_pct <= max_perf_pct */
2107− limits->min_perf_pct = min(limits->max_perf_pct, limits->min_perf_pct);
2108−
2109− limits->min_perf = div_ext_fp(limits->min_perf_pct, 100);
2110− limits->max_perf = div_ext_fp(limits->max_perf_pct, 100);
2074+ /* Normalize user input to [min_perf, max_perf] */
2075+ limits->min_perf = max(min_policy_perf,
2076+ percent_ext_fp(limits->min_sysfs_pct));
2077+ limits->min_perf = min(limits->min_perf, max_policy_perf);
2078+ limits->max_perf = min(max_policy_perf,
2079+ percent_ext_fp(limits->max_sysfs_pct));
2080+ limits->max_perf = max(min_policy_perf, limits->max_perf);
2081+
2082+ /* Make sure min_perf <= max_perf */
2083+ limits->min_perf = min(limits->min_perf, limits->max_perf);
2084+
21112085 limits->max_perf = round_up(limits->max_perf, EXT_FRAC_BITS);
21122086 limits->min_perf = round_up(limits->min_perf, EXT_FRAC_BITS);
2087+ limits->max_perf_pct = fp_ext_toint(limits->max_perf * 100);
2088+ limits->min_perf_pct = fp_ext_toint(limits->min_perf * 100);
21132089
21142090 pr_debug("cpu:%d max_perf_pct:%d min_perf_pct:%d\n", policy->cpu,
21152091 limits->max_perf_pct, limits->min_perf_pct);
@@ -2118,7 +2094,7 @@ static void intel_pstate_update_perf_limits(struct cpufreq_policy *policy, · 2 unmodified lines
21182094 static int intel_pstate_set_policy(struct cpufreq_policy *policy)
21192095 {
21202096 struct cpudata *cpu;
2121− struct perf_limits *perf_limits = NULL;
2097+ struct perf_limits *perf_limits = &global;
21222098
21232099 if (!policy->cpuinfo.max_freq)
21242100 return -ENODEV;
@@ -2141,21 +2117,6 @@ static int intel_pstate_set_policy(struct cpufreq_policy *policy) · 16 unmodified lines
21412117
21422118 mutex_lock(&intel_pstate_limits_lock);
21432119
2144− if (policy->policy == CPUFREQ_POLICY_PERFORMANCE) {
2145− pr_debug("set performance\n");
2146− if (!perf_limits) {
2147− limits = &performance_limits;
2148− perf_limits = limits;
2149− }
2150− } else {
2151− pr_debug("set powersave\n");
2152− if (!perf_limits) {
2153− limits = &powersave_limits;
2154− perf_limits = limits;
2155− }
2156−
2157− }
2158−
21592120 intel_pstate_update_perf_limits(policy, perf_limits);
21602121
21612122 if (cpu->policy == CPUFREQ_POLICY_PERFORMANCE) {
@@ -2179,16 +2140,9 @@ static int intel_pstate_set_policy(struct cpufreq_policy *policy) · 17 unmodified lines
21792140 static int intel_pstate_verify_policy(struct cpufreq_policy *policy)
21802141 {
21812142 struct cpudata *cpu = all_cpu_data[policy->cpu];
2182− struct perf_limits *perf_limits;
2183−
2184− if (policy->policy == CPUFREQ_POLICY_PERFORMANCE)
2185− perf_limits = &performance_limits;
2186− else
2187− perf_limits = &powersave_limits;
21882143
21892144 update_turbo_state();
2190− policy->cpuinfo.max_freq = perf_limits->turbo_disabled ||
2191− perf_limits->no_turbo ?
2145+ policy->cpuinfo.max_freq = global.turbo_disabled || global.no_turbo ?
21922146 cpu->pstate.max_freq :
21932147 cpu->pstate.turbo_freq;
21942148
@@ -2203,9 +2157,9 @@ static int intel_pstate_verify_policy(struct cpufreq_policy *policy) · 8 unmodified lines
22032157 unsigned int max_freq, min_freq;
22042158
22052159 max_freq = policy->cpuinfo.max_freq *
2206− perf_limits->max_sysfs_pct / 100;
2160+ global.max_sysfs_pct / 100;
22072161 min_freq = policy->cpuinfo.max_freq *
2208− perf_limits->min_sysfs_pct / 100;
2162+ global.min_sysfs_pct / 100;
22092163 cpufreq_verify_within_limits(policy, min_freq, max_freq);
22102164 }
22112165
@@ -2257,7 +2211,7 @@ static int __intel_pstate_cpu_init(struct cpufreq_policy *policy) · 45 unmodified lines
22572211 /* cpuinfo and default policy values */
22582212 policy->cpuinfo.min_freq = cpu->pstate.min_pstate * cpu->pstate.scaling;
22592213 update_turbo_state();
2260− policy->cpuinfo.max_freq = limits->turbo_disabled ?
2214+ policy->cpuinfo.max_freq = global.turbo_disabled ?
22612215 cpu->pstate.max_pstate : cpu->pstate.turbo_pstate;
22622216 policy->cpuinfo.max_freq *= cpu->pstate.scaling;
22632217
@@ -2277,7 +2231,7 @@ static int intel_pstate_cpu_init(struct cpufreq_policy *policy) · 13 unmodified lines
22772231 return ret;
22782232
22792233 policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL;
2280− if (limits->min_perf_pct == 100 && limits->max_perf_pct == 100)
2234+ if (IS_ENABLED(CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE))
22812235 policy->policy = CPUFREQ_POLICY_PERFORMANCE;
22822236 else
22832237 policy->policy = CPUFREQ_POLICY_POWERSAVE;
@@ -2303,7 +2257,7 @@ static int intel_cpufreq_verify_policy(struct cpufreq_policy *policy) · 19 unmodified lines
23032257 struct cpudata *cpu = all_cpu_data[policy->cpu];
23042258
23052259 update_turbo_state();
2306− policy->cpuinfo.max_freq = limits->turbo_disabled ?
2260+ policy->cpuinfo.max_freq = global.no_turbo || global.turbo_disabled ?
23072261 cpu->pstate.max_freq : cpu->pstate.turbo_freq;
23082262
23092263 cpufreq_verify_within_cpu_limits(policy);
@@ -2311,26 +2265,6 @@ static int intel_cpufreq_verify_policy(struct cpufreq_policy *policy) · 1 unmodified line
23112265 return 0;
23122266 }
23132267
2314−static unsigned int intel_cpufreq_turbo_update(struct cpudata *cpu,
2315− struct cpufreq_policy *policy,
2316− unsigned int target_freq)
2317−{
2318− unsigned int max_freq;
2319−
2320− update_turbo_state();
2321−
2322− max_freq = limits->no_turbo || limits->turbo_disabled ?
2323− cpu->pstate.max_freq : cpu->pstate.turbo_freq;
2324− policy->cpuinfo.max_freq = max_freq;
2325− if (policy->max > max_freq)
2326− policy->max = max_freq;
2327−
2328− if (target_freq > max_freq)
2329− target_freq = max_freq;
2330−
2331− return target_freq;
2332−}
2333−
23342268 static int intel_cpufreq_target(struct cpufreq_policy *policy,
23352269 unsigned int target_freq,
23362270 unsigned int relation)
@@ -2339,8 +2273,10 @@ static int intel_cpufreq_target(struct cpufreq_policy *policy, · 2 unmodified lines
23392273 struct cpufreq_freqs freqs;
23402274 int target_pstate;
23412275
2276+ update_turbo_state();
2277+
23422278 freqs.old = policy->cur;
2343− freqs.new = intel_cpufreq_turbo_update(cpu, policy, target_freq);
2279+ freqs.new = target_freq;
23442280
23452281 cpufreq_freq_transition_begin(policy, &freqs);
23462282 switch (relation) {
@@ -2372,7 +2308,8 @@ static unsigned int intel_cpufreq_fast_switch(struct cpufreq_policy *policy, · 25 unmodified lines
23722308 struct cpudata *cpu = all_cpu_data[policy->cpu];
23732309 int target_pstate;
23742310
2375− target_freq = intel_cpufreq_turbo_update(cpu, policy, target_freq);
2311+ update_turbo_state();
2312+
23762313 target_pstate = DIV_ROUND_UP(target_freq, cpu->pstate.scaling);
23772314 target_pstate = intel_pstate_prepare_request(cpu, target_pstate);
23782315 intel_pstate_update_pstate(cpu, target_pstate);
@@ -2427,13 +2364,7 @@ static int intel_pstate_register_driver(void) · 48 unmodified lines
24272364 {
24282365 int ret;
24292366
2430− intel_pstate_init_limits(&powersave_limits);
2431− intel_pstate_set_performance_limits(&performance_limits);
2432− if (IS_ENABLED(CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE) &&
2433− intel_pstate_driver == &intel_pstate)
2434− limits = &performance_limits;
2435− else
2436− limits = &powersave_limits;
2367+ intel_pstate_init_limits(&global);
24372368
24382369 ret = cpufreq_register_driver(intel_pstate_driver);
24392370 if (ret) {
drivers/cpuidle/sysfs.c+12−0
@@ -615,6 +615,18 @@ int cpuidle_add_sysfs(struct cpuidle_device *dev) · 614 unmodified lines
615615 struct device *cpu_dev = get_cpu_device((unsigned long)dev->cpu);
616616 int error;
617617
618+ /*
619+ * Return if cpu_device is not setup for this CPU.
620+ *
621+ * This could happen if the arch did not set up cpu_device
622+ * since this CPU is not in cpu_present mask and the
623+ * driver did not send a correct CPU mask during registration.
624+ * Without this check we would end up passing bogus
625+ * value for &cpu_dev->kobj in kobject_init_and_add()
626+ */
627+ if (!cpu_dev)
628+ return -ENODEV;
629+
618630 kdev = kzalloc(sizeof(*kdev), GFP_KERNEL);
619631 if (!kdev)
620632 return -ENOMEM;
drivers/crypto/ccp/ccp-dev.c+4−1
@@ -283,11 +283,14 @@ EXPORT_SYMBOL_GPL(ccp_version); · 282 unmodified lines
283283 */
284284 int ccp_enqueue_cmd(struct ccp_cmd *cmd)
285285 {
286− struct ccp_device *ccp = ccp_get_device();
286+ struct ccp_device *ccp;
287287 unsigned long flags;
288288 unsigned int i;
289289 int ret;
290290
291+ /* Some commands might need to be sent to a specific device */
292+ ccp = cmd->ccp ? cmd->ccp : ccp_get_device();
293+
291294 if (!ccp)
292295 return -ENODEV;
293296
drivers/crypto/ccp/ccp-dmaengine.c+1−0
@@ -390,6 +390,7 @@ static struct ccp_dma_desc *ccp_create_desc(struct dma_chan *dma_chan, · 389 unmodified lines
390390 goto err;
391391
392392 ccp_cmd = &cmd->ccp_cmd;
393+ ccp_cmd->ccp = chan->ccp;
393394 ccp_pt = &ccp_cmd->u.passthru_nomap;
394395 ccp_cmd->flags = CCP_CMD_MAY_BACKLOG;
395396 ccp_cmd->flags |= CCP_CMD_PASSTHRU_NO_DMA_MAP;
drivers/crypto/s5p-sss.c+85−47
@@ -270,7 +270,7 @@ static void s5p_sg_copy_buf(void *buf, struct scatterlist *sg, · 269 unmodified lines
270270 scatterwalk_done(&walk, out, 0);
271271 }
272272
273−static void s5p_aes_complete(struct s5p_aes_dev *dev, int err)
273+static void s5p_sg_done(struct s5p_aes_dev *dev)
274274 {
275275 if (dev->sg_dst_cpy) {
276276 dev_dbg(dev->dev,
@@ -281,8 +281,11 @@ static void s5p_aes_complete(struct s5p_aes_dev *dev, int err) · 4 unmodified lines
281281 }
282282 s5p_free_sg_cpy(dev, &dev->sg_src_cpy);
283283 s5p_free_sg_cpy(dev, &dev->sg_dst_cpy);
284+}
284285
285− /* holding a lock outside */
286+/* Calls the completion. Cannot be called with dev->lock hold. */
287+static void s5p_aes_complete(struct s5p_aes_dev *dev, int err)
288+{
286289 dev->req->base.complete(&dev->req->base, err);
287290 dev->busy = false;
288291 }
@@ -368,51 +371,44 @@ exit: · 79 unmodified lines
368371 }
369372
370373 /*
371− * Returns true if new transmitting (output) data is ready and its
372− * address+length have to be written to device (by calling
373− * s5p_set_dma_outdata()). False otherwise.
374+ * Returns -ERRNO on error (mapping of new data failed).
375+ * On success returns:
376+ * - 0 if there is no more data,
377+ * - 1 if new transmitting (output) data is ready and its address+length
378+ * have to be written to device (by calling s5p_set_dma_outdata()).
374379 */
375−static bool s5p_aes_tx(struct s5p_aes_dev *dev)
380+static int s5p_aes_tx(struct s5p_aes_dev *dev)
376381 {
377− int err = 0;
378− bool ret = false;
382+ int ret = 0;
379383
380384 s5p_unset_outdata(dev);
381385
382386 if (!sg_is_last(dev->sg_dst)) {
383− err = s5p_set_outdata(dev, sg_next(dev->sg_dst));
384− if (err)
385− s5p_aes_complete(dev, err);
386− else
387− ret = true;
388− } else {
389− s5p_aes_complete(dev, err);
390−
391− dev->busy = true;
392− tasklet_schedule(&dev->tasklet);
387+ ret = s5p_set_outdata(dev, sg_next(dev->sg_dst));
388+ if (!ret)
389+ ret = 1;
393390 }
394391
395392 return ret;
396393 }
397394
398395 /*
399− * Returns true if new receiving (input) data is ready and its
400− * address+length have to be written to device (by calling
401− * s5p_set_dma_indata()). False otherwise.
396+ * Returns -ERRNO on error (mapping of new data failed).
397+ * On success returns:
398+ * - 0 if there is no more data,
399+ * - 1 if new receiving (input) data is ready and its address+length
400+ * have to be written to device (by calling s5p_set_dma_indata()).
402401 */
403−static bool s5p_aes_rx(struct s5p_aes_dev *dev)
402+static int s5p_aes_rx(struct s5p_aes_dev *dev/*, bool *set_dma*/)
404403 {
405− int err;
406− bool ret = false;
404+ int ret = 0;
407405
408406 s5p_unset_indata(dev);
409407
410408 if (!sg_is_last(dev->sg_src)) {
411− err = s5p_set_indata(dev, sg_next(dev->sg_src));
412− if (err)
413− s5p_aes_complete(dev, err);
414− else
415− ret = true;
409+ ret = s5p_set_indata(dev, sg_next(dev->sg_src));
410+ if (!ret)
411+ ret = 1;
416412 }
417413
418414 return ret;
@@ -422,33 +418,73 @@ static irqreturn_t s5p_aes_interrupt(int irq, void *dev_id) · 3 unmodified lines
422418 {
423419 struct platform_device *pdev = dev_id;
424420 struct s5p_aes_dev *dev = platform_get_drvdata(pdev);
425− bool set_dma_tx = false;
426− bool set_dma_rx = false;
421+ int err_dma_tx = 0;
422+ int err_dma_rx = 0;
423+ bool tx_end = false;
427424 unsigned long flags;
428425 uint32_t status;
426+ int err;
429427
430428 spin_lock_irqsave(&dev->lock, flags);
431429
430+ /*
431+ * Handle rx or tx interrupt. If there is still data (scatterlist did not
432+ * reach end), then map next scatterlist entry.
433+ * In case of such mapping error, s5p_aes_complete() should be called.
434+ *
435+ * If there is no more data in tx scatter list, call s5p_aes_complete()
436+ * and schedule new tasklet.
437+ */
432438 status = SSS_READ(dev, FCINTSTAT);
433439 if (status & SSS_FCINTSTAT_BRDMAINT)
434− set_dma_rx = s5p_aes_rx(dev);
435− if (status & SSS_FCINTSTAT_BTDMAINT)
436− set_dma_tx = s5p_aes_tx(dev);
440+ err_dma_rx = s5p_aes_rx(dev);
441+
442+ if (status & SSS_FCINTSTAT_BTDMAINT) {
443+ if (sg_is_last(dev->sg_dst))
444+ tx_end = true;
445+ err_dma_tx = s5p_aes_tx(dev);
446+ }
437447
438448 SSS_WRITE(dev, FCINTPEND, status);
439449
440− /*
441− * Writing length of DMA block (either receiving or transmitting)
442− * will start the operation immediately, so this should be done
443− * at the end (even after clearing pending interrupts to not miss the
444− * interrupt).
445− */
446− if (set_dma_tx)
447− s5p_set_dma_outdata(dev, dev->sg_dst);
448− if (set_dma_rx)
449− s5p_set_dma_indata(dev, dev->sg_src);
450+ if (err_dma_rx < 0) {
451+ err = err_dma_rx;
452+ goto error;
453+ }
454+ if (err_dma_tx < 0) {
455+ err = err_dma_tx;
456+ goto error;
457+ }
458+
459+ if (tx_end) {
460+ s5p_sg_done(dev);
461+
462+ spin_unlock_irqrestore(&dev->lock, flags);
463+
464+ s5p_aes_complete(dev, 0);
465+ dev->busy = true;
466+ tasklet_schedule(&dev->tasklet);
467+ } else {
468+ /*
469+ * Writing length of DMA block (either receiving or
470+ * transmitting) will start the operation immediately, so this
471+ * should be done at the end (even after clearing pending
472+ * interrupts to not miss the interrupt).
473+ */
474+ if (err_dma_tx == 1)
475+ s5p_set_dma_outdata(dev, dev->sg_dst);
476+ if (err_dma_rx == 1)
477+ s5p_set_dma_indata(dev, dev->sg_src);
450478
479+ spin_unlock_irqrestore(&dev->lock, flags);
480+ }
481+
482+ return IRQ_HANDLED;
483+
484+error:
485+ s5p_sg_done(dev);
451486 spin_unlock_irqrestore(&dev->lock, flags);
487+ s5p_aes_complete(dev, err);
452488
453489 return IRQ_HANDLED;
454490 }
@@ -597,8 +633,9 @@ outdata_error: · 142 unmodified lines
597633 s5p_unset_indata(dev);
598634
599635 indata_error:
600− s5p_aes_complete(dev, err);
636+ s5p_sg_done(dev);
601637 spin_unlock_irqrestore(&dev->lock, flags);
638+ s5p_aes_complete(dev, err);
602639 }
603640
604641 static void s5p_tasklet_cb(unsigned long data)
@@ -805,8 +842,9 @@ static int s5p_aes_probe(struct platform_device *pdev) · 200 unmodified lines
805842 dev_warn(dev, "feed control interrupt is not available.\n");
806843 goto err_irq;
807844 }
808− err = devm_request_irq(dev, pdata->irq_fc, s5p_aes_interrupt,
809− IRQF_SHARED, pdev->name, pdev);
845+ err = devm_request_threaded_irq(dev, pdata->irq_fc, NULL,
846+ s5p_aes_interrupt, IRQF_ONESHOT,
847+ pdev->name, pdev);
810848 if (err < 0) {
811849 dev_warn(dev, "feed control interrupt is not available.\n");
812850 goto err_irq;
drivers/dax/Kconfig+1−0
@@ -2,6 +2,7 @@ menuconfig DEV_DAX · 1 unmodified line
22 tristate "DAX: direct access to differentiated memory"
33 default m if NVDIMM_DAX
44 depends on TRANSPARENT_HUGEPAGE
5+ select SRCU
56 help
67 Support raw access to differentiated (persistence, bandwidth,
78 latency...) memory via an mmap(2) capable character
drivers/dax/dax.c+37−9
@@ -25,6 +25,7 @@ · 24 unmodified lines
2525 #include "dax.h"
2626
2727 static dev_t dax_devt;
28+DEFINE_STATIC_SRCU(dax_srcu);
2829 static struct class *dax_class;
2930 static DEFINE_IDA(dax_minor_ida);
3031 static int nr_dax = CONFIG_NR_DEV_DAX;
@@ -60,7 +61,7 @@ struct dax_region { · 29 unmodified lines
6061 * @region - parent region
6162 * @dev - device backing the character device
6263 * @cdev - core chardev data
63− * @alive - !alive + rcu grace period == no new mappings can be established
64+ * @alive - !alive + srcu grace period == no new mappings can be established
6465 * @id - child id in the region
6566 * @num_resources - number of physical address extents in this device
6667 * @res - array of physical address ranges
@@ -427,6 +428,7 @@ static int __dax_dev_pte_fault(struct dax_dev *dax_dev, struct vm_fault *vmf) · 360 unmodified lines
427428 int rc = VM_FAULT_SIGBUS;
428429 phys_addr_t phys;
429430 pfn_t pfn;
431+ unsigned int fault_size = PAGE_SIZE;
430432
431433 if (check_vma(dax_dev, vmf->vma, __func__))
432434 return VM_FAULT_SIGBUS;
@@ -437,9 +439,12 @@ static int __dax_dev_pte_fault(struct dax_dev *dax_dev, struct vm_fault *vmf) · 4 unmodified lines
437439 return VM_FAULT_SIGBUS;
438440 }
439441
442+ if (fault_size != dax_region->align)
443+ return VM_FAULT_SIGBUS;
444+
440445 phys = pgoff_to_phys(dax_dev, vmf->pgoff, PAGE_SIZE);
441446 if (phys == -1) {
442− dev_dbg(dev, "%s: phys_to_pgoff(%#lx) failed\n", __func__,
447+ dev_dbg(dev, "%s: pgoff_to_phys(%#lx) failed\n", __func__,
443448 vmf->pgoff);
444449 return VM_FAULT_SIGBUS;
445450 }
@@ -464,6 +469,7 @@ static int __dax_dev_pmd_fault(struct dax_dev *dax_dev, struct vm_fault *vmf) · 18 unmodified lines
464469 phys_addr_t phys;
465470 pgoff_t pgoff;
466471 pfn_t pfn;
472+ unsigned int fault_size = PMD_SIZE;
467473
468474 if (check_vma(dax_dev, vmf->vma, __func__))
469475 return VM_FAULT_SIGBUS;
@@ -480,10 +486,20 @@ static int __dax_dev_pmd_fault(struct dax_dev *dax_dev, struct vm_fault *vmf) · 10 unmodified lines
480486 return VM_FAULT_SIGBUS;
481487 }
482488
489+ if (fault_size < dax_region->align)
490+ return VM_FAULT_SIGBUS;
491+ else if (fault_size > dax_region->align)
492+ return VM_FAULT_FALLBACK;
493+
494+ /* if we are outside of the VMA */
495+ if (pmd_addr < vmf->vma->vm_start ||
496+ (pmd_addr + PMD_SIZE) > vmf->vma->vm_end)
497+ return VM_FAULT_SIGBUS;
498+
483499 pgoff = linear_page_index(vmf->vma, pmd_addr);
484500 phys = pgoff_to_phys(dax_dev, pgoff, PMD_SIZE);
485501 if (phys == -1) {
486− dev_dbg(dev, "%s: phys_to_pgoff(%#lx) failed\n", __func__,
502+ dev_dbg(dev, "%s: pgoff_to_phys(%#lx) failed\n", __func__,
487503 pgoff);
488504 return VM_FAULT_SIGBUS;
489505 }
@@ -503,6 +519,8 @@ static int __dax_dev_pud_fault(struct dax_dev *dax_dev, struct vm_fault *vmf) · 13 unmodified lines
503519 phys_addr_t phys;
504520 pgoff_t pgoff;
505521 pfn_t pfn;
522+ unsigned int fault_size = PUD_SIZE;
523+
506524
507525 if (check_vma(dax_dev, vmf->vma, __func__))
508526 return VM_FAULT_SIGBUS;
@@ -519,10 +537,20 @@ static int __dax_dev_pud_fault(struct dax_dev *dax_dev, struct vm_fault *vmf) · 10 unmodified lines
519537 return VM_FAULT_SIGBUS;
520538 }
521539
540+ if (fault_size < dax_region->align)
541+ return VM_FAULT_SIGBUS;
542+ else if (fault_size > dax_region->align)
543+ return VM_FAULT_FALLBACK;
544+
545+ /* if we are outside of the VMA */
546+ if (pud_addr < vmf->vma->vm_start ||
547+ (pud_addr + PUD_SIZE) > vmf->vma->vm_end)
548+ return VM_FAULT_SIGBUS;
549+
522550 pgoff = linear_page_index(vmf->vma, pud_addr);
523551 phys = pgoff_to_phys(dax_dev, pgoff, PUD_SIZE);
524552 if (phys == -1) {
525− dev_dbg(dev, "%s: phys_to_pgoff(%#lx) failed\n", __func__,
553+ dev_dbg(dev, "%s: pgoff_to_phys(%#lx) failed\n", __func__,
526554 pgoff);
527555 return VM_FAULT_SIGBUS;
528556 }
@@ -542,7 +570,7 @@ static int __dax_dev_pud_fault(struct dax_dev *dax_dev, struct vm_fault *vmf) · 13 unmodified lines
542570 static int dax_dev_huge_fault(struct vm_fault *vmf,
543571 enum page_entry_size pe_size)
544572 {
545− int rc;
573+ int rc, id;
546574 struct file *filp = vmf->vma->vm_file;
547575 struct dax_dev *dax_dev = filp->private_data;
548576
@@ -551,7 +579,7 @@ static int dax_dev_huge_fault(struct vm_fault *vmf, · 2 unmodified lines
551579 ? "write" : "read",
552580 vmf->vma->vm_start, vmf->vma->vm_end);
553581
554− rcu_read_lock();
582+ id = srcu_read_lock(&dax_srcu);
555583 switch (pe_size) {
556584 case PE_SIZE_PTE:
557585 rc = __dax_dev_pte_fault(dax_dev, vmf);
@@ -565,7 +593,7 @@ static int dax_dev_huge_fault(struct vm_fault *vmf, · 7 unmodified lines
565593 default:
566594 return VM_FAULT_FALLBACK;
567595 }
568− rcu_read_unlock();
596+ srcu_read_unlock(&dax_srcu, id);
569597
570598 return rc;
571599 }
@@ -681,11 +709,11 @@ static void kill_dax_dev(struct dax_dev *dax_dev) · 109 unmodified lines
681709 * Note, rcu is not protecting the liveness of dax_dev, rcu is
682710 * ensuring that any fault handlers that might have seen
683711 * dax_dev->alive == true, have completed. Any fault handlers
684− * that start after synchronize_rcu() has started will abort
712+ * that start after synchronize_srcu() has started will abort
685713 * upon seeing dax_dev->alive == false.
686714 */
687715 dax_dev->alive = false;
688− synchronize_rcu();
716+ synchronize_srcu(&dax_srcu);
689717 unmap_mapping_range(dax_dev->inode->i_mapping, 0, 0, 1);
690718 }
691719
drivers/extcon/Kconfig+1−1
@@ -44,7 +44,7 @@ config EXTCON_GPIO · 43 unmodified lines
4444
4545 config EXTCON_INTEL_INT3496
4646 tristate "Intel INT3496 ACPI device extcon driver"
47− depends on GPIOLIB && ACPI
47+ depends on GPIOLIB && ACPI && (X86 || COMPILE_TEST)
4848 help
4949 Say Y here to enable extcon support for USB OTG ports controlled by
5050 an Intel INT3496 ACPI device.
drivers/extcon/extcon-intel-int3496.c+28−11
@@ -45,6 +45,17 @@ static const unsigned int int3496_cable[] = { · 44 unmodified lines
4545 EXTCON_NONE,
4646 };
4747
48+static const struct acpi_gpio_params id_gpios = { INT3496_GPIO_USB_ID, 0, false };
49+static const struct acpi_gpio_params vbus_gpios = { INT3496_GPIO_VBUS_EN, 0, false };
50+static const struct acpi_gpio_params mux_gpios = { INT3496_GPIO_USB_MUX, 0, false };
51+
52+static const struct acpi_gpio_mapping acpi_int3496_default_gpios[] = {
53+ { "id-gpios", &id_gpios, 1 },
54+ { "vbus-gpios", &vbus_gpios, 1 },
55+ { "mux-gpios", &mux_gpios, 1 },
56+ { },
57+};
58+
4859 static void int3496_do_usb_id(struct work_struct *work)
4960 {
5061 struct int3496_data *data =
@@ -83,6 +94,13 @@ static int int3496_probe(struct platform_device *pdev) · 32 unmodified lines
8394 struct int3496_data *data;
8495 int ret;
8596
97+ ret = acpi_dev_add_driver_gpios(ACPI_COMPANION(dev),
98+ acpi_int3496_default_gpios);
99+ if (ret) {
100+ dev_err(dev, "can't add GPIO ACPI mapping\n");
101+ return ret;
102+ }
103+
86104 data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
87105 if (!data)
88106 return -ENOMEM;
@@ -90,30 +108,27 @@ static int int3496_probe(struct platform_device *pdev) · 1 unmodified line
90108 data->dev = dev;
91109 INIT_DELAYED_WORK(&data->work, int3496_do_usb_id);
92110
93− data->gpio_usb_id = devm_gpiod_get_index(dev, "id",
94− INT3496_GPIO_USB_ID,
95− GPIOD_IN);
111+ data->gpio_usb_id = devm_gpiod_get(dev, "id", GPIOD_IN);
96112 if (IS_ERR(data->gpio_usb_id)) {
97113 ret = PTR_ERR(data->gpio_usb_id);
98114 dev_err(dev, "can't request USB ID GPIO: %d\n", ret);
99115 return ret;
116+ } else if (gpiod_get_direction(data->gpio_usb_id) != GPIOF_DIR_IN) {
117+ dev_warn(dev, FW_BUG "USB ID GPIO not in input mode, fixing\n");
118+ gpiod_direction_input(data->gpio_usb_id);
100119 }
101120
102121 data->usb_id_irq = gpiod_to_irq(data->gpio_usb_id);
103− if (data->usb_id_irq <= 0) {
122+ if (data->usb_id_irq < 0) {
104123 dev_err(dev, "can't get USB ID IRQ: %d\n", data->usb_id_irq);
105− return -EINVAL;
124+ return data->usb_id_irq;
106125 }
107126
108− data->gpio_vbus_en = devm_gpiod_get_index(dev, "vbus en",
109− INT3496_GPIO_VBUS_EN,
110− GPIOD_ASIS);
127+ data->gpio_vbus_en = devm_gpiod_get(dev, "vbus", GPIOD_ASIS);
111128 if (IS_ERR(data->gpio_vbus_en))
112129 dev_info(dev, "can't request VBUS EN GPIO\n");
113130
114− data->gpio_usb_mux = devm_gpiod_get_index(dev, "usb mux",
115− INT3496_GPIO_USB_MUX,
116− GPIOD_ASIS);
131+ data->gpio_usb_mux = devm_gpiod_get(dev, "mux", GPIOD_ASIS);
117132 if (IS_ERR(data->gpio_usb_mux))
118133 dev_info(dev, "can't request USB MUX GPIO\n");
119134
@@ -154,6 +169,8 @@ static int int3496_remove(struct platform_device *pdev) · 34 unmodified lines
154169 devm_free_irq(&pdev->dev, data->usb_id_irq, data);
155170 cancel_delayed_work_sync(&data->work);
156171
172+ acpi_dev_remove_driver_gpios(ACPI_COMPANION(&pdev->dev));
173+
157174 return 0;
158175 }
159176
drivers/gpio/gpio-altera-a10sr.c+1−1
@@ -96,7 +96,7 @@ static int altr_a10sr_gpio_probe(struct platform_device *pdev) · 95 unmodified lines
9696 gpio->regmap = a10sr->regmap;
9797
9898 gpio->gp = altr_a10sr_gc;
99−
99+ gpio->gp.parent = pdev->dev.parent;
100100 gpio->gp.of_node = pdev->dev.of_node;
101101
102102 ret = devm_gpiochip_add_data(&pdev->dev, &gpio->gp, gpio);
drivers/gpio/gpio-altera.c+11−15
@@ -90,21 +90,18 @@ static int altera_gpio_irq_set_type(struct irq_data *d, · 89 unmodified lines
9090
9191 altera_gc = gpiochip_get_data(irq_data_get_irq_chip_data(d));
9292
93− if (type == IRQ_TYPE_NONE)
93+ if (type == IRQ_TYPE_NONE) {
94+ irq_set_handler_locked(d, handle_bad_irq);
9495 return 0;
95− if (type == IRQ_TYPE_LEVEL_HIGH &&
96− altera_gc->interrupt_trigger == IRQ_TYPE_LEVEL_HIGH)
97− return 0;
98− if (type == IRQ_TYPE_EDGE_RISING &&
99− altera_gc->interrupt_trigger == IRQ_TYPE_EDGE_RISING)
100− return 0;
101− if (type == IRQ_TYPE_EDGE_FALLING &&
102− altera_gc->interrupt_trigger == IRQ_TYPE_EDGE_FALLING)
103− return 0;
104− if (type == IRQ_TYPE_EDGE_BOTH &&
105− altera_gc->interrupt_trigger == IRQ_TYPE_EDGE_BOTH)
96+ }
97+ if (type == altera_gc->interrupt_trigger) {
98+ if (type == IRQ_TYPE_LEVEL_HIGH)
99+ irq_set_handler_locked(d, handle_level_irq);
100+ else
101+ irq_set_handler_locked(d, handle_simple_irq);
106102 return 0;
107−
103+ }
104+ irq_set_handler_locked(d, handle_bad_irq);
108105 return -EINVAL;
109106 }
110107
@@ -230,7 +227,6 @@ static void altera_gpio_irq_edge_handler(struct irq_desc *desc) · 119 unmodified lines
230227 chained_irq_exit(chip, desc);
231228 }
232229
233−
234230 static void altera_gpio_irq_leveL_high_handler(struct irq_desc *desc)
235231 {
236232 struct altera_gpio_chip *altera_gc;
@@ -310,7 +306,7 @@ static int altera_gpio_probe(struct platform_device *pdev) · 73 unmodified lines
310306 altera_gc->interrupt_trigger = reg;
311307
312308 ret = gpiochip_irqchip_add(&altera_gc->mmchip.gc, &altera_irq_chip, 0,
313− handle_simple_irq, IRQ_TYPE_NONE);
309+ handle_bad_irq, IRQ_TYPE_NONE);
314310
315311 if (ret) {
316312 dev_err(&pdev->dev, "could not add irqchip\n");
drivers/gpio/gpio-mcp23s08.c+60−5
@@ -270,8 +270,10 @@ mcp23s08_direction_output(struct gpio_chip *chip, unsigned offset, int value) · 269 unmodified lines
270270 static irqreturn_t mcp23s08_irq(int irq, void *data)
271271 {
272272 struct mcp23s08 *mcp = data;
273− int intcap, intf, i;
273+ int intcap, intf, i, gpio, gpio_orig, intcap_mask;
274274 unsigned int child_irq;
275+ bool intf_set, intcap_changed, gpio_bit_changed,
276+ defval_changed, gpio_set;
275277
276278 mutex_lock(&mcp->lock);
277279 if (mcp_read(mcp, MCP_INTF, &intf) < 0) {
@@ -287,14 +289,67 @@ static irqreturn_t mcp23s08_irq(int irq, void *data) · 9 unmodified lines
287289 }
288290
289291 mcp->cache[MCP_INTCAP] = intcap;
292+
293+ /* This clears the interrupt(configurable on S18) */
294+ if (mcp_read(mcp, MCP_GPIO, &gpio) < 0) {
295+ mutex_unlock(&mcp->lock);
296+ return IRQ_HANDLED;
297+ }
298+ gpio_orig = mcp->cache[MCP_GPIO];
299+ mcp->cache[MCP_GPIO] = gpio;
290300 mutex_unlock(&mcp->lock);
291301
302+ if (mcp->cache[MCP_INTF] == 0) {
303+ /* There is no interrupt pending */
304+ return IRQ_HANDLED;
305+ }
306+
307+ dev_dbg(mcp->chip.parent,
308+ "intcap 0x%04X intf 0x%04X gpio_orig 0x%04X gpio 0x%04X\n",
309+ intcap, intf, gpio_orig, gpio);
292310
293311 for (i = 0; i < mcp->chip.ngpio; i++) {
294− if ((BIT(i) & mcp->cache[MCP_INTF]) &&
295− ((BIT(i) & intcap & mcp->irq_rise) ||
296− (mcp->irq_fall & ~intcap & BIT(i)) ||
297− (BIT(i) & mcp->cache[MCP_INTCON]))) {
312+ /* We must check all of the inputs on the chip,
313+ * otherwise we may not notice a change on >=2 pins.
314+ *
315+ * On at least the mcp23s17, INTCAP is only updated
316+ * one byte at a time(INTCAPA and INTCAPB are
317+ * not written to at the same time - only on a per-bank
318+ * basis).
319+ *
320+ * INTF only contains the single bit that caused the
321+ * interrupt per-bank. On the mcp23s17, there is
322+ * INTFA and INTFB. If two pins are changed on the A
323+ * side at the same time, INTF will only have one bit
324+ * set. If one pin on the A side and one pin on the B
325+ * side are changed at the same time, INTF will have
326+ * two bits set. Thus, INTF can't be the only check
327+ * to see if the input has changed.
328+ */
329+
330+ intf_set = BIT(i) & mcp->cache[MCP_INTF];
331+ if (i < 8 && intf_set)
332+ intcap_mask = 0x00FF;
333+ else if (i >= 8 && intf_set)
334+ intcap_mask = 0xFF00;
335+ else
336+ intcap_mask = 0x00;
337+
338+ intcap_changed = (intcap_mask &
339+ (BIT(i) & mcp->cache[MCP_INTCAP])) !=
340+ (intcap_mask & (BIT(i) & gpio_orig));
341+ gpio_set = BIT(i) & mcp->cache[MCP_GPIO];
342+ gpio_bit_changed = (BIT(i) & gpio_orig) !=
343+ (BIT(i) & mcp->cache[MCP_GPIO]);
344+ defval_changed = (BIT(i) & mcp->cache[MCP_INTCON]) &&
345+ ((BIT(i) & mcp->cache[MCP_GPIO]) !=
346+ (BIT(i) & mcp->cache[MCP_DEFVAL]));
347+
348+ if (((gpio_bit_changed || intcap_changed) &&
349+ (BIT(i) & mcp->irq_rise) && gpio_set) ||
350+ ((gpio_bit_changed || intcap_changed) &&
351+ (BIT(i) & mcp->irq_fall) && !gpio_set) ||
352+ defval_changed) {
298353 child_irq = irq_find_mapping(mcp->chip.irqdomain, i);
299354 handle_nested_irq(child_irq);
300355 }
drivers/gpio/gpio-mockup.c+3−4
@@ -197,7 +197,7 @@ static ssize_t gpio_mockup_event_write(struct file *file, · 196 unmodified lines
197197 struct seq_file *sfile;
198198 struct gpio_desc *desc;
199199 struct gpio_chip *gc;
200− int status, val;
200+ int val;
201201 char buf;
202202
203203 sfile = file->private_data;
@@ -206,9 +206,8 @@ static ssize_t gpio_mockup_event_write(struct file *file, · 2 unmodified lines
206206 chip = priv->chip;
207207 gc = &chip->gc;
208208
209− status = copy_from_user(&buf, usr_buf, 1);
210− if (status)
211− return status;
209+ if (copy_from_user(&buf, usr_buf, 1))
210+ return -EFAULT;
212211
213212 if (buf == '0')
214213 val = 0;
drivers/gpio/gpio-xgene.c+3−10
@@ -42,9 +42,7 @@ struct xgene_gpio { · 41 unmodified lines
4242 struct gpio_chip chip;
4343 void __iomem *base;
4444 spinlock_t lock;
45−#ifdef CONFIG_PM
4645 u32 set_dr_val[XGENE_MAX_GPIO_BANKS];
47−#endif
4846 };
4947
5048 static int xgene_gpio_get(struct gpio_chip *gc, unsigned int offset)
@@ -138,8 +136,7 @@ static int xgene_gpio_dir_out(struct gpio_chip *gc, · 87 unmodified lines
138136 return 0;
139137 }
140138
141−#ifdef CONFIG_PM
142−static int xgene_gpio_suspend(struct device *dev)
139+static __maybe_unused int xgene_gpio_suspend(struct device *dev)
143140 {
144141 struct xgene_gpio *gpio = dev_get_drvdata(dev);
145142 unsigned long bank_offset;
@@ -152,7 +149,7 @@ static int xgene_gpio_suspend(struct device *dev) · 6 unmodified lines
152149 return 0;
153150 }
154151
155−static int xgene_gpio_resume(struct device *dev)
152+static __maybe_unused int xgene_gpio_resume(struct device *dev)
156153 {
157154 struct xgene_gpio *gpio = dev_get_drvdata(dev);
158155 unsigned long bank_offset;
@@ -166,10 +163,6 @@ static int xgene_gpio_resume(struct device *dev) · 7 unmodified lines
166163 }
167164
168165 static SIMPLE_DEV_PM_OPS(xgene_gpio_pm, xgene_gpio_suspend, xgene_gpio_resume);
169−#define XGENE_GPIO_PM_OPS (&xgene_gpio_pm)
170−#else
171−#define XGENE_GPIO_PM_OPS NULL
172−#endif
173166
174167 static int xgene_gpio_probe(struct platform_device *pdev)
175168 {
@@ -241,7 +234,7 @@ static struct platform_driver xgene_gpio_driver = { · 65 unmodified lines
241234 .name = "xgene-gpio",
242235 .of_match_table = xgene_gpio_of_match,
243236 .acpi_match_table = ACPI_PTR(xgene_gpio_acpi_match),
244− .pm = XGENE_GPIO_PM_OPS,
237+ .pm = &xgene_gpio_pm,
245238 },
246239 .probe = xgene_gpio_probe,
247240 };
drivers/gpu/drm/amd/acp/Makefile+0−2
@@ -3,6 +3,4 @@ · 2 unmodified lines
33 # of AMDSOC/AMDGPU drm driver.
44 # It provides the HW control for ACP related functionalities.
55
6−subdir-ccflags-y += -I$(AMDACPPATH)/ -I$(AMDACPPATH)/include
7−
86 AMD_ACP_FILES := $(AMDACPPATH)/acp_hw.o
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c+2−0
@@ -240,6 +240,8 @@ free_partial_kdata: · 239 unmodified lines
240240 for (; i >= 0; i--)
241241 drm_free_large(p->chunks[i].kdata);
242242 kfree(p->chunks);
243+ p->chunks = NULL;
244+ p->nchunks = 0;
243245 put_ctx:
244246 amdgpu_ctx_put(p->ctx);
245247 free_chunk:
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c+4−4
@@ -475,7 +475,7 @@ static int amdgpu_wb_init(struct amdgpu_device *adev) · 474 unmodified lines
475475 int r;
476476
477477 if (adev->wb.wb_obj == NULL) {
478− r = amdgpu_bo_create_kernel(adev, AMDGPU_MAX_WB * 4,
478+ r = amdgpu_bo_create_kernel(adev, AMDGPU_MAX_WB * sizeof(uint32_t),
479479 PAGE_SIZE, AMDGPU_GEM_DOMAIN_GTT,
480480 &adev->wb.wb_obj, &adev->wb.gpu_addr,
481481 (void **)&adev->wb.wb);
@@ -488,7 +488,7 @@ static int amdgpu_wb_init(struct amdgpu_device *adev) · 6 unmodified lines
488488 memset(&adev->wb.used, 0, sizeof(adev->wb.used));
489489
490490 /* clear wb memory */
491− memset((char *)adev->wb.wb, 0, AMDGPU_GPU_PAGE_SIZE);
491+ memset((char *)adev->wb.wb, 0, AMDGPU_MAX_WB * sizeof(uint32_t));
492492 }
493493
494494 return 0;
@@ -2590,7 +2590,7 @@ static ssize_t amdgpu_debugfs_regs_read(struct file *f, char __user *buf, · 2095 unmodified lines
25902590 use_bank = 0;
25912591 }
25922592
2593− *pos &= 0x3FFFF;
2593+ *pos &= (1UL << 22) - 1;
25942594
25952595 if (use_bank) {
25962596 if ((sh_bank != 0xFFFFFFFF && sh_bank >= adev->gfx.config.max_sh_per_se) ||
@@ -2666,7 +2666,7 @@ static ssize_t amdgpu_debugfs_regs_write(struct file *f, const char __user *buf, · 69 unmodified lines
26662666 use_bank = 0;
26672667 }
26682668
2669− *pos &= 0x3FFFF;
2669+ *pos &= (1UL << 22) - 1;
26702670
26712671 if (use_bank) {
26722672 if ((sh_bank != 0xFFFFFFFF && sh_bank >= adev->gfx.config.max_sh_per_se) ||
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c+1−0
@@ -421,6 +421,7 @@ static const struct pci_device_id pciidlist[] = { · 420 unmodified lines
421421 {0x1002, 0x6985, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS12},
422422 {0x1002, 0x6986, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS12},
423423 {0x1002, 0x6987, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS12},
424+ {0x1002, 0x6995, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS12},
424425 {0x1002, 0x699F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_POLARIS12},
425426
426427 {0, 0, 0}
drivers/gpu/drm/amd/amdgpu/si_dpm.c+10−0
@@ -3464,6 +3464,16 @@ static void si_apply_state_adjust_rules(struct amdgpu_device *adev, · 3463 unmodified lines
34643464 (adev->pdev->device == 0x6667)) {
34653465 max_sclk = 75000;
34663466 }
3467+ } else if (adev->asic_type == CHIP_OLAND) {
3468+ if ((adev->pdev->revision == 0xC7) ||
3469+ (adev->pdev->revision == 0x80) ||
3470+ (adev->pdev->revision == 0x81) ||
3471+ (adev->pdev->revision == 0x83) ||
3472+ (adev->pdev->revision == 0x87) ||
3473+ (adev->pdev->device == 0x6604) ||
3474+ (adev->pdev->device == 0x6605)) {
3475+ max_sclk = 75000;
3476+ }
34673477 }
34683478
34693479 if (rps->vce_active) {
drivers/gpu/drm/amd/amdgpu/vi.c+1−1
@@ -1051,7 +1051,7 @@ static int vi_common_early_init(void *handle) · 1050 unmodified lines
10511051 /* rev0 hardware requires workarounds to support PG */
10521052 adev->pg_flags = 0;
10531053 if (adev->rev_id != 0x00) {
1054− adev->pg_flags |= AMD_PG_SUPPORT_GFX_PG |
1054+ adev->pg_flags |=
10551055 AMD_PG_SUPPORT_GFX_SMG |
10561056 AMD_PG_SUPPORT_GFX_PIPELINE |
10571057 AMD_PG_SUPPORT_CP |
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_clockpowergating.c+1−1
@@ -178,7 +178,7 @@ int smu7_powergate_vce(struct pp_hwmgr *hwmgr, bool bgate) · 177 unmodified lines
178178 if (bgate) {
179179 cgs_set_powergating_state(hwmgr->device,
180180 AMD_IP_BLOCK_TYPE_VCE,
181− AMD_PG_STATE_UNGATE);
181+ AMD_PG_STATE_GATE);
182182 cgs_set_clockgating_state(hwmgr->device,
183183 AMD_IP_BLOCK_TYPE_VCE,
184184 AMD_CG_STATE_GATE);
drivers/gpu/drm/arm/malidp_crtc.c+1−2
@@ -63,8 +63,7 @@ static void malidp_crtc_enable(struct drm_crtc *crtc) · 62 unmodified lines
6363
6464 clk_prepare_enable(hwdev->pxlclk);
6565
66− /* mclk needs to be set to the same or higher rate than pxlclk */
67− clk_set_rate(hwdev->mclk, crtc->state->adjusted_mode.crtc_clock * 1000);
66+ /* We rely on firmware to set mclk to a sensible level. */
6867 clk_set_rate(hwdev->pxlclk, crtc->state->adjusted_mode.crtc_clock * 1000);
6968
7069 hwdev->modeset(hwdev, &vm);
drivers/gpu/drm/arm/malidp_hw.c+1−1
@@ -83,7 +83,7 @@ static const struct malidp_layer malidp550_layers[] = { · 82 unmodified lines
8383 { DE_VIDEO1, MALIDP550_DE_LV1_BASE, MALIDP550_DE_LV1_PTR_BASE, MALIDP_DE_LV_STRIDE0 },
8484 { DE_GRAPHICS1, MALIDP550_DE_LG_BASE, MALIDP550_DE_LG_PTR_BASE, MALIDP_DE_LG_STRIDE },
8585 { DE_VIDEO2, MALIDP550_DE_LV2_BASE, MALIDP550_DE_LV2_PTR_BASE, MALIDP_DE_LV_STRIDE0 },
86− { DE_SMART, MALIDP550_DE_LS_BASE, MALIDP550_DE_LS_PTR_BASE, 0 },
86+ { DE_SMART, MALIDP550_DE_LS_BASE, MALIDP550_DE_LS_PTR_BASE, MALIDP550_DE_LS_R1_STRIDE },
8787 };
8888
8989 #define MALIDP_DE_DEFAULT_PREFETCH_START 5
drivers/gpu/drm/arm/malidp_planes.c+16−2
@@ -37,6 +37,8 @@ · 36 unmodified lines
3737 #define LAYER_V_VAL(x) (((x) & 0x1fff) << 16)
3838 #define MALIDP_LAYER_COMP_SIZE 0x010
3939 #define MALIDP_LAYER_OFFSET 0x014
40+#define MALIDP550_LS_ENABLE 0x01c
41+#define MALIDP550_LS_R1_IN_SIZE 0x020
4042
4143 /*
4244 * This 4-entry look-up-table is used to determine the full 8-bit alpha value
@@ -242,6 +244,11 @@ static void malidp_de_plane_update(struct drm_plane *plane, · 199 unmodified lines
242244 LAYER_V_VAL(plane->state->crtc_y),
243245 mp->layer->base + MALIDP_LAYER_OFFSET);
244246
247+ if (mp->layer->id == DE_SMART)
248+ malidp_hw_write(mp->hwdev,
249+ LAYER_H_VAL(src_w) | LAYER_V_VAL(src_h),
250+ mp->layer->base + MALIDP550_LS_R1_IN_SIZE);
251+
245252 /* first clear the rotation bits */
246253 val = malidp_hw_read(mp->hwdev, mp->layer->base + MALIDP_LAYER_CONTROL);
247254 val &= ~LAYER_ROT_MASK;
@@ -330,9 +337,16 @@ int malidp_de_planes_init(struct drm_device *drm) · 82 unmodified lines
330337 plane->hwdev = malidp->dev;
331338 plane->layer = &map->layers[i];
332339
333− /* Skip the features which the SMART layer doesn't have */
334− if (id == DE_SMART)
340+ if (id == DE_SMART) {
341+ /*
342+ * Enable the first rectangle in the SMART layer to be
343+ * able to use it as a drm plane.
344+ */
345+ malidp_hw_write(malidp->dev, 1,
346+ plane->layer->base + MALIDP550_LS_ENABLE);
347+ /* Skip the features which the SMART layer doesn't have. */
335348 continue;
349+ }
336350
337351 drm_plane_create_rotation_property(&plane->base, DRM_ROTATE_0, flags);
338352 malidp_hw_write(malidp->dev, MALIDP_ALPHA_LUT,
drivers/gpu/drm/arm/malidp_regs.h+1−0
@@ -84,6 +84,7 @@ · 83 unmodified lines
8484 /* Stride register offsets relative to Lx_BASE */
8585 #define MALIDP_DE_LG_STRIDE 0x18
8686 #define MALIDP_DE_LV_STRIDE0 0x18
87+#define MALIDP550_DE_LS_R1_STRIDE 0x28
8788
8889 /* macros to set values into registers */
8990 #define MALIDP_DE_H_FRONTPORCH(x) (((x) & 0xfff) << 0)
drivers/gpu/drm/drm_fb_helper.c+3−3
@@ -1260,9 +1260,9 @@ int drm_fb_helper_check_var(struct fb_var_screeninfo *var, · 1259 unmodified lines
12601260 * to KMS, hence fail if different settings are requested.
12611261 */
12621262 if (var->bits_per_pixel != fb->format->cpp[0] * 8 ||
1263− var->xres != fb->width || var->yres != fb->height ||
1264− var->xres_virtual != fb->width || var->yres_virtual != fb->height) {
1265− DRM_DEBUG("fb userspace requested width/height/bpp different than current fb "
1263+ var->xres > fb->width || var->yres > fb->height ||
1264+ var->xres_virtual > fb->width || var->yres_virtual > fb->height) {
1265+ DRM_DEBUG("fb requested width/height/bpp can't fit in current fb "
12661266 "request %dx%d-%d (virtual %dx%d) > %dx%d-%d\n",
12671267 var->xres, var->yres, var->bits_per_pixel,
12681268 var->xres_virtual, var->yres_virtual,
drivers/gpu/drm/exynos/exynos5433_drm_decon.c+82−5
@@ -68,6 +68,8 @@ struct decon_context { · 67 unmodified lines
6868 unsigned long flags;
6969 unsigned long out_type;
7070 int first_win;
71+ spinlock_t vblank_lock;
72+ u32 frame_id;
7173 };
7274
7375 static const uint32_t decon_formats[] = {
@@ -103,7 +105,7 @@ static int decon_enable_vblank(struct exynos_drm_crtc *crtc) · 29 unmodified lines
103105 if (ctx->out_type & IFTYPE_I80)
104106 val |= VIDINTCON0_FRAMEDONE;
105107 else
106− val |= VIDINTCON0_INTFRMEN;
108+ val |= VIDINTCON0_INTFRMEN | VIDINTCON0_FRAMESEL_FP;
107109
108110 writel(val, ctx->addr + DECON_VIDINTCON0);
109111 }
@@ -122,14 +124,56 @@ static void decon_disable_vblank(struct exynos_drm_crtc *crtc) · 12 unmodified lines
122124 writel(0, ctx->addr + DECON_VIDINTCON0);
123125 }
124126
127+/* return number of starts/ends of frame transmissions since reset */
128+static u32 decon_get_frame_count(struct decon_context *ctx, bool end)
129+{
130+ u32 frm, pfrm, status, cnt = 2;
131+
132+ /* To get consistent result repeat read until frame id is stable.
133+ * Usually the loop will be executed once, in rare cases when the loop
134+ * is executed at frame change time 2nd pass will be needed.
135+ */
136+ frm = readl(ctx->addr + DECON_CRFMID);
137+ do {
138+ status = readl(ctx->addr + DECON_VIDCON1);
139+ pfrm = frm;
140+ frm = readl(ctx->addr + DECON_CRFMID);
141+ } while (frm != pfrm && --cnt);
142+
143+ /* CRFMID is incremented on BPORCH in case of I80 and on VSYNC in case
144+ * of RGB, it should be taken into account.
145+ */
146+ if (!frm)
147+ return 0;
148+
149+ switch (status & (VIDCON1_VSTATUS_MASK | VIDCON1_I80_ACTIVE)) {
150+ case VIDCON1_VSTATUS_VS:
151+ if (!(ctx->out_type & IFTYPE_I80))
152+ --frm;
153+ break;
154+ case VIDCON1_VSTATUS_BP:
155+ --frm;
156+ break;
157+ case VIDCON1_I80_ACTIVE:
158+ case VIDCON1_VSTATUS_AC:
159+ if (end)
160+ --frm;
161+ break;
162+ default:
163+ break;
164+ }
165+
166+ return frm;
167+}
168+
125169 static void decon_setup_trigger(struct decon_context *ctx)
126170 {
127171 if (!(ctx->out_type & (IFTYPE_I80 | I80_HW_TRG)))
128172 return;
129173
130174 if (!(ctx->out_type & I80_HW_TRG)) {
131− writel(TRIGCON_TE_AUTO_MASK | TRIGCON_SWTRIGEN
132− | TRIGCON_TE_AUTO_MASK | TRIGCON_SWTRIGEN,
175+ writel(TRIGCON_TRIGEN_PER_F | TRIGCON_TRIGEN_F |
176+ TRIGCON_TE_AUTO_MASK | TRIGCON_SWTRIGEN,
133177 ctx->addr + DECON_TRIGCON);
134178 return;
135179 }
@@ -365,11 +409,14 @@ static void decon_disable_plane(struct exynos_drm_crtc *crtc, · 229 unmodified lines
365409 static void decon_atomic_flush(struct exynos_drm_crtc *crtc)
366410 {
367411 struct decon_context *ctx = crtc->ctx;
412+ unsigned long flags;
368413 int i;
369414
370415 if (test_bit(BIT_SUSPENDED, &ctx->flags))
371416 return;
372417
418+ spin_lock_irqsave(&ctx->vblank_lock, flags);
419+
373420 for (i = ctx->first_win; i < WINDOWS_NR; i++)
374421 decon_shadow_protect_win(ctx, i, false);
375422
@@ -378,11 +425,18 @@ static void decon_atomic_flush(struct exynos_drm_crtc *crtc) · 2 unmodified lines
378425
379426 if (ctx->out_type & IFTYPE_I80)
380427 set_bit(BIT_WIN_UPDATED, &ctx->flags);
428+
429+ ctx->frame_id = decon_get_frame_count(ctx, true);
430+
431+ exynos_crtc_handle_event(crtc);
432+
433+ spin_unlock_irqrestore(&ctx->vblank_lock, flags);
381434 }
382435
383436 static void decon_swreset(struct decon_context *ctx)
384437 {
385438 unsigned int tries;
439+ unsigned long flags;
386440
387441 writel(0, ctx->addr + DECON_VIDCON0);
388442 for (tries = 2000; tries; --tries) {
@@ -400,6 +454,10 @@ static void decon_swreset(struct decon_context *ctx) · 11 unmodified lines
400454
401455 WARN(tries == 0, "failed to software reset DECON\n");
402456
457+ spin_lock_irqsave(&ctx->vblank_lock, flags);
458+ ctx->frame_id = 0;
459+ spin_unlock_irqrestore(&ctx->vblank_lock, flags);
460+
403461 if (!(ctx->out_type & IFTYPE_HDMI))
404462 return;
405463
@@ -578,6 +636,24 @@ static const struct component_ops decon_component_ops = { · 172 unmodified lines
578636 .unbind = decon_unbind,
579637 };
580638
639+static void decon_handle_vblank(struct decon_context *ctx)
640+{
641+ u32 frm;
642+
643+ spin_lock(&ctx->vblank_lock);
644+
645+ frm = decon_get_frame_count(ctx, true);
646+
647+ if (frm != ctx->frame_id) {
648+ /* handle only if incremented, take care of wrap-around */
649+ if ((s32)(frm - ctx->frame_id) > 0)
650+ drm_crtc_handle_vblank(&ctx->crtc->base);
651+ ctx->frame_id = frm;
652+ }
653+
654+ spin_unlock(&ctx->vblank_lock);
655+}
656+
581657 static irqreturn_t decon_irq_handler(int irq, void *dev_id)
582658 {
583659 struct decon_context *ctx = dev_id;
@@ -598,7 +674,7 @@ static irqreturn_t decon_irq_handler(int irq, void *dev_id) · 14 unmodified lines
598674 (VIDOUT_INTERLACE_EN_F | VIDOUT_INTERLACE_FIELD_F))
599675 return IRQ_HANDLED;
600676 }
601− drm_crtc_handle_vblank(&ctx->crtc->base);
677+ decon_handle_vblank(ctx);
602678 }
603679
604680 out:
@@ -671,6 +747,7 @@ static int exynos5433_decon_probe(struct platform_device *pdev) · 66 unmodified lines
671747 __set_bit(BIT_SUSPENDED, &ctx->flags);
672748 ctx->dev = dev;
673749 ctx->out_type = (unsigned long)of_device_get_match_data(dev);
750+ spin_lock_init(&ctx->vblank_lock);
674751
675752 if (ctx->out_type & IFTYPE_HDMI) {
676753 ctx->first_win = 1;
@@ -678,7 +755,7 @@ static int exynos5433_decon_probe(struct platform_device *pdev) · 1 unmodified line
678755 ctx->out_type |= IFTYPE_I80;
679756 }
680757
681− if (ctx->out_type | I80_HW_TRG) {
758+ if (ctx->out_type & I80_HW_TRG) {
682759 ctx->sysreg = syscon_regmap_lookup_by_phandle(dev->of_node,
683760 "samsung,disp-sysreg");
684761 if (IS_ERR(ctx->sysreg)) {
drivers/gpu/drm/exynos/exynos7_drm_decon.c+1−0
@@ -526,6 +526,7 @@ static void decon_atomic_flush(struct exynos_drm_crtc *crtc) · 525 unmodified lines
526526
527527 for (i = 0; i < WINDOWS_NR; i++)
528528 decon_shadow_protect_win(ctx, i, false);
529+ exynos_crtc_handle_event(crtc);
529530 }
530531
531532 static void decon_init(struct decon_context *ctx)
drivers/gpu/drm/exynos/exynos_drm_crtc.c+16−13
@@ -85,16 +85,28 @@ static void exynos_crtc_atomic_flush(struct drm_crtc *crtc, · 84 unmodified lines
8585 struct drm_crtc_state *old_crtc_state)
8686 {
8787 struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc);
88− struct drm_pending_vblank_event *event;
89− unsigned long flags;
9088
9189 if (exynos_crtc->ops->atomic_flush)
9290 exynos_crtc->ops->atomic_flush(exynos_crtc);
91+}
92+
93+static const struct drm_crtc_helper_funcs exynos_crtc_helper_funcs = {
94+ .enable = exynos_drm_crtc_enable,
95+ .disable = exynos_drm_crtc_disable,
96+ .mode_set_nofb = exynos_drm_crtc_mode_set_nofb,
97+ .atomic_check = exynos_crtc_atomic_check,
98+ .atomic_begin = exynos_crtc_atomic_begin,
99+ .atomic_flush = exynos_crtc_atomic_flush,
100+};
101+
102+void exynos_crtc_handle_event(struct exynos_drm_crtc *exynos_crtc)
103+{
104+ struct drm_crtc *crtc = &exynos_crtc->base;
105+ struct drm_pending_vblank_event *event = crtc->state->event;
106+ unsigned long flags;
93107
94− event = crtc->state->event;
95108 if (event) {
96109 crtc->state->event = NULL;
97−
98110 spin_lock_irqsave(&crtc->dev->event_lock, flags);
99111 if (drm_crtc_vblank_get(crtc) == 0)
100112 drm_crtc_arm_vblank_event(crtc, event);
@@ -105,15 +117,6 @@ static void exynos_crtc_atomic_flush(struct drm_crtc *crtc, · 4 unmodified lines
105117
106118 }
107119
108−static const struct drm_crtc_helper_funcs exynos_crtc_helper_funcs = {
109− .enable = exynos_drm_crtc_enable,
110− .disable = exynos_drm_crtc_disable,
111− .mode_set_nofb = exynos_drm_crtc_mode_set_nofb,
112− .atomic_check = exynos_crtc_atomic_check,
113− .atomic_begin = exynos_crtc_atomic_begin,
114− .atomic_flush = exynos_crtc_atomic_flush,
115−};
116−
117120 static void exynos_drm_crtc_destroy(struct drm_crtc *crtc)
118121 {
119122 struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc);
drivers/gpu/drm/exynos/exynos_drm_crtc.h+2−0
@@ -40,4 +40,6 @@ int exynos_drm_crtc_get_pipe_from_type(struct drm_device *drm_dev, · 39 unmodified lines
4040 */
4141 void exynos_drm_crtc_te_handler(struct drm_crtc *crtc);
4242
43+void exynos_crtc_handle_event(struct exynos_drm_crtc *exynos_crtc);
44+
4345 #endif
drivers/gpu/drm/exynos/exynos_drm_dsi.c+7−17
@@ -86,7 +86,7 @@ · 85 unmodified lines
8686 #define DSIM_SYNC_INFORM (1 << 27)
8787 #define DSIM_EOT_DISABLE (1 << 28)
8888 #define DSIM_MFLUSH_VS (1 << 29)
89−/* This flag is valid only for exynos3250/3472/4415/5260/5430 */
89+/* This flag is valid only for exynos3250/3472/5260/5430 */
9090 #define DSIM_CLKLANE_STOP (1 << 30)
9191
9292 /* DSIM_ESCMODE */
@@ -473,17 +473,6 @@ static const struct exynos_dsi_driver_data exynos4_dsi_driver_data = { · 380 unmodified lines
473473 .reg_values = reg_values,
474474 };
475475
476−static const struct exynos_dsi_driver_data exynos4415_dsi_driver_data = {
477− .reg_ofs = exynos_reg_ofs,
478− .plltmr_reg = 0x58,
479− .has_clklane_stop = 1,
480− .num_clks = 2,
481− .max_freq = 1000,
482− .wait_for_reset = 1,
483− .num_bits_resol = 11,
484− .reg_values = reg_values,
485−};
486−
487476 static const struct exynos_dsi_driver_data exynos5_dsi_driver_data = {
488477 .reg_ofs = exynos_reg_ofs,
489478 .plltmr_reg = 0x58,
@@ -521,8 +510,6 @@ static const struct of_device_id exynos_dsi_of_match[] = { · 31 unmodified lines
521510 .data = &exynos3_dsi_driver_data },
522511 { .compatible = "samsung,exynos4210-mipi-dsi",
523512 .data = &exynos4_dsi_driver_data },
524− { .compatible = "samsung,exynos4415-mipi-dsi",
525− .data = &exynos4415_dsi_driver_data },
526513 { .compatible = "samsung,exynos5410-mipi-dsi",
527514 .data = &exynos5_dsi_driver_data },
528515 { .compatible = "samsung,exynos5422-mipi-dsi",
@@ -979,7 +966,7 @@ static void exynos_dsi_send_to_fifo(struct exynos_dsi *dsi, · 450 unmodified lines
979966 bool first = !xfer->tx_done;
980967 u32 reg;
981968
982− dev_dbg(dev, "< xfer %p: tx len %u, done %u, rx len %u, done %u\n",
969+ dev_dbg(dev, "< xfer %pK: tx len %u, done %u, rx len %u, done %u\n",
983970 xfer, length, xfer->tx_done, xfer->rx_len, xfer->rx_done);
984971
985972 if (length > DSI_TX_FIFO_SIZE)
@@ -1177,7 +1164,7 @@ static bool exynos_dsi_transfer_finish(struct exynos_dsi *dsi) · 191 unmodified lines
11771164 spin_unlock_irqrestore(&dsi->transfer_lock, flags);
11781165
11791166 dev_dbg(dsi->dev,
1180− "> xfer %p, tx_len %zu, tx_done %u, rx_len %u, rx_done %u\n",
1167+ "> xfer %pK, tx_len %zu, tx_done %u, rx_len %u, rx_done %u\n",
11811168 xfer, xfer->packet.payload_length, xfer->tx_done, xfer->rx_len,
11821169 xfer->rx_done);
11831170
@@ -1348,9 +1335,12 @@ static int exynos_dsi_register_te_irq(struct exynos_dsi *dsi) · 164 unmodified lines
13481335 int te_gpio_irq;
13491336
13501337 dsi->te_gpio = of_get_named_gpio(dsi->panel_node, "te-gpios", 0);
1338+ if (dsi->te_gpio == -ENOENT)
1339+ return 0;
1340+
13511341 if (!gpio_is_valid(dsi->te_gpio)) {
1352− dev_err(dsi->dev, "no te-gpios specified\n");
13531342 ret = dsi->te_gpio;
1343+ dev_err(dsi->dev, "cannot get te-gpios, %d\n", ret);
13541344 goto out;
13551345 }
13561346
drivers/gpu/drm/exynos/exynos_drm_fimc.c+1−1
@@ -1695,7 +1695,7 @@ static int fimc_probe(struct platform_device *pdev) · 1694 unmodified lines
16951695 goto err_put_clk;
16961696 }
16971697
1698− DRM_DEBUG_KMS("id[%d]ippdrv[%p]\n", ctx->id, ippdrv);
1698+ DRM_DEBUG_KMS("id[%d]ippdrv[%pK]\n", ctx->id, ippdrv);
16991699
17001700 spin_lock_init(&ctx->lock);
17011701 platform_set_drvdata(pdev, ctx);
drivers/gpu/drm/exynos/exynos_drm_fimd.c+5−17
@@ -71,10 +71,10 @@ · 70 unmodified lines
7171 #define TRIGCON 0x1A4
7272 #define TRGMODE_ENABLE (1 << 0)
7373 #define SWTRGCMD_ENABLE (1 << 1)
74−/* Exynos3250, 3472, 4415, 5260 5410, 5420 and 5422 only supported. */
74+/* Exynos3250, 3472, 5260 5410, 5420 and 5422 only supported. */
7575 #define HWTRGEN_ENABLE (1 << 3)
7676 #define HWTRGMASK_ENABLE (1 << 4)
77−/* Exynos3250, 3472, 4415, 5260, 5420 and 5422 only supported. */
77+/* Exynos3250, 3472, 5260, 5420 and 5422 only supported. */
7878 #define HWTRIGEN_PER_ENABLE (1 << 31)
7979
8080 /* display mode change control register except exynos4 */
@@ -138,18 +138,6 @@ static struct fimd_driver_data exynos4_fimd_driver_data = { · 57 unmodified lines
138138 .has_vtsel = 1,
139139 };
140140
141−static struct fimd_driver_data exynos4415_fimd_driver_data = {
142− .timing_base = 0x20000,
143− .lcdblk_offset = 0x210,
144− .lcdblk_vt_shift = 10,
145− .lcdblk_bypass_shift = 1,
146− .trg_type = I80_HW_TRG,
147− .has_shadowcon = 1,
148− .has_vidoutcon = 1,
149− .has_vtsel = 1,
150− .has_trigger_per_te = 1,
151−};
152−
153141 static struct fimd_driver_data exynos5_fimd_driver_data = {
154142 .timing_base = 0x20000,
155143 .lcdblk_offset = 0x214,
@@ -210,8 +198,6 @@ static const struct of_device_id fimd_driver_dt_match[] = { · 54 unmodified lines
210198 .data = &exynos3_fimd_driver_data },
211199 { .compatible = "samsung,exynos4210-fimd",
212200 .data = &exynos4_fimd_driver_data },
213− { .compatible = "samsung,exynos4415-fimd",
214− .data = &exynos4415_fimd_driver_data },
215201 { .compatible = "samsung,exynos5250-fimd",
216202 .data = &exynos5_fimd_driver_data },
217203 { .compatible = "samsung,exynos5420-fimd",
@@ -257,7 +243,7 @@ static int fimd_enable_vblank(struct exynos_drm_crtc *crtc) · 39 unmodified lines
257243 val |= VIDINTCON0_INT_FRAME;
258244
259245 val &= ~VIDINTCON0_FRAMESEL0_MASK;
260− val |= VIDINTCON0_FRAMESEL0_VSYNC;
246+ val |= VIDINTCON0_FRAMESEL0_FRONTPORCH;
261247 val &= ~VIDINTCON0_FRAMESEL1_MASK;
262248 val |= VIDINTCON0_FRAMESEL1_NONE;
263249 }
@@ -723,6 +709,8 @@ static void fimd_atomic_flush(struct exynos_drm_crtc *crtc) · 459 unmodified lines
723709
724710 for (i = 0; i < WINDOWS_NR; i++)
725711 fimd_shadow_protect_win(ctx, i, false);
712+
713+ exynos_crtc_handle_event(crtc);
726714 }
727715
728716 static void fimd_update_plane(struct exynos_drm_crtc *crtc,
drivers/gpu/drm/exynos/exynos_drm_gem.c+1−1
@@ -218,7 +218,7 @@ static struct exynos_drm_gem *exynos_drm_gem_init(struct drm_device *dev, · 217 unmodified lines
218218 return ERR_PTR(ret);
219219 }
220220
221− DRM_DEBUG_KMS("created file object = %p\n", obj->filp);
221+ DRM_DEBUG_KMS("created file object = %pK\n", obj->filp);
222222
223223 return exynos_gem;
224224 }
drivers/gpu/drm/exynos/exynos_drm_gsc.c+1−1
@@ -1723,7 +1723,7 @@ static int gsc_probe(struct platform_device *pdev) · 1722 unmodified lines
17231723 return ret;
17241724 }
17251725
1726− DRM_DEBUG_KMS("id[%d]ippdrv[%p]\n", ctx->id, ippdrv);
1726+ DRM_DEBUG_KMS("id[%d]ippdrv[%pK]\n", ctx->id, ippdrv);
17271727
17281728 mutex_init(&ctx->lock);
17291729 platform_set_drvdata(pdev, ctx);
drivers/gpu/drm/exynos/exynos_drm_ipp.c+11−11
@@ -208,7 +208,7 @@ static struct exynos_drm_ippdrv *ipp_find_drv_by_handle(u32 prop_id) · 207 unmodified lines
208208 * e.g PAUSE state, queue buf, command control.
209209 */
210210 list_for_each_entry(ippdrv, &exynos_drm_ippdrv_list, drv_list) {
211− DRM_DEBUG_KMS("count[%d]ippdrv[%p]\n", count++, ippdrv);
211+ DRM_DEBUG_KMS("count[%d]ippdrv[%pK]\n", count++, ippdrv);
212212
213213 mutex_lock(&ippdrv->cmd_lock);
214214 list_for_each_entry(c_node, &ippdrv->cmd_list, list) {
@@ -388,7 +388,7 @@ int exynos_drm_ipp_set_property(struct drm_device *drm_dev, void *data, · 173 unmodified lines
388388 }
389389 property->prop_id = ret;
390390
391− DRM_DEBUG_KMS("created prop_id[%d]cmd[%d]ippdrv[%p]\n",
391+ DRM_DEBUG_KMS("created prop_id[%d]cmd[%d]ippdrv[%pK]\n",
392392 property->prop_id, property->cmd, ippdrv);
393393
394394 /* stored property information and ippdrv in private data */
@@ -518,7 +518,7 @@ static int ipp_put_mem_node(struct drm_device *drm_dev, · 123 unmodified lines
518518 {
519519 int i;
520520
521− DRM_DEBUG_KMS("node[%p]\n", m_node);
521+ DRM_DEBUG_KMS("node[%pK]\n", m_node);
522522
523523 if (!m_node) {
524524 DRM_ERROR("invalid dequeue node.\n");
@@ -562,7 +562,7 @@ static struct drm_exynos_ipp_mem_node · 37 unmodified lines
562562 m_node->buf_id = qbuf->buf_id;
563563 INIT_LIST_HEAD(&m_node->list);
564564
565− DRM_DEBUG_KMS("m_node[%p]ops_id[%d]\n", m_node, qbuf->ops_id);
565+ DRM_DEBUG_KMS("m_node[%pK]ops_id[%d]\n", m_node, qbuf->ops_id);
566566 DRM_DEBUG_KMS("prop_id[%d]buf_id[%d]\n", qbuf->prop_id, m_node->buf_id);
567567
568568 for_each_ipp_planar(i) {
@@ -659,7 +659,7 @@ static void ipp_put_event(struct drm_exynos_ipp_cmd_node *c_node, · 90 unmodified lines
659659
660660 mutex_lock(&c_node->event_lock);
661661 list_for_each_entry_safe(e, te, &c_node->event_list, base.link) {
662− DRM_DEBUG_KMS("count[%d]e[%p]\n", count++, e);
662+ DRM_DEBUG_KMS("count[%d]e[%pK]\n", count++, e);
663663
664664 /*
665665 * qbuf == NULL condition means all event deletion.
@@ -750,7 +750,7 @@ static struct drm_exynos_ipp_mem_node · 84 unmodified lines
750750
751751 /* find memory node from memory list */
752752 list_for_each_entry(m_node, head, list) {
753− DRM_DEBUG_KMS("count[%d]m_node[%p]\n", count++, m_node);
753+ DRM_DEBUG_KMS("count[%d]m_node[%pK]\n", count++, m_node);
754754
755755 /* compare buffer id */
756756 if (m_node->buf_id == qbuf->buf_id)
@@ -767,7 +767,7 @@ static int ipp_set_mem_node(struct exynos_drm_ippdrv *ippdrv, · 10 unmodified lines
767767 struct exynos_drm_ipp_ops *ops = NULL;
768768 int ret = 0;
769769
770− DRM_DEBUG_KMS("node[%p]\n", m_node);
770+ DRM_DEBUG_KMS("node[%pK]\n", m_node);
771771
772772 if (!m_node) {
773773 DRM_ERROR("invalid queue node.\n");
@@ -1232,7 +1232,7 @@ static int ipp_start_property(struct exynos_drm_ippdrv *ippdrv, · 458 unmodified lines
12321232 m_node = list_first_entry(head,
12331233 struct drm_exynos_ipp_mem_node, list);
12341234
1235− DRM_DEBUG_KMS("m_node[%p]\n", m_node);
1235+ DRM_DEBUG_KMS("m_node[%pK]\n", m_node);
12361236
12371237 ret = ipp_set_mem_node(ippdrv, c_node, m_node);
12381238 if (ret) {
@@ -1601,7 +1601,7 @@ static int ipp_subdrv_probe(struct drm_device *drm_dev, struct device *dev) · 362 unmodified lines
16011601 }
16021602 ippdrv->prop_list.ipp_id = ret;
16031603
1604− DRM_DEBUG_KMS("count[%d]ippdrv[%p]ipp_id[%d]\n",
1604+ DRM_DEBUG_KMS("count[%d]ippdrv[%pK]ipp_id[%d]\n",
16051605 count++, ippdrv, ret);
16061606
16071607 /* store parent device for node */
@@ -1659,7 +1659,7 @@ static int ipp_subdrv_open(struct drm_device *drm_dev, struct device *dev, · 51 unmodified lines
16591659
16601660 file_priv->ipp_dev = dev;
16611661
1662− DRM_DEBUG_KMS("done priv[%p]\n", dev);
1662+ DRM_DEBUG_KMS("done priv[%pK]\n", dev);
16631663
16641664 return 0;
16651665 }
@@ -1676,7 +1676,7 @@ static void ipp_subdrv_close(struct drm_device *drm_dev, struct device *dev, · 10 unmodified lines
16761676 mutex_lock(&ippdrv->cmd_lock);
16771677 list_for_each_entry_safe(c_node, tc_node,
16781678 &ippdrv->cmd_list, list) {
1679− DRM_DEBUG_KMS("count[%d]ippdrv[%p]\n",
1679+ DRM_DEBUG_KMS("count[%d]ippdrv[%pK]\n",
16801680 count++, ippdrv);
16811681
16821682 if (c_node->filp == file) {
drivers/gpu/drm/exynos/exynos_drm_rotator.c+1−1
@@ -748,7 +748,7 @@ static int rotator_probe(struct platform_device *pdev) · 747 unmodified lines
748748 goto err_ippdrv_register;
749749 }
750750
751− DRM_DEBUG_KMS("ippdrv[%p]\n", ippdrv);
751+ DRM_DEBUG_KMS("ippdrv[%pK]\n", ippdrv);
752752
753753 platform_set_drvdata(pdev, rot);
754754
drivers/gpu/drm/exynos/exynos_drm_vidi.c+1−0
@@ -170,6 +170,7 @@ static const struct exynos_drm_crtc_ops vidi_crtc_ops = { · 169 unmodified lines
170170 .enable_vblank = vidi_enable_vblank,
171171 .disable_vblank = vidi_disable_vblank,
172172 .update_plane = vidi_update_plane,
173+ .atomic_flush = exynos_crtc_handle_event,
173174 };
174175
175176 static void vidi_fake_vblank_timer(unsigned long arg)
drivers/gpu/drm/exynos/exynos_mixer.c+1−0
@@ -1012,6 +1012,7 @@ static void mixer_atomic_flush(struct exynos_drm_crtc *crtc) · 1011 unmodified lines
10121012 return;
10131013
10141014 mixer_vsync_set_update(mixer_ctx, true);
1015+ exynos_crtc_handle_event(crtc);
10151016 }
10161017
10171018 static void mixer_enable(struct exynos_drm_crtc *crtc)
drivers/gpu/drm/i915/gvt/aperture_gm.c+4−4
@@ -242,7 +242,7 @@ static int alloc_resource(struct intel_vgpu *vgpu, · 241 unmodified lines
242242 const char *item;
243243
244244 if (!param->low_gm_sz || !param->high_gm_sz || !param->fence_sz) {
245− gvt_err("Invalid vGPU creation params\n");
245+ gvt_vgpu_err("Invalid vGPU creation params\n");
246246 return -EINVAL;
247247 }
248248
@@ -285,9 +285,9 @@ static int alloc_resource(struct intel_vgpu *vgpu, · 36 unmodified lines
285285 return 0;
286286
287287 no_enough_resource:
288− gvt_err("vgpu%d: fail to allocate resource %s\n", vgpu->id, item);
289− gvt_err("vgpu%d: request %luMB avail %luMB max %luMB taken %luMB\n",
290− vgpu->id, BYTES_TO_MB(request), BYTES_TO_MB(avail),
288+ gvt_vgpu_err("fail to allocate resource %s\n", item);
289+ gvt_vgpu_err("request %luMB avail %luMB max %luMB taken %luMB\n",
290+ BYTES_TO_MB(request), BYTES_TO_MB(avail),
291291 BYTES_TO_MB(max), BYTES_TO_MB(taken));
292292 return -ENOSPC;
293293 }
drivers/gpu/drm/i915/gvt/cmd_parser.c+72−37
@@ -817,6 +817,25 @@ static bool is_shadowed_mmio(unsigned int offset) · 816 unmodified lines
817817 return ret;
818818 }
819819
820+static inline bool is_force_nonpriv_mmio(unsigned int offset)
821+{
822+ return (offset >= 0x24d0 && offset < 0x2500);
823+}
824+
825+static int force_nonpriv_reg_handler(struct parser_exec_state *s,
826+ unsigned int offset, unsigned int index)
827+{
828+ struct intel_gvt *gvt = s->vgpu->gvt;
829+ unsigned int data = cmd_val(s, index + 1);
830+
831+ if (!intel_gvt_in_force_nonpriv_whitelist(gvt, data)) {
832+ gvt_err("Unexpected forcenonpriv 0x%x LRI write, value=0x%x\n",
833+ offset, data);
834+ return -EINVAL;
835+ }
836+ return 0;
837+}
838+
820839 static int cmd_reg_handler(struct parser_exec_state *s,
821840 unsigned int offset, unsigned int index, char *cmd)
822841 {
@@ -824,23 +843,26 @@ static int cmd_reg_handler(struct parser_exec_state *s, · 1 unmodified line
824843 struct intel_gvt *gvt = vgpu->gvt;
825844
826845 if (offset + 4 > gvt->device_info.mmio_size) {
827− gvt_err("%s access to (%x) outside of MMIO range\n",
846+ gvt_vgpu_err("%s access to (%x) outside of MMIO range\n",
828847 cmd, offset);
829848 return -EINVAL;
830849 }
831850
832851 if (!intel_gvt_mmio_is_cmd_access(gvt, offset)) {
833− gvt_err("vgpu%d: %s access to non-render register (%x)\n",
834− s->vgpu->id, cmd, offset);
852+ gvt_vgpu_err("%s access to non-render register (%x)\n",
853+ cmd, offset);
835854 return 0;
836855 }
837856
838857 if (is_shadowed_mmio(offset)) {
839− gvt_err("vgpu%d: found access of shadowed MMIO %x\n",
840− s->vgpu->id, offset);
858+ gvt_vgpu_err("found access of shadowed MMIO %x\n", offset);
841859 return 0;
842860 }
843861
862+ if (is_force_nonpriv_mmio(offset) &&
863+ force_nonpriv_reg_handler(s, offset, index))
864+ return -EINVAL;
865+
844866 if (offset == i915_mmio_reg_offset(DERRMR) ||
845867 offset == i915_mmio_reg_offset(FORCEWAKE_MT)) {
846868 /* Writing to HW VGT_PVINFO_PAGE offset will be discarded */
@@ -1008,7 +1030,7 @@ static int cmd_handler_pipe_control(struct parser_exec_state *s) · 161 unmodified lines
10081030 ret = cmd_reg_handler(s, 0x2358, 1, "pipe_ctrl");
10091031 else if (post_sync == 1) {
10101032 /* check ggtt*/
1011− if ((cmd_val(s, 2) & (1 << 2))) {
1033+ if ((cmd_val(s, 1) & PIPE_CONTROL_GLOBAL_GTT_IVB)) {
10121034 gma = cmd_val(s, 2) & GENMASK(31, 3);
10131035 if (gmadr_bytes == 8)
10141036 gma |= (cmd_gma_hi(s, 3)) << 32;
@@ -1129,6 +1151,7 @@ static int skl_decode_mi_display_flip(struct parser_exec_state *s, · 114 unmodified lines
11291151 struct mi_display_flip_command_info *info)
11301152 {
11311153 struct drm_i915_private *dev_priv = s->vgpu->gvt->dev_priv;
1154+ struct intel_vgpu *vgpu = s->vgpu;
11321155 u32 dword0 = cmd_val(s, 0);
11331156 u32 dword1 = cmd_val(s, 1);
11341157 u32 dword2 = cmd_val(s, 2);
@@ -1167,7 +1190,7 @@ static int skl_decode_mi_display_flip(struct parser_exec_state *s, · 32 unmodified lines
11671190 break;
11681191
11691192 default:
1170− gvt_err("unknown plane code %d\n", plane);
1193+ gvt_vgpu_err("unknown plane code %d\n", plane);
11711194 return -EINVAL;
11721195 }
11731196
@@ -1274,25 +1297,26 @@ static int update_plane_mmio_from_mi_display_flip( · 100 unmodified lines
12741297 static int cmd_handler_mi_display_flip(struct parser_exec_state *s)
12751298 {
12761299 struct mi_display_flip_command_info info;
1300+ struct intel_vgpu *vgpu = s->vgpu;
12771301 int ret;
12781302 int i;
12791303 int len = cmd_length(s);
12801304
12811305 ret = decode_mi_display_flip(s, &info);
12821306 if (ret) {
1283− gvt_err("fail to decode MI display flip command\n");
1307+ gvt_vgpu_err("fail to decode MI display flip command\n");
12841308 return ret;
12851309 }
12861310
12871311 ret = check_mi_display_flip(s, &info);
12881312 if (ret) {
1289− gvt_err("invalid MI display flip command\n");
1313+ gvt_vgpu_err("invalid MI display flip command\n");
12901314 return ret;
12911315 }
12921316
12931317 ret = update_plane_mmio_from_mi_display_flip(s, &info);
12941318 if (ret) {
1295− gvt_err("fail to update plane mmio\n");
1319+ gvt_vgpu_err("fail to update plane mmio\n");
12961320 return ret;
12971321 }
12981322
@@ -1350,7 +1374,8 @@ static inline int cmd_address_audit(struct parser_exec_state *s, · 51 unmodified lines
13501374 int ret;
13511375
13521376 if (op_size > max_surface_size) {
1353− gvt_err("command address audit fail name %s\n", s->info->name);
1377+ gvt_vgpu_err("command address audit fail name %s\n",
1378+ s->info->name);
13541379 return -EINVAL;
13551380 }
13561381
@@ -1367,7 +1392,7 @@ static inline int cmd_address_audit(struct parser_exec_state *s, · 10 unmodified lines
13671392 }
13681393 return 0;
13691394 err:
1370− gvt_err("cmd_parser: Malicious %s detected, addr=0x%lx, len=%d!\n",
1395+ gvt_vgpu_err("cmd_parser: Malicious %s detected, addr=0x%lx, len=%d!\n",
13711396 s->info->name, guest_gma, op_size);
13721397
13731398 pr_err("cmd dump: ");
@@ -1412,8 +1437,10 @@ static int cmd_handler_mi_store_data_imm(struct parser_exec_state *s) · 38 unmodified lines
14121437
14131438 static inline int unexpected_cmd(struct parser_exec_state *s)
14141439 {
1415− gvt_err("vgpu%d: Unexpected %s in command buffer!\n",
1416− s->vgpu->id, s->info->name);
1440+ struct intel_vgpu *vgpu = s->vgpu;
1441+
1442+ gvt_vgpu_err("Unexpected %s in command buffer!\n", s->info->name);
1443+
14171444 return -EINVAL;
14181445 }
14191446
@@ -1516,7 +1543,7 @@ static int copy_gma_to_hva(struct intel_vgpu *vgpu, struct intel_vgpu_mm *mm, · 96 unmodified lines
15161543 while (gma != end_gma) {
15171544 gpa = intel_vgpu_gma_to_gpa(mm, gma);
15181545 if (gpa == INTEL_GVT_INVALID_ADDR) {
1519− gvt_err("invalid gma address: %lx\n", gma);
1546+ gvt_vgpu_err("invalid gma address: %lx\n", gma);
15201547 return -EFAULT;
15211548 }
15221549
@@ -1557,6 +1584,7 @@ static uint32_t find_bb_size(struct parser_exec_state *s) · 34 unmodified lines
15571584 uint32_t bb_size = 0;
15581585 uint32_t cmd_len = 0;
15591586 bool met_bb_end = false;
1587+ struct intel_vgpu *vgpu = s->vgpu;
15601588 u32 cmd;
15611589
15621590 /* get the start gm address of the batch buffer */
@@ -1565,7 +1593,7 @@ static uint32_t find_bb_size(struct parser_exec_state *s) · 2 unmodified lines
15651593
15661594 info = get_cmd_info(s->vgpu->gvt, cmd, s->ring_id);
15671595 if (info == NULL) {
1568− gvt_err("unknown cmd 0x%x, opcode=0x%x\n",
1596+ gvt_vgpu_err("unknown cmd 0x%x, opcode=0x%x\n",
15691597 cmd, get_opcode(cmd, s->ring_id));
15701598 return -EINVAL;
15711599 }
@@ -1574,7 +1602,7 @@ static uint32_t find_bb_size(struct parser_exec_state *s) · 2 unmodified lines
15741602 gma, gma + 4, &cmd);
15751603 info = get_cmd_info(s->vgpu->gvt, cmd, s->ring_id);
15761604 if (info == NULL) {
1577− gvt_err("unknown cmd 0x%x, opcode=0x%x\n",
1605+ gvt_vgpu_err("unknown cmd 0x%x, opcode=0x%x\n",
15781606 cmd, get_opcode(cmd, s->ring_id));
15791607 return -EINVAL;
15801608 }
@@ -1599,6 +1627,7 @@ static uint32_t find_bb_size(struct parser_exec_state *s) · 18 unmodified lines
15991627 static int perform_bb_shadow(struct parser_exec_state *s)
16001628 {
16011629 struct intel_shadow_bb_entry *entry_obj;
1630+ struct intel_vgpu *vgpu = s->vgpu;
16021631 unsigned long gma = 0;
16031632 uint32_t bb_size;
16041633 void *dst = NULL;
@@ -1633,7 +1662,7 @@ static int perform_bb_shadow(struct parser_exec_state *s) · 28 unmodified lines
16331662
16341663 ret = i915_gem_object_set_to_cpu_domain(entry_obj->obj, false);
16351664 if (ret) {
1636− gvt_err("failed to set shadow batch to CPU\n");
1665+ gvt_vgpu_err("failed to set shadow batch to CPU\n");
16371666 goto unmap_src;
16381667 }
16391668
@@ -1645,7 +1674,7 @@ static int perform_bb_shadow(struct parser_exec_state *s) · 5 unmodified lines
16451674 gma, gma + bb_size,
16461675 dst);
16471676 if (ret) {
1648− gvt_err("fail to copy guest ring buffer\n");
1677+ gvt_vgpu_err("fail to copy guest ring buffer\n");
16491678 goto unmap_src;
16501679 }
16511680
@@ -1676,15 +1705,16 @@ static int cmd_handler_mi_batch_buffer_start(struct parser_exec_state *s) · 24 unmodified lines
16761705 {
16771706 bool second_level;
16781707 int ret = 0;
1708+ struct intel_vgpu *vgpu = s->vgpu;
16791709
16801710 if (s->buf_type == BATCH_BUFFER_2ND_LEVEL) {
1681− gvt_err("Found MI_BATCH_BUFFER_START in 2nd level BB\n");
1711+ gvt_vgpu_err("Found MI_BATCH_BUFFER_START in 2nd level BB\n");
16821712 return -EINVAL;
16831713 }
16841714
16851715 second_level = BATCH_BUFFER_2ND_LEVEL_BIT(cmd_val(s, 0)) == 1;
16861716 if (second_level && (s->buf_type != BATCH_BUFFER_INSTRUCTION)) {
1687− gvt_err("Jumping to 2nd level BB from RB is not allowed\n");
1717+ gvt_vgpu_err("Jumping to 2nd level BB from RB is not allowed\n");
16881718 return -EINVAL;
16891719 }
16901720
@@ -1702,7 +1732,7 @@ static int cmd_handler_mi_batch_buffer_start(struct parser_exec_state *s) · 11 unmodified lines
17021732 if (batch_buffer_needs_scan(s)) {
17031733 ret = perform_bb_shadow(s);
17041734 if (ret < 0)
1705− gvt_err("invalid shadow batch buffer\n");
1735+ gvt_vgpu_err("invalid shadow batch buffer\n");
17061736 } else {
17071737 /* emulate a batch buffer end to do return right */
17081738 ret = cmd_handler_mi_batch_buffer_end(s);
@@ -2429,6 +2459,7 @@ static int cmd_parser_exec(struct parser_exec_state *s) · 720 unmodified lines
24292459 int ret = 0;
24302460 cycles_t t0, t1, t2;
24312461 struct parser_exec_state s_before_advance_custom;
2462+ struct intel_vgpu *vgpu = s->vgpu;
24322463
24332464 t0 = get_cycles();
24342465
@@ -2436,7 +2467,7 @@ static int cmd_parser_exec(struct parser_exec_state *s) · 1 unmodified line
24362467
24372468 info = get_cmd_info(s->vgpu->gvt, cmd, s->ring_id);
24382469 if (info == NULL) {
2439− gvt_err("unknown cmd 0x%x, opcode=0x%x\n",
2470+ gvt_vgpu_err("unknown cmd 0x%x, opcode=0x%x\n",
24402471 cmd, get_opcode(cmd, s->ring_id));
24412472 return -EINVAL;
24422473 }
@@ -2452,7 +2483,7 @@ static int cmd_parser_exec(struct parser_exec_state *s) · 9 unmodified lines
24522483 if (info->handler) {
24532484 ret = info->handler(s);
24542485 if (ret < 0) {
2455− gvt_err("%s handler error\n", info->name);
2486+ gvt_vgpu_err("%s handler error\n", info->name);
24562487 return ret;
24572488 }
24582489 }
@@ -2463,7 +2494,7 @@ static int cmd_parser_exec(struct parser_exec_state *s) · 4 unmodified lines
24632494 if (!(info->flag & F_IP_ADVANCE_CUSTOM)) {
24642495 ret = cmd_advance_default(s);
24652496 if (ret) {
2466− gvt_err("%s IP advance error\n", info->name);
2497+ gvt_vgpu_err("%s IP advance error\n", info->name);
24672498 return ret;
24682499 }
24692500 }
@@ -2486,6 +2517,7 @@ static int command_scan(struct parser_exec_state *s, · 16 unmodified lines
24862517
24872518 unsigned long gma_head, gma_tail, gma_bottom;
24882519 int ret = 0;
2520+ struct intel_vgpu *vgpu = s->vgpu;
24892521
24902522 gma_head = rb_start + rb_head;
24912523 gma_tail = rb_start + rb_tail;
@@ -2497,7 +2529,7 @@ static int command_scan(struct parser_exec_state *s, · 5 unmodified lines
24972529 if (s->buf_type == RING_BUFFER_INSTRUCTION) {
24982530 if (!(s->ip_gma >= rb_start) ||
24992531 !(s->ip_gma < gma_bottom)) {
2500− gvt_err("ip_gma %lx out of ring scope."
2532+ gvt_vgpu_err("ip_gma %lx out of ring scope."
25012533 "(base:0x%lx, bottom: 0x%lx)\n",
25022534 s->ip_gma, rb_start,
25032535 gma_bottom);
@@ -2505,7 +2537,7 @@ static int command_scan(struct parser_exec_state *s, · 1 unmodified line
25052537 return -EINVAL;
25062538 }
25072539 if (gma_out_of_range(s->ip_gma, gma_head, gma_tail)) {
2508− gvt_err("ip_gma %lx out of range."
2540+ gvt_vgpu_err("ip_gma %lx out of range."
25092541 "base 0x%lx head 0x%lx tail 0x%lx\n",
25102542 s->ip_gma, rb_start,
25112543 rb_head, rb_tail);
@@ -2515,7 +2547,7 @@ static int command_scan(struct parser_exec_state *s, · 3 unmodified lines
25152547 }
25162548 ret = cmd_parser_exec(s);
25172549 if (ret) {
2518− gvt_err("cmd parser error\n");
2550+ gvt_vgpu_err("cmd parser error\n");
25192551 parser_exec_state_dump(s);
25202552 break;
25212553 }
@@ -2639,7 +2671,7 @@ static int shadow_workload_ring_buffer(struct intel_vgpu_workload *workload) · 117 unmodified lines
26392671 gma_head, gma_top,
26402672 workload->shadow_ring_buffer_va);
26412673 if (ret) {
2642− gvt_err("fail to copy guest ring buffer\n");
2674+ gvt_vgpu_err("fail to copy guest ring buffer\n");
26432675 return ret;
26442676 }
26452677 copy_len = gma_top - gma_head;
@@ -2651,7 +2683,7 @@ static int shadow_workload_ring_buffer(struct intel_vgpu_workload *workload) · 5 unmodified lines
26512683 gma_head, gma_tail,
26522684 workload->shadow_ring_buffer_va + copy_len);
26532685 if (ret) {
2654− gvt_err("fail to copy guest ring buffer\n");
2686+ gvt_vgpu_err("fail to copy guest ring buffer\n");
26552687 return ret;
26562688 }
26572689 ring->tail += workload->rb_len;
@@ -2662,16 +2694,17 @@ static int shadow_workload_ring_buffer(struct intel_vgpu_workload *workload) · 4 unmodified lines
26622694 int intel_gvt_scan_and_shadow_workload(struct intel_vgpu_workload *workload)
26632695 {
26642696 int ret;
2697+ struct intel_vgpu *vgpu = workload->vgpu;
26652698
26662699 ret = shadow_workload_ring_buffer(workload);
26672700 if (ret) {
2668− gvt_err("fail to shadow workload ring_buffer\n");
2701+ gvt_vgpu_err("fail to shadow workload ring_buffer\n");
26692702 return ret;
26702703 }
26712704
26722705 ret = scan_workload(workload);
26732706 if (ret) {
2674− gvt_err("scan workload error\n");
2707+ gvt_vgpu_err("scan workload error\n");
26752708 return ret;
26762709 }
26772710 return 0;
@@ -2681,6 +2714,7 @@ static int shadow_indirect_ctx(struct intel_shadow_wa_ctx *wa_ctx) · 3 unmodified lines
26812714 {
26822715 int ctx_size = wa_ctx->indirect_ctx.size;
26832716 unsigned long guest_gma = wa_ctx->indirect_ctx.guest_gma;
2717+ struct intel_vgpu *vgpu = wa_ctx->workload->vgpu;
26842718 struct drm_i915_gem_object *obj;
26852719 int ret = 0;
26862720 void *map;
@@ -2694,14 +2728,14 @@ static int shadow_indirect_ctx(struct intel_shadow_wa_ctx *wa_ctx) · 7 unmodified lines
26942728 /* get the va of the shadow batch buffer */
26952729 map = i915_gem_object_pin_map(obj, I915_MAP_WB);
26962730 if (IS_ERR(map)) {
2697− gvt_err("failed to vmap shadow indirect ctx\n");
2731+ gvt_vgpu_err("failed to vmap shadow indirect ctx\n");
26982732 ret = PTR_ERR(map);
26992733 goto put_obj;
27002734 }
27012735
27022736 ret = i915_gem_object_set_to_cpu_domain(obj, false);
27032737 if (ret) {
2704− gvt_err("failed to set shadow indirect ctx to CPU\n");
2738+ gvt_vgpu_err("failed to set shadow indirect ctx to CPU\n");
27052739 goto unmap_src;
27062740 }
27072741
@@ -2710,7 +2744,7 @@ static int shadow_indirect_ctx(struct intel_shadow_wa_ctx *wa_ctx) · 2 unmodified lines
27102744 guest_gma, guest_gma + ctx_size,
27112745 map);
27122746 if (ret) {
2713− gvt_err("fail to copy guest indirect ctx\n");
2747+ gvt_vgpu_err("fail to copy guest indirect ctx\n");
27142748 goto unmap_src;
27152749 }
27162750
@@ -2744,13 +2778,14 @@ static int combine_wa_ctx(struct intel_shadow_wa_ctx *wa_ctx) · 27 unmodified lines
27442778 int intel_gvt_scan_and_shadow_wa_ctx(struct intel_shadow_wa_ctx *wa_ctx)
27452779 {
27462780 int ret;
2781+ struct intel_vgpu *vgpu = wa_ctx->workload->vgpu;
27472782
27482783 if (wa_ctx->indirect_ctx.size == 0)
27492784 return 0;
27502785
27512786 ret = shadow_indirect_ctx(wa_ctx);
27522787 if (ret) {
2753− gvt_err("fail to shadow indirect ctx\n");
2788+ gvt_vgpu_err("fail to shadow indirect ctx\n");
27542789 return ret;
27552790 }
27562791
@@ -2758,7 +2793,7 @@ int intel_gvt_scan_and_shadow_wa_ctx(struct intel_shadow_wa_ctx *wa_ctx) · 1 unmodified line
27582793
27592794 ret = scan_wa_ctx(wa_ctx);
27602795 if (ret) {
2761− gvt_err("scan wa ctx error\n");
2796+ gvt_vgpu_err("scan wa ctx error\n");
27622797 return ret;
27632798 }
27642799
drivers/gpu/drm/i915/gvt/debug.h+8−0
@@ -27,6 +27,14 @@ · 26 unmodified lines
2727 #define gvt_err(fmt, args...) \
2828 DRM_ERROR("gvt: "fmt, ##args)
2929
30+#define gvt_vgpu_err(fmt, args...) \
31+do { \
32+ if (IS_ERR_OR_NULL(vgpu)) \
33+ DRM_DEBUG_DRIVER("gvt: "fmt, ##args); \
34+ else \
35+ DRM_DEBUG_DRIVER("gvt: vgpu %d: "fmt, vgpu->id, ##args);\
36+} while (0)
37+
3038 #define gvt_dbg_core(fmt, args...) \
3139 DRM_DEBUG_DRIVER("gvt: core: "fmt, ##args)
3240
drivers/gpu/drm/i915/gvt/edid.c+6−7
@@ -52,16 +52,16 @@ static unsigned char edid_get_byte(struct intel_vgpu *vgpu) · 51 unmodified lines
5252 unsigned char chr = 0;
5353
5454 if (edid->state == I2C_NOT_SPECIFIED || !edid->slave_selected) {
55− gvt_err("Driver tries to read EDID without proper sequence!\n");
55+ gvt_vgpu_err("Driver tries to read EDID without proper sequence!\n");
5656 return 0;
5757 }
5858 if (edid->current_edid_read >= EDID_SIZE) {
59− gvt_err("edid_get_byte() exceeds the size of EDID!\n");
59+ gvt_vgpu_err("edid_get_byte() exceeds the size of EDID!\n");
6060 return 0;
6161 }
6262
6363 if (!edid->edid_available) {
64− gvt_err("Reading EDID but EDID is not available!\n");
64+ gvt_vgpu_err("Reading EDID but EDID is not available!\n");
6565 return 0;
6666 }
6767
@@ -72,7 +72,7 @@ static unsigned char edid_get_byte(struct intel_vgpu *vgpu) · 4 unmodified lines
7272 chr = edid_data->edid_block[edid->current_edid_read];
7373 edid->current_edid_read++;
7474 } else {
75− gvt_err("No EDID available during the reading?\n");
75+ gvt_vgpu_err("No EDID available during the reading?\n");
7676 }
7777 return chr;
7878 }
@@ -223,7 +223,7 @@ static int gmbus1_mmio_write(struct intel_vgpu *vgpu, unsigned int offset, · 144 unmodified lines
223223 vgpu_vreg(vgpu, PCH_GMBUS2) |= GMBUS_ACTIVE;
224224 break;
225225 default:
226− gvt_err("Unknown/reserved GMBUS cycle detected!\n");
226+ gvt_vgpu_err("Unknown/reserved GMBUS cycle detected!\n");
227227 break;
228228 }
229229 /*
@@ -292,8 +292,7 @@ static int gmbus3_mmio_read(struct intel_vgpu *vgpu, unsigned int offset, · 62 unmodified lines
292292 */
293293 } else {
294294 memcpy(p_data, &vgpu_vreg(vgpu, offset), bytes);
295− gvt_err("vgpu%d: warning: gmbus3 read with nothing returned\n",
296− vgpu->id);
295+ gvt_vgpu_err("warning: gmbus3 read with nothing returned\n");
297296 }
298297 return 0;
299298 }
drivers/gpu/drm/i915/gvt/execlist.c+13−16
@@ -172,6 +172,7 @@ static int emulate_execlist_ctx_schedule_out( · 171 unmodified lines
172172 struct intel_vgpu_execlist *execlist,
173173 struct execlist_ctx_descriptor_format *ctx)
174174 {
175+ struct intel_vgpu *vgpu = execlist->vgpu;
175176 struct intel_vgpu_execlist_slot *running = execlist->running_slot;
176177 struct intel_vgpu_execlist_slot *pending = execlist->pending_slot;
177178 struct execlist_ctx_descriptor_format *ctx0 = &running->ctx[0];
@@ -183,7 +184,7 @@ static int emulate_execlist_ctx_schedule_out( · 5 unmodified lines
183184 gvt_dbg_el("schedule out context id %x\n", ctx->context_id);
184185
185186 if (WARN_ON(!same_context(ctx, execlist->running_context))) {
186− gvt_err("schedule out context is not running context,"
187+ gvt_vgpu_err("schedule out context is not running context,"
187188 "ctx id %x running ctx id %x\n",
188189 ctx->context_id,
189190 execlist->running_context->context_id);
@@ -254,7 +255,7 @@ static struct intel_vgpu_execlist_slot *get_next_execlist_slot( · 64 unmodified lines
254255 status.udw = vgpu_vreg(vgpu, status_reg + 4);
255256
256257 if (status.execlist_queue_full) {
257− gvt_err("virtual execlist slots are full\n");
258+ gvt_vgpu_err("virtual execlist slots are full\n");
258259 return NULL;
259260 }
260261
@@ -270,11 +271,12 @@ static int emulate_execlist_schedule_in(struct intel_vgpu_execlist *execlist, · 9 unmodified lines
270271
271272 struct execlist_ctx_descriptor_format *ctx0, *ctx1;
272273 struct execlist_context_status_format status;
274+ struct intel_vgpu *vgpu = execlist->vgpu;
273275
274276 gvt_dbg_el("emulate schedule-in\n");
275277
276278 if (!slot) {
277− gvt_err("no available execlist slot\n");
279+ gvt_vgpu_err("no available execlist slot\n");
278280 return -EINVAL;
279281 }
280282
@@ -375,7 +377,6 @@ static void prepare_shadow_batch_buffer(struct intel_vgpu_workload *workload) · 94 unmodified lines
375377
376378 vma = i915_gem_object_ggtt_pin(entry_obj->obj, NULL, 0, 4, 0);
377379 if (IS_ERR(vma)) {
378− gvt_err("Cannot pin\n");
379380 return;
380381 }
381382
@@ -428,7 +429,6 @@ static void prepare_shadow_wa_ctx(struct intel_shadow_wa_ctx *wa_ctx) · 46 unmodified lines
428429 vma = i915_gem_object_ggtt_pin(wa_ctx->indirect_ctx.obj, NULL,
429430 0, CACHELINE_BYTES, 0);
430431 if (IS_ERR(vma)) {
431− gvt_err("Cannot pin indirect ctx obj\n");
432432 return;
433433 }
434434
@@ -561,6 +561,7 @@ static int prepare_mm(struct intel_vgpu_workload *workload) · 126 unmodified lines
561561 {
562562 struct execlist_ctx_descriptor_format *desc = &workload->ctx_desc;
563563 struct intel_vgpu_mm *mm;
564+ struct intel_vgpu *vgpu = workload->vgpu;
564565 int page_table_level;
565566 u32 pdp[8];
566567
@@ -569,7 +570,7 @@ static int prepare_mm(struct intel_vgpu_workload *workload) · 2 unmodified lines
569570 } else if (desc->addressing_mode == 3) { /* legacy 64 bit */
570571 page_table_level = 4;
571572 } else {
572− gvt_err("Advanced Context mode(SVM) is not supported!\n");
573+ gvt_vgpu_err("Advanced Context mode(SVM) is not supported!\n");
573574 return -EINVAL;
574575 }
575576
@@ -583,7 +584,7 @@ static int prepare_mm(struct intel_vgpu_workload *workload) · 7 unmodified lines
583584 mm = intel_vgpu_create_mm(workload->vgpu, INTEL_GVT_MM_PPGTT,
584585 pdp, page_table_level, 0);
585586 if (IS_ERR(mm)) {
586− gvt_err("fail to create mm object.\n");
587+ gvt_vgpu_err("fail to create mm object.\n");
587588 return PTR_ERR(mm);
588589 }
589590 }
@@ -609,7 +610,7 @@ static int submit_context(struct intel_vgpu *vgpu, int ring_id, · 19 unmodified lines
609610 ring_context_gpa = intel_vgpu_gma_to_gpa(vgpu->gtt.ggtt_mm,
610611 (u32)((desc->lrca + 1) << GTT_PAGE_SHIFT));
611612 if (ring_context_gpa == INTEL_GVT_INVALID_ADDR) {
612− gvt_err("invalid guest context LRCA: %x\n", desc->lrca);
613+ gvt_vgpu_err("invalid guest context LRCA: %x\n", desc->lrca);
613614 return -EINVAL;
614615 }
615616
@@ -724,8 +725,7 @@ int intel_vgpu_submit_execlist(struct intel_vgpu *vgpu, int ring_id) · 108 unmodified lines
724725 continue;
725726
726727 if (!desc[i]->privilege_access) {
727− gvt_err("vgpu%d: unexpected GGTT elsp submission\n",
728− vgpu->id);
728+ gvt_vgpu_err("unexpected GGTT elsp submission\n");
729729 return -EINVAL;
730730 }
731731
@@ -735,15 +735,13 @@ int intel_vgpu_submit_execlist(struct intel_vgpu *vgpu, int ring_id) · 3 unmodified lines
735735 }
736736
737737 if (!valid_desc_bitmap) {
738− gvt_err("vgpu%d: no valid desc in a elsp submission\n",
739− vgpu->id);
738+ gvt_vgpu_err("no valid desc in a elsp submission\n");
740739 return -EINVAL;
741740 }
742741
743742 if (!test_bit(0, (void *)&valid_desc_bitmap) &&
744743 test_bit(1, (void *)&valid_desc_bitmap)) {
745− gvt_err("vgpu%d: weird elsp submission, desc 0 is not valid\n",
746− vgpu->id);
744+ gvt_vgpu_err("weird elsp submission, desc 0 is not valid\n");
747745 return -EINVAL;
748746 }
749747
@@ -752,8 +750,7 @@ int intel_vgpu_submit_execlist(struct intel_vgpu *vgpu, int ring_id) · 2 unmodified lines
752750 ret = submit_context(vgpu, ring_id, &valid_desc[i],
753751 emulate_schedule_in);
754752 if (ret) {
755− gvt_err("vgpu%d: fail to schedule workload\n",
756− vgpu->id);
753+ gvt_vgpu_err("fail to schedule workload\n");
757754 return ret;
758755 }
759756 emulate_schedule_in = false;
drivers/gpu/drm/i915/gvt/gtt.c+36−38
@@ -49,8 +49,8 @@ bool intel_gvt_ggtt_validate_range(struct intel_vgpu *vgpu, u64 addr, u32 size) · 48 unmodified lines
4949 {
5050 if ((!vgpu_gmadr_is_valid(vgpu, addr)) || (size
5151 && !vgpu_gmadr_is_valid(vgpu, addr + size - 1))) {
52− gvt_err("vgpu%d: invalid range gmadr 0x%llx size 0x%x\n",
53− vgpu->id, addr, size);
52+ gvt_vgpu_err("invalid range gmadr 0x%llx size 0x%x\n",
53+ addr, size);
5454 return false;
5555 }
5656 return true;
@@ -430,7 +430,7 @@ static int gtt_entry_p2m(struct intel_vgpu *vgpu, struct intel_gvt_gtt_entry *p, · 373 unmodified lines
430430
431431 mfn = intel_gvt_hypervisor_gfn_to_mfn(vgpu, gfn);
432432 if (mfn == INTEL_GVT_INVALID_ADDR) {
433− gvt_err("fail to translate gfn: 0x%lx\n", gfn);
433+ gvt_vgpu_err("fail to translate gfn: 0x%lx\n", gfn);
434434 return -ENXIO;
435435 }
436436
@@ -611,7 +611,7 @@ static inline int init_shadow_page(struct intel_vgpu *vgpu, · 174 unmodified lines
611611
612612 daddr = dma_map_page(kdev, p->page, 0, 4096, PCI_DMA_BIDIRECTIONAL);
613613 if (dma_mapping_error(kdev, daddr)) {
614− gvt_err("fail to map dma addr\n");
614+ gvt_vgpu_err("fail to map dma addr\n");
615615 return -EINVAL;
616616 }
617617
@@ -735,7 +735,7 @@ retry: · 117 unmodified lines
735735 if (reclaim_one_mm(vgpu->gvt))
736736 goto retry;
737737
738− gvt_err("fail to allocate ppgtt shadow page\n");
738+ gvt_vgpu_err("fail to allocate ppgtt shadow page\n");
739739 return ERR_PTR(-ENOMEM);
740740 }
741741
@@ -750,14 +750,14 @@ retry: · 8 unmodified lines
750750 */
751751 ret = init_shadow_page(vgpu, &spt->shadow_page, type);
752752 if (ret) {
753− gvt_err("fail to initialize shadow page for spt\n");
753+ gvt_vgpu_err("fail to initialize shadow page for spt\n");
754754 goto err;
755755 }
756756
757757 ret = intel_vgpu_init_guest_page(vgpu, &spt->guest_page,
758758 gfn, ppgtt_write_protection_handler, NULL);
759759 if (ret) {
760− gvt_err("fail to initialize guest page for spt\n");
760+ gvt_vgpu_err("fail to initialize guest page for spt\n");
761761 goto err;
762762 }
763763
@@ -776,8 +776,7 @@ static struct intel_vgpu_ppgtt_spt *ppgtt_find_shadow_page( · 12 unmodified lines
776776 if (p)
777777 return shadow_page_to_ppgtt_spt(p);
778778
779− gvt_err("vgpu%d: fail to find ppgtt shadow page: 0x%lx\n",
780− vgpu->id, mfn);
779+ gvt_vgpu_err("fail to find ppgtt shadow page: 0x%lx\n", mfn);
781780 return NULL;
782781 }
783782
@@ -827,8 +826,8 @@ static int ppgtt_invalidate_shadow_page_by_shadow_entry(struct intel_vgpu *vgpu, · 43 unmodified lines
827826 }
828827 s = ppgtt_find_shadow_page(vgpu, ops->get_pfn(e));
829828 if (!s) {
830− gvt_err("vgpu%d: fail to find shadow page: mfn: 0x%lx\n",
831− vgpu->id, ops->get_pfn(e));
829+ gvt_vgpu_err("fail to find shadow page: mfn: 0x%lx\n",
830+ ops->get_pfn(e));
832831 return -ENXIO;
833832 }
834833 return ppgtt_invalidate_shadow_page(s);
@@ -836,6 +835,7 @@ static int ppgtt_invalidate_shadow_page_by_shadow_entry(struct intel_vgpu *vgpu, · 1 unmodified line
836835
837836 static int ppgtt_invalidate_shadow_page(struct intel_vgpu_ppgtt_spt *spt)
838837 {
838+ struct intel_vgpu *vgpu = spt->vgpu;
839839 struct intel_gvt_gtt_entry e;
840840 unsigned long index;
841841 int ret;
@@ -854,7 +854,7 @@ static int ppgtt_invalidate_shadow_page(struct intel_vgpu_ppgtt_spt *spt) · 12 unmodified lines
854854
855855 for_each_present_shadow_entry(spt, &e, index) {
856856 if (!gtt_type_is_pt(get_next_pt_type(e.type))) {
857− gvt_err("GVT doesn't support pse bit for now\n");
857+ gvt_vgpu_err("GVT doesn't support pse bit for now\n");
858858 return -EINVAL;
859859 }
860860 ret = ppgtt_invalidate_shadow_page_by_shadow_entry(
@@ -868,8 +868,8 @@ release: · 7 unmodified lines
868868 ppgtt_free_shadow_page(spt);
869869 return 0;
870870 fail:
871− gvt_err("vgpu%d: fail: shadow page %p shadow entry 0x%llx type %d\n",
872− spt->vgpu->id, spt, e.val64, e.type);
871+ gvt_vgpu_err("fail: shadow page %p shadow entry 0x%llx type %d\n",
872+ spt, e.val64, e.type);
873873 return ret;
874874 }
875875
@@ -914,8 +914,8 @@ static struct intel_vgpu_ppgtt_spt *ppgtt_populate_shadow_page_by_guest_entry( · 38 unmodified lines
914914 }
915915 return s;
916916 fail:
917− gvt_err("vgpu%d: fail: shadow page %p guest entry 0x%llx type %d\n",
918− vgpu->id, s, we->val64, we->type);
917+ gvt_vgpu_err("fail: shadow page %p guest entry 0x%llx type %d\n",
918+ s, we->val64, we->type);
919919 return ERR_PTR(ret);
920920 }
921921
@@ -953,7 +953,7 @@ static int ppgtt_populate_shadow_page(struct intel_vgpu_ppgtt_spt *spt) · 31 unmodified lines
953953
954954 for_each_present_guest_entry(spt, &ge, i) {
955955 if (!gtt_type_is_pt(get_next_pt_type(ge.type))) {
956− gvt_err("GVT doesn't support pse bit now\n");
956+ gvt_vgpu_err("GVT doesn't support pse bit now\n");
957957 ret = -EINVAL;
958958 goto fail;
959959 }
@@ -969,8 +969,8 @@ static int ppgtt_populate_shadow_page(struct intel_vgpu_ppgtt_spt *spt) · 9 unmodified lines
969969 }
970970 return 0;
971971 fail:
972− gvt_err("vgpu%d: fail: shadow page %p guest entry 0x%llx type %d\n",
973− vgpu->id, spt, ge.val64, ge.type);
972+ gvt_vgpu_err("fail: shadow page %p guest entry 0x%llx type %d\n",
973+ spt, ge.val64, ge.type);
974974 return ret;
975975 }
976976
@@ -999,7 +999,7 @@ static int ppgtt_handle_guest_entry_removal(struct intel_vgpu_guest_page *gpt, · 22 unmodified lines
999999 struct intel_vgpu_ppgtt_spt *s =
10001000 ppgtt_find_shadow_page(vgpu, ops->get_pfn(&e));
10011001 if (!s) {
1002− gvt_err("fail to find guest page\n");
1002+ gvt_vgpu_err("fail to find guest page\n");
10031003 ret = -ENXIO;
10041004 goto fail;
10051005 }
@@ -1011,8 +1011,8 @@ static int ppgtt_handle_guest_entry_removal(struct intel_vgpu_guest_page *gpt, · 5 unmodified lines
10111011 ppgtt_set_shadow_entry(spt, &e, index);
10121012 return 0;
10131013 fail:
1014− gvt_err("vgpu%d: fail: shadow page %p guest entry 0x%llx type %d\n",
1015− vgpu->id, spt, e.val64, e.type);
1014+ gvt_vgpu_err("fail: shadow page %p guest entry 0x%llx type %d\n",
1015+ spt, e.val64, e.type);
10161016 return ret;
10171017 }
10181018
@@ -1046,8 +1046,8 @@ static int ppgtt_handle_guest_entry_add(struct intel_vgpu_guest_page *gpt, · 27 unmodified lines
10461046 }
10471047 return 0;
10481048 fail:
1049− gvt_err("vgpu%d: fail: spt %p guest entry 0x%llx type %d\n", vgpu->id,
1050− spt, we->val64, we->type);
1049+ gvt_vgpu_err("fail: spt %p guest entry 0x%llx type %d\n",
1050+ spt, we->val64, we->type);
10511051 return ret;
10521052 }
10531053
@@ -1250,8 +1250,8 @@ static int ppgtt_handle_guest_write_page_table( · 196 unmodified lines
12501250 }
12511251 return 0;
12521252 fail:
1253− gvt_err("vgpu%d: fail: shadow page %p guest entry 0x%llx type %d.\n",
1254− vgpu->id, spt, we->val64, we->type);
1253+ gvt_vgpu_err("fail: shadow page %p guest entry 0x%llx type %d.\n",
1254+ spt, we->val64, we->type);
12551255 return ret;
12561256 }
12571257
@@ -1493,7 +1493,7 @@ static int shadow_mm(struct intel_vgpu_mm *mm) · 235 unmodified lines
14931493
14941494 spt = ppgtt_populate_shadow_page_by_guest_entry(vgpu, &ge);
14951495 if (IS_ERR(spt)) {
1496− gvt_err("fail to populate guest root pointer\n");
1496+ gvt_vgpu_err("fail to populate guest root pointer\n");
14971497 ret = PTR_ERR(spt);
14981498 goto fail;
14991499 }
@@ -1566,7 +1566,7 @@ struct intel_vgpu_mm *intel_vgpu_create_mm(struct intel_vgpu *vgpu, · 66 unmodified lines
15661566
15671567 ret = gtt->mm_alloc_page_table(mm);
15681568 if (ret) {
1569− gvt_err("fail to allocate page table for mm\n");
1569+ gvt_vgpu_err("fail to allocate page table for mm\n");
15701570 goto fail;
15711571 }
15721572
@@ -1584,7 +1584,7 @@ struct intel_vgpu_mm *intel_vgpu_create_mm(struct intel_vgpu *vgpu, · 11 unmodified lines
15841584 }
15851585 return mm;
15861586 fail:
1587− gvt_err("fail to create mm\n");
1587+ gvt_vgpu_err("fail to create mm\n");
15881588 if (mm)
15891589 intel_gvt_mm_unreference(mm);
15901590 return ERR_PTR(ret);
@@ -1760,7 +1760,7 @@ unsigned long intel_vgpu_gma_to_gpa(struct intel_vgpu_mm *mm, unsigned long gma) · 169 unmodified lines
17601760 mm->page_table_level, gma, gpa);
17611761 return gpa;
17621762 err:
1763− gvt_err("invalid mm type: %d gma %lx\n", mm->type, gma);
1763+ gvt_vgpu_err("invalid mm type: %d gma %lx\n", mm->type, gma);
17641764 return INTEL_GVT_INVALID_ADDR;
17651765 }
17661766
@@ -1836,8 +1836,7 @@ static int emulate_gtt_mmio_write(struct intel_vgpu *vgpu, unsigned int off, · 69 unmodified lines
18361836 if (ops->test_present(&e)) {
18371837 ret = gtt_entry_p2m(vgpu, &e, &m);
18381838 if (ret) {
1839− gvt_err("vgpu%d: fail to translate guest gtt entry\n",
1840− vgpu->id);
1839+ gvt_vgpu_err("fail to translate guest gtt entry\n");
18411840 return ret;
18421841 }
18431842 } else {
@@ -1893,14 +1892,14 @@ static int alloc_scratch_pages(struct intel_vgpu *vgpu, · 49 unmodified lines
18931892
18941893 scratch_pt = (void *)get_zeroed_page(GFP_KERNEL);
18951894 if (!scratch_pt) {
1896− gvt_err("fail to allocate scratch page\n");
1895+ gvt_vgpu_err("fail to allocate scratch page\n");
18971896 return -ENOMEM;
18981897 }
18991898
19001899 daddr = dma_map_page(dev, virt_to_page(scratch_pt), 0,
19011900 4096, PCI_DMA_BIDIRECTIONAL);
19021901 if (dma_mapping_error(dev, daddr)) {
1903− gvt_err("fail to dmamap scratch_pt\n");
1902+ gvt_vgpu_err("fail to dmamap scratch_pt\n");
19041903 __free_page(virt_to_page(scratch_pt));
19051904 return -ENOMEM;
19061905 }
@@ -2003,7 +2002,7 @@ int intel_vgpu_init_gtt(struct intel_vgpu *vgpu) · 96 unmodified lines
20032002 ggtt_mm = intel_vgpu_create_mm(vgpu, INTEL_GVT_MM_GGTT,
20042003 NULL, 1, 0);
20052004 if (IS_ERR(ggtt_mm)) {
2006− gvt_err("fail to create mm for ggtt.\n");
2005+ gvt_vgpu_err("fail to create mm for ggtt.\n");
20072006 return PTR_ERR(ggtt_mm);
20082007 }
20092008
@@ -2076,7 +2075,6 @@ static int setup_spt_oos(struct intel_gvt *gvt) · 66 unmodified lines
20762075 for (i = 0; i < preallocated_oos_pages; i++) {
20772076 oos_page = kzalloc(sizeof(*oos_page), GFP_KERNEL);
20782077 if (!oos_page) {
2079− gvt_err("fail to pre-allocate oos page\n");
20802078 ret = -ENOMEM;
20812079 goto fail;
20822080 }
@@ -2166,7 +2164,7 @@ int intel_vgpu_g2v_create_ppgtt_mm(struct intel_vgpu *vgpu, · 83 unmodified lines
21662164 mm = intel_vgpu_create_mm(vgpu, INTEL_GVT_MM_PPGTT,
21672165 pdp, page_table_level, 0);
21682166 if (IS_ERR(mm)) {
2169− gvt_err("fail to create mm\n");
2167+ gvt_vgpu_err("fail to create mm\n");
21702168 return PTR_ERR(mm);
21712169 }
21722170 }
@@ -2196,7 +2194,7 @@ int intel_vgpu_g2v_destroy_ppgtt_mm(struct intel_vgpu *vgpu, · 23 unmodified lines
21962194
21972195 mm = intel_vgpu_find_ppgtt_mm(vgpu, page_table_level, pdp);
21982196 if (!mm) {
2199− gvt_err("fail to find ppgtt instance.\n");
2197+ gvt_vgpu_err("fail to find ppgtt instance.\n");
22002198 return -EINVAL;
22012199 }
22022200 intel_gvt_mm_unreference(mm);
drivers/gpu/drm/i915/gvt/gvt.h+1−1
@@ -162,7 +162,6 @@ struct intel_vgpu { · 161 unmodified lines
162162 atomic_t running_workload_num;
163163 DECLARE_BITMAP(tlb_handle_pending, I915_NUM_ENGINES);
164164 struct i915_gem_context *shadow_ctx;
165− struct notifier_block shadow_ctx_notifier_block;
166165
167166 #if IS_ENABLED(CONFIG_DRM_I915_GVT_KVMGT)
168167 struct {
@@ -233,6 +232,7 @@ struct intel_gvt { · 64 unmodified lines
233232 struct intel_gvt_gtt gtt;
234233 struct intel_gvt_opregion opregion;
235234 struct intel_gvt_workload_scheduler scheduler;
235+ struct notifier_block shadow_ctx_notifier_block[I915_NUM_ENGINES];
236236 DECLARE_HASHTABLE(cmd_table, GVT_CMD_HASH_BITS);
237237 struct intel_vgpu_type *types;
238238 unsigned int num_types;
drivers/gpu/drm/i915/gvt/handlers.c+30−15
@@ -181,11 +181,9 @@ static int sanitize_fence_mmio_access(struct intel_vgpu *vgpu, · 180 unmodified lines
181181 GVT_FAILSAFE_UNSUPPORTED_GUEST);
182182
183183 if (!vgpu->mmio.disable_warn_untrack) {
184− gvt_err("vgpu%d: found oob fence register access\n",
185− vgpu->id);
186− gvt_err("vgpu%d: total fence %d, access fence %d\n",
187− vgpu->id, vgpu_fence_sz(vgpu),
188− fence_num);
184+ gvt_vgpu_err("found oob fence register access\n");
185+ gvt_vgpu_err("total fence %d, access fence %d\n",
186+ vgpu_fence_sz(vgpu), fence_num);
189187 }
190188 memset(p_data, 0, bytes);
191189 return -EINVAL;
@@ -249,7 +247,7 @@ static int mul_force_wake_write(struct intel_vgpu *vgpu, · 57 unmodified lines
249247 break;
250248 default:
251249 /*should not hit here*/
252− gvt_err("invalid forcewake offset 0x%x\n", offset);
250+ gvt_vgpu_err("invalid forcewake offset 0x%x\n", offset);
253251 return -EINVAL;
254252 }
255253 } else {
@@ -530,7 +528,7 @@ static int check_fdi_rx_train_status(struct intel_vgpu *vgpu, · 274 unmodified lines
530528 fdi_tx_train_bits = FDI_LINK_TRAIN_PATTERN_2;
531529 fdi_iir_check_bits = FDI_RX_SYMBOL_LOCK;
532530 } else {
533− gvt_err("Invalid train pattern %d\n", train_pattern);
531+ gvt_vgpu_err("Invalid train pattern %d\n", train_pattern);
534532 return -EINVAL;
535533 }
536534
@@ -588,7 +586,7 @@ static int update_fdi_rx_iir_status(struct intel_vgpu *vgpu, · 51 unmodified lines
588586 else if (FDI_RX_IMR_TO_PIPE(offset) != INVALID_INDEX)
589587 index = FDI_RX_IMR_TO_PIPE(offset);
590588 else {
591− gvt_err("Unsupport registers %x\n", offset);
589+ gvt_vgpu_err("Unsupport registers %x\n", offset);
592590 return -EINVAL;
593591 }
594592
@@ -818,7 +816,7 @@ static int dp_aux_ch_ctl_mmio_write(struct intel_vgpu *vgpu, · 223 unmodified lines
818816 u32 data;
819817
820818 if (!dpy_is_valid_port(port_index)) {
821− gvt_err("GVT(%d): Unsupported DP port access!\n", vgpu->id);
819+ gvt_vgpu_err("Unsupported DP port access!\n");
822820 return 0;
823821 }
824822
@@ -1016,8 +1014,7 @@ static void write_virtual_sbi_register(struct intel_vgpu *vgpu, · 191 unmodified lines
10161014
10171015 if (i == num) {
10181016 if (num == SBI_REG_MAX) {
1019− gvt_err("vgpu%d: SBI caching meets maximum limits\n",
1020− vgpu->id);
1017+ gvt_vgpu_err("SBI caching meets maximum limits\n");
10211018 return;
10221019 }
10231020 display->sbi.number++;
@@ -1097,7 +1094,7 @@ static int pvinfo_mmio_read(struct intel_vgpu *vgpu, unsigned int offset, · 73 unmodified lines
10971094 break;
10981095 }
10991096 if (invalid_read)
1100− gvt_err("invalid pvinfo read: [%x:%x] = %x\n",
1097+ gvt_vgpu_err("invalid pvinfo read: [%x:%x] = %x\n",
11011098 offset, bytes, *(u32 *)p_data);
11021099 vgpu->pv_notified = true;
11031100 return 0;
@@ -1125,7 +1122,7 @@ static int handle_g2v_notification(struct intel_vgpu *vgpu, int notification) · 21 unmodified lines
11251122 case 1: /* Remove this in guest driver. */
11261123 break;
11271124 default:
1128− gvt_err("Invalid PV notification %d\n", notification);
1125+ gvt_vgpu_err("Invalid PV notification %d\n", notification);
11291126 }
11301127 return ret;
11311128 }
@@ -1181,7 +1178,7 @@ static int pvinfo_mmio_write(struct intel_vgpu *vgpu, unsigned int offset, · 49 unmodified lines
11811178 enter_failsafe_mode(vgpu, GVT_FAILSAFE_INSUFFICIENT_RESOURCE);
11821179 break;
11831180 default:
1184− gvt_err("invalid pvinfo write offset %x bytes %x data %x\n",
1181+ gvt_vgpu_err("invalid pvinfo write offset %x bytes %x data %x\n",
11851182 offset, bytes, data);
11861183 break;
11871184 }
@@ -1415,7 +1412,8 @@ static int elsp_mmio_write(struct intel_vgpu *vgpu, unsigned int offset, · 227 unmodified lines
14151412 if (execlist->elsp_dwords.index == 3) {
14161413 ret = intel_vgpu_submit_execlist(vgpu, ring_id);
14171414 if(ret)
1418− gvt_err("fail submit workload on ring %d\n", ring_id);
1415+ gvt_vgpu_err("fail submit workload on ring %d\n",
1416+ ring_id);
14191417 }
14201418
14211419 ++execlist->elsp_dwords.index;
@@ -2988,3 +2986,20 @@ int intel_vgpu_default_mmio_write(struct intel_vgpu *vgpu, unsigned int offset, · 1566 unmodified lines
29882986 write_vreg(vgpu, offset, p_data, bytes);
29892987 return 0;
29902988 }
2989+
2990+/**
2991+ * intel_gvt_in_force_nonpriv_whitelist - if a mmio is in whitelist to be
2992+ * force-nopriv register
2993+ *
2994+ * @gvt: a GVT device
2995+ * @offset: register offset
2996+ *
2997+ * Returns:
2998+ * True if the register is in force-nonpriv whitelist;
2999+ * False if outside;
3000+ */
3001+bool intel_gvt_in_force_nonpriv_whitelist(struct intel_gvt *gvt,
3002+ unsigned int offset)
3003+{
3004+ return in_whitelist(offset);
3005+}
drivers/gpu/drm/i915/gvt/kvmgt.c+23−14
@@ -426,7 +426,7 @@ static void kvmgt_protect_table_del(struct kvmgt_guest_info *info, · 425 unmodified lines
426426
427427 static int intel_vgpu_create(struct kobject *kobj, struct mdev_device *mdev)
428428 {
429− struct intel_vgpu *vgpu;
429+ struct intel_vgpu *vgpu = NULL;
430430 struct intel_vgpu_type *type;
431431 struct device *pdev;
432432 void *gvt;
@@ -437,7 +437,7 @@ static int intel_vgpu_create(struct kobject *kobj, struct mdev_device *mdev) · 4 unmodified lines
437437
438438 type = intel_gvt_find_vgpu_type(gvt, kobject_name(kobj));
439439 if (!type) {
440− gvt_err("failed to find type %s to create\n",
440+ gvt_vgpu_err("failed to find type %s to create\n",
441441 kobject_name(kobj));
442442 ret = -EINVAL;
443443 goto out;
@@ -446,7 +446,7 @@ static int intel_vgpu_create(struct kobject *kobj, struct mdev_device *mdev) · 2 unmodified lines
446446 vgpu = intel_gvt_ops->vgpu_create(gvt, type);
447447 if (IS_ERR_OR_NULL(vgpu)) {
448448 ret = vgpu == NULL ? -EFAULT : PTR_ERR(vgpu);
449− gvt_err("failed to create intel vgpu: %d\n", ret);
449+ gvt_vgpu_err("failed to create intel vgpu: %d\n", ret);
450450 goto out;
451451 }
452452
@@ -526,7 +526,8 @@ static int intel_vgpu_open(struct mdev_device *mdev) · 73 unmodified lines
526526 ret = vfio_register_notifier(mdev_dev(mdev), VFIO_IOMMU_NOTIFY, &events,
527527 &vgpu->vdev.iommu_notifier);
528528 if (ret != 0) {
529− gvt_err("vfio_register_notifier for iommu failed: %d\n", ret);
529+ gvt_vgpu_err("vfio_register_notifier for iommu failed: %d\n",
530+ ret);
530531 goto out;
531532 }
532533
@@ -534,7 +535,8 @@ static int intel_vgpu_open(struct mdev_device *mdev) · 1 unmodified line
534535 ret = vfio_register_notifier(mdev_dev(mdev), VFIO_GROUP_NOTIFY, &events,
535536 &vgpu->vdev.group_notifier);
536537 if (ret != 0) {
537− gvt_err("vfio_register_notifier for group failed: %d\n", ret);
538+ gvt_vgpu_err("vfio_register_notifier for group failed: %d\n",
539+ ret);
538540 goto undo_iommu;
539541 }
540542
@@ -635,7 +637,7 @@ static ssize_t intel_vgpu_rw(struct mdev_device *mdev, char *buf, · 94 unmodified lines
635637
636638
637639 if (index >= VFIO_PCI_NUM_REGIONS) {
638− gvt_err("invalid index: %u\n", index);
640+ gvt_vgpu_err("invalid index: %u\n", index);
639641 return -EINVAL;
640642 }
641643
@@ -669,7 +671,7 @@ static ssize_t intel_vgpu_rw(struct mdev_device *mdev, char *buf, · 27 unmodified lines
669671 case VFIO_PCI_VGA_REGION_INDEX:
670672 case VFIO_PCI_ROM_REGION_INDEX:
671673 default:
672− gvt_err("unsupported region: %u\n", index);
674+ gvt_vgpu_err("unsupported region: %u\n", index);
673675 }
674676
675677 return ret == 0 ? count : ret;
@@ -861,7 +863,7 @@ static int intel_vgpu_set_msi_trigger(struct intel_vgpu *vgpu, · 185 unmodified lines
861863
862864 trigger = eventfd_ctx_fdget(fd);
863865 if (IS_ERR(trigger)) {
864− gvt_err("eventfd_ctx_fdget failed\n");
866+ gvt_vgpu_err("eventfd_ctx_fdget failed\n");
865867 return PTR_ERR(trigger);
866868 }
867869 vgpu->vdev.msi_trigger = trigger;
@@ -1120,7 +1122,7 @@ static long intel_vgpu_ioctl(struct mdev_device *mdev, unsigned int cmd, · 252 unmodified lines
11201122 ret = vfio_set_irqs_validate_and_prepare(&hdr, max,
11211123 VFIO_PCI_NUM_IRQS, &data_size);
11221124 if (ret) {
1123− gvt_err("intel:vfio_set_irqs_validate_and_prepare failed\n");
1125+ gvt_vgpu_err("intel:vfio_set_irqs_validate_and_prepare failed\n");
11241126 return -EINVAL;
11251127 }
11261128 if (data_size) {
@@ -1310,7 +1312,7 @@ static int kvmgt_guest_init(struct mdev_device *mdev) · 183 unmodified lines
13101312
13111313 kvm = vgpu->vdev.kvm;
13121314 if (!kvm || kvm->mm != current->mm) {
1313− gvt_err("KVM is required to use Intel vGPU\n");
1315+ gvt_vgpu_err("KVM is required to use Intel vGPU\n");
13141316 return -ESRCH;
13151317 }
13161318
@@ -1337,8 +1339,10 @@ static int kvmgt_guest_init(struct mdev_device *mdev) · 20 unmodified lines
13371339
13381340 static bool kvmgt_guest_exit(struct kvmgt_guest_info *info)
13391341 {
1342+ struct intel_vgpu *vgpu = info->vgpu;
1343+
13401344 if (!info) {
1341− gvt_err("kvmgt_guest_info invalid\n");
1345+ gvt_vgpu_err("kvmgt_guest_info invalid\n");
13421346 return false;
13431347 }
13441348
@@ -1383,12 +1387,14 @@ static unsigned long kvmgt_gfn_to_pfn(unsigned long handle, unsigned long gfn) · 38 unmodified lines
13831387 unsigned long iova, pfn;
13841388 struct kvmgt_guest_info *info;
13851389 struct device *dev;
1390+ struct intel_vgpu *vgpu;
13861391 int rc;
13871392
13881393 if (!handle_valid(handle))
13891394 return INTEL_GVT_INVALID_ADDR;
13901395
13911396 info = (struct kvmgt_guest_info *)handle;
1397+ vgpu = info->vgpu;
13921398 iova = gvt_cache_find(info->vgpu, gfn);
13931399 if (iova != INTEL_GVT_INVALID_ADDR)
13941400 return iova;
@@ -1397,13 +1403,14 @@ static unsigned long kvmgt_gfn_to_pfn(unsigned long handle, unsigned long gfn) · 2 unmodified lines
13971403 dev = mdev_dev(info->vgpu->vdev.mdev);
13981404 rc = vfio_pin_pages(dev, &gfn, 1, IOMMU_READ | IOMMU_WRITE, &pfn);
13991405 if (rc != 1) {
1400− gvt_err("vfio_pin_pages failed for gfn 0x%lx: %d\n", gfn, rc);
1406+ gvt_vgpu_err("vfio_pin_pages failed for gfn 0x%lx: %d\n",
1407+ gfn, rc);
14011408 return INTEL_GVT_INVALID_ADDR;
14021409 }
14031410 /* transfer to host iova for GFX to use DMA */
14041411 rc = gvt_dma_map_iova(info->vgpu, pfn, &iova);
14051412 if (rc) {
1406− gvt_err("gvt_dma_map_iova failed for gfn: 0x%lx\n", gfn);
1413+ gvt_vgpu_err("gvt_dma_map_iova failed for gfn: 0x%lx\n", gfn);
14071414 vfio_unpin_pages(dev, &gfn, 1);
14081415 return INTEL_GVT_INVALID_ADDR;
14091416 }
@@ -1417,7 +1424,7 @@ static int kvmgt_rw_gpa(unsigned long handle, unsigned long gpa, · 7 unmodified lines
14171424 {
14181425 struct kvmgt_guest_info *info;
14191426 struct kvm *kvm;
1420− int ret;
1427+ int idx, ret;
14211428 bool kthread = current->mm == NULL;
14221429
14231430 if (!handle_valid(handle))
@@ -1429,8 +1436,10 @@ static int kvmgt_rw_gpa(unsigned long handle, unsigned long gpa, · 5 unmodified lines
14291436 if (kthread)
14301437 use_mm(kvm->mm);
14311438
1439+ idx = srcu_read_lock(&kvm->srcu);
14321440 ret = write ? kvm_write_guest(kvm, gpa, buf, len) :
14331441 kvm_read_guest(kvm, gpa, buf, len);
1442+ srcu_read_unlock(&kvm->srcu, idx);
14341443
14351444 if (kthread)
14361445 unuse_mm(kvm->mm);
drivers/gpu/drm/i915/gvt/mmio.c+19−19
@@ -142,10 +142,10 @@ int intel_vgpu_emulate_mmio_read(struct intel_vgpu *vgpu, uint64_t pa, · 141 unmodified lines
142142 ret = intel_gvt_hypervisor_read_gpa(vgpu, pa,
143143 p_data, bytes);
144144 if (ret) {
145− gvt_err("vgpu%d: guest page read error %d, "
145+ gvt_vgpu_err("guest page read error %d, "
146146 "gfn 0x%lx, pa 0x%llx, var 0x%x, len %d\n",
147− vgpu->id, ret,
148− gp->gfn, pa, *(u32 *)p_data, bytes);
147+ ret, gp->gfn, pa, *(u32 *)p_data,
148+ bytes);
149149 }
150150 mutex_unlock(&gvt->lock);
151151 return ret;
@@ -200,14 +200,13 @@ int intel_vgpu_emulate_mmio_read(struct intel_vgpu *vgpu, uint64_t pa, · 48 unmodified lines
200200 ret = intel_vgpu_default_mmio_read(vgpu, offset, p_data, bytes);
201201
202202 if (!vgpu->mmio.disable_warn_untrack) {
203− gvt_err("vgpu%d: read untracked MMIO %x(%dB) val %x\n",
204− vgpu->id, offset, bytes, *(u32 *)p_data);
203+ gvt_vgpu_err("read untracked MMIO %x(%dB) val %x\n",
204+ offset, bytes, *(u32 *)p_data);
205205
206206 if (offset == 0x206c) {
207− gvt_err("------------------------------------------\n");
208− gvt_err("vgpu%d: likely triggers a gfx reset\n",
209− vgpu->id);
210− gvt_err("------------------------------------------\n");
207+ gvt_vgpu_err("------------------------------------------\n");
208+ gvt_vgpu_err("likely triggers a gfx reset\n");
209+ gvt_vgpu_err("------------------------------------------\n");
211210 vgpu->mmio.disable_warn_untrack = true;
212211 }
213212 }
@@ -220,8 +219,8 @@ int intel_vgpu_emulate_mmio_read(struct intel_vgpu *vgpu, uint64_t pa, · 6 unmodified lines
220219 mutex_unlock(&gvt->lock);
221220 return 0;
222221 err:
223− gvt_err("vgpu%d: fail to emulate MMIO read %08x len %d\n",
224− vgpu->id, offset, bytes);
222+ gvt_vgpu_err("fail to emulate MMIO read %08x len %d\n",
223+ offset, bytes);
225224 mutex_unlock(&gvt->lock);
226225 return ret;
227226 }
@@ -259,10 +258,11 @@ int intel_vgpu_emulate_mmio_write(struct intel_vgpu *vgpu, uint64_t pa, · 31 unmodified lines
259258 if (gp) {
260259 ret = gp->handler(gp, pa, p_data, bytes);
261260 if (ret) {
262− gvt_err("vgpu%d: guest page write error %d, "
263− "gfn 0x%lx, pa 0x%llx, var 0x%x, len %d\n",
264− vgpu->id, ret,
265− gp->gfn, pa, *(u32 *)p_data, bytes);
261+ gvt_err("guest page write error %d, "
262+ "gfn 0x%lx, pa 0x%llx, "
263+ "var 0x%x, len %d\n",
264+ ret, gp->gfn, pa,
265+ *(u32 *)p_data, bytes);
266266 }
267267 mutex_unlock(&gvt->lock);
268268 return ret;
@@ -329,8 +329,8 @@ int intel_vgpu_emulate_mmio_write(struct intel_vgpu *vgpu, uint64_t pa, · 60 unmodified lines
329329
330330 /* all register bits are RO. */
331331 if (ro_mask == ~(u64)0) {
332− gvt_err("vgpu%d: try to write RO reg %x\n",
333− vgpu->id, offset);
332+ gvt_vgpu_err("try to write RO reg %x\n",
333+ offset);
334334 ret = 0;
335335 goto out;
336336 }
@@ -360,8 +360,8 @@ out: · 23 unmodified lines
360360 mutex_unlock(&gvt->lock);
361361 return 0;
362362 err:
363− gvt_err("vgpu%d: fail to emulate MMIO write %08x len %d\n",
364− vgpu->id, offset, bytes);
363+ gvt_vgpu_err("fail to emulate MMIO write %08x len %d\n", offset,
364+ bytes);
365365 mutex_unlock(&gvt->lock);
366366 return ret;
367367 }
drivers/gpu/drm/i915/gvt/mmio.h+3−0
@@ -107,4 +107,7 @@ int intel_vgpu_default_mmio_read(struct intel_vgpu *vgpu, unsigned int offset, · 106 unmodified lines
107107 void *p_data, unsigned int bytes);
108108 int intel_vgpu_default_mmio_write(struct intel_vgpu *vgpu, unsigned int offset,
109109 void *p_data, unsigned int bytes);
110+
111+bool intel_gvt_in_force_nonpriv_whitelist(struct intel_gvt *gvt,
112+ unsigned int offset);
110113 #endif
drivers/gpu/drm/i915/gvt/opregion.c+5−5
@@ -67,14 +67,15 @@ static int map_vgpu_opregion(struct intel_vgpu *vgpu, bool map) · 66 unmodified lines
6767 mfn = intel_gvt_hypervisor_virt_to_mfn(vgpu_opregion(vgpu)->va
6868 + i * PAGE_SIZE);
6969 if (mfn == INTEL_GVT_INVALID_ADDR) {
70− gvt_err("fail to get MFN from VA\n");
70+ gvt_vgpu_err("fail to get MFN from VA\n");
7171 return -EINVAL;
7272 }
7373 ret = intel_gvt_hypervisor_map_gfn_to_mfn(vgpu,
7474 vgpu_opregion(vgpu)->gfn[i],
7575 mfn, 1, map);
7676 if (ret) {
77− gvt_err("fail to map GFN to MFN, errno: %d\n", ret);
77+ gvt_vgpu_err("fail to map GFN to MFN, errno: %d\n",
78+ ret);
7879 return ret;
7980 }
8081 }
@@ -287,7 +288,7 @@ int intel_vgpu_emulate_opregion_request(struct intel_vgpu *vgpu, u32 swsci) · 206 unmodified lines
287288 parm = vgpu_opregion(vgpu)->va + INTEL_GVT_OPREGION_PARM;
288289
289290 if (!(swsci & SWSCI_SCI_SELECT)) {
290− gvt_err("vgpu%d: requesting SMI service\n", vgpu->id);
291+ gvt_vgpu_err("requesting SMI service\n");
291292 return 0;
292293 }
293294 /* ignore non 0->1 trasitions */
@@ -300,9 +301,8 @@ int intel_vgpu_emulate_opregion_request(struct intel_vgpu *vgpu, u32 swsci) · 6 unmodified lines
300301 func = GVT_OPREGION_FUNC(*scic);
301302 subfunc = GVT_OPREGION_SUBFUNC(*scic);
302303 if (!querying_capabilities(*scic)) {
303− gvt_err("vgpu%d: requesting runtime service: func \"%s\","
304+ gvt_vgpu_err("requesting runtime service: func \"%s\","
304305 " subfunc \"%s\"\n",
305− vgpu->id,
306306 opregion_func_name(func),
307307 opregion_subfunc_name(subfunc));
308308 /*
drivers/gpu/drm/i915/gvt/render.c+1−1
@@ -167,7 +167,7 @@ static void handle_tlb_pending_event(struct intel_vgpu *vgpu, int ring_id) · 166 unmodified lines
167167 I915_WRITE_FW(reg, 0x1);
168168
169169 if (wait_for_atomic((I915_READ_FW(reg) == 0), 50))
170− gvt_err("timeout in invalidate ring (%d) tlb\n", ring_id);
170+ gvt_vgpu_err("timeout in invalidate ring (%d) tlb\n", ring_id);
171171 else
172172 vgpu_vreg(vgpu, regs[ring_id]) = 0;
173173
drivers/gpu/drm/i915/gvt/sched_policy.c+2−2
@@ -101,7 +101,7 @@ struct tbs_sched_data { · 100 unmodified lines
101101 struct list_head runq_head;
102102 };
103103
104−#define GVT_DEFAULT_TIME_SLICE (1 * HZ / 1000)
104+#define GVT_DEFAULT_TIME_SLICE (msecs_to_jiffies(1))
105105
106106 static void tbs_sched_func(struct work_struct *work)
107107 {
@@ -223,7 +223,7 @@ static void tbs_sched_start_schedule(struct intel_vgpu *vgpu) · 115 unmodified lines
223223 return;
224224
225225 list_add_tail(&vgpu_data->list, &sched_data->runq_head);
226− schedule_delayed_work(&sched_data->work, sched_data->period);
226+ schedule_delayed_work(&sched_data->work, 0);
227227 }
228228
229229 static void tbs_sched_stop_schedule(struct intel_vgpu *vgpu)
drivers/gpu/drm/i915/gvt/scheduler.c+60−46
@@ -84,7 +84,7 @@ static int populate_shadow_context(struct intel_vgpu_workload *workload) · 83 unmodified lines
8484 (u32)((workload->ctx_desc.lrca + i) <<
8585 GTT_PAGE_SHIFT));
8686 if (context_gpa == INTEL_GVT_INVALID_ADDR) {
87− gvt_err("Invalid guest context descriptor\n");
87+ gvt_vgpu_err("Invalid guest context descriptor\n");
8888 return -EINVAL;
8989 }
9090
@@ -130,12 +130,10 @@ static int populate_shadow_context(struct intel_vgpu_workload *workload) · 39 unmodified lines
130130 static int shadow_context_status_change(struct notifier_block *nb,
131131 unsigned long action, void *data)
132132 {
133− struct intel_vgpu *vgpu = container_of(nb,
134− struct intel_vgpu, shadow_ctx_notifier_block);
135− struct drm_i915_gem_request *req =
136− (struct drm_i915_gem_request *)data;
137− struct intel_gvt_workload_scheduler *scheduler =
138− &vgpu->gvt->scheduler;
133+ struct drm_i915_gem_request *req = (struct drm_i915_gem_request *)data;
134+ struct intel_gvt *gvt = container_of(nb, struct intel_gvt,
135+ shadow_ctx_notifier_block[req->engine->id]);
136+ struct intel_gvt_workload_scheduler *scheduler = &gvt->scheduler;
139137 struct intel_vgpu_workload *workload =
140138 scheduler->current_workload[req->engine->id];
141139
@@ -175,7 +173,9 @@ static int dispatch_workload(struct intel_vgpu_workload *workload) · 33 unmodified lines
175173 int ring_id = workload->ring_id;
176174 struct i915_gem_context *shadow_ctx = workload->vgpu->shadow_ctx;
177175 struct drm_i915_private *dev_priv = workload->vgpu->gvt->dev_priv;
176+ struct intel_engine_cs *engine = dev_priv->engine[ring_id];
178177 struct drm_i915_gem_request *rq;
178+ struct intel_vgpu *vgpu = workload->vgpu;
179179 int ret;
180180
181181 gvt_dbg_sched("ring id %d prepare to dispatch workload %p\n",
@@ -187,9 +187,24 @@ static int dispatch_workload(struct intel_vgpu_workload *workload) · 5 unmodified lines
187187
188188 mutex_lock(&dev_priv->drm.struct_mutex);
189189
190+ /* pin shadow context by gvt even the shadow context will be pinned
191+ * when i915 alloc request. That is because gvt will update the guest
192+ * context from shadow context when workload is completed, and at that
193+ * moment, i915 may already unpined the shadow context to make the
194+ * shadow_ctx pages invalid. So gvt need to pin itself. After update
195+ * the guest context, gvt can unpin the shadow_ctx safely.
196+ */
197+ ret = engine->context_pin(engine, shadow_ctx);
198+ if (ret) {
199+ gvt_vgpu_err("fail to pin shadow context\n");
200+ workload->status = ret;
201+ mutex_unlock(&dev_priv->drm.struct_mutex);
202+ return ret;
203+ }
204+
190205 rq = i915_gem_request_alloc(dev_priv->engine[ring_id], shadow_ctx);
191206 if (IS_ERR(rq)) {
192− gvt_err("fail to allocate gem request\n");
207+ gvt_vgpu_err("fail to allocate gem request\n");
193208 ret = PTR_ERR(rq);
194209 goto out;
195210 }
@@ -202,9 +217,12 @@ static int dispatch_workload(struct intel_vgpu_workload *workload) · 6 unmodified lines
202217 if (ret)
203218 goto out;
204219
205− ret = intel_gvt_scan_and_shadow_wa_ctx(&workload->wa_ctx);
206− if (ret)
207− goto out;
220+ if ((workload->ring_id == RCS) &&
221+ (workload->wa_ctx.indirect_ctx.size != 0)) {
222+ ret = intel_gvt_scan_and_shadow_wa_ctx(&workload->wa_ctx);
223+ if (ret)
224+ goto out;
225+ }
208226
209227 ret = populate_shadow_context(workload);
210228 if (ret)
@@ -227,6 +245,9 @@ out: · 16 unmodified lines
227245
228246 if (!IS_ERR_OR_NULL(rq))
229247 i915_add_request_no_flush(rq);
248+ else
249+ engine->context_unpin(engine, shadow_ctx);
250+
230251 mutex_unlock(&dev_priv->drm.struct_mutex);
231252 return ret;
232253 }
@@ -322,7 +343,7 @@ static void update_guest_context(struct intel_vgpu_workload *workload) · 89 unmodified lines
322343 (u32)((workload->ctx_desc.lrca + i) <<
323344 GTT_PAGE_SHIFT));
324345 if (context_gpa == INTEL_GVT_INVALID_ADDR) {
325− gvt_err("invalid guest context descriptor\n");
346+ gvt_vgpu_err("invalid guest context descriptor\n");
326347 return;
327348 }
328349
@@ -376,6 +397,10 @@ static void complete_current_workload(struct intel_gvt *gvt, int ring_id) · 47 unmodified lines
376397 * For the workload w/o request, directly complete the workload.
377398 */
378399 if (workload->req) {
400+ struct drm_i915_private *dev_priv =
401+ workload->vgpu->gvt->dev_priv;
402+ struct intel_engine_cs *engine =
403+ dev_priv->engine[workload->ring_id];
379404 wait_event(workload->shadow_ctx_status_wq,
380405 !atomic_read(&workload->shadow_ctx_active));
381406
@@ -388,6 +413,10 @@ static void complete_current_workload(struct intel_gvt *gvt, int ring_id) · 6 unmodified lines
388413 INTEL_GVT_EVENT_MAX)
389414 intel_vgpu_trigger_virtual_event(vgpu, event);
390415 }
416+ mutex_lock(&dev_priv->drm.struct_mutex);
417+ /* unpin shadow ctx as the shadow_ctx update is done */
418+ engine->context_unpin(engine, workload->vgpu->shadow_ctx);
419+ mutex_unlock(&dev_priv->drm.struct_mutex);
391420 }
392421
393422 gvt_dbg_sched("ring id %d complete workload %p status %d\n",
@@ -417,6 +446,7 @@ static int workload_thread(void *priv) · 23 unmodified lines
417446 int ring_id = p->ring_id;
418447 struct intel_gvt_workload_scheduler *scheduler = &gvt->scheduler;
419448 struct intel_vgpu_workload *workload = NULL;
449+ struct intel_vgpu *vgpu = NULL;
420450 int ret;
421451 bool need_force_wake = IS_SKYLAKE(gvt->dev_priv);
422452 DEFINE_WAIT_FUNC(wait, woken_wake_function);
@@ -459,25 +489,14 @@ static int workload_thread(void *priv) · 36 unmodified lines
459489 mutex_unlock(&gvt->lock);
460490
461491 if (ret) {
462− gvt_err("fail to dispatch workload, skip\n");
492+ vgpu = workload->vgpu;
493+ gvt_vgpu_err("fail to dispatch workload, skip\n");
463494 goto complete;
464495 }
465496
466497 gvt_dbg_sched("ring id %d wait workload %p\n",
467498 workload->ring_id, workload);
468−retry:
469− i915_wait_request(workload->req,
470− 0, MAX_SCHEDULE_TIMEOUT);
471− /* I915 has replay mechanism and a request will be replayed
472− * if there is i915 reset. So the seqno will be updated anyway.
473− * If the seqno is not updated yet after waiting, which means
474− * the replay may still be in progress and we can wait again.
475− */
476− if (!i915_gem_request_completed(workload->req)) {
477− gvt_dbg_sched("workload %p not completed, wait again\n",
478− workload);
479− goto retry;
480− }
499+ i915_wait_request(workload->req, 0, MAX_SCHEDULE_TIMEOUT);
481500
482501 complete:
483502 gvt_dbg_sched("will complete workload %p, status: %d\n",
@@ -513,15 +532,16 @@ void intel_gvt_wait_vgpu_idle(struct intel_vgpu *vgpu) · 29 unmodified lines
513532 void intel_gvt_clean_workload_scheduler(struct intel_gvt *gvt)
514533 {
515534 struct intel_gvt_workload_scheduler *scheduler = &gvt->scheduler;
516− int i;
535+ struct intel_engine_cs *engine;
536+ enum intel_engine_id i;
517537
518538 gvt_dbg_core("clean workload scheduler\n");
519539
520− for (i = 0; i < I915_NUM_ENGINES; i++) {
521− if (scheduler->thread[i]) {
522− kthread_stop(scheduler->thread[i]);
523− scheduler->thread[i] = NULL;
524− }
540+ for_each_engine(engine, gvt->dev_priv, i) {
541+ atomic_notifier_chain_unregister(
542+ &engine->context_status_notifier,
543+ &gvt->shadow_ctx_notifier_block[i]);
544+ kthread_stop(scheduler->thread[i]);
525545 }
526546 }
527547
@@ -529,18 +549,15 @@ int intel_gvt_init_workload_scheduler(struct intel_gvt *gvt) · 1 unmodified line
529549 {
530550 struct intel_gvt_workload_scheduler *scheduler = &gvt->scheduler;
531551 struct workload_thread_param *param = NULL;
552+ struct intel_engine_cs *engine;
553+ enum intel_engine_id i;
532554 int ret;
533− int i;
534555
535556 gvt_dbg_core("init workload scheduler\n");
536557
537558 init_waitqueue_head(&scheduler->workload_complete_wq);
538559
539− for (i = 0; i < I915_NUM_ENGINES; i++) {
540− /* check ring mask at init time */
541− if (!HAS_ENGINE(gvt->dev_priv, i))
542− continue;
543−
560+ for_each_engine(engine, gvt->dev_priv, i) {
544561 init_waitqueue_head(&scheduler->waitq[i]);
545562
546563 param = kzalloc(sizeof(*param), GFP_KERNEL);
@@ -559,6 +576,11 @@ int intel_gvt_init_workload_scheduler(struct intel_gvt *gvt) · 12 unmodified lines
559576 ret = PTR_ERR(scheduler->thread[i]);
560577 goto err;
561578 }
579+
580+ gvt->shadow_ctx_notifier_block[i].notifier_call =
581+ shadow_context_status_change;
582+ atomic_notifier_chain_register(&engine->context_status_notifier,
583+ &gvt->shadow_ctx_notifier_block[i]);
562584 }
563585 return 0;
564586 err:
@@ -570,9 +592,6 @@ err: · 5 unmodified lines
570592
571593 void intel_vgpu_clean_gvt_context(struct intel_vgpu *vgpu)
572594 {
573− atomic_notifier_chain_unregister(&vgpu->shadow_ctx->status_notifier,
574− &vgpu->shadow_ctx_notifier_block);
575−
576595 i915_gem_context_put_unlocked(vgpu->shadow_ctx);
577596 }
578597
@@ -587,10 +606,5 @@ int intel_vgpu_init_gvt_context(struct intel_vgpu *vgpu) · 8 unmodified lines
587606
588607 vgpu->shadow_ctx->engine[RCS].initialised = true;
589608
590− vgpu->shadow_ctx_notifier_block.notifier_call =
591− shadow_context_status_change;
592−
593− atomic_notifier_chain_register(&vgpu->shadow_ctx->status_notifier,
594− &vgpu->shadow_ctx_notifier_block);
595609 return 0;
596610 }
drivers/gpu/drm/i915/i915_drv.c+3−4
@@ -248,6 +248,7 @@ static int i915_getparam(struct drm_device *dev, void *data, · 247 unmodified lines
248248 case I915_PARAM_IRQ_ACTIVE:
249249 case I915_PARAM_ALLOW_BATCHBUFFER:
250250 case I915_PARAM_LAST_DISPATCH:
251+ case I915_PARAM_HAS_EXEC_CONSTANTS:
251252 /* Reject all old ums/dri params. */
252253 return -ENODEV;
253254 case I915_PARAM_CHIPSET_ID:
@@ -274,9 +275,6 @@ static int i915_getparam(struct drm_device *dev, void *data, · 20 unmodified lines
274275 case I915_PARAM_HAS_BSD2:
275276 value = !!dev_priv->engine[VCS2];
276277 break;
277− case I915_PARAM_HAS_EXEC_CONSTANTS:
278− value = INTEL_GEN(dev_priv) >= 4;
279− break;
280278 case I915_PARAM_HAS_LLC:
281279 value = HAS_LLC(dev_priv);
282280 break;
@@ -1788,7 +1786,7 @@ void i915_reset(struct drm_i915_private *dev_priv) · 1505 unmodified lines
17881786 goto error;
17891787 }
17901788
1791− i915_gem_reset_finish(dev_priv);
1789+ i915_gem_reset(dev_priv);
17921790 intel_overlay_reset(dev_priv);
17931791
17941792 /* Ok, now get things going again... */
@@ -1814,6 +1812,7 @@ void i915_reset(struct drm_i915_private *dev_priv) · 19 unmodified lines
18141812 i915_queue_hangcheck(dev_priv);
18151813
18161814 wakeup:
1815+ i915_gem_reset_finish(dev_priv);
18171816 enable_irq(dev_priv->drm.irq);
18181817 wake_up_bit(&error->flags, I915_RESET_IN_PROGRESS);
18191818 return;
drivers/gpu/drm/i915/i915_drv.h+3−3
@@ -293,6 +293,7 @@ enum plane_id { · 292 unmodified lines
293293 PLANE_PRIMARY,
294294 PLANE_SPRITE0,
295295 PLANE_SPRITE1,
296+ PLANE_SPRITE2,
296297 PLANE_CURSOR,
297298 I915_MAX_PLANES,
298299 };
@@ -1324,7 +1325,7 @@ struct intel_gen6_power_mgmt { · 1025 unmodified lines
13241325 unsigned boosts;
13251326
13261327 /* manual wa residency calculations */
1327− struct intel_rps_ei up_ei, down_ei;
1328+ struct intel_rps_ei ei;
13281329
13291330 /*
13301331 * Protects RPS/RC6 register access and PCU communication.
@@ -2063,8 +2064,6 @@ struct drm_i915_private { · 732 unmodified lines
20632064
20642065 const struct intel_device_info info;
20652066
2066− int relative_constants_mode;
2067−
20682067 void __iomem *regs;
20692068
20702069 struct intel_uncore uncore;
@@ -3341,6 +3340,7 @@ static inline u32 i915_reset_count(struct i915_gpu_error *error) · 1270 unmodified lines
33413340 }
33423341
33433342 int i915_gem_reset_prepare(struct drm_i915_private *dev_priv);
3343+void i915_gem_reset(struct drm_i915_private *dev_priv);
33443344 void i915_gem_reset_finish(struct drm_i915_private *dev_priv);
33453345 void i915_gem_set_wedged(struct drm_i915_private *dev_priv);
33463346 void i915_gem_clflush_object(struct drm_i915_gem_object *obj, bool force);
drivers/gpu/drm/i915/i915_gem.c+115−6
@@ -1434,6 +1434,12 @@ i915_gem_pwrite_ioctl(struct drm_device *dev, void *data, · 1433 unmodified lines
14341434
14351435 trace_i915_gem_object_pwrite(obj, args->offset, args->size);
14361436
1437+ ret = -ENODEV;
1438+ if (obj->ops->pwrite)
1439+ ret = obj->ops->pwrite(obj, args);
1440+ if (ret != -ENODEV)
1441+ goto err;
1442+
14371443 ret = i915_gem_object_wait(obj,
14381444 I915_WAIT_INTERRUPTIBLE |
14391445 I915_WAIT_ALL,
@@ -2119,6 +2125,7 @@ i915_gem_object_truncate(struct drm_i915_gem_object *obj) · 679 unmodified lines
21192125 */
21202126 shmem_truncate_range(file_inode(obj->base.filp), 0, (loff_t)-1);
21212127 obj->mm.madv = __I915_MADV_PURGED;
2128+ obj->mm.pages = ERR_PTR(-EFAULT);
21222129 }
21232130
21242131 /* Try to discard unwanted pages */
@@ -2218,7 +2225,9 @@ void __i915_gem_object_put_pages(struct drm_i915_gem_object *obj, · 93 unmodified lines
22182225
22192226 __i915_gem_object_reset_page_iter(obj);
22202227
2221− obj->ops->put_pages(obj, pages);
2228+ if (!IS_ERR(pages))
2229+ obj->ops->put_pages(obj, pages);
2230+
22222231 unlock:
22232232 mutex_unlock(&obj->mm.lock);
22242233 }
@@ -2437,7 +2446,7 @@ int __i915_gem_object_get_pages(struct drm_i915_gem_object *obj) · 212 unmodified lines
24372446 if (err)
24382447 return err;
24392448
2440− if (unlikely(!obj->mm.pages)) {
2449+ if (unlikely(IS_ERR_OR_NULL(obj->mm.pages))) {
24412450 err = ____i915_gem_object_get_pages(obj);
24422451 if (err)
24432452 goto unlock;
@@ -2515,7 +2524,7 @@ void *i915_gem_object_pin_map(struct drm_i915_gem_object *obj, · 71 unmodified lines
25152524
25162525 pinned = true;
25172526 if (!atomic_inc_not_zero(&obj->mm.pages_pin_count)) {
2518− if (unlikely(!obj->mm.pages)) {
2527+ if (unlikely(IS_ERR_OR_NULL(obj->mm.pages))) {
25192528 ret = ____i915_gem_object_get_pages(obj);
25202529 if (ret)
25212530 goto err_unlock;
@@ -2563,6 +2572,75 @@ err_unlock: · 41 unmodified lines
25632572 goto out_unlock;
25642573 }
25652574
2575+static int
2576+i915_gem_object_pwrite_gtt(struct drm_i915_gem_object *obj,
2577+ const struct drm_i915_gem_pwrite *arg)
2578+{
2579+ struct address_space *mapping = obj->base.filp->f_mapping;
2580+ char __user *user_data = u64_to_user_ptr(arg->data_ptr);
2581+ u64 remain, offset;
2582+ unsigned int pg;
2583+
2584+ /* Before we instantiate/pin the backing store for our use, we
2585+ * can prepopulate the shmemfs filp efficiently using a write into
2586+ * the pagecache. We avoid the penalty of instantiating all the
2587+ * pages, important if the user is just writing to a few and never
2588+ * uses the object on the GPU, and using a direct write into shmemfs
2589+ * allows it to avoid the cost of retrieving a page (either swapin
2590+ * or clearing-before-use) before it is overwritten.
2591+ */
2592+ if (READ_ONCE(obj->mm.pages))
2593+ return -ENODEV;
2594+
2595+ /* Before the pages are instantiated the object is treated as being
2596+ * in the CPU domain. The pages will be clflushed as required before
2597+ * use, and we can freely write into the pages directly. If userspace
2598+ * races pwrite with any other operation; corruption will ensue -
2599+ * that is userspace's prerogative!
2600+ */
2601+
2602+ remain = arg->size;
2603+ offset = arg->offset;
2604+ pg = offset_in_page(offset);
2605+
2606+ do {
2607+ unsigned int len, unwritten;
2608+ struct page *page;
2609+ void *data, *vaddr;
2610+ int err;
2611+
2612+ len = PAGE_SIZE - pg;
2613+ if (len > remain)
2614+ len = remain;
2615+
2616+ err = pagecache_write_begin(obj->base.filp, mapping,
2617+ offset, len, 0,
2618+ &page, &data);
2619+ if (err < 0)
2620+ return err;
2621+
2622+ vaddr = kmap(page);
2623+ unwritten = copy_from_user(vaddr + pg, user_data, len);
2624+ kunmap(page);
2625+
2626+ err = pagecache_write_end(obj->base.filp, mapping,
2627+ offset, len, len - unwritten,
2628+ page, data);
2629+ if (err < 0)
2630+ return err;
2631+
2632+ if (unwritten)
2633+ return -EFAULT;
2634+
2635+ remain -= len;
2636+ user_data += len;
2637+ offset += len;
2638+ pg = 0;
2639+ } while (remain);
2640+
2641+ return 0;
2642+}
2643+
25662644 static bool ban_context(const struct i915_gem_context *ctx)
25672645 {
25682646 return (i915_gem_context_is_bannable(ctx) &&
@@ -2641,7 +2719,16 @@ int i915_gem_reset_prepare(struct drm_i915_private *dev_priv) · 72 unmodified lines
26412719 for_each_engine(engine, dev_priv, id) {
26422720 struct drm_i915_gem_request *request;
26432721
2722+ /* Prevent request submission to the hardware until we have
2723+ * completed the reset in i915_gem_reset_finish(). If a request
2724+ * is completed by one engine, it may then queue a request
2725+ * to a second via its engine->irq_tasklet *just* as we are
2726+ * calling engine->init_hw() and also writing the ELSP.
2727+ * Turning off the engine->irq_tasklet until the reset is over
2728+ * prevents the race.
2729+ */
26442730 tasklet_kill(&engine->irq_tasklet);
2731+ tasklet_disable(&engine->irq_tasklet);
26452732
26462733 if (engine_stalled(engine)) {
26472734 request = i915_gem_find_active_request(engine);
@@ -2756,7 +2843,7 @@ static void i915_gem_reset_engine(struct intel_engine_cs *engine) · 108 unmodified lines
27562843 engine->reset_hw(engine, request);
27572844 }
27582845
2759−void i915_gem_reset_finish(struct drm_i915_private *dev_priv)
2846+void i915_gem_reset(struct drm_i915_private *dev_priv)
27602847 {
27612848 struct intel_engine_cs *engine;
27622849 enum intel_engine_id id;
@@ -2778,6 +2865,17 @@ void i915_gem_reset_finish(struct drm_i915_private *dev_priv) · 15 unmodified lines
27782865 }
27792866 }
27802867
2868+void i915_gem_reset_finish(struct drm_i915_private *dev_priv)
2869+{
2870+ struct intel_engine_cs *engine;
2871+ enum intel_engine_id id;
2872+
2873+ lockdep_assert_held(&dev_priv->drm.struct_mutex);
2874+
2875+ for_each_engine(engine, dev_priv, id)
2876+ tasklet_enable(&engine->irq_tasklet);
2877+}
2878+
27812879 static void nop_submit_request(struct drm_i915_gem_request *request)
27822880 {
27832881 dma_fence_set_error(&request->fence, -EIO);
@@ -3029,6 +3127,16 @@ i915_gem_wait_ioctl(struct drm_device *dev, void *data, struct drm_file *file) · 245 unmodified lines
30293127 args->timeout_ns -= ktime_to_ns(ktime_sub(ktime_get(), start));
30303128 if (args->timeout_ns < 0)
30313129 args->timeout_ns = 0;
3130+
3131+ /*
3132+ * Apparently ktime isn't accurate enough and occasionally has a
3133+ * bit of mismatch in the jiffies<->nsecs<->ktime loop. So patch
3134+ * things up to make the test happy. We allow up to 1 jiffy.
3135+ *
3136+ * This is a regression from the timespec->ktime conversion.
3137+ */
3138+ if (ret == -ETIME && !nsecs_to_jiffies(args->timeout_ns))
3139+ args->timeout_ns = 0;
30323140 }
30333141
30343142 i915_gem_object_put(obj);
@@ -3974,8 +4082,11 @@ void i915_gem_object_init(struct drm_i915_gem_object *obj, · 939 unmodified lines
39744082 static const struct drm_i915_gem_object_ops i915_gem_object_ops = {
39754083 .flags = I915_GEM_OBJECT_HAS_STRUCT_PAGE |
39764084 I915_GEM_OBJECT_IS_SHRINKABLE,
4085+
39774086 .get_pages = i915_gem_object_get_pages_gtt,
39784087 .put_pages = i915_gem_object_put_pages_gtt,
4088+
4089+ .pwrite = i915_gem_object_pwrite_gtt,
39794090 };
39804091
39814092 struct drm_i915_gem_object *
@@ -4583,8 +4694,6 @@ i915_gem_load_init(struct drm_i915_private *dev_priv) · 601 unmodified lines
45834694 init_waitqueue_head(&dev_priv->gpu_error.wait_queue);
45844695 init_waitqueue_head(&dev_priv->gpu_error.reset_queue);
45854696
4586− dev_priv->relative_constants_mode = I915_EXEC_CONSTANTS_REL_GENERAL;
4587−
45884697 init_waitqueue_head(&dev_priv->pending_flip_queue);
45894698
45904699 dev_priv->mm.interruptible = true;
drivers/gpu/drm/i915/i915_gem_context.c+0−1
@@ -311,7 +311,6 @@ __create_hw_context(struct drm_i915_private *dev_priv, · 310 unmodified lines
311311 ctx->ring_size = 4 * PAGE_SIZE;
312312 ctx->desc_template = GEN8_CTX_ADDRESSING_MODE(dev_priv) <<
313313 GEN8_CTX_ADDRESSING_MODE_SHIFT;
314− ATOMIC_INIT_NOTIFIER_HEAD(&ctx->status_notifier);
315314
316315 /* GuC requires the ring to be placed above GUC_WOPCM_TOP. If GuC is not
317316 * present or not in use we still need a small bias as ring wraparound
drivers/gpu/drm/i915/i915_gem_context.h+0−3
@@ -160,9 +160,6 @@ struct i915_gem_context { · 159 unmodified lines
160160 /** desc_template: invariant fields for the HW context descriptor */
161161 u32 desc_template;
162162
163− /** status_notifier: list of callbacks for context-switch changes */
164− struct atomic_notifier_head status_notifier;
165−
166163 /** guilty_count: How many times this context has caused a GPU hang. */
167164 unsigned int guilty_count;
168165 /**
drivers/gpu/drm/i915/i915_gem_evict.c+4−4
@@ -293,12 +293,12 @@ int i915_gem_evict_for_node(struct i915_address_space *vm, · 292 unmodified lines
293293 * those as well to make room for our guard pages.
294294 */
295295 if (check_color) {
296− if (vma->node.start + vma->node.size == node->start) {
297− if (vma->node.color == node->color)
296+ if (node->start + node->size == target->start) {
297+ if (node->color == target->color)
298298 continue;
299299 }
300− if (vma->node.start == node->start + node->size) {
301− if (vma->node.color == node->color)
300+ if (node->start == target->start + target->size) {
301+ if (node->color == target->color)
302302 continue;
303303 }
304304 }
drivers/gpu/drm/i915/i915_gem_execbuffer.c+2−50
@@ -1408,10 +1408,7 @@ execbuf_submit(struct i915_execbuffer_params *params, · 1407 unmodified lines
14081408 struct drm_i915_gem_execbuffer2 *args,
14091409 struct list_head *vmas)
14101410 {
1411− struct drm_i915_private *dev_priv = params->request->i915;
14121411 u64 exec_start, exec_len;
1413− int instp_mode;
1414− u32 instp_mask;
14151412 int ret;
14161413
14171414 ret = i915_gem_execbuffer_move_to_gpu(params->request, vmas);
@@ -1422,56 +1419,11 @@ execbuf_submit(struct i915_execbuffer_params *params, · 4 unmodified lines
14221419 if (ret)
14231420 return ret;
14241421
1425− instp_mode = args->flags & I915_EXEC_CONSTANTS_MASK;
1426− instp_mask = I915_EXEC_CONSTANTS_MASK;
1427− switch (instp_mode) {
1428− case I915_EXEC_CONSTANTS_REL_GENERAL:
1429− case I915_EXEC_CONSTANTS_ABSOLUTE:
1430− case I915_EXEC_CONSTANTS_REL_SURFACE:
1431− if (instp_mode != 0 && params->engine->id != RCS) {
1432− DRM_DEBUG("non-0 rel constants mode on non-RCS\n");
1433− return -EINVAL;
1434− }
1435−
1436− if (instp_mode != dev_priv->relative_constants_mode) {
1437− if (INTEL_INFO(dev_priv)->gen < 4) {
1438− DRM_DEBUG("no rel constants on pre-gen4\n");
1439− return -EINVAL;
1440− }
1441−
1442− if (INTEL_INFO(dev_priv)->gen > 5 &&
1443− instp_mode == I915_EXEC_CONSTANTS_REL_SURFACE) {
1444− DRM_DEBUG("rel surface constants mode invalid on gen5+\n");
1445− return -EINVAL;
1446− }
1447−
1448− /* The HW changed the meaning on this bit on gen6 */
1449− if (INTEL_INFO(dev_priv)->gen >= 6)
1450− instp_mask &= ~I915_EXEC_CONSTANTS_REL_SURFACE;
1451− }
1452− break;
1453− default:
1454− DRM_DEBUG("execbuf with unknown constants: %d\n", instp_mode);
1422+ if (args->flags & I915_EXEC_CONSTANTS_MASK) {
1423+ DRM_DEBUG("I915_EXEC_CONSTANTS_* unsupported\n");
14551424 return -EINVAL;
14561425 }
14571426
1458− if (params->engine->id == RCS &&
1459− instp_mode != dev_priv->relative_constants_mode) {
1460− struct intel_ring *ring = params->request->ring;
1461−
1462− ret = intel_ring_begin(params->request, 4);
1463− if (ret)
1464− return ret;
1465−
1466− intel_ring_emit(ring, MI_NOOP);
1467− intel_ring_emit(ring, MI_LOAD_REGISTER_IMM(1));
1468− intel_ring_emit_reg(ring, INSTPM);
1469− intel_ring_emit(ring, instp_mask << 16 | instp_mode);
1470− intel_ring_advance(ring);
1471−
1472− dev_priv->relative_constants_mode = instp_mode;
1473− }
1474−
14751427 if (args->flags & I915_EXEC_GEN7_SOL_RESET) {
14761428 ret = i915_reset_gen7_sol_offsets(params->request);
14771429 if (ret)
drivers/gpu/drm/i915/i915_gem_object.h+3−0
@@ -54,6 +54,9 @@ struct drm_i915_gem_object_ops { · 53 unmodified lines
5454 struct sg_table *(*get_pages)(struct drm_i915_gem_object *);
5555 void (*put_pages)(struct drm_i915_gem_object *, struct sg_table *);
5656
57+ int (*pwrite)(struct drm_i915_gem_object *,
58+ const struct drm_i915_gem_pwrite *);
59+
5760 int (*dmabuf_export)(struct drm_i915_gem_object *);
5861 void (*release)(struct drm_i915_gem_object *);
5962 };
drivers/gpu/drm/i915/i915_gem_shrinker.c+1−1
@@ -263,7 +263,7 @@ unsigned long i915_gem_shrink_all(struct drm_i915_private *dev_priv) · 262 unmodified lines
263263 I915_SHRINK_BOUND |
264264 I915_SHRINK_UNBOUND |
265265 I915_SHRINK_ACTIVE);
266− rcu_barrier(); /* wait until our RCU delayed slab frees are completed */
266+ synchronize_rcu(); /* wait for our earlier RCU delayed slab frees */
267267
268268 return freed;
269269 }
drivers/gpu/drm/i915/i915_irq.c+38−45
@@ -1046,68 +1046,51 @@ static void vlv_c0_read(struct drm_i915_private *dev_priv, · 1045 unmodified lines
10461046 ei->media_c0 = I915_READ(VLV_MEDIA_C0_COUNT);
10471047 }
10481048
1049−static bool vlv_c0_above(struct drm_i915_private *dev_priv,
1050− const struct intel_rps_ei *old,
1051− const struct intel_rps_ei *now,
1052− int threshold)
1053−{
1054− u64 time, c0;
1055− unsigned int mul = 100;
1056−
1057− if (old->cz_clock == 0)
1058− return false;
1059−
1060− if (I915_READ(VLV_COUNTER_CONTROL) & VLV_COUNT_RANGE_HIGH)
1061− mul <<= 8;
1062−
1063− time = now->cz_clock - old->cz_clock;
1064− time *= threshold * dev_priv->czclk_freq;
1065−
1066− /* Workload can be split between render + media, e.g. SwapBuffers
1067− * being blitted in X after being rendered in mesa. To account for
1068− * this we need to combine both engines into our activity counter.
1069− */
1070− c0 = now->render_c0 - old->render_c0;
1071− c0 += now->media_c0 - old->media_c0;
1072− c0 *= mul * VLV_CZ_CLOCK_TO_MILLI_SEC;
1073−
1074− return c0 >= time;
1075−}
1076−
10771049 void gen6_rps_reset_ei(struct drm_i915_private *dev_priv)
10781050 {
1079− vlv_c0_read(dev_priv, &dev_priv->rps.down_ei);
1080− dev_priv->rps.up_ei = dev_priv->rps.down_ei;
1051+ memset(&dev_priv->rps.ei, 0, sizeof(dev_priv->rps.ei));
10811052 }
10821053
10831054 static u32 vlv_wa_c0_ei(struct drm_i915_private *dev_priv, u32 pm_iir)
10841055 {
1056+ const struct intel_rps_ei *prev = &dev_priv->rps.ei;
10851057 struct intel_rps_ei now;
10861058 u32 events = 0;
10871059
1088− if ((pm_iir & (GEN6_PM_RP_DOWN_EI_EXPIRED | GEN6_PM_RP_UP_EI_EXPIRED)) == 0)
1060+ if ((pm_iir & GEN6_PM_RP_UP_EI_EXPIRED) == 0)
10891061 return 0;
10901062
10911063 vlv_c0_read(dev_priv, &now);
10921064 if (now.cz_clock == 0)
10931065 return 0;
10941066
1095− if (pm_iir & GEN6_PM_RP_DOWN_EI_EXPIRED) {
1096− if (!vlv_c0_above(dev_priv,
1097− &dev_priv->rps.down_ei, &now,
1098− dev_priv->rps.down_threshold))
1099− events |= GEN6_PM_RP_DOWN_THRESHOLD;
1100− dev_priv->rps.down_ei = now;
1101− }
1067+ if (prev->cz_clock) {
1068+ u64 time, c0;
1069+ unsigned int mul;
1070+
1071+ mul = VLV_CZ_CLOCK_TO_MILLI_SEC * 100; /* scale to threshold% */
1072+ if (I915_READ(VLV_COUNTER_CONTROL) & VLV_COUNT_RANGE_HIGH)
1073+ mul <<= 8;
11021074
1103− if (pm_iir & GEN6_PM_RP_UP_EI_EXPIRED) {
1104− if (vlv_c0_above(dev_priv,
1105− &dev_priv->rps.up_ei, &now,
1106− dev_priv->rps.up_threshold))
1107− events |= GEN6_PM_RP_UP_THRESHOLD;
1108− dev_priv->rps.up_ei = now;
1075+ time = now.cz_clock - prev->cz_clock;
1076+ time *= dev_priv->czclk_freq;
1077+
1078+ /* Workload can be split between render + media,
1079+ * e.g. SwapBuffers being blitted in X after being rendered in
1080+ * mesa. To account for this we need to combine both engines
1081+ * into our activity counter.
1082+ */
1083+ c0 = now.render_c0 - prev->render_c0;
1084+ c0 += now.media_c0 - prev->media_c0;
1085+ c0 *= mul;
1086+
1087+ if (c0 > time * dev_priv->rps.up_threshold)
1088+ events = GEN6_PM_RP_UP_THRESHOLD;
1089+ else if (c0 < time * dev_priv->rps.down_threshold)
1090+ events = GEN6_PM_RP_DOWN_THRESHOLD;
11091091 }
11101092
1093+ dev_priv->rps.ei = now;
11111094 return events;
11121095 }
11131096
@@ -4228,7 +4211,7 @@ void intel_irq_init(struct drm_i915_private *dev_priv) · 3114 unmodified lines
42284211 /* Let's track the enabled rps events */
42294212 if (IS_VALLEYVIEW(dev_priv))
42304213 /* WaGsvRC0ResidencyMethod:vlv */
4231− dev_priv->pm_rps_events = GEN6_PM_RP_DOWN_EI_EXPIRED | GEN6_PM_RP_UP_EI_EXPIRED;
4214+ dev_priv->pm_rps_events = GEN6_PM_RP_UP_EI_EXPIRED;
42324215 else
42334216 dev_priv->pm_rps_events = GEN6_PM_RPS_EVENTS;
42344217
@@ -4266,6 +4249,16 @@ void intel_irq_init(struct drm_i915_private *dev_priv) · 31 unmodified lines
42664249 if (!IS_GEN2(dev_priv))
42674250 dev->vblank_disable_immediate = true;
42684251
4252+ /* Most platforms treat the display irq block as an always-on
4253+ * power domain. vlv/chv can disable it at runtime and need
4254+ * special care to avoid writing any of the display block registers
4255+ * outside of the power domain. We defer setting up the display irqs
4256+ * in this case to the runtime pm.
4257+ */
4258+ dev_priv->display_irqs_enabled = true;
4259+ if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv))
4260+ dev_priv->display_irqs_enabled = false;
4261+
42694262 dev->driver->get_vblank_timestamp = i915_get_vblank_timestamp;
42704263 dev->driver->get_scanout_position = i915_get_crtc_scanoutpos;
42714264
drivers/gpu/drm/i915/i915_vma.c+37−20
@@ -512,10 +512,36 @@ err_unpin: · 511 unmodified lines
512512 return ret;
513513 }
514514
515+static void
516+i915_vma_remove(struct i915_vma *vma)
517+{
518+ struct drm_i915_gem_object *obj = vma->obj;
519+
520+ GEM_BUG_ON(!drm_mm_node_allocated(&vma->node));
521+ GEM_BUG_ON(vma->flags & (I915_VMA_GLOBAL_BIND | I915_VMA_LOCAL_BIND));
522+
523+ drm_mm_remove_node(&vma->node);
524+ list_move_tail(&vma->vm_link, &vma->vm->unbound_list);
525+
526+ /* Since the unbound list is global, only move to that list if
527+ * no more VMAs exist.
528+ */
529+ if (--obj->bind_count == 0)
530+ list_move_tail(&obj->global_link,
531+ &to_i915(obj->base.dev)->mm.unbound_list);
532+
533+ /* And finally now the object is completely decoupled from this vma,
534+ * we can drop its hold on the backing storage and allow it to be
535+ * reaped by the shrinker.
536+ */
537+ i915_gem_object_unpin_pages(obj);
538+ GEM_BUG_ON(atomic_read(&obj->mm.pages_pin_count) < obj->bind_count);
539+}
540+
515541 int __i915_vma_do_pin(struct i915_vma *vma,
516542 u64 size, u64 alignment, u64 flags)
517543 {
518− unsigned int bound = vma->flags;
544+ const unsigned int bound = vma->flags;
519545 int ret;
520546
521547 lockdep_assert_held(&vma->vm->i915->drm.struct_mutex);
@@ -524,18 +550,18 @@ int __i915_vma_do_pin(struct i915_vma *vma, · 2 unmodified lines
524550
525551 if (WARN_ON(bound & I915_VMA_PIN_OVERFLOW)) {
526552 ret = -EBUSY;
527− goto err;
553+ goto err_unpin;
528554 }
529555
530556 if ((bound & I915_VMA_BIND_MASK) == 0) {
531557 ret = i915_vma_insert(vma, size, alignment, flags);
532558 if (ret)
533− goto err;
559+ goto err_unpin;
534560 }
535561
536562 ret = i915_vma_bind(vma, vma->obj->cache_level, flags);
537563 if (ret)
538− goto err;
564+ goto err_remove;
539565
540566 if ((bound ^ vma->flags) & I915_VMA_GLOBAL_BIND)
541567 __i915_vma_set_map_and_fenceable(vma);
@@ -544,7 +570,12 @@ int __i915_vma_do_pin(struct i915_vma *vma, · 2 unmodified lines
544570 GEM_BUG_ON(i915_vma_misplaced(vma, size, alignment, flags));
545571 return 0;
546572
547−err:
573+err_remove:
574+ if ((bound & I915_VMA_BIND_MASK) == 0) {
575+ GEM_BUG_ON(vma->pages);
576+ i915_vma_remove(vma);
577+ }
578+err_unpin:
548579 __i915_vma_unpin(vma);
549580 return ret;
550581 }
@@ -657,9 +688,6 @@ int i915_vma_unbind(struct i915_vma *vma) · 106 unmodified lines
657688 }
658689 vma->flags &= ~(I915_VMA_GLOBAL_BIND | I915_VMA_LOCAL_BIND);
659690
660− drm_mm_remove_node(&vma->node);
661− list_move_tail(&vma->vm_link, &vma->vm->unbound_list);
662−
663691 if (vma->pages != obj->mm.pages) {
664692 GEM_BUG_ON(!vma->pages);
665693 sg_free_table(vma->pages);
@@ -667,18 +695,7 @@ int i915_vma_unbind(struct i915_vma *vma) · 1 unmodified line
667695 }
668696 vma->pages = NULL;
669697
670− /* Since the unbound list is global, only move to that list if
671− * no more VMAs exist. */
672− if (--obj->bind_count == 0)
673− list_move_tail(&obj->global_link,
674− &to_i915(obj->base.dev)->mm.unbound_list);
675−
676− /* And finally now the object is completely decoupled from this vma,
677− * we can drop its hold on the backing storage and allow it to be
678− * reaped by the shrinker.
679− */
680− i915_gem_object_unpin_pages(obj);
681− GEM_BUG_ON(atomic_read(&obj->mm.pages_pin_count) < obj->bind_count);
698+ i915_vma_remove(vma);
682699
683700 destroy:
684701 if (unlikely(i915_vma_is_closed(vma)))
drivers/gpu/drm/i915/intel_csr.c+0−1
@@ -35,7 +35,6 @@ · 34 unmodified lines
3535 */
3636
3737 #define I915_CSR_GLK "i915/glk_dmc_ver1_01.bin"
38−MODULE_FIRMWARE(I915_CSR_GLK);
3938 #define GLK_CSR_VERSION_REQUIRED CSR_VERSION(1, 1)
4039
4140 #define I915_CSR_KBL "i915/kbl_dmc_ver1_01.bin"
drivers/gpu/drm/i915/intel_display.c+32−35
@@ -3669,10 +3669,6 @@ static void intel_update_pipe_config(struct intel_crtc *crtc, · 3668 unmodified lines
36693669 /* drm_atomic_helper_update_legacy_modeset_state might not be called. */
36703670 crtc->base.mode = crtc->base.state->mode;
36713671
3672− DRM_DEBUG_KMS("Updating pipe size %ix%i -> %ix%i\n",
3673− old_crtc_state->pipe_src_w, old_crtc_state->pipe_src_h,
3674− pipe_config->pipe_src_w, pipe_config->pipe_src_h);
3675−
36763672 /*
36773673 * Update pipe size and adjust fitter if needed: the reason for this is
36783674 * that in compute_mode_changes we check the native mode (not the pfit
@@ -4796,23 +4792,17 @@ static void skylake_pfit_enable(struct intel_crtc *crtc) · 1117 unmodified lines
47964792 struct intel_crtc_scaler_state *scaler_state =
47974793 &crtc->config->scaler_state;
47984794
4799− DRM_DEBUG_KMS("for crtc_state = %p\n", crtc->config);
4800−
48014795 if (crtc->config->pch_pfit.enabled) {
48024796 int id;
48034797
4804− if (WARN_ON(crtc->config->scaler_state.scaler_id < 0)) {
4805− DRM_ERROR("Requesting pfit without getting a scaler first\n");
4798+ if (WARN_ON(crtc->config->scaler_state.scaler_id < 0))
48064799 return;
4807− }
48084800
48094801 id = scaler_state->scaler_id;
48104802 I915_WRITE(SKL_PS_CTRL(pipe, id), PS_SCALER_EN |
48114803 PS_FILTER_MEDIUM | scaler_state->scalers[id].mode);
48124804 I915_WRITE(SKL_PS_WIN_POS(pipe, id), crtc->config->pch_pfit.pos);
48134805 I915_WRITE(SKL_PS_WIN_SZ(pipe, id), crtc->config->pch_pfit.size);
4814−
4815− DRM_DEBUG_KMS("for crtc_state = %p scaler_id = %d\n", crtc->config, id);
48164806 }
48174807 }
48184808
@@ -14379,6 +14369,24 @@ static void skl_update_crtcs(struct drm_atomic_state *state, · 9560 unmodified lines
1437914369 } while (progress);
1438014370 }
1438114371
14372+static void intel_atomic_helper_free_state(struct drm_i915_private *dev_priv)
14373+{
14374+ struct intel_atomic_state *state, *next;
14375+ struct llist_node *freed;
14376+
14377+ freed = llist_del_all(&dev_priv->atomic_helper.free_list);
14378+ llist_for_each_entry_safe(state, next, freed, freed)
14379+ drm_atomic_state_put(&state->base);
14380+}
14381+
14382+static void intel_atomic_helper_free_state_worker(struct work_struct *work)
14383+{
14384+ struct drm_i915_private *dev_priv =
14385+ container_of(work, typeof(*dev_priv), atomic_helper.free_work);
14386+
14387+ intel_atomic_helper_free_state(dev_priv);
14388+}
14389+
1438214390 static void intel_atomic_commit_tail(struct drm_atomic_state *state)
1438314391 {
1438414392 struct drm_device *dev = state->dev;
@@ -14545,6 +14553,8 @@ static void intel_atomic_commit_tail(struct drm_atomic_state *state) · 160 unmodified lines
1454514553 * can happen also when the device is completely off.
1454614554 */
1454714555 intel_uncore_arm_unclaimed_mmio_detection(dev_priv);
14556+
14557+ intel_atomic_helper_free_state(dev_priv);
1454814558 }
1454914559
1455014560 static void intel_atomic_commit_work(struct work_struct *work)
@@ -14946,17 +14956,19 @@ static void intel_begin_crtc_commit(struct drm_crtc *crtc, · 395 unmodified lines
1494614956 to_intel_atomic_state(old_crtc_state->state);
1494714957 bool modeset = needs_modeset(crtc->state);
1494814958
14959+ if (!modeset &&
14960+ (intel_cstate->base.color_mgmt_changed ||
14961+ intel_cstate->update_pipe)) {
14962+ intel_color_set_csc(crtc->state);
14963+ intel_color_load_luts(crtc->state);
14964+ }
14965+
1494914966 /* Perform vblank evasion around commit operation */
1495014967 intel_pipe_update_start(intel_crtc);
1495114968
1495214969 if (modeset)
1495314970 goto out;
1495414971
14955− if (crtc->state->color_mgmt_changed || to_intel_crtc_state(crtc->state)->update_pipe) {
14956− intel_color_set_csc(crtc->state);
14957− intel_color_load_luts(crtc->state);
14958− }
14959−
1496014972 if (intel_cstate->update_pipe)
1496114973 intel_update_pipe_config(intel_crtc, old_intel_cstate);
1496214974 else if (INTEL_GEN(dev_priv) >= 9)
@@ -16599,18 +16611,6 @@ fail: · 1636 unmodified lines
1659916611 drm_modeset_acquire_fini(&ctx);
1660016612 }
1660116613
16602−static void intel_atomic_helper_free_state(struct work_struct *work)
16603−{
16604− struct drm_i915_private *dev_priv =
16605− container_of(work, typeof(*dev_priv), atomic_helper.free_work);
16606− struct intel_atomic_state *state, *next;
16607− struct llist_node *freed;
16608−
16609− freed = llist_del_all(&dev_priv->atomic_helper.free_list);
16610− llist_for_each_entry_safe(state, next, freed, freed)
16611− drm_atomic_state_put(&state->base);
16612−}
16613−
1661416614 int intel_modeset_init(struct drm_device *dev)
1661516615 {
1661616616 struct drm_i915_private *dev_priv = to_i915(dev);
@@ -16631,7 +16631,7 @@ int intel_modeset_init(struct drm_device *dev) · 14 unmodified lines
1663116631 dev->mode_config.funcs = &intel_mode_funcs;
1663216632
1663316633 INIT_WORK(&dev_priv->atomic_helper.free_work,
16634− intel_atomic_helper_free_state);
16634+ intel_atomic_helper_free_state_worker);
1663516635
1663616636 intel_init_quirks(dev);
1663716637
@@ -16696,12 +16696,11 @@ int intel_modeset_init(struct drm_device *dev) · 58 unmodified lines
1669616696 }
1669716697 }
1669816698
16699− intel_update_czclk(dev_priv);
16700− intel_update_cdclk(dev_priv);
16701− dev_priv->atomic_cdclk_freq = dev_priv->cdclk_freq;
16702−
1670316699 intel_shared_dpll_init(dev);
1670416700
16701+ intel_update_czclk(dev_priv);
16702+ intel_modeset_init_hw(dev);
16703+
1670516704 if (dev_priv->max_cdclk_freq == 0)
1670616705 intel_update_max_cdclk(dev_priv);
1670716706
@@ -17258,8 +17257,6 @@ void intel_modeset_gem_init(struct drm_device *dev) · 550 unmodified lines
1725817257
1725917258 intel_init_gt_powersave(dev_priv);
1726017259
17261− intel_modeset_init_hw(dev);
17262−
1726317260 intel_setup_overlay(dev_priv);
1726417261 }
1726517262
drivers/gpu/drm/i915/intel_engine_cs.c+2−0
@@ -105,6 +105,8 @@ intel_engine_setup(struct drm_i915_private *dev_priv, · 104 unmodified lines
105105 /* Nothing to do here, execute in order of dependencies */
106106 engine->schedule = NULL;
107107
108+ ATOMIC_INIT_NOTIFIER_HEAD(&engine->context_status_notifier);
109+
108110 dev_priv->engine[id] = engine;
109111 return 0;
110112 }
drivers/gpu/drm/i915/intel_fbdev.c+4−6
@@ -357,14 +357,13 @@ static bool intel_fb_initial_config(struct drm_fb_helper *fb_helper, · 356 unmodified lines
357357 bool *enabled, int width, int height)
358358 {
359359 struct drm_i915_private *dev_priv = to_i915(fb_helper->dev);
360− unsigned long conn_configured, mask;
360+ unsigned long conn_configured, conn_seq, mask;
361361 unsigned int count = min(fb_helper->connector_count, BITS_PER_LONG);
362362 int i, j;
363363 bool *save_enabled;
364364 bool fallback = true;
365365 int num_connectors_enabled = 0;
366366 int num_connectors_detected = 0;
367− int pass = 0;
368367
369368 save_enabled = kcalloc(count, sizeof(bool), GFP_KERNEL);
370369 if (!save_enabled)
@@ -374,6 +373,7 @@ static bool intel_fb_initial_config(struct drm_fb_helper *fb_helper, · 3 unmodified lines
374373 mask = BIT(count) - 1;
375374 conn_configured = 0;
376375 retry:
376+ conn_seq = conn_configured;
377377 for (i = 0; i < count; i++) {
378378 struct drm_fb_helper_connector *fb_conn;
379379 struct drm_connector *connector;
@@ -387,7 +387,7 @@ retry: · 7 unmodified lines
387387 if (conn_configured & BIT(i))
388388 continue;
389389
390− if (pass == 0 && !connector->has_tile)
390+ if (conn_seq == 0 && !connector->has_tile)
391391 continue;
392392
393393 if (connector->status == connector_status_connected)
@@ -498,10 +498,8 @@ retry: · 104 unmodified lines
498498 conn_configured |= BIT(i);
499499 }
500500
501− if ((conn_configured & mask) != mask) {
502− pass++;
501+ if ((conn_configured & mask) != mask && conn_configured != conn_seq)
503502 goto retry;
504− }
505503
506504 /*
507505 * If the BIOS didn't enable everything it could, fall back to have the
drivers/gpu/drm/i915/intel_gvt.c+5−0
@@ -77,6 +77,11 @@ int intel_gvt_init(struct drm_i915_private *dev_priv) · 76 unmodified lines
7777 goto bail;
7878 }
7979
80+ if (!i915.enable_execlists) {
81+ DRM_INFO("GPU guest virtualisation [GVT-g] disabled due to disabled execlist submission [i915.enable_execlists module parameter]\n");
82+ goto bail;
83+ }
84+
8085 /*
8186 * We're not in host or fail to find a MPT module, disable GVT-g
8287 */
drivers/gpu/drm/i915/intel_hdmi.c+21−3
@@ -1298,16 +1298,34 @@ intel_hdmi_mode_valid(struct drm_connector *connector, · 1297 unmodified lines
12981298
12991299 static bool hdmi_12bpc_possible(struct intel_crtc_state *crtc_state)
13001300 {
1301− struct drm_device *dev = crtc_state->base.crtc->dev;
1301+ struct drm_i915_private *dev_priv =
1302+ to_i915(crtc_state->base.crtc->dev);
1303+ struct drm_atomic_state *state = crtc_state->base.state;
1304+ struct drm_connector_state *connector_state;
1305+ struct drm_connector *connector;
1306+ int i;
13021307
1303− if (HAS_GMCH_DISPLAY(to_i915(dev)))
1308+ if (HAS_GMCH_DISPLAY(dev_priv))
13041309 return false;
13051310
13061311 /*
13071312 * HDMI 12bpc affects the clocks, so it's only possible
13081313 * when not cloning with other encoder types.
13091314 */
1310− return crtc_state->output_types == 1 << INTEL_OUTPUT_HDMI;
1315+ if (crtc_state->output_types != 1 << INTEL_OUTPUT_HDMI)
1316+ return false;
1317+
1318+ for_each_connector_in_state(state, connector, connector_state, i) {
1319+ const struct drm_display_info *info = &connector->display_info;
1320+
1321+ if (connector_state->crtc != crtc_state->base.crtc)
1322+ continue;
1323+
1324+ if ((info->edid_hdmi_dc_modes & DRM_EDID_HDMI_DC_36) == 0)
1325+ return false;
1326+ }
1327+
1328+ return true;
13111329 }
13121330
13131331 bool intel_hdmi_compute_config(struct intel_encoder *encoder,
drivers/gpu/drm/i915/intel_hotplug.c+8−6
@@ -219,7 +219,7 @@ static void intel_hpd_irq_storm_reenable_work(struct work_struct *work) · 218 unmodified lines
219219 }
220220 }
221221 }
222− if (dev_priv->display.hpd_irq_setup)
222+ if (dev_priv->display_irqs_enabled && dev_priv->display.hpd_irq_setup)
223223 dev_priv->display.hpd_irq_setup(dev_priv);
224224 spin_unlock_irq(&dev_priv->irq_lock);
225225
@@ -425,7 +425,7 @@ void intel_hpd_irq_handler(struct drm_i915_private *dev_priv, · 199 unmodified lines
425425 }
426426 }
427427
428− if (storm_detected)
428+ if (storm_detected && dev_priv->display_irqs_enabled)
429429 dev_priv->display.hpd_irq_setup(dev_priv);
430430 spin_unlock(&dev_priv->irq_lock);
431431
@@ -471,10 +471,12 @@ void intel_hpd_init(struct drm_i915_private *dev_priv) · 39 unmodified lines
471471 * Interrupt setup is already guaranteed to be single-threaded, this is
472472 * just to make the assert_spin_locked checks happy.
473473 */
474− spin_lock_irq(&dev_priv->irq_lock);
475− if (dev_priv->display.hpd_irq_setup)
476− dev_priv->display.hpd_irq_setup(dev_priv);
477− spin_unlock_irq(&dev_priv->irq_lock);
474+ if (dev_priv->display_irqs_enabled && dev_priv->display.hpd_irq_setup) {
475+ spin_lock_irq(&dev_priv->irq_lock);
476+ if (dev_priv->display_irqs_enabled)
477+ dev_priv->display.hpd_irq_setup(dev_priv);
478+ spin_unlock_irq(&dev_priv->irq_lock);
479+ }
478480 }
479481
480482 static void i915_hpd_poll_init_work(struct work_struct *work)
drivers/gpu/drm/i915/intel_lrc.c+2−1
@@ -345,7 +345,8 @@ execlists_context_status_change(struct drm_i915_gem_request *rq, · 344 unmodified lines
345345 if (!IS_ENABLED(CONFIG_DRM_I915_GVT))
346346 return;
347347
348− atomic_notifier_call_chain(&rq->ctx->status_notifier, status, rq);
348+ atomic_notifier_call_chain(&rq->engine->context_status_notifier,
349+ status, rq);
349350 }
350351
351352 static void
drivers/gpu/drm/i915/intel_pm.c+16−7
@@ -4891,6 +4891,12 @@ static void gen6_set_rps_thresholds(struct drm_i915_private *dev_priv, u8 val) · 4890 unmodified lines
48914891 break;
48924892 }
48934893
4894+ /* When byt can survive without system hang with dynamic
4895+ * sw freq adjustments, this restriction can be lifted.
4896+ */
4897+ if (IS_VALLEYVIEW(dev_priv))
4898+ goto skip_hw_write;
4899+
48944900 I915_WRITE(GEN6_RP_UP_EI,
48954901 GT_INTERVAL_FROM_US(dev_priv, ei_up));
48964902 I915_WRITE(GEN6_RP_UP_THRESHOLD,
@@ -4911,6 +4917,7 @@ static void gen6_set_rps_thresholds(struct drm_i915_private *dev_priv, u8 val) · 14 unmodified lines
49114917 GEN6_RP_UP_BUSY_AVG |
49124918 GEN6_RP_DOWN_IDLE_AVG);
49134919
4920+skip_hw_write:
49144921 dev_priv->rps.power = new_power;
49154922 dev_priv->rps.up_threshold = threshold_up;
49164923 dev_priv->rps.down_threshold = threshold_down;
@@ -4921,8 +4928,9 @@ static u32 gen6_rps_pm_mask(struct drm_i915_private *dev_priv, u8 val) · 4 unmodified lines
49214928 {
49224929 u32 mask = 0;
49234930
4931+ /* We use UP_EI_EXPIRED interupts for both up/down in manual mode */
49244932 if (val > dev_priv->rps.min_freq_softlimit)
4925− mask |= GEN6_PM_RP_DOWN_EI_EXPIRED | GEN6_PM_RP_DOWN_THRESHOLD | GEN6_PM_RP_DOWN_TIMEOUT;
4933+ mask |= GEN6_PM_RP_UP_EI_EXPIRED | GEN6_PM_RP_DOWN_THRESHOLD | GEN6_PM_RP_DOWN_TIMEOUT;
49264934 if (val < dev_priv->rps.max_freq_softlimit)
49274935 mask |= GEN6_PM_RP_UP_EI_EXPIRED | GEN6_PM_RP_UP_THRESHOLD;
49284936
@@ -5032,7 +5040,7 @@ void gen6_rps_busy(struct drm_i915_private *dev_priv) · 103 unmodified lines
50325040 {
50335041 mutex_lock(&dev_priv->rps.hw_lock);
50345042 if (dev_priv->rps.enabled) {
5035− if (dev_priv->pm_rps_events & (GEN6_PM_RP_DOWN_EI_EXPIRED | GEN6_PM_RP_UP_EI_EXPIRED))
5043+ if (dev_priv->pm_rps_events & GEN6_PM_RP_UP_EI_EXPIRED)
50365044 gen6_rps_reset_ei(dev_priv);
50375045 I915_WRITE(GEN6_PMINTRMSK,
50385046 gen6_rps_pm_mask(dev_priv, dev_priv->rps.cur_freq));
@@ -7916,10 +7924,10 @@ static bool skl_pcode_try_request(struct drm_i915_private *dev_priv, u32 mbox, · 2877 unmodified lines
79167924 * @timeout_base_ms: timeout for polling with preemption enabled
79177925 *
79187926 * Keep resending the @request to @mbox until PCODE acknowledges it, PCODE
7919− * reports an error or an overall timeout of @timeout_base_ms+10 ms expires.
7927+ * reports an error or an overall timeout of @timeout_base_ms+50 ms expires.
79207928 * The request is acknowledged once the PCODE reply dword equals @reply after
79217929 * applying @reply_mask. Polling is first attempted with preemption enabled
7922− * for @timeout_base_ms and if this times out for another 10 ms with
7930+ * for @timeout_base_ms and if this times out for another 50 ms with
79237931 * preemption disabled.
79247932 *
79257933 * Returns 0 on success, %-ETIMEDOUT in case of a timeout, <0 in case of some
@@ -7955,14 +7963,15 @@ int skl_pcode_request(struct drm_i915_private *dev_priv, u32 mbox, u32 request, · 29 unmodified lines
79557963 * worst case) _and_ PCODE was busy for some reason even after a
79567964 * (queued) request and @timeout_base_ms delay. As a workaround retry
79577965 * the poll with preemption disabled to maximize the number of
7958− * requests. Increase the timeout from @timeout_base_ms to 10ms to
7966+ * requests. Increase the timeout from @timeout_base_ms to 50ms to
79597967 * account for interrupts that could reduce the number of these
7960− * requests.
7968+ * requests, and for any quirks of the PCODE firmware that delays
7969+ * the request completion.
79617970 */
79627971 DRM_DEBUG_KMS("PCODE timeout, retrying with preemption disabled\n");
79637972 WARN_ON_ONCE(timeout_base_ms > 3);
79647973 preempt_disable();
7965− ret = wait_for_atomic(COND, 10);
7974+ ret = wait_for_atomic(COND, 50);
79667975 preempt_enable();
79677976
79687977 out:
drivers/gpu/drm/i915/intel_ringbuffer.h+3−0
@@ -403,6 +403,9 @@ struct intel_engine_cs { · 402 unmodified lines
403403 */
404404 struct i915_gem_context *legacy_active_context;
405405
406+ /* status_notifier: list of callbacks for context-switch changes */
407+ struct atomic_notifier_head context_status_notifier;
408+
406409 struct intel_engine_hangcheck hangcheck;
407410
408411 bool needs_cmd_parser;
drivers/gpu/drm/i915/intel_sprite.c+0−3
@@ -254,9 +254,6 @@ skl_update_plane(struct drm_plane *drm_plane, · 253 unmodified lines
254254 int scaler_id = plane_state->scaler_id;
255255 const struct intel_scaler *scaler;
256256
257− DRM_DEBUG_KMS("plane = %d PS_PLANE_SEL(plane) = 0x%x\n",
258− plane_id, PS_PLANE_SEL(plane_id));
259−
260257 scaler = &crtc_state->scaler_state.scalers[scaler_id];
261258
262259 I915_WRITE(SKL_PS_CTRL(pipe, scaler_id),
drivers/gpu/drm/i915/intel_uncore.c+6−7
@@ -119,6 +119,8 @@ fw_domains_get(struct drm_i915_private *dev_priv, enum forcewake_domains fw_doma · 118 unmodified lines
119119
120120 for_each_fw_domain_masked(d, fw_domains, dev_priv)
121121 fw_domain_wait_ack(d);
122+
123+ dev_priv->uncore.fw_domains_active |= fw_domains;
122124 }
123125
124126 static void
@@ -130,6 +132,8 @@ fw_domains_put(struct drm_i915_private *dev_priv, enum forcewake_domains fw_doma · 5 unmodified lines
130132 fw_domain_put(d);
131133 fw_domain_posting_read(d);
132134 }
135+
136+ dev_priv->uncore.fw_domains_active &= ~fw_domains;
133137 }
134138
135139 static void
@@ -240,10 +244,8 @@ intel_uncore_fw_release_timer(struct hrtimer *timer) · 104 unmodified lines
240244 if (WARN_ON(domain->wake_count == 0))
241245 domain->wake_count++;
242246
243− if (--domain->wake_count == 0) {
247+ if (--domain->wake_count == 0)
244248 dev_priv->uncore.funcs.force_wake_put(dev_priv, domain->mask);
245− dev_priv->uncore.fw_domains_active &= ~domain->mask;
246− }
247249
248250 spin_unlock_irqrestore(&dev_priv->uncore.lock, irqflags);
249251
@@ -454,10 +456,8 @@ static void __intel_uncore_forcewake_get(struct drm_i915_private *dev_priv, · 204 unmodified lines
454456 fw_domains &= ~domain->mask;
455457 }
456458
457− if (fw_domains) {
459+ if (fw_domains)
458460 dev_priv->uncore.funcs.force_wake_get(dev_priv, fw_domains);
459− dev_priv->uncore.fw_domains_active |= fw_domains;
460− }
461461 }
462462
463463 /**
@@ -968,7 +968,6 @@ static noinline void ___force_wake_auto(struct drm_i915_private *dev_priv, · 504 unmodified lines
968968 fw_domain_arm_timer(domain);
969969
970970 dev_priv->uncore.funcs.force_wake_get(dev_priv, fw_domains);
971− dev_priv->uncore.fw_domains_active |= fw_domains;
972971 }
973972
974973 static inline void __force_wake_auto(struct drm_i915_private *dev_priv,
drivers/gpu/drm/omapdrm/omap_gem_dmabuf.c+0−3
@@ -147,9 +147,6 @@ static int omap_gem_dmabuf_mmap(struct dma_buf *buffer, · 146 unmodified lines
147147 struct drm_gem_object *obj = buffer->priv;
148148 int ret = 0;
149149
150− if (WARN_ON(!obj->filp))
151− return -EINVAL;
152−
153150 ret = drm_gem_mmap_obj(obj, omap_gem_mmap_size(obj), vma);
154151 if (ret < 0)
155152 return ret;
drivers/gpu/drm/radeon/si_dpm.c+10−0
@@ -2984,6 +2984,16 @@ static void si_apply_state_adjust_rules(struct radeon_device *rdev, · 2983 unmodified lines
29842984 (rdev->pdev->device == 0x6667)) {
29852985 max_sclk = 75000;
29862986 }
2987+ } else if (rdev->family == CHIP_OLAND) {
2988+ if ((rdev->pdev->revision == 0xC7) ||
2989+ (rdev->pdev->revision == 0x80) ||
2990+ (rdev->pdev->revision == 0x81) ||
2991+ (rdev->pdev->revision == 0x83) ||
2992+ (rdev->pdev->revision == 0x87) ||
2993+ (rdev->pdev->device == 0x6604) ||
2994+ (rdev->pdev->device == 0x6605)) {
2995+ max_sclk = 75000;
2996+ }
29872997 }
29882998
29892999 if (rps->vce_active) {
drivers/gpu/drm/tilcdc/tilcdc_crtc.c+24−13
@@ -464,6 +464,7 @@ static void tilcdc_crtc_enable(struct drm_crtc *crtc) · 463 unmodified lines
464464 {
465465 struct drm_device *dev = crtc->dev;
466466 struct tilcdc_crtc *tilcdc_crtc = to_tilcdc_crtc(crtc);
467+ unsigned long flags;
467468
468469 WARN_ON(!drm_modeset_is_locked(&crtc->mutex));
469470 mutex_lock(&tilcdc_crtc->enable_lock);
@@ -484,7 +485,17 @@ static void tilcdc_crtc_enable(struct drm_crtc *crtc) · 14 unmodified lines
484485 tilcdc_write_mask(dev, LCDC_RASTER_CTRL_REG,
485486 LCDC_PALETTE_LOAD_MODE(DATA_ONLY),
486487 LCDC_PALETTE_LOAD_MODE_MASK);
488+
489+ /* There is no real chance for a race here as the time stamp
490+ * is taken before the raster DMA is started. The spin-lock is
491+ * taken to have a memory barrier after taking the time-stamp
492+ * and to avoid a context switch between taking the stamp and
493+ * enabling the raster.
494+ */
495+ spin_lock_irqsave(&tilcdc_crtc->irq_lock, flags);
496+ tilcdc_crtc->last_vblank = ktime_get();
487497 tilcdc_set(dev, LCDC_RASTER_CTRL_REG, LCDC_RASTER_ENABLE);
498+ spin_unlock_irqrestore(&tilcdc_crtc->irq_lock, flags);
488499
489500 drm_crtc_vblank_on(crtc);
490501
@@ -539,7 +550,6 @@ static void tilcdc_crtc_off(struct drm_crtc *crtc, bool shutdown) · 48 unmodified lines
539550 }
540551
541552 drm_flip_work_commit(&tilcdc_crtc->unref_work, priv->wq);
542− tilcdc_crtc->last_vblank = 0;
543553
544554 tilcdc_crtc->enabled = false;
545555 mutex_unlock(&tilcdc_crtc->enable_lock);
@@ -602,7 +612,6 @@ int tilcdc_crtc_update_fb(struct drm_crtc *crtc, · 56 unmodified lines
602612 {
603613 struct tilcdc_crtc *tilcdc_crtc = to_tilcdc_crtc(crtc);
604614 struct drm_device *dev = crtc->dev;
605− unsigned long flags;
606615
607616 WARN_ON(!drm_modeset_is_locked(&crtc->mutex));
608617
@@ -614,28 +623,30 @@ int tilcdc_crtc_update_fb(struct drm_crtc *crtc, · 5 unmodified lines
614623 drm_framebuffer_reference(fb);
615624
616625 crtc->primary->fb = fb;
626+ tilcdc_crtc->event = event;
617627
618− spin_lock_irqsave(&tilcdc_crtc->irq_lock, flags);
628+ mutex_lock(&tilcdc_crtc->enable_lock);
619629
620− if (crtc->hwmode.vrefresh && ktime_to_ns(tilcdc_crtc->last_vblank)) {
630+ if (tilcdc_crtc->enabled) {
631+ unsigned long flags;
621632 ktime_t next_vblank;
622633 s64 tdiff;
623634
624− next_vblank = ktime_add_us(tilcdc_crtc->last_vblank,
625− 1000000 / crtc->hwmode.vrefresh);
635+ spin_lock_irqsave(&tilcdc_crtc->irq_lock, flags);
626636
637+ next_vblank = ktime_add_us(tilcdc_crtc->last_vblank,
638+ 1000000 / crtc->hwmode.vrefresh);
627639 tdiff = ktime_to_us(ktime_sub(next_vblank, ktime_get()));
628640
629641 if (tdiff < TILCDC_VBLANK_SAFETY_THRESHOLD_US)
630642 tilcdc_crtc->next_fb = fb;
631− }
632−
633− if (tilcdc_crtc->next_fb != fb)
634− set_scanout(crtc, fb);
643+ else
644+ set_scanout(crtc, fb);
635645
636− tilcdc_crtc->event = event;
646+ spin_unlock_irqrestore(&tilcdc_crtc->irq_lock, flags);
647+ }
637648
638− spin_unlock_irqrestore(&tilcdc_crtc->irq_lock, flags);
649+ mutex_unlock(&tilcdc_crtc->enable_lock);
639650
640651 return 0;
641652 }
@@ -1036,5 +1047,5 @@ int tilcdc_crtc_create(struct drm_device *dev) · 394 unmodified lines
10361047
10371048 fail:
10381049 tilcdc_crtc_destroy(crtc);
1039− return -ENOMEM;
1050+ return ret;
10401051 }
drivers/hid/Kconfig+3−2
@@ -175,11 +175,11 @@ config HID_CHERRY · 174 unmodified lines
175175 Support for Cherry Cymotion keyboard.
176176
177177 config HID_CHICONY
178− tristate "Chicony Tactical pad"
178+ tristate "Chicony devices"
179179 depends on HID
180180 default !EXPERT
181181 ---help---
182− Support for Chicony Tactical pad.
182+ Support for Chicony Tactical pad and special keys on Chicony keyboards.
183183
184184 config HID_CORSAIR
185185 tristate "Corsair devices"
@@ -190,6 +190,7 @@ config HID_CORSAIR · 4 unmodified lines
190190
191191 Supported devices:
192192 - Vengeance K90
193+ - Scimitar PRO RGB
193194
194195 config HID_PRODIKEYS
195196 tristate "Prodikeys PC-MIDI Keyboard support"
drivers/hid/hid-chicony.c+1−0
@@ -86,6 +86,7 @@ static const struct hid_device_id ch_devices[] = { · 85 unmodified lines
8686 { HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_WIRELESS2) },
8787 { HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_AK1D) },
8888 { HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_ACER_SWITCH12) },
89+ { HID_USB_DEVICE(USB_VENDOR_ID_JESS, USB_DEVICE_ID_JESS_ZEN_AIO_KBD) },
8990 { }
9091 };
9192 MODULE_DEVICE_TABLE(hid, ch_devices);
drivers/hid/hid-core.c+2−0
@@ -1870,6 +1870,7 @@ static const struct hid_device_id hid_have_special_driver[] = { · 1869 unmodified lines
18701870 { HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_AK1D) },
18711871 { HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_ACER_SWITCH12) },
18721872 { HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_K90) },
1873+ { HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_SCIMITAR_PRO_RGB) },
18731874 { HID_USB_DEVICE(USB_VENDOR_ID_CREATIVELABS, USB_DEVICE_ID_PRODIKEYS_PCMIDI) },
18741875 { HID_USB_DEVICE(USB_VENDOR_ID_CYGNAL, USB_DEVICE_ID_CYGNAL_CP2112) },
18751876 { HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_BARCODE_1) },
@@ -1910,6 +1911,7 @@ static const struct hid_device_id hid_have_special_driver[] = { · 34 unmodified lines
19101911 { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A081) },
19111912 { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A0C2) },
19121913 { HID_USB_DEVICE(USB_VENDOR_ID_HUION, USB_DEVICE_ID_HUION_TABLET) },
1914+ { HID_USB_DEVICE(USB_VENDOR_ID_JESS, USB_DEVICE_ID_JESS_ZEN_AIO_KBD) },
19131915 { HID_USB_DEVICE(USB_VENDOR_ID_JESS2, USB_DEVICE_ID_JESS2_COLOR_RUMBLE_PAD) },
19141916 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ION, USB_DEVICE_ID_ICADE) },
19151917 { HID_USB_DEVICE(USB_VENDOR_ID_KENSINGTON, USB_DEVICE_ID_KS_SLIMBLADE) },
drivers/hid/hid-corsair.c+47−0
@@ -3,8 +3,10 @@ · 2 unmodified lines
33 *
44 * Supported devices:
55 * - Vengeance K90 Keyboard
6+ * - Scimitar PRO RGB Gaming Mouse
67 *
78 * Copyright (c) 2015 Clement Vuchener
9+ * Copyright (c) 2017 Oscar Campos
810 */
911
1012 /*
@@ -670,10 +672,51 @@ static int corsair_input_mapping(struct hid_device *dev, · 659 unmodified lines
670672 return 0;
671673 }
672674
675+/*
676+ * The report descriptor of Corsair Scimitar RGB Pro gaming mouse is
677+ * non parseable as they define two consecutive Logical Minimum for
678+ * the Usage Page (Consumer) in rdescs bytes 75 and 77 being 77 0x16
679+ * that should be obviousy 0x26 for Logical Magimum of 16 bits. This
680+ * prevents poper parsing of the report descriptor due Logical
681+ * Minimum being larger than Logical Maximum.
682+ *
683+ * This driver fixes the report descriptor for:
684+ * - USB ID b1c:1b3e, sold as Scimitar RGB Pro Gaming mouse
685+ */
686+
687+static __u8 *corsair_mouse_report_fixup(struct hid_device *hdev, __u8 *rdesc,
688+ unsigned int *rsize)
689+{
690+ struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
691+
692+ if (intf->cur_altsetting->desc.bInterfaceNumber == 1) {
693+ /*
694+ * Corsair Scimitar RGB Pro report descriptor is broken and
695+ * defines two different Logical Minimum for the Consumer
696+ * Application. The byte 77 should be a 0x26 defining a 16
697+ * bits integer for the Logical Maximum but it is a 0x16
698+ * instead (Logical Minimum)
699+ */
700+ switch (hdev->product) {
701+ case USB_DEVICE_ID_CORSAIR_SCIMITAR_PRO_RGB:
702+ if (*rsize >= 172 && rdesc[75] == 0x15 && rdesc[77] == 0x16
703+ && rdesc[78] == 0xff && rdesc[79] == 0x0f) {
704+ hid_info(hdev, "Fixing up report descriptor\n");
705+ rdesc[77] = 0x26;
706+ }
707+ break;
708+ }
709+
710+ }
711+ return rdesc;
712+}
713+
673714 static const struct hid_device_id corsair_devices[] = {
674715 { HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_K90),
675716 .driver_data = CORSAIR_USE_K90_MACRO |
676717 CORSAIR_USE_K90_BACKLIGHT },
718+ { HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR,
719+ USB_DEVICE_ID_CORSAIR_SCIMITAR_PRO_RGB) },
677720 {}
678721 };
679722
@@ -686,10 +729,14 @@ static struct hid_driver corsair_driver = { · 6 unmodified lines
686729 .event = corsair_event,
687730 .remove = corsair_remove,
688731 .input_mapping = corsair_input_mapping,
732+ .report_fixup = corsair_mouse_report_fixup,
689733 };
690734
691735 module_hid_driver(corsair_driver);
692736
693737 MODULE_LICENSE("GPL");
738+/* Original K90 driver author */
694739 MODULE_AUTHOR("Clement Vuchener");
740+/* Scimitar PRO RGB driver author */
741+MODULE_AUTHOR("Oscar Campos");
695742 MODULE_DESCRIPTION("HID driver for Corsair devices");
drivers/hid/hid-ids.h+4−0
@@ -278,6 +278,9 @@ · 277 unmodified lines
278278 #define USB_DEVICE_ID_CORSAIR_K70RGB 0x1b13
279279 #define USB_DEVICE_ID_CORSAIR_STRAFE 0x1b15
280280 #define USB_DEVICE_ID_CORSAIR_K65RGB 0x1b17
281+#define USB_DEVICE_ID_CORSAIR_K70RGB_RAPIDFIRE 0x1b38
282+#define USB_DEVICE_ID_CORSAIR_K65RGB_RAPIDFIRE 0x1b39
283+#define USB_DEVICE_ID_CORSAIR_SCIMITAR_PRO_RGB 0x1b3e
281284
282285 #define USB_VENDOR_ID_CREATIVELABS 0x041e
283286 #define USB_DEVICE_ID_CREATIVE_SB_OMNI_SURROUND_51 0x322c
@@ -557,6 +560,7 @@ · 273 unmodified lines
557560
558561 #define USB_VENDOR_ID_JESS 0x0c45
559562 #define USB_DEVICE_ID_JESS_YUREX 0x1010
563+#define USB_DEVICE_ID_JESS_ZEN_AIO_KBD 0x5112
560564
561565 #define USB_VENDOR_ID_JESS2 0x0f30
562566 #define USB_DEVICE_ID_JESS2_COLOR_RUMBLE_PAD 0x0111
drivers/hid/hid-sony.c+2−0
@@ -2632,6 +2632,8 @@ err_stop: · 2631 unmodified lines
26322632 sony_leds_remove(sc);
26332633 if (sc->quirks & SONY_BATTERY_SUPPORT)
26342634 sony_battery_remove(sc);
2635+ if (sc->touchpad)
2636+ sony_unregister_touchpad(sc);
26352637 sony_cancel_work_sync(sc);
26362638 kfree(sc->output_report_dmabuf);
26372639 sony_remove_dev_list(sc);
drivers/hid/usbhid/hid-quirks.c+3−0
@@ -80,6 +80,9 @@ static const struct hid_blacklist { · 79 unmodified lines
8080 { USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_K70RGB, HID_QUIRK_NO_INIT_REPORTS },
8181 { USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_K65RGB, HID_QUIRK_NO_INIT_REPORTS },
8282 { USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_STRAFE, HID_QUIRK_NO_INIT_REPORTS | HID_QUIRK_ALWAYS_POLL },
83+ { USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_K70RGB_RAPIDFIRE, HID_QUIRK_NO_INIT_REPORTS | HID_QUIRK_ALWAYS_POLL },
84+ { USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_K65RGB_RAPIDFIRE, HID_QUIRK_NO_INIT_REPORTS | HID_QUIRK_ALWAYS_POLL },
85+ { USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_SCIMITAR_PRO_RGB, HID_QUIRK_NO_INIT_REPORTS | HID_QUIRK_ALWAYS_POLL },
8386 { USB_VENDOR_ID_CREATIVELABS, USB_DEVICE_ID_CREATIVE_SB_OMNI_SURROUND_51, HID_QUIRK_NOGET },
8487 { USB_VENDOR_ID_DMI, USB_DEVICE_ID_DMI_ENC, HID_QUIRK_NOGET },
8588 { USB_VENDOR_ID_DRAGONRISE, USB_DEVICE_ID_DRAGONRISE_WIIU, HID_QUIRK_MULTI_INPUT },
drivers/hid/wacom_sys.c+3−1
@@ -2579,7 +2579,9 @@ static void wacom_remove(struct hid_device *hdev) · 2578 unmodified lines
25792579
25802580 /* make sure we don't trigger the LEDs */
25812581 wacom_led_groups_release(wacom);
2582− wacom_release_resources(wacom);
2582+
2583+ if (wacom->wacom_wac.features.type != REMOTE)
2584+ wacom_release_resources(wacom);
25832585
25842586 hid_set_drvdata(hdev, NULL);
25852587 }
drivers/hid/wacom_wac.c+6−4
@@ -1959,8 +1959,10 @@ static void wacom_wac_pen_usage_mapping(struct hid_device *hdev, · 1958 unmodified lines
19591959 input_set_capability(input, EV_KEY, BTN_TOOL_BRUSH);
19601960 input_set_capability(input, EV_KEY, BTN_TOOL_PENCIL);
19611961 input_set_capability(input, EV_KEY, BTN_TOOL_AIRBRUSH);
1962− input_set_capability(input, EV_KEY, BTN_TOOL_MOUSE);
1963− input_set_capability(input, EV_KEY, BTN_TOOL_LENS);
1962+ if (!(features->device_type & WACOM_DEVICETYPE_DIRECT)) {
1963+ input_set_capability(input, EV_KEY, BTN_TOOL_MOUSE);
1964+ input_set_capability(input, EV_KEY, BTN_TOOL_LENS);
1965+ }
19641966 break;
19651967 case WACOM_HID_WD_FINGERWHEEL:
19661968 wacom_map_usage(input, usage, field, EV_ABS, ABS_WHEEL, 0);
@@ -4197,10 +4199,10 @@ static const struct wacom_features wacom_features_0x343 = · 2230 unmodified lines
41974199 WACOM_DTU_OFFSET, WACOM_DTU_OFFSET };
41984200 static const struct wacom_features wacom_features_0x360 =
41994201 { "Wacom Intuos Pro M", 44800, 29600, 8191, 63,
4200− INTUOSP2_BT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, 9, .touch_max = 10 };
4202+ INTUOSP2_BT, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 9, .touch_max = 10 };
42014203 static const struct wacom_features wacom_features_0x361 =
42024204 { "Wacom Intuos Pro L", 62200, 43200, 8191, 63,
4203− INTUOSP2_BT, WACOM_INTUOS_RES, WACOM_INTUOS_RES, 9, .touch_max = 10 };
4205+ INTUOSP2_BT, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 9, .touch_max = 10 };
42044206
42054207 static const struct wacom_features wacom_features_HID_ANY_ID =
42064208 { "Wacom HID", .type = HID_GENERIC, .oVid = HID_ANY_ID, .oPid = HID_ANY_ID };
drivers/hv/channel.c+12−13
@@ -502,12 +502,15 @@ int vmbus_teardown_gpadl(struct vmbus_channel *channel, u32 gpadl_handle) · 501 unmodified lines
502502
503503 wait_for_completion(&info->waitevent);
504504
505− if (channel->rescind) {
506− ret = -ENODEV;
507− goto post_msg_err;
508− }
509−
510505 post_msg_err:
506+ /*
507+ * If the channel has been rescinded;
508+ * we will be awakened by the rescind
509+ * handler; set the error code to zero so we don't leak memory.
510+ */
511+ if (channel->rescind)
512+ ret = 0;
513+
511514 spin_lock_irqsave(&vmbus_connection.channelmsg_lock, flags);
512515 list_del(&info->msglistentry);
513516 spin_unlock_irqrestore(&vmbus_connection.channelmsg_lock, flags);
@@ -530,15 +533,13 @@ static int vmbus_close_internal(struct vmbus_channel *channel) · 16 unmodified lines
530533 int ret;
531534
532535 /*
533− * vmbus_on_event(), running in the tasklet, can race
536+ * vmbus_on_event(), running in the per-channel tasklet, can race
534537 * with vmbus_close_internal() in the case of SMP guest, e.g., when
535538 * the former is accessing channel->inbound.ring_buffer, the latter
536− * could be freeing the ring_buffer pages.
537− *
538− * To resolve the race, we can serialize them by disabling the
539− * tasklet when the latter is running here.
539+ * could be freeing the ring_buffer pages, so here we must stop it
540+ * first.
540541 */
541− hv_event_tasklet_disable(channel);
542+ tasklet_disable(&channel->callback_event);
542543
543544 /*
544545 * In case a device driver's probe() fails (e.g.,
@@ -605,8 +606,6 @@ static int vmbus_close_internal(struct vmbus_channel *channel) · 60 unmodified lines
605606 get_order(channel->ringbuffer_pagecount * PAGE_SIZE));
606607
607608 out:
608− hv_event_tasklet_enable(channel);
609−
610609 return ret;
611610 }
612611
drivers/hv/channel_mgmt.c+5−22
@@ -350,7 +350,8 @@ static struct vmbus_channel *alloc_channel(void) · 349 unmodified lines
350350 static void free_channel(struct vmbus_channel *channel)
351351 {
352352 tasklet_kill(&channel->callback_event);
353− kfree(channel);
353+
354+ kfree_rcu(channel, rcu);
354355 }
355356
356357 static void percpu_channel_enq(void *arg)
@@ -359,14 +360,14 @@ static void percpu_channel_enq(void *arg) · 2 unmodified lines
359360 struct hv_per_cpu_context *hv_cpu
360361 = this_cpu_ptr(hv_context.cpu_context);
361362
362− list_add_tail(&channel->percpu_list, &hv_cpu->chan_list);
363+ list_add_tail_rcu(&channel->percpu_list, &hv_cpu->chan_list);
363364 }
364365
365366 static void percpu_channel_deq(void *arg)
366367 {
367368 struct vmbus_channel *channel = arg;
368369
369− list_del(&channel->percpu_list);
370+ list_del_rcu(&channel->percpu_list);
370371 }
371372
372373
@@ -381,19 +382,6 @@ static void vmbus_release_relid(u32 relid) · 8 unmodified lines
381382 true);
382383 }
383384
384−void hv_event_tasklet_disable(struct vmbus_channel *channel)
385−{
386− tasklet_disable(&channel->callback_event);
387−}
388−
389−void hv_event_tasklet_enable(struct vmbus_channel *channel)
390−{
391− tasklet_enable(&channel->callback_event);
392−
393− /* In case there is any pending event */
394− tasklet_schedule(&channel->callback_event);
395−}
396−
397385 void hv_process_channel_removal(struct vmbus_channel *channel, u32 relid)
398386 {
399387 unsigned long flags;
@@ -402,7 +390,6 @@ void hv_process_channel_removal(struct vmbus_channel *channel, u32 relid) · 2 unmodified lines
402390 BUG_ON(!channel->rescind);
403391 BUG_ON(!mutex_is_locked(&vmbus_connection.channel_mutex));
404392
405− hv_event_tasklet_disable(channel);
406393 if (channel->target_cpu != get_cpu()) {
407394 put_cpu();
408395 smp_call_function_single(channel->target_cpu,
@@ -411,7 +398,6 @@ void hv_process_channel_removal(struct vmbus_channel *channel, u32 relid) · 2 unmodified lines
411398 percpu_channel_deq(channel);
412399 put_cpu();
413400 }
414− hv_event_tasklet_enable(channel);
415401
416402 if (channel->primary_channel == NULL) {
417403 list_del(&channel->listentry);
@@ -505,7 +491,6 @@ static void vmbus_process_offer(struct vmbus_channel *newchannel) · 87 unmodified lines
505491
506492 init_vp_index(newchannel, dev_type);
507493
508− hv_event_tasklet_disable(newchannel);
509494 if (newchannel->target_cpu != get_cpu()) {
510495 put_cpu();
511496 smp_call_function_single(newchannel->target_cpu,
@@ -515,7 +500,6 @@ static void vmbus_process_offer(struct vmbus_channel *newchannel) · 3 unmodified lines
515500 percpu_channel_enq(newchannel);
516501 put_cpu();
517502 }
518− hv_event_tasklet_enable(newchannel);
519503
520504 /*
521505 * This state is used to indicate a successful open
@@ -565,7 +549,6 @@ err_deq_chan: · 43 unmodified lines
565549 list_del(&newchannel->listentry);
566550 mutex_unlock(&vmbus_connection.channel_mutex);
567551
568− hv_event_tasklet_disable(newchannel);
569552 if (newchannel->target_cpu != get_cpu()) {
570553 put_cpu();
571554 smp_call_function_single(newchannel->target_cpu,
@@ -574,7 +557,6 @@ err_deq_chan: · 2 unmodified lines
574557 percpu_channel_deq(newchannel);
575558 put_cpu();
576559 }
577− hv_event_tasklet_enable(newchannel);
578560
579561 vmbus_release_relid(newchannel->offermsg.child_relid);
580562
@@ -814,6 +796,7 @@ static void vmbus_onoffer(struct vmbus_channel_message_header *hdr) · 233 unmodified lines
814796 /* Allocate the channel object and save this offer. */
815797 newchannel = alloc_channel();
816798 if (!newchannel) {
799+ vmbus_release_relid(offer->child_relid);
817800 pr_err("Unable to allocate channel object\n");
818801 return;
819802 }
drivers/hv/hv_fcopy.c+0−4
@@ -71,7 +71,6 @@ static DECLARE_WORK(fcopy_send_work, fcopy_send_data); · 70 unmodified lines
7171 static const char fcopy_devname[] = "vmbus/hv_fcopy";
7272 static u8 *recv_buffer;
7373 static struct hvutil_transport *hvt;
74−static struct completion release_event;
7574 /*
7675 * This state maintains the version number registered by the daemon.
7776 */
@@ -329,7 +328,6 @@ static void fcopy_on_reset(void) · 251 unmodified lines
329328
330329 if (cancel_delayed_work_sync(&fcopy_timeout_work))
331330 fcopy_respond_to_host(HV_E_FAIL);
332− complete(&release_event);
333331 }
334332
335333 int hv_fcopy_init(struct hv_util_service *srv)
@@ -337,7 +335,6 @@ int hv_fcopy_init(struct hv_util_service *srv) · 1 unmodified line
337335 recv_buffer = srv->recv_buffer;
338336 fcopy_transaction.recv_channel = srv->channel;
339337
340− init_completion(&release_event);
341338 /*
342339 * When this driver loads, the user level daemon that
343340 * processes the host requests may not yet be running.
@@ -359,5 +356,4 @@ void hv_fcopy_deinit(void) · 15 unmodified lines
359356 fcopy_transaction.state = HVUTIL_DEVICE_DYING;
360357 cancel_delayed_work_sync(&fcopy_timeout_work);
361358 hvutil_transport_destroy(hvt);
362− wait_for_completion(&release_event);
363359 }
drivers/hv/hv_kvp.c+0−4
@@ -101,7 +101,6 @@ static DECLARE_WORK(kvp_sendkey_work, kvp_send_key); · 100 unmodified lines
101101 static const char kvp_devname[] = "vmbus/hv_kvp";
102102 static u8 *recv_buffer;
103103 static struct hvutil_transport *hvt;
104−static struct completion release_event;
105104 /*
106105 * Register the kernel component with the user-level daemon.
107106 * As part of this registration, pass the LIC version number.
@@ -712,7 +711,6 @@ static void kvp_on_reset(void) · 604 unmodified lines
712711 if (cancel_delayed_work_sync(&kvp_timeout_work))
713712 kvp_respond_to_host(NULL, HV_E_FAIL);
714713 kvp_transaction.state = HVUTIL_DEVICE_INIT;
715− complete(&release_event);
716714 }
717715
718716 int
@@ -721,7 +719,6 @@ hv_kvp_init(struct hv_util_service *srv) · 2 unmodified lines
721719 recv_buffer = srv->recv_buffer;
722720 kvp_transaction.recv_channel = srv->channel;
723721
724− init_completion(&release_event);
725722 /*
726723 * When this driver loads, the user level daemon that
727724 * processes the host requests may not yet be running.
@@ -745,5 +742,4 @@ void hv_kvp_deinit(void) · 17 unmodified lines
745742 cancel_delayed_work_sync(&kvp_timeout_work);
746743 cancel_work_sync(&kvp_sendkey_work);
747744 hvutil_transport_destroy(hvt);
748− wait_for_completion(&release_event);
749745 }
drivers/hv/hv_snapshot.c+0−4
@@ -79,7 +79,6 @@ static int dm_reg_value; · 78 unmodified lines
7979 static const char vss_devname[] = "vmbus/hv_vss";
8080 static __u8 *recv_buffer;
8181 static struct hvutil_transport *hvt;
82−static struct completion release_event;
8382
8483 static void vss_timeout_func(struct work_struct *dummy);
8584 static void vss_handle_request(struct work_struct *dummy);
@@ -359,13 +358,11 @@ static void vss_on_reset(void) · 273 unmodified lines
359358 if (cancel_delayed_work_sync(&vss_timeout_work))
360359 vss_respond_to_host(HV_E_FAIL);
361360 vss_transaction.state = HVUTIL_DEVICE_INIT;
362− complete(&release_event);
363361 }
364362
365363 int
366364 hv_vss_init(struct hv_util_service *srv)
367365 {
368− init_completion(&release_event);
369366 if (vmbus_proto_version < VERSION_WIN8_1) {
370367 pr_warn("Integration service 'Backup (volume snapshot)'"
371368 " not supported on this host version.\n");
@@ -398,5 +395,4 @@ void hv_vss_deinit(void) · 26 unmodified lines
398395 cancel_delayed_work_sync(&vss_timeout_work);
399396 cancel_work_sync(&vss_handle_request_work);
400397 hvutil_transport_destroy(hvt);
401− wait_for_completion(&release_event);
402398 }
drivers/hv/hv_util.c+2−0
@@ -590,6 +590,8 @@ static int hv_timesync_init(struct hv_util_service *srv) · 589 unmodified lines
590590 if (!hyperv_cs)
591591 return -ENODEV;
592592
593+ spin_lock_init(&host_ts.lock);
594+
593595 INIT_WORK(&wrk.work, hv_set_host_time);
594596
595597 /*
drivers/hv/hv_utils_transport.c+8−4
@@ -182,10 +182,11 @@ static int hvt_op_release(struct inode *inode, struct file *file) · 181 unmodified lines
182182 * connects back.
183183 */
184184 hvt_reset(hvt);
185− mutex_unlock(&hvt->lock);
186185
187186 if (mode_old == HVUTIL_TRANSPORT_DESTROY)
188− hvt_transport_free(hvt);
187+ complete(&hvt->release);
188+
189+ mutex_unlock(&hvt->lock);
189190
190191 return 0;
191192 }
@@ -304,6 +305,7 @@ struct hvutil_transport *hvutil_transport_init(const char *name, · 112 unmodified lines
304305
305306 init_waitqueue_head(&hvt->outmsg_q);
306307 mutex_init(&hvt->lock);
308+ init_completion(&hvt->release);
307309
308310 spin_lock(&hvt_list_lock);
309311 list_add(&hvt->list, &hvt_list);
@@ -351,6 +353,8 @@ void hvutil_transport_destroy(struct hvutil_transport *hvt) · 41 unmodified lines
351353 if (hvt->cn_id.idx > 0 && hvt->cn_id.val > 0)
352354 cn_del_callback(&hvt->cn_id);
353355
354− if (mode_old != HVUTIL_TRANSPORT_CHARDEV)
355− hvt_transport_free(hvt);
356+ if (mode_old == HVUTIL_TRANSPORT_CHARDEV)
357+ wait_for_completion(&hvt->release);
358+
359+ hvt_transport_free(hvt);
356360 }
drivers/hv/hv_utils_transport.h+1−0
@@ -41,6 +41,7 @@ struct hvutil_transport { · 40 unmodified lines
4141 int outmsg_len; /* its length */
4242 wait_queue_head_t outmsg_q; /* poll/read wait queue */
4343 struct mutex lock; /* protects struct members */
44+ struct completion release; /* synchronize with fd release */
4445 };
4546
4647 struct hvutil_transport *hvutil_transport_init(const char *name,
drivers/hv/vmbus_drv.c+5−1
@@ -937,8 +937,10 @@ static void vmbus_chan_sched(struct hv_per_cpu_context *hv_cpu) · 936 unmodified lines
937937 if (relid == 0)
938938 continue;
939939
940+ rcu_read_lock();
941+
940942 /* Find channel based on relid */
941− list_for_each_entry(channel, &hv_cpu->chan_list, percpu_list) {
943+ list_for_each_entry_rcu(channel, &hv_cpu->chan_list, percpu_list) {
942944 if (channel->offermsg.child_relid != relid)
943945 continue;
944946
@@ -954,6 +956,8 @@ static void vmbus_chan_sched(struct hv_per_cpu_context *hv_cpu) · 9 unmodified lines
954956 tasklet_schedule(&channel->callback_event);
955957 }
956958 }
959+
960+ rcu_read_unlock();
957961 }
958962 }
959963
drivers/hwmon/asus_atk0110.c+3−0
@@ -646,6 +646,9 @@ static int atk_read_value(struct atk_sensor_data *sensor, u64 *value) · 645 unmodified lines
646646 else
647647 err = atk_read_value_new(sensor, value);
648648
649+ if (err)
650+ return err;
651+
649652 sensor->is_valid = true;
650653 sensor->last_updated = jiffies;
651654 sensor->cached_value = *value;
drivers/hwmon/it87.c+19−5
@@ -3198,7 +3198,7 @@ static int __init sm_it87_init(void) · 3197 unmodified lines
31983198 {
31993199 int sioaddr[2] = { REG_2E, REG_4E };
32003200 struct it87_sio_data sio_data;
3201− unsigned short isa_address;
3201+ unsigned short isa_address[2];
32023202 bool found = false;
32033203 int i, err;
32043204
@@ -3208,15 +3208,29 @@ static int __init sm_it87_init(void) · 3 unmodified lines
32083208
32093209 for (i = 0; i < ARRAY_SIZE(sioaddr); i++) {
32103210 memset(&sio_data, 0, sizeof(struct it87_sio_data));
3211− isa_address = 0;
3212− err = it87_find(sioaddr[i], &isa_address, &sio_data);
3213− if (err || isa_address == 0)
3211+ isa_address[i] = 0;
3212+ err = it87_find(sioaddr[i], &isa_address[i], &sio_data);
3213+ if (err || isa_address[i] == 0)
32143214 continue;
3215+ /*
3216+ * Don't register second chip if its ISA address matches
3217+ * the first chip's ISA address.
3218+ */
3219+ if (i && isa_address[i] == isa_address[0])
3220+ break;
32153221
3216− err = it87_device_add(i, isa_address, &sio_data);
3222+ err = it87_device_add(i, isa_address[i], &sio_data);
32173223 if (err)
32183224 goto exit_dev_unregister;
3225+
32193226 found = true;
3227+
3228+ /*
3229+ * IT8705F may respond on both SIO addresses.
3230+ * Stop probing after finding one.
3231+ */
3232+ if (sio_data.type == it87)
3233+ break;
32203234 }
32213235
32223236 if (!found) {
drivers/hwmon/max31790.c+1−1
@@ -311,7 +311,7 @@ static int max31790_write_pwm(struct device *dev, u32 attr, int channel, · 310 unmodified lines
311311 data->pwm[channel] = val << 8;
312312 err = i2c_smbus_write_word_swapped(client,
313313 MAX31790_REG_PWMOUT(channel),
314− val);
314+ data->pwm[channel]);
315315 break;
316316 case hwmon_pwm_enable:
317317 fan_config = data->fan_config[channel];
drivers/hwtracing/intel_th/core.c+3−1
@@ -221,8 +221,10 @@ static int intel_th_output_activate(struct intel_th_device *thdev) · 220 unmodified lines
221221 else
222222 intel_th_trace_enable(thdev);
223223
224− if (ret)
224+ if (ret) {
225225 pm_runtime_put(&thdev->dev);
226+ module_put(thdrv->driver.owner);
227+ }
226228
227229 return ret;
228230 }
drivers/hwtracing/intel_th/pci.c+10−0
@@ -85,6 +85,16 @@ static const struct pci_device_id intel_th_pci_id_table[] = { · 84 unmodified lines
8585 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0xa2a6),
8686 .driver_data = (kernel_ulong_t)0,
8787 },
88+ {
89+ /* Denverton */
90+ PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x19e1),
91+ .driver_data = (kernel_ulong_t)0,
92+ },
93+ {
94+ /* Gemini Lake */
95+ PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x318e),
96+ .driver_data = (kernel_ulong_t)0,
97+ },
8898 { 0 },
8999 };
90100
drivers/iio/adc/ti_am335x_adc.c+12−1
@@ -169,7 +169,9 @@ static irqreturn_t tiadc_irq_h(int irq, void *private) · 168 unmodified lines
169169 {
170170 struct iio_dev *indio_dev = private;
171171 struct tiadc_device *adc_dev = iio_priv(indio_dev);
172− unsigned int status, config;
172+ unsigned int status, config, adc_fsm;
173+ unsigned short count = 0;
174+
173175 status = tiadc_readl(adc_dev, REG_IRQSTATUS);
174176
175177 /*
@@ -183,6 +185,15 @@ static irqreturn_t tiadc_irq_h(int irq, void *private) · 7 unmodified lines
183185 tiadc_writel(adc_dev, REG_CTRL, config);
184186 tiadc_writel(adc_dev, REG_IRQSTATUS, IRQENB_FIFO1OVRRUN
185187 | IRQENB_FIFO1UNDRFLW | IRQENB_FIFO1THRES);
188+
189+ /* wait for idle state.
190+ * ADC needs to finish the current conversion
191+ * before disabling the module
192+ */
193+ do {
194+ adc_fsm = tiadc_readl(adc_dev, REG_ADCFSM);
195+ } while (adc_fsm != 0x10 && count++ < 100);
196+
186197 tiadc_writel(adc_dev, REG_CTRL, (config | CNTRLREG_TSCSSENB));
187198 return IRQ_HANDLED;
188199 } else if (status & IRQENB_FIFO1THRES) {
drivers/iio/common/hid-sensors/hid-sensor-trigger.c+3−3
@@ -51,8 +51,6 @@ static int _hid_sensor_power_state(struct hid_sensor_common *st, bool state) · 50 unmodified lines
5151 st->report_state.report_id,
5252 st->report_state.index,
5353 HID_USAGE_SENSOR_PROP_REPORTING_STATE_ALL_EVENTS_ENUM);
54−
55− poll_value = hid_sensor_read_poll_value(st);
5654 } else {
5755 int val;
5856
@@ -89,7 +87,9 @@ static int _hid_sensor_power_state(struct hid_sensor_common *st, bool state) · 30 unmodified lines
8987 sensor_hub_get_feature(st->hsdev, st->power_state.report_id,
9088 st->power_state.index,
9189 sizeof(state_val), &state_val);
92− if (state && poll_value)
90+ if (state)
91+ poll_value = hid_sensor_read_poll_value(st);
92+ if (poll_value > 0)
9393 msleep_interruptible(poll_value * 2);
9494
9595 return 0;
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c+2−2
@@ -193,8 +193,8 @@ int st_lsm6dsx_update_watermark(struct st_lsm6dsx_sensor *sensor, u16 watermark) · 192 unmodified lines
193193 if (err < 0)
194194 goto out;
195195
196− fifo_watermark = ((data & ~ST_LSM6DSX_FIFO_TH_MASK) << 8) |
197− (fifo_watermark & ST_LSM6DSX_FIFO_TH_MASK);
196+ fifo_watermark = ((data << 8) & ~ST_LSM6DSX_FIFO_TH_MASK) |
197+ (fifo_watermark & ST_LSM6DSX_FIFO_TH_MASK);
198198
199199 wdata = cpu_to_le16(fifo_watermark);
200200 err = hw->tf->write(hw->dev, ST_LSM6DSX_REG_FIFO_THL_ADDR,
drivers/iio/magnetometer/ak8974.c+2−2
@@ -763,7 +763,7 @@ power_off: · 762 unmodified lines
763763 return ret;
764764 }
765765
766−static int __exit ak8974_remove(struct i2c_client *i2c)
766+static int ak8974_remove(struct i2c_client *i2c)
767767 {
768768 struct iio_dev *indio_dev = i2c_get_clientdata(i2c);
769769 struct ak8974 *ak8974 = iio_priv(indio_dev);
@@ -845,7 +845,7 @@ static struct i2c_driver ak8974_driver = { · 75 unmodified lines
845845 .of_match_table = of_match_ptr(ak8974_of_match),
846846 },
847847 .probe = ak8974_probe,
848− .remove = __exit_p(ak8974_remove),
848+ .remove = ak8974_remove,
849849 .id_table = ak8974_id,
850850 };
851851 module_i2c_driver(ak8974_driver);
drivers/infiniband/core/cq.c+8−2
@@ -29,7 +29,13 @@ static int __ib_process_cq(struct ib_cq *cq, int budget) · 28 unmodified lines
2929 {
3030 int i, n, completed = 0;
3131
32− while ((n = ib_poll_cq(cq, IB_POLL_BATCH, cq->wc)) > 0) {
32+ /*
33+ * budget might be (-1) if the caller does not
34+ * want to bound this call, thus we need unsigned
35+ * minimum here.
36+ */
37+ while ((n = ib_poll_cq(cq, min_t(u32, IB_POLL_BATCH,
38+ budget - completed), cq->wc)) > 0) {
3339 for (i = 0; i < n; i++) {
3440 struct ib_wc *wc = &cq->wc[i];
3541
@@ -196,7 +202,7 @@ void ib_free_cq(struct ib_cq *cq) · 160 unmodified lines
196202 irq_poll_disable(&cq->iop);
197203 break;
198204 case IB_POLL_WORKQUEUE:
199− flush_work(&cq->work);
205+ cancel_work_sync(&cq->work);
200206 break;
201207 default:
202208 WARN_ON_ONCE(1);
drivers/infiniband/core/device.c+21−8
@@ -336,12 +336,26 @@ int ib_register_device(struct ib_device *device, · 335 unmodified lines
336336 struct device *parent = device->dev.parent;
337337
338338 WARN_ON_ONCE(!parent);
339− if (!device->dev.dma_ops)
340− device->dev.dma_ops = parent->dma_ops;
341− if (!device->dev.dma_mask)
342− device->dev.dma_mask = parent->dma_mask;
343− if (!device->dev.coherent_dma_mask)
344− device->dev.coherent_dma_mask = parent->coherent_dma_mask;
339+ WARN_ON_ONCE(device->dma_device);
340+ if (device->dev.dma_ops) {
341+ /*
342+ * The caller provided custom DMA operations. Copy the
343+ * DMA-related fields that are used by e.g. dma_alloc_coherent()
344+ * into device->dev.
345+ */
346+ device->dma_device = &device->dev;
347+ if (!device->dev.dma_mask)
348+ device->dev.dma_mask = parent->dma_mask;
349+ if (!device->dev.coherent_dma_mask)
350+ device->dev.coherent_dma_mask =
351+ parent->coherent_dma_mask;
352+ } else {
353+ /*
354+ * The caller did not provide custom DMA operations. Use the
355+ * DMA mapping operations of the parent device.
356+ */
357+ device->dma_device = parent;
358+ }
345359
346360 mutex_lock(&device_mutex);
347361
@@ -1015,8 +1029,7 @@ static int __init ib_core_init(void) · 667 unmodified lines
10151029 return -ENOMEM;
10161030
10171031 ib_comp_wq = alloc_workqueue("ib-comp-wq",
1018− WQ_UNBOUND | WQ_HIGHPRI | WQ_MEM_RECLAIM,
1019− WQ_UNBOUND_MAX_ACTIVE);
1032+ WQ_HIGHPRI | WQ_MEM_RECLAIM | WQ_SYSFS, 0);
10201033 if (!ib_comp_wq) {
10211034 ret = -ENOMEM;
10221035 goto err;
drivers/infiniband/hw/i40iw/i40iw_utils.c+8−0
@@ -160,6 +160,9 @@ int i40iw_inetaddr_event(struct notifier_block *notifier, · 159 unmodified lines
160160 return NOTIFY_DONE;
161161
162162 iwdev = &hdl->device;
163+ if (iwdev->init_state < INET_NOTIFIER)
164+ return NOTIFY_DONE;
165+
163166 netdev = iwdev->ldev->netdev;
164167 upper_dev = netdev_master_upper_dev_get(netdev);
165168 if (netdev != event_netdev)
@@ -214,6 +217,9 @@ int i40iw_inet6addr_event(struct notifier_block *notifier, · 48 unmodified lines
214217 return NOTIFY_DONE;
215218
216219 iwdev = &hdl->device;
220+ if (iwdev->init_state < INET_NOTIFIER)
221+ return NOTIFY_DONE;
222+
217223 netdev = iwdev->ldev->netdev;
218224 if (netdev != event_netdev)
219225 return NOTIFY_DONE;
@@ -260,6 +266,8 @@ int i40iw_net_event(struct notifier_block *notifier, unsigned long event, void * · 40 unmodified lines
260266 if (!iwhdl)
261267 return NOTIFY_DONE;
262268 iwdev = &iwhdl->device;
269+ if (iwdev->init_state < INET_NOTIFIER)
270+ return NOTIFY_DONE;
263271 p = (__be32 *)neigh->primary_key;
264272 i40iw_copy_ip_ntohl(local_ipaddr, p);
265273 if (neigh->nud_state & NUD_VALID) {
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c+1−1
@@ -372,7 +372,7 @@ static int _ocrdma_pd_mgr_put_bitmap(struct ocrdma_dev *dev, u16 pd_id, · 371 unmodified lines
372372 return 0;
373373 }
374374
375−static u8 ocrdma_put_pd_num(struct ocrdma_dev *dev, u16 pd_id,
375+static int ocrdma_put_pd_num(struct ocrdma_dev *dev, u16 pd_id,
376376 bool dpp_pool)
377377 {
378378 int status;
drivers/infiniband/hw/qib/qib_iba7322.c+1−1
@@ -7068,7 +7068,7 @@ static void qib_7322_txchk_change(struct qib_devdata *dd, u32 start, · 7067 unmodified lines
70687068 unsigned long flags;
70697069
70707070 while (wait) {
7071− unsigned long shadow;
7071+ unsigned long shadow = 0;
70727072 int cstart, previ = -1;
70737073
70747074 /*
drivers/infiniband/hw/vmw_pvrdma/pvrdma.h+3−0
@@ -69,6 +69,9 @@ · 68 unmodified lines
6969 */
7070 #define PCI_DEVICE_ID_VMWARE_PVRDMA 0x0820
7171
72+#define PVRDMA_NUM_RING_PAGES 4
73+#define PVRDMA_QP_NUM_HEADER_PAGES 1
74+
7275 struct pvrdma_dev;
7376
7477 struct pvrdma_page_dir {
drivers/infiniband/hw/vmw_pvrdma/pvrdma_dev_api.h+1−1
@@ -132,7 +132,7 @@ enum pvrdma_pci_resource { · 131 unmodified lines
132132
133133 enum pvrdma_device_ctl {
134134 PVRDMA_DEVICE_CTL_ACTIVATE, /* Activate device. */
135− PVRDMA_DEVICE_CTL_QUIESCE, /* Quiesce device. */
135+ PVRDMA_DEVICE_CTL_UNQUIESCE, /* Unquiesce device. */
136136 PVRDMA_DEVICE_CTL_RESET, /* Reset device. */
137137 };
138138
drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c+13−4
@@ -56,7 +56,7 @@ · 55 unmodified lines
5656 #include "pvrdma.h"
5757
5858 #define DRV_NAME "vmw_pvrdma"
59−#define DRV_VERSION "1.0.0.0-k"
59+#define DRV_VERSION "1.0.1.0-k"
6060
6161 static DEFINE_MUTEX(pvrdma_device_list_lock);
6262 static LIST_HEAD(pvrdma_device_list);
@@ -660,7 +660,16 @@ static void pvrdma_netdevice_event_handle(struct pvrdma_dev *dev, · 597 unmodified lines
660660 pvrdma_dispatch_event(dev, 1, IB_EVENT_PORT_ERR);
661661 break;
662662 case NETDEV_UP:
663− pvrdma_dispatch_event(dev, 1, IB_EVENT_PORT_ACTIVE);
663+ pvrdma_write_reg(dev, PVRDMA_REG_CTL,
664+ PVRDMA_DEVICE_CTL_UNQUIESCE);
665+
666+ mb();
667+
668+ if (pvrdma_read_reg(dev, PVRDMA_REG_ERR))
669+ dev_err(&dev->pdev->dev,
670+ "failed to activate device during link up\n");
671+ else
672+ pvrdma_dispatch_event(dev, 1, IB_EVENT_PORT_ACTIVE);
664673 break;
665674 default:
666675 dev_dbg(&dev->pdev->dev, "ignore netdevice event %ld on %s\n",
@@ -858,7 +867,7 @@ static int pvrdma_pci_probe(struct pci_dev *pdev, · 191 unmodified lines
858867 dev->dsr->resp_slot_dma = (u64)slot_dma;
859868
860869 /* Async event ring */
861− dev->dsr->async_ring_pages.num_pages = 4;
870+ dev->dsr->async_ring_pages.num_pages = PVRDMA_NUM_RING_PAGES;
862871 ret = pvrdma_page_dir_init(dev, &dev->async_pdir,
863872 dev->dsr->async_ring_pages.num_pages, true);
864873 if (ret)
@@ -867,7 +876,7 @@ static int pvrdma_pci_probe(struct pci_dev *pdev, · 2 unmodified lines
867876 dev->dsr->async_ring_pages.pdir_dma = dev->async_pdir.dir_dma;
868877
869878 /* CQ notification ring */
870− dev->dsr->cq_ring_pages.num_pages = 4;
879+ dev->dsr->cq_ring_pages.num_pages = PVRDMA_NUM_RING_PAGES;
871880 ret = pvrdma_page_dir_init(dev, &dev->cq_pdir,
872881 dev->dsr->cq_ring_pages.num_pages, true);
873882 if (ret)
drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c+18−24
@@ -170,8 +170,9 @@ static int pvrdma_set_sq_size(struct pvrdma_dev *dev, struct ib_qp_cap *req_cap, · 169 unmodified lines
170170 sizeof(struct pvrdma_sge) *
171171 qp->sq.max_sg);
172172 /* Note: one extra page for the header. */
173− qp->npages_send = 1 + (qp->sq.wqe_cnt * qp->sq.wqe_size +
174− PAGE_SIZE - 1) / PAGE_SIZE;
173+ qp->npages_send = PVRDMA_QP_NUM_HEADER_PAGES +
174+ (qp->sq.wqe_cnt * qp->sq.wqe_size + PAGE_SIZE - 1) /
175+ PAGE_SIZE;
175176
176177 return 0;
177178 }
@@ -288,7 +289,7 @@ struct ib_qp *pvrdma_create_qp(struct ib_pd *pd, · 110 unmodified lines
288289 qp->npages = qp->npages_send + qp->npages_recv;
289290
290291 /* Skip header page. */
291− qp->sq.offset = PAGE_SIZE;
292+ qp->sq.offset = PVRDMA_QP_NUM_HEADER_PAGES * PAGE_SIZE;
292293
293294 /* Recv queue pages are after send pages. */
294295 qp->rq.offset = qp->npages_send * PAGE_SIZE;
@@ -341,7 +342,7 @@ struct ib_qp *pvrdma_create_qp(struct ib_pd *pd, · 46 unmodified lines
341342 cmd->qp_type = ib_qp_type_to_pvrdma(init_attr->qp_type);
342343 cmd->access_flags = IB_ACCESS_LOCAL_WRITE;
343344 cmd->total_chunks = qp->npages;
344− cmd->send_chunks = qp->npages_send - 1;
345+ cmd->send_chunks = qp->npages_send - PVRDMA_QP_NUM_HEADER_PAGES;
345346 cmd->pdir_dma = qp->pdir.dir_dma;
346347
347348 dev_dbg(&dev->pdev->dev, "create queuepair with %d, %d, %d, %d\n",
@@ -554,13 +555,13 @@ out: · 206 unmodified lines
554555 return ret;
555556 }
556557
557−static inline void *get_sq_wqe(struct pvrdma_qp *qp, int n)
558+static inline void *get_sq_wqe(struct pvrdma_qp *qp, unsigned int n)
558559 {
559560 return pvrdma_page_dir_get_ptr(&qp->pdir,
560561 qp->sq.offset + n * qp->sq.wqe_size);
561562 }
562563
563−static inline void *get_rq_wqe(struct pvrdma_qp *qp, int n)
564+static inline void *get_rq_wqe(struct pvrdma_qp *qp, unsigned int n)
564565 {
565566 return pvrdma_page_dir_get_ptr(&qp->pdir,
566567 qp->rq.offset + n * qp->rq.wqe_size);
@@ -598,9 +599,7 @@ int pvrdma_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, · 31 unmodified lines
598599 unsigned long flags;
599600 struct pvrdma_sq_wqe_hdr *wqe_hdr;
600601 struct pvrdma_sge *sge;
601− int i, index;
602− int nreq;
603− int ret;
602+ int i, ret;
604603
605604 /*
606605 * In states lower than RTS, we can fail immediately. In other states,
@@ -613,9 +612,8 @@ int pvrdma_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, · 6 unmodified lines
613612
614613 spin_lock_irqsave(&qp->sq.lock, flags);
615614
616− index = pvrdma_idx(&qp->sq.ring->prod_tail, qp->sq.wqe_cnt);
617− for (nreq = 0; wr; nreq++, wr = wr->next) {
618− unsigned int tail;
615+ while (wr) {
616+ unsigned int tail = 0;
619617
620618 if (unlikely(!pvrdma_idx_ring_has_space(
621619 qp->sq.ring, qp->sq.wqe_cnt, &tail))) {
@@ -680,7 +678,7 @@ int pvrdma_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, · 58 unmodified lines
680678 }
681679 }
682680
683− wqe_hdr = (struct pvrdma_sq_wqe_hdr *)get_sq_wqe(qp, index);
681+ wqe_hdr = (struct pvrdma_sq_wqe_hdr *)get_sq_wqe(qp, tail);
684682 memset(wqe_hdr, 0, sizeof(*wqe_hdr));
685683 wqe_hdr->wr_id = wr->wr_id;
686684 wqe_hdr->num_sge = wr->num_sge;
@@ -771,12 +769,11 @@ int pvrdma_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, · 84 unmodified lines
771769 /* Make sure wqe is written before index update */
772770 smp_wmb();
773771
774− index++;
775− if (unlikely(index >= qp->sq.wqe_cnt))
776− index = 0;
777772 /* Update shared sq ring */
778773 pvrdma_idx_ring_inc(&qp->sq.ring->prod_tail,
779774 qp->sq.wqe_cnt);
775+
776+ wr = wr->next;
780777 }
781778
782779 ret = 0;
@@ -806,7 +803,6 @@ int pvrdma_post_recv(struct ib_qp *ibqp, struct ib_recv_wr *wr, · 23 unmodified lines
806803 struct pvrdma_qp *qp = to_vqp(ibqp);
807804 struct pvrdma_rq_wqe_hdr *wqe_hdr;
808805 struct pvrdma_sge *sge;
809− int index, nreq;
810806 int ret = 0;
811807 int i;
812808
@@ -821,9 +817,8 @@ int pvrdma_post_recv(struct ib_qp *ibqp, struct ib_recv_wr *wr, · 8 unmodified lines
821817
822818 spin_lock_irqsave(&qp->rq.lock, flags);
823819
824− index = pvrdma_idx(&qp->rq.ring->prod_tail, qp->rq.wqe_cnt);
825− for (nreq = 0; wr; nreq++, wr = wr->next) {
826− unsigned int tail;
820+ while (wr) {
821+ unsigned int tail = 0;
827822
828823 if (unlikely(wr->num_sge > qp->rq.max_sg ||
829824 wr->num_sge < 0)) {
@@ -843,7 +838,7 @@ int pvrdma_post_recv(struct ib_qp *ibqp, struct ib_recv_wr *wr, · 13 unmodified lines
843838 goto out;
844839 }
845840
846− wqe_hdr = (struct pvrdma_rq_wqe_hdr *)get_rq_wqe(qp, index);
841+ wqe_hdr = (struct pvrdma_rq_wqe_hdr *)get_rq_wqe(qp, tail);
847842 wqe_hdr->wr_id = wr->wr_id;
848843 wqe_hdr->num_sge = wr->num_sge;
849844 wqe_hdr->total_len = 0;
@@ -859,12 +854,11 @@ int pvrdma_post_recv(struct ib_qp *ibqp, struct ib_recv_wr *wr, · 9 unmodified lines
859854 /* Make sure wqe is written before index update */
860855 smp_wmb();
861856
862− index++;
863− if (unlikely(index >= qp->rq.wqe_cnt))
864− index = 0;
865857 /* Update shared rq ring */
866858 pvrdma_idx_ring_inc(&qp->rq.ring->prod_tail,
867859 qp->rq.wqe_cnt);
860+
861+ wr = wr->next;
868862 }
869863
870864 spin_unlock_irqrestore(&qp->rq.lock, flags);
drivers/infiniband/sw/rdmavt/mmap.c+2−2
@@ -170,9 +170,9 @@ struct rvt_mmap_info *rvt_create_mmap_info(struct rvt_dev_info *rdi, · 169 unmodified lines
170170
171171 spin_lock_irq(&rdi->mmap_offset_lock);
172172 if (rdi->mmap_offset == 0)
173− rdi->mmap_offset = PAGE_SIZE;
173+ rdi->mmap_offset = ALIGN(PAGE_SIZE, SHMLBA);
174174 ip->offset = rdi->mmap_offset;
175− rdi->mmap_offset += size;
175+ rdi->mmap_offset += ALIGN(size, SHMLBA);
176176 spin_unlock_irq(&rdi->mmap_offset_lock);
177177
178178 INIT_LIST_HEAD(&ip->pending_mmaps);
drivers/infiniband/sw/rxe/Kconfig+1−1
@@ -22,4 +22,4 @@ config RDMA_RXE · 21 unmodified lines
2222 To configure and work with soft-RoCE driver please use the
2323 following wiki page under "configure Soft-RoCE (RXE)" section:
2424
25− https://github.com/SoftRoCE/rxe-dev/wiki/rxe-dev:-Home
25+ https://github.com/linux-rdma/rdma-core/blob/master/Documentation/rxe.md
drivers/infiniband/sw/rxe/rxe_mmap.c+2−2
@@ -156,10 +156,10 @@ struct rxe_mmap_info *rxe_create_mmap_info(struct rxe_dev *rxe, · 155 unmodified lines
156156 spin_lock_bh(&rxe->mmap_offset_lock);
157157
158158 if (rxe->mmap_offset == 0)
159− rxe->mmap_offset = PAGE_SIZE;
159+ rxe->mmap_offset = ALIGN(PAGE_SIZE, SHMLBA);
160160
161161 ip->info.offset = rxe->mmap_offset;
162− rxe->mmap_offset += size;
162+ rxe->mmap_offset += ALIGN(size, SHMLBA);
163163
164164 spin_unlock_bh(&rxe->mmap_offset_lock);
165165
drivers/infiniband/sw/rxe/rxe_req.c+1−1
@@ -729,11 +729,11 @@ next_wqe: · 728 unmodified lines
729729 ret = rxe_xmit_packet(to_rdev(qp->ibqp.device), qp, &pkt, skb);
730730 if (ret) {
731731 qp->need_req_skb = 1;
732− kfree_skb(skb);
733732
734733 rollback_state(wqe, qp, &rollback_wqe, rollback_psn);
735734
736735 if (ret == -EAGAIN) {
736+ kfree_skb(skb);
737737 rxe_run_task(&qp->req.task, 1);
738738 goto exit;
739739 }
drivers/infiniband/sw/rxe/rxe_resp.c+4−5
@@ -813,18 +813,17 @@ static enum resp_states execute(struct rxe_qp *qp, struct rxe_pkt_info *pkt) · 812 unmodified lines
813813 WARN_ON_ONCE(1);
814814 }
815815
816− /* We successfully processed this new request. */
817− qp->resp.msn++;
818−
819816 /* next expected psn, read handles this separately */
820817 qp->resp.psn = (pkt->psn + 1) & BTH_PSN_MASK;
821818
822819 qp->resp.opcode = pkt->opcode;
823820 qp->resp.status = IB_WC_SUCCESS;
824821
825− if (pkt->mask & RXE_COMP_MASK)
822+ if (pkt->mask & RXE_COMP_MASK) {
823+ /* We successfully processed this new request. */
824+ qp->resp.msn++;
826825 return RESPST_COMPLETE;
827− else if (qp_type(qp) == IB_QPT_RC)
826+ } else if (qp_type(qp) == IB_QPT_RC)
828827 return RESPST_ACKNOWLEDGE;
829828 else
830829 return RESPST_CLEANUP;
drivers/infiniband/ulp/iser/iscsi_iser.h+2−0
@@ -430,6 +430,7 @@ struct iser_fr_desc { · 429 unmodified lines
430430 struct list_head list;
431431 struct iser_reg_resources rsc;
432432 struct iser_pi_context *pi_ctx;
433+ struct list_head all_list;
433434 };
434435
435436 /**
@@ -443,6 +444,7 @@ struct iser_fr_pool { · 7 unmodified lines
443444 struct list_head list;
444445 spinlock_t lock;
445446 int size;
447+ struct list_head all_list;
446448 };
447449
448450 /**
drivers/infiniband/ulp/iser/iser_verbs.c+5−3
@@ -362,6 +362,7 @@ int iser_alloc_fastreg_pool(struct ib_conn *ib_conn, · 361 unmodified lines
362362 int i, ret;
363363
364364 INIT_LIST_HEAD(&fr_pool->list);
365+ INIT_LIST_HEAD(&fr_pool->all_list);
365366 spin_lock_init(&fr_pool->lock);
366367 fr_pool->size = 0;
367368 for (i = 0; i < cmds_max; i++) {
@@ -373,6 +374,7 @@ int iser_alloc_fastreg_pool(struct ib_conn *ib_conn, · 5 unmodified lines
373374 }
374375
375376 list_add_tail(&desc->list, &fr_pool->list);
377+ list_add_tail(&desc->all_list, &fr_pool->all_list);
376378 fr_pool->size++;
377379 }
378380
@@ -392,13 +394,13 @@ void iser_free_fastreg_pool(struct ib_conn *ib_conn) · 13 unmodified lines
392394 struct iser_fr_desc *desc, *tmp;
393395 int i = 0;
394396
395− if (list_empty(&fr_pool->list))
397+ if (list_empty(&fr_pool->all_list))
396398 return;
397399
398400 iser_info("freeing conn %p fr pool\n", ib_conn);
399401
400− list_for_each_entry_safe(desc, tmp, &fr_pool->list, list) {
401− list_del(&desc->list);
402+ list_for_each_entry_safe(desc, tmp, &fr_pool->all_list, all_list) {
403+ list_del(&desc->all_list);
402404 iser_free_reg_res(&desc->rsc);
403405 if (desc->pi_ctx)
404406 iser_free_pi_ctx(desc->pi_ctx);
drivers/input/joystick/iforce/iforce-usb.c+3−0
@@ -141,6 +141,9 @@ static int iforce_usb_probe(struct usb_interface *intf, · 140 unmodified lines
141141
142142 interface = intf->cur_altsetting;
143143
144+ if (interface->desc.bNumEndpoints < 2)
145+ return -ENODEV;
146+
144147 epirq = &interface->endpoint[0].desc;
145148 epout = &interface->endpoint[1].desc;
146149
drivers/input/misc/cm109.c+4−0
@@ -700,6 +700,10 @@ static int cm109_usb_probe(struct usb_interface *intf, · 699 unmodified lines
700700 int error = -ENOMEM;
701701
702702 interface = intf->cur_altsetting;
703+
704+ if (interface->desc.bNumEndpoints < 1)
705+ return -ENODEV;
706+
703707 endpoint = &interface->endpoint[0].desc;
704708
705709 if (!usb_endpoint_is_int_in(endpoint))
drivers/input/misc/ims-pcu.c+4−0
@@ -1667,6 +1667,10 @@ static int ims_pcu_parse_cdc_data(struct usb_interface *intf, struct ims_pcu *pc · 1666 unmodified lines
16671667 return -EINVAL;
16681668
16691669 alt = pcu->ctrl_intf->cur_altsetting;
1670+
1671+ if (alt->desc.bNumEndpoints < 1)
1672+ return -ENODEV;
1673+
16701674 pcu->ep_ctrl = &alt->endpoint[0].desc;
16711675 pcu->max_ctrl_size = usb_endpoint_maxp(pcu->ep_ctrl);
16721676
drivers/input/misc/yealink.c+4−0
@@ -875,6 +875,10 @@ static int usb_probe(struct usb_interface *intf, const struct usb_device_id *id) · 874 unmodified lines
875875 int ret, pipe, i;
876876
877877 interface = intf->cur_altsetting;
878+
879+ if (interface->desc.bNumEndpoints < 1)
880+ return -ENODEV;
881+
878882 endpoint = &interface->endpoint[0].desc;
879883 if (!usb_endpoint_is_int_in(endpoint))
880884 return -ENODEV;
drivers/input/mouse/alps.c+52−20
@@ -1282,10 +1282,8 @@ static int alps_decode_ss4_v2(struct alps_fields *f, · 1281 unmodified lines
12821282 /* handle buttons */
12831283 if (pkt_id == SS4_PACKET_ID_STICK) {
12841284 f->ts_left = !!(SS4_BTN_V2(p) & 0x01);
1285− if (!(priv->flags & ALPS_BUTTONPAD)) {
1286− f->ts_right = !!(SS4_BTN_V2(p) & 0x02);
1287− f->ts_middle = !!(SS4_BTN_V2(p) & 0x04);
1288− }
1285+ f->ts_right = !!(SS4_BTN_V2(p) & 0x02);
1286+ f->ts_middle = !!(SS4_BTN_V2(p) & 0x04);
12891287 } else {
12901288 f->left = !!(SS4_BTN_V2(p) & 0x01);
12911289 if (!(priv->flags & ALPS_BUTTONPAD)) {
@@ -2462,14 +2460,34 @@ static int alps_update_device_area_ss4_v2(unsigned char otp[][4], · 1170 unmodified lines
24622460 int num_y_electrode;
24632461 int x_pitch, y_pitch, x_phys, y_phys;
24642462
2465− num_x_electrode = SS4_NUMSENSOR_XOFFSET + (otp[1][0] & 0x0F);
2466− num_y_electrode = SS4_NUMSENSOR_YOFFSET + ((otp[1][0] >> 4) & 0x0F);
2463+ if (IS_SS4PLUS_DEV(priv->dev_id)) {
2464+ num_x_electrode =
2465+ SS4PLUS_NUMSENSOR_XOFFSET + (otp[0][2] & 0x0F);
2466+ num_y_electrode =
2467+ SS4PLUS_NUMSENSOR_YOFFSET + ((otp[0][2] >> 4) & 0x0F);
2468+
2469+ priv->x_max =
2470+ (num_x_electrode - 1) * SS4PLUS_COUNT_PER_ELECTRODE;
2471+ priv->y_max =
2472+ (num_y_electrode - 1) * SS4PLUS_COUNT_PER_ELECTRODE;
24672473
2468− priv->x_max = (num_x_electrode - 1) * SS4_COUNT_PER_ELECTRODE;
2469− priv->y_max = (num_y_electrode - 1) * SS4_COUNT_PER_ELECTRODE;
2474+ x_pitch = (otp[0][1] & 0x0F) + SS4PLUS_MIN_PITCH_MM;
2475+ y_pitch = ((otp[0][1] >> 4) & 0x0F) + SS4PLUS_MIN_PITCH_MM;
24702476
2471− x_pitch = ((otp[1][2] >> 2) & 0x07) + SS4_MIN_PITCH_MM;
2472− y_pitch = ((otp[1][2] >> 5) & 0x07) + SS4_MIN_PITCH_MM;
2477+ } else {
2478+ num_x_electrode =
2479+ SS4_NUMSENSOR_XOFFSET + (otp[1][0] & 0x0F);
2480+ num_y_electrode =
2481+ SS4_NUMSENSOR_YOFFSET + ((otp[1][0] >> 4) & 0x0F);
2482+
2483+ priv->x_max =
2484+ (num_x_electrode - 1) * SS4_COUNT_PER_ELECTRODE;
2485+ priv->y_max =
2486+ (num_y_electrode - 1) * SS4_COUNT_PER_ELECTRODE;
2487+
2488+ x_pitch = ((otp[1][2] >> 2) & 0x07) + SS4_MIN_PITCH_MM;
2489+ y_pitch = ((otp[1][2] >> 5) & 0x07) + SS4_MIN_PITCH_MM;
2490+ }
24732491
24742492 x_phys = x_pitch * (num_x_electrode - 1); /* In 0.1 mm units */
24752493 y_phys = y_pitch * (num_y_electrode - 1); /* In 0.1 mm units */
@@ -2485,7 +2503,10 @@ static int alps_update_btn_info_ss4_v2(unsigned char otp[][4], · 9 unmodified lines
24852503 {
24862504 unsigned char is_btnless;
24872505
2488− is_btnless = (otp[1][1] >> 3) & 0x01;
2506+ if (IS_SS4PLUS_DEV(priv->dev_id))
2507+ is_btnless = (otp[1][0] >> 1) & 0x01;
2508+ else
2509+ is_btnless = (otp[1][1] >> 3) & 0x01;
24892510
24902511 if (is_btnless)
24912512 priv->flags |= ALPS_BUTTONPAD;
@@ -2493,6 +2514,21 @@ static int alps_update_btn_info_ss4_v2(unsigned char otp[][4], · 1 unmodified line
24932514 return 0;
24942515 }
24952516
2517+static int alps_update_dual_info_ss4_v2(unsigned char otp[][4],
2518+ struct alps_data *priv)
2519+{
2520+ bool is_dual = false;
2521+
2522+ if (IS_SS4PLUS_DEV(priv->dev_id))
2523+ is_dual = (otp[0][0] >> 4) & 0x01;
2524+
2525+ if (is_dual)
2526+ priv->flags |= ALPS_DUALPOINT |
2527+ ALPS_DUALPOINT_WITH_PRESSURE;
2528+
2529+ return 0;
2530+}
2531+
24962532 static int alps_set_defaults_ss4_v2(struct psmouse *psmouse,
24972533 struct alps_data *priv)
24982534 {
@@ -2508,6 +2544,8 @@ static int alps_set_defaults_ss4_v2(struct psmouse *psmouse, · 9 unmodified lines
25082544
25092545 alps_update_btn_info_ss4_v2(otp, priv);
25102546
2547+ alps_update_dual_info_ss4_v2(otp, priv);
2548+
25112549 return 0;
25122550 }
25132551
@@ -2753,10 +2791,6 @@ static int alps_set_protocol(struct psmouse *psmouse, · 239 unmodified lines
27532791 if (alps_set_defaults_ss4_v2(psmouse, priv))
27542792 return -EIO;
27552793
2756− if (priv->fw_ver[1] == 0x1)
2757− priv->flags |= ALPS_DUALPOINT |
2758− ALPS_DUALPOINT_WITH_PRESSURE;
2759−
27602794 break;
27612795 }
27622796
@@ -2827,10 +2861,7 @@ static int alps_identify(struct psmouse *psmouse, struct alps_data *priv) · 64 unmodified lines
28272861 ec[2] >= 0x90 && ec[2] <= 0x9d) {
28282862 protocol = &alps_v3_protocol_data;
28292863 } else if (e7[0] == 0x73 && e7[1] == 0x03 &&
2830− e7[2] == 0x14 && ec[1] == 0x02) {
2831− protocol = &alps_v8_protocol_data;
2832− } else if (e7[0] == 0x73 && e7[1] == 0x03 &&
2833− e7[2] == 0x28 && ec[1] == 0x01) {
2864+ (e7[2] == 0x14 || e7[2] == 0x28)) {
28342865 protocol = &alps_v8_protocol_data;
28352866 } else {
28362867 psmouse_dbg(psmouse,
@@ -2840,7 +2871,8 @@ static int alps_identify(struct psmouse *psmouse, struct alps_data *priv) · 3 unmodified lines
28402871 }
28412872
28422873 if (priv) {
2843− /* Save the Firmware version */
2874+ /* Save Device ID and Firmware version */
2875+ memcpy(priv->dev_id, e7, 3);
28442876 memcpy(priv->fw_ver, ec, 3);
28452877 error = alps_set_protocol(psmouse, priv, protocol);
28462878 if (error)
drivers/input/mouse/alps.h+11−0
@@ -54,6 +54,16 @@ enum SS4_PACKET_ID { · 53 unmodified lines
5454
5555 #define SS4_MASK_NORMAL_BUTTONS 0x07
5656
57+#define SS4PLUS_COUNT_PER_ELECTRODE 128
58+#define SS4PLUS_NUMSENSOR_XOFFSET 16
59+#define SS4PLUS_NUMSENSOR_YOFFSET 5
60+#define SS4PLUS_MIN_PITCH_MM 37
61+
62+#define IS_SS4PLUS_DEV(_b) (((_b[0]) == 0x73) && \
63+ ((_b[1]) == 0x03) && \
64+ ((_b[2]) == 0x28) \
65+ )
66+
5767 #define SS4_IS_IDLE_V2(_b) (((_b[0]) == 0x18) && \
5868 ((_b[1]) == 0x10) && \
5969 ((_b[2]) == 0x00) && \
@@ -283,6 +293,7 @@ struct alps_data { · 223 unmodified lines
283293 int addr_command;
284294 u16 proto_version;
285295 u8 byte0, mask0;
296+ u8 dev_id[3];
286297 u8 fw_ver[3];
287298 int flags;
288299 int x_max;
drivers/input/mouse/elan_i2c_core.c+11−9
@@ -218,17 +218,19 @@ static int elan_query_product(struct elan_tp_data *data) · 217 unmodified lines
218218
219219 static int elan_check_ASUS_special_fw(struct elan_tp_data *data)
220220 {
221− if (data->ic_type != 0x0E)
222− return false;
223−
224− switch (data->product_id) {
225− case 0x05 ... 0x07:
226− case 0x09:
227− case 0x13:
221+ if (data->ic_type == 0x0E) {
222+ switch (data->product_id) {
223+ case 0x05 ... 0x07:
224+ case 0x09:
225+ case 0x13:
226+ return true;
227+ }
228+ } else if (data->ic_type == 0x08 && data->product_id == 0x26) {
229+ /* ASUS EeeBook X205TA */
228230 return true;
229− default:
230− return false;
231231 }
232+
233+ return false;
232234 }
233235
234236 static int __elan_initialize(struct elan_tp_data *data)
drivers/input/rmi4/rmi_f30.c+4−0
@@ -170,6 +170,10 @@ static int rmi_f30_config(struct rmi_function *fn) · 169 unmodified lines
170170 rmi_get_platform_data(fn->rmi_dev);
171171 int error;
172172
173+ /* can happen if f30_data.disable is set */
174+ if (!f30)
175+ return 0;
176+
173177 if (pdata->f30_data.trackstick_buttons) {
174178 /* Try [re-]establish link to F03. */
175179 f30->f03 = rmi_find_function(fn->rmi_dev, 0x03);
drivers/input/serio/i8042-x86ia64io.h+14−0
@@ -119,6 +119,13 @@ static const struct dmi_system_id __initconst i8042_dmi_noloop_table[] = { · 118 unmodified lines
119119 DMI_MATCH(DMI_PRODUCT_VERSION, "DL760"),
120120 },
121121 },
122+ {
123+ /* Dell Embedded Box PC 3000 */
124+ .matches = {
125+ DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
126+ DMI_MATCH(DMI_PRODUCT_NAME, "Embedded Box PC 3000"),
127+ },
128+ },
122129 {
123130 /* OQO Model 01 */
124131 .matches = {
@@ -513,6 +520,13 @@ static const struct dmi_system_id __initconst i8042_dmi_nomux_table[] = { · 388 unmodified lines
513520 DMI_MATCH(DMI_PRODUCT_NAME, "IC4I"),
514521 },
515522 },
523+ {
524+ /* TUXEDO BU1406 */
525+ .matches = {
526+ DMI_MATCH(DMI_SYS_VENDOR, "Notebook"),
527+ DMI_MATCH(DMI_PRODUCT_NAME, "N24_25BU"),
528+ },
529+ },
516530 { }
517531 };
518532
drivers/input/tablet/hanwang.c+3−0
@@ -340,6 +340,9 @@ static int hanwang_probe(struct usb_interface *intf, const struct usb_device_id · 339 unmodified lines
340340 int error;
341341 int i;
342342
343+ if (intf->cur_altsetting->desc.bNumEndpoints < 1)
344+ return -ENODEV;
345+
343346 hanwang = kzalloc(sizeof(struct hanwang), GFP_KERNEL);
344347 input_dev = input_allocate_device();
345348 if (!hanwang || !input_dev) {
drivers/input/tablet/kbtab.c+3−0
@@ -122,6 +122,9 @@ static int kbtab_probe(struct usb_interface *intf, const struct usb_device_id *i · 121 unmodified lines
122122 struct input_dev *input_dev;
123123 int error = -ENOMEM;
124124
125+ if (intf->cur_altsetting->desc.bNumEndpoints < 1)
126+ return -ENODEV;
127+
125128 kbtab = kzalloc(sizeof(struct kbtab), GFP_KERNEL);
126129 input_dev = input_allocate_device();
127130 if (!kbtab || !input_dev)
drivers/input/touchscreen/sur40.c+3−0
@@ -527,6 +527,9 @@ static int sur40_probe(struct usb_interface *interface, · 526 unmodified lines
527527 if (iface_desc->desc.bInterfaceClass != 0xFF)
528528 return -ENODEV;
529529
530+ if (iface_desc->desc.bNumEndpoints < 5)
531+ return -ENODEV;
532+
530533 /* Use endpoint #4 (0x86). */
531534 endpoint = &iface_desc->endpoint[4].desc;
532535 if (endpoint->bEndpointAddress != TOUCH_ENDPOINT)
drivers/iommu/amd_iommu.c+1−1
@@ -3202,7 +3202,7 @@ static void amd_iommu_get_resv_regions(struct device *dev, · 3201 unmodified lines
32023202
32033203 region = iommu_alloc_resv_region(MSI_RANGE_START,
32043204 MSI_RANGE_END - MSI_RANGE_START + 1,
3205− 0, IOMMU_RESV_RESERVED);
3205+ 0, IOMMU_RESV_MSI);
32063206 if (!region)
32073207 return;
32083208 list_add_tail(&region->list, head);
drivers/iommu/arm-smmu-v3.c+1−1
@@ -1888,7 +1888,7 @@ static void arm_smmu_get_resv_regions(struct device *dev, · 1887 unmodified lines
18881888 int prot = IOMMU_WRITE | IOMMU_NOEXEC | IOMMU_MMIO;
18891889
18901890 region = iommu_alloc_resv_region(MSI_IOVA_BASE, MSI_IOVA_LENGTH,
1891− prot, IOMMU_RESV_MSI);
1891+ prot, IOMMU_RESV_SW_MSI);
18921892 if (!region)
18931893 return;
18941894
drivers/iommu/arm-smmu.c+1−1
@@ -1608,7 +1608,7 @@ static void arm_smmu_get_resv_regions(struct device *dev, · 1607 unmodified lines
16081608 int prot = IOMMU_WRITE | IOMMU_NOEXEC | IOMMU_MMIO;
16091609
16101610 region = iommu_alloc_resv_region(MSI_IOVA_BASE, MSI_IOVA_LENGTH,
1611− prot, IOMMU_RESV_MSI);
1611+ prot, IOMMU_RESV_SW_MSI);
16121612 if (!region)
16131613 return;
16141614
drivers/iommu/exynos-iommu.c+7−1
@@ -512,7 +512,13 @@ static void sysmmu_tlb_invalidate_flpdcache(struct sysmmu_drvdata *data, · 511 unmodified lines
512512 spin_lock_irqsave(&data->lock, flags);
513513 if (data->active && data->version >= MAKE_MMU_VER(3, 3)) {
514514 clk_enable(data->clk_master);
515− __sysmmu_tlb_invalidate_entry(data, iova, 1);
515+ if (sysmmu_block(data)) {
516+ if (data->version >= MAKE_MMU_VER(5, 0))
517+ __sysmmu_tlb_invalidate(data);
518+ else
519+ __sysmmu_tlb_invalidate_entry(data, iova, 1);
520+ sysmmu_unblock(data);
521+ }
516522 clk_disable(data->clk_master);
517523 }
518524 spin_unlock_irqrestore(&data->lock, flags);
drivers/iommu/intel-iommu.c+2−2
@@ -916,7 +916,7 @@ static struct intel_iommu *device_to_iommu(struct device *dev, u8 *bus, u8 *devf · 915 unmodified lines
916916 * which we used for the IOMMU lookup. Strictly speaking
917917 * we could do this for all PCI devices; we only need to
918918 * get the BDF# from the scope table for ACPI matches. */
919− if (pdev->is_virtfn)
919+ if (pdev && pdev->is_virtfn)
920920 goto got_pdev;
921921
922922 *bus = drhd->devices[i].bus;
@@ -5249,7 +5249,7 @@ static void intel_iommu_get_resv_regions(struct device *device, · 4326 unmodified lines
52495249
52505250 reg = iommu_alloc_resv_region(IOAPIC_RANGE_START,
52515251 IOAPIC_RANGE_END - IOAPIC_RANGE_START + 1,
5252− 0, IOMMU_RESV_RESERVED);
5252+ 0, IOMMU_RESV_MSI);
52535253 if (!reg)
52545254 return;
52555255 list_add_tail(&reg->list, head);
drivers/iommu/io-pgtable-arm-v7s.c+5−1
@@ -422,8 +422,12 @@ static int __arm_v7s_map(struct arm_v7s_io_pgtable *data, unsigned long iova, · 421 unmodified lines
422422 pte |= ARM_V7S_ATTR_NS_TABLE;
423423
424424 __arm_v7s_set_pte(ptep, pte, 1, cfg);
425− } else {
425+ } else if (ARM_V7S_PTE_IS_TABLE(pte, lvl)) {
426426 cptep = iopte_deref(pte, lvl);
427+ } else {
428+ /* We require an unmap first */
429+ WARN_ON(!selftest_running);
430+ return -EEXIST;
427431 }
428432
429433 /* Rinse, repeat */
drivers/iommu/io-pgtable-arm.c+5−1
@@ -335,8 +335,12 @@ static int __arm_lpae_map(struct arm_lpae_io_pgtable *data, unsigned long iova, · 334 unmodified lines
335335 if (cfg->quirks & IO_PGTABLE_QUIRK_ARM_NS)
336336 pte |= ARM_LPAE_PTE_NSTABLE;
337337 __arm_lpae_set_pte(ptep, pte, cfg);
338− } else {
338+ } else if (!iopte_leaf(pte, lvl)) {
339339 cptep = iopte_deref(pte, data);
340+ } else {
341+ /* We require an unmap first */
342+ WARN_ON(!selftest_running);
343+ return -EEXIST;
340344 }
341345
342346 /* Rinse, repeat */
drivers/iommu/iommu.c+3−2
@@ -72,6 +72,7 @@ static const char * const iommu_group_resv_type_string[] = { · 71 unmodified lines
7272 [IOMMU_RESV_DIRECT] = "direct",
7373 [IOMMU_RESV_RESERVED] = "reserved",
7474 [IOMMU_RESV_MSI] = "msi",
75+ [IOMMU_RESV_SW_MSI] = "msi",
7576 };
7677
7778 #define IOMMU_GROUP_ATTR(_name, _mode, _show, _store) \
@@ -1743,8 +1744,8 @@ void iommu_put_resv_regions(struct device *dev, struct list_head *list) · 1665 unmodified lines
17431744 }
17441745
17451746 struct iommu_resv_region *iommu_alloc_resv_region(phys_addr_t start,
1746− size_t length,
1747− int prot, int type)
1747+ size_t length, int prot,
1748+ enum iommu_resv_type type)
17481749 {
17491750 struct iommu_resv_region *region;
17501751
drivers/isdn/gigaset/bas-gigaset.c+3−0
@@ -2317,6 +2317,9 @@ static int gigaset_probe(struct usb_interface *interface, · 2316 unmodified lines
23172317 return -ENODEV;
23182318 }
23192319
2320+ if (hostif->desc.bNumEndpoints < 1)
2321+ return -ENODEV;
2322+
23202323 dev_info(&udev->dev,
23212324 "%s: Device matched (Vendor: 0x%x, Product: 0x%x)\n",
23222325 __func__, le16_to_cpu(udev->descriptor.idVendor),
drivers/macintosh/macio_asic.c+1−0
@@ -392,6 +392,7 @@ static struct macio_dev * macio_add_one_device(struct macio_chip *chip, · 391 unmodified lines
392392 * To get all the fields, copy all archdata
393393 */
394394 dev->ofdev.dev.archdata = chip->lbus.pdev->dev.archdata;
395+ dev->ofdev.dev.dma_ops = chip->lbus.pdev->dev.dma_ops;
395396 #endif /* CONFIG_PCI */
396397
397398 #ifdef DEBUG
drivers/md/dm.c+16−13
@@ -989,26 +989,29 @@ static void flush_current_bio_list(struct blk_plug_cb *cb, bool from_schedule) · 988 unmodified lines
989989 struct dm_offload *o = container_of(cb, struct dm_offload, cb);
990990 struct bio_list list;
991991 struct bio *bio;
992+ int i;
992993
993994 INIT_LIST_HEAD(&o->cb.list);
994995
995996 if (unlikely(!current->bio_list))
996997 return;
997998
998− list = *current->bio_list;
999− bio_list_init(current->bio_list);
1000−
1001− while ((bio = bio_list_pop(&list))) {
1002− struct bio_set *bs = bio->bi_pool;
1003− if (unlikely(!bs) || bs == fs_bio_set) {
1004− bio_list_add(current->bio_list, bio);
1005− continue;
999+ for (i = 0; i < 2; i++) {
1000+ list = current->bio_list[i];
1001+ bio_list_init(&current->bio_list[i]);
1002+
1003+ while ((bio = bio_list_pop(&list))) {
1004+ struct bio_set *bs = bio->bi_pool;
1005+ if (unlikely(!bs) || bs == fs_bio_set) {
1006+ bio_list_add(&current->bio_list[i], bio);
1007+ continue;
1008+ }
1009+
1010+ spin_lock(&bs->rescue_lock);
1011+ bio_list_add(&bs->rescue_list, bio);
1012+ queue_work(bs->rescue_workqueue, &bs->rescue_work);
1013+ spin_unlock(&bs->rescue_lock);
10061014 }
1007−
1008− spin_lock(&bs->rescue_lock);
1009− bio_list_add(&bs->rescue_list, bio);
1010− queue_work(bs->rescue_workqueue, &bs->rescue_work);
1011− spin_unlock(&bs->rescue_lock);
10121015 }
10131016 }
10141017
drivers/md/md-cluster.c+1−1
@@ -777,7 +777,6 @@ static int gather_all_resync_info(struct mddev *mddev, int total_slots) · 776 unmodified lines
777777 bm_lockres->flags |= DLM_LKF_NOQUEUE;
778778 ret = dlm_lock_sync(bm_lockres, DLM_LOCK_PW);
779779 if (ret == -EAGAIN) {
780− memset(bm_lockres->lksb.sb_lvbptr, '\0', LVB_SIZE);
781780 s = read_resync_info(mddev, bm_lockres);
782781 if (s) {
783782 pr_info("%s:%d Resync[%llu..%llu] in progress on %d\n",
@@ -974,6 +973,7 @@ static int leave(struct mddev *mddev) · 190 unmodified lines
974973 lockres_free(cinfo->bitmap_lockres);
975974 unlock_all_bitmaps(mddev);
976975 dlm_release_lockspace(cinfo->lockspace, 2);
976+ kfree(cinfo);
977977 return 0;
978978 }
979979
drivers/md/md.c+11−16
@@ -440,14 +440,6 @@ void md_flush_request(struct mddev *mddev, struct bio *bio) · 439 unmodified lines
440440 }
441441 EXPORT_SYMBOL(md_flush_request);
442442
443−void md_unplug(struct blk_plug_cb *cb, bool from_schedule)
444−{
445− struct mddev *mddev = cb->data;
446− md_wakeup_thread(mddev->thread);
447− kfree(cb);
448−}
449−EXPORT_SYMBOL(md_unplug);
450−
451443 static inline struct mddev *mddev_get(struct mddev *mddev)
452444 {
453445 atomic_inc(&mddev->active);
@@ -1887,7 +1879,7 @@ super_1_rdev_size_change(struct md_rdev *rdev, sector_t num_sectors) · 1433 unmodified lines
18871879 }
18881880 sb = page_address(rdev->sb_page);
18891881 sb->data_size = cpu_to_le64(num_sectors);
1890− sb->super_offset = rdev->sb_start;
1882+ sb->super_offset = cpu_to_le64(rdev->sb_start);
18911883 sb->sb_csum = calc_sb_1_csum(sb);
18921884 do {
18931885 md_super_write(rdev->mddev, rdev, rdev->sb_start, rdev->sb_size,
@@ -2295,7 +2287,7 @@ static bool does_sb_need_changing(struct mddev *mddev) · 401 unmodified lines
22952287 /* Check if any mddev parameters have changed */
22962288 if ((mddev->dev_sectors != le64_to_cpu(sb->size)) ||
22972289 (mddev->reshape_position != le64_to_cpu(sb->reshape_position)) ||
2298− (mddev->layout != le64_to_cpu(sb->layout)) ||
2290+ (mddev->layout != le32_to_cpu(sb->layout)) ||
22992291 (mddev->raid_disks != le32_to_cpu(sb->raid_disks)) ||
23002292 (mddev->chunk_sectors != le32_to_cpu(sb->chunksize)))
23012293 return true;
@@ -6458,11 +6450,10 @@ static int set_array_info(struct mddev *mddev, mdu_array_info_t *info) · 4156 unmodified lines
64586450 mddev->layout = info->layout;
64596451 mddev->chunk_sectors = info->chunk_size >> 9;
64606452
6461− mddev->max_disks = MD_SB_DISKS;
6462−
64636453 if (mddev->persistent) {
6464− mddev->flags = 0;
6465− mddev->sb_flags = 0;
6454+ mddev->max_disks = MD_SB_DISKS;
6455+ mddev->flags = 0;
6456+ mddev->sb_flags = 0;
64666457 }
64676458 set_bit(MD_SB_CHANGE_DEVS, &mddev->sb_flags);
64686459
@@ -6533,8 +6524,12 @@ static int update_size(struct mddev *mddev, sector_t num_sectors) · 64 unmodified lines
65336524 return -ENOSPC;
65346525 }
65356526 rv = mddev->pers->resize(mddev, num_sectors);
6536− if (!rv)
6537− revalidate_disk(mddev->gendisk);
6527+ if (!rv) {
6528+ if (mddev->queue) {
6529+ set_capacity(mddev->gendisk, mddev->array_sectors);
6530+ revalidate_disk(mddev->gendisk);
6531+ }
6532+ }
65386533 return rv;
65396534 }
65406535
drivers/md/md.h+0−6
@@ -676,16 +676,10 @@ extern void mddev_resume(struct mddev *mddev); · 675 unmodified lines
676676 extern struct bio *bio_alloc_mddev(gfp_t gfp_mask, int nr_iovecs,
677677 struct mddev *mddev);
678678
679−extern void md_unplug(struct blk_plug_cb *cb, bool from_schedule);
680679 extern void md_reload_sb(struct mddev *mddev, int raid_disk);
681680 extern void md_update_sb(struct mddev *mddev, int force);
682681 extern void md_kick_rdev_from_array(struct md_rdev * rdev);
683682 struct md_rdev *md_find_rdev_nr_rcu(struct mddev *mddev, int nr);
684−static inline int mddev_check_plugged(struct mddev *mddev)
685−{
686− return !!blk_check_plugged(md_unplug, mddev,
687− sizeof(struct blk_plug_cb));
688−}
689683
690684 static inline void rdev_dec_pending(struct md_rdev *rdev, struct mddev *mddev)
691685 {
drivers/md/raid1.c+24−5
@@ -1027,7 +1027,7 @@ static int get_unqueued_pending(struct r1conf *conf) · 1026 unmodified lines
10271027 static void freeze_array(struct r1conf *conf, int extra)
10281028 {
10291029 /* Stop sync I/O and normal I/O and wait for everything to
1030− * go quite.
1030+ * go quiet.
10311031 * This is called in two situations:
10321032 * 1) management command handlers (reshape, remove disk, quiesce).
10331033 * 2) one normal I/O request failed.
@@ -1587,9 +1587,30 @@ static void raid1_make_request(struct mddev *mddev, struct bio *bio) · 553 unmodified lines
15871587 split = bio;
15881588 }
15891589
1590− if (bio_data_dir(split) == READ)
1590+ if (bio_data_dir(split) == READ) {
15911591 raid1_read_request(mddev, split);
1592− else
1592+
1593+ /*
1594+ * If a bio is splitted, the first part of bio will
1595+ * pass barrier but the bio is queued in
1596+ * current->bio_list (see generic_make_request). If
1597+ * there is a raise_barrier() called here, the second
1598+ * part of bio can't pass barrier. But since the first
1599+ * part bio isn't dispatched to underlaying disks yet,
1600+ * the barrier is never released, hence raise_barrier
1601+ * will alays wait. We have a deadlock.
1602+ * Note, this only happens in read path. For write
1603+ * path, the first part of bio is dispatched in a
1604+ * schedule() call (because of blk plug) or offloaded
1605+ * to raid10d.
1606+ * Quitting from the function immediately can change
1607+ * the bio order queued in bio_list and avoid the deadlock.
1608+ */
1609+ if (split != bio) {
1610+ generic_make_request(bio);
1611+ break;
1612+ }
1613+ } else
15931614 raid1_write_request(mddev, split);
15941615 } while (split != bio);
15951616 }
@@ -3246,8 +3267,6 @@ static int raid1_resize(struct mddev *mddev, sector_t sectors) · 1650 unmodified lines
32463267 return ret;
32473268 }
32483269 md_set_array_sectors(mddev, newsize);
3249− set_capacity(mddev->gendisk, mddev->array_sectors);
3250− revalidate_disk(mddev->gendisk);
32513270 if (sectors > mddev->dev_sectors &&
32523271 mddev->recovery_cp > mddev->dev_sectors) {
32533272 mddev->recovery_cp = mddev->dev_sectors;
drivers/md/raid10.c+36−8
@@ -974,7 +974,8 @@ static void wait_barrier(struct r10conf *conf) · 973 unmodified lines
974974 !conf->barrier ||
975975 (atomic_read(&conf->nr_pending) &&
976976 current->bio_list &&
977− !bio_list_empty(current->bio_list)),
977+ (!bio_list_empty(&current->bio_list[0]) ||
978+ !bio_list_empty(&current->bio_list[1]))),
978979 conf->resync_lock);
979980 conf->nr_waiting--;
980981 if (!conf->nr_waiting)
@@ -1477,11 +1478,24 @@ retry_write: · 496 unmodified lines
14771478 mbio->bi_bdev = (void*)rdev;
14781479
14791480 atomic_inc(&r10_bio->remaining);
1481+
1482+ cb = blk_check_plugged(raid10_unplug, mddev,
1483+ sizeof(*plug));
1484+ if (cb)
1485+ plug = container_of(cb, struct raid10_plug_cb,
1486+ cb);
1487+ else
1488+ plug = NULL;
14801489 spin_lock_irqsave(&conf->device_lock, flags);
1481− bio_list_add(&conf->pending_bio_list, mbio);
1482− conf->pending_count++;
1490+ if (plug) {
1491+ bio_list_add(&plug->pending, mbio);
1492+ plug->pending_cnt++;
1493+ } else {
1494+ bio_list_add(&conf->pending_bio_list, mbio);
1495+ conf->pending_count++;
1496+ }
14831497 spin_unlock_irqrestore(&conf->device_lock, flags);
1484− if (!mddev_check_plugged(mddev))
1498+ if (!plug)
14851499 md_wakeup_thread(mddev->thread);
14861500 }
14871501 }
@@ -1571,7 +1585,25 @@ static void raid10_make_request(struct mddev *mddev, struct bio *bio) · 83 unmodified lines
15711585 split = bio;
15721586 }
15731587
1588+ /*
1589+ * If a bio is splitted, the first part of bio will pass
1590+ * barrier but the bio is queued in current->bio_list (see
1591+ * generic_make_request). If there is a raise_barrier() called
1592+ * here, the second part of bio can't pass barrier. But since
1593+ * the first part bio isn't dispatched to underlaying disks
1594+ * yet, the barrier is never released, hence raise_barrier will
1595+ * alays wait. We have a deadlock.
1596+ * Note, this only happens in read path. For write path, the
1597+ * first part of bio is dispatched in a schedule() call
1598+ * (because of blk plug) or offloaded to raid10d.
1599+ * Quitting from the function immediately can change the bio
1600+ * order queued in bio_list and avoid the deadlock.
1601+ */
15741602 __make_request(mddev, split);
1603+ if (split != bio && bio_data_dir(bio) == READ) {
1604+ generic_make_request(bio);
1605+ break;
1606+ }
15751607 } while (split != bio);
15761608
15771609 /* In case raid10d snuck in to freeze_array */
@@ -3943,10 +3975,6 @@ static int raid10_resize(struct mddev *mddev, sector_t sectors) · 2365 unmodified lines
39433975 return ret;
39443976 }
39453977 md_set_array_sectors(mddev, size);
3946− if (mddev->queue) {
3947− set_capacity(mddev->gendisk, mddev->array_sectors);
3948− revalidate_disk(mddev->gendisk);
3949− }
39503978 if (sectors > mddev->dev_sectors &&
39513979 mddev->recovery_cp > oldsize) {
39523980 mddev->recovery_cp = oldsize;
drivers/md/raid5.c+2−3
@@ -1401,7 +1401,8 @@ static int set_syndrome_sources(struct page **srcs, · 1400 unmodified lines
14011401 (test_bit(R5_Wantdrain, &dev->flags) ||
14021402 test_bit(R5_InJournal, &dev->flags))) ||
14031403 (srctype == SYNDROME_SRC_WRITTEN &&
1404− dev->written)) {
1404+ (dev->written ||
1405+ test_bit(R5_InJournal, &dev->flags)))) {
14051406 if (test_bit(R5_InJournal, &dev->flags))
14061407 srcs[slot] = sh->dev[i].orig_page;
14071408 else
@@ -7605,8 +7606,6 @@ static int raid5_resize(struct mddev *mddev, sector_t sectors) · 6197 unmodified lines
76057606 return ret;
76067607 }
76077608 md_set_array_sectors(mddev, newsize);
7608− set_capacity(mddev->gendisk, mddev->array_sectors);
7609− revalidate_disk(mddev->gendisk);
76107609 if (sectors > mddev->dev_sectors &&
76117610 mddev->recovery_cp > mddev->dev_sectors) {
76127611 mddev->recovery_cp = mddev->dev_sectors;
drivers/media/platform/coda/imx-vdoa.c+1−1
@@ -321,7 +321,7 @@ static const struct of_device_id vdoa_dt_ids[] = { · 320 unmodified lines
321321 };
322322 MODULE_DEVICE_TABLE(of, vdoa_dt_ids);
323323
324−static const struct platform_driver vdoa_driver = {
324+static struct platform_driver vdoa_driver = {
325325 .probe = vdoa_probe,
326326 .remove = vdoa_remove,
327327 .driver = {
drivers/media/platform/exynos-gsc/gsc-core.c+0−2
@@ -861,9 +861,7 @@ int gsc_prepare_addr(struct gsc_ctx *ctx, struct vb2_buffer *vb, · 860 unmodified lines
861861
862862 if ((frame->fmt->pixelformat == V4L2_PIX_FMT_VYUY) ||
863863 (frame->fmt->pixelformat == V4L2_PIX_FMT_YVYU) ||
864− (frame->fmt->pixelformat == V4L2_PIX_FMT_NV61) ||
865864 (frame->fmt->pixelformat == V4L2_PIX_FMT_YVU420) ||
866− (frame->fmt->pixelformat == V4L2_PIX_FMT_NV21) ||
867865 (frame->fmt->pixelformat == V4L2_PIX_FMT_YVU420M))
868866 swap(addr->cb, addr->cr);
869867
drivers/media/platform/sti/bdisp/bdisp-v4l2.c+1−1
@@ -632,8 +632,8 @@ static int bdisp_open(struct file *file) · 631 unmodified lines
632632
633633 error_ctrls:
634634 bdisp_ctrls_delete(ctx);
635−error_fh:
636635 v4l2_fh_del(&ctx->fh);
636+error_fh:
637637 v4l2_fh_exit(&ctx->fh);
638638 bdisp_hw_free_nodes(ctx);
639639 mem_ctx:
drivers/media/usb/dvb-usb/dvb-usb-firmware.c+12−10
@@ -36,16 +36,18 @@ static int usb_cypress_writemem(struct usb_device *udev,u16 addr,u8 *data, u8 le · 35 unmodified lines
3636 int usb_cypress_load_firmware(struct usb_device *udev, const struct firmware *fw, int type)
3737 {
3838 struct hexline *hx;
39− u8 reset;
40− int ret,pos=0;
39+ u8 *buf;
40+ int ret, pos = 0;
41+ u16 cpu_cs_register = cypress[type].cpu_cs_register;
4142
42− hx = kmalloc(sizeof(*hx), GFP_KERNEL);
43− if (!hx)
43+ buf = kmalloc(sizeof(*hx), GFP_KERNEL);
44+ if (!buf)
4445 return -ENOMEM;
46+ hx = (struct hexline *)buf;
4547
4648 /* stop the CPU */
47− reset = 1;
48− if ((ret = usb_cypress_writemem(udev,cypress[type].cpu_cs_register,&reset,1)) != 1)
49+ buf[0] = 1;
50+ if (usb_cypress_writemem(udev, cpu_cs_register, buf, 1) != 1)
4951 err("could not stop the USB controller CPU.");
5052
5153 while ((ret = dvb_usb_get_hexline(fw, hx, &pos)) > 0) {
@@ -61,21 +63,21 @@ int usb_cypress_load_firmware(struct usb_device *udev, const struct firmware *fw · 9 unmodified lines
6163 }
6264 if (ret < 0) {
6365 err("firmware download failed at %d with %d",pos,ret);
64− kfree(hx);
66+ kfree(buf);
6567 return ret;
6668 }
6769
6870 if (ret == 0) {
6971 /* restart the CPU */
70− reset = 0;
71− if (ret || usb_cypress_writemem(udev,cypress[type].cpu_cs_register,&reset,1) != 1) {
72+ buf[0] = 0;
73+ if (usb_cypress_writemem(udev, cpu_cs_register, buf, 1) != 1) {
7274 err("could not restart the USB controller CPU.");
7375 ret = -EINVAL;
7476 }
7577 } else
7678 ret = -EIO;
7779
78− kfree(hx);
80+ kfree(buf);
7981
8082 return ret;
8183 }
drivers/memory/omap-gpmc.c+1−3
@@ -1947,9 +1947,7 @@ static int gpmc_probe_onenand_child(struct platform_device *pdev, · 1946 unmodified lines
19471947 if (!of_property_read_u32(child, "dma-channel", &val))
19481948 gpmc_onenand_data->dma_channel = val;
19491949
1950− gpmc_onenand_init(gpmc_onenand_data);
1951−
1952− return 0;
1950+ return gpmc_onenand_init(gpmc_onenand_data);
19531951 }
19541952 #else
19551953 static int gpmc_probe_onenand_child(struct platform_device *pdev,
drivers/misc/cxl/pci.c+6−7
@@ -1792,15 +1792,14 @@ static pci_ers_result_t cxl_pci_error_detected(struct pci_dev *pdev, · 1791 unmodified lines
17921792
17931793 /* If we're permanently dead, give up. */
17941794 if (state == pci_channel_io_perm_failure) {
1795− /* Tell the AFU drivers; but we don't care what they
1796− * say, we're going away.
1797− */
17981795 for (i = 0; i < adapter->slices; i++) {
17991796 afu = adapter->afu[i];
1800− /* Only participate in EEH if we are on a virtual PHB */
1801− if (afu->phb == NULL)
1802− return PCI_ERS_RESULT_NONE;
1803− cxl_vphb_error_detected(afu, state);
1797+ /*
1798+ * Tell the AFU drivers; but we don't care what they
1799+ * say, we're going away.
1800+ */
1801+ if (afu->phb != NULL)
1802+ cxl_vphb_error_detected(afu, state);
18041803 }
18051804 return PCI_ERS_RESULT_DISCONNECT;
18061805 }
drivers/misc/mei/bus-fixup.c+2−12
@@ -112,11 +112,9 @@ struct mkhi_msg { · 111 unmodified lines
112112
113113 static int mei_osver(struct mei_cl_device *cldev)
114114 {
115− int ret;
116115 const size_t size = sizeof(struct mkhi_msg_hdr) +
117116 sizeof(struct mkhi_fwcaps) +
118117 sizeof(struct mei_os_ver);
119− size_t length = 8;
120118 char buf[size];
121119 struct mkhi_msg *req;
122120 struct mkhi_fwcaps *fwcaps;
@@ -137,15 +135,7 @@ static int mei_osver(struct mei_cl_device *cldev) · 14 unmodified lines
137135 os_ver = (struct mei_os_ver *)fwcaps->data;
138136 os_ver->os_type = OSTYPE_LINUX;
139137
140− ret = __mei_cl_send(cldev->cl, buf, size, mode);
141− if (ret < 0)
142− return ret;
143−
144− ret = __mei_cl_recv(cldev->cl, buf, length, 0);
145− if (ret < 0)
146− return ret;
147−
148− return 0;
138+ return __mei_cl_send(cldev->cl, buf, size, mode);
149139 }
150140
151141 static void mei_mkhi_fix(struct mei_cl_device *cldev)
@@ -160,7 +150,7 @@ static void mei_mkhi_fix(struct mei_cl_device *cldev) · 8 unmodified lines
160150 return;
161151
162152 ret = mei_osver(cldev);
163− if (ret)
153+ if (ret < 0)
164154 dev_err(&cldev->dev, "OS version command failed %d\n", ret);
165155
166156 mei_cldev_disable(cldev);
drivers/misc/mei/init.c+6−2
@@ -124,8 +124,6 @@ int mei_reset(struct mei_device *dev) · 123 unmodified lines
124124
125125 mei_clear_interrupts(dev);
126126
127− mei_synchronize_irq(dev);
128−
129127 /* we're already in reset, cancel the init timer
130128 * if the reset was called due the hbm protocol error
131129 * we need to call it before hw start
@@ -304,6 +302,9 @@ static void mei_reset_work(struct work_struct *work) · 172 unmodified lines
304302 container_of(work, struct mei_device, reset_work);
305303 int ret;
306304
305+ mei_clear_interrupts(dev);
306+ mei_synchronize_irq(dev);
307+
307308 mutex_lock(&dev->device_lock);
308309
309310 ret = mei_reset(dev);
@@ -328,6 +329,9 @@ void mei_stop(struct mei_device *dev) · 18 unmodified lines
328329
329330 mei_cancel_work(dev);
330331
332+ mei_clear_interrupts(dev);
333+ mei_synchronize_irq(dev);
334+
331335 mutex_lock(&dev->device_lock);
332336
333337 dev->dev_state = MEI_DEV_POWER_DOWN;
drivers/misc/vmw_vmci/vmci_guest.c+2−2
@@ -566,10 +566,10 @@ static int vmci_guest_probe_device(struct pci_dev *pdev, · 565 unmodified lines
566566 */
567567 error = pci_alloc_irq_vectors(pdev, VMCI_MAX_INTRS, VMCI_MAX_INTRS,
568568 PCI_IRQ_MSIX);
569− if (error) {
569+ if (error < 0) {
570570 error = pci_alloc_irq_vectors(pdev, 1, 1,
571571 PCI_IRQ_MSIX | PCI_IRQ_MSI | PCI_IRQ_LEGACY);
572− if (error)
572+ if (error < 0)
573573 goto err_remove_bitmap;
574574 } else {
575575 vmci_dev->exclusive_vectors = true;
drivers/mmc/core/block.c+3−4
@@ -1560,11 +1560,8 @@ static bool mmc_blk_rw_cmd_err(struct mmc_blk_data *md, struct mmc_card *card, · 1559 unmodified lines
15601560 struct mmc_blk_request *brq, struct request *req,
15611561 bool old_req_pending)
15621562 {
1563− struct mmc_queue_req *mq_rq;
15641563 bool req_pending;
15651564
1566− mq_rq = container_of(brq, struct mmc_queue_req, brq);
1567−
15681565 /*
15691566 * If this is an SD card and we're writing, we can first
15701567 * mark the known good sectors as ok.
@@ -1701,7 +1698,8 @@ static void mmc_blk_issue_rw_rq(struct mmc_queue *mq, struct request *new_req) · 130 unmodified lines
17011698 case MMC_BLK_CMD_ERR:
17021699 req_pending = mmc_blk_rw_cmd_err(md, card, brq, old_req, req_pending);
17031700 if (mmc_blk_reset(md, card->host, type)) {
1704− mmc_blk_rw_cmd_abort(card, old_req);
1701+ if (req_pending)
1702+ mmc_blk_rw_cmd_abort(card, old_req);
17051703 mmc_blk_rw_try_restart(mq, new_req);
17061704 return;
17071705 }
@@ -1817,6 +1815,7 @@ void mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req) · 109 unmodified lines
18171815 mmc_blk_issue_flush(mq, req);
18181816 } else {
18191817 mmc_blk_issue_rw_rq(mq, req);
1818+ card->host->context_info.is_waiting_last_req = false;
18201819 }
18211820
18221821 out:
drivers/mmc/core/mmc.c+1−1
@@ -1730,7 +1730,7 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr, · 1729 unmodified lines
17301730 err = mmc_select_hs400(card);
17311731 if (err)
17321732 goto free_card;
1733− } else {
1733+ } else if (!mmc_card_hs400es(card)) {
17341734 /* Select the desired bus width optionally */
17351735 err = mmc_select_bus_width(card);
17361736 if (err > 0 && mmc_card_hs(card)) {
drivers/mmc/host/mtk-sd.c+2−2
@@ -580,7 +580,7 @@ static void msdc_set_mclk(struct msdc_host *host, unsigned char timing, u32 hz) · 579 unmodified lines
580580 }
581581 }
582582 sdr_set_field(host->base + MSDC_CFG, MSDC_CFG_CKMOD | MSDC_CFG_CKDIV,
583− (mode << 8) | (div % 0xff));
583+ (mode << 8) | div);
584584 sdr_set_bits(host->base + MSDC_CFG, MSDC_CFG_CKPDN);
585585 while (!(readl(host->base + MSDC_CFG) & MSDC_CFG_CKSTB))
586586 cpu_relax();
@@ -1559,7 +1559,7 @@ static int msdc_drv_probe(struct platform_device *pdev) · 972 unmodified lines
15591559 host->src_clk_freq = clk_get_rate(host->src_clk);
15601560 /* Set host parameters to mmc */
15611561 mmc->ops = &mt_msdc_ops;
1562− mmc->f_min = host->src_clk_freq / (4 * 255);
1562+ mmc->f_min = DIV_ROUND_UP(host->src_clk_freq, 4 * 255);
15631563
15641564 mmc->caps |= MMC_CAP_ERASE | MMC_CAP_CMD23;
15651565 /* MMC core transfer sizes tunable parameters */
drivers/mmc/host/sdhci-of-arasan.c+5−9
@@ -28,13 +28,9 @@ · 27 unmodified lines
2828 #include "sdhci-pltfm.h"
2929 #include <linux/of.h>
3030
31−#define SDHCI_ARASAN_CLK_CTRL_OFFSET 0x2c
3231 #define SDHCI_ARASAN_VENDOR_REGISTER 0x78
3332
3433 #define VENDOR_ENHANCED_STROBE BIT(0)
35−#define CLK_CTRL_TIMEOUT_SHIFT 16
36−#define CLK_CTRL_TIMEOUT_MASK (0xf << CLK_CTRL_TIMEOUT_SHIFT)
37−#define CLK_CTRL_TIMEOUT_MIN_EXP 13
3834
3935 #define PHY_CLK_TOO_SLOW_HZ 400000
4036
@@ -163,15 +159,15 @@ static int sdhci_arasan_syscon_write(struct sdhci_host *host, · 122 unmodified lines
163159
164160 static unsigned int sdhci_arasan_get_timeout_clock(struct sdhci_host *host)
165161 {
166− u32 div;
167162 unsigned long freq;
168163 struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
169164
170− div = readl(host->ioaddr + SDHCI_ARASAN_CLK_CTRL_OFFSET);
171− div = (div & CLK_CTRL_TIMEOUT_MASK) >> CLK_CTRL_TIMEOUT_SHIFT;
165+ /* SDHCI timeout clock is in kHz */
166+ freq = DIV_ROUND_UP(clk_get_rate(pltfm_host->clk), 1000);
172167
173− freq = clk_get_rate(pltfm_host->clk);
174− freq /= 1 << (CLK_CTRL_TIMEOUT_MIN_EXP + div);
168+ /* or in MHz */
169+ if (host->caps & SDHCI_TIMEOUT_CLK_UNIT)
170+ freq = DIV_ROUND_UP(freq, 1000);
175171
176172 return freq;
177173 }
drivers/mmc/host/sdhci-of-at91.c+19−0
@@ -85,11 +85,30 @@ static void sdhci_at91_set_clock(struct sdhci_host *host, unsigned int clock) · 84 unmodified lines
8585 sdhci_writew(host, clk, SDHCI_CLOCK_CONTROL);
8686 }
8787
88+/*
89+ * In this specific implementation of the SDHCI controller, the power register
90+ * needs to have a valid voltage set even when the power supply is managed by
91+ * an external regulator.
92+ */
93+static void sdhci_at91_set_power(struct sdhci_host *host, unsigned char mode,
94+ unsigned short vdd)
95+{
96+ if (!IS_ERR(host->mmc->supply.vmmc)) {
97+ struct mmc_host *mmc = host->mmc;
98+
99+ spin_unlock_irq(&host->lock);
100+ mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd);
101+ spin_lock_irq(&host->lock);
102+ }
103+ sdhci_set_power_noreg(host, mode, vdd);
104+}
105+
88106 static const struct sdhci_ops sdhci_at91_sama5d2_ops = {
89107 .set_clock = sdhci_at91_set_clock,
90108 .set_bus_width = sdhci_set_bus_width,
91109 .reset = sdhci_reset,
92110 .set_uhs_signaling = sdhci_set_uhs_signaling,
111+ .set_power = sdhci_at91_set_power,
93112 };
94113
95114 static const struct sdhci_pltfm_data soc_data_sama5d2 = {
drivers/mmc/host/sdhci-pci-core.c+4−0
@@ -451,6 +451,8 @@ static void sdhci_intel_set_power(struct sdhci_host *host, unsigned char mode, · 450 unmodified lines
451451 if (mode == MMC_POWER_OFF)
452452 return;
453453
454+ spin_unlock_irq(&host->lock);
455+
454456 /*
455457 * Bus power might not enable after D3 -> D0 transition due to the
456458 * present state not yet having propagated. Retry for up to 2ms.
@@ -463,6 +465,8 @@ static void sdhci_intel_set_power(struct sdhci_host *host, unsigned char mode, · 6 unmodified lines
463465 reg |= SDHCI_POWER_ON;
464466 sdhci_writeb(host, reg, SDHCI_POWER_CONTROL);
465467 }
468+
469+ spin_lock_irq(&host->lock);
466470 }
467471
468472 static const struct sdhci_ops sdhci_intel_byt_ops = {
drivers/mmc/host/sdhci.c+3−1
@@ -1362,7 +1362,9 @@ void sdhci_enable_clk(struct sdhci_host *host, u16 clk) · 1361 unmodified lines
13621362 return;
13631363 }
13641364 timeout--;
1365− mdelay(1);
1365+ spin_unlock_irq(&host->lock);
1366+ usleep_range(900, 1100);
1367+ spin_lock_irq(&host->lock);
13661368 }
13671369
13681370 clk |= SDHCI_CLOCK_CARD_EN;
drivers/mmc/host/ushc.c+3−0
@@ -426,6 +426,9 @@ static int ushc_probe(struct usb_interface *intf, const struct usb_device_id *id · 425 unmodified lines
426426 struct ushc_data *ushc;
427427 int ret;
428428
429+ if (intf->cur_altsetting->desc.bNumEndpoints < 1)
430+ return -ENODEV;
431+
429432 mmc = mmc_alloc_host(sizeof(struct ushc_data), &intf->dev);
430433 if (mmc == NULL)
431434 return -ENOMEM;
drivers/net/ethernet/amd/xgbe/xgbe-common.h+16−14
@@ -984,29 +984,29 @@ · 983 unmodified lines
984984 #define XP_ECC_CNT1_DESC_DED_WIDTH 8
985985 #define XP_ECC_CNT1_DESC_SEC_INDEX 0
986986 #define XP_ECC_CNT1_DESC_SEC_WIDTH 8
987−#define XP_ECC_IER_DESC_DED_INDEX 0
987+#define XP_ECC_IER_DESC_DED_INDEX 5
988988 #define XP_ECC_IER_DESC_DED_WIDTH 1
989−#define XP_ECC_IER_DESC_SEC_INDEX 1
989+#define XP_ECC_IER_DESC_SEC_INDEX 4
990990 #define XP_ECC_IER_DESC_SEC_WIDTH 1
991−#define XP_ECC_IER_RX_DED_INDEX 2
991+#define XP_ECC_IER_RX_DED_INDEX 3
992992 #define XP_ECC_IER_RX_DED_WIDTH 1
993−#define XP_ECC_IER_RX_SEC_INDEX 3
993+#define XP_ECC_IER_RX_SEC_INDEX 2
994994 #define XP_ECC_IER_RX_SEC_WIDTH 1
995−#define XP_ECC_IER_TX_DED_INDEX 4
995+#define XP_ECC_IER_TX_DED_INDEX 1
996996 #define XP_ECC_IER_TX_DED_WIDTH 1
997−#define XP_ECC_IER_TX_SEC_INDEX 5
997+#define XP_ECC_IER_TX_SEC_INDEX 0
998998 #define XP_ECC_IER_TX_SEC_WIDTH 1
999−#define XP_ECC_ISR_DESC_DED_INDEX 0
999+#define XP_ECC_ISR_DESC_DED_INDEX 5
10001000 #define XP_ECC_ISR_DESC_DED_WIDTH 1
1001−#define XP_ECC_ISR_DESC_SEC_INDEX 1
1001+#define XP_ECC_ISR_DESC_SEC_INDEX 4
10021002 #define XP_ECC_ISR_DESC_SEC_WIDTH 1
1003−#define XP_ECC_ISR_RX_DED_INDEX 2
1003+#define XP_ECC_ISR_RX_DED_INDEX 3
10041004 #define XP_ECC_ISR_RX_DED_WIDTH 1
1005−#define XP_ECC_ISR_RX_SEC_INDEX 3
1005+#define XP_ECC_ISR_RX_SEC_INDEX 2
10061006 #define XP_ECC_ISR_RX_SEC_WIDTH 1
1007−#define XP_ECC_ISR_TX_DED_INDEX 4
1007+#define XP_ECC_ISR_TX_DED_INDEX 1
10081008 #define XP_ECC_ISR_TX_DED_WIDTH 1
1009−#define XP_ECC_ISR_TX_SEC_INDEX 5
1009+#define XP_ECC_ISR_TX_SEC_INDEX 0
10101010 #define XP_ECC_ISR_TX_SEC_WIDTH 1
10111011 #define XP_I2C_MUTEX_BUSY_INDEX 31
10121012 #define XP_I2C_MUTEX_BUSY_WIDTH 1
@@ -1148,8 +1148,8 @@ · 135 unmodified lines
11481148 #define RX_PACKET_ATTRIBUTES_CSUM_DONE_WIDTH 1
11491149 #define RX_PACKET_ATTRIBUTES_VLAN_CTAG_INDEX 1
11501150 #define RX_PACKET_ATTRIBUTES_VLAN_CTAG_WIDTH 1
1151−#define RX_PACKET_ATTRIBUTES_INCOMPLETE_INDEX 2
1152−#define RX_PACKET_ATTRIBUTES_INCOMPLETE_WIDTH 1
1151+#define RX_PACKET_ATTRIBUTES_LAST_INDEX 2
1152+#define RX_PACKET_ATTRIBUTES_LAST_WIDTH 1
11531153 #define RX_PACKET_ATTRIBUTES_CONTEXT_NEXT_INDEX 3
11541154 #define RX_PACKET_ATTRIBUTES_CONTEXT_NEXT_WIDTH 1
11551155 #define RX_PACKET_ATTRIBUTES_CONTEXT_INDEX 4
@@ -1158,6 +1158,8 @@ · 2 unmodified lines
11581158 #define RX_PACKET_ATTRIBUTES_RX_TSTAMP_WIDTH 1
11591159 #define RX_PACKET_ATTRIBUTES_RSS_HASH_INDEX 6
11601160 #define RX_PACKET_ATTRIBUTES_RSS_HASH_WIDTH 1
1161+#define RX_PACKET_ATTRIBUTES_FIRST_INDEX 7
1162+#define RX_PACKET_ATTRIBUTES_FIRST_WIDTH 1
11611163
11621164 #define RX_NORMAL_DESC0_OVT_INDEX 0
11631165 #define RX_NORMAL_DESC0_OVT_WIDTH 16
drivers/net/ethernet/amd/xgbe/xgbe-dev.c+11−9
@@ -1896,10 +1896,15 @@ static int xgbe_dev_read(struct xgbe_channel *channel) · 1895 unmodified lines
18961896
18971897 /* Get the header length */
18981898 if (XGMAC_GET_BITS_LE(rdesc->desc3, RX_NORMAL_DESC3, FD)) {
1899+ XGMAC_SET_BITS(packet->attributes, RX_PACKET_ATTRIBUTES,
1900+ FIRST, 1);
18991901 rdata->rx.hdr_len = XGMAC_GET_BITS_LE(rdesc->desc2,
19001902 RX_NORMAL_DESC2, HL);
19011903 if (rdata->rx.hdr_len)
19021904 pdata->ext_stats.rx_split_header_packets++;
1905+ } else {
1906+ XGMAC_SET_BITS(packet->attributes, RX_PACKET_ATTRIBUTES,
1907+ FIRST, 0);
19031908 }
19041909
19051910 /* Get the RSS hash */
@@ -1922,19 +1927,16 @@ static int xgbe_dev_read(struct xgbe_channel *channel) · 16 unmodified lines
19221927 }
19231928 }
19241929
1925− /* Get the packet length */
1926− rdata->rx.len = XGMAC_GET_BITS_LE(rdesc->desc3, RX_NORMAL_DESC3, PL);
1927−
1928− if (!XGMAC_GET_BITS_LE(rdesc->desc3, RX_NORMAL_DESC3, LD)) {
1929− /* Not all the data has been transferred for this packet */
1930− XGMAC_SET_BITS(packet->attributes, RX_PACKET_ATTRIBUTES,
1931− INCOMPLETE, 1);
1930+ /* Not all the data has been transferred for this packet */
1931+ if (!XGMAC_GET_BITS_LE(rdesc->desc3, RX_NORMAL_DESC3, LD))
19321932 return 0;
1933− }
19341933
19351934 /* This is the last of the data for this packet */
19361935 XGMAC_SET_BITS(packet->attributes, RX_PACKET_ATTRIBUTES,
1937− INCOMPLETE, 0);
1936+ LAST, 1);
1937+
1938+ /* Get the packet length */
1939+ rdata->rx.len = XGMAC_GET_BITS_LE(rdesc->desc3, RX_NORMAL_DESC3, PL);
19381940
19391941 /* Set checksum done indicator as appropriate */
19401942 if (netdev->features & NETIF_F_RXCSUM)
drivers/net/ethernet/amd/xgbe/xgbe-drv.c+65−47
@@ -1971,13 +1971,12 @@ static struct sk_buff *xgbe_create_skb(struct xgbe_prv_data *pdata, · 1970 unmodified lines
19711971 {
19721972 struct sk_buff *skb;
19731973 u8 *packet;
1974− unsigned int copy_len;
19751974
19761975 skb = napi_alloc_skb(napi, rdata->rx.hdr.dma_len);
19771976 if (!skb)
19781977 return NULL;
19791978
1980− /* Start with the header buffer which may contain just the header
1979+ /* Pull in the header buffer which may contain just the header
19811980 * or the header plus data
19821981 */
19831982 dma_sync_single_range_for_cpu(pdata->dev, rdata->rx.hdr.dma_base,
@@ -1986,30 +1985,49 @@ static struct sk_buff *xgbe_create_skb(struct xgbe_prv_data *pdata, · 2 unmodified lines
19861985
19871986 packet = page_address(rdata->rx.hdr.pa.pages) +
19881987 rdata->rx.hdr.pa.pages_offset;
1989− copy_len = (rdata->rx.hdr_len) ? rdata->rx.hdr_len : len;
1990− copy_len = min(rdata->rx.hdr.dma_len, copy_len);
1991− skb_copy_to_linear_data(skb, packet, copy_len);
1992− skb_put(skb, copy_len);
1993−
1994− len -= copy_len;
1995− if (len) {
1996− /* Add the remaining data as a frag */
1997− dma_sync_single_range_for_cpu(pdata->dev,
1998− rdata->rx.buf.dma_base,
1999− rdata->rx.buf.dma_off,
2000− rdata->rx.buf.dma_len,
2001− DMA_FROM_DEVICE);
2002−
2003− skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags,
2004− rdata->rx.buf.pa.pages,
2005− rdata->rx.buf.pa.pages_offset,
2006− len, rdata->rx.buf.dma_len);
2007− rdata->rx.buf.pa.pages = NULL;
2008− }
1988+ skb_copy_to_linear_data(skb, packet, len);
1989+ skb_put(skb, len);
20091990
20101991 return skb;
20111992 }
20121993
1994+static unsigned int xgbe_rx_buf1_len(struct xgbe_ring_data *rdata,
1995+ struct xgbe_packet_data *packet)
1996+{
1997+ /* Always zero if not the first descriptor */
1998+ if (!XGMAC_GET_BITS(packet->attributes, RX_PACKET_ATTRIBUTES, FIRST))
1999+ return 0;
2000+
2001+ /* First descriptor with split header, return header length */
2002+ if (rdata->rx.hdr_len)
2003+ return rdata->rx.hdr_len;
2004+
2005+ /* First descriptor but not the last descriptor and no split header,
2006+ * so the full buffer was used
2007+ */
2008+ if (!XGMAC_GET_BITS(packet->attributes, RX_PACKET_ATTRIBUTES, LAST))
2009+ return rdata->rx.hdr.dma_len;
2010+
2011+ /* First descriptor and last descriptor and no split header, so
2012+ * calculate how much of the buffer was used
2013+ */
2014+ return min_t(unsigned int, rdata->rx.hdr.dma_len, rdata->rx.len);
2015+}
2016+
2017+static unsigned int xgbe_rx_buf2_len(struct xgbe_ring_data *rdata,
2018+ struct xgbe_packet_data *packet,
2019+ unsigned int len)
2020+{
2021+ /* Always the full buffer if not the last descriptor */
2022+ if (!XGMAC_GET_BITS(packet->attributes, RX_PACKET_ATTRIBUTES, LAST))
2023+ return rdata->rx.buf.dma_len;
2024+
2025+ /* Last descriptor so calculate how much of the buffer was used
2026+ * for the last bit of data
2027+ */
2028+ return rdata->rx.len - len;
2029+}
2030+
20132031 static int xgbe_tx_poll(struct xgbe_channel *channel)
20142032 {
20152033 struct xgbe_prv_data *pdata = channel->pdata;
@@ -2092,8 +2110,8 @@ static int xgbe_rx_poll(struct xgbe_channel *channel, int budget) · 76 unmodified lines
20922110 struct napi_struct *napi;
20932111 struct sk_buff *skb;
20942112 struct skb_shared_hwtstamps *hwtstamps;
2095− unsigned int incomplete, error, context_next, context;
2096− unsigned int len, rdesc_len, max_len;
2113+ unsigned int last, error, context_next, context;
2114+ unsigned int len, buf1_len, buf2_len, max_len;
20972115 unsigned int received = 0;
20982116 int packet_count = 0;
20992117
@@ -2103,7 +2121,7 @@ static int xgbe_rx_poll(struct xgbe_channel *channel, int budget) · 3 unmodified lines
21032121 if (!ring)
21042122 return 0;
21052123
2106− incomplete = 0;
2124+ last = 0;
21072125 context_next = 0;
21082126
21092127 napi = (pdata->per_channel_irq) ? &channel->napi : &pdata->napi;
@@ -2137,9 +2155,8 @@ read_again: · 27 unmodified lines
21372155 received++;
21382156 ring->cur++;
21392157
2140− incomplete = XGMAC_GET_BITS(packet->attributes,
2141− RX_PACKET_ATTRIBUTES,
2142− INCOMPLETE);
2158+ last = XGMAC_GET_BITS(packet->attributes, RX_PACKET_ATTRIBUTES,
2159+ LAST);
21432160 context_next = XGMAC_GET_BITS(packet->attributes,
21442161 RX_PACKET_ATTRIBUTES,
21452162 CONTEXT_NEXT);
@@ -2148,7 +2165,7 @@ read_again: · 2 unmodified lines
21482165 CONTEXT);
21492166
21502167 /* Earlier error, just drain the remaining data */
2151− if ((incomplete || context_next) && error)
2168+ if ((!last || context_next) && error)
21522169 goto read_again;
21532170
21542171 if (error || packet->errors) {
@@ -2160,16 +2177,22 @@ read_again: · 5 unmodified lines
21602177 }
21612178
21622179 if (!context) {
2163− /* Length is cumulative, get this descriptor's length */
2164− rdesc_len = rdata->rx.len - len;
2165− len += rdesc_len;
2180+ /* Get the data length in the descriptor buffers */
2181+ buf1_len = xgbe_rx_buf1_len(rdata, packet);
2182+ len += buf1_len;
2183+ buf2_len = xgbe_rx_buf2_len(rdata, packet, len);
2184+ len += buf2_len;
21662185
2167− if (rdesc_len && !skb) {
2186+ if (!skb) {
21682187 skb = xgbe_create_skb(pdata, napi, rdata,
2169− rdesc_len);
2170− if (!skb)
2188+ buf1_len);
2189+ if (!skb) {
21712190 error = 1;
2172− } else if (rdesc_len) {
2191+ goto skip_data;
2192+ }
2193+ }
2194+
2195+ if (buf2_len) {
21732196 dma_sync_single_range_for_cpu(pdata->dev,
21742197 rdata->rx.buf.dma_base,
21752198 rdata->rx.buf.dma_off,
@@ -2179,13 +2202,14 @@ read_again: · 3 unmodified lines
21792202 skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags,
21802203 rdata->rx.buf.pa.pages,
21812204 rdata->rx.buf.pa.pages_offset,
2182− rdesc_len,
2205+ buf2_len,
21832206 rdata->rx.buf.dma_len);
21842207 rdata->rx.buf.pa.pages = NULL;
21852208 }
21862209 }
21872210
2188− if (incomplete || context_next)
2211+skip_data:
2212+ if (!last || context_next)
21892213 goto read_again;
21902214
21912215 if (!skb)
@@ -2243,7 +2267,7 @@ next_packet: · 51 unmodified lines
22432267 }
22442268
22452269 /* Check if we need to save state before leaving */
2246− if (received && (incomplete || context_next)) {
2270+ if (received && (!last || context_next)) {
22472271 rdata = XGBE_GET_DESC_DATA(ring, ring->cur);
22482272 rdata->state_saved = 1;
22492273 rdata->state.skb = skb;
@@ -2272,10 +2296,7 @@ static int xgbe_one_poll(struct napi_struct *napi, int budget) · 22 unmodified lines
22722296 processed = xgbe_rx_poll(channel, budget);
22732297
22742298 /* If we processed everything, we are done */
2275− if (processed < budget) {
2276− /* Turn off polling */
2277− napi_complete_done(napi, processed);
2278−
2299+ if ((processed < budget) && napi_complete_done(napi, processed)) {
22792300 /* Enable Tx and Rx interrupts */
22802301 if (pdata->channel_irq_mode)
22812302 xgbe_enable_rx_tx_int(pdata, channel);
@@ -2317,10 +2338,7 @@ static int xgbe_all_poll(struct napi_struct *napi, int budget) · 35 unmodified lines
23172338 } while ((processed < budget) && (processed != last_processed));
23182339
23192340 /* If we processed everything, we are done */
2320− if (processed < budget) {
2321− /* Turn off polling */
2322− napi_complete_done(napi, processed);
2323−
2341+ if ((processed < budget) && napi_complete_done(napi, processed)) {
23242342 /* Enable Tx and Rx interrupts */
23252343 xgbe_enable_rx_tx_ints(pdata);
23262344 }
drivers/net/ethernet/aquantia/atlantic/aq_main.c+1−0
@@ -98,6 +98,7 @@ static int aq_ndev_change_mtu(struct net_device *ndev, int new_mtu) · 97 unmodified lines
9898
9999 if (err < 0)
100100 goto err_exit;
101+ ndev->mtu = new_mtu;
101102
102103 if (netif_running(ndev)) {
103104 aq_ndev_close(ndev);
drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c+1−1
@@ -213,9 +213,9 @@ void aq_pci_func_free_irqs(struct aq_pci_func_s *self) · 212 unmodified lines
213213 if (!((1U << i) & self->msix_entry_mask))
214214 continue;
215215
216− free_irq(pci_irq_vector(pdev, i), self->aq_vec[i]);
217216 if (pdev->msix_enabled)
218217 irq_set_affinity_hint(pci_irq_vector(pdev, i), NULL);
218+ free_irq(pci_irq_vector(pdev, i), self->aq_vec[i]);
219219 self->msix_entry_mask &= ~(1U << i);
220220 }
221221 }
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_a0_internal.h+1−0
@@ -137,6 +137,7 @@ static struct aq_hw_caps_s hw_atl_a0_hw_caps_ = { · 136 unmodified lines
137137 .tx_rings = HW_ATL_A0_TX_RINGS,
138138 .rx_rings = HW_ATL_A0_RX_RINGS,
139139 .hw_features = NETIF_F_HW_CSUM |
140+ NETIF_F_RXCSUM |
140141 NETIF_F_RXHASH |
141142 NETIF_F_SG |
142143 NETIF_F_TSO,
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0_internal.h+1−0
@@ -188,6 +188,7 @@ static struct aq_hw_caps_s hw_atl_b0_hw_caps_ = { · 187 unmodified lines
188188 .tx_rings = HW_ATL_B0_TX_RINGS,
189189 .rx_rings = HW_ATL_B0_RX_RINGS,
190190 .hw_features = NETIF_F_HW_CSUM |
191+ NETIF_F_RXCSUM |
191192 NETIF_F_RXHASH |
192193 NETIF_F_SG |
193194 NETIF_F_TSO |
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c+30−6
@@ -13292,17 +13292,15 @@ static int bnx2x_init_dev(struct bnx2x *bp, struct pci_dev *pdev, · 13291 unmodified lines
1329213292 dev->vlan_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
1329313293 NETIF_F_TSO | NETIF_F_TSO_ECN | NETIF_F_TSO6 | NETIF_F_HIGHDMA;
1329413294
13295− /* VF with OLD Hypervisor or old PF do not support filtering */
1329613295 if (IS_PF(bp)) {
1329713296 if (chip_is_e1x)
1329813297 bp->accept_any_vlan = true;
1329913298 else
1330013299 dev->hw_features |= NETIF_F_HW_VLAN_CTAG_FILTER;
13301−#ifdef CONFIG_BNX2X_SRIOV
13302− } else if (bp->acquire_resp.pfdev_info.pf_cap & PFVF_CAP_VLAN_FILTER) {
13303− dev->hw_features |= NETIF_F_HW_VLAN_CTAG_FILTER;
13304−#endif
1330513300 }
13301+ /* For VF we'll know whether to enable VLAN filtering after
13302+ * getting a response to CHANNEL_TLV_ACQUIRE from PF.
13303+ */
1330613304
1330713305 dev->features |= dev->hw_features | NETIF_F_HW_VLAN_CTAG_RX;
1330813306 dev->features |= NETIF_F_HIGHDMA;
@@ -13738,7 +13736,7 @@ static int bnx2x_ptp_adjfreq(struct ptp_clock_info *ptp, s32 ppb) · 429 unmodified lines
1373813736 if (!netif_running(bp->dev)) {
1373913737 DP(BNX2X_MSG_PTP,
1374013738 "PTP adjfreq called while the interface is down\n");
13741− return -EFAULT;
13739+ return -ENETDOWN;
1374213740 }
1374313741
1374413742 if (ppb < 0) {
@@ -13797,6 +13795,12 @@ static int bnx2x_ptp_adjtime(struct ptp_clock_info *ptp, s64 delta) · 52 unmodified lines
1379713795 {
1379813796 struct bnx2x *bp = container_of(ptp, struct bnx2x, ptp_clock_info);
1379913797
13798+ if (!netif_running(bp->dev)) {
13799+ DP(BNX2X_MSG_PTP,
13800+ "PTP adjtime called while the interface is down\n");
13801+ return -ENETDOWN;
13802+ }
13803+
1380013804 DP(BNX2X_MSG_PTP, "PTP adjtime called, delta = %llx\n", delta);
1380113805
1380213806 timecounter_adjtime(&bp->timecounter, delta);
@@ -13809,6 +13813,12 @@ static int bnx2x_ptp_gettime(struct ptp_clock_info *ptp, struct timespec64 *ts) · 6 unmodified lines
1380913813 struct bnx2x *bp = container_of(ptp, struct bnx2x, ptp_clock_info);
1381013814 u64 ns;
1381113815
13816+ if (!netif_running(bp->dev)) {
13817+ DP(BNX2X_MSG_PTP,
13818+ "PTP gettime called while the interface is down\n");
13819+ return -ENETDOWN;
13820+ }
13821+
1381213822 ns = timecounter_read(&bp->timecounter);
1381313823
1381413824 DP(BNX2X_MSG_PTP, "PTP gettime called, ns = %llu\n", ns);
@@ -13824,6 +13834,12 @@ static int bnx2x_ptp_settime(struct ptp_clock_info *ptp, · 9 unmodified lines
1382413834 struct bnx2x *bp = container_of(ptp, struct bnx2x, ptp_clock_info);
1382513835 u64 ns;
1382613836
13837+ if (!netif_running(bp->dev)) {
13838+ DP(BNX2X_MSG_PTP,
13839+ "PTP settime called while the interface is down\n");
13840+ return -ENETDOWN;
13841+ }
13842+
1382713843 ns = timespec64_to_ns(ts);
1382813844
1382913845 DP(BNX2X_MSG_PTP, "PTP settime called, ns = %llu\n", ns);
@@ -13991,6 +14007,14 @@ static int bnx2x_init_one(struct pci_dev *pdev, · 161 unmodified lines
1399114007 rc = bnx2x_vfpf_acquire(bp, tx_count, rx_count);
1399214008 if (rc)
1399314009 goto init_one_freemem;
14010+
14011+#ifdef CONFIG_BNX2X_SRIOV
14012+ /* VF with OLD Hypervisor or old PF do not support filtering */
14013+ if (bp->acquire_resp.pfdev_info.pf_cap & PFVF_CAP_VLAN_FILTER) {
14014+ dev->hw_features |= NETIF_F_HW_VLAN_CTAG_FILTER;
14015+ dev->features |= NETIF_F_HW_VLAN_CTAG_FILTER;
14016+ }
14017+#endif
1399414018 }
1399514019
1399614020 /* Enable SRIOV if capability found in configuration space */
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c+16−8
@@ -434,7 +434,9 @@ static int bnx2x_vf_mac_vlan_config(struct bnx2x *bp, · 433 unmodified lines
434434
435435 /* Add/Remove the filter */
436436 rc = bnx2x_config_vlan_mac(bp, &ramrod);
437− if (rc && rc != -EEXIST) {
437+ if (rc == -EEXIST)
438+ return 0;
439+ if (rc) {
438440 BNX2X_ERR("Failed to %s %s\n",
439441 filter->add ? "add" : "delete",
440442 (filter->type == BNX2X_VF_FILTER_VLAN_MAC) ?
@@ -444,6 +446,8 @@ static int bnx2x_vf_mac_vlan_config(struct bnx2x *bp, · 3 unmodified lines
444446 return rc;
445447 }
446448
449+ filter->applied = true;
450+
447451 return 0;
448452 }
449453
@@ -469,8 +473,10 @@ int bnx2x_vf_mac_vlan_config_list(struct bnx2x *bp, struct bnx2x_virtf *vf, · 19 unmodified lines
469473 /* Rollback if needed */
470474 if (i != filters->count) {
471475 BNX2X_ERR("Managed only %d/%d filters - rolling back\n",
472− i, filters->count + 1);
476+ i, filters->count);
473477 while (--i >= 0) {
478+ if (!filters->filters[i].applied)
479+ continue;
474480 filters->filters[i].add = !filters->filters[i].add;
475481 bnx2x_vf_mac_vlan_config(bp, vf, qid,
476482 &filters->filters[i],
@@ -1899,7 +1905,8 @@ void bnx2x_iov_adjust_stats_req(struct bnx2x *bp) · 1422 unmodified lines
18991905 continue;
19001906 }
19011907
1902− DP(BNX2X_MSG_IOV, "add addresses for vf %d\n", vf->abs_vfid);
1908+ DP_AND((BNX2X_MSG_IOV | BNX2X_MSG_STATS),
1909+ "add addresses for vf %d\n", vf->abs_vfid);
19031910 for_each_vfq(vf, j) {
19041911 struct bnx2x_vf_queue *rxq = vfq_get(vf, j);
19051912
@@ -1920,11 +1927,12 @@ void bnx2x_iov_adjust_stats_req(struct bnx2x *bp) · 14 unmodified lines
19201927 cpu_to_le32(U64_HI(q_stats_addr));
19211928 cur_query_entry->address.lo =
19221929 cpu_to_le32(U64_LO(q_stats_addr));
1923− DP(BNX2X_MSG_IOV,
1924− "added address %x %x for vf %d queue %d client %d\n",
1925− cur_query_entry->address.hi,
1926− cur_query_entry->address.lo, cur_query_entry->funcID,
1927− j, cur_query_entry->index);
1930+ DP_AND((BNX2X_MSG_IOV | BNX2X_MSG_STATS),
1931+ "added address %x %x for vf %d queue %d client %d\n",
1932+ cur_query_entry->address.hi,
1933+ cur_query_entry->address.lo,
1934+ cur_query_entry->funcID,
1935+ j, cur_query_entry->index);
19281936 cur_query_entry++;
19291937 cur_data_offset += sizeof(struct per_queue_stats);
19301938 stats_count++;
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h+1−0
@@ -114,6 +114,7 @@ struct bnx2x_vf_mac_vlan_filter { · 113 unmodified lines
114114 (BNX2X_VF_FILTER_MAC | BNX2X_VF_FILTER_VLAN) /*shortcut*/
115115
116116 bool add;
117+ bool applied;
117118 u8 *mac;
118119 u16 vid;
119120 };
drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c+28−12
@@ -868,7 +868,7 @@ int bnx2x_vfpf_set_mcast(struct net_device *dev) · 867 unmodified lines
868868 struct bnx2x *bp = netdev_priv(dev);
869869 struct vfpf_set_q_filters_tlv *req = &bp->vf2pf_mbox->req.set_q_filters;
870870 struct pfvf_general_resp_tlv *resp = &bp->vf2pf_mbox->resp.general_resp;
871− int rc, i = 0;
871+ int rc = 0, i = 0;
872872 struct netdev_hw_addr *ha;
873873
874874 if (bp->state != BNX2X_STATE_OPEN) {
@@ -883,6 +883,15 @@ int bnx2x_vfpf_set_mcast(struct net_device *dev) · 8 unmodified lines
883883 /* Get Rx mode requested */
884884 DP(NETIF_MSG_IFUP, "dev->flags = %x\n", dev->flags);
885885
886+ /* We support PFVF_MAX_MULTICAST_PER_VF mcast addresses tops */
887+ if (netdev_mc_count(dev) > PFVF_MAX_MULTICAST_PER_VF) {
888+ DP(NETIF_MSG_IFUP,
889+ "VF supports not more than %d multicast MAC addresses\n",
890+ PFVF_MAX_MULTICAST_PER_VF);
891+ rc = -EINVAL;
892+ goto out;
893+ }
894+
886895 netdev_for_each_mc_addr(ha, dev) {
887896 DP(NETIF_MSG_IFUP, "Adding mcast MAC: %pM\n",
888897 bnx2x_mc_addr(ha));
@@ -890,16 +899,6 @@ int bnx2x_vfpf_set_mcast(struct net_device *dev) · 1 unmodified line
890899 i++;
891900 }
892901
893− /* We support four PFVF_MAX_MULTICAST_PER_VF mcast
894− * addresses tops
895− */
896− if (i >= PFVF_MAX_MULTICAST_PER_VF) {
897− DP(NETIF_MSG_IFUP,
898− "VF supports not more than %d multicast MAC addresses\n",
899− PFVF_MAX_MULTICAST_PER_VF);
900− return -EINVAL;
901− }
902−
903902 req->n_multicast = i;
904903 req->flags |= VFPF_SET_Q_FILTERS_MULTICAST_CHANGED;
905904 req->vf_qid = 0;
@@ -924,7 +923,7 @@ int bnx2x_vfpf_set_mcast(struct net_device *dev) · 18 unmodified lines
924923 out:
925924 bnx2x_vfpf_finalize(bp, &req->first_tlv);
926925
927− return 0;
926+ return rc;
928927 }
929928
930929 /* request pf to add a vlan for the vf */
@@ -1778,6 +1777,23 @@ static int bnx2x_vf_mbx_qfilters(struct bnx2x *bp, struct bnx2x_virtf *vf) · 847 unmodified lines
17781777 goto op_err;
17791778 }
17801779
1780+ /* build vlan list */
1781+ fl = NULL;
1782+
1783+ rc = bnx2x_vf_mbx_macvlan_list(bp, vf, msg, &fl,
1784+ VFPF_VLAN_FILTER);
1785+ if (rc)
1786+ goto op_err;
1787+
1788+ if (fl) {
1789+ /* set vlan list */
1790+ rc = bnx2x_vf_mac_vlan_config_list(bp, vf, fl,
1791+ msg->vf_qid,
1792+ false);
1793+ if (rc)
1794+ goto op_err;
1795+ }
1796+
17811797 }
17821798
17831799 if (msg->flags & VFPF_SET_Q_FILTERS_RX_MASK_CHANGED) {
drivers/net/ethernet/broadcom/bnxt/bnxt.c+18−7
@@ -4465,6 +4465,10 @@ static int bnxt_hwrm_func_qcfg(struct bnxt *bp) · 4464 unmodified lines
44654465 vf->vlan = le16_to_cpu(resp->vlan) & VLAN_VID_MASK;
44664466 }
44674467 #endif
4468+ if (BNXT_PF(bp) && (le16_to_cpu(resp->flags) &
4469+ FUNC_QCFG_RESP_FLAGS_FW_DCBX_AGENT_ENABLED))
4470+ bp->flags |= BNXT_FLAG_FW_LLDP_AGENT;
4471+
44684472 switch (resp->port_partition_type) {
44694473 case FUNC_QCFG_RESP_PORT_PARTITION_TYPE_NPAR1_0:
44704474 case FUNC_QCFG_RESP_PORT_PARTITION_TYPE_NPAR1_5:
@@ -5507,8 +5511,9 @@ static int bnxt_hwrm_phy_qcaps(struct bnxt *bp) · 1036 unmodified lines
55075511 bp->lpi_tmr_hi = le32_to_cpu(resp->valid_tx_lpi_timer_high) &
55085512 PORT_PHY_QCAPS_RESP_TX_LPI_TIMER_HIGH_MASK;
55095513 }
5510− link_info->support_auto_speeds =
5511− le16_to_cpu(resp->supported_speeds_auto_mode);
5514+ if (resp->supported_speeds_auto_mode)
5515+ link_info->support_auto_speeds =
5516+ le16_to_cpu(resp->supported_speeds_auto_mode);
55125517
55135518 hwrm_phy_qcaps_exit:
55145519 mutex_unlock(&bp->hwrm_cmd_lock);
@@ -6495,8 +6500,14 @@ static void bnxt_reset_task(struct bnxt *bp, bool silent) · 980 unmodified lines
64956500 if (!silent)
64966501 bnxt_dbg_dump_states(bp);
64976502 if (netif_running(bp->dev)) {
6503+ int rc;
6504+
6505+ if (!silent)
6506+ bnxt_ulp_stop(bp);
64986507 bnxt_close_nic(bp, false, false);
6499− bnxt_open_nic(bp, false, false);
6508+ rc = bnxt_open_nic(bp, false, false);
6509+ if (!silent && !rc)
6510+ bnxt_ulp_start(bp);
65006511 }
65016512 }
65026513
@@ -7444,6 +7455,10 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) · 941 unmodified lines
74447455 if (rc)
74457456 goto init_err_pci_clean;
74467457
7458+ rc = bnxt_hwrm_func_reset(bp);
7459+ if (rc)
7460+ goto init_err_pci_clean;
7461+
74477462 bnxt_hwrm_fw_set_time(bp);
74487463
74497464 dev->hw_features = NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | NETIF_F_SG |
@@ -7554,10 +7569,6 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) · 104 unmodified lines
75547569 if (rc)
75557570 goto init_err_pci_clean;
75567571
7557− rc = bnxt_hwrm_func_reset(bp);
7558− if (rc)
7559− goto init_err_pci_clean;
7560−
75617572 rc = bnxt_init_int_mode(bp);
75627573 if (rc)
75637574 goto init_err_pci_clean;
drivers/net/ethernet/broadcom/bnxt/bnxt.h+1−0
@@ -993,6 +993,7 @@ struct bnxt { · 992 unmodified lines
993993 BNXT_FLAG_ROCEV2_CAP)
994994 #define BNXT_FLAG_NO_AGG_RINGS 0x20000
995995 #define BNXT_FLAG_RX_PAGE_MODE 0x40000
996+ #define BNXT_FLAG_FW_LLDP_AGENT 0x80000
996997 #define BNXT_FLAG_CHIP_NITRO_A0 0x1000000
997998
998999 #define BNXT_FLAG_ALL_CONFIG_FEATS (BNXT_FLAG_TPA | \
drivers/net/ethernet/broadcom/bnxt/bnxt_dcb.c+1−1
@@ -474,7 +474,7 @@ void bnxt_dcb_init(struct bnxt *bp) · 473 unmodified lines
474474 return;
475475
476476 bp->dcbx_cap = DCB_CAP_DCBX_VER_IEEE;
477− if (BNXT_PF(bp))
477+ if (BNXT_PF(bp) && !(bp->flags & BNXT_FLAG_FW_LLDP_AGENT))
478478 bp->dcbx_cap |= DCB_CAP_DCBX_HOST;
479479 else
480480 bp->dcbx_cap |= DCB_CAP_DCBX_LLD_MANAGED;
drivers/net/ethernet/broadcom/genet/bcmgenet.c+151−61
@@ -1,7 +1,7 @@
11 /*
22 * Broadcom GENET (Gigabit Ethernet) controller driver
33 *
4− * Copyright (c) 2014 Broadcom Corporation
4+ * Copyright (c) 2014-2017 Broadcom
55 *
66 * This program is free software; you can redistribute it and/or modify
77 * it under the terms of the GNU General Public License version 2 as
@@ -450,6 +450,22 @@ static inline void bcmgenet_rdma_ring_writel(struct bcmgenet_priv *priv, · 442 unmodified lines
450450 genet_dma_ring_regs[r]);
451451 }
452452
453+static int bcmgenet_begin(struct net_device *dev)
454+{
455+ struct bcmgenet_priv *priv = netdev_priv(dev);
456+
457+ /* Turn on the clock */
458+ return clk_prepare_enable(priv->clk);
459+}
460+
461+static void bcmgenet_complete(struct net_device *dev)
462+{
463+ struct bcmgenet_priv *priv = netdev_priv(dev);
464+
465+ /* Turn off the clock */
466+ clk_disable_unprepare(priv->clk);
467+}
468+
453469 static int bcmgenet_get_link_ksettings(struct net_device *dev,
454470 struct ethtool_link_ksettings *cmd)
455471 {
@@ -778,8 +794,9 @@ static const struct bcmgenet_stats bcmgenet_gstrings_stats[] = { · 322 unmodified lines
778794 STAT_GENET_RUNT("rx_runt_bytes", mib.rx_runt_bytes),
779795 /* Misc UniMAC counters */
780796 STAT_GENET_MISC("rbuf_ovflow_cnt", mib.rbuf_ovflow_cnt,
781− UMAC_RBUF_OVFL_CNT),
782− STAT_GENET_MISC("rbuf_err_cnt", mib.rbuf_err_cnt, UMAC_RBUF_ERR_CNT),
797+ UMAC_RBUF_OVFL_CNT_V1),
798+ STAT_GENET_MISC("rbuf_err_cnt", mib.rbuf_err_cnt,
799+ UMAC_RBUF_ERR_CNT_V1),
783800 STAT_GENET_MISC("mdf_err_cnt", mib.mdf_err_cnt, UMAC_MDF_ERR_CNT),
784801 STAT_GENET_SOFT_MIB("alloc_rx_buff_failed", mib.alloc_rx_buff_failed),
785802 STAT_GENET_SOFT_MIB("rx_dma_failed", mib.rx_dma_failed),
@@ -821,6 +838,45 @@ static void bcmgenet_get_strings(struct net_device *dev, u32 stringset, · 35 unmodified lines
821838 }
822839 }
823840
841+static u32 bcmgenet_update_stat_misc(struct bcmgenet_priv *priv, u16 offset)
842+{
843+ u16 new_offset;
844+ u32 val;
845+
846+ switch (offset) {
847+ case UMAC_RBUF_OVFL_CNT_V1:
848+ if (GENET_IS_V2(priv))
849+ new_offset = RBUF_OVFL_CNT_V2;
850+ else
851+ new_offset = RBUF_OVFL_CNT_V3PLUS;
852+
853+ val = bcmgenet_rbuf_readl(priv, new_offset);
854+ /* clear if overflowed */
855+ if (val == ~0)
856+ bcmgenet_rbuf_writel(priv, 0, new_offset);
857+ break;
858+ case UMAC_RBUF_ERR_CNT_V1:
859+ if (GENET_IS_V2(priv))
860+ new_offset = RBUF_ERR_CNT_V2;
861+ else
862+ new_offset = RBUF_ERR_CNT_V3PLUS;
863+
864+ val = bcmgenet_rbuf_readl(priv, new_offset);
865+ /* clear if overflowed */
866+ if (val == ~0)
867+ bcmgenet_rbuf_writel(priv, 0, new_offset);
868+ break;
869+ default:
870+ val = bcmgenet_umac_readl(priv, offset);
871+ /* clear if overflowed */
872+ if (val == ~0)
873+ bcmgenet_umac_writel(priv, 0, offset);
874+ break;
875+ }
876+
877+ return val;
878+}
879+
824880 static void bcmgenet_update_mib_counters(struct bcmgenet_priv *priv)
825881 {
826882 int i, j = 0;
@@ -836,19 +892,28 @@ static void bcmgenet_update_mib_counters(struct bcmgenet_priv *priv) · 9 unmodified lines
836892 case BCMGENET_STAT_NETDEV:
837893 case BCMGENET_STAT_SOFT:
838894 continue;
839− case BCMGENET_STAT_MIB_RX:
840− case BCMGENET_STAT_MIB_TX:
841895 case BCMGENET_STAT_RUNT:
842− if (s->type != BCMGENET_STAT_MIB_RX)
843− offset = BCMGENET_STAT_OFFSET;
896+ offset += BCMGENET_STAT_OFFSET;
897+ /* fall through */
898+ case BCMGENET_STAT_MIB_TX:
899+ offset += BCMGENET_STAT_OFFSET;
900+ /* fall through */
901+ case BCMGENET_STAT_MIB_RX:
844902 val = bcmgenet_umac_readl(priv,
845903 UMAC_MIB_START + j + offset);
904+ offset = 0; /* Reset Offset */
846905 break;
847906 case BCMGENET_STAT_MISC:
848− val = bcmgenet_umac_readl(priv, s->reg_offset);
849− /* clear if overflowed */
850− if (val == ~0)
851− bcmgenet_umac_writel(priv, 0, s->reg_offset);
907+ if (GENET_IS_V1(priv)) {
908+ val = bcmgenet_umac_readl(priv, s->reg_offset);
909+ /* clear if overflowed */
910+ if (val == ~0)
911+ bcmgenet_umac_writel(priv, 0,
912+ s->reg_offset);
913+ } else {
914+ val = bcmgenet_update_stat_misc(priv,
915+ s->reg_offset);
916+ }
852917 break;
853918 }
854919
@@ -973,6 +1038,8 @@ static int bcmgenet_set_eee(struct net_device *dev, struct ethtool_eee *e) · 118 unmodified lines
9731038
9741039 /* standard ethtool support functions. */
9751040 static const struct ethtool_ops bcmgenet_ethtool_ops = {
1041+ .begin = bcmgenet_begin,
1042+ .complete = bcmgenet_complete,
9761043 .get_strings = bcmgenet_get_strings,
9771044 .get_sset_count = bcmgenet_get_sset_count,
9781045 .get_ethtool_stats = bcmgenet_get_ethtool_stats,
@@ -1167,7 +1234,6 @@ static unsigned int __bcmgenet_tx_reclaim(struct net_device *dev, · 188 unmodified lines
11671234 struct bcmgenet_priv *priv = netdev_priv(dev);
11681235 struct device *kdev = &priv->pdev->dev;
11691236 struct enet_cb *tx_cb_ptr;
1170− struct netdev_queue *txq;
11711237 unsigned int pkts_compl = 0;
11721238 unsigned int bytes_compl = 0;
11731239 unsigned int c_index;
@@ -1219,13 +1285,8 @@ static unsigned int __bcmgenet_tx_reclaim(struct net_device *dev, · 45 unmodified lines
12191285 dev->stats.tx_packets += pkts_compl;
12201286 dev->stats.tx_bytes += bytes_compl;
12211287
1222− txq = netdev_get_tx_queue(dev, ring->queue);
1223− netdev_tx_completed_queue(txq, pkts_compl, bytes_compl);
1224−
1225− if (ring->free_bds > (MAX_SKB_FRAGS + 1)) {
1226− if (netif_tx_queue_stopped(txq))
1227− netif_tx_wake_queue(txq);
1228− }
1288+ netdev_tx_completed_queue(netdev_get_tx_queue(dev, ring->queue),
1289+ pkts_compl, bytes_compl);
12291290
12301291 return pkts_compl;
12311292 }
@@ -1248,8 +1309,16 @@ static int bcmgenet_tx_poll(struct napi_struct *napi, int budget) · 16 unmodified lines
12481309 struct bcmgenet_tx_ring *ring =
12491310 container_of(napi, struct bcmgenet_tx_ring, napi);
12501311 unsigned int work_done = 0;
1312+ struct netdev_queue *txq;
1313+ unsigned long flags;
12511314
1252− work_done = bcmgenet_tx_reclaim(ring->priv->dev, ring);
1315+ spin_lock_irqsave(&ring->lock, flags);
1316+ work_done = __bcmgenet_tx_reclaim(ring->priv->dev, ring);
1317+ if (ring->free_bds > (MAX_SKB_FRAGS + 1)) {
1318+ txq = netdev_get_tx_queue(ring->priv->dev, ring->queue);
1319+ netif_tx_wake_queue(txq);
1320+ }
1321+ spin_unlock_irqrestore(&ring->lock, flags);
12531322
12541323 if (work_done == 0) {
12551324 napi_complete(napi);
@@ -2457,24 +2526,28 @@ static int bcmgenet_init_dma(struct bcmgenet_priv *priv) · 1201 unmodified lines
24572526 /* Interrupt bottom half */
24582527 static void bcmgenet_irq_task(struct work_struct *work)
24592528 {
2529+ unsigned long flags;
2530+ unsigned int status;
24602531 struct bcmgenet_priv *priv = container_of(
24612532 work, struct bcmgenet_priv, bcmgenet_irq_work);
24622533
24632534 netif_dbg(priv, intr, priv->dev, "%s\n", __func__);
24642535
2465− if (priv->irq0_stat & UMAC_IRQ_MPD_R) {
2466− priv->irq0_stat &= ~UMAC_IRQ_MPD_R;
2536+ spin_lock_irqsave(&priv->lock, flags);
2537+ status = priv->irq0_stat;
2538+ priv->irq0_stat = 0;
2539+ spin_unlock_irqrestore(&priv->lock, flags);
2540+
2541+ if (status & UMAC_IRQ_MPD_R) {
24672542 netif_dbg(priv, wol, priv->dev,
24682543 "magic packet detected, waking up\n");
24692544 bcmgenet_power_up(priv, GENET_POWER_WOL_MAGIC);
24702545 }
24712546
24722547 /* Link UP/DOWN event */
2473− if (priv->irq0_stat & UMAC_IRQ_LINK_EVENT) {
2548+ if (status & UMAC_IRQ_LINK_EVENT)
24742549 phy_mac_interrupt(priv->phydev,
2475− !!(priv->irq0_stat & UMAC_IRQ_LINK_UP));
2476− priv->irq0_stat &= ~UMAC_IRQ_LINK_EVENT;
2477− }
2550+ !!(status & UMAC_IRQ_LINK_UP));
24782551 }
24792552
24802553 /* bcmgenet_isr1: handle Rx and Tx priority queues */
@@ -2483,22 +2556,21 @@ static irqreturn_t bcmgenet_isr1(int irq, void *dev_id) · 2 unmodified lines
24832556 struct bcmgenet_priv *priv = dev_id;
24842557 struct bcmgenet_rx_ring *rx_ring;
24852558 struct bcmgenet_tx_ring *tx_ring;
2486− unsigned int index;
2559+ unsigned int index, status;
24872560
2488− /* Save irq status for bottom-half processing. */
2489− priv->irq1_stat =
2490− bcmgenet_intrl2_1_readl(priv, INTRL2_CPU_STAT) &
2561+ /* Read irq status */
2562+ status = bcmgenet_intrl2_1_readl(priv, INTRL2_CPU_STAT) &
24912563 ~bcmgenet_intrl2_1_readl(priv, INTRL2_CPU_MASK_STATUS);
24922564
24932565 /* clear interrupts */
2494− bcmgenet_intrl2_1_writel(priv, priv->irq1_stat, INTRL2_CPU_CLEAR);
2566+ bcmgenet_intrl2_1_writel(priv, status, INTRL2_CPU_CLEAR);
24952567
24962568 netif_dbg(priv, intr, priv->dev,
2497− "%s: IRQ=0x%x\n", __func__, priv->irq1_stat);
2569+ "%s: IRQ=0x%x\n", __func__, status);
24982570
24992571 /* Check Rx priority queue interrupts */
25002572 for (index = 0; index < priv->hw_params->rx_queues; index++) {
2501− if (!(priv->irq1_stat & BIT(UMAC_IRQ1_RX_INTR_SHIFT + index)))
2573+ if (!(status & BIT(UMAC_IRQ1_RX_INTR_SHIFT + index)))
25022574 continue;
25032575
25042576 rx_ring = &priv->rx_rings[index];
@@ -2511,7 +2583,7 @@ static irqreturn_t bcmgenet_isr1(int irq, void *dev_id) · 6 unmodified lines
25112583
25122584 /* Check Tx priority queue interrupts */
25132585 for (index = 0; index < priv->hw_params->tx_queues; index++) {
2514− if (!(priv->irq1_stat & BIT(index)))
2586+ if (!(status & BIT(index)))
25152587 continue;
25162588
25172589 tx_ring = &priv->tx_rings[index];
@@ -2531,19 +2603,20 @@ static irqreturn_t bcmgenet_isr0(int irq, void *dev_id) · 13 unmodified lines
25312603 struct bcmgenet_priv *priv = dev_id;
25322604 struct bcmgenet_rx_ring *rx_ring;
25332605 struct bcmgenet_tx_ring *tx_ring;
2606+ unsigned int status;
2607+ unsigned long flags;
25342608
2535− /* Save irq status for bottom-half processing. */
2536− priv->irq0_stat =
2537− bcmgenet_intrl2_0_readl(priv, INTRL2_CPU_STAT) &
2609+ /* Read irq status */
2610+ status = bcmgenet_intrl2_0_readl(priv, INTRL2_CPU_STAT) &
25382611 ~bcmgenet_intrl2_0_readl(priv, INTRL2_CPU_MASK_STATUS);
25392612
25402613 /* clear interrupts */
2541− bcmgenet_intrl2_0_writel(priv, priv->irq0_stat, INTRL2_CPU_CLEAR);
2614+ bcmgenet_intrl2_0_writel(priv, status, INTRL2_CPU_CLEAR);
25422615
25432616 netif_dbg(priv, intr, priv->dev,
2544− "IRQ=0x%x\n", priv->irq0_stat);
2617+ "IRQ=0x%x\n", status);
25452618
2546− if (priv->irq0_stat & UMAC_IRQ_RXDMA_DONE) {
2619+ if (status & UMAC_IRQ_RXDMA_DONE) {
25472620 rx_ring = &priv->rx_rings[DESC_INDEX];
25482621
25492622 if (likely(napi_schedule_prep(&rx_ring->napi))) {
@@ -2552,7 +2625,7 @@ static irqreturn_t bcmgenet_isr0(int irq, void *dev_id) · 2 unmodified lines
25522625 }
25532626 }
25542627
2555− if (priv->irq0_stat & UMAC_IRQ_TXDMA_DONE) {
2628+ if (status & UMAC_IRQ_TXDMA_DONE) {
25562629 tx_ring = &priv->tx_rings[DESC_INDEX];
25572630
25582631 if (likely(napi_schedule_prep(&tx_ring->napi))) {
@@ -2561,22 +2634,23 @@ static irqreturn_t bcmgenet_isr0(int irq, void *dev_id) · 2 unmodified lines
25612634 }
25622635 }
25632636
2564− if (priv->irq0_stat & (UMAC_IRQ_PHY_DET_R |
2565− UMAC_IRQ_PHY_DET_F |
2566− UMAC_IRQ_LINK_EVENT |
2567− UMAC_IRQ_HFB_SM |
2568− UMAC_IRQ_HFB_MM |
2569− UMAC_IRQ_MPD_R)) {
2570− /* all other interested interrupts handled in bottom half */
2571− schedule_work(&priv->bcmgenet_irq_work);
2572− }
2573−
25742637 if ((priv->hw_params->flags & GENET_HAS_MDIO_INTR) &&
2575− priv->irq0_stat & (UMAC_IRQ_MDIO_DONE | UMAC_IRQ_MDIO_ERROR)) {
2576− priv->irq0_stat &= ~(UMAC_IRQ_MDIO_DONE | UMAC_IRQ_MDIO_ERROR);
2638+ status & (UMAC_IRQ_MDIO_DONE | UMAC_IRQ_MDIO_ERROR)) {
25772639 wake_up(&priv->wq);
25782640 }
25792641
2642+ /* all other interested interrupts handled in bottom half */
2643+ status &= (UMAC_IRQ_LINK_EVENT |
2644+ UMAC_IRQ_MPD_R);
2645+ if (status) {
2646+ /* Save irq status for bottom-half processing. */
2647+ spin_lock_irqsave(&priv->lock, flags);
2648+ priv->irq0_stat |= status;
2649+ spin_unlock_irqrestore(&priv->lock, flags);
2650+
2651+ schedule_work(&priv->bcmgenet_irq_work);
2652+ }
2653+
25802654 return IRQ_HANDLED;
25812655 }
25822656
@@ -2801,6 +2875,8 @@ err_irq0: · 218 unmodified lines
28012875 err_fini_dma:
28022876 bcmgenet_fini_dma(priv);
28032877 err_clk_disable:
2878+ if (priv->internal_phy)
2879+ bcmgenet_power_down(priv, GENET_POWER_PASSIVE);
28042880 clk_disable_unprepare(priv->clk);
28052881 return ret;
28062882 }
@@ -3177,6 +3253,12 @@ static void bcmgenet_set_hw_params(struct bcmgenet_priv *priv) · 370 unmodified lines
31773253 */
31783254 gphy_rev = reg & 0xffff;
31793255
3256+ /* This is reserved so should require special treatment */
3257+ if (gphy_rev == 0 || gphy_rev == 0x01ff) {
3258+ pr_warn("Invalid GPHY revision detected: 0x%04x\n", gphy_rev);
3259+ return;
3260+ }
3261+
31803262 /* This is the good old scheme, just GPHY major, no minor nor patch */
31813263 if ((gphy_rev & 0xf0) != 0)
31823264 priv->gphy_rev = gphy_rev << 8;
@@ -3185,12 +3267,6 @@ static void bcmgenet_set_hw_params(struct bcmgenet_priv *priv) · 2 unmodified lines
31853267 else if ((gphy_rev & 0xff00) != 0)
31863268 priv->gphy_rev = gphy_rev;
31873269
3188− /* This is reserved so should require special treatment */
3189− else if (gphy_rev == 0 || gphy_rev == 0x01ff) {
3190− pr_warn("Invalid GPHY revision detected: 0x%04x\n", gphy_rev);
3191− return;
3192− }
3193−
31943270 #ifdef CONFIG_PHYS_ADDR_T_64BIT
31953271 if (!(params->flags & GENET_HAS_40BITS))
31963272 pr_warn("GENET does not support 40-bits PA\n");
@@ -3233,6 +3309,7 @@ static int bcmgenet_probe(struct platform_device *pdev) · 36 unmodified lines
32333309 const void *macaddr;
32343310 struct resource *r;
32353311 int err = -EIO;
3312+ const char *phy_mode_str;
32363313
32373314 /* Up to GENET_MAX_MQ_CNT + 1 TX queues and RX queues */
32383315 dev = alloc_etherdev_mqs(sizeof(*priv), GENET_MAX_MQ_CNT + 1,
@@ -3276,6 +3353,8 @@ static int bcmgenet_probe(struct platform_device *pdev) · 37 unmodified lines
32763353 goto err;
32773354 }
32783355
3356+ spin_lock_init(&priv->lock);
3357+
32793358 SET_NETDEV_DEV(dev, &pdev->dev);
32803359 dev_set_drvdata(&pdev->dev, dev);
32813360 ether_addr_copy(dev->dev_addr, macaddr);
@@ -3338,6 +3417,13 @@ static int bcmgenet_probe(struct platform_device *pdev) · 56 unmodified lines
33383417 priv->clk_eee = NULL;
33393418 }
33403419
3420+ /* If this is an internal GPHY, power it on now, before UniMAC is
3421+ * brought out of reset as absolutely no UniMAC activity is allowed
3422+ */
3423+ if (dn && !of_property_read_string(dn, "phy-mode", &phy_mode_str) &&
3424+ !strcasecmp(phy_mode_str, "internal"))
3425+ bcmgenet_power_up(priv, GENET_POWER_PASSIVE);
3426+
33413427 err = reset_umac(priv);
33423428 if (err)
33433429 goto err_clk_disable;
@@ -3395,7 +3481,8 @@ static int bcmgenet_suspend(struct device *d) · 51 unmodified lines
33953481
33963482 bcmgenet_netif_stop(dev);
33973483
3398− phy_suspend(priv->phydev);
3484+ if (!device_may_wakeup(d))
3485+ phy_suspend(priv->phydev);
33993486
34003487 netif_device_detach(dev);
34013488
@@ -3492,7 +3579,8 @@ static int bcmgenet_resume(struct device *d) · 90 unmodified lines
34923579
34933580 netif_device_attach(dev);
34943581
3495− phy_resume(priv->phydev);
3582+ if (!device_may_wakeup(d))
3583+ phy_resume(priv->phydev);
34963584
34973585 if (priv->eee.eee_enabled)
34983586 bcmgenet_eee_enable_set(dev, true);
@@ -3502,6 +3590,8 @@ static int bcmgenet_resume(struct device *d) · 3 unmodified lines
35023590 return 0;
35033591
35043592 out_clk_disable:
3593+ if (priv->internal_phy)
3594+ bcmgenet_power_down(priv, GENET_POWER_PASSIVE);
35053595 clk_disable_unprepare(priv->clk);
35063596 return ret;
35073597 }
drivers/net/ethernet/broadcom/genet/bcmgenet.h+11−5
@@ -1,5 +1,5 @@
11 /*
2− * Copyright (c) 2014 Broadcom Corporation
2+ * Copyright (c) 2014-2017 Broadcom
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License version 2 as
@@ -214,7 +214,9 @@ struct bcmgenet_mib_counters { · 208 unmodified lines
214214 #define MDIO_REG_SHIFT 16
215215 #define MDIO_REG_MASK 0x1F
216216
217−#define UMAC_RBUF_OVFL_CNT 0x61C
217+#define UMAC_RBUF_OVFL_CNT_V1 0x61C
218+#define RBUF_OVFL_CNT_V2 0x80
219+#define RBUF_OVFL_CNT_V3PLUS 0x94
218220
219221 #define UMAC_MPD_CTRL 0x620
220222 #define MPD_EN (1 << 0)
@@ -224,7 +226,9 @@ struct bcmgenet_mib_counters { · 3 unmodified lines
224226
225227 #define UMAC_MPD_PW_MS 0x624
226228 #define UMAC_MPD_PW_LS 0x628
227−#define UMAC_RBUF_ERR_CNT 0x634
229+#define UMAC_RBUF_ERR_CNT_V1 0x634
230+#define RBUF_ERR_CNT_V2 0x84
231+#define RBUF_ERR_CNT_V3PLUS 0x98
228232 #define UMAC_MDF_ERR_CNT 0x638
229233 #define UMAC_MDF_CTRL 0x650
230234 #define UMAC_MDF_ADDR 0x654
@@ -619,11 +623,13 @@ struct bcmgenet_priv { · 388 unmodified lines
619623 struct work_struct bcmgenet_irq_work;
620624 int irq0;
621625 int irq1;
622− unsigned int irq0_stat;
623− unsigned int irq1_stat;
624626 int wol_irq;
625627 bool wol_irq_disabled;
626628
629+ /* shared status */
630+ spinlock_t lock;
631+ unsigned int irq0_stat;
632+
627633 /* HW descriptors/checksum variables */
628634 bool desc_64b_en;
629635 bool desc_rxchk_en;
drivers/net/ethernet/broadcom/genet/bcmmii.c+0−15
@@ -220,20 +220,6 @@ void bcmgenet_phy_power_set(struct net_device *dev, bool enable) · 219 unmodified lines
220220 udelay(60);
221221 }
222222
223−static void bcmgenet_internal_phy_setup(struct net_device *dev)
224−{
225− struct bcmgenet_priv *priv = netdev_priv(dev);
226− u32 reg;
227−
228− /* Power up PHY */
229− bcmgenet_phy_power_set(dev, true);
230− /* enable APD */
231− reg = bcmgenet_ext_readl(priv, EXT_EXT_PWR_MGMT);
232− reg |= EXT_PWR_DN_EN_LD;
233− bcmgenet_ext_writel(priv, reg, EXT_EXT_PWR_MGMT);
234− bcmgenet_mii_reset(dev);
235−}
236−
237223 static void bcmgenet_moca_phy_setup(struct bcmgenet_priv *priv)
238224 {
239225 u32 reg;
@@ -281,7 +267,6 @@ int bcmgenet_mii_config(struct net_device *dev) · 41 unmodified lines
281267
282268 if (priv->internal_phy) {
283269 phy_name = "internal PHY";
284− bcmgenet_internal_phy_setup(dev);
285270 } else if (priv->phy_interface == PHY_INTERFACE_MODE_MOCA) {
286271 phy_name = "MoCA";
287272 bcmgenet_moca_phy_setup(priv);
drivers/net/ethernet/brocade/bna/bnad_debugfs.c+1−1
@@ -325,7 +325,7 @@ bnad_debugfs_write_regrd(struct file *file, const char __user *buf, · 324 unmodified lines
325325 return PTR_ERR(kern_buf);
326326
327327 rc = sscanf(kern_buf, "%x:%x", &addr, &len);
328− if (rc < 2) {
328+ if (rc < 2 || len > UINT_MAX >> 2) {
329329 netdev_warn(bnad->netdev, "failed to read user buffer\n");
330330 kfree(kern_buf);
331331 return -EINVAL;
drivers/net/ethernet/cavium/liquidio/lio_main.c+55−55
@@ -152,7 +152,7 @@ struct octnic_gather { · 151 unmodified lines
152152 */
153153 struct octeon_sg_entry *sg;
154154
155− u64 sg_dma_ptr;
155+ dma_addr_t sg_dma_ptr;
156156 };
157157
158158 struct handshake {
@@ -734,6 +734,9 @@ static void delete_glists(struct lio *lio) · 575 unmodified lines
734734 struct octnic_gather *g;
735735 int i;
736736
737+ kfree(lio->glist_lock);
738+ lio->glist_lock = NULL;
739+
737740 if (!lio->glist)
738741 return;
739742
@@ -741,23 +744,26 @@ static void delete_glists(struct lio *lio) · 1 unmodified line
741744 do {
742745 g = (struct octnic_gather *)
743746 list_delete_head(&lio->glist[i]);
744− if (g) {
745− if (g->sg) {
746− dma_unmap_single(&lio->oct_dev->
747− pci_dev->dev,
748− g->sg_dma_ptr,
749− g->sg_size,
750− DMA_TO_DEVICE);
751− kfree((void *)((unsigned long)g->sg -
752− g->adjust));
753− }
747+ if (g)
754748 kfree(g);
755− }
756749 } while (g);
750+
751+ if (lio->glists_virt_base && lio->glists_virt_base[i]) {
752+ lio_dma_free(lio->oct_dev,
753+ lio->glist_entry_size * lio->tx_qsize,
754+ lio->glists_virt_base[i],
755+ lio->glists_dma_base[i]);
756+ }
757757 }
758758
759− kfree((void *)lio->glist);
760− kfree((void *)lio->glist_lock);
759+ kfree(lio->glists_virt_base);
760+ lio->glists_virt_base = NULL;
761+
762+ kfree(lio->glists_dma_base);
763+ lio->glists_dma_base = NULL;
764+
765+ kfree(lio->glist);
766+ lio->glist = NULL;
761767 }
762768
763769 /**
@@ -772,13 +778,30 @@ static int setup_glists(struct octeon_device *oct, struct lio *lio, int num_iqs) · 8 unmodified lines
772778 lio->glist_lock = kcalloc(num_iqs, sizeof(*lio->glist_lock),
773779 GFP_KERNEL);
774780 if (!lio->glist_lock)
775− return 1;
781+ return -ENOMEM;
776782
777783 lio->glist = kcalloc(num_iqs, sizeof(*lio->glist),
778784 GFP_KERNEL);
779785 if (!lio->glist) {
780− kfree((void *)lio->glist_lock);
781− return 1;
786+ kfree(lio->glist_lock);
787+ lio->glist_lock = NULL;
788+ return -ENOMEM;
789+ }
790+
791+ lio->glist_entry_size =
792+ ROUNDUP8((ROUNDUP4(OCTNIC_MAX_SG) >> 2) * OCT_SG_ENTRY_SIZE);
793+
794+ /* allocate memory to store virtual and dma base address of
795+ * per glist consistent memory
796+ */
797+ lio->glists_virt_base = kcalloc(num_iqs, sizeof(*lio->glists_virt_base),
798+ GFP_KERNEL);
799+ lio->glists_dma_base = kcalloc(num_iqs, sizeof(*lio->glists_dma_base),
800+ GFP_KERNEL);
801+
802+ if (!lio->glists_virt_base || !lio->glists_dma_base) {
803+ delete_glists(lio);
804+ return -ENOMEM;
782805 }
783806
784807 for (i = 0; i < num_iqs; i++) {
@@ -788,6 +811,16 @@ static int setup_glists(struct octeon_device *oct, struct lio *lio, int num_iqs) · 3 unmodified lines
788811
789812 INIT_LIST_HEAD(&lio->glist[i]);
790813
814+ lio->glists_virt_base[i] =
815+ lio_dma_alloc(oct,
816+ lio->glist_entry_size * lio->tx_qsize,
817+ &lio->glists_dma_base[i]);
818+
819+ if (!lio->glists_virt_base[i]) {
820+ delete_glists(lio);
821+ return -ENOMEM;
822+ }
823+
791824 for (j = 0; j < lio->tx_qsize; j++) {
792825 g = kzalloc_node(sizeof(*g), GFP_KERNEL,
793826 numa_node);
@@ -796,43 +829,18 @@ static int setup_glists(struct octeon_device *oct, struct lio *lio, int num_iqs) · 2 unmodified lines
796829 if (!g)
797830 break;
798831
799− g->sg_size = ((ROUNDUP4(OCTNIC_MAX_SG) >> 2) *
800− OCT_SG_ENTRY_SIZE);
832+ g->sg = lio->glists_virt_base[i] +
833+ (j * lio->glist_entry_size);
801834
802− g->sg = kmalloc_node(g->sg_size + 8,
803− GFP_KERNEL, numa_node);
804− if (!g->sg)
805− g->sg = kmalloc(g->sg_size + 8, GFP_KERNEL);
806− if (!g->sg) {
807− kfree(g);
808− break;
809− }
810−
811− /* The gather component should be aligned on 64-bit
812− * boundary
813− */
814− if (((unsigned long)g->sg) & 7) {
815− g->adjust = 8 - (((unsigned long)g->sg) & 7);
816− g->sg = (struct octeon_sg_entry *)
817− ((unsigned long)g->sg + g->adjust);
818− }
819− g->sg_dma_ptr = dma_map_single(&oct->pci_dev->dev,
820− g->sg, g->sg_size,
821− DMA_TO_DEVICE);
822− if (dma_mapping_error(&oct->pci_dev->dev,
823− g->sg_dma_ptr)) {
824− kfree((void *)((unsigned long)g->sg -
825− g->adjust));
826− kfree(g);
827− break;
828− }
835+ g->sg_dma_ptr = lio->glists_dma_base[i] +
836+ (j * lio->glist_entry_size);
829837
830838 list_add_tail(&g->list, &lio->glist[i]);
831839 }
832840
833841 if (j != lio->tx_qsize) {
834842 delete_glists(lio);
835− return 1;
843+ return -ENOMEM;
836844 }
837845 }
838846
@@ -1885,9 +1893,6 @@ static void free_netsgbuf(void *buf) · 1046 unmodified lines
18851893 i++;
18861894 }
18871895
1888− dma_sync_single_for_cpu(&lio->oct_dev->pci_dev->dev,
1889− g->sg_dma_ptr, g->sg_size, DMA_TO_DEVICE);
1890−
18911896 iq = skb_iq(lio, skb);
18921897 spin_lock(&lio->glist_lock[iq]);
18931898 list_add_tail(&g->list, &lio->glist[iq]);
@@ -1933,9 +1938,6 @@ static void free_netsgbuf_with_resp(void *buf) · 39 unmodified lines
19331938 i++;
19341939 }
19351940
1936− dma_sync_single_for_cpu(&lio->oct_dev->pci_dev->dev,
1937− g->sg_dma_ptr, g->sg_size, DMA_TO_DEVICE);
1938−
19391941 iq = skb_iq(lio, skb);
19401942
19411943 spin_lock(&lio->glist_lock[iq]);
@@ -3273,8 +3275,6 @@ static int liquidio_xmit(struct sk_buff *skb, struct net_device *netdev) · 1331 unmodified lines
32733275 i++;
32743276 }
32753277
3276− dma_sync_single_for_device(&oct->pci_dev->dev, g->sg_dma_ptr,
3277− g->sg_size, DMA_TO_DEVICE);
32783278 dptr = g->sg_dma_ptr;
32793279
32803280 if (OCTEON_CN23XX_PF(oct))
drivers/net/ethernet/cavium/liquidio/lio_vf_main.c+55−49
@@ -108,6 +108,8 @@ struct octnic_gather { · 107 unmodified lines
108108 * received from the IP layer.
109109 */
110110 struct octeon_sg_entry *sg;
111+
112+ dma_addr_t sg_dma_ptr;
111113 };
112114
113115 struct octeon_device_priv {
@@ -490,6 +492,9 @@ static void delete_glists(struct lio *lio) · 376 unmodified lines
490492 struct octnic_gather *g;
491493 int i;
492494
495+ kfree(lio->glist_lock);
496+ lio->glist_lock = NULL;
497+
493498 if (!lio->glist)
494499 return;
495500
@@ -497,17 +502,26 @@ static void delete_glists(struct lio *lio) · 1 unmodified line
497502 do {
498503 g = (struct octnic_gather *)
499504 list_delete_head(&lio->glist[i]);
500− if (g) {
501− if (g->sg)
502− kfree((void *)((unsigned long)g->sg -
503− g->adjust));
505+ if (g)
504506 kfree(g);
505− }
506507 } while (g);
508+
509+ if (lio->glists_virt_base && lio->glists_virt_base[i]) {
510+ lio_dma_free(lio->oct_dev,
511+ lio->glist_entry_size * lio->tx_qsize,
512+ lio->glists_virt_base[i],
513+ lio->glists_dma_base[i]);
514+ }
507515 }
508516
517+ kfree(lio->glists_virt_base);
518+ lio->glists_virt_base = NULL;
519+
520+ kfree(lio->glists_dma_base);
521+ lio->glists_dma_base = NULL;
522+
509523 kfree(lio->glist);
510− kfree(lio->glist_lock);
524+ lio->glist = NULL;
511525 }
512526
513527 /**
@@ -522,13 +536,30 @@ static int setup_glists(struct lio *lio, int num_iqs) · 8 unmodified lines
522536 lio->glist_lock =
523537 kzalloc(sizeof(*lio->glist_lock) * num_iqs, GFP_KERNEL);
524538 if (!lio->glist_lock)
525− return 1;
539+ return -ENOMEM;
526540
527541 lio->glist =
528542 kzalloc(sizeof(*lio->glist) * num_iqs, GFP_KERNEL);
529543 if (!lio->glist) {
530544 kfree(lio->glist_lock);
531− return 1;
545+ lio->glist_lock = NULL;
546+ return -ENOMEM;
547+ }
548+
549+ lio->glist_entry_size =
550+ ROUNDUP8((ROUNDUP4(OCTNIC_MAX_SG) >> 2) * OCT_SG_ENTRY_SIZE);
551+
552+ /* allocate memory to store virtual and dma base address of
553+ * per glist consistent memory
554+ */
555+ lio->glists_virt_base = kcalloc(num_iqs, sizeof(*lio->glists_virt_base),
556+ GFP_KERNEL);
557+ lio->glists_dma_base = kcalloc(num_iqs, sizeof(*lio->glists_dma_base),
558+ GFP_KERNEL);
559+
560+ if (!lio->glists_virt_base || !lio->glists_dma_base) {
561+ delete_glists(lio);
562+ return -ENOMEM;
532563 }
533564
534565 for (i = 0; i < num_iqs; i++) {
@@ -536,34 +567,33 @@ static int setup_glists(struct lio *lio, int num_iqs) · 1 unmodified line
536567
537568 INIT_LIST_HEAD(&lio->glist[i]);
538569
570+ lio->glists_virt_base[i] =
571+ lio_dma_alloc(lio->oct_dev,
572+ lio->glist_entry_size * lio->tx_qsize,
573+ &lio->glists_dma_base[i]);
574+
575+ if (!lio->glists_virt_base[i]) {
576+ delete_glists(lio);
577+ return -ENOMEM;
578+ }
579+
539580 for (j = 0; j < lio->tx_qsize; j++) {
540581 g = kzalloc(sizeof(*g), GFP_KERNEL);
541582 if (!g)
542583 break;
543584
544− g->sg_size = ((ROUNDUP4(OCTNIC_MAX_SG) >> 2) *
545− OCT_SG_ENTRY_SIZE);
585+ g->sg = lio->glists_virt_base[i] +
586+ (j * lio->glist_entry_size);
546587
547− g->sg = kmalloc(g->sg_size + 8, GFP_KERNEL);
548− if (!g->sg) {
549− kfree(g);
550− break;
551− }
588+ g->sg_dma_ptr = lio->glists_dma_base[i] +
589+ (j * lio->glist_entry_size);
552590
553− /* The gather component should be aligned on 64-bit
554− * boundary
555− */
556− if (((unsigned long)g->sg) & 7) {
557− g->adjust = 8 - (((unsigned long)g->sg) & 7);
558− g->sg = (struct octeon_sg_entry *)
559− ((unsigned long)g->sg + g->adjust);
560− }
561591 list_add_tail(&g->list, &lio->glist[i]);
562592 }
563593
564594 if (j != lio->tx_qsize) {
565595 delete_glists(lio);
566− return 1;
596+ return -ENOMEM;
567597 }
568598 }
569599
@@ -1324,10 +1354,6 @@ static void free_netsgbuf(void *buf) · 754 unmodified lines
13241354 i++;
13251355 }
13261356
1327− dma_unmap_single(&lio->oct_dev->pci_dev->dev,
1328− finfo->dptr, g->sg_size,
1329− DMA_TO_DEVICE);
1330−
13311357 iq = skb_iq(lio, skb);
13321358
13331359 spin_lock(&lio->glist_lock[iq]);
@@ -1374,10 +1400,6 @@ static void free_netsgbuf_with_resp(void *buf) · 40 unmodified lines
13741400 i++;
13751401 }
13761402
1377− dma_unmap_single(&lio->oct_dev->pci_dev->dev,
1378− finfo->dptr, g->sg_size,
1379− DMA_TO_DEVICE);
1380−
13811403 iq = skb_iq(lio, skb);
13821404
13831405 spin_lock(&lio->glist_lock[iq]);
@@ -2382,23 +2404,7 @@ static int liquidio_xmit(struct sk_buff *skb, struct net_device *netdev) · 998 unmodified lines
23822404 i++;
23832405 }
23842406
2385− dptr = dma_map_single(&oct->pci_dev->dev,
2386− g->sg, g->sg_size,
2387− DMA_TO_DEVICE);
2388− if (dma_mapping_error(&oct->pci_dev->dev, dptr)) {
2389− dev_err(&oct->pci_dev->dev, "%s DMA mapping error 4\n",
2390− __func__);
2391− dma_unmap_single(&oct->pci_dev->dev, g->sg[0].ptr[0],
2392− skb->len - skb->data_len,
2393− DMA_TO_DEVICE);
2394− for (j = 1; j <= frags; j++) {
2395− frag = &skb_shinfo(skb)->frags[j - 1];
2396− dma_unmap_page(&oct->pci_dev->dev,
2397− g->sg[j >> 2].ptr[j & 3],
2398− frag->size, DMA_TO_DEVICE);
2399− }
2400− return NETDEV_TX_BUSY;
2401− }
2407+ dptr = g->sg_dma_ptr;
24022408
24032409 ndata.cmd.cmd3.dptr = dptr;
24042410 finfo->dptr = dptr;
drivers/net/ethernet/cavium/liquidio/octeon_config.h+3−3
@@ -71,17 +71,17 @@ · 70 unmodified lines
7171 #define CN23XX_MAX_RINGS_PER_VF 8
7272
7373 #define CN23XX_MAX_INPUT_QUEUES CN23XX_MAX_RINGS_PER_PF
74−#define CN23XX_MAX_IQ_DESCRIPTORS 2048
74+#define CN23XX_MAX_IQ_DESCRIPTORS 512
7575 #define CN23XX_DB_MIN 1
7676 #define CN23XX_DB_MAX 8
7777 #define CN23XX_DB_TIMEOUT 1
7878
7979 #define CN23XX_MAX_OUTPUT_QUEUES CN23XX_MAX_RINGS_PER_PF
80−#define CN23XX_MAX_OQ_DESCRIPTORS 2048
80+#define CN23XX_MAX_OQ_DESCRIPTORS 512
8181 #define CN23XX_OQ_BUF_SIZE 1536
8282 #define CN23XX_OQ_PKTSPER_INTR 128
8383 /*#define CAVIUM_ONLY_CN23XX_RX_PERF*/
84−#define CN23XX_OQ_REFIL_THRESHOLD 128
84+#define CN23XX_OQ_REFIL_THRESHOLD 16
8585
8686 #define CN23XX_OQ_INTR_PKT 64
8787 #define CN23XX_OQ_INTR_TIME 100
drivers/net/ethernet/cavium/liquidio/octeon_droq.c+2−15
@@ -155,11 +155,6 @@ octeon_droq_destroy_ring_buffers(struct octeon_device *oct, · 154 unmodified lines
155155 recv_buffer_destroy(droq->recv_buf_list[i].buffer,
156156 pg_info);
157157
158− if (droq->desc_ring && droq->desc_ring[i].info_ptr)
159− lio_unmap_ring_info(oct->pci_dev,
160− (u64)droq->
161− desc_ring[i].info_ptr,
162− OCT_DROQ_INFO_SIZE);
163158 droq->recv_buf_list[i].buffer = NULL;
164159 }
165160
@@ -211,10 +206,7 @@ int octeon_delete_droq(struct octeon_device *oct, u32 q_no) · 45 unmodified lines
211206 vfree(droq->recv_buf_list);
212207
213208 if (droq->info_base_addr)
214− cnnic_free_aligned_dma(oct->pci_dev, droq->info_list,
215− droq->info_alloc_size,
216− droq->info_base_addr,
217− droq->info_list_dma);
209+ lio_free_info_buffer(oct, droq);
218210
219211 if (droq->desc_ring)
220212 lio_dma_free(oct, (droq->max_count * OCT_DROQ_DESC_SIZE),
@@ -294,12 +286,7 @@ int octeon_init_droq(struct octeon_device *oct, · 73 unmodified lines
294286 dev_dbg(&oct->pci_dev->dev, "droq[%d]: num_desc: %d\n", q_no,
295287 droq->max_count);
296288
297− droq->info_list =
298− cnnic_numa_alloc_aligned_dma((droq->max_count *
299− OCT_DROQ_INFO_SIZE),
300− &droq->info_alloc_size,
301− &droq->info_base_addr,
302− numa_node);
289+ droq->info_list = lio_alloc_info_buffer(oct, droq);
303290 if (!droq->info_list) {
304291 dev_err(&oct->pci_dev->dev, "Cannot allocate memory for info list.\n");
305292 lio_dma_free(oct, (droq->max_count * OCT_DROQ_DESC_SIZE),
drivers/net/ethernet/cavium/liquidio/octeon_droq.h+2−2
@@ -325,10 +325,10 @@ struct octeon_droq { · 324 unmodified lines
325325 size_t desc_ring_dma;
326326
327327 /** Info ptr list are allocated at this virtual address. */
328− size_t info_base_addr;
328+ void *info_base_addr;
329329
330330 /** DMA mapped address of the info list */
331− size_t info_list_dma;
331+ dma_addr_t info_list_dma;
332332
333333 /** Allocated size of info list. */
334334 u32 info_alloc_size;
drivers/net/ethernet/cavium/liquidio/octeon_main.h+0−42
@@ -140,48 +140,6 @@ err_release_region: · 139 unmodified lines
140140 return 1;
141141 }
142142
143−static inline void *
144−cnnic_numa_alloc_aligned_dma(u32 size,
145− u32 *alloc_size,
146− size_t *orig_ptr,
147− int numa_node)
148−{
149− int retries = 0;
150− void *ptr = NULL;
151−
152−#define OCTEON_MAX_ALLOC_RETRIES 1
153− do {
154− struct page *page = NULL;
155−
156− page = alloc_pages_node(numa_node,
157− GFP_KERNEL,
158− get_order(size));
159− if (!page)
160− page = alloc_pages(GFP_KERNEL,
161− get_order(size));
162− ptr = (void *)page_address(page);
163− if ((unsigned long)ptr & 0x07) {
164− __free_pages(page, get_order(size));
165− ptr = NULL;
166− /* Increment the size required if the first
167− * attempt failed.
168− */
169− if (!retries)
170− size += 7;
171− }
172− retries++;
173− } while ((retries <= OCTEON_MAX_ALLOC_RETRIES) && !ptr);
174−
175− *alloc_size = size;
176− *orig_ptr = (unsigned long)ptr;
177− if ((unsigned long)ptr & 0x07)
178− ptr = (void *)(((unsigned long)ptr + 7) & ~(7UL));
179− return ptr;
180−}
181−
182−#define cnnic_free_aligned_dma(pci_dev, ptr, size, orig_ptr, dma_addr) \
183− free_pages(orig_ptr, get_order(size))
184−
185143 static inline int
186144 sleep_cond(wait_queue_head_t *wait_queue, int *condition)
187145 {
drivers/net/ethernet/cavium/liquidio/octeon_network.h+27−16
@@ -62,6 +62,9 @@ struct lio { · 61 unmodified lines
6262
6363 /** Array of gather component linked lists */
6464 struct list_head *glist;
65+ void **glists_virt_base;
66+ dma_addr_t *glists_dma_base;
67+ u32 glist_entry_size;
6568
6669 /** Pointer to the NIC properties for the Octeon device this network
6770 * interface is associated with.
@@ -344,6 +347,29 @@ static inline void tx_buffer_free(void *buffer) · 276 unmodified lines
344347 #define lio_dma_free(oct, size, virt_addr, dma_addr) \
345348 dma_free_coherent(&(oct)->pci_dev->dev, size, virt_addr, dma_addr)
346349
350+static inline void *
351+lio_alloc_info_buffer(struct octeon_device *oct,
352+ struct octeon_droq *droq)
353+{
354+ void *virt_ptr;
355+
356+ virt_ptr = lio_dma_alloc(oct, (droq->max_count * OCT_DROQ_INFO_SIZE),
357+ &droq->info_list_dma);
358+ if (virt_ptr) {
359+ droq->info_alloc_size = droq->max_count * OCT_DROQ_INFO_SIZE;
360+ droq->info_base_addr = virt_ptr;
361+ }
362+
363+ return virt_ptr;
364+}
365+
366+static inline void lio_free_info_buffer(struct octeon_device *oct,
367+ struct octeon_droq *droq)
368+{
369+ lio_dma_free(oct, droq->info_alloc_size, droq->info_base_addr,
370+ droq->info_list_dma);
371+}
372+
347373 static inline
348374 void *get_rbd(struct sk_buff *skb)
349375 {
@@ -359,22 +385,7 @@ void *get_rbd(struct sk_buff *skb) · 9 unmodified lines
359385 static inline u64
360386 lio_map_ring_info(struct octeon_droq *droq, u32 i)
361387 {
362− dma_addr_t dma_addr;
363− struct octeon_device *oct = droq->oct_dev;
364−
365− dma_addr = dma_map_single(&oct->pci_dev->dev, &droq->info_list[i],
366− OCT_DROQ_INFO_SIZE, DMA_FROM_DEVICE);
367−
368− WARN_ON(dma_mapping_error(&oct->pci_dev->dev, dma_addr));
369−
370− return (u64)dma_addr;
371−}
372−
373−static inline void
374−lio_unmap_ring_info(struct pci_dev *pci_dev,
375− u64 info_ptr, u32 size)
376−{
377− dma_unmap_single(&pci_dev->dev, info_ptr, size, DMA_FROM_DEVICE);
388+ return droq->info_list_dma + (i * sizeof(struct octeon_droq_info));
378389 }
379390
380391 static inline u64
drivers/net/ethernet/cavium/thunder/nic.h+1−0
@@ -269,6 +269,7 @@ struct nicvf { · 268 unmodified lines
269269 #define MAX_QUEUES_PER_QSET 8
270270 struct queue_set *qs;
271271 struct nicvf_cq_poll *napi[8];
272+ void *iommu_domain;
272273 u8 vf_id;
273274 u8 sqs_id;
274275 bool sqs_mode;
drivers/net/ethernet/cavium/thunder/nicvf_main.c+11−1
@@ -16,6 +16,7 @@ · 15 unmodified lines
1616 #include <linux/log2.h>
1717 #include <linux/prefetch.h>
1818 #include <linux/irq.h>
19+#include <linux/iommu.h>
1920
2021 #include "nic_reg.h"
2122 #include "nic.h"
@@ -525,7 +526,12 @@ static void nicvf_snd_pkt_handler(struct net_device *netdev, · 503 unmodified lines
525526 /* Get actual TSO descriptors and free them */
526527 tso_sqe =
527528 (struct sq_hdr_subdesc *)GET_SQ_DESC(sq, hdr->rsvd2);
529+ nicvf_unmap_sndq_buffers(nic, sq, hdr->rsvd2,
530+ tso_sqe->subdesc_cnt);
528531 nicvf_put_sq_desc(sq, tso_sqe->subdesc_cnt + 1);
532+ } else {
533+ nicvf_unmap_sndq_buffers(nic, sq, cqe_tx->sqe_ptr,
534+ hdr->subdesc_cnt);
529535 }
530536 nicvf_put_sq_desc(sq, hdr->subdesc_cnt + 1);
531537 prefetch(skb);
@@ -576,6 +582,7 @@ static void nicvf_rcv_pkt_handler(struct net_device *netdev, · 44 unmodified lines
576582 {
577583 struct sk_buff *skb;
578584 struct nicvf *nic = netdev_priv(netdev);
585+ struct nicvf *snic = nic;
579586 int err = 0;
580587 int rq_idx;
581588
@@ -592,7 +599,7 @@ static void nicvf_rcv_pkt_handler(struct net_device *netdev, · 10 unmodified lines
592599 if (err && !cqe_rx->rb_cnt)
593600 return;
594601
595− skb = nicvf_get_rcv_skb(nic, cqe_rx);
602+ skb = nicvf_get_rcv_skb(snic, cqe_rx);
596603 if (!skb) {
597604 netdev_dbg(nic->netdev, "Packet not received\n");
598605 return;
@@ -1643,6 +1650,9 @@ static int nicvf_probe(struct pci_dev *pdev, const struct pci_device_id *ent) · 1044 unmodified lines
16431650 if (!pass1_silicon(nic->pdev))
16441651 nic->hw_tso = true;
16451652
1653+ /* Get iommu domain for iova to physical addr conversion */
1654+ nic->iommu_domain = iommu_get_domain_for_dev(dev);
1655+
16461656 pci_read_config_word(nic->pdev, PCI_SUBSYSTEM_ID, &sdevid);
16471657 if (sdevid == 0xA134)
16481658 nic->t88 = true;
drivers/net/ethernet/cavium/thunder/nicvf_queues.c+145−39
@@ -10,6 +10,7 @@ · 9 unmodified lines
1010 #include <linux/netdevice.h>
1111 #include <linux/ip.h>
1212 #include <linux/etherdevice.h>
13+#include <linux/iommu.h>
1314 #include <net/ip.h>
1415 #include <net/tso.h>
1516
@@ -18,6 +19,16 @@ · 2 unmodified lines
1819 #include "q_struct.h"
1920 #include "nicvf_queues.h"
2021
22+#define NICVF_PAGE_ORDER ((PAGE_SIZE <= 4096) ? PAGE_ALLOC_COSTLY_ORDER : 0)
23+
24+static inline u64 nicvf_iova_to_phys(struct nicvf *nic, dma_addr_t dma_addr)
25+{
26+ /* Translation is installed only when IOMMU is present */
27+ if (nic->iommu_domain)
28+ return iommu_iova_to_phys(nic->iommu_domain, dma_addr);
29+ return dma_addr;
30+}
31+
2132 static void nicvf_get_page(struct nicvf *nic)
2233 {
2334 if (!nic->rb_pageref || !nic->rb_page)
@@ -87,7 +98,7 @@ static void nicvf_free_q_desc_mem(struct nicvf *nic, struct q_desc_mem *dmem) · 63 unmodified lines
8798 static inline int nicvf_alloc_rcv_buffer(struct nicvf *nic, gfp_t gfp,
8899 u32 buf_len, u64 **rbuf)
89100 {
90− int order = (PAGE_SIZE <= 4096) ? PAGE_ALLOC_COSTLY_ORDER : 0;
101+ int order = NICVF_PAGE_ORDER;
91102
92103 /* Check if request can be accomodated in previous allocated page */
93104 if (nic->rb_page &&
@@ -97,22 +108,27 @@ static inline int nicvf_alloc_rcv_buffer(struct nicvf *nic, gfp_t gfp, · 3 unmodified lines
97108 }
98109
99110 nicvf_get_page(nic);
100− nic->rb_page = NULL;
101111
102112 /* Allocate a new page */
113+ nic->rb_page = alloc_pages(gfp | __GFP_COMP | __GFP_NOWARN,
114+ order);
103115 if (!nic->rb_page) {
104− nic->rb_page = alloc_pages(gfp | __GFP_COMP | __GFP_NOWARN,
105− order);
106− if (!nic->rb_page) {
107− this_cpu_inc(nic->pnicvf->drv_stats->
108− rcv_buffer_alloc_failures);
109− return -ENOMEM;
110− }
111− nic->rb_page_offset = 0;
116+ this_cpu_inc(nic->pnicvf->drv_stats->rcv_buffer_alloc_failures);
117+ return -ENOMEM;
112118 }
113−
119+ nic->rb_page_offset = 0;
114120 ret:
115− *rbuf = (u64 *)((u64)page_address(nic->rb_page) + nic->rb_page_offset);
121+ /* HW will ensure data coherency, CPU sync not required */
122+ *rbuf = (u64 *)((u64)dma_map_page_attrs(&nic->pdev->dev, nic->rb_page,
123+ nic->rb_page_offset, buf_len,
124+ DMA_FROM_DEVICE,
125+ DMA_ATTR_SKIP_CPU_SYNC));
126+ if (dma_mapping_error(&nic->pdev->dev, (dma_addr_t)*rbuf)) {
127+ if (!nic->rb_page_offset)
128+ __free_pages(nic->rb_page, order);
129+ nic->rb_page = NULL;
130+ return -ENOMEM;
131+ }
116132 nic->rb_page_offset += buf_len;
117133
118134 return 0;
@@ -158,16 +174,21 @@ static int nicvf_init_rbdr(struct nicvf *nic, struct rbdr *rbdr, · 39 unmodified lines
158174 rbdr->dma_size = buf_size;
159175 rbdr->enable = true;
160176 rbdr->thresh = RBDR_THRESH;
177+ rbdr->head = 0;
178+ rbdr->tail = 0;
161179
162180 nic->rb_page = NULL;
163181 for (idx = 0; idx < ring_len; idx++) {
164182 err = nicvf_alloc_rcv_buffer(nic, GFP_KERNEL, RCV_FRAG_LEN,
165183 &rbuf);
166− if (err)
184+ if (err) {
185+ /* To free already allocated and mapped ones */
186+ rbdr->tail = idx - 1;
167187 return err;
188+ }
168189
169190 desc = GET_RBDR_DESC(rbdr, idx);
170− desc->buf_addr = virt_to_phys(rbuf) >> NICVF_RCV_BUF_ALIGN;
191+ desc->buf_addr = (u64)rbuf >> NICVF_RCV_BUF_ALIGN;
171192 }
172193
173194 nicvf_get_page(nic);
@@ -179,7 +200,7 @@ static int nicvf_init_rbdr(struct nicvf *nic, struct rbdr *rbdr, · 5 unmodified lines
179200 static void nicvf_free_rbdr(struct nicvf *nic, struct rbdr *rbdr)
180201 {
181202 int head, tail;
182− u64 buf_addr;
203+ u64 buf_addr, phys_addr;
183204 struct rbdr_entry_t *desc;
184205
185206 if (!rbdr)
@@ -192,18 +213,26 @@ static void nicvf_free_rbdr(struct nicvf *nic, struct rbdr *rbdr) · 6 unmodified lines
192213 head = rbdr->head;
193214 tail = rbdr->tail;
194215
195− /* Free SKBs */
216+ /* Release page references */
196217 while (head != tail) {
197218 desc = GET_RBDR_DESC(rbdr, head);
198− buf_addr = desc->buf_addr << NICVF_RCV_BUF_ALIGN;
199− put_page(virt_to_page(phys_to_virt(buf_addr)));
219+ buf_addr = ((u64)desc->buf_addr) << NICVF_RCV_BUF_ALIGN;
220+ phys_addr = nicvf_iova_to_phys(nic, buf_addr);
221+ dma_unmap_page_attrs(&nic->pdev->dev, buf_addr, RCV_FRAG_LEN,
222+ DMA_FROM_DEVICE, DMA_ATTR_SKIP_CPU_SYNC);
223+ if (phys_addr)
224+ put_page(virt_to_page(phys_to_virt(phys_addr)));
200225 head++;
201226 head &= (rbdr->dmem.q_len - 1);
202227 }
203− /* Free SKB of tail desc */
228+ /* Release buffer of tail desc */
204229 desc = GET_RBDR_DESC(rbdr, tail);
205− buf_addr = desc->buf_addr << NICVF_RCV_BUF_ALIGN;
206− put_page(virt_to_page(phys_to_virt(buf_addr)));
230+ buf_addr = ((u64)desc->buf_addr) << NICVF_RCV_BUF_ALIGN;
231+ phys_addr = nicvf_iova_to_phys(nic, buf_addr);
232+ dma_unmap_page_attrs(&nic->pdev->dev, buf_addr, RCV_FRAG_LEN,
233+ DMA_FROM_DEVICE, DMA_ATTR_SKIP_CPU_SYNC);
234+ if (phys_addr)
235+ put_page(virt_to_page(phys_to_virt(phys_addr)));
207236
208237 /* Free RBDR ring */
209238 nicvf_free_q_desc_mem(nic, &rbdr->dmem);
@@ -250,7 +279,7 @@ refill: · 40 unmodified lines
250279 break;
251280
252281 desc = GET_RBDR_DESC(rbdr, tail);
253− desc->buf_addr = virt_to_phys(rbuf) >> NICVF_RCV_BUF_ALIGN;
282+ desc->buf_addr = (u64)rbuf >> NICVF_RCV_BUF_ALIGN;
254283 refill_rb_cnt--;
255284 new_rb++;
256285 }
@@ -361,9 +390,29 @@ static int nicvf_init_snd_queue(struct nicvf *nic, · 104 unmodified lines
361390 return 0;
362391 }
363392
393+void nicvf_unmap_sndq_buffers(struct nicvf *nic, struct snd_queue *sq,
394+ int hdr_sqe, u8 subdesc_cnt)
395+{
396+ u8 idx;
397+ struct sq_gather_subdesc *gather;
398+
399+ /* Unmap DMA mapped skb data buffers */
400+ for (idx = 0; idx < subdesc_cnt; idx++) {
401+ hdr_sqe++;
402+ hdr_sqe &= (sq->dmem.q_len - 1);
403+ gather = (struct sq_gather_subdesc *)GET_SQ_DESC(sq, hdr_sqe);
404+ /* HW will ensure data coherency, CPU sync not required */
405+ dma_unmap_page_attrs(&nic->pdev->dev, gather->addr,
406+ gather->size, DMA_TO_DEVICE,
407+ DMA_ATTR_SKIP_CPU_SYNC);
408+ }
409+}
410+
364411 static void nicvf_free_snd_queue(struct nicvf *nic, struct snd_queue *sq)
365412 {
366413 struct sk_buff *skb;
414+ struct sq_hdr_subdesc *hdr;
415+ struct sq_hdr_subdesc *tso_sqe;
367416
368417 if (!sq)
369418 return;
@@ -379,8 +428,22 @@ static void nicvf_free_snd_queue(struct nicvf *nic, struct snd_queue *sq) · 9 unmodified lines
379428 smp_rmb();
380429 while (sq->head != sq->tail) {
381430 skb = (struct sk_buff *)sq->skbuff[sq->head];
382− if (skb)
383− dev_kfree_skb_any(skb);
431+ if (!skb)
432+ goto next;
433+ hdr = (struct sq_hdr_subdesc *)GET_SQ_DESC(sq, sq->head);
434+ /* Check for dummy descriptor used for HW TSO offload on 88xx */
435+ if (hdr->dont_send) {
436+ /* Get actual TSO descriptors and unmap them */
437+ tso_sqe =
438+ (struct sq_hdr_subdesc *)GET_SQ_DESC(sq, hdr->rsvd2);
439+ nicvf_unmap_sndq_buffers(nic, sq, hdr->rsvd2,
440+ tso_sqe->subdesc_cnt);
441+ } else {
442+ nicvf_unmap_sndq_buffers(nic, sq, sq->head,
443+ hdr->subdesc_cnt);
444+ }
445+ dev_kfree_skb_any(skb);
446+next:
384447 sq->head++;
385448 sq->head &= (sq->dmem.q_len - 1);
386449 }
@@ -559,9 +622,11 @@ static void nicvf_rcv_queue_config(struct nicvf *nic, struct queue_set *qs, · 172 unmodified lines
559622 nicvf_send_msg_to_pf(nic, &mbx);
560623
561624 if (!nic->sqs_mode && (qidx == 0)) {
562− /* Enable checking L3/L4 length and TCP/UDP checksums */
625+ /* Enable checking L3/L4 length and TCP/UDP checksums
626+ * Also allow IPv6 pkts with zero UDP checksum.
627+ */
563628 nicvf_queue_reg_write(nic, NIC_QSET_RQ_GEN_CFG, 0,
564− (BIT(24) | BIT(23) | BIT(21)));
629+ (BIT(24) | BIT(23) | BIT(21) | BIT(20)));
565630 nicvf_config_vlan_stripping(nic, nic->netdev->features);
566631 }
567632
@@ -882,6 +947,14 @@ static inline int nicvf_get_sq_desc(struct snd_queue *sq, int desc_cnt) · 314 unmodified lines
882947 return qentry;
883948 }
884949
950+/* Rollback to previous tail pointer when descriptors not used */
951+static inline void nicvf_rollback_sq_desc(struct snd_queue *sq,
952+ int qentry, int desc_cnt)
953+{
954+ sq->tail = qentry;
955+ atomic_add(desc_cnt, &sq->free_cnt);
956+}
957+
885958 /* Free descriptor back to SQ for future use */
886959 void nicvf_put_sq_desc(struct snd_queue *sq, int desc_cnt)
887960 {
@@ -1207,8 +1280,9 @@ int nicvf_sq_append_skb(struct nicvf *nic, struct snd_queue *sq, · 319 unmodified lines
12071280 struct sk_buff *skb, u8 sq_num)
12081281 {
12091282 int i, size;
1210− int subdesc_cnt, tso_sqe = 0;
1283+ int subdesc_cnt, hdr_sqe = 0;
12111284 int qentry;
1285+ u64 dma_addr;
12121286
12131287 subdesc_cnt = nicvf_sq_subdesc_required(nic, skb);
12141288 if (subdesc_cnt > atomic_read(&sq->free_cnt))
@@ -1223,12 +1297,21 @@ int nicvf_sq_append_skb(struct nicvf *nic, struct snd_queue *sq, · 8 unmodified lines
12231297 /* Add SQ header subdesc */
12241298 nicvf_sq_add_hdr_subdesc(nic, sq, qentry, subdesc_cnt - 1,
12251299 skb, skb->len);
1226− tso_sqe = qentry;
1300+ hdr_sqe = qentry;
12271301
12281302 /* Add SQ gather subdescs */
12291303 qentry = nicvf_get_nxt_sqentry(sq, qentry);
12301304 size = skb_is_nonlinear(skb) ? skb_headlen(skb) : skb->len;
1231− nicvf_sq_add_gather_subdesc(sq, qentry, size, virt_to_phys(skb->data));
1305+ /* HW will ensure data coherency, CPU sync not required */
1306+ dma_addr = dma_map_page_attrs(&nic->pdev->dev, virt_to_page(skb->data),
1307+ offset_in_page(skb->data), size,
1308+ DMA_TO_DEVICE, DMA_ATTR_SKIP_CPU_SYNC);
1309+ if (dma_mapping_error(&nic->pdev->dev, dma_addr)) {
1310+ nicvf_rollback_sq_desc(sq, qentry, subdesc_cnt);
1311+ return 0;
1312+ }
1313+
1314+ nicvf_sq_add_gather_subdesc(sq, qentry, size, dma_addr);
12321315
12331316 /* Check for scattered buffer */
12341317 if (!skb_is_nonlinear(skb))
@@ -1241,15 +1324,26 @@ int nicvf_sq_append_skb(struct nicvf *nic, struct snd_queue *sq, · 6 unmodified lines
12411324
12421325 qentry = nicvf_get_nxt_sqentry(sq, qentry);
12431326 size = skb_frag_size(frag);
1244− nicvf_sq_add_gather_subdesc(sq, qentry, size,
1245− virt_to_phys(
1246− skb_frag_address(frag)));
1327+ dma_addr = dma_map_page_attrs(&nic->pdev->dev,
1328+ skb_frag_page(frag),
1329+ frag->page_offset, size,
1330+ DMA_TO_DEVICE,
1331+ DMA_ATTR_SKIP_CPU_SYNC);
1332+ if (dma_mapping_error(&nic->pdev->dev, dma_addr)) {
1333+ /* Free entire chain of mapped buffers
1334+ * here 'i' = frags mapped + above mapped skb->data
1335+ */
1336+ nicvf_unmap_sndq_buffers(nic, sq, hdr_sqe, i);
1337+ nicvf_rollback_sq_desc(sq, qentry, subdesc_cnt);
1338+ return 0;
1339+ }
1340+ nicvf_sq_add_gather_subdesc(sq, qentry, size, dma_addr);
12471341 }
12481342
12491343 doorbell:
12501344 if (nic->t88 && skb_shinfo(skb)->gso_size) {
12511345 qentry = nicvf_get_nxt_sqentry(sq, qentry);
1252− nicvf_sq_add_cqe_subdesc(sq, qentry, tso_sqe, skb);
1346+ nicvf_sq_add_cqe_subdesc(sq, qentry, hdr_sqe, skb);
12531347 }
12541348
12551349 nicvf_sq_doorbell(nic, skb, sq_num, subdesc_cnt);
@@ -1282,6 +1376,7 @@ struct sk_buff *nicvf_get_rcv_skb(struct nicvf *nic, struct cqe_rx_t *cqe_rx) · 26 unmodified lines
12821376 int offset;
12831377 u16 *rb_lens = NULL;
12841378 u64 *rb_ptrs = NULL;
1379+ u64 phys_addr;
12851380
12861381 rb_lens = (void *)cqe_rx + (3 * sizeof(u64));
12871382 /* Except 88xx pass1 on all other chips CQE_RX2_S is added to
@@ -1296,15 +1391,23 @@ struct sk_buff *nicvf_get_rcv_skb(struct nicvf *nic, struct cqe_rx_t *cqe_rx) · 8 unmodified lines
12961391 else
12971392 rb_ptrs = (void *)cqe_rx + (7 * sizeof(u64));
12981393
1299− netdev_dbg(nic->netdev, "%s rb_cnt %d rb0_ptr %llx rb0_sz %d\n",
1300− __func__, cqe_rx->rb_cnt, cqe_rx->rb0_ptr, cqe_rx->rb0_sz);
1301−
13021394 for (frag = 0; frag < cqe_rx->rb_cnt; frag++) {
13031395 payload_len = rb_lens[frag_num(frag)];
1396+ phys_addr = nicvf_iova_to_phys(nic, *rb_ptrs);
1397+ if (!phys_addr) {
1398+ if (skb)
1399+ dev_kfree_skb_any(skb);
1400+ return NULL;
1401+ }
1402+
13041403 if (!frag) {
13051404 /* First fragment */
1405+ dma_unmap_page_attrs(&nic->pdev->dev,
1406+ *rb_ptrs - cqe_rx->align_pad,
1407+ RCV_FRAG_LEN, DMA_FROM_DEVICE,
1408+ DMA_ATTR_SKIP_CPU_SYNC);
13061409 skb = nicvf_rb_ptr_to_skb(nic,
1307− *rb_ptrs - cqe_rx->align_pad,
1410+ phys_addr - cqe_rx->align_pad,
13081411 payload_len);
13091412 if (!skb)
13101413 return NULL;
@@ -1312,8 +1415,11 @@ struct sk_buff *nicvf_get_rcv_skb(struct nicvf *nic, struct cqe_rx_t *cqe_rx) · 1 unmodified line
13121415 skb_put(skb, payload_len);
13131416 } else {
13141417 /* Add fragments */
1315− page = virt_to_page(phys_to_virt(*rb_ptrs));
1316− offset = phys_to_virt(*rb_ptrs) - page_address(page);
1418+ dma_unmap_page_attrs(&nic->pdev->dev, *rb_ptrs,
1419+ RCV_FRAG_LEN, DMA_FROM_DEVICE,
1420+ DMA_ATTR_SKIP_CPU_SYNC);
1421+ page = virt_to_page(phys_to_virt(phys_addr));
1422+ offset = phys_to_virt(phys_addr) - page_address(page);
13171423 skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags, page,
13181424 offset, payload_len, RCV_FRAG_LEN);
13191425 }
drivers/net/ethernet/cavium/thunder/nicvf_queues.h+3−1
@@ -87,7 +87,7 @@ · 86 unmodified lines
8787 #define RCV_BUF_COUNT (1ULL << (RBDR_SIZE + 13))
8888 #define MAX_RCV_BUF_COUNT (1ULL << (RBDR_SIZE6 + 13))
8989 #define RBDR_THRESH (RCV_BUF_COUNT / 2)
90−#define DMA_BUFFER_LEN 2048 /* In multiples of 128bytes */
90+#define DMA_BUFFER_LEN 1536 /* In multiples of 128bytes */
9191 #define RCV_FRAG_LEN (SKB_DATA_ALIGN(DMA_BUFFER_LEN + NET_SKB_PAD) + \
9292 SKB_DATA_ALIGN(sizeof(struct skb_shared_info)))
9393
@@ -301,6 +301,8 @@ struct queue_set { · 207 unmodified lines
301301
302302 #define CQ_ERR_MASK (CQ_WR_FULL | CQ_WR_DISABLE | CQ_WR_FAULT)
303303
304+void nicvf_unmap_sndq_buffers(struct nicvf *nic, struct snd_queue *sq,
305+ int hdr_sqe, u8 subdesc_cnt);
304306 void nicvf_config_vlan_stripping(struct nicvf *nic,
305307 netdev_features_t features);
306308 int nicvf_set_qset_resources(struct nicvf *nic);
drivers/net/ethernet/cavium/thunder/thunder_bgx.c+45−19
@@ -123,14 +123,44 @@ static int bgx_poll_reg(struct bgx *bgx, u8 lmac, u64 reg, u64 mask, bool zero) · 122 unmodified lines
123123 return 1;
124124 }
125125
126+static int max_bgx_per_node;
127+static void set_max_bgx_per_node(struct pci_dev *pdev)
128+{
129+ u16 sdevid;
130+
131+ if (max_bgx_per_node)
132+ return;
133+
134+ pci_read_config_word(pdev, PCI_SUBSYSTEM_ID, &sdevid);
135+ switch (sdevid) {
136+ case PCI_SUBSYS_DEVID_81XX_BGX:
137+ max_bgx_per_node = MAX_BGX_PER_CN81XX;
138+ break;
139+ case PCI_SUBSYS_DEVID_83XX_BGX:
140+ max_bgx_per_node = MAX_BGX_PER_CN83XX;
141+ break;
142+ case PCI_SUBSYS_DEVID_88XX_BGX:
143+ default:
144+ max_bgx_per_node = MAX_BGX_PER_CN88XX;
145+ break;
146+ }
147+}
148+
149+static struct bgx *get_bgx(int node, int bgx_idx)
150+{
151+ int idx = (node * max_bgx_per_node) + bgx_idx;
152+
153+ return bgx_vnic[idx];
154+}
155+
126156 /* Return number of BGX present in HW */
127157 unsigned bgx_get_map(int node)
128158 {
129159 int i;
130160 unsigned map = 0;
131161
132− for (i = 0; i < MAX_BGX_PER_NODE; i++) {
133− if (bgx_vnic[(node * MAX_BGX_PER_NODE) + i])
162+ for (i = 0; i < max_bgx_per_node; i++) {
163+ if (bgx_vnic[(node * max_bgx_per_node) + i])
134164 map |= (1 << i);
135165 }
136166
@@ -143,7 +173,7 @@ int bgx_get_lmac_count(int node, int bgx_idx) · 6 unmodified lines
143173 {
144174 struct bgx *bgx;
145175
146− bgx = bgx_vnic[(node * MAX_BGX_PER_NODE) + bgx_idx];
176+ bgx = get_bgx(node, bgx_idx);
147177 if (bgx)
148178 return bgx->lmac_count;
149179
@@ -158,7 +188,7 @@ void bgx_get_lmac_link_state(int node, int bgx_idx, int lmacid, void *status) · 8 unmodified lines
158188 struct bgx *bgx;
159189 struct lmac *lmac;
160190
161− bgx = bgx_vnic[(node * MAX_BGX_PER_NODE) + bgx_idx];
191+ bgx = get_bgx(node, bgx_idx);
162192 if (!bgx)
163193 return;
164194
@@ -172,7 +202,7 @@ EXPORT_SYMBOL(bgx_get_lmac_link_state); · 7 unmodified lines
172202
173203 const u8 *bgx_get_lmac_mac(int node, int bgx_idx, int lmacid)
174204 {
175− struct bgx *bgx = bgx_vnic[(node * MAX_BGX_PER_NODE) + bgx_idx];
205+ struct bgx *bgx = get_bgx(node, bgx_idx);
176206
177207 if (bgx)
178208 return bgx->lmac[lmacid].mac;
@@ -183,7 +213,7 @@ EXPORT_SYMBOL(bgx_get_lmac_mac); · 4 unmodified lines
183213
184214 void bgx_set_lmac_mac(int node, int bgx_idx, int lmacid, const u8 *mac)
185215 {
186− struct bgx *bgx = bgx_vnic[(node * MAX_BGX_PER_NODE) + bgx_idx];
216+ struct bgx *bgx = get_bgx(node, bgx_idx);
187217
188218 if (!bgx)
189219 return;
@@ -194,7 +224,7 @@ EXPORT_SYMBOL(bgx_set_lmac_mac); · 4 unmodified lines
194224
195225 void bgx_lmac_rx_tx_enable(int node, int bgx_idx, int lmacid, bool enable)
196226 {
197− struct bgx *bgx = bgx_vnic[(node * MAX_BGX_PER_NODE) + bgx_idx];
227+ struct bgx *bgx = get_bgx(node, bgx_idx);
198228 struct lmac *lmac;
199229 u64 cfg;
200230
@@ -217,7 +247,7 @@ EXPORT_SYMBOL(bgx_lmac_rx_tx_enable); · 16 unmodified lines
217247 void bgx_lmac_get_pfc(int node, int bgx_idx, int lmacid, void *pause)
218248 {
219249 struct pfc *pfc = (struct pfc *)pause;
220− struct bgx *bgx = bgx_vnic[(node * MAX_BGX_PER_CN88XX) + bgx_idx];
250+ struct bgx *bgx = get_bgx(node, bgx_idx);
221251 struct lmac *lmac;
222252 u64 cfg;
223253
@@ -237,7 +267,7 @@ EXPORT_SYMBOL(bgx_lmac_get_pfc); · 13 unmodified lines
237267 void bgx_lmac_set_pfc(int node, int bgx_idx, int lmacid, void *pause)
238268 {
239269 struct pfc *pfc = (struct pfc *)pause;
240− struct bgx *bgx = bgx_vnic[(node * MAX_BGX_PER_CN88XX) + bgx_idx];
270+ struct bgx *bgx = get_bgx(node, bgx_idx);
241271 struct lmac *lmac;
242272 u64 cfg;
243273
@@ -369,7 +399,7 @@ u64 bgx_get_rx_stats(int node, int bgx_idx, int lmac, int idx) · 125 unmodified lines
369399 {
370400 struct bgx *bgx;
371401
372− bgx = bgx_vnic[(node * MAX_BGX_PER_NODE) + bgx_idx];
402+ bgx = get_bgx(node, bgx_idx);
373403 if (!bgx)
374404 return 0;
375405
@@ -383,7 +413,7 @@ u64 bgx_get_tx_stats(int node, int bgx_idx, int lmac, int idx) · 7 unmodified lines
383413 {
384414 struct bgx *bgx;
385415
386− bgx = bgx_vnic[(node * MAX_BGX_PER_NODE) + bgx_idx];
416+ bgx = get_bgx(node, bgx_idx);
387417 if (!bgx)
388418 return 0;
389419
@@ -411,7 +441,7 @@ void bgx_lmac_internal_loopback(int node, int bgx_idx, · 21 unmodified lines
411441 struct lmac *lmac;
412442 u64 cfg;
413443
414− bgx = bgx_vnic[(node * MAX_BGX_PER_NODE) + bgx_idx];
444+ bgx = get_bgx(node, bgx_idx);
415445 if (!bgx)
416446 return;
417447
@@ -1011,12 +1041,6 @@ static void bgx_print_qlm_mode(struct bgx *bgx, u8 lmacid) · 593 unmodified lines
10111041 dev_info(dev, "%s: 40G_KR4\n", (char *)str);
10121042 break;
10131043 case BGX_MODE_QSGMII:
1014− if ((lmacid == 0) &&
1015− (bgx_get_lane2sds_cfg(bgx, lmac) != lmacid))
1016− return;
1017− if ((lmacid == 2) &&
1018− (bgx_get_lane2sds_cfg(bgx, lmac) == lmacid))
1019− return;
10201044 dev_info(dev, "%s: QSGMII\n", (char *)str);
10211045 break;
10221046 case BGX_MODE_RGMII:
@@ -1334,11 +1358,13 @@ static int bgx_probe(struct pci_dev *pdev, const struct pci_device_id *ent) · 311 unmodified lines
13341358 goto err_release_regions;
13351359 }
13361360
1361+ set_max_bgx_per_node(pdev);
1362+
13371363 pci_read_config_word(pdev, PCI_DEVICE_ID, &sdevid);
13381364 if (sdevid != PCI_DEVICE_ID_THUNDER_RGX) {
13391365 bgx->bgx_id = (pci_resource_start(pdev,
13401366 PCI_CFG_REG_BAR_NUM) >> 24) & BGX_ID_MASK;
1341− bgx->bgx_id += nic_get_node_id(pdev) * MAX_BGX_PER_NODE;
1367+ bgx->bgx_id += nic_get_node_id(pdev) * max_bgx_per_node;
13421368 bgx->max_lmac = MAX_LMAC_PER_BGX;
13431369 bgx_vnic[bgx->bgx_id] = bgx;
13441370 } else {
drivers/net/ethernet/cavium/thunder/thunder_bgx.h+0−1
@@ -22,7 +22,6 @@ · 21 unmodified lines
2222 #define MAX_BGX_PER_CN88XX 2
2323 #define MAX_BGX_PER_CN81XX 3 /* 2 BGXs + 1 RGX */
2424 #define MAX_BGX_PER_CN83XX 4
25−#define MAX_BGX_PER_NODE 4
2625 #define MAX_LMAC_PER_BGX 4
2726 #define MAX_BGX_CHANS_PER_LMAC 16
2827 #define MAX_DMAC_PER_LMAC 8
drivers/net/ethernet/ibm/emac/core.c+17−8
@@ -2589,8 +2589,6 @@ static int emac_dt_mdio_probe(struct emac_instance *dev) · 2588 unmodified lines
25892589 static int emac_dt_phy_connect(struct emac_instance *dev,
25902590 struct device_node *phy_handle)
25912591 {
2592− int res;
2593−
25942592 dev->phy.def = devm_kzalloc(&dev->ofdev->dev, sizeof(*dev->phy.def),
25952593 GFP_KERNEL);
25962594 if (!dev->phy.def)
@@ -2617,7 +2615,7 @@ static int emac_dt_phy_probe(struct emac_instance *dev) · 20 unmodified lines
26172615 {
26182616 struct device_node *np = dev->ofdev->dev.of_node;
26192617 struct device_node *phy_handle;
2620− int res = 0;
2618+ int res = 1;
26212619
26222620 phy_handle = of_parse_phandle(np, "phy-handle", 0);
26232621
@@ -2714,13 +2712,24 @@ static int emac_init_phy(struct emac_instance *dev) · 90 unmodified lines
27142712 if (emac_has_feature(dev, EMAC_FTR_HAS_RGMII)) {
27152713 int res = emac_dt_phy_probe(dev);
27162714
2717− mutex_unlock(&emac_phy_map_lock);
2718− if (!res)
2715+ switch (res) {
2716+ case 1:
2717+ /* No phy-handle property configured.
2718+ * Continue with the existing phy probe
2719+ * and setup code.
2720+ */
2721+ break;
2722+
2723+ case 0:
2724+ mutex_unlock(&emac_phy_map_lock);
27192725 goto init_phy;
27202726
2721− dev_err(&dev->ofdev->dev, "failed to attach dt phy (%d).\n",
2722− res);
2723− return res;
2727+ default:
2728+ mutex_unlock(&emac_phy_map_lock);
2729+ dev_err(&dev->ofdev->dev, "failed to attach dt phy (%d).\n",
2730+ res);
2731+ return res;
2732+ }
27242733 }
27252734
27262735 if (dev->phy_address != 0xffffffff)
drivers/net/ethernet/ibm/ibmvnic.c+36−9
@@ -404,7 +404,7 @@ static int ibmvnic_open(struct net_device *netdev) · 403 unmodified lines
404404 send_map_query(adapter);
405405 for (i = 0; i < rxadd_subcrqs; i++) {
406406 init_rx_pool(adapter, &adapter->rx_pool[i],
407− IBMVNIC_BUFFS_PER_POOL, i,
407+ adapter->req_rx_add_entries_per_subcrq, i,
408408 be64_to_cpu(size_array[i]), 1);
409409 if (alloc_rx_pool(adapter, &adapter->rx_pool[i])) {
410410 dev_err(dev, "Couldn't alloc rx pool\n");
@@ -419,23 +419,23 @@ static int ibmvnic_open(struct net_device *netdev) · 8 unmodified lines
419419 for (i = 0; i < tx_subcrqs; i++) {
420420 tx_pool = &adapter->tx_pool[i];
421421 tx_pool->tx_buff =
422− kcalloc(adapter->max_tx_entries_per_subcrq,
422+ kcalloc(adapter->req_tx_entries_per_subcrq,
423423 sizeof(struct ibmvnic_tx_buff), GFP_KERNEL);
424424 if (!tx_pool->tx_buff)
425425 goto tx_pool_alloc_failed;
426426
427427 if (alloc_long_term_buff(adapter, &tx_pool->long_term_buff,
428− adapter->max_tx_entries_per_subcrq *
428+ adapter->req_tx_entries_per_subcrq *
429429 adapter->req_mtu))
430430 goto tx_ltb_alloc_failed;
431431
432432 tx_pool->free_map =
433− kcalloc(adapter->max_tx_entries_per_subcrq,
433+ kcalloc(adapter->req_tx_entries_per_subcrq,
434434 sizeof(int), GFP_KERNEL);
435435 if (!tx_pool->free_map)
436436 goto tx_fm_alloc_failed;
437437
438− for (j = 0; j < adapter->max_tx_entries_per_subcrq; j++)
438+ for (j = 0; j < adapter->req_tx_entries_per_subcrq; j++)
439439 tx_pool->free_map[j] = j;
440440
441441 tx_pool->consumer_index = 0;
@@ -705,6 +705,7 @@ static int ibmvnic_xmit(struct sk_buff *skb, struct net_device *netdev) · 263 unmodified lines
705705 u8 *hdrs = (u8 *)&adapter->tx_rx_desc_req;
706706 struct device *dev = &adapter->vdev->dev;
707707 struct ibmvnic_tx_buff *tx_buff = NULL;
708+ struct ibmvnic_sub_crq_queue *tx_scrq;
708709 struct ibmvnic_tx_pool *tx_pool;
709710 unsigned int tx_send_failed = 0;
710711 unsigned int tx_map_failed = 0;
@@ -724,6 +725,7 @@ static int ibmvnic_xmit(struct sk_buff *skb, struct net_device *netdev) · 13 unmodified lines
724725 int ret = 0;
725726
726727 tx_pool = &adapter->tx_pool[queue_num];
728+ tx_scrq = adapter->tx_scrq[queue_num];
727729 txq = netdev_get_tx_queue(netdev, skb_get_queue_mapping(skb));
728730 handle_array = (u64 *)((u8 *)(adapter->login_rsp_buf) +
729731 be32_to_cpu(adapter->login_rsp_buf->
@@ -744,7 +746,7 @@ static int ibmvnic_xmit(struct sk_buff *skb, struct net_device *netdev) · 14 unmodified lines
744746
745747 tx_pool->consumer_index =
746748 (tx_pool->consumer_index + 1) %
747− adapter->max_tx_entries_per_subcrq;
749+ adapter->req_tx_entries_per_subcrq;
748750
749751 tx_buff = &tx_pool->tx_buff[index];
750752 tx_buff->skb = skb;
@@ -817,7 +819,7 @@ static int ibmvnic_xmit(struct sk_buff *skb, struct net_device *netdev) · 66 unmodified lines
817819
818820 if (tx_pool->consumer_index == 0)
819821 tx_pool->consumer_index =
820− adapter->max_tx_entries_per_subcrq - 1;
822+ adapter->req_tx_entries_per_subcrq - 1;
821823 else
822824 tx_pool->consumer_index--;
823825
@@ -826,6 +828,14 @@ static int ibmvnic_xmit(struct sk_buff *skb, struct net_device *netdev) · 2 unmodified lines
826828 ret = NETDEV_TX_BUSY;
827829 goto out;
828830 }
831+
832+ atomic_inc(&tx_scrq->used);
833+
834+ if (atomic_read(&tx_scrq->used) >= adapter->req_tx_entries_per_subcrq) {
835+ netdev_info(netdev, "Stopping queue %d\n", queue_num);
836+ netif_stop_subqueue(netdev, queue_num);
837+ }
838+
829839 tx_packets++;
830840 tx_bytes += skb->len;
831841 txq->trans_start = jiffies;
@@ -1213,6 +1223,7 @@ static struct ibmvnic_sub_crq_queue *init_sub_crq_queue(struct ibmvnic_adapter · 381 unmodified lines
12131223 scrq->adapter = adapter;
12141224 scrq->size = 4 * PAGE_SIZE / sizeof(*scrq->msgs);
12151225 scrq->cur = 0;
1226+ atomic_set(&scrq->used, 0);
12161227 scrq->rx_skb_top = NULL;
12171228 spin_lock_init(&scrq->lock);
12181229
@@ -1246,6 +1257,7 @@ static void release_sub_crqs(struct ibmvnic_adapter *adapter) · 27 unmodified lines
12461257 release_sub_crq_queue(adapter,
12471258 adapter->tx_scrq[i]);
12481259 }
1260+ kfree(adapter->tx_scrq);
12491261 adapter->tx_scrq = NULL;
12501262 }
12511263
@@ -1258,6 +1270,7 @@ static void release_sub_crqs(struct ibmvnic_adapter *adapter) · 6 unmodified lines
12581270 release_sub_crq_queue(adapter,
12591271 adapter->rx_scrq[i]);
12601272 }
1273+ kfree(adapter->rx_scrq);
12611274 adapter->rx_scrq = NULL;
12621275 }
12631276 }
@@ -1355,14 +1368,28 @@ restart_loop: · 91 unmodified lines
13551368 DMA_TO_DEVICE);
13561369 }
13571370
1358− if (txbuff->last_frag)
1371+ if (txbuff->last_frag) {
1372+ atomic_dec(&scrq->used);
1373+
1374+ if (atomic_read(&scrq->used) <=
1375+ (adapter->req_tx_entries_per_subcrq / 2) &&
1376+ netif_subqueue_stopped(adapter->netdev,
1377+ txbuff->skb)) {
1378+ netif_wake_subqueue(adapter->netdev,
1379+ scrq->pool_index);
1380+ netdev_dbg(adapter->netdev,
1381+ "Started queue %d\n",
1382+ scrq->pool_index);
1383+ }
1384+
13591385 dev_kfree_skb_any(txbuff->skb);
1386+ }
13601387
13611388 adapter->tx_pool[pool].free_map[adapter->tx_pool[pool].
13621389 producer_index] = index;
13631390 adapter->tx_pool[pool].producer_index =
13641391 (adapter->tx_pool[pool].producer_index + 1) %
1365− adapter->max_tx_entries_per_subcrq;
1392+ adapter->req_tx_entries_per_subcrq;
13661393 }
13671394 /* remove tx_comp scrq*/
13681395 next->tx_comp.first = 0;
drivers/net/ethernet/ibm/ibmvnic.h+1−0
@@ -863,6 +863,7 @@ struct ibmvnic_sub_crq_queue { · 862 unmodified lines
863863 spinlock_t lock;
864864 struct sk_buff *rx_skb_top;
865865 struct ibmvnic_adapter *adapter;
866+ atomic_t used;
866867 };
867868
868869 struct ibmvnic_long_term_buff {
drivers/net/ethernet/mellanox/mlx4/cmd.c+11−0
@@ -2305,6 +2305,17 @@ static int sync_toggles(struct mlx4_dev *dev) · 2304 unmodified lines
23052305 rd_toggle = swab32(readl(&priv->mfunc.comm->slave_read));
23062306 if (wr_toggle == 0xffffffff || rd_toggle == 0xffffffff) {
23072307 /* PCI might be offline */
2308+
2309+ /* If device removal has been requested,
2310+ * do not continue retrying.
2311+ */
2312+ if (dev->persist->interface_state &
2313+ MLX4_INTERFACE_STATE_NOWAIT) {
2314+ mlx4_warn(dev,
2315+ "communication channel is offline\n");
2316+ return -EIO;
2317+ }
2318+
23082319 msleep(100);
23092320 wr_toggle = swab32(readl(&priv->mfunc.comm->
23102321 slave_write));
drivers/net/ethernet/mellanox/mlx4/main.c+11−0
@@ -1940,6 +1940,14 @@ static int mlx4_comm_check_offline(struct mlx4_dev *dev) · 1939 unmodified lines
19401940 (u32)(1 << COMM_CHAN_OFFLINE_OFFSET));
19411941 if (!offline_bit)
19421942 return 0;
1943+
1944+ /* If device removal has been requested,
1945+ * do not continue retrying.
1946+ */
1947+ if (dev->persist->interface_state &
1948+ MLX4_INTERFACE_STATE_NOWAIT)
1949+ break;
1950+
19431951 /* There are cases as part of AER/Reset flow that PF needs
19441952 * around 100 msec to load. We therefore sleep for 100 msec
19451953 * to allow other tasks to make use of that CPU during this
@@ -3955,6 +3963,9 @@ static void mlx4_remove_one(struct pci_dev *pdev) · 2009 unmodified lines
39553963 struct devlink *devlink = priv_to_devlink(priv);
39563964 int active_vfs = 0;
39573965
3966+ if (mlx4_is_slave(dev))
3967+ persist->interface_state |= MLX4_INTERFACE_STATE_NOWAIT;
3968+
39583969 mutex_lock(&persist->interface_state_mutex);
39593970 persist->interface_state |= MLX4_INTERFACE_STATE_DELETION;
39603971 mutex_unlock(&persist->interface_state_mutex);
drivers/net/ethernet/mellanox/mlx5/core/Kconfig+1−0
@@ -14,6 +14,7 @@ config MLX5_CORE · 13 unmodified lines
1414 config MLX5_CORE_EN
1515 bool "Mellanox Technologies ConnectX-4 Ethernet support"
1616 depends on NETDEVICES && ETHERNET && PCI && MLX5_CORE
17+ depends on IPV6=y || IPV6=n || MLX5_CORE=m
1718 imply PTP_1588_CLOCK
1819 default n
1920 ---help---
drivers/net/ethernet/mellanox/mlx5/core/cmd.c+4−0
@@ -361,6 +361,8 @@ static int mlx5_internal_err_ret_value(struct mlx5_core_dev *dev, u16 op, · 360 unmodified lines
361361 case MLX5_CMD_OP_QUERY_VPORT_COUNTER:
362362 case MLX5_CMD_OP_ALLOC_Q_COUNTER:
363363 case MLX5_CMD_OP_QUERY_Q_COUNTER:
364+ case MLX5_CMD_OP_SET_RATE_LIMIT:
365+ case MLX5_CMD_OP_QUERY_RATE_LIMIT:
364366 case MLX5_CMD_OP_ALLOC_PD:
365367 case MLX5_CMD_OP_ALLOC_UAR:
366368 case MLX5_CMD_OP_CONFIG_INT_MODERATION:
@@ -497,6 +499,8 @@ const char *mlx5_command_str(int command) · 130 unmodified lines
497499 MLX5_COMMAND_STR_CASE(ALLOC_Q_COUNTER);
498500 MLX5_COMMAND_STR_CASE(DEALLOC_Q_COUNTER);
499501 MLX5_COMMAND_STR_CASE(QUERY_Q_COUNTER);
502+ MLX5_COMMAND_STR_CASE(SET_RATE_LIMIT);
503+ MLX5_COMMAND_STR_CASE(QUERY_RATE_LIMIT);
500504 MLX5_COMMAND_STR_CASE(ALLOC_PD);
501505 MLX5_COMMAND_STR_CASE(DEALLOC_PD);
502506 MLX5_COMMAND_STR_CASE(ALLOC_UAR);
drivers/net/ethernet/mellanox/mlx5/core/en.h+0−4
@@ -928,10 +928,6 @@ void mlx5e_destroy_netdev(struct mlx5_core_dev *mdev, struct mlx5e_priv *priv); · 927 unmodified lines
928928 int mlx5e_attach_netdev(struct mlx5_core_dev *mdev, struct net_device *netdev);
929929 void mlx5e_detach_netdev(struct mlx5_core_dev *mdev, struct net_device *netdev);
930930 u32 mlx5e_choose_lro_timeout(struct mlx5_core_dev *mdev, u32 wanted_timeout);
931−void mlx5e_add_vxlan_port(struct net_device *netdev,
932− struct udp_tunnel_info *ti);
933−void mlx5e_del_vxlan_port(struct net_device *netdev,
934− struct udp_tunnel_info *ti);
935931
936932 int mlx5e_get_offload_stats(int attr_id, const struct net_device *dev,
937933 void *sp);
drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c+5−5
@@ -302,6 +302,9 @@ static u8 mlx5e_dcbnl_setdcbx(struct net_device *dev, u8 mode) · 301 unmodified lines
302302 struct mlx5e_priv *priv = netdev_priv(dev);
303303 struct mlx5e_dcbx *dcbx = &priv->dcbx;
304304
305+ if (mode & DCB_CAP_DCBX_LLD_MANAGED)
306+ return 1;
307+
305308 if ((!mode) && MLX5_CAP_GEN(priv->mdev, dcbx)) {
306309 if (dcbx->mode == MLX5E_DCBX_PARAM_VER_OPER_AUTO)
307310 return 0;
@@ -315,13 +318,10 @@ static u8 mlx5e_dcbnl_setdcbx(struct net_device *dev, u8 mode) · 7 unmodified lines
315318 return 1;
316319 }
317320
318− if (mlx5e_dcbnl_switch_to_host_mode(netdev_priv(dev)))
321+ if (!(mode & DCB_CAP_DCBX_HOST))
319322 return 1;
320323
321− if ((mode & DCB_CAP_DCBX_LLD_MANAGED) ||
322− !(mode & DCB_CAP_DCBX_VER_CEE) ||
323− !(mode & DCB_CAP_DCBX_VER_IEEE) ||
324− !(mode & DCB_CAP_DCBX_HOST))
324+ if (mlx5e_dcbnl_switch_to_host_mode(netdev_priv(dev)))
325325 return 1;
326326
327327 return 0;
drivers/net/ethernet/mellanox/mlx5/core/en_main.c+4−4
@@ -3100,8 +3100,8 @@ static int mlx5e_get_vf_stats(struct net_device *dev, · 3099 unmodified lines
31003100 vf_stats);
31013101 }
31023102
3103−void mlx5e_add_vxlan_port(struct net_device *netdev,
3104− struct udp_tunnel_info *ti)
3103+static void mlx5e_add_vxlan_port(struct net_device *netdev,
3104+ struct udp_tunnel_info *ti)
31053105 {
31063106 struct mlx5e_priv *priv = netdev_priv(netdev);
31073107
@@ -3114,8 +3114,8 @@ void mlx5e_add_vxlan_port(struct net_device *netdev, · 6 unmodified lines
31143114 mlx5e_vxlan_queue_work(priv, ti->sa_family, be16_to_cpu(ti->port), 1);
31153115 }
31163116
3117−void mlx5e_del_vxlan_port(struct net_device *netdev,
3118− struct udp_tunnel_info *ti)
3117+static void mlx5e_del_vxlan_port(struct net_device *netdev,
3118+ struct udp_tunnel_info *ti)
31193119 {
31203120 struct mlx5e_priv *priv = netdev_priv(netdev);
31213121
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c+0−2
@@ -393,8 +393,6 @@ static const struct net_device_ops mlx5e_netdev_ops_rep = { · 392 unmodified lines
393393 .ndo_get_phys_port_name = mlx5e_rep_get_phys_port_name,
394394 .ndo_setup_tc = mlx5e_rep_ndo_setup_tc,
395395 .ndo_get_stats64 = mlx5e_rep_get_stats,
396− .ndo_udp_tunnel_add = mlx5e_add_vxlan_port,
397− .ndo_udp_tunnel_del = mlx5e_del_vxlan_port,
398396 .ndo_has_offload_stats = mlx5e_has_offload_stats,
399397 .ndo_get_offload_stats = mlx5e_get_offload_stats,
400398 };
drivers/net/ethernet/mellanox/mlx5/core/en_rx.c+4−0
@@ -601,6 +601,10 @@ static inline void mlx5e_build_rx_skb(struct mlx5_cqe64 *cqe, · 600 unmodified lines
601601 if (lro_num_seg > 1) {
602602 mlx5e_lro_update_hdr(skb, cqe, cqe_bcnt);
603603 skb_shinfo(skb)->gso_size = DIV_ROUND_UP(cqe_bcnt, lro_num_seg);
604+ /* Subtract one since we already counted this as one
605+ * "regular" packet in mlx5e_complete_rx_cqe()
606+ */
607+ rq->stats.packets += lro_num_seg - 1;
604608 rq->stats.lro_packets++;
605609 rq->stats.lro_bytes += cqe_bcnt;
606610 }
drivers/net/ethernet/mellanox/mlx5/core/en_selftest.c+1−4
@@ -204,9 +204,6 @@ mlx5e_test_loopback_validate(struct sk_buff *skb, · 203 unmodified lines
204204 struct iphdr *iph;
205205
206206 /* We are only going to peek, no need to clone the SKB */
207− if (skb->protocol != htons(ETH_P_IP))
208− goto out;
209−
210207 if (MLX5E_TEST_PKT_SIZE - ETH_HLEN > skb_headlen(skb))
211208 goto out;
212209
@@ -249,7 +246,7 @@ static int mlx5e_test_loopback_setup(struct mlx5e_priv *priv, · 36 unmodified lines
249246 lbtp->loopback_ok = false;
250247 init_completion(&lbtp->comp);
251248
252− lbtp->pt.type = htons(ETH_P_ALL);
249+ lbtp->pt.type = htons(ETH_P_IP);
253250 lbtp->pt.func = mlx5e_test_loopback_validate;
254251 lbtp->pt.dev = priv->netdev;
255252 lbtp->pt.af_packet_priv = lbtp;
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c+67−38
@@ -48,9 +48,14 @@ · 47 unmodified lines
4848 #include "eswitch.h"
4949 #include "vxlan.h"
5050
51+enum {
52+ MLX5E_TC_FLOW_ESWITCH = BIT(0),
53+};
54+
5155 struct mlx5e_tc_flow {
5256 struct rhash_head node;
5357 u64 cookie;
58+ u8 flags;
5459 struct mlx5_flow_handle *rule;
5560 struct list_head encap; /* flows sharing the same encap */
5661 struct mlx5_esw_flow_attr *attr;
@@ -128,6 +133,23 @@ err_create_ft: · 71 unmodified lines
128133 return rule;
129134 }
130135
136+static void mlx5e_tc_del_nic_flow(struct mlx5e_priv *priv,
137+ struct mlx5e_tc_flow *flow)
138+{
139+ struct mlx5_fc *counter = NULL;
140+
141+ if (!IS_ERR(flow->rule)) {
142+ counter = mlx5_flow_rule_counter(flow->rule);
143+ mlx5_del_flow_rules(flow->rule);
144+ mlx5_fc_destroy(priv->mdev, counter);
145+ }
146+
147+ if (!mlx5e_tc_num_filters(priv) && (priv->fs.tc.t)) {
148+ mlx5_destroy_flow_table(priv->fs.tc.t);
149+ priv->fs.tc.t = NULL;
150+ }
151+}
152+
131153 static struct mlx5_flow_handle *
132154 mlx5e_tc_add_fdb_flow(struct mlx5e_priv *priv,
133155 struct mlx5_flow_spec *spec,
@@ -144,7 +166,24 @@ mlx5e_tc_add_fdb_flow(struct mlx5e_priv *priv, · 10 unmodified lines
144166 }
145167
146168 static void mlx5e_detach_encap(struct mlx5e_priv *priv,
147− struct mlx5e_tc_flow *flow) {
169+ struct mlx5e_tc_flow *flow);
170+
171+static void mlx5e_tc_del_fdb_flow(struct mlx5e_priv *priv,
172+ struct mlx5e_tc_flow *flow)
173+{
174+ struct mlx5_eswitch *esw = priv->mdev->priv.eswitch;
175+
176+ mlx5_eswitch_del_offloaded_rule(esw, flow->rule, flow->attr);
177+
178+ mlx5_eswitch_del_vlan_action(esw, flow->attr);
179+
180+ if (flow->attr->action & MLX5_FLOW_CONTEXT_ACTION_ENCAP)
181+ mlx5e_detach_encap(priv, flow);
182+}
183+
184+static void mlx5e_detach_encap(struct mlx5e_priv *priv,
185+ struct mlx5e_tc_flow *flow)
186+{
148187 struct list_head *next = flow->encap.next;
149188
150189 list_del(&flow->encap);
@@ -168,25 +207,10 @@ static void mlx5e_detach_encap(struct mlx5e_priv *priv, · 17 unmodified lines
168207 static void mlx5e_tc_del_flow(struct mlx5e_priv *priv,
169208 struct mlx5e_tc_flow *flow)
170209 {
171− struct mlx5_eswitch *esw = priv->mdev->priv.eswitch;
172− struct mlx5_fc *counter = NULL;
173−
174− if (!IS_ERR(flow->rule)) {
175− counter = mlx5_flow_rule_counter(flow->rule);
176− mlx5_del_flow_rules(flow->rule);
177− mlx5_fc_destroy(priv->mdev, counter);
178− }
179−
180− if (esw && esw->mode == SRIOV_OFFLOADS) {
181− mlx5_eswitch_del_vlan_action(esw, flow->attr);
182− if (flow->attr->action & MLX5_FLOW_CONTEXT_ACTION_ENCAP)
183− mlx5e_detach_encap(priv, flow);
184− }
185−
186− if (!mlx5e_tc_num_filters(priv) && (priv->fs.tc.t)) {
187− mlx5_destroy_flow_table(priv->fs.tc.t);
188− priv->fs.tc.t = NULL;
189− }
210+ if (flow->flags & MLX5E_TC_FLOW_ESWITCH)
211+ mlx5e_tc_del_fdb_flow(priv, flow);
212+ else
213+ mlx5e_tc_del_nic_flow(priv, flow);
190214 }
191215
192216 static void parse_vxlan_attr(struct mlx5_flow_spec *spec,
@@ -243,12 +267,15 @@ static int parse_tunnel_attr(struct mlx5e_priv *priv, · 50 unmodified lines
243267 skb_flow_dissector_target(f->dissector,
244268 FLOW_DISSECTOR_KEY_ENC_PORTS,
245269 f->mask);
270+ struct mlx5_eswitch *esw = priv->mdev->priv.eswitch;
271+ struct net_device *up_dev = mlx5_eswitch_get_uplink_netdev(esw);
272+ struct mlx5e_priv *up_priv = netdev_priv(up_dev);
246273
247274 /* Full udp dst port must be given */
248275 if (memchr_inv(&mask->dst, 0xff, sizeof(mask->dst)))
249276 goto vxlan_match_offload_err;
250277
251− if (mlx5e_vxlan_lookup_port(priv, be16_to_cpu(key->dst)) &&
278+ if (mlx5e_vxlan_lookup_port(up_priv, be16_to_cpu(key->dst)) &&
252279 MLX5_CAP_ESW(priv->mdev, vxlan_encap_decap))
253280 parse_vxlan_attr(spec, f);
254281 else {
@@ -598,6 +625,7 @@ static int __parse_cls_flower(struct mlx5e_priv *priv, · 343 unmodified lines
598625 }
599626
600627 static int parse_cls_flower(struct mlx5e_priv *priv,
628+ struct mlx5e_tc_flow *flow,
601629 struct mlx5_flow_spec *spec,
602630 struct tc_cls_flower_offload *f)
603631 {
@@ -609,7 +637,7 @@ static int parse_cls_flower(struct mlx5e_priv *priv, · 5 unmodified lines
609637
610638 err = __parse_cls_flower(priv, spec, f, &min_inline);
611639
612− if (!err && esw->mode == SRIOV_OFFLOADS &&
640+ if (!err && (flow->flags & MLX5E_TC_FLOW_ESWITCH) &&
613641 rep->vport != FDB_UPLINK_VPORT) {
614642 if (min_inline > esw->offloads.inline_mode) {
615643 netdev_warn(priv->netdev,
@@ -970,6 +998,8 @@ static int mlx5e_attach_encap(struct mlx5e_priv *priv, · 354 unmodified lines
970998 struct mlx5_esw_flow_attr *attr)
971999 {
9721000 struct mlx5_eswitch *esw = priv->mdev->priv.eswitch;
1001+ struct net_device *up_dev = mlx5_eswitch_get_uplink_netdev(esw);
1002+ struct mlx5e_priv *up_priv = netdev_priv(up_dev);
9731003 unsigned short family = ip_tunnel_info_af(tun_info);
9741004 struct ip_tunnel_key *key = &tun_info->key;
9751005 struct mlx5_encap_entry *e;
@@ -990,7 +1020,7 @@ vxlan_encap_offload_err: · 14 unmodified lines
9901020 return -EOPNOTSUPP;
9911021 }
9921022
993− if (mlx5e_vxlan_lookup_port(priv, be16_to_cpu(key->tp_dst)) &&
1023+ if (mlx5e_vxlan_lookup_port(up_priv, be16_to_cpu(key->tp_dst)) &&
9941024 MLX5_CAP_ESW(priv->mdev, vxlan_encap_decap)) {
9951025 tunnel_type = MLX5_HEADER_TYPE_VXLAN;
9961026 } else {
@@ -1106,14 +1136,16 @@ static int parse_tc_fdb_actions(struct mlx5e_priv *priv, struct tcf_exts *exts, · 109 unmodified lines
11061136 }
11071137
11081138 if (is_tcf_vlan(a)) {
1109− if (tcf_vlan_action(a) == VLAN_F_POP) {
1139+ if (tcf_vlan_action(a) == TCA_VLAN_ACT_POP) {
11101140 attr->action |= MLX5_FLOW_CONTEXT_ACTION_VLAN_POP;
1111− } else if (tcf_vlan_action(a) == VLAN_F_PUSH) {
1141+ } else if (tcf_vlan_action(a) == TCA_VLAN_ACT_PUSH) {
11121142 if (tcf_vlan_push_proto(a) != htons(ETH_P_8021Q))
11131143 return -EOPNOTSUPP;
11141144
11151145 attr->action |= MLX5_FLOW_CONTEXT_ACTION_VLAN_PUSH;
11161146 attr->vlan = tcf_vlan_push_vid(a);
1147+ } else { /* action is TCA_VLAN_ACT_MODIFY */
1148+ return -EOPNOTSUPP;
11171149 }
11181150 continue;
11191151 }
@@ -1132,23 +1164,19 @@ int mlx5e_configure_flower(struct mlx5e_priv *priv, __be16 protocol, · 12 unmodified lines
11321164 struct tc_cls_flower_offload *f)
11331165 {
11341166 struct mlx5e_tc_table *tc = &priv->fs.tc;
1135− int err = 0;
1136− bool fdb_flow = false;
1167+ int err, attr_size = 0;
11371168 u32 flow_tag, action;
11381169 struct mlx5e_tc_flow *flow;
11391170 struct mlx5_flow_spec *spec;
11401171 struct mlx5_eswitch *esw = priv->mdev->priv.eswitch;
1172+ u8 flow_flags = 0;
11411173
1142− if (esw && esw->mode == SRIOV_OFFLOADS)
1143− fdb_flow = true;
1144−
1145− if (fdb_flow)
1146− flow = kzalloc(sizeof(*flow) +
1147− sizeof(struct mlx5_esw_flow_attr),
1148− GFP_KERNEL);
1149− else
1150− flow = kzalloc(sizeof(*flow), GFP_KERNEL);
1174+ if (esw && esw->mode == SRIOV_OFFLOADS) {
1175+ flow_flags = MLX5E_TC_FLOW_ESWITCH;
1176+ attr_size = sizeof(struct mlx5_esw_flow_attr);
1177+ }
11511178
1179+ flow = kzalloc(sizeof(*flow) + attr_size, GFP_KERNEL);
11521180 spec = mlx5_vzalloc(sizeof(*spec));
11531181 if (!spec || !flow) {
11541182 err = -ENOMEM;
@@ -1156,12 +1184,13 @@ int mlx5e_configure_flower(struct mlx5e_priv *priv, __be16 protocol, · 1 unmodified line
11561184 }
11571185
11581186 flow->cookie = f->cookie;
1187+ flow->flags = flow_flags;
11591188
1160− err = parse_cls_flower(priv, spec, f);
1189+ err = parse_cls_flower(priv, flow, spec, f);
11611190 if (err < 0)
11621191 goto err_free;
11631192
1164− if (fdb_flow) {
1193+ if (flow->flags & MLX5E_TC_FLOW_ESWITCH) {
11651194 flow->attr = (struct mlx5_esw_flow_attr *)(flow + 1);
11661195 err = parse_tc_fdb_actions(priv, f->exts, flow);
11671196 if (err < 0)
drivers/net/ethernet/mellanox/mlx5/core/en_tx.c+3−2
@@ -274,15 +274,18 @@ static netdev_tx_t mlx5e_sq_xmit(struct mlx5e_sq *sq, struct sk_buff *skb) · 273 unmodified lines
274274 sq->stats.tso_bytes += skb->len - ihs;
275275 }
276276
277+ sq->stats.packets += skb_shinfo(skb)->gso_segs;
277278 num_bytes = skb->len + (skb_shinfo(skb)->gso_segs - 1) * ihs;
278279 } else {
279280 bf = sq->bf_budget &&
280281 !skb->xmit_more &&
281282 !skb_shinfo(skb)->nr_frags;
282283 ihs = mlx5e_get_inline_hdr_size(sq, skb, bf);
284+ sq->stats.packets++;
283285 num_bytes = max_t(unsigned int, skb->len, ETH_ZLEN);
284286 }
285287
288+ sq->stats.bytes += num_bytes;
286289 wi->num_bytes = num_bytes;
287290
288291 ds_cnt = sizeof(*wqe) / MLX5_SEND_WQE_DS;
@@ -381,8 +384,6 @@ static netdev_tx_t mlx5e_sq_xmit(struct mlx5e_sq *sq, struct sk_buff *skb) · 92 unmodified lines
381384 if (bf)
382385 sq->bf_budget--;
383386
384− sq->stats.packets++;
385− sq->stats.bytes += num_bytes;
386387 return NETDEV_TX_OK;
387388
388389 dma_unmap_wqe_err:
drivers/net/ethernet/mellanox/mlx5/core/eswitch.h+6−0
@@ -209,6 +209,7 @@ struct mlx5_esw_offload { · 208 unmodified lines
209209 struct mlx5_eswitch_rep *vport_reps;
210210 DECLARE_HASHTABLE(encap_tbl, 8);
211211 u8 inline_mode;
212+ u64 num_flows;
212213 };
213214
214215 struct mlx5_eswitch {
@@ -271,6 +272,11 @@ struct mlx5_flow_handle * · 56 unmodified lines
271272 mlx5_eswitch_add_offloaded_rule(struct mlx5_eswitch *esw,
272273 struct mlx5_flow_spec *spec,
273274 struct mlx5_esw_flow_attr *attr);
275+void
276+mlx5_eswitch_del_offloaded_rule(struct mlx5_eswitch *esw,
277+ struct mlx5_flow_handle *rule,
278+ struct mlx5_esw_flow_attr *attr);
279+
274280 struct mlx5_flow_handle *
275281 mlx5_eswitch_create_vport_rx_rule(struct mlx5_eswitch *esw, int vport, u32 tirn);
276282
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c+22−0
@@ -93,10 +93,27 @@ mlx5_eswitch_add_offloaded_rule(struct mlx5_eswitch *esw, · 92 unmodified lines
9393 spec, &flow_act, dest, i);
9494 if (IS_ERR(rule))
9595 mlx5_fc_destroy(esw->dev, counter);
96+ else
97+ esw->offloads.num_flows++;
9698
9799 return rule;
98100 }
99101
102+void
103+mlx5_eswitch_del_offloaded_rule(struct mlx5_eswitch *esw,
104+ struct mlx5_flow_handle *rule,
105+ struct mlx5_esw_flow_attr *attr)
106+{
107+ struct mlx5_fc *counter = NULL;
108+
109+ if (!IS_ERR(rule)) {
110+ counter = mlx5_flow_rule_counter(rule);
111+ mlx5_del_flow_rules(rule);
112+ mlx5_fc_destroy(esw->dev, counter);
113+ esw->offloads.num_flows--;
114+ }
115+}
116+
100117 static int esw_set_global_vlan_pop(struct mlx5_eswitch *esw, u8 val)
101118 {
102119 struct mlx5_eswitch_rep *rep;
@@ -908,6 +925,11 @@ int mlx5_devlink_eswitch_inline_mode_set(struct devlink *devlink, u8 mode) · 805 unmodified lines
908925 MLX5_CAP_INLINE_MODE_VPORT_CONTEXT)
909926 return -EOPNOTSUPP;
910927
928+ if (esw->offloads.num_flows > 0) {
929+ esw_warn(dev, "Can't set inline mode when flows are configured\n");
930+ return -EOPNOTSUPP;
931+ }
932+
911933 err = esw_inline_mode_from_devlink(mode, &mlx5_mode);
912934 if (err)
913935 goto out;
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c+1−1
@@ -1136,7 +1136,7 @@ static struct mlx5_flow_group *create_autogroup(struct mlx5_flow_table *ft, · 1135 unmodified lines
11361136 u32 *match_criteria)
11371137 {
11381138 int inlen = MLX5_ST_SZ_BYTES(create_flow_group_in);
1139− struct list_head *prev = ft->node.children.prev;
1139+ struct list_head *prev = &ft->node.children;
11401140 unsigned int candidate_index = 0;
11411141 struct mlx5_flow_group *fg;
11421142 void *match_criteria_addr;
drivers/net/ethernet/mellanox/mlx5/core/main.c+4−3
@@ -87,7 +87,7 @@ static struct mlx5_profile profile[] = { · 86 unmodified lines
8787 [2] = {
8888 .mask = MLX5_PROF_MASK_QP_SIZE |
8989 MLX5_PROF_MASK_MR_CACHE,
90− .log_max_qp = 17,
90+ .log_max_qp = 18,
9191 .mr_cache[0] = {
9292 .size = 500,
9393 .limit = 250
@@ -1352,6 +1352,7 @@ static int init_one(struct pci_dev *pdev, · 1258 unmodified lines
13521352 if (err)
13531353 goto clean_load;
13541354
1355+ pci_save_state(pdev);
13551356 return 0;
13561357
13571358 clean_load:
@@ -1407,9 +1408,8 @@ static pci_ers_result_t mlx5_pci_err_detected(struct pci_dev *pdev, · 49 unmodified lines
14071408
14081409 mlx5_enter_error_state(dev);
14091410 mlx5_unload_one(dev, priv, false);
1410− /* In case of kernel call save the pci state and drain the health wq */
1411+ /* In case of kernel call drain the health wq */
14111412 if (state) {
1412− pci_save_state(pdev);
14131413 mlx5_drain_health_wq(dev);
14141414 mlx5_pci_disable_device(dev);
14151415 }
@@ -1461,6 +1461,7 @@ static pci_ers_result_t mlx5_pci_slot_reset(struct pci_dev *pdev) · 45 unmodified lines
14611461
14621462 pci_set_master(pdev);
14631463 pci_restore_state(pdev);
1464+ pci_save_state(pdev);
14641465
14651466 if (wait_vital(pdev)) {
14661467 dev_err(&pdev->dev, "%s: wait_vital timed out\n", __func__);
drivers/net/ethernet/mellanox/mlxsw/reg.h+2−2
@@ -769,7 +769,7 @@ static inline void mlxsw_reg_spvid_pack(char *payload, u8 local_port, u16 pvid) · 768 unmodified lines
769769 #define MLXSW_REG_SPVM_ID 0x200F
770770 #define MLXSW_REG_SPVM_BASE_LEN 0x04 /* base length, without records */
771771 #define MLXSW_REG_SPVM_REC_LEN 0x04 /* record length */
772−#define MLXSW_REG_SPVM_REC_MAX_COUNT 256
772+#define MLXSW_REG_SPVM_REC_MAX_COUNT 255
773773 #define MLXSW_REG_SPVM_LEN (MLXSW_REG_SPVM_BASE_LEN + \
774774 MLXSW_REG_SPVM_REC_LEN * MLXSW_REG_SPVM_REC_MAX_COUNT)
775775
@@ -1702,7 +1702,7 @@ static inline void mlxsw_reg_sfmr_pack(char *payload, · 926 unmodified lines
17021702 #define MLXSW_REG_SPVMLR_ID 0x2020
17031703 #define MLXSW_REG_SPVMLR_BASE_LEN 0x04 /* base length, without records */
17041704 #define MLXSW_REG_SPVMLR_REC_LEN 0x04 /* record length */
1705−#define MLXSW_REG_SPVMLR_REC_MAX_COUNT 256
1705+#define MLXSW_REG_SPVMLR_REC_MAX_COUNT 255
17061706 #define MLXSW_REG_SPVMLR_LEN (MLXSW_REG_SPVMLR_BASE_LEN + \
17071707 MLXSW_REG_SPVMLR_REC_LEN * \
17081708 MLXSW_REG_SPVMLR_REC_MAX_COUNT)
drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c+2−2
@@ -303,11 +303,11 @@ void mlxsw_sp_flower_destroy(struct mlxsw_sp_port *mlxsw_sp_port, bool ingress, · 302 unmodified lines
303303 ruleset = mlxsw_sp_acl_ruleset_get(mlxsw_sp, mlxsw_sp_port->dev,
304304 ingress,
305305 MLXSW_SP_ACL_PROFILE_FLOWER);
306− if (WARN_ON(IS_ERR(ruleset)))
306+ if (IS_ERR(ruleset))
307307 return;
308308
309309 rule = mlxsw_sp_acl_rule_lookup(mlxsw_sp, ruleset, f->cookie);
310− if (!WARN_ON(!rule)) {
310+ if (rule) {
311311 mlxsw_sp_acl_rule_del(mlxsw_sp, rule);
312312 mlxsw_sp_acl_rule_destroy(mlxsw_sp, rule);
313313 }
drivers/net/ethernet/qlogic/qed/qed_cxt.c+2−1
@@ -422,8 +422,9 @@ static void qed_cxt_set_proto_cid_count(struct qed_hwfn *p_hwfn, · 421 unmodified lines
422422 u32 page_sz = p_mgr->clients[ILT_CLI_CDUC].p_size.val;
423423 u32 cxt_size = CONN_CXT_SIZE(p_hwfn);
424424 u32 elems_per_page = ILT_PAGE_IN_BYTES(page_sz) / cxt_size;
425+ u32 align = elems_per_page * DQ_RANGE_ALIGN;
425426
426− p_conn->cid_count = roundup(p_conn->cid_count, elems_per_page);
427+ p_conn->cid_count = roundup(p_conn->cid_count, align);
427428 }
428429 }
429430
drivers/net/ethernet/qlogic/qed/qed_dev.c+2−3
@@ -2389,9 +2389,8 @@ qed_chain_alloc_sanity_check(struct qed_dev *cdev, · 2388 unmodified lines
23892389 * size/capacity fields are of a u32 type.
23902390 */
23912391 if ((cnt_type == QED_CHAIN_CNT_TYPE_U16 &&
2392− chain_size > 0x10000) ||
2393− (cnt_type == QED_CHAIN_CNT_TYPE_U32 &&
2394− chain_size > 0x100000000ULL)) {
2392+ chain_size > ((u32)U16_MAX + 1)) ||
2393+ (cnt_type == QED_CHAIN_CNT_TYPE_U32 && chain_size > U32_MAX)) {
23952394 DP_NOTICE(cdev,
23962395 "The actual chain size (0x%llx) is larger than the maximal possible value\n",
23972396 chain_size);
drivers/net/ethernet/qlogic/qed/qed_iscsi.c+31−0
@@ -190,6 +190,9 @@ qed_sp_iscsi_func_start(struct qed_hwfn *p_hwfn, · 189 unmodified lines
190190 p_init->num_sq_pages_in_ring = p_params->num_sq_pages_in_ring;
191191 p_init->num_r2tq_pages_in_ring = p_params->num_r2tq_pages_in_ring;
192192 p_init->num_uhq_pages_in_ring = p_params->num_uhq_pages_in_ring;
193+ p_init->ooo_enable = p_params->ooo_enable;
194+ p_init->ll2_rx_queue_id = p_hwfn->hw_info.resc_start[QED_LL2_QUEUE] +
195+ p_params->ll2_ooo_queue_id;
193196 p_init->func_params.log_page_size = p_params->log_page_size;
194197 val = p_params->num_tasks;
195198 p_init->func_params.num_tasks = cpu_to_le16(val);
@@ -786,6 +789,23 @@ static void qed_iscsi_release_connection(struct qed_hwfn *p_hwfn, · 590 unmodified lines
786789 spin_unlock_bh(&p_hwfn->p_iscsi_info->lock);
787790 }
788791
792+void qed_iscsi_free_connection(struct qed_hwfn *p_hwfn,
793+ struct qed_iscsi_conn *p_conn)
794+{
795+ qed_chain_free(p_hwfn->cdev, &p_conn->xhq);
796+ qed_chain_free(p_hwfn->cdev, &p_conn->uhq);
797+ qed_chain_free(p_hwfn->cdev, &p_conn->r2tq);
798+ dma_free_coherent(&p_hwfn->cdev->pdev->dev,
799+ sizeof(struct tcp_upload_params),
800+ p_conn->tcp_upload_params_virt_addr,
801+ p_conn->tcp_upload_params_phys_addr);
802+ dma_free_coherent(&p_hwfn->cdev->pdev->dev,
803+ sizeof(struct scsi_terminate_extra_params),
804+ p_conn->queue_cnts_virt_addr,
805+ p_conn->queue_cnts_phys_addr);
806+ kfree(p_conn);
807+}
808+
789809 struct qed_iscsi_info *qed_iscsi_alloc(struct qed_hwfn *p_hwfn)
790810 {
791811 struct qed_iscsi_info *p_iscsi_info;
@@ -807,6 +827,17 @@ void qed_iscsi_setup(struct qed_hwfn *p_hwfn, · 15 unmodified lines
807827 void qed_iscsi_free(struct qed_hwfn *p_hwfn,
808828 struct qed_iscsi_info *p_iscsi_info)
809829 {
830+ struct qed_iscsi_conn *p_conn = NULL;
831+
832+ while (!list_empty(&p_hwfn->p_iscsi_info->free_list)) {
833+ p_conn = list_first_entry(&p_hwfn->p_iscsi_info->free_list,
834+ struct qed_iscsi_conn, list_entry);
835+ if (p_conn) {
836+ list_del(&p_conn->list_entry);
837+ qed_iscsi_free_connection(p_hwfn, p_conn);
838+ }
839+ }
840+
810841 kfree(p_iscsi_info);
811842 }
812843
drivers/net/ethernet/qlogic/qed/qed_ll2.c+8−5
@@ -211,6 +211,8 @@ static void qed_ll2b_complete_rx_packet(struct qed_hwfn *p_hwfn, · 210 unmodified lines
211211 /* If need to reuse or there's no replacement buffer, repost this */
212212 if (rc)
213213 goto out_post;
214+ dma_unmap_single(&cdev->pdev->dev, buffer->phys_addr,
215+ cdev->ll2->rx_size, DMA_FROM_DEVICE);
214216
215217 skb = build_skb(buffer->data, 0);
216218 if (!skb) {
@@ -474,7 +476,7 @@ qed_ll2_rxq_completion_gsi(struct qed_hwfn *p_hwfn, · 257 unmodified lines
474476 static int qed_ll2_rxq_completion_reg(struct qed_hwfn *p_hwfn,
475477 struct qed_ll2_info *p_ll2_conn,
476478 union core_rx_cqe_union *p_cqe,
477− unsigned long lock_flags,
479+ unsigned long *p_lock_flags,
478480 bool b_last_cqe)
479481 {
480482 struct qed_ll2_rx_queue *p_rx = &p_ll2_conn->rx_queue;
@@ -495,10 +497,10 @@ static int qed_ll2_rxq_completion_reg(struct qed_hwfn *p_hwfn, · 14 unmodified lines
495497 "Mismatch between active_descq and the LL2 Rx chain\n");
496498 list_add_tail(&p_pkt->list_entry, &p_rx->free_descq);
497499
498− spin_unlock_irqrestore(&p_rx->lock, lock_flags);
500+ spin_unlock_irqrestore(&p_rx->lock, *p_lock_flags);
499501 qed_ll2b_complete_rx_packet(p_hwfn, p_ll2_conn->my_id,
500502 p_pkt, &p_cqe->rx_cqe_fp, b_last_cqe);
501− spin_lock_irqsave(&p_rx->lock, lock_flags);
503+ spin_lock_irqsave(&p_rx->lock, *p_lock_flags);
502504
503505 return 0;
504506 }
@@ -538,7 +540,8 @@ static int qed_ll2_rxq_completion(struct qed_hwfn *p_hwfn, void *cookie) · 33 unmodified lines
538540 break;
539541 case CORE_RX_CQE_TYPE_REGULAR:
540542 rc = qed_ll2_rxq_completion_reg(p_hwfn, p_ll2_conn,
541− cqe, flags, b_last_cqe);
543+ cqe, &flags,
544+ b_last_cqe);
542545 break;
543546 default:
544547 rc = -EIO;
@@ -968,7 +971,7 @@ static int qed_ll2_start_ooo(struct qed_dev *cdev, · 423 unmodified lines
968971 {
969972 struct qed_hwfn *hwfn = QED_LEADING_HWFN(cdev);
970973 u8 *handle = &hwfn->pf_params.iscsi_pf_params.ll2_ooo_queue_id;
971− struct qed_ll2_conn ll2_info;
974+ struct qed_ll2_conn ll2_info = { 0 };
972975 int rc;
973976
974977 ll2_info.conn_type = QED_LL2_TYPE_ISCSI_OOO;
drivers/net/ethernet/qlogic/qed/qed_ooo.c+2−0
@@ -159,6 +159,8 @@ struct qed_ooo_info *qed_ooo_alloc(struct qed_hwfn *p_hwfn) · 158 unmodified lines
159159 if (!p_ooo_info->ooo_history.p_cqes)
160160 goto no_history_mem;
161161
162+ p_ooo_info->ooo_history.num_of_cqes = QED_MAX_NUM_OOO_HISTORY_ENTRIES;
163+
162164 return p_ooo_info;
163165
164166 no_history_mem:
drivers/net/ethernet/sfc/efx.c+1−1
@@ -2404,7 +2404,7 @@ static void efx_udp_tunnel_del(struct net_device *dev, struct udp_tunnel_info *t · 2403 unmodified lines
24042404 tnl.type = (u16)efx_tunnel_type;
24052405 tnl.port = ti->port;
24062406
2407− if (efx->type->udp_tnl_add_port)
2407+ if (efx->type->udp_tnl_del_port)
24082408 (void)efx->type->udp_tnl_del_port(efx, tnl);
24092409 }
24102410
drivers/net/ethernet/smsc/smc91x.c+25−22
@@ -1535,32 +1535,33 @@ static int smc_close(struct net_device *dev) · 1534 unmodified lines
15351535 * Ethtool support
15361536 */
15371537 static int
1538−smc_ethtool_getsettings(struct net_device *dev, struct ethtool_cmd *cmd)
1538+smc_ethtool_get_link_ksettings(struct net_device *dev,
1539+ struct ethtool_link_ksettings *cmd)
15391540 {
15401541 struct smc_local *lp = netdev_priv(dev);
15411542 int ret;
15421543
1543− cmd->maxtxpkt = 1;
1544− cmd->maxrxpkt = 1;
1545−
15461544 if (lp->phy_type != 0) {
15471545 spin_lock_irq(&lp->lock);
1548− ret = mii_ethtool_gset(&lp->mii, cmd);
1546+ ret = mii_ethtool_get_link_ksettings(&lp->mii, cmd);
15491547 spin_unlock_irq(&lp->lock);
15501548 } else {
1551− cmd->supported = SUPPORTED_10baseT_Half |
1549+ u32 supported = SUPPORTED_10baseT_Half |
15521550 SUPPORTED_10baseT_Full |
15531551 SUPPORTED_TP | SUPPORTED_AUI;
15541552
15551553 if (lp->ctl_rspeed == 10)
1556− ethtool_cmd_speed_set(cmd, SPEED_10);
1554+ cmd->base.speed = SPEED_10;
15571555 else if (lp->ctl_rspeed == 100)
1558− ethtool_cmd_speed_set(cmd, SPEED_100);
1556+ cmd->base.speed = SPEED_100;
1557+
1558+ cmd->base.autoneg = AUTONEG_DISABLE;
1559+ cmd->base.port = 0;
1560+ cmd->base.duplex = lp->tcr_cur_mode & TCR_SWFDUP ?
1561+ DUPLEX_FULL : DUPLEX_HALF;
15591562
1560− cmd->autoneg = AUTONEG_DISABLE;
1561− cmd->transceiver = XCVR_INTERNAL;
1562− cmd->port = 0;
1563− cmd->duplex = lp->tcr_cur_mode & TCR_SWFDUP ? DUPLEX_FULL : DUPLEX_HALF;
1563+ ethtool_convert_legacy_u32_to_link_mode(
1564+ cmd->link_modes.supported, supported);
15641565
15651566 ret = 0;
15661567 }
@@ -1569,24 +1570,26 @@ smc_ethtool_getsettings(struct net_device *dev, struct ethtool_cmd *cmd) · 2 unmodified lines
15691570 }
15701571
15711572 static int
1572−smc_ethtool_setsettings(struct net_device *dev, struct ethtool_cmd *cmd)
1573+smc_ethtool_set_link_ksettings(struct net_device *dev,
1574+ const struct ethtool_link_ksettings *cmd)
15731575 {
15741576 struct smc_local *lp = netdev_priv(dev);
15751577 int ret;
15761578
15771579 if (lp->phy_type != 0) {
15781580 spin_lock_irq(&lp->lock);
1579− ret = mii_ethtool_sset(&lp->mii, cmd);
1581+ ret = mii_ethtool_set_link_ksettings(&lp->mii, cmd);
15801582 spin_unlock_irq(&lp->lock);
15811583 } else {
1582− if (cmd->autoneg != AUTONEG_DISABLE ||
1583− cmd->speed != SPEED_10 ||
1584− (cmd->duplex != DUPLEX_HALF && cmd->duplex != DUPLEX_FULL) ||
1585− (cmd->port != PORT_TP && cmd->port != PORT_AUI))
1584+ if (cmd->base.autoneg != AUTONEG_DISABLE ||
1585+ cmd->base.speed != SPEED_10 ||
1586+ (cmd->base.duplex != DUPLEX_HALF &&
1587+ cmd->base.duplex != DUPLEX_FULL) ||
1588+ (cmd->base.port != PORT_TP && cmd->base.port != PORT_AUI))
15861589 return -EINVAL;
15871590
1588−// lp->port = cmd->port;
1589− lp->ctl_rfduplx = cmd->duplex == DUPLEX_FULL;
1591+// lp->port = cmd->base.port;
1592+ lp->ctl_rfduplx = cmd->base.duplex == DUPLEX_FULL;
15901593
15911594 // if (netif_running(dev))
15921595 // smc_set_port(dev);
@@ -1744,8 +1747,6 @@ static int smc_ethtool_seteeprom(struct net_device *dev, · 151 unmodified lines
17441747
17451748
17461749 static const struct ethtool_ops smc_ethtool_ops = {
1747− .get_settings = smc_ethtool_getsettings,
1748− .set_settings = smc_ethtool_setsettings,
17491750 .get_drvinfo = smc_ethtool_getdrvinfo,
17501751
17511752 .get_msglevel = smc_ethtool_getmsglevel,
@@ -1755,6 +1756,8 @@ static const struct ethtool_ops smc_ethtool_ops = { · 3 unmodified lines
17551756 .get_eeprom_len = smc_ethtool_geteeprom_len,
17561757 .get_eeprom = smc_ethtool_geteeprom,
17571758 .set_eeprom = smc_ethtool_seteeprom,
1759+ .get_link_ksettings = smc_ethtool_get_link_ksettings,
1760+ .set_link_ksettings = smc_ethtool_set_link_ksettings,
17581761 };
17591762
17601763 static const struct net_device_ops smc_netdev_ops = {
drivers/net/ethernet/ti/Kconfig+8−2
@@ -74,15 +74,21 @@ config TI_CPSW · 73 unmodified lines
7474 will be called cpsw.
7575
7676 config TI_CPTS
77− tristate "TI Common Platform Time Sync (CPTS) Support"
77+ bool "TI Common Platform Time Sync (CPTS) Support"
7878 depends on TI_CPSW || TI_KEYSTONE_NETCP
79− imply PTP_1588_CLOCK
79+ depends on PTP_1588_CLOCK
8080 ---help---
8181 This driver supports the Common Platform Time Sync unit of
8282 the CPSW Ethernet Switch and Keystone 2 1g/10g Switch Subsystem.
8383 The unit can time stamp PTP UDP/IPv4 and Layer 2 packets, and the
8484 driver offers a PTP Hardware Clock.
8585
86+config TI_CPTS_MOD
87+ tristate
88+ depends on TI_CPTS
89+ default y if TI_CPSW=y || TI_KEYSTONE_NETCP=y
90+ default m
91+
8692 config TI_KEYSTONE_NETCP
8793 tristate "TI Keystone NETCP Core Support"
8894 select TI_CPSW_ALE
drivers/net/ethernet/ti/Makefile+1−1
@@ -12,7 +12,7 @@ obj-$(CONFIG_TI_DAVINCI_MDIO) += davinci_mdio.o · 11 unmodified lines
1212 obj-$(CONFIG_TI_DAVINCI_CPDMA) += davinci_cpdma.o
1313 obj-$(CONFIG_TI_CPSW_PHY_SEL) += cpsw-phy-sel.o
1414 obj-$(CONFIG_TI_CPSW_ALE) += cpsw_ale.o
15−obj-$(CONFIG_TI_CPTS) += cpts.o
15+obj-$(CONFIG_TI_CPTS_MOD) += cpts.o
1616 obj-$(CONFIG_TI_CPSW) += ti_cpsw.o
1717 ti_cpsw-y := cpsw.o
1818
drivers/net/fjes/fjes_main.c+72−6
@@ -45,6 +45,8 @@ MODULE_DESCRIPTION("FUJITSU Extended Socket Network Device Driver"); · 44 unmodified lines
4545 MODULE_LICENSE("GPL");
4646 MODULE_VERSION(DRV_VERSION);
4747
48+#define ACPI_MOTHERBOARD_RESOURCE_HID "PNP0C02"
49+
4850 static int fjes_request_irq(struct fjes_adapter *);
4951 static void fjes_free_irq(struct fjes_adapter *);
5052
@@ -78,7 +80,7 @@ static void fjes_rx_irq(struct fjes_adapter *, int); · 27 unmodified lines
7880 static int fjes_poll(struct napi_struct *, int);
7981
8082 static const struct acpi_device_id fjes_acpi_ids[] = {
81− {"PNP0C02", 0},
83+ {ACPI_MOTHERBOARD_RESOURCE_HID, 0},
8284 {"", 0},
8385 };
8486 MODULE_DEVICE_TABLE(acpi, fjes_acpi_ids);
@@ -115,18 +117,17 @@ static struct resource fjes_resource[] = { · 30 unmodified lines
115117 },
116118 };
117119
118−static int fjes_acpi_add(struct acpi_device *device)
120+static bool is_extended_socket_device(struct acpi_device *device)
119121 {
120122 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL};
121123 char str_buf[sizeof(FJES_ACPI_SYMBOL) + 1];
122− struct platform_device *plat_dev;
123124 union acpi_object *str;
124125 acpi_status status;
125126 int result;
126127
127128 status = acpi_evaluate_object(device->handle, "_STR", NULL, &buffer);
128129 if (ACPI_FAILURE(status))
129− return -ENODEV;
130+ return false;
130131
131132 str = buffer.pointer;
132133 result = utf16s_to_utf8s((wchar_t *)str->string.pointer,
@@ -136,10 +137,42 @@ static int fjes_acpi_add(struct acpi_device *device) · 3 unmodified lines
136137
137138 if (strncmp(FJES_ACPI_SYMBOL, str_buf, strlen(FJES_ACPI_SYMBOL)) != 0) {
138139 kfree(buffer.pointer);
139− return -ENODEV;
140+ return false;
140141 }
141142 kfree(buffer.pointer);
142143
144+ return true;
145+}
146+
147+static int acpi_check_extended_socket_status(struct acpi_device *device)
148+{
149+ unsigned long long sta;
150+ acpi_status status;
151+
152+ status = acpi_evaluate_integer(device->handle, "_STA", NULL, &sta);
153+ if (ACPI_FAILURE(status))
154+ return -ENODEV;
155+
156+ if (!((sta & ACPI_STA_DEVICE_PRESENT) &&
157+ (sta & ACPI_STA_DEVICE_ENABLED) &&
158+ (sta & ACPI_STA_DEVICE_UI) &&
159+ (sta & ACPI_STA_DEVICE_FUNCTIONING)))
160+ return -ENODEV;
161+
162+ return 0;
163+}
164+
165+static int fjes_acpi_add(struct acpi_device *device)
166+{
167+ struct platform_device *plat_dev;
168+ acpi_status status;
169+
170+ if (!is_extended_socket_device(device))
171+ return -ENODEV;
172+
173+ if (acpi_check_extended_socket_status(device))
174+ return -ENODEV;
175+
143176 status = acpi_walk_resources(device->handle, METHOD_NAME__CRS,
144177 fjes_get_acpi_resource, fjes_resource);
145178 if (ACPI_FAILURE(status))
@@ -1316,7 +1349,7 @@ static void fjes_netdev_setup(struct net_device *netdev) · 1170 unmodified lines
13161349 netdev->min_mtu = fjes_support_mtu[0];
13171350 netdev->max_mtu = fjes_support_mtu[3];
13181351 netdev->flags |= IFF_BROADCAST;
1319− netdev->features |= NETIF_F_HW_CSUM | NETIF_F_HW_VLAN_CTAG_FILTER;
1352+ netdev->features |= NETIF_F_HW_VLAN_CTAG_FILTER;
13201353 }
13211354
13221355 static void fjes_irq_watch_task(struct work_struct *work)
@@ -1473,11 +1506,44 @@ static void fjes_watch_unshare_task(struct work_struct *work) · 150 unmodified lines
14731506 }
14741507 }
14751508
1509+static acpi_status
1510+acpi_find_extended_socket_device(acpi_handle obj_handle, u32 level,
1511+ void *context, void **return_value)
1512+{
1513+ struct acpi_device *device;
1514+ bool *found = context;
1515+ int result;
1516+
1517+ result = acpi_bus_get_device(obj_handle, &device);
1518+ if (result)
1519+ return AE_OK;
1520+
1521+ if (strcmp(acpi_device_hid(device), ACPI_MOTHERBOARD_RESOURCE_HID))
1522+ return AE_OK;
1523+
1524+ if (!is_extended_socket_device(device))
1525+ return AE_OK;
1526+
1527+ if (acpi_check_extended_socket_status(device))
1528+ return AE_OK;
1529+
1530+ *found = true;
1531+ return AE_CTRL_TERMINATE;
1532+}
1533+
14761534 /* fjes_init_module - Driver Registration Routine */
14771535 static int __init fjes_init_module(void)
14781536 {
1537+ bool found = false;
14791538 int result;
14801539
1540+ acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, ACPI_UINT32_MAX,
1541+ acpi_find_extended_socket_device, NULL, &found,
1542+ NULL);
1543+
1544+ if (!found)
1545+ return -ENODEV;
1546+
14811547 pr_info("%s - version %s - %s\n",
14821548 fjes_driver_string, fjes_driver_version, fjes_copyright);
14831549
drivers/net/hyperv/hyperv_net.h+2−1
@@ -700,6 +700,8 @@ struct net_device_context { · 699 unmodified lines
700700
701701 u32 tx_checksum_mask;
702702
703+ u32 tx_send_table[VRSS_SEND_TAB_SIZE];
704+
703705 /* Ethtool settings */
704706 u8 duplex;
705707 u32 speed;
@@ -757,7 +759,6 @@ struct netvsc_device { · 51 unmodified lines
757759
758760 struct nvsp_message revoke_packet;
759761
760− u32 send_table[VRSS_SEND_TAB_SIZE];
761762 u32 max_chn;
762763 u32 num_chn;
763764 spinlock_t sc_lock; /* Protects num_sc_offered variable */
drivers/net/hyperv/netvsc.c+7−8
@@ -1136,15 +1136,11 @@ static void netvsc_receive(struct net_device *ndev, · 1135 unmodified lines
11361136 static void netvsc_send_table(struct hv_device *hdev,
11371137 struct nvsp_message *nvmsg)
11381138 {
1139− struct netvsc_device *nvscdev;
11401139 struct net_device *ndev = hv_get_drvdata(hdev);
1140+ struct net_device_context *net_device_ctx = netdev_priv(ndev);
11411141 int i;
11421142 u32 count, *tab;
11431143
1144− nvscdev = get_outbound_net_device(hdev);
1145− if (!nvscdev)
1146− return;
1147−
11481144 count = nvmsg->msg.v5_msg.send_table.count;
11491145 if (count != VRSS_SEND_TAB_SIZE) {
11501146 netdev_err(ndev, "Received wrong send-table size:%u\n", count);
@@ -1155,7 +1151,7 @@ static void netvsc_send_table(struct hv_device *hdev, · 4 unmodified lines
11551151 nvmsg->msg.v5_msg.send_table.offset);
11561152
11571153 for (i = 0; i < count; i++)
1158− nvscdev->send_table[i] = tab[i];
1154+ net_device_ctx->tx_send_table[i] = tab[i];
11591155 }
11601156
11611157 static void netvsc_send_vf(struct net_device_context *net_device_ctx,
@@ -1235,8 +1231,11 @@ void netvsc_channel_cb(void *context) · 73 unmodified lines
12351231 return;
12361232
12371233 net_device = net_device_to_netvsc_device(ndev);
1238− if (unlikely(net_device->destroy) &&
1239− netvsc_channel_idle(net_device, q_idx))
1234+ if (unlikely(!net_device))
1235+ return;
1236+
1237+ if (unlikely(net_device->destroy &&
1238+ netvsc_channel_idle(net_device, q_idx)))
12401239 return;
12411240
12421241 /* commit_rd_index() -> hv_signal_on_read() needs this. */
drivers/net/hyperv/netvsc_drv.c+3−8
@@ -206,17 +206,15 @@ static u16 netvsc_select_queue(struct net_device *ndev, struct sk_buff *skb, · 205 unmodified lines
206206 void *accel_priv, select_queue_fallback_t fallback)
207207 {
208208 struct net_device_context *net_device_ctx = netdev_priv(ndev);
209− struct netvsc_device *nvsc_dev = net_device_ctx->nvdev;
209+ unsigned int num_tx_queues = ndev->real_num_tx_queues;
210210 struct sock *sk = skb->sk;
211211 int q_idx = sk_tx_queue_get(sk);
212212
213− if (q_idx < 0 || skb->ooo_okay ||
214− q_idx >= ndev->real_num_tx_queues) {
213+ if (q_idx < 0 || skb->ooo_okay || q_idx >= num_tx_queues) {
215214 u16 hash = __skb_tx_hash(ndev, skb, VRSS_SEND_TAB_SIZE);
216215 int new_idx;
217216
218− new_idx = nvsc_dev->send_table[hash]
219− % nvsc_dev->num_chn;
217+ new_idx = net_device_ctx->tx_send_table[hash] % num_tx_queues;
220218
221219 if (q_idx != new_idx && sk &&
222220 sk_fullsock(sk) && rcu_access_pointer(sk->sk_dst_cache))
@@ -225,9 +223,6 @@ static u16 netvsc_select_queue(struct net_device *ndev, struct sk_buff *skb, · 2 unmodified lines
225223 q_idx = new_idx;
226224 }
227225
228− if (unlikely(!nvsc_dev->chan_table[q_idx].channel))
229− q_idx = 0;
230−
231226 return q_idx;
232227 }
233228
drivers/net/phy/marvell.c+0−15
@@ -1883,17 +1883,6 @@ static int m88e1510_probe(struct phy_device *phydev) · 1882 unmodified lines
18831883 return m88e1510_hwmon_probe(phydev);
18841884 }
18851885
1886−static void marvell_remove(struct phy_device *phydev)
1887−{
1888−#ifdef CONFIG_HWMON
1889−
1890− struct marvell_priv *priv = phydev->priv;
1891−
1892− if (priv && priv->hwmon_dev)
1893− hwmon_device_unregister(priv->hwmon_dev);
1894−#endif
1895−}
1896−
18971886 static struct phy_driver marvell_drivers[] = {
18981887 {
18991888 .phy_id = MARVELL_PHY_ID_88E1101,
@@ -1974,7 +1963,6 @@ static struct phy_driver marvell_drivers[] = { · 74 unmodified lines
19741963 .features = PHY_GBIT_FEATURES,
19751964 .flags = PHY_HAS_INTERRUPT,
19761965 .probe = &m88e1121_probe,
1977− .remove = &marvell_remove,
19781966 .config_init = &m88e1121_config_init,
19791967 .config_aneg = &m88e1121_config_aneg,
19801968 .read_status = &marvell_read_status,
@@ -2087,7 +2075,6 @@ static struct phy_driver marvell_drivers[] = { · 106 unmodified lines
20872075 .features = PHY_GBIT_FEATURES | SUPPORTED_FIBRE,
20882076 .flags = PHY_HAS_INTERRUPT,
20892077 .probe = &m88e1510_probe,
2090− .remove = &marvell_remove,
20912078 .config_init = &m88e1510_config_init,
20922079 .config_aneg = &m88e1510_config_aneg,
20932080 .read_status = &marvell_read_status,
@@ -2109,7 +2096,6 @@ static struct phy_driver marvell_drivers[] = { · 15 unmodified lines
21092096 .features = PHY_GBIT_FEATURES,
21102097 .flags = PHY_HAS_INTERRUPT,
21112098 .probe = m88e1510_probe,
2112− .remove = &marvell_remove,
21132099 .config_init = &marvell_config_init,
21142100 .config_aneg = &m88e1510_config_aneg,
21152101 .read_status = &marvell_read_status,
@@ -2127,7 +2113,6 @@ static struct phy_driver marvell_drivers[] = { · 11 unmodified lines
21272113 .phy_id_mask = MARVELL_PHY_ID_MASK,
21282114 .name = "Marvell 88E1545",
21292115 .probe = m88e1510_probe,
2130− .remove = &marvell_remove,
21312116 .features = PHY_GBIT_FEATURES,
21322117 .flags = PHY_HAS_INTERRUPT,
21332118 .config_init = &marvell_config_init,
drivers/net/phy/phy_device.c+1−1
@@ -1864,7 +1864,7 @@ static struct phy_driver genphy_driver[] = { · 1863 unmodified lines
18641864 .phy_id = 0xffffffff,
18651865 .phy_id_mask = 0xffffffff,
18661866 .name = "Generic PHY",
1867− .soft_reset = genphy_soft_reset,
1867+ .soft_reset = genphy_no_soft_reset,
18681868 .config_init = genphy_config_init,
18691869 .features = PHY_GBIT_FEATURES | SUPPORTED_MII |
18701870 SUPPORTED_AUI | SUPPORTED_FIBRE |
drivers/net/phy/spi_ks8995.c+2−1
@@ -491,13 +491,14 @@ static int ks8995_probe(struct spi_device *spi) · 490 unmodified lines
491491 if (err)
492492 return err;
493493
494− ks->regs_attr.size = ks->chip->regs_size;
495494 memcpy(&ks->regs_attr, &ks8995_registers_attr, sizeof(ks->regs_attr));
495+ ks->regs_attr.size = ks->chip->regs_size;
496496
497497 err = ks8995_reset(ks);
498498 if (err)
499499 return err;
500500
501+ sysfs_attr_init(&ks->regs_attr.attr);
501502 err = sysfs_create_bin_file(&spi->dev.kobj, &ks->regs_attr);
502503 if (err) {
503504 dev_err(&spi->dev, "unable to create sysfs file, err=%d\n",
drivers/net/team/team.c+1−0
@@ -2072,6 +2072,7 @@ static int team_dev_type_check_change(struct net_device *dev, · 2071 unmodified lines
20722072 static void team_setup(struct net_device *dev)
20732073 {
20742074 ether_setup(dev);
2075+ dev->max_mtu = ETH_MAX_MTU;
20752076
20762077 dev->netdev_ops = &team_netdev_ops;
20772078 dev->ethtool_ops = &team_ethtool_ops;
drivers/net/tun.c+17−4
@@ -822,7 +822,18 @@ static void tun_net_uninit(struct net_device *dev) · 821 unmodified lines
822822 /* Net device open. */
823823 static int tun_net_open(struct net_device *dev)
824824 {
825+ struct tun_struct *tun = netdev_priv(dev);
826+ int i;
827+
825828 netif_tx_start_all_queues(dev);
829+
830+ for (i = 0; i < tun->numqueues; i++) {
831+ struct tun_file *tfile;
832+
833+ tfile = rtnl_dereference(tun->tfiles[i]);
834+ tfile->socket.sk->sk_write_space(tfile->socket.sk);
835+ }
836+
826837 return 0;
827838 }
828839
@@ -1103,9 +1114,10 @@ static unsigned int tun_chr_poll(struct file *file, poll_table *wait) · 274 unmodified lines
11031114 if (!skb_array_empty(&tfile->tx_array))
11041115 mask |= POLLIN | POLLRDNORM;
11051116
1106− if (sock_writeable(sk) ||
1107− (!test_and_set_bit(SOCKWQ_ASYNC_NOSPACE, &sk->sk_socket->flags) &&
1108− sock_writeable(sk)))
1117+ if (tun->dev->flags & IFF_UP &&
1118+ (sock_writeable(sk) ||
1119+ (!test_and_set_bit(SOCKWQ_ASYNC_NOSPACE, &sk->sk_socket->flags) &&
1120+ sock_writeable(sk))))
11091121 mask |= POLLOUT | POLLWRNORM;
11101122
11111123 if (tun->dev->reg_state != NETREG_REGISTERED)
@@ -1919,6 +1931,8 @@ static int set_offload(struct tun_struct *tun, unsigned long arg) · 807 unmodified lines
19191931 return -EINVAL;
19201932
19211933 tun->set_features = features;
1934+ tun->dev->wanted_features &= ~TUN_USER_FEATURES;
1935+ tun->dev->wanted_features |= features;
19221936 netdev_update_features(tun->dev);
19231937
19241938 return 0;
@@ -2570,7 +2584,6 @@ static int __init tun_init(void) · 645 unmodified lines
25702584 int ret = 0;
25712585
25722586 pr_info("%s, %s\n", DRV_DESCRIPTION, DRV_VERSION);
2573− pr_info("%s\n", DRV_COPYRIGHT);
25742587
25752588 ret = rtnl_link_register(&tun_link_ops);
25762589 if (ret) {
drivers/net/usb/qmi_wwan.c+6−0
@@ -580,6 +580,10 @@ static const struct usb_device_id products[] = { · 579 unmodified lines
580580 USB_VENDOR_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, USB_CLASS_VENDOR_SPEC, 0x01, 0x69),
581581 .driver_info = (unsigned long)&qmi_wwan_info,
582582 },
583+ { /* Motorola Mapphone devices with MDM6600 */
584+ USB_VENDOR_AND_INTERFACE_INFO(0x22b8, USB_CLASS_VENDOR_SPEC, 0xfb, 0xff),
585+ .driver_info = (unsigned long)&qmi_wwan_info,
586+ },
583587
584588 /* 2. Combined interface devices matching on class+protocol */
585589 { /* Huawei E367 and possibly others in "Windows mode" */
@@ -925,6 +929,8 @@ static const struct usb_device_id products[] = { · 339 unmodified lines
925929 {QMI_FIXED_INTF(0x413c, 0x81a9, 8)}, /* Dell Wireless 5808e Gobi(TM) 4G LTE Mobile Broadband Card */
926930 {QMI_FIXED_INTF(0x413c, 0x81b1, 8)}, /* Dell Wireless 5809e Gobi(TM) 4G LTE Mobile Broadband Card */
927931 {QMI_FIXED_INTF(0x413c, 0x81b3, 8)}, /* Dell Wireless 5809e Gobi(TM) 4G LTE Mobile Broadband Card (rev3) */
932+ {QMI_FIXED_INTF(0x413c, 0x81b6, 8)}, /* Dell Wireless 5811e */
933+ {QMI_FIXED_INTF(0x413c, 0x81b6, 10)}, /* Dell Wireless 5811e */
928934 {QMI_FIXED_INTF(0x03f0, 0x4e1d, 8)}, /* HP lt4111 LTE/EV-DO/HSPA+ Gobi 4G Module */
929935 {QMI_FIXED_INTF(0x22de, 0x9061, 3)}, /* WeTelecom WPD-600N */
930936 {QMI_FIXED_INTF(0x1e0e, 0x9001, 5)}, /* SIMCom 7230E */
drivers/net/usb/r8152.c+17−7
@@ -32,7 +32,7 @@ · 31 unmodified lines
3232 #define NETNEXT_VERSION "08"
3333
3434 /* Information for net */
35−#define NET_VERSION "8"
35+#define NET_VERSION "9"
3636
3737 #define DRIVER_VERSION "v1." NETNEXT_VERSION "." NET_VERSION
3838 #define DRIVER_AUTHOR "Realtek linux nic maintainers <nic_swsd@realtek.com>"
@@ -501,6 +501,8 @@ enum rtl_register_content { · 462 unmodified lines
501501 #define RTL8153_RMS RTL8153_MAX_PACKET
502502 #define RTL8152_TX_TIMEOUT (5 * HZ)
503503 #define RTL8152_NAPI_WEIGHT 64
504+#define rx_reserved_size(x) ((x) + VLAN_ETH_HLEN + CRC_SIZE + \
505+ sizeof(struct rx_desc) + RX_ALIGN)
504506
505507 /* rtl8152 flags */
506508 enum rtl8152_flags {
@@ -1362,6 +1364,7 @@ static int alloc_all_mem(struct r8152 *tp) · 855 unmodified lines
13621364 spin_lock_init(&tp->rx_lock);
13631365 spin_lock_init(&tp->tx_lock);
13641366 INIT_LIST_HEAD(&tp->tx_free);
1367+ INIT_LIST_HEAD(&tp->rx_done);
13651368 skb_queue_head_init(&tp->tx_queue);
13661369 skb_queue_head_init(&tp->rx_queue);
13671370
@@ -2252,8 +2255,7 @@ static void r8153_set_rx_early_timeout(struct r8152 *tp) · 884 unmodified lines
22522255
22532256 static void r8153_set_rx_early_size(struct r8152 *tp)
22542257 {
2255− u32 mtu = tp->netdev->mtu;
2256− u32 ocp_data = (agg_buf_sz - mtu - VLAN_ETH_HLEN - VLAN_HLEN) / 8;
2258+ u32 ocp_data = (agg_buf_sz - rx_reserved_size(tp->netdev->mtu)) / 4;
22572259
22582260 ocp_write_word(tp, MCU_TYPE_USB, USB_RX_EARLY_SIZE, ocp_data);
22592261 }
@@ -2898,7 +2900,8 @@ static void r8153_first_init(struct r8152 *tp) · 638 unmodified lines
28982900
28992901 rtl_rx_vlan_en(tp, tp->netdev->features & NETIF_F_HW_VLAN_CTAG_RX);
29002902
2901− ocp_write_word(tp, MCU_TYPE_PLA, PLA_RMS, RTL8153_RMS);
2903+ ocp_data = tp->netdev->mtu + VLAN_ETH_HLEN + CRC_SIZE;
2904+ ocp_write_word(tp, MCU_TYPE_PLA, PLA_RMS, ocp_data);
29022905 ocp_write_byte(tp, MCU_TYPE_PLA, PLA_MTPS, MTPS_JUMBO);
29032906
29042907 ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_TCR0);
@@ -2950,7 +2953,8 @@ static void r8153_enter_oob(struct r8152 *tp) · 45 unmodified lines
29502953 usleep_range(1000, 2000);
29512954 }
29522955
2953− ocp_write_word(tp, MCU_TYPE_PLA, PLA_RMS, RTL8153_RMS);
2956+ ocp_data = tp->netdev->mtu + VLAN_ETH_HLEN + CRC_SIZE;
2957+ ocp_write_word(tp, MCU_TYPE_PLA, PLA_RMS, ocp_data);
29542958
29552959 ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_TEREDO_CFG);
29562960 ocp_data &= ~TEREDO_WAKE_MASK;
@@ -4200,8 +4204,14 @@ static int rtl8152_change_mtu(struct net_device *dev, int new_mtu) · 1243 unmodified lines
42004204
42014205 dev->mtu = new_mtu;
42024206
4203− if (netif_running(dev) && netif_carrier_ok(dev))
4204− r8153_set_rx_early_size(tp);
4207+ if (netif_running(dev)) {
4208+ u32 rms = new_mtu + VLAN_ETH_HLEN + CRC_SIZE;
4209+
4210+ ocp_write_word(tp, MCU_TYPE_PLA, PLA_RMS, rms);
4211+
4212+ if (netif_carrier_ok(dev))
4213+ r8153_set_rx_early_size(tp);
4214+ }
42054215
42064216 mutex_unlock(&tp->control);
42074217
drivers/net/vrf.c+5−2
@@ -340,6 +340,7 @@ static netdev_tx_t is_ip_tx_frame(struct sk_buff *skb, struct net_device *dev) · 339 unmodified lines
340340
341341 static netdev_tx_t vrf_xmit(struct sk_buff *skb, struct net_device *dev)
342342 {
343+ int len = skb->len;
343344 netdev_tx_t ret = is_ip_tx_frame(skb, dev);
344345
345346 if (likely(ret == NET_XMIT_SUCCESS || ret == NET_XMIT_CN)) {
@@ -347,7 +348,7 @@ static netdev_tx_t vrf_xmit(struct sk_buff *skb, struct net_device *dev) · 1 unmodified line
347348
348349 u64_stats_update_begin(&dstats->syncp);
349350 dstats->tx_pkts++;
350− dstats->tx_bytes += skb->len;
351+ dstats->tx_bytes += len;
351352 u64_stats_update_end(&dstats->syncp);
352353 } else {
353354 this_cpu_inc(dev->dstats->tx_drps);
@@ -461,8 +462,10 @@ static void vrf_rt6_release(struct net_device *dev, struct net_vrf *vrf) · 107 unmodified lines
461462 }
462463
463464 if (rt6_local) {
464− if (rt6_local->rt6i_idev)
465+ if (rt6_local->rt6i_idev) {
465466 in6_dev_put(rt6_local->rt6i_idev);
467+ rt6_local->rt6i_idev = NULL;
468+ }
466469
467470 dst = &rt6_local->dst;
468471 dev_put(dst->dev);
drivers/net/vxlan.c+40−33
@@ -2976,6 +2976,44 @@ static int vxlan_dev_configure(struct net *src_net, struct net_device *dev, · 2975 unmodified lines
29762976 return 0;
29772977 }
29782978
2979+static int __vxlan_dev_create(struct net *net, struct net_device *dev,
2980+ struct vxlan_config *conf)
2981+{
2982+ struct vxlan_net *vn = net_generic(net, vxlan_net_id);
2983+ struct vxlan_dev *vxlan = netdev_priv(dev);
2984+ int err;
2985+
2986+ err = vxlan_dev_configure(net, dev, conf, false);
2987+ if (err)
2988+ return err;
2989+
2990+ dev->ethtool_ops = &vxlan_ethtool_ops;
2991+
2992+ /* create an fdb entry for a valid default destination */
2993+ if (!vxlan_addr_any(&vxlan->default_dst.remote_ip)) {
2994+ err = vxlan_fdb_create(vxlan, all_zeros_mac,
2995+ &vxlan->default_dst.remote_ip,
2996+ NUD_REACHABLE | NUD_PERMANENT,
2997+ NLM_F_EXCL | NLM_F_CREATE,
2998+ vxlan->cfg.dst_port,
2999+ vxlan->default_dst.remote_vni,
3000+ vxlan->default_dst.remote_vni,
3001+ vxlan->default_dst.remote_ifindex,
3002+ NTF_SELF);
3003+ if (err)
3004+ return err;
3005+ }
3006+
3007+ err = register_netdevice(dev);
3008+ if (err) {
3009+ vxlan_fdb_delete_default(vxlan, vxlan->default_dst.remote_vni);
3010+ return err;
3011+ }
3012+
3013+ list_add(&vxlan->next, &vn->vxlan_list);
3014+ return 0;
3015+}
3016+
29793017 static int vxlan_nl2conf(struct nlattr *tb[], struct nlattr *data[],
29803018 struct net_device *dev, struct vxlan_config *conf,
29813019 bool changelink)
@@ -3172,8 +3210,6 @@ static int vxlan_nl2conf(struct nlattr *tb[], struct nlattr *data[], · 190 unmodified lines
31723210 static int vxlan_newlink(struct net *src_net, struct net_device *dev,
31733211 struct nlattr *tb[], struct nlattr *data[])
31743212 {
3175− struct vxlan_net *vn = net_generic(src_net, vxlan_net_id);
3176− struct vxlan_dev *vxlan = netdev_priv(dev);
31773213 struct vxlan_config conf;
31783214 int err;
31793215
@@ -3181,36 +3217,7 @@ static int vxlan_newlink(struct net *src_net, struct net_device *dev, · 1 unmodified line
31813217 if (err)
31823218 return err;
31833219
3184− err = vxlan_dev_configure(src_net, dev, &conf, false);
3185− if (err)
3186− return err;
3187−
3188− dev->ethtool_ops = &vxlan_ethtool_ops;
3189−
3190− /* create an fdb entry for a valid default destination */
3191− if (!vxlan_addr_any(&vxlan->default_dst.remote_ip)) {
3192− err = vxlan_fdb_create(vxlan, all_zeros_mac,
3193− &vxlan->default_dst.remote_ip,
3194− NUD_REACHABLE | NUD_PERMANENT,
3195− NLM_F_EXCL | NLM_F_CREATE,
3196− vxlan->cfg.dst_port,
3197− vxlan->default_dst.remote_vni,
3198− vxlan->default_dst.remote_vni,
3199− vxlan->default_dst.remote_ifindex,
3200− NTF_SELF);
3201− if (err)
3202− return err;
3203− }
3204−
3205− err = register_netdevice(dev);
3206− if (err) {
3207− vxlan_fdb_delete_default(vxlan, vxlan->default_dst.remote_vni);
3208− return err;
3209− }
3210−
3211− list_add(&vxlan->next, &vn->vxlan_list);
3212−
3213− return 0;
3220+ return __vxlan_dev_create(src_net, dev, &conf);
32143221 }
32153222
32163223 static int vxlan_changelink(struct net_device *dev, struct nlattr *tb[],
@@ -3440,7 +3447,7 @@ struct net_device *vxlan_dev_create(struct net *net, const char *name, · 223 unmodified lines
34403447 if (IS_ERR(dev))
34413448 return dev;
34423449
3443− err = vxlan_dev_configure(net, dev, conf, false);
3450+ err = __vxlan_dev_create(net, dev, conf);
34443451 if (err < 0) {
34453452 free_netdev(dev);
34463453 return ERR_PTR(err);
drivers/net/wan/fsl_ucc_hdlc.c+2−2
@@ -381,8 +381,8 @@ static netdev_tx_t ucc_hdlc_tx(struct sk_buff *skb, struct net_device *dev) · 380 unmodified lines
381381 /* set bd status and length */
382382 bd_status = (bd_status & T_W_S) | T_R_S | T_I_S | T_L_S | T_TC_S;
383383
384− iowrite16be(bd_status, &bd->status);
385384 iowrite16be(skb->len, &bd->length);
385+ iowrite16be(bd_status, &bd->status);
386386
387387 /* Move to next BD in the ring */
388388 if (!(bd_status & T_W_S))
@@ -457,7 +457,7 @@ static int hdlc_rx_done(struct ucc_hdlc_private *priv, int rx_work_limit) · 68 unmodified lines
457457 struct sk_buff *skb;
458458 hdlc_device *hdlc = dev_to_hdlc(dev);
459459 struct qe_bd *bd;
460− u32 bd_status;
460+ u16 bd_status;
461461 u16 length, howmany = 0;
462462 u8 *bdbuffer;
463463 int i;
drivers/net/wimax/i2400m/usb.c+3−0
@@ -467,6 +467,9 @@ int i2400mu_probe(struct usb_interface *iface, · 466 unmodified lines
467467 struct i2400mu *i2400mu;
468468 struct usb_device *usb_dev = interface_to_usbdev(iface);
469469
470+ if (iface->cur_altsetting->desc.bNumEndpoints < 4)
471+ return -ENODEV;
472+
470473 if (usb_dev->speed != USB_SPEED_HIGH)
471474 dev_err(dev, "device not connected as high speed\n");
472475
drivers/net/wireless/ath/ath10k/hw.c+1−1
@@ -51,7 +51,7 @@ const struct ath10k_hw_regs qca6174_regs = { · 50 unmodified lines
5151 .rtc_soc_base_address = 0x00000800,
5252 .rtc_wmac_base_address = 0x00001000,
5353 .soc_core_base_address = 0x0003a000,
54− .wlan_mac_base_address = 0x00020000,
54+ .wlan_mac_base_address = 0x00010000,
5555 .ce_wrapper_base_address = 0x00034000,
5656 .ce0_base_address = 0x00034400,
5757 .ce1_base_address = 0x00034800,
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c+3−2
@@ -2319,7 +2319,7 @@ iwl_mvm_mac_release_buffered_frames(struct ieee80211_hw *hw, · 2318 unmodified lines
23192319 {
23202320 struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
23212321
2322− /* Called when we need to transmit (a) frame(s) from agg queue */
2322+ /* Called when we need to transmit (a) frame(s) from agg or dqa queue */
23232323
23242324 iwl_mvm_sta_modify_sleep_tx_count(mvm, sta, reason, num_frames,
23252325 tids, more_data, true);
@@ -2338,7 +2338,8 @@ static void __iwl_mvm_mac_sta_notify(struct ieee80211_hw *hw, · 12 unmodified lines
23382338 for (tid = 0; tid < IWL_MAX_TID_COUNT; tid++) {
23392339 struct iwl_mvm_tid_data *tid_data = &mvmsta->tid_data[tid];
23402340
2341− if (tid_data->state != IWL_AGG_ON &&
2341+ if (!iwl_mvm_is_dqa_supported(mvm) &&
2342+ tid_data->state != IWL_AGG_ON &&
23422343 tid_data->state != IWL_EMPTYING_HW_QUEUE_DELBA)
23432344 continue;
23442345
drivers/net/wireless/intel/iwlwifi/mvm/sta.c+6−5
@@ -3135,7 +3135,7 @@ void iwl_mvm_sta_modify_sleep_tx_count(struct iwl_mvm *mvm, · 3134 unmodified lines
31353135 struct ieee80211_sta *sta,
31363136 enum ieee80211_frame_release_type reason,
31373137 u16 cnt, u16 tids, bool more_data,
3138− bool agg)
3138+ bool single_sta_queue)
31393139 {
31403140 struct iwl_mvm_sta *mvmsta = iwl_mvm_sta_from_mac80211(sta);
31413141 struct iwl_mvm_add_sta_cmd cmd = {
@@ -3155,14 +3155,14 @@ void iwl_mvm_sta_modify_sleep_tx_count(struct iwl_mvm *mvm, · 13 unmodified lines
31553155 for_each_set_bit(tid, &_tids, IWL_MAX_TID_COUNT)
31563156 cmd.awake_acs |= BIT(tid_to_ucode_ac[tid]);
31573157
3158− /* If we're releasing frames from aggregation queues then check if the
3159− * all queues combined that we're releasing frames from have
3158+ /* If we're releasing frames from aggregation or dqa queues then check
3159+ * if all the queues that we're releasing frames from, combined, have:
31603160 * - more frames than the service period, in which case more_data
31613161 * needs to be set
31623162 * - fewer than 'cnt' frames, in which case we need to adjust the
31633163 * firmware command (but do that unconditionally)
31643164 */
3165− if (agg) {
3165+ if (single_sta_queue) {
31663166 int remaining = cnt;
31673167 int sleep_tx_count;
31683168
@@ -3172,7 +3172,8 @@ void iwl_mvm_sta_modify_sleep_tx_count(struct iwl_mvm *mvm, · 3 unmodified lines
31723172 u16 n_queued;
31733173
31743174 tid_data = &mvmsta->tid_data[tid];
3175− if (WARN(tid_data->state != IWL_AGG_ON &&
3175+ if (WARN(!iwl_mvm_is_dqa_supported(mvm) &&
3176+ tid_data->state != IWL_AGG_ON &&
31763177 tid_data->state != IWL_EMPTYING_HW_QUEUE_DELBA,
31773178 "TID %d state is %d\n",
31783179 tid, tid_data->state)) {
drivers/net/wireless/intel/iwlwifi/mvm/sta.h+1−1
@@ -547,7 +547,7 @@ void iwl_mvm_sta_modify_sleep_tx_count(struct iwl_mvm *mvm, · 546 unmodified lines
547547 struct ieee80211_sta *sta,
548548 enum ieee80211_frame_release_type reason,
549549 u16 cnt, u16 tids, bool more_data,
550− bool agg);
550+ bool single_sta_queue);
551551 int iwl_mvm_drain_sta(struct iwl_mvm *mvm, struct iwl_mvm_sta *mvmsta,
552552 bool drain);
553553 void iwl_mvm_sta_modify_disable_tx(struct iwl_mvm *mvm,
drivers/net/wireless/intel/iwlwifi/mvm/tx.c+18−23
@@ -7,7 +7,7 @@ · 6 unmodified lines
77 *
88 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
99 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
10− * Copyright(c) 2016 Intel Deutschland GmbH
10+ * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
1111 *
1212 * This program is free software; you can redistribute it and/or modify
1313 * it under the terms of version 2 of the GNU General Public License as
@@ -34,6 +34,7 @@ · 20 unmodified lines
3434 *
3535 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
3636 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
37+ * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
3738 * All rights reserved.
3839 *
3940 * Redistribution and use in source and binary forms, with or without
@@ -628,8 +629,10 @@ int iwl_mvm_tx_skb_non_sta(struct iwl_mvm *mvm, struct sk_buff *skb) · 588 unmodified lines
628629 * values.
629630 * Note that we don't need to make sure it isn't agg'd, since we're
630631 * TXing non-sta
632+ * For DQA mode - we shouldn't increase it though
631633 */
632− atomic_inc(&mvm->pending_frames[sta_id]);
634+ if (!iwl_mvm_is_dqa_supported(mvm))
635+ atomic_inc(&mvm->pending_frames[sta_id]);
633636
634637 return 0;
635638 }
@@ -1005,11 +1008,8 @@ static int iwl_mvm_tx_mpdu(struct iwl_mvm *mvm, struct sk_buff *skb, · 369 unmodified lines
10051008
10061009 spin_unlock(&mvmsta->lock);
10071010
1008− /* Increase pending frames count if this isn't AMPDU */
1009− if ((iwl_mvm_is_dqa_supported(mvm) &&
1010− mvmsta->tid_data[tx_cmd->tid_tspec].state != IWL_AGG_ON &&
1011− mvmsta->tid_data[tx_cmd->tid_tspec].state != IWL_AGG_STARTING) ||
1012− (!iwl_mvm_is_dqa_supported(mvm) && !is_ampdu))
1011+ /* Increase pending frames count if this isn't AMPDU or DQA queue */
1012+ if (!iwl_mvm_is_dqa_supported(mvm) && !is_ampdu)
10131013 atomic_inc(&mvm->pending_frames[mvmsta->sta_id]);
10141014
10151015 return 0;
@@ -1079,12 +1079,13 @@ static void iwl_mvm_check_ratid_empty(struct iwl_mvm *mvm, · 63 unmodified lines
10791079 lockdep_assert_held(&mvmsta->lock);
10801080
10811081 if ((tid_data->state == IWL_AGG_ON ||
1082− tid_data->state == IWL_EMPTYING_HW_QUEUE_DELBA) &&
1082+ tid_data->state == IWL_EMPTYING_HW_QUEUE_DELBA ||
1083+ iwl_mvm_is_dqa_supported(mvm)) &&
10831084 iwl_mvm_tid_queued(tid_data) == 0) {
10841085 /*
1085− * Now that this aggregation queue is empty tell mac80211 so it
1086− * knows we no longer have frames buffered for the station on
1087− * this TID (for the TIM bitmap calculation.)
1086+ * Now that this aggregation or DQA queue is empty tell
1087+ * mac80211 so it knows we no longer have frames buffered for
1088+ * the station on this TID (for the TIM bitmap calculation.)
10881089 */
10891090 ieee80211_sta_set_buffered(sta, tid, false);
10901091 }
@@ -1257,7 +1258,6 @@ static void iwl_mvm_rx_tx_cmd_single(struct iwl_mvm *mvm, · 166 unmodified lines
12571258 u8 skb_freed = 0;
12581259 u16 next_reclaimed, seq_ctl;
12591260 bool is_ndp = false;
1260− bool txq_agg = false; /* Is this TXQ aggregated */
12611261
12621262 __skb_queue_head_init(&skbs);
12631263
@@ -1283,6 +1283,10 @@ static void iwl_mvm_rx_tx_cmd_single(struct iwl_mvm *mvm, · 19 unmodified lines
12831283 info->flags |= IEEE80211_TX_STAT_ACK;
12841284 break;
12851285 case TX_STATUS_FAIL_DEST_PS:
1286+ /* In DQA, the FW should have stopped the queue and not
1287+ * return this status
1288+ */
1289+ WARN_ON(iwl_mvm_is_dqa_supported(mvm));
12861290 info->flags |= IEEE80211_TX_STAT_TX_FILTERED;
12871291 break;
12881292 default:
@@ -1387,15 +1391,6 @@ static void iwl_mvm_rx_tx_cmd_single(struct iwl_mvm *mvm, · 98 unmodified lines
13871391 bool send_eosp_ndp = false;
13881392
13891393 spin_lock_bh(&mvmsta->lock);
1390− if (iwl_mvm_is_dqa_supported(mvm)) {
1391− enum iwl_mvm_agg_state state;
1392−
1393− state = mvmsta->tid_data[tid].state;
1394− txq_agg = (state == IWL_AGG_ON ||
1395− state == IWL_EMPTYING_HW_QUEUE_DELBA);
1396− } else {
1397− txq_agg = txq_id >= mvm->first_agg_queue;
1398− }
13991394
14001395 if (!is_ndp) {
14011396 tid_data->next_reclaimed = next_reclaimed;
@@ -1452,11 +1447,11 @@ static void iwl_mvm_rx_tx_cmd_single(struct iwl_mvm *mvm, · 50 unmodified lines
14521447 * If the txq is not an AMPDU queue, there is no chance we freed
14531448 * several skbs. Check that out...
14541449 */
1455− if (txq_agg)
1450+ if (iwl_mvm_is_dqa_supported(mvm) || txq_id >= mvm->first_agg_queue)
14561451 goto out;
14571452
14581453 /* We can't free more than one frame at once on a shared queue */
1459− WARN_ON(!iwl_mvm_is_dqa_supported(mvm) && (skb_freed > 1));
1454+ WARN_ON(skb_freed > 1);
14601455
14611456 /* If we have still frames for this STA nothing to do here */
14621457 if (!atomic_sub_and_test(skb_freed, &mvm->pending_frames[sta_id]))
drivers/net/wireless/marvell/mwifiex/main.c+7−4
@@ -57,8 +57,8 @@ MODULE_PARM_DESC(mfg_mode, "manufacturing mode enable:1, disable:0"); · 56 unmodified lines
5757 * In case of any errors during inittialization, this function also ensures
5858 * proper cleanup before exiting.
5959 */
60−static int mwifiex_register(void *card, struct mwifiex_if_ops *if_ops,
61− void **padapter)
60+static int mwifiex_register(void *card, struct device *dev,
61+ struct mwifiex_if_ops *if_ops, void **padapter)
6262 {
6363 struct mwifiex_adapter *adapter;
6464 int i;
@@ -68,6 +68,7 @@ static int mwifiex_register(void *card, struct mwifiex_if_ops *if_ops, · 3 unmodified lines
6868 return -ENOMEM;
6969
7070 *padapter = adapter;
71+ adapter->dev = dev;
7172 adapter->card = card;
7273
7374 /* Save interface specific operations in adapter */
@@ -1568,12 +1569,11 @@ mwifiex_add_card(void *card, struct completion *fw_done, · 1494 unmodified lines
15681569 {
15691570 struct mwifiex_adapter *adapter;
15701571
1571− if (mwifiex_register(card, if_ops, (void **)&adapter)) {
1572+ if (mwifiex_register(card, dev, if_ops, (void **)&adapter)) {
15721573 pr_err("%s: software init failed\n", __func__);
15731574 goto err_init_sw;
15741575 }
15751576
1576− adapter->dev = dev;
15771577 mwifiex_probe_of(adapter);
15781578
15791579 adapter->iface_type = iface_type;
@@ -1718,6 +1718,9 @@ int mwifiex_remove_card(struct mwifiex_adapter *adapter) · 138 unmodified lines
17181718 wiphy_unregister(adapter->wiphy);
17191719 wiphy_free(adapter->wiphy);
17201720
1721+ if (adapter->irq_wakeup >= 0)
1722+ device_init_wakeup(adapter->dev, false);
1723+
17211724 /* Unregister device */
17221725 mwifiex_dbg(adapter, INFO,
17231726 "info: unregister device\n");
drivers/net/wireless/marvell/mwifiex/pcie.c+19−19
@@ -2739,6 +2739,21 @@ static void mwifiex_pcie_device_dump(struct mwifiex_adapter *adapter) · 2738 unmodified lines
27392739 schedule_work(&card->work);
27402740 }
27412741
2742+static void mwifiex_pcie_free_buffers(struct mwifiex_adapter *adapter)
2743+{
2744+ struct pcie_service_card *card = adapter->card;
2745+ const struct mwifiex_pcie_card_reg *reg = card->pcie.reg;
2746+
2747+ if (reg->sleep_cookie)
2748+ mwifiex_pcie_delete_sleep_cookie_buf(adapter);
2749+
2750+ mwifiex_pcie_delete_cmdrsp_buf(adapter);
2751+ mwifiex_pcie_delete_evtbd_ring(adapter);
2752+ mwifiex_pcie_delete_rxbd_ring(adapter);
2753+ mwifiex_pcie_delete_txbd_ring(adapter);
2754+ card->cmdrsp_buf = NULL;
2755+}
2756+
27422757 /*
27432758 * This function initializes the PCI-E host memory space, WCB rings, etc.
27442759 *
@@ -2850,13 +2865,6 @@ err_enable_dev: · 105 unmodified lines
28502865
28512866 /*
28522867 * This function cleans up the allocated card buffers.
2853− *
2854− * The following are freed by this function -
2855− * - TXBD ring buffers
2856− * - RXBD ring buffers
2857− * - Event BD ring buffers
2858− * - Command response ring buffer
2859− * - Sleep cookie buffer
28602868 */
28612869 static void mwifiex_cleanup_pcie(struct mwifiex_adapter *adapter)
28622870 {
@@ -2875,6 +2883,8 @@ static void mwifiex_cleanup_pcie(struct mwifiex_adapter *adapter) · 12 unmodified lines
28752883 "Failed to write driver not-ready signature\n");
28762884 }
28772885
2886+ mwifiex_pcie_free_buffers(adapter);
2887+
28782888 if (pdev) {
28792889 pci_iounmap(pdev, card->pci_mmap);
28802890 pci_iounmap(pdev, card->pci_mmap1);
@@ -3126,10 +3136,7 @@ err_cre_txbd: · 245 unmodified lines
31263136 pci_iounmap(pdev, card->pci_mmap1);
31273137 }
31283138
3129−/* This function cleans up the PCI-E host memory space.
3130− * Some code is extracted from mwifiex_unregister_dev()
3131− *
3132− */
3139+/* This function cleans up the PCI-E host memory space. */
31333140 static void mwifiex_pcie_down_dev(struct mwifiex_adapter *adapter)
31343141 {
31353142 struct pcie_service_card *card = adapter->card;
@@ -3140,14 +3147,7 @@ static void mwifiex_pcie_down_dev(struct mwifiex_adapter *adapter) · 4 unmodified lines
31403147
31413148 adapter->seq_num = 0;
31423149
3143− if (reg->sleep_cookie)
3144− mwifiex_pcie_delete_sleep_cookie_buf(adapter);
3145−
3146− mwifiex_pcie_delete_cmdrsp_buf(adapter);
3147− mwifiex_pcie_delete_evtbd_ring(adapter);
3148− mwifiex_pcie_delete_rxbd_ring(adapter);
3149− mwifiex_pcie_delete_txbd_ring(adapter);
3150− card->cmdrsp_buf = NULL;
3150+ mwifiex_pcie_free_buffers(adapter);
31513151 }
31523152
31533153 static struct mwifiex_if_ops pcie_ops = {
drivers/net/xen-netback/interface.c+17−9
@@ -165,13 +165,17 @@ static int xenvif_start_xmit(struct sk_buff *skb, struct net_device *dev) · 164 unmodified lines
165165 {
166166 struct xenvif *vif = netdev_priv(dev);
167167 struct xenvif_queue *queue = NULL;
168− unsigned int num_queues = vif->num_queues;
168+ unsigned int num_queues;
169169 u16 index;
170170 struct xenvif_rx_cb *cb;
171171
172172 BUG_ON(skb->dev != dev);
173173
174− /* Drop the packet if queues are not set up */
174+ /* Drop the packet if queues are not set up.
175+ * This handler should be called inside an RCU read section
176+ * so we don't need to enter it here explicitly.
177+ */
178+ num_queues = READ_ONCE(vif->num_queues);
175179 if (num_queues < 1)
176180 goto drop;
177181
@@ -222,18 +226,18 @@ static struct net_device_stats *xenvif_get_stats(struct net_device *dev) · 44 unmodified lines
222226 {
223227 struct xenvif *vif = netdev_priv(dev);
224228 struct xenvif_queue *queue = NULL;
229+ unsigned int num_queues;
225230 u64 rx_bytes = 0;
226231 u64 rx_packets = 0;
227232 u64 tx_bytes = 0;
228233 u64 tx_packets = 0;
229234 unsigned int index;
230235
231− spin_lock(&vif->lock);
232− if (vif->queues == NULL)
233− goto out;
236+ rcu_read_lock();
237+ num_queues = READ_ONCE(vif->num_queues);
234238
235239 /* Aggregate tx and rx stats from each queue */
236− for (index = 0; index < vif->num_queues; ++index) {
240+ for (index = 0; index < num_queues; ++index) {
237241 queue = &vif->queues[index];
238242 rx_bytes += queue->stats.rx_bytes;
239243 rx_packets += queue->stats.rx_packets;
@@ -241,8 +245,7 @@ static struct net_device_stats *xenvif_get_stats(struct net_device *dev) · 1 unmodified line
241245 tx_packets += queue->stats.tx_packets;
242246 }
243247
244−out:
245− spin_unlock(&vif->lock);
248+ rcu_read_unlock();
246249
247250 vif->dev->stats.rx_bytes = rx_bytes;
248251 vif->dev->stats.rx_packets = rx_packets;
@@ -378,10 +381,13 @@ static void xenvif_get_ethtool_stats(struct net_device *dev, · 129 unmodified lines
378381 struct ethtool_stats *stats, u64 * data)
379382 {
380383 struct xenvif *vif = netdev_priv(dev);
381− unsigned int num_queues = vif->num_queues;
384+ unsigned int num_queues;
382385 int i;
383386 unsigned int queue_index;
384387
388+ rcu_read_lock();
389+ num_queues = READ_ONCE(vif->num_queues);
390+
385391 for (i = 0; i < ARRAY_SIZE(xenvif_stats); i++) {
386392 unsigned long accum = 0;
387393 for (queue_index = 0; queue_index < num_queues; ++queue_index) {
@@ -390,6 +396,8 @@ static void xenvif_get_ethtool_stats(struct net_device *dev, · 2 unmodified lines
390396 }
391397 data[i] = accum;
392398 }
399+
400+ rcu_read_unlock();
393401 }
394402
395403 static void xenvif_get_strings(struct net_device *dev, u32 stringset, u8 * data)
drivers/net/xen-netback/netback.c+1−1
@@ -214,7 +214,7 @@ static void xenvif_fatal_tx_err(struct xenvif *vif) · 213 unmodified lines
214214 netdev_err(vif->dev, "fatal error; disabling device\n");
215215 vif->disabled = true;
216216 /* Disable the vif from queue 0's kthread */
217− if (vif->queues)
217+ if (vif->num_queues)
218218 xenvif_kick_thread(&vif->queues[0]);
219219 }
220220
drivers/net/xen-netback/xenbus.c+10−10
@@ -495,26 +495,26 @@ static void backend_disconnect(struct backend_info *be) · 494 unmodified lines
495495 struct xenvif *vif = be->vif;
496496
497497 if (vif) {
498+ unsigned int num_queues = vif->num_queues;
498499 unsigned int queue_index;
499− struct xenvif_queue *queues;
500500
501501 xen_unregister_watchers(vif);
502502 #ifdef CONFIG_DEBUG_FS
503503 xenvif_debugfs_delif(vif);
504504 #endif /* CONFIG_DEBUG_FS */
505505 xenvif_disconnect_data(vif);
506− for (queue_index = 0;
507− queue_index < vif->num_queues;
508− ++queue_index)
509− xenvif_deinit_queue(&vif->queues[queue_index]);
510506
511− spin_lock(&vif->lock);
512− queues = vif->queues;
507+ /* At this point some of the handlers may still be active
508+ * so we need to have additional synchronization here.
509+ */
513510 vif->num_queues = 0;
514− vif->queues = NULL;
515− spin_unlock(&vif->lock);
511+ synchronize_net();
516512
517− vfree(queues);
513+ for (queue_index = 0; queue_index < num_queues; ++queue_index)
514+ xenvif_deinit_queue(&vif->queues[queue_index]);
515+
516+ vfree(vif->queues);
517+ vif->queues = NULL;
518518
519519 xenvif_disconnect_ctrl(vif);
520520 }
drivers/nvdimm/bus.c+6−0
@@ -934,8 +934,14 @@ static int __nd_ioctl(struct nvdimm_bus *nvdimm_bus, struct nvdimm *nvdimm, · 933 unmodified lines
934934 rc = nd_desc->ndctl(nd_desc, nvdimm, cmd, buf, buf_len, NULL);
935935 if (rc < 0)
936936 goto out_unlock;
937+ nvdimm_bus_unlock(&nvdimm_bus->dev);
938+
937939 if (copy_to_user(p, buf, buf_len))
938940 rc = -EFAULT;
941+
942+ vfree(buf);
943+ return rc;
944+
939945 out_unlock:
940946 nvdimm_bus_unlock(&nvdimm_bus->dev);
941947 out:
drivers/nvdimm/claim.c+9−1
@@ -243,7 +243,15 @@ static int nsio_rw_bytes(struct nd_namespace_common *ndns, · 242 unmodified lines
243243 }
244244
245245 if (unlikely(is_bad_pmem(&nsio->bb, sector, sz_align))) {
246− if (IS_ALIGNED(offset, 512) && IS_ALIGNED(size, 512)) {
246+ /*
247+ * FIXME: nsio_rw_bytes() may be called from atomic
248+ * context in the btt case and nvdimm_clear_poison()
249+ * takes a sleeping lock. Until the locking can be
250+ * reworked this capability requires that the namespace
251+ * is not claimed by btt.
252+ */
253+ if (IS_ALIGNED(offset, 512) && IS_ALIGNED(size, 512)
254+ && (!ndns->claim || !is_nd_btt(ndns->claim))) {
247255 long cleared;
248256
249257 cleared = nvdimm_clear_poison(&ndns->dev, offset, size);
drivers/nvdimm/dimm_devs.c+11−66
@@ -395,7 +395,7 @@ EXPORT_SYMBOL_GPL(nvdimm_create); · 394 unmodified lines
395395
396396 int alias_dpa_busy(struct device *dev, void *data)
397397 {
398− resource_size_t map_end, blk_start, new, busy;
398+ resource_size_t map_end, blk_start, new;
399399 struct blk_alloc_info *info = data;
400400 struct nd_mapping *nd_mapping;
401401 struct nd_region *nd_region;
@@ -436,29 +436,19 @@ int alias_dpa_busy(struct device *dev, void *data) · 34 unmodified lines
436436 retry:
437437 /*
438438 * Find the free dpa from the end of the last pmem allocation to
439− * the end of the interleave-set mapping that is not already
440− * covered by a blk allocation.
439+ * the end of the interleave-set mapping.
441440 */
442− busy = 0;
443441 for_each_dpa_resource(ndd, res) {
442+ if (strncmp(res->name, "pmem", 4) != 0)
443+ continue;
444444 if ((res->start >= blk_start && res->start < map_end)
445445 || (res->end >= blk_start
446446 && res->end <= map_end)) {
447− if (strncmp(res->name, "pmem", 4) == 0) {
448− new = max(blk_start, min(map_end + 1,
449− res->end + 1));
450− if (new != blk_start) {
451− blk_start = new;
452− goto retry;
453− }
454− } else
455− busy += min(map_end, res->end)
456− - max(nd_mapping->start, res->start) + 1;
457− } else if (nd_mapping->start > res->start
458− && map_end < res->end) {
459− /* total eclipse of the PMEM region mapping */
460− busy += nd_mapping->size;
461− break;
447+ new = max(blk_start, min(map_end + 1, res->end + 1));
448+ if (new != blk_start) {
449+ blk_start = new;
450+ goto retry;
451+ }
462452 }
463453 }
464454
@@ -470,52 +460,11 @@ int alias_dpa_busy(struct device *dev, void *data) · 5 unmodified lines
470460 return 1;
471461 }
472462
473− info->available -= blk_start - nd_mapping->start + busy;
463+ info->available -= blk_start - nd_mapping->start;
474464
475465 return 0;
476466 }
477467
478−static int blk_dpa_busy(struct device *dev, void *data)
479−{
480− struct blk_alloc_info *info = data;
481− struct nd_mapping *nd_mapping;
482− struct nd_region *nd_region;
483− resource_size_t map_end;
484− int i;
485−
486− if (!is_nd_pmem(dev))
487− return 0;
488−
489− nd_region = to_nd_region(dev);
490− for (i = 0; i < nd_region->ndr_mappings; i++) {
491− nd_mapping = &nd_region->mapping[i];
492− if (nd_mapping->nvdimm == info->nd_mapping->nvdimm)
493− break;
494− }
495−
496− if (i >= nd_region->ndr_mappings)
497− return 0;
498−
499− map_end = nd_mapping->start + nd_mapping->size - 1;
500− if (info->res->start >= nd_mapping->start
501− && info->res->start < map_end) {
502− if (info->res->end <= map_end) {
503− info->busy = 0;
504− return 1;
505− } else {
506− info->busy -= info->res->end - map_end;
507− return 0;
508− }
509− } else if (info->res->end >= nd_mapping->start
510− && info->res->end <= map_end) {
511− info->busy -= nd_mapping->start - info->res->start;
512− return 0;
513− } else {
514− info->busy -= nd_mapping->size;
515− return 0;
516− }
517−}
518−
519468 /**
520469 * nd_blk_available_dpa - account the unused dpa of BLK region
521470 * @nd_mapping: container of dpa-resource-root + labels
@@ -545,11 +494,7 @@ resource_size_t nd_blk_available_dpa(struct nd_region *nd_region) · 23 unmodified lines
545494 for_each_dpa_resource(ndd, res) {
546495 if (strncmp(res->name, "blk", 3) != 0)
547496 continue;
548−
549− info.res = res;
550− info.busy = resource_size(res);
551− device_for_each_child(&nvdimm_bus->dev, &info, blk_dpa_busy);
552− info.available -= info.busy;
497+ info.available -= resource_size(res);
553498 }
554499
555500 return info.available;
drivers/nvme/host/rdma.c+14−14
@@ -343,8 +343,6 @@ static int __nvme_rdma_init_request(struct nvme_rdma_ctrl *ctrl, · 342 unmodified lines
343343 struct ib_device *ibdev = dev->dev;
344344 int ret;
345345
346− BUG_ON(queue_idx >= ctrl->queue_count);
347−
348346 ret = nvme_rdma_alloc_qe(ibdev, &req->sqe, sizeof(struct nvme_command),
349347 DMA_TO_DEVICE);
350348 if (ret)
@@ -652,8 +650,22 @@ out_free_queues: · 301 unmodified lines
652650
653651 static int nvme_rdma_init_io_queues(struct nvme_rdma_ctrl *ctrl)
654652 {
653+ struct nvmf_ctrl_options *opts = ctrl->ctrl.opts;
654+ unsigned int nr_io_queues;
655655 int i, ret;
656656
657+ nr_io_queues = min(opts->nr_io_queues, num_online_cpus());
658+ ret = nvme_set_queue_count(&ctrl->ctrl, &nr_io_queues);
659+ if (ret)
660+ return ret;
661+
662+ ctrl->queue_count = nr_io_queues + 1;
663+ if (ctrl->queue_count < 2)
664+ return 0;
665+
666+ dev_info(ctrl->ctrl.device,
667+ "creating %d I/O queues.\n", nr_io_queues);
668+
657669 for (i = 1; i < ctrl->queue_count; i++) {
658670 ret = nvme_rdma_init_queue(ctrl, i,
659671 ctrl->ctrl.opts->queue_size);
@@ -1791,20 +1803,8 @@ static const struct nvme_ctrl_ops nvme_rdma_ctrl_ops = { · 1131 unmodified lines
17911803
17921804 static int nvme_rdma_create_io_queues(struct nvme_rdma_ctrl *ctrl)
17931805 {
1794− struct nvmf_ctrl_options *opts = ctrl->ctrl.opts;
17951806 int ret;
17961807
1797− ret = nvme_set_queue_count(&ctrl->ctrl, &opts->nr_io_queues);
1798− if (ret)
1799− return ret;
1800−
1801− ctrl->queue_count = opts->nr_io_queues + 1;
1802− if (ctrl->queue_count < 2)
1803− return 0;
1804−
1805− dev_info(ctrl->ctrl.device,
1806− "creating %d I/O queues.\n", opts->nr_io_queues);
1807−
18081808 ret = nvme_rdma_init_io_queues(ctrl);
18091809 if (ret)
18101810 return ret;
drivers/nvme/target/core.c+10−1
@@ -425,6 +425,13 @@ void nvmet_sq_setup(struct nvmet_ctrl *ctrl, struct nvmet_sq *sq, · 424 unmodified lines
425425 ctrl->sqs[qid] = sq;
426426 }
427427
428+static void nvmet_confirm_sq(struct percpu_ref *ref)
429+{
430+ struct nvmet_sq *sq = container_of(ref, struct nvmet_sq, ref);
431+
432+ complete(&sq->confirm_done);
433+}
434+
428435 void nvmet_sq_destroy(struct nvmet_sq *sq)
429436 {
430437 /*
@@ -433,7 +440,8 @@ void nvmet_sq_destroy(struct nvmet_sq *sq) · 2 unmodified lines
433440 */
434441 if (sq->ctrl && sq->ctrl->sqs && sq->ctrl->sqs[0] == sq)
435442 nvmet_async_events_free(sq->ctrl);
436− percpu_ref_kill(&sq->ref);
443+ percpu_ref_kill_and_confirm(&sq->ref, nvmet_confirm_sq);
444+ wait_for_completion(&sq->confirm_done);
437445 wait_for_completion(&sq->free_done);
438446 percpu_ref_exit(&sq->ref);
439447
@@ -461,6 +469,7 @@ int nvmet_sq_init(struct nvmet_sq *sq) · 21 unmodified lines
461469 return ret;
462470 }
463471 init_completion(&sq->free_done);
472+ init_completion(&sq->confirm_done);
464473
465474 return 0;
466475 }
drivers/nvme/target/loop.c+51−39
@@ -223,8 +223,6 @@ static void nvme_loop_submit_async_event(struct nvme_ctrl *arg, int aer_idx) · 222 unmodified lines
223223 static int nvme_loop_init_iod(struct nvme_loop_ctrl *ctrl,
224224 struct nvme_loop_iod *iod, unsigned int queue_idx)
225225 {
226− BUG_ON(queue_idx >= ctrl->queue_count);
227−
228226 iod->req.cmd = &iod->cmd;
229227 iod->req.rsp = &iod->rsp;
230228 iod->queue = &ctrl->queues[queue_idx];
@@ -288,9 +286,9 @@ static struct blk_mq_ops nvme_loop_admin_mq_ops = { · 57 unmodified lines
288286
289287 static void nvme_loop_destroy_admin_queue(struct nvme_loop_ctrl *ctrl)
290288 {
289+ nvmet_sq_destroy(&ctrl->queues[0].nvme_sq);
291290 blk_cleanup_queue(ctrl->ctrl.admin_q);
292291 blk_mq_free_tag_set(&ctrl->admin_tag_set);
293− nvmet_sq_destroy(&ctrl->queues[0].nvme_sq);
294292 }
295293
296294 static void nvme_loop_free_ctrl(struct nvme_ctrl *nctrl)
@@ -314,6 +312,43 @@ free_ctrl: · 17 unmodified lines
314312 kfree(ctrl);
315313 }
316314
315+static void nvme_loop_destroy_io_queues(struct nvme_loop_ctrl *ctrl)
316+{
317+ int i;
318+
319+ for (i = 1; i < ctrl->queue_count; i++)
320+ nvmet_sq_destroy(&ctrl->queues[i].nvme_sq);
321+}
322+
323+static int nvme_loop_init_io_queues(struct nvme_loop_ctrl *ctrl)
324+{
325+ struct nvmf_ctrl_options *opts = ctrl->ctrl.opts;
326+ unsigned int nr_io_queues;
327+ int ret, i;
328+
329+ nr_io_queues = min(opts->nr_io_queues, num_online_cpus());
330+ ret = nvme_set_queue_count(&ctrl->ctrl, &nr_io_queues);
331+ if (ret || !nr_io_queues)
332+ return ret;
333+
334+ dev_info(ctrl->ctrl.device, "creating %d I/O queues.\n", nr_io_queues);
335+
336+ for (i = 1; i <= nr_io_queues; i++) {
337+ ctrl->queues[i].ctrl = ctrl;
338+ ret = nvmet_sq_init(&ctrl->queues[i].nvme_sq);
339+ if (ret)
340+ goto out_destroy_queues;
341+
342+ ctrl->queue_count++;
343+ }
344+
345+ return 0;
346+
347+out_destroy_queues:
348+ nvme_loop_destroy_io_queues(ctrl);
349+ return ret;
350+}
351+
317352 static int nvme_loop_configure_admin_queue(struct nvme_loop_ctrl *ctrl)
318353 {
319354 int error;
@@ -385,17 +420,13 @@ out_free_sq: · 65 unmodified lines
385420
386421 static void nvme_loop_shutdown_ctrl(struct nvme_loop_ctrl *ctrl)
387422 {
388− int i;
389−
390423 nvme_stop_keep_alive(&ctrl->ctrl);
391424
392425 if (ctrl->queue_count > 1) {
393426 nvme_stop_queues(&ctrl->ctrl);
394427 blk_mq_tagset_busy_iter(&ctrl->tag_set,
395428 nvme_cancel_request, &ctrl->ctrl);
396−
397− for (i = 1; i < ctrl->queue_count; i++)
398− nvmet_sq_destroy(&ctrl->queues[i].nvme_sq);
429+ nvme_loop_destroy_io_queues(ctrl);
399430 }
400431
401432 if (ctrl->ctrl.state == NVME_CTRL_LIVE)
@@ -467,19 +498,14 @@ static void nvme_loop_reset_ctrl_work(struct work_struct *work) · 65 unmodified lines
467498 if (ret)
468499 goto out_disable;
469500
470− for (i = 1; i <= ctrl->ctrl.opts->nr_io_queues; i++) {
471− ctrl->queues[i].ctrl = ctrl;
472− ret = nvmet_sq_init(&ctrl->queues[i].nvme_sq);
473− if (ret)
474− goto out_free_queues;
475−
476− ctrl->queue_count++;
477− }
501+ ret = nvme_loop_init_io_queues(ctrl);
502+ if (ret)
503+ goto out_destroy_admin;
478504
479− for (i = 1; i <= ctrl->ctrl.opts->nr_io_queues; i++) {
505+ for (i = 1; i < ctrl->queue_count; i++) {
480506 ret = nvmf_connect_io_queue(&ctrl->ctrl, i);
481507 if (ret)
482− goto out_free_queues;
508+ goto out_destroy_io;
483509 }
484510
485511 changed = nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_LIVE);
@@ -492,9 +518,9 @@ static void nvme_loop_reset_ctrl_work(struct work_struct *work) · 6 unmodified lines
492518
493519 return;
494520
495−out_free_queues:
496− for (i = 1; i < ctrl->queue_count; i++)
497− nvmet_sq_destroy(&ctrl->queues[i].nvme_sq);
521+out_destroy_io:
522+ nvme_loop_destroy_io_queues(ctrl);
523+out_destroy_admin:
498524 nvme_loop_destroy_admin_queue(ctrl);
499525 out_disable:
500526 dev_warn(ctrl->ctrl.device, "Removing after reset failure\n");
@@ -533,25 +559,12 @@ static const struct nvme_ctrl_ops nvme_loop_ctrl_ops = { · 32 unmodified lines
533559
534560 static int nvme_loop_create_io_queues(struct nvme_loop_ctrl *ctrl)
535561 {
536− struct nvmf_ctrl_options *opts = ctrl->ctrl.opts;
537562 int ret, i;
538563
539− ret = nvme_set_queue_count(&ctrl->ctrl, &opts->nr_io_queues);
540− if (ret || !opts->nr_io_queues)
564+ ret = nvme_loop_init_io_queues(ctrl);
565+ if (ret)
541566 return ret;
542567
543− dev_info(ctrl->ctrl.device, "creating %d I/O queues.\n",
544− opts->nr_io_queues);
545−
546− for (i = 1; i <= opts->nr_io_queues; i++) {
547− ctrl->queues[i].ctrl = ctrl;
548− ret = nvmet_sq_init(&ctrl->queues[i].nvme_sq);
549− if (ret)
550− goto out_destroy_queues;
551−
552− ctrl->queue_count++;
553− }
554−
555568 memset(&ctrl->tag_set, 0, sizeof(ctrl->tag_set));
556569 ctrl->tag_set.ops = &nvme_loop_mq_ops;
557570 ctrl->tag_set.queue_depth = ctrl->ctrl.opts->queue_size;
@@ -575,7 +588,7 @@ static int nvme_loop_create_io_queues(struct nvme_loop_ctrl *ctrl) · 17 unmodified lines
575588 goto out_free_tagset;
576589 }
577590
578− for (i = 1; i <= opts->nr_io_queues; i++) {
591+ for (i = 1; i < ctrl->queue_count; i++) {
579592 ret = nvmf_connect_io_queue(&ctrl->ctrl, i);
580593 if (ret)
581594 goto out_cleanup_connect_q;
@@ -588,8 +601,7 @@ out_cleanup_connect_q: · 6 unmodified lines
588601 out_free_tagset:
589602 blk_mq_free_tag_set(&ctrl->tag_set);
590603 out_destroy_queues:
591− for (i = 1; i < ctrl->queue_count; i++)
592− nvmet_sq_destroy(&ctrl->queues[i].nvme_sq);
604+ nvme_loop_destroy_io_queues(ctrl);
593605 return ret;
594606 }
595607
drivers/nvme/target/nvmet.h+1−0
@@ -73,6 +73,7 @@ struct nvmet_sq { · 72 unmodified lines
7373 u16 qid;
7474 u16 size;
7575 struct completion free_done;
76+ struct completion confirm_done;
7677 };
7778
7879 /**
drivers/nvme/target/rdma.c+3−5
@@ -703,11 +703,6 @@ static void nvmet_rdma_handle_command(struct nvmet_rdma_queue *queue, · 702 unmodified lines
703703 {
704704 u16 status;
705705
706− cmd->queue = queue;
707− cmd->n_rdma = 0;
708− cmd->req.port = queue->port;
709−
710−
711706 ib_dma_sync_single_for_cpu(queue->dev->device,
712707 cmd->cmd->sge[0].addr, cmd->cmd->sge[0].length,
713708 DMA_FROM_DEVICE);
@@ -760,9 +755,12 @@ static void nvmet_rdma_recv_done(struct ib_cq *cq, struct ib_wc *wc) · 46 unmodified lines
760755
761756 cmd->queue = queue;
762757 rsp = nvmet_rdma_get_rsp(queue);
758+ rsp->queue = queue;
763759 rsp->cmd = cmd;
764760 rsp->flags = 0;
765761 rsp->req.cmd = cmd->nvme_cmd;
762+ rsp->req.port = queue->port;
763+ rsp->n_rdma = 0;
766764
767765 if (unlikely(queue->state != NVMET_RDMA_Q_LIVE)) {
768766 unsigned long flags;
drivers/parport/share.c+4−2
@@ -939,8 +939,10 @@ parport_register_dev_model(struct parport *port, const char *name, · 938 unmodified lines
939939 * pardevice fields. -arca
940940 */
941941 port->ops->init_state(par_dev, par_dev->state);
942− port->proc_device = par_dev;
943− parport_device_proc_register(par_dev);
942+ if (!test_and_set_bit(PARPORT_DEVPROC_REGISTERED, &port->devflags)) {
943+ port->proc_device = par_dev;
944+ parport_device_proc_register(par_dev);
945+ }
944946
945947 return par_dev;
946948
drivers/phy/Kconfig+1−8
@@ -449,6 +449,7 @@ config PHY_QCOM_UFS · 448 unmodified lines
449449 config PHY_QCOM_USB_HS
450450 tristate "Qualcomm USB HS PHY module"
451451 depends on USB_ULPI_BUS
452+ depends on EXTCON || !EXTCON # if EXTCON=m, this cannot be built-in
452453 select GENERIC_PHY
453454 help
454455 Support for the USB high-speed ULPI compliant phy on Qualcomm
@@ -510,12 +511,4 @@ config PHY_MESON8B_USB2 · 55 unmodified lines
510511 and GXBB SoCs.
511512 If unsure, say N.
512513
513−config PHY_NSP_USB3
514− tristate "Broadcom NorthStar plus USB3 PHY driver"
515− depends on OF && (ARCH_BCM_NSP || COMPILE_TEST)
516− select GENERIC_PHY
517− default ARCH_BCM_NSP
518− help
519− Enable this to support the Broadcom Northstar plus USB3 PHY.
520− If unsure, say N.
521514 endmenu
drivers/phy/Makefile+0−1
@@ -62,4 +62,3 @@ obj-$(CONFIG_PHY_CYGNUS_PCIE) += phy-bcm-cygnus-pcie.o · 61 unmodified lines
6262 obj-$(CONFIG_ARCH_TEGRA) += tegra/
6363 obj-$(CONFIG_PHY_NS2_PCIE) += phy-bcm-ns2-pcie.o
6464 obj-$(CONFIG_PHY_MESON8B_USB2) += phy-meson8b-usb2.o
65−obj-$(CONFIG_PHY_NSP_USB3) += phy-bcm-nsp-usb3.o
drivers/phy/phy-bcm-nsp-usb3.c+0−177
@@ -1,177 +0,0 @@
1−/*
2− * Copyright (C) 2016 Broadcom
3− *
4− * This program is free software; you can redistribute it and/or
5− * modify it under the terms of the GNU General Public License as
6− * published by the Free Software Foundation version 2.
7− *
8− * This program is distributed "as is" WITHOUT ANY WARRANTY of any
9− * kind, whether express or implied; without even the implied warranty
10− * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11− * GNU General Public License for more details.
12− */
13−
14−#include <linux/delay.h>
15−#include <linux/io.h>
16−#include <linux/kernel.h>
17−#include <linux/mfd/syscon.h>
18−#include <linux/mdio.h>
19−#include <linux/module.h>
20−#include <linux/of.h>
21−#include <linux/of_address.h>
22−#include <linux/phy/phy.h>
23−#include <linux/regmap.h>
24−
25−#define NSP_USB3_RST_CTRL_OFFSET 0x3f8
26−
27−/* mdio reg access */
28−#define NSP_USB3_PHY_BASE_ADDR_REG 0x1f
29−
30−#define NSP_USB3_PHY_PLL30_BLOCK 0x8000
31−#define NSP_USB3_PLL_CONTROL 0x01
32−#define NSP_USB3_PLLA_CONTROL0 0x0a
33−#define NSP_USB3_PLLA_CONTROL1 0x0b
34−
35−#define NSP_USB3_PHY_TX_PMD_BLOCK 0x8040
36−#define NSP_USB3_TX_PMD_CONTROL1 0x01
37−
38−#define NSP_USB3_PHY_PIPE_BLOCK 0x8060
39−#define NSP_USB3_LFPS_CMP 0x02
40−#define NSP_USB3_LFPS_DEGLITCH 0x03
41−
42−struct nsp_usb3_phy {
43− struct regmap *usb3_ctrl;
44− struct phy *phy;
45− struct mdio_device *mdiodev;
46−};
47−
48−static int nsp_usb3_phy_init(struct phy *phy)
49−{
50− struct nsp_usb3_phy *iphy = phy_get_drvdata(phy);
51− struct mii_bus *bus = iphy->mdiodev->bus;
52− int addr = iphy->mdiodev->addr;
53− u32 data;
54− int rc;
55−
56− rc = regmap_read(iphy->usb3_ctrl, 0, &data);
57− if (rc)
58− return rc;
59− data |= 1;
60− rc = regmap_write(iphy->usb3_ctrl, 0, data);
61− if (rc)
62− return rc;
63−
64− rc = regmap_write(iphy->usb3_ctrl, NSP_USB3_RST_CTRL_OFFSET, 1);
65− if (rc)
66− return rc;
67−
68− rc = mdiobus_write(bus, addr, NSP_USB3_PHY_BASE_ADDR_REG,
69− NSP_USB3_PHY_PLL30_BLOCK);
70− if (rc)
71− return rc;
72−
73− rc = mdiobus_write(bus, addr, NSP_USB3_PLL_CONTROL, 0x1000);
74− if (rc)
75− return rc;
76−
77− rc = mdiobus_write(bus, addr, NSP_USB3_PLLA_CONTROL0, 0x6400);
78− if (rc)
79− return rc;
80−
81− rc = mdiobus_write(bus, addr, NSP_USB3_PLLA_CONTROL1, 0xc000);
82− if (rc)
83− return rc;
84−
85− rc = mdiobus_write(bus, addr, NSP_USB3_PLLA_CONTROL1, 0x8000);
86− if (rc)
87− return rc;
88−
89− rc = regmap_write(iphy->usb3_ctrl, NSP_USB3_RST_CTRL_OFFSET, 0);
90− if (rc)
91− return rc;
92−
93− rc = mdiobus_write(bus, addr, NSP_USB3_PLL_CONTROL, 0x9000);
94− if (rc)
95− return rc;
96−
97− rc = mdiobus_write(bus, addr, NSP_USB3_PHY_BASE_ADDR_REG,
98− NSP_USB3_PHY_PIPE_BLOCK);
99− if (rc)
100− return rc;
101−
102− rc = mdiobus_write(bus, addr, NSP_USB3_LFPS_CMP, 0xf30d);
103− if (rc)
104− return rc;
105−
106− rc = mdiobus_write(bus, addr, NSP_USB3_LFPS_DEGLITCH, 0x6302);
107− if (rc)
108− return rc;
109−
110− rc = mdiobus_write(bus, addr, NSP_USB3_PHY_BASE_ADDR_REG,
111− NSP_USB3_PHY_TX_PMD_BLOCK);
112− if (rc)
113− return rc;
114−
115− rc = mdiobus_write(bus, addr, NSP_USB3_TX_PMD_CONTROL1, 0x1003);
116−
117− return rc;
118−}
119−
120−static struct phy_ops nsp_usb3_phy_ops = {
121− .init = nsp_usb3_phy_init,
122− .owner = THIS_MODULE,
123−};
124−
125−static int nsp_usb3_phy_probe(struct mdio_device *mdiodev)
126−{
127− struct device *dev = &mdiodev->dev;
128− struct phy_provider *provider;
129− struct nsp_usb3_phy *iphy;
130−
131− iphy = devm_kzalloc(dev, sizeof(*iphy), GFP_KERNEL);
132− if (!iphy)
133− return -ENOMEM;
134− iphy->mdiodev = mdiodev;
135−
136− iphy->usb3_ctrl = syscon_regmap_lookup_by_phandle(dev->of_node,
137− "usb3-ctrl-syscon");
138− if (IS_ERR(iphy->usb3_ctrl))
139− return PTR_ERR(iphy->usb3_ctrl);
140−
141− iphy->phy = devm_phy_create(dev, dev->of_node, &nsp_usb3_phy_ops);
142− if (IS_ERR(iphy->phy)) {
143− dev_err(dev, "failed to create PHY\n");
144− return PTR_ERR(iphy->phy);
145− }
146−
147− phy_set_drvdata(iphy->phy, iphy);
148−
149− provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate);
150− if (IS_ERR(provider)) {
151− dev_err(dev, "could not register PHY provider\n");
152− return PTR_ERR(provider);
153− }
154−
155− return 0;
156−}
157−
158−static const struct of_device_id nsp_usb3_phy_of_match[] = {
159− {.compatible = "brcm,nsp-usb3-phy",},
160− { /* sentinel */ }
161−};
162−
163−static struct mdio_driver nsp_usb3_phy_driver = {
164− .mdiodrv = {
165− .driver = {
166− .name = "nsp-usb3-phy",
167− .of_match_table = nsp_usb3_phy_of_match,
168− },
169− },
170− .probe = nsp_usb3_phy_probe,
171−};
172−
173−mdio_module_driver(nsp_usb3_phy_driver);
174−
175−MODULE_DESCRIPTION("Broadcom NSP USB3 PHY driver");
176−MODULE_LICENSE("GPL v2");
177−MODULE_AUTHOR("Yendapally Reddy Dhananjaya Reddy <yendapally.reddy@broadcom.com");
drivers/phy/phy-exynos-pcie.c+2−2
@@ -254,8 +254,8 @@ static int exynos_pcie_phy_probe(struct platform_device *pdev) · 253 unmodified lines
254254
255255 res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
256256 exynos_phy->blk_base = devm_ioremap_resource(dev, res);
257− if (IS_ERR(exynos_phy->phy_base))
258− return PTR_ERR(exynos_phy->phy_base);
257+ if (IS_ERR(exynos_phy->blk_base))
258+ return PTR_ERR(exynos_phy->blk_base);
259259
260260 exynos_phy->drv_data = drv_data;
261261
drivers/platform/x86/asus-nb-wmi.c+2−47
@@ -103,15 +103,6 @@ static struct quirk_entry quirk_asus_x200ca = { · 102 unmodified lines
103103 .wapf = 2,
104104 };
105105
106−static struct quirk_entry quirk_no_rfkill = {
107− .no_rfkill = true,
108−};
109−
110−static struct quirk_entry quirk_no_rfkill_wapf4 = {
111− .wapf = 4,
112− .no_rfkill = true,
113−};
114−
115106 static struct quirk_entry quirk_asus_ux303ub = {
116107 .wmi_backlight_native = true,
117108 };
@@ -194,7 +185,7 @@ static const struct dmi_system_id asus_quirks[] = { · 76 unmodified lines
194185 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
195186 DMI_MATCH(DMI_PRODUCT_NAME, "X456UA"),
196187 },
197− .driver_data = &quirk_no_rfkill_wapf4,
188+ .driver_data = &quirk_asus_wapf4,
198189 },
199190 {
200191 .callback = dmi_matched,
@@ -203,7 +194,7 @@ static const struct dmi_system_id asus_quirks[] = { · 2 unmodified lines
203194 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
204195 DMI_MATCH(DMI_PRODUCT_NAME, "X456UF"),
205196 },
206− .driver_data = &quirk_no_rfkill_wapf4,
197+ .driver_data = &quirk_asus_wapf4,
207198 },
208199 {
209200 .callback = dmi_matched,
@@ -367,42 +358,6 @@ static const struct dmi_system_id asus_quirks[] = { · 157 unmodified lines
367358 },
368359 .driver_data = &quirk_asus_x200ca,
369360 },
370− {
371− .callback = dmi_matched,
372− .ident = "ASUSTeK COMPUTER INC. X555UB",
373− .matches = {
374− DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
375− DMI_MATCH(DMI_PRODUCT_NAME, "X555UB"),
376− },
377− .driver_data = &quirk_no_rfkill,
378− },
379− {
380− .callback = dmi_matched,
381− .ident = "ASUSTeK COMPUTER INC. N552VW",
382− .matches = {
383− DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
384− DMI_MATCH(DMI_PRODUCT_NAME, "N552VW"),
385− },
386− .driver_data = &quirk_no_rfkill,
387− },
388− {
389− .callback = dmi_matched,
390− .ident = "ASUSTeK COMPUTER INC. U303LB",
391− .matches = {
392− DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
393− DMI_MATCH(DMI_PRODUCT_NAME, "U303LB"),
394− },
395− .driver_data = &quirk_no_rfkill,
396− },
397− {
398− .callback = dmi_matched,
399− .ident = "ASUSTeK COMPUTER INC. Z550MA",
400− .matches = {
401− DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
402− DMI_MATCH(DMI_PRODUCT_NAME, "Z550MA"),
403− },
404− .driver_data = &quirk_no_rfkill,
405− },
406361 {
407362 .callback = dmi_matched,
408363 .ident = "ASUSTeK COMPUTER INC. UX303UB",
drivers/platform/x86/asus-wmi.c+17−5
@@ -159,6 +159,8 @@ MODULE_LICENSE("GPL"); · 158 unmodified lines
159159 #define USB_INTEL_XUSB2PR 0xD0
160160 #define PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_XHCI 0x9c31
161161
162+static const char * const ashs_ids[] = { "ATK4001", "ATK4002", NULL };
163+
162164 struct bios_args {
163165 u32 arg0;
164166 u32 arg1;
@@ -2051,6 +2053,16 @@ static int asus_wmi_fan_init(struct asus_wmi *asus) · 1886 unmodified lines
20512053 return 0;
20522054 }
20532055
2056+static bool ashs_present(void)
2057+{
2058+ int i = 0;
2059+ while (ashs_ids[i]) {
2060+ if (acpi_dev_found(ashs_ids[i++]))
2061+ return true;
2062+ }
2063+ return false;
2064+}
2065+
20542066 /*
20552067 * WMI Driver
20562068 */
@@ -2095,7 +2107,11 @@ static int asus_wmi_add(struct platform_device *pdev) · 38 unmodified lines
20952107 if (err)
20962108 goto fail_leds;
20972109
2098− if (!asus->driver->quirks->no_rfkill) {
2110+ asus_wmi_get_devstate(asus, ASUS_WMI_DEVID_WLAN, &result);
2111+ if (result & (ASUS_WMI_DSTS_PRESENCE_BIT | ASUS_WMI_DSTS_USER_BIT))
2112+ asus->driver->wlan_ctrl_by_user = 1;
2113+
2114+ if (!(asus->driver->wlan_ctrl_by_user && ashs_present())) {
20992115 err = asus_wmi_rfkill_init(asus);
21002116 if (err)
21012117 goto fail_rfkill;
@@ -2134,10 +2150,6 @@ static int asus_wmi_add(struct platform_device *pdev) · 32 unmodified lines
21342150 if (err)
21352151 goto fail_debugfs;
21362152
2137− asus_wmi_get_devstate(asus, ASUS_WMI_DEVID_WLAN, &result);
2138− if (result & (ASUS_WMI_DSTS_PRESENCE_BIT | ASUS_WMI_DSTS_USER_BIT))
2139− asus->driver->wlan_ctrl_by_user = 1;
2140−
21412153 return 0;
21422154
21432155 fail_debugfs:
drivers/platform/x86/asus-wmi.h+0−1
@@ -39,7 +39,6 @@ struct key_entry; · 38 unmodified lines
3939 struct asus_wmi;
4040
4141 struct quirk_entry {
42− bool no_rfkill;
4342 bool hotplug_wireless;
4443 bool scalar_panel_brightness;
4544 bool store_backlight_power;
drivers/platform/x86/fujitsu-laptop.c+222−229
@@ -78,18 +78,18 @@ · 77 unmodified lines
7878
7979 #define FUJITSU_LCD_N_LEVELS 8
8080
81−#define ACPI_FUJITSU_CLASS "fujitsu"
82−#define ACPI_FUJITSU_HID "FUJ02B1"
83−#define ACPI_FUJITSU_DRIVER_NAME "Fujitsu laptop FUJ02B1 ACPI brightness driver"
84−#define ACPI_FUJITSU_DEVICE_NAME "Fujitsu FUJ02B1"
85−#define ACPI_FUJITSU_HOTKEY_HID "FUJ02E3"
86−#define ACPI_FUJITSU_HOTKEY_DRIVER_NAME "Fujitsu laptop FUJ02E3 ACPI hotkeys driver"
87−#define ACPI_FUJITSU_HOTKEY_DEVICE_NAME "Fujitsu FUJ02E3"
81+#define ACPI_FUJITSU_CLASS "fujitsu"
82+#define ACPI_FUJITSU_BL_HID "FUJ02B1"
83+#define ACPI_FUJITSU_BL_DRIVER_NAME "Fujitsu laptop FUJ02B1 ACPI brightness driver"
84+#define ACPI_FUJITSU_BL_DEVICE_NAME "Fujitsu FUJ02B1"
85+#define ACPI_FUJITSU_LAPTOP_HID "FUJ02E3"
86+#define ACPI_FUJITSU_LAPTOP_DRIVER_NAME "Fujitsu laptop FUJ02E3 ACPI hotkeys driver"
87+#define ACPI_FUJITSU_LAPTOP_DEVICE_NAME "Fujitsu FUJ02E3"
8888
8989 #define ACPI_FUJITSU_NOTIFY_CODE1 0x80
9090
9191 /* FUNC interface - command values */
92−#define FUNC_RFKILL 0x1000
92+#define FUNC_FLAGS 0x1000
9393 #define FUNC_LEDS 0x1001
9494 #define FUNC_BUTTONS 0x1002
9595 #define FUNC_BACKLIGHT 0x1004
@@ -97,6 +97,11 @@ · 1 unmodified line
9797 /* FUNC interface - responses */
9898 #define UNSUPPORTED_CMD 0x80000000
9999
100+/* FUNC interface - status flags */
101+#define FLAG_RFKILL 0x020
102+#define FLAG_LID 0x100
103+#define FLAG_DOCK 0x200
104+
100105 #if IS_ENABLED(CONFIG_LEDS_CLASS)
101106 /* FUNC interface - LED control */
102107 #define FUNC_LED_OFF 0x1
@@ -136,7 +141,7 @@ · 33 unmodified lines
136141 #endif
137142
138143 /* Device controlling the backlight and associated keys */
139−struct fujitsu_t {
144+struct fujitsu_bl {
140145 acpi_handle acpi_handle;
141146 struct acpi_device *dev;
142147 struct input_dev *input;
@@ -150,12 +155,12 @@ struct fujitsu_t { · 7 unmodified lines
150155 unsigned int brightness_level;
151156 };
152157
153−static struct fujitsu_t *fujitsu;
158+static struct fujitsu_bl *fujitsu_bl;
154159 static int use_alt_lcd_levels = -1;
155160 static int disable_brightness_adjust = -1;
156161
157−/* Device used to access other hotkeys on the laptop */
158−struct fujitsu_hotkey_t {
162+/* Device used to access hotkeys and other features on the laptop */
163+struct fujitsu_laptop {
159164 acpi_handle acpi_handle;
160165 struct acpi_device *dev;
161166 struct input_dev *input;
@@ -163,17 +168,15 @@ struct fujitsu_hotkey_t { · 1 unmodified line
163168 struct platform_device *pf_device;
164169 struct kfifo fifo;
165170 spinlock_t fifo_lock;
166− int rfkill_supported;
167− int rfkill_state;
171+ int flags_supported;
172+ int flags_state;
168173 int logolamp_registered;
169174 int kblamps_registered;
170175 int radio_led_registered;
171176 int eco_led_registered;
172177 };
173178
174−static struct fujitsu_hotkey_t *fujitsu_hotkey;
175−
176−static void acpi_fujitsu_hotkey_notify(struct acpi_device *device, u32 event);
179+static struct fujitsu_laptop *fujitsu_laptop;
177180
178181 #if IS_ENABLED(CONFIG_LEDS_CLASS)
179182 static enum led_brightness logolamp_get(struct led_classdev *cdev);
@@ -222,8 +225,6 @@ static struct led_classdev eco_led = { · 42 unmodified lines
222225 static u32 dbg_level = 0x03;
223226 #endif
224227
225−static void acpi_fujitsu_notify(struct acpi_device *device, u32 event);
226−
227228 /* Fujitsu ACPI interface function */
228229
229230 static int call_fext_func(int cmd, int arg0, int arg1, int arg2)
@@ -239,7 +240,7 @@ static int call_fext_func(int cmd, int arg0, int arg1, int arg2) · 9 unmodified lines
239240 unsigned long long value;
240241 acpi_handle handle = NULL;
241242
242− status = acpi_get_handle(fujitsu_hotkey->acpi_handle, "FUNC", &handle);
243+ status = acpi_get_handle(fujitsu_laptop->acpi_handle, "FUNC", &handle);
243244 if (ACPI_FAILURE(status)) {
244245 vdbg_printk(FUJLAPTOP_DBG_ERROR,
245246 "FUNC interface is not present\n");
@@ -300,9 +301,9 @@ static int radio_led_set(struct led_classdev *cdev, · 54 unmodified lines
300301 enum led_brightness brightness)
301302 {
302303 if (brightness >= LED_FULL)
303− return call_fext_func(FUNC_RFKILL, 0x5, RADIO_LED_ON, RADIO_LED_ON);
304+ return call_fext_func(FUNC_FLAGS, 0x5, RADIO_LED_ON, RADIO_LED_ON);
304305 else
305− return call_fext_func(FUNC_RFKILL, 0x5, RADIO_LED_ON, 0x0);
306+ return call_fext_func(FUNC_FLAGS, 0x5, RADIO_LED_ON, 0x0);
306307 }
307308
308309 static int eco_led_set(struct led_classdev *cdev,
@@ -346,7 +347,7 @@ static enum led_brightness radio_led_get(struct led_classdev *cdev) · 37 unmodified lines
346347 {
347348 enum led_brightness brightness = LED_OFF;
348349
349− if (call_fext_func(FUNC_RFKILL, 0x4, 0x0, 0x0) & RADIO_LED_ON)
350+ if (call_fext_func(FUNC_FLAGS, 0x4, 0x0, 0x0) & RADIO_LED_ON)
350351 brightness = LED_FULL;
351352
352353 return brightness;
@@ -373,10 +374,10 @@ static int set_lcd_level(int level) · 20 unmodified lines
373374 vdbg_printk(FUJLAPTOP_DBG_TRACE, "set lcd level via SBLL [%d]\n",
374375 level);
375376
376− if (level < 0 || level >= fujitsu->max_brightness)
377+ if (level < 0 || level >= fujitsu_bl->max_brightness)
377378 return -EINVAL;
378379
379− status = acpi_get_handle(fujitsu->acpi_handle, "SBLL", &handle);
380+ status = acpi_get_handle(fujitsu_bl->acpi_handle, "SBLL", &handle);
380381 if (ACPI_FAILURE(status)) {
381382 vdbg_printk(FUJLAPTOP_DBG_ERROR, "SBLL not present\n");
382383 return -ENODEV;
@@ -398,10 +399,10 @@ static int set_lcd_level_alt(int level) · 15 unmodified lines
398399 vdbg_printk(FUJLAPTOP_DBG_TRACE, "set lcd level via SBL2 [%d]\n",
399400 level);
400401
401− if (level < 0 || level >= fujitsu->max_brightness)
402+ if (level < 0 || level >= fujitsu_bl->max_brightness)
402403 return -EINVAL;
403404
404− status = acpi_get_handle(fujitsu->acpi_handle, "SBL2", &handle);
405+ status = acpi_get_handle(fujitsu_bl->acpi_handle, "SBL2", &handle);
405406 if (ACPI_FAILURE(status)) {
406407 vdbg_printk(FUJLAPTOP_DBG_ERROR, "SBL2 not present\n");
407408 return -ENODEV;
@@ -421,19 +422,19 @@ static int get_lcd_level(void) · 13 unmodified lines
421422
422423 vdbg_printk(FUJLAPTOP_DBG_TRACE, "get lcd level via GBLL\n");
423424
424− status =
425− acpi_evaluate_integer(fujitsu->acpi_handle, "GBLL", NULL, &state);
425+ status = acpi_evaluate_integer(fujitsu_bl->acpi_handle, "GBLL", NULL,
426+ &state);
426427 if (ACPI_FAILURE(status))
427428 return 0;
428429
429− fujitsu->brightness_level = state & 0x0fffffff;
430+ fujitsu_bl->brightness_level = state & 0x0fffffff;
430431
431432 if (state & 0x80000000)
432− fujitsu->brightness_changed = 1;
433+ fujitsu_bl->brightness_changed = 1;
433434 else
434− fujitsu->brightness_changed = 0;
435+ fujitsu_bl->brightness_changed = 0;
435436
436− return fujitsu->brightness_level;
437+ return fujitsu_bl->brightness_level;
437438 }
438439
439440 static int get_max_brightness(void)
@@ -443,14 +444,14 @@ static int get_max_brightness(void) · 3 unmodified lines
443444
444445 vdbg_printk(FUJLAPTOP_DBG_TRACE, "get max lcd level via RBLL\n");
445446
446− status =
447− acpi_evaluate_integer(fujitsu->acpi_handle, "RBLL", NULL, &state);
447+ status = acpi_evaluate_integer(fujitsu_bl->acpi_handle, "RBLL", NULL,
448+ &state);
448449 if (ACPI_FAILURE(status))
449450 return -1;
450451
451− fujitsu->max_brightness = state;
452+ fujitsu_bl->max_brightness = state;
452453
453− return fujitsu->max_brightness;
454+ return fujitsu_bl->max_brightness;
454455 }
455456
456457 /* Backlight device stuff */
@@ -483,7 +484,7 @@ static int bl_update_status(struct backlight_device *b) · 26 unmodified lines
483484 return ret;
484485 }
485486
486−static const struct backlight_ops fujitsubl_ops = {
487+static const struct backlight_ops fujitsu_bl_ops = {
487488 .get_brightness = bl_get_brightness,
488489 .update_status = bl_update_status,
489490 };
@@ -511,7 +512,7 @@ show_brightness_changed(struct device *dev, · 21 unmodified lines
511512
512513 int ret;
513514
514− ret = fujitsu->brightness_changed;
515+ ret = fujitsu_bl->brightness_changed;
515516 if (ret < 0)
516517 return ret;
517518
@@ -539,7 +540,7 @@ static ssize_t store_lcd_level(struct device *dev, · 21 unmodified lines
539540 int level, ret;
540541
541542 if (sscanf(buf, "%i", &level) != 1
542− || (level < 0 || level >= fujitsu->max_brightness))
543+ || (level < 0 || level >= fujitsu_bl->max_brightness))
543544 return -EINVAL;
544545
545546 if (use_alt_lcd_levels)
@@ -567,9 +568,9 @@ static ssize_t · 21 unmodified lines
567568 show_lid_state(struct device *dev,
568569 struct device_attribute *attr, char *buf)
569570 {
570− if (!(fujitsu_hotkey->rfkill_supported & 0x100))
571+ if (!(fujitsu_laptop->flags_supported & FLAG_LID))
571572 return sprintf(buf, "unknown\n");
572− if (fujitsu_hotkey->rfkill_state & 0x100)
573+ if (fujitsu_laptop->flags_state & FLAG_LID)
573574 return sprintf(buf, "open\n");
574575 else
575576 return sprintf(buf, "closed\n");
@@ -579,9 +580,9 @@ static ssize_t · 3 unmodified lines
579580 show_dock_state(struct device *dev,
580581 struct device_attribute *attr, char *buf)
581582 {
582− if (!(fujitsu_hotkey->rfkill_supported & 0x200))
583+ if (!(fujitsu_laptop->flags_supported & FLAG_DOCK))
583584 return sprintf(buf, "unknown\n");
584− if (fujitsu_hotkey->rfkill_state & 0x200)
585+ if (fujitsu_laptop->flags_state & FLAG_DOCK)
585586 return sprintf(buf, "docked\n");
586587 else
587588 return sprintf(buf, "undocked\n");
@@ -591,9 +592,9 @@ static ssize_t · 3 unmodified lines
591592 show_radios_state(struct device *dev,
592593 struct device_attribute *attr, char *buf)
593594 {
594− if (!(fujitsu_hotkey->rfkill_supported & 0x20))
595+ if (!(fujitsu_laptop->flags_supported & FLAG_RFKILL))
595596 return sprintf(buf, "unknown\n");
596− if (fujitsu_hotkey->rfkill_state & 0x20)
597+ if (fujitsu_laptop->flags_state & FLAG_RFKILL)
597598 return sprintf(buf, "on\n");
598599 else
599600 return sprintf(buf, "killed\n");
@@ -607,7 +608,7 @@ static DEVICE_ATTR(lid, 0444, show_lid_state, ignore_store); · 7 unmodified lines
607608 static DEVICE_ATTR(dock, 0444, show_dock_state, ignore_store);
608609 static DEVICE_ATTR(radios, 0444, show_radios_state, ignore_store);
609610
610−static struct attribute *fujitsupf_attributes[] = {
611+static struct attribute *fujitsu_pf_attributes[] = {
611612 &dev_attr_brightness_changed.attr,
612613 &dev_attr_max_brightness.attr,
613614 &dev_attr_lcd_level.attr,
@@ -617,11 +618,11 @@ static struct attribute *fujitsupf_attributes[] = { · 3 unmodified lines
617618 NULL
618619 };
619620
620−static struct attribute_group fujitsupf_attribute_group = {
621− .attrs = fujitsupf_attributes
621+static struct attribute_group fujitsu_pf_attribute_group = {
622+ .attrs = fujitsu_pf_attributes
622623 };
623624
624−static struct platform_driver fujitsupf_driver = {
625+static struct platform_driver fujitsu_pf_driver = {
625626 .driver = {
626627 .name = "fujitsu-laptop",
627628 }
@@ -630,39 +631,30 @@ static struct platform_driver fujitsupf_driver = { · 2 unmodified lines
630631 static void __init dmi_check_cb_common(const struct dmi_system_id *id)
631632 {
632633 pr_info("Identified laptop model '%s'\n", id->ident);
633− if (use_alt_lcd_levels == -1) {
634− if (acpi_has_method(NULL,
635− "\\_SB.PCI0.LPCB.FJEX.SBL2"))
636− use_alt_lcd_levels = 1;
637− else
638− use_alt_lcd_levels = 0;
639− vdbg_printk(FUJLAPTOP_DBG_TRACE, "auto-detected usealt as "
640− "%i\n", use_alt_lcd_levels);
641− }
642634 }
643635
644636 static int __init dmi_check_cb_s6410(const struct dmi_system_id *id)
645637 {
646638 dmi_check_cb_common(id);
647− fujitsu->keycode1 = KEY_SCREENLOCK; /* "Lock" */
648− fujitsu->keycode2 = KEY_HELP; /* "Mobility Center" */
639+ fujitsu_bl->keycode1 = KEY_SCREENLOCK; /* "Lock" */
640+ fujitsu_bl->keycode2 = KEY_HELP; /* "Mobility Center" */
649641 return 1;
650642 }
651643
652644 static int __init dmi_check_cb_s6420(const struct dmi_system_id *id)
653645 {
654646 dmi_check_cb_common(id);
655− fujitsu->keycode1 = KEY_SCREENLOCK; /* "Lock" */
656− fujitsu->keycode2 = KEY_HELP; /* "Mobility Center" */
647+ fujitsu_bl->keycode1 = KEY_SCREENLOCK; /* "Lock" */
648+ fujitsu_bl->keycode2 = KEY_HELP; /* "Mobility Center" */
657649 return 1;
658650 }
659651
660652 static int __init dmi_check_cb_p8010(const struct dmi_system_id *id)
661653 {
662654 dmi_check_cb_common(id);
663− fujitsu->keycode1 = KEY_HELP; /* "Support" */
664− fujitsu->keycode3 = KEY_SWITCHVIDEOMODE; /* "Presentation" */
665− fujitsu->keycode4 = KEY_WWW; /* "Internet" */
655+ fujitsu_bl->keycode1 = KEY_HELP; /* "Support" */
656+ fujitsu_bl->keycode3 = KEY_SWITCHVIDEOMODE; /* "Presentation" */
657+ fujitsu_bl->keycode4 = KEY_WWW; /* "Internet" */
666658 return 1;
667659 }
668660
@@ -693,7 +685,7 @@ static const struct dmi_system_id fujitsu_dmi_table[] __initconst = { · 24 unmodified lines
693685
694686 /* ACPI device for LCD brightness control */
695687
696−static int acpi_fujitsu_add(struct acpi_device *device)
688+static int acpi_fujitsu_bl_add(struct acpi_device *device)
697689 {
698690 int state = 0;
699691 struct input_dev *input;
@@ -702,22 +694,22 @@ static int acpi_fujitsu_add(struct acpi_device *device) · 2 unmodified lines
702694 if (!device)
703695 return -EINVAL;
704696
705− fujitsu->acpi_handle = device->handle;
706− sprintf(acpi_device_name(device), "%s", ACPI_FUJITSU_DEVICE_NAME);
697+ fujitsu_bl->acpi_handle = device->handle;
698+ sprintf(acpi_device_name(device), "%s", ACPI_FUJITSU_BL_DEVICE_NAME);
707699 sprintf(acpi_device_class(device), "%s", ACPI_FUJITSU_CLASS);
708− device->driver_data = fujitsu;
700+ device->driver_data = fujitsu_bl;
709701
710− fujitsu->input = input = input_allocate_device();
702+ fujitsu_bl->input = input = input_allocate_device();
711703 if (!input) {
712704 error = -ENOMEM;
713705 goto err_stop;
714706 }
715707
716− snprintf(fujitsu->phys, sizeof(fujitsu->phys),
708+ snprintf(fujitsu_bl->phys, sizeof(fujitsu_bl->phys),
717709 "%s/video/input0", acpi_device_hid(device));
718710
719711 input->name = acpi_device_name(device);
720− input->phys = fujitsu->phys;
712+ input->phys = fujitsu_bl->phys;
721713 input->id.bustype = BUS_HOST;
722714 input->id.product = 0x06;
723715 input->dev.parent = &device->dev;
@@ -730,7 +722,7 @@ static int acpi_fujitsu_add(struct acpi_device *device) · 6 unmodified lines
730722 if (error)
731723 goto err_free_input_dev;
732724
733− error = acpi_bus_update_power(fujitsu->acpi_handle, &state);
725+ error = acpi_bus_update_power(fujitsu_bl->acpi_handle, &state);
734726 if (error) {
735727 pr_err("Error reading power state\n");
736728 goto err_unregister_input_dev;
@@ -740,7 +732,7 @@ static int acpi_fujitsu_add(struct acpi_device *device) · 3 unmodified lines
740732 acpi_device_name(device), acpi_device_bid(device),
741733 !device->power.state ? "on" : "off");
742734
743− fujitsu->dev = device;
735+ fujitsu_bl->dev = device;
744736
745737 if (acpi_has_method(device->handle, METHOD_NAME__INI)) {
746738 vdbg_printk(FUJLAPTOP_DBG_INFO, "Invoking _INI\n");
@@ -750,6 +742,15 @@ static int acpi_fujitsu_add(struct acpi_device *device) · 3 unmodified lines
750742 pr_err("_INI Method failed\n");
751743 }
752744
745+ if (use_alt_lcd_levels == -1) {
746+ if (acpi_has_method(NULL, "\\_SB.PCI0.LPCB.FJEX.SBL2"))
747+ use_alt_lcd_levels = 1;
748+ else
749+ use_alt_lcd_levels = 0;
750+ vdbg_printk(FUJLAPTOP_DBG_TRACE, "auto-detected usealt as %i\n",
751+ use_alt_lcd_levels);
752+ }
753+
753754 /* do config (detect defaults) */
754755 use_alt_lcd_levels = use_alt_lcd_levels == 1 ? 1 : 0;
755756 disable_brightness_adjust = disable_brightness_adjust == 1 ? 1 : 0;
@@ -758,7 +759,7 @@ static int acpi_fujitsu_add(struct acpi_device *device) · 2 unmodified lines
758759 use_alt_lcd_levels, disable_brightness_adjust);
759760
760761 if (get_max_brightness() <= 0)
761− fujitsu->max_brightness = FUJITSU_LCD_N_LEVELS;
762+ fujitsu_bl->max_brightness = FUJITSU_LCD_N_LEVELS;
762763 get_lcd_level();
763764
764765 return 0;
@@ -772,38 +773,38 @@ err_stop: · 7 unmodified lines
772773 return error;
773774 }
774775
775−static int acpi_fujitsu_remove(struct acpi_device *device)
776+static int acpi_fujitsu_bl_remove(struct acpi_device *device)
776777 {
777− struct fujitsu_t *fujitsu = acpi_driver_data(device);
778− struct input_dev *input = fujitsu->input;
778+ struct fujitsu_bl *fujitsu_bl = acpi_driver_data(device);
779+ struct input_dev *input = fujitsu_bl->input;
779780
780781 input_unregister_device(input);
781782
782− fujitsu->acpi_handle = NULL;
783+ fujitsu_bl->acpi_handle = NULL;
783784
784785 return 0;
785786 }
786787
787788 /* Brightness notify */
788789
789−static void acpi_fujitsu_notify(struct acpi_device *device, u32 event)
790+static void acpi_fujitsu_bl_notify(struct acpi_device *device, u32 event)
790791 {
791792 struct input_dev *input;
792793 int keycode;
793794 int oldb, newb;
794795
795− input = fujitsu->input;
796+ input = fujitsu_bl->input;
796797
797798 switch (event) {
798799 case ACPI_FUJITSU_NOTIFY_CODE1:
799800 keycode = 0;
800− oldb = fujitsu->brightness_level;
801+ oldb = fujitsu_bl->brightness_level;
801802 get_lcd_level();
802− newb = fujitsu->brightness_level;
803+ newb = fujitsu_bl->brightness_level;
803804
804805 vdbg_printk(FUJLAPTOP_DBG_TRACE,
805806 "brightness button event [%i -> %i (%i)]\n",
806− oldb, newb, fujitsu->brightness_changed);
807+ oldb, newb, fujitsu_bl->brightness_changed);
807808
808809 if (oldb < newb) {
809810 if (disable_brightness_adjust != 1) {
@@ -840,7 +841,7 @@ static void acpi_fujitsu_notify(struct acpi_device *device, u32 event) · 30 unmodified lines
840841
841842 /* ACPI device for hotkey handling */
842843
843−static int acpi_fujitsu_hotkey_add(struct acpi_device *device)
844+static int acpi_fujitsu_laptop_add(struct acpi_device *device)
844845 {
845846 int result = 0;
846847 int state = 0;
@@ -851,42 +852,42 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device) · 4 unmodified lines
851852 if (!device)
852853 return -EINVAL;
853854
854− fujitsu_hotkey->acpi_handle = device->handle;
855+ fujitsu_laptop->acpi_handle = device->handle;
855856 sprintf(acpi_device_name(device), "%s",
856− ACPI_FUJITSU_HOTKEY_DEVICE_NAME);
857+ ACPI_FUJITSU_LAPTOP_DEVICE_NAME);
857858 sprintf(acpi_device_class(device), "%s", ACPI_FUJITSU_CLASS);
858− device->driver_data = fujitsu_hotkey;
859+ device->driver_data = fujitsu_laptop;
859860
860861 /* kfifo */
861− spin_lock_init(&fujitsu_hotkey->fifo_lock);
862− error = kfifo_alloc(&fujitsu_hotkey->fifo, RINGBUFFERSIZE * sizeof(int),
862+ spin_lock_init(&fujitsu_laptop->fifo_lock);
863+ error = kfifo_alloc(&fujitsu_laptop->fifo, RINGBUFFERSIZE * sizeof(int),
863864 GFP_KERNEL);
864865 if (error) {
865866 pr_err("kfifo_alloc failed\n");
866867 goto err_stop;
867868 }
868869
869− fujitsu_hotkey->input = input = input_allocate_device();
870+ fujitsu_laptop->input = input = input_allocate_device();
870871 if (!input) {
871872 error = -ENOMEM;
872873 goto err_free_fifo;
873874 }
874875
875− snprintf(fujitsu_hotkey->phys, sizeof(fujitsu_hotkey->phys),
876+ snprintf(fujitsu_laptop->phys, sizeof(fujitsu_laptop->phys),
876877 "%s/video/input0", acpi_device_hid(device));
877878
878879 input->name = acpi_device_name(device);
879− input->phys = fujitsu_hotkey->phys;
880+ input->phys = fujitsu_laptop->phys;
880881 input->id.bustype = BUS_HOST;
881882 input->id.product = 0x06;
882883 input->dev.parent = &device->dev;
883884
884885 set_bit(EV_KEY, input->evbit);
885− set_bit(fujitsu->keycode1, input->keybit);
886− set_bit(fujitsu->keycode2, input->keybit);
887− set_bit(fujitsu->keycode3, input->keybit);
888− set_bit(fujitsu->keycode4, input->keybit);
889− set_bit(fujitsu->keycode5, input->keybit);
886+ set_bit(fujitsu_bl->keycode1, input->keybit);
887+ set_bit(fujitsu_bl->keycode2, input->keybit);
888+ set_bit(fujitsu_bl->keycode3, input->keybit);
889+ set_bit(fujitsu_bl->keycode4, input->keybit);
890+ set_bit(fujitsu_bl->keycode5, input->keybit);
890891 set_bit(KEY_TOUCHPAD_TOGGLE, input->keybit);
891892 set_bit(KEY_UNKNOWN, input->keybit);
892893
@@ -894,7 +895,7 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device) · 1 unmodified line
894895 if (error)
895896 goto err_free_input_dev;
896897
897− error = acpi_bus_update_power(fujitsu_hotkey->acpi_handle, &state);
898+ error = acpi_bus_update_power(fujitsu_laptop->acpi_handle, &state);
898899 if (error) {
899900 pr_err("Error reading power state\n");
900901 goto err_unregister_input_dev;
@@ -904,7 +905,7 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device) · 3 unmodified lines
904905 acpi_device_name(device), acpi_device_bid(device),
905906 !device->power.state ? "on" : "off");
906907
907− fujitsu_hotkey->dev = device;
908+ fujitsu_laptop->dev = device;
908909
909910 if (acpi_has_method(device->handle, METHOD_NAME__INI)) {
910911 vdbg_printk(FUJLAPTOP_DBG_INFO, "Invoking _INI\n");
@@ -920,27 +921,27 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device) · 9 unmodified lines
920921 ; /* No action, result is discarded */
921922 vdbg_printk(FUJLAPTOP_DBG_INFO, "Discarded %i ringbuffer entries\n", i);
922923
923− fujitsu_hotkey->rfkill_supported =
924− call_fext_func(FUNC_RFKILL, 0x0, 0x0, 0x0);
924+ fujitsu_laptop->flags_supported =
925+ call_fext_func(FUNC_FLAGS, 0x0, 0x0, 0x0);
925926
926927 /* Make sure our bitmask of supported functions is cleared if the
927928 RFKILL function block is not implemented, like on the S7020. */
928− if (fujitsu_hotkey->rfkill_supported == UNSUPPORTED_CMD)
929− fujitsu_hotkey->rfkill_supported = 0;
929+ if (fujitsu_laptop->flags_supported == UNSUPPORTED_CMD)
930+ fujitsu_laptop->flags_supported = 0;
930931
931− if (fujitsu_hotkey->rfkill_supported)
932− fujitsu_hotkey->rfkill_state =
933− call_fext_func(FUNC_RFKILL, 0x4, 0x0, 0x0);
932+ if (fujitsu_laptop->flags_supported)
933+ fujitsu_laptop->flags_state =
934+ call_fext_func(FUNC_FLAGS, 0x4, 0x0, 0x0);
934935
935936 /* Suspect this is a keymap of the application panel, print it */
936937 pr_info("BTNI: [0x%x]\n", call_fext_func(FUNC_BUTTONS, 0x0, 0x0, 0x0));
937938
938939 #if IS_ENABLED(CONFIG_LEDS_CLASS)
939940 if (call_fext_func(FUNC_LEDS, 0x0, 0x0, 0x0) & LOGOLAMP_POWERON) {
940− result = led_classdev_register(&fujitsu->pf_device->dev,
941+ result = led_classdev_register(&fujitsu_bl->pf_device->dev,
941942 &logolamp_led);
942943 if (result == 0) {
943− fujitsu_hotkey->logolamp_registered = 1;
944+ fujitsu_laptop->logolamp_registered = 1;
944945 } else {
945946 pr_err("Could not register LED handler for logo lamp, error %i\n",
946947 result);
@@ -949,10 +950,10 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device) · 2 unmodified lines
949950
950951 if ((call_fext_func(FUNC_LEDS, 0x0, 0x0, 0x0) & KEYBOARD_LAMPS) &&
951952 (call_fext_func(FUNC_BUTTONS, 0x0, 0x0, 0x0) == 0x0)) {
952− result = led_classdev_register(&fujitsu->pf_device->dev,
953+ result = led_classdev_register(&fujitsu_bl->pf_device->dev,
953954 &kblamps_led);
954955 if (result == 0) {
955− fujitsu_hotkey->kblamps_registered = 1;
956+ fujitsu_laptop->kblamps_registered = 1;
956957 } else {
957958 pr_err("Could not register LED handler for keyboard lamps, error %i\n",
958959 result);
@@ -966,10 +967,10 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device) · 7 unmodified lines
966967 * that an RF LED is present.
967968 */
968969 if (call_fext_func(FUNC_BUTTONS, 0x0, 0x0, 0x0) & BIT(24)) {
969− result = led_classdev_register(&fujitsu->pf_device->dev,
970+ result = led_classdev_register(&fujitsu_bl->pf_device->dev,
970971 &radio_led);
971972 if (result == 0) {
972− fujitsu_hotkey->radio_led_registered = 1;
973+ fujitsu_laptop->radio_led_registered = 1;
973974 } else {
974975 pr_err("Could not register LED handler for radio LED, error %i\n",
975976 result);
@@ -983,10 +984,10 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device) · 7 unmodified lines
983984 */
984985 if ((call_fext_func(FUNC_LEDS, 0x0, 0x0, 0x0) & BIT(14)) &&
985986 (call_fext_func(FUNC_LEDS, 0x2, ECO_LED, 0x0) != UNSUPPORTED_CMD)) {
986− result = led_classdev_register(&fujitsu->pf_device->dev,
987+ result = led_classdev_register(&fujitsu_bl->pf_device->dev,
987988 &eco_led);
988989 if (result == 0) {
989− fujitsu_hotkey->eco_led_registered = 1;
990+ fujitsu_laptop->eco_led_registered = 1;
990991 } else {
991992 pr_err("Could not register LED handler for eco LED, error %i\n",
992993 result);
@@ -1002,47 +1003,47 @@ err_unregister_input_dev: · 9 unmodified lines
10021003 err_free_input_dev:
10031004 input_free_device(input);
10041005 err_free_fifo:
1005− kfifo_free(&fujitsu_hotkey->fifo);
1006+ kfifo_free(&fujitsu_laptop->fifo);
10061007 err_stop:
10071008 return error;
10081009 }
10091010
1010−static int acpi_fujitsu_hotkey_remove(struct acpi_device *device)
1011+static int acpi_fujitsu_laptop_remove(struct acpi_device *device)
10111012 {
1012− struct fujitsu_hotkey_t *fujitsu_hotkey = acpi_driver_data(device);
1013− struct input_dev *input = fujitsu_hotkey->input;
1013+ struct fujitsu_laptop *fujitsu_laptop = acpi_driver_data(device);
1014+ struct input_dev *input = fujitsu_laptop->input;
10141015
10151016 #if IS_ENABLED(CONFIG_LEDS_CLASS)
1016− if (fujitsu_hotkey->logolamp_registered)
1017+ if (fujitsu_laptop->logolamp_registered)
10171018 led_classdev_unregister(&logolamp_led);
10181019
1019− if (fujitsu_hotkey->kblamps_registered)
1020+ if (fujitsu_laptop->kblamps_registered)
10201021 led_classdev_unregister(&kblamps_led);
10211022
1022− if (fujitsu_hotkey->radio_led_registered)
1023+ if (fujitsu_laptop->radio_led_registered)
10231024 led_classdev_unregister(&radio_led);
10241025
1025− if (fujitsu_hotkey->eco_led_registered)
1026+ if (fujitsu_laptop->eco_led_registered)
10261027 led_classdev_unregister(&eco_led);
10271028 #endif
10281029
10291030 input_unregister_device(input);
10301031
1031− kfifo_free(&fujitsu_hotkey->fifo);
1032+ kfifo_free(&fujitsu_laptop->fifo);
10321033
1033− fujitsu_hotkey->acpi_handle = NULL;
1034+ fujitsu_laptop->acpi_handle = NULL;
10341035
10351036 return 0;
10361037 }
10371038
1038−static void acpi_fujitsu_hotkey_press(int keycode)
1039+static void acpi_fujitsu_laptop_press(int keycode)
10391040 {
1040− struct input_dev *input = fujitsu_hotkey->input;
1041+ struct input_dev *input = fujitsu_laptop->input;
10411042 int status;
10421043
1043− status = kfifo_in_locked(&fujitsu_hotkey->fifo,
1044+ status = kfifo_in_locked(&fujitsu_laptop->fifo,
10441045 (unsigned char *)&keycode, sizeof(keycode),
1045− &fujitsu_hotkey->fifo_lock);
1046+ &fujitsu_laptop->fifo_lock);
10461047 if (status != sizeof(keycode)) {
10471048 vdbg_printk(FUJLAPTOP_DBG_WARN,
10481049 "Could not push keycode [0x%x]\n", keycode);
@@ -1054,16 +1055,16 @@ static void acpi_fujitsu_hotkey_press(int keycode) · 5 unmodified lines
10541055 "Push keycode into ringbuffer [%d]\n", keycode);
10551056 }
10561057
1057−static void acpi_fujitsu_hotkey_release(void)
1058+static void acpi_fujitsu_laptop_release(void)
10581059 {
1059− struct input_dev *input = fujitsu_hotkey->input;
1060+ struct input_dev *input = fujitsu_laptop->input;
10601061 int keycode, status;
10611062
10621063 while (true) {
1063− status = kfifo_out_locked(&fujitsu_hotkey->fifo,
1064+ status = kfifo_out_locked(&fujitsu_laptop->fifo,
10641065 (unsigned char *)&keycode,
10651066 sizeof(keycode),
1066− &fujitsu_hotkey->fifo_lock);
1067+ &fujitsu_laptop->fifo_lock);
10671068 if (status != sizeof(keycode))
10681069 return;
10691070 input_report_key(input, keycode, 0);
@@ -1073,14 +1074,14 @@ static void acpi_fujitsu_hotkey_release(void) · 3 unmodified lines
10731074 }
10741075 }
10751076
1076−static void acpi_fujitsu_hotkey_notify(struct acpi_device *device, u32 event)
1077+static void acpi_fujitsu_laptop_notify(struct acpi_device *device, u32 event)
10771078 {
10781079 struct input_dev *input;
10791080 int keycode;
10801081 unsigned int irb = 1;
10811082 int i;
10821083
1083− input = fujitsu_hotkey->input;
1084+ input = fujitsu_laptop->input;
10841085
10851086 if (event != ACPI_FUJITSU_NOTIFY_CODE1) {
10861087 keycode = KEY_UNKNOWN;
@@ -1093,9 +1094,9 @@ static void acpi_fujitsu_hotkey_notify(struct acpi_device *device, u32 event) · 6 unmodified lines
10931094 return;
10941095 }
10951096
1096− if (fujitsu_hotkey->rfkill_supported)
1097− fujitsu_hotkey->rfkill_state =
1098− call_fext_func(FUNC_RFKILL, 0x4, 0x0, 0x0);
1097+ if (fujitsu_laptop->flags_supported)
1098+ fujitsu_laptop->flags_state =
1099+ call_fext_func(FUNC_FLAGS, 0x4, 0x0, 0x0);
10991100
11001101 i = 0;
11011102 while ((irb =
@@ -1103,19 +1104,19 @@ static void acpi_fujitsu_hotkey_notify(struct acpi_device *device, u32 event) · 1 unmodified line
11031104 && (i++) < MAX_HOTKEY_RINGBUFFER_SIZE) {
11041105 switch (irb & 0x4ff) {
11051106 case KEY1_CODE:
1106− keycode = fujitsu->keycode1;
1107+ keycode = fujitsu_bl->keycode1;
11071108 break;
11081109 case KEY2_CODE:
1109− keycode = fujitsu->keycode2;
1110+ keycode = fujitsu_bl->keycode2;
11101111 break;
11111112 case KEY3_CODE:
1112− keycode = fujitsu->keycode3;
1113+ keycode = fujitsu_bl->keycode3;
11131114 break;
11141115 case KEY4_CODE:
1115− keycode = fujitsu->keycode4;
1116+ keycode = fujitsu_bl->keycode4;
11161117 break;
11171118 case KEY5_CODE:
1118− keycode = fujitsu->keycode5;
1119+ keycode = fujitsu_bl->keycode5;
11191120 break;
11201121 case 0:
11211122 keycode = 0;
@@ -1128,17 +1129,17 @@ static void acpi_fujitsu_hotkey_notify(struct acpi_device *device, u32 event) · 6 unmodified lines
11281129 }
11291130
11301131 if (keycode > 0)
1131− acpi_fujitsu_hotkey_press(keycode);
1132+ acpi_fujitsu_laptop_press(keycode);
11321133 else if (keycode == 0)
1133− acpi_fujitsu_hotkey_release();
1134+ acpi_fujitsu_laptop_release();
11341135 }
11351136
11361137 /* On some models (first seen on the Skylake-based Lifebook
11371138 * E736/E746/E756), the touchpad toggle hotkey (Fn+F4) is
1138− * handled in software; its state is queried using FUNC_RFKILL
1139+ * handled in software; its state is queried using FUNC_FLAGS
11391140 */
1140− if ((fujitsu_hotkey->rfkill_supported & BIT(26)) &&
1141− (call_fext_func(FUNC_RFKILL, 0x1, 0x0, 0x0) & BIT(26))) {
1141+ if ((fujitsu_laptop->flags_supported & BIT(26)) &&
1142+ (call_fext_func(FUNC_FLAGS, 0x1, 0x0, 0x0) & BIT(26))) {
11421143 keycode = KEY_TOUCHPAD_TOGGLE;
11431144 input_report_key(input, keycode, 1);
11441145 input_sync(input);
@@ -1150,83 +1151,81 @@ static void acpi_fujitsu_hotkey_notify(struct acpi_device *device, u32 event) · 5 unmodified lines
11501151
11511152 /* Initialization */
11521153
1153−static const struct acpi_device_id fujitsu_device_ids[] = {
1154− {ACPI_FUJITSU_HID, 0},
1154+static const struct acpi_device_id fujitsu_bl_device_ids[] = {
1155+ {ACPI_FUJITSU_BL_HID, 0},
11551156 {"", 0},
11561157 };
11571158
1158−static struct acpi_driver acpi_fujitsu_driver = {
1159− .name = ACPI_FUJITSU_DRIVER_NAME,
1159+static struct acpi_driver acpi_fujitsu_bl_driver = {
1160+ .name = ACPI_FUJITSU_BL_DRIVER_NAME,
11601161 .class = ACPI_FUJITSU_CLASS,
1161− .ids = fujitsu_device_ids,
1162+ .ids = fujitsu_bl_device_ids,
11621163 .ops = {
1163− .add = acpi_fujitsu_add,
1164− .remove = acpi_fujitsu_remove,
1165− .notify = acpi_fujitsu_notify,
1164+ .add = acpi_fujitsu_bl_add,
1165+ .remove = acpi_fujitsu_bl_remove,
1166+ .notify = acpi_fujitsu_bl_notify,
11661167 },
11671168 };
11681169
1169−static const struct acpi_device_id fujitsu_hotkey_device_ids[] = {
1170− {ACPI_FUJITSU_HOTKEY_HID, 0},
1170+static const struct acpi_device_id fujitsu_laptop_device_ids[] = {
1171+ {ACPI_FUJITSU_LAPTOP_HID, 0},
11711172 {"", 0},
11721173 };
11731174
1174−static struct acpi_driver acpi_fujitsu_hotkey_driver = {
1175− .name = ACPI_FUJITSU_HOTKEY_DRIVER_NAME,
1175+static struct acpi_driver acpi_fujitsu_laptop_driver = {
1176+ .name = ACPI_FUJITSU_LAPTOP_DRIVER_NAME,
11761177 .class = ACPI_FUJITSU_CLASS,
1177− .ids = fujitsu_hotkey_device_ids,
1178+ .ids = fujitsu_laptop_device_ids,
11781179 .ops = {
1179− .add = acpi_fujitsu_hotkey_add,
1180− .remove = acpi_fujitsu_hotkey_remove,
1181− .notify = acpi_fujitsu_hotkey_notify,
1180+ .add = acpi_fujitsu_laptop_add,
1181+ .remove = acpi_fujitsu_laptop_remove,
1182+ .notify = acpi_fujitsu_laptop_notify,
11821183 },
11831184 };
11841185
11851186 static const struct acpi_device_id fujitsu_ids[] __used = {
1186− {ACPI_FUJITSU_HID, 0},
1187− {ACPI_FUJITSU_HOTKEY_HID, 0},
1187+ {ACPI_FUJITSU_BL_HID, 0},
1188+ {ACPI_FUJITSU_LAPTOP_HID, 0},
11881189 {"", 0}
11891190 };
11901191 MODULE_DEVICE_TABLE(acpi, fujitsu_ids);
11911192
11921193 static int __init fujitsu_init(void)
11931194 {
1194− int ret, result, max_brightness;
1195+ int ret, max_brightness;
11951196
11961197 if (acpi_disabled)
11971198 return -ENODEV;
11981199
1199− fujitsu = kzalloc(sizeof(struct fujitsu_t), GFP_KERNEL);
1200− if (!fujitsu)
1200+ fujitsu_bl = kzalloc(sizeof(struct fujitsu_bl), GFP_KERNEL);
1201+ if (!fujitsu_bl)
12011202 return -ENOMEM;
1202− fujitsu->keycode1 = KEY_PROG1;
1203− fujitsu->keycode2 = KEY_PROG2;
1204− fujitsu->keycode3 = KEY_PROG3;
1205− fujitsu->keycode4 = KEY_PROG4;
1206− fujitsu->keycode5 = KEY_RFKILL;
1203+ fujitsu_bl->keycode1 = KEY_PROG1;
1204+ fujitsu_bl->keycode2 = KEY_PROG2;
1205+ fujitsu_bl->keycode3 = KEY_PROG3;
1206+ fujitsu_bl->keycode4 = KEY_PROG4;
1207+ fujitsu_bl->keycode5 = KEY_RFKILL;
12071208 dmi_check_system(fujitsu_dmi_table);
12081209
1209− result = acpi_bus_register_driver(&acpi_fujitsu_driver);
1210− if (result < 0) {
1211− ret = -ENODEV;
1210+ ret = acpi_bus_register_driver(&acpi_fujitsu_bl_driver);
1211+ if (ret)
12121212 goto fail_acpi;
1213− }
12141213
12151214 /* Register platform stuff */
12161215
1217− fujitsu->pf_device = platform_device_alloc("fujitsu-laptop", -1);
1218− if (!fujitsu->pf_device) {
1216+ fujitsu_bl->pf_device = platform_device_alloc("fujitsu-laptop", -1);
1217+ if (!fujitsu_bl->pf_device) {
12191218 ret = -ENOMEM;
12201219 goto fail_platform_driver;
12211220 }
12221221
1223− ret = platform_device_add(fujitsu->pf_device);
1222+ ret = platform_device_add(fujitsu_bl->pf_device);
12241223 if (ret)
12251224 goto fail_platform_device1;
12261225
12271226 ret =
1228− sysfs_create_group(&fujitsu->pf_device->dev.kobj,
1229− &fujitsupf_attribute_group);
1227+ sysfs_create_group(&fujitsu_bl->pf_device->dev.kobj,
1228+ &fujitsu_pf_attribute_group);
12301229 if (ret)
12311230 goto fail_platform_device2;
12321231
@@ -1236,90 +1235,88 @@ static int __init fujitsu_init(void) · 3 unmodified lines
12361235 struct backlight_properties props;
12371236
12381237 memset(&props, 0, sizeof(struct backlight_properties));
1239− max_brightness = fujitsu->max_brightness;
1238+ max_brightness = fujitsu_bl->max_brightness;
12401239 props.type = BACKLIGHT_PLATFORM;
12411240 props.max_brightness = max_brightness - 1;
1242− fujitsu->bl_device = backlight_device_register("fujitsu-laptop",
1243− NULL, NULL,
1244− &fujitsubl_ops,
1245− &props);
1246− if (IS_ERR(fujitsu->bl_device)) {
1247− ret = PTR_ERR(fujitsu->bl_device);
1248− fujitsu->bl_device = NULL;
1241+ fujitsu_bl->bl_device = backlight_device_register("fujitsu-laptop",
1242+ NULL, NULL,
1243+ &fujitsu_bl_ops,
1244+ &props);
1245+ if (IS_ERR(fujitsu_bl->bl_device)) {
1246+ ret = PTR_ERR(fujitsu_bl->bl_device);
1247+ fujitsu_bl->bl_device = NULL;
12491248 goto fail_sysfs_group;
12501249 }
1251− fujitsu->bl_device->props.brightness = fujitsu->brightness_level;
1250+ fujitsu_bl->bl_device->props.brightness = fujitsu_bl->brightness_level;
12521251 }
12531252
1254− ret = platform_driver_register(&fujitsupf_driver);
1253+ ret = platform_driver_register(&fujitsu_pf_driver);
12551254 if (ret)
12561255 goto fail_backlight;
12571256
1258− /* Register hotkey driver */
1257+ /* Register laptop driver */
12591258
1260− fujitsu_hotkey = kzalloc(sizeof(struct fujitsu_hotkey_t), GFP_KERNEL);
1261− if (!fujitsu_hotkey) {
1259+ fujitsu_laptop = kzalloc(sizeof(struct fujitsu_laptop), GFP_KERNEL);
1260+ if (!fujitsu_laptop) {
12621261 ret = -ENOMEM;
1263− goto fail_hotkey;
1262+ goto fail_laptop;
12641263 }
12651264
1266− result = acpi_bus_register_driver(&acpi_fujitsu_hotkey_driver);
1267− if (result < 0) {
1268− ret = -ENODEV;
1269− goto fail_hotkey1;
1270− }
1265+ ret = acpi_bus_register_driver(&acpi_fujitsu_laptop_driver);
1266+ if (ret)
1267+ goto fail_laptop1;
12711268
12721269 /* Sync backlight power status (needs FUJ02E3 device, hence deferred) */
12731270 if (acpi_video_get_backlight_type() == acpi_backlight_vendor) {
12741271 if (call_fext_func(FUNC_BACKLIGHT, 0x2, 0x4, 0x0) == 3)
1275− fujitsu->bl_device->props.power = FB_BLANK_POWERDOWN;
1272+ fujitsu_bl->bl_device->props.power = FB_BLANK_POWERDOWN;
12761273 else
1277− fujitsu->bl_device->props.power = FB_BLANK_UNBLANK;
1274+ fujitsu_bl->bl_device->props.power = FB_BLANK_UNBLANK;
12781275 }
12791276
12801277 pr_info("driver " FUJITSU_DRIVER_VERSION " successfully loaded\n");
12811278
12821279 return 0;
12831280
1284−fail_hotkey1:
1285− kfree(fujitsu_hotkey);
1286−fail_hotkey:
1287− platform_driver_unregister(&fujitsupf_driver);
1281+fail_laptop1:
1282+ kfree(fujitsu_laptop);
1283+fail_laptop:
1284+ platform_driver_unregister(&fujitsu_pf_driver);
12881285 fail_backlight:
1289− backlight_device_unregister(fujitsu->bl_device);
1286+ backlight_device_unregister(fujitsu_bl->bl_device);
12901287 fail_sysfs_group:
1291− sysfs_remove_group(&fujitsu->pf_device->dev.kobj,
1292− &fujitsupf_attribute_group);
1288+ sysfs_remove_group(&fujitsu_bl->pf_device->dev.kobj,
1289+ &fujitsu_pf_attribute_group);
12931290 fail_platform_device2:
1294− platform_device_del(fujitsu->pf_device);
1291+ platform_device_del(fujitsu_bl->pf_device);
12951292 fail_platform_device1:
1296− platform_device_put(fujitsu->pf_device);
1293+ platform_device_put(fujitsu_bl->pf_device);
12971294 fail_platform_driver:
1298− acpi_bus_unregister_driver(&acpi_fujitsu_driver);
1295+ acpi_bus_unregister_driver(&acpi_fujitsu_bl_driver);
12991296 fail_acpi:
1300− kfree(fujitsu);
1297+ kfree(fujitsu_bl);
13011298
13021299 return ret;
13031300 }
13041301
13051302 static void __exit fujitsu_cleanup(void)
13061303 {
1307− acpi_bus_unregister_driver(&acpi_fujitsu_hotkey_driver);
1304+ acpi_bus_unregister_driver(&acpi_fujitsu_laptop_driver);
13081305
1309− kfree(fujitsu_hotkey);
1306+ kfree(fujitsu_laptop);
13101307
1311− platform_driver_unregister(&fujitsupf_driver);
1308+ platform_driver_unregister(&fujitsu_pf_driver);
13121309
1313− backlight_device_unregister(fujitsu->bl_device);
1310+ backlight_device_unregister(fujitsu_bl->bl_device);
13141311
1315− sysfs_remove_group(&fujitsu->pf_device->dev.kobj,
1316− &fujitsupf_attribute_group);
1312+ sysfs_remove_group(&fujitsu_bl->pf_device->dev.kobj,
1313+ &fujitsu_pf_attribute_group);
13171314
1318− platform_device_unregister(fujitsu->pf_device);
1315+ platform_device_unregister(fujitsu_bl->pf_device);
13191316
1320− acpi_bus_unregister_driver(&acpi_fujitsu_driver);
1317+ acpi_bus_unregister_driver(&acpi_fujitsu_bl_driver);
13211318
1322− kfree(fujitsu);
1319+ kfree(fujitsu_bl);
13231320
13241321 pr_info("driver unloaded\n");
13251322 }
@@ -1341,7 +1338,3 @@ MODULE_AUTHOR("Jonathan Woithe, Peter Gruber, Tony Vroon"); · 15 unmodified lines
13411338 MODULE_DESCRIPTION("Fujitsu laptop extras support");
13421339 MODULE_VERSION(FUJITSU_DRIVER_VERSION);
13431340 MODULE_LICENSE("GPL");
1344−
1345−MODULE_ALIAS("dmi:*:svnFUJITSUSIEMENS:*:pvr:rvnFUJITSU:rnFJNB1D3:*:cvrS6410:*");
1346−MODULE_ALIAS("dmi:*:svnFUJITSUSIEMENS:*:pvr:rvnFUJITSU:rnFJNB1E6:*:cvrS6420:*");
1347−MODULE_ALIAS("dmi:*:svnFUJITSU:*:pvr:rvnFUJITSU:rnFJNB19C:*:cvrS7020:*");
drivers/remoteproc/Kconfig+3−3
@@ -76,7 +76,7 @@ config QCOM_ADSP_PIL · 75 unmodified lines
7676 depends on OF && ARCH_QCOM
7777 depends on REMOTEPROC
7878 depends on QCOM_SMEM
79− depends on QCOM_SMD || (COMPILE_TEST && QCOM_SMD=n)
79+ depends on RPMSG_QCOM_SMD || QCOM_SMD || (COMPILE_TEST && QCOM_SMD=n && RPMSG_QCOM_SMD=n)
8080 select MFD_SYSCON
8181 select QCOM_MDT_LOADER
8282 select QCOM_RPROC_COMMON
@@ -93,7 +93,7 @@ config QCOM_Q6V5_PIL · 10 unmodified lines
9393 depends on OF && ARCH_QCOM
9494 depends on QCOM_SMEM
9595 depends on REMOTEPROC
96− depends on QCOM_SMD || (COMPILE_TEST && QCOM_SMD=n)
96+ depends on RPMSG_QCOM_SMD || QCOM_SMD || (COMPILE_TEST && QCOM_SMD=n && RPMSG_QCOM_SMD=n)
9797 select MFD_SYSCON
9898 select QCOM_RPROC_COMMON
9999 select QCOM_SCM
@@ -104,7 +104,7 @@ config QCOM_Q6V5_PIL · 4 unmodified lines
104104 config QCOM_WCNSS_PIL
105105 tristate "Qualcomm WCNSS Peripheral Image Loader"
106106 depends on OF && ARCH_QCOM
107− depends on QCOM_SMD || (COMPILE_TEST && QCOM_SMD=n)
107+ depends on RPMSG_QCOM_SMD || QCOM_SMD || (COMPILE_TEST && QCOM_SMD=n && RPMSG_QCOM_SMD=n)
108108 depends on QCOM_SMEM
109109 depends on REMOTEPROC
110110 select QCOM_MDT_LOADER
drivers/scsi/Kconfig+2−3
@@ -1241,16 +1241,15 @@ config SCSI_LPFC · 1240 unmodified lines
12411241 tristate "Emulex LightPulse Fibre Channel Support"
12421242 depends on PCI && SCSI
12431243 depends on SCSI_FC_ATTRS
1244− depends on NVME_FC && NVME_TARGET_FC
12451244 select CRC_T10DIF
1246− help
1245+ ---help---
12471246 This lpfc driver supports the Emulex LightPulse
12481247 Family of Fibre Channel PCI host adapters.
12491248
12501249 config SCSI_LPFC_DEBUG_FS
12511250 bool "Emulex LightPulse Fibre Channel debugfs Support"
12521251 depends on SCSI_LPFC && DEBUG_FS
1253− help
1252+ ---help---
12541253 This makes debugging information from the lpfc driver
12551254 available via the debugfs filesystem.
12561255
drivers/scsi/aacraid/src.c+1−1
@@ -468,7 +468,7 @@ err_out: · 467 unmodified lines
468468 return -1;
469469
470470 err_blink:
471− return (status > 16) & 0xFF;
471+ return (status >> 16) & 0xFF;
472472 }
473473
474474 static inline u32 aac_get_vector(struct aac_dev *dev)
drivers/scsi/hpsa.c+32−21
@@ -2956,7 +2956,7 @@ static int hpsa_send_reset(struct ctlr_info *h, unsigned char *scsi3addr, · 2955 unmodified lines
29562956 /* fill_cmd can't fail here, no data buffer to map. */
29572957 (void) fill_cmd(c, reset_type, h, NULL, 0, 0,
29582958 scsi3addr, TYPE_MSG);
2959− rc = hpsa_scsi_do_simple_cmd(h, c, reply_queue, DEFAULT_TIMEOUT);
2959+ rc = hpsa_scsi_do_simple_cmd(h, c, reply_queue, NO_TIMEOUT);
29602960 if (rc) {
29612961 dev_warn(&h->pdev->dev, "Failed to send reset command\n");
29622962 goto out;
@@ -3714,7 +3714,7 @@ exit_failed: · 751 unmodified lines
37143714 * # (integer code indicating one of several NOT READY states
37153715 * describing why a volume is to be kept offline)
37163716 */
3717−static int hpsa_volume_offline(struct ctlr_info *h,
3717+static unsigned char hpsa_volume_offline(struct ctlr_info *h,
37183718 unsigned char scsi3addr[])
37193719 {
37203720 struct CommandList *c;
@@ -3735,7 +3735,7 @@ static int hpsa_volume_offline(struct ctlr_info *h, · 14 unmodified lines
37353735 DEFAULT_TIMEOUT);
37363736 if (rc) {
37373737 cmd_free(h, c);
3738− return 0;
3738+ return HPSA_VPD_LV_STATUS_UNSUPPORTED;
37393739 }
37403740 sense = c->err_info->SenseInfo;
37413741 if (c->err_info->SenseLen > sizeof(c->err_info->SenseInfo))
@@ -3746,19 +3746,13 @@ static int hpsa_volume_offline(struct ctlr_info *h, · 4 unmodified lines
37463746 cmd_status = c->err_info->CommandStatus;
37473747 scsi_status = c->err_info->ScsiStatus;
37483748 cmd_free(h, c);
3749− /* Is the volume 'not ready'? */
3750− if (cmd_status != CMD_TARGET_STATUS ||
3751− scsi_status != SAM_STAT_CHECK_CONDITION ||
3752− sense_key != NOT_READY ||
3753− asc != ASC_LUN_NOT_READY) {
3754− return 0;
3755− }
37563749
37573750 /* Determine the reason for not ready state */
37583751 ldstat = hpsa_get_volume_status(h, scsi3addr);
37593752
37603753 /* Keep volume offline in certain cases: */
37613754 switch (ldstat) {
3755+ case HPSA_LV_FAILED:
37623756 case HPSA_LV_UNDERGOING_ERASE:
37633757 case HPSA_LV_NOT_AVAILABLE:
37643758 case HPSA_LV_UNDERGOING_RPI:
@@ -3780,7 +3774,7 @@ static int hpsa_volume_offline(struct ctlr_info *h, · 15 unmodified lines
37803774 default:
37813775 break;
37823776 }
3783− return 0;
3777+ return HPSA_LV_OK;
37843778 }
37853779
37863780 /*
@@ -3853,10 +3847,10 @@ static int hpsa_update_device_info(struct ctlr_info *h, · 66 unmodified lines
38533847 /* Do an inquiry to the device to see what it is. */
38543848 if (hpsa_scsi_do_inquiry(h, scsi3addr, 0, inq_buff,
38553849 (unsigned char) OBDR_TAPE_INQ_SIZE) != 0) {
3856− /* Inquiry failed (msg printed already) */
38573850 dev_err(&h->pdev->dev,
3858− "hpsa_update_device_info: inquiry failed\n");
3859− rc = -EIO;
3851+ "%s: inquiry failed, device will be skipped.\n",
3852+ __func__);
3853+ rc = HPSA_INQUIRY_FAILED;
38603854 goto bail_out;
38613855 }
38623856
@@ -3885,15 +3879,19 @@ static int hpsa_update_device_info(struct ctlr_info *h, · 22 unmodified lines
38853879 if ((this_device->devtype == TYPE_DISK ||
38863880 this_device->devtype == TYPE_ZBC) &&
38873881 is_logical_dev_addr_mode(scsi3addr)) {
3888− int volume_offline;
3882+ unsigned char volume_offline;
38893883
38903884 hpsa_get_raid_level(h, scsi3addr, &this_device->raid_level);
38913885 if (h->fw_support & MISC_FW_RAID_OFFLOAD_BASIC)
38923886 hpsa_get_ioaccel_status(h, scsi3addr, this_device);
38933887 volume_offline = hpsa_volume_offline(h, scsi3addr);
3894− if (volume_offline < 0 || volume_offline > 0xff)
3895− volume_offline = HPSA_VPD_LV_STATUS_UNSUPPORTED;
3896− this_device->volume_offline = volume_offline & 0xff;
3888+ if (volume_offline == HPSA_LV_FAILED) {
3889+ rc = HPSA_LV_FAILED;
3890+ dev_err(&h->pdev->dev,
3891+ "%s: LV failed, device will be skipped.\n",
3892+ __func__);
3893+ goto bail_out;
3894+ }
38973895 } else {
38983896 this_device->raid_level = RAID_UNKNOWN;
38993897 this_device->offload_config = 0;
@@ -4379,8 +4377,7 @@ static void hpsa_update_scsi_devices(struct ctlr_info *h) · 479 unmodified lines
43794377 goto out;
43804378 }
43814379 if (rc) {
4382− dev_warn(&h->pdev->dev,
4383− "Inquiry failed, skipping device.\n");
4380+ h->drv_req_rescan = 1;
43844381 continue;
43854382 }
43864383
@@ -5558,7 +5555,7 @@ static void hpsa_scan_complete(struct ctlr_info *h) · 1171 unmodified lines
55585555
55595556 spin_lock_irqsave(&h->scan_lock, flags);
55605557 h->scan_finished = 1;
5561− wake_up_all(&h->scan_wait_queue);
5558+ wake_up(&h->scan_wait_queue);
55625559 spin_unlock_irqrestore(&h->scan_lock, flags);
55635560 }
55645561
@@ -5576,11 +5573,23 @@ static void hpsa_scan_start(struct Scsi_Host *sh) · 11 unmodified lines
55765573 if (unlikely(lockup_detected(h)))
55775574 return hpsa_scan_complete(h);
55785575
5576+ /*
5577+ * If a scan is already waiting to run, no need to add another
5578+ */
5579+ spin_lock_irqsave(&h->scan_lock, flags);
5580+ if (h->scan_waiting) {
5581+ spin_unlock_irqrestore(&h->scan_lock, flags);
5582+ return;
5583+ }
5584+
5585+ spin_unlock_irqrestore(&h->scan_lock, flags);
5586+
55795587 /* wait until any scan already in progress is finished. */
55805588 while (1) {
55815589 spin_lock_irqsave(&h->scan_lock, flags);
55825590 if (h->scan_finished)
55835591 break;
5592+ h->scan_waiting = 1;
55845593 spin_unlock_irqrestore(&h->scan_lock, flags);
55855594 wait_event(h->scan_wait_queue, h->scan_finished);
55865595 /* Note: We don't need to worry about a race between this
@@ -5590,6 +5599,7 @@ static void hpsa_scan_start(struct Scsi_Host *sh) · 3 unmodified lines
55905599 */
55915600 }
55925601 h->scan_finished = 0; /* mark scan as in progress */
5602+ h->scan_waiting = 0;
55935603 spin_unlock_irqrestore(&h->scan_lock, flags);
55945604
55955605 if (unlikely(lockup_detected(h)))
@@ -8792,6 +8802,7 @@ reinit_after_soft_reset: · 3196 unmodified lines
87928802 init_waitqueue_head(&h->event_sync_wait_queue);
87938803 mutex_init(&h->reset_mutex);
87948804 h->scan_finished = 1; /* no scan currently in progress */
8805+ h->scan_waiting = 0;
87958806
87968807 pci_set_drvdata(pdev, h);
87978808 h->ndevices = 0;
drivers/scsi/hpsa.h+1−0
@@ -201,6 +201,7 @@ struct ctlr_info { · 200 unmodified lines
201201 dma_addr_t errinfo_pool_dhandle;
202202 unsigned long *cmd_pool_bits;
203203 int scan_finished;
204+ u8 scan_waiting : 1;
204205 spinlock_t scan_lock;
205206 wait_queue_head_t scan_wait_queue;
206207
drivers/scsi/hpsa_cmd.h+2−0
@@ -156,6 +156,7 @@ · 155 unmodified lines
156156 #define CFGTBL_BusType_Fibre2G 0x00000200l
157157
158158 /* VPD Inquiry types */
159+#define HPSA_INQUIRY_FAILED 0x02
159160 #define HPSA_VPD_SUPPORTED_PAGES 0x00
160161 #define HPSA_VPD_LV_DEVICE_ID 0x83
161162 #define HPSA_VPD_LV_DEVICE_GEOMETRY 0xC1
@@ -166,6 +167,7 @@ · 4 unmodified lines
166167 /* Logical volume states */
167168 #define HPSA_VPD_LV_STATUS_UNSUPPORTED 0xff
168169 #define HPSA_LV_OK 0x0
170+#define HPSA_LV_FAILED 0x01
169171 #define HPSA_LV_NOT_AVAILABLE 0x0b
170172 #define HPSA_LV_UNDERGOING_ERASE 0x0F
171173 #define HPSA_LV_UNDERGOING_RPI 0x12
drivers/scsi/libiscsi.c+25−1
@@ -561,8 +561,12 @@ static void iscsi_complete_task(struct iscsi_task *task, int state) · 560 unmodified lines
561561 WARN_ON_ONCE(task->state == ISCSI_TASK_FREE);
562562 task->state = state;
563563
564− if (!list_empty(&task->running))
564+ spin_lock_bh(&conn->taskqueuelock);
565+ if (!list_empty(&task->running)) {
566+ pr_debug_once("%s while task on list", __func__);
565567 list_del_init(&task->running);
568+ }
569+ spin_unlock_bh(&conn->taskqueuelock);
566570
567571 if (conn->task == task)
568572 conn->task = NULL;
@@ -784,7 +788,9 @@ __iscsi_conn_send_pdu(struct iscsi_conn *conn, struct iscsi_hdr *hdr, · 215 unmodified lines
784788 if (session->tt->xmit_task(task))
785789 goto free_task;
786790 } else {
791+ spin_lock_bh(&conn->taskqueuelock);
787792 list_add_tail(&task->running, &conn->mgmtqueue);
793+ spin_unlock_bh(&conn->taskqueuelock);
788794 iscsi_conn_queue_work(conn);
789795 }
790796
@@ -1475,8 +1481,10 @@ void iscsi_requeue_task(struct iscsi_task *task) · 684 unmodified lines
14751481 * this may be on the requeue list already if the xmit_task callout
14761482 * is handling the r2ts while we are adding new ones
14771483 */
1484+ spin_lock_bh(&conn->taskqueuelock);
14781485 if (list_empty(&task->running))
14791486 list_add_tail(&task->running, &conn->requeue);
1487+ spin_unlock_bh(&conn->taskqueuelock);
14801488 iscsi_conn_queue_work(conn);
14811489 }
14821490 EXPORT_SYMBOL_GPL(iscsi_requeue_task);
@@ -1513,22 +1521,26 @@ static int iscsi_data_xmit(struct iscsi_conn *conn) · 30 unmodified lines
15131521 * only have one nop-out as a ping from us and targets should not
15141522 * overflow us with nop-ins
15151523 */
1524+ spin_lock_bh(&conn->taskqueuelock);
15161525 check_mgmt:
15171526 while (!list_empty(&conn->mgmtqueue)) {
15181527 conn->task = list_entry(conn->mgmtqueue.next,
15191528 struct iscsi_task, running);
15201529 list_del_init(&conn->task->running);
1530+ spin_unlock_bh(&conn->taskqueuelock);
15211531 if (iscsi_prep_mgmt_task(conn, conn->task)) {
15221532 /* regular RX path uses back_lock */
15231533 spin_lock_bh(&conn->session->back_lock);
15241534 __iscsi_put_task(conn->task);
15251535 spin_unlock_bh(&conn->session->back_lock);
15261536 conn->task = NULL;
1537+ spin_lock_bh(&conn->taskqueuelock);
15271538 continue;
15281539 }
15291540 rc = iscsi_xmit_task(conn);
15301541 if (rc)
15311542 goto done;
1543+ spin_lock_bh(&conn->taskqueuelock);
15321544 }
15331545
15341546 /* process pending command queue */
@@ -1536,19 +1548,24 @@ check_mgmt: · 1 unmodified line
15361548 conn->task = list_entry(conn->cmdqueue.next, struct iscsi_task,
15371549 running);
15381550 list_del_init(&conn->task->running);
1551+ spin_unlock_bh(&conn->taskqueuelock);
15391552 if (conn->session->state == ISCSI_STATE_LOGGING_OUT) {
15401553 fail_scsi_task(conn->task, DID_IMM_RETRY);
1554+ spin_lock_bh(&conn->taskqueuelock);
15411555 continue;
15421556 }
15431557 rc = iscsi_prep_scsi_cmd_pdu(conn->task);
15441558 if (rc) {
15451559 if (rc == -ENOMEM || rc == -EACCES) {
1560+ spin_lock_bh(&conn->taskqueuelock);
15461561 list_add_tail(&conn->task->running,
15471562 &conn->cmdqueue);
15481563 conn->task = NULL;
1564+ spin_unlock_bh(&conn->taskqueuelock);
15491565 goto done;
15501566 } else
15511567 fail_scsi_task(conn->task, DID_ABORT);
1568+ spin_lock_bh(&conn->taskqueuelock);
15521569 continue;
15531570 }
15541571 rc = iscsi_xmit_task(conn);
@@ -1559,6 +1576,7 @@ check_mgmt: · 4 unmodified lines
15591576 * we need to check the mgmt queue for nops that need to
15601577 * be sent to aviod starvation
15611578 */
1579+ spin_lock_bh(&conn->taskqueuelock);
15621580 if (!list_empty(&conn->mgmtqueue))
15631581 goto check_mgmt;
15641582 }
@@ -1578,12 +1596,15 @@ check_mgmt: · 13 unmodified lines
15781596 conn->task = task;
15791597 list_del_init(&conn->task->running);
15801598 conn->task->state = ISCSI_TASK_RUNNING;
1599+ spin_unlock_bh(&conn->taskqueuelock);
15811600 rc = iscsi_xmit_task(conn);
15821601 if (rc)
15831602 goto done;
1603+ spin_lock_bh(&conn->taskqueuelock);
15841604 if (!list_empty(&conn->mgmtqueue))
15851605 goto check_mgmt;
15861606 }
1607+ spin_unlock_bh(&conn->taskqueuelock);
15871608 spin_unlock_bh(&conn->session->frwd_lock);
15881609 return -ENODATA;
15891610
@@ -1739,7 +1760,9 @@ int iscsi_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *sc) · 149 unmodified lines
17391760 goto prepd_reject;
17401761 }
17411762 } else {
1763+ spin_lock_bh(&conn->taskqueuelock);
17421764 list_add_tail(&task->running, &conn->cmdqueue);
1765+ spin_unlock_bh(&conn->taskqueuelock);
17431766 iscsi_conn_queue_work(conn);
17441767 }
17451768
@@ -2897,6 +2920,7 @@ iscsi_conn_setup(struct iscsi_cls_session *cls_session, int dd_size, · 1151 unmodified lines
28972920 INIT_LIST_HEAD(&conn->mgmtqueue);
28982921 INIT_LIST_HEAD(&conn->cmdqueue);
28992922 INIT_LIST_HEAD(&conn->requeue);
2923+ spin_lock_init(&conn->taskqueuelock);
29002924 INIT_WORK(&conn->xmitwork, iscsi_xmitworker);
29012925
29022926 /* allocate login_task used for the login/text sequences */
drivers/scsi/lpfc/lpfc.h+3−1
@@ -99,12 +99,13 @@ struct lpfc_sli2_slim; · 98 unmodified lines
9999 #define FC_MAX_ADPTMSG 64
100100
101101 #define MAX_HBAEVT 32
102+#define MAX_HBAS_NO_RESET 16
102103
103104 /* Number of MSI-X vectors the driver uses */
104105 #define LPFC_MSIX_VECTORS 2
105106
106107 /* lpfc wait event data ready flag */
107−#define LPFC_DATA_READY (1<<0)
108+#define LPFC_DATA_READY 0 /* bit 0 */
108109
109110 /* queue dump line buffer size */
110111 #define LPFC_LBUF_SZ 128
@@ -692,6 +693,7 @@ struct lpfc_hba { · 581 unmodified lines
692693 * capability
693694 */
694695 #define HBA_NVME_IOQ_FLUSH 0x80000 /* NVME IO queues flushed. */
696+#define NVME_XRI_ABORT_EVENT 0x100000
695697
696698 uint32_t fcp_ring_in_use; /* When polling test if intr-hndlr active*/
697699 struct lpfc_dmabuf slim2p;
drivers/scsi/lpfc/lpfc_attr.c+10−3
@@ -3010,6 +3010,12 @@ MODULE_PARM_DESC(lpfc_poll, "FCP ring polling mode control:" · 3009 unmodified lines
30103010 static DEVICE_ATTR(lpfc_poll, S_IRUGO | S_IWUSR,
30113011 lpfc_poll_show, lpfc_poll_store);
30123012
3013+int lpfc_no_hba_reset_cnt;
3014+unsigned long lpfc_no_hba_reset[MAX_HBAS_NO_RESET] = {
3015+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
3016+module_param_array(lpfc_no_hba_reset, ulong, &lpfc_no_hba_reset_cnt, 0444);
3017+MODULE_PARM_DESC(lpfc_no_hba_reset, "WWPN of HBAs that should not be reset");
3018+
30133019 LPFC_ATTR(sli_mode, 0, 0, 3,
30143020 "SLI mode selector:"
30153021 " 0 - auto (SLI-3 if supported),"
@@ -3309,9 +3315,9 @@ LPFC_ATTR_R(nvmet_mrq_post, LPFC_DEF_MRQ_POST, · 293 unmodified lines
33093315 * lpfc_enable_fc4_type: Defines what FC4 types are supported.
33103316 * Supported Values: 1 - register just FCP
33113317 * 3 - register both FCP and NVME
3312− * Supported values are [1,3]. Default value is 3
3318+ * Supported values are [1,3]. Default value is 1
33133319 */
3314−LPFC_ATTR_R(enable_fc4_type, LPFC_ENABLE_BOTH,
3320+LPFC_ATTR_R(enable_fc4_type, LPFC_ENABLE_FCP,
33153321 LPFC_ENABLE_FCP, LPFC_ENABLE_BOTH,
33163322 "Define fc4 type to register with fabric.");
33173323
@@ -4451,7 +4457,8 @@ lpfc_fcp_imax_store(struct device *dev, struct device_attribute *attr, · 1133 unmodified lines
44514457 return -EINVAL;
44524458
44534459 phba->cfg_fcp_imax = (uint32_t)val;
4454− for (i = 0; i < phba->io_channel_irqs; i++)
4460+
4461+ for (i = 0; i < phba->io_channel_irqs; i += LPFC_MAX_EQ_DELAY_EQID_CNT)
44554462 lpfc_modify_hba_eq_delay(phba, i);
44564463
44574464 return strlen(buf);
drivers/scsi/lpfc/lpfc_crtn.h+3−1
@@ -384,7 +384,7 @@ void lpfc_free_sysfs_attr(struct lpfc_vport *); · 383 unmodified lines
384384 extern struct device_attribute *lpfc_hba_attrs[];
385385 extern struct device_attribute *lpfc_vport_attrs[];
386386 extern struct scsi_host_template lpfc_template;
387−extern struct scsi_host_template lpfc_template_s3;
387+extern struct scsi_host_template lpfc_template_no_hr;
388388 extern struct scsi_host_template lpfc_template_nvme;
389389 extern struct scsi_host_template lpfc_vport_template;
390390 extern struct fc_function_template lpfc_transport_functions;
@@ -554,3 +554,5 @@ void lpfc_nvme_abort_fcreq_cmpl(struct lpfc_hba *phba, · 163 unmodified lines
554554 struct lpfc_wcqe_complete *abts_cmpl);
555555 extern int lpfc_enable_nvmet_cnt;
556556 extern unsigned long long lpfc_enable_nvmet[];
557+extern int lpfc_no_hba_reset_cnt;
558+extern unsigned long lpfc_no_hba_reset[];
drivers/scsi/lpfc/lpfc_ct.c+1−1
@@ -939,8 +939,8 @@ lpfc_cmpl_ct_cmd_gft_id(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, · 938 unmodified lines
939939 "FC4 x%08x, Data: x%08x x%08x\n",
940940 ndlp, did, ndlp->nlp_fc4_type,
941941 FC_TYPE_FCP, FC_TYPE_NVME);
942+ ndlp->nlp_prev_state = NLP_STE_REG_LOGIN_ISSUE;
942943 }
943− ndlp->nlp_prev_state = NLP_STE_REG_LOGIN_ISSUE;
944944 lpfc_nlp_set_state(vport, ndlp, NLP_STE_PRLI_ISSUE);
945945 lpfc_issue_els_prli(vport, ndlp, 0);
946946 } else
drivers/scsi/lpfc/lpfc_debugfs.c+0−22
@@ -3653,17 +3653,6 @@ lpfc_idiag_queacc_write(struct file *file, const char __user *buf, · 3652 unmodified lines
36533653 idiag.ptr_private = phba->sli4_hba.nvmels_cq;
36543654 goto pass_check;
36553655 }
3656− /* NVME LS complete queue */
3657− if (phba->sli4_hba.nvmels_cq &&
3658− phba->sli4_hba.nvmels_cq->queue_id == queid) {
3659− /* Sanity check */
3660− rc = lpfc_idiag_que_param_check(
3661− phba->sli4_hba.nvmels_cq, index, count);
3662− if (rc)
3663− goto error_out;
3664− idiag.ptr_private = phba->sli4_hba.nvmels_cq;
3665− goto pass_check;
3666− }
36673656 /* FCP complete queue */
36683657 if (phba->sli4_hba.fcp_cq) {
36693658 for (qidx = 0; qidx < phba->cfg_fcp_io_channel;
@@ -3738,17 +3727,6 @@ lpfc_idiag_queacc_write(struct file *file, const char __user *buf, · 68 unmodified lines
37383727 idiag.ptr_private = phba->sli4_hba.nvmels_wq;
37393728 goto pass_check;
37403729 }
3741− /* NVME LS work queue */
3742− if (phba->sli4_hba.nvmels_wq &&
3743− phba->sli4_hba.nvmels_wq->queue_id == queid) {
3744− /* Sanity check */
3745− rc = lpfc_idiag_que_param_check(
3746− phba->sli4_hba.nvmels_wq, index, count);
3747− if (rc)
3748− goto error_out;
3749− idiag.ptr_private = phba->sli4_hba.nvmels_wq;
3750− goto pass_check;
3751− }
37523730 /* FCP work queue */
37533731 if (phba->sli4_hba.fcp_wq) {
37543732 for (qidx = 0; qidx < phba->cfg_fcp_io_channel;
drivers/scsi/lpfc/lpfc_els.c+14−8
@@ -5177,15 +5177,15 @@ lpfc_rdp_res_speed(struct fc_rdp_port_speed_desc *desc, struct lpfc_hba *phba) · 5176 unmodified lines
51775177
51785178 static uint32_t
51795179 lpfc_rdp_res_diag_port_names(struct fc_rdp_port_name_desc *desc,
5180− struct lpfc_hba *phba)
5180+ struct lpfc_vport *vport)
51815181 {
51825182
51835183 desc->tag = cpu_to_be32(RDP_PORT_NAMES_DESC_TAG);
51845184
5185− memcpy(desc->port_names.wwnn, phba->wwnn,
5185+ memcpy(desc->port_names.wwnn, &vport->fc_nodename,
51865186 sizeof(desc->port_names.wwnn));
51875187
5188− memcpy(desc->port_names.wwpn, phba->wwpn,
5188+ memcpy(desc->port_names.wwpn, &vport->fc_portname,
51895189 sizeof(desc->port_names.wwpn));
51905190
51915191 desc->length = cpu_to_be32(sizeof(desc->port_names));
@@ -5279,7 +5279,7 @@ lpfc_els_rdp_cmpl(struct lpfc_hba *phba, struct lpfc_rdp_context *rdp_context, · 87 unmodified lines
52795279 len += lpfc_rdp_res_link_error((struct fc_rdp_link_error_status_desc *)
52805280 (len + pcmd), &rdp_context->link_stat);
52815281 len += lpfc_rdp_res_diag_port_names((struct fc_rdp_port_name_desc *)
5282− (len + pcmd), phba);
5282+ (len + pcmd), vport);
52835283 len += lpfc_rdp_res_attach_port_names((struct fc_rdp_port_name_desc *)
52845284 (len + pcmd), vport, ndlp);
52855285 len += lpfc_rdp_res_fec_desc((struct fc_fec_rdp_desc *)(len + pcmd),
@@ -8371,11 +8371,17 @@ lpfc_cmpl_reg_new_vport(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) · 3085 unmodified lines
83718371 spin_lock_irq(shost->host_lock);
83728372 vport->fc_flag |= FC_VPORT_NEEDS_REG_VPI;
83738373 spin_unlock_irq(shost->host_lock);
8374− if (vport->port_type == LPFC_PHYSICAL_PORT
8375− && !(vport->fc_flag & FC_LOGO_RCVD_DID_CHNG))
8376− lpfc_issue_init_vfi(vport);
8377− else
8374+ if (mb->mbxStatus == MBX_NOT_FINISHED)
8375+ break;
8376+ if ((vport->port_type == LPFC_PHYSICAL_PORT) &&
8377+ !(vport->fc_flag & FC_LOGO_RCVD_DID_CHNG)) {
8378+ if (phba->sli_rev == LPFC_SLI_REV4)
8379+ lpfc_issue_init_vfi(vport);
8380+ else
8381+ lpfc_initial_flogi(vport);
8382+ } else {
83788383 lpfc_initial_fdisc(vport);
8384+ }
83798385 break;
83808386 }
83818387 } else {
drivers/scsi/lpfc/lpfc_hbadisc.c+13−11
@@ -313,8 +313,7 @@ lpfc_dev_loss_tmo_handler(struct lpfc_nodelist *ndlp) · 312 unmodified lines
313313 ndlp->nlp_state, ndlp->nlp_rpi);
314314 }
315315
316− if (!(vport->load_flag & FC_UNLOADING) &&
317− !(ndlp->nlp_flag & NLP_DELAY_TMO) &&
316+ if (!(ndlp->nlp_flag & NLP_DELAY_TMO) &&
318317 !(ndlp->nlp_flag & NLP_NPR_2B_DISC) &&
319318 (ndlp->nlp_state != NLP_STE_UNMAPPED_NODE) &&
320319 (ndlp->nlp_state != NLP_STE_REG_LOGIN_ISSUE) &&
@@ -641,6 +640,8 @@ lpfc_work_done(struct lpfc_hba *phba) · 320 unmodified lines
641640 lpfc_handle_rrq_active(phba);
642641 if (phba->hba_flag & FCP_XRI_ABORT_EVENT)
643642 lpfc_sli4_fcp_xri_abort_event_proc(phba);
643+ if (phba->hba_flag & NVME_XRI_ABORT_EVENT)
644+ lpfc_sli4_nvme_xri_abort_event_proc(phba);
644645 if (phba->hba_flag & ELS_XRI_ABORT_EVENT)
645646 lpfc_sli4_els_xri_abort_event_proc(phba);
646647 if (phba->hba_flag & ASYNC_EVENT)
@@ -2173,7 +2174,7 @@ lpfc_mbx_cmpl_fcf_scan_read_fcf_rec(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq) · 1526 unmodified lines
21732174 uint32_t boot_flag, addr_mode;
21742175 uint16_t fcf_index, next_fcf_index;
21752176 struct lpfc_fcf_rec *fcf_rec = NULL;
2176− uint16_t vlan_id;
2177+ uint16_t vlan_id = LPFC_FCOE_NULL_VID;
21772178 bool select_new_fcf;
21782179 int rc;
21792180
@@ -4020,9 +4021,11 @@ lpfc_register_remote_port(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) · 1840 unmodified lines
40204021 rdata = rport->dd_data;
40214022 /* break the link before dropping the ref */
40224023 ndlp->rport = NULL;
4023− if (rdata && rdata->pnode == ndlp)
4024− lpfc_nlp_put(ndlp);
4025− rdata->pnode = NULL;
4024+ if (rdata) {
4025+ if (rdata->pnode == ndlp)
4026+ lpfc_nlp_put(ndlp);
4027+ rdata->pnode = NULL;
4028+ }
40264029 /* drop reference for earlier registeration */
40274030 put_device(&rport->dev);
40284031 }
@@ -4344,9 +4347,8 @@ lpfc_initialize_node(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, · 315 unmodified lines
43444347 {
43454348 INIT_LIST_HEAD(&ndlp->els_retry_evt.evt_listp);
43464349 INIT_LIST_HEAD(&ndlp->dev_loss_evt.evt_listp);
4347− init_timer(&ndlp->nlp_delayfunc);
4348− ndlp->nlp_delayfunc.function = lpfc_els_retry_delay;
4349− ndlp->nlp_delayfunc.data = (unsigned long)ndlp;
4350+ setup_timer(&ndlp->nlp_delayfunc, lpfc_els_retry_delay,
4351+ (unsigned long)ndlp);
43504352 ndlp->nlp_DID = did;
43514353 ndlp->vport = vport;
43524354 ndlp->phba = vport->phba;
@@ -4606,9 +4608,9 @@ lpfc_sli4_dequeue_nport_iocbs(struct lpfc_hba *phba, · 253 unmodified lines
46064608 pring = qp->pring;
46074609 if (!pring)
46084610 continue;
4609− spin_lock_irq(&pring->ring_lock);
4611+ spin_lock(&pring->ring_lock);
46104612 __lpfc_dequeue_nport_iocbs(phba, ndlp, pring, dequeue_list);
4611− spin_unlock_irq(&pring->ring_lock);
4613+ spin_unlock(&pring->ring_lock);
46124614 }
46134615 spin_unlock_irq(&phba->hbalock);
46144616 }
drivers/scsi/lpfc/lpfc_hw4.h+2−2
@@ -1001,7 +1001,7 @@ struct eq_delay_info { · 1000 unmodified lines
10011001 uint32_t phase;
10021002 uint32_t delay_multi;
10031003 };
1004−#define LPFC_MAX_EQ_DELAY 8
1004+#define LPFC_MAX_EQ_DELAY_EQID_CNT 8
10051005
10061006 struct sgl_page_pairs {
10071007 uint32_t sgl_pg0_addr_lo;
@@ -1070,7 +1070,7 @@ struct lpfc_mbx_modify_eq_delay { · 62 unmodified lines
10701070 union {
10711071 struct {
10721072 uint32_t num_eq;
1073− struct eq_delay_info eq[LPFC_MAX_EQ_DELAY];
1073+ struct eq_delay_info eq[LPFC_MAX_EQ_DELAY_EQID_CNT];
10741074 } request;
10751075 struct {
10761076 uint32_t word0;
drivers/scsi/lpfc/lpfc_init.c+92−43
@@ -3555,6 +3555,44 @@ out_free_mem: · 3554 unmodified lines
35553555 return rc;
35563556 }
35573557
3558+static uint64_t
3559+lpfc_get_wwpn(struct lpfc_hba *phba)
3560+{
3561+ uint64_t wwn;
3562+ int rc;
3563+ LPFC_MBOXQ_t *mboxq;
3564+ MAILBOX_t *mb;
3565+
3566+
3567+ mboxq = (LPFC_MBOXQ_t *) mempool_alloc(phba->mbox_mem_pool,
3568+ GFP_KERNEL);
3569+ if (!mboxq)
3570+ return (uint64_t)-1;
3571+
3572+ /* First get WWN of HBA instance */
3573+ lpfc_read_nv(phba, mboxq);
3574+ rc = lpfc_sli_issue_mbox(phba, mboxq, MBX_POLL);
3575+ if (rc != MBX_SUCCESS) {
3576+ lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
3577+ "6019 Mailbox failed , mbxCmd x%x "
3578+ "READ_NV, mbxStatus x%x\n",
3579+ bf_get(lpfc_mqe_command, &mboxq->u.mqe),
3580+ bf_get(lpfc_mqe_status, &mboxq->u.mqe));
3581+ mempool_free(mboxq, phba->mbox_mem_pool);
3582+ return (uint64_t) -1;
3583+ }
3584+ mb = &mboxq->u.mb;
3585+ memcpy(&wwn, (char *)mb->un.varRDnvp.portname, sizeof(uint64_t));
3586+ /* wwn is WWPN of HBA instance */
3587+ mempool_free(mboxq, phba->mbox_mem_pool);
3588+ if (phba->sli_rev == LPFC_SLI_REV4)
3589+ return be64_to_cpu(wwn);
3590+ else
3591+ return (((wwn & 0xffffffff00000000) >> 32) |
3592+ ((wwn & 0x00000000ffffffff) << 32));
3593+
3594+}
3595+
35583596 /**
35593597 * lpfc_sli4_nvme_sgl_update - update xri-sgl sizing and mapping
35603598 * @phba: pointer to lpfc hba data structure.
@@ -3676,17 +3714,32 @@ lpfc_create_port(struct lpfc_hba *phba, int instance, struct device *dev) · 115 unmodified lines
36763714 struct lpfc_vport *vport;
36773715 struct Scsi_Host *shost = NULL;
36783716 int error = 0;
3717+ int i;
3718+ uint64_t wwn;
3719+ bool use_no_reset_hba = false;
3720+
3721+ wwn = lpfc_get_wwpn(phba);
3722+
3723+ for (i = 0; i < lpfc_no_hba_reset_cnt; i++) {
3724+ if (wwn == lpfc_no_hba_reset[i]) {
3725+ lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
3726+ "6020 Setting use_no_reset port=%llx\n",
3727+ wwn);
3728+ use_no_reset_hba = true;
3729+ break;
3730+ }
3731+ }
36793732
36803733 if (phba->cfg_enable_fc4_type & LPFC_ENABLE_FCP) {
36813734 if (dev != &phba->pcidev->dev) {
36823735 shost = scsi_host_alloc(&lpfc_vport_template,
36833736 sizeof(struct lpfc_vport));
36843737 } else {
3685− if (phba->sli_rev == LPFC_SLI_REV4)
3738+ if (!use_no_reset_hba)
36863739 shost = scsi_host_alloc(&lpfc_template,
36873740 sizeof(struct lpfc_vport));
36883741 else
3689− shost = scsi_host_alloc(&lpfc_template_s3,
3742+ shost = scsi_host_alloc(&lpfc_template_no_hr,
36903743 sizeof(struct lpfc_vport));
36913744 }
36923745 } else if (phba->cfg_enable_fc4_type & LPFC_ENABLE_NVME) {
@@ -3734,17 +3787,14 @@ lpfc_create_port(struct lpfc_hba *phba, int instance, struct device *dev) · 41 unmodified lines
37343787 INIT_LIST_HEAD(&vport->rcv_buffer_list);
37353788 spin_lock_init(&vport->work_port_lock);
37363789
3737− init_timer(&vport->fc_disctmo);
3738− vport->fc_disctmo.function = lpfc_disc_timeout;
3739− vport->fc_disctmo.data = (unsigned long)vport;
3790+ setup_timer(&vport->fc_disctmo, lpfc_disc_timeout,
3791+ (unsigned long)vport);
37403792
3741− init_timer(&vport->els_tmofunc);
3742− vport->els_tmofunc.function = lpfc_els_timeout;
3743− vport->els_tmofunc.data = (unsigned long)vport;
3793+ setup_timer(&vport->els_tmofunc, lpfc_els_timeout,
3794+ (unsigned long)vport);
37443795
3745− init_timer(&vport->delayed_disc_tmo);
3746− vport->delayed_disc_tmo.function = lpfc_delayed_disc_tmo;
3747− vport->delayed_disc_tmo.data = (unsigned long)vport;
3796+ setup_timer(&vport->delayed_disc_tmo, lpfc_delayed_disc_tmo,
3797+ (unsigned long)vport);
37483798
37493799 error = scsi_add_host_with_dma(shost, dev, &phba->pcidev->dev);
37503800 if (error)
@@ -5406,21 +5456,15 @@ lpfc_setup_driver_resource_phase1(struct lpfc_hba *phba) · 1655 unmodified lines
54065456 INIT_LIST_HEAD(&phba->luns);
54075457
54085458 /* MBOX heartbeat timer */
5409− init_timer(&psli->mbox_tmo);
5410− psli->mbox_tmo.function = lpfc_mbox_timeout;
5411− psli->mbox_tmo.data = (unsigned long) phba;
5459+ setup_timer(&psli->mbox_tmo, lpfc_mbox_timeout, (unsigned long)phba);
54125460 /* Fabric block timer */
5413− init_timer(&phba->fabric_block_timer);
5414− phba->fabric_block_timer.function = lpfc_fabric_block_timeout;
5415− phba->fabric_block_timer.data = (unsigned long) phba;
5461+ setup_timer(&phba->fabric_block_timer, lpfc_fabric_block_timeout,
5462+ (unsigned long)phba);
54165463 /* EA polling mode timer */
5417− init_timer(&phba->eratt_poll);
5418− phba->eratt_poll.function = lpfc_poll_eratt;
5419− phba->eratt_poll.data = (unsigned long) phba;
5464+ setup_timer(&phba->eratt_poll, lpfc_poll_eratt,
5465+ (unsigned long)phba);
54205466 /* Heartbeat timer */
5421− init_timer(&phba->hb_tmofunc);
5422− phba->hb_tmofunc.function = lpfc_hb_timeout;
5423− phba->hb_tmofunc.data = (unsigned long)phba;
5467+ setup_timer(&phba->hb_tmofunc, lpfc_hb_timeout, (unsigned long)phba);
54245468
54255469 return 0;
54265470 }
@@ -5446,9 +5490,8 @@ lpfc_sli_driver_resource_setup(struct lpfc_hba *phba) · 19 unmodified lines
54465490 */
54475491
54485492 /* FCP polling mode timer */
5449− init_timer(&phba->fcp_poll_timer);
5450− phba->fcp_poll_timer.function = lpfc_poll_timeout;
5451− phba->fcp_poll_timer.data = (unsigned long) phba;
5493+ setup_timer(&phba->fcp_poll_timer, lpfc_poll_timeout,
5494+ (unsigned long)phba);
54525495
54535496 /* Host attention work mask setup */
54545497 phba->work_ha_mask = (HA_ERATT | HA_MBATT | HA_LATT);
@@ -5482,7 +5525,8 @@ lpfc_sli_driver_resource_setup(struct lpfc_hba *phba) · 27 unmodified lines
54825525
54835526 /* Initialize the host templates the configured values. */
54845527 lpfc_vport_template.sg_tablesize = phba->cfg_sg_seg_cnt;
5485− lpfc_template_s3.sg_tablesize = phba->cfg_sg_seg_cnt;
5528+ lpfc_template_no_hr.sg_tablesize = phba->cfg_sg_seg_cnt;
5529+ lpfc_template.sg_tablesize = phba->cfg_sg_seg_cnt;
54865530
54875531 /* There are going to be 2 reserved BDEs: 1 FCP cmnd + 1 FCP rsp */
54885532 if (phba->cfg_enable_bg) {
@@ -5617,14 +5661,11 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba) · 128 unmodified lines
56175661 * Initialize timers used by driver
56185662 */
56195663
5620− init_timer(&phba->rrq_tmr);
5621− phba->rrq_tmr.function = lpfc_rrq_timeout;
5622− phba->rrq_tmr.data = (unsigned long)phba;
5664+ setup_timer(&phba->rrq_tmr, lpfc_rrq_timeout, (unsigned long)phba);
56235665
56245666 /* FCF rediscover timer */
5625− init_timer(&phba->fcf.redisc_wait);
5626− phba->fcf.redisc_wait.function = lpfc_sli4_fcf_redisc_wait_tmo;
5627− phba->fcf.redisc_wait.data = (unsigned long)phba;
5667+ setup_timer(&phba->fcf.redisc_wait, lpfc_sli4_fcf_redisc_wait_tmo,
5668+ (unsigned long)phba);
56285669
56295670 /*
56305671 * Control structure for handling external multi-buffer mailbox
@@ -5706,6 +5747,7 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba) · 75 unmodified lines
57065747 /* Initialize the host templates with the updated values. */
57075748 lpfc_vport_template.sg_tablesize = phba->cfg_sg_seg_cnt;
57085749 lpfc_template.sg_tablesize = phba->cfg_sg_seg_cnt;
5750+ lpfc_template_no_hr.sg_tablesize = phba->cfg_sg_seg_cnt;
57095751
57105752 if (phba->cfg_sg_dma_buf_size <= LPFC_MIN_SG_SLI4_BUF_SZ)
57115753 phba->cfg_sg_dma_buf_size = LPFC_MIN_SG_SLI4_BUF_SZ;
@@ -5736,6 +5778,8 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba) · 24 unmodified lines
57365778 /* Initialize the Abort nvme buffer list used by driver */
57375779 spin_lock_init(&phba->sli4_hba.abts_nvme_buf_list_lock);
57385780 INIT_LIST_HEAD(&phba->sli4_hba.lpfc_abts_nvme_buf_list);
5781+ /* Fast-path XRI aborted CQ Event work queue list */
5782+ INIT_LIST_HEAD(&phba->sli4_hba.sp_nvme_xri_aborted_work_queue);
57395783 }
57405784
57415785 /* This abort list used by worker thread */
@@ -5847,10 +5891,17 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba) · 105 unmodified lines
58475891 /* Check to see if it matches any module parameter */
58485892 for (i = 0; i < lpfc_enable_nvmet_cnt; i++) {
58495893 if (wwn == lpfc_enable_nvmet[i]) {
5894+#if (IS_ENABLED(CONFIG_NVME_TARGET_FC))
58505895 lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
58515896 "6017 NVME Target %016llx\n",
58525897 wwn);
58535898 phba->nvmet_support = 1; /* a match */
5899+#else
5900+ lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
5901+ "6021 Can't enable NVME Target."
5902+ " NVME_TARGET_FC infrastructure"
5903+ " is not in kernel\n");
5904+#endif
58545905 }
58555906 }
58565907 }
@@ -8712,12 +8763,9 @@ lpfc_sli4_queue_setup(struct lpfc_hba *phba) · 2855 unmodified lines
87128763 }
87138764 }
87148765
8715− /*
8716− * Configure EQ delay multipier for interrupt coalescing using
8717− * MODIFY_EQ_DELAY for all EQs created, LPFC_MAX_EQ_DELAY at a time.
8718− */
8719− for (qidx = 0; qidx < io_channel; qidx += LPFC_MAX_EQ_DELAY)
8766+ for (qidx = 0; qidx < io_channel; qidx += LPFC_MAX_EQ_DELAY_EQID_CNT)
87208767 lpfc_modify_hba_eq_delay(phba, qidx);
8768+
87218769 return 0;
87228770
87238771 out_destroy:
@@ -8973,6 +9021,11 @@ lpfc_sli4_cq_event_release_all(struct lpfc_hba *phba) · 249 unmodified lines
89739021 /* Pending ELS XRI abort events */
89749022 list_splice_init(&phba->sli4_hba.sp_els_xri_aborted_work_queue,
89759023 &cqelist);
9024+ if (phba->cfg_enable_fc4_type & LPFC_ENABLE_NVME) {
9025+ /* Pending NVME XRI abort events */
9026+ list_splice_init(&phba->sli4_hba.sp_nvme_xri_aborted_work_queue,
9027+ &cqelist);
9028+ }
89769029 /* Pending asynnc events */
89779030 list_splice_init(&phba->sli4_hba.sp_asynce_work_queue,
89789031 &cqelist);
@@ -10400,12 +10453,7 @@ lpfc_pci_remove_one_s3(struct pci_dev *pdev) · 1421 unmodified lines
1040010453 fc_remove_host(shost);
1040110454 scsi_remove_host(shost);
1040210455
10403− /* Perform ndlp cleanup on the physical port. The nvme and nvmet
10404− * localports are destroyed after to cleanup all transport memory.
10405− */
1040610456 lpfc_cleanup(vport);
10407− lpfc_nvmet_destroy_targetport(phba);
10408− lpfc_nvme_destroy_localport(vport);
1040910457
1041010458 /*
1041110459 * Bring down the SLI Layer. This step disable all interrupts,
@@ -12018,6 +12066,7 @@ static struct pci_driver lpfc_driver = { · 1606 unmodified lines
1201812066 .id_table = lpfc_id_table,
1201912067 .probe = lpfc_pci_probe_one,
1202012068 .remove = lpfc_pci_remove_one,
12069+ .shutdown = lpfc_pci_remove_one,
1202112070 .suspend = lpfc_pci_suspend_one,
1202212071 .resume = lpfc_pci_resume_one,
1202312072 .err_handler = &lpfc_err_handler,
drivers/scsi/lpfc/lpfc_mem.c+1−1
@@ -646,7 +646,6 @@ lpfc_sli4_nvmet_alloc(struct lpfc_hba *phba) · 645 unmodified lines
646646 }
647647
648648 dma_buf->iocbq = lpfc_sli_get_iocbq(phba);
649− dma_buf->iocbq->iocb_flag = LPFC_IO_NVMET;
650649 if (!dma_buf->iocbq) {
651650 kfree(dma_buf->context);
652651 pci_pool_free(phba->lpfc_drb_pool, dma_buf->dbuf.virt,
@@ -658,6 +657,7 @@ lpfc_sli4_nvmet_alloc(struct lpfc_hba *phba) · 5 unmodified lines
658657 "2621 Ran out of nvmet iocb/WQEs\n");
659658 return NULL;
660659 }
660+ dma_buf->iocbq->iocb_flag = LPFC_IO_NVMET;
661661 nvmewqe = dma_buf->iocbq;
662662 wqe = (union lpfc_wqe128 *)&nvmewqe->wqe;
663663 /* Initialize WQE */
drivers/scsi/lpfc/lpfc_nvme.c+82−25
@@ -316,7 +316,7 @@ lpfc_nvme_gen_req(struct lpfc_vport *vport, struct lpfc_dmabuf *bmp, · 315 unmodified lines
316316 bf_set(wqe_dfctl, &wqe->gen_req.wge_ctl, 0);
317317 bf_set(wqe_si, &wqe->gen_req.wge_ctl, 1);
318318 bf_set(wqe_la, &wqe->gen_req.wge_ctl, 1);
319− bf_set(wqe_rctl, &wqe->gen_req.wge_ctl, FC_RCTL_DD_UNSOL_CTL);
319+ bf_set(wqe_rctl, &wqe->gen_req.wge_ctl, FC_RCTL_ELS4_REQ);
320320 bf_set(wqe_type, &wqe->gen_req.wge_ctl, FC_TYPE_NVME);
321321
322322 /* Word 6 */
@@ -620,15 +620,15 @@ lpfc_nvme_adj_fcp_sgls(struct lpfc_vport *vport, · 297 unmodified lines
620620 * Embed the payload in the last half of the WQE
621621 * WQE words 16-30 get the NVME CMD IU payload
622622 *
623− * WQE Word 16 is already setup with flags
624− * WQE words 17-19 get payload Words 2-4
623+ * WQE words 16-19 get payload Words 1-4
625624 * WQE words 20-21 get payload Words 6-7
626625 * WQE words 22-29 get payload Words 16-23
627626 */
628− wptr = &wqe->words[17]; /* WQE ptr */
627+ wptr = &wqe->words[16]; /* WQE ptr */
629628 dptr = (uint32_t *)nCmd->cmdaddr; /* payload ptr */
630− dptr += 2; /* Skip Words 0-1 in payload */
629+ dptr++; /* Skip Word 0 in payload */
631630
631+ *wptr++ = *dptr++; /* Word 1 */
632632 *wptr++ = *dptr++; /* Word 2 */
633633 *wptr++ = *dptr++; /* Word 3 */
634634 *wptr++ = *dptr++; /* Word 4 */
@@ -978,9 +978,6 @@ lpfc_nvme_prep_io_cmd(struct lpfc_vport *vport, · 343 unmodified lines
978978 bf_set(wqe_cmd_type, &wqe->generic.wqe_com,
979979 NVME_WRITE_CMD);
980980
981− /* Word 16 */
982− wqe->words[16] = LPFC_NVME_EMBED_WRITE;
983−
984981 phba->fc4NvmeOutputRequests++;
985982 } else {
986983 /* Word 7 */
@@ -1002,9 +999,6 @@ lpfc_nvme_prep_io_cmd(struct lpfc_vport *vport, · 15 unmodified lines
1002999 bf_set(wqe_cmd_type, &wqe->generic.wqe_com,
10031000 NVME_READ_CMD);
10041001
1005− /* Word 16 */
1006− wqe->words[16] = LPFC_NVME_EMBED_READ;
1007−
10081002 phba->fc4NvmeInputRequests++;
10091003 }
10101004 } else {
@@ -1026,9 +1020,6 @@ lpfc_nvme_prep_io_cmd(struct lpfc_vport *vport, · 15 unmodified lines
10261020 /* Word 11 */
10271021 bf_set(wqe_cmd_type, &wqe->generic.wqe_com, NVME_READ_CMD);
10281022
1029− /* Word 16 */
1030− wqe->words[16] = LPFC_NVME_EMBED_CMD;
1031−
10321023 phba->fc4NvmeControlRequests++;
10331024 }
10341025 /*
@@ -1286,6 +1277,7 @@ lpfc_nvme_fcp_io_submit(struct nvme_fc_local_port *pnvme_lport, · 251 unmodified lines
12861277 pnvme_fcreq->private = (void *)lpfc_ncmd;
12871278 lpfc_ncmd->nvmeCmd = pnvme_fcreq;
12881279 lpfc_ncmd->nrport = rport;
1280+ lpfc_ncmd->ndlp = ndlp;
12891281 lpfc_ncmd->start_time = jiffies;
12901282
12911283 lpfc_nvme_prep_io_cmd(vport, lpfc_ncmd, ndlp);
@@ -1319,7 +1311,7 @@ lpfc_nvme_fcp_io_submit(struct nvme_fc_local_port *pnvme_lport, · 27 unmodified lines
13191311 "sid: x%x did: x%x oxid: x%x\n",
13201312 ret, vport->fc_myDID, ndlp->nlp_DID,
13211313 lpfc_ncmd->cur_iocbq.sli4_xritag);
1322− ret = -EINVAL;
1314+ ret = -EBUSY;
13231315 goto out_free_nvme_buf;
13241316 }
13251317
@@ -1821,10 +1813,10 @@ lpfc_post_nvme_sgl_list(struct lpfc_hba *phba, · 495 unmodified lines
18211813 pdma_phys_sgl1, cur_xritag);
18221814 if (status) {
18231815 /* failure, put on abort nvme list */
1824− lpfc_ncmd->exch_busy = 1;
1816+ lpfc_ncmd->flags |= LPFC_SBUF_XBUSY;
18251817 } else {
18261818 /* success, put on NVME buffer list */
1827− lpfc_ncmd->exch_busy = 0;
1819+ lpfc_ncmd->flags &= ~LPFC_SBUF_XBUSY;
18281820 lpfc_ncmd->status = IOSTAT_SUCCESS;
18291821 num_posted++;
18301822 }
@@ -1854,10 +1846,10 @@ lpfc_post_nvme_sgl_list(struct lpfc_hba *phba, · 23 unmodified lines
18541846 struct lpfc_nvme_buf, list);
18551847 if (status) {
18561848 /* failure, put on abort nvme list */
1857− lpfc_ncmd->exch_busy = 1;
1849+ lpfc_ncmd->flags |= LPFC_SBUF_XBUSY;
18581850 } else {
18591851 /* success, put on NVME buffer list */
1860− lpfc_ncmd->exch_busy = 0;
1852+ lpfc_ncmd->flags &= ~LPFC_SBUF_XBUSY;
18611853 lpfc_ncmd->status = IOSTAT_SUCCESS;
18621854 num_posted++;
18631855 }
@@ -2099,7 +2091,7 @@ lpfc_release_nvme_buf(struct lpfc_hba *phba, struct lpfc_nvme_buf *lpfc_ncmd) · 235 unmodified lines
20992091 unsigned long iflag = 0;
21002092
21012093 lpfc_ncmd->nonsg_phys = 0;
2102− if (lpfc_ncmd->exch_busy) {
2094+ if (lpfc_ncmd->flags & LPFC_SBUF_XBUSY) {
21032095 spin_lock_irqsave(&phba->sli4_hba.abts_nvme_buf_list_lock,
21042096 iflag);
21052097 lpfc_ncmd->nvmeCmd = NULL;
@@ -2135,11 +2127,12 @@ lpfc_release_nvme_buf(struct lpfc_hba *phba, struct lpfc_nvme_buf *lpfc_ncmd) · 29 unmodified lines
21352127 int
21362128 lpfc_nvme_create_localport(struct lpfc_vport *vport)
21372129 {
2130+ int ret = 0;
21382131 struct lpfc_hba *phba = vport->phba;
21392132 struct nvme_fc_port_info nfcp_info;
21402133 struct nvme_fc_local_port *localport;
21412134 struct lpfc_nvme_lport *lport;
2142− int len, ret = 0;
2135+ int len;
21432136
21442137 /* Initialize this localport instance. The vport wwn usage ensures
21452138 * that NPIV is accounted for.
@@ -2156,8 +2149,12 @@ lpfc_nvme_create_localport(struct lpfc_vport *vport) · 10 unmodified lines
21562149 /* localport is allocated from the stack, but the registration
21572150 * call allocates heap memory as well as the private area.
21582151 */
2152+#if (IS_ENABLED(CONFIG_NVME_FC))
21592153 ret = nvme_fc_register_localport(&nfcp_info, &lpfc_nvme_template,
21602154 &vport->phba->pcidev->dev, &localport);
2155+#else
2156+ ret = -ENOMEM;
2157+#endif
21612158 if (!ret) {
21622159 lpfc_printf_vlog(vport, KERN_INFO, LOG_NVME | LOG_NVME_DISC,
21632160 "6005 Successfully registered local "
@@ -2173,10 +2170,10 @@ lpfc_nvme_create_localport(struct lpfc_vport *vport) · 9 unmodified lines
21732170 lport->vport = vport;
21742171 INIT_LIST_HEAD(&lport->rport_list);
21752172 vport->nvmei_support = 1;
2173+ len = lpfc_new_nvme_buf(vport, phba->sli4_hba.nvme_xri_max);
2174+ vport->phba->total_nvme_bufs += len;
21762175 }
21772176
2178− len = lpfc_new_nvme_buf(vport, phba->sli4_hba.nvme_xri_max);
2179− vport->phba->total_nvme_bufs += len;
21802177 return ret;
21812178 }
21822179
@@ -2193,6 +2190,7 @@ lpfc_nvme_create_localport(struct lpfc_vport *vport) · 10 unmodified lines
21932190 void
21942191 lpfc_nvme_destroy_localport(struct lpfc_vport *vport)
21952192 {
2193+#if (IS_ENABLED(CONFIG_NVME_FC))
21962194 struct nvme_fc_local_port *localport;
21972195 struct lpfc_nvme_lport *lport;
21982196 struct lpfc_nvme_rport *rport = NULL, *rport_next = NULL;
@@ -2208,7 +2206,6 @@ lpfc_nvme_destroy_localport(struct lpfc_vport *vport) · 9 unmodified lines
22082206 lpfc_printf_vlog(vport, KERN_INFO, LOG_NVME,
22092207 "6011 Destroying NVME localport %p\n",
22102208 localport);
2211−
22122209 list_for_each_entry_safe(rport, rport_next, &lport->rport_list, list) {
22132210 /* The last node ref has to get released now before the rport
22142211 * private memory area is released by the transport.
@@ -2222,6 +2219,7 @@ lpfc_nvme_destroy_localport(struct lpfc_vport *vport) · 7 unmodified lines
22222219 "6008 rport fail destroy %x\n", ret);
22232220 wait_for_completion_timeout(&rport->rport_unreg_done, 5);
22242221 }
2222+
22252223 /* lport's rport list is clear. Unregister
22262224 * lport and release resources.
22272225 */
@@ -2245,6 +2243,7 @@ lpfc_nvme_destroy_localport(struct lpfc_vport *vport) · 17 unmodified lines
22452243 "Failed, status x%x\n",
22462244 ret);
22472245 }
2246+#endif
22482247 }
22492248
22502249 void
@@ -2275,6 +2274,7 @@ lpfc_nvme_update_localport(struct lpfc_vport *vport) · 24 unmodified lines
22752274 int
22762275 lpfc_nvme_register_port(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp)
22772276 {
2277+#if (IS_ENABLED(CONFIG_NVME_FC))
22782278 int ret = 0;
22792279 struct nvme_fc_local_port *localport;
22802280 struct lpfc_nvme_lport *lport;
@@ -2348,7 +2348,6 @@ lpfc_nvme_register_port(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) · 67 unmodified lines
23482348 rpinfo.port_role |= FC_PORT_ROLE_NVME_INITIATOR;
23492349 rpinfo.port_name = wwn_to_u64(ndlp->nlp_portname.u.wwn);
23502350 rpinfo.node_name = wwn_to_u64(ndlp->nlp_nodename.u.wwn);
2351−
23522351 ret = nvme_fc_register_remoteport(localport, &rpinfo,
23532352 &remote_port);
23542353 if (!ret) {
@@ -2384,6 +2383,9 @@ lpfc_nvme_register_port(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) · 29 unmodified lines
23842383 ndlp->nlp_type, ndlp->nlp_DID, ndlp);
23852384 }
23862385 return ret;
2386+#else
2387+ return 0;
2388+#endif
23872389 }
23882390
23892391 /* lpfc_nvme_unregister_port - unbind the DID and port_role from this rport.
@@ -2401,6 +2403,7 @@ lpfc_nvme_register_port(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) · 11 unmodified lines
24012403 void
24022404 lpfc_nvme_unregister_port(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp)
24032405 {
2406+#if (IS_ENABLED(CONFIG_NVME_FC))
24042407 int ret;
24052408 struct nvme_fc_local_port *localport;
24062409 struct lpfc_nvme_lport *lport;
@@ -2458,7 +2461,61 @@ lpfc_nvme_unregister_port(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) · 51 unmodified lines
24582461 return;
24592462
24602463 input_err:
2464+#endif
24612465 lpfc_printf_vlog(vport, KERN_ERR, LOG_NVME_DISC,
24622466 "6168: State error: lport %p, rport%p FCID x%06x\n",
24632467 vport->localport, ndlp->rport, ndlp->nlp_DID);
24642468 }
2469+
2470+/**
2471+ * lpfc_sli4_nvme_xri_aborted - Fast-path process of NVME xri abort
2472+ * @phba: pointer to lpfc hba data structure.
2473+ * @axri: pointer to the fcp xri abort wcqe structure.
2474+ *
2475+ * This routine is invoked by the worker thread to process a SLI4 fast-path
2476+ * FCP aborted xri.
2477+ **/
2478+void
2479+lpfc_sli4_nvme_xri_aborted(struct lpfc_hba *phba,
2480+ struct sli4_wcqe_xri_aborted *axri)
2481+{
2482+ uint16_t xri = bf_get(lpfc_wcqe_xa_xri, axri);
2483+ uint16_t rxid = bf_get(lpfc_wcqe_xa_remote_xid, axri);
2484+ struct lpfc_nvme_buf *lpfc_ncmd, *next_lpfc_ncmd;
2485+ struct lpfc_nodelist *ndlp;
2486+ unsigned long iflag = 0;
2487+ int rrq_empty = 0;
2488+
2489+ if (!(phba->cfg_enable_fc4_type & LPFC_ENABLE_NVME))
2490+ return;
2491+ spin_lock_irqsave(&phba->hbalock, iflag);
2492+ spin_lock(&phba->sli4_hba.abts_nvme_buf_list_lock);
2493+ list_for_each_entry_safe(lpfc_ncmd, next_lpfc_ncmd,
2494+ &phba->sli4_hba.lpfc_abts_nvme_buf_list,
2495+ list) {
2496+ if (lpfc_ncmd->cur_iocbq.sli4_xritag == xri) {
2497+ list_del(&lpfc_ncmd->list);
2498+ lpfc_ncmd->flags &= ~LPFC_SBUF_XBUSY;
2499+ lpfc_ncmd->status = IOSTAT_SUCCESS;
2500+ spin_unlock(
2501+ &phba->sli4_hba.abts_nvme_buf_list_lock);
2502+
2503+ rrq_empty = list_empty(&phba->active_rrq_list);
2504+ spin_unlock_irqrestore(&phba->hbalock, iflag);
2505+ ndlp = lpfc_ncmd->ndlp;
2506+ if (ndlp) {
2507+ lpfc_set_rrq_active(
2508+ phba, ndlp,
2509+ lpfc_ncmd->cur_iocbq.sli4_lxritag,
2510+ rxid, 1);
2511+ lpfc_sli4_abts_err_handler(phba, ndlp, axri);
2512+ }
2513+ lpfc_release_nvme_buf(phba, lpfc_ncmd);
2514+ if (rrq_empty)
2515+ lpfc_worker_wake_up(phba);
2516+ return;
2517+ }
2518+ }
2519+ spin_unlock(&phba->sli4_hba.abts_nvme_buf_list_lock);
2520+ spin_unlock_irqrestore(&phba->hbalock, iflag);
2521+}
drivers/scsi/lpfc/lpfc_nvme.h+1−0
@@ -57,6 +57,7 @@ struct lpfc_nvme_buf { · 56 unmodified lines
5757 struct list_head list;
5858 struct nvmefc_fcp_req *nvmeCmd;
5959 struct lpfc_nvme_rport *nrport;
60+ struct lpfc_nodelist *ndlp;
6061
6162 uint32_t timeout;
6263
drivers/scsi/lpfc/lpfc_nvmet.c+35−8
@@ -571,6 +571,7 @@ lpfc_nvmet_xmt_fcp_op(struct nvmet_fc_target_port *tgtport, · 570 unmodified lines
571571 lpfc_printf_log(phba, KERN_ERR, LOG_NVME_IOERR,
572572 "6102 Bad state IO x%x aborted\n",
573573 ctxp->oxid);
574+ rc = -ENXIO;
574575 goto aerr;
575576 }
576577
@@ -580,6 +581,7 @@ lpfc_nvmet_xmt_fcp_op(struct nvmet_fc_target_port *tgtport, · 3 unmodified lines
580581 lpfc_printf_log(phba, KERN_ERR, LOG_NVME_IOERR,
581582 "6152 FCP Drop IO x%x: Prep\n",
582583 ctxp->oxid);
584+ rc = -ENXIO;
583585 goto aerr;
584586 }
585587
@@ -618,8 +620,9 @@ lpfc_nvmet_xmt_fcp_op(struct nvmet_fc_target_port *tgtport, · 32 unmodified lines
618620 ctxp->wqeq->hba_wqidx = 0;
619621 nvmewqeq->context2 = NULL;
620622 nvmewqeq->context3 = NULL;
623+ rc = -EBUSY;
621624 aerr:
622− return -ENXIO;
625+ return rc;
623626 }
624627
625628 static void
@@ -668,9 +671,13 @@ lpfc_nvmet_create_targetport(struct lpfc_hba *phba) · 42 unmodified lines
668671 lpfc_tgttemplate.target_features = NVMET_FCTGTFEAT_READDATA_RSP |
669672 NVMET_FCTGTFEAT_NEEDS_CMD_CPUSCHED;
670673
674+#if (IS_ENABLED(CONFIG_NVME_TARGET_FC))
671675 error = nvmet_fc_register_targetport(&pinfo, &lpfc_tgttemplate,
672676 &phba->pcidev->dev,
673677 &phba->targetport);
678+#else
679+ error = -ENOMEM;
680+#endif
674681 if (error) {
675682 lpfc_printf_log(phba, KERN_ERR, LOG_NVME_DISC,
676683 "6025 Cannot register NVME targetport "
@@ -731,9 +738,25 @@ lpfc_nvmet_update_targetport(struct lpfc_hba *phba) · 54 unmodified lines
731738 return 0;
732739 }
733740
741+/**
742+ * lpfc_sli4_nvmet_xri_aborted - Fast-path process of nvmet xri abort
743+ * @phba: pointer to lpfc hba data structure.
744+ * @axri: pointer to the nvmet xri abort wcqe structure.
745+ *
746+ * This routine is invoked by the worker thread to process a SLI4 fast-path
747+ * NVMET aborted xri.
748+ **/
749+void
750+lpfc_sli4_nvmet_xri_aborted(struct lpfc_hba *phba,
751+ struct sli4_wcqe_xri_aborted *axri)
752+{
753+ /* TODO: work in progress */
754+}
755+
734756 void
735757 lpfc_nvmet_destroy_targetport(struct lpfc_hba *phba)
736758 {
759+#if (IS_ENABLED(CONFIG_NVME_TARGET_FC))
737760 struct lpfc_nvmet_tgtport *tgtp;
738761
739762 if (phba->nvmet_support == 0)
@@ -745,6 +768,7 @@ lpfc_nvmet_destroy_targetport(struct lpfc_hba *phba) · 5 unmodified lines
745768 wait_for_completion_timeout(&tgtp->tport_unreg_done, 5);
746769 }
747770 phba->targetport = NULL;
771+#endif
748772 }
749773
750774 /**
@@ -764,6 +788,7 @@ static void · 13 unmodified lines
764788 lpfc_nvmet_unsol_ls_buffer(struct lpfc_hba *phba, struct lpfc_sli_ring *pring,
765789 struct hbq_dmabuf *nvmebuf)
766790 {
791+#if (IS_ENABLED(CONFIG_NVME_TARGET_FC))
767792 struct lpfc_nvmet_tgtport *tgtp;
768793 struct fc_frame_header *fc_hdr;
769794 struct lpfc_nvmet_rcv_ctx *ctxp;
@@ -844,6 +869,7 @@ dropit: · 74 unmodified lines
844869
845870 atomic_inc(&tgtp->xmt_ls_abort);
846871 lpfc_nvmet_unsol_ls_issue_abort(phba, ctxp, sid, oxid);
872+#endif
847873 }
848874
849875 /**
@@ -865,6 +891,7 @@ lpfc_nvmet_unsol_fcp_buffer(struct lpfc_hba *phba, · 15 unmodified lines
865891 struct rqb_dmabuf *nvmebuf,
866892 uint64_t isr_timestamp)
867893 {
894+#if (IS_ENABLED(CONFIG_NVME_TARGET_FC))
868895 struct lpfc_nvmet_rcv_ctx *ctxp;
869896 struct lpfc_nvmet_tgtport *tgtp;
870897 struct fc_frame_header *fc_hdr;
@@ -955,7 +982,7 @@ lpfc_nvmet_unsol_fcp_buffer(struct lpfc_hba *phba, · 84 unmodified lines
955982
956983 atomic_inc(&tgtp->rcv_fcp_cmd_drop);
957984 lpfc_printf_log(phba, KERN_ERR, LOG_NVME_IOERR,
958− "6159 FCP Drop IO x%x: nvmet_fc_rcv_fcp_req x%x\n",
985+ "6159 FCP Drop IO x%x: err x%x\n",
959986 ctxp->oxid, rc);
960987 dropit:
961988 lpfc_nvmeio_data(phba, "NVMET FCP DROP: xri x%x sz %d from %06x\n",
@@ -970,6 +997,7 @@ dropit: · 8 unmodified lines
970997 /* We assume a rcv'ed cmd ALWAYs fits into 1 buffer */
971998 lpfc_nvmet_rq_post(phba, NULL, &nvmebuf->hbuf);
972999 }
1000+#endif
9731001 }
9741002
9751003 /**
@@ -1114,7 +1142,7 @@ lpfc_nvmet_prep_ls_wqe(struct lpfc_hba *phba, · 138 unmodified lines
11141142 bf_set(wqe_dfctl, &wqe->xmit_sequence.wge_ctl, 0);
11151143 bf_set(wqe_ls, &wqe->xmit_sequence.wge_ctl, 1);
11161144 bf_set(wqe_la, &wqe->xmit_sequence.wge_ctl, 0);
1117− bf_set(wqe_rctl, &wqe->xmit_sequence.wge_ctl, FC_RCTL_DD_SOL_CTL);
1145+ bf_set(wqe_rctl, &wqe->xmit_sequence.wge_ctl, FC_RCTL_ELS4_REP);
11181146 bf_set(wqe_type, &wqe->xmit_sequence.wge_ctl, FC_TYPE_NVME);
11191147
11201148 /* Word 6 */
@@ -1445,7 +1473,6 @@ lpfc_nvmet_prep_fcp_wqe(struct lpfc_hba *phba, · 324 unmodified lines
14451473
14461474 case NVMET_FCOP_RSP:
14471475 /* Words 0 - 2 */
1448− sgel = &rsp->sg[0];
14491476 physaddr = rsp->rspdma;
14501477 wqe->fcp_trsp.bde.tus.f.bdeFlags = BUFF_TYPE_BDE_64;
14511478 wqe->fcp_trsp.bde.tus.f.bdeSize = rsp->rsplen;
@@ -1681,8 +1708,8 @@ lpfc_nvmet_unsol_issue_abort(struct lpfc_hba *phba, · 229 unmodified lines
16811708 struct lpfc_nodelist *ndlp;
16821709
16831710 lpfc_printf_log(phba, KERN_INFO, LOG_NVME_ABTS,
1684− "6067 %s: Entrypoint: sid %x xri %x\n", __func__,
1685− sid, xri);
1711+ "6067 Abort: sid %x xri x%x/x%x\n",
1712+ sid, xri, ctxp->wqeq->sli4_xritag);
16861713
16871714 tgtp = (struct lpfc_nvmet_tgtport *)phba->targetport->private;
16881715
@@ -1693,7 +1720,7 @@ lpfc_nvmet_unsol_issue_abort(struct lpfc_hba *phba, · 4 unmodified lines
16931720 atomic_inc(&tgtp->xmt_abort_rsp_error);
16941721 lpfc_printf_log(phba, KERN_WARNING, LOG_NVME_ABTS,
16951722 "6134 Drop ABTS - wrong NDLP state x%x.\n",
1696− ndlp->nlp_state);
1723+ (ndlp) ? ndlp->nlp_state : NLP_STE_MAX_STATE);
16971724
16981725 /* No failure to an ABTS request. */
16991726 return 0;
@@ -1791,7 +1818,7 @@ lpfc_nvmet_sol_fcp_issue_abort(struct lpfc_hba *phba, · 91 unmodified lines
17911818 atomic_inc(&tgtp->xmt_abort_rsp_error);
17921819 lpfc_printf_log(phba, KERN_WARNING, LOG_NVME_ABTS,
17931820 "6160 Drop ABTS - wrong NDLP state x%x.\n",
1794− ndlp->nlp_state);
1821+ (ndlp) ? ndlp->nlp_state : NLP_STE_MAX_STATE);
17951822
17961823 /* No failure to an ABTS request. */
17971824 return 0;
drivers/scsi/lpfc/lpfc_scsi.c+2−2
@@ -5953,12 +5953,13 @@ struct scsi_host_template lpfc_template_nvme = { · 5952 unmodified lines
59535953 .track_queue_depth = 0,
59545954 };
59555955
5956−struct scsi_host_template lpfc_template_s3 = {
5956+struct scsi_host_template lpfc_template_no_hr = {
59575957 .module = THIS_MODULE,
59585958 .name = LPFC_DRIVER_NAME,
59595959 .proc_name = LPFC_DRIVER_NAME,
59605960 .info = lpfc_info,
59615961 .queuecommand = lpfc_queuecommand,
5962+ .eh_timed_out = fc_eh_timed_out,
59625963 .eh_abort_handler = lpfc_abort_handler,
59635964 .eh_device_reset_handler = lpfc_device_reset_handler,
59645965 .eh_target_reset_handler = lpfc_target_reset_handler,
@@ -6015,7 +6016,6 @@ struct scsi_host_template lpfc_vport_template = { · 50 unmodified lines
60156016 .eh_abort_handler = lpfc_abort_handler,
60166017 .eh_device_reset_handler = lpfc_device_reset_handler,
60176018 .eh_target_reset_handler = lpfc_target_reset_handler,
6018− .eh_bus_reset_handler = lpfc_bus_reset_handler,
60196019 .slave_alloc = lpfc_slave_alloc,
60206020 .slave_configure = lpfc_slave_configure,
60216021 .slave_destroy = lpfc_slave_destroy,
drivers/scsi/lpfc/lpfc_sli.c+59−9
@@ -1,3 +1,4 @@
1+
12 /*******************************************************************
23 * This file is part of the Emulex Linux Device Driver for *
34 * Fibre Channel Host Bus Adapters. *
@@ -952,7 +953,7 @@ __lpfc_sli_get_els_sglq(struct lpfc_hba *phba, struct lpfc_iocbq *piocbq) · 948 unmodified lines
952953 start_sglq = sglq;
953954 while (!found) {
954955 if (!sglq)
955− return NULL;
956+ break;
956957 if (ndlp && ndlp->active_rrqs_xri_bitmap &&
957958 test_bit(sglq->sli4_lxritag,
958959 ndlp->active_rrqs_xri_bitmap)) {
@@ -12212,6 +12213,41 @@ void lpfc_sli4_fcp_xri_abort_event_proc(struct lpfc_hba *phba) · 11253 unmodified lines
1221212213 }
1221312214 }
1221412215
12216+/**
12217+ * lpfc_sli4_nvme_xri_abort_event_proc - Process nvme xri abort event
12218+ * @phba: pointer to lpfc hba data structure.
12219+ *
12220+ * This routine is invoked by the worker thread to process all the pending
12221+ * SLI4 NVME abort XRI events.
12222+ **/
12223+void lpfc_sli4_nvme_xri_abort_event_proc(struct lpfc_hba *phba)
12224+{
12225+ struct lpfc_cq_event *cq_event;
12226+
12227+ /* First, declare the fcp xri abort event has been handled */
12228+ spin_lock_irq(&phba->hbalock);
12229+ phba->hba_flag &= ~NVME_XRI_ABORT_EVENT;
12230+ spin_unlock_irq(&phba->hbalock);
12231+ /* Now, handle all the fcp xri abort events */
12232+ while (!list_empty(&phba->sli4_hba.sp_nvme_xri_aborted_work_queue)) {
12233+ /* Get the first event from the head of the event queue */
12234+ spin_lock_irq(&phba->hbalock);
12235+ list_remove_head(&phba->sli4_hba.sp_nvme_xri_aborted_work_queue,
12236+ cq_event, struct lpfc_cq_event, list);
12237+ spin_unlock_irq(&phba->hbalock);
12238+ /* Notify aborted XRI for NVME work queue */
12239+ if (phba->nvmet_support) {
12240+ lpfc_sli4_nvmet_xri_aborted(phba,
12241+ &cq_event->cqe.wcqe_axri);
12242+ } else {
12243+ lpfc_sli4_nvme_xri_aborted(phba,
12244+ &cq_event->cqe.wcqe_axri);
12245+ }
12246+ /* Free the event processed back to the free pool */
12247+ lpfc_sli4_cq_event_release(phba, cq_event);
12248+ }
12249+}
12250+
1221512251 /**
1221612252 * lpfc_sli4_els_xri_abort_event_proc - Process els xri abort event
1221712253 * @phba: pointer to lpfc hba data structure.
@@ -12709,10 +12745,22 @@ lpfc_sli4_sp_handle_abort_xri_wcqe(struct lpfc_hba *phba, · 491 unmodified lines
1270912745 spin_unlock_irqrestore(&phba->hbalock, iflags);
1271012746 workposted = true;
1271112747 break;
12748+ case LPFC_NVME:
12749+ spin_lock_irqsave(&phba->hbalock, iflags);
12750+ list_add_tail(&cq_event->list,
12751+ &phba->sli4_hba.sp_nvme_xri_aborted_work_queue);
12752+ /* Set the nvme xri abort event flag */
12753+ phba->hba_flag |= NVME_XRI_ABORT_EVENT;
12754+ spin_unlock_irqrestore(&phba->hbalock, iflags);
12755+ workposted = true;
12756+ break;
1271212757 default:
1271312758 lpfc_printf_log(phba, KERN_ERR, LOG_SLI,
12714− "0603 Invalid work queue CQE subtype (x%x)\n",
12715− cq->subtype);
12759+ "0603 Invalid CQ subtype %d: "
12760+ "%08x %08x %08x %08x\n",
12761+ cq->subtype, wcqe->word0, wcqe->parameter,
12762+ wcqe->word2, wcqe->word3);
12763+ lpfc_sli4_cq_event_release(phba, cq_event);
1271612764 workposted = false;
1271712765 break;
1271812766 }
@@ -13827,6 +13875,8 @@ lpfc_dual_chute_pci_bar_map(struct lpfc_hba *phba, uint16_t pci_barset) · 1108 unmodified lines
1382713875 * @startq: The starting FCP EQ to modify
1382813876 *
1382913877 * This function sends an MODIFY_EQ_DELAY mailbox command to the HBA.
13878+ * The command allows up to LPFC_MAX_EQ_DELAY_EQID_CNT EQ ID's to be
13879+ * updated in one mailbox command.
1383013880 *
1383113881 * The @phba struct is used to send mailbox command to HBA. The @startq
1383213882 * is used to get the starting FCP EQ to change.
@@ -13879,7 +13929,7 @@ lpfc_modify_hba_eq_delay(struct lpfc_hba *phba, uint32_t startq) · 46 unmodified lines
1387913929 eq_delay->u.request.eq[cnt].phase = 0;
1388013930 eq_delay->u.request.eq[cnt].delay_multi = dmult;
1388113931 cnt++;
13882− if (cnt >= LPFC_MAX_EQ_DELAY)
13932+ if (cnt >= LPFC_MAX_EQ_DELAY_EQID_CNT)
1388313933 break;
1388413934 }
1388513935 eq_delay->u.request.num_eq = cnt;
@@ -15185,17 +15235,17 @@ lpfc_mrq_create(struct lpfc_hba *phba, struct lpfc_queue **hrqp, · 1299 unmodified lines
1518515235 drq = drqp[idx];
1518615236 cq = cqp[idx];
1518715237
15188− if (hrq->entry_count != drq->entry_count) {
15189− status = -EINVAL;
15190− goto out;
15191− }
15192−
1519315238 /* sanity check on queue memory */
1519415239 if (!hrq || !drq || !cq) {
1519515240 status = -ENODEV;
1519615241 goto out;
1519715242 }
1519815243
15244+ if (hrq->entry_count != drq->entry_count) {
15245+ status = -EINVAL;
15246+ goto out;
15247+ }
15248+
1519915249 if (idx == 0) {
1520015250 bf_set(lpfc_mbx_rq_create_num_pages,
1520115251 &rq_create->u.request,
drivers/scsi/lpfc/lpfc_sli4.h+6−0
@@ -642,6 +642,7 @@ struct lpfc_sli4_hba { · 641 unmodified lines
642642 struct list_head sp_asynce_work_queue;
643643 struct list_head sp_fcp_xri_aborted_work_queue;
644644 struct list_head sp_els_xri_aborted_work_queue;
645+ struct list_head sp_nvme_xri_aborted_work_queue;
645646 struct list_head sp_unsol_work_queue;
646647 struct lpfc_sli4_link link_state;
647648 struct lpfc_sli4_lnk_info lnk_info;
@@ -794,9 +795,14 @@ void lpfc_sli4_fcf_redisc_event_proc(struct lpfc_hba *); · 146 unmodified lines
794795 int lpfc_sli4_resume_rpi(struct lpfc_nodelist *,
795796 void (*)(struct lpfc_hba *, LPFC_MBOXQ_t *), void *);
796797 void lpfc_sli4_fcp_xri_abort_event_proc(struct lpfc_hba *);
798+void lpfc_sli4_nvme_xri_abort_event_proc(struct lpfc_hba *phba);
797799 void lpfc_sli4_els_xri_abort_event_proc(struct lpfc_hba *);
798800 void lpfc_sli4_fcp_xri_aborted(struct lpfc_hba *,
799801 struct sli4_wcqe_xri_aborted *);
802+void lpfc_sli4_nvme_xri_aborted(struct lpfc_hba *phba,
803+ struct sli4_wcqe_xri_aborted *axri);
804+void lpfc_sli4_nvmet_xri_aborted(struct lpfc_hba *phba,
805+ struct sli4_wcqe_xri_aborted *axri);
800806 void lpfc_sli4_els_xri_aborted(struct lpfc_hba *,
801807 struct sli4_wcqe_xri_aborted *);
802808 void lpfc_sli4_vport_delete_els_xri_aborted(struct lpfc_vport *);
drivers/scsi/lpfc/lpfc_version.h+1−1
@@ -20,7 +20,7 @@ · 19 unmodified lines
2020 * included with this package. *
2121 *******************************************************************/
2222
23−#define LPFC_DRIVER_VERSION "11.2.0.7"
23+#define LPFC_DRIVER_VERSION "11.2.0.10"
2424 #define LPFC_DRIVER_NAME "lpfc"
2525
2626 /* Used for SLI 2/3 */
drivers/scsi/megaraid/megaraid_sas.h+2−2
@@ -35,8 +35,8 @@ · 34 unmodified lines
3535 /*
3636 * MegaRAID SAS Driver meta data
3737 */
38−#define MEGASAS_VERSION "07.701.16.00-rc1"
39−#define MEGASAS_RELDATE "February 2, 2017"
38+#define MEGASAS_VERSION "07.701.17.00-rc1"
39+#define MEGASAS_RELDATE "March 2, 2017"
4040
4141 /*
4242 * Device IDs
drivers/scsi/megaraid/megaraid_sas_base.c+12−5
@@ -1963,6 +1963,9 @@ scan_target: · 1962 unmodified lines
19631963 if (!mr_device_priv_data)
19641964 return -ENOMEM;
19651965 sdev->hostdata = mr_device_priv_data;
1966+
1967+ atomic_set(&mr_device_priv_data->r1_ldio_hint,
1968+ instance->r1_ldio_hint_default);
19661969 return 0;
19671970 }
19681971
@@ -5034,10 +5037,12 @@ megasas_setup_irqs_msix(struct megasas_instance *instance, u8 is_probe) · 3065 unmodified lines
50345037 &instance->irq_context[j]);
50355038 /* Retry irq register for IO_APIC*/
50365039 instance->msix_vectors = 0;
5037− if (is_probe)
5040+ if (is_probe) {
5041+ pci_free_irq_vectors(instance->pdev);
50385042 return megasas_setup_irqs_ioapic(instance);
5039− else
5043+ } else {
50405044 return -1;
5045+ }
50415046 }
50425047 }
50435048 return 0;
@@ -5277,9 +5282,11 @@ static int megasas_init_fw(struct megasas_instance *instance) · 233 unmodified lines
52775282 MPI2_REPLY_POST_HOST_INDEX_OFFSET);
52785283 }
52795284
5280− i = pci_alloc_irq_vectors(instance->pdev, 1, 1, PCI_IRQ_LEGACY);
5281− if (i < 0)
5282− goto fail_setup_irqs;
5285+ if (!instance->msix_vectors) {
5286+ i = pci_alloc_irq_vectors(instance->pdev, 1, 1, PCI_IRQ_LEGACY);
5287+ if (i < 0)
5288+ goto fail_setup_irqs;
5289+ }
52835290
52845291 dev_info(&instance->pdev->dev,
52855292 "firmware supports msix\t: (%d)", fw_msix_count);
drivers/scsi/megaraid/megaraid_sas_fusion.c+2−2
@@ -2159,7 +2159,7 @@ megasas_set_raidflag_cpu_affinity(union RAID_CONTEXT_UNION *praid_context, · 2158 unmodified lines
21592159 cpu_sel = MR_RAID_CTX_CPUSEL_1;
21602160
21612161 if (is_stream_detected(rctx_g35) &&
2162− (raid->level == 5) &&
2162+ ((raid->level == 5) || (raid->level == 6)) &&
21632163 (raid->writeMode == MR_RL_WRITE_THROUGH_MODE) &&
21642164 (cpu_sel == MR_RAID_CTX_CPUSEL_FCFS))
21652165 cpu_sel = MR_RAID_CTX_CPUSEL_0;
@@ -2338,7 +2338,7 @@ megasas_build_ldio_fusion(struct megasas_instance *instance, · 172 unmodified lines
23382338 fp_possible = false;
23392339 atomic_dec(&instance->fw_outstanding);
23402340 } else if ((scsi_buff_len > MR_LARGE_IO_MIN_SIZE) ||
2341− atomic_dec_if_positive(&mrdev_priv->r1_ldio_hint)) {
2341+ (atomic_dec_if_positive(&mrdev_priv->r1_ldio_hint) > 0)) {
23422342 fp_possible = false;
23432343 atomic_dec(&instance->fw_outstanding);
23442344 if (scsi_buff_len > MR_LARGE_IO_MIN_SIZE)
drivers/scsi/mpt3sas/mpt3sas_base.h+0−3
@@ -1442,9 +1442,6 @@ void mpt3sas_transport_update_links(struct MPT3SAS_ADAPTER *ioc, · 1441 unmodified lines
14421442 u64 sas_address, u16 handle, u8 phy_number, u8 link_rate);
14431443 extern struct sas_function_template mpt3sas_transport_functions;
14441444 extern struct scsi_transport_template *mpt3sas_transport_template;
1445−extern int scsi_internal_device_block(struct scsi_device *sdev);
1446−extern int scsi_internal_device_unblock(struct scsi_device *sdev,
1447− enum scsi_device_state new_state);
14481445 /* trigger data externs */
14491446 void mpt3sas_send_trigger_data_event(struct MPT3SAS_ADAPTER *ioc,
14501447 struct SL_WH_TRIGGERS_EVENT_DATA_T *event_data);
drivers/scsi/mpt3sas/mpt3sas_scsih.c+2−17
@@ -2859,7 +2859,7 @@ _scsih_internal_device_block(struct scsi_device *sdev, · 2858 unmodified lines
28592859 sas_device_priv_data->sas_target->handle);
28602860 sas_device_priv_data->block = 1;
28612861
2862− r = scsi_internal_device_block(sdev);
2862+ r = scsi_internal_device_block(sdev, false);
28632863 if (r == -EINVAL)
28642864 sdev_printk(KERN_WARNING, sdev,
28652865 "device_block failed with return(%d) for handle(0x%04x)\n",
@@ -2895,7 +2895,7 @@ _scsih_internal_device_unblock(struct scsi_device *sdev, · 29 unmodified lines
28952895 "performing a block followed by an unblock\n",
28962896 r, sas_device_priv_data->sas_target->handle);
28972897 sas_device_priv_data->block = 1;
2898− r = scsi_internal_device_block(sdev);
2898+ r = scsi_internal_device_block(sdev, false);
28992899 if (r)
29002900 sdev_printk(KERN_WARNING, sdev, "retried device_block "
29012901 "failed with return(%d) for handle(0x%04x)\n",
@@ -4677,7 +4677,6 @@ _scsih_io_done(struct MPT3SAS_ADAPTER *ioc, u16 smid, u8 msix_index, u32 reply) · 1775 unmodified lines
46774677 struct MPT3SAS_DEVICE *sas_device_priv_data;
46784678 u32 response_code = 0;
46794679 unsigned long flags;
4680− unsigned int sector_sz;
46814680
46824681 mpi_reply = mpt3sas_base_get_reply_virt_addr(ioc, reply);
46834682
@@ -4742,20 +4741,6 @@ _scsih_io_done(struct MPT3SAS_ADAPTER *ioc, u16 smid, u8 msix_index, u32 reply) · 58 unmodified lines
47424741 }
47434742
47444743 xfer_cnt = le32_to_cpu(mpi_reply->TransferCount);
4745−
4746− /* In case of bogus fw or device, we could end up having
4747− * unaligned partial completion. We can force alignment here,
4748− * then scsi-ml does not need to handle this misbehavior.
4749− */
4750− sector_sz = scmd->device->sector_size;
4751− if (unlikely(!blk_rq_is_passthrough(scmd->request) && sector_sz &&
4752− xfer_cnt % sector_sz)) {
4753− sdev_printk(KERN_INFO, scmd->device,
4754− "unaligned partial completion avoided (xfer_cnt=%u, sector_sz=%u)\n",
4755− xfer_cnt, sector_sz);
4756− xfer_cnt = round_down(xfer_cnt, sector_sz);
4757− }
4758−
47594744 scsi_set_resid(scmd, scsi_bufflen(scmd) - xfer_cnt);
47604745 if (ioc_status & MPI2_IOCSTATUS_FLAG_LOG_INFO_AVAILABLE)
47614746 log_info = le32_to_cpu(mpi_reply->IOCLogInfo);
drivers/scsi/qedf/qedf_dbg.h+8−5
@@ -81,14 +81,17 @@ struct qedf_dbg_ctx { · 80 unmodified lines
8181 #define QEDF_INFO(pdev, level, fmt, ...) \
8282 qedf_dbg_info(pdev, __func__, __LINE__, level, fmt, \
8383 ## __VA_ARGS__)
84−
85−extern void qedf_dbg_err(struct qedf_dbg_ctx *qedf, const char *func, u32 line,
84+__printf(4, 5)
85+void qedf_dbg_err(struct qedf_dbg_ctx *qedf, const char *func, u32 line,
8686 const char *fmt, ...);
87−extern void qedf_dbg_warn(struct qedf_dbg_ctx *qedf, const char *func, u32 line,
87+__printf(4, 5)
88+void qedf_dbg_warn(struct qedf_dbg_ctx *qedf, const char *func, u32 line,
8889 const char *, ...);
89−extern void qedf_dbg_notice(struct qedf_dbg_ctx *qedf, const char *func,
90+__printf(4, 5)
91+void qedf_dbg_notice(struct qedf_dbg_ctx *qedf, const char *func,
9092 u32 line, const char *, ...);
91−extern void qedf_dbg_info(struct qedf_dbg_ctx *qedf, const char *func, u32 line,
93+__printf(5, 6)
94+void qedf_dbg_info(struct qedf_dbg_ctx *qedf, const char *func, u32 line,
9295 u32 info, const char *fmt, ...);
9396
9497 /* GRC Dump related defines */
drivers/scsi/qedf/qedf_fip.c+1−1
@@ -203,7 +203,7 @@ void qedf_fip_recv(struct qedf_ctx *qedf, struct sk_buff *skb) · 202 unmodified lines
203203 case FIP_DT_MAC:
204204 mp = (struct fip_mac_desc *)desc;
205205 QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_LL2,
206− "fd_mac=%pM.\n", __func__, mp->fd_mac);
206+ "fd_mac=%pM\n", mp->fd_mac);
207207 ether_addr_copy(cvl_mac, mp->fd_mac);
208208 break;
209209 case FIP_DT_NAME:
drivers/scsi/qedf/qedf_io.c+2−2
@@ -1342,7 +1342,7 @@ void qedf_scsi_completion(struct qedf_ctx *qedf, struct fcoe_cqe *cqe, · 1341 unmodified lines
13421342 } else {
13431343 refcount = kref_read(&io_req->refcount);
13441344 QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_IO,
1345− "%d:0:%d:%d xid=0x%0x op=0x%02x "
1345+ "%d:0:%d:%lld xid=0x%0x op=0x%02x "
13461346 "lba=%02x%02x%02x%02x cdb_status=%d "
13471347 "fcp_resid=0x%x refcount=%d.\n",
13481348 qedf->lport->host->host_no, sc_cmd->device->id,
@@ -1426,7 +1426,7 @@ void qedf_scsi_done(struct qedf_ctx *qedf, struct qedf_ioreq *io_req, · 77 unmodified lines
14261426
14271427 sc_cmd->result = result << 16;
14281428 refcount = kref_read(&io_req->refcount);
1429− QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_IO, "%d:0:%d:%d: Completing "
1429+ QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_IO, "%d:0:%d:%lld: Completing "
14301430 "sc_cmd=%p result=0x%08x op=0x%02x lba=0x%02x%02x%02x%02x, "
14311431 "allowed=%d retries=%d refcount=%d.\n",
14321432 qedf->lport->host->host_no, sc_cmd->device->id,
drivers/scsi/qedf/qedf_main.c+2−2
@@ -2456,8 +2456,8 @@ static int qedf_alloc_bdq(struct qedf_ctx *qedf) · 2455 unmodified lines
24562456 }
24572457
24582458 QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_DISC,
2459− "BDQ PBL addr=0x%p dma=0x%llx.\n", qedf->bdq_pbl,
2460− qedf->bdq_pbl_dma);
2459+ "BDQ PBL addr=0x%p dma=%pad\n",
2460+ qedf->bdq_pbl, &qedf->bdq_pbl_dma);
24612461
24622462 /*
24632463 * Populate BDQ PBL with physical and virtual address of individual
drivers/scsi/qedi/qedi_debugfs.c+8−8
@@ -14,7 +14,7 @@ · 13 unmodified lines
1414 #include <linux/debugfs.h>
1515 #include <linux/module.h>
1616
17−int do_not_recover;
17+int qedi_do_not_recover;
1818 static struct dentry *qedi_dbg_root;
1919
2020 void
@@ -74,22 +74,22 @@ qedi_dbg_exit(void) · 53 unmodified lines
7474 static ssize_t
7575 qedi_dbg_do_not_recover_enable(struct qedi_dbg_ctx *qedi_dbg)
7676 {
77− if (!do_not_recover)
78− do_not_recover = 1;
77+ if (!qedi_do_not_recover)
78+ qedi_do_not_recover = 1;
7979
8080 QEDI_INFO(qedi_dbg, QEDI_LOG_DEBUGFS, "do_not_recover=%d\n",
81− do_not_recover);
81+ qedi_do_not_recover);
8282 return 0;
8383 }
8484
8585 static ssize_t
8686 qedi_dbg_do_not_recover_disable(struct qedi_dbg_ctx *qedi_dbg)
8787 {
88− if (do_not_recover)
89− do_not_recover = 0;
88+ if (qedi_do_not_recover)
89+ qedi_do_not_recover = 0;
9090
9191 QEDI_INFO(qedi_dbg, QEDI_LOG_DEBUGFS, "do_not_recover=%d\n",
92− do_not_recover);
92+ qedi_do_not_recover);
9393 return 0;
9494 }
9595
@@ -141,7 +141,7 @@ qedi_dbg_do_not_recover_cmd_read(struct file *filp, char __user *buffer, · 45 unmodified lines
141141 if (*ppos)
142142 return 0;
143143
144− cnt = sprintf(buffer, "do_not_recover=%d\n", do_not_recover);
144+ cnt = sprintf(buffer, "do_not_recover=%d\n", qedi_do_not_recover);
145145 cnt = min_t(int, count, cnt - *ppos);
146146 *ppos += cnt;
147147 return cnt;
drivers/scsi/qedi/qedi_fw.c+2−2
@@ -1461,9 +1461,9 @@ static void qedi_tmf_work(struct work_struct *work) · 1460 unmodified lines
14611461 get_itt(tmf_hdr->rtt), get_itt(ctask->itt), cmd->task_id,
14621462 qedi_conn->iscsi_conn_id);
14631463
1464− if (do_not_recover) {
1464+ if (qedi_do_not_recover) {
14651465 QEDI_ERR(&qedi->dbg_ctx, "DONT SEND CLEANUP/ABORT %d\n",
1466− do_not_recover);
1466+ qedi_do_not_recover);
14671467 goto abort_ret;
14681468 }
14691469
drivers/scsi/qedi/qedi_gbl.h+7−1
@@ -12,8 +12,14 @@ · 11 unmodified lines
1212
1313 #include "qedi_iscsi.h"
1414
15+#ifdef CONFIG_DEBUG_FS
16+extern int qedi_do_not_recover;
17+#else
18+#define qedi_do_not_recover (0)
19+#endif
20+
1521 extern uint qedi_io_tracing;
16−extern int do_not_recover;
22+
1723 extern struct scsi_host_template qedi_host_template;
1824 extern struct iscsi_transport qedi_iscsi_transport;
1925 extern const struct qed_iscsi_ops *qedi_ops;
drivers/scsi/qedi/qedi_iscsi.c+4−4
@@ -833,7 +833,7 @@ qedi_ep_connect(struct Scsi_Host *shost, struct sockaddr *dst_addr, · 832 unmodified lines
833833 return ERR_PTR(ret);
834834 }
835835
836− if (do_not_recover) {
836+ if (qedi_do_not_recover) {
837837 ret = -ENOMEM;
838838 return ERR_PTR(ret);
839839 }
@@ -957,7 +957,7 @@ static int qedi_ep_poll(struct iscsi_endpoint *ep, int timeout_ms) · 117 unmodified lines
957957 struct qedi_endpoint *qedi_ep;
958958 int ret = 0;
959959
960− if (do_not_recover)
960+ if (qedi_do_not_recover)
961961 return 1;
962962
963963 qedi_ep = ep->dd_data;
@@ -1025,7 +1025,7 @@ static void qedi_ep_disconnect(struct iscsi_endpoint *ep) · 61 unmodified lines
10251025 }
10261026
10271027 if (test_bit(QEDI_IN_RECOVERY, &qedi->flags)) {
1028− if (do_not_recover) {
1028+ if (qedi_do_not_recover) {
10291029 QEDI_INFO(&qedi->dbg_ctx, QEDI_LOG_INFO,
10301030 "Do not recover cid=0x%x\n",
10311031 qedi_ep->iscsi_cid);
@@ -1039,7 +1039,7 @@ static void qedi_ep_disconnect(struct iscsi_endpoint *ep) · 7 unmodified lines
10391039 }
10401040 }
10411041
1042− if (do_not_recover)
1042+ if (qedi_do_not_recover)
10431043 goto ep_exit_recover;
10441044
10451045 switch (qedi_ep->state) {
drivers/scsi/qedi/qedi_main.c+1−1
@@ -1805,7 +1805,7 @@ static int __qedi_probe(struct pci_dev *pdev, int mode) · 1804 unmodified lines
18051805 */
18061806 qedi_ops->common->update_pf_params(qedi->cdev, &qedi->pf_params);
18071807
1808− qedi_setup_int(qedi);
1808+ rc = qedi_setup_int(qedi);
18091809 if (rc)
18101810 goto stop_iscsi_func;
18111811
drivers/scsi/qla2xxx/Kconfig+1−0
@@ -3,6 +3,7 @@ config SCSI_QLA_FC · 2 unmodified lines
33 depends on PCI && SCSI
44 depends on SCSI_FC_ATTRS
55 select FW_LOADER
6+ select BTREE
67 ---help---
78 This qla2xxx driver supports all QLogic Fibre Channel
89 PCI and PCIe host adapters.
drivers/scsi/qla2xxx/qla_attr.c+1−3
@@ -2154,8 +2154,6 @@ qla24xx_vport_delete(struct fc_vport *fc_vport) · 2153 unmodified lines
21542154 "Timer for the VP[%d] has stopped\n", vha->vp_idx);
21552155 }
21562156
2157− BUG_ON(atomic_read(&vha->vref_count));
2158−
21592157 qla2x00_free_fcports(vha);
21602158
21612159 mutex_lock(&ha->vport_lock);
@@ -2166,7 +2164,7 @@ qla24xx_vport_delete(struct fc_vport *fc_vport) · 4 unmodified lines
21662164 dma_free_coherent(&ha->pdev->dev, vha->gnl.size, vha->gnl.l,
21672165 vha->gnl.ldma);
21682166
2169− if (vha->qpair->vp_idx == vha->vp_idx) {
2167+ if (vha->qpair && vha->qpair->vp_idx == vha->vp_idx) {
21702168 if (qla2xxx_delete_qpair(vha, vha->qpair) != QLA_SUCCESS)
21712169 ql_log(ql_log_warn, vha, 0x7087,
21722170 "Queue Pair delete failed.\n");
drivers/scsi/qla2xxx/qla_dbg.c+4−8
@@ -2707,13 +2707,9 @@ ql_dump_buffer(uint32_t level, scsi_qla_host_t *vha, int32_t id, · 2706 unmodified lines
27072707 "%-+5d 0 1 2 3 4 5 6 7 8 9 A B C D E F\n", size);
27082708 ql_dbg(level, vha, id,
27092709 "----- -----------------------------------------------\n");
2710− for (cnt = 0; cnt < size; cnt++, buf++) {
2711− if (cnt % 16 == 0)
2712− ql_dbg(level, vha, id, "%04x:", cnt & ~0xFU);
2713− printk(" %02x", *buf);
2714− if (cnt % 16 == 15)
2715− printk("\n");
2710+ for (cnt = 0; cnt < size; cnt += 16) {
2711+ ql_dbg(level, vha, id, "%04x: ", cnt);
2712+ print_hex_dump(KERN_CONT, "", DUMP_PREFIX_NONE, 16, 1,
2713+ buf + cnt, min(16U, size - cnt), false);
27162714 }
2717− if (cnt % 16 != 0)
2718− printk("\n");
27192715 }
drivers/scsi/qla2xxx/qla_dbg.h+1−0
@@ -348,6 +348,7 @@ ql_log_pci(uint32_t, struct pci_dev *pdev, int32_t, const char *fmt, ...); · 347 unmodified lines
348348 #define ql_dbg_tgt 0x00004000 /* Target mode */
349349 #define ql_dbg_tgt_mgt 0x00002000 /* Target mode management */
350350 #define ql_dbg_tgt_tmr 0x00001000 /* Target mode task management */
351+#define ql_dbg_tgt_dif 0x00000800 /* Target mode dif */
351352
352353 extern int qla27xx_dump_mpi_ram(struct qla_hw_data *, uint32_t, uint32_t *,
353354 uint32_t, void **);
drivers/scsi/qla2xxx/qla_def.h+50−6
@@ -25,6 +25,7 @@ · 24 unmodified lines
2525 #include <linux/firmware.h>
2626 #include <linux/aer.h>
2727 #include <linux/mutex.h>
28+#include <linux/btree.h>
2829
2930 #include <scsi/scsi.h>
3031 #include <scsi/scsi_host.h>
@@ -395,11 +396,15 @@ struct srb_iocb { · 364 unmodified lines
395396 struct completion comp;
396397 } abt;
397398 struct ct_arg ctarg;
399+#define MAX_IOCB_MB_REG 28
400+#define SIZEOF_IOCB_MB_REG (MAX_IOCB_MB_REG * sizeof(uint16_t))
398401 struct {
399− __le16 in_mb[28]; /* fr fw */
400− __le16 out_mb[28]; /* to fw */
402+ __le16 in_mb[MAX_IOCB_MB_REG]; /* from FW */
403+ __le16 out_mb[MAX_IOCB_MB_REG]; /* to FW */
401404 void *out, *in;
402405 dma_addr_t out_dma, in_dma;
406+ struct completion comp;
407+ int rc;
403408 } mbx;
404409 struct {
405410 struct imm_ntfy_from_isp *ntfy;
@@ -437,7 +442,7 @@ typedef struct srb { · 31 unmodified lines
437442 uint32_t handle;
438443 uint16_t flags;
439444 uint16_t type;
440− char *name;
445+ const char *name;
441446 int iocbs;
442447 struct qla_qpair *qpair;
443448 u32 gen1; /* scratch */
@@ -2300,6 +2305,8 @@ typedef struct fc_port { · 1856 unmodified lines
23002305 struct ct_sns_desc ct_desc;
23012306 enum discovery_state disc_state;
23022307 enum login_state fw_login_state;
2308+ unsigned long plogi_nack_done_deadline;
2309+
23032310 u32 login_gen, last_login_gen;
23042311 u32 rscn_gen, last_rscn_gen;
23052312 u32 chip_reset;
@@ -3106,6 +3113,16 @@ struct qla_chip_state_84xx { · 800 unmodified lines
31063113 uint32_t gold_fw_version;
31073114 };
31083115
3116+struct qla_dif_statistics {
3117+ uint64_t dif_input_bytes;
3118+ uint64_t dif_output_bytes;
3119+ uint64_t dif_input_requests;
3120+ uint64_t dif_output_requests;
3121+ uint32_t dif_guard_err;
3122+ uint32_t dif_ref_tag_err;
3123+ uint32_t dif_app_tag_err;
3124+};
3125+
31093126 struct qla_statistics {
31103127 uint32_t total_isp_aborts;
31113128 uint64_t input_bytes;
@@ -3118,6 +3135,8 @@ struct qla_statistics { · 6 unmodified lines
31183135 uint32_t stat_max_pend_cmds;
31193136 uint32_t stat_max_qfull_cmds_alloc;
31203137 uint32_t stat_max_qfull_cmds_dropped;
3138+
3139+ struct qla_dif_statistics qla_dif_stats;
31213140 };
31223141
31233142 struct bidi_statistics {
@@ -3125,6 +3144,16 @@ struct bidi_statistics { · 1 unmodified line
31253144 unsigned long long transfer_bytes;
31263145 };
31273146
3147+struct qla_tc_param {
3148+ struct scsi_qla_host *vha;
3149+ uint32_t blk_sz;
3150+ uint32_t bufflen;
3151+ struct scatterlist *sg;
3152+ struct scatterlist *prot_sg;
3153+ struct crc_context *ctx;
3154+ uint8_t *ctx_dsd_alloced;
3155+};
3156+
31283157 /* Multi queue support */
31293158 #define MBC_INITIALIZE_MULTIQ 0x1f
31303159 #define QLA_QUE_PAGE 0X1000
@@ -3272,6 +3301,8 @@ struct qlt_hw_data { · 141 unmodified lines
32723301 uint8_t tgt_node_name[WWN_SIZE];
32733302
32743303 struct dentry *dfs_tgt_sess;
3304+ struct dentry *dfs_tgt_port_database;
3305+
32753306 struct list_head q_full_list;
32763307 uint32_t num_pend_cmds;
32773308 uint32_t num_qfull_cmds_alloc;
@@ -3281,6 +3312,7 @@ struct qlt_hw_data { · 3 unmodified lines
32813312 spinlock_t sess_lock;
32823313 int rspq_vector_cpuid;
32833314 spinlock_t atio_lock ____cacheline_aligned;
3315+ struct btree_head32 host_map;
32843316 };
32853317
32863318 #define MAX_QFULL_CMDS_ALLOC 8192
@@ -3290,6 +3322,10 @@ struct qlt_hw_data { · 3 unmodified lines
32903322
32913323 #define LEAK_EXCHG_THRESH_HOLD_PERCENT 75 /* 75 percent */
32923324
3325+#define QLA_EARLY_LINKUP(_ha) \
3326+ ((_ha->flags.n2n_ae || _ha->flags.lip_ae) && \
3327+ _ha->flags.fw_started && !_ha->flags.fw_init_done)
3328+
32933329 /*
32943330 * Qlogic host adapter specific data structure.
32953331 */
@@ -3339,7 +3375,11 @@ struct qla_hw_data { · 43 unmodified lines
33393375 uint32_t fawwpn_enabled:1;
33403376 uint32_t exlogins_enabled:1;
33413377 uint32_t exchoffld_enabled:1;
3342− /* 35 bits */
3378+
3379+ uint32_t lip_ae:1;
3380+ uint32_t n2n_ae:1;
3381+ uint32_t fw_started:1;
3382+ uint32_t fw_init_done:1;
33433383 } flags;
33443384
33453385 /* This spinlock is used to protect "io transactions", you must
@@ -3432,7 +3472,6 @@ struct qla_hw_data { · 86 unmodified lines
34323472 #define P2P_LOOP 3
34333473 uint8_t interrupts_on;
34343474 uint32_t isp_abort_cnt;
3435−
34363475 #define PCI_DEVICE_ID_QLOGIC_ISP2532 0x2532
34373476 #define PCI_DEVICE_ID_QLOGIC_ISP8432 0x8432
34383477 #define PCI_DEVICE_ID_QLOGIC_ISP8001 0x8001
@@ -3913,6 +3952,7 @@ typedef struct scsi_qla_host { · 474 unmodified lines
39133952 struct list_head vp_fcports; /* list of fcports */
39143953 struct list_head work_list;
39153954 spinlock_t work_lock;
3955+ struct work_struct iocb_work;
39163956
39173957 /* Commonly used flags and state information. */
39183958 struct Scsi_Host *host;
@@ -4076,6 +4116,7 @@ typedef struct scsi_qla_host { · 157 unmodified lines
40764116 /* Count of active session/fcport */
40774117 int fcport_count;
40784118 wait_queue_head_t fcport_waitQ;
4119+ wait_queue_head_t vref_waitq;
40794120 } scsi_qla_host_t;
40804121
40814122 struct qla27xx_image_status {
@@ -4131,14 +4172,17 @@ struct qla2_sgx { · 49 unmodified lines
41314172 mb(); \
41324173 if (__vha->flags.delete_progress) { \
41334174 atomic_dec(&__vha->vref_count); \
4175+ wake_up(&__vha->vref_waitq); \
41344176 __bail = 1; \
41354177 } else { \
41364178 __bail = 0; \
41374179 } \
41384180 } while (0)
41394181
4140−#define QLA_VHA_MARK_NOT_BUSY(__vha) \
4182+#define QLA_VHA_MARK_NOT_BUSY(__vha) do { \
41414183 atomic_dec(&__vha->vref_count); \
4184+ wake_up(&__vha->vref_waitq); \
4185+} while (0) \
41424186
41434187 #define QLA_QPAIR_MARK_BUSY(__qpair, __bail) do { \
41444188 atomic_inc(&__qpair->ref_count); \
drivers/scsi/qla2xxx/qla_dfs.c+103−4
@@ -19,11 +19,11 @@ qla2x00_dfs_tgt_sess_show(struct seq_file *s, void *unused) · 18 unmodified lines
1919 struct qla_hw_data *ha = vha->hw;
2020 unsigned long flags;
2121 struct fc_port *sess = NULL;
22− struct qla_tgt *tgt= vha->vha_tgt.qla_tgt;
22+ struct qla_tgt *tgt = vha->vha_tgt.qla_tgt;
2323
24− seq_printf(s, "%s\n",vha->host_str);
24+ seq_printf(s, "%s\n", vha->host_str);
2525 if (tgt) {
26− seq_printf(s, "Port ID Port Name Handle\n");
26+ seq_puts(s, "Port ID Port Name Handle\n");
2727
2828 spin_lock_irqsave(&ha->tgt.sess_lock, flags);
2929 list_for_each_entry(sess, &vha->vp_fcports, list)
@@ -44,7 +44,6 @@ qla2x00_dfs_tgt_sess_open(struct inode *inode, struct file *file) · 14 unmodified lines
4444 return single_open(file, qla2x00_dfs_tgt_sess_show, vha);
4545 }
4646
47−
4847 static const struct file_operations dfs_tgt_sess_ops = {
4948 .open = qla2x00_dfs_tgt_sess_open,
5049 .read = seq_read,
@@ -52,6 +51,78 @@ static const struct file_operations dfs_tgt_sess_ops = { · 1 unmodified line
5251 .release = single_release,
5352 };
5453
54+static int
55+qla2x00_dfs_tgt_port_database_show(struct seq_file *s, void *unused)
56+{
57+ scsi_qla_host_t *vha = s->private;
58+ struct qla_hw_data *ha = vha->hw;
59+ struct gid_list_info *gid_list;
60+ dma_addr_t gid_list_dma;
61+ fc_port_t fc_port;
62+ char *id_iter;
63+ int rc, i;
64+ uint16_t entries, loop_id;
65+ struct qla_tgt *tgt = vha->vha_tgt.qla_tgt;
66+
67+ seq_printf(s, "%s\n", vha->host_str);
68+ if (tgt) {
69+ gid_list = dma_alloc_coherent(&ha->pdev->dev,
70+ qla2x00_gid_list_size(ha),
71+ &gid_list_dma, GFP_KERNEL);
72+ if (!gid_list) {
73+ ql_dbg(ql_dbg_user, vha, 0x705c,
74+ "DMA allocation failed for %u\n",
75+ qla2x00_gid_list_size(ha));
76+ return 0;
77+ }
78+
79+ rc = qla24xx_gidlist_wait(vha, gid_list, gid_list_dma,
80+ &entries);
81+ if (rc != QLA_SUCCESS)
82+ goto out_free_id_list;
83+
84+ id_iter = (char *)gid_list;
85+
86+ seq_puts(s, "Port Name Port ID Loop ID\n");
87+
88+ for (i = 0; i < entries; i++) {
89+ struct gid_list_info *gid =
90+ (struct gid_list_info *)id_iter;
91+ loop_id = le16_to_cpu(gid->loop_id);
92+ memset(&fc_port, 0, sizeof(fc_port_t));
93+
94+ fc_port.loop_id = loop_id;
95+
96+ rc = qla24xx_gpdb_wait(vha, &fc_port, 0);
97+ seq_printf(s, "%8phC %02x%02x%02x %d\n",
98+ fc_port.port_name, fc_port.d_id.b.domain,
99+ fc_port.d_id.b.area, fc_port.d_id.b.al_pa,
100+ fc_port.loop_id);
101+ id_iter += ha->gid_list_info_size;
102+ }
103+out_free_id_list:
104+ dma_free_coherent(&ha->pdev->dev, qla2x00_gid_list_size(ha),
105+ gid_list, gid_list_dma);
106+ }
107+
108+ return 0;
109+}
110+
111+static int
112+qla2x00_dfs_tgt_port_database_open(struct inode *inode, struct file *file)
113+{
114+ scsi_qla_host_t *vha = inode->i_private;
115+
116+ return single_open(file, qla2x00_dfs_tgt_port_database_show, vha);
117+}
118+
119+static const struct file_operations dfs_tgt_port_database_ops = {
120+ .open = qla2x00_dfs_tgt_port_database_open,
121+ .read = seq_read,
122+ .llseek = seq_lseek,
123+ .release = single_release,
124+};
125+
55126 static int
56127 qla_dfs_fw_resource_cnt_show(struct seq_file *s, void *unused)
57128 {
@@ -114,6 +185,21 @@ qla_dfs_tgt_counters_show(struct seq_file *s, void *unused) · 56 unmodified lines
114185 seq_printf(s, "num Q full sent = %lld\n",
115186 vha->tgt_counters.num_q_full_sent);
116187
188+ /* DIF stats */
189+ seq_printf(s, "DIF Inp Bytes = %lld\n",
190+ vha->qla_stats.qla_dif_stats.dif_input_bytes);
191+ seq_printf(s, "DIF Outp Bytes = %lld\n",
192+ vha->qla_stats.qla_dif_stats.dif_output_bytes);
193+ seq_printf(s, "DIF Inp Req = %lld\n",
194+ vha->qla_stats.qla_dif_stats.dif_input_requests);
195+ seq_printf(s, "DIF Outp Req = %lld\n",
196+ vha->qla_stats.qla_dif_stats.dif_output_requests);
197+ seq_printf(s, "DIF Guard err = %d\n",
198+ vha->qla_stats.qla_dif_stats.dif_guard_err);
199+ seq_printf(s, "DIF Ref tag err = %d\n",
200+ vha->qla_stats.qla_dif_stats.dif_ref_tag_err);
201+ seq_printf(s, "DIF App tag err = %d\n",
202+ vha->qla_stats.qla_dif_stats.dif_app_tag_err);
117203 return 0;
118204 }
119205
@@ -281,6 +367,14 @@ create_nodes: · 161 unmodified lines
281367 goto out;
282368 }
283369
370+ ha->tgt.dfs_tgt_port_database = debugfs_create_file("tgt_port_database",
371+ S_IRUSR, ha->dfs_dir, vha, &dfs_tgt_port_database_ops);
372+ if (!ha->tgt.dfs_tgt_port_database) {
373+ ql_log(ql_log_warn, vha, 0xffff,
374+ "Unable to create debugFS tgt_port_database node.\n");
375+ goto out;
376+ }
377+
284378 ha->dfs_fce = debugfs_create_file("fce", S_IRUSR, ha->dfs_dir, vha,
285379 &dfs_fce_ops);
286380 if (!ha->dfs_fce) {
@@ -311,6 +405,11 @@ qla2x00_dfs_remove(scsi_qla_host_t *vha) · 24 unmodified lines
311405 ha->tgt.dfs_tgt_sess = NULL;
312406 }
313407
408+ if (ha->tgt.dfs_tgt_port_database) {
409+ debugfs_remove(ha->tgt.dfs_tgt_port_database);
410+ ha->tgt.dfs_tgt_port_database = NULL;
411+ }
412+
314413 if (ha->dfs_fw_resource_cnt) {
315414 debugfs_remove(ha->dfs_fw_resource_cnt);
316415 ha->dfs_fw_resource_cnt = NULL;
drivers/scsi/qla2xxx/qla_gbl.h+14−4
@@ -193,6 +193,7 @@ extern int qla24xx_post_upd_fcport_work(struct scsi_qla_host *, fc_port_t *); · 192 unmodified lines
193193 void qla2x00_handle_login_done_event(struct scsi_qla_host *, fc_port_t *,
194194 uint16_t *);
195195 int qla24xx_post_gnl_work(struct scsi_qla_host *, fc_port_t *);
196+int qla24xx_async_abort_cmd(srb_t *);
196197
197198 /*
198199 * Global Functions in qla_mid.c source file.
@@ -256,11 +257,11 @@ extern unsigned long qla2x00_get_async_timeout(struct scsi_qla_host *); · 57 unmodified lines
256257 extern void *qla2x00_alloc_iocbs(scsi_qla_host_t *, srb_t *);
257258 extern int qla2x00_issue_marker(scsi_qla_host_t *, int);
258259 extern int qla24xx_walk_and_build_sglist_no_difb(struct qla_hw_data *, srb_t *,
259− uint32_t *, uint16_t, struct qla_tgt_cmd *);
260+ uint32_t *, uint16_t, struct qla_tc_param *);
260261 extern int qla24xx_walk_and_build_sglist(struct qla_hw_data *, srb_t *,
261− uint32_t *, uint16_t, struct qla_tgt_cmd *);
262+ uint32_t *, uint16_t, struct qla_tc_param *);
262263 extern int qla24xx_walk_and_build_prot_sglist(struct qla_hw_data *, srb_t *,
263− uint32_t *, uint16_t, struct qla_tgt_cmd *);
264+ uint32_t *, uint16_t, struct qla_tc_param *);
264265 extern int qla24xx_get_one_block_sg(uint32_t, struct qla2_sgx *, uint32_t *);
265266 extern int qla24xx_configure_prot_mode(srb_t *, uint16_t *);
266267 extern int qla24xx_build_scsi_crc_2_iocbs(srb_t *,
@@ -368,7 +369,7 @@ qla2x00_get_link_status(scsi_qla_host_t *, uint16_t, struct link_statistics *, · 101 unmodified lines
368369
369370 extern int
370371 qla24xx_get_isp_stats(scsi_qla_host_t *, struct link_statistics *,
371− dma_addr_t, uint);
372+ dma_addr_t, uint16_t);
372373
373374 extern int qla24xx_abort_command(srb_t *);
374375 extern int qla24xx_async_abort_command(srb_t *);
@@ -472,6 +473,13 @@ qla2x00_dump_mctp_data(scsi_qla_host_t *, dma_addr_t, uint32_t, uint32_t); · 97 unmodified lines
472473 extern int
473474 qla26xx_dport_diagnostics(scsi_qla_host_t *, void *, uint, uint);
474475
476+int qla24xx_send_mb_cmd(struct scsi_qla_host *, mbx_cmd_t *);
477+int qla24xx_gpdb_wait(struct scsi_qla_host *, fc_port_t *, u8);
478+int qla24xx_gidlist_wait(struct scsi_qla_host *, void *, dma_addr_t,
479+ uint16_t *);
480+int __qla24xx_parse_gpdb(struct scsi_qla_host *, fc_port_t *,
481+ struct port_database_24xx *);
482+
475483 /*
476484 * Global Function Prototypes in qla_isr.c source file.
477485 */
@@ -846,5 +854,7 @@ extern struct fc_port *qlt_find_sess_invalidate_other(scsi_qla_host_t *, · 368 unmodified lines
846854 uint64_t wwn, port_id_t port_id, uint16_t loop_id, struct fc_port **);
847855 void qla24xx_delete_sess_fn(struct work_struct *);
848856 void qlt_unknown_atio_work_fn(struct work_struct *);
857+void qlt_update_host_map(struct scsi_qla_host *, port_id_t);
858+void qlt_remove_target_resources(struct qla_hw_data *);
849859
850860 #endif /* _QLA_GBL_H */
drivers/scsi/qla2xxx/qla_init.c+31−54
@@ -629,7 +629,6 @@ void qla24xx_async_gpdb_sp_done(void *s, int res) · 628 unmodified lines
629629 struct srb *sp = s;
630630 struct scsi_qla_host *vha = sp->vha;
631631 struct qla_hw_data *ha = vha->hw;
632− uint64_t zero = 0;
633632 struct port_database_24xx *pd;
634633 fc_port_t *fcport = sp->fcport;
635634 u16 *mb = sp->u.iocb_cmd.u.mbx.in_mb;
@@ -649,48 +648,7 @@ void qla24xx_async_gpdb_sp_done(void *s, int res) · 13 unmodified lines
649648
650649 pd = (struct port_database_24xx *)sp->u.iocb_cmd.u.mbx.in;
651650
652− /* Check for logged in state. */
653− if (pd->current_login_state != PDS_PRLI_COMPLETE &&
654− pd->last_login_state != PDS_PRLI_COMPLETE) {
655− ql_dbg(ql_dbg_mbx, vha, 0xffff,
656− "Unable to verify login-state (%x/%x) for "
657− "loop_id %x.\n", pd->current_login_state,
658− pd->last_login_state, fcport->loop_id);
659− rval = QLA_FUNCTION_FAILED;
660− goto gpd_error_out;
661− }
662−
663− if (fcport->loop_id == FC_NO_LOOP_ID ||
664− (memcmp(fcport->port_name, (uint8_t *)&zero, 8) &&
665− memcmp(fcport->port_name, pd->port_name, 8))) {
666− /* We lost the device mid way. */
667− rval = QLA_NOT_LOGGED_IN;
668− goto gpd_error_out;
669− }
670−
671− /* Names are little-endian. */
672− memcpy(fcport->node_name, pd->node_name, WWN_SIZE);
673−
674− /* Get port_id of device. */
675− fcport->d_id.b.domain = pd->port_id[0];
676− fcport->d_id.b.area = pd->port_id[1];
677− fcport->d_id.b.al_pa = pd->port_id[2];
678− fcport->d_id.b.rsvd_1 = 0;
679−
680− /* If not target must be initiator or unknown type. */
681− if ((pd->prli_svc_param_word_3[0] & BIT_4) == 0)
682− fcport->port_type = FCT_INITIATOR;
683− else
684− fcport->port_type = FCT_TARGET;
685−
686− /* Passback COS information. */
687− fcport->supported_classes = (pd->flags & PDF_CLASS_2) ?
688− FC_COS_CLASS2 : FC_COS_CLASS3;
689−
690− if (pd->prli_svc_param_word_3[0] & BIT_7) {
691− fcport->flags |= FCF_CONF_COMP_SUPPORTED;
692− fcport->conf_compl_supported = 1;
693− }
651+ rval = __qla24xx_parse_gpdb(vha, fcport, pd);
694652
695653 gpd_error_out:
696654 memset(&ea, 0, sizeof(ea));
@@ -876,10 +834,14 @@ int qla24xx_fcport_handle_login(struct scsi_qla_host *vha, fc_port_t *fcport) · 179 unmodified lines
876834 fcport->login_retry--;
877835
878836 if ((fcport->fw_login_state == DSC_LS_PLOGI_PEND) ||
879− (fcport->fw_login_state == DSC_LS_PLOGI_COMP) ||
880837 (fcport->fw_login_state == DSC_LS_PRLI_PEND))
881838 return 0;
882839
840+ if (fcport->fw_login_state == DSC_LS_PLOGI_COMP) {
841+ if (time_before_eq(jiffies, fcport->plogi_nack_done_deadline))
842+ return 0;
843+ }
844+
883845 /* for pure Target Mode. Login will not be initiated */
884846 if (vha->host->active_mode == MODE_TARGET)
885847 return 0;
@@ -1041,10 +1003,14 @@ void qla24xx_handle_relogin_event(scsi_qla_host_t *vha, · 155 unmodified lines
10411003 fcport->flags);
10421004
10431005 if ((fcport->fw_login_state == DSC_LS_PLOGI_PEND) ||
1044− (fcport->fw_login_state == DSC_LS_PLOGI_COMP) ||
10451006 (fcport->fw_login_state == DSC_LS_PRLI_PEND))
10461007 return;
10471008
1009+ if (fcport->fw_login_state == DSC_LS_PLOGI_COMP) {
1010+ if (time_before_eq(jiffies, fcport->plogi_nack_done_deadline))
1011+ return;
1012+ }
1013+
10481014 if (fcport->flags & FCF_ASYNC_SENT) {
10491015 fcport->login_retry++;
10501016 set_bit(RELOGIN_NEEDED, &vha->dpc_flags);
@@ -1258,7 +1224,7 @@ qla24xx_abort_sp_done(void *ptr, int res) · 207 unmodified lines
12581224 complete(&abt->u.abt.comp);
12591225 }
12601226
1261−static int
1227+int
12621228 qla24xx_async_abort_cmd(srb_t *cmd_sp)
12631229 {
12641230 scsi_qla_host_t *vha = cmd_sp->vha;
@@ -3212,6 +3178,7 @@ next_check: · 1947 unmodified lines
32123178 } else {
32133179 ql_dbg(ql_dbg_init, vha, 0x00d3,
32143180 "Init Firmware -- success.\n");
3181+ ha->flags.fw_started = 1;
32153182 }
32163183
32173184 return (rval);
@@ -3374,8 +3341,8 @@ qla2x00_configure_hba(scsi_qla_host_t *vha) · 156 unmodified lines
33743341 uint8_t domain;
33753342 char connect_type[22];
33763343 struct qla_hw_data *ha = vha->hw;
3377− unsigned long flags;
33783344 scsi_qla_host_t *base_vha = pci_get_drvdata(ha->pdev);
3345+ port_id_t id;
33793346
33803347 /* Get host addresses. */
33813348 rval = qla2x00_get_adapter_id(vha,
@@ -3453,13 +3420,11 @@ qla2x00_configure_hba(scsi_qla_host_t *vha) · 71 unmodified lines
34533420
34543421 /* Save Host port and loop ID. */
34553422 /* byte order - Big Endian */
3456− vha->d_id.b.domain = domain;
3457− vha->d_id.b.area = area;
3458− vha->d_id.b.al_pa = al_pa;
3459−
3460− spin_lock_irqsave(&ha->vport_slock, flags);
3461− qlt_update_vp_map(vha, SET_AL_PA);
3462− spin_unlock_irqrestore(&ha->vport_slock, flags);
3423+ id.b.domain = domain;
3424+ id.b.area = area;
3425+ id.b.al_pa = al_pa;
3426+ id.b.rsvd_1 = 0;
3427+ qlt_update_host_map(vha, id);
34633428
34643429 if (!vha->flags.init_done)
34653430 ql_log(ql_log_info, vha, 0x2010,
@@ -4036,6 +4001,7 @@ qla2x00_configure_loop(scsi_qla_host_t *vha) · 570 unmodified lines
40364001 atomic_set(&vha->loop_state, LOOP_READY);
40374002 ql_dbg(ql_dbg_disc, vha, 0x2069,
40384003 "LOOP READY.\n");
4004+ ha->flags.fw_init_done = 1;
40394005
40404006 /*
40414007 * Process any ATIO queue entries that came in
@@ -5148,6 +5114,7 @@ qla2x00_update_fcports(scsi_qla_host_t *base_vha) · 1106 unmodified lines
51485114 }
51495115 }
51505116 atomic_dec(&vha->vref_count);
5117+ wake_up(&vha->vref_waitq);
51515118 }
51525119 spin_unlock_irqrestore(&ha->vport_slock, flags);
51535120 }
@@ -5526,6 +5493,11 @@ qla2x00_abort_isp_cleanup(scsi_qla_host_t *vha) · 372 unmodified lines
55265493 if (!(IS_P3P_TYPE(ha)))
55275494 ha->isp_ops->reset_chip(vha);
55285495
5496+ ha->flags.n2n_ae = 0;
5497+ ha->flags.lip_ae = 0;
5498+ ha->current_topology = 0;
5499+ ha->flags.fw_started = 0;
5500+ ha->flags.fw_init_done = 0;
55295501 ha->chip_reset++;
55305502
55315503 atomic_set(&vha->loop_down_timer, LOOP_DOWN_TIME);
@@ -6802,6 +6774,8 @@ qla2x00_try_to_stop_firmware(scsi_qla_host_t *vha) · 1270 unmodified lines
68026774 return;
68036775 if (!ha->fw_major_version)
68046776 return;
6777+ if (!ha->flags.fw_started)
6778+ return;
68056779
68066780 ret = qla2x00_stop_firmware(vha);
68076781 for (retries = 5; ret != QLA_SUCCESS && ret != QLA_FUNCTION_TIMEOUT &&
@@ -6815,6 +6789,9 @@ qla2x00_try_to_stop_firmware(scsi_qla_host_t *vha) · 7 unmodified lines
68156789 "Attempting retry of stop-firmware command.\n");
68166790 ret = qla2x00_stop_firmware(vha);
68176791 }
6792+
6793+ ha->flags.fw_started = 0;
6794+ ha->flags.fw_init_done = 0;
68186795 }
68196796
68206797 int
drivers/scsi/qla2xxx/qla_iocb.c+6−7
@@ -889,7 +889,7 @@ qla24xx_get_one_block_sg(uint32_t blk_sz, struct qla2_sgx *sgx, · 888 unmodified lines
889889
890890 int
891891 qla24xx_walk_and_build_sglist_no_difb(struct qla_hw_data *ha, srb_t *sp,
892− uint32_t *dsd, uint16_t tot_dsds, struct qla_tgt_cmd *tc)
892+ uint32_t *dsd, uint16_t tot_dsds, struct qla_tc_param *tc)
893893 {
894894 void *next_dsd;
895895 uint8_t avail_dsds = 0;
@@ -898,7 +898,6 @@ qla24xx_walk_and_build_sglist_no_difb(struct qla_hw_data *ha, srb_t *sp, · 2 unmodified lines
898898 struct scatterlist *sg_prot;
899899 uint32_t *cur_dsd = dsd;
900900 uint16_t used_dsds = tot_dsds;
901−
902901 uint32_t prot_int; /* protection interval */
903902 uint32_t partial;
904903 struct qla2_sgx sgx;
@@ -966,7 +965,7 @@ alloc_and_fill: · 61 unmodified lines
966965 } else {
967966 list_add_tail(&dsd_ptr->list,
968967 &(tc->ctx->dsd_list));
969− tc->ctx_dsd_alloced = 1;
968+ *tc->ctx_dsd_alloced = 1;
970969 }
971970
972971
@@ -1005,7 +1004,7 @@ alloc_and_fill: · 32 unmodified lines
10051004
10061005 int
10071006 qla24xx_walk_and_build_sglist(struct qla_hw_data *ha, srb_t *sp, uint32_t *dsd,
1008− uint16_t tot_dsds, struct qla_tgt_cmd *tc)
1007+ uint16_t tot_dsds, struct qla_tc_param *tc)
10091008 {
10101009 void *next_dsd;
10111010 uint8_t avail_dsds = 0;
@@ -1066,7 +1065,7 @@ qla24xx_walk_and_build_sglist(struct qla_hw_data *ha, srb_t *sp, uint32_t *dsd, · 54 unmodified lines
10661065 } else {
10671066 list_add_tail(&dsd_ptr->list,
10681067 &(tc->ctx->dsd_list));
1069− tc->ctx_dsd_alloced = 1;
1068+ *tc->ctx_dsd_alloced = 1;
10701069 }
10711070
10721071 /* add new list to cmd iocb or last list */
@@ -1092,7 +1091,7 @@ qla24xx_walk_and_build_sglist(struct qla_hw_data *ha, srb_t *sp, uint32_t *dsd, · 19 unmodified lines
10921091
10931092 int
10941093 qla24xx_walk_and_build_prot_sglist(struct qla_hw_data *ha, srb_t *sp,
1095− uint32_t *dsd, uint16_t tot_dsds, struct qla_tgt_cmd *tc)
1094+ uint32_t *dsd, uint16_t tot_dsds, struct qla_tc_param *tc)
10961095 {
10971096 void *next_dsd;
10981097 uint8_t avail_dsds = 0;
@@ -1158,7 +1157,7 @@ qla24xx_walk_and_build_prot_sglist(struct qla_hw_data *ha, srb_t *sp, · 59 unmodified lines
11581157 } else {
11591158 list_add_tail(&dsd_ptr->list,
11601159 &(tc->ctx->dsd_list));
1161− tc->ctx_dsd_alloced = 1;
1160+ *tc->ctx_dsd_alloced = 1;
11621161 }
11631162
11641163 /* add new list to cmd iocb or last list */
drivers/scsi/qla2xxx/qla_isr.c+33−8
@@ -708,6 +708,8 @@ skip_rio: · 707 unmodified lines
708708 "mbx7=%xh.\n", mb[1], mb[2], mb[3], mbx);
709709
710710 ha->isp_ops->fw_dump(vha, 1);
711+ ha->flags.fw_init_done = 0;
712+ ha->flags.fw_started = 0;
711713
712714 if (IS_FWI2_CAPABLE(ha)) {
713715 if (mb[1] == 0 && mb[2] == 0) {
@@ -761,6 +763,9 @@ skip_rio: · 47 unmodified lines
761763 break;
762764
763765 case MBA_LIP_OCCURRED: /* Loop Initialization Procedure */
766+ ha->flags.lip_ae = 1;
767+ ha->flags.n2n_ae = 0;
768+
764769 ql_dbg(ql_dbg_async, vha, 0x5009,
765770 "LIP occurred (%x).\n", mb[1]);
766771
@@ -797,6 +802,10 @@ skip_rio: · 30 unmodified lines
797802 break;
798803
799804 case MBA_LOOP_DOWN: /* Loop Down Event */
805+ ha->flags.n2n_ae = 0;
806+ ha->flags.lip_ae = 0;
807+ ha->current_topology = 0;
808+
800809 mbx = (IS_QLA81XX(ha) || IS_QLA8031(ha))
801810 ? RD_REG_WORD(&reg24->mailbox4) : 0;
802811 mbx = (IS_P3P_TYPE(ha)) ? RD_REG_WORD(&reg82->mailbox_out[4])
@@ -866,6 +875,9 @@ skip_rio: · 63 unmodified lines
866875
867876 /* case MBA_DCBX_COMPLETE: */
868877 case MBA_POINT_TO_POINT: /* Point-to-Point */
878+ ha->flags.lip_ae = 0;
879+ ha->flags.n2n_ae = 1;
880+
869881 if (IS_QLA2100(ha))
870882 break;
871883
@@ -1620,9 +1632,9 @@ qla24xx_logio_entry(scsi_qla_host_t *vha, struct req_que *req, · 748 unmodified lines
16201632 QLA_LOGIO_LOGIN_RETRIED : 0;
16211633 if (logio->entry_status) {
16221634 ql_log(ql_log_warn, fcport->vha, 0x5034,
1623− "Async-%s error entry - hdl=%x"
1635+ "Async-%s error entry - %8phC hdl=%x"
16241636 "portid=%02x%02x%02x entry-status=%x.\n",
1625− type, sp->handle, fcport->d_id.b.domain,
1637+ type, fcport->port_name, sp->handle, fcport->d_id.b.domain,
16261638 fcport->d_id.b.area, fcport->d_id.b.al_pa,
16271639 logio->entry_status);
16281640 ql_dump_buffer(ql_dbg_async + ql_dbg_buffer, vha, 0x504d,
@@ -1633,8 +1645,9 @@ qla24xx_logio_entry(scsi_qla_host_t *vha, struct req_que *req, · 4 unmodified lines
16331645
16341646 if (le16_to_cpu(logio->comp_status) == CS_COMPLETE) {
16351647 ql_dbg(ql_dbg_async, fcport->vha, 0x5036,
1636− "Async-%s complete - hdl=%x portid=%02x%02x%02x "
1637− "iop0=%x.\n", type, sp->handle, fcport->d_id.b.domain,
1648+ "Async-%s complete - %8phC hdl=%x portid=%02x%02x%02x "
1649+ "iop0=%x.\n", type, fcport->port_name, sp->handle,
1650+ fcport->d_id.b.domain,
16381651 fcport->d_id.b.area, fcport->d_id.b.al_pa,
16391652 le32_to_cpu(logio->io_parameter[0]));
16401653
@@ -1674,6 +1687,17 @@ qla24xx_logio_entry(scsi_qla_host_t *vha, struct req_que *req, · 33 unmodified lines
16741687 case LSC_SCODE_NPORT_USED:
16751688 data[0] = MBS_LOOP_ID_USED;
16761689 break;
1690+ case LSC_SCODE_CMD_FAILED:
1691+ if (iop[1] == 0x0606) {
1692+ /*
1693+ * PLOGI/PRLI Completed. We must have Recv PLOGI/PRLI,
1694+ * Target side acked.
1695+ */
1696+ data[0] = MBS_COMMAND_COMPLETE;
1697+ goto logio_done;
1698+ }
1699+ data[0] = MBS_COMMAND_ERROR;
1700+ break;
16771701 case LSC_SCODE_NOXCB:
16781702 vha->hw->exch_starvation++;
16791703 if (vha->hw->exch_starvation > 5) {
@@ -1695,8 +1719,9 @@ qla24xx_logio_entry(scsi_qla_host_t *vha, struct req_que *req, · 15 unmodified lines
16951719 }
16961720
16971721 ql_dbg(ql_dbg_async, fcport->vha, 0x5037,
1698− "Async-%s failed - hdl=%x portid=%02x%02x%02x comp=%x "
1699− "iop0=%x iop1=%x.\n", type, sp->handle, fcport->d_id.b.domain,
1722+ "Async-%s failed - %8phC hdl=%x portid=%02x%02x%02x comp=%x "
1723+ "iop0=%x iop1=%x.\n", type, fcport->port_name,
1724+ sp->handle, fcport->d_id.b.domain,
17001725 fcport->d_id.b.area, fcport->d_id.b.al_pa,
17011726 le16_to_cpu(logio->comp_status),
17021727 le32_to_cpu(logio->io_parameter[0]),
@@ -2679,7 +2704,7 @@ qla24xx_abort_iocb_entry(scsi_qla_host_t *vha, struct req_que *req, · 976 unmodified lines
26792704 return;
26802705
26812706 abt = &sp->u.iocb_cmd;
2682− abt->u.abt.comp_status = le32_to_cpu(pkt->nport_handle);
2707+ abt->u.abt.comp_status = le16_to_cpu(pkt->nport_handle);
26832708 sp->done(sp, 0);
26842709 }
26852710
@@ -2693,7 +2718,7 @@ void qla24xx_process_response_queue(struct scsi_qla_host *vha, · 7 unmodified lines
26932718 struct sts_entry_24xx *pkt;
26942719 struct qla_hw_data *ha = vha->hw;
26952720
2696− if (!vha->flags.online)
2721+ if (!ha->flags.fw_started)
26972722 return;
26982723
26992724 while (rsp->ring_ptr->signature != RESPONSE_PROCESSED) {
drivers/scsi/qla2xxx/qla_mbx.c+268−36
@@ -10,6 +10,28 @@ · 9 unmodified lines
1010 #include <linux/delay.h>
1111 #include <linux/gfp.h>
1212
13+static struct mb_cmd_name {
14+ uint16_t cmd;
15+ const char *str;
16+} mb_str[] = {
17+ {MBC_GET_PORT_DATABASE, "GPDB"},
18+ {MBC_GET_ID_LIST, "GIDList"},
19+ {MBC_GET_LINK_PRIV_STATS, "Stats"},
20+};
21+
22+static const char *mb_to_str(uint16_t cmd)
23+{
24+ int i;
25+ struct mb_cmd_name *e;
26+
27+ for (i = 0; i < ARRAY_SIZE(mb_str); i++) {
28+ e = mb_str + i;
29+ if (cmd == e->cmd)
30+ return e->str;
31+ }
32+ return "unknown";
33+}
34+
1335 static struct rom_cmd {
1436 uint16_t cmd;
1537 } rom_cmds[] = {
@@ -2818,7 +2840,7 @@ qla2x00_get_link_status(scsi_qla_host_t *vha, uint16_t loop_id, · 2802 unmodified lines
28182840
28192841 int
28202842 qla24xx_get_isp_stats(scsi_qla_host_t *vha, struct link_statistics *stats,
2821− dma_addr_t stats_dma, uint options)
2843+ dma_addr_t stats_dma, uint16_t options)
28222844 {
28232845 int rval;
28242846 mbx_cmd_t mc;
@@ -2828,19 +2850,17 @@ qla24xx_get_isp_stats(scsi_qla_host_t *vha, struct link_statistics *stats, · 3 unmodified lines
28282850 ql_dbg(ql_dbg_mbx + ql_dbg_verbose, vha, 0x1088,
28292851 "Entered %s.\n", __func__);
28302852
2831− mcp->mb[0] = MBC_GET_LINK_PRIV_STATS;
2832− mcp->mb[2] = MSW(stats_dma);
2833− mcp->mb[3] = LSW(stats_dma);
2834− mcp->mb[6] = MSW(MSD(stats_dma));
2835− mcp->mb[7] = LSW(MSD(stats_dma));
2836− mcp->mb[8] = sizeof(struct link_statistics) / 4;
2837− mcp->mb[9] = vha->vp_idx;
2838− mcp->mb[10] = options;
2839− mcp->out_mb = MBX_10|MBX_9|MBX_8|MBX_7|MBX_6|MBX_3|MBX_2|MBX_0;
2840− mcp->in_mb = MBX_2|MBX_1|MBX_0;
2841− mcp->tov = MBX_TOV_SECONDS;
2842− mcp->flags = IOCTL_CMD;
2843− rval = qla2x00_mailbox_command(vha, mcp);
2853+ memset(&mc, 0, sizeof(mc));
2854+ mc.mb[0] = MBC_GET_LINK_PRIV_STATS;
2855+ mc.mb[2] = MSW(stats_dma);
2856+ mc.mb[3] = LSW(stats_dma);
2857+ mc.mb[6] = MSW(MSD(stats_dma));
2858+ mc.mb[7] = LSW(MSD(stats_dma));
2859+ mc.mb[8] = sizeof(struct link_statistics) / 4;
2860+ mc.mb[9] = cpu_to_le16(vha->vp_idx);
2861+ mc.mb[10] = cpu_to_le16(options);
2862+
2863+ rval = qla24xx_send_mb_cmd(vha, &mc);
28442864
28452865 if (rval == QLA_SUCCESS) {
28462866 if (mcp->mb[0] != MBS_COMMAND_COMPLETE) {
@@ -3603,6 +3623,7 @@ qla24xx_report_id_acquisition(scsi_qla_host_t *vha, · 756 unmodified lines
36033623 scsi_qla_host_t *vp = NULL;
36043624 unsigned long flags;
36053625 int found;
3626+ port_id_t id;
36063627
36073628 ql_dbg(ql_dbg_mbx + ql_dbg_verbose, vha, 0x10b6,
36083629 "Entered %s.\n", __func__);
@@ -3610,28 +3631,27 @@ qla24xx_report_id_acquisition(scsi_qla_host_t *vha, · 1 unmodified line
36103631 if (rptid_entry->entry_status != 0)
36113632 return;
36123633
3634+ id.b.domain = rptid_entry->port_id[2];
3635+ id.b.area = rptid_entry->port_id[1];
3636+ id.b.al_pa = rptid_entry->port_id[0];
3637+ id.b.rsvd_1 = 0;
3638+
36133639 if (rptid_entry->format == 0) {
36143640 /* loop */
3615− ql_dbg(ql_dbg_mbx + ql_dbg_verbose, vha, 0x10b7,
3641+ ql_dbg(ql_dbg_async, vha, 0x10b7,
36163642 "Format 0 : Number of VPs setup %d, number of "
36173643 "VPs acquired %d.\n", rptid_entry->vp_setup,
36183644 rptid_entry->vp_acquired);
3619− ql_dbg(ql_dbg_mbx + ql_dbg_verbose, vha, 0x10b8,
3645+ ql_dbg(ql_dbg_async, vha, 0x10b8,
36203646 "Primary port id %02x%02x%02x.\n",
36213647 rptid_entry->port_id[2], rptid_entry->port_id[1],
36223648 rptid_entry->port_id[0]);
36233649
3624− vha->d_id.b.domain = rptid_entry->port_id[2];
3625− vha->d_id.b.area = rptid_entry->port_id[1];
3626− vha->d_id.b.al_pa = rptid_entry->port_id[0];
3627−
3628− spin_lock_irqsave(&ha->vport_slock, flags);
3629− qlt_update_vp_map(vha, SET_AL_PA);
3630− spin_unlock_irqrestore(&ha->vport_slock, flags);
3650+ qlt_update_host_map(vha, id);
36313651
36323652 } else if (rptid_entry->format == 1) {
36333653 /* fabric */
3634− ql_dbg(ql_dbg_mbx + ql_dbg_verbose, vha, 0x10b9,
3654+ ql_dbg(ql_dbg_async, vha, 0x10b9,
36353655 "Format 1: VP[%d] enabled - status %d - with "
36363656 "port id %02x%02x%02x.\n", rptid_entry->vp_idx,
36373657 rptid_entry->vp_status,
@@ -3653,12 +3673,7 @@ qla24xx_report_id_acquisition(scsi_qla_host_t *vha, · 15 unmodified lines
36533673 WWN_SIZE);
36543674 }
36553675
3656− vha->d_id.b.domain = rptid_entry->port_id[2];
3657− vha->d_id.b.area = rptid_entry->port_id[1];
3658− vha->d_id.b.al_pa = rptid_entry->port_id[0];
3659− spin_lock_irqsave(&ha->vport_slock, flags);
3660− qlt_update_vp_map(vha, SET_AL_PA);
3661− spin_unlock_irqrestore(&ha->vport_slock, flags);
3676+ qlt_update_host_map(vha, id);
36623677 }
36633678
36643679 fc_host_port_name(vha->host) =
@@ -3694,12 +3709,7 @@ qla24xx_report_id_acquisition(scsi_qla_host_t *vha, · 29 unmodified lines
36943709 if (!found)
36953710 return;
36963711
3697− vp->d_id.b.domain = rptid_entry->port_id[2];
3698− vp->d_id.b.area = rptid_entry->port_id[1];
3699− vp->d_id.b.al_pa = rptid_entry->port_id[0];
3700− spin_lock_irqsave(&ha->vport_slock, flags);
3701− qlt_update_vp_map(vp, SET_AL_PA);
3702− spin_unlock_irqrestore(&ha->vport_slock, flags);
3712+ qlt_update_host_map(vp, id);
37033713
37043714 /*
37053715 * Cannot configure here as we are still sitting on the
@@ -5827,3 +5837,225 @@ qla26xx_dport_diagnostics(scsi_qla_host_t *vha, · 2121 unmodified lines
58275837
58285838 return rval;
58295839 }
5840+
5841+static void qla2x00_async_mb_sp_done(void *s, int res)
5842+{
5843+ struct srb *sp = s;
5844+
5845+ sp->u.iocb_cmd.u.mbx.rc = res;
5846+
5847+ complete(&sp->u.iocb_cmd.u.mbx.comp);
5848+ /* don't free sp here. Let the caller do the free */
5849+}
5850+
5851+/*
5852+ * This mailbox uses the iocb interface to send MB command.
5853+ * This allows non-critial (non chip setup) command to go
5854+ * out in parrallel.
5855+ */
5856+int qla24xx_send_mb_cmd(struct scsi_qla_host *vha, mbx_cmd_t *mcp)
5857+{
5858+ int rval = QLA_FUNCTION_FAILED;
5859+ srb_t *sp;
5860+ struct srb_iocb *c;
5861+
5862+ if (!vha->hw->flags.fw_started)
5863+ goto done;
5864+
5865+ sp = qla2x00_get_sp(vha, NULL, GFP_KERNEL);
5866+ if (!sp)
5867+ goto done;
5868+
5869+ sp->type = SRB_MB_IOCB;
5870+ sp->name = mb_to_str(mcp->mb[0]);
5871+
5872+ qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2);
5873+
5874+ memcpy(sp->u.iocb_cmd.u.mbx.out_mb, mcp->mb, SIZEOF_IOCB_MB_REG);
5875+
5876+ c = &sp->u.iocb_cmd;
5877+ c->timeout = qla2x00_async_iocb_timeout;
5878+ init_completion(&c->u.mbx.comp);
5879+
5880+ sp->done = qla2x00_async_mb_sp_done;
5881+
5882+ rval = qla2x00_start_sp(sp);
5883+ if (rval != QLA_SUCCESS) {
5884+ ql_dbg(ql_dbg_mbx, vha, 0xffff,
5885+ "%s: %s Failed submission. %x.\n",
5886+ __func__, sp->name, rval);
5887+ goto done_free_sp;
5888+ }
5889+
5890+ ql_dbg(ql_dbg_mbx, vha, 0xffff, "MB:%s hndl %x submitted\n",
5891+ sp->name, sp->handle);
5892+
5893+ wait_for_completion(&c->u.mbx.comp);
5894+ memcpy(mcp->mb, sp->u.iocb_cmd.u.mbx.in_mb, SIZEOF_IOCB_MB_REG);
5895+
5896+ rval = c->u.mbx.rc;
5897+ switch (rval) {
5898+ case QLA_FUNCTION_TIMEOUT:
5899+ ql_dbg(ql_dbg_mbx, vha, 0xffff, "%s: %s Timeout. %x.\n",
5900+ __func__, sp->name, rval);
5901+ break;
5902+ case QLA_SUCCESS:
5903+ ql_dbg(ql_dbg_mbx, vha, 0xffff, "%s: %s done.\n",
5904+ __func__, sp->name);
5905+ sp->free(sp);
5906+ break;
5907+ default:
5908+ ql_dbg(ql_dbg_mbx, vha, 0xffff, "%s: %s Failed. %x.\n",
5909+ __func__, sp->name, rval);
5910+ sp->free(sp);
5911+ break;
5912+ }
5913+
5914+ return rval;
5915+
5916+done_free_sp:
5917+ sp->free(sp);
5918+done:
5919+ return rval;
5920+}
5921+
5922+/*
5923+ * qla24xx_gpdb_wait
5924+ * NOTE: Do not call this routine from DPC thread
5925+ */
5926+int qla24xx_gpdb_wait(struct scsi_qla_host *vha, fc_port_t *fcport, u8 opt)
5927+{
5928+ int rval = QLA_FUNCTION_FAILED;
5929+ dma_addr_t pd_dma;
5930+ struct port_database_24xx *pd;
5931+ struct qla_hw_data *ha = vha->hw;
5932+ mbx_cmd_t mc;
5933+
5934+ if (!vha->hw->flags.fw_started)
5935+ goto done;
5936+
5937+ pd = dma_pool_alloc(ha->s_dma_pool, GFP_KERNEL, &pd_dma);
5938+ if (pd == NULL) {
5939+ ql_log(ql_log_warn, vha, 0xffff,
5940+ "Failed to allocate port database structure.\n");
5941+ goto done_free_sp;
5942+ }
5943+ memset(pd, 0, max(PORT_DATABASE_SIZE, PORT_DATABASE_24XX_SIZE));
5944+
5945+ memset(&mc, 0, sizeof(mc));
5946+ mc.mb[0] = MBC_GET_PORT_DATABASE;
5947+ mc.mb[1] = cpu_to_le16(fcport->loop_id);
5948+ mc.mb[2] = MSW(pd_dma);
5949+ mc.mb[3] = LSW(pd_dma);
5950+ mc.mb[6] = MSW(MSD(pd_dma));
5951+ mc.mb[7] = LSW(MSD(pd_dma));
5952+ mc.mb[9] = cpu_to_le16(vha->vp_idx);
5953+ mc.mb[10] = cpu_to_le16((uint16_t)opt);
5954+
5955+ rval = qla24xx_send_mb_cmd(vha, &mc);
5956+ if (rval != QLA_SUCCESS) {
5957+ ql_dbg(ql_dbg_mbx, vha, 0xffff,
5958+ "%s: %8phC fail\n", __func__, fcport->port_name);
5959+ goto done_free_sp;
5960+ }
5961+
5962+ rval = __qla24xx_parse_gpdb(vha, fcport, pd);
5963+
5964+ ql_dbg(ql_dbg_mbx, vha, 0xffff, "%s: %8phC done\n",
5965+ __func__, fcport->port_name);
5966+
5967+done_free_sp:
5968+ if (pd)
5969+ dma_pool_free(ha->s_dma_pool, pd, pd_dma);
5970+done:
5971+ return rval;
5972+}
5973+
5974+int __qla24xx_parse_gpdb(struct scsi_qla_host *vha, fc_port_t *fcport,
5975+ struct port_database_24xx *pd)
5976+{
5977+ int rval = QLA_SUCCESS;
5978+ uint64_t zero = 0;
5979+
5980+ /* Check for logged in state. */
5981+ if (pd->current_login_state != PDS_PRLI_COMPLETE &&
5982+ pd->last_login_state != PDS_PRLI_COMPLETE) {
5983+ ql_dbg(ql_dbg_mbx, vha, 0xffff,
5984+ "Unable to verify login-state (%x/%x) for "
5985+ "loop_id %x.\n", pd->current_login_state,
5986+ pd->last_login_state, fcport->loop_id);
5987+ rval = QLA_FUNCTION_FAILED;
5988+ goto gpd_error_out;
5989+ }
5990+
5991+ if (fcport->loop_id == FC_NO_LOOP_ID ||
5992+ (memcmp(fcport->port_name, (uint8_t *)&zero, 8) &&
5993+ memcmp(fcport->port_name, pd->port_name, 8))) {
5994+ /* We lost the device mid way. */
5995+ rval = QLA_NOT_LOGGED_IN;
5996+ goto gpd_error_out;
5997+ }
5998+
5999+ /* Names are little-endian. */
6000+ memcpy(fcport->node_name, pd->node_name, WWN_SIZE);
6001+ memcpy(fcport->port_name, pd->port_name, WWN_SIZE);
6002+
6003+ /* Get port_id of device. */
6004+ fcport->d_id.b.domain = pd->port_id[0];
6005+ fcport->d_id.b.area = pd->port_id[1];
6006+ fcport->d_id.b.al_pa = pd->port_id[2];
6007+ fcport->d_id.b.rsvd_1 = 0;
6008+
6009+ /* If not target must be initiator or unknown type. */
6010+ if ((pd->prli_svc_param_word_3[0] & BIT_4) == 0)
6011+ fcport->port_type = FCT_INITIATOR;
6012+ else
6013+ fcport->port_type = FCT_TARGET;
6014+
6015+ /* Passback COS information. */
6016+ fcport->supported_classes = (pd->flags & PDF_CLASS_2) ?
6017+ FC_COS_CLASS2 : FC_COS_CLASS3;
6018+
6019+ if (pd->prli_svc_param_word_3[0] & BIT_7) {
6020+ fcport->flags |= FCF_CONF_COMP_SUPPORTED;
6021+ fcport->conf_compl_supported = 1;
6022+ }
6023+
6024+gpd_error_out:
6025+ return rval;
6026+}
6027+
6028+/*
6029+ * qla24xx_gidlist__wait
6030+ * NOTE: don't call this routine from DPC thread.
6031+ */
6032+int qla24xx_gidlist_wait(struct scsi_qla_host *vha,
6033+ void *id_list, dma_addr_t id_list_dma, uint16_t *entries)
6034+{
6035+ int rval = QLA_FUNCTION_FAILED;
6036+ mbx_cmd_t mc;
6037+
6038+ if (!vha->hw->flags.fw_started)
6039+ goto done;
6040+
6041+ memset(&mc, 0, sizeof(mc));
6042+ mc.mb[0] = MBC_GET_ID_LIST;
6043+ mc.mb[2] = MSW(id_list_dma);
6044+ mc.mb[3] = LSW(id_list_dma);
6045+ mc.mb[6] = MSW(MSD(id_list_dma));
6046+ mc.mb[7] = LSW(MSD(id_list_dma));
6047+ mc.mb[8] = 0;
6048+ mc.mb[9] = cpu_to_le16(vha->vp_idx);
6049+
6050+ rval = qla24xx_send_mb_cmd(vha, &mc);
6051+ if (rval != QLA_SUCCESS) {
6052+ ql_dbg(ql_dbg_mbx, vha, 0xffff,
6053+ "%s: fail\n", __func__);
6054+ } else {
6055+ *entries = mc.mb[1];
6056+ ql_dbg(ql_dbg_mbx, vha, 0xffff,
6057+ "%s: done\n", __func__);
6058+ }
6059+done:
6060+ return rval;
6061+}
drivers/scsi/qla2xxx/qla_mid.c+8−6
@@ -74,13 +74,14 @@ qla24xx_deallocate_vp_id(scsi_qla_host_t *vha) · 73 unmodified lines
7474 * ensures no active vp_list traversal while the vport is removed
7575 * from the queue)
7676 */
77− spin_lock_irqsave(&ha->vport_slock, flags);
78− while (atomic_read(&vha->vref_count)) {
79− spin_unlock_irqrestore(&ha->vport_slock, flags);
80−
81− msleep(500);
77+ wait_event_timeout(vha->vref_waitq, atomic_read(&vha->vref_count),
78+ 10*HZ);
8279
83− spin_lock_irqsave(&ha->vport_slock, flags);
80+ spin_lock_irqsave(&ha->vport_slock, flags);
81+ if (atomic_read(&vha->vref_count)) {
82+ ql_dbg(ql_dbg_vport, vha, 0xfffa,
83+ "vha->vref_count=%u timeout\n", vha->vref_count.counter);
84+ vha->vref_count = (atomic_t)ATOMIC_INIT(0);
8485 }
8586 list_del(&vha->list);
8687 qlt_update_vp_map(vha, RESET_VP_IDX);
@@ -269,6 +270,7 @@ qla2x00_alert_all_vps(struct rsp_que *rsp, uint16_t *mb) · 182 unmodified lines
269270
270271 spin_lock_irqsave(&ha->vport_slock, flags);
271272 atomic_dec(&vha->vref_count);
273+ wake_up(&vha->vref_waitq);
272274 }
273275 i++;
274276 }
drivers/scsi/qla2xxx/qla_os.c+22−1
@@ -2560,6 +2560,20 @@ qla2xxx_scan_finished(struct Scsi_Host *shost, unsigned long time) · 2559 unmodified lines
25602560 return atomic_read(&vha->loop_state) == LOOP_READY;
25612561 }
25622562
2563+static void qla2x00_iocb_work_fn(struct work_struct *work)
2564+{
2565+ struct scsi_qla_host *vha = container_of(work,
2566+ struct scsi_qla_host, iocb_work);
2567+ int cnt = 0;

49 more lines aren’t shown here.

drivers/scsi/qla2xxx/qla_target.c+470−278

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

drivers/scsi/qla2xxx/qla_target.h+33−6

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

drivers/scsi/qla2xxx/qla_version.h+3−3

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

drivers/scsi/qla2xxx/tcm_qla2xxx.c+33−16

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

drivers/scsi/scsi_lib.c+10−4

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

drivers/scsi/scsi_priv.h+0−3

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

drivers/scsi/sd.c+17−0

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

drivers/scsi/storvsc_drv.c+17−10

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

drivers/scsi/ufs/ufs.h+8−14

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

drivers/scsi/ufs/ufshcd.c+174−59

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

drivers/scsi/ufs/ufshcd.h+15−0

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

drivers/scsi/vmw_pvscsi.c+1−1

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

drivers/staging/lustre/lnet/lnet/lib-socket.c+2−2

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

drivers/target/target_core_alua.c+38−44

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

drivers/target/target_core_configfs.c+4−0

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

drivers/target/target_core_pscsi.c+14−36

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

drivers/target/target_core_sbc.c+8−2

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

drivers/target/target_core_tpg.c+2−1

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

drivers/target/target_core_transport.c+1−2

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

drivers/target/target_core_user.c+123−29

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

drivers/tty/serial/8250/8250_dw.c+7−2

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

drivers/tty/serial/amba-pl011.c+1−1

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

drivers/tty/serial/st-asc.c+6−5

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

drivers/tty/tty_ldisc.c+21−71

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

drivers/usb/class/usbtmc.c+15−3

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

drivers/usb/core/config.c+10−0

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

drivers/usb/core/hub.c+1−1

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

drivers/usb/core/quirks.c+8−0

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

drivers/usb/dwc3/gadget.c+17−4

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

drivers/usb/gadget/function/f_acm.c+3−1

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

drivers/usb/gadget/function/f_hid.c+4−4

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

drivers/usb/gadget/function/f_uvc.c+9−1

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

drivers/usb/gadget/udc/pch_udc.c+0−1

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

drivers/usb/misc/idmouse.c+3−0

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

drivers/usb/misc/lvstest.c+4−0

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

drivers/usb/misc/uss720.c+5−0

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

drivers/usb/musb/musb_core.c+1−1

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

drivers/usb/musb/musb_cppi41.c+21−2

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

drivers/usb/musb/musb_dsps.c+4−1

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

drivers/usb/serial/option.c+16−1

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

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

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

drivers/usb/wusbcore/wa-hc.c+3−0

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

drivers/uwb/hwa-rc.c+3−0

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

drivers/uwb/i1480/dfu/usb.c+3−0

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

drivers/vfio/vfio.c+5−3

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

drivers/vfio/vfio_iommu_type1.c+3−4

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

drivers/vhost/vsock.c+41−0

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

drivers/xen/gntdev.c+6−5

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

drivers/xen/xen-acpi-processor.c+27−9

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

fs/afs/callback.c+4−3

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

fs/afs/cmservice.c+5−6

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

fs/afs/file.c+16−4

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

fs/afs/fsclient.c+50−27

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

fs/afs/inode.c+22−20

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

fs/afs/internal.h+13−10

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

fs/afs/misc.c+2−0

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

fs/afs/mntpt.c+0−53

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

fs/afs/rxrpc.c+84−65

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

fs/afs/security.c+7−2

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

fs/afs/server.c+3−3

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

fs/afs/vlocation.c+9−7

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

fs/afs/write.c+54−22

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

fs/btrfs/extent_io.c+2−1

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

fs/btrfs/inode.c+14−0

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

fs/crypto/crypto.c+1−9

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

fs/crypto/fname.c+1−1

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

fs/crypto/fscrypt_private.h+0−4

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

fs/crypto/keyinfo.c+9−43

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

fs/crypto/policy.c+0−7

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

fs/dlm/lowcomms.c+1−1

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

fs/ext4/inline.c+2−3

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

fs/ext4/inode.c+1−1

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

fs/ext4/move_extent.c+1−1

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

fs/ext4/super.c+4−6

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

fs/ext4/xattr.c+31−34

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

fs/f2fs/debug.c+1−0

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

fs/f2fs/dir.c+1−1

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

fs/f2fs/f2fs.h+2−0

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

fs/f2fs/node.c+77−86

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

fs/f2fs/segment.c+6−0

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

fs/fs-writeback.c+21−14

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

fs/gfs2/incore.h+1−1

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

fs/jbd2/journal.c+11−11

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

fs/jbd2/revoke.c+1−0

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

fs/kernfs/file.c+2−1

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

fs/nfs/callback.c+2−2

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

fs/nfs/client.c+24−1

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

fs/nfs/filelayout/filelayoutdev.c+7−1

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

fs/nfs/flexfilelayout/flexfilelayout.h+13−1

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

fs/nfs/flexfilelayout/flexfilelayoutdev.c+3−2

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

fs/nfs/internal.h+2−0

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

fs/nfs/nfs4client.c+2−2

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

fs/nfs/nfs4proc.c+4−7

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

fs/nfs/nfs4xdr.c+1−1

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

fs/nfs/pnfs.h+1−1

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

fs/nfs/pnfs_nfs.c+25−6

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

fs/nfs/write.c+4−2

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

fs/ocfs2/cluster/tcp.c+1−1

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

fs/xfs/libxfs/xfs_dir2_priv.h+2−0

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

fs/xfs/libxfs/xfs_dir2_sf.c+87−0

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

fs/xfs/libxfs/xfs_inode_fork.c+23−3

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

fs/xfs/libxfs/xfs_inode_fork.h+1−1

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

fs/xfs/xfs_dir2_readdir.c+0−11

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

fs/xfs/xfs_inode.c+9−3

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

include/crypto/if_alg.h+1−1

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

include/linux/acpi.h+1−4

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

include/linux/ccp.h+1−1

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

include/linux/dccp.h+1−0

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

include/linux/device.h+0−1

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

include/linux/errqueue.h+2−0

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

include/linux/filter.h+12−4

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

include/linux/fscrypt_common.h+0−1

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

include/linux/gpio/consumer.h+0−16

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

include/linux/hwmon.h+1−0

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

include/linux/hyperv.h+7−3

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

include/linux/iio/sw_device.h+1−1

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

include/linux/iommu.h+13−5

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

include/linux/kasan.h+1−0

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

include/linux/list_nulls.h+5−0

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

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

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

include/linux/net.h+1−1

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

include/linux/omap-gpmc.h+3−13

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

include/linux/phy.h+4−0

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

include/linux/rculist_nulls.h+14−0

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

include/linux/reset.h+2−7

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

include/linux/usb/quirks.h+6−0

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

include/linux/virtio_vsock.h+3−0

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

include/net/af_vsock.h+3−0

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

include/net/inet_common.h+2−1

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

include/net/inet_connection_sock.h+1−1

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

include/net/netfilter/nf_conntrack.h+1−1

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

include/net/netfilter/nf_tables.h+29−1

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

include/net/netfilter/nf_tables_ipv6.h+4−2

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

include/net/sctp/structs.h+5−3

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

include/net/sock.h+6−3

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

include/rdma/ib_verbs.h+17−13

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

include/scsi/libiscsi.h+1−0

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

include/scsi/scsi_device.h+4−0

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

include/target/target_core_backend.h+6−1

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

include/target/target_core_base.h+1−1

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

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

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

include/uapi/drm/omap_drm.h+19−19

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

include/uapi/linux/btrfs.h+0−27

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

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

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

include/uapi/rdma/mlx5-abi.h+2−1

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

include/video/exynos5433_decon.h+12−0

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

kernel/audit.c+394−245

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

kernel/audit.h+2−7

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

kernel/auditsc.c+3−3

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

kernel/bpf/hashtab.c+146−107

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

kernel/bpf/lpm_trie.c+6−0

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

kernel/cgroup/cgroup-v1.c+1−1

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

kernel/cgroup/pids.c+1−1

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

kernel/cpu.c+14−14

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

kernel/events/core.c+48−16

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

kernel/futex.c+13−9

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

kernel/locking/rwsem-spinlock.c+11−5

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

kernel/memremap.c+0−4

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

kernel/sched/cpufreq_schedutil.c+7−13

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

kernel/sched/deadline.c+57−6

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

kernel/sched/loadavg.c+12−8

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

kernel/workqueue.c+1−0

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

mm/gup.c+1−1

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

mm/memory_hotplug.c+5−1

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

mm/percpu-vm.c+3−4

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

mm/percpu.c+4−1

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

mm/swap_slots.c+0−2

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

mm/vmalloc.c+2−1

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

mm/z3fold.c+1−0

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

net/atm/svc.c+3−2

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

net/ax25/af_ax25.c+2−1

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

net/batman-adv/bat_iv_ogm.c+11−0

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

net/batman-adv/bat_v.c+11−3

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

net/batman-adv/fragmentation.c+13−7

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

net/batman-adv/gateway_common.c+5−0

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

net/batman-adv/soft-interface.c+0−1

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

net/batman-adv/types.h+2−0

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

net/bluetooth/l2cap_sock.c+1−1

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

net/bluetooth/rfcomm/sock.c+2−1

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

net/bluetooth/sco.c+1−1

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

net/bridge/br_fdb.c+1−1

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

net/bridge/br_input.c+1−0

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

net/bridge/br_netfilter_hooks.c+7−26

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

net/bridge/br_private.h+0−9

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

net/ceph/messenger.c+6−0

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

net/core/dev.c+1−0

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

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

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

net/core/netclassid_cgroup.c+16−16

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

net/core/skbuff.c+36−19

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

net/core/sock.c+68−54

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

net/dccp/ccids/ccid2.c+1−0

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

net/dccp/ipv4.c+2−1

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

net/dccp/ipv6.c+5−3

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

net/dccp/minisocks.c+16−8

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

net/decnet/af_decnet.c+3−2

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

net/ipv4/af_inet.c+6−3

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

net/ipv4/fib_frontend.c+2−1

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

net/ipv4/inet_connection_sock.c+1−1

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

net/ipv4/ip_fragment.c+17−8

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

net/ipv4/ip_output.c+1−1

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

net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c+4−0

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

net/ipv4/netfilter/nf_nat_l3proto_ipv4.c+0−5

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

net/ipv4/netfilter/nft_masq_ipv4.c+4−4

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

net/ipv4/netfilter/nft_redir_ipv4.c+4−4

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

net/ipv4/tcp.c+2−1

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

net/ipv4/tcp_input.c+1−1

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

net/ipv4/tcp_ipv4.c+7−3

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

net/ipv4/tcp_minisocks.c+1−0

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

net/ipv4/tcp_timer.c+4−2

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

net/ipv6/af_inet6.c+5−5

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

net/ipv6/ip6_fib.c+2−0

This diff is large: its 9 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_output.c+7−2

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

net/ipv6/ip6_vti.c+6−2

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

net/ipv6/netfilter/nft_masq_ipv6.c+4−4

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

net/ipv6/netfilter/nft_redir_ipv6.c+4−4

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

net/ipv6/route.c+8−5

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

net/ipv6/tcp_ipv6.c+5−3

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

net/ipv6/udp.c+1−1

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

net/irda/af_irda.c+3−2

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

net/iucv/af_iucv.c+1−1

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

net/llc/af_llc.c+3−1

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

net/mpls/af_mpls.c+11−2

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

net/netfilter/nf_conntrack_core.c+5−1

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

net/netfilter/nf_nat_proto_sctp.c+12−1

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

net/netfilter/nf_tables_api.c+0−4

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

net/netfilter/nft_ct.c+12−9

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

net/netfilter/nft_meta.c+21−19

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

net/netfilter/nft_nat.c+4−4

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

net/netfilter/nft_set_bitmap.c+79−86

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

net/netlink/af_netlink.c+41−0

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

net/netlink/genetlink.c+3−1

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

net/netrom/af_netrom.c+2−1

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

net/nfc/llcp_sock.c+1−1

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

net/openvswitch/flow_netlink.c+3−1

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

net/phonet/pep.c+4−2

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

net/phonet/socket.c+2−2

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

net/rds/connection.c+1−0

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

net/rds/ib_cm.c+36−11

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

net/rds/rds.h+3−3

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

net/rds/tcp.c+21−17

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

net/rds/tcp.h+1−1

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

net/rds/tcp_listen.c+8−3

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

net/rose/af_rose.c+2−1

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

net/rxrpc/conn_event.c+4−0

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

net/rxrpc/input.c+19−8

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

net/rxrpc/recvmsg.c+2−2

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

net/rxrpc/sendmsg.c+31−18

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

net/sched/act_connmark.c+3−0

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

net/sched/act_skbmod.c+0−1

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

net/sched/sch_dsmark.c+8−2

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

net/sctp/associola.c+2−4

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

net/sctp/ipv6.c+3−2

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

net/sctp/output.c+3−4

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

net/sctp/outqueue.c+5−6

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

net/sctp/protocol.c+3−2

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

net/sctp/socket.c+2−2

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

net/smc/af_smc.c+1−1

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

net/socket.c+15−3

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

net/sunrpc/xprtrdma/verbs.c+2−1

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

net/tipc/socket.c+5−3

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

net/tipc/subscr.c+6−1

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

net/unix/af_unix.c+3−2

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

net/unix/garbage.c+9−8

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

net/vmw_vsock/af_vsock.c+16−1

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

net/vmw_vsock/virtio_transport.c+42−0

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

net/vmw_vsock/virtio_transport_common.c+7−0

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

net/wireless/nl80211.c+56−71

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

net/x25/af_x25.c+2−1

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

net/xfrm/xfrm_policy.c+9−10

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

sound/core/seq/seq_clientmgr.c+1−0

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

sound/core/seq/seq_fifo.c+3−0

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

sound/core/seq/seq_memory.c+13−4

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

sound/core/seq/seq_memory.h+1−0

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

sound/pci/ctxfi/cthw20k1.c+1−1

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

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

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

sound/pci/hda/patch_realtek.c+15−1

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

sound/x86/Kconfig+2−1

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

tools/include/uapi/linux/bpf_perf_event.h+18−0

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

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

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

tools/testing/selftests/bpf/Makefile+11−8

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

tools/testing/selftests/bpf/test_maps.c+26−3

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

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

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

tools/testing/selftests/powerpc/include/vsx_asm.h+24−24

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