History

Merge tag 'v4.3-rc4' into for-4.4/core

Linux 4.3-rc4 Pulling in v4.3-rc4 to avoid conflicts with NVMe fixes that have gone in since for-4.4/core was based.

Jens Axboe committed 11 years ago

Commit fd48ca32 parents 53cbf3b 049e6dd690 files · +7244 −3957Browse files

Unified · Split

690 files
  1. Documentation/Changes +1 −1
  2. Documentation/devicetree/bindings/arm/gic-v3.txt +5 −0
  3. Documentation/devicetree/bindings/arm/idle-states.txt +1 −1
  4. Documentation/devicetree/bindings/gpio/gpio.txt +3 −1
  5. Documentation/devicetree/bindings/iio/accel/bma180.txt +6 −2
  6. Documentation/devicetree/bindings/input/cypress,cyapa.txt +1 −1
  7. Documentation/devicetree/bindings/interrupt-controller/qca,ath79-misc-intc.txt +18 −2
  8. Documentation/devicetree/bindings/pci/pci-rcar-gen2.txt +2 −1
  9. Documentation/devicetree/bindings/regulator/pbias-regulator.txt +6 −1
  10. Documentation/devicetree/bindings/spi/spi-mt65xx.txt +10 −6
  11. Documentation/devicetree/bindings/thermal/thermal.txt +14 −13
  12. Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt +1 −0
  13. Documentation/devicetree/bindings/vendor-prefixes.txt +1 −0
  14. Documentation/input/multi-touch-protocol.txt +1 −1
  15. Documentation/networking/vrf.txt +96 −0
  16. Documentation/power/pci.txt +38 −13
  17. Documentation/ptp/testptp.c +1 −0
  18. Documentation/sysctl/net.txt +9 −7
  19. Documentation/thermal/power_allocator.txt +1 −1
  20. MAINTAINERS +27 −15
  21. Makefile +1 −1
  22. arch/alpha/kernel/pci.c +6 −1
  23. arch/arc/include/asm/Kbuild +1 −0
  24. arch/arm/boot/dts/am335x-phycore-som.dtsi +2 −2
  25. arch/arm/boot/dts/am57xx-beagle-x15.dts +29 −17
  26. arch/arm/boot/dts/dm8148-evm.dts +2 −2
  27. arch/arm/boot/dts/dm8148-t410.dts +3 −3
  28. arch/arm/boot/dts/dm814x.dtsi +4 −4
  29. arch/arm/boot/dts/dra7.dtsi +3 −2
  30. arch/arm/boot/dts/omap2430.dtsi +2 −1
  31. arch/arm/boot/dts/omap3-beagle.dts +1 −1
  32. arch/arm/boot/dts/omap3-igep.dtsi +0 −6
  33. arch/arm/boot/dts/omap3-igep0020-common.dtsi +6 −0
  34. arch/arm/boot/dts/omap3.dtsi +13 −12
  35. arch/arm/boot/dts/omap4.dtsi +2 −1
  36. arch/arm/boot/dts/omap5-uevm.dts +2 −2
  37. arch/arm/boot/dts/omap5.dtsi +2 −1
  38. arch/arm/boot/dts/rk3288-veyron.dtsi +1 −0
  39. arch/arm/boot/dts/stih407.dtsi +40 −42
  40. arch/arm/boot/dts/stih410.dtsi +40 −42
  41. arch/arm/configs/omap2plus_defconfig +4 −1
  42. arch/arm/include/asm/kvm_host.h +1 −0
  43. arch/arm/include/asm/unistd.h +1 −1
  44. arch/arm/include/uapi/asm/unistd.h +2 −0
  45. arch/arm/kernel/calls.S +2 −0
  46. arch/arm/mach-omap2/Kconfig +5 −1
  47. arch/arm/mach-omap2/board-generic.c +0 −7
  48. arch/arm/mach-omap2/id.c +6 −2
  49. arch/arm/mach-omap2/io.c +1 −0
  50. arch/arm/mach-omap2/omap_device.c +2 −1
  51. arch/arm/mach-omap2/pm.h +2 −1
  52. arch/arm/mach-omap2/soc.h +2 −0
  53. arch/arm/mach-omap2/timer.c +2 −6
  54. arch/arm/mach-omap2/vc.c +1 −1
  55. arch/arm/mach-pxa/balloon3.c +1 −1
  56. arch/arm/mach-pxa/include/mach/addr-map.h +7 −0
  57. arch/arm/mach-pxa/pxa3xx.c +20 −1
  58. arch/arm/mm/alignment.c +25 −5
  59. arch/arm/plat-pxa/ssp.c +0 −1
  60. arch/arm64/boot/dts/mediatek/mt8173.dtsi +1 −1
  61. arch/arm64/boot/dts/rockchip/rk3368.dtsi +1 −1
  62. arch/arm64/include/asm/kvm_host.h +1 −0
  63. arch/arm64/include/asm/pgtable.h +2 −2
  64. arch/arm64/kernel/efi.c +2 −1
  65. arch/arm64/kernel/entry-ftrace.S +20 −2
  66. arch/avr32/include/asm/Kbuild +1 −0
  67. arch/blackfin/include/asm/Kbuild +1 −0
  68. arch/c6x/include/asm/Kbuild +1 −0
  69. arch/cris/include/asm/Kbuild +1 −0
  70. arch/frv/include/asm/Kbuild +1 −0
  71. arch/frv/mb93090-mb00/pci-vdk.c +2 −0
  72. arch/hexagon/include/asm/Kbuild +1 −0
  73. arch/ia64/include/asm/Kbuild +1 −0
  74. arch/ia64/pci/pci.c +3 −2
  75. arch/m32r/include/asm/Kbuild +1 −0
  76. arch/m68k/configs/amiga_defconfig +8 −1
  77. arch/m68k/configs/apollo_defconfig +8 −1
  78. arch/m68k/configs/atari_defconfig +8 −1
  79. arch/m68k/configs/bvme6000_defconfig +8 −1
  80. arch/m68k/configs/hp300_defconfig +8 −1
  81. arch/m68k/configs/mac_defconfig +8 −1
  82. arch/m68k/configs/multi_defconfig +8 −1
  83. arch/m68k/configs/mvme147_defconfig +8 −1
  84. arch/m68k/configs/mvme16x_defconfig +8 −1
  85. arch/m68k/configs/q40_defconfig +8 −1
  86. arch/m68k/configs/sun3_defconfig +8 −1
  87. arch/m68k/configs/sun3x_defconfig +8 −1
  88. arch/m68k/include/asm/linkage.h +30 −0
  89. arch/m68k/include/asm/unistd.h +1 −1
  90. arch/m68k/include/uapi/asm/unistd.h +19 −0
  91. arch/m68k/kernel/syscalltable.S +19 −1
  92. arch/metag/include/asm/Kbuild +1 −0
  93. arch/microblaze/include/asm/Kbuild +1 −0
  94. arch/microblaze/pci/pci-common.c +8 −1
  95. arch/mips/ath79/irq.c +20 −2
  96. arch/mips/cavium-octeon/setup.c +1 −1
  97. arch/mips/include/asm/Kbuild +1 −0
  98. arch/mips/include/asm/cpu-features.h +3 −0
  99. arch/mips/include/asm/cpu.h +1 −0
  100. arch/mips/include/asm/kvm_host.h +1 −0
  101. arch/mips/include/asm/maar.h +9 −0
  102. arch/mips/include/asm/mips-cm.h +39 −0
  103. arch/mips/include/asm/mipsregs.h +2 −0
  104. arch/mips/include/uapi/asm/unistd.h +12 −6
  105. arch/mips/jz4740/board-qi_lb60.c +1 −0
  106. arch/mips/jz4740/gpio.c +1 −0
  107. arch/mips/kernel/cps-vec.S +7 −5
  108. arch/mips/kernel/cpu-probe.c +13 −8
  109. arch/mips/kernel/octeon_switch.S +1 −25
  110. arch/mips/kernel/r2300_switch.S +1 −27
  111. arch/mips/kernel/scall32-o32.S +18 −23
  112. arch/mips/kernel/scall64-64.S +18 −22
  113. arch/mips/kernel/scall64-n32.S +7 −14
  114. arch/mips/kernel/scall64-o32.S +7 −14
  115. arch/mips/kernel/setup.c +9 −1
  116. arch/mips/kernel/smp.c +2 −0
  117. arch/mips/loongson64/common/env.c +3 −0
  118. arch/mips/mm/dma-default.c +1 −1
  119. arch/mips/mm/init.c +114 −63
  120. arch/mips/net/bpf_jit_asm.S +54 −9
  121. arch/mips/pci/pci.c +6 −0
  122. arch/mn10300/include/asm/Kbuild +1 −0
  123. arch/mn10300/unit-asb2305/pci.c +1 −0
  124. arch/nios2/include/asm/Kbuild +1 −0
  125. arch/powerpc/include/asm/Kbuild +1 −0
  126. arch/powerpc/include/asm/kvm_host.h +1 −0
  127. arch/powerpc/include/asm/systbl.h +1 −0
  128. arch/powerpc/include/asm/unistd.h +1 −1
  129. arch/powerpc/include/uapi/asm/unistd.h +1 −0
  130. arch/powerpc/kernel/pci-common.c +7 −1
  131. arch/powerpc/kvm/book3s.c +6 −0
  132. arch/powerpc/kvm/book3s_hv.c +5 −1
  133. arch/powerpc/kvm/book3s_hv_rmhandlers.S +1 −0
  134. arch/s390/include/asm/Kbuild +1 −0
  135. arch/s390/include/asm/kvm_host.h +1 −0
  136. arch/score/include/asm/Kbuild +1 −0
  137. arch/tile/gxio/mpipe.c +4 −29
  138. arch/tile/include/asm/Kbuild +1 −0
  139. arch/tile/kernel/usb.c +1 −0
  140. arch/um/include/asm/Kbuild +1 −0
  141. arch/unicore32/include/asm/Kbuild +1 −0
  142. arch/x86/entry/entry_64.S +15 −1
  143. arch/x86/include/asm/cpufeature.h +1 −1
  144. arch/x86/include/asm/efi.h +12 −0
  145. arch/x86/include/asm/kvm_host.h +1 −0
  146. arch/x86/include/asm/msr-index.h +3 −0
  147. arch/x86/include/asm/pvclock-abi.h +1 −0
  148. arch/x86/include/uapi/asm/bitsperlong.h +1 −1
  149. arch/x86/kernel/cpu/mshyperv.c +7 −5
  150. arch/x86/kernel/cpu/perf_event.h +1 −0
  151. arch/x86/kernel/cpu/perf_event_intel.c +15 −2
  152. arch/x86/kernel/cpu/perf_event_msr.c +2 −2
  153. arch/x86/kernel/cpu/scattered.c +1 −1
  154. arch/x86/kernel/crash.c +3 −4
  155. arch/x86/kernel/paravirt.c +12 −4
  156. arch/x86/kernel/process.c +55 −0
  157. arch/x86/kernel/process_32.c +0 −28
  158. arch/x86/kernel/process_64.c +0 −24
  159. arch/x86/kvm/mmu.c +18 −7
  160. arch/x86/kvm/svm.c +16 −113
  161. arch/x86/kvm/vmx.c +8 −3
  162. arch/x86/kvm/x86.c +2 −4
  163. arch/x86/mm/init_64.c +1 −1
  164. arch/x86/pci/common.c +1 −0
  165. arch/x86/platform/efi/efi.c +66 −1
  166. arch/xtensa/include/asm/Kbuild +1 −0
  167. arch/xtensa/kernel/pci.c +4 −0
  168. block/blk-mq-cpumap.c +5 −4
  169. block/blk-mq-sysfs.c +22 −12
  170. block/blk-mq-tag.c +20 −7
  171. block/blk-mq-tag.h +2 −0
  172. block/blk-mq.c +77 −41
  173. block/blk-mq.h +2 −1
  174. crypto/asymmetric_keys/x509_public_key.c +0 −4
  175. drivers/acpi/ec.c +2 −0
  176. drivers/acpi/pci_irq.c +1 −0
  177. drivers/acpi/pci_link.c +14 −2
  178. drivers/atm/he.c +2 −5
  179. drivers/atm/solos-pci.c +10 −2
  180. drivers/base/cacheinfo.c +8 −2
  181. drivers/base/power/opp.c +12 −5
  182. drivers/block/loop.c +5 −6
  183. drivers/block/null_blk.c +1 −1
  184. drivers/block/nvme-core.c +24 −28
  185. drivers/block/virtio_blk.c +1 −1
  186. drivers/block/xen-blkback/xenbus.c +20 −18
  187. drivers/block/xen-blkfront.c +10 −9
  188. drivers/char/hw_random/xgene-rng.c +4 −3
  189. drivers/clocksource/rockchip_timer.c +1 −1
  190. drivers/clocksource/timer-keystone.c +1 −1
  191. drivers/crypto/marvell/cesa.h +27 −0
  192. drivers/crypto/marvell/cipher.c +3 −4
  193. drivers/crypto/marvell/hash.c +3 −5
  194. drivers/crypto/qat/qat_common/adf_aer.c +3 −0
  195. drivers/dma/at_xdmac.c +12 −3
  196. drivers/dma/dmaengine.c +9 −1
  197. drivers/dma/dw/core.c +2 −2
  198. drivers/dma/idma64.c +8 −8
  199. drivers/dma/pxa_dma.c +25 −6
  200. drivers/dma/sun4i-dma.c +3 −3
  201. drivers/dma/xgene-dma.c +17 −29
  202. drivers/dma/zx296702_dma.c +1 −1
  203. drivers/extcon/extcon.c +1 −1
  204. drivers/firmware/Kconfig +8 −0
  205. drivers/firmware/Makefile +2 −1
  206. drivers/firmware/efi/libstub/arm-stub.c +73 −15
  207. drivers/firmware/efi/libstub/efistub.h +0 −4
  208. drivers/firmware/qcom_scm-64.c +63 −0
  209. drivers/gpu/drm/amd/amdgpu/amdgpu.h +6 −5
  210. drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c +1 −1
  211. drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c +4 −2
  212. drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c +3 −41
  213. drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +82 −58
  214. drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c +5 −5
  215. drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +7 −2
  216. drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +4 −0
  217. drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c +14 −11
  218. drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c +1 −1
  219. drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +12 −4
  220. drivers/gpu/drm/amd/amdgpu/amdgpu_ih.c +1 −1
  221. drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c +1 −1
  222. drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +3 −2
  223. drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +9 −10
  224. drivers/gpu/drm/amd/amdgpu/amdgpu_object.h +2 −0
  225. drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c +4 −1
  226. drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c +4 −4
  227. drivers/gpu/drm/amd/amdgpu/amdgpu_sa.c +31 −16
  228. drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c +25 −40
  229. drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c +24 −3
  230. drivers/gpu/drm/amd/amdgpu/amdgpu_test.c +5 −3
  231. drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +1 −1
  232. drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c +1 −1
  233. drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +47 −33
  234. drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c +4 −4
  235. drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +11 −34
  236. drivers/gpu/drm/amd/amdgpu/atombios_encoders.c +1 −2
  237. drivers/gpu/drm/amd/amdgpu/cz_smc.c +4 −2
  238. drivers/gpu/drm/amd/amdgpu/fiji_smc.c +2 −2
  239. drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c +22 −52
  240. drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +29 −50
  241. drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c +6 −2
  242. drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c +6 −2
  243. drivers/gpu/drm/amd/amdgpu/iceland_smc.c +1 −1
  244. drivers/gpu/drm/amd/amdgpu/tonga_smc.c +2 −2
  245. drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c +2 −2
  246. drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c +2 −2
  247. drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c +12 −8
  248. drivers/gpu/drm/amd/amdgpu/vi.c +2 −1
  249. drivers/gpu/drm/amd/include/cgs_linux.h +0 −17
  250. drivers/gpu/drm/amd/scheduler/gpu_sched_trace.h +41 −0
  251. drivers/gpu/drm/amd/scheduler/gpu_scheduler.c +78 −77
  252. drivers/gpu/drm/amd/scheduler/gpu_scheduler.h +20 −21
  253. drivers/gpu/drm/amd/scheduler/sched_fence.c +2 −2
  254. drivers/gpu/drm/drm_dp_mst_topology.c +52 −33
  255. drivers/gpu/drm/drm_fb_helper.c +5 −1
  256. drivers/gpu/drm/drm_ioctl.c +2 −1
  257. drivers/gpu/drm/drm_probe_helper.c +16 −3
  258. drivers/gpu/drm/exynos/exynos7_drm_decon.c +0 −12
  259. drivers/gpu/drm/exynos/exynos_dp_core.c +0 −23
  260. drivers/gpu/drm/exynos/exynos_drm_core.c +0 −6
  261. drivers/gpu/drm/exynos/exynos_drm_crtc.c +0 −15
  262. drivers/gpu/drm/exynos/exynos_drm_drv.c +2 −0
  263. drivers/gpu/drm/exynos/exynos_drm_drv.h +0 −4
  264. drivers/gpu/drm/exynos/exynos_drm_fimc.c +18 −18
  265. drivers/gpu/drm/exynos/exynos_drm_fimd.c +1 −13
  266. drivers/gpu/drm/exynos/exynos_drm_g2d.c +0 −3
  267. drivers/gpu/drm/exynos/exynos_drm_gem.c +41 −53
  268. drivers/gpu/drm/exynos/exynos_drm_gem.h +2 −4
  269. drivers/gpu/drm/exynos/exynos_drm_rotator.c +1 −1
  270. drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c +2 −1
  271. drivers/gpu/drm/i915/i915_irq.c +26 −0
  272. drivers/gpu/drm/i915/intel_audio.c +1 −1
  273. drivers/gpu/drm/i915/intel_bios.c +11 −1
  274. drivers/gpu/drm/i915/intel_display.c +5 −2
  275. drivers/gpu/drm/i915/intel_dp_mst.c +8 −1
  276. drivers/gpu/drm/i915/intel_hotplug.c +1 −1
  277. drivers/gpu/drm/i915/intel_lrc.c +32 −7
  278. drivers/gpu/drm/i915/intel_lrc.h +2 −0
  279. drivers/gpu/drm/i915/intel_runtime_pm.c +2 −1
  280. drivers/gpu/drm/mgag200/mgag200_fb.c +23 −8
  281. drivers/gpu/drm/mgag200/mgag200_main.c +20 −16
  282. drivers/gpu/drm/qxl/qxl_display.c +8 −6
  283. drivers/gpu/drm/radeon/atombios_encoders.c +4 −4
  284. drivers/gpu/drm/radeon/radeon_device.c +4 −0
  285. drivers/gpu/drm/radeon/radeon_dp_mst.c +9 −2
  286. drivers/gpu/drm/radeon/radeon_fb.c +1 −31
  287. drivers/gpu/drm/radeon/si_dpm.c +1 −0
  288. drivers/gpu/drm/ttm/ttm_bo.c +16 −12
  289. drivers/gpu/drm/vmwgfx/Kconfig +1 −1
  290. drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c +8 −0
  291. drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c +1 −2
  292. drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +2 −8
  293. drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +4 −3
  294. drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c +4 −2
  295. drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +1 −2
  296. drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c +1 −1
  297. drivers/gpu/drm/vmwgfx/vmwgfx_resource.c +21 −8
  298. drivers/gpu/drm/vmwgfx/vmwgfx_shader.c +1 −1
  299. drivers/gpu/drm/vmwgfx/vmwgfx_surface.c +8 −3
  300. drivers/hv/channel_mgmt.c +17 −0
  301. drivers/hwmon/abx500.c +1 −0
  302. drivers/hwmon/gpio-fan.c +1 −0
  303. drivers/hwmon/pwm-fan.c +1 −0
  304. drivers/idle/intel_idle.c +10 −2
  305. drivers/infiniband/hw/mlx5/main.c +1 −66
  306. drivers/infiniband/hw/mlx5/mlx5_ib.h +0 −2
  307. drivers/infiniband/hw/mlx5/qp.c +1 −3
  308. drivers/infiniband/ulp/ipoib/ipoib.h +3 −1
  309. drivers/infiniband/ulp/ipoib/ipoib_main.c +18 −0
  310. drivers/infiniband/ulp/ipoib/ipoib_multicast.c +14 −12
  311. drivers/infiniband/ulp/iser/iscsi_iser.c +5 −0
  312. drivers/infiniband/ulp/iser/iscsi_iser.h +1 −0
  313. drivers/infiniband/ulp/iser/iser_memory.c +12 −6
  314. drivers/infiniband/ulp/iser/iser_verbs.c +13 −8
  315. drivers/infiniband/ulp/isert/ib_isert.c +186 −107
  316. drivers/infiniband/ulp/isert/ib_isert.h +9 −12
  317. drivers/input/joystick/Kconfig +1 −0
  318. drivers/input/joystick/walkera0701.c +2 −2
  319. drivers/input/keyboard/omap4-keypad.c +1 −1
  320. drivers/input/misc/pm8941-pwrkey.c +1 −1
  321. drivers/input/misc/uinput.c +1 −1
  322. drivers/input/mouse/elan_i2c.h +1 −1
  323. drivers/input/mouse/elan_i2c_core.c +19 −7
  324. drivers/input/mouse/elan_i2c_i2c.c +2 −2
  325. drivers/input/mouse/elan_i2c_smbus.c +2 −2
  326. drivers/input/mouse/synaptics.c +4 −8
  327. drivers/input/serio/libps2.c +14 −8
  328. drivers/input/serio/parkbd.c +1 −0
  329. drivers/input/touchscreen/imx6ul_tsc.c +22 −12
  330. drivers/input/touchscreen/mms114.c +2 −2
  331. drivers/iommu/Kconfig +1 −1
  332. drivers/iommu/intel-iommu.c +5 −3
  333. drivers/iommu/iova.c +69 −51
  334. drivers/irqchip/irq-atmel-aic5.c +16 −8
  335. drivers/irqchip/irq-gic-v3-its-pci-msi.c +1 −1
  336. drivers/irqchip/irq-gic-v3-its.c +3 −0
  337. drivers/irqchip/irq-mips-gic.c +10 −2
  338. drivers/md/bitmap.c +2 −1
  339. drivers/md/dm-crypt.c +15 −2
  340. drivers/md/dm-thin.c +4 −0
  341. drivers/md/md.c +5 −0
  342. drivers/md/multipath.c +1 −2
  343. drivers/md/raid0.c +6 −6
  344. drivers/md/raid1.c +4 −7
  345. drivers/md/raid10.c +3 −6
  346. drivers/md/raid5.c +7 −4
  347. drivers/misc/cxl/sysfs.c +2 −0
  348. drivers/misc/mei/debugfs.c +2 −1
  349. drivers/mmc/core/core.c +4 −2
  350. drivers/mmc/core/host.c +2 −2
  351. drivers/mmc/host/pxamci.c +22 −44
  352. drivers/mmc/host/sunxi-mmc.c +39 −14
  353. drivers/mtd/ubi/io.c +5 −0
  354. drivers/mtd/ubi/vtbl.c +1 −0
  355. drivers/mtd/ubi/wl.c +1 −0
  356. drivers/net/arcnet/arcnet.c +1 −1
  357. drivers/net/dsa/mv88e6xxx.c +3 −0
  358. drivers/net/ethernet/apm/xgene/xgene_enet_hw.c +16 −8
  359. drivers/net/ethernet/arc/emac_arc.c +1 −0
  360. drivers/net/ethernet/broadcom/bcmsysport.c +1 −0
  361. drivers/net/ethernet/broadcom/bnx2x/bnx2x.h +1 −0
  362. drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +14 −6
  363. drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c +10 −2
  364. drivers/net/ethernet/broadcom/genet/bcmgenet.c +1 −0
  365. drivers/net/ethernet/brocade/bna/bfa_ioc.c +7 −6
  366. drivers/net/ethernet/brocade/bna/bna_tx_rx.c +2 −0
  367. drivers/net/ethernet/brocade/bna/bna_types.h +1 −0
  368. drivers/net/ethernet/brocade/bna/bnad.c +28 −1
  369. drivers/net/ethernet/brocade/bna/bnad.h +2 −0
  370. drivers/net/ethernet/brocade/bna/bnad_ethtool.c +4 −0
  371. drivers/net/ethernet/chelsio/cxgb4/t4_pci_id_tbl.h +5 −0
  372. drivers/net/ethernet/emulex/benet/be.h +1 −0
  373. drivers/net/ethernet/emulex/benet/be_main.c +10 −0
  374. drivers/net/ethernet/freescale/gianfar.c +10 −5
  375. drivers/net/ethernet/freescale/gianfar_ptp.c +1 −0
  376. drivers/net/ethernet/freescale/ucc_geth.c +7 −1
  377. drivers/net/ethernet/hisilicon/hip04_eth.c +1 −1
  378. drivers/net/ethernet/ibm/emac/core.h +3 −3
  379. drivers/net/ethernet/intel/i40e/i40e_adminq.c +9 −0
  380. drivers/net/ethernet/intel/i40e/i40e_main.c +2 −1
  381. drivers/net/ethernet/intel/i40evf/i40e_adminq.c +9 −0
  382. drivers/net/ethernet/marvell/mvneta.c +5 −1
  383. drivers/net/ethernet/mellanox/mlx4/en_rx.c +0 −2
  384. drivers/net/ethernet/mellanox/mlx4/mcg.c +4 −3
  385. drivers/net/ethernet/mellanox/mlx5/core/fw.c +0 −22
  386. drivers/net/ethernet/micrel/ks8851.c +1 −0
  387. drivers/net/ethernet/moxa/moxart_ether.c +1 −0
  388. drivers/net/ethernet/qlogic/qlcnic/qlcnic.h +1 −0
  389. drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c +13 −5
  390. drivers/net/ethernet/realtek/8139cp.c +55 −56
  391. drivers/net/ethernet/realtek/r8169.c +1 −1
  392. drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c +8 −3
  393. drivers/net/ethernet/sun/sunvnet.c +11 −6
  394. drivers/net/ethernet/ti/netcp_core.c +35 −39
  395. drivers/net/ethernet/ti/netcp_ethss.c +20 −27
  396. drivers/net/ethernet/via/Kconfig +1 −1
  397. drivers/net/ethernet/xilinx/xilinx_emaclite.c +2 −0
  398. drivers/net/fjes/fjes_hw.c +4 −4
  399. drivers/net/geneve.c +14 −18
  400. drivers/net/irda/ali-ircc.c +0 −6
  401. drivers/net/macvtap.c +2 −2
  402. drivers/net/phy/fixed_phy.c +1 −1
  403. drivers/net/phy/marvell.c +9 −0
  404. drivers/net/phy/mdio-bcm-unimac.c +1 −0
  405. drivers/net/phy/mdio-gpio.c +1 −0
  406. drivers/net/phy/mdio-mux.c +13 −6
  407. drivers/net/phy/mdio_bus.c +21 −10
  408. drivers/net/phy/phy_device.c +48 −14
  409. drivers/net/phy/vitesse.c +0 −14
  410. drivers/net/ppp/ppp_generic.c +3 −1
  411. drivers/net/usb/Kconfig +11 −0
  412. drivers/net/usb/Makefile +1 −1
  413. drivers/net/usb/ch9200.c +432 −0
  414. drivers/net/vrf.c +2 −1
  415. drivers/net/vxlan.c +9 −6
  416. drivers/of/of_mdio.c +23 −4
  417. drivers/of/of_pci_irq.c +14 −8
  418. drivers/parisc/dino.c +3 −0
  419. drivers/parisc/lba_pci.c +1 −0
  420. drivers/pci/access.c +4 −23
  421. drivers/pci/bus.c +2 −0
  422. drivers/pci/host/pci-rcar-gen2.c +1 −0
  423. drivers/pci/pci-driver.c +4 −3
  424. drivers/pci/probe.c +11 −12
  425. drivers/pci/quirks.c +18 −2
  426. drivers/regulator/anatop-regulator.c +1 −0
  427. drivers/regulator/core.c +10 −11
  428. drivers/regulator/gpio-regulator.c +1 −0
  429. drivers/regulator/pbias-regulator.c +50 −6
  430. drivers/regulator/tps65218-regulator.c +1 −1
  431. drivers/regulator/vexpress.c +1 −0
  432. drivers/scsi/scsi_lib.c +1 −1
  433. drivers/spi/spi-atmel.c +2 −0
  434. drivers/spi/spi-bcm2835.c +3 −3
  435. drivers/spi/spi-meson-spifc.c +1 −0
  436. drivers/spi/spi-mt65xx.c +23 −30
  437. drivers/spi/spi-pxa2xx.c +4 −0
  438. drivers/spi/spi-xtensa-xtfpga.c +2 −2
  439. drivers/spi/spi.c +1 −2
  440. drivers/spi/spidev.c +2 −1
  441. drivers/staging/android/TODO +20 −0
  442. drivers/staging/android/ion/ion.c +3 −3
  443. drivers/staging/fbtft/fb_uc1611.c +1 −1
  444. drivers/staging/fbtft/fb_watterott.c +2 −2
  445. drivers/staging/fbtft/fbtft-core.c +3 −7
  446. drivers/staging/fbtft/flexfb.c +4 −7
  447. drivers/staging/lustre/README.txt +6 −10
  448. drivers/staging/most/Kconfig +1 −0
  449. drivers/staging/most/hdm-dim2/Kconfig +1 −0
  450. drivers/staging/most/hdm-usb/Kconfig +1 −1
  451. drivers/staging/most/mostcore/Kconfig +1 −0
  452. drivers/staging/unisys/visorbus/Makefile +0 −1
  453. drivers/staging/unisys/visorbus/visorbus_main.c +9 −4
  454. drivers/staging/unisys/visornic/visornic_main.c +11 −7
  455. drivers/target/iscsi/iscsi_target_parameters.c +3 −2
  456. drivers/target/target_core_device.c +26 −19
  457. drivers/target/target_core_hba.c +1 −1
  458. drivers/target/target_core_iblock.c +2 −0
  459. drivers/target/target_core_pr.c +67 −24
  460. drivers/target/target_core_tpg.c +4 −1
  461. drivers/thermal/Kconfig +9 −8
  462. drivers/thermal/cpu_cooling.c +31 −21
  463. drivers/thermal/db8500_cpufreq_cooling.c +1 −0
  464. drivers/thermal/power_allocator.c +189 −64
  465. drivers/thermal/thermal_core.c +28 −0
  466. drivers/thermal/ti-soc-thermal/Kconfig +3 −5
  467. drivers/thunderbolt/nhi.c +1 −1
  468. drivers/tty/serial/8250/8250_port.c +2 −0
  469. drivers/usb/chipidea/ci_hdrc_imx.c +1 −1
  470. drivers/usb/chipidea/ci_hdrc_usb2.c +19 −6
  471. drivers/usb/chipidea/udc.c +44 −40
  472. drivers/usb/core/config.c +3 −2
  473. drivers/usb/dwc3/dwc3-omap.c +2 −2
  474. drivers/usb/dwc3/gadget.c +0 −4
  475. drivers/usb/gadget/epautoconf.c +1 −0
  476. drivers/usb/gadget/udc/amd5536udc.c +20 −23
  477. drivers/usb/gadget/udc/atmel_usba_udc.c +11 −0
  478. drivers/usb/gadget/udc/bdc/bdc_core.c +1 −2
  479. drivers/usb/gadget/udc/dummy_hcd.c +30 −16
  480. drivers/usb/gadget/udc/gr_udc.c +1 −2
  481. drivers/usb/gadget/udc/mv_u3d_core.c +1 −2
  482. drivers/usb/gadget/udc/mv_udc_core.c +1 −2
  483. drivers/usb/host/xhci-mem.c +8 −9
  484. drivers/usb/host/xhci-pci.c +45 −45
  485. drivers/usb/host/xhci-ring.c +11 −2
  486. drivers/usb/host/xhci.c +11 −13
  487. drivers/usb/musb/musb_core.c +7 −0
  488. drivers/usb/musb/musb_cppi41.c +3 −0
  489. drivers/usb/musb/musb_dsps.c +5 −2
  490. drivers/usb/musb/ux500.c +2 −0
  491. drivers/usb/phy/Kconfig +1 −1
  492. drivers/usb/phy/phy-generic.c +2 −1
  493. drivers/usb/phy/phy-isp1301.c +1 −0
  494. drivers/usb/serial/option.c +24 −0
  495. drivers/usb/serial/whiteheat.c +31 −0
  496. drivers/watchdog/Kconfig +2 −1
  497. drivers/watchdog/bcm2835_wdt.c +8 −2
  498. drivers/watchdog/gef_wdt.c +1 −0
  499. drivers/watchdog/mena21_wdt.c +1 −0
  500. drivers/watchdog/moxart_wdt.c +1 −0
  501. fs/btrfs/btrfs_inode.h +0 −2
  502. fs/btrfs/disk-io.c +0 −2
  503. fs/btrfs/extent-tree.c +2 −5
  504. fs/btrfs/extent_io.c +57 −8
  505. fs/btrfs/inode.c +23 −22
  506. fs/btrfs/super.c +0 −2
  507. fs/btrfs/transaction.c +32 −0
  508. fs/btrfs/transaction.h +4 −1
  509. fs/cifs/cifsencrypt.c +51 −2
  510. fs/cifs/smb2ops.c +6 −2
  511. fs/cifs/smb2pdu.c +69 −15
  512. fs/dax.c +12 −1
  513. fs/nfs/delegation.c +5 −3
  514. fs/nfs/delegation.h +1 −1
  515. fs/nfs/direct.c +5 −2
  516. fs/nfs/filelayout/filelayout.c +12 −19
  517. fs/nfs/nfs42proc.c +3 −1
  518. fs/nfs/nfs4proc.c +82 −45
  519. fs/nfs/nfs4state.c +1 −1
  520. fs/nfs/pagelist.c +1 −1
  521. fs/nfs/pnfs.c +25 −10
  522. fs/nfs/pnfs.h +7 −0
  523. fs/nfs/read.c +3 −0
  524. fs/nfs/write.c +3 −0
  525. fs/ocfs2/dlm/dlmmaster.c +6 −3
  526. fs/ocfs2/dlm/dlmrecovery.c +6 −2
  527. fs/ubifs/xattr.c +0 −3
  528. fs/userfaultfd.c +4 −4
  529. include/asm-generic/word-at-a-time.h +72 −8
  530. include/drm/drm_crtc_helper.h +1 −0
  531. include/drm/drm_dp_helper.h +4 −0
  532. include/drm/drm_dp_mst_helper.h +1 −0
  533. include/linux/acpi.h +1 −0
  534. include/linux/backing-dev.h +9 −2
  535. include/linux/blk-mq.h +1 −4
  536. include/linux/blkdev.h +2 −0
  537. include/linux/iova.h +2 −2
  538. include/linux/memcontrol.h +0 −1
  539. include/linux/mlx5/device.h +0 −11
  540. include/linux/mlx5/driver.h +0 −1
  541. include/linux/mm.h +21 −0
  542. include/linux/netdevice.h +1 −0
  543. include/linux/phy.h +5 −1
  544. include/linux/rcupdate.h +5 −6
  545. include/linux/skbuff.h +6 −3
  546. include/linux/spi/spi.h +1 −1
  547. include/linux/string.h +3 −0
  548. include/linux/sunrpc/xprtsock.h +3 −0
  549. include/linux/thermal.h +7 −1
  550. include/linux/wait.h +2 −3
  551. include/net/af_unix.h +5 −1
  552. include/net/flow.h +1 −0
  553. include/net/inet_timewait_sock.h +13 −1
  554. include/net/ip6_fib.h +2 −1
  555. include/net/ip6_tunnel.h +12 −5
  556. include/net/ip_fib.h +19 −11
  557. include/net/ip_tunnels.h +2 −0
  558. include/net/route.h +1 −1
  559. include/target/target_core_base.h +1 −0
  560. include/uapi/asm-generic/unistd.h +5 −3
  561. include/uapi/linux/lwtunnel.h +0 −4
  562. include/uapi/linux/userfaultfd.h +0 −2
  563. ipc/msg.c +7 −7
  564. ipc/shm.c +7 −6
  565. ipc/util.c +4 −4
  566. kernel/events/core.c +81 −33
  567. kernel/irq/proc.c +17 −2
  568. kernel/locking/lockdep.c +5 −5
  569. kernel/rcu/tree.c +5 −0
  570. kernel/sched/core.c +11 −3
  571. kernel/sched/wait.c +3 −4
  572. kernel/time/clocksource.c +1 −1
  573. lib/iommu-common.c +3 −3
  574. lib/rhashtable.c +1 −4
  575. lib/string.c +88 −0
  576. mm/dmapool.c +1 −1
  577. mm/hugetlb.c +8 −0
  578. mm/memcontrol.c +18 −13
  579. mm/migrate.c +12 −2
  580. mm/mmap.c +2 −1
  581. mm/slab.c +10 −3
  582. mm/vmscan.c +1 −1
  583. net/atm/clip.c +3 −0
  584. net/bluetooth/smp.c +6 −6
  585. net/bridge/br_multicast.c +2 −2
  586. net/core/dev.c +2 −0
  587. net/core/fib_rules.c +9 −5
  588. net/core/filter.c +1 −1
  589. net/core/net-sysfs.c +10 −2
  590. net/core/netpoll.c +8 −2
  591. net/core/rtnetlink.c +16 −10
  592. net/core/skbuff.c +5 −4
  593. net/core/sock.c +4 −8
  594. net/dccp/ackvec.c +4 −8
  595. net/dccp/ccid.c +1 −2
  596. net/dccp/minisocks.c +2 −2
  597. net/dsa/dsa.c +34 −7
  598. net/dsa/slave.c +8 −3
  599. net/dsa/tag_trailer.c +1 −1
  600. net/ipv4/arp.c +25 −14
  601. net/ipv4/fib_frontend.c +1 −0
  602. net/ipv4/fib_trie.c +1 −1
  603. net/ipv4/icmp.c +2 −2
  604. net/ipv4/inet_connection_sock.c +4 −4
  605. net/ipv4/inet_timewait_sock.c +10 −6
  606. net/ipv4/ip_tunnel_core.c +29 −25
  607. net/ipv4/route.c +5 −2
  608. net/ipv4/tcp_cubic.c +8 −2
  609. net/ipv4/tcp_minisocks.c +6 −7
  610. net/ipv4/tcp_output.c +1 −0
  611. net/ipv4/udp.c +2 −1
  612. net/ipv4/xfrm4_policy.c +2 −0
  613. net/ipv6/addrconf.c +3 −4
  614. net/ipv6/ip6_fib.c +19 −7
  615. net/ipv6/ip6_gre.c +55 −38
  616. net/ipv6/ip6_output.c +8 −6
  617. net/ipv6/ip6_tunnel.c +106 −41
  618. net/ipv6/route.c +12 −7
  619. net/l2tp/l2tp_core.c +9 −2
  620. net/mac80211/cfg.c +8 −5
  621. net/netfilter/nf_log.c +7 −2
  622. net/netfilter/nft_compat.c +18 −6
  623. net/netlink/af_netlink.c +49 −14
  624. net/netlink/af_netlink.h +10 −0
  625. net/openvswitch/Kconfig +2 −1
  626. net/openvswitch/conntrack.c +5 −3
  627. net/openvswitch/datapath.c +2 −2
  628. net/openvswitch/flow_netlink.c +59 −23
  629. net/openvswitch/flow_table.c +12 −11
  630. net/openvswitch/flow_table.h +1 −1
  631. net/packet/af_packet.c +17 −15
  632. net/sched/cls_fw.c +15 −15
  633. net/sctp/associola.c +11 −9
  634. net/sctp/protocol.c +41 −23
  635. net/sctp/sm_sideeffect.c +24 −20
  636. net/sunrpc/sched.c +5 −9
  637. net/sunrpc/xprt.c +6 −0
  638. net/sunrpc/xprtrdma/fmr_ops.c +0 −19
  639. net/sunrpc/xprtrdma/frwr_ops.c +0 −5
  640. net/sunrpc/xprtrdma/physical_ops.c +1 −9
  641. net/sunrpc/xprtrdma/verbs.c +1 −1
  642. net/sunrpc/xprtrdma/xprt_rdma.h +0 −1
  643. net/sunrpc/xprtsock.c +11 −4
  644. net/tipc/msg.c +1 −0
  645. net/unix/af_unix.c +14 −1
  646. samples/kprobes/jprobe_example.c +7 −7
  647. samples/kprobes/kprobe_example.c +3 −3
  648. samples/kprobes/kretprobe_example.c +2 −2
  649. scripts/extract-cert.c +0 −4
  650. scripts/sign-file.c +77 −17
  651. security/keys/gc.c +4 −4
  652. sound/arm/Kconfig +8 −7
  653. sound/pci/hda/hda_tegra.c +25 −5
  654. sound/pci/hda/patch_realtek.c +19 −12
  655. sound/soc/au1x/psc-i2s.c +0 −1
  656. sound/soc/codecs/rt5645.c +13 −9
  657. sound/soc/codecs/wm0010.c +9 −14
  658. sound/soc/codecs/wm8960.c +18 −8
  659. sound/soc/codecs/wm8962.c +2 −1
  660. sound/soc/davinci/davinci-mcasp.c +7 −7
  661. sound/soc/fsl/fsl-asoc-card.c +2 −1
  662. sound/soc/fsl/fsl_ssi.c +3 −2
  663. sound/soc/intel/haswell/sst-haswell-ipc.c +12 −8
  664. sound/soc/mediatek/mtk-afe-pcm.c +17 −0
  665. sound/soc/pxa/Kconfig +0 −2
  666. sound/soc/pxa/pxa2xx-ac97.c +2 −2
  667. sound/soc/soc-dapm.c +1 −1
  668. sound/soc/soc-utils.c +9 −0
  669. sound/soc/spear/Kconfig +1 −1
  670. sound/soc/sti/uniperif_player.c +10 −4
  671. sound/soc/sti/uniperif_reader.c +5 −1
  672. tools/build/Makefile.feature +6 −2
  673. tools/build/feature/Makefile +9 −1
  674. tools/build/feature/test-all.c +10 −0
  675. tools/build/feature/test-get_cpuid.c +7 −0
  676. tools/build/feature/test-numa_num_possible_cpus.c +6 −0
  677. tools/lib/traceevent/event-parse.c +20 −3
  678. tools/perf/Documentation/intel-pt.txt +0 −15
  679. tools/perf/config/Makefile +15 −5
  680. tools/perf/util/probe-event.c +7 −6
  681. tools/perf/util/session.c +4 −1
  682. tools/perf/util/stat.c +14 −2
  683. tools/perf/util/symbol-elf.c +14 −23
  684. tools/perf/util/util.c +1 −1
  685. tools/power/x86/turbostat/turbostat.c +34 −5
  686. tools/testing/selftests/membarrier/Makefile +3 −4
  687. tools/testing/selftests/membarrier/membarrier_test.c +1 −4
  688. tools/testing/selftests/vm/Makefile +6 −3
  689. tools/testing/selftests/vm/userfaultfd.c +29 −25
  690. virt/kvm/kvm_main.c +2 −2
Documentation/Changes+1−1
@@ -43,7 +43,7 @@ o udev 081 # udevd --version · 42 unmodified lines
4343 o grub 0.93 # grub --version || grub-install --version
4444 o mcelog 0.6 # mcelog --version
4545 o iptables 1.4.2 # iptables -V
46−o openssl & libcrypto 1.0.1k # openssl version
46+o openssl & libcrypto 1.0.0 # openssl version
4747
4848
4949 Kernel compilation
Documentation/devicetree/bindings/arm/gic-v3.txt+5−0
@@ -57,6 +57,8 @@ used to route Message Signalled Interrupts (MSI) to the CPUs. · 56 unmodified lines
5757 These nodes must have the following properties:
5858 - compatible : Should at least contain "arm,gic-v3-its".
5959 - msi-controller : Boolean property. Identifies the node as an MSI controller
60+- #msi-cells: Must be <1>. The single msi-cell is the DeviceID of the device
61+ which will generate the MSI.
6062 - reg: Specifies the base physical address and size of the ITS
6163 registers.
6264
@@ -83,6 +85,7 @@ Examples: · 20 unmodified lines
8385 gic-its@2c200000 {
8486 compatible = "arm,gic-v3-its";
8587 msi-controller;
88+ #msi-cells = <1>;
8689 reg = <0x0 0x2c200000 0 0x200000>;
8790 };
8891 };
@@ -107,12 +110,14 @@ Examples: · 18 unmodified lines
107110 gic-its@2c200000 {
108111 compatible = "arm,gic-v3-its";
109112 msi-controller;
113+ #msi-cells = <1>;
110114 reg = <0x0 0x2c200000 0 0x200000>;
111115 };
112116
113117 gic-its@2c400000 {
114118 compatible = "arm,gic-v3-its";
115119 msi-controller;
120+ #msi-cells = <1>;
116121 reg = <0x0 0x2c400000 0 0x200000>;
117122 };
118123 };
Documentation/devicetree/bindings/arm/idle-states.txt+1−1
@@ -497,7 +497,7 @@ cpus { · 496 unmodified lines
497497 };
498498
499499 idle-states {
500− entry-method = "arm,psci";
500+ entry-method = "psci";
501501
502502 CPU_RETENTION_0_0: cpu-retention-0-0 {
503503 compatible = "arm,idle-state";
Documentation/devicetree/bindings/gpio/gpio.txt+3−1
@@ -16,7 +16,9 @@ properties, each containing a 'gpio-list': · 15 unmodified lines
1616 GPIO properties should be named "[<name>-]gpios", with <name> being the purpose
1717 of this GPIO for the device. While a non-existent <name> is considered valid
1818 for compatibility reasons (resolving to the "gpios" property), it is not allowed
19−for new bindings.
19+for new bindings. Also, GPIO properties named "[<name>-]gpio" are valid and old
20+bindings use it, but are only supported for compatibility reasons and should not
21+be used for newer bindings since it has been deprecated.
2022
2123 GPIO properties can contain one or more GPIO phandles, but only in exceptional
2224 cases should they contain more than one. If your device uses several GPIOs with
Documentation/devicetree/bindings/iio/accel/bma180.txt+6−2
@@ -1,10 +1,11 @@
1−* Bosch BMA180 triaxial acceleration sensor
1+* Bosch BMA180 / BMA250 triaxial acceleration sensor
22
33 http://omapworld.com/BMA180_111_1002839.pdf
4+http://ae-bst.resource.bosch.com/media/products/dokumente/bma250/bst-bma250-ds002-05.pdf
45
56 Required properties:
67
7− - compatible : should be "bosch,bma180"
8+ - compatible : should be "bosch,bma180" or "bosch,bma250"
89 - reg : the I2C address of the sensor
910
1011 Optional properties:
@@ -13,6 +14,9 @@ Optional properties: · 2 unmodified lines
1314
1415 - interrupts : interrupt mapping for GPIO IRQ, it should by configured with
1516 flags IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_EDGE_RISING
17+ For the bma250 the first interrupt listed must be the one
18+ connected to the INT1 pin, the second (optional) interrupt
19+ listed must be the one connected to the INT2 pin.
1620
1721 Example:
1822
Documentation/devicetree/bindings/input/cypress,cyapa.txt+1−1
@@ -25,7 +25,7 @@ Example: · 24 unmodified lines
2525 /* Cypress Gen3 touchpad */
2626 touchpad@67 {
2727 compatible = "cypress,cyapa";
28− reg = <0x24>;
28+ reg = <0x67>;
2929 interrupt-parent = <&gpio>;
3030 interrupts = <2 IRQ_TYPE_EDGE_FALLING>; /* GPIO 2 */
3131 wakeup-source;
Documentation/devicetree/bindings/interrupt-controller/qca,ath79-misc-intc.txt+18−2
@@ -4,8 +4,8 @@ The MISC interrupt controller is a secondary controller for lower priority · 3 unmodified lines
44 interrupt.
55
66 Required Properties:
7−- compatible: has to be "qca,<soctype>-cpu-intc", "qca,ar7100-misc-intc"
8− as fallback
7+- compatible: has to be "qca,<soctype>-cpu-intc", "qca,ar7100-misc-intc" or
8+ "qca,<soctype>-cpu-intc", "qca,ar7240-misc-intc"
99 - reg: Base address and size of the controllers memory area
1010 - interrupt-parent: phandle of the parent interrupt controller.
1111 - interrupts: Interrupt specifier for the controllers interrupt.
@@ -13,6 +13,9 @@ Required Properties: · 1 unmodified line
1313 - #interrupt-cells : Specifies the number of cells needed to encode interrupt
1414 source, should be 1
1515
16+Compatible fallback depends on the SoC. Use ar7100 for ar71xx and ar913x,
17+use ar7240 for all other SoCs.
18+
1619 Please refer to interrupts.txt in this directory for details of the common
1720 Interrupt Controllers bindings used by client devices.
1821
@@ -28,3 +31,16 @@ Example: · 9 unmodified lines
2831 interrupt-controller;
2932 #interrupt-cells = <1>;
3033 };
34+
35+Another example:
36+
37+ interrupt-controller@18060010 {
38+ compatible = "qca,ar9331-misc-intc", qca,ar7240-misc-intc";
39+ reg = <0x18060010 0x4>;
40+
41+ interrupt-parent = <&cpuintc>;
42+ interrupts = <6>;
43+
44+ interrupt-controller;
45+ #interrupt-cells = <1>;
46+ };
Documentation/devicetree/bindings/pci/pci-rcar-gen2.txt+2−1
@@ -7,7 +7,8 @@ OHCI and EHCI controllers. · 6 unmodified lines
77
88 Required properties:
99 - compatible: "renesas,pci-r8a7790" for the R8A7790 SoC;
10− "renesas,pci-r8a7791" for the R8A7791 SoC.
10+ "renesas,pci-r8a7791" for the R8A7791 SoC;
11+ "renesas,pci-r8a7794" for the R8A7794 SoC.
1112 - reg: A list of physical regions to access the device: the first is
1213 the operational registers for the OHCI/EHCI controllers and the
1314 second is for the bridge configuration and control registers.
Documentation/devicetree/bindings/regulator/pbias-regulator.txt+6−1
@@ -2,7 +2,12 @@ PBIAS internal regulator for SD card dual voltage i/o pads on OMAP SoCs. · 1 unmodified line
22
33 Required properties:
44 - compatible:
5− - "ti,pbias-omap" for OMAP2, OMAP3, OMAP4, OMAP5, DRA7.
5+ - should be "ti,pbias-dra7" for DRA7
6+ - should be "ti,pbias-omap2" for OMAP2
7+ - should be "ti,pbias-omap3" for OMAP3
8+ - should be "ti,pbias-omap4" for OMAP4
9+ - should be "ti,pbias-omap5" for OMAP5
10+ - "ti,pbias-omap" is deprecated
611 - reg: pbias register offset from syscon base and size of pbias register.
712 - syscon : phandle of the system control module
813 - regulator-name : should be
Documentation/devicetree/bindings/spi/spi-mt65xx.txt+10−6
@@ -15,17 +15,18 @@ Required properties: · 14 unmodified lines
1515 - interrupts: Should contain spi interrupt
1616
1717 - clocks: phandles to input clocks.
18− The first should be <&topckgen CLK_TOP_SPI_SEL>.
19− The second should be one of the following.
18+ The first should be one of the following. It's PLL.
2019 - <&clk26m>: specify parent clock 26MHZ.
2120 - <&topckgen CLK_TOP_SYSPLL3_D2>: specify parent clock 109MHZ.
2221 It's the default one.
2322 - <&topckgen CLK_TOP_SYSPLL4_D2>: specify parent clock 78MHZ.
2423 - <&topckgen CLK_TOP_UNIVPLL2_D4>: specify parent clock 104MHZ.
2524 - <&topckgen CLK_TOP_UNIVPLL1_D8>: specify parent clock 78MHZ.
25+ The second should be <&topckgen CLK_TOP_SPI_SEL>. It's clock mux.
26+ The third is <&pericfg CLK_PERI_SPI0>. It's clock gate.
2627
27−- clock-names: shall be "spi-clk" for the controller clock, and
28− "parent-clk" for the parent clock.
28+- clock-names: shall be "parent-clk" for the parent clock, "sel-clk" for the
29+ muxes clock, and "spi-clk" for the clock gate.
2930
3031 Optional properties:
3132 - mediatek,pad-select: specify which pins group(ck/mi/mo/cs) spi
@@ -44,8 +45,11 @@ spi: spi@1100a000 { · 12 unmodified lines
4445 #size-cells = <0>;
4546 reg = <0 0x1100a000 0 0x1000>;
4647 interrupts = <GIC_SPI 110 IRQ_TYPE_LEVEL_LOW>;
47− clocks = <&topckgen CLK_TOP_SPI_SEL>, <&topckgen CLK_TOP_SYSPLL3_D2>;
48− clock-names = "spi-clk", "parent-clk";
48+ clocks = <&topckgen CLK_TOP_SYSPLL3_D2>,
49+ <&topckgen CLK_TOP_SPI_SEL>,
50+ <&pericfg CLK_PERI_SPI0>;
51+ clock-names = "parent-clk", "sel-clk", "spi-clk";
52+
4953 mediatek,pad-select = <0>;
5054 status = "disabled";
5155 };
Documentation/devicetree/bindings/thermal/thermal.txt+14−13
@@ -55,19 +55,11 @@ of heat dissipation). For example a fan's cooling states correspond to · 54 unmodified lines
5555 the different fan speeds possible. Cooling states are referred to by
5656 single unsigned integers, where larger numbers mean greater heat
5757 dissipation. The precise set of cooling states associated with a device
58−(as referred to be the cooling-min-state and cooling-max-state
58+(as referred to by the cooling-min-level and cooling-max-level
5959 properties) should be defined in a particular device's binding.
6060 For more examples of cooling devices, refer to the example sections below.
6161
6262 Required properties:
63−- cooling-min-state: An integer indicating the smallest
64− Type: unsigned cooling state accepted. Typically 0.
65− Size: one cell
66−
67−- cooling-max-state: An integer indicating the largest
68− Type: unsigned cooling state accepted.
69− Size: one cell
70−
7163 - #cooling-cells: Used to provide cooling device specific information
7264 Type: unsigned while referring to it. Must be at least 2, in order
7365 Size: one cell to specify minimum and maximum cooling state used
@@ -77,6 +69,15 @@ Required properties: · 3 unmodified lines
7769 See Cooling device maps section below for more details
7870 on how consumers refer to cooling devices.
7971
72+Optional properties:
73+- cooling-min-level: An integer indicating the smallest
74+ Type: unsigned cooling state accepted. Typically 0.
75+ Size: one cell
76+
77+- cooling-max-level: An integer indicating the largest
78+ Type: unsigned cooling state accepted.
79+ Size: one cell
80+
8081 * Trip points
8182
8283 The trip node is a node to describe a point in the temperature domain
@@ -225,8 +226,8 @@ cpus { · 142 unmodified lines
225226 396000 950000
226227 198000 850000
227228 >;
228− cooling-min-state = <0>;
229− cooling-max-state = <3>;
229+ cooling-min-level = <0>;
230+ cooling-max-level = <3>;
230231 #cooling-cells = <2>; /* min followed by max */
231232 };
232233 ...
@@ -240,8 +241,8 @@ cpus { · 7 unmodified lines
240241 */
241242 fan0: fan@0x48 {
242243 ...
243− cooling-min-state = <0>;
244− cooling-max-state = <9>;
244+ cooling-min-level = <0>;
245+ cooling-max-level = <9>;
245246 #cooling-cells = <2>; /* min followed by max */
246247 };
247248 };
Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt+1−0
@@ -6,6 +6,7 @@ Required properties: · 5 unmodified lines
66 "lsi,zevio-usb"
77 "qcom,ci-hdrc"
88 "chipidea,usb2"
9+ "xlnx,zynq-usb-2.20a"
910 - reg: base address and length of the registers
1011 - interrupts: interrupt for the USB controller
1112
Documentation/devicetree/bindings/vendor-prefixes.txt+1−0
@@ -203,6 +203,7 @@ sitronix Sitronix Technology Corporation · 202 unmodified lines
203203 skyworks Skyworks Solutions, Inc.
204204 smsc Standard Microsystems Corporation
205205 snps Synopsys, Inc.
206+socionext Socionext Inc.
206207 solidrun SolidRun
207208 solomon Solomon Systech Limited
208209 sony Sony Corporation
Documentation/input/multi-touch-protocol.txt+1−1
@@ -361,7 +361,7 @@ For win8 devices with both T and C coordinates, the position mapping is · 360 unmodified lines
361361 ABS_MT_POSITION_X := T_X
362362 ABS_MT_POSITION_Y := T_Y
363363 ABS_MT_TOOL_X := C_X
364− ABS_MT_TOOL_X := C_Y
364+ ABS_MT_TOOL_Y := C_Y
365365
366366 Unfortunately, there is not enough information to specify both the touching
367367 ellipse and the tool ellipse, so one has to resort to approximations. One
Documentation/networking/vrf.txt+96−0
@@ -0,0 +1,96 @@
1+Virtual Routing and Forwarding (VRF)
2+====================================
3+The VRF device combined with ip rules provides the ability to create virtual
4+routing and forwarding domains (aka VRFs, VRF-lite to be specific) in the
5+Linux network stack. One use case is the multi-tenancy problem where each
6+tenant has their own unique routing tables and in the very least need
7+different default gateways.
8+
9+Processes can be "VRF aware" by binding a socket to the VRF device. Packets
10+through the socket then use the routing table associated with the VRF
11+device. An important feature of the VRF device implementation is that it
12+impacts only Layer 3 and above so L2 tools (e.g., LLDP) are not affected
13+(ie., they do not need to be run in each VRF). The design also allows
14+the use of higher priority ip rules (Policy Based Routing, PBR) to take
15+precedence over the VRF device rules directing specific traffic as desired.
16+
17+In addition, VRF devices allow VRFs to be nested within namespaces. For
18+example network namespaces provide separation of network interfaces at L1
19+(Layer 1 separation), VLANs on the interfaces within a namespace provide
20+L2 separation and then VRF devices provide L3 separation.
21+
22+Design
23+------
24+A VRF device is created with an associated route table. Network interfaces
25+are then enslaved to a VRF device:
26+
27+ +-----------------------------+
28+ | vrf-blue | ===> route table 10
29+ +-----------------------------+
30+ | | |
31+ +------+ +------+ +-------------+
32+ | eth1 | | eth2 | ... | bond1 |
33+ +------+ +------+ +-------------+
34+ | |
35+ +------+ +------+
36+ | eth8 | | eth9 |
37+ +------+ +------+
38+
39+Packets received on an enslaved device and are switched to the VRF device
40+using an rx_handler which gives the impression that packets flow through
41+the VRF device. Similarly on egress routing rules are used to send packets
42+to the VRF device driver before getting sent out the actual interface. This
43+allows tcpdump on a VRF device to capture all packets into and out of the
44+VRF as a whole.[1] Similiarly, netfilter [2] and tc rules can be applied
45+using the VRF device to specify rules that apply to the VRF domain as a whole.
46+
47+[1] Packets in the forwarded state do not flow through the device, so those
48+ packets are not seen by tcpdump. Will revisit this limitation in a
49+ future release.
50+
51+[2] Iptables on ingress is limited to NF_INET_PRE_ROUTING only with skb->dev
52+ set to real ingress device and egress is limited to NF_INET_POST_ROUTING.
53+ Will revisit this limitation in a future release.
54+
55+
56+Setup
57+-----
58+1. VRF device is created with an association to a FIB table.
59+ e.g, ip link add vrf-blue type vrf table 10
60+ ip link set dev vrf-blue up
61+
62+2. Rules are added that send lookups to the associated FIB table when the
63+ iif or oif is the VRF device. e.g.,
64+ ip ru add oif vrf-blue table 10
65+ ip ru add iif vrf-blue table 10
66+
67+ Set the default route for the table (and hence default route for the VRF).
68+ e.g, ip route add table 10 prohibit default
69+
70+3. Enslave L3 interfaces to a VRF device.
71+ e.g, ip link set dev eth1 master vrf-blue
72+
73+ Local and connected routes for enslaved devices are automatically moved to
74+ the table associated with VRF device. Any additional routes depending on
75+ the enslaved device will need to be reinserted following the enslavement.
76+
77+4. Additional VRF routes are added to associated table.
78+ e.g., ip route add table 10 ...
79+
80+
81+Applications
82+------------
83+Applications that are to work within a VRF need to bind their socket to the
84+VRF device:
85+
86+ setsockopt(sd, SOL_SOCKET, SO_BINDTODEVICE, dev, strlen(dev)+1);
87+
88+or to specify the output device using cmsg and IP_PKTINFO.
89+
90+
91+Limitations
92+-----------
93+VRF device currently only works for IPv4. Support for IPv6 is under development.
94+
95+Index of original ingress interface is not available via cmsg. Will address
96+soon.
Documentation/power/pci.txt+38−13
@@ -979,20 +979,45 @@ every time right after the runtime_resume() callback has returned · 978 unmodified lines
979979 (alternatively, the runtime_suspend() callback will have to check if the
980980 device should really be suspended and return -EAGAIN if that is not the case).
981981
982−The runtime PM of PCI devices is disabled by default. It is also blocked by
983−pci_pm_init() that runs the pm_runtime_forbid() helper function. If a PCI
984−driver implements the runtime PM callbacks and intends to use the runtime PM
985−framework provided by the PM core and the PCI subsystem, it should enable this
986−feature by executing the pm_runtime_enable() helper function. However, the
987−driver should not call the pm_runtime_allow() helper function unblocking
988−the runtime PM of the device. Instead, it should allow user space or some
989−platform-specific code to do that (user space can do it via sysfs), although
990−once it has called pm_runtime_enable(), it must be prepared to handle the
982+The runtime PM of PCI devices is enabled by default by the PCI core. PCI
983+device drivers do not need to enable it and should not attempt to do so.
984+However, it is blocked by pci_pm_init() that runs the pm_runtime_forbid()
985+helper function. In addition to that, the runtime PM usage counter of
986+each PCI device is incremented by local_pci_probe() before executing the
987+probe callback provided by the device's driver.
988+
989+If a PCI driver implements the runtime PM callbacks and intends to use the
990+runtime PM framework provided by the PM core and the PCI subsystem, it needs
991+to decrement the device's runtime PM usage counter in its probe callback
992+function. If it doesn't do that, the counter will always be different from
993+zero for the device and it will never be runtime-suspended. The simplest
994+way to do that is by calling pm_runtime_put_noidle(), but if the driver
995+wants to schedule an autosuspend right away, for example, it may call
996+pm_runtime_put_autosuspend() instead for this purpose. Generally, it
997+just needs to call a function that decrements the devices usage counter
998+from its probe routine to make runtime PM work for the device.
999+
1000+It is important to remember that the driver's runtime_suspend() callback
1001+may be executed right after the usage counter has been decremented, because
1002+user space may already have cuased the pm_runtime_allow() helper function
1003+unblocking the runtime PM of the device to run via sysfs, so the driver must
1004+be prepared to cope with that.
1005+
1006+The driver itself should not call pm_runtime_allow(), though. Instead, it
1007+should let user space or some platform-specific code do that (user space can
1008+do it via sysfs as stated above), but it must be prepared to handle the
9911009 runtime PM of the device correctly as soon as pm_runtime_allow() is called
992−(which may happen at any time). [It also is possible that user space causes
993−pm_runtime_allow() to be called via sysfs before the driver is loaded, so in
994−fact the driver has to be prepared to handle the runtime PM of the device as
995−soon as it calls pm_runtime_enable().]
1010+(which may happen at any time, even before the driver is loaded).
1011+
1012+When the driver's remove callback runs, it has to balance the decrementation
1013+of the device's runtime PM usage counter at the probe time. For this reason,
1014+if it has decremented the counter in its probe callback, it must run
1015+pm_runtime_get_noresume() in its remove callback. [Since the core carries
1016+out a runtime resume of the device and bumps up the device's usage counter
1017+before running the driver's remove callback, the runtime PM of the device
1018+is effectively disabled for the duration of the remove execution and all
1019+runtime PM helper functions incrementing the device's usage counter are
1020+then effectively equivalent to pm_runtime_get_noresume().]
9961021
9971022 The runtime PM framework works by processing requests to suspend or resume
9981023 devices, or to check if they are idle (in which cases it is reasonable to
Documentation/ptp/testptp.c+1−0
@@ -18,6 +18,7 @@ · 17 unmodified lines
1818 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
1919 */
2020 #define _GNU_SOURCE
21+#define __SANE_USERSPACE_TYPES__ /* For PPC64, to get LL64 types */
2122 #include <errno.h>
2223 #include <fcntl.h>
2324 #include <inttypes.h>
Documentation/sysctl/net.txt+9−7
@@ -54,13 +54,15 @@ default_qdisc · 53 unmodified lines
5454 --------------
5555
5656 The default queuing discipline to use for network devices. This allows
57−overriding the default queue discipline of pfifo_fast with an
58−alternative. Since the default queuing discipline is created with the
59−no additional parameters so is best suited to queuing disciplines that
60−work well without configuration like stochastic fair queue (sfq),
61−CoDel (codel) or fair queue CoDel (fq_codel). Don't use queuing disciplines
62−like Hierarchical Token Bucket or Deficit Round Robin which require setting
63−up classes and bandwidths.
57+overriding the default of pfifo_fast with an alternative. Since the default
58+queuing discipline is created without additional parameters so is best suited
59+to queuing disciplines that work well without configuration like stochastic
60+fair queue (sfq), CoDel (codel) or fair queue CoDel (fq_codel). Don't use
61+queuing disciplines like Hierarchical Token Bucket or Deficit Round Robin
62+which require setting up classes and bandwidths. Note that physical multiqueue
63+interfaces still use mq as root qdisc, which in turn uses this default for its
64+leaves. Virtual devices (like e.g. lo or veth) ignore this setting and instead
65+default to noqueue.
6466 Default: pfifo_fast
6567
6668 busy_read
Documentation/thermal/power_allocator.txt+1−1
@@ -4,7 +4,7 @@ Power allocator governor tunables · 3 unmodified lines
44 Trip points
55 -----------
66
7−The governor requires the following two passive trip points:
7+The governor works optimally with the following two passive trip points:
88
99 1. "switch on" trip point: temperature above which the governor
1010 control loop starts operating. This is the first passive trip
MAINTAINERS+27−15
@@ -615,9 +615,8 @@ F: Documentation/hwmon/fam15h_power · 614 unmodified lines
615615 F: drivers/hwmon/fam15h_power.c
616616
617617 AMD GEODE CS5536 USB DEVICE CONTROLLER DRIVER
618−M: Thomas Dahlmann <dahlmann.thomas@arcor.de>
619618 L: linux-geode@lists.infradead.org (moderated for non-subscribers)
620−S: Supported
619+S: Orphan
621620 F: drivers/usb/gadget/udc/amd5536udc.*
622621
623622 AMD GEODE PROCESSOR/CHIPSET SUPPORT
@@ -808,6 +807,13 @@ S: Maintained · 184 unmodified lines
808807 F: drivers/video/fbdev/arcfb.c
809808 F: drivers/video/fbdev/core/fb_defio.c
810809
810+ARCNET NETWORK LAYER
811+M: Michael Grzeschik <m.grzeschik@pengutronix.de>
812+L: netdev@vger.kernel.org
813+S: Maintained
814+F: drivers/net/arcnet/
815+F: include/uapi/linux/if_arcnet.h
816+
811817 ARM MFM AND FLOPPY DRIVERS
812818 M: Ian Molton <spyro@f2s.com>
813819 S: Maintained
@@ -3394,7 +3400,6 @@ F: drivers/staging/dgnc/ · 2580 unmodified lines
33943400
33953401 DIGI EPCA PCI PRODUCTS
33963402 M: Lidza Louina <lidza.louina@gmail.com>
3397−M: Mark Hounschell <markh@compro.net>
33983403 M: Daeseok Youn <daeseok.youn@gmail.com>
33993404 L: driverdev-devel@linuxdriverproject.org
34003405 S: Maintained
@@ -5952,7 +5957,7 @@ F: virt/kvm/ · 2551 unmodified lines
59525957 KERNEL VIRTUAL MACHINE (KVM) FOR AMD-V
59535958 M: Joerg Roedel <joro@8bytes.org>
59545959 L: kvm@vger.kernel.org
5955−W: http://kvm.qumranet.com
5960+W: http://www.linux-kvm.org/
59565961 S: Maintained
59575962 F: arch/x86/include/asm/svm.h
59585963 F: arch/x86/kvm/svm.c
@@ -5960,7 +5965,7 @@ F: arch/x86/kvm/svm.c · 1 unmodified line
59605965 KERNEL VIRTUAL MACHINE (KVM) FOR POWERPC
59615966 M: Alexander Graf <agraf@suse.com>
59625967 L: kvm-ppc@vger.kernel.org
5963−W: http://kvm.qumranet.com
5968+W: http://www.linux-kvm.org/
59645969 T: git git://github.com/agraf/linux-2.6.git
59655970 S: Supported
59665971 F: arch/powerpc/include/asm/kvm*
@@ -8500,7 +8505,6 @@ F: Documentation/networking/LICENSE.qla3xxx · 2533 unmodified lines
85008505 F: drivers/net/ethernet/qlogic/qla3xxx.*
85018506
85028507 QLOGIC QLCNIC (1/10)Gb ETHERNET DRIVER
8503−M: Shahed Shaikh <shahed.shaikh@qlogic.com>
85048508 M: Dept-GELinuxNICDev@qlogic.com
85058509 L: netdev@vger.kernel.org
85068510 S: Supported
@@ -9904,8 +9908,8 @@ F: drivers/staging/media/lirc/ · 1397 unmodified lines
99049908 STAGING - LUSTRE PARALLEL FILESYSTEM
99059909 M: Oleg Drokin <oleg.drokin@intel.com>
99069910 M: Andreas Dilger <andreas.dilger@intel.com>
9907−L: HPDD-discuss@lists.01.org (moderated for non-subscribers)
9908−W: http://lustre.opensfs.org/
9911+L: lustre-devel@lists.lustre.org (moderated for non-subscribers)
9912+W: http://wiki.lustre.org/
99099913 S: Maintained
99109914 F: drivers/staging/lustre
99119915
@@ -10338,6 +10342,16 @@ F: include/uapi/linux/thermal.h · 426 unmodified lines
1033810342 F: include/linux/cpu_cooling.h
1033910343 F: Documentation/devicetree/bindings/thermal/
1034010344
10345+THERMAL/CPU_COOLING
10346+M: Amit Daniel Kachhap <amit.kachhap@gmail.com>
10347+M: Viresh Kumar <viresh.kumar@linaro.org>
10348+M: Javi Merino <javi.merino@arm.com>
10349+L: linux-pm@vger.kernel.org
10350+S: Supported
10351+F: Documentation/thermal/cpu-cooling-api.txt
10352+F: drivers/thermal/cpu_cooling.c
10353+F: include/linux/cpu_cooling.h
10354+
1034110355 THINGM BLINK(1) USB RGB LED DRIVER
1034210356 M: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
1034310357 S: Maintained
@@ -11187,7 +11201,7 @@ F: drivers/vlynq/vlynq.c · 843 unmodified lines
1118711201 F: include/linux/vlynq.h
1118811202
1118911203 VME SUBSYSTEM
11190−M: Martyn Welch <martyn.welch@ge.com>
11204+M: Martyn Welch <martyn@welchs.me.uk>
1119111205 M: Manohar Vanga <manohar.vanga@gmail.com>
1119211206 M: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1119311207 L: devel@driverdev.osuosl.org
@@ -11239,7 +11253,6 @@ VOLTAGE AND CURRENT REGULATOR FRAMEWORK · 45 unmodified lines
1123911253 M: Liam Girdwood <lgirdwood@gmail.com>
1124011254 M: Mark Brown <broonie@kernel.org>
1124111255 L: linux-kernel@vger.kernel.org
11242−W: http://opensource.wolfsonmicro.com/node/15
1124311256 W: http://www.slimlogic.co.uk/?p=48
1124411257 T: git git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git
1124511258 S: Supported
@@ -11253,6 +11266,7 @@ L: netdev@vger.kernel.org · 7 unmodified lines
1125311266 S: Maintained
1125411267 F: drivers/net/vrf.c
1125511268 F: include/net/vrf.h
11269+F: Documentation/networking/vrf.txt
1125611270
1125711271 VT1211 HARDWARE MONITOR DRIVER
1125811272 M: Juerg Haefliger <juergh@gmail.com>
@@ -11368,17 +11382,15 @@ WM97XX TOUCHSCREEN DRIVERS · 109 unmodified lines
1136811382 M: Mark Brown <broonie@kernel.org>
1136911383 M: Liam Girdwood <lrg@slimlogic.co.uk>
1137011384 L: linux-input@vger.kernel.org
11371−T: git git://opensource.wolfsonmicro.com/linux-2.6-touch
11372−W: http://opensource.wolfsonmicro.com/node/7
11385+W: https://github.com/CirrusLogic/linux-drivers/wiki
1137311386 S: Supported
1137411387 F: drivers/input/touchscreen/*wm97*
1137511388 F: include/linux/wm97xx.h
1137611389
1137711390 WOLFSON MICROELECTRONICS DRIVERS
1137811391 L: patches@opensource.wolfsonmicro.com
11379−T: git git://opensource.wolfsonmicro.com/linux-2.6-asoc
11380−T: git git://opensource.wolfsonmicro.com/linux-2.6-audioplus
11381−W: http://opensource.wolfsonmicro.com/content/linux-drivers-wolfson-devices
11392+T: git https://github.com/CirrusLogic/linux-drivers.git
11393+W: https://github.com/CirrusLogic/linux-drivers/wiki
1138211394 S: Supported
1138311395 F: Documentation/hwmon/wm83??
1138411396 F: arch/arm/mach-s3c64xx/mach-crag6410*
Makefile+1−1
@@ -1,7 +1,7 @@
11 VERSION = 4
22 PATCHLEVEL = 3
33 SUBLEVEL = 0
4−EXTRAVERSION = -rc2
4+EXTRAVERSION = -rc4
55 NAME = Hurr durr I'ma sheep
66
77 # *DOCUMENTATION*
arch/alpha/kernel/pci.c+6−1
@@ -242,7 +242,12 @@ pci_restore_srm_config(void) · 241 unmodified lines
242242
243243 void pcibios_fixup_bus(struct pci_bus *bus)
244244 {
245− struct pci_dev *dev;
245+ struct pci_dev *dev = bus->self;
246+
247+ if (pci_has_flag(PCI_PROBE_ONLY) && dev &&
248+ (dev->class >> 8) == PCI_CLASS_BRIDGE_PCI) {
249+ pci_read_bridge_bases(bus);
250+ }
246251
247252 list_for_each_entry(dev, &bus->devices, bus_list) {
248253 pdev_save_srm_config(dev);
arch/arc/include/asm/Kbuild+1−0
@@ -48,4 +48,5 @@ generic-y += types.h · 47 unmodified lines
4848 generic-y += ucontext.h
4949 generic-y += user.h
5050 generic-y += vga.h
51+generic-y += word-at-a-time.h
5152 generic-y += xor.h
arch/arm/boot/dts/am335x-phycore-som.dtsi+2−2
@@ -252,10 +252,10 @@ · 251 unmodified lines
252252 };
253253
254254 vdd1_reg: regulator@2 {
255− /* VDD_MPU voltage limits 0.95V - 1.26V with +/-4% tolerance */
255+ /* VDD_MPU voltage limits 0.95V - 1.325V with +/-4% tolerance */
256256 regulator-name = "vdd_mpu";
257257 regulator-min-microvolt = <912500>;
258− regulator-max-microvolt = <1312500>;
258+ regulator-max-microvolt = <1378000>;
259259 regulator-boot-on;
260260 regulator-always-on;
261261 };
arch/arm/boot/dts/am57xx-beagle-x15.dts+29−17
@@ -98,13 +98,6 @@ · 97 unmodified lines
9898 pinctrl-0 = <&extcon_usb1_pins>;
9999 };
100100
101− extcon_usb2: extcon_usb2 {
102− compatible = "linux,extcon-usb-gpio";
103− id-gpio = <&gpio7 24 GPIO_ACTIVE_HIGH>;
104− pinctrl-names = "default";
105− pinctrl-0 = <&extcon_usb2_pins>;
106− };
107−
108101 hdmi0: connector {
109102 compatible = "hdmi-connector";
110103 label = "hdmi";
@@ -326,12 +319,6 @@ · 215 unmodified lines
326319 >;
327320 };
328321
329− extcon_usb2_pins: extcon_usb2_pins {
330− pinctrl-single,pins = <
331− 0x3e8 (PIN_INPUT_PULLUP | MUX_MODE14) /* uart1_ctsn.gpio7_24 */
332− >;
333− };
334−
335322 tpd12s015_pins: pinmux_tpd12s015_pins {
336323 pinctrl-single,pins = <
337324 0x3b0 (PIN_OUTPUT | MUX_MODE14) /* gpio7_10 CT_CP_HPD */
@@ -432,7 +419,7 @@ · 94 unmodified lines
432419 };
433420
434421 ldo3_reg: ldo3 {
435− /* VDDA_1V8_PHY */
422+ /* VDDA_1V8_PHYA */
436423 regulator-name = "ldo3";
437424 regulator-min-microvolt = <1800000>;
438425 regulator-max-microvolt = <1800000>;
@@ -440,6 +427,15 @@ · 1 unmodified line
440427 regulator-boot-on;
441428 };
442429
430+ ldo4_reg: ldo4 {
431+ /* VDDA_1V8_PHYB */
432+ regulator-name = "ldo4";
433+ regulator-min-microvolt = <1800000>;
434+ regulator-max-microvolt = <1800000>;
435+ regulator-always-on;
436+ regulator-boot-on;
437+ };
438+
443439 ldo9_reg: ldo9 {
444440 /* VDD_RTC */
445441 regulator-name = "ldo9";
@@ -495,6 +491,14 @@ · 49 unmodified lines
495491 gpio-controller;
496492 #gpio-cells = <2>;
497493 };
494+
495+ extcon_usb2: tps659038_usb {
496+ compatible = "ti,palmas-usb-vid";
497+ ti,enable-vbus-detection;
498+ ti,enable-id-detection;
499+ id-gpios = <&gpio7 24 GPIO_ACTIVE_HIGH>;
500+ };
501+
498502 };
499503
500504 tmp102: tmp102@48 {
@@ -517,7 +521,8 @@ · 16 unmodified lines
517521 mcp_rtc: rtc@6f {
518522 compatible = "microchip,mcp7941x";
519523 reg = <0x6f>;
520− interrupts = <GIC_SPI 2 IRQ_TYPE_EDGE_RISING>; /* IRQ_SYS_1N */
524+ interrupts-extended = <&crossbar_mpu GIC_SPI 2 IRQ_TYPE_EDGE_RISING>,
525+ <&dra7_pmx_core 0x424>;
521526
522527 pinctrl-names = "default";
523528 pinctrl-0 = <&mcp79410_pins_default>;
@@ -579,7 +584,6 @@ · 55 unmodified lines
579584 pinctrl-0 = <&mmc1_pins_default>;
580585
581586 vmmc-supply = <&ldo1_reg>;
582− vmmc_aux-supply = <&vdd_3v3>;
583587 bus-width = <4>;
584588 cd-gpios = <&gpio6 27 0>; /* gpio 219 */
585589 };
@@ -623,6 +627,14 @@ · 37 unmodified lines
623627 };
624628
625629 &usb2 {
630+ /*
631+ * Stand alone usage is peripheral only.
632+ * However, with some resistor modifications
633+ * this port can be used via expansion connectors
634+ * as "host" or "dual-role". If so, provide
635+ * the necessary dr_mode override in the expansion
636+ * board's DT.
637+ */
626638 dr_mode = "peripheral";
627639 };
628640
@@ -681,7 +693,7 @@ · 52 unmodified lines
681693
682694 &hdmi {
683695 status = "ok";
684− vdda-supply = <&ldo3_reg>;
696+ vdda-supply = <&ldo4_reg>;
685697
686698 pinctrl-names = "default";
687699 pinctrl-0 = <&hdmi_pins>;
arch/arm/boot/dts/dm8148-evm.dts+2−2
@@ -19,10 +19,10 @@ · 18 unmodified lines
1919
2020 &cpsw_emac0 {
2121 phy_id = <&davinci_mdio>, <0>;
22− phy-mode = "mii";
22+ phy-mode = "rgmii";
2323 };
2424
2525 &cpsw_emac1 {
2626 phy_id = <&davinci_mdio>, <1>;
27− phy-mode = "mii";
27+ phy-mode = "rgmii";
2828 };
arch/arm/boot/dts/dm8148-t410.dts+3−3
@@ -8,7 +8,7 @@ · 7 unmodified lines
88 #include "dm814x.dtsi"
99
1010 / {
11− model = "DM8148 EVM";
11+ model = "HP t410 Smart Zero Client";
1212 compatible = "hp,t410", "ti,dm8148";
1313
1414 memory {
@@ -19,10 +19,10 @@ · 4 unmodified lines
1919
2020 &cpsw_emac0 {
2121 phy_id = <&davinci_mdio>, <0>;
22− phy-mode = "mii";
22+ phy-mode = "rgmii";
2323 };
2424
2525 &cpsw_emac1 {
2626 phy_id = <&davinci_mdio>, <1>;
27− phy-mode = "mii";
27+ phy-mode = "rgmii";
2828 };
arch/arm/boot/dts/dm814x.dtsi+4−4
@@ -181,9 +181,9 @@ · 180 unmodified lines
181181 ti,hwmods = "timer3";
182182 };
183183
184− control: control@160000 {
184+ control: control@140000 {
185185 compatible = "ti,dm814-scm", "simple-bus";
186− reg = <0x160000 0x16d000>;
186+ reg = <0x140000 0x16d000>;
187187 #address-cells = <1>;
188188 #size-cells = <1>;
189189 ranges = <0 0x160000 0x16d000>;
@@ -321,9 +321,9 @@ · 131 unmodified lines
321321 mac-address = [ 00 00 00 00 00 00 ];
322322 };
323323
324− phy_sel: cpsw-phy-sel@0x48160650 {
324+ phy_sel: cpsw-phy-sel@48140650 {
325325 compatible = "ti,am3352-cpsw-phy-sel";
326− reg= <0x48160650 0x4>;
326+ reg= <0x48140650 0x4>;
327327 reg-names = "gmii-sel";
328328 };
329329 };
arch/arm/boot/dts/dra7.dtsi+3−2
@@ -120,9 +120,10 @@ · 119 unmodified lines
120120 reg = <0x0 0x1400>;
121121 #address-cells = <1>;
122122 #size-cells = <1>;
123+ ranges = <0 0x0 0x1400>;
123124
124125 pbias_regulator: pbias_regulator {
125− compatible = "ti,pbias-omap";
126+ compatible = "ti,pbias-dra7", "ti,pbias-omap";
126127 reg = <0xe00 0x4>;
127128 syscon = <&scm_conf>;
128129 pbias_mmc_reg: pbias_mmc_omap5 {
@@ -1417,7 +1418,7 @@ · 1288 unmodified lines
14171418 ti,irqs-safe-map = <0>;
14181419 };
14191420
1420− mac: ethernet@4a100000 {
1421+ mac: ethernet@48484000 {
14211422 compatible = "ti,dra7-cpsw","ti,cpsw";
14221423 ti,hwmods = "gmac";
14231424 clocks = <&dpll_gmac_ck>, <&gmac_gmii_ref_clk_div>;
arch/arm/boot/dts/omap2430.dtsi+2−1
@@ -56,6 +56,7 @@ · 55 unmodified lines
5656 reg = <0x270 0x240>;
5757 #address-cells = <1>;
5858 #size-cells = <1>;
59+ ranges = <0 0x270 0x240>;
5960
6061 scm_clocks: clocks {
6162 #address-cells = <1>;
@@ -63,7 +64,7 @@ · 1 unmodified line
6364 };
6465
6566 pbias_regulator: pbias_regulator {
66− compatible = "ti,pbias-omap";
67+ compatible = "ti,pbias-omap2", "ti,pbias-omap";
6768 reg = <0x230 0x4>;
6869 syscon = <&scm_conf>;
6970 pbias_mmc_reg: pbias_mmc_omap2430 {
arch/arm/boot/dts/omap3-beagle.dts+1−1
@@ -202,7 +202,7 @@ · 201 unmodified lines
202202
203203 tfp410_pins: pinmux_tfp410_pins {
204204 pinctrl-single,pins = <
205− 0x194 (PIN_OUTPUT | MUX_MODE4) /* hdq_sio.gpio_170 */
205+ 0x196 (PIN_OUTPUT | MUX_MODE4) /* hdq_sio.gpio_170 */
206206 >;
207207 };
208208
arch/arm/boot/dts/omap3-igep.dtsi+0−6
@@ -78,12 +78,6 @@ · 77 unmodified lines
7878 >;
7979 };
8080
81− smsc9221_pins: pinmux_smsc9221_pins {
82− pinctrl-single,pins = <
83− 0x1a2 (PIN_INPUT | MUX_MODE4) /* mcspi1_cs2.gpio_176 */
84− >;
85− };
86−
8781 i2c1_pins: pinmux_i2c1_pins {
8882 pinctrl-single,pins = <
8983 0x18a (PIN_INPUT | MUX_MODE0) /* i2c1_scl.i2c1_scl */
arch/arm/boot/dts/omap3-igep0020-common.dtsi+6−0
@@ -156,6 +156,12 @@ · 155 unmodified lines
156156 OMAP3_CORE1_IOPAD(0x217a, PIN_INPUT | MUX_MODE0) /* uart2_rx.uart2_rx */
157157 >;
158158 };
159+
160+ smsc9221_pins: pinmux_smsc9221_pins {
161+ pinctrl-single,pins = <
162+ OMAP3_CORE1_IOPAD(0x21d2, PIN_INPUT | MUX_MODE4) /* mcspi1_cs2.gpio_176 */
163+ >;
164+ };
159165 };
160166
161167 &omap3_pmx_core2 {
arch/arm/boot/dts/omap3.dtsi+13−12
@@ -113,10 +113,22 @@ · 112 unmodified lines
113113 };
114114
115115 scm_conf: scm_conf@270 {
116− compatible = "syscon";
116+ compatible = "syscon", "simple-bus";
117117 reg = <0x270 0x330>;
118118 #address-cells = <1>;
119119 #size-cells = <1>;
120+ ranges = <0 0x270 0x330>;
121+
122+ pbias_regulator: pbias_regulator {
123+ compatible = "ti,pbias-omap3", "ti,pbias-omap";
124+ reg = <0x2b0 0x4>;
125+ syscon = <&scm_conf>;
126+ pbias_mmc_reg: pbias_mmc_omap2430 {
127+ regulator-name = "pbias_mmc_omap2430";
128+ regulator-min-microvolt = <1800000>;
129+ regulator-max-microvolt = <3000000>;
130+ };
131+ };
120132
121133 scm_clocks: clocks {
122134 #address-cells = <1>;
@@ -202,17 +214,6 @@ · 79 unmodified lines
202214 dma-requests = <96>;
203215 };
204216
205− pbias_regulator: pbias_regulator {
206− compatible = "ti,pbias-omap";
207− reg = <0x2b0 0x4>;
208− syscon = <&scm_conf>;
209− pbias_mmc_reg: pbias_mmc_omap2430 {
210− regulator-name = "pbias_mmc_omap2430";
211− regulator-min-microvolt = <1800000>;
212− regulator-max-microvolt = <3000000>;
213− };
214− };
215−
216217 gpio1: gpio@48310000 {
217218 compatible = "ti,omap3-gpio";
218219 reg = <0x48310000 0x200>;
arch/arm/boot/dts/omap4.dtsi+2−1
@@ -196,9 +196,10 @@ · 195 unmodified lines
196196 reg = <0x5a0 0x170>;
197197 #address-cells = <1>;
198198 #size-cells = <1>;
199+ ranges = <0 0x5a0 0x170>;
199200
200201 pbias_regulator: pbias_regulator {
201− compatible = "ti,pbias-omap";
202+ compatible = "ti,pbias-omap4", "ti,pbias-omap";
202203 reg = <0x60 0x4>;
203204 syscon = <&omap4_padconf_global>;
204205 pbias_mmc_reg: pbias_mmc_omap4 {
arch/arm/boot/dts/omap5-uevm.dts+2−2
@@ -174,8 +174,8 @@ · 173 unmodified lines
174174
175175 i2c5_pins: pinmux_i2c5_pins {
176176 pinctrl-single,pins = <
177− 0x184 (PIN_INPUT | MUX_MODE0) /* i2c5_scl */
178− 0x186 (PIN_INPUT | MUX_MODE0) /* i2c5_sda */
177+ 0x186 (PIN_INPUT | MUX_MODE0) /* i2c5_scl */
178+ 0x188 (PIN_INPUT | MUX_MODE0) /* i2c5_sda */
179179 >;
180180 };
181181
arch/arm/boot/dts/omap5.dtsi+2−1
@@ -185,9 +185,10 @@ · 184 unmodified lines
185185 reg = <0x5a0 0xec>;
186186 #address-cells = <1>;
187187 #size-cells = <1>;
188+ ranges = <0 0x5a0 0xec>;
188189
189190 pbias_regulator: pbias_regulator {
190− compatible = "ti,pbias-omap";
191+ compatible = "ti,pbias-omap5", "ti,pbias-omap";
191192 reg = <0x60 0x4>;
192193 syscon = <&omap5_padconf_global>;
193194 pbias_mmc_reg: pbias_mmc_omap5 {
arch/arm/boot/dts/rk3288-veyron.dtsi+1−0
@@ -158,6 +158,7 @@ · 157 unmodified lines
158158 };
159159
160160 &hdmi {
161+ ddc-i2c-bus = <&i2c5>;
161162 status = "okay";
162163 };
163164
arch/arm/boot/dts/stih407.dtsi+40−42
@@ -103,48 +103,46 @@ · 102 unmodified lines
103103 <&clk_s_d0_quadfs 0>,
104104 <&clk_s_d2_quadfs 0>,
105105 <&clk_s_d2_quadfs 0>;
106− ranges;
107−
108− sti-hdmi@8d04000 {
109− compatible = "st,stih407-hdmi";
110− reg = <0x8d04000 0x1000>;
111− reg-names = "hdmi-reg";
112− interrupts = <GIC_SPI 106 IRQ_TYPE_NONE>;
113− interrupt-names = "irq";
114− clock-names = "pix",
115− "tmds",
116− "phy",
117− "audio",
118− "main_parent",
119− "aux_parent";
120−
121− clocks = <&clk_s_d2_flexgen CLK_PIX_HDMI>,
122− <&clk_s_d2_flexgen CLK_TMDS_HDMI>,
123− <&clk_s_d2_flexgen CLK_REF_HDMIPHY>,
124− <&clk_s_d0_flexgen CLK_PCM_0>,
125− <&clk_s_d2_quadfs 0>,
126− <&clk_s_d2_quadfs 1>;
127−
128− hdmi,hpd-gpio = <&pio5 3>;
129− reset-names = "hdmi";
130− resets = <&softreset STIH407_HDMI_TX_PHY_SOFTRESET>;
131− ddc = <&hdmiddc>;
132−
133− };
134−
135− sti-hda@8d02000 {
136− compatible = "st,stih407-hda";
137− reg = <0x8d02000 0x400>, <0x92b0120 0x4>;
138− reg-names = "hda-reg", "video-dacs-ctrl";
139− clock-names = "pix",
140− "hddac",
141− "main_parent",
142− "aux_parent";
143− clocks = <&clk_s_d2_flexgen CLK_PIX_HDDAC>,
144− <&clk_s_d2_flexgen CLK_HDDAC>,
145− <&clk_s_d2_quadfs 0>,
146− <&clk_s_d2_quadfs 1>;
147− };
106+ };
107+
108+ sti-hdmi@8d04000 {
109+ compatible = "st,stih407-hdmi";
110+ reg = <0x8d04000 0x1000>;
111+ reg-names = "hdmi-reg";
112+ interrupts = <GIC_SPI 106 IRQ_TYPE_NONE>;
113+ interrupt-names = "irq";
114+ clock-names = "pix",
115+ "tmds",
116+ "phy",
117+ "audio",
118+ "main_parent",
119+ "aux_parent";
120+
121+ clocks = <&clk_s_d2_flexgen CLK_PIX_HDMI>,
122+ <&clk_s_d2_flexgen CLK_TMDS_HDMI>,
123+ <&clk_s_d2_flexgen CLK_REF_HDMIPHY>,
124+ <&clk_s_d0_flexgen CLK_PCM_0>,
125+ <&clk_s_d2_quadfs 0>,
126+ <&clk_s_d2_quadfs 1>;
127+
128+ hdmi,hpd-gpio = <&pio5 3>;
129+ reset-names = "hdmi";
130+ resets = <&softreset STIH407_HDMI_TX_PHY_SOFTRESET>;
131+ ddc = <&hdmiddc>;
132+ };
133+
134+ sti-hda@8d02000 {
135+ compatible = "st,stih407-hda";
136+ reg = <0x8d02000 0x400>, <0x92b0120 0x4>;
137+ reg-names = "hda-reg", "video-dacs-ctrl";
138+ clock-names = "pix",
139+ "hddac",
140+ "main_parent",
141+ "aux_parent";
142+ clocks = <&clk_s_d2_flexgen CLK_PIX_HDDAC>,
143+ <&clk_s_d2_flexgen CLK_HDDAC>,
144+ <&clk_s_d2_quadfs 0>,
145+ <&clk_s_d2_quadfs 1>;
148146 };
149147 };
150148 };
arch/arm/boot/dts/stih410.dtsi+40−42
@@ -178,48 +178,46 @@ · 177 unmodified lines
178178 <&clk_s_d0_quadfs 0>,
179179 <&clk_s_d2_quadfs 0>,
180180 <&clk_s_d2_quadfs 0>;
181− ranges;
182−
183− sti-hdmi@8d04000 {
184− compatible = "st,stih407-hdmi";
185− reg = <0x8d04000 0x1000>;
186− reg-names = "hdmi-reg";
187− interrupts = <GIC_SPI 106 IRQ_TYPE_NONE>;
188− interrupt-names = "irq";
189− clock-names = "pix",
190− "tmds",
191− "phy",
192− "audio",
193− "main_parent",
194− "aux_parent";
195−
196− clocks = <&clk_s_d2_flexgen CLK_PIX_HDMI>,
197− <&clk_s_d2_flexgen CLK_TMDS_HDMI>,
198− <&clk_s_d2_flexgen CLK_REF_HDMIPHY>,
199− <&clk_s_d0_flexgen CLK_PCM_0>,
200− <&clk_s_d2_quadfs 0>,
201− <&clk_s_d2_quadfs 1>;
202−
203− hdmi,hpd-gpio = <&pio5 3>;
204− reset-names = "hdmi";
205− resets = <&softreset STIH407_HDMI_TX_PHY_SOFTRESET>;
206− ddc = <&hdmiddc>;
207−
208− };
209−
210− sti-hda@8d02000 {
211− compatible = "st,stih407-hda";
212− reg = <0x8d02000 0x400>, <0x92b0120 0x4>;
213− reg-names = "hda-reg", "video-dacs-ctrl";
214− clock-names = "pix",
215− "hddac",
216− "main_parent",
217− "aux_parent";
218− clocks = <&clk_s_d2_flexgen CLK_PIX_HDDAC>,
219− <&clk_s_d2_flexgen CLK_HDDAC>,
220− <&clk_s_d2_quadfs 0>,
221− <&clk_s_d2_quadfs 1>;
222− };
181+ };
182+
183+ sti-hdmi@8d04000 {
184+ compatible = "st,stih407-hdmi";
185+ reg = <0x8d04000 0x1000>;
186+ reg-names = "hdmi-reg";
187+ interrupts = <GIC_SPI 106 IRQ_TYPE_NONE>;
188+ interrupt-names = "irq";
189+ clock-names = "pix",
190+ "tmds",
191+ "phy",
192+ "audio",
193+ "main_parent",
194+ "aux_parent";
195+
196+ clocks = <&clk_s_d2_flexgen CLK_PIX_HDMI>,
197+ <&clk_s_d2_flexgen CLK_TMDS_HDMI>,
198+ <&clk_s_d2_flexgen CLK_REF_HDMIPHY>,
199+ <&clk_s_d0_flexgen CLK_PCM_0>,
200+ <&clk_s_d2_quadfs 0>,
201+ <&clk_s_d2_quadfs 1>;
202+
203+ hdmi,hpd-gpio = <&pio5 3>;
204+ reset-names = "hdmi";
205+ resets = <&softreset STIH407_HDMI_TX_PHY_SOFTRESET>;
206+ ddc = <&hdmiddc>;
207+ };
208+
209+ sti-hda@8d02000 {
210+ compatible = "st,stih407-hda";
211+ reg = <0x8d02000 0x400>, <0x92b0120 0x4>;
212+ reg-names = "hda-reg", "video-dacs-ctrl";
213+ clock-names = "pix",
214+ "hddac",
215+ "main_parent",
216+ "aux_parent";
217+ clocks = <&clk_s_d2_flexgen CLK_PIX_HDDAC>,
218+ <&clk_s_d2_flexgen CLK_HDDAC>,
219+ <&clk_s_d2_quadfs 0>,
220+ <&clk_s_d2_quadfs 1>;
223221 };
224222 };
225223
arch/arm/configs/omap2plus_defconfig+4−1
@@ -240,7 +240,8 @@ CONFIG_SSI_PROTOCOL=m · 239 unmodified lines
240240 CONFIG_PINCTRL_SINGLE=y
241241 CONFIG_DEBUG_GPIO=y
242242 CONFIG_GPIO_SYSFS=y
243−CONFIG_GPIO_PCF857X=m
243+CONFIG_GPIO_PCA953X=m
244+CONFIG_GPIO_PCF857X=y
244245 CONFIG_GPIO_TWL4030=y
245246 CONFIG_GPIO_PALMAS=y
246247 CONFIG_W1=m
@@ -350,6 +351,8 @@ CONFIG_USB_MUSB_HDRC=m · 103 unmodified lines
350351 CONFIG_USB_MUSB_OMAP2PLUS=m
351352 CONFIG_USB_MUSB_AM35X=m
352353 CONFIG_USB_MUSB_DSPS=m
354+CONFIG_USB_INVENTRA_DMA=y
355+CONFIG_USB_TI_CPPI41_DMA=y
353356 CONFIG_USB_DWC3=m
354357 CONFIG_USB_TEST=m
355358 CONFIG_AM335X_PHY_USB=y
arch/arm/include/asm/kvm_host.h+1−0
@@ -33,6 +33,7 @@ · 32 unmodified lines
3333 #define KVM_PRIVATE_MEM_SLOTS 4
3434 #define KVM_COALESCED_MMIO_PAGE_OFFSET 1
3535 #define KVM_HAVE_ONE_REG
36+#define KVM_HALT_POLL_NS_DEFAULT 500000
3637
3738 #define KVM_VCPU_MAX_FEATURES 2
3839
arch/arm/include/asm/unistd.h+1−1
@@ -19,7 +19,7 @@ · 18 unmodified lines
1919 * This may need to be greater than __NR_last_syscall+1 in order to
2020 * account for the padding in the syscall table
2121 */
22−#define __NR_syscalls (388)
22+#define __NR_syscalls (392)
2323
2424 /*
2525 * *NOTE*: This is a ghost syscall private to the kernel. Only the
arch/arm/include/uapi/asm/unistd.h+2−0
@@ -414,6 +414,8 @@ · 413 unmodified lines
414414 #define __NR_memfd_create (__NR_SYSCALL_BASE+385)
415415 #define __NR_bpf (__NR_SYSCALL_BASE+386)
416416 #define __NR_execveat (__NR_SYSCALL_BASE+387)
417+#define __NR_userfaultfd (__NR_SYSCALL_BASE+388)
418+#define __NR_membarrier (__NR_SYSCALL_BASE+389)
417419
418420 /*
419421 * The following SWIs are ARM private.
arch/arm/kernel/calls.S+2−0
@@ -397,6 +397,8 @@ · 396 unmodified lines
397397 /* 385 */ CALL(sys_memfd_create)
398398 CALL(sys_bpf)
399399 CALL(sys_execveat)
400+ CALL(sys_userfaultfd)
401+ CALL(sys_membarrier)
400402 #ifndef syscalls_counted
401403 .equ syscalls_padding, ((NR_syscalls + 3) & ~3) - NR_syscalls
402404 #define syscalls_counted
arch/arm/mach-omap2/Kconfig+5−1
@@ -44,10 +44,11 @@ config SOC_OMAP5 · 43 unmodified lines
4444 select ARM_CPU_SUSPEND if PM
4545 select ARM_GIC
4646 select HAVE_ARM_SCU if SMP
47− select HAVE_ARM_TWD if SMP
4847 select HAVE_ARM_ARCH_TIMER
4948 select ARM_ERRATA_798181 if SMP
49+ select OMAP_INTERCONNECT
5050 select OMAP_INTERCONNECT_BARRIER
51+ select PM_OPP if PM
5152
5253 config SOC_AM33XX
5354 bool "TI AM33XX"
@@ -70,10 +71,13 @@ config SOC_DRA7XX · 16 unmodified lines
7071 select ARCH_OMAP2PLUS
7172 select ARM_CPU_SUSPEND if PM
7273 select ARM_GIC
74+ select HAVE_ARM_SCU if SMP
7375 select HAVE_ARM_ARCH_TIMER
7476 select IRQ_CROSSBAR
7577 select ARM_ERRATA_798181 if SMP
78+ select OMAP_INTERCONNECT
7679 select OMAP_INTERCONNECT_BARRIER
80+ select PM_OPP if PM
7781
7882 config ARCH_OMAP2PLUS
7983 bool
arch/arm/mach-omap2/board-generic.c+0−7
@@ -20,13 +20,6 @@ · 19 unmodified lines
2020
2121 #include "common.h"
2222
23−#if !(defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3))
24−#define intc_of_init NULL
25−#endif
26−#ifndef CONFIG_ARCH_OMAP4
27−#define gic_of_init NULL
28−#endif
29−
3023 static const struct of_device_id omap_dt_match_table[] __initconst = {
3124 { .compatible = "simple-bus", },
3225 { .compatible = "ti,omap-infra", },
arch/arm/mach-omap2/id.c+6−2
@@ -653,8 +653,12 @@ void __init dra7xxx_check_revision(void) · 652 unmodified lines
653653 omap_revision = DRA752_REV_ES1_0;
654654 break;
655655 case 1:
656− default:
657656 omap_revision = DRA752_REV_ES1_1;
657+ break;
658+ case 2:
659+ default:
660+ omap_revision = DRA752_REV_ES2_0;
661+ break;
658662 }
659663 break;
660664
@@ -674,7 +678,7 @@ void __init dra7xxx_check_revision(void) · 13 unmodified lines
674678 /* Unknown default to latest silicon rev as default*/
675679 pr_warn("%s: unknown idcode=0x%08x (hawkeye=0x%08x,rev=0x%x)\n",
676680 __func__, idcode, hawkeye, rev);
677− omap_revision = DRA752_REV_ES1_1;
681+ omap_revision = DRA752_REV_ES2_0;
678682 }
679683
680684 sprintf(soc_name, "DRA%03x", omap_rev() >> 16);
arch/arm/mach-omap2/io.c+1−0
@@ -676,6 +676,7 @@ void __init am43xx_init_early(void) · 675 unmodified lines
676676 void __init am43xx_init_late(void)
677677 {
678678 omap_common_late_init();
679+ omap2_clk_enable_autoidle_all();
679680 }
680681 #endif
681682
arch/arm/mach-omap2/omap_device.c+2−1
@@ -901,7 +901,8 @@ static int __init omap_device_late_idle(struct device *dev, void *data) · 900 unmodified lines
901901 if (od->hwmods[i]->flags & HWMOD_INIT_NO_IDLE)
902902 return 0;
903903
904− if (od->_driver_status != BUS_NOTIFY_BOUND_DRIVER) {
904+ if (od->_driver_status != BUS_NOTIFY_BOUND_DRIVER &&
905+ od->_driver_status != BUS_NOTIFY_BIND_DRIVER) {
905906 if (od->_state == OMAP_DEVICE_STATE_ENABLED) {
906907 dev_warn(dev, "%s: enabled but no driver. Idling\n",
907908 __func__);
arch/arm/mach-omap2/pm.h+2−1
@@ -103,7 +103,8 @@ static inline void enable_omap3630_toggle_l2_on_restore(void) { } · 102 unmodified lines
103103 #define PM_OMAP4_ROM_SMP_BOOT_ERRATUM_GICD (1 << 0)
104104 #define PM_OMAP4_CPU_OSWR_DISABLE (1 << 1)
105105
106−#if defined(CONFIG_PM) && defined(CONFIG_ARCH_OMAP4)
106+#if defined(CONFIG_PM) && (defined(CONFIG_ARCH_OMAP4) ||\
107+ defined(CONFIG_SOC_OMAP5) || defined(CONFIG_SOC_DRA7XX))
107108 extern u16 pm44xx_errata;
108109 #define IS_PM44XX_ERRATUM(id) (pm44xx_errata & (id))
109110 #else
arch/arm/mach-omap2/soc.h+2−0
@@ -469,6 +469,8 @@ IS_OMAP_TYPE(3430, 0x3430) · 468 unmodified lines
469469 #define DRA7XX_CLASS 0x07000000
470470 #define DRA752_REV_ES1_0 (DRA7XX_CLASS | (0x52 << 16) | (0x10 << 8))
471471 #define DRA752_REV_ES1_1 (DRA7XX_CLASS | (0x52 << 16) | (0x11 << 8))
472+#define DRA752_REV_ES2_0 (DRA7XX_CLASS | (0x52 << 16) | (0x20 << 8))
473+#define DRA722_REV_ES1_0 (DRA7XX_CLASS | (0x22 << 16) | (0x10 << 8))
472474 #define DRA722_REV_ES1_0 (DRA7XX_CLASS | (0x22 << 16) | (0x10 << 8))
473475
474476 void omap2xxx_check_revision(void);
arch/arm/mach-omap2/timer.c+2−6
@@ -297,12 +297,8 @@ static int __init omap_dm_timer_init_one(struct omap_dm_timer *timer, · 296 unmodified lines
297297 if (IS_ERR(src))
298298 return PTR_ERR(src);
299299
300− r = clk_set_parent(timer->fclk, src);
301− if (r < 0) {
302− pr_warn("%s: %s cannot set source\n", __func__, oh->name);
303− clk_put(src);
304− return r;
305− }
300+ WARN(clk_set_parent(timer->fclk, src) < 0,
301+ "Cannot set timer parent clock, no PLL clock driver?");
306302
307303 clk_put(src);
308304
arch/arm/mach-omap2/vc.c+1−1
@@ -300,7 +300,7 @@ static void __init omap3_vc_init_pmic_signaling(struct voltagedomain *voltdm) · 299 unmodified lines
300300
301301 val = voltdm->read(OMAP3_PRM_POLCTRL_OFFSET);
302302 if (!(val & OMAP3430_PRM_POLCTRL_CLKREQ_POL) ||
303− (val & OMAP3430_PRM_POLCTRL_CLKREQ_POL)) {
303+ (val & OMAP3430_PRM_POLCTRL_OFFMODE_POL)) {
304304 val |= OMAP3430_PRM_POLCTRL_CLKREQ_POL;
305305 val &= ~OMAP3430_PRM_POLCTRL_OFFMODE_POL;
306306 pr_debug("PM: fixing sys_clkreq and sys_off_mode polarity to 0x%x\n",
arch/arm/mach-pxa/balloon3.c+1−1
@@ -502,7 +502,7 @@ static void balloon3_irq_handler(struct irq_desc *desc) · 501 unmodified lines
502502 balloon3_irq_enabled;
503503 do {
504504 struct irq_data *d = irq_desc_get_irq_data(desc);
505− struct irq_chip *chip = irq_data_get_chip(d);
505+ struct irq_chip *chip = irq_desc_get_chip(desc);
506506 unsigned int irq;
507507
508508 /* clear useless edge notification */
arch/arm/mach-pxa/include/mach/addr-map.h+7−0
@@ -43,6 +43,13 @@ · 42 unmodified lines
4343 * 0xf6200000..0xf6201000
4444 */
4545
46+/*
47+ * DFI Bus for NAND, PXA3xx only
48+ */
49+#define NAND_PHYS 0x43100000
50+#define NAND_VIRT IOMEM(0xf6300000)
51+#define NAND_SIZE 0x00100000
52+
4653 /*
4754 * Internal Memory Controller (PXA27x and later)
4855 */
arch/arm/mach-pxa/pxa3xx.c+20−1
@@ -47,6 +47,13 @@ extern void __init pxa_dt_irq_init(int (*fn)(struct irq_data *, unsigned int)); · 46 unmodified lines
4747 #define ISRAM_START 0x5c000000
4848 #define ISRAM_SIZE SZ_256K
4949
50+/*
51+ * NAND NFC: DFI bus arbitration subset
52+ */
53+#define NDCR (*(volatile u32 __iomem*)(NAND_VIRT + 0))
54+#define NDCR_ND_ARB_EN (1 << 12)
55+#define NDCR_ND_ARB_CNTL (1 << 19)
56+
5057 static void __iomem *sram;
5158 static unsigned long wakeup_src;
5259
@@ -362,7 +369,12 @@ static struct map_desc pxa3xx_io_desc[] __initdata = { · 309 unmodified lines
362369 .pfn = __phys_to_pfn(PXA3XX_SMEMC_BASE),
363370 .length = SMEMC_SIZE,
364371 .type = MT_DEVICE
365− }
372+ }, {
373+ .virtual = (unsigned long)NAND_VIRT,
374+ .pfn = __phys_to_pfn(NAND_PHYS),
375+ .length = NAND_SIZE,
376+ .type = MT_DEVICE
377+ },
366378 };
367379
368380 void __init pxa3xx_map_io(void)
@@ -419,6 +431,13 @@ static int __init pxa3xx_init(void) · 50 unmodified lines
419431 */
420432 ASCR &= ~(ASCR_RDH | ASCR_D1S | ASCR_D2S | ASCR_D3S);
421433
434+ /*
435+ * Disable DFI bus arbitration, to prevent a system bus lock if
436+ * somebody disables the NAND clock (unused clock) while this
437+ * bit remains set.
438+ */
439+ NDCR = (NDCR & ~NDCR_ND_ARB_EN) | NDCR_ND_ARB_CNTL;
440+
422441 if ((ret = pxa_init_dma(IRQ_DMA, 32)))
423442 return ret;
424443
arch/arm/mm/alignment.c+25−5
@@ -365,15 +365,21 @@ do_alignment_ldrhstrh(unsigned long addr, unsigned long instr, struct pt_regs *r · 364 unmodified lines
365365 user:
366366 if (LDST_L_BIT(instr)) {
367367 unsigned long val;
368+ unsigned int __ua_flags = uaccess_save_and_enable();
369+
368370 get16t_unaligned_check(val, addr);
371+ uaccess_restore(__ua_flags);
369372
370373 /* signed half-word? */
371374 if (instr & 0x40)
372375 val = (signed long)((signed short) val);
373376
374377 regs->uregs[rd] = val;
375− } else
378+ } else {
379+ unsigned int __ua_flags = uaccess_save_and_enable();
376380 put16t_unaligned_check(regs->uregs[rd], addr);
381+ uaccess_restore(__ua_flags);
382+ }
377383
378384 return TYPE_LDST;
379385
@@ -420,14 +426,21 @@ do_alignment_ldrdstrd(unsigned long addr, unsigned long instr, · 40 unmodified lines
420426
421427 user:
422428 if (load) {
423− unsigned long val;
429+ unsigned long val, val2;
430+ unsigned int __ua_flags = uaccess_save_and_enable();
431+
424432 get32t_unaligned_check(val, addr);
433+ get32t_unaligned_check(val2, addr + 4);
434+
435+ uaccess_restore(__ua_flags);
436+
425437 regs->uregs[rd] = val;
426− get32t_unaligned_check(val, addr + 4);
427− regs->uregs[rd2] = val;
438+ regs->uregs[rd2] = val2;
428439 } else {
440+ unsigned int __ua_flags = uaccess_save_and_enable();
429441 put32t_unaligned_check(regs->uregs[rd], addr);
430442 put32t_unaligned_check(regs->uregs[rd2], addr + 4);
443+ uaccess_restore(__ua_flags);
431444 }
432445
433446 return TYPE_LDST;
@@ -458,10 +471,15 @@ do_alignment_ldrstr(unsigned long addr, unsigned long instr, struct pt_regs *reg · 24 unmodified lines
458471 trans:
459472 if (LDST_L_BIT(instr)) {
460473 unsigned int val;
474+ unsigned int __ua_flags = uaccess_save_and_enable();
461475 get32t_unaligned_check(val, addr);
476+ uaccess_restore(__ua_flags);
462477 regs->uregs[rd] = val;
463− } else
478+ } else {
479+ unsigned int __ua_flags = uaccess_save_and_enable();
464480 put32t_unaligned_check(regs->uregs[rd], addr);
481+ uaccess_restore(__ua_flags);
482+ }
465483 return TYPE_LDST;
466484
467485 fault:
@@ -531,6 +549,7 @@ do_alignment_ldmstm(unsigned long addr, unsigned long instr, struct pt_regs *reg · 63 unmodified lines
531549 #endif
532550
533551 if (user_mode(regs)) {
552+ unsigned int __ua_flags = uaccess_save_and_enable();
534553 for (regbits = REGMASK_BITS(instr), rd = 0; regbits;
535554 regbits >>= 1, rd += 1)
536555 if (regbits & 1) {
@@ -542,6 +561,7 @@ do_alignment_ldmstm(unsigned long addr, unsigned long instr, struct pt_regs *reg · 5 unmodified lines
542561 put32t_unaligned_check(regs->uregs[rd], eaddr);
543562 eaddr += 4;
544563 }
564+ uaccess_restore(__ua_flags);
545565 } else {
546566 for (regbits = REGMASK_BITS(instr), rd = 0; regbits;
547567 regbits >>= 1, rd += 1)
arch/arm/plat-pxa/ssp.c+0−1
@@ -107,7 +107,6 @@ static const struct of_device_id pxa_ssp_of_ids[] = { · 106 unmodified lines
107107 { .compatible = "mvrl,pxa168-ssp", .data = (void *) PXA168_SSP },
108108 { .compatible = "mrvl,pxa910-ssp", .data = (void *) PXA910_SSP },
109109 { .compatible = "mrvl,ce4100-ssp", .data = (void *) CE4100_SSP },
110− { .compatible = "mrvl,lpss-ssp", .data = (void *) LPSS_SSP },
111110 { },
112111 };
113112 MODULE_DEVICE_TABLE(of, pxa_ssp_of_ids);
arch/arm64/boot/dts/mediatek/mt8173.dtsi+1−1
@@ -81,7 +81,7 @@ · 80 unmodified lines
8181 };
8282
8383 idle-states {
84− entry-method = "arm,psci";
84+ entry-method = "psci";
8585
8686 CPU_SLEEP_0: cpu-sleep-0 {
8787 compatible = "arm,idle-state";
arch/arm64/boot/dts/rockchip/rk3368.dtsi+1−1
@@ -106,7 +106,7 @@ · 105 unmodified lines
106106 };
107107
108108 idle-states {
109− entry-method = "arm,psci";
109+ entry-method = "psci";
110110
111111 cpu_sleep: cpu-sleep-0 {
112112 compatible = "arm,idle-state";
arch/arm64/include/asm/kvm_host.h+1−0
@@ -33,6 +33,7 @@ · 32 unmodified lines
3333 #define KVM_USER_MEM_SLOTS 32
3434 #define KVM_PRIVATE_MEM_SLOTS 4
3535 #define KVM_COALESCED_MMIO_PAGE_OFFSET 1
36+#define KVM_HALT_POLL_NS_DEFAULT 500000
3637
3738 #include <kvm/arm_vgic.h>
3839 #include <kvm/arm_arch_timer.h>
arch/arm64/include/asm/pgtable.h+2−2
@@ -79,7 +79,7 @@ extern void __pgd_error(const char *file, int line, unsigned long val); · 78 unmodified lines
7979 #define PAGE_S2 __pgprot(PROT_DEFAULT | PTE_S2_MEMATTR(MT_S2_NORMAL) | PTE_S2_RDONLY)
8080 #define PAGE_S2_DEVICE __pgprot(PROT_DEFAULT | PTE_S2_MEMATTR(MT_S2_DEVICE_nGnRE) | PTE_S2_RDONLY | PTE_UXN)
8181
82−#define PAGE_NONE __pgprot(((_PAGE_DEFAULT) & ~PTE_TYPE_MASK) | PTE_PROT_NONE | PTE_PXN | PTE_UXN)
82+#define PAGE_NONE __pgprot(((_PAGE_DEFAULT) & ~PTE_VALID) | PTE_PROT_NONE | PTE_PXN | PTE_UXN)
8383 #define PAGE_SHARED __pgprot(_PAGE_DEFAULT | PTE_USER | PTE_NG | PTE_PXN | PTE_UXN | PTE_WRITE)
8484 #define PAGE_SHARED_EXEC __pgprot(_PAGE_DEFAULT | PTE_USER | PTE_NG | PTE_PXN | PTE_WRITE)
8585 #define PAGE_COPY __pgprot(_PAGE_DEFAULT | PTE_USER | PTE_NG | PTE_PXN | PTE_UXN)
@@ -496,7 +496,7 @@ static inline pud_t *pud_offset(pgd_t *pgd, unsigned long addr) · 410 unmodified lines
496496 static inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
497497 {
498498 const pteval_t mask = PTE_USER | PTE_PXN | PTE_UXN | PTE_RDONLY |
499− PTE_PROT_NONE | PTE_WRITE | PTE_TYPE_MASK;
499+ PTE_PROT_NONE | PTE_VALID | PTE_WRITE;
500500 /* preserve the hardware dirty information */
501501 if (pte_hw_dirty(pte))
502502 pte = pte_mkdirty(pte);
arch/arm64/kernel/efi.c+2−1
@@ -258,7 +258,8 @@ static bool __init efi_virtmap_init(void) · 257 unmodified lines
258258 */
259259 if (!is_normal_ram(md))
260260 prot = __pgprot(PROT_DEVICE_nGnRE);
261− else if (md->type == EFI_RUNTIME_SERVICES_CODE)
261+ else if (md->type == EFI_RUNTIME_SERVICES_CODE ||
262+ !PAGE_ALIGNED(md->phys_addr))
262263 prot = PAGE_KERNEL_EXEC;
263264 else
264265 prot = PAGE_KERNEL;
arch/arm64/kernel/entry-ftrace.S+20−2
@@ -178,6 +178,24 @@ ENTRY(ftrace_stub) · 177 unmodified lines
178178 ENDPROC(ftrace_stub)
179179
180180 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
181+ /* save return value regs*/
182+ .macro save_return_regs
183+ sub sp, sp, #64
184+ stp x0, x1, [sp]
185+ stp x2, x3, [sp, #16]
186+ stp x4, x5, [sp, #32]
187+ stp x6, x7, [sp, #48]
188+ .endm
189+
190+ /* restore return value regs*/
191+ .macro restore_return_regs
192+ ldp x0, x1, [sp]
193+ ldp x2, x3, [sp, #16]
194+ ldp x4, x5, [sp, #32]
195+ ldp x6, x7, [sp, #48]
196+ add sp, sp, #64
197+ .endm
198+
181199 /*
182200 * void ftrace_graph_caller(void)
183201 *
@@ -204,11 +222,11 @@ ENDPROC(ftrace_graph_caller) · 20 unmodified lines
204222 * only when CONFIG_HAVE_FUNCTION_GRAPH_FP_TEST is enabled.
205223 */
206224 ENTRY(return_to_handler)
207− str x0, [sp, #-16]!
225+ save_return_regs
208226 mov x0, x29 // parent's fp
209227 bl ftrace_return_to_handler// addr = ftrace_return_to_hander(fp);
210228 mov x30, x0 // restore the original return address
211− ldr x0, [sp], #16
229+ restore_return_regs
212230 ret
213231 END(return_to_handler)
214232 #endif /* CONFIG_FUNCTION_GRAPH_TRACER */
arch/avr32/include/asm/Kbuild+1−0
@@ -20,4 +20,5 @@ generic-y += sections.h · 19 unmodified lines
2020 generic-y += topology.h
2121 generic-y += trace_clock.h
2222 generic-y += vga.h
23+generic-y += word-at-a-time.h
2324 generic-y += xor.h
arch/blackfin/include/asm/Kbuild+1−0
@@ -46,4 +46,5 @@ generic-y += types.h · 45 unmodified lines
4646 generic-y += ucontext.h
4747 generic-y += unaligned.h
4848 generic-y += user.h
49+generic-y += word-at-a-time.h
4950 generic-y += xor.h
arch/c6x/include/asm/Kbuild+1−0
@@ -59,4 +59,5 @@ generic-y += types.h · 58 unmodified lines
5959 generic-y += ucontext.h
6060 generic-y += user.h
6161 generic-y += vga.h
62+generic-y += word-at-a-time.h
6263 generic-y += xor.h
arch/cris/include/asm/Kbuild+1−0
@@ -43,4 +43,5 @@ generic-y += topology.h · 42 unmodified lines
4343 generic-y += trace_clock.h
4444 generic-y += types.h
4545 generic-y += vga.h
46+generic-y += word-at-a-time.h
4647 generic-y += xor.h
arch/frv/include/asm/Kbuild+1−0
@@ -7,3 +7,4 @@ generic-y += mcs_spinlock.h · 6 unmodified lines
77 generic-y += mm-arch-hooks.h
88 generic-y += preempt.h
99 generic-y += trace_clock.h
10+generic-y += word-at-a-time.h
arch/frv/mb93090-mb00/pci-vdk.c+2−0
@@ -294,6 +294,8 @@ void pcibios_fixup_bus(struct pci_bus *bus) · 293 unmodified lines
294294 printk("### PCIBIOS_FIXUP_BUS(%d)\n",bus->number);
295295 #endif
296296
297+ pci_read_bridge_bases(bus);
298+
297299 if (bus->number == 0) {
298300 struct pci_dev *dev;
299301 list_for_each_entry(dev, &bus->devices, bus_list) {
arch/hexagon/include/asm/Kbuild+1−0
@@ -58,4 +58,5 @@ generic-y += types.h · 57 unmodified lines
5858 generic-y += ucontext.h
5959 generic-y += unaligned.h
6060 generic-y += vga.h
61+generic-y += word-at-a-time.h
6162 generic-y += xor.h
arch/ia64/include/asm/Kbuild+1−0
@@ -8,3 +8,4 @@ generic-y += mm-arch-hooks.h · 7 unmodified lines
88 generic-y += preempt.h
99 generic-y += trace_clock.h
1010 generic-y += vtime.h
11+generic-y += word-at-a-time.h
arch/ia64/pci/pci.c+3−2
@@ -533,9 +533,10 @@ void pcibios_fixup_bus(struct pci_bus *b) · 532 unmodified lines
533533 {
534534 struct pci_dev *dev;
535535
536− if (b->self)
536+ if (b->self) {
537+ pci_read_bridge_bases(b);
537538 pcibios_fixup_bridge_resources(b->self);
538−
539+ }
539540 list_for_each_entry(dev, &b->devices, bus_list)
540541 pcibios_fixup_device_resources(dev);
541542 platform_pci_fixup_bus(b);
arch/m32r/include/asm/Kbuild+1−0
@@ -9,3 +9,4 @@ generic-y += module.h · 8 unmodified lines
99 generic-y += preempt.h
1010 generic-y += sections.h
1111 generic-y += trace_clock.h
12+generic-y += word-at-a-time.h
arch/m68k/configs/amiga_defconfig+8−1
@@ -10,6 +10,7 @@ CONFIG_LOG_BUF_SHIFT=16 · 9 unmodified lines
1010 # CONFIG_PID_NS is not set
1111 # CONFIG_NET_NS is not set
1212 CONFIG_BLK_DEV_INITRD=y
13+CONFIG_USERFAULTFD=y
1314 CONFIG_SLAB=y
1415 CONFIG_MODULES=y
1516 CONFIG_MODULE_UNLOAD=y
@@ -57,7 +58,6 @@ CONFIG_NET_IPGRE_DEMUX=m · 41 unmodified lines
5758 CONFIG_NET_IPGRE=m
5859 CONFIG_NET_IPVTI=m
5960 CONFIG_NET_FOU_IP_TUNNELS=y
60−CONFIG_GENEVE_CORE=m
6161 CONFIG_INET_AH=m
6262 CONFIG_INET_ESP=m
6363 CONFIG_INET_IPCOMP=m
@@ -67,10 +67,12 @@ CONFIG_INET_XFRM_MODE_BEET=m · 3 unmodified lines
6767 # CONFIG_INET_LRO is not set
6868 CONFIG_INET_DIAG=m
6969 CONFIG_INET_UDP_DIAG=m
70+CONFIG_IPV6=m
7071 CONFIG_IPV6_ROUTER_PREF=y
7172 CONFIG_INET6_AH=m
7273 CONFIG_INET6_ESP=m
7374 CONFIG_INET6_IPCOMP=m
75+CONFIG_IPV6_ILA=m
7476 CONFIG_IPV6_VTI=m
7577 CONFIG_IPV6_GRE=m
7678 CONFIG_NETFILTER=y
@@ -179,6 +181,7 @@ CONFIG_IP_SET_HASH_NETIFACE=m · 102 unmodified lines
179181 CONFIG_IP_SET_LIST_SET=m
180182 CONFIG_NF_CONNTRACK_IPV4=m
181183 CONFIG_NFT_CHAIN_ROUTE_IPV4=m
184+CONFIG_NFT_DUP_IPV4=m
182185 CONFIG_NF_TABLES_ARP=m
183186 CONFIG_NF_LOG_ARP=m
184187 CONFIG_NFT_CHAIN_NAT_IPV4=m
@@ -206,6 +209,7 @@ CONFIG_IP_NF_ARPFILTER=m · 21 unmodified lines
206209 CONFIG_IP_NF_ARP_MANGLE=m
207210 CONFIG_NF_CONNTRACK_IPV6=m
208211 CONFIG_NFT_CHAIN_ROUTE_IPV6=m
212+CONFIG_NFT_DUP_IPV6=m
209213 CONFIG_NFT_CHAIN_NAT_IPV6=m
210214 CONFIG_NFT_MASQ_IPV6=m
211215 CONFIG_NFT_REDIR_IPV6=m
@@ -271,6 +275,7 @@ CONFIG_NETLINK_DIAG=m · 59 unmodified lines
271275 CONFIG_MPLS=y
272276 CONFIG_NET_MPLS_GSO=m
273277 CONFIG_MPLS_ROUTING=m
278+CONFIG_MPLS_IPTUNNEL=m
274279 # CONFIG_WIRELESS is not set
275280 # CONFIG_UEVENT_HELPER is not set
276281 CONFIG_DEVTMPFS=y
@@ -370,6 +375,7 @@ CONFIG_ZORRO8390=y · 93 unmodified lines
370375 # CONFIG_NET_VENDOR_SEEQ is not set
371376 # CONFIG_NET_VENDOR_SMSC is not set
372377 # CONFIG_NET_VENDOR_STMICRO is not set
378+# CONFIG_NET_VENDOR_SYNOPSYS is not set
373379 # CONFIG_NET_VENDOR_VIA is not set
374380 # CONFIG_NET_VENDOR_WIZNET is not set
375381 CONFIG_PPP=m
@@ -537,6 +543,7 @@ CONFIG_TEST_USER_COPY=m · 161 unmodified lines
537543 CONFIG_TEST_BPF=m
538544 CONFIG_TEST_FIRMWARE=m
539545 CONFIG_TEST_UDELAY=m
546+CONFIG_TEST_STATIC_KEYS=m
540547 CONFIG_EARLY_PRINTK=y
541548 CONFIG_ENCRYPTED_KEYS=m
542549 CONFIG_CRYPTO_RSA=m
arch/m68k/configs/apollo_defconfig+8−1
@@ -10,6 +10,7 @@ CONFIG_LOG_BUF_SHIFT=16 · 9 unmodified lines
1010 # CONFIG_PID_NS is not set
1111 # CONFIG_NET_NS is not set
1212 CONFIG_BLK_DEV_INITRD=y
13+CONFIG_USERFAULTFD=y
1314 CONFIG_SLAB=y
1415 CONFIG_MODULES=y
1516 CONFIG_MODULE_UNLOAD=y
@@ -55,7 +56,6 @@ CONFIG_NET_IPGRE_DEMUX=m · 39 unmodified lines
5556 CONFIG_NET_IPGRE=m
5657 CONFIG_NET_IPVTI=m
5758 CONFIG_NET_FOU_IP_TUNNELS=y
58−CONFIG_GENEVE_CORE=m
5959 CONFIG_INET_AH=m
6060 CONFIG_INET_ESP=m
6161 CONFIG_INET_IPCOMP=m
@@ -65,10 +65,12 @@ CONFIG_INET_XFRM_MODE_BEET=m · 3 unmodified lines
6565 # CONFIG_INET_LRO is not set
6666 CONFIG_INET_DIAG=m
6767 CONFIG_INET_UDP_DIAG=m
68+CONFIG_IPV6=m
6869 CONFIG_IPV6_ROUTER_PREF=y
6970 CONFIG_INET6_AH=m
7071 CONFIG_INET6_ESP=m
7172 CONFIG_INET6_IPCOMP=m
73+CONFIG_IPV6_ILA=m
7274 CONFIG_IPV6_VTI=m
7375 CONFIG_IPV6_GRE=m
7476 CONFIG_NETFILTER=y
@@ -177,6 +179,7 @@ CONFIG_IP_SET_HASH_NETIFACE=m · 102 unmodified lines
177179 CONFIG_IP_SET_LIST_SET=m
178180 CONFIG_NF_CONNTRACK_IPV4=m
179181 CONFIG_NFT_CHAIN_ROUTE_IPV4=m
182+CONFIG_NFT_DUP_IPV4=m
180183 CONFIG_NF_TABLES_ARP=m
181184 CONFIG_NF_LOG_ARP=m
182185 CONFIG_NFT_CHAIN_NAT_IPV4=m
@@ -204,6 +207,7 @@ CONFIG_IP_NF_ARPFILTER=m · 21 unmodified lines
204207 CONFIG_IP_NF_ARP_MANGLE=m
205208 CONFIG_NF_CONNTRACK_IPV6=m
206209 CONFIG_NFT_CHAIN_ROUTE_IPV6=m
210+CONFIG_NFT_DUP_IPV6=m
207211 CONFIG_NFT_CHAIN_NAT_IPV6=m
208212 CONFIG_NFT_MASQ_IPV6=m
209213 CONFIG_NFT_REDIR_IPV6=m
@@ -269,6 +273,7 @@ CONFIG_NETLINK_DIAG=m · 59 unmodified lines
269273 CONFIG_MPLS=y
270274 CONFIG_NET_MPLS_GSO=m
271275 CONFIG_MPLS_ROUTING=m
276+CONFIG_MPLS_IPTUNNEL=m
272277 # CONFIG_WIRELESS is not set
273278 # CONFIG_UEVENT_HELPER is not set
274279 CONFIG_DEVTMPFS=y
@@ -344,6 +349,7 @@ CONFIG_VETH=m · 69 unmodified lines
344349 # CONFIG_NET_VENDOR_SAMSUNG is not set
345350 # CONFIG_NET_VENDOR_SEEQ is not set
346351 # CONFIG_NET_VENDOR_STMICRO is not set
352+# CONFIG_NET_VENDOR_SYNOPSYS is not set
347353 # CONFIG_NET_VENDOR_VIA is not set
348354 # CONFIG_NET_VENDOR_WIZNET is not set
349355 CONFIG_PPP=m
@@ -495,6 +501,7 @@ CONFIG_TEST_USER_COPY=m · 145 unmodified lines
495501 CONFIG_TEST_BPF=m
496502 CONFIG_TEST_FIRMWARE=m
497503 CONFIG_TEST_UDELAY=m
504+CONFIG_TEST_STATIC_KEYS=m
498505 CONFIG_EARLY_PRINTK=y
499506 CONFIG_ENCRYPTED_KEYS=m
500507 CONFIG_CRYPTO_RSA=m
arch/m68k/configs/atari_defconfig+8−1
@@ -10,6 +10,7 @@ CONFIG_LOG_BUF_SHIFT=16 · 9 unmodified lines
1010 # CONFIG_PID_NS is not set
1111 # CONFIG_NET_NS is not set
1212 CONFIG_BLK_DEV_INITRD=y
13+CONFIG_USERFAULTFD=y
1314 CONFIG_SLAB=y
1415 CONFIG_MODULES=y
1516 CONFIG_MODULE_UNLOAD=y
@@ -55,7 +56,6 @@ CONFIG_NET_IPGRE_DEMUX=m · 39 unmodified lines
5556 CONFIG_NET_IPGRE=m
5657 CONFIG_NET_IPVTI=m
5758 CONFIG_NET_FOU_IP_TUNNELS=y
58−CONFIG_GENEVE_CORE=m
5959 CONFIG_INET_AH=m
6060 CONFIG_INET_ESP=m
6161 CONFIG_INET_IPCOMP=m
@@ -65,10 +65,12 @@ CONFIG_INET_XFRM_MODE_BEET=m · 3 unmodified lines
6565 # CONFIG_INET_LRO is not set
6666 CONFIG_INET_DIAG=m
6767 CONFIG_INET_UDP_DIAG=m
68+CONFIG_IPV6=m
6869 CONFIG_IPV6_ROUTER_PREF=y
6970 CONFIG_INET6_AH=m
7071 CONFIG_INET6_ESP=m
7172 CONFIG_INET6_IPCOMP=m
73+CONFIG_IPV6_ILA=m
7274 CONFIG_IPV6_VTI=m
7375 CONFIG_IPV6_GRE=m
7476 CONFIG_NETFILTER=y
@@ -177,6 +179,7 @@ CONFIG_IP_SET_HASH_NETIFACE=m · 102 unmodified lines
177179 CONFIG_IP_SET_LIST_SET=m
178180 CONFIG_NF_CONNTRACK_IPV4=m
179181 CONFIG_NFT_CHAIN_ROUTE_IPV4=m
182+CONFIG_NFT_DUP_IPV4=m
180183 CONFIG_NF_TABLES_ARP=m
181184 CONFIG_NF_LOG_ARP=m
182185 CONFIG_NFT_CHAIN_NAT_IPV4=m
@@ -204,6 +207,7 @@ CONFIG_IP_NF_ARPFILTER=m · 21 unmodified lines
204207 CONFIG_IP_NF_ARP_MANGLE=m
205208 CONFIG_NF_CONNTRACK_IPV6=m
206209 CONFIG_NFT_CHAIN_ROUTE_IPV6=m
210+CONFIG_NFT_DUP_IPV6=m
207211 CONFIG_NFT_CHAIN_NAT_IPV6=m
208212 CONFIG_NFT_MASQ_IPV6=m
209213 CONFIG_NFT_REDIR_IPV6=m
@@ -269,6 +273,7 @@ CONFIG_NETLINK_DIAG=m · 59 unmodified lines
269273 CONFIG_MPLS=y
270274 CONFIG_NET_MPLS_GSO=m
271275 CONFIG_MPLS_ROUTING=m
276+CONFIG_MPLS_IPTUNNEL=m
272277 # CONFIG_WIRELESS is not set
273278 # CONFIG_UEVENT_HELPER is not set
274279 CONFIG_DEVTMPFS=y
@@ -355,6 +360,7 @@ CONFIG_NE2000=y · 80 unmodified lines
355360 # CONFIG_NET_VENDOR_SEEQ is not set
356361 CONFIG_SMC91X=y
357362 # CONFIG_NET_VENDOR_STMICRO is not set
363+# CONFIG_NET_VENDOR_SYNOPSYS is not set
358364 # CONFIG_NET_VENDOR_VIA is not set
359365 # CONFIG_NET_VENDOR_WIZNET is not set
360366 CONFIG_PPP=m
@@ -517,6 +523,7 @@ CONFIG_TEST_USER_COPY=m · 156 unmodified lines
517523 CONFIG_TEST_BPF=m
518524 CONFIG_TEST_FIRMWARE=m
519525 CONFIG_TEST_UDELAY=m
526+CONFIG_TEST_STATIC_KEYS=m
520527 CONFIG_EARLY_PRINTK=y
521528 CONFIG_ENCRYPTED_KEYS=m
522529 CONFIG_CRYPTO_RSA=m
arch/m68k/configs/bvme6000_defconfig+8−1
@@ -10,6 +10,7 @@ CONFIG_LOG_BUF_SHIFT=16 · 9 unmodified lines
1010 # CONFIG_PID_NS is not set
1111 # CONFIG_NET_NS is not set
1212 CONFIG_BLK_DEV_INITRD=y
13+CONFIG_USERFAULTFD=y
1314 CONFIG_SLAB=y
1415 CONFIG_MODULES=y
1516 CONFIG_MODULE_UNLOAD=y
@@ -53,7 +54,6 @@ CONFIG_NET_IPGRE_DEMUX=m · 37 unmodified lines
5354 CONFIG_NET_IPGRE=m
5455 CONFIG_NET_IPVTI=m
5556 CONFIG_NET_FOU_IP_TUNNELS=y
56−CONFIG_GENEVE_CORE=m
5757 CONFIG_INET_AH=m
5858 CONFIG_INET_ESP=m
5959 CONFIG_INET_IPCOMP=m
@@ -63,10 +63,12 @@ CONFIG_INET_XFRM_MODE_BEET=m · 3 unmodified lines
6363 # CONFIG_INET_LRO is not set
6464 CONFIG_INET_DIAG=m
6565 CONFIG_INET_UDP_DIAG=m
66+CONFIG_IPV6=m
6667 CONFIG_IPV6_ROUTER_PREF=y
6768 CONFIG_INET6_AH=m
6869 CONFIG_INET6_ESP=m
6970 CONFIG_INET6_IPCOMP=m
71+CONFIG_IPV6_ILA=m
7072 CONFIG_IPV6_VTI=m
7173 CONFIG_IPV6_GRE=m
7274 CONFIG_NETFILTER=y
@@ -175,6 +177,7 @@ CONFIG_IP_SET_HASH_NETIFACE=m · 102 unmodified lines
175177 CONFIG_IP_SET_LIST_SET=m
176178 CONFIG_NF_CONNTRACK_IPV4=m
177179 CONFIG_NFT_CHAIN_ROUTE_IPV4=m
180+CONFIG_NFT_DUP_IPV4=m
178181 CONFIG_NF_TABLES_ARP=m
179182 CONFIG_NF_LOG_ARP=m
180183 CONFIG_NFT_CHAIN_NAT_IPV4=m
@@ -202,6 +205,7 @@ CONFIG_IP_NF_ARPFILTER=m · 21 unmodified lines
202205 CONFIG_IP_NF_ARP_MANGLE=m
203206 CONFIG_NF_CONNTRACK_IPV6=m
204207 CONFIG_NFT_CHAIN_ROUTE_IPV6=m
208+CONFIG_NFT_DUP_IPV6=m
205209 CONFIG_NFT_CHAIN_NAT_IPV6=m
206210 CONFIG_NFT_MASQ_IPV6=m
207211 CONFIG_NFT_REDIR_IPV6=m
@@ -267,6 +271,7 @@ CONFIG_NETLINK_DIAG=m · 59 unmodified lines
267271 CONFIG_MPLS=y
268272 CONFIG_NET_MPLS_GSO=m
269273 CONFIG_MPLS_ROUTING=m
274+CONFIG_MPLS_IPTUNNEL=m
270275 # CONFIG_WIRELESS is not set
271276 # CONFIG_UEVENT_HELPER is not set
272277 CONFIG_DEVTMPFS=y
@@ -343,6 +348,7 @@ CONFIG_BVME6000_NET=y · 70 unmodified lines
343348 # CONFIG_NET_VENDOR_SAMSUNG is not set
344349 # CONFIG_NET_VENDOR_SEEQ is not set
345350 # CONFIG_NET_VENDOR_STMICRO is not set
351+# CONFIG_NET_VENDOR_SYNOPSYS is not set
346352 # CONFIG_NET_VENDOR_VIA is not set
347353 # CONFIG_NET_VENDOR_WIZNET is not set
348354 CONFIG_PPP=m
@@ -488,6 +494,7 @@ CONFIG_TEST_USER_COPY=m · 139 unmodified lines
488494 CONFIG_TEST_BPF=m
489495 CONFIG_TEST_FIRMWARE=m
490496 CONFIG_TEST_UDELAY=m
497+CONFIG_TEST_STATIC_KEYS=m
491498 CONFIG_EARLY_PRINTK=y
492499 CONFIG_ENCRYPTED_KEYS=m
493500 CONFIG_CRYPTO_RSA=m
arch/m68k/configs/hp300_defconfig+8−1
@@ -10,6 +10,7 @@ CONFIG_LOG_BUF_SHIFT=16 · 9 unmodified lines
1010 # CONFIG_PID_NS is not set
1111 # CONFIG_NET_NS is not set
1212 CONFIG_BLK_DEV_INITRD=y
13+CONFIG_USERFAULTFD=y
1314 CONFIG_SLAB=y
1415 CONFIG_MODULES=y
1516 CONFIG_MODULE_UNLOAD=y
@@ -55,7 +56,6 @@ CONFIG_NET_IPGRE_DEMUX=m · 39 unmodified lines
5556 CONFIG_NET_IPGRE=m
5657 CONFIG_NET_IPVTI=m
5758 CONFIG_NET_FOU_IP_TUNNELS=y
58−CONFIG_GENEVE_CORE=m
5959 CONFIG_INET_AH=m
6060 CONFIG_INET_ESP=m
6161 CONFIG_INET_IPCOMP=m
@@ -65,10 +65,12 @@ CONFIG_INET_XFRM_MODE_BEET=m · 3 unmodified lines
6565 # CONFIG_INET_LRO is not set
6666 CONFIG_INET_DIAG=m
6767 CONFIG_INET_UDP_DIAG=m
68+CONFIG_IPV6=m
6869 CONFIG_IPV6_ROUTER_PREF=y
6970 CONFIG_INET6_AH=m
7071 CONFIG_INET6_ESP=m
7172 CONFIG_INET6_IPCOMP=m
73+CONFIG_IPV6_ILA=m
7274 CONFIG_IPV6_VTI=m
7375 CONFIG_IPV6_GRE=m
7476 CONFIG_NETFILTER=y
@@ -177,6 +179,7 @@ CONFIG_IP_SET_HASH_NETIFACE=m · 102 unmodified lines
177179 CONFIG_IP_SET_LIST_SET=m
178180 CONFIG_NF_CONNTRACK_IPV4=m
179181 CONFIG_NFT_CHAIN_ROUTE_IPV4=m
182+CONFIG_NFT_DUP_IPV4=m
180183 CONFIG_NF_TABLES_ARP=m
181184 CONFIG_NF_LOG_ARP=m
182185 CONFIG_NFT_CHAIN_NAT_IPV4=m
@@ -204,6 +207,7 @@ CONFIG_IP_NF_ARPFILTER=m · 21 unmodified lines
204207 CONFIG_IP_NF_ARP_MANGLE=m
205208 CONFIG_NF_CONNTRACK_IPV6=m
206209 CONFIG_NFT_CHAIN_ROUTE_IPV6=m
210+CONFIG_NFT_DUP_IPV6=m
207211 CONFIG_NFT_CHAIN_NAT_IPV6=m
208212 CONFIG_NFT_MASQ_IPV6=m
209213 CONFIG_NFT_REDIR_IPV6=m
@@ -269,6 +273,7 @@ CONFIG_NETLINK_DIAG=m · 59 unmodified lines
269273 CONFIG_MPLS=y
270274 CONFIG_NET_MPLS_GSO=m
271275 CONFIG_MPLS_ROUTING=m
276+CONFIG_MPLS_IPTUNNEL=m
272277 # CONFIG_WIRELESS is not set
273278 # CONFIG_UEVENT_HELPER is not set
274279 CONFIG_DEVTMPFS=y
@@ -345,6 +350,7 @@ CONFIG_HPLANCE=y · 70 unmodified lines
345350 # CONFIG_NET_VENDOR_SAMSUNG is not set
346351 # CONFIG_NET_VENDOR_SEEQ is not set
347352 # CONFIG_NET_VENDOR_STMICRO is not set
353+# CONFIG_NET_VENDOR_SYNOPSYS is not set
348354 # CONFIG_NET_VENDOR_VIA is not set
349355 # CONFIG_NET_VENDOR_WIZNET is not set
350356 CONFIG_PPP=m
@@ -497,6 +503,7 @@ CONFIG_TEST_USER_COPY=m · 146 unmodified lines
497503 CONFIG_TEST_BPF=m
498504 CONFIG_TEST_FIRMWARE=m
499505 CONFIG_TEST_UDELAY=m
506+CONFIG_TEST_STATIC_KEYS=m
500507 CONFIG_EARLY_PRINTK=y
501508 CONFIG_ENCRYPTED_KEYS=m
502509 CONFIG_CRYPTO_RSA=m
arch/m68k/configs/mac_defconfig+8−1
@@ -10,6 +10,7 @@ CONFIG_LOG_BUF_SHIFT=16 · 9 unmodified lines
1010 # CONFIG_PID_NS is not set
1111 # CONFIG_NET_NS is not set
1212 CONFIG_BLK_DEV_INITRD=y
13+CONFIG_USERFAULTFD=y
1314 CONFIG_SLAB=y
1415 CONFIG_MODULES=y
1516 CONFIG_MODULE_UNLOAD=y
@@ -54,7 +55,6 @@ CONFIG_NET_IPGRE_DEMUX=m · 38 unmodified lines
5455 CONFIG_NET_IPGRE=m
5556 CONFIG_NET_IPVTI=m
5657 CONFIG_NET_FOU_IP_TUNNELS=y
57−CONFIG_GENEVE_CORE=m
5858 CONFIG_INET_AH=m
5959 CONFIG_INET_ESP=m
6060 CONFIG_INET_IPCOMP=m
@@ -64,10 +64,12 @@ CONFIG_INET_XFRM_MODE_BEET=m · 3 unmodified lines
6464 # CONFIG_INET_LRO is not set
6565 CONFIG_INET_DIAG=m
6666 CONFIG_INET_UDP_DIAG=m
67+CONFIG_IPV6=m
6768 CONFIG_IPV6_ROUTER_PREF=y
6869 CONFIG_INET6_AH=m
6970 CONFIG_INET6_ESP=m
7071 CONFIG_INET6_IPCOMP=m
72+CONFIG_IPV6_ILA=m
7173 CONFIG_IPV6_VTI=m
7274 CONFIG_IPV6_GRE=m
7375 CONFIG_NETFILTER=y
@@ -176,6 +178,7 @@ CONFIG_IP_SET_HASH_NETIFACE=m · 102 unmodified lines
176178 CONFIG_IP_SET_LIST_SET=m
177179 CONFIG_NF_CONNTRACK_IPV4=m
178180 CONFIG_NFT_CHAIN_ROUTE_IPV4=m
181+CONFIG_NFT_DUP_IPV4=m
179182 CONFIG_NF_TABLES_ARP=m
180183 CONFIG_NF_LOG_ARP=m
181184 CONFIG_NFT_CHAIN_NAT_IPV4=m
@@ -203,6 +206,7 @@ CONFIG_IP_NF_ARPFILTER=m · 21 unmodified lines
203206 CONFIG_IP_NF_ARP_MANGLE=m
204207 CONFIG_NF_CONNTRACK_IPV6=m
205208 CONFIG_NFT_CHAIN_ROUTE_IPV6=m
209+CONFIG_NFT_DUP_IPV6=m
206210 CONFIG_NFT_CHAIN_NAT_IPV6=m
207211 CONFIG_NFT_MASQ_IPV6=m
208212 CONFIG_NFT_REDIR_IPV6=m
@@ -271,6 +275,7 @@ CONFIG_NETLINK_DIAG=m · 62 unmodified lines
271275 CONFIG_MPLS=y
272276 CONFIG_NET_MPLS_GSO=m
273277 CONFIG_MPLS_ROUTING=m
278+CONFIG_MPLS_IPTUNNEL=m
274279 # CONFIG_WIRELESS is not set
275280 # CONFIG_UEVENT_HELPER is not set
276281 CONFIG_DEVTMPFS=y
@@ -364,6 +369,7 @@ CONFIG_MAC8390=y · 87 unmodified lines
364369 # CONFIG_NET_VENDOR_SEEQ is not set
365370 # CONFIG_NET_VENDOR_SMSC is not set
366371 # CONFIG_NET_VENDOR_STMICRO is not set
372+# CONFIG_NET_VENDOR_SYNOPSYS is not set
367373 # CONFIG_NET_VENDOR_VIA is not set
368374 # CONFIG_NET_VENDOR_WIZNET is not set
369375 CONFIG_PPP=m
@@ -519,6 +525,7 @@ CONFIG_TEST_USER_COPY=m · 149 unmodified lines
519525 CONFIG_TEST_BPF=m
520526 CONFIG_TEST_FIRMWARE=m
521527 CONFIG_TEST_UDELAY=m
528+CONFIG_TEST_STATIC_KEYS=m
522529 CONFIG_EARLY_PRINTK=y
523530 CONFIG_ENCRYPTED_KEYS=m
524531 CONFIG_CRYPTO_RSA=m
arch/m68k/configs/multi_defconfig+8−1
@@ -10,6 +10,7 @@ CONFIG_LOG_BUF_SHIFT=16 · 9 unmodified lines
1010 # CONFIG_PID_NS is not set
1111 # CONFIG_NET_NS is not set
1212 CONFIG_BLK_DEV_INITRD=y
13+CONFIG_USERFAULTFD=y
1314 CONFIG_SLAB=y
1415 CONFIG_MODULES=y
1516 CONFIG_MODULE_UNLOAD=y
@@ -64,7 +65,6 @@ CONFIG_NET_IPGRE_DEMUX=m · 48 unmodified lines
6465 CONFIG_NET_IPGRE=m
6566 CONFIG_NET_IPVTI=m
6667 CONFIG_NET_FOU_IP_TUNNELS=y
67−CONFIG_GENEVE_CORE=m
6868 CONFIG_INET_AH=m
6969 CONFIG_INET_ESP=m
7070 CONFIG_INET_IPCOMP=m
@@ -74,10 +74,12 @@ CONFIG_INET_XFRM_MODE_BEET=m · 3 unmodified lines
7474 # CONFIG_INET_LRO is not set
7575 CONFIG_INET_DIAG=m
7676 CONFIG_INET_UDP_DIAG=m
77+CONFIG_IPV6=m
7778 CONFIG_IPV6_ROUTER_PREF=y
7879 CONFIG_INET6_AH=m
7980 CONFIG_INET6_ESP=m
8081 CONFIG_INET6_IPCOMP=m
82+CONFIG_IPV6_ILA=m
8183 CONFIG_IPV6_VTI=m
8284 CONFIG_IPV6_GRE=m
8385 CONFIG_NETFILTER=y
@@ -186,6 +188,7 @@ CONFIG_IP_SET_HASH_NETIFACE=m · 102 unmodified lines
186188 CONFIG_IP_SET_LIST_SET=m
187189 CONFIG_NF_CONNTRACK_IPV4=m
188190 CONFIG_NFT_CHAIN_ROUTE_IPV4=m
191+CONFIG_NFT_DUP_IPV4=m
189192 CONFIG_NF_TABLES_ARP=m
190193 CONFIG_NF_LOG_ARP=m
191194 CONFIG_NFT_CHAIN_NAT_IPV4=m
@@ -213,6 +216,7 @@ CONFIG_IP_NF_ARPFILTER=m · 21 unmodified lines
213216 CONFIG_IP_NF_ARP_MANGLE=m
214217 CONFIG_NF_CONNTRACK_IPV6=m
215218 CONFIG_NFT_CHAIN_ROUTE_IPV6=m
219+CONFIG_NFT_DUP_IPV6=m
216220 CONFIG_NFT_CHAIN_NAT_IPV6=m
217221 CONFIG_NFT_MASQ_IPV6=m
218222 CONFIG_NFT_REDIR_IPV6=m
@@ -281,6 +285,7 @@ CONFIG_NETLINK_DIAG=m · 62 unmodified lines
281285 CONFIG_MPLS=y
282286 CONFIG_NET_MPLS_GSO=m
283287 CONFIG_MPLS_ROUTING=m
288+CONFIG_MPLS_IPTUNNEL=m
284289 # CONFIG_WIRELESS is not set
285290 # CONFIG_UEVENT_HELPER is not set
286291 CONFIG_DEVTMPFS=y
@@ -410,6 +415,7 @@ CONFIG_ZORRO8390=y · 123 unmodified lines
410415 # CONFIG_NET_VENDOR_SEEQ is not set
411416 CONFIG_SMC91X=y
412417 # CONFIG_NET_VENDOR_STMICRO is not set
418+# CONFIG_NET_VENDOR_SYNOPSYS is not set
413419 # CONFIG_NET_VENDOR_VIA is not set
414420 # CONFIG_NET_VENDOR_WIZNET is not set
415421 CONFIG_PLIP=m
@@ -599,6 +605,7 @@ CONFIG_TEST_USER_COPY=m · 183 unmodified lines
599605 CONFIG_TEST_BPF=m
600606 CONFIG_TEST_FIRMWARE=m
601607 CONFIG_TEST_UDELAY=m
608+CONFIG_TEST_STATIC_KEYS=m
602609 CONFIG_EARLY_PRINTK=y
603610 CONFIG_ENCRYPTED_KEYS=m
604611 CONFIG_CRYPTO_RSA=m
arch/m68k/configs/mvme147_defconfig+8−1
@@ -10,6 +10,7 @@ CONFIG_LOG_BUF_SHIFT=16 · 9 unmodified lines
1010 # CONFIG_PID_NS is not set
1111 # CONFIG_NET_NS is not set
1212 CONFIG_BLK_DEV_INITRD=y
13+CONFIG_USERFAULTFD=y
1314 CONFIG_SLAB=y
1415 CONFIG_MODULES=y
1516 CONFIG_MODULE_UNLOAD=y
@@ -52,7 +53,6 @@ CONFIG_NET_IPGRE_DEMUX=m · 36 unmodified lines
5253 CONFIG_NET_IPGRE=m
5354 CONFIG_NET_IPVTI=m
5455 CONFIG_NET_FOU_IP_TUNNELS=y
55−CONFIG_GENEVE_CORE=m
5656 CONFIG_INET_AH=m
5757 CONFIG_INET_ESP=m
5858 CONFIG_INET_IPCOMP=m
@@ -62,10 +62,12 @@ CONFIG_INET_XFRM_MODE_BEET=m · 3 unmodified lines
6262 # CONFIG_INET_LRO is not set
6363 CONFIG_INET_DIAG=m
6464 CONFIG_INET_UDP_DIAG=m
65+CONFIG_IPV6=m
6566 CONFIG_IPV6_ROUTER_PREF=y
6667 CONFIG_INET6_AH=m
6768 CONFIG_INET6_ESP=m
6869 CONFIG_INET6_IPCOMP=m
70+CONFIG_IPV6_ILA=m
6971 CONFIG_IPV6_VTI=m
7072 CONFIG_IPV6_GRE=m
7173 CONFIG_NETFILTER=y
@@ -174,6 +176,7 @@ CONFIG_IP_SET_HASH_NETIFACE=m · 102 unmodified lines
174176 CONFIG_IP_SET_LIST_SET=m
175177 CONFIG_NF_CONNTRACK_IPV4=m
176178 CONFIG_NFT_CHAIN_ROUTE_IPV4=m
179+CONFIG_NFT_DUP_IPV4=m
177180 CONFIG_NF_TABLES_ARP=m
178181 CONFIG_NF_LOG_ARP=m
179182 CONFIG_NFT_CHAIN_NAT_IPV4=m
@@ -201,6 +204,7 @@ CONFIG_IP_NF_ARPFILTER=m · 21 unmodified lines
201204 CONFIG_IP_NF_ARP_MANGLE=m
202205 CONFIG_NF_CONNTRACK_IPV6=m
203206 CONFIG_NFT_CHAIN_ROUTE_IPV6=m
207+CONFIG_NFT_DUP_IPV6=m
204208 CONFIG_NFT_CHAIN_NAT_IPV6=m
205209 CONFIG_NFT_MASQ_IPV6=m
206210 CONFIG_NFT_REDIR_IPV6=m
@@ -266,6 +270,7 @@ CONFIG_NETLINK_DIAG=m · 59 unmodified lines
266270 CONFIG_MPLS=y
267271 CONFIG_NET_MPLS_GSO=m
268272 CONFIG_MPLS_ROUTING=m
273+CONFIG_MPLS_IPTUNNEL=m
269274 # CONFIG_WIRELESS is not set
270275 # CONFIG_UEVENT_HELPER is not set
271276 CONFIG_DEVTMPFS=y
@@ -343,6 +348,7 @@ CONFIG_MVME147_NET=y · 71 unmodified lines
343348 # CONFIG_NET_VENDOR_SAMSUNG is not set
344349 # CONFIG_NET_VENDOR_SEEQ is not set
345350 # CONFIG_NET_VENDOR_STMICRO is not set
351+# CONFIG_NET_VENDOR_SYNOPSYS is not set
346352 # CONFIG_NET_VENDOR_VIA is not set
347353 # CONFIG_NET_VENDOR_WIZNET is not set
348354 CONFIG_PPP=m
@@ -488,6 +494,7 @@ CONFIG_TEST_USER_COPY=m · 139 unmodified lines
488494 CONFIG_TEST_BPF=m
489495 CONFIG_TEST_FIRMWARE=m
490496 CONFIG_TEST_UDELAY=m
497+CONFIG_TEST_STATIC_KEYS=m
491498 CONFIG_EARLY_PRINTK=y
492499 CONFIG_ENCRYPTED_KEYS=m
493500 CONFIG_CRYPTO_RSA=m
arch/m68k/configs/mvme16x_defconfig+8−1
@@ -10,6 +10,7 @@ CONFIG_LOG_BUF_SHIFT=16 · 9 unmodified lines
1010 # CONFIG_PID_NS is not set
1111 # CONFIG_NET_NS is not set
1212 CONFIG_BLK_DEV_INITRD=y
13+CONFIG_USERFAULTFD=y
1314 CONFIG_SLAB=y
1415 CONFIG_MODULES=y
1516 CONFIG_MODULE_UNLOAD=y
@@ -53,7 +54,6 @@ CONFIG_NET_IPGRE_DEMUX=m · 37 unmodified lines
5354 CONFIG_NET_IPGRE=m
5455 CONFIG_NET_IPVTI=m
5556 CONFIG_NET_FOU_IP_TUNNELS=y
56−CONFIG_GENEVE_CORE=m
5757 CONFIG_INET_AH=m
5858 CONFIG_INET_ESP=m
5959 CONFIG_INET_IPCOMP=m
@@ -63,10 +63,12 @@ CONFIG_INET_XFRM_MODE_BEET=m · 3 unmodified lines
6363 # CONFIG_INET_LRO is not set
6464 CONFIG_INET_DIAG=m
6565 CONFIG_INET_UDP_DIAG=m
66+CONFIG_IPV6=m
6667 CONFIG_IPV6_ROUTER_PREF=y
6768 CONFIG_INET6_AH=m
6869 CONFIG_INET6_ESP=m
6970 CONFIG_INET6_IPCOMP=m
71+CONFIG_IPV6_ILA=m
7072 CONFIG_IPV6_VTI=m
7173 CONFIG_IPV6_GRE=m
7274 CONFIG_NETFILTER=y
@@ -175,6 +177,7 @@ CONFIG_IP_SET_HASH_NETIFACE=m · 102 unmodified lines
175177 CONFIG_IP_SET_LIST_SET=m
176178 CONFIG_NF_CONNTRACK_IPV4=m
177179 CONFIG_NFT_CHAIN_ROUTE_IPV4=m
180+CONFIG_NFT_DUP_IPV4=m
178181 CONFIG_NF_TABLES_ARP=m
179182 CONFIG_NF_LOG_ARP=m
180183 CONFIG_NFT_CHAIN_NAT_IPV4=m
@@ -202,6 +205,7 @@ CONFIG_IP_NF_ARPFILTER=m · 21 unmodified lines
202205 CONFIG_IP_NF_ARP_MANGLE=m
203206 CONFIG_NF_CONNTRACK_IPV6=m
204207 CONFIG_NFT_CHAIN_ROUTE_IPV6=m
208+CONFIG_NFT_DUP_IPV6=m
205209 CONFIG_NFT_CHAIN_NAT_IPV6=m
206210 CONFIG_NFT_MASQ_IPV6=m
207211 CONFIG_NFT_REDIR_IPV6=m
@@ -267,6 +271,7 @@ CONFIG_NETLINK_DIAG=m · 59 unmodified lines
267271 CONFIG_MPLS=y
268272 CONFIG_NET_MPLS_GSO=m
269273 CONFIG_MPLS_ROUTING=m
274+CONFIG_MPLS_IPTUNNEL=m
270275 # CONFIG_WIRELESS is not set
271276 # CONFIG_UEVENT_HELPER is not set
272277 CONFIG_DEVTMPFS=y
@@ -343,6 +348,7 @@ CONFIG_MVME16x_NET=y · 70 unmodified lines
343348 # CONFIG_NET_VENDOR_SAMSUNG is not set
344349 # CONFIG_NET_VENDOR_SEEQ is not set
345350 # CONFIG_NET_VENDOR_STMICRO is not set
351+# CONFIG_NET_VENDOR_SYNOPSYS is not set
346352 # CONFIG_NET_VENDOR_VIA is not set
347353 # CONFIG_NET_VENDOR_WIZNET is not set
348354 CONFIG_PPP=m
@@ -488,6 +494,7 @@ CONFIG_TEST_USER_COPY=m · 139 unmodified lines
488494 CONFIG_TEST_BPF=m
489495 CONFIG_TEST_FIRMWARE=m
490496 CONFIG_TEST_UDELAY=m
497+CONFIG_TEST_STATIC_KEYS=m
491498 CONFIG_EARLY_PRINTK=y
492499 CONFIG_ENCRYPTED_KEYS=m
493500 CONFIG_CRYPTO_RSA=m
arch/m68k/configs/q40_defconfig+8−1
@@ -10,6 +10,7 @@ CONFIG_LOG_BUF_SHIFT=16 · 9 unmodified lines
1010 # CONFIG_PID_NS is not set
1111 # CONFIG_NET_NS is not set
1212 CONFIG_BLK_DEV_INITRD=y
13+CONFIG_USERFAULTFD=y
1314 CONFIG_SLAB=y
1415 CONFIG_MODULES=y
1516 CONFIG_MODULE_UNLOAD=y
@@ -53,7 +54,6 @@ CONFIG_NET_IPGRE_DEMUX=m · 37 unmodified lines
5354 CONFIG_NET_IPGRE=m
5455 CONFIG_NET_IPVTI=m
5556 CONFIG_NET_FOU_IP_TUNNELS=y
56−CONFIG_GENEVE_CORE=m
5757 CONFIG_INET_AH=m
5858 CONFIG_INET_ESP=m
5959 CONFIG_INET_IPCOMP=m
@@ -63,10 +63,12 @@ CONFIG_INET_XFRM_MODE_BEET=m · 3 unmodified lines
6363 # CONFIG_INET_LRO is not set
6464 CONFIG_INET_DIAG=m
6565 CONFIG_INET_UDP_DIAG=m
66+CONFIG_IPV6=m
6667 CONFIG_IPV6_ROUTER_PREF=y
6768 CONFIG_INET6_AH=m
6869 CONFIG_INET6_ESP=m
6970 CONFIG_INET6_IPCOMP=m
71+CONFIG_IPV6_ILA=m
7072 CONFIG_IPV6_VTI=m
7173 CONFIG_IPV6_GRE=m
7274 CONFIG_NETFILTER=y
@@ -175,6 +177,7 @@ CONFIG_IP_SET_HASH_NETIFACE=m · 102 unmodified lines
175177 CONFIG_IP_SET_LIST_SET=m
176178 CONFIG_NF_CONNTRACK_IPV4=m
177179 CONFIG_NFT_CHAIN_ROUTE_IPV4=m
180+CONFIG_NFT_DUP_IPV4=m
178181 CONFIG_NF_TABLES_ARP=m
179182 CONFIG_NF_LOG_ARP=m
180183 CONFIG_NFT_CHAIN_NAT_IPV4=m
@@ -202,6 +205,7 @@ CONFIG_IP_NF_ARPFILTER=m · 21 unmodified lines
202205 CONFIG_IP_NF_ARP_MANGLE=m
203206 CONFIG_NF_CONNTRACK_IPV6=m
204207 CONFIG_NFT_CHAIN_ROUTE_IPV6=m
208+CONFIG_NFT_DUP_IPV6=m
205209 CONFIG_NFT_CHAIN_NAT_IPV6=m
206210 CONFIG_NFT_MASQ_IPV6=m
207211 CONFIG_NFT_REDIR_IPV6=m
@@ -267,6 +271,7 @@ CONFIG_NETLINK_DIAG=m · 59 unmodified lines
267271 CONFIG_MPLS=y
268272 CONFIG_NET_MPLS_GSO=m
269273 CONFIG_MPLS_ROUTING=m
274+CONFIG_MPLS_IPTUNNEL=m
270275 # CONFIG_WIRELESS is not set
271276 # CONFIG_UEVENT_HELPER is not set
272277 CONFIG_DEVTMPFS=y
@@ -354,6 +359,7 @@ CONFIG_NE2000=y · 81 unmodified lines
354359 # CONFIG_NET_VENDOR_SEEQ is not set
355360 # CONFIG_NET_VENDOR_SMSC is not set
356361 # CONFIG_NET_VENDOR_STMICRO is not set
362+# CONFIG_NET_VENDOR_SYNOPSYS is not set
357363 # CONFIG_NET_VENDOR_VIA is not set
358364 # CONFIG_NET_VENDOR_WIZNET is not set
359365 CONFIG_PLIP=m
@@ -510,6 +516,7 @@ CONFIG_TEST_USER_COPY=m · 150 unmodified lines
510516 CONFIG_TEST_BPF=m
511517 CONFIG_TEST_FIRMWARE=m
512518 CONFIG_TEST_UDELAY=m
519+CONFIG_TEST_STATIC_KEYS=m
513520 CONFIG_EARLY_PRINTK=y
514521 CONFIG_ENCRYPTED_KEYS=m
515522 CONFIG_CRYPTO_RSA=m
arch/m68k/configs/sun3_defconfig+8−1
@@ -10,6 +10,7 @@ CONFIG_LOG_BUF_SHIFT=16 · 9 unmodified lines
1010 # CONFIG_PID_NS is not set
1111 # CONFIG_NET_NS is not set
1212 CONFIG_BLK_DEV_INITRD=y
13+CONFIG_USERFAULTFD=y
1314 CONFIG_SLAB=y
1415 CONFIG_MODULES=y
1516 CONFIG_MODULE_UNLOAD=y
@@ -50,7 +51,6 @@ CONFIG_NET_IPGRE_DEMUX=m · 34 unmodified lines
5051 CONFIG_NET_IPGRE=m
5152 CONFIG_NET_IPVTI=m
5253 CONFIG_NET_FOU_IP_TUNNELS=y
53−CONFIG_GENEVE_CORE=m
5454 CONFIG_INET_AH=m
5555 CONFIG_INET_ESP=m
5656 CONFIG_INET_IPCOMP=m
@@ -60,10 +60,12 @@ CONFIG_INET_XFRM_MODE_BEET=m · 3 unmodified lines
6060 # CONFIG_INET_LRO is not set
6161 CONFIG_INET_DIAG=m
6262 CONFIG_INET_UDP_DIAG=m
63+CONFIG_IPV6=m
6364 CONFIG_IPV6_ROUTER_PREF=y
6465 CONFIG_INET6_AH=m
6566 CONFIG_INET6_ESP=m
6667 CONFIG_INET6_IPCOMP=m
68+CONFIG_IPV6_ILA=m
6769 CONFIG_IPV6_VTI=m
6870 CONFIG_IPV6_GRE=m
6971 CONFIG_NETFILTER=y
@@ -172,6 +174,7 @@ CONFIG_IP_SET_HASH_NETIFACE=m · 102 unmodified lines
172174 CONFIG_IP_SET_LIST_SET=m
173175 CONFIG_NF_CONNTRACK_IPV4=m
174176 CONFIG_NFT_CHAIN_ROUTE_IPV4=m
177+CONFIG_NFT_DUP_IPV4=m
175178 CONFIG_NF_TABLES_ARP=m
176179 CONFIG_NF_LOG_ARP=m
177180 CONFIG_NFT_CHAIN_NAT_IPV4=m
@@ -199,6 +202,7 @@ CONFIG_IP_NF_ARPFILTER=m · 21 unmodified lines
199202 CONFIG_IP_NF_ARP_MANGLE=m
200203 CONFIG_NF_CONNTRACK_IPV6=m
201204 CONFIG_NFT_CHAIN_ROUTE_IPV6=m
205+CONFIG_NFT_DUP_IPV6=m
202206 CONFIG_NFT_CHAIN_NAT_IPV6=m
203207 CONFIG_NFT_MASQ_IPV6=m
204208 CONFIG_NFT_REDIR_IPV6=m
@@ -264,6 +268,7 @@ CONFIG_NETLINK_DIAG=m · 59 unmodified lines
264268 CONFIG_MPLS=y
265269 CONFIG_NET_MPLS_GSO=m
266270 CONFIG_MPLS_ROUTING=m
271+CONFIG_MPLS_IPTUNNEL=m
267272 # CONFIG_WIRELESS is not set
268273 # CONFIG_UEVENT_HELPER is not set
269274 CONFIG_DEVTMPFS=y
@@ -341,6 +346,7 @@ CONFIG_SUN3_82586=y · 71 unmodified lines
341346 # CONFIG_NET_VENDOR_SEEQ is not set
342347 # CONFIG_NET_VENDOR_STMICRO is not set
343348 # CONFIG_NET_VENDOR_SUN is not set
349+# CONFIG_NET_VENDOR_SYNOPSYS is not set
344350 # CONFIG_NET_VENDOR_VIA is not set
345351 # CONFIG_NET_VENDOR_WIZNET is not set
346352 CONFIG_PPP=m
@@ -489,6 +495,7 @@ CONFIG_TEST_USER_COPY=m · 142 unmodified lines
489495 CONFIG_TEST_BPF=m
490496 CONFIG_TEST_FIRMWARE=m
491497 CONFIG_TEST_UDELAY=m
498+CONFIG_TEST_STATIC_KEYS=m
492499 CONFIG_ENCRYPTED_KEYS=m
493500 CONFIG_CRYPTO_RSA=m
494501 CONFIG_CRYPTO_MANAGER=y
arch/m68k/configs/sun3x_defconfig+8−1
@@ -10,6 +10,7 @@ CONFIG_LOG_BUF_SHIFT=16 · 9 unmodified lines
1010 # CONFIG_PID_NS is not set
1111 # CONFIG_NET_NS is not set
1212 CONFIG_BLK_DEV_INITRD=y
13+CONFIG_USERFAULTFD=y
1314 CONFIG_SLAB=y
1415 CONFIG_MODULES=y
1516 CONFIG_MODULE_UNLOAD=y
@@ -50,7 +51,6 @@ CONFIG_NET_IPGRE_DEMUX=m · 34 unmodified lines
5051 CONFIG_NET_IPGRE=m
5152 CONFIG_NET_IPVTI=m
5253 CONFIG_NET_FOU_IP_TUNNELS=y
53−CONFIG_GENEVE_CORE=m
5454 CONFIG_INET_AH=m
5555 CONFIG_INET_ESP=m
5656 CONFIG_INET_IPCOMP=m
@@ -60,10 +60,12 @@ CONFIG_INET_XFRM_MODE_BEET=m · 3 unmodified lines
6060 # CONFIG_INET_LRO is not set
6161 CONFIG_INET_DIAG=m
6262 CONFIG_INET_UDP_DIAG=m
63+CONFIG_IPV6=m
6364 CONFIG_IPV6_ROUTER_PREF=y
6465 CONFIG_INET6_AH=m
6566 CONFIG_INET6_ESP=m
6667 CONFIG_INET6_IPCOMP=m
68+CONFIG_IPV6_ILA=m
6769 CONFIG_IPV6_VTI=m
6870 CONFIG_IPV6_GRE=m
6971 CONFIG_NETFILTER=y
@@ -172,6 +174,7 @@ CONFIG_IP_SET_HASH_NETIFACE=m · 102 unmodified lines
172174 CONFIG_IP_SET_LIST_SET=m
173175 CONFIG_NF_CONNTRACK_IPV4=m
174176 CONFIG_NFT_CHAIN_ROUTE_IPV4=m
177+CONFIG_NFT_DUP_IPV4=m
175178 CONFIG_NF_TABLES_ARP=m
176179 CONFIG_NF_LOG_ARP=m
177180 CONFIG_NFT_CHAIN_NAT_IPV4=m
@@ -199,6 +202,7 @@ CONFIG_IP_NF_ARPFILTER=m · 21 unmodified lines
199202 CONFIG_IP_NF_ARP_MANGLE=m
200203 CONFIG_NF_CONNTRACK_IPV6=m
201204 CONFIG_NFT_CHAIN_ROUTE_IPV6=m
205+CONFIG_NFT_DUP_IPV6=m
202206 CONFIG_NFT_CHAIN_NAT_IPV6=m
203207 CONFIG_NFT_MASQ_IPV6=m
204208 CONFIG_NFT_REDIR_IPV6=m
@@ -264,6 +268,7 @@ CONFIG_NETLINK_DIAG=m · 59 unmodified lines
264268 CONFIG_MPLS=y
265269 CONFIG_NET_MPLS_GSO=m
266270 CONFIG_MPLS_ROUTING=m
271+CONFIG_MPLS_IPTUNNEL=m
267272 # CONFIG_WIRELESS is not set
268273 # CONFIG_UEVENT_HELPER is not set
269274 CONFIG_DEVTMPFS=y
@@ -341,6 +346,7 @@ CONFIG_SUN3LANCE=y · 71 unmodified lines
341346 # CONFIG_NET_VENDOR_SAMSUNG is not set
342347 # CONFIG_NET_VENDOR_SEEQ is not set
343348 # CONFIG_NET_VENDOR_STMICRO is not set
349+# CONFIG_NET_VENDOR_SYNOPSYS is not set
344350 # CONFIG_NET_VENDOR_VIA is not set
345351 # CONFIG_NET_VENDOR_WIZNET is not set
346352 CONFIG_PPP=m
@@ -489,6 +495,7 @@ CONFIG_TEST_USER_COPY=m · 142 unmodified lines
489495 CONFIG_TEST_BPF=m
490496 CONFIG_TEST_FIRMWARE=m
491497 CONFIG_TEST_UDELAY=m
498+CONFIG_TEST_STATIC_KEYS=m
492499 CONFIG_EARLY_PRINTK=y
493500 CONFIG_ENCRYPTED_KEYS=m
494501 CONFIG_CRYPTO_RSA=m
arch/m68k/include/asm/linkage.h+30−0
@@ -4,4 +4,34 @@ · 3 unmodified lines
44 #define __ALIGN .align 4
55 #define __ALIGN_STR ".align 4"
66
7+/*
8+ * Make sure the compiler doesn't do anything stupid with the
9+ * arguments on the stack - they are owned by the *caller*, not
10+ * the callee. This just fools gcc into not spilling into them,
11+ * and keeps it from doing tailcall recursion and/or using the
12+ * stack slots for temporaries, since they are live and "used"
13+ * all the way to the end of the function.
14+ */
15+#define asmlinkage_protect(n, ret, args...) \
16+ __asmlinkage_protect##n(ret, ##args)
17+#define __asmlinkage_protect_n(ret, args...) \
18+ __asm__ __volatile__ ("" : "=r" (ret) : "0" (ret), ##args)
19+#define __asmlinkage_protect0(ret) \
20+ __asmlinkage_protect_n(ret)
21+#define __asmlinkage_protect1(ret, arg1) \
22+ __asmlinkage_protect_n(ret, "m" (arg1))
23+#define __asmlinkage_protect2(ret, arg1, arg2) \
24+ __asmlinkage_protect_n(ret, "m" (arg1), "m" (arg2))
25+#define __asmlinkage_protect3(ret, arg1, arg2, arg3) \
26+ __asmlinkage_protect_n(ret, "m" (arg1), "m" (arg2), "m" (arg3))
27+#define __asmlinkage_protect4(ret, arg1, arg2, arg3, arg4) \
28+ __asmlinkage_protect_n(ret, "m" (arg1), "m" (arg2), "m" (arg3), \
29+ "m" (arg4))
30+#define __asmlinkage_protect5(ret, arg1, arg2, arg3, arg4, arg5) \
31+ __asmlinkage_protect_n(ret, "m" (arg1), "m" (arg2), "m" (arg3), \
32+ "m" (arg4), "m" (arg5))
33+#define __asmlinkage_protect6(ret, arg1, arg2, arg3, arg4, arg5, arg6) \
34+ __asmlinkage_protect_n(ret, "m" (arg1), "m" (arg2), "m" (arg3), \
35+ "m" (arg4), "m" (arg5), "m" (arg6))
36+
737 #endif
arch/m68k/include/asm/unistd.h+1−1
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 #include <uapi/asm/unistd.h>
55
66
7−#define NR_syscalls 356
7+#define NR_syscalls 375
88
99 #define __ARCH_WANT_OLD_READDIR
1010 #define __ARCH_WANT_OLD_STAT
arch/m68k/include/uapi/asm/unistd.h+19−0
@@ -361,5 +361,24 @@ · 360 unmodified lines
361361 #define __NR_memfd_create 353
362362 #define __NR_bpf 354
363363 #define __NR_execveat 355
364+#define __NR_socket 356
365+#define __NR_socketpair 357
366+#define __NR_bind 358
367+#define __NR_connect 359
368+#define __NR_listen 360
369+#define __NR_accept4 361
370+#define __NR_getsockopt 362
371+#define __NR_setsockopt 363
372+#define __NR_getsockname 364
373+#define __NR_getpeername 365
374+#define __NR_sendto 366
375+#define __NR_sendmsg 367
376+#define __NR_recvfrom 368
377+#define __NR_recvmsg 369
378+#define __NR_shutdown 370
379+#define __NR_recvmmsg 371
380+#define __NR_sendmmsg 372
381+#define __NR_userfaultfd 373
382+#define __NR_membarrier 374
364383
365384 #endif /* _UAPI_ASM_M68K_UNISTD_H_ */
arch/m68k/kernel/syscalltable.S+19−1
@@ -376,4 +376,22 @@ ENTRY(sys_call_table) · 375 unmodified lines
376376 .long sys_memfd_create
377377 .long sys_bpf
378378 .long sys_execveat /* 355 */
379−
379+ .long sys_socket
380+ .long sys_socketpair
381+ .long sys_bind
382+ .long sys_connect
383+ .long sys_listen /* 360 */
384+ .long sys_accept4
385+ .long sys_getsockopt
386+ .long sys_setsockopt
387+ .long sys_getsockname
388+ .long sys_getpeername /* 365 */
389+ .long sys_sendto
390+ .long sys_sendmsg
391+ .long sys_recvfrom
392+ .long sys_recvmsg
393+ .long sys_shutdown /* 370 */
394+ .long sys_recvmmsg
395+ .long sys_sendmmsg
396+ .long sys_userfaultfd
397+ .long sys_membarrier
arch/metag/include/asm/Kbuild+1−0
@@ -54,4 +54,5 @@ generic-y += ucontext.h · 53 unmodified lines
5454 generic-y += unaligned.h
5555 generic-y += user.h
5656 generic-y += vga.h
57+generic-y += word-at-a-time.h
5758 generic-y += xor.h
arch/microblaze/include/asm/Kbuild+1−0
@@ -10,3 +10,4 @@ generic-y += mm-arch-hooks.h · 9 unmodified lines
1010 generic-y += preempt.h
1111 generic-y += syscalls.h
1212 generic-y += trace_clock.h
13+generic-y += word-at-a-time.h
arch/microblaze/pci/pci-common.c+8−1
@@ -863,7 +863,14 @@ void pcibios_setup_bus_devices(struct pci_bus *bus) · 862 unmodified lines
863863
864864 void pcibios_fixup_bus(struct pci_bus *bus)
865865 {
866− /* Fixup the bus */
866+ /* When called from the generic PCI probe, read PCI<->PCI bridge
867+ * bases. This is -not- called when generating the PCI tree from
868+ * the OF device-tree.
869+ */
870+ if (bus->self != NULL)
871+ pci_read_bridge_bases(bus);
872+
873+ /* Now fixup the bus bus */
867874 pcibios_setup_bus_self(bus);
868875
869876 /* Now fixup devices on that bus */
arch/mips/ath79/irq.c+20−2
@@ -293,8 +293,26 @@ static int __init ath79_misc_intc_of_init( · 292 unmodified lines
293293
294294 return 0;
295295 }
296−IRQCHIP_DECLARE(ath79_misc_intc, "qca,ar7100-misc-intc",
297− ath79_misc_intc_of_init);
296+
297+static int __init ar7100_misc_intc_of_init(
298+ struct device_node *node, struct device_node *parent)
299+{
300+ ath79_misc_irq_chip.irq_mask_ack = ar71xx_misc_irq_mask;
301+ return ath79_misc_intc_of_init(node, parent);
302+}
303+
304+IRQCHIP_DECLARE(ar7100_misc_intc, "qca,ar7100-misc-intc",
305+ ar7100_misc_intc_of_init);
306+
307+static int __init ar7240_misc_intc_of_init(
308+ struct device_node *node, struct device_node *parent)
309+{
310+ ath79_misc_irq_chip.irq_ack = ar724x_misc_irq_ack;
311+ return ath79_misc_intc_of_init(node, parent);
312+}
313+
314+IRQCHIP_DECLARE(ar7240_misc_intc, "qca,ar7240-misc-intc",
315+ ar7240_misc_intc_of_init);
298316
299317 static int __init ar79_cpu_intc_of_init(
300318 struct device_node *node, struct device_node *parent)
arch/mips/cavium-octeon/setup.c+1−1
@@ -933,7 +933,7 @@ void __init plat_mem_setup(void) · 932 unmodified lines
933933 while ((boot_mem_map.nr_map < BOOT_MEM_MAP_MAX)
934934 && (total < MAX_MEMORY)) {
935935 memory = cvmx_bootmem_phy_alloc(mem_alloc_size,
936− __pa_symbol(&__init_end), -1,
936+ __pa_symbol(&_end), -1,
937937 0x100000,
938938 CVMX_BOOTMEM_FLAG_NO_LOCKING);
939939 if (memory >= 0) {
arch/mips/include/asm/Kbuild+1−0
@@ -17,4 +17,5 @@ generic-y += segment.h · 16 unmodified lines
1717 generic-y += serial.h
1818 generic-y += trace_clock.h
1919 generic-y += user.h
20+generic-y += word-at-a-time.h
2021 generic-y += xor.h
arch/mips/include/asm/cpu-features.h+3−0
@@ -20,6 +20,9 @@ · 19 unmodified lines
2020 #ifndef cpu_has_tlb
2121 #define cpu_has_tlb (cpu_data[0].options & MIPS_CPU_TLB)
2222 #endif
23+#ifndef cpu_has_ftlb
24+#define cpu_has_ftlb (cpu_data[0].options & MIPS_CPU_FTLB)
25+#endif
2326 #ifndef cpu_has_tlbinv
2427 #define cpu_has_tlbinv (cpu_data[0].options & MIPS_CPU_TLBINV)
2528 #endif
arch/mips/include/asm/cpu.h+1−0
@@ -385,6 +385,7 @@ enum cpu_type_enum { · 384 unmodified lines
385385 #define MIPS_CPU_CDMM 0x4000000000ull /* CPU has Common Device Memory Map */
386386 #define MIPS_CPU_BP_GHIST 0x8000000000ull /* R12K+ Branch Prediction Global History */
387387 #define MIPS_CPU_SP 0x10000000000ull /* Small (1KB) page support */
388+#define MIPS_CPU_FTLB 0x20000000000ull /* CPU has Fixed-page-size TLB */
388389
389390 /*
390391 * CPU ASE encodings
arch/mips/include/asm/kvm_host.h+1−0
@@ -61,6 +61,7 @@ · 60 unmodified lines
6161 #define KVM_PRIVATE_MEM_SLOTS 0
6262
6363 #define KVM_COALESCED_MMIO_PAGE_OFFSET 1
64+#define KVM_HALT_POLL_NS_DEFAULT 500000
6465
6566
6667
arch/mips/include/asm/maar.h+9−0
@@ -65,6 +65,15 @@ static inline void write_maar_pair(unsigned idx, phys_addr_t lower, · 64 unmodified lines
6565 back_to_back_c0_hazard();
6666 }
6767
68+/**
69+ * maar_init() - initialise MAARs
70+ *
71+ * Performs initialisation of MAARs for the current CPU, making use of the
72+ * platforms implementation of platform_maar_init where necessary and
73+ * duplicating the setup it provides on secondary CPUs.
74+ */
75+extern void maar_init(void);
76+
6877 /**
6978 * struct maar_config - MAAR configuration data
7079 * @lower: The lowest address that the MAAR pair will affect. Must be
arch/mips/include/asm/mips-cm.h+39−0
@@ -194,6 +194,7 @@ BUILD_CM_RW(reg3_mask, MIPS_CM_GCB_OFS + 0xc8) · 193 unmodified lines
194194 BUILD_CM_R_(gic_status, MIPS_CM_GCB_OFS + 0xd0)
195195 BUILD_CM_R_(cpc_status, MIPS_CM_GCB_OFS + 0xf0)
196196 BUILD_CM_RW(l2_config, MIPS_CM_GCB_OFS + 0x130)
197+BUILD_CM_RW(sys_config2, MIPS_CM_GCB_OFS + 0x150)
197198
198199 /* Core Local & Core Other register accessor functions */
199200 BUILD_CM_Cx_RW(reset_release, 0x00)
@@ -316,6 +317,10 @@ BUILD_CM_Cx_R_(tcid_8_priority, 0x80) · 116 unmodified lines
316317 #define CM_GCR_L2_CONFIG_ASSOC_SHF 0
317318 #define CM_GCR_L2_CONFIG_ASSOC_MSK (_ULCAST_(0xff) << 0)
318319
320+/* GCR_SYS_CONFIG2 register fields */
321+#define CM_GCR_SYS_CONFIG2_MAXVPW_SHF 0
322+#define CM_GCR_SYS_CONFIG2_MAXVPW_MSK (_ULCAST_(0xf) << 0)
323+
319324 /* GCR_Cx_COHERENCE register fields */
320325 #define CM_GCR_Cx_COHERENCE_COHDOMAINEN_SHF 0
321326 #define CM_GCR_Cx_COHERENCE_COHDOMAINEN_MSK (_ULCAST_(0xff) << 0)
@@ -405,4 +410,38 @@ static inline int mips_cm_revision(void) · 83 unmodified lines
405410 return read_gcr_rev();
406411 }
407412
413+/**
414+ * mips_cm_max_vp_width() - return the width in bits of VP indices
415+ *
416+ * Return: the width, in bits, of VP indices in fields that combine core & VP
417+ * indices.
418+ */
419+static inline unsigned int mips_cm_max_vp_width(void)
420+{
421+ extern int smp_num_siblings;
422+
423+ if (mips_cm_revision() >= CM_REV_CM3)
424+ return read_gcr_sys_config2() & CM_GCR_SYS_CONFIG2_MAXVPW_MSK;
425+
426+ return smp_num_siblings;
427+}
428+
429+/**
430+ * mips_cm_vp_id() - calculate the hardware VP ID for a CPU
431+ * @cpu: the CPU whose VP ID to calculate
432+ *
433+ * Hardware such as the GIC uses identifiers for VPs which may not match the
434+ * CPU numbers used by Linux. This function calculates the hardware VP
435+ * identifier corresponding to a given CPU.
436+ *
437+ * Return: the VP ID for the CPU.
438+ */
439+static inline unsigned int mips_cm_vp_id(unsigned int cpu)
440+{
441+ unsigned int core = cpu_data[cpu].core;
442+ unsigned int vp = cpu_vpe_id(&cpu_data[cpu]);
443+
444+ return (core * mips_cm_max_vp_width()) + vp;
445+}
446+
408447 #endif /* __MIPS_ASM_MIPS_CM_H__ */
arch/mips/include/asm/mipsregs.h+2−0
@@ -487,6 +487,8 @@ · 486 unmodified lines
487487
488488 /* Bits specific to the MIPS32/64 PRA. */
489489 #define MIPS_CONF_MT (_ULCAST_(7) << 7)
490+#define MIPS_CONF_MT_TLB (_ULCAST_(1) << 7)
491+#define MIPS_CONF_MT_FTLB (_ULCAST_(4) << 7)
490492 #define MIPS_CONF_AR (_ULCAST_(7) << 10)
491493 #define MIPS_CONF_AT (_ULCAST_(3) << 13)
492494 #define MIPS_CONF_M (_ULCAST_(1) << 31)
arch/mips/include/uapi/asm/unistd.h+12−6
@@ -377,16 +377,18 @@ · 376 unmodified lines
377377 #define __NR_memfd_create (__NR_Linux + 354)
378378 #define __NR_bpf (__NR_Linux + 355)
379379 #define __NR_execveat (__NR_Linux + 356)
380+#define __NR_userfaultfd (__NR_Linux + 357)
381+#define __NR_membarrier (__NR_Linux + 358)
380382
381383 /*
382384 * Offset of the last Linux o32 flavoured syscall
383385 */
384−#define __NR_Linux_syscalls 356
386+#define __NR_Linux_syscalls 358
385387
386388 #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
387389
388390 #define __NR_O32_Linux 4000
389−#define __NR_O32_Linux_syscalls 356
391+#define __NR_O32_Linux_syscalls 358
390392
391393 #if _MIPS_SIM == _MIPS_SIM_ABI64
392394
@@ -711,16 +713,18 @@ · 318 unmodified lines
711713 #define __NR_memfd_create (__NR_Linux + 314)
712714 #define __NR_bpf (__NR_Linux + 315)
713715 #define __NR_execveat (__NR_Linux + 316)
716+#define __NR_userfaultfd (__NR_Linux + 317)
717+#define __NR_membarrier (__NR_Linux + 318)
714718
715719 /*
716720 * Offset of the last Linux 64-bit flavoured syscall
717721 */
718−#define __NR_Linux_syscalls 316
722+#define __NR_Linux_syscalls 318
719723
720724 #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
721725
722726 #define __NR_64_Linux 5000
723−#define __NR_64_Linux_syscalls 316
727+#define __NR_64_Linux_syscalls 318
724728
725729 #if _MIPS_SIM == _MIPS_SIM_NABI32
726730
@@ -1049,15 +1053,17 @@ · 322 unmodified lines
10491053 #define __NR_memfd_create (__NR_Linux + 318)
10501054 #define __NR_bpf (__NR_Linux + 319)
10511055 #define __NR_execveat (__NR_Linux + 320)
1056+#define __NR_userfaultfd (__NR_Linux + 321)
1057+#define __NR_membarrier (__NR_Linux + 322)
10521058
10531059 /*
10541060 * Offset of the last N32 flavoured syscall
10551061 */
1056−#define __NR_Linux_syscalls 320
1062+#define __NR_Linux_syscalls 322
10571063
10581064 #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */
10591065
10601066 #define __NR_N32_Linux 6000
1061−#define __NR_N32_Linux_syscalls 320
1067+#define __NR_N32_Linux_syscalls 322
10621068
10631069 #endif /* _UAPI_ASM_UNISTD_H */
arch/mips/jz4740/board-qi_lb60.c+1−0
@@ -26,6 +26,7 @@ · 25 unmodified lines
2626 #include <linux/power/jz4740-battery.h>
2727 #include <linux/power/gpio-charger.h>
2828
29+#include <asm/mach-jz4740/gpio.h>
2930 #include <asm/mach-jz4740/jz4740_fb.h>
3031 #include <asm/mach-jz4740/jz4740_mmc.h>
3132 #include <asm/mach-jz4740/jz4740_nand.h>
arch/mips/jz4740/gpio.c+1−0
@@ -28,6 +28,7 @@ · 27 unmodified lines
2828 #include <linux/seq_file.h>
2929
3030 #include <asm/mach-jz4740/base.h>
31+#include <asm/mach-jz4740/gpio.h>
3132
3233 #define JZ4740_GPIO_BASE_A (32*0)
3334 #define JZ4740_GPIO_BASE_B (32*1)
arch/mips/kernel/cps-vec.S+7−5
@@ -39,6 +39,7 @@ · 38 unmodified lines
3939 mfc0 \dest, CP0_CONFIG, 3
4040 andi \dest, \dest, MIPS_CONF3_MT
4141 beqz \dest, \nomt
42+ nop
4243 .endm
4344
4445 .section .text.cps-vec
@@ -223,10 +224,9 @@ LEAF(excep_ejtag) · 178 unmodified lines
223224 END(excep_ejtag)
224225
225226 LEAF(mips_cps_core_init)
226−#ifdef CONFIG_MIPS_MT
227+#ifdef CONFIG_MIPS_MT_SMP
227228 /* Check that the core implements the MT ASE */
228229 has_mt t0, 3f
229− nop
230230
231231 .set push
232232 .set mips64r2
@@ -310,8 +310,9 @@ LEAF(mips_cps_boot_vpes) · 77 unmodified lines
310310 PTR_ADDU t0, t0, t1
311311
312312 /* Calculate this VPEs ID. If the core doesn't support MT use 0 */
313+ li t9, 0
314+#ifdef CONFIG_MIPS_MT_SMP
313315 has_mt ta2, 1f
314− li t9, 0
315316
316317 /* Find the number of VPEs present in the core */
317318 mfc0 t1, CP0_MVPCONF0
@@ -330,6 +331,7 @@ LEAF(mips_cps_boot_vpes) · 12 unmodified lines
330331 /* Retrieve the VPE ID from EBase.CPUNum */
331332 mfc0 t9, $15, 1
332333 and t9, t9, t1
334+#endif
333335
334336 1: /* Calculate a pointer to this VPEs struct vpe_boot_config */
335337 li t1, VPEBOOTCFG_SIZE
@@ -337,7 +339,7 @@ LEAF(mips_cps_boot_vpes) · 1 unmodified line
337339 PTR_L ta3, COREBOOTCFG_VPECONFIG(t0)
338340 PTR_ADDU v0, v0, ta3
339341
340−#ifdef CONFIG_MIPS_MT
342+#ifdef CONFIG_MIPS_MT_SMP
341343
342344 /* If the core doesn't support MT then return */
343345 bnez ta2, 1f
@@ -451,7 +453,7 @@ LEAF(mips_cps_boot_vpes) · 107 unmodified lines
451453
452454 2: .set pop
453455
454−#endif /* CONFIG_MIPS_MT */
456+#endif /* CONFIG_MIPS_MT_SMP */
455457
456458 /* Return */
457459 jr ra
arch/mips/kernel/cpu-probe.c+13−8
@@ -410,16 +410,18 @@ static int set_ftlb_enable(struct cpuinfo_mips *c, int enable) · 409 unmodified lines
410410 static inline unsigned int decode_config0(struct cpuinfo_mips *c)
411411 {
412412 unsigned int config0;
413− int isa;
413+ int isa, mt;
414414
415415 config0 = read_c0_config();
416416
417417 /*
418418 * Look for Standard TLB or Dual VTLB and FTLB
419419 */
420− if ((((config0 & MIPS_CONF_MT) >> 7) == 1) ||
421− (((config0 & MIPS_CONF_MT) >> 7) == 4))
420+ mt = config0 & MIPS_CONF_MT;
421+ if (mt == MIPS_CONF_MT_TLB)
422422 c->options |= MIPS_CPU_TLB;
423+ else if (mt == MIPS_CONF_MT_FTLB)
424+ c->options |= MIPS_CPU_TLB | MIPS_CPU_FTLB;
423425
424426 isa = (config0 & MIPS_CONF_AT) >> 13;
425427 switch (isa) {
@@ -559,15 +561,18 @@ static inline unsigned int decode_config4(struct cpuinfo_mips *c) · 133 unmodified lines
559561 if (cpu_has_tlb) {
560562 if (((config4 & MIPS_CONF4_IE) >> 29) == 2)
561563 c->options |= MIPS_CPU_TLBINV;
564+
562565 /*
563− * This is a bit ugly. R6 has dropped that field from
564− * config4 and the only valid configuration is VTLB+FTLB so
565− * set a good value for mmuextdef for that case.
566+ * R6 has dropped the MMUExtDef field from config4.
567+ * On R6 the fields always describe the FTLB, and only if it is
568+ * present according to Config.MT.
566569 */
567− if (cpu_has_mips_r6)
570+ if (!cpu_has_mips_r6)
571+ mmuextdef = config4 & MIPS_CONF4_MMUEXTDEF;
572+ else if (cpu_has_ftlb)
568573 mmuextdef = MIPS_CONF4_MMUEXTDEF_VTLBSIZEEXT;
569574 else
570− mmuextdef = config4 & MIPS_CONF4_MMUEXTDEF;
575+ mmuextdef = 0;
571576
572577 switch (mmuextdef) {
573578 case MIPS_CONF4_MMUEXTDEF_MMUSIZEEXT:
arch/mips/kernel/octeon_switch.S+1−25
@@ -18,7 +18,7 @@ · 17 unmodified lines
1818 .set pop
1919 /*
2020 * task_struct *resume(task_struct *prev, task_struct *next,
21− * struct thread_info *next_ti, int usedfpu)
21+ * struct thread_info *next_ti)
2222 */
2323 .align 7
2424 LEAF(resume)
@@ -28,30 +28,6 @@ · 3 unmodified lines
2828 cpu_save_nonscratch a0
2929 LONG_S ra, THREAD_REG31(a0)
3030
31− /*
32− * check if we need to save FPU registers
33− */
34− .set push
35− .set noreorder
36− beqz a3, 1f
37− PTR_L t3, TASK_THREAD_INFO(a0)
38− .set pop
39−
40− /*
41− * clear saved user stack CU1 bit
42− */
43− LONG_L t0, ST_OFF(t3)
44− li t1, ~ST0_CU1
45− and t0, t0, t1
46− LONG_S t0, ST_OFF(t3)
47−
48− .set push
49− .set arch=mips64r2
50− fpu_save_double a0 t0 t1 # c0_status passed in t0
51− # clobbers t1
52− .set pop
53−1:
54−
5531 #if CONFIG_CAVIUM_OCTEON_CVMSEG_SIZE > 0
5632 /* Check if we need to store CVMSEG state */
5733 dmfc0 t0, $11,7 /* CvmMemCtl */
arch/mips/kernel/r2300_switch.S+1−27
@@ -30,19 +30,9 @@ · 29 unmodified lines
3030 */
3131 #define ST_OFF (_THREAD_SIZE - 32 - PT_SIZE + PT_STATUS)
3232
33−/*
34− * FPU context is saved iff the process has used it's FPU in the current
35− * time slice as indicated by TIF_USEDFPU. In any case, the CU1 bit for user
36− * space STATUS register should be 0, so that a process *always* starts its
37− * userland with FPU disabled after each context switch.
38− *
39− * FPU will be enabled as soon as the process accesses FPU again, through
40− * do_cpu() trap.
41− */
42−
4333 /*
4434 * task_struct *resume(task_struct *prev, task_struct *next,
45− * struct thread_info *next_ti, int usedfpu)
35+ * struct thread_info *next_ti)
4636 */
4737 LEAF(resume)
4838 mfc0 t1, CP0_STATUS
@@ -50,22 +40,6 @@ LEAF(resume) · 1 unmodified line
5040 cpu_save_nonscratch a0
5141 sw ra, THREAD_REG31(a0)
5242
53− beqz a3, 1f
54−
55− PTR_L t3, TASK_THREAD_INFO(a0)
56−
57− /*
58− * clear saved user stack CU1 bit
59− */
60− lw t0, ST_OFF(t3)
61− li t1, ~ST0_CU1
62− and t0, t0, t1
63− sw t0, ST_OFF(t3)
64−
65− fpu_save_single a0, t0 # clobbers t0
66−
67−1:
68−
6943 #if defined(CONFIG_CC_STACKPROTECTOR) && !defined(CONFIG_SMP)
7044 PTR_LA t8, __stack_chk_guard
7145 LONG_L t9, TASK_STACK_CANARY(a1)
arch/mips/kernel/scall32-o32.S+18−23
@@ -36,16 +36,8 @@ NESTED(handle_sys, PT_SIZE, sp) · 35 unmodified lines
3636 lw t1, PT_EPC(sp) # skip syscall on return
3737
3838 subu v0, v0, __NR_O32_Linux # check syscall number
39− sltiu t0, v0, __NR_O32_Linux_syscalls + 1
4039 addiu t1, 4 # skip to next instruction
4140 sw t1, PT_EPC(sp)
42− beqz t0, illegal_syscall
43−
44− sll t0, v0, 2
45− la t1, sys_call_table
46− addu t1, t0
47− lw t2, (t1) # syscall routine
48− beqz t2, illegal_syscall
4941
5042 sw a3, PT_R26(sp) # save a3 for syscall restarting
5143
@@ -96,6 +88,16 @@ loads_done: · 44 unmodified lines
9688 li t1, _TIF_WORK_SYSCALL_ENTRY
9789 and t0, t1
9890 bnez t0, syscall_trace_entry # -> yes
91+syscall_common:
92+ sltiu t0, v0, __NR_O32_Linux_syscalls + 1
93+ beqz t0, illegal_syscall
94+
95+ sll t0, v0, 2
96+ la t1, sys_call_table
97+ addu t1, t0
98+ lw t2, (t1) # syscall routine
99+
100+ beqz t2, illegal_syscall
99101
100102 jalr t2 # Do The Real Thing (TM)
101103
@@ -116,7 +118,7 @@ o32_syscall_exit: · 14 unmodified lines
116118
117119 syscall_trace_entry:
118120 SAVE_STATIC
119− move s0, t2
121+ move s0, v0
120122 move a0, sp
121123
122124 /*
@@ -129,27 +131,18 @@ syscall_trace_entry: · 6 unmodified lines
129131
130132 1: jal syscall_trace_enter
131133
132− bltz v0, 2f # seccomp failed? Skip syscall
134+ bltz v0, 1f # seccomp failed? Skip syscall
135+
136+ move v0, s0 # restore syscall
133137
134− move t0, s0
135138 RESTORE_STATIC
136139 lw a0, PT_R4(sp) # Restore argument registers
137140 lw a1, PT_R5(sp)
138141 lw a2, PT_R6(sp)
139142 lw a3, PT_R7(sp)
140− jalr t0
141−
142− li t0, -EMAXERRNO - 1 # error?
143− sltu t0, t0, v0
144− sw t0, PT_R7(sp) # set error flag
145− beqz t0, 1f
146−
147− lw t1, PT_R2(sp) # syscall number
148− negu v0 # error
149− sw t1, PT_R0(sp) # save it for syscall restarting
150−1: sw v0, PT_R2(sp) # result
143+ j syscall_common
151144
152−2: j syscall_exit
145+1: j syscall_exit
153146
154147 /* ------------------------------------------------------------------------ */
155148
@@ -599,3 +592,5 @@ EXPORT(sys_call_table) · 443 unmodified lines
599592 PTR sys_memfd_create
600593 PTR sys_bpf /* 4355 */
601594 PTR sys_execveat
595+ PTR sys_userfaultfd
596+ PTR sys_membarrier
arch/mips/kernel/scall64-64.S+18−22
@@ -39,18 +39,11 @@ NESTED(handle_sys64, PT_SIZE, sp) · 38 unmodified lines
3939 .set at
4040 #endif
4141
42− dsubu t0, v0, __NR_64_Linux # check syscall number
43− sltiu t0, t0, __NR_64_Linux_syscalls + 1
4442 #if !defined(CONFIG_MIPS32_O32) && !defined(CONFIG_MIPS32_N32)
4543 ld t1, PT_EPC(sp) # skip syscall on return
4644 daddiu t1, 4 # skip to next instruction
4745 sd t1, PT_EPC(sp)
4846 #endif
49− beqz t0, illegal_syscall
50−
51− dsll t0, v0, 3 # offset into table
52− ld t2, (sys_call_table - (__NR_64_Linux * 8))(t0)
53− # syscall routine
5447
5548 sd a3, PT_R26(sp) # save a3 for syscall restarting
5649
@@ -59,6 +52,17 @@ NESTED(handle_sys64, PT_SIZE, sp) · 2 unmodified lines
5952 and t0, t1, t0
6053 bnez t0, syscall_trace_entry
6154
55+syscall_common:
56+ dsubu t2, v0, __NR_64_Linux
57+ sltiu t0, t2, __NR_64_Linux_syscalls + 1
58+ beqz t0, illegal_syscall
59+
60+ dsll t0, t2, 3 # offset into table
61+ dla t2, sys_call_table
62+ daddu t0, t2, t0
63+ ld t2, (t0) # syscall routine
64+ beqz t2, illegal_syscall
65+
6266 jalr t2 # Do The Real Thing (TM)
6367
6468 li t0, -EMAXERRNO - 1 # error?
@@ -78,14 +82,14 @@ n64_syscall_exit: · 13 unmodified lines
7882
7983 syscall_trace_entry:
8084 SAVE_STATIC
81− move s0, t2
85+ move s0, v0
8286 move a0, sp
8387 move a1, v0
8488 jal syscall_trace_enter
8589
86− bltz v0, 2f # seccomp failed? Skip syscall
90+ bltz v0, 1f # seccomp failed? Skip syscall
8791
88− move t0, s0
92+ move v0, s0
8993 RESTORE_STATIC
9094 ld a0, PT_R4(sp) # Restore argument registers
9195 ld a1, PT_R5(sp)
@@ -93,19 +97,9 @@ syscall_trace_entry: · 1 unmodified line
9397 ld a3, PT_R7(sp)
9498 ld a4, PT_R8(sp)
9599 ld a5, PT_R9(sp)
96− jalr t0
97−
98− li t0, -EMAXERRNO - 1 # error?
99− sltu t0, t0, v0
100− sd t0, PT_R7(sp) # set error flag
101− beqz t0, 1f
102−
103− ld t1, PT_R2(sp) # syscall number
104− dnegu v0 # error
105− sd t1, PT_R0(sp) # save it for syscall restarting
106−1: sd v0, PT_R2(sp) # result
100+ j syscall_common
107101
108−2: j syscall_exit
102+1: j syscall_exit
109103
110104 illegal_syscall:
111105 /* This also isn't a 64-bit syscall, throw an error. */
@@ -436,4 +430,6 @@ EXPORT(sys_call_table) · 324 unmodified lines
436430 PTR sys_memfd_create
437431 PTR sys_bpf /* 5315 */
438432 PTR sys_execveat
433+ PTR sys_userfaultfd
434+ PTR sys_membarrier
439435 .size sys_call_table,.-sys_call_table
arch/mips/kernel/scall64-n32.S+7−14
@@ -52,6 +52,7 @@ NESTED(handle_sysn32, PT_SIZE, sp) · 51 unmodified lines
5252 and t0, t1, t0
5353 bnez t0, n32_syscall_trace_entry
5454
55+syscall_common:
5556 jalr t2 # Do The Real Thing (TM)
5657
5758 li t0, -EMAXERRNO - 1 # error?
@@ -75,9 +76,9 @@ n32_syscall_trace_entry: · 17 unmodified lines
7576 move a1, v0
7677 jal syscall_trace_enter
7778
78− bltz v0, 2f # seccomp failed? Skip syscall
79+ bltz v0, 1f # seccomp failed? Skip syscall
7980
80− move t0, s0
81+ move t2, s0
8182 RESTORE_STATIC
8283 ld a0, PT_R4(sp) # Restore argument registers
8384 ld a1, PT_R5(sp)
@@ -85,19 +86,9 @@ n32_syscall_trace_entry: · 1 unmodified line
8586 ld a3, PT_R7(sp)
8687 ld a4, PT_R8(sp)
8788 ld a5, PT_R9(sp)
88− jalr t0
89+ j syscall_common
8990
90− li t0, -EMAXERRNO - 1 # error?
91− sltu t0, t0, v0
92− sd t0, PT_R7(sp) # set error flag
93− beqz t0, 1f
94−
95− ld t1, PT_R2(sp) # syscall number
96− dnegu v0 # error
97− sd t1, PT_R0(sp) # save it for syscall restarting
98−1: sd v0, PT_R2(sp) # result
99−
100−2: j syscall_exit
91+1: j syscall_exit
10192
10293 not_n32_scall:
10394 /* This is not an n32 compatibility syscall, pass it on to
@@ -429,4 +420,6 @@ EXPORT(sysn32_call_table) · 325 unmodified lines
429420 PTR sys_memfd_create
430421 PTR sys_bpf
431422 PTR compat_sys_execveat /* 6320 */
423+ PTR sys_userfaultfd
424+ PTR sys_membarrier
432425 .size sysn32_call_table,.-sysn32_call_table
arch/mips/kernel/scall64-o32.S+7−14
@@ -87,6 +87,7 @@ loads_done: · 86 unmodified lines
8787 and t0, t1, t0
8888 bnez t0, trace_a_syscall
8989
90+syscall_common:
9091 jalr t2 # Do The Real Thing (TM)
9192
9293 li t0, -EMAXERRNO - 1 # error?
@@ -130,9 +131,9 @@ trace_a_syscall: · 37 unmodified lines
130131
131132 1: jal syscall_trace_enter
132133
133− bltz v0, 2f # seccomp failed? Skip syscall
134+ bltz v0, 1f # seccomp failed? Skip syscall
134135
135− move t0, s0
136+ move t2, s0
136137 RESTORE_STATIC
137138 ld a0, PT_R4(sp) # Restore argument registers
138139 ld a1, PT_R5(sp)
@@ -142,19 +143,9 @@ trace_a_syscall: · 3 unmodified lines
142143 ld a5, PT_R9(sp)
143144 ld a6, PT_R10(sp)
144145 ld a7, PT_R11(sp) # For indirect syscalls
145− jalr t0
146+ j syscall_common
146147
147− li t0, -EMAXERRNO - 1 # error?
148− sltu t0, t0, v0
149− sd t0, PT_R7(sp) # set error flag
150− beqz t0, 1f
151−
152− ld t1, PT_R2(sp) # syscall number
153− dnegu v0 # error
154− sd t1, PT_R0(sp) # save it for syscall restarting
155−1: sd v0, PT_R2(sp) # result
156−
157−2: j syscall_exit
148+1: j syscall_exit
158149
159150 /* ------------------------------------------------------------------------ */
160151
@@ -584,4 +575,6 @@ EXPORT(sys32_call_table) · 423 unmodified lines
584575 PTR sys_memfd_create
585576 PTR sys_bpf /* 4355 */
586577 PTR compat_sys_execveat
578+ PTR sys_userfaultfd
579+ PTR sys_membarrier
587580 .size sys32_call_table,.-sys32_call_table
arch/mips/kernel/setup.c+9−1
@@ -338,7 +338,7 @@ static void __init bootmem_init(void) · 337 unmodified lines
338338 if (end <= reserved_end)
339339 continue;
340340 #ifdef CONFIG_BLK_DEV_INITRD
341− /* mapstart should be after initrd_end */
341+ /* Skip zones before initrd and initrd itself */
342342 if (initrd_end && end <= (unsigned long)PFN_UP(__pa(initrd_end)))
343343 continue;
344344 #endif
@@ -371,6 +371,14 @@ static void __init bootmem_init(void) · 26 unmodified lines
371371 max_low_pfn = PFN_DOWN(HIGHMEM_START);
372372 }
373373
374+#ifdef CONFIG_BLK_DEV_INITRD
375+ /*
376+ * mapstart should be after initrd_end
377+ */
378+ if (initrd_end)
379+ mapstart = max(mapstart, (unsigned long)PFN_UP(__pa(initrd_end)));
380+#endif
381+
374382 /*
375383 * Initialize the boot-time allocator with low memory only.
376384 */
arch/mips/kernel/smp.c+2−0
@@ -42,6 +42,7 @@ · 41 unmodified lines
4242 #include <asm/mmu_context.h>
4343 #include <asm/time.h>
4444 #include <asm/setup.h>
45+#include <asm/maar.h>
4546
4647 cpumask_t cpu_callin_map; /* Bitmask of started secondaries */
4748
@@ -157,6 +158,7 @@ asmlinkage void start_secondary(void) · 109 unmodified lines
157158 mips_clockevent_init();
158159 mp_ops->init_secondary();
159160 cpu_report();
161+ maar_init();
160162
161163 /*
162164 * XXX parity protection should be folded in here when it's converted
arch/mips/loongson64/common/env.c+3−0
@@ -64,6 +64,9 @@ void __init prom_init_env(void) · 63 unmodified lines
6464 }
6565 if (memsize == 0)
6666 memsize = 256;
67+
68+ loongson_sysconf.nr_uarts = 1;
69+
6770 pr_info("memsize=%u, highmemsize=%u\n", memsize, highmemsize);
6871 #else
6972 struct boot_params *boot_p;
arch/mips/mm/dma-default.c+1−1
@@ -100,7 +100,7 @@ static gfp_t massage_gfp_flags(const struct device *dev, gfp_t gfp) · 99 unmodified lines
100100 else
101101 #endif
102102 #if defined(CONFIG_ZONE_DMA) && !defined(CONFIG_ZONE_DMA32)
103− if (dev->coherent_dma_mask < DMA_BIT_MASK(64))
103+ if (dev->coherent_dma_mask < DMA_BIT_MASK(sizeof(phys_addr_t) * 8))
104104 dma_flag = __GFP_DMA;
105105 else
106106 #endif
arch/mips/mm/init.c+114−63
@@ -44,6 +44,7 @@ · 43 unmodified lines
4444 #include <asm/pgalloc.h>
4545 #include <asm/tlb.h>
4646 #include <asm/fixmap.h>
47+#include <asm/maar.h>
4748
4849 /*
4950 * We have up to 8 empty zeroed pages so we can map one of the right colour
@@ -252,6 +253,119 @@ void __init fixrange_init(unsigned long start, unsigned long end, · 202 unmodified lines
252253 #endif
253254 }
254255
256+unsigned __weak platform_maar_init(unsigned num_pairs)
257+{
258+ struct maar_config cfg[BOOT_MEM_MAP_MAX];
259+ unsigned i, num_configured, num_cfg = 0;
260+ phys_addr_t skip;
261+
262+ for (i = 0; i < boot_mem_map.nr_map; i++) {
263+ switch (boot_mem_map.map[i].type) {
264+ case BOOT_MEM_RAM:
265+ case BOOT_MEM_INIT_RAM:
266+ break;
267+ default:
268+ continue;
269+ }
270+
271+ skip = 0x10000 - (boot_mem_map.map[i].addr & 0xffff);
272+
273+ cfg[num_cfg].lower = boot_mem_map.map[i].addr;
274+ cfg[num_cfg].lower += skip;
275+
276+ cfg[num_cfg].upper = cfg[num_cfg].lower;
277+ cfg[num_cfg].upper += boot_mem_map.map[i].size - 1;
278+ cfg[num_cfg].upper -= skip;
279+
280+ cfg[num_cfg].attrs = MIPS_MAAR_S;
281+ num_cfg++;
282+ }
283+
284+ num_configured = maar_config(cfg, num_cfg, num_pairs);
285+ if (num_configured < num_cfg)
286+ pr_warn("Not enough MAAR pairs (%u) for all bootmem regions (%u)\n",
287+ num_pairs, num_cfg);
288+
289+ return num_configured;
290+}
291+
292+void maar_init(void)
293+{
294+ unsigned num_maars, used, i;
295+ phys_addr_t lower, upper, attr;
296+ static struct {
297+ struct maar_config cfgs[3];
298+ unsigned used;
299+ } recorded = { { { 0 } }, 0 };
300+
301+ if (!cpu_has_maar)
302+ return;
303+
304+ /* Detect the number of MAARs */
305+ write_c0_maari(~0);
306+ back_to_back_c0_hazard();
307+ num_maars = read_c0_maari() + 1;
308+
309+ /* MAARs should be in pairs */
310+ WARN_ON(num_maars % 2);
311+
312+ /* Set MAARs using values we recorded already */
313+ if (recorded.used) {
314+ used = maar_config(recorded.cfgs, recorded.used, num_maars / 2);
315+ BUG_ON(used != recorded.used);
316+ } else {
317+ /* Configure the required MAARs */
318+ used = platform_maar_init(num_maars / 2);
319+ }
320+
321+ /* Disable any further MAARs */
322+ for (i = (used * 2); i < num_maars; i++) {
323+ write_c0_maari(i);
324+ back_to_back_c0_hazard();
325+ write_c0_maar(0);
326+ back_to_back_c0_hazard();
327+ }
328+
329+ if (recorded.used)
330+ return;
331+
332+ pr_info("MAAR configuration:\n");
333+ for (i = 0; i < num_maars; i += 2) {
334+ write_c0_maari(i);
335+ back_to_back_c0_hazard();
336+ upper = read_c0_maar();
337+
338+ write_c0_maari(i + 1);
339+ back_to_back_c0_hazard();
340+ lower = read_c0_maar();
341+
342+ attr = lower & upper;
343+ lower = (lower & MIPS_MAAR_ADDR) << 4;
344+ upper = ((upper & MIPS_MAAR_ADDR) << 4) | 0xffff;
345+
346+ pr_info(" [%d]: ", i / 2);
347+ if (!(attr & MIPS_MAAR_V)) {
348+ pr_cont("disabled\n");
349+ continue;
350+ }
351+
352+ pr_cont("%pa-%pa", &lower, &upper);
353+
354+ if (attr & MIPS_MAAR_S)
355+ pr_cont(" speculate");
356+
357+ pr_cont("\n");
358+
359+ /* Record the setup for use on secondary CPUs */
360+ if (used <= ARRAY_SIZE(recorded.cfgs)) {
361+ recorded.cfgs[recorded.used].lower = lower;
362+ recorded.cfgs[recorded.used].upper = upper;
363+ recorded.cfgs[recorded.used].attrs = attr;
364+ recorded.used++;
365+ }
366+ }
367+}
368+
255369 #ifndef CONFIG_NEED_MULTIPLE_NODES
256370 int page_is_ram(unsigned long pagenr)
257371 {
@@ -334,69 +448,6 @@ static inline void mem_init_free_highmem(void) · 76 unmodified lines
334448 #endif
335449 }
336450
337−unsigned __weak platform_maar_init(unsigned num_pairs)
338−{
339− struct maar_config cfg[BOOT_MEM_MAP_MAX];
340− unsigned i, num_configured, num_cfg = 0;
341− phys_addr_t skip;
342−
343− for (i = 0; i < boot_mem_map.nr_map; i++) {
344− switch (boot_mem_map.map[i].type) {
345− case BOOT_MEM_RAM:
346− case BOOT_MEM_INIT_RAM:
347− break;
348− default:
349− continue;
350− }
351−
352− skip = 0x10000 - (boot_mem_map.map[i].addr & 0xffff);
353−
354− cfg[num_cfg].lower = boot_mem_map.map[i].addr;
355− cfg[num_cfg].lower += skip;
356−
357− cfg[num_cfg].upper = cfg[num_cfg].lower;
358− cfg[num_cfg].upper += boot_mem_map.map[i].size - 1;
359− cfg[num_cfg].upper -= skip;
360−
361− cfg[num_cfg].attrs = MIPS_MAAR_S;
362− num_cfg++;
363− }
364−
365− num_configured = maar_config(cfg, num_cfg, num_pairs);
366− if (num_configured < num_cfg)
367− pr_warn("Not enough MAAR pairs (%u) for all bootmem regions (%u)\n",
368− num_pairs, num_cfg);
369−
370− return num_configured;
371−}
372−
373−static void maar_init(void)
374−{
375− unsigned num_maars, used, i;
376−
377− if (!cpu_has_maar)
378− return;
379−
380− /* Detect the number of MAARs */
381− write_c0_maari(~0);
382− back_to_back_c0_hazard();
383− num_maars = read_c0_maari() + 1;
384−
385− /* MAARs should be in pairs */
386− WARN_ON(num_maars % 2);
387−
388− /* Configure the required MAARs */
389− used = platform_maar_init(num_maars / 2);
390−
391− /* Disable any further MAARs */
392− for (i = (used * 2); i < num_maars; i++) {
393− write_c0_maari(i);
394− back_to_back_c0_hazard();
395− write_c0_maar(0);
396− back_to_back_c0_hazard();
397− }
398−}
399−
400451 void __init mem_init(void)
401452 {
402453 #ifdef CONFIG_HIGHMEM
arch/mips/net/bpf_jit_asm.S+54−9
@@ -57,15 +57,28 @@ · 56 unmodified lines
5757
5858 LEAF(sk_load_word)
5959 is_offset_negative(word)
60− .globl sk_load_word_positive
61−sk_load_word_positive:
60+FEXPORT(sk_load_word_positive)
6261 is_offset_in_header(4, word)
6362 /* Offset within header boundaries */
6463 PTR_ADDU t1, $r_skb_data, offset
64+ .set reorder
6565 lw $r_A, 0(t1)
66+ .set noreorder
6667 #ifdef CONFIG_CPU_LITTLE_ENDIAN
68+# if defined(__mips_isa_rev) && (__mips_isa_rev >= 2)
6769 wsbh t0, $r_A
6870 rotr $r_A, t0, 16
71+# else
72+ sll t0, $r_A, 24
73+ srl t1, $r_A, 24
74+ srl t2, $r_A, 8
75+ or t0, t0, t1
76+ andi t2, t2, 0xff00
77+ andi t1, $r_A, 0xff00
78+ or t0, t0, t2
79+ sll t1, t1, 8
80+ or $r_A, t0, t1
81+# endif
6982 #endif
7083 jr $r_ra
7184 move $r_ret, zero
@@ -73,15 +86,24 @@ sk_load_word_positive: · 1 unmodified line
7386
7487 LEAF(sk_load_half)
7588 is_offset_negative(half)
76− .globl sk_load_half_positive
77−sk_load_half_positive:
89+FEXPORT(sk_load_half_positive)
7890 is_offset_in_header(2, half)
7991 /* Offset within header boundaries */
8092 PTR_ADDU t1, $r_skb_data, offset
93+ .set reorder
8194 lh $r_A, 0(t1)
95+ .set noreorder
8296 #ifdef CONFIG_CPU_LITTLE_ENDIAN
97+# if defined(__mips_isa_rev) && (__mips_isa_rev >= 2)
8398 wsbh t0, $r_A
8499 seh $r_A, t0
100+# else
101+ sll t0, $r_A, 24
102+ andi t1, $r_A, 0xff00
103+ sra t0, t0, 16
104+ srl t1, t1, 8
105+ or $r_A, t0, t1
106+# endif
85107 #endif
86108 jr $r_ra
87109 move $r_ret, zero
@@ -89,8 +111,7 @@ sk_load_half_positive: · 1 unmodified line
89111
90112 LEAF(sk_load_byte)
91113 is_offset_negative(byte)
92− .globl sk_load_byte_positive
93−sk_load_byte_positive:
114+FEXPORT(sk_load_byte_positive)
94115 is_offset_in_header(1, byte)
95116 /* Offset within header boundaries */
96117 PTR_ADDU t1, $r_skb_data, offset
@@ -148,23 +169,47 @@ sk_load_byte_positive: · 51 unmodified lines
148169 NESTED(bpf_slow_path_word, (6 * SZREG), $r_sp)
149170 bpf_slow_path_common(4)
150171 #ifdef CONFIG_CPU_LITTLE_ENDIAN
172+# if defined(__mips_isa_rev) && (__mips_isa_rev >= 2)
151173 wsbh t0, $r_s0
152174 jr $r_ra
153175 rotr $r_A, t0, 16
154−#endif
176+# else
177+ sll t0, $r_s0, 24
178+ srl t1, $r_s0, 24
179+ srl t2, $r_s0, 8
180+ or t0, t0, t1
181+ andi t2, t2, 0xff00
182+ andi t1, $r_s0, 0xff00
183+ or t0, t0, t2
184+ sll t1, t1, 8
185+ jr $r_ra
186+ or $r_A, t0, t1
187+# endif
188+#else
155189 jr $r_ra
156− move $r_A, $r_s0
190+ move $r_A, $r_s0
191+#endif
157192
158193 END(bpf_slow_path_word)
159194
160195 NESTED(bpf_slow_path_half, (6 * SZREG), $r_sp)
161196 bpf_slow_path_common(2)
162197 #ifdef CONFIG_CPU_LITTLE_ENDIAN
198+# if defined(__mips_isa_rev) && (__mips_isa_rev >= 2)
163199 jr $r_ra
164200 wsbh $r_A, $r_s0
165−#endif
201+# else
202+ sll t0, $r_s0, 8
203+ andi t1, $r_s0, 0xff00
204+ andi t0, t0, 0xff00
205+ srl t1, t1, 8
206+ jr $r_ra
207+ or $r_A, t0, t1
208+# endif
209+#else
166210 jr $r_ra
167211 move $r_A, $r_s0
212+#endif
168213
169214 END(bpf_slow_path_half)
170215
arch/mips/pci/pci.c+6−0
@@ -311,6 +311,12 @@ int pcibios_enable_device(struct pci_dev *dev, int mask) · 310 unmodified lines
311311
312312 void pcibios_fixup_bus(struct pci_bus *bus)
313313 {
314+ struct pci_dev *dev = bus->self;
315+
316+ if (pci_has_flag(PCI_PROBE_ONLY) && dev &&
317+ (dev->class >> 8) == PCI_CLASS_BRIDGE_PCI) {
318+ pci_read_bridge_bases(bus);
319+ }
314320 }
315321
316322 EXPORT_SYMBOL(PCIBIOS_MIN_IO);
arch/mn10300/include/asm/Kbuild+1−0
@@ -9,3 +9,4 @@ generic-y += mm-arch-hooks.h · 8 unmodified lines
99 generic-y += preempt.h
1010 generic-y += sections.h
1111 generic-y += trace_clock.h
12+generic-y += word-at-a-time.h
arch/mn10300/unit-asb2305/pci.c+1−0
@@ -324,6 +324,7 @@ void pcibios_fixup_bus(struct pci_bus *bus) · 323 unmodified lines
324324 struct pci_dev *dev;
325325
326326 if (bus->self) {
327+ pci_read_bridge_bases(bus);
327328 pcibios_fixup_bridge_resources(bus->self);
328329 }
329330
arch/nios2/include/asm/Kbuild+1−0
@@ -61,4 +61,5 @@ generic-y += types.h · 60 unmodified lines
6161 generic-y += unaligned.h
6262 generic-y += user.h
6363 generic-y += vga.h
64+generic-y += word-at-a-time.h
6465 generic-y += xor.h
arch/powerpc/include/asm/Kbuild+1−0
@@ -7,3 +7,4 @@ generic-y += mcs_spinlock.h · 6 unmodified lines
77 generic-y += preempt.h
88 generic-y += rwsem.h
99 generic-y += vtime.h
10+generic-y += word-at-a-time.h
arch/powerpc/include/asm/kvm_host.h+1−0
@@ -44,6 +44,7 @@ · 43 unmodified lines
4444 #ifdef CONFIG_KVM_MMIO
4545 #define KVM_COALESCED_MMIO_PAGE_OFFSET 1
4646 #endif
47+#define KVM_HALT_POLL_NS_DEFAULT 500000
4748
4849 /* These values are internal and can be increased later */
4950 #define KVM_NR_IRQCHIPS 1
arch/powerpc/include/asm/systbl.h+1−0
@@ -369,3 +369,4 @@ SYSCALL_SPU(bpf) · 368 unmodified lines
369369 COMPAT_SYS(execveat)
370370 PPC64ONLY(switch_endian)
371371 SYSCALL_SPU(userfaultfd)
372+SYSCALL_SPU(membarrier)
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 365
15+#define __NR_syscalls 366
1616
1717 #define __NR__exit __NR_exit
1818 #define NR_syscalls __NR_syscalls
arch/powerpc/include/uapi/asm/unistd.h+1−0
@@ -387,5 +387,6 @@ · 386 unmodified lines
387387 #define __NR_execveat 362
388388 #define __NR_switch_endian 363
389389 #define __NR_userfaultfd 364
390+#define __NR_membarrier 365
390391
391392 #endif /* _UAPI_ASM_POWERPC_UNISTD_H_ */
arch/powerpc/kernel/pci-common.c+7−1
@@ -1032,7 +1032,13 @@ void pcibios_set_master(struct pci_dev *dev) · 1031 unmodified lines
10321032
10331033 void pcibios_fixup_bus(struct pci_bus *bus)
10341034 {
1035− /* Fixup the bus */
1035+ /* When called from the generic PCI probe, read PCI<->PCI bridge
1036+ * bases. This is -not- called when generating the PCI tree from
1037+ * the OF device-tree.
1038+ */
1039+ pci_read_bridge_bases(bus);
1040+
1041+ /* Now fixup the bus bus */
10361042 pcibios_setup_bus_self(bus);
10371043
10381044 /* Now fixup devices on that bus */
arch/powerpc/kvm/book3s.c+6−0
@@ -829,12 +829,15 @@ int kvmppc_h_logical_ci_load(struct kvm_vcpu *vcpu) · 828 unmodified lines
829829 unsigned long size = kvmppc_get_gpr(vcpu, 4);
830830 unsigned long addr = kvmppc_get_gpr(vcpu, 5);
831831 u64 buf;
832+ int srcu_idx;
832833 int ret;
833834
834835 if (!is_power_of_2(size) || (size > sizeof(buf)))
835836 return H_TOO_HARD;
836837
838+ srcu_idx = srcu_read_lock(&vcpu->kvm->srcu);
837839 ret = kvm_io_bus_read(vcpu, KVM_MMIO_BUS, addr, size, &buf);
840+ srcu_read_unlock(&vcpu->kvm->srcu, srcu_idx);
838841 if (ret != 0)
839842 return H_TOO_HARD;
840843
@@ -869,6 +872,7 @@ int kvmppc_h_logical_ci_store(struct kvm_vcpu *vcpu) · 28 unmodified lines
869872 unsigned long addr = kvmppc_get_gpr(vcpu, 5);
870873 unsigned long val = kvmppc_get_gpr(vcpu, 6);
871874 u64 buf;
875+ int srcu_idx;
872876 int ret;
873877
874878 switch (size) {
@@ -892,7 +896,9 @@ int kvmppc_h_logical_ci_store(struct kvm_vcpu *vcpu) · 17 unmodified lines
892896 return H_TOO_HARD;
893897 }
894898
899+ srcu_idx = srcu_read_lock(&vcpu->kvm->srcu);
895900 ret = kvm_io_bus_write(vcpu, KVM_MMIO_BUS, addr, size, &buf);
901+ srcu_read_unlock(&vcpu->kvm->srcu, srcu_idx);
896902 if (ret != 0)
897903 return H_TOO_HARD;
898904
arch/powerpc/kvm/book3s_hv.c+5−1
@@ -2692,9 +2692,13 @@ static int kvmppc_run_vcpu(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu) · 2691 unmodified lines
26922692
26932693 while (vcpu->arch.state == KVMPPC_VCPU_RUNNABLE &&
26942694 (vc->vcore_state == VCORE_RUNNING ||
2695− vc->vcore_state == VCORE_EXITING))
2695+ vc->vcore_state == VCORE_EXITING ||
2696+ vc->vcore_state == VCORE_PIGGYBACK))
26962697 kvmppc_wait_for_exec(vc, vcpu, TASK_UNINTERRUPTIBLE);
26972698
2699+ if (vc->vcore_state == VCORE_PREEMPT && vc->runner == NULL)
2700+ kvmppc_vcore_end_preempt(vc);
2701+
26982702 if (vcpu->arch.state == KVMPPC_VCPU_RUNNABLE) {
26992703 kvmppc_remove_runnable(vc, vcpu);
27002704 vcpu->stat.signal_exits++;
arch/powerpc/kvm/book3s_hv_rmhandlers.S+1−0
@@ -1257,6 +1257,7 @@ mc_cont: · 1256 unmodified lines
12571257 bl kvmhv_accumulate_time
12581258 #endif
12591259
1260+ mr r3, r12
12601261 /* Increment exit count, poke other threads to exit */
12611262 bl kvmhv_commence_exit
12621263 nop
arch/s390/include/asm/Kbuild+1−0
@@ -6,3 +6,4 @@ generic-y += mcs_spinlock.h · 5 unmodified lines
66 generic-y += mm-arch-hooks.h
77 generic-y += preempt.h
88 generic-y += trace_clock.h
9+generic-y += word-at-a-time.h
arch/s390/include/asm/kvm_host.h+1−0
@@ -35,6 +35,7 @@ · 34 unmodified lines
3535 */
3636 #define KVM_NR_IRQCHIPS 1
3737 #define KVM_IRQCHIP_NUM_PINS 4096
38+#define KVM_HALT_POLL_NS_DEFAULT 0
3839
3940 #define SIGP_CTRL_C 0x80
4041 #define SIGP_CTRL_SCN_MASK 0x3f
arch/score/include/asm/Kbuild+1−0
@@ -13,3 +13,4 @@ generic-y += sections.h · 12 unmodified lines
1313 generic-y += trace_clock.h
1414 generic-y += xor.h
1515 generic-y += serial.h
16+generic-y += word-at-a-time.h
arch/tile/gxio/mpipe.c+4−29
@@ -19,6 +19,7 @@ · 18 unmodified lines
1919 #include <linux/errno.h>
2020 #include <linux/io.h>
2121 #include <linux/module.h>
22+#include <linux/string.h>
2223
2324 #include <gxio/iorpc_globals.h>
2425 #include <gxio/iorpc_mpipe.h>
@@ -29,32 +30,6 @@ · 4 unmodified lines
2930 /* HACK: Avoid pointless "shadow" warnings. */
3031 #define link link_shadow
3132
32−/**
33− * strscpy - Copy a C-string into a sized buffer, but only if it fits
34− * @dest: Where to copy the string to
35− * @src: Where to copy the string from
36− * @size: size of destination buffer
37− *
38− * Use this routine to avoid copying too-long strings.
39− * The routine returns the total number of bytes copied
40− * (including the trailing NUL) or zero if the buffer wasn't
41− * big enough. To ensure that programmers pay attention
42− * to the return code, the destination has a single NUL
43− * written at the front (if size is non-zero) when the
44− * buffer is not big enough.
45− */
46−static size_t strscpy(char *dest, const char *src, size_t size)
47−{
48− size_t len = strnlen(src, size) + 1;
49− if (len > size) {
50− if (size)
51− dest[0] = '\0';
52− return 0;
53− }
54− memcpy(dest, src, len);
55− return len;
56−}
57−
5833 int gxio_mpipe_init(gxio_mpipe_context_t *context, unsigned int mpipe_index)
5934 {
6035 char file[32];
@@ -540,7 +515,7 @@ int gxio_mpipe_link_instance(const char *link_name) · 479 unmodified lines
540515 if (!context)
541516 return GXIO_ERR_NO_DEVICE;
542517
543− if (strscpy(name.name, link_name, sizeof(name.name)) == 0)
518+ if (strscpy(name.name, link_name, sizeof(name.name)) < 0)
544519 return GXIO_ERR_NO_DEVICE;
545520
546521 return gxio_mpipe_info_instance_aux(context, name);
@@ -559,7 +534,7 @@ int gxio_mpipe_link_enumerate_mac(int idx, char *link_name, uint8_t *link_mac) · 12 unmodified lines
559534
560535 rv = gxio_mpipe_info_enumerate_aux(context, idx, &name, &mac);
561536 if (rv >= 0) {
562− if (strscpy(link_name, name.name, sizeof(name.name)) == 0)
537+ if (strscpy(link_name, name.name, sizeof(name.name)) < 0)
563538 return GXIO_ERR_INVAL_MEMORY_SIZE;
564539 memcpy(link_mac, mac.mac, sizeof(mac.mac));
565540 }
@@ -576,7 +551,7 @@ int gxio_mpipe_link_open(gxio_mpipe_link_t *link, · 10 unmodified lines
576551 _gxio_mpipe_link_name_t name;
577552 int rv;
578553
579− if (strscpy(name.name, link_name, sizeof(name.name)) == 0)
554+ if (strscpy(name.name, link_name, sizeof(name.name)) < 0)
580555 return GXIO_ERR_NO_DEVICE;
581556
582557 rv = gxio_mpipe_link_open_aux(context, name, flags);
arch/tile/include/asm/Kbuild+1−0
@@ -40,4 +40,5 @@ generic-y += termbits.h · 39 unmodified lines
4040 generic-y += termios.h
4141 generic-y += trace_clock.h
4242 generic-y += types.h
43+generic-y += word-at-a-time.h
4344 generic-y += xor.h
arch/tile/kernel/usb.c+1−0
@@ -22,6 +22,7 @@ · 21 unmodified lines
2222 #include <linux/platform_device.h>
2323 #include <linux/usb/tilegx.h>
2424 #include <linux/init.h>
25+#include <linux/module.h>
2526 #include <linux/types.h>
2627
2728 static u64 ehci_dmamask = DMA_BIT_MASK(32);
arch/um/include/asm/Kbuild+1−0
@@ -25,4 +25,5 @@ generic-y += preempt.h · 24 unmodified lines
2525 generic-y += switch_to.h
2626 generic-y += topology.h
2727 generic-y += trace_clock.h
28+generic-y += word-at-a-time.h
2829 generic-y += xor.h
arch/unicore32/include/asm/Kbuild+1−0
@@ -62,4 +62,5 @@ generic-y += ucontext.h · 61 unmodified lines
6262 generic-y += unaligned.h
6363 generic-y += user.h
6464 generic-y += vga.h
65+generic-y += word-at-a-time.h
6566 generic-y += xor.h
arch/x86/entry/entry_64.S+15−1
@@ -1128,7 +1128,18 @@ END(error_exit) · 1127 unmodified lines
11281128
11291129 /* Runs on exception stack */
11301130 ENTRY(nmi)
1131+ /*
1132+ * Fix up the exception frame if we're on Xen.
1133+ * PARAVIRT_ADJUST_EXCEPTION_FRAME is guaranteed to push at most
1134+ * one value to the stack on native, so it may clobber the rdx
1135+ * scratch slot, but it won't clobber any of the important
1136+ * slots past it.
1137+ *
1138+ * Xen is a different story, because the Xen frame itself overlaps
1139+ * the "NMI executing" variable.
1140+ */
11311141 PARAVIRT_ADJUST_EXCEPTION_FRAME
1142+
11321143 /*
11331144 * We allow breakpoints in NMIs. If a breakpoint occurs, then
11341145 * the iretq it performs will take us out of NMI context.
@@ -1179,9 +1190,12 @@ ENTRY(nmi) · 44 unmodified lines
11791190 * we don't want to enable interrupts, because then we'll end
11801191 * up in an awkward situation in which IRQs are on but NMIs
11811192 * are off.
1193+ *
1194+ * We also must not push anything to the stack before switching
1195+ * stacks lest we corrupt the "NMI executing" variable.
11821196 */
11831197
1184− SWAPGS
1198+ SWAPGS_UNSAFE_STACK
11851199 cld
11861200 movq %rsp, %rdx
11871201 movq PER_CPU_VAR(cpu_current_top_of_stack), %rsp
arch/x86/include/asm/cpufeature.h+1−1
@@ -193,7 +193,7 @@ · 192 unmodified lines
193193 #define X86_FEATURE_HW_PSTATE ( 7*32+ 8) /* AMD HW-PState */
194194 #define X86_FEATURE_PROC_FEEDBACK ( 7*32+ 9) /* AMD ProcFeedbackInterface */
195195 #define X86_FEATURE_HWP ( 7*32+ 10) /* "hwp" Intel HWP */
196−#define X86_FEATURE_HWP_NOITFY ( 7*32+ 11) /* Intel HWP_NOTIFY */
196+#define X86_FEATURE_HWP_NOTIFY ( 7*32+ 11) /* Intel HWP_NOTIFY */
197197 #define X86_FEATURE_HWP_ACT_WINDOW ( 7*32+ 12) /* Intel HWP_ACT_WINDOW */
198198 #define X86_FEATURE_HWP_EPP ( 7*32+13) /* Intel HWP_EPP */
199199 #define X86_FEATURE_HWP_PKG_REQ ( 7*32+14) /* Intel HWP_PKG_REQ */
arch/x86/include/asm/efi.h+12−0
@@ -86,6 +86,18 @@ extern u64 asmlinkage efi_call(void *fp, ...); · 85 unmodified lines
8686 extern void __iomem *__init efi_ioremap(unsigned long addr, unsigned long size,
8787 u32 type, u64 attribute);
8888
89+#ifdef CONFIG_KASAN
90+/*
91+ * CONFIG_KASAN may redefine memset to __memset. __memset function is present
92+ * only in kernel binary. Since the EFI stub linked into a separate binary it
93+ * doesn't have __memset(). So we should use standard memset from
94+ * arch/x86/boot/compressed/string.c. The same applies to memcpy and memmove.
95+ */
96+#undef memcpy
97+#undef memset
98+#undef memmove
99+#endif
100+
89101 #endif /* CONFIG_X86_32 */
90102
91103 extern struct efi_scratch efi_scratch;
arch/x86/include/asm/kvm_host.h+1−0
@@ -40,6 +40,7 @@ · 39 unmodified lines
4040
4141 #define KVM_PIO_PAGE_OFFSET 1
4242 #define KVM_COALESCED_MMIO_PAGE_OFFSET 2
43+#define KVM_HALT_POLL_NS_DEFAULT 500000
4344
4445 #define KVM_IRQCHIP_NUM_PINS KVM_IOAPIC_NUM_PINS
4546
arch/x86/include/asm/msr-index.h+3−0
@@ -141,6 +141,8 @@ · 140 unmodified lines
141141 #define DEBUGCTLMSR_BTS_OFF_USR (1UL << 10)
142142 #define DEBUGCTLMSR_FREEZE_LBRS_ON_PMI (1UL << 11)
143143
144+#define MSR_PEBS_FRONTEND 0x000003f7
145+
144146 #define MSR_IA32_POWER_CTL 0x000001fc
145147
146148 #define MSR_IA32_MC0_CTL 0x00000400
@@ -331,6 +333,7 @@ · 184 unmodified lines
331333 /* C1E active bits in int pending message */
332334 #define K8_INTP_C1E_ACTIVE_MASK 0x18000000
333335 #define MSR_K8_TSEG_ADDR 0xc0010112
336+#define MSR_K8_TSEG_MASK 0xc0010113
334337 #define K8_MTRRFIXRANGE_DRAM_ENABLE 0x00040000 /* MtrrFixDramEn bit */
335338 #define K8_MTRRFIXRANGE_DRAM_MODIFY 0x00080000 /* MtrrFixDramModEn bit */
336339 #define K8_MTRR_RDMEM_WRMEM_MASK 0x18181818 /* Mask: RdMem|WrMem */
arch/x86/include/asm/pvclock-abi.h+1−0
@@ -41,6 +41,7 @@ struct pvclock_wall_clock { · 40 unmodified lines
4141
4242 #define PVCLOCK_TSC_STABLE_BIT (1 << 0)
4343 #define PVCLOCK_GUEST_STOPPED (1 << 1)
44+/* PVCLOCK_COUNTS_FROM_ZERO broke ABI and can't be used anymore. */
4445 #define PVCLOCK_COUNTS_FROM_ZERO (1 << 2)
4546 #endif /* __ASSEMBLY__ */
4647 #endif /* _ASM_X86_PVCLOCK_ABI_H */
arch/x86/include/uapi/asm/bitsperlong.h+1−1
@@ -1,7 +1,7 @@
11 #ifndef __ASM_X86_BITSPERLONG_H
22 #define __ASM_X86_BITSPERLONG_H
33
4−#ifdef __x86_64__
4+#if defined(__x86_64__) && !defined(__ILP32__)
55 # define __BITS_PER_LONG 64
66 #else
77 # define __BITS_PER_LONG 32
arch/x86/kernel/cpu/mshyperv.c+7−5
@@ -34,11 +34,10 @@ · 33 unmodified lines
3434 struct ms_hyperv_info ms_hyperv;
3535 EXPORT_SYMBOL_GPL(ms_hyperv);
3636
37−static void (*hv_kexec_handler)(void);
38−static void (*hv_crash_handler)(struct pt_regs *regs);
39−
4037 #if IS_ENABLED(CONFIG_HYPERV)
4138 static void (*vmbus_handler)(void);
39+static void (*hv_kexec_handler)(void);
40+static void (*hv_crash_handler)(struct pt_regs *regs);
4241
4342 void hyperv_vector_handler(struct pt_regs *regs)
4443 {
@@ -96,8 +95,8 @@ void hv_remove_crash_handler(void) · 51 unmodified lines
9695 hv_crash_handler = NULL;
9796 }
9897 EXPORT_SYMBOL_GPL(hv_remove_crash_handler);
99−#endif
10098
99+#ifdef CONFIG_KEXEC_CORE
101100 static void hv_machine_shutdown(void)
102101 {
103102 if (kexec_in_progress && hv_kexec_handler)
@@ -111,7 +110,8 @@ static void hv_machine_crash_shutdown(struct pt_regs *regs) · 7 unmodified lines
111110 hv_crash_handler(regs);
112111 native_machine_crash_shutdown(regs);
113112 }
114−
113+#endif /* CONFIG_KEXEC_CORE */
114+#endif /* CONFIG_HYPERV */
115115
116116 static uint32_t __init ms_hyperv_platform(void)
117117 {
@@ -186,8 +186,10 @@ static void __init ms_hyperv_init_platform(void) · 68 unmodified lines
186186 no_timer_check = 1;
187187 #endif
188188
189+#if IS_ENABLED(CONFIG_HYPERV) && defined(CONFIG_KEXEC_CORE)
189190 machine_ops.shutdown = hv_machine_shutdown;
190191 machine_ops.crash_shutdown = hv_machine_crash_shutdown;
192+#endif
191193 mark_tsc_unstable("running on Hyper-V");
192194 }
193195
arch/x86/kernel/cpu/perf_event.h+1−0
@@ -47,6 +47,7 @@ enum extra_reg_type { · 46 unmodified lines
4747 EXTRA_REG_RSP_1 = 1, /* offcore_response_1 */
4848 EXTRA_REG_LBR = 2, /* lbr_select */
4949 EXTRA_REG_LDLAT = 3, /* ld_lat_threshold */
50+ EXTRA_REG_FE = 4, /* fe_* */
5051
5152 EXTRA_REG_MAX /* number of entries needed */
5253 };
arch/x86/kernel/cpu/perf_event_intel.c+15−2
@@ -205,6 +205,11 @@ static struct extra_reg intel_skl_extra_regs[] __read_mostly = { · 204 unmodified lines
205205 INTEL_UEVENT_EXTRA_REG(0x01b7, MSR_OFFCORE_RSP_0, 0x3fffff8fffull, RSP_0),
206206 INTEL_UEVENT_EXTRA_REG(0x01bb, MSR_OFFCORE_RSP_1, 0x3fffff8fffull, RSP_1),
207207 INTEL_UEVENT_PEBS_LDLAT_EXTRA_REG(0x01cd),
208+ /*
209+ * Note the low 8 bits eventsel code is not a continuous field, containing
210+ * some #GPing bits. These are masked out.
211+ */
212+ INTEL_UEVENT_EXTRA_REG(0x01c6, MSR_PEBS_FRONTEND, 0x7fff17, FE),
208213 EVENT_EXTRA_END
209214 };
210215
@@ -250,7 +255,7 @@ struct event_constraint intel_bdw_event_constraints[] = { · 39 unmodified lines
250255 FIXED_EVENT_CONSTRAINT(0x003c, 1), /* CPU_CLK_UNHALTED.CORE */
251256 FIXED_EVENT_CONSTRAINT(0x0300, 2), /* CPU_CLK_UNHALTED.REF */
252257 INTEL_UEVENT_CONSTRAINT(0x148, 0x4), /* L1D_PEND_MISS.PENDING */
253− INTEL_EVENT_CONSTRAINT(0xa3, 0x4), /* CYCLE_ACTIVITY.* */
258+ INTEL_UEVENT_CONSTRAINT(0x8a3, 0x4), /* CYCLE_ACTIVITY.CYCLES_L1D_MISS */
254259 EVENT_CONSTRAINT_END
255260 };
256261
@@ -2891,6 +2896,8 @@ PMU_FORMAT_ATTR(offcore_rsp, "config1:0-63"); · 2634 unmodified lines
28912896
28922897 PMU_FORMAT_ATTR(ldlat, "config1:0-15");
28932898
2899+PMU_FORMAT_ATTR(frontend, "config1:0-23");
2900+
28942901 static struct attribute *intel_arch3_formats_attr[] = {
28952902 &format_attr_event.attr,
28962903 &format_attr_umask.attr,
@@ -2907,6 +2914,11 @@ static struct attribute *intel_arch3_formats_attr[] = { · 10 unmodified lines
29072914 NULL,
29082915 };
29092916
2917+static struct attribute *skl_format_attr[] = {
2918+ &format_attr_frontend.attr,
2919+ NULL,
2920+};
2921+
29102922 static __initconst const struct x86_pmu core_pmu = {
29112923 .name = "core",
29122924 .handle_irq = x86_pmu_handle_irq,
@@ -3516,7 +3528,8 @@ __init int intel_pmu_init(void) · 603 unmodified lines
35163528
35173529 x86_pmu.hw_config = hsw_hw_config;
35183530 x86_pmu.get_event_constraints = hsw_get_event_constraints;
3519− x86_pmu.cpu_events = hsw_events_attrs;
3531+ x86_pmu.format_attrs = merge_attr(intel_arch3_formats_attr,
3532+ skl_format_attr);
35203533 WARN_ON(!x86_pmu.format_attrs);
35213534 x86_pmu.cpu_events = hsw_events_attrs;
35223535 pr_cont("Skylake events, ");
arch/x86/kernel/cpu/perf_event_msr.c+2−2
@@ -10,12 +10,12 @@ enum perf_msr_id { · 9 unmodified lines
1010 PERF_MSR_EVENT_MAX,
1111 };
1212
13−bool test_aperfmperf(int idx)
13+static bool test_aperfmperf(int idx)
1414 {
1515 return boot_cpu_has(X86_FEATURE_APERFMPERF);
1616 }
1717
18−bool test_intel(int idx)
18+static bool test_intel(int idx)
1919 {
2020 if (boot_cpu_data.x86_vendor != X86_VENDOR_INTEL ||
2121 boot_cpu_data.x86 != 6)
arch/x86/kernel/cpu/scattered.c+1−1
@@ -37,7 +37,7 @@ void init_scattered_cpuid_features(struct cpuinfo_x86 *c) · 36 unmodified lines
3737 { X86_FEATURE_PLN, CR_EAX, 4, 0x00000006, 0 },
3838 { X86_FEATURE_PTS, CR_EAX, 6, 0x00000006, 0 },
3939 { X86_FEATURE_HWP, CR_EAX, 7, 0x00000006, 0 },
40− { X86_FEATURE_HWP_NOITFY, CR_EAX, 8, 0x00000006, 0 },
40+ { X86_FEATURE_HWP_NOTIFY, CR_EAX, 8, 0x00000006, 0 },
4141 { X86_FEATURE_HWP_ACT_WINDOW, CR_EAX, 9, 0x00000006, 0 },
4242 { X86_FEATURE_HWP_EPP, CR_EAX,10, 0x00000006, 0 },
4343 { X86_FEATURE_HWP_PKG_REQ, CR_EAX,11, 0x00000006, 0 },
arch/x86/kernel/crash.c+3−4
@@ -185,10 +185,9 @@ void native_machine_crash_shutdown(struct pt_regs *regs) · 184 unmodified lines
185185 }
186186
187187 #ifdef CONFIG_KEXEC_FILE
188−static int get_nr_ram_ranges_callback(unsigned long start_pfn,
189− unsigned long nr_pfn, void *arg)
188+static int get_nr_ram_ranges_callback(u64 start, u64 end, void *arg)
190189 {
191− int *nr_ranges = arg;
190+ unsigned int *nr_ranges = arg;
192191
193192 (*nr_ranges)++;
194193 return 0;
@@ -214,7 +213,7 @@ static void fill_up_crash_elf_data(struct crash_elf_data *ced, · 19 unmodified lines
214213
215214 ced->image = image;
216215
217− walk_system_ram_range(0, -1, &nr_ranges,
216+ walk_system_ram_res(0, -1, &nr_ranges,
218217 get_nr_ram_ranges_callback);
219218
220219 ced->max_nr_ranges = nr_ranges;
arch/x86/kernel/paravirt.c+12−4
@@ -41,10 +41,18 @@ · 40 unmodified lines
4141 #include <asm/timer.h>
4242 #include <asm/special_insns.h>
4343
44−/* nop stub */
45−void _paravirt_nop(void)
46−{
47−}
44+/*
45+ * nop stub, which must not clobber anything *including the stack* to
46+ * avoid confusing the entry prologues.
47+ */
48+extern void _paravirt_nop(void);
49+asm (".pushsection .entry.text, \"ax\"\n"
50+ ".global _paravirt_nop\n"
51+ "_paravirt_nop:\n\t"
52+ "ret\n\t"
53+ ".size _paravirt_nop, . - _paravirt_nop\n\t"
54+ ".type _paravirt_nop, @function\n\t"
55+ ".popsection");
4856
4957 /* identity function, which can be inlined */
5058 u32 _paravirt_ident_32(u32 x)
arch/x86/kernel/process.c+55−0
@@ -506,3 +506,58 @@ unsigned long arch_randomize_brk(struct mm_struct *mm) · 505 unmodified lines
506506 return randomize_range(mm->brk, range_end, 0) ? : mm->brk;
507507 }
508508
509+/*
510+ * Called from fs/proc with a reference on @p to find the function
511+ * which called into schedule(). This needs to be done carefully
512+ * because the task might wake up and we might look at a stack
513+ * changing under us.
514+ */
515+unsigned long get_wchan(struct task_struct *p)
516+{
517+ unsigned long start, bottom, top, sp, fp, ip;
518+ int count = 0;
519+
520+ if (!p || p == current || p->state == TASK_RUNNING)
521+ return 0;
522+
523+ start = (unsigned long)task_stack_page(p);
524+ if (!start)
525+ return 0;
526+
527+ /*
528+ * Layout of the stack page:
529+ *
530+ * ----------- topmax = start + THREAD_SIZE - sizeof(unsigned long)
531+ * PADDING
532+ * ----------- top = topmax - TOP_OF_KERNEL_STACK_PADDING
533+ * stack
534+ * ----------- bottom = start + sizeof(thread_info)
535+ * thread_info
536+ * ----------- start
537+ *
538+ * The tasks stack pointer points at the location where the
539+ * framepointer is stored. The data on the stack is:
540+ * ... IP FP ... IP FP
541+ *
542+ * We need to read FP and IP, so we need to adjust the upper
543+ * bound by another unsigned long.
544+ */
545+ top = start + THREAD_SIZE - TOP_OF_KERNEL_STACK_PADDING;
546+ top -= 2 * sizeof(unsigned long);
547+ bottom = start + sizeof(struct thread_info);
548+
549+ sp = READ_ONCE(p->thread.sp);
550+ if (sp < bottom || sp > top)
551+ return 0;
552+
553+ fp = READ_ONCE(*(unsigned long *)sp);
554+ do {
555+ if (fp < bottom || fp > top)
556+ return 0;
557+ ip = READ_ONCE(*(unsigned long *)(fp + sizeof(unsigned long)));
558+ if (!in_sched_functions(ip))
559+ return ip;
560+ fp = READ_ONCE(*(unsigned long *)fp);
561+ } while (count++ < 16 && p->state != TASK_RUNNING);
562+ return 0;
563+}
arch/x86/kernel/process_32.c+0−28
@@ -324,31 +324,3 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p) · 323 unmodified lines
324324
325325 return prev_p;
326326 }
327−
328−#define top_esp (THREAD_SIZE - sizeof(unsigned long))
329−#define top_ebp (THREAD_SIZE - 2*sizeof(unsigned long))
330−
331−unsigned long get_wchan(struct task_struct *p)
332−{
333− unsigned long bp, sp, ip;
334− unsigned long stack_page;
335− int count = 0;
336− if (!p || p == current || p->state == TASK_RUNNING)
337− return 0;
338− stack_page = (unsigned long)task_stack_page(p);
339− sp = p->thread.sp;
340− if (!stack_page || sp < stack_page || sp > top_esp+stack_page)
341− return 0;
342− /* include/asm-i386/system.h:switch_to() pushes bp last. */
343− bp = *(unsigned long *) sp;
344− do {
345− if (bp < stack_page || bp > top_ebp+stack_page)
346− return 0;
347− ip = *(unsigned long *) (bp+4);
348− if (!in_sched_functions(ip))
349− return ip;
350− bp = *(unsigned long *) bp;
351− } while (count++ < 16);
352− return 0;
353−}
354−
arch/x86/kernel/process_64.c+0−24
@@ -499,30 +499,6 @@ void set_personality_ia32(bool x32) · 498 unmodified lines
499499 }
500500 EXPORT_SYMBOL_GPL(set_personality_ia32);
501501
502−unsigned long get_wchan(struct task_struct *p)
503−{
504− unsigned long stack;
505− u64 fp, ip;
506− int count = 0;
507−
508− if (!p || p == current || p->state == TASK_RUNNING)
509− return 0;
510− stack = (unsigned long)task_stack_page(p);
511− if (p->thread.sp < stack || p->thread.sp >= stack+THREAD_SIZE)
512− return 0;
513− fp = *(u64 *)(p->thread.sp);
514− do {
515− if (fp < (unsigned long)stack ||
516− fp >= (unsigned long)stack+THREAD_SIZE)
517− return 0;
518− ip = *(u64 *)(fp+8);
519− if (!in_sched_functions(ip))
520− return ip;
521− fp = *(u64 *)fp;
522− } while (count++ < 16);
523− return 0;
524−}
525−
526502 long do_arch_prctl(struct task_struct *task, int code, unsigned long addr)
527503 {
528504 int ret = 0;
arch/x86/kvm/mmu.c+18−7
@@ -3322,7 +3322,7 @@ walk_shadow_page_get_mmio_spte(struct kvm_vcpu *vcpu, u64 addr, u64 *sptep) · 3321 unmodified lines
33223322 break;
33233323
33243324 reserved |= is_shadow_zero_bits_set(&vcpu->arch.mmu, spte,
3325− leaf);
3325+ iterator.level);
33263326 }
33273327
33283328 walk_shadow_page_lockless_end(vcpu);
@@ -3614,7 +3614,7 @@ static void · 285 unmodified lines
36143614 __reset_rsvds_bits_mask(struct kvm_vcpu *vcpu,
36153615 struct rsvd_bits_validate *rsvd_check,
36163616 int maxphyaddr, int level, bool nx, bool gbpages,
3617− bool pse)
3617+ bool pse, bool amd)
36183618 {
36193619 u64 exb_bit_rsvd = 0;
36203620 u64 gbpages_bit_rsvd = 0;
@@ -3631,7 +3631,7 @@ __reset_rsvds_bits_mask(struct kvm_vcpu *vcpu, · 10 unmodified lines
36313631 * Non-leaf PML4Es and PDPEs reserve bit 8 (which would be the G bit for
36323632 * leaf entries) on AMD CPUs only.
36333633 */
3634− if (guest_cpuid_is_amd(vcpu))
3634+ if (amd)
36353635 nonleaf_bit8_rsvd = rsvd_bits(8, 8);
36363636
36373637 switch (level) {
@@ -3699,7 +3699,7 @@ static void reset_rsvds_bits_mask(struct kvm_vcpu *vcpu, · 61 unmodified lines
36993699 __reset_rsvds_bits_mask(vcpu, &context->guest_rsvd_check,
37003700 cpuid_maxphyaddr(vcpu), context->root_level,
37013701 context->nx, guest_cpuid_has_gbpages(vcpu),
3702− is_pse(vcpu));
3702+ is_pse(vcpu), guest_cpuid_is_amd(vcpu));
37033703 }
37043704
37053705 static void
@@ -3749,13 +3749,24 @@ static void reset_rsvds_bits_mask_ept(struct kvm_vcpu *vcpu, · 43 unmodified lines
37493749 void
37503750 reset_shadow_zero_bits_mask(struct kvm_vcpu *vcpu, struct kvm_mmu *context)
37513751 {
3752+ /*
3753+ * Passing "true" to the last argument is okay; it adds a check
3754+ * on bit 8 of the SPTEs which KVM doesn't use anyway.
3755+ */
37523756 __reset_rsvds_bits_mask(vcpu, &context->shadow_zero_check,
37533757 boot_cpu_data.x86_phys_bits,
37543758 context->shadow_root_level, context->nx,
3755− guest_cpuid_has_gbpages(vcpu), is_pse(vcpu));
3759+ guest_cpuid_has_gbpages(vcpu), is_pse(vcpu),
3760+ true);
37563761 }
37573762 EXPORT_SYMBOL_GPL(reset_shadow_zero_bits_mask);
37583763
3764+static inline bool boot_cpu_is_amd(void)
3765+{
3766+ WARN_ON_ONCE(!tdp_enabled);
3767+ return shadow_x_mask == 0;
3768+}
3769+
37593770 /*
37603771 * the direct page table on host, use as much mmu features as
37613772 * possible, however, kvm currently does not do execution-protection.
@@ -3764,11 +3775,11 @@ static void · 2 unmodified lines
37643775 reset_tdp_shadow_zero_bits_mask(struct kvm_vcpu *vcpu,
37653776 struct kvm_mmu *context)
37663777 {
3767− if (guest_cpuid_is_amd(vcpu))
3778+ if (boot_cpu_is_amd())
37683779 __reset_rsvds_bits_mask(vcpu, &context->shadow_zero_check,
37693780 boot_cpu_data.x86_phys_bits,
37703781 context->shadow_root_level, false,
3771− cpu_has_gbpages, true);
3782+ cpu_has_gbpages, true, true);
37723783 else
37733784 __reset_rsvds_bits_mask_ept(&context->shadow_zero_check,
37743785 boot_cpu_data.x86_phys_bits,
arch/x86/kvm/svm.c+16−113
@@ -202,6 +202,7 @@ module_param(npt, int, S_IRUGO); · 201 unmodified lines
202202 static int nested = true;
203203 module_param(nested, int, S_IRUGO);
204204
205+static void svm_set_cr0(struct kvm_vcpu *vcpu, unsigned long cr0);
205206 static void svm_flush_tlb(struct kvm_vcpu *vcpu);
206207 static void svm_complete_interrupts(struct vcpu_svm *svm);
207208
@@ -513,7 +514,7 @@ static void skip_emulated_instruction(struct kvm_vcpu *vcpu) · 305 unmodified lines
513514 struct vcpu_svm *svm = to_svm(vcpu);
514515
515516 if (svm->vmcb->control.next_rip != 0) {
516− WARN_ON(!static_cpu_has(X86_FEATURE_NRIPS));
517+ WARN_ON_ONCE(!static_cpu_has(X86_FEATURE_NRIPS));
517518 svm->next_rip = svm->vmcb->control.next_rip;
518519 }
519520
@@ -865,64 +866,6 @@ static void svm_disable_lbrv(struct vcpu_svm *svm) · 345 unmodified lines
865866 set_msr_interception(msrpm, MSR_IA32_LASTINTTOIP, 0, 0);
866867 }
867868
868−#define MTRR_TYPE_UC_MINUS 7
869−#define MTRR2PROTVAL_INVALID 0xff
870−
871−static u8 mtrr2protval[8];
872−
873−static u8 fallback_mtrr_type(int mtrr)
874−{
875− /*
876− * WT and WP aren't always available in the host PAT. Treat
877− * them as UC and UC- respectively. Everything else should be
878− * there.
879− */
880− switch (mtrr)
881− {
882− case MTRR_TYPE_WRTHROUGH:
883− return MTRR_TYPE_UNCACHABLE;
884− case MTRR_TYPE_WRPROT:
885− return MTRR_TYPE_UC_MINUS;
886− default:
887− BUG();
888− }
889−}
890−
891−static void build_mtrr2protval(void)
892−{
893− int i;
894− u64 pat;
895−
896− for (i = 0; i < 8; i++)
897− mtrr2protval[i] = MTRR2PROTVAL_INVALID;
898−
899− /* Ignore the invalid MTRR types. */
900− mtrr2protval[2] = 0;
901− mtrr2protval[3] = 0;
902−
903− /*
904− * Use host PAT value to figure out the mapping from guest MTRR
905− * values to nested page table PAT/PCD/PWT values. We do not
906− * want to change the host PAT value every time we enter the
907− * guest.
908− */
909− rdmsrl(MSR_IA32_CR_PAT, pat);
910− for (i = 0; i < 8; i++) {
911− u8 mtrr = pat >> (8 * i);
912−
913− if (mtrr2protval[mtrr] == MTRR2PROTVAL_INVALID)
914− mtrr2protval[mtrr] = __cm_idx2pte(i);
915− }
916−
917− for (i = 0; i < 8; i++) {
918− if (mtrr2protval[i] == MTRR2PROTVAL_INVALID) {
919− u8 fallback = fallback_mtrr_type(i);
920− mtrr2protval[i] = mtrr2protval[fallback];
921− BUG_ON(mtrr2protval[i] == MTRR2PROTVAL_INVALID);
922− }
923− }
924−}
925−
926869 static __init int svm_hardware_setup(void)
927870 {
928871 int cpu;
@@ -989,7 +932,6 @@ static __init int svm_hardware_setup(void) · 60 unmodified lines
989932 } else
990933 kvm_disable_tdp();
991934
992− build_mtrr2protval();
993935 return 0;
994936
995937 err:
@@ -1144,43 +1086,6 @@ static u64 svm_compute_tsc_offset(struct kvm_vcpu *vcpu, u64 target_tsc) · 148 unmodified lines
11441086 return target_tsc - tsc;
11451087 }
11461088
1147−static void svm_set_guest_pat(struct vcpu_svm *svm, u64 *g_pat)
1148−{
1149− struct kvm_vcpu *vcpu = &svm->vcpu;
1150−
1151− /* Unlike Intel, AMD takes the guest's CR0.CD into account.
1152− *
1153− * AMD does not have IPAT. To emulate it for the case of guests
1154− * with no assigned devices, just set everything to WB. If guests
1155− * have assigned devices, however, we cannot force WB for RAM
1156− * pages only, so use the guest PAT directly.
1157− */
1158− if (!kvm_arch_has_assigned_device(vcpu->kvm))
1159− *g_pat = 0x0606060606060606;
1160− else
1161− *g_pat = vcpu->arch.pat;
1162−}
1163−
1164−static u64 svm_get_mt_mask(struct kvm_vcpu *vcpu, gfn_t gfn, bool is_mmio)
1165−{
1166− u8 mtrr;
1167−
1168− /*
1169− * 1. MMIO: trust guest MTRR, so same as item 3.
1170− * 2. No passthrough: always map as WB, and force guest PAT to WB as well
1171− * 3. Passthrough: can't guarantee the result, try to trust guest.
1172− */
1173− if (!is_mmio && !kvm_arch_has_assigned_device(vcpu->kvm))
1174− return 0;
1175−
1176− if (!kvm_check_has_quirk(vcpu->kvm, KVM_X86_QUIRK_CD_NW_CLEARED) &&
1177− kvm_read_cr0(vcpu) & X86_CR0_CD)
1178− return _PAGE_NOCACHE;
1179−
1180− mtrr = kvm_mtrr_get_guest_memory_type(vcpu, gfn);
1181− return mtrr2protval[mtrr];
1182−}
1183−
11841089 static void init_vmcb(struct vcpu_svm *svm, bool init_event)
11851090 {
11861091 struct vmcb_control_area *control = &svm->vmcb->control;
@@ -1263,7 +1168,8 @@ static void init_vmcb(struct vcpu_svm *svm, bool init_event) · 76 unmodified lines
12631168 * svm_set_cr0() sets PG and WP and clears NW and CD on save->cr0.
12641169 * It also updates the guest-visible cr0 value.
12651170 */
1266− (void)kvm_set_cr0(&svm->vcpu, X86_CR0_NW | X86_CR0_CD | X86_CR0_ET);
1171+ svm_set_cr0(&svm->vcpu, X86_CR0_NW | X86_CR0_CD | X86_CR0_ET);
1172+ kvm_mmu_reset_context(&svm->vcpu);
12671173
12681174 save->cr4 = X86_CR4_PAE;
12691175 /* rdx = ?? */
@@ -1276,7 +1182,6 @@ static void init_vmcb(struct vcpu_svm *svm, bool init_event) · 6 unmodified lines
12761182 clr_cr_intercept(svm, INTERCEPT_CR3_READ);
12771183 clr_cr_intercept(svm, INTERCEPT_CR3_WRITE);
12781184 save->g_pat = svm->vcpu.arch.pat;
1279− svm_set_guest_pat(svm, &save->g_pat);
12801185 save->cr3 = 0;
12811186 save->cr4 = 0;
12821187 }
@@ -1671,10 +1576,13 @@ static void svm_set_cr0(struct kvm_vcpu *vcpu, unsigned long cr0) · 388 unmodified lines
16711576
16721577 if (!vcpu->fpu_active)
16731578 cr0 |= X86_CR0_TS;
1674−
1675− /* These are emulated via page tables. */
1676− cr0 &= ~(X86_CR0_CD | X86_CR0_NW);
1677−
1579+ /*
1580+ * re-enable caching here because the QEMU bios
1581+ * does not do it - this results in some delay at
1582+ * reboot
1583+ */
1584+ if (kvm_check_has_quirk(vcpu->kvm, KVM_X86_QUIRK_CD_NW_CLEARED))
1585+ cr0 &= ~(X86_CR0_CD | X86_CR0_NW);
16781586 svm->vmcb->save.cr0 = cr0;
16791587 mark_dirty(svm->vmcb, VMCB_CR);
16801588 update_cr0_intercept(svm);
@@ -3349,16 +3257,6 @@ static int svm_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr) · 1668 unmodified lines
33493257 case MSR_VM_IGNNE:
33503258 vcpu_unimpl(vcpu, "unimplemented wrmsr: 0x%x data 0x%llx\n", ecx, data);
33513259 break;
3352− case MSR_IA32_CR_PAT:
3353− if (npt_enabled) {
3354− if (!kvm_mtrr_valid(vcpu, MSR_IA32_CR_PAT, data))
3355− return 1;
3356− vcpu->arch.pat = data;
3357− svm_set_guest_pat(svm, &svm->vmcb->save.g_pat);
3358− mark_dirty(svm->vmcb, VMCB_NPT);
3359− break;
3360− }
3361− /* fall through */
33623260 default:
33633261 return kvm_set_msr_common(vcpu, msr);
33643262 }
@@ -4193,6 +4091,11 @@ static bool svm_has_high_real_mode_segbase(void) · 828 unmodified lines
41934091 return true;
41944092 }
41954093
4094+static u64 svm_get_mt_mask(struct kvm_vcpu *vcpu, gfn_t gfn, bool is_mmio)
4095+{
4096+ return 0;
4097+}
4098+
41964099 static void svm_cpuid_update(struct kvm_vcpu *vcpu)
41974100 {
41984101 }
arch/x86/kvm/vmx.c+8−3
@@ -8617,17 +8617,22 @@ static u64 vmx_get_mt_mask(struct kvm_vcpu *vcpu, gfn_t gfn, bool is_mmio) · 8616 unmodified lines
86178617 u64 ipat = 0;
86188618
86198619 /* For VT-d and EPT combination
8620− * 1. MMIO: guest may want to apply WC, trust it.
8620+ * 1. MMIO: always map as UC
86218621 * 2. EPT with VT-d:
86228622 * a. VT-d without snooping control feature: can't guarantee the
8623− * result, try to trust guest. So the same as item 1.
8623+ * result, try to trust guest.
86248624 * b. VT-d with snooping control feature: snooping control feature of
86258625 * VT-d engine can guarantee the cache correctness. Just set it
86268626 * to WB to keep consistent with host. So the same as item 3.
86278627 * 3. EPT without VT-d: always map as WB and set IPAT=1 to keep
86288628 * consistent with host MTRR
86298629 */
8630− if (!is_mmio && !kvm_arch_has_noncoherent_dma(vcpu->kvm)) {
8630+ if (is_mmio) {
8631+ cache = MTRR_TYPE_UNCACHABLE;
8632+ goto exit;
8633+ }
8634+
8635+ if (!kvm_arch_has_noncoherent_dma(vcpu->kvm)) {
86318636 ipat = VMX_EPT_IPAT_BIT;
86328637 cache = MTRR_TYPE_WRBACK;
86338638 goto exit;
arch/x86/kvm/x86.c+2−4
@@ -1708,8 +1708,6 @@ static int kvm_guest_time_update(struct kvm_vcpu *v) · 1707 unmodified lines
17081708 vcpu->pvclock_set_guest_stopped_request = false;
17091709 }
17101710
1711− pvclock_flags |= PVCLOCK_COUNTS_FROM_ZERO;
1712−
17131711 /* If the host uses TSC clocksource, then it is stable */
17141712 if (use_master_clock)
17151713 pvclock_flags |= PVCLOCK_TSC_STABLE_BIT;
@@ -2007,8 +2005,6 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info) · 291 unmodified lines
20072005 &vcpu->requests);
20082006
20092007 ka->boot_vcpu_runs_old_kvmclock = tmp;
2010−
2011− ka->kvmclock_offset = -get_kernel_ns();
20122008 }
20132009
20142010 vcpu->arch.time = data;
@@ -2190,6 +2186,8 @@ int kvm_get_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info) · 175 unmodified lines
21902186 case MSR_IA32_LASTINTFROMIP:
21912187 case MSR_IA32_LASTINTTOIP:
21922188 case MSR_K8_SYSCFG:
2189+ case MSR_K8_TSEG_ADDR:
2190+ case MSR_K8_TSEG_MASK:
21932191 case MSR_K7_HWCR:
21942192 case MSR_VM_HSAVE_PA:
21952193 case MSR_K8_INT_PENDING_MSG:
arch/x86/mm/init_64.c+1−1
@@ -1132,7 +1132,7 @@ void mark_rodata_ro(void) · 1131 unmodified lines
11321132 * has been zapped already via cleanup_highmem().
11331133 */
11341134 all_end = roundup((unsigned long)_brk_end, PMD_SIZE);
1135− set_memory_nx(rodata_start, (all_end - rodata_start) >> PAGE_SHIFT);
1135+ set_memory_nx(text_end, (all_end - text_end) >> PAGE_SHIFT);
11361136
11371137 rodata_test();
11381138
arch/x86/pci/common.c+1−0
@@ -166,6 +166,7 @@ void pcibios_fixup_bus(struct pci_bus *b) · 165 unmodified lines
166166 {
167167 struct pci_dev *dev;
168168
169+ pci_read_bridge_bases(b);
169170 list_for_each_entry(dev, &b->devices, bus_list)
170171 pcibios_fixup_device_resources(dev);
171172 }
arch/x86/platform/efi/efi.c+66−1
@@ -704,6 +704,70 @@ out: · 703 unmodified lines
704704 return ret;
705705 }
706706
707+/*
708+ * Iterate the EFI memory map in reverse order because the regions
709+ * will be mapped top-down. The end result is the same as if we had
710+ * mapped things forward, but doesn't require us to change the
711+ * existing implementation of efi_map_region().
712+ */
713+static inline void *efi_map_next_entry_reverse(void *entry)
714+{
715+ /* Initial call */
716+ if (!entry)
717+ return memmap.map_end - memmap.desc_size;
718+
719+ entry -= memmap.desc_size;
720+ if (entry < memmap.map)
721+ return NULL;
722+
723+ return entry;
724+}
725+
726+/*
727+ * efi_map_next_entry - Return the next EFI memory map descriptor
728+ * @entry: Previous EFI memory map descriptor
729+ *
730+ * This is a helper function to iterate over the EFI memory map, which
731+ * we do in different orders depending on the current configuration.
732+ *
733+ * To begin traversing the memory map @entry must be %NULL.
734+ *
735+ * Returns %NULL when we reach the end of the memory map.
736+ */
737+static void *efi_map_next_entry(void *entry)
738+{
739+ if (!efi_enabled(EFI_OLD_MEMMAP) && efi_enabled(EFI_64BIT)) {
740+ /*
741+ * Starting in UEFI v2.5 the EFI_PROPERTIES_TABLE
742+ * config table feature requires us to map all entries
743+ * in the same order as they appear in the EFI memory
744+ * map. That is to say, entry N must have a lower
745+ * virtual address than entry N+1. This is because the
746+ * firmware toolchain leaves relative references in
747+ * the code/data sections, which are split and become
748+ * separate EFI memory regions. Mapping things
749+ * out-of-order leads to the firmware accessing
750+ * unmapped addresses.
751+ *
752+ * Since we need to map things this way whether or not
753+ * the kernel actually makes use of
754+ * EFI_PROPERTIES_TABLE, let's just switch to this
755+ * scheme by default for 64-bit.
756+ */
757+ return efi_map_next_entry_reverse(entry);
758+ }
759+
760+ /* Initial call */
761+ if (!entry)
762+ return memmap.map;
763+
764+ entry += memmap.desc_size;
765+ if (entry >= memmap.map_end)
766+ return NULL;
767+
768+ return entry;
769+}
770+
707771 /*
708772 * Map the efi memory ranges of the runtime services and update new_mmap with
709773 * virtual addresses.
@@ -714,7 +778,8 @@ static void * __init efi_map_regions(int *count, int *pg_shift) · 4 unmodified lines
714778 unsigned long left = 0;
715779 efi_memory_desc_t *md;
716780
717− for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) {
781+ p = NULL;
782+ while ((p = efi_map_next_entry(p))) {
718783 md = p;
719784 if (!(md->attribute & EFI_MEMORY_RUNTIME)) {
720785 #ifdef CONFIG_X86_64
arch/xtensa/include/asm/Kbuild+1−0
@@ -28,4 +28,5 @@ generic-y += statfs.h · 27 unmodified lines
2828 generic-y += termios.h
2929 generic-y += topology.h
3030 generic-y += trace_clock.h
31+generic-y += word-at-a-time.h
3132 generic-y += xor.h
arch/xtensa/kernel/pci.c+4−0
@@ -210,6 +210,10 @@ subsys_initcall(pcibios_init); · 209 unmodified lines
210210
211211 void pcibios_fixup_bus(struct pci_bus *bus)
212212 {
213+ if (bus->parent) {
214+ /* This is a subordinate bridge */
215+ pci_read_bridge_bases(bus);
216+ }
213217 }
214218
215219 void pcibios_set_master(struct pci_dev *dev)
block/blk-mq-cpumap.c+5−4
@@ -31,7 +31,8 @@ static int get_first_sibling(unsigned int cpu) · 30 unmodified lines
3131 return cpu;
3232 }
3333
34−int blk_mq_update_queue_map(unsigned int *map, unsigned int nr_queues)
34+int blk_mq_update_queue_map(unsigned int *map, unsigned int nr_queues,
35+ const struct cpumask *online_mask)
3536 {
3637 unsigned int i, nr_cpus, nr_uniq_cpus, queue, first_sibling;
3738 cpumask_var_t cpus;
@@ -41,7 +42,7 @@ int blk_mq_update_queue_map(unsigned int *map, unsigned int nr_queues) · 3 unmodified lines
4142
4243 cpumask_clear(cpus);
4344 nr_cpus = nr_uniq_cpus = 0;
44− for_each_online_cpu(i) {
45+ for_each_cpu(i, online_mask) {
4546 nr_cpus++;
4647 first_sibling = get_first_sibling(i);
4748 if (!cpumask_test_cpu(first_sibling, cpus))
@@ -51,7 +52,7 @@ int blk_mq_update_queue_map(unsigned int *map, unsigned int nr_queues) · 3 unmodified lines
5152
5253 queue = 0;
5354 for_each_possible_cpu(i) {
54− if (!cpu_online(i)) {
55+ if (!cpumask_test_cpu(i, online_mask)) {
5556 map[i] = 0;
5657 continue;
5758 }
@@ -95,7 +96,7 @@ unsigned int *blk_mq_make_queue_map(struct blk_mq_tag_set *set) · 37 unmodified lines
9596 if (!map)
9697 return NULL;
9798
98− if (!blk_mq_update_queue_map(map, set->nr_hw_queues))
99+ if (!blk_mq_update_queue_map(map, set->nr_hw_queues, cpu_online_mask))
99100 return map;
100101
101102 kfree(map);
block/blk-mq-sysfs.c+22−12
@@ -229,8 +229,6 @@ static ssize_t blk_mq_hw_sysfs_cpus_show(struct blk_mq_hw_ctx *hctx, char *page) · 228 unmodified lines
229229 unsigned int i, first = 1;
230230 ssize_t ret = 0;
231231
232− blk_mq_disable_hotplug();
233−
234232 for_each_cpu(i, hctx->cpumask) {
235233 if (first)
236234 ret += sprintf(ret + page, "%u", i);
@@ -240,8 +238,6 @@ static ssize_t blk_mq_hw_sysfs_cpus_show(struct blk_mq_hw_ctx *hctx, char *page) · 3 unmodified lines
240238 first = 0;
241239 }
242240
243− blk_mq_enable_hotplug();
244−
245241 ret += sprintf(ret + page, "\n");
246242 return ret;
247243 }
@@ -343,7 +339,7 @@ static void blk_mq_unregister_hctx(struct blk_mq_hw_ctx *hctx) · 95 unmodified lines
343339 struct blk_mq_ctx *ctx;
344340 int i;
345341
346− if (!hctx->nr_ctx || !(hctx->flags & BLK_MQ_F_SYSFS_UP))
342+ if (!hctx->nr_ctx)
347343 return;
348344
349345 hctx_for_each_ctx(hctx, ctx, i)
@@ -358,7 +354,7 @@ static int blk_mq_register_hctx(struct blk_mq_hw_ctx *hctx) · 8 unmodified lines
358354 struct blk_mq_ctx *ctx;
359355 int i, ret;
360356
361− if (!hctx->nr_ctx || !(hctx->flags & BLK_MQ_F_SYSFS_UP))
357+ if (!hctx->nr_ctx)
362358 return 0;
363359
364360 ret = kobject_add(&hctx->kobj, &q->mq_kobj, "%u", hctx->queue_num);
@@ -381,6 +377,8 @@ void blk_mq_unregister_disk(struct gendisk *disk) · 16 unmodified lines
381377 struct blk_mq_ctx *ctx;
382378 int i, j;
383379
380+ blk_mq_disable_hotplug();
381+
384382 queue_for_each_hw_ctx(q, hctx, i) {
385383 blk_mq_unregister_hctx(hctx);
386384
@@ -395,6 +393,9 @@ void blk_mq_unregister_disk(struct gendisk *disk) · 8 unmodified lines
395393 kobject_put(&q->mq_kobj);
396394
397395 kobject_put(&disk_to_dev(disk)->kobj);
396+
397+ q->mq_sysfs_init_done = false;
398+ blk_mq_enable_hotplug();
398399 }
399400
400401 static void blk_mq_sysfs_init(struct request_queue *q)
@@ -425,27 +426,30 @@ int blk_mq_register_disk(struct gendisk *disk) · 24 unmodified lines
425426 struct blk_mq_hw_ctx *hctx;
426427 int ret, i;
427428
429+ blk_mq_disable_hotplug();
430+
428431 blk_mq_sysfs_init(q);
429432
430433 ret = kobject_add(&q->mq_kobj, kobject_get(&dev->kobj), "%s", "mq");
431434 if (ret < 0)
432− return ret;
435+ goto out;
433436
434437 kobject_uevent(&q->mq_kobj, KOBJ_ADD);
435438
436439 queue_for_each_hw_ctx(q, hctx, i) {
437− hctx->flags |= BLK_MQ_F_SYSFS_UP;
438440 ret = blk_mq_register_hctx(hctx);
439441 if (ret)
440442 break;
441443 }
442444
443− if (ret) {
445+ if (ret)
444446 blk_mq_unregister_disk(disk);
445− return ret;
446− }
447+ else
448+ q->mq_sysfs_init_done = true;
449+out:
450+ blk_mq_enable_hotplug();
447451
448− return 0;
452+ return ret;
449453 }
450454 EXPORT_SYMBOL_GPL(blk_mq_register_disk);
451455
@@ -454,6 +458,9 @@ void blk_mq_sysfs_unregister(struct request_queue *q) · 2 unmodified lines
454458 struct blk_mq_hw_ctx *hctx;
455459 int i;
456460
461+ if (!q->mq_sysfs_init_done)
462+ return;
463+
457464 queue_for_each_hw_ctx(q, hctx, i)
458465 blk_mq_unregister_hctx(hctx);
459466 }
@@ -463,6 +470,9 @@ int blk_mq_sysfs_register(struct request_queue *q) · 3 unmodified lines
463470 struct blk_mq_hw_ctx *hctx;
464471 int i, ret = 0;
465472
473+ if (!q->mq_sysfs_init_done)
474+ return ret;
475+
466476 queue_for_each_hw_ctx(q, hctx, i) {
467477 ret = blk_mq_register_hctx(hctx);
468478 if (ret)
block/blk-mq-tag.c+20−7
@@ -471,17 +471,30 @@ void blk_mq_all_tag_busy_iter(struct blk_mq_tags *tags, busy_tag_iter_fn *fn, · 470 unmodified lines
471471 }
472472 EXPORT_SYMBOL(blk_mq_all_tag_busy_iter);
473473
474−void blk_mq_tag_busy_iter(struct blk_mq_hw_ctx *hctx, busy_iter_fn *fn,
474+void blk_mq_queue_tag_busy_iter(struct request_queue *q, busy_iter_fn *fn,
475475 void *priv)
476476 {
477− struct blk_mq_tags *tags = hctx->tags;
477+ struct blk_mq_hw_ctx *hctx;
478+ int i;
479+
480+
481+ queue_for_each_hw_ctx(q, hctx, i) {
482+ struct blk_mq_tags *tags = hctx->tags;
483+
484+ /*
485+ * If not software queues are currently mapped to this
486+ * hardware queue, there's nothing to check
487+ */
488+ if (!blk_mq_hw_queue_mapped(hctx))
489+ continue;
490+
491+ if (tags->nr_reserved_tags)
492+ bt_for_each(hctx, &tags->breserved_tags, 0, fn, priv, true);
493+ bt_for_each(hctx, &tags->bitmap_tags, tags->nr_reserved_tags, fn, priv,
494+ false);
495+ }
478496
479− if (tags->nr_reserved_tags)
480− bt_for_each(hctx, &tags->breserved_tags, 0, fn, priv, true);
481− bt_for_each(hctx, &tags->bitmap_tags, tags->nr_reserved_tags, fn, priv,
482− false);
483497 }
484−EXPORT_SYMBOL(blk_mq_tag_busy_iter);
485498
486499 static unsigned int bt_unused_tags(struct blk_mq_bitmap_tags *bt)
487500 {
block/blk-mq-tag.h+2−0
@@ -58,6 +58,8 @@ extern ssize_t blk_mq_tag_sysfs_show(struct blk_mq_tags *tags, char *page); · 57 unmodified lines
5858 extern void blk_mq_tag_init_last_tag(struct blk_mq_tags *tags, unsigned int *last_tag);
5959 extern int blk_mq_tag_update_depth(struct blk_mq_tags *tags, unsigned int depth);
6060 extern void blk_mq_tag_wakeup_all(struct blk_mq_tags *tags, bool);
61+void blk_mq_queue_tag_busy_iter(struct request_queue *q, busy_iter_fn *fn,
62+ void *priv);
6163
6264 enum {
6365 BLK_MQ_TAG_CACHE_MIN = 1,
block/blk-mq.c+77−41
@@ -394,14 +394,16 @@ void __blk_mq_complete_request(struct request *rq) · 393 unmodified lines
394394 * Ends all I/O on a request. It does not handle partial completions.
395395 * The actual completion happens out-of-order, through a IPI handler.
396396 **/
397−void blk_mq_complete_request(struct request *rq)
397+void blk_mq_complete_request(struct request *rq, int error)
398398 {
399399 struct request_queue *q = rq->q;
400400
401401 if (unlikely(blk_should_fake_timeout(q)))
402402 return;
403− if (!blk_mark_rq_complete(rq))
403+ if (!blk_mark_rq_complete(rq)) {
404+ rq->errors = error;
404405 __blk_mq_complete_request(rq);
406+ }
405407 }
406408 EXPORT_SYMBOL(blk_mq_complete_request);
407409
@@ -617,10 +619,8 @@ static void blk_mq_check_expired(struct blk_mq_hw_ctx *hctx, · 209 unmodified lines
617619 * If a request wasn't started before the queue was
618620 * marked dying, kill it here or it'll go unnoticed.
619621 */
620− if (unlikely(blk_queue_dying(rq->q))) {
621− rq->errors = -EIO;
622− blk_mq_complete_request(rq);
623− }
622+ if (unlikely(blk_queue_dying(rq->q)))
623+ blk_mq_complete_request(rq, -EIO);
624624 return;
625625 }
626626 if (rq->cmd_flags & REQ_NO_TIMEOUT)
@@ -642,24 +642,16 @@ static void blk_mq_rq_timer(unsigned long priv) · 15 unmodified lines
642642 .next = 0,
643643 .next_set = 0,
644644 };
645− struct blk_mq_hw_ctx *hctx;
646645 int i;
647646
648− queue_for_each_hw_ctx(q, hctx, i) {
649− /*
650− * If not software queues are currently mapped to this
651− * hardware queue, there's nothing to check
652− */
653− if (!blk_mq_hw_queue_mapped(hctx))
654− continue;
655−
656− blk_mq_tag_busy_iter(hctx, blk_mq_check_expired, &data);
657− }
647+ blk_mq_queue_tag_busy_iter(q, blk_mq_check_expired, &data);
658648
659649 if (data.next_set) {
660650 data.next = blk_rq_timeout(round_jiffies_up(data.next));
661651 mod_timer(&q->timeout, data.next);
662652 } else {
653+ struct blk_mq_hw_ctx *hctx;
654+
663655 queue_for_each_hw_ctx(q, hctx, i) {
664656 /* the hctx may be unmapped, so check it here */
665657 if (blk_mq_hw_queue_mapped(hctx))
@@ -1800,13 +1792,19 @@ static void blk_mq_init_cpu_queues(struct request_queue *q, · 1134 unmodified lines
18001792 }
18011793 }
18021794
1803−static void blk_mq_map_swqueue(struct request_queue *q)
1795+static void blk_mq_map_swqueue(struct request_queue *q,
1796+ const struct cpumask *online_mask)
18041797 {
18051798 unsigned int i;
18061799 struct blk_mq_hw_ctx *hctx;
18071800 struct blk_mq_ctx *ctx;
18081801 struct blk_mq_tag_set *set = q->tag_set;
18091802
1803+ /*
1804+ * Avoid others reading imcomplete hctx->cpumask through sysfs
1805+ */
1806+ mutex_lock(&q->sysfs_lock);
1807+
18101808 queue_for_each_hw_ctx(q, hctx, i) {
18111809 cpumask_clear(hctx->cpumask);
18121810 hctx->nr_ctx = 0;
@@ -1817,16 +1815,17 @@ static void blk_mq_map_swqueue(struct request_queue *q) · 4 unmodified lines
18171815 */
18181816 queue_for_each_ctx(q, ctx, i) {
18191817 /* If the cpu isn't online, the cpu is mapped to first hctx */
1820− if (!cpu_online(i))
1818+ if (!cpumask_test_cpu(i, online_mask))
18211819 continue;
18221820
18231821 hctx = q->mq_ops->map_queue(q, i);
18241822 cpumask_set_cpu(i, hctx->cpumask);
1825− cpumask_set_cpu(i, hctx->tags->cpumask);
18261823 ctx->index_hw = hctx->nr_ctx;
18271824 hctx->ctxs[hctx->nr_ctx++] = ctx;
18281825 }
18291826
1827+ mutex_unlock(&q->sysfs_lock);
1828+
18301829 queue_for_each_hw_ctx(q, hctx, i) {
18311830 struct blk_mq_ctxmap *map = &hctx->ctx_map;
18321831
@@ -1862,6 +1861,14 @@ static void blk_mq_map_swqueue(struct request_queue *q) · 29 unmodified lines
18621861 hctx->next_cpu = cpumask_first(hctx->cpumask);
18631862 hctx->next_cpu_batch = BLK_MQ_CPU_WORK_BATCH;
18641863 }
1864+
1865+ queue_for_each_ctx(q, ctx, i) {
1866+ if (!cpumask_test_cpu(i, online_mask))
1867+ continue;
1868+
1869+ hctx = q->mq_ops->map_queue(q, i);
1870+ cpumask_set_cpu(i, hctx->tags->cpumask);
1871+ }
18651872 }
18661873
18671874 static void blk_mq_update_tag_set_depth(struct blk_mq_tag_set *set)
@@ -1929,6 +1936,9 @@ void blk_mq_release(struct request_queue *q) · 61 unmodified lines
19291936 kfree(hctx);
19301937 }
19311938
1939+ kfree(q->mq_map);
1940+ q->mq_map = NULL;
1941+
19321942 kfree(q->queue_hw_ctx);
19331943
19341944 /* ctx kobj stays in queue_ctx */
@@ -2038,13 +2048,15 @@ struct request_queue *blk_mq_init_allocated_queue(struct blk_mq_tag_set *set, · 103 unmodified lines
20382048 if (blk_mq_init_hw_queues(q, set))
20392049 goto err_hctxs;
20402050
2051+ get_online_cpus();
20412052 mutex_lock(&all_q_mutex);
2042− list_add_tail(&q->all_q_node, &all_q_list);
2043− mutex_unlock(&all_q_mutex);
20442053
2054+ list_add_tail(&q->all_q_node, &all_q_list);
20452055 blk_mq_add_queue_tag_set(set, q);
2056+ blk_mq_map_swqueue(q, cpu_online_mask);
20462057
2047− blk_mq_map_swqueue(q);
2058+ mutex_unlock(&all_q_mutex);
2059+ put_online_cpus();
20482060
20492061 return q;
20502062
@@ -2068,30 +2080,27 @@ void blk_mq_free_queue(struct request_queue *q) · 17 unmodified lines
20682080 {
20692081 struct blk_mq_tag_set *set = q->tag_set;
20702082
2083+ mutex_lock(&all_q_mutex);
2084+ list_del_init(&q->all_q_node);
2085+ mutex_unlock(&all_q_mutex);
2086+
20712087 blk_mq_del_queue_tag_set(q);
20722088
20732089 blk_mq_exit_hw_queues(q, set, set->nr_hw_queues);
20742090 blk_mq_free_hw_queues(q, set);
20752091
20762092 percpu_ref_exit(&q->mq_usage_counter);
2077−
2078− kfree(q->mq_map);
2079−
2080− q->mq_map = NULL;
2081−
2082− mutex_lock(&all_q_mutex);
2083− list_del_init(&q->all_q_node);
2084− mutex_unlock(&all_q_mutex);
20852093 }
20862094
20872095 /* Basically redo blk_mq_init_queue with queue frozen */
2088−static void blk_mq_queue_reinit(struct request_queue *q)
2096+static void blk_mq_queue_reinit(struct request_queue *q,
2097+ const struct cpumask *online_mask)
20892098 {
20902099 WARN_ON_ONCE(!atomic_read(&q->mq_freeze_depth));
20912100
20922101 blk_mq_sysfs_unregister(q);
20932102
2094− blk_mq_update_queue_map(q->mq_map, q->nr_hw_queues);
2103+ blk_mq_update_queue_map(q->mq_map, q->nr_hw_queues, online_mask);
20952104
20962105 /*
20972106 * redo blk_mq_init_cpu_queues and blk_mq_init_hw_queues. FIXME: maybe
@@ -2099,7 +2108,7 @@ static void blk_mq_queue_reinit(struct request_queue *q) · 1 unmodified line
20992108 * involves free and re-allocate memory, worthy doing?)
21002109 */
21012110
2102− blk_mq_map_swqueue(q);
2111+ blk_mq_map_swqueue(q, online_mask);
21032112
21042113 blk_mq_sysfs_register(q);
21052114 }
@@ -2108,16 +2117,43 @@ static int blk_mq_queue_reinit_notify(struct notifier_block *nb, · 2 unmodified lines
21082117 unsigned long action, void *hcpu)
21092118 {
21102119 struct request_queue *q;
2120+ int cpu = (unsigned long)hcpu;
2121+ /*
2122+ * New online cpumask which is going to be set in this hotplug event.
2123+ * Declare this cpumasks as global as cpu-hotplug operation is invoked
2124+ * one-by-one and dynamically allocating this could result in a failure.
2125+ */
2126+ static struct cpumask online_new;
21112127
21122128 /*
2113− * Before new mappings are established, hotadded cpu might already
2114− * start handling requests. This doesn't break anything as we map
2115− * offline CPUs to first hardware queue. We will re-init the queue
2116− * below to get optimal settings.
2129+ * Before hotadded cpu starts handling requests, new mappings must
2130+ * be established. Otherwise, these requests in hw queue might
2131+ * never be dispatched.
2132+ *
2133+ * For example, there is a single hw queue (hctx) and two CPU queues
2134+ * (ctx0 for CPU0, and ctx1 for CPU1).
2135+ *
2136+ * Now CPU1 is just onlined and a request is inserted into
2137+ * ctx1->rq_list and set bit0 in pending bitmap as ctx1->index_hw is
2138+ * still zero.
2139+ *
2140+ * And then while running hw queue, flush_busy_ctxs() finds bit0 is
2141+ * set in pending bitmap and tries to retrieve requests in
2142+ * hctx->ctxs[0]->rq_list. But htx->ctxs[0] is a pointer to ctx0,
2143+ * so the request in ctx1->rq_list is ignored.
21172144 */
2118− if (action != CPU_DEAD && action != CPU_DEAD_FROZEN &&
2119− action != CPU_ONLINE && action != CPU_ONLINE_FROZEN)
2145+ switch (action & ~CPU_TASKS_FROZEN) {
2146+ case CPU_DEAD:
2147+ case CPU_UP_CANCELED:
2148+ cpumask_copy(&online_new, cpu_online_mask);
2149+ break;
2150+ case CPU_UP_PREPARE:
2151+ cpumask_copy(&online_new, cpu_online_mask);
2152+ cpumask_set_cpu(cpu, &online_new);
2153+ break;
2154+ default:
21202155 return NOTIFY_OK;
2156+ }
21212157
21222158 mutex_lock(&all_q_mutex);
21232159
@@ -2141,7 +2177,7 @@ static int blk_mq_queue_reinit_notify(struct notifier_block *nb, · 17 unmodified lines
21412177 }
21422178
21432179 list_for_each_entry(q, &all_q_list, all_q_node)
2144− blk_mq_queue_reinit(q);
2180+ blk_mq_queue_reinit(q, &online_new);
21452181
21462182 list_for_each_entry(q, &all_q_list, all_q_node)
21472183 blk_mq_unfreeze_queue(q);
block/blk-mq.h+2−1
@@ -51,7 +51,8 @@ void blk_mq_disable_hotplug(void); · 50 unmodified lines
5151 * CPU -> queue mappings
5252 */
5353 extern unsigned int *blk_mq_make_queue_map(struct blk_mq_tag_set *set);
54−extern int blk_mq_update_queue_map(unsigned int *map, unsigned int nr_queues);
54+extern int blk_mq_update_queue_map(unsigned int *map, unsigned int nr_queues,
55+ const struct cpumask *online_mask);
5556 extern int blk_mq_hw_queue_to_node(unsigned int *map, unsigned int);
5657
5758 /*
crypto/asymmetric_keys/x509_public_key.c+0−4
@@ -332,10 +332,6 @@ static int x509_key_preparse(struct key_preparsed_payload *prep) · 331 unmodified lines
332332 srlen = cert->raw_serial_size;
333333 q = cert->raw_serial;
334334 }
335− if (srlen > 1 && *q == 0) {
336− srlen--;
337− q++;
338− }
339335
340336 ret = -ENOMEM;
341337 desc = kmalloc(sulen + 2 + srlen * 2 + 1, GFP_KERNEL);
drivers/acpi/ec.c+2−0
@@ -1044,8 +1044,10 @@ static int acpi_ec_query(struct acpi_ec *ec, u8 *data) · 1043 unmodified lines
10441044 goto err_exit;
10451045
10461046 mutex_lock(&ec->mutex);
1047+ result = -ENODATA;
10471048 list_for_each_entry(handler, &ec->list, node) {
10481049 if (value == handler->query_bit) {
1050+ result = 0;
10491051 q->handler = acpi_ec_get_query_handler(handler);
10501052 ec_dbg_evt("Query(0x%02x) scheduled",
10511053 q->handler->query_bit);
drivers/acpi/pci_irq.c+1−0
@@ -372,6 +372,7 @@ static int acpi_isa_register_gsi(struct pci_dev *dev) · 371 unmodified lines
372372
373373 /* Interrupt Line values above 0xF are forbidden */
374374 if (dev->irq > 0 && (dev->irq <= 0xF) &&
375+ acpi_isa_irq_available(dev->irq) &&
375376 (acpi_isa_irq_to_gsi(dev->irq, &dev_gsi) == 0)) {
376377 dev_warn(&dev->dev, "PCI INT %c: no GSI - using ISA IRQ %d\n",
377378 pin_name(dev->pin), dev->irq);
drivers/acpi/pci_link.c+14−2
@@ -498,8 +498,7 @@ int __init acpi_irq_penalty_init(void) · 497 unmodified lines
498498 PIRQ_PENALTY_PCI_POSSIBLE;
499499 }
500500 }
501− /* Add a penalty for the SCI */
502− acpi_irq_penalty[acpi_gbl_FADT.sci_interrupt] += PIRQ_PENALTY_PCI_USING;
501+
503502 return 0;
504503 }
505504
@@ -553,6 +552,13 @@ static int acpi_pci_link_allocate(struct acpi_pci_link *link) · 47 unmodified lines
553552 irq = link->irq.possible[i];
554553 }
555554 }
555+ if (acpi_irq_penalty[irq] >= PIRQ_PENALTY_ISA_ALWAYS) {
556+ printk(KERN_ERR PREFIX "No IRQ available for %s [%s]. "
557+ "Try pci=noacpi or acpi=off\n",
558+ acpi_device_name(link->device),
559+ acpi_device_bid(link->device));
560+ return -ENODEV;
561+ }
556562
557563 /* Attempt to enable the link device at this IRQ. */
558564 if (acpi_pci_link_set(link, irq)) {
@@ -821,6 +827,12 @@ void acpi_penalize_isa_irq(int irq, int active) · 262 unmodified lines
821827 }
822828 }
823829
830+bool acpi_isa_irq_available(int irq)
831+{
832+ return irq >= 0 && (irq >= ARRAY_SIZE(acpi_irq_penalty) ||
833+ acpi_irq_penalty[irq] < PIRQ_PENALTY_ISA_ALWAYS);
834+}
835+
824836 /*
825837 * Penalize IRQ used by ACPI SCI. If ACPI SCI pin attributes conflict with
826838 * PCI IRQ attributes, mark ACPI SCI as ISA_ALWAYS so it won't be use for
drivers/atm/he.c+2−5
@@ -1578,9 +1578,7 @@ he_stop(struct he_dev *he_dev) · 1577 unmodified lines
15781578
15791579 kfree(he_dev->rbpl_virt);
15801580 kfree(he_dev->rbpl_table);
1581−
1582− if (he_dev->rbpl_pool)
1583− dma_pool_destroy(he_dev->rbpl_pool);
1581+ dma_pool_destroy(he_dev->rbpl_pool);
15841582
15851583 if (he_dev->rbrq_base)
15861584 dma_free_coherent(&he_dev->pci_dev->dev, CONFIG_RBRQ_SIZE * sizeof(struct he_rbrq),
@@ -1594,8 +1592,7 @@ he_stop(struct he_dev *he_dev) · 7 unmodified lines
15941592 dma_free_coherent(&he_dev->pci_dev->dev, CONFIG_TBRQ_SIZE * sizeof(struct he_tbrq),
15951593 he_dev->tpdrq_base, he_dev->tpdrq_phys);
15961594
1597− if (he_dev->tpd_pool)
1598− dma_pool_destroy(he_dev->tpd_pool);
1595+ dma_pool_destroy(he_dev->tpd_pool);
15991596
16001597 if (he_dev->pci_dev) {
16011598 pci_read_config_word(he_dev->pci_dev, PCI_COMMAND, &command);
drivers/atm/solos-pci.c+10−2
@@ -805,7 +805,12 @@ static void solos_bh(unsigned long card_arg) · 804 unmodified lines
805805 continue;
806806 }
807807
808− skb = alloc_skb(size + 1, GFP_ATOMIC);
808+ /* Use netdev_alloc_skb() because it adds NET_SKB_PAD of
809+ * headroom, and ensures we can route packets back out an
810+ * Ethernet interface (for example) without having to
811+ * reallocate. Adding NET_IP_ALIGN also ensures that both
812+ * PPPoATM and PPPoEoBR2684 packets end up aligned. */
813+ skb = netdev_alloc_skb_ip_align(NULL, size + 1);
809814 if (!skb) {
810815 if (net_ratelimit())
811816 dev_warn(&card->dev->dev, "Failed to allocate sk_buff for RX\n");
@@ -869,7 +874,10 @@ static void solos_bh(unsigned long card_arg) · 57 unmodified lines
869874 /* Allocate RX skbs for any ports which need them */
870875 if (card->using_dma && card->atmdev[port] &&
871876 !card->rx_skb[port]) {
872− struct sk_buff *skb = alloc_skb(RX_DMA_SIZE, GFP_ATOMIC);
877+ /* Unlike the MMIO case (qv) we can't add NET_IP_ALIGN
878+ * here; the FPGA can only DMA to addresses which are
879+ * aligned to 4 bytes. */
880+ struct sk_buff *skb = dev_alloc_skb(RX_DMA_SIZE);
873881 if (skb) {
874882 SKB_CB(skb)->dma_addr =
875883 dma_map_single(&card->dev->dev, skb->data,
drivers/base/cacheinfo.c+8−2
@@ -148,7 +148,11 @@ static void cache_shared_cpu_map_remove(unsigned int cpu) · 147 unmodified lines
148148
149149 if (sibling == cpu) /* skip itself */
150150 continue;
151+
151152 sib_cpu_ci = get_cpu_cacheinfo(sibling);
153+ if (!sib_cpu_ci->info_list)
154+ continue;
155+
152156 sib_leaf = sib_cpu_ci->info_list + index;
153157 cpumask_clear_cpu(cpu, &sib_leaf->shared_cpu_map);
154158 cpumask_clear_cpu(sibling, &this_leaf->shared_cpu_map);
@@ -159,6 +163,9 @@ static void cache_shared_cpu_map_remove(unsigned int cpu) · 4 unmodified lines
159163
160164 static void free_cache_attributes(unsigned int cpu)
161165 {
166+ if (!per_cpu_cacheinfo(cpu))
167+ return;
168+
162169 cache_shared_cpu_map_remove(cpu);
163170
164171 kfree(per_cpu_cacheinfo(cpu));
@@ -514,8 +521,7 @@ static int cacheinfo_cpu_callback(struct notifier_block *nfb, · 349 unmodified lines
514521 break;
515522 case CPU_DEAD:
516523 cache_remove_dev(cpu);
517− if (per_cpu_cacheinfo(cpu))
518− free_cache_attributes(cpu);
524+ free_cache_attributes(cpu);
519525 break;
520526 }
521527 return notifier_from_errno(rc);
drivers/base/power/opp.c+12−5
@@ -892,10 +892,17 @@ static int opp_get_microvolt(struct dev_pm_opp *opp, struct device *dev) · 891 unmodified lines
892892 u32 microvolt[3] = {0};
893893 int count, ret;
894894
895− count = of_property_count_u32_elems(opp->np, "opp-microvolt");
896− if (!count)
895+ /* Missing property isn't a problem, but an invalid entry is */
896+ if (!of_find_property(opp->np, "opp-microvolt", NULL))
897897 return 0;
898898
899+ count = of_property_count_u32_elems(opp->np, "opp-microvolt");
900+ if (count < 0) {
901+ dev_err(dev, "%s: Invalid opp-microvolt property (%d)\n",
902+ __func__, count);
903+ return count;
904+ }
905+
899906 /* There can be one or three elements here */
900907 if (count != 1 && count != 3) {
901908 dev_err(dev, "%s: Invalid number of elements in opp-microvolt property (%d)\n",
@@ -1063,7 +1070,7 @@ EXPORT_SYMBOL_GPL(dev_pm_opp_add); · 161 unmodified lines
10631070 * share a common logic which is isolated here.
10641071 *
10651072 * Return: -EINVAL for bad pointers, -ENOMEM if no memory available for the
1066− * copy operation, returns 0 if no modifcation was done OR modification was
1073+ * copy operation, returns 0 if no modification was done OR modification was
10671074 * successful.
10681075 *
10691076 * Locking: The internal device_opp and opp structures are RCU protected.
@@ -1151,7 +1158,7 @@ unlock: · 81 unmodified lines
11511158 * mutex locking or synchronize_rcu() blocking calls cannot be used.
11521159 *
11531160 * Return: -EINVAL for bad pointers, -ENOMEM if no memory available for the
1154− * copy operation, returns 0 if no modifcation was done OR modification was
1161+ * copy operation, returns 0 if no modification was done OR modification was
11551162 * successful.
11561163 */
11571164 int dev_pm_opp_enable(struct device *dev, unsigned long freq)
@@ -1177,7 +1184,7 @@ EXPORT_SYMBOL_GPL(dev_pm_opp_enable); · 19 unmodified lines
11771184 * mutex locking or synchronize_rcu() blocking calls cannot be used.
11781185 *
11791186 * Return: -EINVAL for bad pointers, -ENOMEM if no memory available for the
1180− * copy operation, returns 0 if no modifcation was done OR modification was
1187+ * copy operation, returns 0 if no modification was done OR modification was
11811188 * successful.
11821189 */
11831190 int dev_pm_opp_disable(struct device *dev, unsigned long freq)
drivers/block/loop.c+5−6
@@ -1486,17 +1486,16 @@ static void loop_handle_cmd(struct loop_cmd *cmd) · 1485 unmodified lines
14861486 {
14871487 const bool write = cmd->rq->cmd_flags & REQ_WRITE;
14881488 struct loop_device *lo = cmd->rq->q->queuedata;
1489− int ret = -EIO;
1489+ int ret = 0;
14901490
1491− if (write && (lo->lo_flags & LO_FLAGS_READ_ONLY))
1491+ if (write && (lo->lo_flags & LO_FLAGS_READ_ONLY)) {
1492+ ret = -EIO;
14921493 goto failed;
1494+ }
14931495
14941496 ret = do_req_filebacked(lo, cmd->rq);
1495−
14961497 failed:
1497− if (ret)
1498− cmd->rq->errors = -EIO;
1499− blk_mq_complete_request(cmd->rq);
1498+ blk_mq_complete_request(cmd->rq, ret ? -EIO : 0);
15001499 }
15011500
15021501 static void loop_queue_write_work(struct work_struct *work)
drivers/block/null_blk.c+1−1
@@ -289,7 +289,7 @@ static inline void null_handle_cmd(struct nullb_cmd *cmd) · 288 unmodified lines
289289 case NULL_IRQ_SOFTIRQ:
290290 switch (queue_mode) {
291291 case NULL_Q_MQ:
292− blk_mq_complete_request(cmd->rq);
292+ blk_mq_complete_request(cmd->rq, cmd->rq->errors);
293293 break;
294294 case NULL_Q_RQ:
295295 blk_complete_request(cmd->rq);
drivers/block/nvme-core.c+24−28
@@ -618,16 +618,15 @@ static void req_completion(struct nvme_queue *nvmeq, void *ctx, · 617 unmodified lines
618618 spin_unlock_irqrestore(req->q->queue_lock, flags);
619619 return;
620620 }
621+
621622 if (req->cmd_type == REQ_TYPE_DRV_PRIV) {
622623 if (cmd_rq->ctx == CMD_CTX_CANCELLED)
623− req->errors = -EINTR;
624− else
625− req->errors = status;
624+ status = -EINTR;
626625 } else {
627− req->errors = nvme_error_status(status);
626+ status = nvme_error_status(status);
628627 }
629− } else
630− req->errors = 0;
628+ }
629+
631630 if (req->cmd_type == REQ_TYPE_DRV_PRIV) {
632631 u32 result = le32_to_cpup(&cqe->result);
633632 req->special = (void *)(uintptr_t)result;
@@ -650,7 +649,7 @@ static void req_completion(struct nvme_queue *nvmeq, void *ctx, · 16 unmodified lines
650649 }
651650 nvme_free_iod(nvmeq->dev, iod);
652651
653− blk_mq_complete_request(req);
652+ blk_mq_complete_request(req, status);
654653 }
655654
656655 /* length is in bytes. gfp flags indicates whether we may sleep. */
@@ -863,8 +862,7 @@ static int nvme_queue_rq(struct blk_mq_hw_ctx *hctx, · 206 unmodified lines
863862 if (ns && ns->ms && !blk_integrity_rq(req)) {
864863 if (!(ns->pi_type && ns->ms == 8) &&
865864 req->cmd_type != REQ_TYPE_DRV_PRIV) {
866− req->errors = -EFAULT;
867− blk_mq_complete_request(req);
865+ blk_mq_complete_request(req, -EFAULT);
868866 return BLK_MQ_RQ_QUEUE_OK;
869867 }
870868 }
@@ -2439,6 +2437,22 @@ static void nvme_scan_namespaces(struct nvme_dev *dev, unsigned nn) · 1568 unmodified lines
24392437 list_sort(NULL, &dev->namespaces, ns_cmp);
24402438 }
24412439
2440+static void nvme_set_irq_hints(struct nvme_dev *dev)
2441+{
2442+ struct nvme_queue *nvmeq;
2443+ int i;
2444+
2445+ for (i = 0; i < dev->online_queues; i++) {
2446+ nvmeq = dev->queues[i];
2447+
2448+ if (!nvmeq->tags || !(*nvmeq->tags))
2449+ continue;
2450+
2451+ irq_set_affinity_hint(dev->entry[nvmeq->cq_vector].vector,
2452+ blk_mq_tags_cpumask(*nvmeq->tags));
2453+ }
2454+}
2455+
24422456 static void nvme_dev_scan(struct work_struct *work)
24432457 {
24442458 struct nvme_dev *dev = container_of(work, struct nvme_dev, scan_work);
@@ -2450,6 +2464,7 @@ static void nvme_dev_scan(struct work_struct *work) · 5 unmodified lines
24502464 return;
24512465 nvme_scan_namespaces(dev, le32_to_cpup(&ctrl->nn));
24522466 kfree(ctrl);
2467+ nvme_set_irq_hints(dev);
24532468 }
24542469
24552470 /*
@@ -2953,22 +2968,6 @@ static const struct file_operations nvme_dev_fops = { · 497 unmodified lines
29532968 .compat_ioctl = nvme_dev_ioctl,
29542969 };
29552970
2956−static void nvme_set_irq_hints(struct nvme_dev *dev)
2957−{
2958− struct nvme_queue *nvmeq;
2959− int i;
2960−
2961− for (i = 0; i < dev->online_queues; i++) {
2962− nvmeq = dev->queues[i];
2963−
2964− if (!nvmeq->tags || !(*nvmeq->tags))
2965− continue;
2966−
2967− irq_set_affinity_hint(dev->entry[nvmeq->cq_vector].vector,
2968− blk_mq_tags_cpumask(*nvmeq->tags));
2969− }
2970−}
2971−
29722971 static int nvme_dev_start(struct nvme_dev *dev)
29732972 {
29742973 int result;
@@ -3010,8 +3009,6 @@ static int nvme_dev_start(struct nvme_dev *dev) · 35 unmodified lines
30103009 if (result)
30113010 goto free_tags;
30123011
3013− nvme_set_irq_hints(dev);
3014−
30153012 dev->event_limit = 1;
30163013 return result;
30173014
@@ -3062,7 +3059,6 @@ static int nvme_dev_resume(struct nvme_dev *dev) · 44 unmodified lines
30623059 } else {
30633060 nvme_unfreeze_queues(dev);
30643061 nvme_dev_add(dev);
3065− nvme_set_irq_hints(dev);
30663062 }
30673063 return 0;
30683064 }
drivers/block/virtio_blk.c+1−1
@@ -144,7 +144,7 @@ static void virtblk_done(struct virtqueue *vq) · 143 unmodified lines
144144 do {
145145 virtqueue_disable_cb(vq);
146146 while ((vbr = virtqueue_get_buf(vblk->vqs[qid].vq, &len)) != NULL) {
147− blk_mq_complete_request(vbr->req);
147+ blk_mq_complete_request(vbr->req, vbr->req->errors);
148148 req_done = true;
149149 }
150150 if (unlikely(virtqueue_is_broken(vq)))
drivers/block/xen-blkback/xenbus.c+20−18
@@ -212,6 +212,9 @@ static int xen_blkif_map(struct xen_blkif *blkif, grant_ref_t *gref, · 211 unmodified lines
212212
213213 static int xen_blkif_disconnect(struct xen_blkif *blkif)
214214 {
215+ struct pending_req *req, *n;
216+ int i = 0, j;
217+
215218 if (blkif->xenblkd) {
216219 kthread_stop(blkif->xenblkd);
217220 wake_up(&blkif->shutdown_wq);
@@ -238,13 +241,28 @@ static int xen_blkif_disconnect(struct xen_blkif *blkif) · 20 unmodified lines
238241 /* Remove all persistent grants and the cache of ballooned pages. */
239242 xen_blkbk_free_caches(blkif);
240243
244+ /* Check that there is no request in use */
245+ list_for_each_entry_safe(req, n, &blkif->pending_free, free_list) {
246+ list_del(&req->free_list);
247+
248+ for (j = 0; j < MAX_INDIRECT_SEGMENTS; j++)
249+ kfree(req->segments[j]);
250+
251+ for (j = 0; j < MAX_INDIRECT_PAGES; j++)
252+ kfree(req->indirect_pages[j]);
253+
254+ kfree(req);
255+ i++;
256+ }
257+
258+ WARN_ON(i != (XEN_BLKIF_REQS_PER_PAGE * blkif->nr_ring_pages));
259+ blkif->nr_ring_pages = 0;
260+
241261 return 0;
242262 }
243263
244264 static void xen_blkif_free(struct xen_blkif *blkif)
245265 {
246− struct pending_req *req, *n;
247− int i = 0, j;
248266
249267 xen_blkif_disconnect(blkif);
250268 xen_vbd_free(&blkif->vbd);
@@ -257,22 +275,6 @@ static void xen_blkif_free(struct xen_blkif *blkif) · 6 unmodified lines
257275 BUG_ON(!list_empty(&blkif->free_pages));
258276 BUG_ON(!RB_EMPTY_ROOT(&blkif->persistent_gnts));
259277
260− /* Check that there is no request in use */
261− list_for_each_entry_safe(req, n, &blkif->pending_free, free_list) {
262− list_del(&req->free_list);
263−
264− for (j = 0; j < MAX_INDIRECT_SEGMENTS; j++)
265− kfree(req->segments[j]);
266−
267− for (j = 0; j < MAX_INDIRECT_PAGES; j++)
268− kfree(req->indirect_pages[j]);
269−
270− kfree(req);
271− i++;
272− }
273−
274− WARN_ON(i != (XEN_BLKIF_REQS_PER_PAGE * blkif->nr_ring_pages));
275−
276278 kmem_cache_free(xen_blkif_cachep, blkif);
277279 }
278280
drivers/block/xen-blkfront.c+10−9
@@ -1142,6 +1142,7 @@ static irqreturn_t blkif_interrupt(int irq, void *dev_id) · 1141 unmodified lines
11421142 RING_IDX i, rp;
11431143 unsigned long flags;
11441144 struct blkfront_info *info = (struct blkfront_info *)dev_id;
1145+ int error;
11451146
11461147 spin_lock_irqsave(&info->io_lock, flags);
11471148
@@ -1182,37 +1183,37 @@ static irqreturn_t blkif_interrupt(int irq, void *dev_id) · 34 unmodified lines
11821183 continue;
11831184 }
11841185
1185− req->errors = (bret->status == BLKIF_RSP_OKAY) ? 0 : -EIO;
1186+ error = (bret->status == BLKIF_RSP_OKAY) ? 0 : -EIO;
11861187 switch (bret->operation) {
11871188 case BLKIF_OP_DISCARD:
11881189 if (unlikely(bret->status == BLKIF_RSP_EOPNOTSUPP)) {
11891190 struct request_queue *rq = info->rq;
11901191 printk(KERN_WARNING "blkfront: %s: %s op failed\n",
11911192 info->gd->disk_name, op_name(bret->operation));
1192− req->errors = -EOPNOTSUPP;
1193+ error = -EOPNOTSUPP;
11931194 info->feature_discard = 0;
11941195 info->feature_secdiscard = 0;
11951196 queue_flag_clear(QUEUE_FLAG_DISCARD, rq);
11961197 queue_flag_clear(QUEUE_FLAG_SECDISCARD, rq);
11971198 }
1198− blk_mq_complete_request(req);
1199+ blk_mq_complete_request(req, error);
11991200 break;
12001201 case BLKIF_OP_FLUSH_DISKCACHE:
12011202 case BLKIF_OP_WRITE_BARRIER:
12021203 if (unlikely(bret->status == BLKIF_RSP_EOPNOTSUPP)) {
12031204 printk(KERN_WARNING "blkfront: %s: %s op failed\n",
12041205 info->gd->disk_name, op_name(bret->operation));
1205− req->errors = -EOPNOTSUPP;
1206+ error = -EOPNOTSUPP;
12061207 }
12071208 if (unlikely(bret->status == BLKIF_RSP_ERROR &&
12081209 info->shadow[id].req.u.rw.nr_segments == 0)) {
12091210 printk(KERN_WARNING "blkfront: %s: empty %s op failed\n",
12101211 info->gd->disk_name, op_name(bret->operation));
1211− req->errors = -EOPNOTSUPP;
1212+ error = -EOPNOTSUPP;
12121213 }
1213− if (unlikely(req->errors)) {
1214− if (req->errors == -EOPNOTSUPP)
1215− req->errors = 0;
1214+ if (unlikely(error)) {
1215+ if (error == -EOPNOTSUPP)
1216+ error = 0;
12161217 info->feature_flush = 0;
12171218 xlvbd_flush(info);
12181219 }
@@ -1223,7 +1224,7 @@ static irqreturn_t blkif_interrupt(int irq, void *dev_id) · 4 unmodified lines
12231224 dev_dbg(&info->xbdev->dev, "Bad return from blkdev data "
12241225 "request: %x\n", bret->status);
12251226
1226− blk_mq_complete_request(req);
1227+ blk_mq_complete_request(req, error);
12271228 break;
12281229 default:
12291230 BUG();
drivers/char/hw_random/xgene-rng.c+4−3
@@ -344,11 +344,12 @@ static int xgene_rng_probe(struct platform_device *pdev) · 343 unmodified lines
344344 if (IS_ERR(ctx->csr_base))
345345 return PTR_ERR(ctx->csr_base);
346346
347− ctx->irq = platform_get_irq(pdev, 0);
348− if (ctx->irq < 0) {
347+ rc = platform_get_irq(pdev, 0);
348+ if (rc < 0) {
349349 dev_err(&pdev->dev, "No IRQ resource\n");
350− return ctx->irq;
350+ return rc;
351351 }
352+ ctx->irq = rc;
352353
353354 dev_dbg(&pdev->dev, "APM X-Gene RNG BASE %p ALARM IRQ %d",
354355 ctx->csr_base, ctx->irq);
drivers/clocksource/rockchip_timer.c+1−1
@@ -148,7 +148,7 @@ static void __init rk_timer_init(struct device_node *np) · 147 unmodified lines
148148 bc_timer.freq = clk_get_rate(timer_clk);
149149
150150 irq = irq_of_parse_and_map(np, 0);
151− if (irq == NO_IRQ) {
151+ if (!irq) {
152152 pr_err("Failed to map interrupts for '%s'\n", TIMER_NAME);
153153 return;
154154 }
drivers/clocksource/timer-keystone.c+1−1
@@ -152,7 +152,7 @@ static void __init keystone_timer_init(struct device_node *np) · 151 unmodified lines
152152 int irq, error;
153153
154154 irq = irq_of_parse_and_map(np, 0);
155− if (irq == NO_IRQ) {
155+ if (!irq) {
156156 pr_err("%s: failed to map interrupts\n", __func__);
157157 return;
158158 }
drivers/crypto/marvell/cesa.h+27−0
@@ -687,6 +687,33 @@ static inline u32 mv_cesa_get_int_mask(struct mv_cesa_engine *engine) · 686 unmodified lines
687687
688688 int mv_cesa_queue_req(struct crypto_async_request *req);
689689
690+/*
691+ * Helper function that indicates whether a crypto request needs to be
692+ * cleaned up or not after being enqueued using mv_cesa_queue_req().
693+ */
694+static inline int mv_cesa_req_needs_cleanup(struct crypto_async_request *req,
695+ int ret)
696+{
697+ /*
698+ * The queue still had some space, the request was queued
699+ * normally, so there's no need to clean it up.
700+ */
701+ if (ret == -EINPROGRESS)
702+ return false;
703+
704+ /*
705+ * The queue had not space left, but since the request is
706+ * flagged with CRYPTO_TFM_REQ_MAY_BACKLOG, it was added to
707+ * the backlog and will be processed later. There's no need to
708+ * clean it up.
709+ */
710+ if (ret == -EBUSY && req->flags & CRYPTO_TFM_REQ_MAY_BACKLOG)
711+ return false;
712+
713+ /* Request wasn't queued, we need to clean it up */
714+ return true;
715+}
716+
690717 /* TDMA functions */
691718
692719 static inline void mv_cesa_req_dma_iter_init(struct mv_cesa_dma_iter *iter,
drivers/crypto/marvell/cipher.c+3−4
@@ -189,7 +189,6 @@ static inline void mv_cesa_ablkcipher_prepare(struct crypto_async_request *req, · 188 unmodified lines
189189 {
190190 struct ablkcipher_request *ablkreq = ablkcipher_request_cast(req);
191191 struct mv_cesa_ablkcipher_req *creq = ablkcipher_request_ctx(ablkreq);
192−
193192 creq->req.base.engine = engine;
194193
195194 if (creq->req.base.type == CESA_DMA_REQ)
@@ -431,7 +430,7 @@ static int mv_cesa_des_op(struct ablkcipher_request *req, · 235 unmodified lines
431430 return ret;
432431
433432 ret = mv_cesa_queue_req(&req->base);
434− if (ret && ret != -EINPROGRESS)
433+ if (mv_cesa_req_needs_cleanup(&req->base, ret))
435434 mv_cesa_ablkcipher_cleanup(req);
436435
437436 return ret;
@@ -551,7 +550,7 @@ static int mv_cesa_des3_op(struct ablkcipher_request *req, · 113 unmodified lines
551550 return ret;
552551
553552 ret = mv_cesa_queue_req(&req->base);
554− if (ret && ret != -EINPROGRESS)
553+ if (mv_cesa_req_needs_cleanup(&req->base, ret))
555554 mv_cesa_ablkcipher_cleanup(req);
556555
557556 return ret;
@@ -693,7 +692,7 @@ static int mv_cesa_aes_op(struct ablkcipher_request *req, · 135 unmodified lines
693692 return ret;
694693
695694 ret = mv_cesa_queue_req(&req->base);
696− if (ret && ret != -EINPROGRESS)
695+ if (mv_cesa_req_needs_cleanup(&req->base, ret))
697696 mv_cesa_ablkcipher_cleanup(req);
698697
699698 return ret;
drivers/crypto/marvell/hash.c+3−5
@@ -739,10 +739,8 @@ static int mv_cesa_ahash_update(struct ahash_request *req) · 738 unmodified lines
739739 return 0;
740740
741741 ret = mv_cesa_queue_req(&req->base);
742− if (ret && ret != -EINPROGRESS) {
742+ if (mv_cesa_req_needs_cleanup(&req->base, ret))
743743 mv_cesa_ahash_cleanup(req);
744− return ret;
745− }
746744
747745 return ret;
748746 }
@@ -766,7 +764,7 @@ static int mv_cesa_ahash_final(struct ahash_request *req) · 17 unmodified lines
766764 return 0;
767765
768766 ret = mv_cesa_queue_req(&req->base);
769− if (ret && ret != -EINPROGRESS)
767+ if (mv_cesa_req_needs_cleanup(&req->base, ret))
770768 mv_cesa_ahash_cleanup(req);
771769
772770 return ret;
@@ -791,7 +789,7 @@ static int mv_cesa_ahash_finup(struct ahash_request *req) · 18 unmodified lines
791789 return 0;
792790
793791 ret = mv_cesa_queue_req(&req->base);
794− if (ret && ret != -EINPROGRESS)
792+ if (mv_cesa_req_needs_cleanup(&req->base, ret))
795793 mv_cesa_ahash_cleanup(req);
796794
797795 return ret;
drivers/crypto/qat/qat_common/adf_aer.c+3−0
@@ -88,6 +88,9 @@ static void adf_dev_restore(struct adf_accel_dev *accel_dev) · 87 unmodified lines
8888 struct pci_dev *parent = pdev->bus->self;
8989 uint16_t bridge_ctl = 0;
9090
91+ if (accel_dev->is_vf)
92+ return;
93+
9194 dev_info(&GET_DEV(accel_dev), "Resetting device qat_dev%d\n",
9295 accel_dev->accel_id);
9396
drivers/dma/at_xdmac.c+12−3
@@ -455,6 +455,15 @@ static struct at_xdmac_desc *at_xdmac_alloc_desc(struct dma_chan *chan, · 454 unmodified lines
455455 return desc;
456456 }
457457
458+void at_xdmac_init_used_desc(struct at_xdmac_desc *desc)
459+{
460+ memset(&desc->lld, 0, sizeof(desc->lld));
461+ INIT_LIST_HEAD(&desc->descs_list);
462+ desc->direction = DMA_TRANS_NONE;
463+ desc->xfer_size = 0;
464+ desc->active_xfer = false;
465+}
466+
458467 /* Call must be protected by lock. */
459468 static struct at_xdmac_desc *at_xdmac_get_desc(struct at_xdmac_chan *atchan)
460469 {
@@ -466,7 +475,7 @@ static struct at_xdmac_desc *at_xdmac_get_desc(struct at_xdmac_chan *atchan) · 5 unmodified lines
466475 desc = list_first_entry(&atchan->free_descs_list,
467476 struct at_xdmac_desc, desc_node);
468477 list_del(&desc->desc_node);
469− desc->active_xfer = false;
478+ at_xdmac_init_used_desc(desc);
470479 }
471480
472481 return desc;
@@ -875,14 +884,14 @@ at_xdmac_interleaved_queue_desc(struct dma_chan *chan, · 402 unmodified lines
875884
876885 if (xt->src_inc) {
877886 if (xt->src_sgl)
878− chan_cc |= AT_XDMAC_CC_SAM_UBS_DS_AM;
887+ chan_cc |= AT_XDMAC_CC_SAM_UBS_AM;
879888 else
880889 chan_cc |= AT_XDMAC_CC_SAM_INCREMENTED_AM;
881890 }
882891
883892 if (xt->dst_inc) {
884893 if (xt->dst_sgl)
885− chan_cc |= AT_XDMAC_CC_DAM_UBS_DS_AM;
894+ chan_cc |= AT_XDMAC_CC_DAM_UBS_AM;
886895 else
887896 chan_cc |= AT_XDMAC_CC_DAM_INCREMENTED_AM;
888897 }
drivers/dma/dmaengine.c+9−1
@@ -554,10 +554,18 @@ struct dma_chan *dma_get_slave_channel(struct dma_chan *chan) · 553 unmodified lines
554554 mutex_lock(&dma_list_mutex);
555555
556556 if (chan->client_count == 0) {
557+ struct dma_device *device = chan->device;
558+
559+ dma_cap_set(DMA_PRIVATE, device->cap_mask);
560+ device->privatecnt++;
557561 err = dma_chan_get(chan);
558− if (err)
562+ if (err) {
559563 pr_debug("%s: failed to get %s: (%d)\n",
560564 __func__, dma_chan_name(chan), err);
565+ chan = NULL;
566+ if (--device->privatecnt == 0)
567+ dma_cap_clear(DMA_PRIVATE, device->cap_mask);
568+ }
561569 } else
562570 chan = NULL;
563571
drivers/dma/dw/core.c+2−2
@@ -1591,7 +1591,6 @@ int dw_dma_probe(struct dw_dma_chip *chip, struct dw_dma_platform_data *pdata) · 1590 unmodified lines
15911591 INIT_LIST_HEAD(&dw->dma.channels);
15921592 for (i = 0; i < nr_channels; i++) {
15931593 struct dw_dma_chan *dwc = &dw->chan[i];
1594− int r = nr_channels - i - 1;
15951594
15961595 dwc->chan.device = &dw->dma;
15971596 dma_cookie_init(&dwc->chan);
@@ -1603,7 +1602,7 @@ int dw_dma_probe(struct dw_dma_chip *chip, struct dw_dma_platform_data *pdata) · 5 unmodified lines
16031602
16041603 /* 7 is highest priority & 0 is lowest. */
16051604 if (pdata->chan_priority == CHAN_PRIORITY_ASCENDING)
1606− dwc->priority = r;
1605+ dwc->priority = nr_channels - i - 1;
16071606 else
16081607 dwc->priority = i;
16091608
@@ -1622,6 +1621,7 @@ int dw_dma_probe(struct dw_dma_chip *chip, struct dw_dma_platform_data *pdata) · 12 unmodified lines
16221621 /* Hardware configuration */
16231622 if (autocfg) {
16241623 unsigned int dwc_params;
1624+ unsigned int r = DW_DMA_MAX_NR_CHANNELS - i - 1;
16251625 void __iomem *addr = chip->regs + r * sizeof(u32);
16261626
16271627 dwc_params = dma_read_byaddr(addr, DWC_PARAMS);
drivers/dma/idma64.c+8−8
@@ -355,23 +355,23 @@ static size_t idma64_active_desc_size(struct idma64_chan *idma64c) · 354 unmodified lines
355355 struct idma64_desc *desc = idma64c->desc;
356356 struct idma64_hw_desc *hw;
357357 size_t bytes = desc->length;
358− u64 llp;
359− u32 ctlhi;
358+ u64 llp = channel_readq(idma64c, LLP);
359+ u32 ctlhi = channel_readl(idma64c, CTL_HI);
360360 unsigned int i = 0;
361361
362− llp = channel_readq(idma64c, LLP);
363362 do {
364363 hw = &desc->hw[i];
365− } while ((hw->llp != llp) && (++i < desc->ndesc));
364+ if (hw->llp == llp)
365+ break;
366+ bytes -= hw->len;
367+ } while (++i < desc->ndesc);
366368
367369 if (!i)
368370 return bytes;
369371
370− do {
371− bytes -= desc->hw[--i].len;
372− } while (i);
372+ /* The current chunk is not fully transfered yet */
373+ bytes += desc->hw[--i].len;
373374
374− ctlhi = channel_readl(idma64c, CTL_HI);
375375 return bytes - IDMA64C_CTLH_BLOCK_TS(ctlhi);
376376 }
377377
drivers/dma/pxa_dma.c+25−6
@@ -473,8 +473,10 @@ static void pxad_free_phy(struct pxad_chan *chan) · 472 unmodified lines
473473 return;
474474
475475 /* clear the channel mapping in DRCMR */
476− reg = pxad_drcmr(chan->drcmr);
477− writel_relaxed(0, chan->phy->base + reg);
476+ if (chan->drcmr <= DRCMR_CHLNUM) {
477+ reg = pxad_drcmr(chan->drcmr);
478+ writel_relaxed(0, chan->phy->base + reg);
479+ }
478480
479481 spin_lock_irqsave(&pdev->phy_lock, flags);
480482 for (i = 0; i < 32; i++)
@@ -516,8 +518,10 @@ static void phy_enable(struct pxad_phy *phy, bool misaligned) · 35 unmodified lines
516518 "%s(); phy=%p(%d) misaligned=%d\n", __func__,
517519 phy, phy->idx, misaligned);
518520
519− reg = pxad_drcmr(phy->vchan->drcmr);
520− writel_relaxed(DRCMR_MAPVLD | phy->idx, phy->base + reg);
521+ if (phy->vchan->drcmr <= DRCMR_CHLNUM) {
522+ reg = pxad_drcmr(phy->vchan->drcmr);
523+ writel_relaxed(DRCMR_MAPVLD | phy->idx, phy->base + reg);
524+ }
521525
522526 dalgn = phy_readl_relaxed(phy, DALGN);
523527 if (misaligned)
@@ -887,6 +891,7 @@ pxad_tx_prep(struct virt_dma_chan *vc, struct virt_dma_desc *vd, · 363 unmodified lines
887891 struct dma_async_tx_descriptor *tx;
888892 struct pxad_chan *chan = container_of(vc, struct pxad_chan, vc);
889893
894+ INIT_LIST_HEAD(&vd->node);
890895 tx = vchan_tx_prep(vc, vd, tx_flags);
891896 tx->tx_submit = pxad_tx_submit;
892897 dev_dbg(&chan->vc.chan.dev->device,
@@ -910,14 +915,18 @@ static void pxad_get_config(struct pxad_chan *chan, · 17 unmodified lines
910915 width = chan->cfg.src_addr_width;
911916 dev_addr = chan->cfg.src_addr;
912917 *dev_src = dev_addr;
913− *dcmd |= PXA_DCMD_INCTRGADDR | PXA_DCMD_FLOWSRC;
918+ *dcmd |= PXA_DCMD_INCTRGADDR;
919+ if (chan->drcmr <= DRCMR_CHLNUM)
920+ *dcmd |= PXA_DCMD_FLOWSRC;
914921 }
915922 if (dir == DMA_MEM_TO_DEV) {
916923 maxburst = chan->cfg.dst_maxburst;
917924 width = chan->cfg.dst_addr_width;
918925 dev_addr = chan->cfg.dst_addr;
919926 *dev_dst = dev_addr;
920− *dcmd |= PXA_DCMD_INCSRCADDR | PXA_DCMD_FLOWTRG;
927+ *dcmd |= PXA_DCMD_INCSRCADDR;
928+ if (chan->drcmr <= DRCMR_CHLNUM)
929+ *dcmd |= PXA_DCMD_FLOWTRG;
921930 }
922931 if (dir == DMA_MEM_TO_MEM)
923932 *dcmd |= PXA_DCMD_BURST32 | PXA_DCMD_INCTRGADDR |
@@ -1177,6 +1186,16 @@ static unsigned int pxad_residue(struct pxad_chan *chan, · 253 unmodified lines
11771186 else
11781187 curr = phy_readl_relaxed(chan->phy, DTADR);
11791188
1189+ /*
1190+ * curr has to be actually read before checking descriptor
1191+ * completion, so that a curr inside a status updater
1192+ * descriptor implies the following test returns true, and
1193+ * preventing reordering of curr load and the test.
1194+ */
1195+ rmb();
1196+ if (is_desc_completed(vd))
1197+ goto out;
1198+
11801199 for (i = 0; i < sw_desc->nb_desc - 1; i++) {
11811200 hw_desc = sw_desc->hw_desc[i];
11821201 if (sw_desc->hw_desc[0]->dcmd & PXA_DCMD_INCSRCADDR)
drivers/dma/sun4i-dma.c+3−3
@@ -599,13 +599,13 @@ get_next_cyclic_promise(struct sun4i_dma_contract *contract) · 598 unmodified lines
599599 static void sun4i_dma_free_contract(struct virt_dma_desc *vd)
600600 {
601601 struct sun4i_dma_contract *contract = to_sun4i_dma_contract(vd);
602− struct sun4i_dma_promise *promise;
602+ struct sun4i_dma_promise *promise, *tmp;
603603
604604 /* Free all the demands and completed demands */
605− list_for_each_entry(promise, &contract->demands, list)
605+ list_for_each_entry_safe(promise, tmp, &contract->demands, list)
606606 kfree(promise);
607607
608− list_for_each_entry(promise, &contract->completed_demands, list)
608+ list_for_each_entry_safe(promise, tmp, &contract->completed_demands, list)
609609 kfree(promise);
610610
611611 kfree(contract);
drivers/dma/xgene-dma.c+17−29
@@ -59,7 +59,6 @@ · 58 unmodified lines
5959 #define XGENE_DMA_RING_MEM_RAM_SHUTDOWN 0xD070
6060 #define XGENE_DMA_RING_BLK_MEM_RDY 0xD074
6161 #define XGENE_DMA_RING_BLK_MEM_RDY_VAL 0xFFFFFFFF
62−#define XGENE_DMA_RING_DESC_CNT(v) (((v) & 0x0001FFFE) >> 1)
6362 #define XGENE_DMA_RING_ID_GET(owner, num) (((owner) << 6) | (num))
6463 #define XGENE_DMA_RING_DST_ID(v) ((1 << 10) | (v))
6564 #define XGENE_DMA_RING_CMD_OFFSET 0x2C
@@ -379,14 +378,6 @@ static u8 xgene_dma_encode_xor_flyby(u32 src_cnt) · 313 unmodified lines
379378 return flyby_type[src_cnt];
380379 }
381380
382−static u32 xgene_dma_ring_desc_cnt(struct xgene_dma_ring *ring)
383−{
384− u32 __iomem *cmd_base = ring->cmd_base;
385− u32 ring_state = ioread32(&cmd_base[1]);
386−
387− return XGENE_DMA_RING_DESC_CNT(ring_state);
388−}
389−
390381 static void xgene_dma_set_src_buffer(__le64 *ext8, size_t *len,
391382 dma_addr_t *paddr)
392383 {
@@ -659,15 +650,12 @@ static void xgene_dma_clean_running_descriptor(struct xgene_dma_chan *chan, · 266 unmodified lines
659650 dma_pool_free(chan->desc_pool, desc, desc->tx.phys);
660651 }
661652
662−static int xgene_chan_xfer_request(struct xgene_dma_ring *ring,
663− struct xgene_dma_desc_sw *desc_sw)
653+static void xgene_chan_xfer_request(struct xgene_dma_chan *chan,
654+ struct xgene_dma_desc_sw *desc_sw)
664655 {
656+ struct xgene_dma_ring *ring = &chan->tx_ring;
665657 struct xgene_dma_desc_hw *desc_hw;
666658
667− /* Check if can push more descriptor to hw for execution */
668− if (xgene_dma_ring_desc_cnt(ring) > (ring->slots - 2))
669− return -EBUSY;
670−
671659 /* Get hw descriptor from DMA tx ring */
672660 desc_hw = &ring->desc_hw[ring->head];
673661
@@ -694,11 +682,13 @@ static int xgene_chan_xfer_request(struct xgene_dma_ring *ring, · 20 unmodified lines
694682 memcpy(desc_hw, &desc_sw->desc2, sizeof(*desc_hw));
695683 }
696684
685+ /* Increment the pending transaction count */
686+ chan->pending += ((desc_sw->flags &
687+ XGENE_DMA_FLAG_64B_DESC) ? 2 : 1);
688+
697689 /* Notify the hw that we have descriptor ready for execution */
698690 iowrite32((desc_sw->flags & XGENE_DMA_FLAG_64B_DESC) ?
699691 2 : 1, ring->cmd);
700−
701− return 0;
702692 }
703693
704694 /**
@@ -710,7 +700,6 @@ static int xgene_chan_xfer_request(struct xgene_dma_ring *ring, · 5 unmodified lines
710700 static void xgene_chan_xfer_ld_pending(struct xgene_dma_chan *chan)
711701 {
712702 struct xgene_dma_desc_sw *desc_sw, *_desc_sw;
713− int ret;
714703
715704 /*
716705 * If the list of pending descriptors is empty, then we
@@ -735,18 +724,13 @@ static void xgene_chan_xfer_ld_pending(struct xgene_dma_chan *chan) · 18 unmodified lines
735724 if (chan->pending >= chan->max_outstanding)
736725 return;
737726
738− ret = xgene_chan_xfer_request(&chan->tx_ring, desc_sw);
739− if (ret)
740− return;
727+ xgene_chan_xfer_request(chan, desc_sw);
741728
742729 /*
743730 * Delete this element from ld pending queue and append it to
744731 * ld running queue
745732 */
746733 list_move_tail(&desc_sw->node, &chan->ld_running);
747−
748− /* Increment the pending transaction count */
749− chan->pending++;
750734 }
751735 }
752736
@@ -821,7 +805,8 @@ static void xgene_dma_cleanup_descriptors(struct xgene_dma_chan *chan) · 68 unmodified lines
821805 * Decrement the pending transaction count
822806 * as we have processed one
823807 */
824− chan->pending--;
808+ chan->pending -= ((desc_sw->flags &
809+ XGENE_DMA_FLAG_64B_DESC) ? 2 : 1);
825810
826811 /*
827812 * Delete this node from ld running queue and append it to
@@ -1421,15 +1406,18 @@ static int xgene_dma_create_ring_one(struct xgene_dma_chan *chan, · 593 unmodified lines
14211406 struct xgene_dma_ring *ring,
14221407 enum xgene_dma_ring_cfgsize cfgsize)
14231408 {
1409+ int ret;
1410+
14241411 /* Setup DMA ring descriptor variables */
14251412 ring->pdma = chan->pdma;
14261413 ring->cfgsize = cfgsize;
14271414 ring->num = chan->pdma->ring_num++;
14281415 ring->id = XGENE_DMA_RING_ID_GET(ring->owner, ring->buf_num);
14291416
1430− ring->size = xgene_dma_get_ring_size(chan, cfgsize);
1431− if (ring->size <= 0)
1432− return ring->size;
1417+ ret = xgene_dma_get_ring_size(chan, cfgsize);
1418+ if (ret <= 0)
1419+ return ret;
1420+ ring->size = ret;
14331421
14341422 /* Allocate memory for DMA ring descriptor */
14351423 ring->desc_vaddr = dma_zalloc_coherent(chan->dev, ring->size,
@@ -1482,7 +1470,7 @@ static int xgene_dma_create_chan_rings(struct xgene_dma_chan *chan) · 46 unmodified lines
14821470 tx_ring->id, tx_ring->num, tx_ring->desc_vaddr);
14831471
14841472 /* Set the max outstanding request possible to this channel */
1485− chan->max_outstanding = rx_ring->slots;
1473+ chan->max_outstanding = tx_ring->slots;
14861474
14871475 return ret;
14881476 }
drivers/dma/zx296702_dma.c+1−1
@@ -739,7 +739,7 @@ static struct dma_chan *zx_of_dma_simple_xlate(struct of_phandle_args *dma_spec, · 738 unmodified lines
739739 struct dma_chan *chan;
740740 struct zx_dma_chan *c;
741741
742− if (request > d->dma_requests)
742+ if (request >= d->dma_requests)
743743 return NULL;
744744
745745 chan = dma_get_any_slave_channel(&d->slave);
drivers/extcon/extcon.c+1−1
@@ -159,7 +159,7 @@ static int find_cable_index_by_name(struct extcon_dev *edev, const char *name) · 158 unmodified lines
159159 static bool is_extcon_changed(u32 prev, u32 new, int idx, bool *attached)
160160 {
161161 if (((prev >> idx) & 0x1) != ((new >> idx) & 0x1)) {
162− *attached = new ? true : false;
162+ *attached = ((new >> idx) & 0x1) ? true : false;
163163 return true;
164164 }
165165
drivers/firmware/Kconfig+8−0
@@ -139,6 +139,14 @@ config QCOM_SCM · 138 unmodified lines
139139 bool
140140 depends on ARM || ARM64
141141
142+config QCOM_SCM_32
143+ def_bool y
144+ depends on QCOM_SCM && ARM
145+
146+config QCOM_SCM_64
147+ def_bool y
148+ depends on QCOM_SCM && ARM64
149+
142150 source "drivers/firmware/broadcom/Kconfig"
143151 source "drivers/firmware/google/Kconfig"
144152 source "drivers/firmware/efi/Kconfig"
drivers/firmware/Makefile+2−1
@@ -13,7 +13,8 @@ obj-$(CONFIG_ISCSI_IBFT_FIND) += iscsi_ibft_find.o · 12 unmodified lines
1313 obj-$(CONFIG_ISCSI_IBFT) += iscsi_ibft.o
1414 obj-$(CONFIG_FIRMWARE_MEMMAP) += memmap.o
1515 obj-$(CONFIG_QCOM_SCM) += qcom_scm.o
16−obj-$(CONFIG_QCOM_SCM) += qcom_scm-32.o
16+obj-$(CONFIG_QCOM_SCM_64) += qcom_scm-64.o
17+obj-$(CONFIG_QCOM_SCM_32) += qcom_scm-32.o
1718 CFLAGS_qcom_scm-32.o :=$(call as-instr,.arch_extension sec,-DREQUIRES_SEC=1)
1819
1920 obj-y += broadcom/
drivers/firmware/efi/libstub/arm-stub.c+73−15
@@ -13,6 +13,7 @@ · 12 unmodified lines
1313 */
1414
1515 #include <linux/efi.h>
16+#include <linux/sort.h>
1617 #include <asm/efi.h>
1718
1819 #include "efistub.h"
@@ -305,6 +306,44 @@ fail: · 286 unmodified lines
305306 */
306307 #define EFI_RT_VIRTUAL_BASE 0x40000000
307308
309+static int cmp_mem_desc(const void *l, const void *r)
310+{
311+ const efi_memory_desc_t *left = l, *right = r;
312+
313+ return (left->phys_addr > right->phys_addr) ? 1 : -1;
314+}
315+
316+/*
317+ * Returns whether region @left ends exactly where region @right starts,
318+ * or false if either argument is NULL.
319+ */
320+static bool regions_are_adjacent(efi_memory_desc_t *left,
321+ efi_memory_desc_t *right)
322+{
323+ u64 left_end;
324+
325+ if (left == NULL || right == NULL)
326+ return false;
327+
328+ left_end = left->phys_addr + left->num_pages * EFI_PAGE_SIZE;
329+
330+ return left_end == right->phys_addr;
331+}
332+
333+/*
334+ * Returns whether region @left and region @right have compatible memory type
335+ * mapping attributes, and are both EFI_MEMORY_RUNTIME regions.
336+ */
337+static bool regions_have_compatible_memory_type_attrs(efi_memory_desc_t *left,
338+ efi_memory_desc_t *right)
339+{
340+ static const u64 mem_type_mask = EFI_MEMORY_WB | EFI_MEMORY_WT |
341+ EFI_MEMORY_WC | EFI_MEMORY_UC |
342+ EFI_MEMORY_RUNTIME;
343+
344+ return ((left->attribute ^ right->attribute) & mem_type_mask) == 0;
345+}
346+
308347 /*
309348 * efi_get_virtmap() - create a virtual mapping for the EFI memory map
310349 *
@@ -317,33 +356,52 @@ void efi_get_virtmap(efi_memory_desc_t *memory_map, unsigned long map_size, · 6 unmodified lines
317356 int *count)
318357 {
319358 u64 efi_virt_base = EFI_RT_VIRTUAL_BASE;
320− efi_memory_desc_t *out = runtime_map;
359+ efi_memory_desc_t *in, *prev = NULL, *out = runtime_map;
321360 int l;
322361
323− for (l = 0; l < map_size; l += desc_size) {
324− efi_memory_desc_t *in = (void *)memory_map + l;
362+ /*
363+ * To work around potential issues with the Properties Table feature
364+ * introduced in UEFI 2.5, which may split PE/COFF executable images
365+ * in memory into several RuntimeServicesCode and RuntimeServicesData
366+ * regions, we need to preserve the relative offsets between adjacent
367+ * EFI_MEMORY_RUNTIME regions with the same memory type attributes.
368+ * The easiest way to find adjacent regions is to sort the memory map
369+ * before traversing it.
370+ */
371+ sort(memory_map, map_size / desc_size, desc_size, cmp_mem_desc, NULL);
372+
373+ for (l = 0; l < map_size; l += desc_size, prev = in) {
325374 u64 paddr, size;
326375
376+ in = (void *)memory_map + l;
327377 if (!(in->attribute & EFI_MEMORY_RUNTIME))
328378 continue;
329379
380+ paddr = in->phys_addr;
381+ size = in->num_pages * EFI_PAGE_SIZE;
382+
330383 /*
331384 * Make the mapping compatible with 64k pages: this allows
332385 * a 4k page size kernel to kexec a 64k page size kernel and
333386 * vice versa.
334387 */
335− paddr = round_down(in->phys_addr, SZ_64K);
336− size = round_up(in->num_pages * EFI_PAGE_SIZE +
337− in->phys_addr - paddr, SZ_64K);
338−
339− /*
340− * Avoid wasting memory on PTEs by choosing a virtual base that
341− * is compatible with section mappings if this region has the
342− * appropriate size and physical alignment. (Sections are 2 MB
343− * on 4k granule kernels)
344− */
345− if (IS_ALIGNED(in->phys_addr, SZ_2M) && size >= SZ_2M)
346− efi_virt_base = round_up(efi_virt_base, SZ_2M);
388+ if (!regions_are_adjacent(prev, in) ||
389+ !regions_have_compatible_memory_type_attrs(prev, in)) {
390+
391+ paddr = round_down(in->phys_addr, SZ_64K);
392+ size += in->phys_addr - paddr;
393+
394+ /*
395+ * Avoid wasting memory on PTEs by choosing a virtual
396+ * base that is compatible with section mappings if this
397+ * region has the appropriate size and physical
398+ * alignment. (Sections are 2 MB on 4k granule kernels)
399+ */
400+ if (IS_ALIGNED(in->phys_addr, SZ_2M) && size >= SZ_2M)
401+ efi_virt_base = round_up(efi_virt_base, SZ_2M);
402+ else
403+ efi_virt_base = round_up(efi_virt_base, SZ_64K);
404+ }
347405
348406 in->virt_addr = efi_virt_base + in->phys_addr - paddr;
349407 efi_virt_base += size;
drivers/firmware/efi/libstub/efistub.h+0−4
@@ -5,10 +5,6 @@ · 4 unmodified lines
55 /* error code which can't be mistaken for valid address */
66 #define EFI_ERROR (~0UL)
77
8−#undef memcpy
9−#undef memset
10−#undef memmove
11−
128 void efi_char16_printk(efi_system_table_t *, efi_char16_t *);
139
1410 efi_status_t efi_open_volume(efi_system_table_t *sys_table_arg, void *__image,
drivers/firmware/qcom_scm-64.c+63−0
@@ -0,0 +1,63 @@
1+/* Copyright (c) 2015, The Linux Foundation. All rights reserved.
2+ *
3+ * This program is free software; you can redistribute it and/or modify
4+ * it under the terms of the GNU General Public License version 2 and
5+ * only version 2 as published by the Free Software Foundation.
6+ *
7+ * This program is distributed in the hope that it will be useful,
8+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
9+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10+ * GNU General Public License for more details.
11+ */
12+
13+#include <linux/io.h>
14+#include <linux/errno.h>
15+#include <linux/qcom_scm.h>
16+
17+/**
18+ * qcom_scm_set_cold_boot_addr() - Set the cold boot address for cpus
19+ * @entry: Entry point function for the cpus
20+ * @cpus: The cpumask of cpus that will use the entry point
21+ *
22+ * Set the cold boot address of the cpus. Any cpu outside the supported
23+ * range would be removed from the cpu present mask.
24+ */
25+int __qcom_scm_set_cold_boot_addr(void *entry, const cpumask_t *cpus)
26+{
27+ return -ENOTSUPP;
28+}
29+
30+/**
31+ * qcom_scm_set_warm_boot_addr() - Set the warm boot address for cpus
32+ * @entry: Entry point function for the cpus
33+ * @cpus: The cpumask of cpus that will use the entry point
34+ *
35+ * Set the Linux entry point for the SCM to transfer control to when coming
36+ * out of a power down. CPU power down may be executed on cpuidle or hotplug.
37+ */
38+int __qcom_scm_set_warm_boot_addr(void *entry, const cpumask_t *cpus)
39+{
40+ return -ENOTSUPP;
41+}
42+
43+/**
44+ * qcom_scm_cpu_power_down() - Power down the cpu
45+ * @flags - Flags to flush cache
46+ *
47+ * This is an end point to power down cpu. If there was a pending interrupt,
48+ * the control would return from this function, otherwise, the cpu jumps to the
49+ * warm boot entry point set for this cpu upon reset.
50+ */
51+void __qcom_scm_cpu_power_down(u32 flags)
52+{
53+}
54+
55+int __qcom_scm_is_call_available(u32 svc_id, u32 cmd_id)
56+{
57+ return -ENOTSUPP;
58+}
59+
60+int __qcom_scm_hdcp_req(struct qcom_scm_hdcp_req *req, u32 req_cnt, u32 *resp)
61+{
62+ return -ENOTSUPP;
63+}
drivers/gpu/drm/amd/amdgpu/amdgpu.h+6−5
@@ -82,6 +82,7 @@ extern int amdgpu_vm_block_size; · 81 unmodified lines
8282 extern int amdgpu_enable_scheduler;
8383 extern int amdgpu_sched_jobs;
8484 extern int amdgpu_sched_hw_submission;
85+extern int amdgpu_enable_semaphores;
8586
8687 #define AMDGPU_WAIT_IDLE_TIMEOUT_IN_MS 3000
8788 #define AMDGPU_MAX_USEC_TIMEOUT 100000 /* 100 ms */
@@ -432,7 +433,7 @@ int amdgpu_fence_driver_init(struct amdgpu_device *adev); · 344 unmodified lines
432433 void amdgpu_fence_driver_fini(struct amdgpu_device *adev);
433434 void amdgpu_fence_driver_force_completion(struct amdgpu_device *adev);
434435
435−void amdgpu_fence_driver_init_ring(struct amdgpu_ring *ring);
436+int amdgpu_fence_driver_init_ring(struct amdgpu_ring *ring);
436437 int amdgpu_fence_driver_start_ring(struct amdgpu_ring *ring,
437438 struct amdgpu_irq_src *irq_src,
438439 unsigned irq_type);
@@ -890,7 +891,7 @@ struct amdgpu_ring { · 451 unmodified lines
890891 struct amdgpu_device *adev;
891892 const struct amdgpu_ring_funcs *funcs;
892893 struct amdgpu_fence_driver fence_drv;
893− struct amd_gpu_scheduler *scheduler;
894+ struct amd_gpu_scheduler sched;
894895
895896 spinlock_t fence_lock;
896897 struct mutex *ring_lock;
@@ -1201,8 +1202,6 @@ struct amdgpu_gfx { · 304 unmodified lines
12011202 struct amdgpu_irq_src priv_inst_irq;
12021203 /* gfx status */
12031204 uint32_t gfx_current_status;
1204− /* sync signal for const engine */
1205− unsigned ce_sync_offs;
12061205 /* ce ram size*/
12071206 unsigned ce_ram_size;
12081207 };
@@ -1274,8 +1273,10 @@ struct amdgpu_job { · 65 unmodified lines
12741273 uint32_t num_ibs;
12751274 struct mutex job_lock;
12761275 struct amdgpu_user_fence uf;
1277− int (*free_job)(struct amdgpu_job *sched_job);
1276+ int (*free_job)(struct amdgpu_job *job);
12781277 };
1278+#define to_amdgpu_job(sched_job) \
1279+ container_of((sched_job), struct amdgpu_job, base)
12791280
12801281 static inline u32 amdgpu_get_ib_value(struct amdgpu_cs_parser *p, uint32_t ib_idx, int idx)
12811282 {
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c+1−1
@@ -183,7 +183,7 @@ int alloc_gtt_mem(struct kgd_dev *kgd, size_t size, · 182 unmodified lines
183183 return -ENOMEM;
184184
185185 r = amdgpu_bo_create(rdev, size, PAGE_SIZE, true, AMDGPU_GEM_DOMAIN_GTT,
186− AMDGPU_GEM_CREATE_CPU_GTT_USWC, NULL, &(*mem)->bo);
186+ AMDGPU_GEM_CREATE_CPU_GTT_USWC, NULL, NULL, &(*mem)->bo);
187187 if (r) {
188188 dev_err(rdev->dev,
189189 "failed to allocate BO for amdkfd (%d)\n", r);
drivers/gpu/drm/amd/amdgpu/amdgpu_benchmark.c+4−2
@@ -79,7 +79,8 @@ static void amdgpu_benchmark_move(struct amdgpu_device *adev, unsigned size, · 78 unmodified lines
7979 int time;
8080
8181 n = AMDGPU_BENCHMARK_ITERATIONS;
82− r = amdgpu_bo_create(adev, size, PAGE_SIZE, true, sdomain, 0, NULL, &sobj);
82+ r = amdgpu_bo_create(adev, size, PAGE_SIZE, true, sdomain, 0, NULL,
83+ NULL, &sobj);
8384 if (r) {
8485 goto out_cleanup;
8586 }
@@ -91,7 +92,8 @@ static void amdgpu_benchmark_move(struct amdgpu_device *adev, unsigned size, · 5 unmodified lines
9192 if (r) {
9293 goto out_cleanup;
9394 }
94− r = amdgpu_bo_create(adev, size, PAGE_SIZE, true, ddomain, 0, NULL, &dobj);
95+ r = amdgpu_bo_create(adev, size, PAGE_SIZE, true, ddomain, 0, NULL,
96+ NULL, &dobj);
9597 if (r) {
9698 goto out_cleanup;
9799 }
drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c+3−41
@@ -86,7 +86,7 @@ static int amdgpu_cgs_gmap_kmem(void *cgs_device, void *kmem, · 85 unmodified lines
8686
8787 struct sg_table *sg = drm_prime_pages_to_sg(&kmem_page, npages);
8888 ret = amdgpu_bo_create(adev, size, PAGE_SIZE, false,
89− AMDGPU_GEM_DOMAIN_GTT, 0, sg, &bo);
89+ AMDGPU_GEM_DOMAIN_GTT, 0, sg, NULL, &bo);
9090 if (ret)
9191 return ret;
9292 ret = amdgpu_bo_reserve(bo, false);
@@ -197,7 +197,8 @@ static int amdgpu_cgs_alloc_gpu_mem(void *cgs_device, · 104 unmodified lines
197197
198198 ret = amdgpu_bo_create_restricted(adev, size, PAGE_SIZE,
199199 true, domain, flags,
200− NULL, &placement, &obj);
200+ NULL, &placement, NULL,
201+ &obj);
201202 if (ret) {
202203 DRM_ERROR("(%d) bo create failed\n", ret);
203204 return ret;
@@ -207,44 +208,6 @@ static int amdgpu_cgs_alloc_gpu_mem(void *cgs_device, · 3 unmodified lines
207208 return ret;
208209 }
209210
210−static int amdgpu_cgs_import_gpu_mem(void *cgs_device, int dmabuf_fd,
211− cgs_handle_t *handle)
212−{
213− CGS_FUNC_ADEV;
214− int r;
215− uint32_t dma_handle;
216− struct drm_gem_object *obj;
217− struct amdgpu_bo *bo;
218− struct drm_device *dev = adev->ddev;
219− struct drm_file *file_priv = NULL, *priv;
220−
221− mutex_lock(&dev->struct_mutex);
222− list_for_each_entry(priv, &dev->filelist, lhead) {
223− rcu_read_lock();
224− if (priv->pid == get_pid(task_pid(current)))
225− file_priv = priv;
226− rcu_read_unlock();
227− if (file_priv)
228− break;
229− }
230− mutex_unlock(&dev->struct_mutex);
231− r = dev->driver->prime_fd_to_handle(dev,
232− file_priv, dmabuf_fd,
233− &dma_handle);
234− spin_lock(&file_priv->table_lock);
235−
236− /* Check if we currently have a reference on the object */
237− obj = idr_find(&file_priv->object_idr, dma_handle);
238− if (obj == NULL) {
239− spin_unlock(&file_priv->table_lock);
240− return -EINVAL;
241− }
242− spin_unlock(&file_priv->table_lock);
243− bo = gem_to_amdgpu_bo(obj);
244− *handle = (cgs_handle_t)bo;
245− return 0;
246−}
247−
248211 static int amdgpu_cgs_free_gpu_mem(void *cgs_device, cgs_handle_t handle)
249212 {
250213 struct amdgpu_bo *obj = (struct amdgpu_bo *)handle;
@@ -809,7 +772,6 @@ static const struct cgs_ops amdgpu_cgs_ops = { · 558 unmodified lines
809772 };
810773
811774 static const struct cgs_os_ops amdgpu_cgs_os_ops = {
812− amdgpu_cgs_import_gpu_mem,
813775 amdgpu_cgs_add_irq_source,
814776 amdgpu_cgs_irq_get,
815777 amdgpu_cgs_irq_put
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c+82−58
@@ -154,42 +154,42 @@ int amdgpu_cs_parser_init(struct amdgpu_cs_parser *p, void *data) · 153 unmodified lines
154154 {
155155 union drm_amdgpu_cs *cs = data;
156156 uint64_t *chunk_array_user;
157− uint64_t *chunk_array = NULL;
157+ uint64_t *chunk_array;
158158 struct amdgpu_fpriv *fpriv = p->filp->driver_priv;
159− unsigned size, i;
160− int r = 0;
159+ unsigned size;
160+ int i;
161+ int ret;
161162
162− if (!cs->in.num_chunks)
163− goto out;
163+ if (cs->in.num_chunks == 0)
164+ return 0;
165+
166+ chunk_array = kmalloc_array(cs->in.num_chunks, sizeof(uint64_t), GFP_KERNEL);
167+ if (!chunk_array)
168+ return -ENOMEM;
164169
165170 p->ctx = amdgpu_ctx_get(fpriv, cs->in.ctx_id);
166171 if (!p->ctx) {
167− r = -EINVAL;
168− goto out;
172+ ret = -EINVAL;
173+ goto free_chunk;
169174 }
175+
170176 p->bo_list = amdgpu_bo_list_get(fpriv, cs->in.bo_list_handle);
171177
172178 /* get chunks */
173179 INIT_LIST_HEAD(&p->validated);
174− chunk_array = kmalloc_array(cs->in.num_chunks, sizeof(uint64_t), GFP_KERNEL);
175− if (chunk_array == NULL) {
176− r = -ENOMEM;
177− goto out;
178− }
179−
180180 chunk_array_user = (uint64_t __user *)(cs->in.chunks);
181181 if (copy_from_user(chunk_array, chunk_array_user,
182182 sizeof(uint64_t)*cs->in.num_chunks)) {
183− r = -EFAULT;
184− goto out;
183+ ret = -EFAULT;
184+ goto put_bo_list;
185185 }
186186
187187 p->nchunks = cs->in.num_chunks;
188188 p->chunks = kmalloc_array(p->nchunks, sizeof(struct amdgpu_cs_chunk),
189189 GFP_KERNEL);
190− if (p->chunks == NULL) {
191− r = -ENOMEM;
192− goto out;
190+ if (!p->chunks) {
191+ ret = -ENOMEM;
192+ goto put_bo_list;
193193 }
194194
195195 for (i = 0; i < p->nchunks; i++) {
@@ -200,8 +200,9 @@ int amdgpu_cs_parser_init(struct amdgpu_cs_parser *p, void *data) · 4 unmodified lines
200200 chunk_ptr = (void __user *)chunk_array[i];
201201 if (copy_from_user(&user_chunk, chunk_ptr,
202202 sizeof(struct drm_amdgpu_cs_chunk))) {
203− r = -EFAULT;
204− goto out;
203+ ret = -EFAULT;
204+ i--;
205+ goto free_partial_kdata;
205206 }
206207 p->chunks[i].chunk_id = user_chunk.chunk_id;
207208 p->chunks[i].length_dw = user_chunk.length_dw;
@@ -212,13 +213,14 @@ int amdgpu_cs_parser_init(struct amdgpu_cs_parser *p, void *data) · 4 unmodified lines
212213
213214 p->chunks[i].kdata = drm_malloc_ab(size, sizeof(uint32_t));
214215 if (p->chunks[i].kdata == NULL) {
215− r = -ENOMEM;
216− goto out;
216+ ret = -ENOMEM;
217+ i--;
218+ goto free_partial_kdata;
217219 }
218220 size *= sizeof(uint32_t);
219221 if (copy_from_user(p->chunks[i].kdata, cdata, size)) {
220− r = -EFAULT;
221− goto out;
222+ ret = -EFAULT;
223+ goto free_partial_kdata;
222224 }
223225
224226 switch (p->chunks[i].chunk_id) {
@@ -238,15 +240,15 @@ int amdgpu_cs_parser_init(struct amdgpu_cs_parser *p, void *data) · 13 unmodified lines
238240 gobj = drm_gem_object_lookup(p->adev->ddev,
239241 p->filp, handle);
240242 if (gobj == NULL) {
241− r = -EINVAL;
242− goto out;
243+ ret = -EINVAL;
244+ goto free_partial_kdata;
243245 }
244246
245247 p->uf.bo = gem_to_amdgpu_bo(gobj);
246248 p->uf.offset = fence_data->offset;
247249 } else {
248− r = -EINVAL;
249− goto out;
250+ ret = -EINVAL;
251+ goto free_partial_kdata;
250252 }
251253 break;
252254
@@ -254,19 +256,35 @@ int amdgpu_cs_parser_init(struct amdgpu_cs_parser *p, void *data) · 1 unmodified line
254256 break;
255257
256258 default:
257− r = -EINVAL;
258− goto out;
259+ ret = -EINVAL;
260+ goto free_partial_kdata;
259261 }
260262 }
261263
262264
263265 p->ibs = kcalloc(p->num_ibs, sizeof(struct amdgpu_ib), GFP_KERNEL);
264− if (!p->ibs)
265− r = -ENOMEM;
266+ if (!p->ibs) {
267+ ret = -ENOMEM;
268+ goto free_all_kdata;
269+ }
266270
267−out:
268271 kfree(chunk_array);
269− return r;
272+ return 0;
273+
274+free_all_kdata:
275+ i = p->nchunks - 1;
276+free_partial_kdata:
277+ for (; i >= 0; i--)
278+ drm_free_large(p->chunks[i].kdata);
279+ kfree(p->chunks);
280+put_bo_list:
281+ if (p->bo_list)
282+ amdgpu_bo_list_put(p->bo_list);
283+ amdgpu_ctx_put(p->ctx);
284+free_chunk:
285+ kfree(chunk_array);
286+
287+ return ret;
270288 }
271289
272290 /* Returns how many bytes TTM can move per IB.
@@ -321,25 +339,17 @@ static u64 amdgpu_cs_get_threshold_for_moves(struct amdgpu_device *adev) · 48 unmodified lines
321339 return max(bytes_moved_threshold, 1024*1024ull);
322340 }
323341
324−int amdgpu_cs_list_validate(struct amdgpu_cs_parser *p)
342+int amdgpu_cs_list_validate(struct amdgpu_device *adev,
343+ struct amdgpu_vm *vm,
344+ struct list_head *validated)
325345 {
326− struct amdgpu_fpriv *fpriv = p->filp->driver_priv;
327− struct amdgpu_vm *vm = &fpriv->vm;
328− struct amdgpu_device *adev = p->adev;
329346 struct amdgpu_bo_list_entry *lobj;
330− struct list_head duplicates;
331347 struct amdgpu_bo *bo;
332348 u64 bytes_moved = 0, initial_bytes_moved;
333349 u64 bytes_moved_threshold = amdgpu_cs_get_threshold_for_moves(adev);
334350 int r;
335351
336− INIT_LIST_HEAD(&duplicates);
337− r = ttm_eu_reserve_buffers(&p->ticket, &p->validated, true, &duplicates);
338− if (unlikely(r != 0)) {
339− return r;
340− }
341−
342− list_for_each_entry(lobj, &p->validated, tv.head) {
352+ list_for_each_entry(lobj, validated, tv.head) {
343353 bo = lobj->robj;
344354 if (!bo->pin_count) {
345355 u32 domain = lobj->prefered_domains;
@@ -373,7 +383,6 @@ int amdgpu_cs_list_validate(struct amdgpu_cs_parser *p) · 27 unmodified lines
373383 domain = lobj->allowed_domains;
374384 goto retry;
375385 }
376− ttm_eu_backoff_reservation(&p->ticket, &p->validated);
377386 return r;
378387 }
379388 }
@@ -386,6 +395,7 @@ static int amdgpu_cs_parser_relocs(struct amdgpu_cs_parser *p) · 6 unmodified lines
386395 {
387396 struct amdgpu_fpriv *fpriv = p->filp->driver_priv;
388397 struct amdgpu_cs_buckets buckets;
398+ struct list_head duplicates;
389399 bool need_mmap_lock = false;
390400 int i, r;
391401
@@ -405,8 +415,22 @@ static int amdgpu_cs_parser_relocs(struct amdgpu_cs_parser *p) · 13 unmodified lines
405415 if (need_mmap_lock)
406416 down_read(&current->mm->mmap_sem);
407417
408− r = amdgpu_cs_list_validate(p);
418+ INIT_LIST_HEAD(&duplicates);
419+ r = ttm_eu_reserve_buffers(&p->ticket, &p->validated, true, &duplicates);
420+ if (unlikely(r != 0))
421+ goto error_reserve;
422+
423+ r = amdgpu_cs_list_validate(p->adev, &fpriv->vm, &p->validated);
424+ if (r)
425+ goto error_validate;
426+
427+ r = amdgpu_cs_list_validate(p->adev, &fpriv->vm, &duplicates);
428+
429+error_validate:
430+ if (r)
431+ ttm_eu_backoff_reservation(&p->ticket, &p->validated);
409432
433+error_reserve:
410434 if (need_mmap_lock)
411435 up_read(&current->mm->mmap_sem);
412436
@@ -772,15 +796,15 @@ static int amdgpu_cs_dependencies(struct amdgpu_device *adev, · 359 unmodified lines
772796 return 0;
773797 }
774798
775−static int amdgpu_cs_free_job(struct amdgpu_job *sched_job)
799+static int amdgpu_cs_free_job(struct amdgpu_job *job)
776800 {
777801 int i;
778− if (sched_job->ibs)
779− for (i = 0; i < sched_job->num_ibs; i++)
780− amdgpu_ib_free(sched_job->adev, &sched_job->ibs[i]);
781− kfree(sched_job->ibs);
782− if (sched_job->uf.bo)
783− drm_gem_object_unreference_unlocked(&sched_job->uf.bo->gem_base);
802+ if (job->ibs)
803+ for (i = 0; i < job->num_ibs; i++)
804+ amdgpu_ib_free(job->adev, &job->ibs[i]);
805+ kfree(job->ibs);
806+ if (job->uf.bo)
807+ drm_gem_object_unreference_unlocked(&job->uf.bo->gem_base);
784808 return 0;
785809 }
786810
@@ -804,7 +828,7 @@ int amdgpu_cs_ioctl(struct drm_device *dev, void *data, struct drm_file *filp) · 17 unmodified lines
804828 r = amdgpu_cs_parser_init(parser, data);
805829 if (r) {
806830 DRM_ERROR("Failed to initialize parser !\n");
807− amdgpu_cs_parser_fini(parser, r, false);
831+ kfree(parser);
808832 up_read(&adev->exclusive_lock);
809833 r = amdgpu_cs_handle_lockup(adev, r);
810834 return r;
@@ -842,7 +866,7 @@ int amdgpu_cs_ioctl(struct drm_device *dev, void *data, struct drm_file *filp) · 31 unmodified lines
842866 job = kzalloc(sizeof(struct amdgpu_job), GFP_KERNEL);
843867 if (!job)
844868 return -ENOMEM;
845− job->base.sched = ring->scheduler;
869+ job->base.sched = &ring->sched;
846870 job->base.s_entity = &parser->ctx->rings[ring->idx].entity;
847871 job->adev = parser->adev;
848872 job->ibs = parser->ibs;
@@ -857,7 +881,7 @@ int amdgpu_cs_ioctl(struct drm_device *dev, void *data, struct drm_file *filp) · 8 unmodified lines
857881
858882 job->free_job = amdgpu_cs_free_job;
859883 mutex_lock(&job->job_lock);
860− r = amd_sched_entity_push_job((struct amd_sched_job *)job);
884+ r = amd_sched_entity_push_job(&job->base);
861885 if (r) {
862886 mutex_unlock(&job->job_lock);
863887 amdgpu_cs_free_job(job);
drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c+5−5
@@ -43,10 +43,10 @@ int amdgpu_ctx_init(struct amdgpu_device *adev, bool kernel, · 42 unmodified lines
4343 for (i = 0; i < adev->num_rings; i++) {
4444 struct amd_sched_rq *rq;
4545 if (kernel)
46− rq = &adev->rings[i]->scheduler->kernel_rq;
46+ rq = &adev->rings[i]->sched.kernel_rq;
4747 else
48− rq = &adev->rings[i]->scheduler->sched_rq;
49− r = amd_sched_entity_init(adev->rings[i]->scheduler,
48+ rq = &adev->rings[i]->sched.sched_rq;
49+ r = amd_sched_entity_init(&adev->rings[i]->sched,
5050 &ctx->rings[i].entity,
5151 rq, amdgpu_sched_jobs);
5252 if (r)
@@ -55,7 +55,7 @@ int amdgpu_ctx_init(struct amdgpu_device *adev, bool kernel, · 2 unmodified lines
5555
5656 if (i < adev->num_rings) {
5757 for (j = 0; j < i; j++)
58− amd_sched_entity_fini(adev->rings[j]->scheduler,
58+ amd_sched_entity_fini(&adev->rings[j]->sched,
5959 &ctx->rings[j].entity);
6060 kfree(ctx);
6161 return r;
@@ -75,7 +75,7 @@ void amdgpu_ctx_fini(struct amdgpu_ctx *ctx) · 13 unmodified lines
7575
7676 if (amdgpu_enable_scheduler) {
7777 for (i = 0; i < adev->num_rings; i++)
78− amd_sched_entity_fini(adev->rings[i]->scheduler,
78+ amd_sched_entity_fini(&adev->rings[i]->sched,
7979 &ctx->rings[i].entity);
8080 }
8181 }
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c+7−2
@@ -246,7 +246,7 @@ static int amdgpu_vram_scratch_init(struct amdgpu_device *adev) · 245 unmodified lines
246246 r = amdgpu_bo_create(adev, AMDGPU_GPU_PAGE_SIZE,
247247 PAGE_SIZE, true, AMDGPU_GEM_DOMAIN_VRAM,
248248 AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED,
249− NULL, &adev->vram_scratch.robj);
249+ NULL, NULL, &adev->vram_scratch.robj);
250250 if (r) {
251251 return r;
252252 }
@@ -449,7 +449,8 @@ static int amdgpu_wb_init(struct amdgpu_device *adev) · 196 unmodified lines
449449
450450 if (adev->wb.wb_obj == NULL) {
451451 r = amdgpu_bo_create(adev, AMDGPU_MAX_WB * 4, PAGE_SIZE, true,
452− AMDGPU_GEM_DOMAIN_GTT, 0, NULL, &adev->wb.wb_obj);
452+ AMDGPU_GEM_DOMAIN_GTT, 0, NULL, NULL,
453+ &adev->wb.wb_obj);
453454 if (r) {
454455 dev_warn(adev->dev, "(%d) create WB bo failed\n", r);
455456 return r;
@@ -1650,9 +1651,11 @@ int amdgpu_suspend_kms(struct drm_device *dev, bool suspend, bool fbcon) · 1194 unmodified lines
16501651 drm_kms_helper_poll_disable(dev);
16511652
16521653 /* turn off display hw */
1654+ drm_modeset_lock_all(dev);
16531655 list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
16541656 drm_helper_connector_dpms(connector, DRM_MODE_DPMS_OFF);
16551657 }
1658+ drm_modeset_unlock_all(dev);
16561659
16571660 /* unpin the front buffers */
16581661 list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
@@ -1747,9 +1750,11 @@ int amdgpu_resume_kms(struct drm_device *dev, bool resume, bool fbcon) · 88 unmodified lines
17471750 if (fbcon) {
17481751 drm_helper_resume_force_mode(dev);
17491752 /* turn on display hw */
1753+ drm_modeset_lock_all(dev);
17501754 list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
17511755 drm_helper_connector_dpms(connector, DRM_MODE_DPMS_ON);
17521756 }
1757+ drm_modeset_unlock_all(dev);
17531758 }
17541759
17551760 drm_kms_helper_poll_enable(dev);
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c+4−0
@@ -79,6 +79,7 @@ int amdgpu_exp_hw_support = 0; · 78 unmodified lines
7979 int amdgpu_enable_scheduler = 0;
8080 int amdgpu_sched_jobs = 16;
8181 int amdgpu_sched_hw_submission = 2;
82+int amdgpu_enable_semaphores = 1;
8283
8384 MODULE_PARM_DESC(vramlimit, "Restrict VRAM for testing, in megabytes");
8485 module_param_named(vramlimit, amdgpu_vram_limit, int, 0600);
@@ -152,6 +153,9 @@ module_param_named(sched_jobs, amdgpu_sched_jobs, int, 0444); · 67 unmodified lines
152153 MODULE_PARM_DESC(sched_hw_submission, "the max number of HW submissions (default 2)");
153154 module_param_named(sched_hw_submission, amdgpu_sched_hw_submission, int, 0444);
154155
156+MODULE_PARM_DESC(enable_semaphores, "Enable semaphores (1 = enable (default), 0 = disable)");
157+module_param_named(enable_semaphores, amdgpu_enable_semaphores, int, 0644);
158+
155159 static struct pci_device_id pciidlist[] = {
156160 #ifdef CONFIG_DRM_AMDGPU_CIK
157161 /* Kaveri */
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c+14−11
@@ -609,9 +609,9 @@ int amdgpu_fence_driver_start_ring(struct amdgpu_ring *ring, · 608 unmodified lines
609609 * Init the fence driver for the requested ring (all asics).
610610 * Helper function for amdgpu_fence_driver_init().
611611 */
612−void amdgpu_fence_driver_init_ring(struct amdgpu_ring *ring)
612+int amdgpu_fence_driver_init_ring(struct amdgpu_ring *ring)
613613 {
614− int i;
614+ int i, r;
615615
616616 ring->fence_drv.cpu_addr = NULL;
617617 ring->fence_drv.gpu_addr = 0;
@@ -625,15 +625,19 @@ void amdgpu_fence_driver_init_ring(struct amdgpu_ring *ring) · 7 unmodified lines
625625 amdgpu_fence_check_lockup);
626626 ring->fence_drv.ring = ring;
627627
628+ init_waitqueue_head(&ring->fence_drv.fence_queue);
629+
628630 if (amdgpu_enable_scheduler) {
629− ring->scheduler = amd_sched_create(&amdgpu_sched_ops,
630− ring->idx,
631− amdgpu_sched_hw_submission,
632− (void *)ring->adev);
633− if (!ring->scheduler)
634− DRM_ERROR("Failed to create scheduler on ring %d.\n",
635− ring->idx);
631+ r = amd_sched_init(&ring->sched, &amdgpu_sched_ops,
632+ amdgpu_sched_hw_submission, ring->name);
633+ if (r) {
634+ DRM_ERROR("Failed to create scheduler on ring %s.\n",
635+ ring->name);
636+ return r;
637+ }
636638 }
639+
640+ return 0;
637641 }
638642
639643 /**
@@ -681,8 +685,7 @@ void amdgpu_fence_driver_fini(struct amdgpu_device *adev) · 41 unmodified lines
681685 wake_up_all(&ring->fence_drv.fence_queue);
682686 amdgpu_irq_put(adev, ring->fence_drv.irq_src,
683687 ring->fence_drv.irq_type);
684− if (ring->scheduler)
685− amd_sched_destroy(ring->scheduler);
688+ amd_sched_fini(&ring->sched);
686689 ring->fence_drv.initialized = false;
687690 }
688691 mutex_unlock(&adev->ring_lock);
drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c+1−1
@@ -127,7 +127,7 @@ int amdgpu_gart_table_vram_alloc(struct amdgpu_device *adev) · 126 unmodified lines
127127 r = amdgpu_bo_create(adev, adev->gart.table_size,
128128 PAGE_SIZE, true, AMDGPU_GEM_DOMAIN_VRAM,
129129 AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED,
130− NULL, &adev->gart.robj);
130+ NULL, NULL, &adev->gart.robj);
131131 if (r) {
132132 return r;
133133 }
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c+12−4
@@ -69,7 +69,8 @@ int amdgpu_gem_object_create(struct amdgpu_device *adev, unsigned long size, · 68 unmodified lines
6969 }
7070 }
7171 retry:
72− r = amdgpu_bo_create(adev, size, alignment, kernel, initial_domain, flags, NULL, &robj);
72+ r = amdgpu_bo_create(adev, size, alignment, kernel, initial_domain,
73+ flags, NULL, NULL, &robj);
7374 if (r) {
7475 if (r != -ERESTARTSYS) {
7576 if (initial_domain == AMDGPU_GEM_DOMAIN_VRAM) {
@@ -426,6 +427,10 @@ int amdgpu_gem_metadata_ioctl(struct drm_device *dev, void *data, · 350 unmodified lines
426427 &args->data.data_size_bytes,
427428 &args->data.flags);
428429 } else if (args->op == AMDGPU_GEM_METADATA_OP_SET_METADATA) {
430+ if (args->data.data_size_bytes > sizeof(args->data.data)) {
431+ r = -EINVAL;
432+ goto unreserve;
433+ }
429434 r = amdgpu_bo_set_tiling_flags(robj, args->data.tiling_info);
430435 if (!r)
431436 r = amdgpu_bo_set_metadata(robj, args->data.data,
@@ -433,6 +438,7 @@ int amdgpu_gem_metadata_ioctl(struct drm_device *dev, void *data, · 1 unmodified line
433438 args->data.flags);
434439 }
435440
441+unreserve:
436442 amdgpu_bo_unreserve(robj);
437443 out:
438444 drm_gem_object_unreference_unlocked(gobj);
@@ -454,11 +460,12 @@ static void amdgpu_gem_va_update_vm(struct amdgpu_device *adev, · 15 unmodified lines
454460 struct ttm_validate_buffer tv, *entry;
455461 struct amdgpu_bo_list_entry *vm_bos;
456462 struct ww_acquire_ctx ticket;
457− struct list_head list;
463+ struct list_head list, duplicates;
458464 unsigned domain;
459465 int r;
460466
461467 INIT_LIST_HEAD(&list);
468+ INIT_LIST_HEAD(&duplicates);
462469
463470 tv.bo = &bo_va->bo->tbo;
464471 tv.shared = true;
@@ -468,7 +475,8 @@ static void amdgpu_gem_va_update_vm(struct amdgpu_device *adev, · 3 unmodified lines
468475 if (!vm_bos)
469476 return;
470477
471− r = ttm_eu_reserve_buffers(&ticket, &list, true, NULL);
478+ /* Provide duplicates to avoid -EALREADY */
479+ r = ttm_eu_reserve_buffers(&ticket, &list, true, &duplicates);
472480 if (r)
473481 goto error_free;
474482
@@ -651,7 +659,7 @@ int amdgpu_mode_dumb_create(struct drm_file *file_priv, · 176 unmodified lines
651659 int r;
652660
653661 args->pitch = amdgpu_align_pitch(adev, args->width, args->bpp, 0) * ((args->bpp + 1) / 8);
654− args->size = args->pitch * args->height;
662+ args->size = (u64)args->pitch * args->height;
655663 args->size = ALIGN(args->size, PAGE_SIZE);
656664
657665 r = amdgpu_gem_object_create(adev, args->size, 0,
drivers/gpu/drm/amd/amdgpu/amdgpu_ih.c+1−1
@@ -43,7 +43,7 @@ static int amdgpu_ih_ring_alloc(struct amdgpu_device *adev) · 42 unmodified lines
4343 r = amdgpu_bo_create(adev, adev->irq.ih.ring_size,
4444 PAGE_SIZE, true,
4545 AMDGPU_GEM_DOMAIN_GTT, 0,
46− NULL, &adev->irq.ih.ring_obj);
46+ NULL, NULL, &adev->irq.ih.ring_obj);
4747 if (r) {
4848 DRM_ERROR("amdgpu: failed to create ih ring buffer (%d).\n", r);
4949 return r;
drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c+1−1
@@ -140,7 +140,7 @@ void amdgpu_irq_preinstall(struct drm_device *dev) · 139 unmodified lines
140140 */
141141 int amdgpu_irq_postinstall(struct drm_device *dev)
142142 {
143− dev->max_vblank_count = 0x001fffff;
143+ dev->max_vblank_count = 0x00ffffff;
144144 return 0;
145145 }
146146
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c+3−2
@@ -390,7 +390,7 @@ static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file · 389 unmodified lines
390390 min((size_t)size, sizeof(vram_gtt))) ? -EFAULT : 0;
391391 }
392392 case AMDGPU_INFO_READ_MMR_REG: {
393− unsigned n, alloc_size = info->read_mmr_reg.count * 4;
393+ unsigned n, alloc_size;
394394 uint32_t *regs;
395395 unsigned se_num = (info->read_mmr_reg.instance >>
396396 AMDGPU_INFO_MMR_SE_INDEX_SHIFT) &
@@ -406,9 +406,10 @@ static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file · 9 unmodified lines
406406 if (sh_num == AMDGPU_INFO_MMR_SH_INDEX_MASK)
407407 sh_num = 0xffffffff;
408408
409− regs = kmalloc(alloc_size, GFP_KERNEL);
409+ regs = kmalloc_array(info->read_mmr_reg.count, sizeof(*regs), GFP_KERNEL);
410410 if (!regs)
411411 return -ENOMEM;
412+ alloc_size = info->read_mmr_reg.count * sizeof(*regs);
412413
413414 for (i = 0; i < info->read_mmr_reg.count; i++)
414415 if (amdgpu_asic_read_register(adev, se_num, sh_num,
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c+9−10
@@ -215,6 +215,7 @@ int amdgpu_bo_create_restricted(struct amdgpu_device *adev, · 214 unmodified lines
215215 bool kernel, u32 domain, u64 flags,
216216 struct sg_table *sg,
217217 struct ttm_placement *placement,
218+ struct reservation_object *resv,
218219 struct amdgpu_bo **bo_ptr)
219220 {
220221 struct amdgpu_bo *bo;
@@ -261,7 +262,7 @@ int amdgpu_bo_create_restricted(struct amdgpu_device *adev, · 40 unmodified lines
261262 /* Kernel allocation are uninterruptible */
262263 r = ttm_bo_init(&adev->mman.bdev, &bo->tbo, size, type,
263264 &bo->placement, page_align, !kernel, NULL,
264− acc_size, sg, NULL, &amdgpu_ttm_bo_destroy);
265+ acc_size, sg, resv, &amdgpu_ttm_bo_destroy);
265266 if (unlikely(r != 0)) {
266267 return r;
267268 }
@@ -275,7 +276,9 @@ int amdgpu_bo_create_restricted(struct amdgpu_device *adev, · 7 unmodified lines
275276 int amdgpu_bo_create(struct amdgpu_device *adev,
276277 unsigned long size, int byte_align,
277278 bool kernel, u32 domain, u64 flags,
278− struct sg_table *sg, struct amdgpu_bo **bo_ptr)
279+ struct sg_table *sg,
280+ struct reservation_object *resv,
281+ struct amdgpu_bo **bo_ptr)
279282 {
280283 struct ttm_placement placement = {0};
281284 struct ttm_place placements[AMDGPU_GEM_DOMAIN_MAX + 1];
@@ -286,11 +289,9 @@ int amdgpu_bo_create(struct amdgpu_device *adev, · 4 unmodified lines
286289 amdgpu_ttm_placement_init(adev, &placement,
287290 placements, domain, flags);
288291
289− return amdgpu_bo_create_restricted(adev, size, byte_align,
290− kernel, domain, flags,
291− sg,
292− &placement,
293− bo_ptr);
292+ return amdgpu_bo_create_restricted(adev, size, byte_align, kernel,
293+ domain, flags, sg, &placement,
294+ resv, bo_ptr);
294295 }
295296
296297 int amdgpu_bo_kmap(struct amdgpu_bo *bo, void **ptr)
@@ -535,12 +536,10 @@ int amdgpu_bo_set_metadata (struct amdgpu_bo *bo, void *metadata, · 238 unmodified lines
535536 if (metadata == NULL)
536537 return -EINVAL;
537538
538− buffer = kzalloc(metadata_size, GFP_KERNEL);
539+ buffer = kmemdup(metadata, metadata_size, GFP_KERNEL);
539540 if (buffer == NULL)
540541 return -ENOMEM;
541542
542− memcpy(buffer, metadata, metadata_size);
543−
544543 kfree(bo->metadata);
545544 bo->metadata_flags = flags;
546545 bo->metadata = buffer;
drivers/gpu/drm/amd/amdgpu/amdgpu_object.h+2−0
@@ -129,12 +129,14 @@ int amdgpu_bo_create(struct amdgpu_device *adev, · 128 unmodified lines
129129 unsigned long size, int byte_align,
130130 bool kernel, u32 domain, u64 flags,
131131 struct sg_table *sg,
132+ struct reservation_object *resv,
132133 struct amdgpu_bo **bo_ptr);
133134 int amdgpu_bo_create_restricted(struct amdgpu_device *adev,
134135 unsigned long size, int byte_align,
135136 bool kernel, u32 domain, u64 flags,
136137 struct sg_table *sg,
137138 struct ttm_placement *placement,
139+ struct reservation_object *resv,
138140 struct amdgpu_bo **bo_ptr);
139141 int amdgpu_bo_kmap(struct amdgpu_bo *bo, void **ptr);
140142 void amdgpu_bo_kunmap(struct amdgpu_bo *bo);
drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c+4−1
@@ -61,12 +61,15 @@ struct drm_gem_object *amdgpu_gem_prime_import_sg_table(struct drm_device *dev, · 60 unmodified lines
6161 struct dma_buf_attachment *attach,
6262 struct sg_table *sg)
6363 {
64+ struct reservation_object *resv = attach->dmabuf->resv;
6465 struct amdgpu_device *adev = dev->dev_private;
6566 struct amdgpu_bo *bo;
6667 int ret;
6768
69+ ww_mutex_lock(&resv->lock, NULL);
6870 ret = amdgpu_bo_create(adev, attach->dmabuf->size, PAGE_SIZE, false,
69− AMDGPU_GEM_DOMAIN_GTT, 0, sg, &bo);
71+ AMDGPU_GEM_DOMAIN_GTT, 0, sg, resv, &bo);
72+ ww_mutex_unlock(&resv->lock);
7073 if (ret)
7174 return ERR_PTR(ret);
7275
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c+4−4
@@ -357,11 +357,11 @@ int amdgpu_ring_init(struct amdgpu_device *adev, struct amdgpu_ring *ring, · 356 unmodified lines
357357 ring->adev = adev;
358358 ring->idx = adev->num_rings++;
359359 adev->rings[ring->idx] = ring;
360− amdgpu_fence_driver_init_ring(ring);
360+ r = amdgpu_fence_driver_init_ring(ring);
361+ if (r)
362+ return r;
361363 }
362364
363− init_waitqueue_head(&ring->fence_drv.fence_queue);
364−
365365 r = amdgpu_wb_get(adev, &ring->rptr_offs);
366366 if (r) {
367367 dev_err(adev->dev, "(%d) ring rptr_offs wb alloc failed\n", r);
@@ -407,7 +407,7 @@ int amdgpu_ring_init(struct amdgpu_device *adev, struct amdgpu_ring *ring, · 39 unmodified lines
407407 if (ring->ring_obj == NULL) {
408408 r = amdgpu_bo_create(adev, ring->ring_size, PAGE_SIZE, true,
409409 AMDGPU_GEM_DOMAIN_GTT, 0,
410− NULL, &ring->ring_obj);
410+ NULL, NULL, &ring->ring_obj);
411411 if (r) {
412412 dev_err(adev->dev, "(%d) ring create failed\n", r);
413413 return r;
drivers/gpu/drm/amd/amdgpu/amdgpu_sa.c+31−16
@@ -64,8 +64,8 @@ int amdgpu_sa_bo_manager_init(struct amdgpu_device *adev, · 63 unmodified lines
6464 INIT_LIST_HEAD(&sa_manager->flist[i]);
6565 }
6666
67− r = amdgpu_bo_create(adev, size, align, true,
68− domain, 0, NULL, &sa_manager->bo);
67+ r = amdgpu_bo_create(adev, size, align, true, domain,
68+ 0, NULL, NULL, &sa_manager->bo);
6969 if (r) {
7070 dev_err(adev->dev, "(%d) failed to allocate bo for manager\n", r);
7171 return r;
@@ -145,8 +145,13 @@ static uint32_t amdgpu_sa_get_ring_from_fence(struct fence *f) · 73 unmodified lines
145145 struct amd_sched_fence *s_fence;
146146
147147 s_fence = to_amd_sched_fence(f);
148− if (s_fence)
149− return s_fence->scheduler->ring_id;
148+ if (s_fence) {
149+ struct amdgpu_ring *ring;
150+
151+ ring = container_of(s_fence->sched, struct amdgpu_ring, sched);
152+ return ring->idx;
153+ }
154+
150155 a_fence = to_amdgpu_fence(f);
151156 if (a_fence)
152157 return a_fence->ring->idx;
@@ -412,6 +417,26 @@ void amdgpu_sa_bo_free(struct amdgpu_device *adev, struct amdgpu_sa_bo **sa_bo, · 259 unmodified lines
412417 }
413418
414419 #if defined(CONFIG_DEBUG_FS)
420+
421+static void amdgpu_sa_bo_dump_fence(struct fence *fence, struct seq_file *m)
422+{
423+ struct amdgpu_fence *a_fence = to_amdgpu_fence(fence);
424+ struct amd_sched_fence *s_fence = to_amd_sched_fence(fence);
425+
426+ if (a_fence)
427+ seq_printf(m, " protected by 0x%016llx on ring %d",
428+ a_fence->seq, a_fence->ring->idx);
429+
430+ if (s_fence) {
431+ struct amdgpu_ring *ring;
432+
433+
434+ ring = container_of(s_fence->sched, struct amdgpu_ring, sched);
435+ seq_printf(m, " protected by 0x%016x on ring %d",
436+ s_fence->base.seqno, ring->idx);
437+ }
438+}
439+
415440 void amdgpu_sa_bo_dump_debug_info(struct amdgpu_sa_manager *sa_manager,
416441 struct seq_file *m)
417442 {
@@ -428,18 +453,8 @@ void amdgpu_sa_bo_dump_debug_info(struct amdgpu_sa_manager *sa_manager, · 10 unmodified lines
428453 }
429454 seq_printf(m, "[0x%010llx 0x%010llx] size %8lld",
430455 soffset, eoffset, eoffset - soffset);
431− if (i->fence) {
432− struct amdgpu_fence *a_fence = to_amdgpu_fence(i->fence);
433− struct amd_sched_fence *s_fence = to_amd_sched_fence(i->fence);
434− if (a_fence)
435− seq_printf(m, " protected by 0x%016llx on ring %d",
436− a_fence->seq, a_fence->ring->idx);
437− if (s_fence)
438− seq_printf(m, " protected by 0x%016x on ring %d",
439− s_fence->base.seqno,
440− s_fence->scheduler->ring_id);
441−
442− }
456+ if (i->fence)
457+ amdgpu_sa_bo_dump_fence(i->fence, m);
443458 seq_printf(m, "\n");
444459 }
445460 spin_unlock(&sa_manager->wq.lock);
drivers/gpu/drm/amd/amdgpu/amdgpu_sched.c+25−40
@@ -27,63 +27,48 @@ · 26 unmodified lines
2727 #include <drm/drmP.h>
2828 #include "amdgpu.h"
2929
30−static struct fence *amdgpu_sched_dependency(struct amd_sched_job *job)
30+static struct fence *amdgpu_sched_dependency(struct amd_sched_job *sched_job)
3131 {
32− struct amdgpu_job *sched_job = (struct amdgpu_job *)job;
33− return amdgpu_sync_get_fence(&sched_job->ibs->sync);
32+ struct amdgpu_job *job = to_amdgpu_job(sched_job);
33+ return amdgpu_sync_get_fence(&job->ibs->sync);
3434 }
3535
36−static struct fence *amdgpu_sched_run_job(struct amd_sched_job *job)
36+static struct fence *amdgpu_sched_run_job(struct amd_sched_job *sched_job)
3737 {
38− struct amdgpu_job *sched_job;
39− struct amdgpu_fence *fence;
38+ struct amdgpu_fence *fence = NULL;
39+ struct amdgpu_job *job;
4040 int r;
4141
42− if (!job) {
42+ if (!sched_job) {
4343 DRM_ERROR("job is null\n");
4444 return NULL;
4545 }
46− sched_job = (struct amdgpu_job *)job;
47− mutex_lock(&sched_job->job_lock);
48− r = amdgpu_ib_schedule(sched_job->adev,
49− sched_job->num_ibs,
50− sched_job->ibs,
51− sched_job->base.owner);
52− if (r)
46+ job = to_amdgpu_job(sched_job);
47+ mutex_lock(&job->job_lock);
48+ r = amdgpu_ib_schedule(job->adev,
49+ job->num_ibs,
50+ job->ibs,
51+ job->base.owner);
52+ if (r) {
53+ DRM_ERROR("Error scheduling IBs (%d)\n", r);
5354 goto err;
54− fence = amdgpu_fence_ref(sched_job->ibs[sched_job->num_ibs - 1].fence);
55−
56− if (sched_job->free_job)
57− sched_job->free_job(sched_job);
55+ }
5856
59− mutex_unlock(&sched_job->job_lock);
60− return &fence->base;
57+ fence = amdgpu_fence_ref(job->ibs[job->num_ibs - 1].fence);
6158
6259 err:
63− DRM_ERROR("Run job error\n");
64− mutex_unlock(&sched_job->job_lock);
65− job->sched->ops->process_job(job);
66− return NULL;
67−}
60+ if (job->free_job)
61+ job->free_job(job);
6862
69−static void amdgpu_sched_process_job(struct amd_sched_job *job)
70−{
71− struct amdgpu_job *sched_job;
72−
73− if (!job) {
74− DRM_ERROR("job is null\n");
75− return;
76− }
77− sched_job = (struct amdgpu_job *)job;
78− /* after processing job, free memory */
79− fence_put(&sched_job->base.s_fence->base);
80− kfree(sched_job);
63+ mutex_unlock(&job->job_lock);
64+ fence_put(&job->base.s_fence->base);
65+ kfree(job);
66+ return fence ? &fence->base : NULL;
8167 }
8268
8369 struct amd_sched_backend_ops amdgpu_sched_ops = {
8470 .dependency = amdgpu_sched_dependency,
8571 .run_job = amdgpu_sched_run_job,
86− .process_job = amdgpu_sched_process_job
8772 };
8873
8974 int amdgpu_sched_ib_submit_kernel_helper(struct amdgpu_device *adev,
@@ -100,7 +85,7 @@ int amdgpu_sched_ib_submit_kernel_helper(struct amdgpu_device *adev, · 10 unmodified lines
10085 kzalloc(sizeof(struct amdgpu_job), GFP_KERNEL);
10186 if (!job)
10287 return -ENOMEM;
103− job->base.sched = ring->scheduler;
88+ job->base.sched = &ring->sched;
10489 job->base.s_entity = &adev->kernel_ctx.rings[ring->idx].entity;
10590 job->adev = adev;
10691 job->ibs = ibs;
@@ -109,7 +94,7 @@ int amdgpu_sched_ib_submit_kernel_helper(struct amdgpu_device *adev, · 2 unmodified lines
10994 mutex_init(&job->job_lock);
11095 job->free_job = free_job;
11196 mutex_lock(&job->job_lock);
112− r = amd_sched_entity_push_job((struct amd_sched_job *)job);
97+ r = amd_sched_entity_push_job(&job->base);
11398 if (r) {
11499 mutex_unlock(&job->job_lock);
115100 kfree(job);
drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c+24−3
@@ -65,8 +65,14 @@ static bool amdgpu_sync_same_dev(struct amdgpu_device *adev, struct fence *f) · 64 unmodified lines
6565
6666 if (a_fence)
6767 return a_fence->ring->adev == adev;
68− if (s_fence)
69− return (struct amdgpu_device *)s_fence->scheduler->priv == adev;
68+
69+ if (s_fence) {
70+ struct amdgpu_ring *ring;
71+
72+ ring = container_of(s_fence->sched, struct amdgpu_ring, sched);
73+ return ring->adev == adev;
74+ }
75+
7076 return false;
7177 }
7278
@@ -251,6 +257,20 @@ int amdgpu_sync_wait(struct amdgpu_sync *sync) · 178 unmodified lines
251257 fence_put(e->fence);
252258 kfree(e);
253259 }
260+
261+ if (amdgpu_enable_semaphores)
262+ return 0;
263+
264+ for (i = 0; i < AMDGPU_MAX_RINGS; ++i) {
265+ struct amdgpu_fence *fence = sync->sync_to[i];
266+ if (!fence)
267+ continue;
268+
269+ r = fence_wait(&fence->base, false);
270+ if (r)
271+ return r;
272+ }
273+
254274 return 0;
255275 }
256276
@@ -285,7 +305,8 @@ int amdgpu_sync_rings(struct amdgpu_sync *sync, · 28 unmodified lines
285305 return -EINVAL;
286306 }
287307
288− if (amdgpu_enable_scheduler || (count >= AMDGPU_NUM_SYNCS)) {
308+ if (amdgpu_enable_scheduler || !amdgpu_enable_semaphores ||
309+ (count >= AMDGPU_NUM_SYNCS)) {
289310 /* not enough room, wait manually */
290311 r = fence_wait(&fence->base, false);
291312 if (r)
drivers/gpu/drm/amd/amdgpu/amdgpu_test.c+5−3
@@ -59,8 +59,9 @@ static void amdgpu_do_test_moves(struct amdgpu_device *adev) · 58 unmodified lines
5959 goto out_cleanup;
6060 }
6161
62− r = amdgpu_bo_create(adev, size, PAGE_SIZE, true, AMDGPU_GEM_DOMAIN_VRAM, 0,
63− NULL, &vram_obj);
62+ r = amdgpu_bo_create(adev, size, PAGE_SIZE, true,
63+ AMDGPU_GEM_DOMAIN_VRAM, 0,
64+ NULL, NULL, &vram_obj);
6465 if (r) {
6566 DRM_ERROR("Failed to create VRAM object\n");
6667 goto out_cleanup;
@@ -80,7 +81,8 @@ static void amdgpu_do_test_moves(struct amdgpu_device *adev) · 13 unmodified lines
8081 struct fence *fence = NULL;
8182
8283 r = amdgpu_bo_create(adev, size, PAGE_SIZE, true,
83− AMDGPU_GEM_DOMAIN_GTT, 0, NULL, gtt_obj + i);
84+ AMDGPU_GEM_DOMAIN_GTT, 0, NULL,
85+ NULL, gtt_obj + i);
8486 if (r) {
8587 DRM_ERROR("Failed to create GTT object %d\n", i);
8688 goto out_lclean;
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c+1−1
@@ -861,7 +861,7 @@ int amdgpu_ttm_init(struct amdgpu_device *adev) · 860 unmodified lines
861861 r = amdgpu_bo_create(adev, 256 * 1024, PAGE_SIZE, true,
862862 AMDGPU_GEM_DOMAIN_VRAM,
863863 AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED,
864− NULL, &adev->stollen_vga_memory);
864+ NULL, NULL, &adev->stollen_vga_memory);
865865 if (r) {
866866 return r;
867867 }
drivers/gpu/drm/amd/amdgpu/amdgpu_ucode.c+1−1
@@ -247,7 +247,7 @@ int amdgpu_ucode_init_bo(struct amdgpu_device *adev) · 246 unmodified lines
247247 const struct common_firmware_header *header = NULL;
248248
249249 err = amdgpu_bo_create(adev, adev->firmware.fw_size, PAGE_SIZE, true,
250− AMDGPU_GEM_DOMAIN_GTT, 0, NULL, bo);
250+ AMDGPU_GEM_DOMAIN_GTT, 0, NULL, NULL, bo);
251251 if (err) {
252252 dev_err(adev->dev, "(%d) Firmware buffer allocate failed\n", err);
253253 err = -ENOMEM;
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c+47−33
@@ -156,7 +156,7 @@ int amdgpu_uvd_sw_init(struct amdgpu_device *adev) · 155 unmodified lines
156156 r = amdgpu_bo_create(adev, bo_size, PAGE_SIZE, true,
157157 AMDGPU_GEM_DOMAIN_VRAM,
158158 AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED,
159− NULL, &adev->uvd.vcpu_bo);
159+ NULL, NULL, &adev->uvd.vcpu_bo);
160160 if (r) {
161161 dev_err(adev->dev, "(%d) failed to allocate UVD bo\n", r);
162162 return r;
@@ -543,46 +543,60 @@ static int amdgpu_uvd_cs_msg(struct amdgpu_uvd_cs_ctx *ctx, · 380 unmodified lines
543543 return -EINVAL;
544544 }
545545
546− if (msg_type == 1) {
546+ switch (msg_type) {
547+ case 0:
548+ /* it's a create msg, calc image size (width * height) */
549+ amdgpu_bo_kunmap(bo);
550+
551+ /* try to alloc a new handle */
552+ for (i = 0; i < AMDGPU_MAX_UVD_HANDLES; ++i) {
553+ if (atomic_read(&adev->uvd.handles[i]) == handle) {
554+ DRM_ERROR("Handle 0x%x already in use!\n", handle);
555+ return -EINVAL;
556+ }
557+
558+ if (!atomic_cmpxchg(&adev->uvd.handles[i], 0, handle)) {
559+ adev->uvd.filp[i] = ctx->parser->filp;
560+ return 0;
561+ }
562+ }
563+
564+ DRM_ERROR("No more free UVD handles!\n");
565+ return -EINVAL;
566+
567+ case 1:
547568 /* it's a decode msg, calc buffer sizes */
548569 r = amdgpu_uvd_cs_msg_decode(msg, ctx->buf_sizes);
549570 amdgpu_bo_kunmap(bo);
550571 if (r)
551572 return r;
552573
553− } else if (msg_type == 2) {
574+ /* validate the handle */
575+ for (i = 0; i < AMDGPU_MAX_UVD_HANDLES; ++i) {
576+ if (atomic_read(&adev->uvd.handles[i]) == handle) {
577+ if (adev->uvd.filp[i] != ctx->parser->filp) {
578+ DRM_ERROR("UVD handle collision detected!\n");
579+ return -EINVAL;
580+ }
581+ return 0;
582+ }
583+ }
584+
585+ DRM_ERROR("Invalid UVD handle 0x%x!\n", handle);
586+ return -ENOENT;
587+
588+ case 2:
554589 /* it's a destroy msg, free the handle */
555590 for (i = 0; i < AMDGPU_MAX_UVD_HANDLES; ++i)
556591 atomic_cmpxchg(&adev->uvd.handles[i], handle, 0);
557592 amdgpu_bo_kunmap(bo);
558593 return 0;
559− } else {
560− /* it's a create msg */
561− amdgpu_bo_kunmap(bo);
562−
563− if (msg_type != 0) {
564− DRM_ERROR("Illegal UVD message type (%d)!\n", msg_type);
565− return -EINVAL;
566− }
567−
568− /* it's a create msg, no special handling needed */
569− }
570−
571− /* create or decode, validate the handle */
572− for (i = 0; i < AMDGPU_MAX_UVD_HANDLES; ++i) {
573− if (atomic_read(&adev->uvd.handles[i]) == handle)
574− return 0;
575− }
576594
577− /* handle not found try to alloc a new one */
578− for (i = 0; i < AMDGPU_MAX_UVD_HANDLES; ++i) {
579− if (!atomic_cmpxchg(&adev->uvd.handles[i], 0, handle)) {
580− adev->uvd.filp[i] = ctx->parser->filp;
581− return 0;
582− }
595+ default:
596+ DRM_ERROR("Illegal UVD message type (%d)!\n", msg_type);
597+ return -EINVAL;
583598 }
584−
585− DRM_ERROR("No more free UVD handles!\n");
599+ BUG();
586600 return -EINVAL;
587601 }
588602
@@ -805,10 +819,10 @@ int amdgpu_uvd_ring_parse_cs(struct amdgpu_cs_parser *parser, uint32_t ib_idx) · 216 unmodified lines
805819 }
806820
807821 static int amdgpu_uvd_free_job(
808− struct amdgpu_job *sched_job)
822+ struct amdgpu_job *job)
809823 {
810− amdgpu_ib_free(sched_job->adev, sched_job->ibs);
811− kfree(sched_job->ibs);
824+ amdgpu_ib_free(job->adev, job->ibs);
825+ kfree(job->ibs);
812826 return 0;
813827 }
814828
@@ -905,7 +919,7 @@ int amdgpu_uvd_get_create_msg(struct amdgpu_ring *ring, uint32_t handle, · 90 unmodified lines
905919 r = amdgpu_bo_create(adev, 1024, PAGE_SIZE, true,
906920 AMDGPU_GEM_DOMAIN_VRAM,
907921 AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED,
908− NULL, &bo);
922+ NULL, NULL, &bo);
909923 if (r)
910924 return r;
911925
@@ -954,7 +968,7 @@ int amdgpu_uvd_get_destroy_msg(struct amdgpu_ring *ring, uint32_t handle, · 42 unmodified lines
954968 r = amdgpu_bo_create(adev, 1024, PAGE_SIZE, true,
955969 AMDGPU_GEM_DOMAIN_VRAM,
956970 AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED,
957− NULL, &bo);
971+ NULL, NULL, &bo);
958972 if (r)
959973 return r;
960974
drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c+4−4
@@ -143,7 +143,7 @@ int amdgpu_vce_sw_init(struct amdgpu_device *adev, unsigned long size) · 142 unmodified lines
143143 r = amdgpu_bo_create(adev, size, PAGE_SIZE, true,
144144 AMDGPU_GEM_DOMAIN_VRAM,
145145 AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED,
146− NULL, &adev->vce.vcpu_bo);
146+ NULL, NULL, &adev->vce.vcpu_bo);
147147 if (r) {
148148 dev_err(adev->dev, "(%d) failed to allocate VCE bo\n", r);
149149 return r;
@@ -342,10 +342,10 @@ void amdgpu_vce_free_handles(struct amdgpu_device *adev, struct drm_file *filp) · 192 unmodified lines
342342 }
343343
344344 static int amdgpu_vce_free_job(
345− struct amdgpu_job *sched_job)
345+ struct amdgpu_job *job)
346346 {
347− amdgpu_ib_free(sched_job->adev, sched_job->ibs);
348− kfree(sched_job->ibs);
347+ amdgpu_ib_free(job->adev, job->ibs);
348+ kfree(job->ibs);
349349 return 0;
350350 }
351351
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c+11−34
@@ -316,12 +316,12 @@ static void amdgpu_vm_update_pages(struct amdgpu_device *adev, · 315 unmodified lines
316316 }
317317 }
318318
319−int amdgpu_vm_free_job(struct amdgpu_job *sched_job)
319+int amdgpu_vm_free_job(struct amdgpu_job *job)
320320 {
321321 int i;
322− for (i = 0; i < sched_job->num_ibs; i++)
323− amdgpu_ib_free(sched_job->adev, &sched_job->ibs[i]);
324− kfree(sched_job->ibs);
322+ for (i = 0; i < job->num_ibs; i++)
323+ amdgpu_ib_free(job->adev, &job->ibs[i]);
324+ kfree(job->ibs);
325325 return 0;
326326 }
327327
@@ -685,31 +685,6 @@ static int amdgpu_vm_update_ptes(struct amdgpu_device *adev, · 357 unmodified lines
685685 return 0;
686686 }
687687
688−/**
689− * amdgpu_vm_fence_pts - fence page tables after an update
690− *
691− * @vm: requested vm
692− * @start: start of GPU address range
693− * @end: end of GPU address range
694− * @fence: fence to use
695− *
696− * Fence the page tables in the range @start - @end (cayman+).
697− *
698− * Global and local mutex must be locked!
699− */
700−static void amdgpu_vm_fence_pts(struct amdgpu_vm *vm,
701− uint64_t start, uint64_t end,
702− struct fence *fence)
703−{
704− unsigned i;
705−
706− start >>= amdgpu_vm_block_size;
707− end >>= amdgpu_vm_block_size;
708−
709− for (i = start; i <= end; ++i)
710− amdgpu_bo_fence(vm->page_tables[i].bo, fence, true);
711−}
712−
713688 /**
714689 * amdgpu_vm_bo_update_mapping - update a mapping in the vm page table
715690 *
@@ -813,8 +788,7 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev, · 97 unmodified lines
813788 if (r)
814789 goto error_free;
815790
816− amdgpu_vm_fence_pts(vm, mapping->it.start,
817− mapping->it.last + 1, f);
791+ amdgpu_bo_fence(vm->page_directory, f, true);
818792 if (fence) {
819793 fence_put(*fence);
820794 *fence = fence_get(f);
@@ -855,7 +829,7 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev, · 34 unmodified lines
855829 int r;
856830
857831 if (mem) {
858− addr = mem->start << PAGE_SHIFT;
832+ addr = (u64)mem->start << PAGE_SHIFT;
859833 if (mem->mem_type != TTM_PL_TT)
860834 addr += adev->vm_manager.vram_base_offset;
861835 } else {
@@ -1089,6 +1063,7 @@ int amdgpu_vm_bo_map(struct amdgpu_device *adev, · 227 unmodified lines
10891063
10901064 /* walk over the address space and allocate the page tables */
10911065 for (pt_idx = saddr; pt_idx <= eaddr; ++pt_idx) {
1066+ struct reservation_object *resv = vm->page_directory->tbo.resv;
10921067 struct amdgpu_bo *pt;
10931068
10941069 if (vm->page_tables[pt_idx].bo)
@@ -1097,11 +1072,13 @@ int amdgpu_vm_bo_map(struct amdgpu_device *adev, · 2 unmodified lines
10971072 /* drop mutex to allocate and clear page table */
10981073 mutex_unlock(&vm->mutex);
10991074
1075+ ww_mutex_lock(&resv->lock, NULL);
11001076 r = amdgpu_bo_create(adev, AMDGPU_VM_PTE_COUNT * 8,
11011077 AMDGPU_GPU_PAGE_SIZE, true,
11021078 AMDGPU_GEM_DOMAIN_VRAM,
11031079 AMDGPU_GEM_CREATE_NO_CPU_ACCESS,
1104− NULL, &pt);
1080+ NULL, resv, &pt);
1081+ ww_mutex_unlock(&resv->lock);
11051082 if (r)
11061083 goto error_free;
11071084
@@ -1303,7 +1280,7 @@ int amdgpu_vm_init(struct amdgpu_device *adev, struct amdgpu_vm *vm) · 195 unmodified lines
13031280 r = amdgpu_bo_create(adev, pd_size, align, true,
13041281 AMDGPU_GEM_DOMAIN_VRAM,
13051282 AMDGPU_GEM_CREATE_NO_CPU_ACCESS,
1306− NULL, &vm->page_directory);
1283+ NULL, NULL, &vm->page_directory);
13071284 if (r)
13081285 return r;
13091286
drivers/gpu/drm/amd/amdgpu/atombios_encoders.c+1−2
@@ -1279,8 +1279,7 @@ amdgpu_atombios_encoder_setup_dig(struct drm_encoder *encoder, int action) · 1278 unmodified lines
12791279 amdgpu_atombios_encoder_setup_dig_encoder(encoder, ATOM_ENCODER_CMD_DP_VIDEO_ON, 0);
12801280 }
12811281 if (amdgpu_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT))
1282− amdgpu_atombios_encoder_setup_dig_transmitter(encoder,
1283− ATOM_TRANSMITTER_ACTION_LCD_BLON, 0, 0);
1282+ amdgpu_atombios_encoder_set_backlight_level(amdgpu_encoder, dig->backlight_level);
12841283 if (ext_encoder)
12851284 amdgpu_atombios_encoder_setup_external_encoder(encoder, ext_encoder, ATOM_ENABLE);
12861285 } else {
drivers/gpu/drm/amd/amdgpu/cz_smc.c+4−2
@@ -814,7 +814,8 @@ int cz_smu_init(struct amdgpu_device *adev) · 813 unmodified lines
814814 * 3. map kernel virtual address
815815 */
816816 ret = amdgpu_bo_create(adev, priv->toc_buffer.data_size, PAGE_SIZE,
817− true, AMDGPU_GEM_DOMAIN_GTT, 0, NULL, toc_buf);
817+ true, AMDGPU_GEM_DOMAIN_GTT, 0, NULL, NULL,
818+ toc_buf);
818819
819820 if (ret) {
820821 dev_err(adev->dev, "(%d) SMC TOC buffer allocation failed\n", ret);
@@ -822,7 +823,8 @@ int cz_smu_init(struct amdgpu_device *adev) · 1 unmodified line
822823 }
823824
824825 ret = amdgpu_bo_create(adev, priv->smu_buffer.data_size, PAGE_SIZE,
825− true, AMDGPU_GEM_DOMAIN_GTT, 0, NULL, smu_buf);
826+ true, AMDGPU_GEM_DOMAIN_GTT, 0, NULL, NULL,
827+ smu_buf);
826828
827829 if (ret) {
828830 dev_err(adev->dev, "(%d) SMC Internal buffer allocation failed\n", ret);
drivers/gpu/drm/amd/amdgpu/fiji_smc.c+2−2
@@ -764,7 +764,7 @@ int fiji_smu_init(struct amdgpu_device *adev) · 763 unmodified lines
764764 ret = amdgpu_bo_create(adev, image_size, PAGE_SIZE,
765765 true, AMDGPU_GEM_DOMAIN_VRAM,
766766 AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED,
767− NULL, toc_buf);
767+ NULL, NULL, toc_buf);
768768 if (ret) {
769769 DRM_ERROR("Failed to allocate memory for TOC buffer\n");
770770 return -ENOMEM;
@@ -774,7 +774,7 @@ int fiji_smu_init(struct amdgpu_device *adev) · 3 unmodified lines
774774 ret = amdgpu_bo_create(adev, smu_internal_buffer_size, PAGE_SIZE,
775775 true, AMDGPU_GEM_DOMAIN_VRAM,
776776 AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED,
777− NULL, smu_buf);
777+ NULL, NULL, smu_buf);
778778 if (ret) {
779779 DRM_ERROR("Failed to allocate memory for SMU internal buffer\n");
780780 return -ENOMEM;
drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c+22−52
@@ -3206,7 +3206,7 @@ static int gfx_v7_0_mec_init(struct amdgpu_device *adev) · 3205 unmodified lines
32063206 r = amdgpu_bo_create(adev,
32073207 adev->gfx.mec.num_mec *adev->gfx.mec.num_pipe * MEC_HPD_SIZE * 2,
32083208 PAGE_SIZE, true,
3209− AMDGPU_GEM_DOMAIN_GTT, 0, NULL,
3209+ AMDGPU_GEM_DOMAIN_GTT, 0, NULL, NULL,
32103210 &adev->gfx.mec.hpd_eop_obj);
32113211 if (r) {
32123212 dev_warn(adev->dev, "(%d) create HDP EOP bo failed\n", r);
@@ -3373,7 +3373,7 @@ static int gfx_v7_0_cp_compute_resume(struct amdgpu_device *adev) · 160 unmodified lines
33733373 r = amdgpu_bo_create(adev,
33743374 sizeof(struct bonaire_mqd),
33753375 PAGE_SIZE, true,
3376− AMDGPU_GEM_DOMAIN_GTT, 0, NULL,
3376+ AMDGPU_GEM_DOMAIN_GTT, 0, NULL, NULL,
33773377 &ring->mqd_obj);
33783378 if (r) {
33793379 dev_warn(adev->dev, "(%d) create MQD bo failed\n", r);
@@ -3610,41 +3610,6 @@ static int gfx_v7_0_cp_resume(struct amdgpu_device *adev) · 230 unmodified lines
36103610 return 0;
36113611 }
36123612
3613−static void gfx_v7_0_ce_sync_me(struct amdgpu_ring *ring)
3614−{
3615− struct amdgpu_device *adev = ring->adev;
3616− u64 gpu_addr = adev->wb.gpu_addr + adev->gfx.ce_sync_offs * 4;
3617−
3618− /* instruct DE to set a magic number */
3619− amdgpu_ring_write(ring, PACKET3(PACKET3_WRITE_DATA, 3));
3620− amdgpu_ring_write(ring, (WRITE_DATA_ENGINE_SEL(0) |
3621− WRITE_DATA_DST_SEL(5)));
3622− amdgpu_ring_write(ring, gpu_addr & 0xfffffffc);
3623− amdgpu_ring_write(ring, upper_32_bits(gpu_addr) & 0xffffffff);
3624− amdgpu_ring_write(ring, 1);
3625−
3626− /* let CE wait till condition satisfied */
3627− amdgpu_ring_write(ring, PACKET3(PACKET3_WAIT_REG_MEM, 5));
3628− amdgpu_ring_write(ring, (WAIT_REG_MEM_OPERATION(0) | /* wait */
3629− WAIT_REG_MEM_MEM_SPACE(1) | /* memory */
3630− WAIT_REG_MEM_FUNCTION(3) | /* == */
3631− WAIT_REG_MEM_ENGINE(2))); /* ce */
3632− amdgpu_ring_write(ring, gpu_addr & 0xfffffffc);
3633− amdgpu_ring_write(ring, upper_32_bits(gpu_addr) & 0xffffffff);
3634− amdgpu_ring_write(ring, 1);
3635− amdgpu_ring_write(ring, 0xffffffff);
3636− amdgpu_ring_write(ring, 4); /* poll interval */
3637−
3638− /* instruct CE to reset wb of ce_sync to zero */
3639− amdgpu_ring_write(ring, PACKET3(PACKET3_WRITE_DATA, 3));
3640− amdgpu_ring_write(ring, (WRITE_DATA_ENGINE_SEL(2) |
3641− WRITE_DATA_DST_SEL(5) |
3642− WR_CONFIRM));
3643− amdgpu_ring_write(ring, gpu_addr & 0xfffffffc);
3644− amdgpu_ring_write(ring, upper_32_bits(gpu_addr) & 0xffffffff);
3645− amdgpu_ring_write(ring, 0);
3646−}
3647−
36483613 /*
36493614 * vm
36503615 * VMID 0 is the physical GPU addresses as used by the kernel.
@@ -3663,6 +3628,13 @@ static void gfx_v7_0_ring_emit_vm_flush(struct amdgpu_ring *ring, · 12 unmodified lines
36633628 unsigned vm_id, uint64_t pd_addr)
36643629 {
36653630 int usepfp = (ring->type == AMDGPU_RING_TYPE_GFX);
3631+ if (usepfp) {
3632+ /* synce CE with ME to prevent CE fetch CEIB before context switch done */
3633+ amdgpu_ring_write(ring, PACKET3(PACKET3_SWITCH_BUFFER, 0));
3634+ amdgpu_ring_write(ring, 0);
3635+ amdgpu_ring_write(ring, PACKET3(PACKET3_SWITCH_BUFFER, 0));
3636+ amdgpu_ring_write(ring, 0);
3637+ }
36663638
36673639 amdgpu_ring_write(ring, PACKET3(PACKET3_WRITE_DATA, 3));
36683640 amdgpu_ring_write(ring, (WRITE_DATA_ENGINE_SEL(usepfp) |
@@ -3703,7 +3675,10 @@ static void gfx_v7_0_ring_emit_vm_flush(struct amdgpu_ring *ring, · 34 unmodified lines
37033675 amdgpu_ring_write(ring, 0x0);
37043676
37053677 /* synce CE with ME to prevent CE fetch CEIB before context switch done */
3706− gfx_v7_0_ce_sync_me(ring);
3678+ amdgpu_ring_write(ring, PACKET3(PACKET3_SWITCH_BUFFER, 0));
3679+ amdgpu_ring_write(ring, 0);
3680+ amdgpu_ring_write(ring, PACKET3(PACKET3_SWITCH_BUFFER, 0));
3681+ amdgpu_ring_write(ring, 0);
37073682 }
37083683 }
37093684
@@ -3788,7 +3763,8 @@ static int gfx_v7_0_rlc_init(struct amdgpu_device *adev) · 78 unmodified lines
37883763 r = amdgpu_bo_create(adev, dws * 4, PAGE_SIZE, true,
37893764 AMDGPU_GEM_DOMAIN_VRAM,
37903765 AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED,
3791− NULL, &adev->gfx.rlc.save_restore_obj);
3766+ NULL, NULL,
3767+ &adev->gfx.rlc.save_restore_obj);
37923768 if (r) {
37933769 dev_warn(adev->dev, "(%d) create RLC sr bo failed\n", r);
37943770 return r;
@@ -3831,7 +3807,8 @@ static int gfx_v7_0_rlc_init(struct amdgpu_device *adev) · 36 unmodified lines
38313807 r = amdgpu_bo_create(adev, dws * 4, PAGE_SIZE, true,
38323808 AMDGPU_GEM_DOMAIN_VRAM,
38333809 AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED,
3834− NULL, &adev->gfx.rlc.clear_state_obj);
3810+ NULL, NULL,
3811+ &adev->gfx.rlc.clear_state_obj);
38353812 if (r) {
38363813 dev_warn(adev->dev, "(%d) create RLC c bo failed\n", r);
38373814 gfx_v7_0_rlc_fini(adev);
@@ -3870,7 +3847,8 @@ static int gfx_v7_0_rlc_init(struct amdgpu_device *adev) · 32 unmodified lines
38703847 r = amdgpu_bo_create(adev, adev->gfx.rlc.cp_table_size, PAGE_SIZE, true,
38713848 AMDGPU_GEM_DOMAIN_VRAM,
38723849 AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED,
3873− NULL, &adev->gfx.rlc.cp_table_obj);
3850+ NULL, NULL,
3851+ &adev->gfx.rlc.cp_table_obj);
38743852 if (r) {
38753853 dev_warn(adev->dev, "(%d) create RLC cp table bo failed\n", r);
38763854 gfx_v7_0_rlc_fini(adev);
@@ -4802,12 +4780,6 @@ static int gfx_v7_0_sw_init(void *handle) · 925 unmodified lines
48024780 return r;
48034781 }
48044782
4805− r = amdgpu_wb_get(adev, &adev->gfx.ce_sync_offs);
4806− if (r) {
4807− DRM_ERROR("(%d) gfx.ce_sync_offs wb alloc failed\n", r);
4808− return r;
4809− }
4810−
48114783 for (i = 0; i < adev->gfx.num_gfx_rings; i++) {
48124784 ring = &adev->gfx.gfx_ring[i];
48134785 ring->ring_obj = NULL;
@@ -4851,21 +4823,21 @@ static int gfx_v7_0_sw_init(void *handle) · 37 unmodified lines
48514823 r = amdgpu_bo_create(adev, adev->gds.mem.gfx_partition_size,
48524824 PAGE_SIZE, true,
48534825 AMDGPU_GEM_DOMAIN_GDS, 0,
4854− NULL, &adev->gds.gds_gfx_bo);
4826+ NULL, NULL, &adev->gds.gds_gfx_bo);
48554827 if (r)
48564828 return r;
48574829
48584830 r = amdgpu_bo_create(adev, adev->gds.gws.gfx_partition_size,
48594831 PAGE_SIZE, true,
48604832 AMDGPU_GEM_DOMAIN_GWS, 0,
4861− NULL, &adev->gds.gws_gfx_bo);
4833+ NULL, NULL, &adev->gds.gws_gfx_bo);
48624834 if (r)
48634835 return r;
48644836
48654837 r = amdgpu_bo_create(adev, adev->gds.oa.gfx_partition_size,
48664838 PAGE_SIZE, true,
48674839 AMDGPU_GEM_DOMAIN_OA, 0,
4868− NULL, &adev->gds.oa_gfx_bo);
4840+ NULL, NULL, &adev->gds.oa_gfx_bo);
48694841 if (r)
48704842 return r;
48714843
@@ -4886,8 +4858,6 @@ static int gfx_v7_0_sw_fini(void *handle) · 14 unmodified lines
48864858 for (i = 0; i < adev->gfx.num_compute_rings; i++)
48874859 amdgpu_ring_fini(&adev->gfx.compute_ring[i]);
48884860
4889− amdgpu_wb_free(adev, adev->gfx.ce_sync_offs);
4890−
48914861 gfx_v7_0_cp_compute_fini(adev);
48924862 gfx_v7_0_rlc_fini(adev);
48934863 gfx_v7_0_mec_fini(adev);
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c+29−50
@@ -868,7 +868,7 @@ static int gfx_v8_0_mec_init(struct amdgpu_device *adev) · 867 unmodified lines
868868 r = amdgpu_bo_create(adev,
869869 adev->gfx.mec.num_mec *adev->gfx.mec.num_pipe * MEC_HPD_SIZE * 2,
870870 PAGE_SIZE, true,
871− AMDGPU_GEM_DOMAIN_GTT, 0, NULL,
871+ AMDGPU_GEM_DOMAIN_GTT, 0, NULL, NULL,
872872 &adev->gfx.mec.hpd_eop_obj);
873873 if (r) {
874874 dev_warn(adev->dev, "(%d) create HDP EOP bo failed\n", r);
@@ -940,12 +940,6 @@ static int gfx_v8_0_sw_init(void *handle) · 65 unmodified lines
940940 return r;
941941 }
942942
943− r = amdgpu_wb_get(adev, &adev->gfx.ce_sync_offs);
944− if (r) {
945− DRM_ERROR("(%d) gfx.ce_sync_offs wb alloc failed\n", r);
946− return r;
947− }
948−
949943 /* set up the gfx ring */
950944 for (i = 0; i < adev->gfx.num_gfx_rings; i++) {
951945 ring = &adev->gfx.gfx_ring[i];
@@ -995,21 +989,21 @@ static int gfx_v8_0_sw_init(void *handle) · 43 unmodified lines
995989 /* reserve GDS, GWS and OA resource for gfx */
996990 r = amdgpu_bo_create(adev, adev->gds.mem.gfx_partition_size,
997991 PAGE_SIZE, true,
998− AMDGPU_GEM_DOMAIN_GDS, 0,
992+ AMDGPU_GEM_DOMAIN_GDS, 0, NULL,
999993 NULL, &adev->gds.gds_gfx_bo);
1000994 if (r)
1001995 return r;
1002996
1003997 r = amdgpu_bo_create(adev, adev->gds.gws.gfx_partition_size,
1004998 PAGE_SIZE, true,
1005− AMDGPU_GEM_DOMAIN_GWS, 0,
999+ AMDGPU_GEM_DOMAIN_GWS, 0, NULL,
10061000 NULL, &adev->gds.gws_gfx_bo);
10071001 if (r)
10081002 return r;
10091003
10101004 r = amdgpu_bo_create(adev, adev->gds.oa.gfx_partition_size,
10111005 PAGE_SIZE, true,
1012− AMDGPU_GEM_DOMAIN_OA, 0,
1006+ AMDGPU_GEM_DOMAIN_OA, 0, NULL,
10131007 NULL, &adev->gds.oa_gfx_bo);
10141008 if (r)
10151009 return r;
@@ -1033,8 +1027,6 @@ static int gfx_v8_0_sw_fini(void *handle) · 17 unmodified lines
10331027 for (i = 0; i < adev->gfx.num_compute_rings; i++)
10341028 amdgpu_ring_fini(&adev->gfx.compute_ring[i]);
10351029
1036− amdgpu_wb_free(adev, adev->gfx.ce_sync_offs);
1037−
10381030 gfx_v8_0_mec_fini(adev);
10391031
10401032 return 0;
@@ -3106,7 +3098,7 @@ static int gfx_v8_0_cp_compute_resume(struct amdgpu_device *adev) · 2065 unmodified lines
31063098 sizeof(struct vi_mqd),
31073099 PAGE_SIZE, true,
31083100 AMDGPU_GEM_DOMAIN_GTT, 0, NULL,
3109− &ring->mqd_obj);
3101+ NULL, &ring->mqd_obj);
31103102 if (r) {
31113103 dev_warn(adev->dev, "(%d) create MQD bo failed\n", r);
31123104 return r;
@@ -3965,6 +3957,7 @@ static void gfx_v8_0_ring_emit_fence_gfx(struct amdgpu_ring *ring, u64 addr, · 852 unmodified lines
39653957 DATA_SEL(write64bit ? 2 : 1) | INT_SEL(int_sel ? 2 : 0));
39663958 amdgpu_ring_write(ring, lower_32_bits(seq));
39673959 amdgpu_ring_write(ring, upper_32_bits(seq));
3960+
39683961 }
39693962
39703963 /**
@@ -4005,49 +3998,34 @@ static bool gfx_v8_0_ring_emit_semaphore(struct amdgpu_ring *ring, · 34 unmodified lines
40053998 return true;
40063999 }
40074000
4008−static void gfx_v8_0_ce_sync_me(struct amdgpu_ring *ring)
4001+static void gfx_v8_0_ring_emit_vm_flush(struct amdgpu_ring *ring,
4002+ unsigned vm_id, uint64_t pd_addr)
40094003 {
4010− struct amdgpu_device *adev = ring->adev;
4011− u64 gpu_addr = adev->wb.gpu_addr + adev->gfx.ce_sync_offs * 4;
4012−
4013− /* instruct DE to set a magic number */
4014− amdgpu_ring_write(ring, PACKET3(PACKET3_WRITE_DATA, 3));
4015− amdgpu_ring_write(ring, (WRITE_DATA_ENGINE_SEL(0) |
4016− WRITE_DATA_DST_SEL(5)));
4017− amdgpu_ring_write(ring, gpu_addr & 0xfffffffc);
4018− amdgpu_ring_write(ring, upper_32_bits(gpu_addr) & 0xffffffff);
4019− amdgpu_ring_write(ring, 1);
4004+ int usepfp = (ring->type == AMDGPU_RING_TYPE_GFX);
4005+ uint32_t seq = ring->fence_drv.sync_seq[ring->idx];
4006+ uint64_t addr = ring->fence_drv.gpu_addr;
40204007
4021− /* let CE wait till condition satisfied */
40224008 amdgpu_ring_write(ring, PACKET3(PACKET3_WAIT_REG_MEM, 5));
4023− amdgpu_ring_write(ring, (WAIT_REG_MEM_OPERATION(0) | /* wait */
4024− WAIT_REG_MEM_MEM_SPACE(1) | /* memory */
4025− WAIT_REG_MEM_FUNCTION(3) | /* == */
4026− WAIT_REG_MEM_ENGINE(2))); /* ce */
4027− amdgpu_ring_write(ring, gpu_addr & 0xfffffffc);
4028− amdgpu_ring_write(ring, upper_32_bits(gpu_addr) & 0xffffffff);
4029− amdgpu_ring_write(ring, 1);
4009+ amdgpu_ring_write(ring, (WAIT_REG_MEM_MEM_SPACE(1) | /* memory */
4010+ WAIT_REG_MEM_FUNCTION(3))); /* equal */
4011+ amdgpu_ring_write(ring, addr & 0xfffffffc);
4012+ amdgpu_ring_write(ring, upper_32_bits(addr) & 0xffffffff);
4013+ amdgpu_ring_write(ring, seq);
40304014 amdgpu_ring_write(ring, 0xffffffff);
40314015 amdgpu_ring_write(ring, 4); /* poll interval */
40324016
4033− /* instruct CE to reset wb of ce_sync to zero */
4034− amdgpu_ring_write(ring, PACKET3(PACKET3_WRITE_DATA, 3));
4035− amdgpu_ring_write(ring, (WRITE_DATA_ENGINE_SEL(2) |
4036− WRITE_DATA_DST_SEL(5) |
4037− WR_CONFIRM));
4038− amdgpu_ring_write(ring, gpu_addr & 0xfffffffc);
4039− amdgpu_ring_write(ring, upper_32_bits(gpu_addr) & 0xffffffff);
4040− amdgpu_ring_write(ring, 0);
4041−}
4042−
4043−static void gfx_v8_0_ring_emit_vm_flush(struct amdgpu_ring *ring,
4044− unsigned vm_id, uint64_t pd_addr)
4045−{
4046− int usepfp = (ring->type == AMDGPU_RING_TYPE_GFX);
4017+ if (usepfp) {
4018+ /* synce CE with ME to prevent CE fetch CEIB before context switch done */
4019+ amdgpu_ring_write(ring, PACKET3(PACKET3_SWITCH_BUFFER, 0));
4020+ amdgpu_ring_write(ring, 0);
4021+ amdgpu_ring_write(ring, PACKET3(PACKET3_SWITCH_BUFFER, 0));
4022+ amdgpu_ring_write(ring, 0);
4023+ }
40474024
40484025 amdgpu_ring_write(ring, PACKET3(PACKET3_WRITE_DATA, 3));
40494026 amdgpu_ring_write(ring, (WRITE_DATA_ENGINE_SEL(usepfp) |
4050− WRITE_DATA_DST_SEL(0)));
4027+ WRITE_DATA_DST_SEL(0)) |
4028+ WR_CONFIRM);
40514029 if (vm_id < 8) {
40524030 amdgpu_ring_write(ring,
40534031 (mmVM_CONTEXT0_PAGE_TABLE_BASE_ADDR + vm_id));
@@ -4083,9 +4061,10 @@ static void gfx_v8_0_ring_emit_vm_flush(struct amdgpu_ring *ring, · 29 unmodified lines
40834061 /* sync PFP to ME, otherwise we might get invalid PFP reads */
40844062 amdgpu_ring_write(ring, PACKET3(PACKET3_PFP_SYNC_ME, 0));
40854063 amdgpu_ring_write(ring, 0x0);
4086−
4087− /* synce CE with ME to prevent CE fetch CEIB before context switch done */
4088− gfx_v8_0_ce_sync_me(ring);
4064+ amdgpu_ring_write(ring, PACKET3(PACKET3_SWITCH_BUFFER, 0));
4065+ amdgpu_ring_write(ring, 0);
4066+ amdgpu_ring_write(ring, PACKET3(PACKET3_SWITCH_BUFFER, 0));
4067+ amdgpu_ring_write(ring, 0);
40894068 }
40904069 }
40914070
drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c+6−2
@@ -1262,6 +1262,12 @@ static int gmc_v7_0_process_interrupt(struct amdgpu_device *adev, · 1261 unmodified lines
12621262 addr = RREG32(mmVM_CONTEXT1_PROTECTION_FAULT_ADDR);
12631263 status = RREG32(mmVM_CONTEXT1_PROTECTION_FAULT_STATUS);
12641264 mc_client = RREG32(mmVM_CONTEXT1_PROTECTION_FAULT_MCCLIENT);
1265+ /* reset addr and status */
1266+ WREG32_P(mmVM_CONTEXT1_CNTL2, 1, ~1);
1267+
1268+ if (!addr && !status)
1269+ return 0;
1270+
12651271 dev_err(adev->dev, "GPU fault detected: %d 0x%08x\n",
12661272 entry->src_id, entry->src_data);
12671273 dev_err(adev->dev, " VM_CONTEXT1_PROTECTION_FAULT_ADDR 0x%08X\n",
@@ -1269,8 +1275,6 @@ static int gmc_v7_0_process_interrupt(struct amdgpu_device *adev, · 1 unmodified line
12691275 dev_err(adev->dev, " VM_CONTEXT1_PROTECTION_FAULT_STATUS 0x%08X\n",
12701276 status);
12711277 gmc_v7_0_vm_decode_fault(adev, status, addr, mc_client);
1272− /* reset addr and status */
1273− WREG32_P(mmVM_CONTEXT1_CNTL2, 1, ~1);
12741278
12751279 return 0;
12761280 }
drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c+6−2
@@ -1262,6 +1262,12 @@ static int gmc_v8_0_process_interrupt(struct amdgpu_device *adev, · 1261 unmodified lines
12621262 addr = RREG32(mmVM_CONTEXT1_PROTECTION_FAULT_ADDR);
12631263 status = RREG32(mmVM_CONTEXT1_PROTECTION_FAULT_STATUS);
12641264 mc_client = RREG32(mmVM_CONTEXT1_PROTECTION_FAULT_MCCLIENT);
1265+ /* reset addr and status */
1266+ WREG32_P(mmVM_CONTEXT1_CNTL2, 1, ~1);
1267+
1268+ if (!addr && !status)
1269+ return 0;
1270+
12651271 dev_err(adev->dev, "GPU fault detected: %d 0x%08x\n",
12661272 entry->src_id, entry->src_data);
12671273 dev_err(adev->dev, " VM_CONTEXT1_PROTECTION_FAULT_ADDR 0x%08X\n",
@@ -1269,8 +1275,6 @@ static int gmc_v8_0_process_interrupt(struct amdgpu_device *adev, · 1 unmodified line
12691275 dev_err(adev->dev, " VM_CONTEXT1_PROTECTION_FAULT_STATUS 0x%08X\n",
12701276 status);
12711277 gmc_v8_0_vm_decode_fault(adev, status, addr, mc_client);
1272− /* reset addr and status */
1273− WREG32_P(mmVM_CONTEXT1_CNTL2, 1, ~1);
12741278
12751279 return 0;
12761280 }
drivers/gpu/drm/amd/amdgpu/iceland_smc.c+1−1
@@ -625,7 +625,7 @@ int iceland_smu_init(struct amdgpu_device *adev) · 624 unmodified lines
625625 ret = amdgpu_bo_create(adev, image_size, PAGE_SIZE,
626626 true, AMDGPU_GEM_DOMAIN_VRAM,
627627 AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED,
628− NULL, toc_buf);
628+ NULL, NULL, toc_buf);
629629 if (ret) {
630630 DRM_ERROR("Failed to allocate memory for TOC buffer\n");
631631 return -ENOMEM;
drivers/gpu/drm/amd/amdgpu/tonga_smc.c+2−2
@@ -763,7 +763,7 @@ int tonga_smu_init(struct amdgpu_device *adev) · 762 unmodified lines
763763 ret = amdgpu_bo_create(adev, image_size, PAGE_SIZE,
764764 true, AMDGPU_GEM_DOMAIN_VRAM,
765765 AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED,
766− NULL, toc_buf);
766+ NULL, NULL, toc_buf);
767767 if (ret) {
768768 DRM_ERROR("Failed to allocate memory for TOC buffer\n");
769769 return -ENOMEM;
@@ -773,7 +773,7 @@ int tonga_smu_init(struct amdgpu_device *adev) · 3 unmodified lines
773773 ret = amdgpu_bo_create(adev, smu_internal_buffer_size, PAGE_SIZE,
774774 true, AMDGPU_GEM_DOMAIN_VRAM,
775775 AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED,
776− NULL, smu_buf);
776+ NULL, NULL, smu_buf);
777777 if (ret) {
778778 DRM_ERROR("Failed to allocate memory for SMU internal buffer\n");
779779 return -ENOMEM;
drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c+2−2
@@ -224,11 +224,11 @@ static int uvd_v4_2_suspend(void *handle) · 223 unmodified lines
224224 int r;
225225 struct amdgpu_device *adev = (struct amdgpu_device *)handle;
226226
227− r = uvd_v4_2_hw_fini(adev);
227+ r = amdgpu_uvd_suspend(adev);
228228 if (r)
229229 return r;
230230
231− r = amdgpu_uvd_suspend(adev);
231+ r = uvd_v4_2_hw_fini(adev);
232232 if (r)
233233 return r;
234234
drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c+2−2
@@ -220,11 +220,11 @@ static int uvd_v5_0_suspend(void *handle) · 219 unmodified lines
220220 int r;
221221 struct amdgpu_device *adev = (struct amdgpu_device *)handle;
222222
223− r = uvd_v5_0_hw_fini(adev);
223+ r = amdgpu_uvd_suspend(adev);
224224 if (r)
225225 return r;
226226
227− r = amdgpu_uvd_suspend(adev);
227+ r = uvd_v5_0_hw_fini(adev);
228228 if (r)
229229 return r;
230230
drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c+12−8
@@ -214,14 +214,16 @@ static int uvd_v6_0_suspend(void *handle) · 213 unmodified lines
214214 int r;
215215 struct amdgpu_device *adev = (struct amdgpu_device *)handle;
216216
217+ /* Skip this for APU for now */
218+ if (!(adev->flags & AMD_IS_APU)) {
219+ r = amdgpu_uvd_suspend(adev);
220+ if (r)
221+ return r;
222+ }
217223 r = uvd_v6_0_hw_fini(adev);
218224 if (r)
219225 return r;
220226
221− r = amdgpu_uvd_suspend(adev);
222− if (r)
223− return r;
224−
225227 return r;
226228 }
227229
@@ -230,10 +232,12 @@ static int uvd_v6_0_resume(void *handle) · 2 unmodified lines
230232 int r;
231233 struct amdgpu_device *adev = (struct amdgpu_device *)handle;
232234
233− r = amdgpu_uvd_resume(adev);
234− if (r)
235− return r;
236−
235+ /* Skip this for APU for now */
236+ if (!(adev->flags & AMD_IS_APU)) {
237+ r = amdgpu_uvd_resume(adev);
238+ if (r)
239+ return r;
240+ }
237241 r = uvd_v6_0_hw_init(adev);
238242 if (r)
239243 return r;
drivers/gpu/drm/amd/amdgpu/vi.c+2−1
@@ -1400,7 +1400,8 @@ static int vi_common_early_init(void *handle) · 1399 unmodified lines
14001400 case CHIP_CARRIZO:
14011401 adev->has_uvd = true;
14021402 adev->cg_flags = 0;
1403− adev->pg_flags = AMDGPU_PG_SUPPORT_UVD | AMDGPU_PG_SUPPORT_VCE;
1403+ /* Disable UVD pg */
1404+ adev->pg_flags = /* AMDGPU_PG_SUPPORT_UVD | */AMDGPU_PG_SUPPORT_VCE;
14041405 adev->external_rev_id = adev->rev_id + 0x1;
14051406 if (amdgpu_smc_load_fw && smc_enabled)
14061407 adev->firmware.smu_load = true;
drivers/gpu/drm/amd/include/cgs_linux.h+0−17
@@ -26,19 +26,6 @@ · 25 unmodified lines
2626
2727 #include "cgs_common.h"
2828
29−/**
30− * cgs_import_gpu_mem() - Import dmabuf handle
31− * @cgs_device: opaque device handle
32− * @dmabuf_fd: DMABuf file descriptor
33− * @handle: memory handle (output)
34− *
35− * Must be called in the process context that dmabuf_fd belongs to.
36− *
37− * Return: 0 on success, -errno otherwise
38− */
39−typedef int (*cgs_import_gpu_mem_t)(void *cgs_device, int dmabuf_fd,
40− cgs_handle_t *handle);
41−
4229 /**
4330 * cgs_irq_source_set_func() - Callback for enabling/disabling interrupt sources
4431 * @private_data: private data provided to cgs_add_irq_source
@@ -114,16 +101,12 @@ typedef int (*cgs_irq_get_t)(void *cgs_device, unsigned src_id, unsigned type); · 69 unmodified lines
114101 typedef int (*cgs_irq_put_t)(void *cgs_device, unsigned src_id, unsigned type);
115102
116103 struct cgs_os_ops {
117− cgs_import_gpu_mem_t import_gpu_mem;
118−
119104 /* IRQ handling */
120105 cgs_add_irq_source_t add_irq_source;
121106 cgs_irq_get_t irq_get;
122107 cgs_irq_put_t irq_put;
123108 };
124109
125−#define cgs_import_gpu_mem(dev,dmabuf_fd,handle) \
126− CGS_OS_CALL(import_gpu_mem,dev,dmabuf_fd,handle)
127110 #define cgs_add_irq_source(dev,src_id,num_types,set,handler,private_data) \
128111 CGS_OS_CALL(add_irq_source,dev,src_id,num_types,set,handler, \
129112 private_data)
drivers/gpu/drm/amd/scheduler/gpu_sched_trace.h+41−0
@@ -0,0 +1,41 @@
1+#if !defined(_GPU_SCHED_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
2+#define _GPU_SCHED_TRACE_H_
3+
4+#include <linux/stringify.h>
5+#include <linux/types.h>
6+#include <linux/tracepoint.h>
7+
8+#include <drm/drmP.h>
9+
10+#undef TRACE_SYSTEM
11+#define TRACE_SYSTEM gpu_sched
12+#define TRACE_INCLUDE_FILE gpu_sched_trace
13+
14+TRACE_EVENT(amd_sched_job,
15+ TP_PROTO(struct amd_sched_job *sched_job),
16+ TP_ARGS(sched_job),
17+ TP_STRUCT__entry(
18+ __field(struct amd_sched_entity *, entity)
19+ __field(const char *, name)
20+ __field(u32, job_count)
21+ __field(int, hw_job_count)
22+ ),
23+
24+ TP_fast_assign(
25+ __entry->entity = sched_job->s_entity;
26+ __entry->name = sched_job->sched->name;
27+ __entry->job_count = kfifo_len(
28+ &sched_job->s_entity->job_queue) / sizeof(sched_job);
29+ __entry->hw_job_count = atomic_read(
30+ &sched_job->sched->hw_rq_count);
31+ ),
32+ TP_printk("entity=%p, ring=%s, job count:%u, hw job count:%d",
33+ __entry->entity, __entry->name, __entry->job_count,
34+ __entry->hw_job_count)
35+);
36+#endif
37+
38+/* This part must be outside protection */
39+#undef TRACE_INCLUDE_PATH
40+#define TRACE_INCLUDE_PATH .
41+#include <trace/define_trace.h>
drivers/gpu/drm/amd/scheduler/gpu_scheduler.c+78−77
@@ -27,6 +27,9 @@ · 26 unmodified lines
2727 #include <drm/drmP.h>
2828 #include "gpu_scheduler.h"
2929
30+#define CREATE_TRACE_POINTS
31+#include "gpu_sched_trace.h"
32+
3033 static struct amd_sched_job *
3134 amd_sched_entity_pop_job(struct amd_sched_entity *entity);
3235 static void amd_sched_wakeup(struct amd_gpu_scheduler *sched);
@@ -65,29 +68,29 @@ static struct amd_sched_job * · 32 unmodified lines
6568 amd_sched_rq_select_job(struct amd_sched_rq *rq)
6669 {
6770 struct amd_sched_entity *entity;
68− struct amd_sched_job *job;
71+ struct amd_sched_job *sched_job;
6972
7073 spin_lock(&rq->lock);
7174
7275 entity = rq->current_entity;
7376 if (entity) {
7477 list_for_each_entry_continue(entity, &rq->entities, list) {
75− job = amd_sched_entity_pop_job(entity);
76− if (job) {
78+ sched_job = amd_sched_entity_pop_job(entity);
79+ if (sched_job) {
7780 rq->current_entity = entity;
7881 spin_unlock(&rq->lock);
79− return job;
82+ return sched_job;
8083 }
8184 }
8285 }
8386
8487 list_for_each_entry(entity, &rq->entities, list) {
8588
86− job = amd_sched_entity_pop_job(entity);
87− if (job) {
89+ sched_job = amd_sched_entity_pop_job(entity);
90+ if (sched_job) {
8891 rq->current_entity = entity;
8992 spin_unlock(&rq->lock);
90− return job;
93+ return sched_job;
9194 }
9295
9396 if (entity == rq->current_entity)
@@ -115,23 +118,27 @@ int amd_sched_entity_init(struct amd_gpu_scheduler *sched, · 21 unmodified lines
115118 struct amd_sched_rq *rq,
116119 uint32_t jobs)
117120 {
121+ int r;
122+
118123 if (!(sched && entity && rq))
119124 return -EINVAL;
120125
121126 memset(entity, 0, sizeof(struct amd_sched_entity));
122− entity->belongto_rq = rq;
123− entity->scheduler = sched;
124− entity->fence_context = fence_context_alloc(1);
125− if(kfifo_alloc(&entity->job_queue,
126− jobs * sizeof(void *),
127− GFP_KERNEL))
128− return -EINVAL;
127+ INIT_LIST_HEAD(&entity->list);
128+ entity->rq = rq;
129+ entity->sched = sched;
129130
130131 spin_lock_init(&entity->queue_lock);
132+ r = kfifo_alloc(&entity->job_queue, jobs * sizeof(void *), GFP_KERNEL);
133+ if (r)
134+ return r;
135+
131136 atomic_set(&entity->fence_seq, 0);
137+ entity->fence_context = fence_context_alloc(1);
132138
133139 /* Add the entity to the run queue */
134140 amd_sched_rq_add_entity(rq, entity);
141+
135142 return 0;
136143 }
137144
@@ -146,8 +153,8 @@ int amd_sched_entity_init(struct amd_gpu_scheduler *sched, · 8 unmodified lines
146153 static bool amd_sched_entity_is_initialized(struct amd_gpu_scheduler *sched,
147154 struct amd_sched_entity *entity)
148155 {
149− return entity->scheduler == sched &&
150− entity->belongto_rq != NULL;
156+ return entity->sched == sched &&
157+ entity->rq != NULL;
151158 }
152159
153160 /**
@@ -177,7 +184,7 @@ static bool amd_sched_entity_is_idle(struct amd_sched_entity *entity) · 23 unmodified lines
177184 void amd_sched_entity_fini(struct amd_gpu_scheduler *sched,
178185 struct amd_sched_entity *entity)
179186 {
180− struct amd_sched_rq *rq = entity->belongto_rq;
187+ struct amd_sched_rq *rq = entity->rq;
181188
182189 if (!amd_sched_entity_is_initialized(sched, entity))
183190 return;
@@ -198,22 +205,22 @@ static void amd_sched_entity_wakeup(struct fence *f, struct fence_cb *cb) · 14 unmodified lines
198205 container_of(cb, struct amd_sched_entity, cb);
199206 entity->dependency = NULL;
200207 fence_put(f);
201− amd_sched_wakeup(entity->scheduler);
208+ amd_sched_wakeup(entity->sched);
202209 }
203210
204211 static struct amd_sched_job *
205212 amd_sched_entity_pop_job(struct amd_sched_entity *entity)
206213 {
207− struct amd_gpu_scheduler *sched = entity->scheduler;
208− struct amd_sched_job *job;
214+ struct amd_gpu_scheduler *sched = entity->sched;
215+ struct amd_sched_job *sched_job;
209216
210217 if (ACCESS_ONCE(entity->dependency))
211218 return NULL;
212219
213− if (!kfifo_out_peek(&entity->job_queue, &job, sizeof(job)))
220+ if (!kfifo_out_peek(&entity->job_queue, &sched_job, sizeof(sched_job)))
214221 return NULL;
215222
216− while ((entity->dependency = sched->ops->dependency(job))) {
223+ while ((entity->dependency = sched->ops->dependency(sched_job))) {
217224
218225 if (fence_add_callback(entity->dependency, &entity->cb,
219226 amd_sched_entity_wakeup))
@@ -222,32 +229,33 @@ amd_sched_entity_pop_job(struct amd_sched_entity *entity) · 2 unmodified lines
222229 return NULL;
223230 }
224231
225− return job;
232+ return sched_job;
226233 }
227234
228235 /**
229236 * Helper to submit a job to the job queue
230237 *
231− * @job The pointer to job required to submit
238+ * @sched_job The pointer to job required to submit
232239 *
233240 * Returns true if we could submit the job.
234241 */
235−static bool amd_sched_entity_in(struct amd_sched_job *job)
242+static bool amd_sched_entity_in(struct amd_sched_job *sched_job)
236243 {
237− struct amd_sched_entity *entity = job->s_entity;
244+ struct amd_sched_entity *entity = sched_job->s_entity;
238245 bool added, first = false;
239246
240247 spin_lock(&entity->queue_lock);
241− added = kfifo_in(&entity->job_queue, &job, sizeof(job)) == sizeof(job);
248+ added = kfifo_in(&entity->job_queue, &sched_job,
249+ sizeof(sched_job)) == sizeof(sched_job);
242250
243− if (added && kfifo_len(&entity->job_queue) == sizeof(job))
251+ if (added && kfifo_len(&entity->job_queue) == sizeof(sched_job))
244252 first = true;
245253
246254 spin_unlock(&entity->queue_lock);
247255
248256 /* first job wakes up scheduler */
249257 if (first)
250− amd_sched_wakeup(job->sched);
258+ amd_sched_wakeup(sched_job->sched);
251259
252260 return added;
253261 }
@@ -255,7 +263,7 @@ static bool amd_sched_entity_in(struct amd_sched_job *job) · 1 unmodified line
255263 /**
256264 * Submit a job to the job queue
257265 *
258− * @job The pointer to job required to submit
266+ * @sched_job The pointer to job required to submit
259267 *
260268 * Returns 0 for success, negative error code otherwise.
261269 */
@@ -271,9 +279,9 @@ int amd_sched_entity_push_job(struct amd_sched_job *sched_job) · 9 unmodified lines
271279 fence_get(&fence->base);
272280 sched_job->s_fence = fence;
273281
274− wait_event(entity->scheduler->job_scheduled,
282+ wait_event(entity->sched->job_scheduled,
275283 amd_sched_entity_in(sched_job));
276−
284+ trace_amd_sched_job(sched_job);
277285 return 0;
278286 }
279287
@@ -301,30 +309,28 @@ static void amd_sched_wakeup(struct amd_gpu_scheduler *sched) · 21 unmodified lines
301309 static struct amd_sched_job *
302310 amd_sched_select_job(struct amd_gpu_scheduler *sched)
303311 {
304− struct amd_sched_job *job;
312+ struct amd_sched_job *sched_job;
305313
306314 if (!amd_sched_ready(sched))
307315 return NULL;
308316
309317 /* Kernel run queue has higher priority than normal run queue*/
310− job = amd_sched_rq_select_job(&sched->kernel_rq);
311− if (job == NULL)
312− job = amd_sched_rq_select_job(&sched->sched_rq);
318+ sched_job = amd_sched_rq_select_job(&sched->kernel_rq);
319+ if (sched_job == NULL)
320+ sched_job = amd_sched_rq_select_job(&sched->sched_rq);
313321
314− return job;
322+ return sched_job;
315323 }
316324
317325 static void amd_sched_process_job(struct fence *f, struct fence_cb *cb)
318326 {
319− struct amd_sched_job *sched_job =
320− container_of(cb, struct amd_sched_job, cb);
321− struct amd_gpu_scheduler *sched;
327+ struct amd_sched_fence *s_fence =
328+ container_of(cb, struct amd_sched_fence, cb);
329+ struct amd_gpu_scheduler *sched = s_fence->sched;
322330
323− sched = sched_job->sched;
324− amd_sched_fence_signal(sched_job->s_fence);
325331 atomic_dec(&sched->hw_rq_count);
326− fence_put(&sched_job->s_fence->base);
327− sched->ops->process_job(sched_job);
332+ amd_sched_fence_signal(s_fence);
333+ fence_put(&s_fence->base);
328334 wake_up_interruptible(&sched->wake_up_worker);
329335 }
330336
@@ -338,87 +344,82 @@ static int amd_sched_main(void *param) · 7 unmodified lines
338344
339345 while (!kthread_should_stop()) {
340346 struct amd_sched_entity *entity;
341− struct amd_sched_job *job;
347+ struct amd_sched_fence *s_fence;
348+ struct amd_sched_job *sched_job;
342349 struct fence *fence;
343350
344351 wait_event_interruptible(sched->wake_up_worker,
345352 kthread_should_stop() ||
346− (job = amd_sched_select_job(sched)));
353+ (sched_job = amd_sched_select_job(sched)));
347354
348− if (!job)
355+ if (!sched_job)
349356 continue;
350357
351− entity = job->s_entity;
358+ entity = sched_job->s_entity;
359+ s_fence = sched_job->s_fence;
352360 atomic_inc(&sched->hw_rq_count);
353− fence = sched->ops->run_job(job);
361+ fence = sched->ops->run_job(sched_job);
354362 if (fence) {
355− r = fence_add_callback(fence, &job->cb,
363+ r = fence_add_callback(fence, &s_fence->cb,
356364 amd_sched_process_job);
357365 if (r == -ENOENT)
358− amd_sched_process_job(fence, &job->cb);
366+ amd_sched_process_job(fence, &s_fence->cb);
359367 else if (r)
360368 DRM_ERROR("fence add callback failed (%d)\n", r);
361369 fence_put(fence);
370+ } else {
371+ DRM_ERROR("Failed to run job!\n");
372+ amd_sched_process_job(NULL, &s_fence->cb);
362373 }
363374
364− count = kfifo_out(&entity->job_queue, &job, sizeof(job));
365− WARN_ON(count != sizeof(job));
375+ count = kfifo_out(&entity->job_queue, &sched_job,
376+ sizeof(sched_job));
377+ WARN_ON(count != sizeof(sched_job));
366378 wake_up(&sched->job_scheduled);
367379 }
368380 return 0;
369381 }
370382
371383 /**
372− * Create a gpu scheduler
384+ * Init a gpu scheduler instance
373385 *
386+ * @sched The pointer to the scheduler
374387 * @ops The backend operations for this scheduler.
375− * @ring The the ring id for the scheduler.
376388 * @hw_submissions Number of hw submissions to do.
389+ * @name Name used for debugging
377390 *
378− * Return the pointer to scheduler for success, otherwise return NULL
391+ * Return 0 on success, otherwise error code.
379392 */
380−struct amd_gpu_scheduler *amd_sched_create(struct amd_sched_backend_ops *ops,
381− unsigned ring, unsigned hw_submission,
382− void *priv)
393+int amd_sched_init(struct amd_gpu_scheduler *sched,
394+ struct amd_sched_backend_ops *ops,
395+ unsigned hw_submission, const char *name)
383396 {
384− struct amd_gpu_scheduler *sched;
385−
386− sched = kzalloc(sizeof(struct amd_gpu_scheduler), GFP_KERNEL);
387− if (!sched)
388− return NULL;
389−
390397 sched->ops = ops;
391− sched->ring_id = ring;
392398 sched->hw_submission_limit = hw_submission;
393− sched->priv = priv;
394− snprintf(sched->name, sizeof(sched->name), "amdgpu[%d]", ring);
399+ sched->name = name;
395400 amd_sched_rq_init(&sched->sched_rq);
396401 amd_sched_rq_init(&sched->kernel_rq);
397402
398403 init_waitqueue_head(&sched->wake_up_worker);
399404 init_waitqueue_head(&sched->job_scheduled);
400405 atomic_set(&sched->hw_rq_count, 0);
406+
401407 /* Each scheduler will run on a seperate kernel thread */
402408 sched->thread = kthread_run(amd_sched_main, sched, sched->name);
403409 if (IS_ERR(sched->thread)) {
404− DRM_ERROR("Failed to create scheduler for id %d.\n", ring);
405− kfree(sched);
406− return NULL;
410+ DRM_ERROR("Failed to create scheduler for %s.\n", name);
411+ return PTR_ERR(sched->thread);
407412 }
408413
409− return sched;
414+ return 0;
410415 }
411416
412417 /**
413418 * Destroy a gpu scheduler
414419 *
415420 * @sched The pointer to the scheduler
416− *
417− * return 0 if succeed. -1 if failed.
418421 */
419−int amd_sched_destroy(struct amd_gpu_scheduler *sched)
422+void amd_sched_fini(struct amd_gpu_scheduler *sched)
420423 {
421424 kthread_stop(sched->thread);
422− kfree(sched);
423− return 0;
424425 }
drivers/gpu/drm/amd/scheduler/gpu_scheduler.h+20−21
@@ -38,13 +38,15 @@ struct amd_sched_rq; · 37 unmodified lines
3838 */
3939 struct amd_sched_entity {
4040 struct list_head list;
41− struct amd_sched_rq *belongto_rq;
42− atomic_t fence_seq;
43− /* the job_queue maintains the jobs submitted by clients */
44− struct kfifo job_queue;
41+ struct amd_sched_rq *rq;
42+ struct amd_gpu_scheduler *sched;
43+
4544 spinlock_t queue_lock;
46− struct amd_gpu_scheduler *scheduler;
45+ struct kfifo job_queue;
46+
47+ atomic_t fence_seq;
4748 uint64_t fence_context;
49+
4850 struct fence *dependency;
4951 struct fence_cb cb;
5052 };
@@ -62,13 +64,13 @@ struct amd_sched_rq { · 11 unmodified lines
6264
6365 struct amd_sched_fence {
6466 struct fence base;
65− struct amd_gpu_scheduler *scheduler;
67+ struct fence_cb cb;
68+ struct amd_gpu_scheduler *sched;
6669 spinlock_t lock;
6770 void *owner;
6871 };
6972
7073 struct amd_sched_job {
71− struct fence_cb cb;
7274 struct amd_gpu_scheduler *sched;
7375 struct amd_sched_entity *s_entity;
7476 struct amd_sched_fence *s_fence;
@@ -91,32 +93,29 @@ static inline struct amd_sched_fence *to_amd_sched_fence(struct fence *f) · 16 unmodified lines
9193 * these functions should be implemented in driver side
9294 */
9395 struct amd_sched_backend_ops {
94− struct fence *(*dependency)(struct amd_sched_job *job);
95− struct fence *(*run_job)(struct amd_sched_job *job);
96− void (*process_job)(struct amd_sched_job *job);
96+ struct fence *(*dependency)(struct amd_sched_job *sched_job);
97+ struct fence *(*run_job)(struct amd_sched_job *sched_job);
9798 };
9899
99100 /**
100101 * One scheduler is implemented for each hardware ring
101102 */
102103 struct amd_gpu_scheduler {
103− struct task_struct *thread;
104+ struct amd_sched_backend_ops *ops;
105+ uint32_t hw_submission_limit;
106+ const char *name;
104107 struct amd_sched_rq sched_rq;
105108 struct amd_sched_rq kernel_rq;
106− atomic_t hw_rq_count;
107− struct amd_sched_backend_ops *ops;
108− uint32_t ring_id;
109109 wait_queue_head_t wake_up_worker;
110110 wait_queue_head_t job_scheduled;
111− uint32_t hw_submission_limit;
112− char name[20];
113− void *priv;
111+ atomic_t hw_rq_count;
112+ struct task_struct *thread;
114113 };
115114
116−struct amd_gpu_scheduler *
117−amd_sched_create(struct amd_sched_backend_ops *ops,
118− uint32_t ring, uint32_t hw_submission, void *priv);
119−int amd_sched_destroy(struct amd_gpu_scheduler *sched);
115+int amd_sched_init(struct amd_gpu_scheduler *sched,
116+ struct amd_sched_backend_ops *ops,
117+ uint32_t hw_submission, const char *name);
118+void amd_sched_fini(struct amd_gpu_scheduler *sched);
120119
121120 int amd_sched_entity_init(struct amd_gpu_scheduler *sched,
122121 struct amd_sched_entity *entity,
drivers/gpu/drm/amd/scheduler/sched_fence.c+2−2
@@ -36,7 +36,7 @@ struct amd_sched_fence *amd_sched_fence_create(struct amd_sched_entity *s_entity · 35 unmodified lines
3636 if (fence == NULL)
3737 return NULL;
3838 fence->owner = owner;
39− fence->scheduler = s_entity->scheduler;
39+ fence->sched = s_entity->sched;
4040 spin_lock_init(&fence->lock);
4141
4242 seq = atomic_inc_return(&s_entity->fence_seq);
@@ -63,7 +63,7 @@ static const char *amd_sched_fence_get_driver_name(struct fence *fence) · 20 unmodified lines
6363 static const char *amd_sched_fence_get_timeline_name(struct fence *f)
6464 {
6565 struct amd_sched_fence *fence = to_amd_sched_fence(f);
66− return (const char *)fence->scheduler->name;
66+ return (const char *)fence->sched->name;
6767 }
6868
6969 static bool amd_sched_fence_enable_signaling(struct fence *f)
drivers/gpu/drm/drm_dp_mst_topology.c+52−33
@@ -53,8 +53,8 @@ static int drm_dp_send_dpcd_write(struct drm_dp_mst_topology_mgr *mgr, · 52 unmodified lines
5353 struct drm_dp_mst_port *port,
5454 int offset, int size, u8 *bytes);
5555
56−static int drm_dp_send_link_address(struct drm_dp_mst_topology_mgr *mgr,
57− struct drm_dp_mst_branch *mstb);
56+static void drm_dp_send_link_address(struct drm_dp_mst_topology_mgr *mgr,
57+ struct drm_dp_mst_branch *mstb);
5858 static int drm_dp_send_enum_path_resources(struct drm_dp_mst_topology_mgr *mgr,
5959 struct drm_dp_mst_branch *mstb,
6060 struct drm_dp_mst_port *port);
@@ -804,8 +804,6 @@ static void drm_dp_destroy_mst_branch_device(struct kref *kref) · 743 unmodified lines
804804 struct drm_dp_mst_port *port, *tmp;
805805 bool wake_tx = false;
806806
807− cancel_work_sync(&mstb->mgr->work);
808−
809807 /*
810808 * destroy all ports - don't need lock
811809 * as there are no more references to the mst branch
@@ -863,29 +861,33 @@ static void drm_dp_destroy_port(struct kref *kref) · 51 unmodified lines
863861 {
864862 struct drm_dp_mst_port *port = container_of(kref, struct drm_dp_mst_port, kref);
865863 struct drm_dp_mst_topology_mgr *mgr = port->mgr;
864+
866865 if (!port->input) {
867866 port->vcpi.num_slots = 0;
868867
869868 kfree(port->cached_edid);
870869
871− /* we can't destroy the connector here, as
872− we might be holding the mode_config.mutex
873− from an EDID retrieval */
870+ /*
871+ * The only time we don't have a connector
872+ * on an output port is if the connector init
873+ * fails.
874+ */
874875 if (port->connector) {
876+ /* we can't destroy the connector here, as
877+ * we might be holding the mode_config.mutex
878+ * from an EDID retrieval */
879+
875880 mutex_lock(&mgr->destroy_connector_lock);
876881 list_add(&port->next, &mgr->destroy_connector_list);
877882 mutex_unlock(&mgr->destroy_connector_lock);
878883 schedule_work(&mgr->destroy_connector_work);
879884 return;
880885 }
886+ /* no need to clean up vcpi
887+ * as if we have no connector we never setup a vcpi */
881888 drm_dp_port_teardown_pdt(port, port->pdt);
882−
883− if (!port->input && port->vcpi.vcpi > 0)
884− drm_dp_mst_put_payload_id(mgr, port->vcpi.vcpi);
885889 }
886890 kfree(port);
887−
888− (*mgr->cbs->hotplug)(mgr);
889891 }
890892
891893 static void drm_dp_put_port(struct drm_dp_mst_port *port)
@@ -1027,8 +1029,8 @@ static void drm_dp_check_port_guid(struct drm_dp_mst_branch *mstb, · 135 unmodified lines
10271029 }
10281030 }
10291031
1030−static void build_mst_prop_path(struct drm_dp_mst_port *port,
1031− struct drm_dp_mst_branch *mstb,
1032+static void build_mst_prop_path(const struct drm_dp_mst_branch *mstb,
1033+ int pnum,
10321034 char *proppath,
10331035 size_t proppath_size)
10341036 {
@@ -1041,7 +1043,7 @@ static void build_mst_prop_path(struct drm_dp_mst_port *port, · 6 unmodified lines
10411043 snprintf(temp, sizeof(temp), "-%d", port_num);
10421044 strlcat(proppath, temp, proppath_size);
10431045 }
1044− snprintf(temp, sizeof(temp), "-%d", port->port_num);
1046+ snprintf(temp, sizeof(temp), "-%d", pnum);
10451047 strlcat(proppath, temp, proppath_size);
10461048 }
10471049
@@ -1105,22 +1107,32 @@ static void drm_dp_add_port(struct drm_dp_mst_branch *mstb, · 57 unmodified lines
11051107 drm_dp_port_teardown_pdt(port, old_pdt);
11061108
11071109 ret = drm_dp_port_setup_pdt(port);
1108− if (ret == true) {
1110+ if (ret == true)
11091111 drm_dp_send_link_address(mstb->mgr, port->mstb);
1110− port->mstb->link_address_sent = true;
1111− }
11121112 }
11131113
11141114 if (created && !port->input) {
11151115 char proppath[255];
1116− build_mst_prop_path(port, mstb, proppath, sizeof(proppath));
1117− port->connector = (*mstb->mgr->cbs->add_connector)(mstb->mgr, port, proppath);
11181116
1119− if (port->port_num >= 8) {
1117+ build_mst_prop_path(mstb, port->port_num, proppath, sizeof(proppath));
1118+ port->connector = (*mstb->mgr->cbs->add_connector)(mstb->mgr, port, proppath);
1119+ if (!port->connector) {
1120+ /* remove it from the port list */
1121+ mutex_lock(&mstb->mgr->lock);
1122+ list_del(&port->next);
1123+ mutex_unlock(&mstb->mgr->lock);
1124+ /* drop port list reference */
1125+ drm_dp_put_port(port);
1126+ goto out;
1127+ }
1128+ if (port->port_num >= DP_MST_LOGICAL_PORT_0) {
11201129 port->cached_edid = drm_get_edid(port->connector, &port->aux.ddc);
1130+ drm_mode_connector_set_tile_property(port->connector);
11211131 }
1132+ (*mstb->mgr->cbs->register_connector)(port->connector);
11221133 }
11231134
1135+out:
11241136 /* put reference to this port */
11251137 drm_dp_put_port(port);
11261138 }
@@ -1202,10 +1214,9 @@ static void drm_dp_check_and_send_link_address(struct drm_dp_mst_topology_mgr *m · 75 unmodified lines
12021214 {
12031215 struct drm_dp_mst_port *port;
12041216 struct drm_dp_mst_branch *mstb_child;
1205− if (!mstb->link_address_sent) {
1217+ if (!mstb->link_address_sent)
12061218 drm_dp_send_link_address(mgr, mstb);
1207− mstb->link_address_sent = true;
1208− }
1219+
12091220 list_for_each_entry(port, &mstb->ports, next) {
12101221 if (port->input)
12111222 continue;
@@ -1458,8 +1469,8 @@ static void drm_dp_queue_down_tx(struct drm_dp_mst_topology_mgr *mgr, · 246 unmodified lines
14581469 mutex_unlock(&mgr->qlock);
14591470 }
14601471
1461−static int drm_dp_send_link_address(struct drm_dp_mst_topology_mgr *mgr,
1462− struct drm_dp_mst_branch *mstb)
1472+static void drm_dp_send_link_address(struct drm_dp_mst_topology_mgr *mgr,
1473+ struct drm_dp_mst_branch *mstb)
14631474 {
14641475 int len;
14651476 struct drm_dp_sideband_msg_tx *txmsg;
@@ -1467,11 +1478,12 @@ static int drm_dp_send_link_address(struct drm_dp_mst_topology_mgr *mgr, · 1 unmodified line
14671478
14681479 txmsg = kzalloc(sizeof(*txmsg), GFP_KERNEL);
14691480 if (!txmsg)
1470− return -ENOMEM;
1481+ return;
14711482
14721483 txmsg->dst = mstb;
14731484 len = build_link_address(txmsg);
14741485
1486+ mstb->link_address_sent = true;
14751487 drm_dp_queue_down_tx(mgr, txmsg);
14761488
14771489 ret = drm_dp_mst_wait_tx_reply(mstb, txmsg);
@@ -1499,11 +1511,12 @@ static int drm_dp_send_link_address(struct drm_dp_mst_topology_mgr *mgr, · 21 unmodified lines
14991511 }
15001512 (*mgr->cbs->hotplug)(mgr);
15011513 }
1502− } else
1514+ } else {
1515+ mstb->link_address_sent = false;
15031516 DRM_DEBUG_KMS("link address failed %d\n", ret);
1517+ }
15041518
15051519 kfree(txmsg);
1506− return 0;
15071520 }
15081521
15091522 static int drm_dp_send_enum_path_resources(struct drm_dp_mst_topology_mgr *mgr,
@@ -1978,6 +1991,8 @@ void drm_dp_mst_topology_mgr_suspend(struct drm_dp_mst_topology_mgr *mgr) · 468 unmodified lines
19781991 drm_dp_dpcd_writeb(mgr->aux, DP_MSTM_CTRL,
19791992 DP_MST_EN | DP_UPSTREAM_IS_SRC);
19801993 mutex_unlock(&mgr->lock);
1994+ flush_work(&mgr->work);
1995+ flush_work(&mgr->destroy_connector_work);
19811996 }
19821997 EXPORT_SYMBOL(drm_dp_mst_topology_mgr_suspend);
19831998
@@ -2263,10 +2278,10 @@ struct edid *drm_dp_mst_get_edid(struct drm_connector *connector, struct drm_dp_ · 279 unmodified lines
22632278
22642279 if (port->cached_edid)
22652280 edid = drm_edid_duplicate(port->cached_edid);
2266− else
2281+ else {
22672282 edid = drm_get_edid(connector, &port->aux.ddc);
2268−
2269− drm_mode_connector_set_tile_property(connector);
2283+ drm_mode_connector_set_tile_property(connector);
2284+ }
22702285 drm_dp_put_port(port);
22712286 return edid;
22722287 }
@@ -2671,7 +2686,7 @@ static void drm_dp_destroy_connector_work(struct work_struct *work) · 398 unmodified lines
26712686 {
26722687 struct drm_dp_mst_topology_mgr *mgr = container_of(work, struct drm_dp_mst_topology_mgr, destroy_connector_work);
26732688 struct drm_dp_mst_port *port;
2674−
2689+ bool send_hotplug = false;
26752690 /*
26762691 * Not a regular list traverse as we have to drop the destroy
26772692 * connector lock before destroying the connector, to avoid AB->BA
@@ -2694,7 +2709,10 @@ static void drm_dp_destroy_connector_work(struct work_struct *work) · 16 unmodified lines
26942709 if (!port->input && port->vcpi.vcpi > 0)
26952710 drm_dp_mst_put_payload_id(mgr, port->vcpi.vcpi);
26962711 kfree(port);
2712+ send_hotplug = true;
26972713 }
2714+ if (send_hotplug)
2715+ (*mgr->cbs->hotplug)(mgr);
26982716 }
26992717
27002718 /**
@@ -2747,6 +2765,7 @@ EXPORT_SYMBOL(drm_dp_mst_topology_mgr_init); · 46 unmodified lines
27472765 */
27482766 void drm_dp_mst_topology_mgr_destroy(struct drm_dp_mst_topology_mgr *mgr)
27492767 {
2768+ flush_work(&mgr->work);
27502769 flush_work(&mgr->destroy_connector_work);
27512770 mutex_lock(&mgr->payload_lock);
27522771 kfree(mgr->payloads);
drivers/gpu/drm/drm_fb_helper.c+5−1
@@ -345,7 +345,11 @@ static bool restore_fbdev_mode(struct drm_fb_helper *fb_helper) · 344 unmodified lines
345345 struct drm_crtc *crtc = mode_set->crtc;
346346 int ret;
347347
348− if (crtc->funcs->cursor_set) {
348+ if (crtc->funcs->cursor_set2) {
349+ ret = crtc->funcs->cursor_set2(crtc, NULL, 0, 0, 0, 0, 0);
350+ if (ret)
351+ error = true;
352+ } else if (crtc->funcs->cursor_set) {
349353 ret = crtc->funcs->cursor_set(crtc, NULL, 0, 0, 0);
350354 if (ret)
351355 error = true;
drivers/gpu/drm/drm_ioctl.c+2−1
@@ -520,7 +520,8 @@ EXPORT_SYMBOL(drm_ioctl_permit); · 519 unmodified lines
520520
521521 /** Ioctl table */
522522 static const struct drm_ioctl_desc drm_ioctls[] = {
523− DRM_IOCTL_DEF(DRM_IOCTL_VERSION, drm_version, DRM_UNLOCKED|DRM_RENDER_ALLOW),
523+ DRM_IOCTL_DEF(DRM_IOCTL_VERSION, drm_version,
524+ DRM_UNLOCKED|DRM_RENDER_ALLOW|DRM_CONTROL_ALLOW),
524525 DRM_IOCTL_DEF(DRM_IOCTL_GET_UNIQUE, drm_getunique, 0),
525526 DRM_IOCTL_DEF(DRM_IOCTL_GET_MAGIC, drm_getmagic, 0),
526527 DRM_IOCTL_DEF(DRM_IOCTL_IRQ_BUSID, drm_irq_by_busid, DRM_MASTER|DRM_ROOT_ONLY),
drivers/gpu/drm/drm_probe_helper.c+16−3
@@ -94,7 +94,18 @@ static int drm_helper_probe_add_cmdline_mode(struct drm_connector *connector) · 93 unmodified lines
9494 }
9595
9696 #define DRM_OUTPUT_POLL_PERIOD (10*HZ)
97−static void __drm_kms_helper_poll_enable(struct drm_device *dev)
97+/**
98+ * drm_kms_helper_poll_enable_locked - re-enable output polling.
99+ * @dev: drm_device
100+ *
101+ * This function re-enables the output polling work without
102+ * locking the mode_config mutex.
103+ *
104+ * This is like drm_kms_helper_poll_enable() however it is to be
105+ * called from a context where the mode_config mutex is locked
106+ * already.
107+ */
108+void drm_kms_helper_poll_enable_locked(struct drm_device *dev)
98109 {
99110 bool poll = false;
100111 struct drm_connector *connector;
@@ -113,6 +124,8 @@ static void __drm_kms_helper_poll_enable(struct drm_device *dev) · 12 unmodified lines
113124 if (poll)
114125 schedule_delayed_work(&dev->mode_config.output_poll_work, DRM_OUTPUT_POLL_PERIOD);
115126 }
127+EXPORT_SYMBOL(drm_kms_helper_poll_enable_locked);
128+
116129
117130 static int drm_helper_probe_single_connector_modes_merge_bits(struct drm_connector *connector,
118131 uint32_t maxX, uint32_t maxY, bool merge_type_bits)
@@ -174,7 +187,7 @@ static int drm_helper_probe_single_connector_modes_merge_bits(struct drm_connect · 55 unmodified lines
174187
175188 /* Re-enable polling in case the global poll config changed. */
176189 if (drm_kms_helper_poll != dev->mode_config.poll_running)
177− __drm_kms_helper_poll_enable(dev);
190+ drm_kms_helper_poll_enable_locked(dev);
178191
179192 dev->mode_config.poll_running = drm_kms_helper_poll;
180193
@@ -428,7 +441,7 @@ EXPORT_SYMBOL(drm_kms_helper_poll_disable); · 247 unmodified lines
428441 void drm_kms_helper_poll_enable(struct drm_device *dev)
429442 {
430443 mutex_lock(&dev->mode_config.mutex);
431− __drm_kms_helper_poll_enable(dev);
444+ drm_kms_helper_poll_enable_locked(dev);
432445 mutex_unlock(&dev->mode_config.mutex);
433446 }
434447 EXPORT_SYMBOL(drm_kms_helper_poll_enable);
drivers/gpu/drm/exynos/exynos7_drm_decon.c+0−12
@@ -37,7 +37,6 @@ · 36 unmodified lines
3737 * DECON stands for Display and Enhancement controller.
3838 */
3939
40−#define DECON_DEFAULT_FRAMERATE 60
4140 #define MIN_FB_WIDTH_FOR_16WORD_BURST 128
4241
4342 #define WINDOWS_NR 2
@@ -165,16 +164,6 @@ static u32 decon_calc_clkdiv(struct decon_context *ctx, · 121 unmodified lines
165164 return (clkdiv < 0x100) ? clkdiv : 0xff;
166165 }
167166
168−static bool decon_mode_fixup(struct exynos_drm_crtc *crtc,
169− const struct drm_display_mode *mode,
170− struct drm_display_mode *adjusted_mode)
171−{
172− if (adjusted_mode->vrefresh == 0)
173− adjusted_mode->vrefresh = DECON_DEFAULT_FRAMERATE;
174−
175− return true;
176−}
177−
178167 static void decon_commit(struct exynos_drm_crtc *crtc)
179168 {
180169 struct decon_context *ctx = crtc->ctx;
@@ -637,7 +626,6 @@ static void decon_disable(struct exynos_drm_crtc *crtc) · 456 unmodified lines
637626 static const struct exynos_drm_crtc_ops decon_crtc_ops = {
638627 .enable = decon_enable,
639628 .disable = decon_disable,
640− .mode_fixup = decon_mode_fixup,
641629 .commit = decon_commit,
642630 .enable_vblank = decon_enable_vblank,
643631 .disable_vblank = decon_disable_vblank,
drivers/gpu/drm/exynos/exynos_dp_core.c+0−23
@@ -1383,28 +1383,6 @@ static int exynos_dp_remove(struct platform_device *pdev) · 1382 unmodified lines
13831383 return 0;
13841384 }
13851385
1386−#ifdef CONFIG_PM_SLEEP
1387−static int exynos_dp_suspend(struct device *dev)
1388−{
1389− struct exynos_dp_device *dp = dev_get_drvdata(dev);
1390−
1391− exynos_dp_disable(&dp->encoder);
1392− return 0;
1393−}
1394−
1395−static int exynos_dp_resume(struct device *dev)
1396−{
1397− struct exynos_dp_device *dp = dev_get_drvdata(dev);
1398−
1399− exynos_dp_enable(&dp->encoder);
1400− return 0;
1401−}
1402−#endif
1403−
1404−static const struct dev_pm_ops exynos_dp_pm_ops = {
1405− SET_SYSTEM_SLEEP_PM_OPS(exynos_dp_suspend, exynos_dp_resume)
1406−};
1407−
14081386 static const struct of_device_id exynos_dp_match[] = {
14091387 { .compatible = "samsung,exynos5-dp" },
14101388 {},
@@ -1417,7 +1395,6 @@ struct platform_driver dp_driver = { · 6 unmodified lines
14171395 .driver = {
14181396 .name = "exynos-dp",
14191397 .owner = THIS_MODULE,
1420− .pm = &exynos_dp_pm_ops,
14211398 .of_match_table = exynos_dp_match,
14221399 },
14231400 };
drivers/gpu/drm/exynos/exynos_drm_core.c+0−6
@@ -28,7 +28,6 @@ int exynos_drm_subdrv_register(struct exynos_drm_subdrv *subdrv) · 27 unmodified lines
2828
2929 return 0;
3030 }
31−EXPORT_SYMBOL_GPL(exynos_drm_subdrv_register);
3231
3332 int exynos_drm_subdrv_unregister(struct exynos_drm_subdrv *subdrv)
3433 {
@@ -39,7 +38,6 @@ int exynos_drm_subdrv_unregister(struct exynos_drm_subdrv *subdrv) · 4 unmodified lines
3938
4039 return 0;
4140 }
42−EXPORT_SYMBOL_GPL(exynos_drm_subdrv_unregister);
4341
4442 int exynos_drm_device_subdrv_probe(struct drm_device *dev)
4543 {
@@ -69,7 +67,6 @@ int exynos_drm_device_subdrv_probe(struct drm_device *dev) · 23 unmodified lines
6967
7068 return 0;
7169 }
72−EXPORT_SYMBOL_GPL(exynos_drm_device_subdrv_probe);
7370
7471 int exynos_drm_device_subdrv_remove(struct drm_device *dev)
7572 {
@@ -87,7 +84,6 @@ int exynos_drm_device_subdrv_remove(struct drm_device *dev) · 11 unmodified lines
8784
8885 return 0;
8986 }
90−EXPORT_SYMBOL_GPL(exynos_drm_device_subdrv_remove);
9187
9288 int exynos_drm_subdrv_open(struct drm_device *dev, struct drm_file *file)
9389 {
@@ -111,7 +107,6 @@ err: · 17 unmodified lines
111107 }
112108 return ret;
113109 }
114−EXPORT_SYMBOL_GPL(exynos_drm_subdrv_open);
115110
116111 void exynos_drm_subdrv_close(struct drm_device *dev, struct drm_file *file)
117112 {
@@ -122,4 +117,3 @@ void exynos_drm_subdrv_close(struct drm_device *dev, struct drm_file *file) · 4 unmodified lines
122117 subdrv->close(dev, subdrv->dev, file);
123118 }
124119 }
125−EXPORT_SYMBOL_GPL(exynos_drm_subdrv_close);
drivers/gpu/drm/exynos/exynos_drm_crtc.c+0−15
@@ -41,20 +41,6 @@ static void exynos_drm_crtc_disable(struct drm_crtc *crtc) · 40 unmodified lines
4141 exynos_crtc->ops->disable(exynos_crtc);
4242 }
4343
44−static bool
45−exynos_drm_crtc_mode_fixup(struct drm_crtc *crtc,
46− const struct drm_display_mode *mode,
47− struct drm_display_mode *adjusted_mode)
48−{
49− struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc);
50−
51− if (exynos_crtc->ops->mode_fixup)
52− return exynos_crtc->ops->mode_fixup(exynos_crtc, mode,
53− adjusted_mode);
54−
55− return true;
56−}
57−
5844 static void
5945 exynos_drm_crtc_mode_set_nofb(struct drm_crtc *crtc)
6046 {
@@ -99,7 +85,6 @@ static void exynos_crtc_atomic_flush(struct drm_crtc *crtc, · 38 unmodified lines
9985 static struct drm_crtc_helper_funcs exynos_crtc_helper_funcs = {
10086 .enable = exynos_drm_crtc_enable,
10187 .disable = exynos_drm_crtc_disable,
102− .mode_fixup = exynos_drm_crtc_mode_fixup,
10388 .mode_set_nofb = exynos_drm_crtc_mode_set_nofb,
10489 .atomic_begin = exynos_crtc_atomic_begin,
10590 .atomic_flush = exynos_crtc_atomic_flush,
drivers/gpu/drm/exynos/exynos_drm_drv.c+2−0
@@ -304,6 +304,7 @@ int exynos_atomic_commit(struct drm_device *dev, struct drm_atomic_state *state, · 303 unmodified lines
304304 return 0;
305305 }
306306
307+#ifdef CONFIG_PM_SLEEP
307308 static int exynos_drm_suspend(struct drm_device *dev, pm_message_t state)
308309 {
309310 struct drm_connector *connector;
@@ -340,6 +341,7 @@ static int exynos_drm_resume(struct drm_device *dev) · 30 unmodified lines
340341
341342 return 0;
342343 }
344+#endif
343345
344346 static int exynos_drm_open(struct drm_device *dev, struct drm_file *file)
345347 {
drivers/gpu/drm/exynos/exynos_drm_drv.h+0−4
@@ -82,7 +82,6 @@ struct exynos_drm_plane { · 81 unmodified lines
8282 *
8383 * @enable: enable the device
8484 * @disable: disable the device
85− * @mode_fixup: fix mode data before applying it
8685 * @commit: set current hw specific display mode to hw.
8786 * @enable_vblank: specific driver callback for enabling vblank interrupt.
8887 * @disable_vblank: specific driver callback for disabling vblank interrupt.
@@ -103,9 +102,6 @@ struct exynos_drm_crtc; · 14 unmodified lines
103102 struct exynos_drm_crtc_ops {
104103 void (*enable)(struct exynos_drm_crtc *crtc);
105104 void (*disable)(struct exynos_drm_crtc *crtc);
106− bool (*mode_fixup)(struct exynos_drm_crtc *crtc,
107− const struct drm_display_mode *mode,
108− struct drm_display_mode *adjusted_mode);
109105 void (*commit)(struct exynos_drm_crtc *crtc);
110106 int (*enable_vblank)(struct exynos_drm_crtc *crtc);
111107 void (*disable_vblank)(struct exynos_drm_crtc *crtc);
drivers/gpu/drm/exynos/exynos_drm_fimc.c+18−18
@@ -1206,23 +1206,6 @@ static struct exynos_drm_ipp_ops fimc_dst_ops = { · 1205 unmodified lines
12061206 .set_addr = fimc_dst_set_addr,
12071207 };
12081208
1209−static int fimc_clk_ctrl(struct fimc_context *ctx, bool enable)
1210−{
1211− DRM_DEBUG_KMS("enable[%d]\n", enable);
1212−
1213− if (enable) {
1214− clk_prepare_enable(ctx->clocks[FIMC_CLK_GATE]);
1215− clk_prepare_enable(ctx->clocks[FIMC_CLK_WB_A]);
1216− ctx->suspended = false;
1217− } else {
1218− clk_disable_unprepare(ctx->clocks[FIMC_CLK_GATE]);
1219− clk_disable_unprepare(ctx->clocks[FIMC_CLK_WB_A]);
1220− ctx->suspended = true;
1221− }
1222−
1223− return 0;
1224−}
1225−
12261209 static irqreturn_t fimc_irq_handler(int irq, void *dev_id)
12271210 {
12281211 struct fimc_context *ctx = dev_id;
@@ -1780,6 +1763,24 @@ static int fimc_remove(struct platform_device *pdev) · 551 unmodified lines
17801763 return 0;
17811764 }
17821765
1766+#ifdef CONFIG_PM
1767+static int fimc_clk_ctrl(struct fimc_context *ctx, bool enable)
1768+{
1769+ DRM_DEBUG_KMS("enable[%d]\n", enable);
1770+
1771+ if (enable) {
1772+ clk_prepare_enable(ctx->clocks[FIMC_CLK_GATE]);
1773+ clk_prepare_enable(ctx->clocks[FIMC_CLK_WB_A]);
1774+ ctx->suspended = false;
1775+ } else {
1776+ clk_disable_unprepare(ctx->clocks[FIMC_CLK_GATE]);
1777+ clk_disable_unprepare(ctx->clocks[FIMC_CLK_WB_A]);
1778+ ctx->suspended = true;
1779+ }
1780+
1781+ return 0;
1782+}
1783+
17831784 #ifdef CONFIG_PM_SLEEP
17841785 static int fimc_suspend(struct device *dev)
17851786 {
@@ -1806,7 +1807,6 @@ static int fimc_resume(struct device *dev) · 20 unmodified lines
18061807 }
18071808 #endif
18081809
1809−#ifdef CONFIG_PM
18101810 static int fimc_runtime_suspend(struct device *dev)
18111811 {
18121812 struct fimc_context *ctx = get_fimc_context(dev);
drivers/gpu/drm/exynos/exynos_drm_fimd.c+1−13
@@ -41,7 +41,6 @@ · 40 unmodified lines
4141 * CPU Interface.
4242 */
4343
44−#define FIMD_DEFAULT_FRAMERATE 60
4544 #define MIN_FB_WIDTH_FOR_16WORD_BURST 128
4645
4746 /* position control register for hardware window 0, 2 ~ 4.*/
@@ -377,16 +376,6 @@ static u32 fimd_calc_clkdiv(struct fimd_context *ctx, · 329 unmodified lines
377376 return (clkdiv < 0x100) ? clkdiv : 0xff;
378377 }
379378
380−static bool fimd_mode_fixup(struct exynos_drm_crtc *crtc,
381− const struct drm_display_mode *mode,
382− struct drm_display_mode *adjusted_mode)
383−{
384− if (adjusted_mode->vrefresh == 0)
385− adjusted_mode->vrefresh = FIMD_DEFAULT_FRAMERATE;
386−
387− return true;
388−}
389−
390379 static void fimd_commit(struct exynos_drm_crtc *crtc)
391380 {
392381 struct fimd_context *ctx = crtc->ctx;
@@ -882,13 +871,12 @@ static void fimd_dp_clock_enable(struct exynos_drm_crtc *crtc, bool enable) · 489 unmodified lines
882871 return;
883872
884873 val = enable ? DP_MIE_CLK_DP_ENABLE : DP_MIE_CLK_DISABLE;
885− writel(DP_MIE_CLK_DP_ENABLE, ctx->regs + DP_MIE_CLKCON);
874+ writel(val, ctx->regs + DP_MIE_CLKCON);
886875 }
887876
888877 static const struct exynos_drm_crtc_ops fimd_crtc_ops = {
889878 .enable = fimd_enable,
890879 .disable = fimd_disable,
891− .mode_fixup = fimd_mode_fixup,
892880 .commit = fimd_commit,
893881 .enable_vblank = fimd_enable_vblank,
894882 .disable_vblank = fimd_disable_vblank,
drivers/gpu/drm/exynos/exynos_drm_g2d.c+0−3
@@ -1059,7 +1059,6 @@ int exynos_g2d_get_ver_ioctl(struct drm_device *drm_dev, void *data, · 1058 unmodified lines
10591059
10601060 return 0;
10611061 }
1062−EXPORT_SYMBOL_GPL(exynos_g2d_get_ver_ioctl);
10631062
10641063 int exynos_g2d_set_cmdlist_ioctl(struct drm_device *drm_dev, void *data,
10651064 struct drm_file *file)
@@ -1230,7 +1229,6 @@ err: · 164 unmodified lines
12301229 g2d_put_cmdlist(g2d, node);
12311230 return ret;
12321231 }
1233−EXPORT_SYMBOL_GPL(exynos_g2d_set_cmdlist_ioctl);
12341232
12351233 int exynos_g2d_exec_ioctl(struct drm_device *drm_dev, void *data,
12361234 struct drm_file *file)
@@ -1293,7 +1291,6 @@ int exynos_g2d_exec_ioctl(struct drm_device *drm_dev, void *data, · 56 unmodified lines
12931291 out:
12941292 return 0;
12951293 }
1296−EXPORT_SYMBOL_GPL(exynos_g2d_exec_ioctl);
12971294
12981295 static int g2d_subdrv_probe(struct drm_device *drm_dev, struct device *dev)
12991296 {
drivers/gpu/drm/exynos/exynos_drm_gem.c+41−53
@@ -56,39 +56,35 @@ static int exynos_drm_alloc_buf(struct exynos_drm_gem_obj *obj) · 55 unmodified lines
5656 nr_pages = obj->size >> PAGE_SHIFT;
5757
5858 if (!is_drm_iommu_supported(dev)) {
59− dma_addr_t start_addr;
60− unsigned int i = 0;
61−
6259 obj->pages = drm_calloc_large(nr_pages, sizeof(struct page *));
6360 if (!obj->pages) {
6461 DRM_ERROR("failed to allocate pages.\n");
6562 return -ENOMEM;
6663 }
64+ }
6765
68− obj->cookie = dma_alloc_attrs(dev->dev,
69− obj->size,
70− &obj->dma_addr, GFP_KERNEL,
71− &obj->dma_attrs);
72− if (!obj->cookie) {
73− DRM_ERROR("failed to allocate buffer.\n");
66+ obj->cookie = dma_alloc_attrs(dev->dev, obj->size, &obj->dma_addr,
67+ GFP_KERNEL, &obj->dma_attrs);
68+ if (!obj->cookie) {
69+ DRM_ERROR("failed to allocate buffer.\n");
70+ if (obj->pages)
7471 drm_free_large(obj->pages);
75− return -ENOMEM;
76− }
72+ return -ENOMEM;
73+ }
74+
75+ if (obj->pages) {
76+ dma_addr_t start_addr;
77+ unsigned int i = 0;
7778
7879 start_addr = obj->dma_addr;
7980 while (i < nr_pages) {
80− obj->pages[i] = phys_to_page(start_addr);
81+ obj->pages[i] = pfn_to_page(dma_to_pfn(dev->dev,
82+ start_addr));
8183 start_addr += PAGE_SIZE;
8284 i++;
8385 }
8486 } else {
85− obj->pages = dma_alloc_attrs(dev->dev, obj->size,
86− &obj->dma_addr, GFP_KERNEL,
87− &obj->dma_attrs);
88− if (!obj->pages) {
89− DRM_ERROR("failed to allocate buffer.\n");
90− return -ENOMEM;
91− }
87+ obj->pages = obj->cookie;
9288 }
9389
9490 DRM_DEBUG_KMS("dma_addr(0x%lx), size(0x%lx)\n",
@@ -110,15 +106,11 @@ static void exynos_drm_free_buf(struct exynos_drm_gem_obj *obj) · 15 unmodified lines
110106 DRM_DEBUG_KMS("dma_addr(0x%lx), size(0x%lx)\n",
111107 (unsigned long)obj->dma_addr, obj->size);
112108
113− if (!is_drm_iommu_supported(dev)) {
114− dma_free_attrs(dev->dev, obj->size, obj->cookie,
115− (dma_addr_t)obj->dma_addr, &obj->dma_attrs);
116− drm_free_large(obj->pages);
117− } else
118− dma_free_attrs(dev->dev, obj->size, obj->pages,
119− (dma_addr_t)obj->dma_addr, &obj->dma_attrs);
109+ dma_free_attrs(dev->dev, obj->size, obj->cookie,
110+ (dma_addr_t)obj->dma_addr, &obj->dma_attrs);
120111
121− obj->dma_addr = (dma_addr_t)NULL;
112+ if (!is_drm_iommu_supported(dev))
113+ drm_free_large(obj->pages);
122114 }
123115
124116 static int exynos_drm_gem_handle_create(struct drm_gem_object *obj,
@@ -156,18 +148,14 @@ void exynos_drm_gem_destroy(struct exynos_drm_gem_obj *exynos_gem_obj) · 31 unmodified lines
156148 * once dmabuf's refcount becomes 0.
157149 */
158150 if (obj->import_attach)
159− goto out;
160−
161− exynos_drm_free_buf(exynos_gem_obj);
162−
163−out:
164− drm_gem_free_mmap_offset(obj);
151+ drm_prime_gem_destroy(obj, exynos_gem_obj->sgt);
152+ else
153+ exynos_drm_free_buf(exynos_gem_obj);
165154
166155 /* release file pointer to gem object. */
167156 drm_gem_object_release(obj);
168157
169158 kfree(exynos_gem_obj);
170− exynos_gem_obj = NULL;
171159 }
172160
173161 unsigned long exynos_drm_gem_get_size(struct drm_device *dev,
@@ -190,8 +178,7 @@ unsigned long exynos_drm_gem_get_size(struct drm_device *dev, · 16 unmodified lines
190178 return exynos_gem_obj->size;
191179 }
192180
193−
194−struct exynos_drm_gem_obj *exynos_drm_gem_init(struct drm_device *dev,
181+static struct exynos_drm_gem_obj *exynos_drm_gem_init(struct drm_device *dev,
195182 unsigned long size)
196183 {
197184 struct exynos_drm_gem_obj *exynos_gem_obj;
@@ -212,6 +199,13 @@ struct exynos_drm_gem_obj *exynos_drm_gem_init(struct drm_device *dev, · 14 unmodified lines
212199 return ERR_PTR(ret);
213200 }
214201
202+ ret = drm_gem_create_mmap_offset(obj);
203+ if (ret < 0) {
204+ drm_gem_object_release(obj);
205+ kfree(exynos_gem_obj);
206+ return ERR_PTR(ret);
207+ }
208+
215209 DRM_DEBUG_KMS("created file object = 0x%x\n", (unsigned int)obj->filp);
216210
217211 return exynos_gem_obj;
@@ -313,7 +307,7 @@ void exynos_drm_gem_put_dma_addr(struct drm_device *dev, · 95 unmodified lines
313307 drm_gem_object_unreference_unlocked(obj);
314308 }
315309
316−int exynos_drm_gem_mmap_buffer(struct exynos_drm_gem_obj *exynos_gem_obj,
310+static int exynos_drm_gem_mmap_buffer(struct exynos_drm_gem_obj *exynos_gem_obj,
317311 struct vm_area_struct *vma)
318312 {
319313 struct drm_device *drm_dev = exynos_gem_obj->base.dev;
@@ -342,7 +336,8 @@ int exynos_drm_gem_mmap_buffer(struct exynos_drm_gem_obj *exynos_gem_obj, · 22 unmodified lines
342336
343337 int exynos_drm_gem_get_ioctl(struct drm_device *dev, void *data,
344338 struct drm_file *file_priv)
345−{ struct exynos_drm_gem_obj *exynos_gem_obj;
339+{
340+ struct exynos_drm_gem_obj *exynos_gem_obj;
346341 struct drm_exynos_gem_info *args = data;
347342 struct drm_gem_object *obj;
348343
@@ -402,6 +397,7 @@ int exynos_drm_gem_dumb_create(struct drm_file *file_priv, · 53 unmodified lines
402397 struct drm_mode_create_dumb *args)
403398 {
404399 struct exynos_drm_gem_obj *exynos_gem_obj;
400+ unsigned int flags;
405401 int ret;
406402
407403 /*
@@ -413,16 +409,12 @@ int exynos_drm_gem_dumb_create(struct drm_file *file_priv, · 5 unmodified lines
413409 args->pitch = args->width * ((args->bpp + 7) / 8);
414410 args->size = args->pitch * args->height;
415411
416− if (is_drm_iommu_supported(dev)) {
417− exynos_gem_obj = exynos_drm_gem_create(dev,
418− EXYNOS_BO_NONCONTIG | EXYNOS_BO_WC,
419− args->size);
420− } else {
421− exynos_gem_obj = exynos_drm_gem_create(dev,
422− EXYNOS_BO_CONTIG | EXYNOS_BO_WC,
423− args->size);
424− }
412+ if (is_drm_iommu_supported(dev))
413+ flags = EXYNOS_BO_NONCONTIG | EXYNOS_BO_WC;
414+ else
415+ flags = EXYNOS_BO_CONTIG | EXYNOS_BO_WC;
425416
417+ exynos_gem_obj = exynos_drm_gem_create(dev, flags, args->size);
426418 if (IS_ERR(exynos_gem_obj)) {
427419 dev_warn(dev->dev, "FB allocation failed.\n");
428420 return PTR_ERR(exynos_gem_obj);
@@ -460,14 +452,9 @@ int exynos_drm_gem_dumb_map_offset(struct drm_file *file_priv, · 31 unmodified lines
460452 goto unlock;
461453 }
462454
463− ret = drm_gem_create_mmap_offset(obj);
464− if (ret)
465− goto out;
466−
467455 *offset = drm_vma_node_offset_addr(&obj->vma_node);
468456 DRM_DEBUG_KMS("offset = 0x%lx\n", (unsigned long)*offset);
469457
470−out:
471458 drm_gem_object_unreference(obj);
472459 unlock:
473460 mutex_unlock(&dev->struct_mutex);
@@ -543,7 +530,6 @@ int exynos_drm_gem_mmap(struct file *filp, struct vm_area_struct *vma) · 69 unmodified lines
543530
544531 err_close_vm:
545532 drm_gem_vm_close(vma);
546− drm_gem_free_mmap_offset(obj);
547533
548534 return ret;
549535 }
@@ -588,6 +574,8 @@ exynos_drm_gem_prime_import_sg_table(struct drm_device *dev, · 38 unmodified lines
588574 if (ret < 0)
589575 goto err_free_large;
590576
577+ exynos_gem_obj->sgt = sgt;
578+
591579 if (sgt->nents == 1) {
592580 /* always physically continuous memory if sgt->nents is 1. */
593581 exynos_gem_obj->flags |= EXYNOS_BO_CONTIG;
drivers/gpu/drm/exynos/exynos_drm_gem.h+2−4
@@ -39,6 +39,7 @@ · 38 unmodified lines
3939 * - this address could be physical address without IOMMU and
4040 * device address with IOMMU.
4141 * @pages: Array of backing pages.
42+ * @sgt: Imported sg_table.
4243 *
4344 * P.S. this object would be transferred to user as kms_bo.handle so
4445 * user can access the buffer through kms_bo.handle.
@@ -52,6 +53,7 @@ struct exynos_drm_gem_obj { · 7 unmodified lines
5253 dma_addr_t dma_addr;
5354 struct dma_attrs dma_attrs;
5455 struct page **pages;
56+ struct sg_table *sgt;
5557 };
5658
5759 struct page **exynos_gem_get_pages(struct drm_gem_object *obj, gfp_t gfpmask);
@@ -59,10 +61,6 @@ struct page **exynos_gem_get_pages(struct drm_gem_object *obj, gfp_t gfpmask); · 1 unmodified line
5961 /* destroy a buffer with gem object */
6062 void exynos_drm_gem_destroy(struct exynos_drm_gem_obj *exynos_gem_obj);
6163
62−/* create a private gem object and initialize it. */
63−struct exynos_drm_gem_obj *exynos_drm_gem_init(struct drm_device *dev,
64− unsigned long size);
65−
6664 /* create a new buffer with gem object */
6765 struct exynos_drm_gem_obj *exynos_drm_gem_create(struct drm_device *dev,
6866 unsigned int flags,
drivers/gpu/drm/exynos/exynos_drm_rotator.c+1−1
@@ -786,6 +786,7 @@ static int rotator_remove(struct platform_device *pdev) · 785 unmodified lines
786786 return 0;
787787 }
788788
789+#ifdef CONFIG_PM
789790 static int rotator_clk_crtl(struct rot_context *rot, bool enable)
790791 {
791792 if (enable) {
@@ -822,7 +823,6 @@ static int rotator_resume(struct device *dev) · 30 unmodified lines
822823 }
823824 #endif
824825
825−#ifdef CONFIG_PM
826826 static int rotator_runtime_suspend(struct device *dev)
827827 {
828828 struct rot_context *rot = dev_get_drvdata(dev);
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c+2−1
@@ -58,7 +58,8 @@ static void fsl_dcu_drm_plane_atomic_disable(struct drm_plane *plane, · 57 unmodified lines
5858 struct drm_plane_state *old_state)
5959 {
6060 struct fsl_dcu_drm_device *fsl_dev = plane->dev->dev_private;
61− unsigned int index, value, ret;
61+ unsigned int value;
62+ int index, ret;
6263
6364 index = fsl_dcu_drm_plane_index(plane);
6465 if (index < 0)
drivers/gpu/drm/i915/i915_irq.c+26−0
@@ -639,6 +639,32 @@ static int __intel_get_crtc_scanline(struct intel_crtc *crtc) · 638 unmodified lines
639639 else
640640 position = __raw_i915_read32(dev_priv, PIPEDSL(pipe)) & DSL_LINEMASK_GEN3;
641641
642+ /*
643+ * On HSW, the DSL reg (0x70000) appears to return 0 if we
644+ * read it just before the start of vblank. So try it again
645+ * so we don't accidentally end up spanning a vblank frame
646+ * increment, causing the pipe_update_end() code to squak at us.
647+ *
648+ * The nature of this problem means we can't simply check the ISR
649+ * bit and return the vblank start value; nor can we use the scanline
650+ * debug register in the transcoder as it appears to have the same
651+ * problem. We may need to extend this to include other platforms,
652+ * but so far testing only shows the problem on HSW.
653+ */
654+ if (IS_HASWELL(dev) && !position) {
655+ int i, temp;
656+
657+ for (i = 0; i < 100; i++) {
658+ udelay(1);
659+ temp = __raw_i915_read32(dev_priv, PIPEDSL(pipe)) &
660+ DSL_LINEMASK_GEN3;
661+ if (temp != position) {
662+ position = temp;
663+ break;
664+ }
665+ }
666+ }
667+
642668 /*
643669 * See update_scanline_offset() for the details on the
644670 * scanline_offset adjustment.
drivers/gpu/drm/i915/intel_audio.c+1−1
@@ -430,7 +430,7 @@ void intel_audio_codec_enable(struct intel_encoder *intel_encoder) · 429 unmodified lines
430430
431431 /**
432432 * intel_audio_codec_disable - Disable the audio codec for HD audio
433− * @encoder: encoder on which to disable audio
433+ * @intel_encoder: encoder on which to disable audio
434434 *
435435 * The disable sequences must be performed before disabling the transcoder or
436436 * port.
drivers/gpu/drm/i915/intel_bios.c+11−1
@@ -42,7 +42,7 @@ find_section(const void *_bdb, int section_id) · 41 unmodified lines
4242 const struct bdb_header *bdb = _bdb;
4343 const u8 *base = _bdb;
4444 int index = 0;
45− u16 total, current_size;
45+ u32 total, current_size;
4646 u8 current_id;
4747
4848 /* skip to first section */
@@ -57,6 +57,10 @@ find_section(const void *_bdb, int section_id) · 8 unmodified lines
5757 current_size = *((const u16 *)(base + index));
5858 index += 2;
5959
60+ /* The MIPI Sequence Block v3+ has a separate size field. */
61+ if (current_id == BDB_MIPI_SEQUENCE && *(base + index) >= 3)
62+ current_size = *((const u32 *)(base + index + 1));
63+
6064 if (index + current_size > total)
6165 return NULL;
6266
@@ -799,6 +803,12 @@ parse_mipi(struct drm_i915_private *dev_priv, const struct bdb_header *bdb) · 736 unmodified lines
799803 return;
800804 }
801805
806+ /* Fail gracefully for forward incompatible sequence block. */
807+ if (sequence->version >= 3) {
808+ DRM_ERROR("Unable to parse MIPI Sequence Block v3+\n");
809+ return;
810+ }
811+
802812 DRM_DEBUG_DRIVER("Found MIPI sequence block\n");
803813
804814 block_size = get_blocksize(sequence);
drivers/gpu/drm/i915/intel_display.c+5−2
@@ -15087,9 +15087,12 @@ static void readout_plane_state(struct intel_crtc *crtc, · 15086 unmodified lines
1508715087
1508815088 plane_state = to_intel_plane_state(p->base.state);
1508915089
15090− if (p->base.type == DRM_PLANE_TYPE_PRIMARY)
15090+ if (p->base.type == DRM_PLANE_TYPE_PRIMARY) {
1509115091 plane_state->visible = primary_get_hw_state(crtc);
15092− else {
15092+ if (plane_state->visible)
15093+ crtc->base.state->plane_mask |=
15094+ 1 << drm_plane_index(&p->base);
15095+ } else {
1509315096 if (active)
1509415097 p->disable_plane(&p->base, &crtc->base);
1509515098
drivers/gpu/drm/i915/intel_dp_mst.c+8−1
@@ -462,11 +462,17 @@ static struct drm_connector *intel_dp_add_mst_connector(struct drm_dp_mst_topolo · 461 unmodified lines
462462 drm_object_attach_property(&connector->base, dev->mode_config.tile_property, 0);
463463
464464 drm_mode_connector_set_path_property(connector, pathprop);
465+ return connector;
466+}
467+
468+static void intel_dp_register_mst_connector(struct drm_connector *connector)
469+{
470+ struct intel_connector *intel_connector = to_intel_connector(connector);
471+ struct drm_device *dev = connector->dev;
465472 drm_modeset_lock_all(dev);
466473 intel_connector_add_to_fbdev(intel_connector);
467474 drm_modeset_unlock_all(dev);
468475 drm_connector_register(&intel_connector->base);
469− return connector;
470476 }
471477
472478 static void intel_dp_destroy_mst_connector(struct drm_dp_mst_topology_mgr *mgr,
@@ -512,6 +518,7 @@ static void intel_dp_mst_hotplug(struct drm_dp_mst_topology_mgr *mgr) · 39 unmodified lines
512518
513519 static struct drm_dp_mst_topology_cbs mst_cbs = {
514520 .add_connector = intel_dp_add_mst_connector,
521+ .register_connector = intel_dp_register_mst_connector,
515522 .destroy_connector = intel_dp_destroy_mst_connector,
516523 .hotplug = intel_dp_mst_hotplug,
517524 };
drivers/gpu/drm/i915/intel_hotplug.c+1−1
@@ -180,7 +180,7 @@ static void intel_hpd_irq_storm_disable(struct drm_i915_private *dev_priv) · 179 unmodified lines
180180
181181 /* Enable polling and queue hotplug re-enabling. */
182182 if (hpd_disabled) {
183− drm_kms_helper_poll_enable(dev);
183+ drm_kms_helper_poll_enable_locked(dev);
184184 mod_delayed_work(system_wq, &dev_priv->hotplug.reenable_work,
185185 msecs_to_jiffies(HPD_STORM_REENABLE_DELAY));
186186 }
drivers/gpu/drm/i915/intel_lrc.c+32−7
@@ -484,18 +484,18 @@ void intel_lrc_irq_handler(struct intel_engine_cs *ring) · 483 unmodified lines
484484 status_pointer = I915_READ(RING_CONTEXT_STATUS_PTR(ring));
485485
486486 read_pointer = ring->next_context_status_buffer;
487− write_pointer = status_pointer & 0x07;
487+ write_pointer = status_pointer & GEN8_CSB_PTR_MASK;
488488 if (read_pointer > write_pointer)
489− write_pointer += 6;
489+ write_pointer += GEN8_CSB_ENTRIES;
490490
491491 spin_lock(&ring->execlist_lock);
492492
493493 while (read_pointer < write_pointer) {
494494 read_pointer++;
495495 status = I915_READ(RING_CONTEXT_STATUS_BUF(ring) +
496− (read_pointer % 6) * 8);
496+ (read_pointer % GEN8_CSB_ENTRIES) * 8);
497497 status_id = I915_READ(RING_CONTEXT_STATUS_BUF(ring) +
498− (read_pointer % 6) * 8 + 4);
498+ (read_pointer % GEN8_CSB_ENTRIES) * 8 + 4);
499499
500500 if (status & GEN8_CTX_STATUS_IDLE_ACTIVE)
501501 continue;
@@ -521,10 +521,12 @@ void intel_lrc_irq_handler(struct intel_engine_cs *ring) · 19 unmodified lines
521521 spin_unlock(&ring->execlist_lock);
522522
523523 WARN(submit_contexts > 2, "More than two context complete events?\n");
524− ring->next_context_status_buffer = write_pointer % 6;
524+ ring->next_context_status_buffer = write_pointer % GEN8_CSB_ENTRIES;
525525
526526 I915_WRITE(RING_CONTEXT_STATUS_PTR(ring),
527− _MASKED_FIELD(0x07 << 8, ((u32)ring->next_context_status_buffer & 0x07) << 8));
527+ _MASKED_FIELD(GEN8_CSB_PTR_MASK << 8,
528+ ((u32)ring->next_context_status_buffer &
529+ GEN8_CSB_PTR_MASK) << 8));
528530 }
529531
530532 static int execlists_context_queue(struct drm_i915_gem_request *request)
@@ -1422,6 +1424,7 @@ static int gen8_init_common_ring(struct intel_engine_cs *ring) · 891 unmodified lines
14221424 {
14231425 struct drm_device *dev = ring->dev;
14241426 struct drm_i915_private *dev_priv = dev->dev_private;
1427+ u8 next_context_status_buffer_hw;
14251428
14261429 I915_WRITE_IMR(ring, ~(ring->irq_enable_mask | ring->irq_keep_mask));
14271430 I915_WRITE(RING_HWSTAM(ring->mmio_base), 0xffffffff);
@@ -1436,7 +1439,29 @@ static int gen8_init_common_ring(struct intel_engine_cs *ring) · 8 unmodified lines
14361439 _MASKED_BIT_DISABLE(GFX_REPLAY_MODE) |
14371440 _MASKED_BIT_ENABLE(GFX_RUN_LIST_ENABLE));
14381441 POSTING_READ(RING_MODE_GEN7(ring));
1439− ring->next_context_status_buffer = 0;
1442+
1443+ /*
1444+ * Instead of resetting the Context Status Buffer (CSB) read pointer to
1445+ * zero, we need to read the write pointer from hardware and use its
1446+ * value because "this register is power context save restored".
1447+ * Effectively, these states have been observed:
1448+ *
1449+ * | Suspend-to-idle (freeze) | Suspend-to-RAM (mem) |
1450+ * BDW | CSB regs not reset | CSB regs reset |
1451+ * CHT | CSB regs not reset | CSB regs not reset |
1452+ */
1453+ next_context_status_buffer_hw = (I915_READ(RING_CONTEXT_STATUS_PTR(ring))
1454+ & GEN8_CSB_PTR_MASK);
1455+
1456+ /*
1457+ * When the CSB registers are reset (also after power-up / gpu reset),
1458+ * CSB write pointer is set to all 1's, which is not valid, use '5' in
1459+ * this special case, so the first element read is CSB[0].
1460+ */
1461+ if (next_context_status_buffer_hw == GEN8_CSB_PTR_MASK)
1462+ next_context_status_buffer_hw = (GEN8_CSB_ENTRIES - 1);
1463+
1464+ ring->next_context_status_buffer = next_context_status_buffer_hw;
14401465 DRM_DEBUG_DRIVER("Execlists enabled for %s\n", ring->name);
14411466
14421467 memset(&ring->hangcheck, 0, sizeof(ring->hangcheck));
drivers/gpu/drm/i915/intel_lrc.h+2−0
@@ -25,6 +25,8 @@ · 24 unmodified lines
2525 #define _INTEL_LRC_H_
2626
2727 #define GEN8_LR_CONTEXT_ALIGN 4096
28+#define GEN8_CSB_ENTRIES 6
29+#define GEN8_CSB_PTR_MASK 0x07
2830
2931 /* Execlists regs */
3032 #define RING_ELSP(ring) ((ring)->mmio_base+0x230)
drivers/gpu/drm/i915/intel_runtime_pm.c+2−1
@@ -246,7 +246,8 @@ static void skl_power_well_post_enable(struct drm_i915_private *dev_priv, · 245 unmodified lines
246246 }
247247
248248 if (power_well->data == SKL_DISP_PW_1) {
249− intel_prepare_ddi(dev);
249+ if (!dev_priv->power_domains.initializing)
250+ intel_prepare_ddi(dev);
250251 gen8_irq_power_well_post_enable(dev_priv, 1 << PIPE_A);
251252 }
252253 }
drivers/gpu/drm/mgag200/mgag200_fb.c+23−8
@@ -186,17 +186,19 @@ static int mgag200fb_create(struct drm_fb_helper *helper, · 185 unmodified lines
186186
187187 sysram = vmalloc(size);
188188 if (!sysram)
189− return -ENOMEM;
189+ goto err_sysram;
190190
191191 info = drm_fb_helper_alloc_fbi(helper);
192− if (IS_ERR(info))
193− return PTR_ERR(info);
192+ if (IS_ERR(info)) {
193+ ret = PTR_ERR(info);
194+ goto err_alloc_fbi;
195+ }
194196
195197 info->par = mfbdev;
196198
197199 ret = mgag200_framebuffer_init(dev, &mfbdev->mfb, &mode_cmd, gobj);
198200 if (ret)
199− return ret;
201+ goto err_framebuffer_init;
200202
201203 mfbdev->sysram = sysram;
202204 mfbdev->size = size;
@@ -225,7 +227,17 @@ static int mgag200fb_create(struct drm_fb_helper *helper, · 22 unmodified lines
225227
226228 DRM_DEBUG_KMS("allocated %dx%d\n",
227229 fb->width, fb->height);
230+
228231 return 0;
232+
233+err_framebuffer_init:
234+ drm_fb_helper_release_fbi(helper);
235+err_alloc_fbi:
236+ vfree(sysram);
237+err_sysram:
238+ drm_gem_object_unreference_unlocked(gobj);
239+
240+ return ret;
229241 }
230242
231243 static int mga_fbdev_destroy(struct drm_device *dev,
@@ -276,23 +288,26 @@ int mgag200_fbdev_init(struct mga_device *mdev) · 44 unmodified lines
276288 ret = drm_fb_helper_init(mdev->dev, &mfbdev->helper,
277289 mdev->num_crtc, MGAG200FB_CONN_LIMIT);
278290 if (ret)
279− return ret;
291+ goto err_fb_helper;
280292
281293 ret = drm_fb_helper_single_add_all_connectors(&mfbdev->helper);
282294 if (ret)
283− goto fini;
295+ goto err_fb_setup;
284296
285297 /* disable all the possible outputs/crtcs before entering KMS mode */
286298 drm_helper_disable_unused_functions(mdev->dev);
287299
288300 ret = drm_fb_helper_initial_config(&mfbdev->helper, bpp_sel);
289301 if (ret)
290− goto fini;
302+ goto err_fb_setup;
291303
292304 return 0;
293305
294−fini:
306+err_fb_setup:
295307 drm_fb_helper_fini(&mfbdev->helper);
308+err_fb_helper:
309+ mdev->mfbdev = NULL;
310+
296311 return ret;
297312 }
298313
drivers/gpu/drm/mgag200/mgag200_main.c+20−16
@@ -220,7 +220,7 @@ int mgag200_driver_load(struct drm_device *dev, unsigned long flags) · 219 unmodified lines
220220 }
221221 r = mgag200_mm_init(mdev);
222222 if (r)
223− goto out;
223+ goto err_mm;
224224
225225 drm_mode_config_init(dev);
226226 dev->mode_config.funcs = (void *)&mga_mode_funcs;
@@ -233,7 +233,7 @@ int mgag200_driver_load(struct drm_device *dev, unsigned long flags) · 6 unmodified lines
233233 r = mgag200_modeset_init(mdev);
234234 if (r) {
235235 dev_err(&dev->pdev->dev, "Fatal error during modeset init: %d\n", r);
236− goto out;
236+ goto err_modeset;
237237 }
238238
239239 /* Make small buffers to store a hardware cursor (double buffered icon updates) */
@@ -241,20 +241,24 @@ int mgag200_driver_load(struct drm_device *dev, unsigned long flags) · 1 unmodified line
241241 &mdev->cursor.pixels_1);
242242 mgag200_bo_create(dev, roundup(48*64, PAGE_SIZE), 0, 0,
243243 &mdev->cursor.pixels_2);
244− if (!mdev->cursor.pixels_2 || !mdev->cursor.pixels_1)
245− goto cursor_nospace;
246− mdev->cursor.pixels_current = mdev->cursor.pixels_1;
247− mdev->cursor.pixels_prev = mdev->cursor.pixels_2;
248− goto cursor_done;
249− cursor_nospace:
250− mdev->cursor.pixels_1 = NULL;
251− mdev->cursor.pixels_2 = NULL;
252− dev_warn(&dev->pdev->dev, "Could not allocate space for cursors. Not doing hardware cursors.\n");
253− cursor_done:
254−
255−out:
256− if (r)
257− mgag200_driver_unload(dev);
244+ if (!mdev->cursor.pixels_2 || !mdev->cursor.pixels_1) {
245+ mdev->cursor.pixels_1 = NULL;
246+ mdev->cursor.pixels_2 = NULL;
247+ dev_warn(&dev->pdev->dev,
248+ "Could not allocate space for cursors. Not doing hardware cursors.\n");
249+ } else {
250+ mdev->cursor.pixels_current = mdev->cursor.pixels_1;
251+ mdev->cursor.pixels_prev = mdev->cursor.pixels_2;
252+ }
253+
254+ return 0;
255+
256+err_modeset:
257+ drm_mode_config_cleanup(dev);
258+ mgag200_mm_fini(mdev);
259+err_mm:
260+ dev->dev_private = NULL;
261+
258262 return r;
259263 }
260264
drivers/gpu/drm/qxl/qxl_display.c+8−6
@@ -618,7 +618,7 @@ static int qxl_crtc_mode_set(struct drm_crtc *crtc, · 617 unmodified lines
618618 adjusted_mode->hdisplay,
619619 adjusted_mode->vdisplay);
620620
621− if (qcrtc->index == 0)
621+ if (bo->is_primary == false)
622622 recreate_primary = true;
623623
624624 if (bo->surf.stride * bo->surf.height > qdev->vram_size) {
@@ -886,13 +886,15 @@ static enum drm_connector_status qxl_conn_detect( · 261 unmodified lines
886886 drm_connector_to_qxl_output(connector);
887887 struct drm_device *ddev = connector->dev;
888888 struct qxl_device *qdev = ddev->dev_private;
889− int connected;
889+ bool connected = false;
890890
891891 /* The first monitor is always connected */
892− connected = (output->index == 0) ||
893− (qdev->client_monitors_config &&
894− qdev->client_monitors_config->count > output->index &&
895− qxl_head_enabled(&qdev->client_monitors_config->heads[output->index]));
892+ if (!qdev->client_monitors_config) {
893+ if (output->index == 0)
894+ connected = true;
895+ } else
896+ connected = qdev->client_monitors_config->count > output->index &&
897+ qxl_head_enabled(&qdev->client_monitors_config->heads[output->index]);
896898
897899 DRM_DEBUG("#%d connected: %d\n", output->index, connected);
898900 if (!connected)
drivers/gpu/drm/radeon/atombios_encoders.c+4−4
@@ -1624,8 +1624,9 @@ radeon_atom_encoder_dpms_avivo(struct drm_encoder *encoder, int mode) · 1623 unmodified lines
16241624 } else
16251625 atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args);
16261626 if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) {
1627− args.ucAction = ATOM_LCD_BLON;
1628− atom_execute_table(rdev->mode_info.atom_context, index, (uint32_t *)&args);
1627+ struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv;
1628+
1629+ atombios_set_backlight_level(radeon_encoder, dig->backlight_level);
16291630 }
16301631 break;
16311632 case DRM_MODE_DPMS_STANDBY:
@@ -1706,8 +1707,7 @@ radeon_atom_encoder_dpms_dig(struct drm_encoder *encoder, int mode) · 74 unmodified lines
17061707 atombios_dig_encoder_setup(encoder, ATOM_ENCODER_CMD_DP_VIDEO_ON, 0);
17071708 }
17081709 if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT))
1709− atombios_dig_transmitter_setup(encoder,
1710− ATOM_TRANSMITTER_ACTION_LCD_BLON, 0, 0);
1710+ atombios_set_backlight_level(radeon_encoder, dig->backlight_level);
17111711 if (ext_encoder)
17121712 atombios_external_encoder_setup(encoder, ext_encoder, ATOM_ENABLE);
17131713 break;
drivers/gpu/drm/radeon/radeon_device.c+4−0
@@ -1573,10 +1573,12 @@ int radeon_suspend_kms(struct drm_device *dev, bool suspend, bool fbcon) · 1572 unmodified lines
15731573
15741574 drm_kms_helper_poll_disable(dev);
15751575
1576+ drm_modeset_lock_all(dev);
15761577 /* turn off display hw */
15771578 list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
15781579 drm_helper_connector_dpms(connector, DRM_MODE_DPMS_OFF);
15791580 }
1581+ drm_modeset_unlock_all(dev);
15801582
15811583 /* unpin the front buffers and cursors */
15821584 list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
@@ -1734,9 +1736,11 @@ int radeon_resume_kms(struct drm_device *dev, bool resume, bool fbcon) · 151 unmodified lines
17341736 if (fbcon) {
17351737 drm_helper_resume_force_mode(dev);
17361738 /* turn on display hw */
1739+ drm_modeset_lock_all(dev);
17371740 list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
17381741 drm_helper_connector_dpms(connector, DRM_MODE_DPMS_ON);
17391742 }
1743+ drm_modeset_unlock_all(dev);
17401744 }
17411745
17421746 drm_kms_helper_poll_enable(dev);
drivers/gpu/drm/radeon/radeon_dp_mst.c+9−2
@@ -265,7 +265,6 @@ static struct drm_connector *radeon_dp_add_mst_connector(struct drm_dp_mst_topol · 264 unmodified lines
265265 {
266266 struct radeon_connector *master = container_of(mgr, struct radeon_connector, mst_mgr);
267267 struct drm_device *dev = master->base.dev;
268− struct radeon_device *rdev = dev->dev_private;
269268 struct radeon_connector *radeon_connector;
270269 struct drm_connector *connector;
271270
@@ -286,12 +285,19 @@ static struct drm_connector *radeon_dp_add_mst_connector(struct drm_dp_mst_topol · 14 unmodified lines
286285 drm_object_attach_property(&connector->base, dev->mode_config.path_property, 0);
287286 drm_mode_connector_set_path_property(connector, pathprop);
288287
288+ return connector;
289+}
290+
291+static void radeon_dp_register_mst_connector(struct drm_connector *connector)
292+{
293+ struct drm_device *dev = connector->dev;
294+ struct radeon_device *rdev = dev->dev_private;
295+
289296 drm_modeset_lock_all(dev);
290297 radeon_fb_add_connector(rdev, connector);
291298 drm_modeset_unlock_all(dev);
292299
293300 drm_connector_register(connector);
294− return connector;
295301 }
296302
297303 static void radeon_dp_destroy_mst_connector(struct drm_dp_mst_topology_mgr *mgr,
@@ -324,6 +330,7 @@ static void radeon_dp_mst_hotplug(struct drm_dp_mst_topology_mgr *mgr) · 26 unmodified lines
324330
325331 struct drm_dp_mst_topology_cbs mst_cbs = {
326332 .add_connector = radeon_dp_add_mst_connector,
333+ .register_connector = radeon_dp_register_mst_connector,
327334 .destroy_connector = radeon_dp_destroy_mst_connector,
328335 .hotplug = radeon_dp_mst_hotplug,
329336 };
drivers/gpu/drm/radeon/radeon_fb.c+1−31
@@ -48,40 +48,10 @@ struct radeon_fbdev { · 47 unmodified lines
4848 struct radeon_device *rdev;
4949 };
5050
51−/**
52− * radeon_fb_helper_set_par - Hide cursor on CRTCs used by fbdev.
53− *
54− * @info: fbdev info
55− *
56− * This function hides the cursor on all CRTCs used by fbdev.
57− */
58−static int radeon_fb_helper_set_par(struct fb_info *info)
59−{
60− int ret;
61−
62− ret = drm_fb_helper_set_par(info);
63−
64− /* XXX: with universal plane support fbdev will automatically disable
65− * all non-primary planes (including the cursor)
66− */
67− if (ret == 0) {
68− struct drm_fb_helper *fb_helper = info->par;
69− int i;
70−
71− for (i = 0; i < fb_helper->crtc_count; i++) {
72− struct drm_crtc *crtc = fb_helper->crtc_info[i].mode_set.crtc;
73−
74− radeon_crtc_cursor_set2(crtc, NULL, 0, 0, 0, 0, 0);
75− }
76− }
77−
78− return ret;
79−}
80−
8151 static struct fb_ops radeonfb_ops = {
8252 .owner = THIS_MODULE,
8353 .fb_check_var = drm_fb_helper_check_var,
84− .fb_set_par = radeon_fb_helper_set_par,
54+ .fb_set_par = drm_fb_helper_set_par,
8555 .fb_fillrect = drm_fb_helper_cfb_fillrect,
8656 .fb_copyarea = drm_fb_helper_cfb_copyarea,
8757 .fb_imageblit = drm_fb_helper_cfb_imageblit,
drivers/gpu/drm/radeon/si_dpm.c+1−0
@@ -2927,6 +2927,7 @@ static struct si_dpm_quirk si_dpm_quirk_list[] = { · 2926 unmodified lines
29272927 { PCI_VENDOR_ID_ATI, 0x6810, 0x1462, 0x3036, 0, 120000 },
29282928 { PCI_VENDOR_ID_ATI, 0x6811, 0x174b, 0xe271, 0, 120000 },
29292929 { PCI_VENDOR_ID_ATI, 0x6810, 0x174b, 0xe271, 85000, 90000 },
2930+ { PCI_VENDOR_ID_ATI, 0x6811, 0x1762, 0x2015, 0, 120000 },
29302931 { 0, 0, 0, 0 },
29312932 };
29322933
drivers/gpu/drm/ttm/ttm_bo.c+16−12
@@ -882,6 +882,8 @@ int ttm_bo_mem_space(struct ttm_buffer_object *bo, · 881 unmodified lines
882882 if (ret)
883883 return ret;
884884 man = &bdev->man[mem_type];
885+ if (!man->has_type || !man->use_type)
886+ continue;
885887
886888 type_ok = ttm_bo_mt_compatible(man, mem_type, place,
887889 &cur_flags);
@@ -889,6 +891,7 @@ int ttm_bo_mem_space(struct ttm_buffer_object *bo, · 1 unmodified line
889891 if (!type_ok)
890892 continue;
891893
894+ type_found = true;
892895 cur_flags = ttm_bo_select_caching(man, bo->mem.placement,
893896 cur_flags);
894897 /*
@@ -901,12 +904,10 @@ int ttm_bo_mem_space(struct ttm_buffer_object *bo, · 6 unmodified lines
901904 if (mem_type == TTM_PL_SYSTEM)
902905 break;
903906
904− if (man->has_type && man->use_type) {
905− type_found = true;
906− ret = (*man->func->get_node)(man, bo, place, mem);
907− if (unlikely(ret))
908− return ret;
909− }
907+ ret = (*man->func->get_node)(man, bo, place, mem);
908+ if (unlikely(ret))
909+ return ret;
910+
910911 if (mem->mm_node)
911912 break;
912913 }
@@ -917,9 +918,6 @@ int ttm_bo_mem_space(struct ttm_buffer_object *bo, · 4 unmodified lines
917918 return 0;
918919 }
919920
920− if (!type_found)
921− return -EINVAL;
922−
923921 for (i = 0; i < placement->num_busy_placement; ++i) {
924922 const struct ttm_place *place = &placement->busy_placement[i];
925923
@@ -927,11 +925,12 @@ int ttm_bo_mem_space(struct ttm_buffer_object *bo, · 1 unmodified line
927925 if (ret)
928926 return ret;
929927 man = &bdev->man[mem_type];
930− if (!man->has_type)
928+ if (!man->has_type || !man->use_type)
931929 continue;
932930 if (!ttm_bo_mt_compatible(man, mem_type, place, &cur_flags))
933931 continue;
934932
933+ type_found = true;
935934 cur_flags = ttm_bo_select_caching(man, bo->mem.placement,
936935 cur_flags);
937936 /*
@@ -957,8 +956,13 @@ int ttm_bo_mem_space(struct ttm_buffer_object *bo, · 19 unmodified lines
957956 if (ret == -ERESTARTSYS)
958957 has_erestartsys = true;
959958 }
960− ret = (has_erestartsys) ? -ERESTARTSYS : -ENOMEM;
961− return ret;
959+
960+ if (!type_found) {
961+ printk(KERN_ERR TTM_PFX "No compatible memory type found.\n");
962+ return -EINVAL;
963+ }
964+
965+ return (has_erestartsys) ? -ERESTARTSYS : -ENOMEM;
962966 }
963967 EXPORT_SYMBOL(ttm_bo_mem_space);
964968
drivers/gpu/drm/vmwgfx/Kconfig+1−1
@@ -1,6 +1,6 @@
11 config DRM_VMWGFX
22 tristate "DRM driver for VMware Virtual GPU"
3− depends on DRM && PCI
3+ depends on DRM && PCI && X86
44 select FB_DEFERRED_IO
55 select FB_CFB_FILLRECT
66 select FB_CFB_COPYAREA
drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf.c+8−0
@@ -681,6 +681,14 @@ static bool vmw_cmdbuf_try_alloc(struct vmw_cmdbuf_man *man, · 680 unmodified lines
681681 0, 0,
682682 DRM_MM_SEARCH_DEFAULT,
683683 DRM_MM_CREATE_DEFAULT);
684+ if (ret) {
685+ (void) vmw_cmdbuf_man_process(man);
686+ ret = drm_mm_insert_node_generic(&man->mm, info->node,
687+ info->page_size, 0, 0,
688+ DRM_MM_SEARCH_DEFAULT,
689+ DRM_MM_CREATE_DEFAULT);
690+ }
691+
684692 spin_unlock_bh(&man->lock);
685693 info->done = !ret;
686694
drivers/gpu/drm/vmwgfx/vmwgfx_cotable.c+1−2
@@ -311,7 +311,6 @@ static int vmw_cotable_unbind(struct vmw_resource *res, · 310 unmodified lines
311311 struct vmw_private *dev_priv = res->dev_priv;
312312 struct ttm_buffer_object *bo = val_buf->bo;
313313 struct vmw_fence_obj *fence;
314− int ret;
315314
316315 if (list_empty(&res->mob_head))
317316 return 0;
@@ -328,7 +327,7 @@ static int vmw_cotable_unbind(struct vmw_resource *res, · 10 unmodified lines
328327 if (likely(fence != NULL))
329328 vmw_fence_obj_unreference(&fence);
330329
331− return ret;
330+ return 0;
332331 }
333332
334333 /**
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c+2−8
@@ -752,12 +752,8 @@ static int vmw_driver_load(struct drm_device *dev, unsigned long chipset) · 751 unmodified lines
752752 ttm_lock_set_kill(&dev_priv->fbdev_master.lock, false, SIGTERM);
753753 dev_priv->active_master = &dev_priv->fbdev_master;
754754
755−
756− dev_priv->mmio_mtrr = arch_phys_wc_add(dev_priv->mmio_start,
757− dev_priv->mmio_size);
758−
759− dev_priv->mmio_virt = ioremap_wc(dev_priv->mmio_start,
760− dev_priv->mmio_size);
755+ dev_priv->mmio_virt = ioremap_cache(dev_priv->mmio_start,
756+ dev_priv->mmio_size);
761757
762758 if (unlikely(dev_priv->mmio_virt == NULL)) {
763759 ret = -ENOMEM;
@@ -913,7 +909,6 @@ out_no_device: · 149 unmodified lines
913909 out_err4:
914910 iounmap(dev_priv->mmio_virt);
915911 out_err3:
916− arch_phys_wc_del(dev_priv->mmio_mtrr);
917912 vmw_ttm_global_release(dev_priv);
918913 out_err0:
919914 for (i = vmw_res_context; i < vmw_res_max; ++i)
@@ -964,7 +959,6 @@ static int vmw_driver_unload(struct drm_device *dev) · 44 unmodified lines
964959
965960 ttm_object_device_release(&dev_priv->tdev);
966961 iounmap(dev_priv->mmio_virt);
967− arch_phys_wc_del(dev_priv->mmio_mtrr);
968962 if (dev_priv->ctx.staged_bindings)
969963 vmw_binding_state_free(dev_priv->ctx.staged_bindings);
970964 vmw_ttm_global_release(dev_priv);
drivers/gpu/drm/vmwgfx/vmwgfx_drv.h+4−3
@@ -376,7 +376,6 @@ struct vmw_private { · 375 unmodified lines
376376 uint32_t initial_width;
377377 uint32_t initial_height;
378378 u32 __iomem *mmio_virt;
379− int mmio_mtrr;
380379 uint32_t capabilities;
381380 uint32_t max_gmr_ids;
382381 uint32_t max_gmr_pages;
@@ -631,7 +630,8 @@ extern int vmw_user_dmabuf_alloc(struct vmw_private *dev_priv, · 248 unmodified lines
631630 uint32_t size,
632631 bool shareable,
633632 uint32_t *handle,
634− struct vmw_dma_buffer **p_dma_buf);
633+ struct vmw_dma_buffer **p_dma_buf,
634+ struct ttm_base_object **p_base);
635635 extern int vmw_user_dmabuf_reference(struct ttm_object_file *tfile,
636636 struct vmw_dma_buffer *dma_buf,
637637 uint32_t *handle);
@@ -645,7 +645,8 @@ extern uint32_t vmw_dmabuf_validate_node(struct ttm_buffer_object *bo, · 7 unmodified lines
645645 uint32_t cur_validate_node);
646646 extern void vmw_dmabuf_validate_clear(struct ttm_buffer_object *bo);
647647 extern int vmw_user_dmabuf_lookup(struct ttm_object_file *tfile,
648− uint32_t id, struct vmw_dma_buffer **out);
648+ uint32_t id, struct vmw_dma_buffer **out,
649+ struct ttm_base_object **base);
649650 extern int vmw_stream_claim_ioctl(struct drm_device *dev, void *data,
650651 struct drm_file *file_priv);
651652 extern int vmw_stream_unref_ioctl(struct drm_device *dev, void *data,
drivers/gpu/drm/vmwgfx/vmwgfx_execbuf.c+4−2
@@ -1236,7 +1236,8 @@ static int vmw_translate_mob_ptr(struct vmw_private *dev_priv, · 1235 unmodified lines
12361236 struct vmw_relocation *reloc;
12371237 int ret;
12381238
1239− ret = vmw_user_dmabuf_lookup(sw_context->fp->tfile, handle, &vmw_bo);
1239+ ret = vmw_user_dmabuf_lookup(sw_context->fp->tfile, handle, &vmw_bo,
1240+ NULL);
12401241 if (unlikely(ret != 0)) {
12411242 DRM_ERROR("Could not find or use MOB buffer.\n");
12421243 ret = -EINVAL;
@@ -1296,7 +1297,8 @@ static int vmw_translate_guest_ptr(struct vmw_private *dev_priv, · 53 unmodified lines
12961297 struct vmw_relocation *reloc;
12971298 int ret;
12981299
1299− ret = vmw_user_dmabuf_lookup(sw_context->fp->tfile, handle, &vmw_bo);
1300+ ret = vmw_user_dmabuf_lookup(sw_context->fp->tfile, handle, &vmw_bo,
1301+ NULL);
13001302 if (unlikely(ret != 0)) {
13011303 DRM_ERROR("Could not find or use GMR region.\n");
13021304 ret = -EINVAL;
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c+1−2
@@ -1685,7 +1685,6 @@ int vmw_kms_helper_dirty(struct vmw_private *dev_priv, · 1684 unmodified lines
16851685 struct drm_crtc *crtc;
16861686 u32 num_units = 0;
16871687 u32 i, k;
1688− int ret;
16891688
16901689 dirty->dev_priv = dev_priv;
16911690
@@ -1711,7 +1710,7 @@ int vmw_kms_helper_dirty(struct vmw_private *dev_priv, · 19 unmodified lines
17111710 if (!dirty->cmd) {
17121711 DRM_ERROR("Couldn't reserve fifo space "
17131712 "for dirty blits.\n");
1714− return ret;
1713+ return -ENOMEM;
17151714 }
17161715 memset(dirty->cmd, 0, dirty->fifo_reserve_size);
17171716 }
drivers/gpu/drm/vmwgfx/vmwgfx_overlay.c+1−1
@@ -484,7 +484,7 @@ int vmw_overlay_ioctl(struct drm_device *dev, void *data, · 483 unmodified lines
484484 goto out_unlock;
485485 }
486486
487− ret = vmw_user_dmabuf_lookup(tfile, arg->handle, &buf);
487+ ret = vmw_user_dmabuf_lookup(tfile, arg->handle, &buf, NULL);
488488 if (ret)
489489 goto out_unlock;
490490
drivers/gpu/drm/vmwgfx/vmwgfx_resource.c+21−8
@@ -354,7 +354,7 @@ int vmw_user_lookup_handle(struct vmw_private *dev_priv, · 353 unmodified lines
354354 }
355355
356356 *out_surf = NULL;
357− ret = vmw_user_dmabuf_lookup(tfile, handle, out_buf);
357+ ret = vmw_user_dmabuf_lookup(tfile, handle, out_buf, NULL);
358358 return ret;
359359 }
360360
@@ -481,7 +481,8 @@ int vmw_user_dmabuf_alloc(struct vmw_private *dev_priv, · 120 unmodified lines
481481 uint32_t size,
482482 bool shareable,
483483 uint32_t *handle,
484− struct vmw_dma_buffer **p_dma_buf)
484+ struct vmw_dma_buffer **p_dma_buf,
485+ struct ttm_base_object **p_base)
485486 {
486487 struct vmw_user_dma_buffer *user_bo;
487488 struct ttm_buffer_object *tmp;
@@ -515,6 +516,10 @@ int vmw_user_dmabuf_alloc(struct vmw_private *dev_priv, · 27 unmodified lines
515516 }
516517
517518 *p_dma_buf = &user_bo->dma;
519+ if (p_base) {
520+ *p_base = &user_bo->prime.base;
521+ kref_get(&(*p_base)->refcount);
522+ }
518523 *handle = user_bo->prime.base.hash.key;
519524
520525 out_no_base_object:
@@ -631,6 +636,7 @@ int vmw_user_dmabuf_synccpu_ioctl(struct drm_device *dev, void *data, · 110 unmodified lines
631636 struct vmw_dma_buffer *dma_buf;
632637 struct vmw_user_dma_buffer *user_bo;
633638 struct ttm_object_file *tfile = vmw_fpriv(file_priv)->tfile;
639+ struct ttm_base_object *buffer_base;
634640 int ret;
635641
636642 if ((arg->flags & (drm_vmw_synccpu_read | drm_vmw_synccpu_write)) == 0
@@ -643,7 +649,8 @@ int vmw_user_dmabuf_synccpu_ioctl(struct drm_device *dev, void *data, · 6 unmodified lines
643649
644650 switch (arg->op) {
645651 case drm_vmw_synccpu_grab:
646− ret = vmw_user_dmabuf_lookup(tfile, arg->handle, &dma_buf);
652+ ret = vmw_user_dmabuf_lookup(tfile, arg->handle, &dma_buf,
653+ &buffer_base);
647654 if (unlikely(ret != 0))
648655 return ret;
649656
@@ -651,6 +658,7 @@ int vmw_user_dmabuf_synccpu_ioctl(struct drm_device *dev, void *data, · 1 unmodified line
651658 dma);
652659 ret = vmw_user_dmabuf_synccpu_grab(user_bo, tfile, arg->flags);
653660 vmw_dmabuf_unreference(&dma_buf);
661+ ttm_base_object_unref(&buffer_base);
654662 if (unlikely(ret != 0 && ret != -ERESTARTSYS &&
655663 ret != -EBUSY)) {
656664 DRM_ERROR("Failed synccpu grab on handle 0x%08x.\n",
@@ -692,7 +700,8 @@ int vmw_dmabuf_alloc_ioctl(struct drm_device *dev, void *data, · 35 unmodified lines
692700 return ret;
693701
694702 ret = vmw_user_dmabuf_alloc(dev_priv, vmw_fpriv(file_priv)->tfile,
695− req->size, false, &handle, &dma_buf);
703+ req->size, false, &handle, &dma_buf,
704+ NULL);
696705 if (unlikely(ret != 0))
697706 goto out_no_dmabuf;
698707
@@ -721,7 +730,8 @@ int vmw_dmabuf_unref_ioctl(struct drm_device *dev, void *data, · 22 unmodified lines
721730 }
722731
723732 int vmw_user_dmabuf_lookup(struct ttm_object_file *tfile,
724− uint32_t handle, struct vmw_dma_buffer **out)
733+ uint32_t handle, struct vmw_dma_buffer **out,
734+ struct ttm_base_object **p_base)
725735 {
726736 struct vmw_user_dma_buffer *vmw_user_bo;
727737 struct ttm_base_object *base;
@@ -743,7 +753,10 @@ int vmw_user_dmabuf_lookup(struct ttm_object_file *tfile, · 15 unmodified lines
743753 vmw_user_bo = container_of(base, struct vmw_user_dma_buffer,
744754 prime.base);
745755 (void)ttm_bo_reference(&vmw_user_bo->dma.base);
746− ttm_base_object_unref(&base);
756+ if (p_base)
757+ *p_base = base;
758+ else
759+ ttm_base_object_unref(&base);
747760 *out = &vmw_user_bo->dma;
748761
749762 return 0;
@@ -1004,7 +1017,7 @@ int vmw_dumb_create(struct drm_file *file_priv, · 254 unmodified lines
10041017
10051018 ret = vmw_user_dmabuf_alloc(dev_priv, vmw_fpriv(file_priv)->tfile,
10061019 args->size, false, &args->handle,
1007− &dma_buf);
1020+ &dma_buf, NULL);
10081021 if (unlikely(ret != 0))
10091022 goto out_no_dmabuf;
10101023
@@ -1032,7 +1045,7 @@ int vmw_dumb_map_offset(struct drm_file *file_priv, · 21 unmodified lines
10321045 struct vmw_dma_buffer *out_buf;
10331046 int ret;
10341047
1035− ret = vmw_user_dmabuf_lookup(tfile, handle, &out_buf);
1048+ ret = vmw_user_dmabuf_lookup(tfile, handle, &out_buf, NULL);
10361049 if (ret != 0)
10371050 return -EINVAL;
10381051
drivers/gpu/drm/vmwgfx/vmwgfx_shader.c+1−1
@@ -855,7 +855,7 @@ static int vmw_shader_define(struct drm_device *dev, struct drm_file *file_priv, · 854 unmodified lines
855855
856856 if (buffer_handle != SVGA3D_INVALID_ID) {
857857 ret = vmw_user_dmabuf_lookup(tfile, buffer_handle,
858− &buffer);
858+ &buffer, NULL);
859859 if (unlikely(ret != 0)) {
860860 DRM_ERROR("Could not find buffer for shader "
861861 "creation.\n");
drivers/gpu/drm/vmwgfx/vmwgfx_surface.c+8−3
@@ -46,6 +46,7 @@ struct vmw_user_surface { · 45 unmodified lines
4646 struct vmw_surface srf;
4747 uint32_t size;
4848 struct drm_master *master;
49+ struct ttm_base_object *backup_base;
4950 };
5051
5152 /**
@@ -656,6 +657,7 @@ static void vmw_user_surface_base_release(struct ttm_base_object **p_base) · 604 unmodified lines
656657 struct vmw_resource *res = &user_srf->srf.res;
657658
658659 *p_base = NULL;
660+ ttm_base_object_unref(&user_srf->backup_base);
659661 vmw_resource_unreference(&res);
660662 }
661663
@@ -851,7 +853,8 @@ int vmw_surface_define_ioctl(struct drm_device *dev, void *data, · 189 unmodified lines
851853 res->backup_size,
852854 true,
853855 &backup_handle,
854− &res->backup);
856+ &res->backup,
857+ &user_srf->backup_base);
855858 if (unlikely(ret != 0)) {
856859 vmw_resource_unreference(&res);
857860 goto out_unlock;
@@ -1321,7 +1324,8 @@ int vmw_gb_surface_define_ioctl(struct drm_device *dev, void *data, · 463 unmodified lines
13211324
13221325 if (req->buffer_handle != SVGA3D_INVALID_ID) {
13231326 ret = vmw_user_dmabuf_lookup(tfile, req->buffer_handle,
1324− &res->backup);
1327+ &res->backup,
1328+ &user_srf->backup_base);
13251329 if (ret == 0 && res->backup->base.num_pages * PAGE_SIZE <
13261330 res->backup_size) {
13271331 DRM_ERROR("Surface backup buffer is too small.\n");
@@ -1335,7 +1339,8 @@ int vmw_gb_surface_define_ioctl(struct drm_device *dev, void *data, · 7 unmodified lines
13351339 req->drm_surface_flags &
13361340 drm_vmw_surface_flag_shareable,
13371341 &backup_handle,
1338− &res->backup);
1342+ &res->backup,
1343+ &user_srf->backup_base);
13391344
13401345 if (unlikely(ret != 0)) {
13411346 vmw_resource_unreference(&res);
drivers/hv/channel_mgmt.c+17−0
@@ -204,6 +204,8 @@ void hv_process_channel_removal(struct vmbus_channel *channel, u32 relid) · 203 unmodified lines
204204 spin_lock_irqsave(&vmbus_connection.channel_lock, flags);
205205 list_del(&channel->listentry);
206206 spin_unlock_irqrestore(&vmbus_connection.channel_lock, flags);
207+
208+ primary_channel = channel;
207209 } else {
208210 primary_channel = channel->primary_channel;
209211 spin_lock_irqsave(&primary_channel->lock, flags);
@@ -211,6 +213,14 @@ void hv_process_channel_removal(struct vmbus_channel *channel, u32 relid) · 1 unmodified line
211213 primary_channel->num_sc--;
212214 spin_unlock_irqrestore(&primary_channel->lock, flags);
213215 }
216+
217+ /*
218+ * We need to free the bit for init_vp_index() to work in the case
219+ * of sub-channel, when we reload drivers like hv_netvsc.
220+ */
221+ cpumask_clear_cpu(channel->target_cpu,
222+ &primary_channel->alloced_cpus_in_node);
223+
214224 free_channel(channel);
215225 }
216226
@@ -458,6 +468,13 @@ static void init_vp_index(struct vmbus_channel *channel, const uuid_le *type_gui · 241 unmodified lines
458468 continue;
459469 }
460470
471+ /*
472+ * NOTE: in the case of sub-channel, we clear the sub-channel
473+ * related bit(s) in primary->alloced_cpus_in_node in
474+ * hv_process_channel_removal(), so when we reload drivers
475+ * like hv_netvsc in SMP guest, here we're able to re-allocate
476+ * bit from primary->alloced_cpus_in_node.
477+ */
461478 if (!cpumask_test_cpu(cur_cpu,
462479 &primary->alloced_cpus_in_node)) {
463480 cpumask_set_cpu(cur_cpu,
drivers/hwmon/abx500.c+1−0
@@ -470,6 +470,7 @@ static const struct of_device_id abx500_temp_match[] = { · 469 unmodified lines
470470 { .compatible = "stericsson,abx500-temp" },
471471 {},
472472 };
473+MODULE_DEVICE_TABLE(of, abx500_temp_match);
473474 #endif
474475
475476 static struct platform_driver abx500_temp_driver = {
drivers/hwmon/gpio-fan.c+1−0
@@ -539,6 +539,7 @@ static const struct of_device_id of_gpio_fan_match[] = { · 538 unmodified lines
539539 { .compatible = "gpio-fan", },
540540 {},
541541 };
542+MODULE_DEVICE_TABLE(of, of_gpio_fan_match);
542543 #endif /* CONFIG_OF_GPIO */
543544
544545 static int gpio_fan_probe(struct platform_device *pdev)
drivers/hwmon/pwm-fan.c+1−0
@@ -323,6 +323,7 @@ static const struct of_device_id of_pwm_fan_match[] = { · 322 unmodified lines
323323 { .compatible = "pwm-fan", },
324324 {},
325325 };
326+MODULE_DEVICE_TABLE(of, of_pwm_fan_match);
326327
327328 static struct platform_driver pwm_fan_driver = {
328329 .probe = pwm_fan_probe,
drivers/idle/intel_idle.c+10−2
@@ -620,7 +620,7 @@ static struct cpuidle_state skl_cstates[] = { · 619 unmodified lines
620620 .name = "C6-SKL",
621621 .desc = "MWAIT 0x20",
622622 .flags = MWAIT2flg(0x20) | CPUIDLE_FLAG_TLB_FLUSHED,
623− .exit_latency = 75,
623+ .exit_latency = 85,
624624 .target_residency = 200,
625625 .enter = &intel_idle,
626626 .enter_freeze = intel_idle_freeze, },
@@ -636,10 +636,18 @@ static struct cpuidle_state skl_cstates[] = { · 9 unmodified lines
636636 .name = "C8-SKL",
637637 .desc = "MWAIT 0x40",
638638 .flags = MWAIT2flg(0x40) | CPUIDLE_FLAG_TLB_FLUSHED,
639− .exit_latency = 174,
639+ .exit_latency = 200,
640640 .target_residency = 800,
641641 .enter = &intel_idle,
642642 .enter_freeze = intel_idle_freeze, },
643+ {
644+ .name = "C9-SKL",
645+ .desc = "MWAIT 0x50",
646+ .flags = MWAIT2flg(0x50) | CPUIDLE_FLAG_TLB_FLUSHED,
647+ .exit_latency = 480,
648+ .target_residency = 5000,
649+ .enter = &intel_idle,
650+ .enter_freeze = intel_idle_freeze, },
643651 {
644652 .name = "C10-SKL",
645653 .desc = "MWAIT 0x60",
drivers/infiniband/hw/mlx5/main.c+1−66
@@ -245,7 +245,6 @@ static int mlx5_ib_query_device(struct ib_device *ibdev, · 244 unmodified lines
245245 props->device_cap_flags |= IB_DEVICE_BAD_QKEY_CNTR;
246246 if (MLX5_CAP_GEN(mdev, apm))
247247 props->device_cap_flags |= IB_DEVICE_AUTO_PATH_MIG;
248− props->device_cap_flags |= IB_DEVICE_LOCAL_DMA_LKEY;
249248 if (MLX5_CAP_GEN(mdev, xrc))
250249 props->device_cap_flags |= IB_DEVICE_XRC;
251250 props->device_cap_flags |= IB_DEVICE_MEM_MGT_EXTENSIONS;
@@ -795,53 +794,6 @@ static int mlx5_ib_mmap(struct ib_ucontext *ibcontext, struct vm_area_struct *vm · 543 unmodified lines
795794 return 0;
796795 }
797796
798−static int alloc_pa_mkey(struct mlx5_ib_dev *dev, u32 *key, u32 pdn)
799−{
800− struct mlx5_create_mkey_mbox_in *in;
801− struct mlx5_mkey_seg *seg;
802− struct mlx5_core_mr mr;
803− int err;
804−
805− in = kzalloc(sizeof(*in), GFP_KERNEL);
806− if (!in)
807− return -ENOMEM;
808−
809− seg = &in->seg;
810− seg->flags = MLX5_PERM_LOCAL_READ | MLX5_ACCESS_MODE_PA;
811− seg->flags_pd = cpu_to_be32(pdn | MLX5_MKEY_LEN64);
812− seg->qpn_mkey7_0 = cpu_to_be32(0xffffff << 8);
813− seg->start_addr = 0;
814−
815− err = mlx5_core_create_mkey(dev->mdev, &mr, in, sizeof(*in),
816− NULL, NULL, NULL);
817− if (err) {
818− mlx5_ib_warn(dev, "failed to create mkey, %d\n", err);
819− goto err_in;
820− }
821−
822− kfree(in);
823− *key = mr.key;
824−
825− return 0;
826−
827−err_in:
828− kfree(in);
829−
830− return err;
831−}
832−
833−static void free_pa_mkey(struct mlx5_ib_dev *dev, u32 key)
834−{
835− struct mlx5_core_mr mr;
836− int err;
837−
838− memset(&mr, 0, sizeof(mr));
839− mr.key = key;
840− err = mlx5_core_destroy_mkey(dev->mdev, &mr);
841− if (err)
842− mlx5_ib_warn(dev, "failed to destroy mkey 0x%x\n", key);
843−}
844−
845797 static struct ib_pd *mlx5_ib_alloc_pd(struct ib_device *ibdev,
846798 struct ib_ucontext *context,
847799 struct ib_udata *udata)
@@ -867,13 +819,6 @@ static struct ib_pd *mlx5_ib_alloc_pd(struct ib_device *ibdev, · 19 unmodified lines
867819 kfree(pd);
868820 return ERR_PTR(-EFAULT);
869821 }
870− } else {
871− err = alloc_pa_mkey(to_mdev(ibdev), &pd->pa_lkey, pd->pdn);
872− if (err) {
873− mlx5_core_dealloc_pd(to_mdev(ibdev)->mdev, pd->pdn);
874− kfree(pd);
875− return ERR_PTR(err);
876− }
877822 }
878823
879824 return &pd->ibpd;
@@ -884,9 +829,6 @@ static int mlx5_ib_dealloc_pd(struct ib_pd *pd) · 4 unmodified lines
884829 struct mlx5_ib_dev *mdev = to_mdev(pd->device);
885830 struct mlx5_ib_pd *mpd = to_mpd(pd);
886831
887− if (!pd->uobject)
888− free_pa_mkey(mdev, mpd->pa_lkey);
889−
890832 mlx5_core_dealloc_pd(mdev->mdev, mpd->pdn);
891833 kfree(mpd);
892834
@@ -1245,18 +1187,10 @@ static int create_dev_resources(struct mlx5_ib_resources *devr) · 352 unmodified lines
12451187 struct ib_srq_init_attr attr;
12461188 struct mlx5_ib_dev *dev;
12471189 struct ib_cq_init_attr cq_attr = {.cqe = 1};
1248− u32 rsvd_lkey;
12491190 int ret = 0;
12501191
12511192 dev = container_of(devr, struct mlx5_ib_dev, devr);
12521193
1253− ret = mlx5_core_query_special_context(dev->mdev, &rsvd_lkey);
1254− if (ret) {
1255− pr_err("Failed to query special context %d\n", ret);
1256− return ret;
1257− }
1258− dev->ib_dev.local_dma_lkey = rsvd_lkey;
1259−
12601194 devr->p0 = mlx5_ib_alloc_pd(&dev->ib_dev, NULL, NULL);
12611195 if (IS_ERR(devr->p0)) {
12621196 ret = PTR_ERR(devr->p0);
@@ -1418,6 +1352,7 @@ static void *mlx5_ib_add(struct mlx5_core_dev *mdev) · 155 unmodified lines
14181352 strlcpy(dev->ib_dev.name, "mlx5_%d", IB_DEVICE_NAME_MAX);
14191353 dev->ib_dev.owner = THIS_MODULE;
14201354 dev->ib_dev.node_type = RDMA_NODE_IB_CA;
1355+ dev->ib_dev.local_dma_lkey = 0 /* not supported for now */;
14211356 dev->num_ports = MLX5_CAP_GEN(mdev, num_ports);
14221357 dev->ib_dev.phys_port_cnt = dev->num_ports;
14231358 dev->ib_dev.num_comp_vectors =
drivers/infiniband/hw/mlx5/mlx5_ib.h+0−2
@@ -103,7 +103,6 @@ static inline struct mlx5_ib_ucontext *to_mucontext(struct ib_ucontext *ibuconte · 102 unmodified lines
103103 struct mlx5_ib_pd {
104104 struct ib_pd ibpd;
105105 u32 pdn;
106− u32 pa_lkey;
107106 };
108107
109108 /* Use macros here so that don't have to duplicate
@@ -213,7 +212,6 @@ struct mlx5_ib_qp { · 103 unmodified lines
213212 int uuarn;
214213
215214 int create_type;
216− u32 pa_lkey;
217215
218216 /* Store signature errors */
219217 bool signature_en;
drivers/infiniband/hw/mlx5/qp.c+1−3
@@ -925,8 +925,6 @@ static int create_qp_common(struct mlx5_ib_dev *dev, struct ib_pd *pd, · 924 unmodified lines
925925 err = create_kernel_qp(dev, init_attr, qp, &in, &inlen);
926926 if (err)
927927 mlx5_ib_dbg(dev, "err %d\n", err);
928− else
929− qp->pa_lkey = to_mpd(pd)->pa_lkey;
930928 }
931929
932930 if (err)
@@ -2045,7 +2043,7 @@ static void set_frwr_pages(struct mlx5_wqe_data_seg *dseg, · 1112 unmodified lines
20452043 mfrpl->mapped_page_list[i] = cpu_to_be64(page_list[i] | perm);
20462044 dseg->addr = cpu_to_be64(mfrpl->map);
20472045 dseg->byte_count = cpu_to_be32(ALIGN(sizeof(u64) * wr->wr.fast_reg.page_list_len, 64));
2048− dseg->lkey = cpu_to_be32(pd->pa_lkey);
2046+ dseg->lkey = cpu_to_be32(pd->ibpd.local_dma_lkey);
20492047 }
20502048
20512049 static __be32 send_ieth(struct ib_send_wr *wr)
drivers/infiniband/ulp/ipoib/ipoib.h+3−1
@@ -80,7 +80,7 @@ enum { · 79 unmodified lines
8080 IPOIB_NUM_WC = 4,
8181
8282 IPOIB_MAX_PATH_REC_QUEUE = 3,
83− IPOIB_MAX_MCAST_QUEUE = 3,
83+ IPOIB_MAX_MCAST_QUEUE = 64,
8484
8585 IPOIB_FLAG_OPER_UP = 0,
8686 IPOIB_FLAG_INITIALIZED = 1,
@@ -548,6 +548,8 @@ void ipoib_path_iter_read(struct ipoib_path_iter *iter, · 461 unmodified lines
548548
549549 int ipoib_mcast_attach(struct net_device *dev, u16 mlid,
550550 union ib_gid *mgid, int set_qkey);
551+int ipoib_mcast_leave(struct net_device *dev, struct ipoib_mcast *mcast);
552+struct ipoib_mcast *__ipoib_mcast_find(struct net_device *dev, void *mgid);
551553
552554 int ipoib_init_qp(struct net_device *dev);
553555 int ipoib_transport_dev_init(struct net_device *dev, struct ib_device *ca);
drivers/infiniband/ulp/ipoib/ipoib_main.c+18−0
@@ -1149,6 +1149,9 @@ static void __ipoib_reap_neigh(struct ipoib_dev_priv *priv) · 1148 unmodified lines
11491149 unsigned long dt;
11501150 unsigned long flags;
11511151 int i;
1152+ LIST_HEAD(remove_list);
1153+ struct ipoib_mcast *mcast, *tmcast;
1154+ struct net_device *dev = priv->dev;
11521155
11531156 if (test_bit(IPOIB_STOP_NEIGH_GC, &priv->flags))
11541157 return;
@@ -1176,6 +1179,19 @@ static void __ipoib_reap_neigh(struct ipoib_dev_priv *priv) · 21 unmodified lines
11761179 lockdep_is_held(&priv->lock))) != NULL) {
11771180 /* was the neigh idle for two GC periods */
11781181 if (time_after(neigh_obsolete, neigh->alive)) {
1182+ u8 *mgid = neigh->daddr + 4;
1183+
1184+ /* Is this multicast ? */
1185+ if (*mgid == 0xff) {
1186+ mcast = __ipoib_mcast_find(dev, mgid);
1187+
1188+ if (mcast && test_bit(IPOIB_MCAST_FLAG_SENDONLY, &mcast->flags)) {
1189+ list_del(&mcast->list);
1190+ rb_erase(&mcast->rb_node, &priv->multicast_tree);
1191+ list_add_tail(&mcast->list, &remove_list);
1192+ }
1193+ }
1194+
11791195 rcu_assign_pointer(*np,
11801196 rcu_dereference_protected(neigh->hnext,
11811197 lockdep_is_held(&priv->lock)));
@@ -1191,6 +1207,8 @@ static void __ipoib_reap_neigh(struct ipoib_dev_priv *priv) · 9 unmodified lines
11911207
11921208 out_unlock:
11931209 spin_unlock_irqrestore(&priv->lock, flags);
1210+ list_for_each_entry_safe(mcast, tmcast, &remove_list, list)
1211+ ipoib_mcast_leave(dev, mcast);
11941212 }
11951213
11961214 static void ipoib_reap_neigh(struct work_struct *work)
drivers/infiniband/ulp/ipoib/ipoib_multicast.c+14−12
@@ -153,7 +153,7 @@ static struct ipoib_mcast *ipoib_mcast_alloc(struct net_device *dev, · 152 unmodified lines
153153 return mcast;
154154 }
155155
156−static struct ipoib_mcast *__ipoib_mcast_find(struct net_device *dev, void *mgid)
156+struct ipoib_mcast *__ipoib_mcast_find(struct net_device *dev, void *mgid)
157157 {
158158 struct ipoib_dev_priv *priv = netdev_priv(dev);
159159 struct rb_node *n = priv->multicast_tree.rb_node;
@@ -508,17 +508,19 @@ static void ipoib_mcast_join(struct net_device *dev, struct ipoib_mcast *mcast) · 348 unmodified lines
508508 rec.hop_limit = priv->broadcast->mcmember.hop_limit;
509509
510510 /*
511− * Historically Linux IPoIB has never properly supported SEND
512− * ONLY join. It emulated it by not providing all the required
513− * attributes, which is enough to prevent group creation and
514− * detect if there are full members or not. A major problem
515− * with supporting SEND ONLY is detecting when the group is
516− * auto-destroyed as IPoIB will cache the MLID..
511+ * Send-only IB Multicast joins do not work at the core
512+ * IB layer yet, so we can't use them here. However,
513+ * we are emulating an Ethernet multicast send, which
514+ * does not require a multicast subscription and will
515+ * still send properly. The most appropriate thing to
516+ * do is to create the group if it doesn't exist as that
517+ * most closely emulates the behavior, from a user space
518+ * application perspecitive, of Ethernet multicast
519+ * operation. For now, we do a full join, maybe later
520+ * when the core IB layers support send only joins we
521+ * will use them.
517522 */
518−#if 1
519− if (test_bit(IPOIB_MCAST_FLAG_SENDONLY, &mcast->flags))
520− comp_mask &= ~IB_SA_MCMEMBER_REC_TRAFFIC_CLASS;
521−#else
523+#if 0
522524 if (test_bit(IPOIB_MCAST_FLAG_SENDONLY, &mcast->flags))
523525 rec.join_state = 4;
524526 #endif
@@ -675,7 +677,7 @@ int ipoib_mcast_stop_thread(struct net_device *dev) · 150 unmodified lines
675677 return 0;
676678 }
677679
678−static int ipoib_mcast_leave(struct net_device *dev, struct ipoib_mcast *mcast)
680+int ipoib_mcast_leave(struct net_device *dev, struct ipoib_mcast *mcast)
679681 {
680682 struct ipoib_dev_priv *priv = netdev_priv(dev);
681683 int ret = 0;
drivers/infiniband/ulp/iser/iscsi_iser.c+5−0
@@ -97,6 +97,11 @@ unsigned int iser_max_sectors = ISER_DEF_MAX_SECTORS; · 96 unmodified lines
9797 module_param_named(max_sectors, iser_max_sectors, uint, S_IRUGO | S_IWUSR);
9898 MODULE_PARM_DESC(max_sectors, "Max number of sectors in a single scsi command (default:1024");
9999
100+bool iser_always_reg = true;
101+module_param_named(always_register, iser_always_reg, bool, S_IRUGO);
102+MODULE_PARM_DESC(always_register,
103+ "Always register memory, even for continuous memory regions (default:true)");
104+
100105 bool iser_pi_enable = false;
101106 module_param_named(pi_enable, iser_pi_enable, bool, S_IRUGO);
102107 MODULE_PARM_DESC(pi_enable, "Enable T10-PI offload support (default:disabled)");
drivers/infiniband/ulp/iser/iscsi_iser.h+1−0
@@ -611,6 +611,7 @@ extern int iser_debug_level; · 610 unmodified lines
611611 extern bool iser_pi_enable;
612612 extern int iser_pi_guard;
613613 extern unsigned int iser_max_sectors;
614+extern bool iser_always_reg;
614615
615616 int iser_assign_reg_ops(struct iser_device *device);
616617
drivers/infiniband/ulp/iser/iser_memory.c+12−6
@@ -803,11 +803,12 @@ static int · 802 unmodified lines
803803 iser_reg_prot_sg(struct iscsi_iser_task *task,
804804 struct iser_data_buf *mem,
805805 struct iser_fr_desc *desc,
806+ bool use_dma_key,
806807 struct iser_mem_reg *reg)
807808 {
808809 struct iser_device *device = task->iser_conn->ib_conn.device;
809810
810− if (mem->dma_nents == 1)
811+ if (use_dma_key)
811812 return iser_reg_dma(device, mem, reg);
812813
813814 return device->reg_ops->reg_mem(task, mem, &desc->pi_ctx->rsc, reg);
@@ -817,11 +818,12 @@ static int · 3 unmodified lines
817818 iser_reg_data_sg(struct iscsi_iser_task *task,
818819 struct iser_data_buf *mem,
819820 struct iser_fr_desc *desc,
821+ bool use_dma_key,
820822 struct iser_mem_reg *reg)
821823 {
822824 struct iser_device *device = task->iser_conn->ib_conn.device;
823825
824− if (mem->dma_nents == 1)
826+ if (use_dma_key)
825827 return iser_reg_dma(device, mem, reg);
826828
827829 return device->reg_ops->reg_mem(task, mem, &desc->rsc, reg);
@@ -836,14 +838,17 @@ int iser_reg_rdma_mem(struct iscsi_iser_task *task, · 8 unmodified lines
836838 struct iser_mem_reg *reg = &task->rdma_reg[dir];
837839 struct iser_mem_reg *data_reg;
838840 struct iser_fr_desc *desc = NULL;
841+ bool use_dma_key;
839842 int err;
840843
841844 err = iser_handle_unaligned_buf(task, mem, dir);
842845 if (unlikely(err))
843846 return err;
844847
845− if (mem->dma_nents != 1 ||
846− scsi_get_prot_op(task->sc) != SCSI_PROT_NORMAL) {
848+ use_dma_key = (mem->dma_nents == 1 && !iser_always_reg &&
849+ scsi_get_prot_op(task->sc) == SCSI_PROT_NORMAL);
850+
851+ if (!use_dma_key) {
847852 desc = device->reg_ops->reg_desc_get(ib_conn);
848853 reg->mem_h = desc;
849854 }
@@ -853,7 +858,7 @@ int iser_reg_rdma_mem(struct iscsi_iser_task *task, · 3 unmodified lines
853858 else
854859 data_reg = &task->desc.data_reg;
855860
856− err = iser_reg_data_sg(task, mem, desc, data_reg);
861+ err = iser_reg_data_sg(task, mem, desc, use_dma_key, data_reg);
857862 if (unlikely(err))
858863 goto err_reg;
859864
@@ -866,7 +871,8 @@ int iser_reg_rdma_mem(struct iscsi_iser_task *task, · 6 unmodified lines
866871 if (unlikely(err))
867872 goto err_reg;
868873
869− err = iser_reg_prot_sg(task, mem, desc, prot_reg);
874+ err = iser_reg_prot_sg(task, mem, desc,
875+ use_dma_key, prot_reg);
870876 if (unlikely(err))
871877 goto err_reg;
872878 }
drivers/infiniband/ulp/iser/iser_verbs.c+13−8
@@ -133,11 +133,15 @@ static int iser_create_device_ib_res(struct iser_device *device) · 132 unmodified lines
133133 (unsigned long)comp);
134134 }
135135
136− device->mr = ib_get_dma_mr(device->pd, IB_ACCESS_LOCAL_WRITE |
137− IB_ACCESS_REMOTE_WRITE |
138− IB_ACCESS_REMOTE_READ);
139− if (IS_ERR(device->mr))
140− goto dma_mr_err;
136+ if (!iser_always_reg) {
137+ int access = IB_ACCESS_LOCAL_WRITE |
138+ IB_ACCESS_REMOTE_WRITE |
139+ IB_ACCESS_REMOTE_READ;
140+
141+ device->mr = ib_get_dma_mr(device->pd, access);
142+ if (IS_ERR(device->mr))
143+ goto dma_mr_err;
144+ }
141145
142146 INIT_IB_EVENT_HANDLER(&device->event_handler, device->ib_device,
143147 iser_event_handler);
@@ -147,7 +151,8 @@ static int iser_create_device_ib_res(struct iser_device *device) · 3 unmodified lines
147151 return 0;
148152
149153 handler_err:
150− ib_dereg_mr(device->mr);
154+ if (device->mr)
155+ ib_dereg_mr(device->mr);
151156 dma_mr_err:
152157 for (i = 0; i < device->comps_used; i++)
153158 tasklet_kill(&device->comps[i].tasklet);
@@ -173,7 +178,6 @@ comps_err: · 19 unmodified lines
173178 static void iser_free_device_ib_res(struct iser_device *device)
174179 {
175180 int i;
176− BUG_ON(device->mr == NULL);
177181
178182 for (i = 0; i < device->comps_used; i++) {
179183 struct iser_comp *comp = &device->comps[i];
@@ -184,7 +188,8 @@ static void iser_free_device_ib_res(struct iser_device *device) · 4 unmodified lines
184188 }
185189
186190 (void)ib_unregister_event_handler(&device->event_handler);
187− (void)ib_dereg_mr(device->mr);
191+ if (device->mr)
192+ (void)ib_dereg_mr(device->mr);
188193 ib_dealloc_pd(device->pd);
189194
190195 kfree(device->comps);
drivers/infiniband/ulp/isert/ib_isert.c+186−107
@@ -238,8 +238,6 @@ isert_alloc_rx_descriptors(struct isert_conn *isert_conn) · 237 unmodified lines
238238 rx_sg->lkey = device->pd->local_dma_lkey;
239239 }
240240
241− isert_conn->rx_desc_head = 0;
242−
243241 return 0;
244242
245243 dma_map_fail:
@@ -634,7 +632,7 @@ static void · 388 unmodified lines
634632 isert_init_conn(struct isert_conn *isert_conn)
635633 {
636634 isert_conn->state = ISER_CONN_INIT;
637− INIT_LIST_HEAD(&isert_conn->accept_node);
635+ INIT_LIST_HEAD(&isert_conn->node);
638636 init_completion(&isert_conn->login_comp);
639637 init_completion(&isert_conn->login_req_comp);
640638 init_completion(&isert_conn->wait);
@@ -762,28 +760,15 @@ isert_connect_request(struct rdma_cm_id *cma_id, struct rdma_cm_event *event) · 121 unmodified lines
762760 ret = isert_rdma_post_recvl(isert_conn);
763761 if (ret)
764762 goto out_conn_dev;
765− /*
766− * Obtain the second reference now before isert_rdma_accept() to
767− * ensure that any initiator generated REJECT CM event that occurs
768− * asynchronously won't drop the last reference until the error path
769− * in iscsi_target_login_sess_out() does it's ->iscsit_free_conn() ->
770− * isert_free_conn() -> isert_put_conn() -> kref_put().
771− */
772− if (!kref_get_unless_zero(&isert_conn->kref)) {
773− isert_warn("conn %p connect_release is running\n", isert_conn);
774− goto out_conn_dev;
775− }
776763
777764 ret = isert_rdma_accept(isert_conn);
778765 if (ret)
779766 goto out_conn_dev;
780767
781− mutex_lock(&isert_np->np_accept_mutex);
782− list_add_tail(&isert_conn->accept_node, &isert_np->np_accept_list);
783− mutex_unlock(&isert_np->np_accept_mutex);
768+ mutex_lock(&isert_np->mutex);
769+ list_add_tail(&isert_conn->node, &isert_np->accepted);
770+ mutex_unlock(&isert_np->mutex);
784771
785− isert_info("np %p: Allow accept_np to continue\n", np);
786− up(&isert_np->np_sem);
787772 return 0;
788773
789774 out_conn_dev:
@@ -831,13 +816,21 @@ static void · 41 unmodified lines
831816 isert_connected_handler(struct rdma_cm_id *cma_id)
832817 {
833818 struct isert_conn *isert_conn = cma_id->qp->qp_context;
819+ struct isert_np *isert_np = cma_id->context;
834820
835821 isert_info("conn %p\n", isert_conn);
836822
837823 mutex_lock(&isert_conn->mutex);
838− if (isert_conn->state != ISER_CONN_FULL_FEATURE)
839− isert_conn->state = ISER_CONN_UP;
824+ isert_conn->state = ISER_CONN_UP;
825+ kref_get(&isert_conn->kref);
840826 mutex_unlock(&isert_conn->mutex);
827+
828+ mutex_lock(&isert_np->mutex);
829+ list_move_tail(&isert_conn->node, &isert_np->pending);
830+ mutex_unlock(&isert_np->mutex);
831+
832+ isert_info("np %p: Allow accept_np to continue\n", isert_np);
833+ up(&isert_np->sem);
841834 }
842835
843836 static void
@@ -903,14 +896,14 @@ isert_np_cma_handler(struct isert_np *isert_np, · 59 unmodified lines
903896
904897 switch (event) {
905898 case RDMA_CM_EVENT_DEVICE_REMOVAL:
906− isert_np->np_cm_id = NULL;
899+ isert_np->cm_id = NULL;
907900 break;
908901 case RDMA_CM_EVENT_ADDR_CHANGE:
909− isert_np->np_cm_id = isert_setup_id(isert_np);
910− if (IS_ERR(isert_np->np_cm_id)) {
902+ isert_np->cm_id = isert_setup_id(isert_np);
903+ if (IS_ERR(isert_np->cm_id)) {
911904 isert_err("isert np %p setup id failed: %ld\n",
912− isert_np, PTR_ERR(isert_np->np_cm_id));
913− isert_np->np_cm_id = NULL;
905+ isert_np, PTR_ERR(isert_np->cm_id));
906+ isert_np->cm_id = NULL;
914907 }
915908 break;
916909 default:
@@ -929,7 +922,7 @@ isert_disconnected_handler(struct rdma_cm_id *cma_id, · 12 unmodified lines
929922 struct isert_conn *isert_conn;
930923 bool terminating = false;
931924
932− if (isert_np->np_cm_id == cma_id)
925+ if (isert_np->cm_id == cma_id)
933926 return isert_np_cma_handler(cma_id->context, event);
934927
935928 isert_conn = cma_id->qp->qp_context;
@@ -945,13 +938,13 @@ isert_disconnected_handler(struct rdma_cm_id *cma_id, · 9 unmodified lines
945938 if (terminating)
946939 goto out;
947940
948− mutex_lock(&isert_np->np_accept_mutex);
949− if (!list_empty(&isert_conn->accept_node)) {
950− list_del_init(&isert_conn->accept_node);
941+ mutex_lock(&isert_np->mutex);
942+ if (!list_empty(&isert_conn->node)) {
943+ list_del_init(&isert_conn->node);
951944 isert_put_conn(isert_conn);
952945 queue_work(isert_release_wq, &isert_conn->release_work);
953946 }
954− mutex_unlock(&isert_np->np_accept_mutex);
947+ mutex_unlock(&isert_np->mutex);
955948
956949 out:
957950 return 0;
@@ -962,6 +955,7 @@ isert_connect_error(struct rdma_cm_id *cma_id) · 4 unmodified lines
962955 {
963956 struct isert_conn *isert_conn = cma_id->qp->qp_context;
964957
958+ list_del_init(&isert_conn->node);
965959 isert_conn->cm_id = NULL;
966960 isert_put_conn(isert_conn);
967961
@@ -1006,35 +1000,51 @@ isert_cma_handler(struct rdma_cm_id *cma_id, struct rdma_cm_event *event) · 38 unmodified lines
10061000 }
10071001
10081002 static int
1009−isert_post_recv(struct isert_conn *isert_conn, u32 count)
1003+isert_post_recvm(struct isert_conn *isert_conn, u32 count)
10101004 {
10111005 struct ib_recv_wr *rx_wr, *rx_wr_failed;
10121006 int i, ret;
1013− unsigned int rx_head = isert_conn->rx_desc_head;
10141007 struct iser_rx_desc *rx_desc;
10151008
10161009 for (rx_wr = isert_conn->rx_wr, i = 0; i < count; i++, rx_wr++) {
1017− rx_desc = &isert_conn->rx_descs[rx_head];
1018− rx_wr->wr_id = (uintptr_t)rx_desc;
1019− rx_wr->sg_list = &rx_desc->rx_sg;
1020− rx_wr->num_sge = 1;
1021− rx_wr->next = rx_wr + 1;
1022− rx_head = (rx_head + 1) & (ISERT_QP_MAX_RECV_DTOS - 1);
1010+ rx_desc = &isert_conn->rx_descs[i];
1011+ rx_wr->wr_id = (uintptr_t)rx_desc;
1012+ rx_wr->sg_list = &rx_desc->rx_sg;
1013+ rx_wr->num_sge = 1;
1014+ rx_wr->next = rx_wr + 1;
10231015 }
1024−
10251016 rx_wr--;
10261017 rx_wr->next = NULL; /* mark end of work requests list */
10271018
10281019 isert_conn->post_recv_buf_count += count;
10291020 ret = ib_post_recv(isert_conn->qp, isert_conn->rx_wr,
1030− &rx_wr_failed);
1021+ &rx_wr_failed);
10311022 if (ret) {
10321023 isert_err("ib_post_recv() failed with ret: %d\n", ret);
10331024 isert_conn->post_recv_buf_count -= count;
1034− } else {
1035− isert_dbg("Posted %d RX buffers\n", count);
1036− isert_conn->rx_desc_head = rx_head;
10371025 }
1026+
1027+ return ret;
1028+}
1029+
1030+static int
1031+isert_post_recv(struct isert_conn *isert_conn, struct iser_rx_desc *rx_desc)
1032+{
1033+ struct ib_recv_wr *rx_wr_failed, rx_wr;
1034+ int ret;
1035+
1036+ rx_wr.wr_id = (uintptr_t)rx_desc;
1037+ rx_wr.sg_list = &rx_desc->rx_sg;
1038+ rx_wr.num_sge = 1;
1039+ rx_wr.next = NULL;
1040+
1041+ isert_conn->post_recv_buf_count++;
1042+ ret = ib_post_recv(isert_conn->qp, &rx_wr, &rx_wr_failed);
1043+ if (ret) {
1044+ isert_err("ib_post_recv() failed with ret: %d\n", ret);
1045+ isert_conn->post_recv_buf_count--;
1046+ }
1047+
10381048 return ret;
10391049 }
10401050
@@ -1205,7 +1215,8 @@ isert_put_login_tx(struct iscsi_conn *conn, struct iscsi_login *login, · 164 unmodified lines
12051215 if (ret)
12061216 return ret;
12071217
1208− ret = isert_post_recv(isert_conn, ISERT_MIN_POSTED_RX);
1218+ ret = isert_post_recvm(isert_conn,
1219+ ISERT_QP_MAX_RECV_DTOS);
12091220 if (ret)
12101221 return ret;
12111222
@@ -1278,7 +1289,7 @@ isert_rx_login_req(struct isert_conn *isert_conn) · 66 unmodified lines
12781289 }
12791290
12801291 static struct iscsi_cmd
1281−*isert_allocate_cmd(struct iscsi_conn *conn)
1292+*isert_allocate_cmd(struct iscsi_conn *conn, struct iser_rx_desc *rx_desc)
12821293 {
12831294 struct isert_conn *isert_conn = conn->context;
12841295 struct isert_cmd *isert_cmd;
@@ -1292,6 +1303,7 @@ static struct iscsi_cmd · 7 unmodified lines
12921303 isert_cmd = iscsit_priv_cmd(cmd);
12931304 isert_cmd->conn = isert_conn;
12941305 isert_cmd->iscsi_cmd = cmd;
1306+ isert_cmd->rx_desc = rx_desc;
12951307
12961308 return cmd;
12971309 }
@@ -1303,9 +1315,9 @@ isert_handle_scsi_cmd(struct isert_conn *isert_conn, · 5 unmodified lines
13031315 {
13041316 struct iscsi_conn *conn = isert_conn->conn;
13051317 struct iscsi_scsi_req *hdr = (struct iscsi_scsi_req *)buf;
1306− struct scatterlist *sg;
13071318 int imm_data, imm_data_len, unsol_data, sg_nents, rc;
13081319 bool dump_payload = false;
1320+ unsigned int data_len;
13091321
13101322 rc = iscsit_setup_scsi_cmd(conn, cmd, buf);
13111323 if (rc < 0)
@@ -1314,7 +1326,10 @@ isert_handle_scsi_cmd(struct isert_conn *isert_conn, · 2 unmodified lines
13141326 imm_data = cmd->immediate_data;
13151327 imm_data_len = cmd->first_burst_len;
13161328 unsol_data = cmd->unsolicited_data;
1329+ data_len = cmd->se_cmd.data_length;
13171330
1331+ if (imm_data && imm_data_len == data_len)
1332+ cmd->se_cmd.se_cmd_flags |= SCF_PASSTHROUGH_SG_TO_MEM_NOALLOC;
13181333 rc = iscsit_process_scsi_cmd(conn, cmd, hdr);
13191334 if (rc < 0) {
13201335 return 0;
@@ -1326,13 +1341,20 @@ isert_handle_scsi_cmd(struct isert_conn *isert_conn, · 5 unmodified lines
13261341 if (!imm_data)
13271342 return 0;
13281343
1329− sg = &cmd->se_cmd.t_data_sg[0];
1330− sg_nents = max(1UL, DIV_ROUND_UP(imm_data_len, PAGE_SIZE));
1331−
1332− isert_dbg("Copying Immediate SG: %p sg_nents: %u from %p imm_data_len: %d\n",
1333− sg, sg_nents, &rx_desc->data[0], imm_data_len);
1334−
1335− sg_copy_from_buffer(sg, sg_nents, &rx_desc->data[0], imm_data_len);
1344+ if (imm_data_len != data_len) {
1345+ sg_nents = max(1UL, DIV_ROUND_UP(imm_data_len, PAGE_SIZE));
1346+ sg_copy_from_buffer(cmd->se_cmd.t_data_sg, sg_nents,
1347+ &rx_desc->data[0], imm_data_len);
1348+ isert_dbg("Copy Immediate sg_nents: %u imm_data_len: %d\n",
1349+ sg_nents, imm_data_len);
1350+ } else {
1351+ sg_init_table(&isert_cmd->sg, 1);
1352+ cmd->se_cmd.t_data_sg = &isert_cmd->sg;
1353+ cmd->se_cmd.t_data_nents = 1;
1354+ sg_set_buf(&isert_cmd->sg, &rx_desc->data[0], imm_data_len);
1355+ isert_dbg("Transfer Immediate imm_data_len: %d\n",
1356+ imm_data_len);
1357+ }
13361358
13371359 cmd->write_data_done += imm_data_len;
13381360
@@ -1407,6 +1429,15 @@ isert_handle_iscsi_dataout(struct isert_conn *isert_conn, · 68 unmodified lines
14071429 if (rc < 0)
14081430 return rc;
14091431
1432+ /*
1433+ * multiple data-outs on the same command can arrive -
1434+ * so post the buffer before hand
1435+ */
1436+ rc = isert_post_recv(isert_conn, rx_desc);
1437+ if (rc) {
1438+ isert_err("ib_post_recv failed with %d\n", rc);
1439+ return rc;
1440+ }
14101441 return 0;
14111442 }
14121443
@@ -1479,7 +1510,7 @@ isert_rx_opcode(struct isert_conn *isert_conn, struct iser_rx_desc *rx_desc, · 66 unmodified lines
14791510
14801511 switch (opcode) {
14811512 case ISCSI_OP_SCSI_CMD:
1482− cmd = isert_allocate_cmd(conn);
1513+ cmd = isert_allocate_cmd(conn, rx_desc);
14831514 if (!cmd)
14841515 break;
14851516
@@ -1493,7 +1524,7 @@ isert_rx_opcode(struct isert_conn *isert_conn, struct iser_rx_desc *rx_desc, · 7 unmodified lines
14931524 rx_desc, (unsigned char *)hdr);
14941525 break;
14951526 case ISCSI_OP_NOOP_OUT:
1496− cmd = isert_allocate_cmd(conn);
1527+ cmd = isert_allocate_cmd(conn, rx_desc);
14971528 if (!cmd)
14981529 break;
14991530
@@ -1506,7 +1537,7 @@ isert_rx_opcode(struct isert_conn *isert_conn, struct iser_rx_desc *rx_desc, · 6 unmodified lines
15061537 (unsigned char *)hdr);
15071538 break;
15081539 case ISCSI_OP_SCSI_TMFUNC:
1509− cmd = isert_allocate_cmd(conn);
1540+ cmd = isert_allocate_cmd(conn, rx_desc);
15101541 if (!cmd)
15111542 break;
15121543
@@ -1514,22 +1545,20 @@ isert_rx_opcode(struct isert_conn *isert_conn, struct iser_rx_desc *rx_desc, · 1 unmodified line
15141545 (unsigned char *)hdr);
15151546 break;
15161547 case ISCSI_OP_LOGOUT:
1517− cmd = isert_allocate_cmd(conn);
1548+ cmd = isert_allocate_cmd(conn, rx_desc);
15181549 if (!cmd)
15191550 break;
15201551
15211552 ret = iscsit_handle_logout_cmd(conn, cmd, (unsigned char *)hdr);
15221553 break;
15231554 case ISCSI_OP_TEXT:
1524− if (be32_to_cpu(hdr->ttt) != 0xFFFFFFFF) {
1555+ if (be32_to_cpu(hdr->ttt) != 0xFFFFFFFF)
15251556 cmd = iscsit_find_cmd_from_itt(conn, hdr->itt);
1526− if (!cmd)
1527− break;
1528− } else {
1529− cmd = isert_allocate_cmd(conn);
1530− if (!cmd)
1531− break;
1532− }
1557+ else
1558+ cmd = isert_allocate_cmd(conn, rx_desc);
1559+
1560+ if (!cmd)
1561+ break;
15331562
15341563 isert_cmd = iscsit_priv_cmd(cmd);
15351564 ret = isert_handle_text_cmd(isert_conn, isert_cmd, cmd,
@@ -1589,7 +1618,7 @@ isert_rcv_completion(struct iser_rx_desc *desc, · 53 unmodified lines
15891618 struct ib_device *ib_dev = isert_conn->cm_id->device;
15901619 struct iscsi_hdr *hdr;
15911620 u64 rx_dma;
1592− int rx_buflen, outstanding;
1621+ int rx_buflen;
15931622
15941623 if ((char *)desc == isert_conn->login_req_buf) {
15951624 rx_dma = isert_conn->login_req_dma;
@@ -1629,22 +1658,6 @@ isert_rcv_completion(struct iser_rx_desc *desc, · 33 unmodified lines
16291658 DMA_FROM_DEVICE);
16301659
16311660 isert_conn->post_recv_buf_count--;
1632− isert_dbg("Decremented post_recv_buf_count: %d\n",
1633− isert_conn->post_recv_buf_count);
1634−
1635− if ((char *)desc == isert_conn->login_req_buf)
1636− return;
1637−
1638− outstanding = isert_conn->post_recv_buf_count;
1639− if (outstanding + ISERT_MIN_POSTED_RX <= ISERT_QP_MAX_RECV_DTOS) {
1640− int err, count = min(ISERT_QP_MAX_RECV_DTOS - outstanding,
1641− ISERT_MIN_POSTED_RX);
1642− err = isert_post_recv(isert_conn, count);
1643− if (err) {
1644− isert_err("isert_post_recv() count: %d failed, %d\n",
1645− count, err);
1646− }
1647− }
16481661 }
16491662
16501663 static int
@@ -2156,6 +2169,12 @@ isert_post_response(struct isert_conn *isert_conn, struct isert_cmd *isert_cmd) · 505 unmodified lines
21562169 struct ib_send_wr *wr_failed;
21572170 int ret;
21582171
2172+ ret = isert_post_recv(isert_conn, isert_cmd->rx_desc);
2173+ if (ret) {
2174+ isert_err("ib_post_recv failed with %d\n", ret);
2175+ return ret;
2176+ }
2177+
21592178 ret = ib_post_send(isert_conn->qp, &isert_cmd->tx_desc.send_wr,
21602179 &wr_failed);
21612180 if (ret) {
@@ -2950,6 +2969,12 @@ isert_put_datain(struct iscsi_conn *conn, struct iscsi_cmd *cmd) · 788 unmodified lines
29502969 &isert_cmd->tx_desc.send_wr);
29512970 isert_cmd->rdma_wr.s_send_wr.next = &isert_cmd->tx_desc.send_wr;
29522971 wr->send_wr_num += 1;
2972+
2973+ rc = isert_post_recv(isert_conn, isert_cmd->rx_desc);
2974+ if (rc) {
2975+ isert_err("ib_post_recv failed with %d\n", rc);
2976+ return rc;
2977+ }
29532978 }
29542979
29552980 rc = ib_post_send(isert_conn->qp, wr->send_wr, &wr_failed);
@@ -2999,9 +3024,16 @@ isert_get_dataout(struct iscsi_conn *conn, struct iscsi_cmd *cmd, bool recovery) · 43 unmodified lines
29993024 static int
30003025 isert_immediate_queue(struct iscsi_conn *conn, struct iscsi_cmd *cmd, int state)
30013026 {
3002− int ret;
3027+ struct isert_cmd *isert_cmd = iscsit_priv_cmd(cmd);
3028+ int ret = 0;
30033029
30043030 switch (state) {
3031+ case ISTATE_REMOVE:
3032+ spin_lock_bh(&conn->cmd_lock);
3033+ list_del_init(&cmd->i_conn_node);
3034+ spin_unlock_bh(&conn->cmd_lock);
3035+ isert_put_cmd(isert_cmd, true);
3036+ break;
30053037 case ISTATE_SEND_NOPIN_WANT_RESPONSE:
30063038 ret = isert_put_nopin(cmd, conn, false);
30073039 break;
@@ -3106,10 +3138,10 @@ isert_setup_np(struct iscsi_np *np, · 98 unmodified lines
31063138 isert_err("Unable to allocate struct isert_np\n");
31073139 return -ENOMEM;
31083140 }
3109− sema_init(&isert_np->np_sem, 0);
3110− mutex_init(&isert_np->np_accept_mutex);
3111− INIT_LIST_HEAD(&isert_np->np_accept_list);
3112− init_completion(&isert_np->np_login_comp);
3141+ sema_init(&isert_np->sem, 0);
3142+ mutex_init(&isert_np->mutex);
3143+ INIT_LIST_HEAD(&isert_np->accepted);
3144+ INIT_LIST_HEAD(&isert_np->pending);
31133145 isert_np->np = np;
31143146
31153147 /*
@@ -3125,7 +3157,7 @@ isert_setup_np(struct iscsi_np *np, · 9 unmodified lines
31253157 goto out;
31263158 }
31273159
3128− isert_np->np_cm_id = isert_lid;
3160+ isert_np->cm_id = isert_lid;
31293161 np->np_context = isert_np;
31303162
31313163 return 0;
@@ -3214,7 +3246,7 @@ isert_accept_np(struct iscsi_np *np, struct iscsi_conn *conn) · 82 unmodified lines
32143246 int ret;
32153247
32163248 accept_wait:
3217− ret = down_interruptible(&isert_np->np_sem);
3249+ ret = down_interruptible(&isert_np->sem);
32183250 if (ret)
32193251 return -ENODEV;
32203252
@@ -3231,15 +3263,15 @@ accept_wait: · 10 unmodified lines
32313263 }
32323264 spin_unlock_bh(&np->np_thread_lock);
32333265
3234− mutex_lock(&isert_np->np_accept_mutex);
3235− if (list_empty(&isert_np->np_accept_list)) {
3236− mutex_unlock(&isert_np->np_accept_mutex);
3266+ mutex_lock(&isert_np->mutex);
3267+ if (list_empty(&isert_np->pending)) {
3268+ mutex_unlock(&isert_np->mutex);
32373269 goto accept_wait;
32383270 }
3239− isert_conn = list_first_entry(&isert_np->np_accept_list,
3240− struct isert_conn, accept_node);
3241− list_del_init(&isert_conn->accept_node);
3242− mutex_unlock(&isert_np->np_accept_mutex);
3271+ isert_conn = list_first_entry(&isert_np->pending,
3272+ struct isert_conn, node);
3273+ list_del_init(&isert_conn->node);
3274+ mutex_unlock(&isert_np->mutex);
32433275
32443276 conn->context = isert_conn;
32453277 isert_conn->conn = conn;
@@ -3257,28 +3289,39 @@ isert_free_np(struct iscsi_np *np) · 11 unmodified lines
32573289 struct isert_np *isert_np = np->np_context;
32583290 struct isert_conn *isert_conn, *n;
32593291
3260− if (isert_np->np_cm_id)
3261− rdma_destroy_id(isert_np->np_cm_id);
3292+ if (isert_np->cm_id)
3293+ rdma_destroy_id(isert_np->cm_id);
32623294
32633295 /*
32643296 * FIXME: At this point we don't have a good way to insure
32653297 * that at this point we don't have hanging connections that
32663298 * completed RDMA establishment but didn't start iscsi login
32673299 * process. So work-around this by cleaning up what ever piled
3268− * up in np_accept_list.
3300+ * up in accepted and pending lists.
32693301 */
3270− mutex_lock(&isert_np->np_accept_mutex);
3271− if (!list_empty(&isert_np->np_accept_list)) {
3272− isert_info("Still have isert connections, cleaning up...\n");
3302+ mutex_lock(&isert_np->mutex);
3303+ if (!list_empty(&isert_np->pending)) {
3304+ isert_info("Still have isert pending connections\n");
3305+ list_for_each_entry_safe(isert_conn, n,
3306+ &isert_np->pending,
3307+ node) {
3308+ isert_info("cleaning isert_conn %p state (%d)\n",
3309+ isert_conn, isert_conn->state);
3310+ isert_connect_release(isert_conn);
3311+ }
3312+ }
3313+
3314+ if (!list_empty(&isert_np->accepted)) {
3315+ isert_info("Still have isert accepted connections\n");
32733316 list_for_each_entry_safe(isert_conn, n,
3274− &isert_np->np_accept_list,
3275− accept_node) {
3317+ &isert_np->accepted,
3318+ node) {
32763319 isert_info("cleaning isert_conn %p state (%d)\n",
32773320 isert_conn, isert_conn->state);
32783321 isert_connect_release(isert_conn);
32793322 }
32803323 }
3281− mutex_unlock(&isert_np->np_accept_mutex);
3324+ mutex_unlock(&isert_np->mutex);
32823325
32833326 np->np_context = NULL;
32843327 kfree(isert_np);
@@ -3345,6 +3388,41 @@ isert_wait4flush(struct isert_conn *isert_conn) · 60 unmodified lines
33453388 wait_for_completion(&isert_conn->wait_comp_err);
33463389 }
33473390
3391+/**
3392+ * isert_put_unsol_pending_cmds() - Drop commands waiting for
3393+ * unsolicitate dataout
3394+ * @conn: iscsi connection
3395+ *
3396+ * We might still have commands that are waiting for unsolicited
3397+ * dataouts messages. We must put the extra reference on those
3398+ * before blocking on the target_wait_for_session_cmds
3399+ */
3400+static void
3401+isert_put_unsol_pending_cmds(struct iscsi_conn *conn)
3402+{
3403+ struct iscsi_cmd *cmd, *tmp;
3404+ static LIST_HEAD(drop_cmd_list);
3405+
3406+ spin_lock_bh(&conn->cmd_lock);
3407+ list_for_each_entry_safe(cmd, tmp, &conn->conn_cmd_list, i_conn_node) {
3408+ if ((cmd->cmd_flags & ICF_NON_IMMEDIATE_UNSOLICITED_DATA) &&
3409+ (cmd->write_data_done < conn->sess->sess_ops->FirstBurstLength) &&
3410+ (cmd->write_data_done < cmd->se_cmd.data_length))
3411+ list_move_tail(&cmd->i_conn_node, &drop_cmd_list);
3412+ }
3413+ spin_unlock_bh(&conn->cmd_lock);
3414+
3415+ list_for_each_entry_safe(cmd, tmp, &drop_cmd_list, i_conn_node) {
3416+ list_del_init(&cmd->i_conn_node);
3417+ if (cmd->i_state != ISTATE_REMOVE) {
3418+ struct isert_cmd *isert_cmd = iscsit_priv_cmd(cmd);
3419+
3420+ isert_info("conn %p dropping cmd %p\n", conn, cmd);
3421+ isert_put_cmd(isert_cmd, true);
3422+ }
3423+ }
3424+}
3425+
33483426 static void isert_wait_conn(struct iscsi_conn *conn)
33493427 {
33503428 struct isert_conn *isert_conn = conn->context;
@@ -3363,8 +3441,9 @@ static void isert_wait_conn(struct iscsi_conn *conn) · 12 unmodified lines
33633441 isert_conn_terminate(isert_conn);
33643442 mutex_unlock(&isert_conn->mutex);
33653443
3366− isert_wait4cmds(conn);
33673444 isert_wait4flush(isert_conn);
3445+ isert_put_unsol_pending_cmds(conn);
3446+ isert_wait4cmds(conn);
33683447 isert_wait4logout(isert_conn);
33693448
33703449 queue_work(isert_release_wq, &isert_conn->release_work);
drivers/infiniband/ulp/isert/ib_isert.h+9−12
@@ -113,7 +113,6 @@ enum { · 112 unmodified lines
113113 };
114114
115115 struct isert_rdma_wr {
116− struct list_head wr_list;
117116 struct isert_cmd *isert_cmd;
118117 enum iser_ib_op_code iser_ib_op;
119118 struct ib_sge *ib_sge;
@@ -134,14 +133,13 @@ struct isert_cmd { · 14 unmodified lines
134133 uint64_t write_va;
135134 u64 pdu_buf_dma;
136135 u32 pdu_buf_len;
137− u32 read_va_off;
138− u32 write_va_off;
139− u32 rdma_wr_num;
140136 struct isert_conn *conn;
141137 struct iscsi_cmd *iscsi_cmd;
142138 struct iser_tx_desc tx_desc;
139+ struct iser_rx_desc *rx_desc;
143140 struct isert_rdma_wr rdma_wr;
144141 struct work_struct comp_work;
142+ struct scatterlist sg;
145143 };
146144
147145 struct isert_device;
@@ -159,11 +157,10 @@ struct isert_conn { · 11 unmodified lines
159157 u64 login_req_dma;
160158 int login_req_len;
161159 u64 login_rsp_dma;
162− unsigned int rx_desc_head;
163160 struct iser_rx_desc *rx_descs;
164− struct ib_recv_wr rx_wr[ISERT_MIN_POSTED_RX];
161+ struct ib_recv_wr rx_wr[ISERT_QP_MAX_RECV_DTOS];
165162 struct iscsi_conn *conn;
166− struct list_head accept_node;
163+ struct list_head node;
167164 struct completion login_comp;
168165 struct completion login_req_comp;
169166 struct iser_tx_desc login_tx_desc;
@@ -222,9 +219,9 @@ struct isert_device { · 52 unmodified lines
222219
223220 struct isert_np {
224221 struct iscsi_np *np;
225− struct semaphore np_sem;
226− struct rdma_cm_id *np_cm_id;
227− struct mutex np_accept_mutex;
228− struct list_head np_accept_list;
229− struct completion np_login_comp;
222+ struct semaphore sem;
223+ struct rdma_cm_id *cm_id;
224+ struct mutex mutex;
225+ struct list_head accepted;
226+ struct list_head pending;
230227 };
drivers/input/joystick/Kconfig+1−0
@@ -196,6 +196,7 @@ config JOYSTICK_TWIDJOY · 195 unmodified lines
196196 config JOYSTICK_ZHENHUA
197197 tristate "5-byte Zhenhua RC transmitter"
198198 select SERIO
199+ select BITREVERSE
199200 help
200201 Say Y here if you have a Zhen Hua PPM-4CH transmitter which is
201202 supplied with a ready to fly micro electric indoor helicopters
drivers/input/joystick/walkera0701.c+2−2
@@ -150,7 +150,7 @@ static void walkera0701_irq_handler(void *handler_data) · 149 unmodified lines
150150 if (w->counter == 24) { /* full frame */
151151 walkera0701_parse_frame(w);
152152 w->counter = NO_SYNC;
153− if (abs(pulse_time - SYNC_PULSE) < RESERVE) /* new frame sync */
153+ if (abs64(pulse_time - SYNC_PULSE) < RESERVE) /* new frame sync */
154154 w->counter = 0;
155155 } else {
156156 if ((pulse_time > (ANALOG_MIN_PULSE - RESERVE)
@@ -161,7 +161,7 @@ static void walkera0701_irq_handler(void *handler_data) · 4 unmodified lines
161161 } else
162162 w->counter = NO_SYNC;
163163 }
164− } else if (abs(pulse_time - SYNC_PULSE - BIN0_PULSE) <
164+ } else if (abs64(pulse_time - SYNC_PULSE - BIN0_PULSE) <
165165 RESERVE + BIN1_PULSE - BIN0_PULSE) /* frame sync .. */
166166 w->counter = 0;
167167
drivers/input/keyboard/omap4-keypad.c+1−1
@@ -266,7 +266,7 @@ static int omap4_keypad_probe(struct platform_device *pdev) · 265 unmodified lines
266266
267267 error = omap4_keypad_parse_dt(&pdev->dev, keypad_data);
268268 if (error)
269− return error;
269+ goto err_free_keypad;
270270
271271 res = request_mem_region(res->start, resource_size(res), pdev->name);
272272 if (!res) {
drivers/input/misc/pm8941-pwrkey.c+1−1
@@ -93,7 +93,7 @@ static int pm8941_reboot_notify(struct notifier_block *nb, · 92 unmodified lines
9393 default:
9494 reset_type = PON_PS_HOLD_TYPE_HARD_RESET;
9595 break;
96− };
96+ }
9797
9898 error = regmap_update_bits(pwrkey->regmap,
9999 pwrkey->baseaddr + PON_PS_HOLD_RST_CTL,
drivers/input/misc/uinput.c+1−1
@@ -414,7 +414,7 @@ static int uinput_setup_device(struct uinput_device *udev, · 413 unmodified lines
414414 dev->id.product = user_dev->id.product;
415415 dev->id.version = user_dev->id.version;
416416
417− for_each_set_bit(i, dev->absbit, ABS_CNT) {
417+ for (i = 0; i < ABS_CNT; i++) {
418418 input_abs_set_max(dev, i, user_dev->absmax[i]);
419419 input_abs_set_min(dev, i, user_dev->absmin[i]);
420420 input_abs_set_fuzz(dev, i, user_dev->absfuzz[i]);
drivers/input/mouse/elan_i2c.h+1−1
@@ -60,7 +60,7 @@ struct elan_transport_ops { · 59 unmodified lines
6060 int (*get_sm_version)(struct i2c_client *client,
6161 u8* ic_type, u8 *version);
6262 int (*get_checksum)(struct i2c_client *client, bool iap, u16 *csum);
63− int (*get_product_id)(struct i2c_client *client, u8 *id);
63+ int (*get_product_id)(struct i2c_client *client, u16 *id);
6464
6565 int (*get_max)(struct i2c_client *client,
6666 unsigned int *max_x, unsigned int *max_y);
drivers/input/mouse/elan_i2c_core.c+19−7
@@ -40,7 +40,7 @@ · 39 unmodified lines
4040 #include "elan_i2c.h"
4141
4242 #define DRIVER_NAME "elan_i2c"
43−#define ELAN_DRIVER_VERSION "1.6.0"
43+#define ELAN_DRIVER_VERSION "1.6.1"
4444 #define ETP_MAX_PRESSURE 255
4545 #define ETP_FWIDTH_REDUCE 90
4646 #define ETP_FINGER_WIDTH 15
@@ -76,7 +76,7 @@ struct elan_tp_data { · 29 unmodified lines
7676 unsigned int x_res;
7777 unsigned int y_res;
7878
79− u8 product_id;
79+ u16 product_id;
8080 u8 fw_version;
8181 u8 sm_version;
8282 u8 iap_version;
@@ -98,15 +98,25 @@ static int elan_get_fwinfo(u8 iap_version, u16 *validpage_count, · 15 unmodified lines
9898 u16 *signature_address)
9999 {
100100 switch (iap_version) {
101+ case 0x00:
102+ case 0x06:
101103 case 0x08:
102104 *validpage_count = 512;
103105 break;
106+ case 0x03:
107+ case 0x07:
104108 case 0x09:
109+ case 0x0A:
110+ case 0x0B:
111+ case 0x0C:
105112 *validpage_count = 768;
106113 break;
107114 case 0x0D:
108115 *validpage_count = 896;
109116 break;
117+ case 0x0E:
118+ *validpage_count = 640;
119+ break;
110120 default:
111121 /* unknown ic type clear value */
112122 *validpage_count = 0;
@@ -266,11 +276,10 @@ static int elan_query_device_info(struct elan_tp_data *data) · 153 unmodified lines
266276
267277 error = elan_get_fwinfo(data->iap_version, &data->fw_validpage_count,
268278 &data->fw_signature_address);
269− if (error) {
270− dev_err(&data->client->dev,
271− "unknown iap version %d\n", data->iap_version);
272− return error;
273− }
279+ if (error)
280+ dev_warn(&data->client->dev,
281+ "unexpected iap version %#04x (ic type: %#04x), firmware update will not work\n",
282+ data->iap_version, data->ic_type);
274283
275284 return 0;
276285 }
@@ -486,6 +495,9 @@ static ssize_t elan_sysfs_update_fw(struct device *dev, · 209 unmodified lines
486495 const u8 *fw_signature;
487496 static const u8 signature[] = {0xAA, 0x55, 0xCC, 0x33, 0xFF, 0xFF};
488497
498+ if (data->fw_validpage_count == 0)
499+ return -EINVAL;
500+
489501 /* Look for a firmware with the product id appended. */
490502 fw_name = kasprintf(GFP_KERNEL, ETP_FW_NAME, data->product_id);
491503 if (!fw_name) {
drivers/input/mouse/elan_i2c_i2c.c+2−2
@@ -276,7 +276,7 @@ static int elan_i2c_get_sm_version(struct i2c_client *client, · 275 unmodified lines
276276 return 0;
277277 }
278278
279−static int elan_i2c_get_product_id(struct i2c_client *client, u8 *id)
279+static int elan_i2c_get_product_id(struct i2c_client *client, u16 *id)
280280 {
281281 int error;
282282 u8 val[3];
@@ -287,7 +287,7 @@ static int elan_i2c_get_product_id(struct i2c_client *client, u8 *id) · 4 unmodified lines
287287 return error;
288288 }
289289
290− *id = val[0];
290+ *id = le16_to_cpup((__le16 *)val);
291291 return 0;
292292 }
293293
drivers/input/mouse/elan_i2c_smbus.c+2−2
@@ -183,7 +183,7 @@ static int elan_smbus_get_sm_version(struct i2c_client *client, · 182 unmodified lines
183183 return 0;
184184 }
185185
186−static int elan_smbus_get_product_id(struct i2c_client *client, u8 *id)
186+static int elan_smbus_get_product_id(struct i2c_client *client, u16 *id)
187187 {
188188 int error;
189189 u8 val[3];
@@ -195,7 +195,7 @@ static int elan_smbus_get_product_id(struct i2c_client *client, u8 *id) · 5 unmodified lines
195195 return error;
196196 }
197197
198− *id = val[1];
198+ *id = be16_to_cpup((__be16 *)val);
199199 return 0;
200200 }
201201
drivers/input/mouse/synaptics.c+4−8
@@ -519,18 +519,14 @@ static int synaptics_set_mode(struct psmouse *psmouse) · 518 unmodified lines
519519 struct synaptics_data *priv = psmouse->private;
520520
521521 priv->mode = 0;
522−
523− if (priv->absolute_mode) {
522+ if (priv->absolute_mode)
524523 priv->mode |= SYN_BIT_ABSOLUTE_MODE;
525− if (SYN_CAP_EXTENDED(priv->capabilities))
526− priv->mode |= SYN_BIT_W_MODE;
527− }
528−
529− if (!SYN_MODE_WMODE(priv->mode) && priv->disable_gesture)
524+ if (priv->disable_gesture)
530525 priv->mode |= SYN_BIT_DISABLE_GESTURE;
531−
532526 if (psmouse->rate >= 80)
533527 priv->mode |= SYN_BIT_HIGH_RATE;
528+ if (SYN_CAP_EXTENDED(priv->capabilities))
529+ priv->mode |= SYN_BIT_W_MODE;
534530
535531 if (synaptics_mode_cmd(psmouse, priv->mode))
536532 return -1;
drivers/input/serio/libps2.c+14−8
@@ -212,12 +212,17 @@ int __ps2_command(struct ps2dev *ps2dev, unsigned char *param, int command) · 211 unmodified lines
212212 * time before the ACK arrives.
213213 */
214214 if (ps2_sendbyte(ps2dev, command & 0xff,
215− command == PS2_CMD_RESET_BAT ? 1000 : 200))
216− goto out;
215+ command == PS2_CMD_RESET_BAT ? 1000 : 200)) {
216+ serio_pause_rx(ps2dev->serio);
217+ goto out_reset_flags;
218+ }
217219
218− for (i = 0; i < send; i++)
219− if (ps2_sendbyte(ps2dev, param[i], 200))
220− goto out;
220+ for (i = 0; i < send; i++) {
221+ if (ps2_sendbyte(ps2dev, param[i], 200)) {
222+ serio_pause_rx(ps2dev->serio);
223+ goto out_reset_flags;
224+ }
225+ }
221226
222227 /*
223228 * The reset command takes a long time to execute.
@@ -234,17 +239,18 @@ int __ps2_command(struct ps2dev *ps2dev, unsigned char *param, int command) · 10 unmodified lines
234239 !(ps2dev->flags & PS2_FLAG_CMD), timeout);
235240 }
236241
242+ serio_pause_rx(ps2dev->serio);
243+
237244 if (param)
238245 for (i = 0; i < receive; i++)
239246 param[i] = ps2dev->cmdbuf[(receive - 1) - i];
240247
241248 if (ps2dev->cmdcnt && (command != PS2_CMD_RESET_BAT || ps2dev->cmdcnt != 1))
242− goto out;
249+ goto out_reset_flags;
243250
244251 rc = 0;
245252
246− out:
247− serio_pause_rx(ps2dev->serio);
253+ out_reset_flags:
248254 ps2dev->flags = 0;
249255 serio_continue_rx(ps2dev->serio);
250256
drivers/input/serio/parkbd.c+1−0
@@ -194,6 +194,7 @@ static int __init parkbd_init(void) · 193 unmodified lines
194194 parkbd_port = parkbd_allocate_serio();
195195 if (!parkbd_port) {
196196 parport_release(parkbd_dev);
197+ parport_unregister_device(parkbd_dev);
197198 return -ENOMEM;
198199 }
199200
drivers/input/touchscreen/imx6ul_tsc.c+22−12
@@ -94,7 +94,7 @@ struct imx6ul_tsc { · 93 unmodified lines
9494 * TSC module need ADC to get the measure value. So
9595 * before config TSC, we should initialize ADC module.
9696 */
97−static void imx6ul_adc_init(struct imx6ul_tsc *tsc)
97+static int imx6ul_adc_init(struct imx6ul_tsc *tsc)
9898 {
9999 int adc_hc = 0;
100100 int adc_gc;
@@ -122,17 +122,23 @@ static void imx6ul_adc_init(struct imx6ul_tsc *tsc) · 21 unmodified lines
122122
123123 timeout = wait_for_completion_timeout
124124 (&tsc->completion, ADC_TIMEOUT);
125− if (timeout == 0)
125+ if (timeout == 0) {
126126 dev_err(tsc->dev, "Timeout for adc calibration\n");
127+ return -ETIMEDOUT;
128+ }
127129
128130 adc_gs = readl(tsc->adc_regs + REG_ADC_GS);
129− if (adc_gs & ADC_CALF)
131+ if (adc_gs & ADC_CALF) {
130132 dev_err(tsc->dev, "ADC calibration failed\n");
133+ return -EINVAL;
134+ }
131135
132136 /* TSC need the ADC work in hardware trigger */
133137 adc_cfg = readl(tsc->adc_regs + REG_ADC_CFG);
134138 adc_cfg |= ADC_HARDWARE_TRIGGER;
135139 writel(adc_cfg, tsc->adc_regs + REG_ADC_CFG);
140+
141+ return 0;
136142 }
137143
138144 /*
@@ -188,11 +194,17 @@ static void imx6ul_tsc_set(struct imx6ul_tsc *tsc) · 49 unmodified lines
188194 writel(start, tsc->tsc_regs + REG_TSC_FLOW_CONTROL);
189195 }
190196
191−static void imx6ul_tsc_init(struct imx6ul_tsc *tsc)
197+static int imx6ul_tsc_init(struct imx6ul_tsc *tsc)
192198 {
193− imx6ul_adc_init(tsc);
199+ int err;
200+
201+ err = imx6ul_adc_init(tsc);
202+ if (err)
203+ return err;
194204 imx6ul_tsc_channel_config(tsc);
195205 imx6ul_tsc_set(tsc);
206+
207+ return 0;
196208 }
197209
198210 static void imx6ul_tsc_disable(struct imx6ul_tsc *tsc)
@@ -311,9 +323,7 @@ static int imx6ul_tsc_open(struct input_dev *input_dev) · 112 unmodified lines
311323 return err;
312324 }
313325
314− imx6ul_tsc_init(tsc);
315−
316− return 0;
326+ return imx6ul_tsc_init(tsc);
317327 }
318328
319329 static void imx6ul_tsc_close(struct input_dev *input_dev)
@@ -337,7 +347,7 @@ static int imx6ul_tsc_probe(struct platform_device *pdev) · 17 unmodified lines
337347 int tsc_irq;
338348 int adc_irq;
339349
340− tsc = devm_kzalloc(&pdev->dev, sizeof(struct imx6ul_tsc), GFP_KERNEL);
350+ tsc = devm_kzalloc(&pdev->dev, sizeof(*tsc), GFP_KERNEL);
341351 if (!tsc)
342352 return -ENOMEM;
343353
@@ -345,7 +355,7 @@ static int imx6ul_tsc_probe(struct platform_device *pdev) · 1 unmodified line
345355 if (!input_dev)
346356 return -ENOMEM;
347357
348− input_dev->name = "iMX6UL TouchScreen Controller";
358+ input_dev->name = "iMX6UL Touchscreen Controller";
349359 input_dev->id.bustype = BUS_HOST;
350360
351361 input_dev->open = imx6ul_tsc_open;
@@ -406,7 +416,7 @@ static int imx6ul_tsc_probe(struct platform_device *pdev) · 54 unmodified lines
406416 }
407417
408418 adc_irq = platform_get_irq(pdev, 1);
409− if (adc_irq <= 0) {
419+ if (adc_irq < 0) {
410420 dev_err(&pdev->dev, "no adc irq resource?\n");
411421 return adc_irq;
412422 }
@@ -491,7 +501,7 @@ static int __maybe_unused imx6ul_tsc_resume(struct device *dev) · 78 unmodified lines
491501 goto out;
492502 }
493503
494− imx6ul_tsc_init(tsc);
504+ retval = imx6ul_tsc_init(tsc);
495505 }
496506
497507 out:
drivers/input/touchscreen/mms114.c+2−2
@@ -394,12 +394,12 @@ static struct mms114_platform_data *mms114_parse_dt(struct device *dev) · 393 unmodified lines
394394 if (of_property_read_u32(np, "x-size", &pdata->x_size)) {
395395 dev_err(dev, "failed to get x-size property\n");
396396 return NULL;
397− };
397+ }
398398
399399 if (of_property_read_u32(np, "y-size", &pdata->y_size)) {
400400 dev_err(dev, "failed to get y-size property\n");
401401 return NULL;
402− };
402+ }
403403
404404 of_property_read_u32(np, "contact-threshold",
405405 &pdata->contact_threshold);
drivers/iommu/Kconfig+1−1
@@ -43,7 +43,7 @@ config IOMMU_IO_PGTABLE_LPAE_SELFTEST · 42 unmodified lines
4343 endmenu
4444
4545 config IOMMU_IOVA
46− bool
46+ tristate
4747
4848 config OF_IOMMU
4949 def_bool y
drivers/iommu/intel-iommu.c+5−3
@@ -3215,6 +3215,8 @@ static struct iova *intel_alloc_iova(struct device *dev, · 3214 unmodified lines
32153215
32163216 /* Restrict dma_mask to the width that the iommu can handle */
32173217 dma_mask = min_t(uint64_t, DOMAIN_MAX_ADDR(domain->gaw), dma_mask);
3218+ /* Ensure we reserve the whole size-aligned region */
3219+ nrpages = __roundup_pow_of_two(nrpages);
32183220
32193221 if (!dmar_forcedac && dma_mask > DMA_BIT_MASK(32)) {
32203222 /*
@@ -3711,7 +3713,7 @@ static inline int iommu_devinfo_cache_init(void) · 490 unmodified lines
37113713 static int __init iommu_init_mempool(void)
37123714 {
37133715 int ret;
3714− ret = iommu_iova_cache_init();
3716+ ret = iova_cache_get();
37153717 if (ret)
37163718 return ret;
37173719
@@ -3725,7 +3727,7 @@ static int __init iommu_init_mempool(void) · 7 unmodified lines
37253727
37263728 kmem_cache_destroy(iommu_domain_cache);
37273729 domain_error:
3728− iommu_iova_cache_destroy();
3730+ iova_cache_put();
37293731
37303732 return -ENOMEM;
37313733 }
@@ -3734,7 +3736,7 @@ static void __init iommu_exit_mempool(void) · 2 unmodified lines
37343736 {
37353737 kmem_cache_destroy(iommu_devinfo_cache);
37363738 kmem_cache_destroy(iommu_domain_cache);
3737− iommu_iova_cache_destroy();
3739+ iova_cache_put();
37383740 }
37393741
37403742 static void quirk_ioat_snb_local_iommu(struct pci_dev *pdev)
drivers/iommu/iova.c+69−51
@@ -18,42 +18,9 @@ · 17 unmodified lines
1818 */
1919
2020 #include <linux/iova.h>
21+#include <linux/module.h>
2122 #include <linux/slab.h>
2223
23−static struct kmem_cache *iommu_iova_cache;
24−
25−int iommu_iova_cache_init(void)
26−{
27− int ret = 0;
28−
29− iommu_iova_cache = kmem_cache_create("iommu_iova",
30− sizeof(struct iova),
31− 0,
32− SLAB_HWCACHE_ALIGN,
33− NULL);
34− if (!iommu_iova_cache) {
35− pr_err("Couldn't create iova cache\n");
36− ret = -ENOMEM;
37− }
38−
39− return ret;
40−}
41−
42−void iommu_iova_cache_destroy(void)
43−{
44− kmem_cache_destroy(iommu_iova_cache);
45−}
46−
47−struct iova *alloc_iova_mem(void)
48−{
49− return kmem_cache_alloc(iommu_iova_cache, GFP_ATOMIC);
50−}
51−
52−void free_iova_mem(struct iova *iova)
53−{
54− kmem_cache_free(iommu_iova_cache, iova);
55−}
56−
5724 void
5825 init_iova_domain(struct iova_domain *iovad, unsigned long granule,
5926 unsigned long start_pfn, unsigned long pfn_32bit)
@@ -72,6 +39,7 @@ init_iova_domain(struct iova_domain *iovad, unsigned long granule, · 12 unmodified lines
7239 iovad->start_pfn = start_pfn;
7340 iovad->dma_32bit_pfn = pfn_32bit;
7441 }
42+EXPORT_SYMBOL_GPL(init_iova_domain);
7543
7644 static struct rb_node *
7745 __get_cached_rbnode(struct iova_domain *iovad, unsigned long *limit_pfn)
@@ -120,19 +88,14 @@ __cached_rbnode_delete_update(struct iova_domain *iovad, struct iova *free) · 42 unmodified lines
12088 }
12189 }
12290
123−/* Computes the padding size required, to make the
124− * the start address naturally aligned on its size
91+/*
92+ * Computes the padding size required, to make the start address
93+ * naturally aligned on the power-of-two order of its size
12594 */
126−static int
127−iova_get_pad_size(int size, unsigned int limit_pfn)
95+static unsigned int
96+iova_get_pad_size(unsigned int size, unsigned int limit_pfn)
12897 {
129− unsigned int pad_size = 0;
130− unsigned int order = ilog2(size);
131−
132− if (order)
133− pad_size = (limit_pfn + 1) % (1 << order);
134−
135− return pad_size;
98+ return (limit_pfn + 1 - size) & (__roundup_pow_of_two(size) - 1);
13699 }
137100
138101 static int __alloc_and_insert_iova_range(struct iova_domain *iovad,
@@ -242,6 +205,57 @@ iova_insert_rbtree(struct rb_root *root, struct iova *iova) · 103 unmodified lines
242205 rb_insert_color(&iova->node, root);
243206 }
244207
208+static struct kmem_cache *iova_cache;
209+static unsigned int iova_cache_users;
210+static DEFINE_MUTEX(iova_cache_mutex);
211+
212+struct iova *alloc_iova_mem(void)
213+{
214+ return kmem_cache_alloc(iova_cache, GFP_ATOMIC);
215+}
216+EXPORT_SYMBOL(alloc_iova_mem);
217+
218+void free_iova_mem(struct iova *iova)
219+{
220+ kmem_cache_free(iova_cache, iova);
221+}
222+EXPORT_SYMBOL(free_iova_mem);
223+
224+int iova_cache_get(void)
225+{
226+ mutex_lock(&iova_cache_mutex);
227+ if (!iova_cache_users) {
228+ iova_cache = kmem_cache_create(
229+ "iommu_iova", sizeof(struct iova), 0,
230+ SLAB_HWCACHE_ALIGN, NULL);
231+ if (!iova_cache) {
232+ mutex_unlock(&iova_cache_mutex);
233+ printk(KERN_ERR "Couldn't create iova cache\n");
234+ return -ENOMEM;
235+ }
236+ }
237+
238+ iova_cache_users++;
239+ mutex_unlock(&iova_cache_mutex);
240+
241+ return 0;
242+}
243+EXPORT_SYMBOL_GPL(iova_cache_get);
244+
245+void iova_cache_put(void)
246+{
247+ mutex_lock(&iova_cache_mutex);
248+ if (WARN_ON(!iova_cache_users)) {
249+ mutex_unlock(&iova_cache_mutex);
250+ return;
251+ }
252+ iova_cache_users--;
253+ if (!iova_cache_users)
254+ kmem_cache_destroy(iova_cache);
255+ mutex_unlock(&iova_cache_mutex);
256+}
257+EXPORT_SYMBOL_GPL(iova_cache_put);
258+
245259 /**
246260 * alloc_iova - allocates an iova
247261 * @iovad: - iova domain in question
@@ -265,12 +279,6 @@ alloc_iova(struct iova_domain *iovad, unsigned long size, · 17 unmodified lines
265279 if (!new_iova)
266280 return NULL;
267281
268− /* If size aligned is set then round the size to
269− * to next power of two.
270− */
271− if (size_aligned)
272− size = __roundup_pow_of_two(size);
273−
274282 ret = __alloc_and_insert_iova_range(iovad, size, limit_pfn,
275283 new_iova, size_aligned);
276284
@@ -281,6 +289,7 @@ alloc_iova(struct iova_domain *iovad, unsigned long size, · 4 unmodified lines
281289
282290 return new_iova;
283291 }
292+EXPORT_SYMBOL_GPL(alloc_iova);
284293
285294 /**
286295 * find_iova - find's an iova for a given pfn
@@ -321,6 +330,7 @@ struct iova *find_iova(struct iova_domain *iovad, unsigned long pfn) · 34 unmodified lines
321330 spin_unlock_irqrestore(&iovad->iova_rbtree_lock, flags);
322331 return NULL;
323332 }
333+EXPORT_SYMBOL_GPL(find_iova);
324334
325335 /**
326336 * __free_iova - frees the given iova
@@ -339,6 +349,7 @@ __free_iova(struct iova_domain *iovad, struct iova *iova) · 12 unmodified lines
339349 spin_unlock_irqrestore(&iovad->iova_rbtree_lock, flags);
340350 free_iova_mem(iova);
341351 }
352+EXPORT_SYMBOL_GPL(__free_iova);
342353
343354 /**
344355 * free_iova - finds and frees the iova for a given pfn
@@ -356,6 +367,7 @@ free_iova(struct iova_domain *iovad, unsigned long pfn) · 11 unmodified lines
356367 __free_iova(iovad, iova);
357368
358369 }
370+EXPORT_SYMBOL_GPL(free_iova);
359371
360372 /**
361373 * put_iova_domain - destroys the iova doamin
@@ -378,6 +390,7 @@ void put_iova_domain(struct iova_domain *iovad) · 16 unmodified lines
378390 }
379391 spin_unlock_irqrestore(&iovad->iova_rbtree_lock, flags);
380392 }
393+EXPORT_SYMBOL_GPL(put_iova_domain);
381394
382395 static int
383396 __is_range_overlap(struct rb_node *node,
@@ -467,6 +480,7 @@ finish: · 83 unmodified lines
467480 spin_unlock_irqrestore(&iovad->iova_rbtree_lock, flags);
468481 return iova;
469482 }
483+EXPORT_SYMBOL_GPL(reserve_iova);
470484
471485 /**
472486 * copy_reserved_iova - copies the reserved between domains
@@ -493,6 +507,7 @@ copy_reserved_iova(struct iova_domain *from, struct iova_domain *to) · 20 unmodified lines
493507 }
494508 spin_unlock_irqrestore(&from->iova_rbtree_lock, flags);
495509 }
510+EXPORT_SYMBOL_GPL(copy_reserved_iova);
496511
497512 struct iova *
498513 split_and_remove_iova(struct iova_domain *iovad, struct iova *iova,
@@ -534,3 +549,6 @@ error: · 35 unmodified lines
534549 free_iova_mem(prev);
535550 return NULL;
536551 }
552+
553+MODULE_AUTHOR("Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>");
554+MODULE_LICENSE("GPL");
drivers/irqchip/irq-atmel-aic5.c+16−8
@@ -88,28 +88,36 @@ static void aic5_mask(struct irq_data *d) · 87 unmodified lines
8888 {
8989 struct irq_domain *domain = d->domain;
9090 struct irq_domain_chip_generic *dgc = domain->gc;
91− struct irq_chip_generic *gc = dgc->gc[0];
91+ struct irq_chip_generic *bgc = dgc->gc[0];
92+ struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
9293
93− /* Disable interrupt on AIC5 */
94− irq_gc_lock(gc);
94+ /*
95+ * Disable interrupt on AIC5. We always take the lock of the
96+ * first irq chip as all chips share the same registers.
97+ */
98+ irq_gc_lock(bgc);
9599 irq_reg_writel(gc, d->hwirq, AT91_AIC5_SSR);
96100 irq_reg_writel(gc, 1, AT91_AIC5_IDCR);
97101 gc->mask_cache &= ~d->mask;
98− irq_gc_unlock(gc);
102+ irq_gc_unlock(bgc);
99103 }
100104
101105 static void aic5_unmask(struct irq_data *d)
102106 {
103107 struct irq_domain *domain = d->domain;
104108 struct irq_domain_chip_generic *dgc = domain->gc;
105− struct irq_chip_generic *gc = dgc->gc[0];
109+ struct irq_chip_generic *bgc = dgc->gc[0];
110+ struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
106111
107− /* Enable interrupt on AIC5 */
108− irq_gc_lock(gc);
112+ /*
113+ * Enable interrupt on AIC5. We always take the lock of the
114+ * first irq chip as all chips share the same registers.
115+ */
116+ irq_gc_lock(bgc);
109117 irq_reg_writel(gc, d->hwirq, AT91_AIC5_SSR);
110118 irq_reg_writel(gc, 1, AT91_AIC5_IECR);
111119 gc->mask_cache |= d->mask;
112− irq_gc_unlock(gc);
120+ irq_gc_unlock(bgc);
113121 }
114122
115123 static int aic5_retrigger(struct irq_data *d)
drivers/irqchip/irq-gic-v3-its-pci-msi.c+1−1
@@ -62,7 +62,7 @@ static int its_get_pci_alias(struct pci_dev *pdev, u16 alias, void *data) · 61 unmodified lines
6262
6363 dev_alias->dev_id = alias;
6464 if (pdev != dev_alias->pdev)
65− dev_alias->count += its_pci_msi_vec_count(dev_alias->pdev);
65+ dev_alias->count += its_pci_msi_vec_count(pdev);
6666
6767 return 0;
6868 }
drivers/irqchip/irq-gic-v3-its.c+3−0
@@ -719,6 +719,9 @@ static unsigned long *its_lpi_alloc_chunks(int nr_irqs, int *base, int *nr_ids) · 718 unmodified lines
719719 out:
720720 spin_unlock(&lpi_lock);
721721
722+ if (!bitmap)
723+ *base = *nr_ids = 0;
724+
722725 return bitmap;
723726 }
724727
drivers/irqchip/irq-mips-gic.c+10−2
@@ -320,6 +320,14 @@ static void gic_handle_shared_int(bool chained) · 319 unmodified lines
320320 intrmask[i] = gic_read(intrmask_reg);
321321 pending_reg += gic_reg_step;
322322 intrmask_reg += gic_reg_step;
323+
324+ if (!config_enabled(CONFIG_64BIT) || mips_cm_is64)
325+ continue;
326+
327+ pending[i] |= (u64)gic_read(pending_reg) << 32;
328+ intrmask[i] |= (u64)gic_read(intrmask_reg) << 32;
329+ pending_reg += gic_reg_step;
330+ intrmask_reg += gic_reg_step;
323331 }
324332
325333 bitmap_and(pending, pending, intrmask, gic_shared_intrs);
@@ -426,7 +434,7 @@ static int gic_set_affinity(struct irq_data *d, const struct cpumask *cpumask, · 100 unmodified lines
426434 spin_lock_irqsave(&gic_lock, flags);
427435
428436 /* Re-route this IRQ */
429− gic_map_to_vpe(irq, cpumask_first(&tmp));
437+ gic_map_to_vpe(irq, mips_cm_vp_id(cpumask_first(&tmp)));
430438
431439 /* Update the pcpu_masks */
432440 for (i = 0; i < NR_CPUS; i++)
@@ -599,7 +607,7 @@ static __init void gic_ipi_init_one(unsigned int intr, int cpu, · 166 unmodified lines
599607 GIC_SHARED_TO_HWIRQ(intr));
600608 int i;
601609
602− gic_map_to_vpe(intr, cpu);
610+ gic_map_to_vpe(intr, mips_cm_vp_id(cpu));
603611 for (i = 0; i < NR_CPUS; i++)
604612 clear_bit(intr, pcpu_masks[i].pcpu_mask);
605613 set_bit(intr, pcpu_masks[cpu].pcpu_mask);
drivers/md/bitmap.c+2−1
@@ -1997,7 +1997,8 @@ int bitmap_resize(struct bitmap *bitmap, sector_t blocks, · 1996 unmodified lines
19971997 if (bitmap->mddev->bitmap_info.offset || bitmap->mddev->bitmap_info.file)
19981998 ret = bitmap_storage_alloc(&store, chunks,
19991999 !bitmap->mddev->bitmap_info.external,
2000− bitmap->cluster_slot);
2000+ mddev_is_clustered(bitmap->mddev)
2001+ ? bitmap->cluster_slot : 0);
20012002 if (ret)
20022003 goto err;
20032004
drivers/md/dm-crypt.c+15−2
@@ -968,7 +968,8 @@ static void crypt_free_buffer_pages(struct crypt_config *cc, struct bio *clone); · 967 unmodified lines
968968
969969 /*
970970 * Generate a new unfragmented bio with the given size
971− * This should never violate the device limitations
971+ * This should never violate the device limitations (but only because
972+ * max_segment_size is being constrained to PAGE_SIZE).
972973 *
973974 * This function may be called concurrently. If we allocate from the mempool
974975 * concurrently, there is a possibility of deadlock. For example, if we have
@@ -2045,9 +2046,20 @@ static int crypt_iterate_devices(struct dm_target *ti, · 1070 unmodified lines
20452046 return fn(ti, cc->dev, cc->start, ti->len, data);
20462047 }
20472048
2049+static void crypt_io_hints(struct dm_target *ti, struct queue_limits *limits)
2050+{
2051+ /*
2052+ * Unfortunate constraint that is required to avoid the potential
2053+ * for exceeding underlying device's max_segments limits -- due to
2054+ * crypt_alloc_buffer() possibly allocating pages for the encryption
2055+ * bio that are not as physically contiguous as the original bio.
2056+ */
2057+ limits->max_segment_size = PAGE_SIZE;
2058+}
2059+
20482060 static struct target_type crypt_target = {
20492061 .name = "crypt",
2050− .version = {1, 14, 0},
2062+ .version = {1, 14, 1},
20512063 .module = THIS_MODULE,
20522064 .ctr = crypt_ctr,
20532065 .dtr = crypt_dtr,
@@ -2058,6 +2070,7 @@ static struct target_type crypt_target = { · 4 unmodified lines
20582070 .resume = crypt_resume,
20592071 .message = crypt_message,
20602072 .iterate_devices = crypt_iterate_devices,
2073+ .io_hints = crypt_io_hints,
20612074 };
20622075
20632076 static int __init dm_crypt_init(void)
drivers/md/dm-thin.c+4−0
@@ -4249,6 +4249,10 @@ static void thin_io_hints(struct dm_target *ti, struct queue_limits *limits) · 4248 unmodified lines
42494249 {
42504250 struct thin_c *tc = ti->private;
42514251 struct pool *pool = tc->pool;
4252+ struct queue_limits *pool_limits = dm_get_queue_limits(pool->pool_md);
4253+
4254+ if (!pool_limits->discard_granularity)
4255+ return; /* pool's discard support is disabled */
42524256
42534257 limits->discard_granularity = pool->sectors_per_block << SECTOR_SHIFT;
42544258 limits->max_discard_sectors = 2048 * 1024 * 16; /* 16G */
drivers/md/md.c+5−0
@@ -5409,9 +5409,13 @@ static int md_set_readonly(struct mddev *mddev, struct block_device *bdev) · 5408 unmodified lines
54095409 * which will now never happen */
54105410 wake_up_process(mddev->sync_thread->tsk);
54115411
5412+ if (mddev->external && test_bit(MD_CHANGE_PENDING, &mddev->flags))
5413+ return -EBUSY;
54125414 mddev_unlock(mddev);
54135415 wait_event(resync_wait, !test_bit(MD_RECOVERY_RUNNING,
54145416 &mddev->recovery));
5417+ wait_event(mddev->sb_wait,
5418+ !test_bit(MD_CHANGE_PENDING, &mddev->flags));
54155419 mddev_lock_nointr(mddev);
54165420
54175421 mutex_lock(&mddev->open_mutex);
@@ -8160,6 +8164,7 @@ void md_check_recovery(struct mddev *mddev) · 2742 unmodified lines
81608164 md_reap_sync_thread(mddev);
81618165 clear_bit(MD_RECOVERY_RECOVER, &mddev->recovery);
81628166 clear_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
8167+ clear_bit(MD_CHANGE_PENDING, &mddev->flags);
81638168 goto unlock;
81648169 }
81658170
drivers/md/multipath.c+1−2
@@ -470,8 +470,7 @@ static int multipath_run (struct mddev *mddev) · 469 unmodified lines
470470 return 0;
471471
472472 out_free_conf:
473− if (conf->pool)
474− mempool_destroy(conf->pool);
473+ mempool_destroy(conf->pool);
475474 kfree(conf->multipaths);
476475 kfree(conf);
477476 mddev->private = NULL;
drivers/md/raid0.c+6−6
@@ -376,12 +376,6 @@ static int raid0_run(struct mddev *mddev) · 375 unmodified lines
376376 struct md_rdev *rdev;
377377 bool discard_supported = false;
378378
379− rdev_for_each(rdev, mddev) {
380− disk_stack_limits(mddev->gendisk, rdev->bdev,
381− rdev->data_offset << 9);
382− if (blk_queue_discard(bdev_get_queue(rdev->bdev)))
383− discard_supported = true;
384− }
385379 blk_queue_max_hw_sectors(mddev->queue, mddev->chunk_sectors);
386380 blk_queue_max_write_same_sectors(mddev->queue, mddev->chunk_sectors);
387381 blk_queue_max_discard_sectors(mddev->queue, mddev->chunk_sectors);
@@ -390,6 +384,12 @@ static int raid0_run(struct mddev *mddev) · 2 unmodified lines
390384 blk_queue_io_opt(mddev->queue,
391385 (mddev->chunk_sectors << 9) * mddev->raid_disks);
392386
387+ rdev_for_each(rdev, mddev) {
388+ disk_stack_limits(mddev->gendisk, rdev->bdev,
389+ rdev->data_offset << 9);
390+ if (blk_queue_discard(bdev_get_queue(rdev->bdev)))
391+ discard_supported = true;
392+ }
393393 if (!discard_supported)
394394 queue_flag_clear_unlocked(QUEUE_FLAG_DISCARD, mddev->queue);
395395 else
drivers/md/raid1.c+4−7
@@ -881,8 +881,7 @@ static sector_t wait_barrier(struct r1conf *conf, struct bio *bio) · 880 unmodified lines
881881 }
882882
883883 if (bio && bio_data_dir(bio) == WRITE) {
884− if (bio->bi_iter.bi_sector >=
885− conf->mddev->curr_resync_completed) {
884+ if (bio->bi_iter.bi_sector >= conf->next_resync) {
886885 if (conf->start_next_window == MaxSector)
887886 conf->start_next_window =
888887 conf->next_resync +
@@ -1516,7 +1515,7 @@ static void close_sync(struct r1conf *conf) · 627 unmodified lines
15161515 conf->r1buf_pool = NULL;
15171516
15181517 spin_lock_irq(&conf->resync_lock);
1519− conf->next_resync = 0;
1518+ conf->next_resync = MaxSector - 2 * NEXT_NORMALIO_DISTANCE;
15201519 conf->start_next_window = MaxSector;
15211520 conf->current_window_requests +=
15221521 conf->next_window_requests;
@@ -2843,8 +2842,7 @@ static struct r1conf *setup_conf(struct mddev *mddev) · 1320 unmodified lines
28432842
28442843 abort:
28452844 if (conf) {
2846− if (conf->r1bio_pool)
2847− mempool_destroy(conf->r1bio_pool);
2845+ mempool_destroy(conf->r1bio_pool);
28482846 kfree(conf->mirrors);
28492847 safe_put_page(conf->tmppage);
28502848 kfree(conf->poolinfo);
@@ -2946,8 +2944,7 @@ static void raid1_free(struct mddev *mddev, void *priv) · 95 unmodified lines
29462944 {
29472945 struct r1conf *conf = priv;
29482946
2949− if (conf->r1bio_pool)
2950− mempool_destroy(conf->r1bio_pool);
2947+ mempool_destroy(conf->r1bio_pool);
29512948 kfree(conf->mirrors);
29522949 safe_put_page(conf->tmppage);
29532950 kfree(conf->poolinfo);
drivers/md/raid10.c+3−6
@@ -3486,8 +3486,7 @@ static struct r10conf *setup_conf(struct mddev *mddev) · 3485 unmodified lines
34863486 printk(KERN_ERR "md/raid10:%s: couldn't allocate memory.\n",
34873487 mdname(mddev));
34883488 if (conf) {
3489− if (conf->r10bio_pool)
3490− mempool_destroy(conf->r10bio_pool);
3489+ mempool_destroy(conf->r10bio_pool);
34913490 kfree(conf->mirrors);
34923491 safe_put_page(conf->tmppage);
34933492 kfree(conf);
@@ -3682,8 +3681,7 @@ static int run(struct mddev *mddev) · 188 unmodified lines
36823681
36833682 out_free_conf:
36843683 md_unregister_thread(&mddev->thread);
3685− if (conf->r10bio_pool)
3686− mempool_destroy(conf->r10bio_pool);
3684+ mempool_destroy(conf->r10bio_pool);
36873685 safe_put_page(conf->tmppage);
36883686 kfree(conf->mirrors);
36893687 kfree(conf);
@@ -3696,8 +3694,7 @@ static void raid10_free(struct mddev *mddev, void *priv) · 6 unmodified lines
36963694 {
36973695 struct r10conf *conf = priv;
36983696
3699− if (conf->r10bio_pool)
3700− mempool_destroy(conf->r10bio_pool);
3697+ mempool_destroy(conf->r10bio_pool);
37013698 safe_put_page(conf->tmppage);
37023699 kfree(conf->mirrors);
37033700 kfree(conf->mirrors_old);
drivers/md/raid5.c+7−4
@@ -2271,8 +2271,7 @@ static void shrink_stripes(struct r5conf *conf) · 2270 unmodified lines
22712271 drop_one_stripe(conf))
22722272 ;
22732273
2274− if (conf->slab_cache)
2275− kmem_cache_destroy(conf->slab_cache);
2274+ kmem_cache_destroy(conf->slab_cache);
22762275 conf->slab_cache = NULL;
22772276 }
22782277
@@ -3150,6 +3149,8 @@ handle_failed_stripe(struct r5conf *conf, struct stripe_head *sh, · 871 unmodified lines
31503149 spin_unlock_irq(&sh->stripe_lock);
31513150 if (test_and_clear_bit(R5_Overlap, &sh->dev[i].flags))
31523151 wake_up(&conf->wait_for_overlap);
3152+ if (bi)
3153+ s->to_read--;
31533154 while (bi && bi->bi_iter.bi_sector <
31543155 sh->dev[i].sector + STRIPE_SECTORS) {
31553156 struct bio *nextbi =
@@ -3169,6 +3170,8 @@ handle_failed_stripe(struct r5conf *conf, struct stripe_head *sh, · 13 unmodified lines
31693170 */
31703171 clear_bit(R5_LOCKED, &sh->dev[i].flags);
31713172 }
3173+ s->to_write = 0;
3174+ s->written = 0;
31723175
31733176 if (test_and_clear_bit(STRIPE_FULL_WRITE, &sh->state))
31743177 if (atomic_dec_and_test(&conf->pending_full_writes))
@@ -3300,7 +3303,7 @@ static int need_this_block(struct stripe_head *sh, struct stripe_head_state *s, · 125 unmodified lines
33003303 */
33013304 return 0;
33023305
3303− for (i = 0; i < s->failed; i++) {
3306+ for (i = 0; i < s->failed && i < 2; i++) {
33043307 if (fdev[i]->towrite &&
33053308 !test_bit(R5_UPTODATE, &fdev[i]->flags) &&
33063309 !test_bit(R5_OVERWRITE, &fdev[i]->flags))
@@ -3324,7 +3327,7 @@ static int need_this_block(struct stripe_head *sh, struct stripe_head_state *s, · 17 unmodified lines
33243327 sh->sector < sh->raid_conf->mddev->recovery_cp)
33253328 /* reconstruct-write isn't being forced */
33263329 return 0;
3327− for (i = 0; i < s->failed; i++) {
3330+ for (i = 0; i < s->failed && i < 2; i++) {
33283331 if (s->failed_num[i] != sh->pd_idx &&
33293332 s->failed_num[i] != sh->qd_idx &&
33303333 !test_bit(R5_UPTODATE, &fdev[i]->flags) &&
drivers/misc/cxl/sysfs.c+2−0
@@ -592,6 +592,8 @@ int cxl_sysfs_afu_add(struct cxl_afu *afu) · 591 unmodified lines
592592
593593 /* conditionally create the add the binary file for error info buffer */
594594 if (afu->eb_len) {
595+ sysfs_attr_init(&afu->attr_eb.attr);
596+
595597 afu->attr_eb.attr.name = "afu_err_buff";
596598 afu->attr_eb.attr.mode = S_IRUGO;
597599 afu->attr_eb.size = afu->eb_len;
drivers/misc/mei/debugfs.c+2−1
@@ -204,6 +204,8 @@ int mei_dbgfs_register(struct mei_device *dev, const char *name) · 203 unmodified lines
204204 if (!dir)
205205 return -ENOMEM;
206206
207+ dev->dbgfs_dir = dir;
208+
207209 f = debugfs_create_file("meclients", S_IRUSR, dir,
208210 dev, &mei_dbgfs_fops_meclients);
209211 if (!f) {
@@ -228,7 +230,6 @@ int mei_dbgfs_register(struct mei_device *dev, const char *name) · 18 unmodified lines
228230 dev_err(dev->dev, "allow_fixed_address: registration failed\n");
229231 goto err;
230232 }
231− dev->dbgfs_dir = dir;
232233 return 0;
233234 err:
234235 mei_dbgfs_deregister(dev);
drivers/mmc/core/core.c+4−2
@@ -134,9 +134,11 @@ void mmc_request_done(struct mmc_host *host, struct mmc_request *mrq) · 133 unmodified lines
134134 int err = cmd->error;
135135
136136 /* Flag re-tuning needed on CRC errors */
137− if (err == -EILSEQ || (mrq->sbc && mrq->sbc->error == -EILSEQ) ||
137+ if ((cmd->opcode != MMC_SEND_TUNING_BLOCK &&
138+ cmd->opcode != MMC_SEND_TUNING_BLOCK_HS200) &&
139+ (err == -EILSEQ || (mrq->sbc && mrq->sbc->error == -EILSEQ) ||
138140 (mrq->data && mrq->data->error == -EILSEQ) ||
139− (mrq->stop && mrq->stop->error == -EILSEQ))
141+ (mrq->stop && mrq->stop->error == -EILSEQ)))
140142 mmc_retune_needed(host);
141143
142144 if (err && cmd->retries && mmc_host_is_spi(host)) {
drivers/mmc/core/host.c+2−2
@@ -457,7 +457,7 @@ int mmc_of_parse(struct mmc_host *host) · 456 unmodified lines
457457 0, &cd_gpio_invert);
458458 if (!ret)
459459 dev_info(host->parent, "Got CD GPIO\n");
460− else if (ret != -ENOENT)
460+ else if (ret != -ENOENT && ret != -ENOSYS)
461461 return ret;
462462
463463 /*
@@ -481,7 +481,7 @@ int mmc_of_parse(struct mmc_host *host) · 17 unmodified lines
481481 ret = mmc_gpiod_request_ro(host, "wp", 0, false, 0, &ro_gpio_invert);
482482 if (!ret)
483483 dev_info(host->parent, "Got WP GPIO\n");
484− else if (ret != -ENOENT)
484+ else if (ret != -ENOENT && ret != -ENOSYS)
485485 return ret;
486486
487487 if (of_property_read_bool(np, "disable-wp"))
drivers/mmc/host/pxamci.c+22−44
@@ -28,6 +28,7 @@ · 27 unmodified lines
2828 #include <linux/clk.h>
2929 #include <linux/err.h>
3030 #include <linux/mmc/host.h>
31+#include <linux/mmc/slot-gpio.h>
3132 #include <linux/io.h>
3233 #include <linux/regulator/consumer.h>
3334 #include <linux/gpio.h>
@@ -454,12 +455,8 @@ static int pxamci_get_ro(struct mmc_host *mmc) · 420 unmodified lines
454455 {
455456 struct pxamci_host *host = mmc_priv(mmc);
456457
457− if (host->pdata && gpio_is_valid(host->pdata->gpio_card_ro)) {
458− if (host->pdata->gpio_card_ro_invert)
459− return !gpio_get_value(host->pdata->gpio_card_ro);
460− else
461− return gpio_get_value(host->pdata->gpio_card_ro);
462− }
458+ if (host->pdata && gpio_is_valid(host->pdata->gpio_card_ro))
459+ return mmc_gpio_get_ro(mmc);
463460 if (host->pdata && host->pdata->get_ro)
464461 return !!host->pdata->get_ro(mmc_dev(mmc));
465462 /*
@@ -551,6 +548,7 @@ static void pxamci_enable_sdio_irq(struct mmc_host *host, int enable) · 85 unmodified lines
551548
552549 static const struct mmc_host_ops pxamci_ops = {
553550 .request = pxamci_request,
551+ .get_cd = mmc_gpio_get_cd,
554552 .get_ro = pxamci_get_ro,
555553 .set_ios = pxamci_set_ios,
556554 .enable_sdio_irq = pxamci_enable_sdio_irq,
@@ -790,37 +788,31 @@ static int pxamci_probe(struct platform_device *pdev) · 233 unmodified lines
790788 gpio_power = host->pdata->gpio_power;
791789 }
792790 if (gpio_is_valid(gpio_power)) {
793− ret = gpio_request(gpio_power, "mmc card power");
791+ ret = devm_gpio_request(&pdev->dev, gpio_power,
792+ "mmc card power");
794793 if (ret) {
795− dev_err(&pdev->dev, "Failed requesting gpio_power %d\n", gpio_power);
794+ dev_err(&pdev->dev, "Failed requesting gpio_power %d\n",
795+ gpio_power);
796796 goto out;
797797 }
798798 gpio_direction_output(gpio_power,
799799 host->pdata->gpio_power_invert);
800800 }
801− if (gpio_is_valid(gpio_ro)) {
802− ret = gpio_request(gpio_ro, "mmc card read only");
803− if (ret) {
804− dev_err(&pdev->dev, "Failed requesting gpio_ro %d\n", gpio_ro);
805− goto err_gpio_ro;
806− }
807− gpio_direction_input(gpio_ro);
801+ if (gpio_is_valid(gpio_ro))
802+ ret = mmc_gpio_request_ro(mmc, gpio_ro);
803+ if (ret) {
804+ dev_err(&pdev->dev, "Failed requesting gpio_ro %d\n", gpio_ro);
805+ goto out;
806+ } else {
807+ mmc->caps |= host->pdata->gpio_card_ro_invert ?
808+ MMC_CAP2_RO_ACTIVE_HIGH : 0;
808809 }
809− if (gpio_is_valid(gpio_cd)) {
810− ret = gpio_request(gpio_cd, "mmc card detect");
811− if (ret) {
812− dev_err(&pdev->dev, "Failed requesting gpio_cd %d\n", gpio_cd);
813− goto err_gpio_cd;
814− }
815− gpio_direction_input(gpio_cd);
816810
817− ret = request_irq(gpio_to_irq(gpio_cd), pxamci_detect_irq,
818− IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
819− "mmc card detect", mmc);
820− if (ret) {
821− dev_err(&pdev->dev, "failed to request card detect IRQ\n");
822− goto err_request_irq;
823− }
811+ if (gpio_is_valid(gpio_cd))
812+ ret = mmc_gpio_request_cd(mmc, gpio_cd, 0);
813+ if (ret) {
814+ dev_err(&pdev->dev, "Failed requesting gpio_cd %d\n", gpio_cd);
815+ goto out;
824816 }
825817
826818 if (host->pdata && host->pdata->init)
@@ -835,13 +827,7 @@ static int pxamci_probe(struct platform_device *pdev) · 8 unmodified lines
835827
836828 return 0;
837829
838−err_request_irq:
839− gpio_free(gpio_cd);
840−err_gpio_cd:
841− gpio_free(gpio_ro);
842−err_gpio_ro:
843− gpio_free(gpio_power);
844− out:
830+out:
845831 if (host) {
846832 if (host->dma_chan_rx)
847833 dma_release_channel(host->dma_chan_rx);
@@ -873,14 +859,6 @@ static int pxamci_remove(struct platform_device *pdev) · 25 unmodified lines
873859 gpio_ro = host->pdata->gpio_card_ro;
874860 gpio_power = host->pdata->gpio_power;
875861 }
876− if (gpio_is_valid(gpio_cd)) {
877− free_irq(gpio_to_irq(gpio_cd), mmc);
878− gpio_free(gpio_cd);
879− }
880− if (gpio_is_valid(gpio_ro))
881− gpio_free(gpio_ro);
882− if (gpio_is_valid(gpio_power))
883− gpio_free(gpio_power);
884862 if (host->vcc)
885863 regulator_put(host->vcc);
886864
drivers/mmc/host/sunxi-mmc.c+39−14
@@ -210,6 +210,16 @@ · 209 unmodified lines
210210 #define SDXC_IDMAC_DES0_CES BIT(30) /* card error summary */
211211 #define SDXC_IDMAC_DES0_OWN BIT(31) /* 1-idma owns it, 0-host owns it */
212212
213+#define SDXC_CLK_400K 0
214+#define SDXC_CLK_25M 1
215+#define SDXC_CLK_50M 2
216+#define SDXC_CLK_50M_DDR 3
217+
218+struct sunxi_mmc_clk_delay {
219+ u32 output;
220+ u32 sample;
221+};
222+
213223 struct sunxi_idma_des {
214224 u32 config;
215225 u32 buf_size;
@@ -229,6 +239,7 @@ struct sunxi_mmc_host { · 13 unmodified lines
229239 struct clk *clk_mmc;
230240 struct clk *clk_sample;
231241 struct clk *clk_output;
242+ const struct sunxi_mmc_clk_delay *clk_delays;
232243
233244 /* irq */
234245 spinlock_t lock;
@@ -654,25 +665,19 @@ static int sunxi_mmc_clk_set_rate(struct sunxi_mmc_host *host, · 419 unmodified lines
654665
655666 /* determine delays */
656667 if (rate <= 400000) {
657− oclk_dly = 180;
658− sclk_dly = 42;
668+ oclk_dly = host->clk_delays[SDXC_CLK_400K].output;
669+ sclk_dly = host->clk_delays[SDXC_CLK_400K].sample;
659670 } else if (rate <= 25000000) {
660− oclk_dly = 180;
661− sclk_dly = 75;
671+ oclk_dly = host->clk_delays[SDXC_CLK_25M].output;
672+ sclk_dly = host->clk_delays[SDXC_CLK_25M].sample;
662673 } else if (rate <= 50000000) {
663674 if (ios->timing == MMC_TIMING_UHS_DDR50) {
664− oclk_dly = 60;
665− sclk_dly = 120;
675+ oclk_dly = host->clk_delays[SDXC_CLK_50M_DDR].output;
676+ sclk_dly = host->clk_delays[SDXC_CLK_50M_DDR].sample;
666677 } else {
667− oclk_dly = 90;
668− sclk_dly = 150;
678+ oclk_dly = host->clk_delays[SDXC_CLK_50M].output;
679+ sclk_dly = host->clk_delays[SDXC_CLK_50M].sample;
669680 }
670− } else if (rate <= 100000000) {
671− oclk_dly = 6;
672− sclk_dly = 24;
673− } else if (rate <= 200000000) {
674− oclk_dly = 3;
675− sclk_dly = 12;
676681 } else {
677682 return -EINVAL;
678683 }
@@ -871,6 +876,7 @@ static void sunxi_mmc_request(struct mmc_host *mmc, struct mmc_request *mrq) · 192 unmodified lines
871876 static const struct of_device_id sunxi_mmc_of_match[] = {
872877 { .compatible = "allwinner,sun4i-a10-mmc", },
873878 { .compatible = "allwinner,sun5i-a13-mmc", },
879+ { .compatible = "allwinner,sun9i-a80-mmc", },
874880 { /* sentinel */ }
875881 };
876882 MODULE_DEVICE_TABLE(of, sunxi_mmc_of_match);
@@ -884,6 +890,20 @@ static struct mmc_host_ops sunxi_mmc_ops = { · 7 unmodified lines
884890 .hw_reset = sunxi_mmc_hw_reset,
885891 };
886892
893+static const struct sunxi_mmc_clk_delay sunxi_mmc_clk_delays[] = {
894+ [SDXC_CLK_400K] = { .output = 180, .sample = 180 },
895+ [SDXC_CLK_25M] = { .output = 180, .sample = 75 },
896+ [SDXC_CLK_50M] = { .output = 90, .sample = 120 },
897+ [SDXC_CLK_50M_DDR] = { .output = 60, .sample = 120 },
898+};
899+
900+static const struct sunxi_mmc_clk_delay sun9i_mmc_clk_delays[] = {
901+ [SDXC_CLK_400K] = { .output = 180, .sample = 180 },
902+ [SDXC_CLK_25M] = { .output = 180, .sample = 75 },
903+ [SDXC_CLK_50M] = { .output = 150, .sample = 120 },
904+ [SDXC_CLK_50M_DDR] = { .output = 90, .sample = 120 },
905+};
906+
887907 static int sunxi_mmc_resource_request(struct sunxi_mmc_host *host,
888908 struct platform_device *pdev)
889909 {
@@ -895,6 +915,11 @@ static int sunxi_mmc_resource_request(struct sunxi_mmc_host *host, · 5 unmodified lines
895915 else
896916 host->idma_des_size_bits = 16;
897917
918+ if (of_device_is_compatible(np, "allwinner,sun9i-a80-mmc"))
919+ host->clk_delays = sun9i_mmc_clk_delays;
920+ else
921+ host->clk_delays = sunxi_mmc_clk_delays;
922+
898923 ret = mmc_regulator_get_supply(host->mmc);
899924 if (ret) {
900925 if (ret != -EPROBE_DEFER)
drivers/mtd/ubi/io.c+5−0
@@ -926,6 +926,11 @@ static int validate_vid_hdr(const struct ubi_device *ubi, · 925 unmodified lines
926926 goto bad;
927927 }
928928
929+ if (data_size > ubi->leb_size) {
930+ ubi_err(ubi, "bad data_size");
931+ goto bad;
932+ }
933+
929934 if (vol_type == UBI_VID_STATIC) {
930935 /*
931936 * Although from high-level point of view static volumes may
drivers/mtd/ubi/vtbl.c+1−0
@@ -649,6 +649,7 @@ static int init_volumes(struct ubi_device *ubi, · 648 unmodified lines
649649 if (ubi->corr_peb_count)
650650 ubi_err(ubi, "%d PEBs are corrupted and not used",
651651 ubi->corr_peb_count);
652+ return -ENOSPC;
652653 }
653654 ubi->rsvd_pebs += reserved_pebs;
654655 ubi->avail_pebs -= reserved_pebs;
drivers/mtd/ubi/wl.c+1−0
@@ -1601,6 +1601,7 @@ int ubi_wl_init(struct ubi_device *ubi, struct ubi_attach_info *ai) · 1600 unmodified lines
16011601 if (ubi->corr_peb_count)
16021602 ubi_err(ubi, "%d PEBs are corrupted and not used",
16031603 ubi->corr_peb_count);
1604+ err = -ENOSPC;
16041605 goto out_free;
16051606 }
16061607 ubi->avail_pebs -= reserved_pebs;
drivers/net/arcnet/arcnet.c+1−1
@@ -326,7 +326,7 @@ static void arcdev_setup(struct net_device *dev) · 325 unmodified lines
326326 dev->type = ARPHRD_ARCNET;
327327 dev->netdev_ops = &arcnet_netdev_ops;
328328 dev->header_ops = &arcnet_header_ops;
329− dev->hard_header_len = sizeof(struct archdr);
329+ dev->hard_header_len = sizeof(struct arc_hardware);
330330 dev->mtu = choose_mtu();
331331
332332 dev->addr_len = ARCNET_ALEN;
drivers/net/dsa/mv88e6xxx.c+3−0
@@ -2000,6 +2000,7 @@ static int mv88e6xxx_setup_port(struct dsa_switch *ds, int port) · 1999 unmodified lines
20002000 */
20012001 reg = _mv88e6xxx_reg_read(ds, REG_PORT(port), PORT_PCS_CTRL);
20022002 if (dsa_is_cpu_port(ds, port) || dsa_is_dsa_port(ds, port)) {
2003+ reg &= ~PORT_PCS_CTRL_UNFORCED;
20032004 reg |= PORT_PCS_CTRL_FORCE_LINK |
20042005 PORT_PCS_CTRL_LINK_UP |
20052006 PORT_PCS_CTRL_DUPLEX_FULL |
@@ -2050,6 +2051,8 @@ static int mv88e6xxx_setup_port(struct dsa_switch *ds, int port) · 44 unmodified lines
20502051 reg |= PORT_CONTROL_FRAME_ETHER_TYPE_DSA;
20512052 else
20522053 reg |= PORT_CONTROL_FRAME_MODE_DSA;
2054+ reg |= PORT_CONTROL_FORWARD_UNKNOWN |
2055+ PORT_CONTROL_FORWARD_UNKNOWN_MC;
20532056 }
20542057
20552058 if (mv88e6xxx_6352_family(ds) || mv88e6xxx_6351_family(ds) ||
drivers/net/ethernet/apm/xgene/xgene_enet_hw.c+16−8
@@ -689,16 +689,24 @@ static int xgene_enet_phy_connect(struct net_device *ndev) · 688 unmodified lines
689689 netdev_dbg(ndev, "No phy-handle found in DT\n");
690690 return -ENODEV;
691691 }
692− pdata->phy_dev = of_phy_find_device(phy_np);
693− }
694692
695− phy_dev = pdata->phy_dev;
693+ phy_dev = of_phy_connect(ndev, phy_np, &xgene_enet_adjust_link,
694+ 0, pdata->phy_mode);
695+ if (!phy_dev) {
696+ netdev_err(ndev, "Could not connect to PHY\n");
697+ return -ENODEV;
698+ }
699+
700+ pdata->phy_dev = phy_dev;
701+ } else {
702+ phy_dev = pdata->phy_dev;
696703
697− if (!phy_dev ||
698− phy_connect_direct(ndev, phy_dev, &xgene_enet_adjust_link,
699− pdata->phy_mode)) {
700− netdev_err(ndev, "Could not connect to PHY\n");
701− return -ENODEV;
704+ if (!phy_dev ||
705+ phy_connect_direct(ndev, phy_dev, &xgene_enet_adjust_link,
706+ pdata->phy_mode)) {
707+ netdev_err(ndev, "Could not connect to PHY\n");
708+ return -ENODEV;
709+ }
702710 }
703711
704712 pdata->phy_speed = SPEED_UNKNOWN;
drivers/net/ethernet/arc/emac_arc.c+1−0
@@ -78,6 +78,7 @@ static const struct of_device_id emac_arc_dt_ids[] = { · 77 unmodified lines
7878 { .compatible = "snps,arc-emac" },
7979 { /* Sentinel */ }
8080 };
81+MODULE_DEVICE_TABLE(of, emac_arc_dt_ids);
8182
8283 static struct platform_driver emac_arc_driver = {
8384 .probe = emac_arc_probe,
drivers/net/ethernet/broadcom/bcmsysport.c+1−0
@@ -2079,6 +2079,7 @@ static const struct of_device_id bcm_sysport_of_match[] = { · 2078 unmodified lines
20792079 { .compatible = "brcm,systemport" },
20802080 { /* sentinel */ }
20812081 };
2082+MODULE_DEVICE_TABLE(of, bcm_sysport_of_match);
20822083
20832084 static struct platform_driver bcm_sysport_driver = {
20842085 .probe = bcm_sysport_probe,
drivers/net/ethernet/broadcom/bnx2x/bnx2x.h+1−0
@@ -1946,6 +1946,7 @@ struct bnx2x { · 1945 unmodified lines
19461946 u16 vlan_cnt;
19471947 u16 vlan_credit;
19481948 u16 vxlan_dst_port;
1949+ u8 vxlan_dst_port_count;
19491950 bool accept_any_vlan;
19501951 };
19511952
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c+14−6
@@ -3705,16 +3705,14 @@ out: · 3704 unmodified lines
37053705
37063706 void bnx2x_update_mfw_dump(struct bnx2x *bp)
37073707 {
3708− struct timeval epoc;
37093708 u32 drv_ver;
37103709 u32 valid_dump;
37113710
37123711 if (!SHMEM2_HAS(bp, drv_info))
37133712 return;
37143713
3715− /* Update Driver load time */
3716− do_gettimeofday(&epoc);
3717− SHMEM2_WR(bp, drv_info.epoc, epoc.tv_sec);
3714+ /* Update Driver load time, possibly broken in y2038 */
3715+ SHMEM2_WR(bp, drv_info.epoc, (u32)ktime_get_real_seconds());
37183716
37193717 drv_ver = bnx2x_update_mng_version_utility(DRV_MODULE_VERSION, true);
37203718 SHMEM2_WR(bp, drv_info.drv_ver, drv_ver);
@@ -10110,12 +10108,18 @@ static void __bnx2x_add_vxlan_port(struct bnx2x *bp, u16 port) · 6389 unmodified lines
1011010108 if (!netif_running(bp->dev))
1011110109 return;
1011210110
10113− if (bp->vxlan_dst_port || !IS_PF(bp)) {
10111+ if (bp->vxlan_dst_port_count && bp->vxlan_dst_port == port) {
10112+ bp->vxlan_dst_port_count++;
10113+ return;
10114+ }
10115+
10116+ if (bp->vxlan_dst_port_count || !IS_PF(bp)) {
1011410117 DP(BNX2X_MSG_SP, "Vxlan destination port limit reached\n");
1011510118 return;
1011610119 }
1011710120
1011810121 bp->vxlan_dst_port = port;
10122+ bp->vxlan_dst_port_count = 1;
1011910123 bnx2x_schedule_sp_rtnl(bp, BNX2X_SP_RTNL_ADD_VXLAN_PORT, 0);
1012010124 }
1012110125
@@ -10130,10 +10134,14 @@ static void bnx2x_add_vxlan_port(struct net_device *netdev, · 8 unmodified lines
1013010134
1013110135 static void __bnx2x_del_vxlan_port(struct bnx2x *bp, u16 port)
1013210136 {
10133− if (!bp->vxlan_dst_port || bp->vxlan_dst_port != port || !IS_PF(bp)) {
10137+ if (!bp->vxlan_dst_port_count || bp->vxlan_dst_port != port ||
10138+ !IS_PF(bp)) {
1013410139 DP(BNX2X_MSG_SP, "Invalid vxlan port\n");
1013510140 return;
1013610141 }
10142+ bp->vxlan_dst_port--;
10143+ if (bp->vxlan_dst_port)
10144+ return;
1013710145
1013810146 if (netif_running(bp->dev)) {
1013910147 bnx2x_schedule_sp_rtnl(bp, BNX2X_SP_RTNL_DEL_VXLAN_PORT, 0);
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c+10−2
@@ -4319,8 +4319,16 @@ static int bnx2x_setup_rss(struct bnx2x *bp, · 4318 unmodified lines
43194319
43204320 /* RSS keys */
43214321 if (test_bit(BNX2X_RSS_SET_SRCH, &p->rss_flags)) {
4322− memcpy(&data->rss_key[0], &p->rss_key[0],
4323− sizeof(data->rss_key));
4322+ u8 *dst = (u8 *)(data->rss_key) + sizeof(data->rss_key);
4323+ const u8 *src = (const u8 *)p->rss_key;
4324+ int i;
4325+
4326+ /* Apparently, bnx2x reads this array in reverse order
4327+ * We need to byte swap rss_key to comply with Toeplitz specs.
4328+ */
4329+ for (i = 0; i < sizeof(data->rss_key); i++)
4330+ *--dst = *src++;
4331+
43244332 caps |= ETH_RSS_UPDATE_RAMROD_DATA_UPDATE_RSS_KEY;
43254333 }
43264334
drivers/net/ethernet/broadcom/genet/bcmgenet.c+1−0
@@ -3155,6 +3155,7 @@ static const struct of_device_id bcmgenet_match[] = { · 3154 unmodified lines
31553155 { .compatible = "brcm,genet-v4", .data = (void *)GENET_V4 },
31563156 { },
31573157 };
3158+MODULE_DEVICE_TABLE(of, bcmgenet_match);
31583159
31593160 static int bcmgenet_probe(struct platform_device *pdev)
31603161 {
drivers/net/ethernet/brocade/bna/bfa_ioc.c+7−6
@@ -1543,7 +1543,7 @@ bfa_flash_cmd_act_check(void __iomem *pci_bar) · 1542 unmodified lines
15431543 }
15441544
15451545 /* Flush FLI data fifo. */
1546−static u32
1546+static int
15471547 bfa_flash_fifo_flush(void __iomem *pci_bar)
15481548 {
15491549 u32 i;
@@ -1573,11 +1573,11 @@ bfa_flash_fifo_flush(void __iomem *pci_bar) · 23 unmodified lines
15731573 }
15741574
15751575 /* Read flash status. */
1576−static u32
1576+static int
15771577 bfa_flash_status_read(void __iomem *pci_bar)
15781578 {
15791579 union bfa_flash_dev_status_reg dev_status;
1580− u32 status;
1580+ int status;
15811581 u32 ret_status;
15821582 int i;
15831583
@@ -1611,11 +1611,11 @@ bfa_flash_status_read(void __iomem *pci_bar) · 27 unmodified lines
16111611 }
16121612
16131613 /* Start flash read operation. */
1614−static u32
1614+static int
16151615 bfa_flash_read_start(void __iomem *pci_bar, u32 offset, u32 len,
16161616 char *buf)
16171617 {
1618− u32 status;
1618+ int status;
16191619
16201620 /* len must be mutiple of 4 and not exceeding fifo size */
16211621 if (len == 0 || len > BFA_FLASH_FIFO_SIZE || (len & 0x03) != 0)
@@ -1703,7 +1703,8 @@ static enum bfa_status · 81 unmodified lines
17031703 bfa_flash_raw_read(void __iomem *pci_bar, u32 offset, char *buf,
17041704 u32 len)
17051705 {
1706− u32 n, status;
1706+ u32 n;
1707+ int status;
17071708 u32 off, l, s, residue, fifo_sz;
17081709
17091710 residue = len;
drivers/net/ethernet/brocade/bna/bna_tx_rx.c+2−0
@@ -2400,6 +2400,7 @@ bna_rx_create(struct bna *bna, struct bnad *bnad, · 2399 unmodified lines
24002400 q0->rcb->id = 0;
24012401 q0->rx_packets = q0->rx_bytes = 0;
24022402 q0->rx_packets_with_error = q0->rxbuf_alloc_failed = 0;
2403+ q0->rxbuf_map_failed = 0;
24032404
24042405 bna_rxq_qpt_setup(q0, rxp, dpage_count, PAGE_SIZE,
24052406 &dqpt_mem[i], &dsqpt_mem[i], &dpage_mem[i]);
@@ -2428,6 +2429,7 @@ bna_rx_create(struct bna *bna, struct bnad *bnad, · 22 unmodified lines
24282429 : rx_cfg->q1_buf_size;
24292430 q1->rx_packets = q1->rx_bytes = 0;
24302431 q1->rx_packets_with_error = q1->rxbuf_alloc_failed = 0;
2432+ q1->rxbuf_map_failed = 0;
24312433
24322434 bna_rxq_qpt_setup(q1, rxp, hpage_count, PAGE_SIZE,
24332435 &hqpt_mem[i], &hsqpt_mem[i],
drivers/net/ethernet/brocade/bna/bna_types.h+1−0
@@ -587,6 +587,7 @@ struct bna_rxq { · 586 unmodified lines
587587 u64 rx_bytes;
588588 u64 rx_packets_with_error;
589589 u64 rxbuf_alloc_failed;
590+ u64 rxbuf_map_failed;
590591 };
591592
592593 /* RxQ pair */
drivers/net/ethernet/brocade/bna/bnad.c+28−1
@@ -399,7 +399,13 @@ bnad_rxq_refill_page(struct bnad *bnad, struct bna_rcb *rcb, u32 nalloc) · 398 unmodified lines
399399 }
400400
401401 dma_addr = dma_map_page(&bnad->pcidev->dev, page, page_offset,
402− unmap_q->map_size, DMA_FROM_DEVICE);
402+ unmap_q->map_size, DMA_FROM_DEVICE);
403+ if (dma_mapping_error(&bnad->pcidev->dev, dma_addr)) {
404+ put_page(page);
405+ BNAD_UPDATE_CTR(bnad, rxbuf_map_failed);
406+ rcb->rxq->rxbuf_map_failed++;
407+ goto finishing;
408+ }
403409
404410 unmap->page = page;
405411 unmap->page_offset = page_offset;
@@ -454,8 +460,15 @@ bnad_rxq_refill_skb(struct bnad *bnad, struct bna_rcb *rcb, u32 nalloc) · 48 unmodified lines
454460 rcb->rxq->rxbuf_alloc_failed++;
455461 goto finishing;
456462 }
463+
457464 dma_addr = dma_map_single(&bnad->pcidev->dev, skb->data,
458465 buff_sz, DMA_FROM_DEVICE);
466+ if (dma_mapping_error(&bnad->pcidev->dev, dma_addr)) {
467+ dev_kfree_skb_any(skb);
468+ BNAD_UPDATE_CTR(bnad, rxbuf_map_failed);
469+ rcb->rxq->rxbuf_map_failed++;
470+ goto finishing;
471+ }
459472
460473 unmap->skb = skb;
461474 dma_unmap_addr_set(&unmap->vector, dma_addr, dma_addr);
@@ -3025,6 +3038,11 @@ bnad_start_xmit(struct sk_buff *skb, struct net_device *netdev) · 2563 unmodified lines
30253038 unmap = head_unmap;
30263039 dma_addr = dma_map_single(&bnad->pcidev->dev, skb->data,
30273040 len, DMA_TO_DEVICE);
3041+ if (dma_mapping_error(&bnad->pcidev->dev, dma_addr)) {
3042+ dev_kfree_skb_any(skb);
3043+ BNAD_UPDATE_CTR(bnad, tx_skb_map_failed);
3044+ return NETDEV_TX_OK;
3045+ }
30283046 BNA_SET_DMA_ADDR(dma_addr, &txqent->vector[0].host_addr);
30293047 txqent->vector[0].length = htons(len);
30303048 dma_unmap_addr_set(&unmap->vectors[0], dma_addr, dma_addr);
@@ -3056,6 +3074,15 @@ bnad_start_xmit(struct sk_buff *skb, struct net_device *netdev) · 25 unmodified lines
30563074
30573075 dma_addr = skb_frag_dma_map(&bnad->pcidev->dev, frag,
30583076 0, size, DMA_TO_DEVICE);
3077+ if (dma_mapping_error(&bnad->pcidev->dev, dma_addr)) {
3078+ /* Undo the changes starting at tcb->producer_index */
3079+ bnad_tx_buff_unmap(bnad, unmap_q, q_depth,
3080+ tcb->producer_index);
3081+ dev_kfree_skb_any(skb);
3082+ BNAD_UPDATE_CTR(bnad, tx_skb_map_failed);
3083+ return NETDEV_TX_OK;
3084+ }
3085+
30593086 dma_unmap_len_set(&unmap->vectors[vect_id], dma_len, size);
30603087 BNA_SET_DMA_ADDR(dma_addr, &txqent->vector[vect_id].host_addr);
30613088 txqent->vector[vect_id].length = htons(size);
drivers/net/ethernet/brocade/bna/bnad.h+2−0
@@ -175,6 +175,7 @@ struct bnad_drv_stats { · 174 unmodified lines
175175 u64 tx_skb_headlen_zero;
176176 u64 tx_skb_frag_zero;
177177 u64 tx_skb_len_mismatch;
178+ u64 tx_skb_map_failed;
178179
179180 u64 hw_stats_updates;
180181 u64 netif_rx_dropped;
@@ -189,6 +190,7 @@ struct bnad_drv_stats { · 8 unmodified lines
189190 u64 rx_unmap_q_alloc_failed;
190191
191192 u64 rxbuf_alloc_failed;
193+ u64 rxbuf_map_failed;
192194 };
193195
194196 /* Complete driver stats */
drivers/net/ethernet/brocade/bna/bnad_ethtool.c+4−0
@@ -90,6 +90,7 @@ static const char *bnad_net_stats_strings[BNAD_ETHTOOL_STATS_NUM] = { · 89 unmodified lines
9090 "tx_skb_headlen_zero",
9191 "tx_skb_frag_zero",
9292 "tx_skb_len_mismatch",
93+ "tx_skb_map_failed",
9394 "hw_stats_updates",
9495 "netif_rx_dropped",
9596
@@ -102,6 +103,7 @@ static const char *bnad_net_stats_strings[BNAD_ETHTOOL_STATS_NUM] = { · 6 unmodified lines
102103 "tx_unmap_q_alloc_failed",
103104 "rx_unmap_q_alloc_failed",
104105 "rxbuf_alloc_failed",
106+ "rxbuf_map_failed",
105107
106108 "mac_stats_clr_cnt",
107109 "mac_frame_64",
@@ -807,6 +809,7 @@ bnad_per_q_stats_fill(struct bnad *bnad, u64 *buf, int bi) · 699 unmodified lines
807809 rx_packets_with_error;
808810 buf[bi++] = rcb->rxq->
809811 rxbuf_alloc_failed;
812+ buf[bi++] = rcb->rxq->rxbuf_map_failed;
810813 buf[bi++] = rcb->producer_index;
811814 buf[bi++] = rcb->consumer_index;
812815 }
@@ -821,6 +824,7 @@ bnad_per_q_stats_fill(struct bnad *bnad, u64 *buf, int bi) · 8 unmodified lines
821824 rx_packets_with_error;
822825 buf[bi++] = rcb->rxq->
823826 rxbuf_alloc_failed;
827+ buf[bi++] = rcb->rxq->rxbuf_map_failed;
824828 buf[bi++] = rcb->producer_index;
825829 buf[bi++] = rcb->consumer_index;
826830 }
drivers/net/ethernet/chelsio/cxgb4/t4_pci_id_tbl.h+5−0
@@ -157,6 +157,11 @@ CH_PCI_DEVICE_ID_TABLE_DEFINE_BEGIN · 156 unmodified lines
157157 CH_PCI_ID_TABLE_FENTRY(0x5090), /* Custom T540-CR */
158158 CH_PCI_ID_TABLE_FENTRY(0x5091), /* Custom T522-CR */
159159 CH_PCI_ID_TABLE_FENTRY(0x5092), /* Custom T520-CR */
160+ CH_PCI_ID_TABLE_FENTRY(0x5093), /* Custom T580-LP-CR */
161+ CH_PCI_ID_TABLE_FENTRY(0x5094), /* Custom T540-CR */
162+ CH_PCI_ID_TABLE_FENTRY(0x5095), /* Custom T540-CR-SO */
163+ CH_PCI_ID_TABLE_FENTRY(0x5096), /* Custom T580-CR */
164+ CH_PCI_ID_TABLE_FENTRY(0x5097), /* Custom T520-KR */
160165
161166 /* T6 adapters:
162167 */
drivers/net/ethernet/emulex/benet/be.h+1−0
@@ -582,6 +582,7 @@ struct be_adapter { · 581 unmodified lines
582582 u16 pvid;
583583 __be16 vxlan_port;
584584 int vxlan_port_count;
585+ int vxlan_port_aliases;
585586 struct phy_info phy;
586587 u8 wol_cap;
587588 bool wol_en;
drivers/net/ethernet/emulex/benet/be_main.c+10−0
@@ -5176,6 +5176,11 @@ static void be_add_vxlan_port(struct net_device *netdev, sa_family_t sa_family, · 5175 unmodified lines
51765176 if (lancer_chip(adapter) || BEx_chip(adapter) || be_is_mc(adapter))
51775177 return;
51785178
5179+ if (adapter->vxlan_port == port && adapter->vxlan_port_count) {
5180+ adapter->vxlan_port_aliases++;
5181+ return;
5182+ }
5183+
51795184 if (adapter->flags & BE_FLAGS_VXLAN_OFFLOADS) {
51805185 dev_info(dev,
51815186 "Only one UDP port supported for VxLAN offloads\n");
@@ -5226,6 +5231,11 @@ static void be_del_vxlan_port(struct net_device *netdev, sa_family_t sa_family, · 44 unmodified lines
52265231 if (adapter->vxlan_port != port)
52275232 goto done;
52285233
5234+ if (adapter->vxlan_port_aliases) {
5235+ adapter->vxlan_port_aliases--;
5236+ return;
5237+ }
5238+
52295239 be_disable_vxlan_offloads(adapter);
52305240
52315241 dev_info(&adapter->pdev->dev,
drivers/net/ethernet/freescale/gianfar.c+10−5
@@ -1710,8 +1710,10 @@ static void gfar_configure_serdes(struct net_device *dev) · 1709 unmodified lines
17101710 * everything for us? Resetting it takes the link down and requires
17111711 * several seconds for it to come back.
17121712 */
1713− if (phy_read(tbiphy, MII_BMSR) & BMSR_LSTATUS)
1713+ if (phy_read(tbiphy, MII_BMSR) & BMSR_LSTATUS) {
1714+ put_device(&tbiphy->dev);
17141715 return;
1716+ }
17151717
17161718 /* Single clk mode, mii mode off(for serdes communication) */
17171719 phy_write(tbiphy, MII_TBICON, TBICON_CLK_SELECT);
@@ -1723,6 +1725,8 @@ static void gfar_configure_serdes(struct net_device *dev) · 5 unmodified lines
17231725 phy_write(tbiphy, MII_BMCR,
17241726 BMCR_ANENABLE | BMCR_ANRESTART | BMCR_FULLDPLX |
17251727 BMCR_SPEED1000);
1728+
1729+ put_device(&tbiphy->dev);
17261730 }
17271731
17281732 static int __gfar_is_rx_idle(struct gfar_private *priv)
@@ -1970,8 +1974,7 @@ static int register_grp_irqs(struct gfar_priv_grp *grp) · 241 unmodified lines
19701974 /* Install our interrupt handlers for Error,
19711975 * Transmit, and Receive
19721976 */
1973− err = request_irq(gfar_irq(grp, ER)->irq, gfar_error,
1974− IRQF_NO_SUSPEND,
1977+ err = request_irq(gfar_irq(grp, ER)->irq, gfar_error, 0,
19751978 gfar_irq(grp, ER)->name, grp);
19761979 if (err < 0) {
19771980 netif_err(priv, intr, dev, "Can't get IRQ %d\n",
@@ -1979,6 +1982,8 @@ static int register_grp_irqs(struct gfar_priv_grp *grp) · 1 unmodified line
19791982
19801983 goto err_irq_fail;
19811984 }
1985+ enable_irq_wake(gfar_irq(grp, ER)->irq);
1986+
19821987 err = request_irq(gfar_irq(grp, TX)->irq, gfar_transmit, 0,
19831988 gfar_irq(grp, TX)->name, grp);
19841989 if (err < 0) {
@@ -1994,14 +1999,14 @@ static int register_grp_irqs(struct gfar_priv_grp *grp) · 9 unmodified lines
19941999 goto rx_irq_fail;
19952000 }
19962001 } else {
1997− err = request_irq(gfar_irq(grp, TX)->irq, gfar_interrupt,
1998− IRQF_NO_SUSPEND,
2002+ err = request_irq(gfar_irq(grp, TX)->irq, gfar_interrupt, 0,
19992003 gfar_irq(grp, TX)->name, grp);
20002004 if (err < 0) {
20012005 netif_err(priv, intr, dev, "Can't get IRQ %d\n",
20022006 gfar_irq(grp, TX)->irq);
20032007 goto err_irq_fail;
20042008 }
2009+ enable_irq_wake(gfar_irq(grp, TX)->irq);
20052010 }
20062011
20072012 return 0;
drivers/net/ethernet/freescale/gianfar_ptp.c+1−0
@@ -557,6 +557,7 @@ static const struct of_device_id match_table[] = { · 556 unmodified lines
557557 { .compatible = "fsl,etsec-ptp" },
558558 {},
559559 };
560+MODULE_DEVICE_TABLE(of, match_table);
560561
561562 static struct platform_driver gianfar_ptp_driver = {
562563 .driver = {
drivers/net/ethernet/freescale/ucc_geth.c+7−1
@@ -1384,6 +1384,8 @@ static int adjust_enet_interface(struct ucc_geth_private *ugeth) · 1383 unmodified lines
13841384 value = phy_read(tbiphy, ENET_TBI_MII_CR);
13851385 value &= ~0x1000; /* Turn off autonegotiation */
13861386 phy_write(tbiphy, ENET_TBI_MII_CR, value);
1387+
1388+ put_device(&tbiphy->dev);
13871389 }
13881390
13891391 init_check_frame_length_mode(ug_info->lengthCheckRx, &ug_regs->maccfg2);
@@ -1702,8 +1704,10 @@ static void uec_configure_serdes(struct net_device *dev) · 312 unmodified lines
17021704 * everything for us? Resetting it takes the link down and requires
17031705 * several seconds for it to come back.
17041706 */
1705− if (phy_read(tbiphy, ENET_TBI_MII_SR) & TBISR_LSTATUS)
1707+ if (phy_read(tbiphy, ENET_TBI_MII_SR) & TBISR_LSTATUS) {
1708+ put_device(&tbiphy->dev);
17061709 return;
1710+ }
17071711
17081712 /* Single clk mode, mii mode off(for serdes communication) */
17091713 phy_write(tbiphy, ENET_TBI_MII_ANA, TBIANA_SETTINGS);
@@ -1711,6 +1715,8 @@ static void uec_configure_serdes(struct net_device *dev) · 1 unmodified line
17111715 phy_write(tbiphy, ENET_TBI_MII_TBICON, TBICON_CLK_SELECT);
17121716
17131717 phy_write(tbiphy, ENET_TBI_MII_CR, TBICR_SETTINGS);
1718+
1719+ put_device(&tbiphy->dev);
17141720 }
17151721
17161722 /* Configure the PHY for dev.
drivers/net/ethernet/hisilicon/hip04_eth.c+1−1
@@ -816,7 +816,7 @@ static int hip04_mac_probe(struct platform_device *pdev) · 815 unmodified lines
816816 struct net_device *ndev;
817817 struct hip04_priv *priv;
818818 struct resource *res;
819− unsigned int irq;
819+ int irq;
820820 int ret;
821821
822822 ndev = alloc_etherdev(sizeof(struct hip04_priv));
drivers/net/ethernet/ibm/emac/core.h+3−3
@@ -460,8 +460,8 @@ struct emac_ethtool_regs_subhdr { · 459 unmodified lines
460460 u32 index;
461461 };
462462
463−#define EMAC_ETHTOOL_REGS_VER 0
464−#define EMAC4_ETHTOOL_REGS_VER 1
465−#define EMAC4SYNC_ETHTOOL_REGS_VER 2
463+#define EMAC_ETHTOOL_REGS_VER 3
464+#define EMAC4_ETHTOOL_REGS_VER 4
465+#define EMAC4SYNC_ETHTOOL_REGS_VER 5
466466
467467 #endif /* __IBM_NEWEMAC_CORE_H */
drivers/net/ethernet/intel/i40e/i40e_adminq.c+9−0
@@ -946,6 +946,13 @@ i40e_status i40e_clean_arq_element(struct i40e_hw *hw, · 945 unmodified lines
946946 /* take the lock before we start messing with the ring */
947947 mutex_lock(&hw->aq.arq_mutex);
948948
949+ if (hw->aq.arq.count == 0) {
950+ i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE,
951+ "AQRX: Admin queue not initialized.\n");
952+ ret_code = I40E_ERR_QUEUE_EMPTY;
953+ goto clean_arq_element_err;
954+ }
955+
949956 /* set next_to_use to head */
950957 ntu = (rd32(hw, hw->aq.arq.head) & I40E_PF_ARQH_ARQH_MASK);
951958 if (ntu == ntc) {
@@ -1007,6 +1014,8 @@ clean_arq_element_out: · 55 unmodified lines
10071014 /* Set pending if needed, unlock and return */
10081015 if (pending != NULL)
10091016 *pending = (ntc > ntu ? hw->aq.arq.count : 0) + (ntu - ntc);
1017+
1018+clean_arq_element_err:
10101019 mutex_unlock(&hw->aq.arq_mutex);
10111020
10121021 if (i40e_is_nvm_update_op(&e->desc)) {
drivers/net/ethernet/intel/i40e/i40e_main.c+2−1
@@ -2672,7 +2672,8 @@ static int i40e_configure_rx_ring(struct i40e_ring *ring) · 2671 unmodified lines
26722672 rx_ctx.lrxqthresh = 2;
26732673 rx_ctx.crcstrip = 1;
26742674 rx_ctx.l2tsel = 1;
2675− rx_ctx.showiv = 1;
2675+ /* this controls whether VLAN is stripped from inner headers */
2676+ rx_ctx.showiv = 0;
26762677 #ifdef I40E_FCOE
26772678 rx_ctx.fc_ena = (vsi->type == I40E_VSI_FCOE);
26782679 #endif
drivers/net/ethernet/intel/i40evf/i40e_adminq.c+9−0
@@ -887,6 +887,13 @@ i40e_status i40evf_clean_arq_element(struct i40e_hw *hw, · 886 unmodified lines
887887 /* take the lock before we start messing with the ring */
888888 mutex_lock(&hw->aq.arq_mutex);
889889
890+ if (hw->aq.arq.count == 0) {
891+ i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE,
892+ "AQRX: Admin queue not initialized.\n");
893+ ret_code = I40E_ERR_QUEUE_EMPTY;
894+ goto clean_arq_element_err;
895+ }
896+
890897 /* set next_to_use to head */
891898 ntu = (rd32(hw, hw->aq.arq.head) & I40E_VF_ARQH1_ARQH_MASK);
892899 if (ntu == ntc) {
@@ -948,6 +955,8 @@ clean_arq_element_out: · 55 unmodified lines
948955 /* Set pending if needed, unlock and return */
949956 if (pending != NULL)
950957 *pending = (ntc > ntu ? hw->aq.arq.count : 0) + (ntu - ntc);
958+
959+clean_arq_element_err:
951960 mutex_unlock(&hw->aq.arq_mutex);
952961
953962 return ret_code;
drivers/net/ethernet/marvell/mvneta.c+5−1
@@ -1479,6 +1479,7 @@ static int mvneta_rx(struct mvneta_port *pp, int rx_todo, · 1478 unmodified lines
14791479 struct mvneta_rx_desc *rx_desc = mvneta_rxq_next_desc_get(rxq);
14801480 struct sk_buff *skb;
14811481 unsigned char *data;
1482+ dma_addr_t phys_addr;
14821483 u32 rx_status;
14831484 int rx_bytes, err;
14841485
@@ -1486,6 +1487,7 @@ static int mvneta_rx(struct mvneta_port *pp, int rx_todo, · 1 unmodified line
14861487 rx_status = rx_desc->status;
14871488 rx_bytes = rx_desc->data_size - (ETH_FCS_LEN + MVNETA_MH_SIZE);
14881489 data = (unsigned char *)rx_desc->buf_cookie;
1490+ phys_addr = rx_desc->buf_phys_addr;
14891491
14901492 if (!mvneta_rxq_desc_is_first_last(rx_status) ||
14911493 (rx_status & MVNETA_RXD_ERR_SUMMARY)) {
@@ -1534,7 +1536,7 @@ static int mvneta_rx(struct mvneta_port *pp, int rx_todo, · 42 unmodified lines
15341536 if (!skb)
15351537 goto err_drop_frame;
15361538
1537− dma_unmap_single(dev->dev.parent, rx_desc->buf_phys_addr,
1539+ dma_unmap_single(dev->dev.parent, phys_addr,
15381540 MVNETA_RX_BUF_SIZE(pp->pkt_size), DMA_FROM_DEVICE);
15391541
15401542 rcvd_pkts++;
@@ -3173,6 +3175,8 @@ static int mvneta_probe(struct platform_device *pdev) · 1632 unmodified lines
31733175 struct phy_device *phy = of_phy_find_device(dn);
31743176
31753177 mvneta_fixed_link_update(pp, phy);
3178+
3179+ put_device(&phy->dev);
31763180 }
31773181
31783182 return 0;
drivers/net/ethernet/mellanox/mlx4/en_rx.c+0−2
@@ -1270,8 +1270,6 @@ int mlx4_en_config_rss_steer(struct mlx4_en_priv *priv) · 1269 unmodified lines
12701270 rss_context->hash_fn = MLX4_RSS_HASH_TOP;
12711271 memcpy(rss_context->rss_key, priv->rss_key,
12721272 MLX4_EN_RSS_KEY_SIZE);
1273− netdev_rss_key_fill(rss_context->rss_key,
1274− MLX4_EN_RSS_KEY_SIZE);
12751273 } else {
12761274 en_err(priv, "Unknown RSS hash function requested\n");
12771275 err = -EINVAL;
drivers/net/ethernet/mellanox/mlx4/mcg.c+4−3
@@ -1184,10 +1184,11 @@ out: · 1183 unmodified lines
11841184 if (prot == MLX4_PROT_ETH) {
11851185 /* manage the steering entry for promisc mode */
11861186 if (new_entry)
1187− new_steering_entry(dev, port, steer, index, qp->qpn);
1187+ err = new_steering_entry(dev, port, steer,
1188+ index, qp->qpn);
11881189 else
1189− existing_steering_entry(dev, port, steer,
1190− index, qp->qpn);
1190+ err = existing_steering_entry(dev, port, steer,
1191+ index, qp->qpn);
11911192 }
11921193 if (err && link && index != -1) {
11931194 if (index < dev->caps.num_mgms)
drivers/net/ethernet/mellanox/mlx5/core/fw.c+0−22
@@ -200,25 +200,3 @@ int mlx5_cmd_teardown_hca(struct mlx5_core_dev *dev) · 199 unmodified lines
200200
201201 return err;
202202 }
203−
204−int mlx5_core_query_special_context(struct mlx5_core_dev *dev, u32 *rsvd_lkey)
205−{
206− struct mlx5_cmd_query_special_contexts_mbox_in in;
207− struct mlx5_cmd_query_special_contexts_mbox_out out;
208− int err;
209−
210− memset(&in, 0, sizeof(in));
211− memset(&out, 0, sizeof(out));
212− in.hdr.opcode = cpu_to_be16(MLX5_CMD_OP_QUERY_SPECIAL_CONTEXTS);
213− err = mlx5_cmd_exec(dev, &in, sizeof(in), &out, sizeof(out));
214− if (err)
215− return err;
216−
217− if (out.hdr.status)
218− err = mlx5_cmd_status_to_err(&out.hdr);
219−
220− *rsvd_lkey = be32_to_cpu(out.resd_lkey);
221−
222− return err;
223−}
224−EXPORT_SYMBOL(mlx5_core_query_special_context);
drivers/net/ethernet/micrel/ks8851.c+1−0
@@ -1601,6 +1601,7 @@ static const struct of_device_id ks8851_match_table[] = { · 1600 unmodified lines
16011601 { .compatible = "micrel,ks8851" },
16021602 { }
16031603 };
1604+MODULE_DEVICE_TABLE(of, ks8851_match_table);
16041605
16051606 static struct spi_driver ks8851_driver = {
16061607 .driver = {
drivers/net/ethernet/moxa/moxart_ether.c+1−0
@@ -552,6 +552,7 @@ static const struct of_device_id moxart_mac_match[] = { · 551 unmodified lines
552552 { .compatible = "moxa,moxart-mac" },
553553 { }
554554 };
555+MODULE_DEVICE_TABLE(of, moxart_mac_match);
555556
556557 static struct platform_driver moxart_mac_driver = {
557558 .probe = moxart_mac_probe,
drivers/net/ethernet/qlogic/qlcnic/qlcnic.h+1−0
@@ -536,6 +536,7 @@ struct qlcnic_hardware_context { · 535 unmodified lines
536536 u8 extend_lb_time;
537537 u8 phys_port_id[ETH_ALEN];
538538 u8 lb_mode;
539+ u8 vxlan_port_count;
539540 u16 vxlan_port;
540541 struct device *hwmon_dev;
541542 u32 post_mode;
drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c+13−5
@@ -483,11 +483,17 @@ static void qlcnic_add_vxlan_port(struct net_device *netdev, · 482 unmodified lines
483483 /* Adapter supports only one VXLAN port. Use very first port
484484 * for enabling offload
485485 */
486− if (!qlcnic_encap_rx_offload(adapter) || ahw->vxlan_port)
486+ if (!qlcnic_encap_rx_offload(adapter))
487487 return;
488+ if (!ahw->vxlan_port_count) {
489+ ahw->vxlan_port_count = 1;
490+ ahw->vxlan_port = ntohs(port);
491+ adapter->flags |= QLCNIC_ADD_VXLAN_PORT;
492+ return;
493+ }
494+ if (ahw->vxlan_port == ntohs(port))
495+ ahw->vxlan_port_count++;
488496
489− ahw->vxlan_port = ntohs(port);
490− adapter->flags |= QLCNIC_ADD_VXLAN_PORT;
491497 }
492498
493499 static void qlcnic_del_vxlan_port(struct net_device *netdev,
@@ -496,11 +502,13 @@ static void qlcnic_del_vxlan_port(struct net_device *netdev, · 2 unmodified lines
496502 struct qlcnic_adapter *adapter = netdev_priv(netdev);
497503 struct qlcnic_hardware_context *ahw = adapter->ahw;
498504
499− if (!qlcnic_encap_rx_offload(adapter) || !ahw->vxlan_port ||
505+ if (!qlcnic_encap_rx_offload(adapter) || !ahw->vxlan_port_count ||
500506 (ahw->vxlan_port != ntohs(port)))
501507 return;
502508
503− adapter->flags |= QLCNIC_DEL_VXLAN_PORT;
509+ ahw->vxlan_port_count--;
510+ if (!ahw->vxlan_port_count)
511+ adapter->flags |= QLCNIC_DEL_VXLAN_PORT;
504512 }
505513
506514 static netdev_features_t qlcnic_features_check(struct sk_buff *skb,
drivers/net/ethernet/realtek/8139cp.c+55−56
@@ -157,6 +157,7 @@ enum { · 156 unmodified lines
157157 NWayAdvert = 0x66, /* MII ADVERTISE */
158158 NWayLPAR = 0x68, /* MII LPA */
159159 NWayExpansion = 0x6A, /* MII Expansion */
160+ TxDmaOkLowDesc = 0x82, /* Low 16 bit address of a Tx descriptor. */
160161 Config5 = 0xD8, /* Config5 */
161162 TxPoll = 0xD9, /* Tell chip to check Tx descriptors for work */
162163 RxMaxSize = 0xDA, /* Max size of an Rx packet (8169 only) */
@@ -341,6 +342,7 @@ struct cp_private { · 178 unmodified lines
341342 unsigned tx_tail;
342343 struct cp_desc *tx_ring;
343344 struct sk_buff *tx_skb[CP_TX_RING_SIZE];
345+ u32 tx_opts[CP_TX_RING_SIZE];
344346
345347 unsigned rx_buf_sz;
346348 unsigned wol_enabled : 1; /* Is Wake-on-LAN enabled? */
@@ -665,7 +667,7 @@ static void cp_tx (struct cp_private *cp) · 318 unmodified lines
665667 BUG_ON(!skb);
666668
667669 dma_unmap_single(&cp->pdev->dev, le64_to_cpu(txd->addr),
668− le32_to_cpu(txd->opts1) & 0xffff,
670+ cp->tx_opts[tx_tail] & 0xffff,
669671 PCI_DMA_TODEVICE);
670672
671673 if (status & LastFrag) {
@@ -733,7 +735,7 @@ static netdev_tx_t cp_start_xmit (struct sk_buff *skb, · 61 unmodified lines
733735 {
734736 struct cp_private *cp = netdev_priv(dev);
735737 unsigned entry;
736− u32 eor, flags;
738+ u32 eor, opts1;
737739 unsigned long intr_flags;
738740 __le32 opts2;
739741 int mss = 0;
@@ -753,6 +755,21 @@ static netdev_tx_t cp_start_xmit (struct sk_buff *skb, · 13 unmodified lines
753755 mss = skb_shinfo(skb)->gso_size;
754756
755757 opts2 = cpu_to_le32(cp_tx_vlan_tag(skb));
758+ opts1 = DescOwn;
759+ if (mss)
760+ opts1 |= LargeSend | ((mss & MSSMask) << MSSShift);
761+ else if (skb->ip_summed == CHECKSUM_PARTIAL) {
762+ const struct iphdr *ip = ip_hdr(skb);
763+ if (ip->protocol == IPPROTO_TCP)
764+ opts1 |= IPCS | TCPCS;
765+ else if (ip->protocol == IPPROTO_UDP)
766+ opts1 |= IPCS | UDPCS;
767+ else {
768+ WARN_ONCE(1,
769+ "Net bug: asked to checksum invalid Legacy IP packet\n");
770+ goto out_dma_error;
771+ }
772+ }
756773
757774 if (skb_shinfo(skb)->nr_frags == 0) {
758775 struct cp_desc *txd = &cp->tx_ring[entry];
@@ -768,31 +785,20 @@ static netdev_tx_t cp_start_xmit (struct sk_buff *skb, · 9 unmodified lines
768785 txd->addr = cpu_to_le64(mapping);
769786 wmb();
770787
771− flags = eor | len | DescOwn | FirstFrag | LastFrag;
772−
773− if (mss)
774− flags |= LargeSend | ((mss & MSSMask) << MSSShift);
775− else if (skb->ip_summed == CHECKSUM_PARTIAL) {
776− const struct iphdr *ip = ip_hdr(skb);
777− if (ip->protocol == IPPROTO_TCP)
778− flags |= IPCS | TCPCS;
779− else if (ip->protocol == IPPROTO_UDP)
780− flags |= IPCS | UDPCS;
781− else
782− WARN_ON(1); /* we need a WARN() */
783− }
788+ opts1 |= eor | len | FirstFrag | LastFrag;
784789
785− txd->opts1 = cpu_to_le32(flags);
790+ txd->opts1 = cpu_to_le32(opts1);
786791 wmb();
787792
788793 cp->tx_skb[entry] = skb;
789− entry = NEXT_TX(entry);
794+ cp->tx_opts[entry] = opts1;
795+ netif_dbg(cp, tx_queued, cp->dev, "tx queued, slot %d, skblen %d\n",
796+ entry, skb->len);
790797 } else {
791798 struct cp_desc *txd;
792− u32 first_len, first_eor;
799+ u32 first_len, first_eor, ctrl;
793800 dma_addr_t first_mapping;
794801 int frag, first_entry = entry;
795− const struct iphdr *ip = ip_hdr(skb);
796802
797803 /* We must give this initial chunk to the device last.
798804 * Otherwise we could race with the device.
@@ -805,14 +811,14 @@ static netdev_tx_t cp_start_xmit (struct sk_buff *skb, · 6 unmodified lines
805811 goto out_dma_error;
806812
807813 cp->tx_skb[entry] = skb;
808− entry = NEXT_TX(entry);
809814
810815 for (frag = 0; frag < skb_shinfo(skb)->nr_frags; frag++) {
811816 const skb_frag_t *this_frag = &skb_shinfo(skb)->frags[frag];
812817 u32 len;
813− u32 ctrl;
814818 dma_addr_t mapping;
815819
820+ entry = NEXT_TX(entry);
821+
816822 len = skb_frag_size(this_frag);
817823 mapping = dma_map_single(&cp->pdev->dev,
818824 skb_frag_address(this_frag),
@@ -824,19 +830,7 @@ static netdev_tx_t cp_start_xmit (struct sk_buff *skb, · 5 unmodified lines
824830
825831 eor = (entry == (CP_TX_RING_SIZE - 1)) ? RingEnd : 0;
826832
827− ctrl = eor | len | DescOwn;
828−
829− if (mss)
830− ctrl |= LargeSend |
831− ((mss & MSSMask) << MSSShift);
832− else if (skb->ip_summed == CHECKSUM_PARTIAL) {
833− if (ip->protocol == IPPROTO_TCP)
834− ctrl |= IPCS | TCPCS;
835− else if (ip->protocol == IPPROTO_UDP)
836− ctrl |= IPCS | UDPCS;
837− else
838− BUG();
839− }
833+ ctrl = opts1 | eor | len;
840834
841835 if (frag == skb_shinfo(skb)->nr_frags - 1)
842836 ctrl |= LastFrag;
@@ -849,8 +843,8 @@ static netdev_tx_t cp_start_xmit (struct sk_buff *skb, · 6 unmodified lines
849843 txd->opts1 = cpu_to_le32(ctrl);
850844 wmb();
851845
846+ cp->tx_opts[entry] = ctrl;
852847 cp->tx_skb[entry] = skb;
853− entry = NEXT_TX(entry);
854848 }
855849
856850 txd = &cp->tx_ring[first_entry];
@@ -858,27 +852,17 @@ static netdev_tx_t cp_start_xmit (struct sk_buff *skb, · 1 unmodified line
858852 txd->addr = cpu_to_le64(first_mapping);
859853 wmb();
860854
861− if (skb->ip_summed == CHECKSUM_PARTIAL) {
862− if (ip->protocol == IPPROTO_TCP)
863− txd->opts1 = cpu_to_le32(first_eor | first_len |
864− FirstFrag | DescOwn |
865− IPCS | TCPCS);
866− else if (ip->protocol == IPPROTO_UDP)
867− txd->opts1 = cpu_to_le32(first_eor | first_len |
868− FirstFrag | DescOwn |
869− IPCS | UDPCS);
870− else
871− BUG();
872− } else
873− txd->opts1 = cpu_to_le32(first_eor | first_len |
874− FirstFrag | DescOwn);
855+ ctrl = opts1 | first_eor | first_len | FirstFrag;
856+ txd->opts1 = cpu_to_le32(ctrl);
875857 wmb();
858+
859+ cp->tx_opts[first_entry] = ctrl;
860+ netif_dbg(cp, tx_queued, cp->dev, "tx queued, slots %d-%d, skblen %d\n",
861+ first_entry, entry, skb->len);
876862 }
877− cp->tx_head = entry;
863+ cp->tx_head = NEXT_TX(entry);
878864
879865 netdev_sent_queue(dev, skb->len);
880− netif_dbg(cp, tx_queued, cp->dev, "tx queued, slot %d, skblen %d\n",
881− entry, skb->len);
882866 if (TX_BUFFS_AVAIL(cp) <= (MAX_SKB_FRAGS + 1))
883867 netif_stop_queue(dev);
884868
@@ -1115,6 +1099,7 @@ static int cp_init_rings (struct cp_private *cp) · 230 unmodified lines
11151099 {
11161100 memset(cp->tx_ring, 0, sizeof(struct cp_desc) * CP_TX_RING_SIZE);
11171101 cp->tx_ring[CP_TX_RING_SIZE - 1].opts1 = cpu_to_le32(RingEnd);
1102+ memset(cp->tx_opts, 0, sizeof(cp->tx_opts));
11181103
11191104 cp_init_rings_index(cp);
11201105
@@ -1151,7 +1136,7 @@ static void cp_clean_rings (struct cp_private *cp) · 30 unmodified lines
11511136 desc = cp->rx_ring + i;
11521137 dma_unmap_single(&cp->pdev->dev,le64_to_cpu(desc->addr),
11531138 cp->rx_buf_sz, PCI_DMA_FROMDEVICE);
1154− dev_kfree_skb(cp->rx_skb[i]);
1139+ dev_kfree_skb_any(cp->rx_skb[i]);
11551140 }
11561141 }
11571142
@@ -1164,7 +1149,7 @@ static void cp_clean_rings (struct cp_private *cp) · 6 unmodified lines
11641149 le32_to_cpu(desc->opts1) & 0xffff,
11651150 PCI_DMA_TODEVICE);
11661151 if (le32_to_cpu(desc->opts1) & LastFrag)
1167− dev_kfree_skb(skb);
1152+ dev_kfree_skb_any(skb);
11681153 cp->dev->stats.tx_dropped++;
11691154 }
11701155 }
@@ -1172,6 +1157,7 @@ static void cp_clean_rings (struct cp_private *cp) · 1 unmodified line
11721157
11731158 memset(cp->rx_ring, 0, sizeof(struct cp_desc) * CP_RX_RING_SIZE);
11741159 memset(cp->tx_ring, 0, sizeof(struct cp_desc) * CP_TX_RING_SIZE);
1160+ memset(cp->tx_opts, 0, sizeof(cp->tx_opts));
11751161
11761162 memset(cp->rx_skb, 0, sizeof(struct sk_buff *) * CP_RX_RING_SIZE);
11771163 memset(cp->tx_skb, 0, sizeof(struct sk_buff *) * CP_TX_RING_SIZE);
@@ -1249,7 +1235,7 @@ static void cp_tx_timeout(struct net_device *dev) · 71 unmodified lines
12491235 {
12501236 struct cp_private *cp = netdev_priv(dev);
12511237 unsigned long flags;
1252− int rc;
1238+ int rc, i;
12531239
12541240 netdev_warn(dev, "Transmit timeout, status %2x %4x %4x %4x\n",
12551241 cpr8(Cmd), cpr16(CpCmd),
@@ -1257,13 +1243,26 @@ static void cp_tx_timeout(struct net_device *dev) · 1 unmodified line
12571243
12581244 spin_lock_irqsave(&cp->lock, flags);
12591245
1246+ netif_dbg(cp, tx_err, cp->dev, "TX ring head %d tail %d desc %x\n",
1247+ cp->tx_head, cp->tx_tail, cpr16(TxDmaOkLowDesc));
1248+ for (i = 0; i < CP_TX_RING_SIZE; i++) {
1249+ netif_dbg(cp, tx_err, cp->dev,
1250+ "TX slot %d @%p: %08x (%08x) %08x %llx %p\n",
1251+ i, &cp->tx_ring[i], le32_to_cpu(cp->tx_ring[i].opts1),
1252+ cp->tx_opts[i], le32_to_cpu(cp->tx_ring[i].opts2),
1253+ le64_to_cpu(cp->tx_ring[i].addr),
1254+ cp->tx_skb[i]);
1255+ }
1256+
12601257 cp_stop_hw(cp);
12611258 cp_clean_rings(cp);
12621259 rc = cp_init_rings(cp);
12631260 cp_start_hw(cp);
1264− cp_enable_irq(cp);
1261+ __cp_set_rx_mode(dev);
1262+ cpw16_f(IntrMask, cp_norx_intr_mask);
12651263
12661264 netif_wake_queue(dev);
1265+ napi_schedule_irqoff(&cp->napi);
12671266
12681267 spin_unlock_irqrestore(&cp->lock, flags);
12691268 }
drivers/net/ethernet/realtek/r8169.c+1−1
@@ -6081,7 +6081,7 @@ static void rtl_hw_start_8168h_1(struct rtl8169_private *tp) · 6080 unmodified lines
60816081 {
60826082 void __iomem *ioaddr = tp->mmio_addr;
60836083 struct pci_dev *pdev = tp->pci_dev;
6084− u16 rg_saw_cnt;
6084+ int rg_saw_cnt;
60856085 u32 data;
60866086 static const struct ephy_info e_info_8168h_1[] = {
60876087 { 0x1e, 0x0800, 0x0001 },
drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c+8−3
@@ -161,11 +161,16 @@ int stmmac_mdio_reset(struct mii_bus *bus) · 160 unmodified lines
161161
162162 if (!gpio_request(reset_gpio, "mdio-reset")) {
163163 gpio_direction_output(reset_gpio, active_low ? 1 : 0);
164− udelay(data->delays[0]);
164+ if (data->delays[0])
165+ msleep(DIV_ROUND_UP(data->delays[0], 1000));
166+
165167 gpio_set_value(reset_gpio, active_low ? 0 : 1);
166− udelay(data->delays[1]);
168+ if (data->delays[1])
169+ msleep(DIV_ROUND_UP(data->delays[1], 1000));
170+
167171 gpio_set_value(reset_gpio, active_low ? 1 : 0);
168− udelay(data->delays[2]);
172+ if (data->delays[2])
173+ msleep(DIV_ROUND_UP(data->delays[2], 1000));
169174 }
170175 }
171176 #endif
drivers/net/ethernet/sun/sunvnet.c+11−6
@@ -1756,7 +1756,8 @@ static const struct net_device_ops vnet_ops = { · 1755 unmodified lines
17561756 #endif
17571757 };
17581758
1759−static struct vnet *vnet_new(const u64 *local_mac)
1759+static struct vnet *vnet_new(const u64 *local_mac,
1760+ struct vio_dev *vdev)
17601761 {
17611762 struct net_device *dev;
17621763 struct vnet *vp;
@@ -1790,6 +1791,8 @@ static struct vnet *vnet_new(const u64 *local_mac) · 27 unmodified lines
17901791 NETIF_F_HW_CSUM | NETIF_F_SG;
17911792 dev->features = dev->hw_features;
17921793
1794+ SET_NETDEV_DEV(dev, &vdev->dev);
1795+
17931796 err = register_netdev(dev);
17941797 if (err) {
17951798 pr_err("Cannot register net device, aborting\n");
@@ -1808,7 +1811,8 @@ err_out_free_dev: · 12 unmodified lines
18081811 return ERR_PTR(err);
18091812 }
18101813
1811−static struct vnet *vnet_find_or_create(const u64 *local_mac)
1814+static struct vnet *vnet_find_or_create(const u64 *local_mac,
1815+ struct vio_dev *vdev)
18121816 {
18131817 struct vnet *iter, *vp;
18141818
@@ -1821,7 +1825,7 @@ static struct vnet *vnet_find_or_create(const u64 *local_mac) · 6 unmodified lines
18211825 }
18221826 }
18231827 if (!vp)
1824− vp = vnet_new(local_mac);
1828+ vp = vnet_new(local_mac, vdev);
18251829 mutex_unlock(&vnet_list_mutex);
18261830
18271831 return vp;
@@ -1848,7 +1852,8 @@ static void vnet_cleanup(void) · 20 unmodified lines
18481852 static const char *local_mac_prop = "local-mac-address";
18491853
18501854 static struct vnet *vnet_find_parent(struct mdesc_handle *hp,
1851− u64 port_node)
1855+ u64 port_node,
1856+ struct vio_dev *vdev)
18521857 {
18531858 const u64 *local_mac = NULL;
18541859 u64 a;
@@ -1869,7 +1874,7 @@ static struct vnet *vnet_find_parent(struct mdesc_handle *hp, · 14 unmodified lines
18691874 if (!local_mac)
18701875 return ERR_PTR(-ENODEV);
18711876
1872− return vnet_find_or_create(local_mac);
1877+ return vnet_find_or_create(local_mac, vdev);
18731878 }
18741879
18751880 static struct ldc_channel_config vnet_ldc_cfg = {
@@ -1923,7 +1928,7 @@ static int vnet_port_probe(struct vio_dev *vdev, const struct vio_device_id *id) · 47 unmodified lines
19231928
19241929 hp = mdesc_grab();
19251930
1926− vp = vnet_find_parent(hp, vdev->mp);
1931+ vp = vnet_find_parent(hp, vdev->mp, vdev);
19271932 if (IS_ERR(vp)) {
19281933 pr_err("Cannot find port parent vnet\n");
19291934 err = PTR_ERR(vp);
drivers/net/ethernet/ti/netcp_core.c+35−39
@@ -291,13 +291,6 @@ static int netcp_module_probe(struct netcp_device *netcp_device, · 290 unmodified lines
291291 interface_list) {
292292 struct netcp_intf_modpriv *intf_modpriv;
293293
294− /* If interface not registered then register now */
295− if (!netcp_intf->netdev_registered)
296− ret = netcp_register_interface(netcp_intf);
297−
298− if (ret)
299− return -ENODEV;
300−
301294 intf_modpriv = devm_kzalloc(dev, sizeof(*intf_modpriv),
302295 GFP_KERNEL);
303296 if (!intf_modpriv)
@@ -306,6 +299,11 @@ static int netcp_module_probe(struct netcp_device *netcp_device, · 2 unmodified lines
306299 interface = of_parse_phandle(netcp_intf->node_interface,
307300 module->name, 0);
308301
302+ if (!interface) {
303+ devm_kfree(dev, intf_modpriv);
304+ continue;
305+ }
306+
309307 intf_modpriv->netcp_priv = netcp_intf;
310308 intf_modpriv->netcp_module = module;
311309 list_add_tail(&intf_modpriv->intf_list,
@@ -323,6 +321,18 @@ static int netcp_module_probe(struct netcp_device *netcp_device, · 11 unmodified lines
323321 continue;
324322 }
325323 }
324+
325+ /* Now register the interface with netdev */
326+ list_for_each_entry(netcp_intf,
327+ &netcp_device->interface_head,
328+ interface_list) {
329+ /* If interface not registered then register now */
330+ if (!netcp_intf->netdev_registered) {
331+ ret = netcp_register_interface(netcp_intf);
332+ if (ret)
333+ return -ENODEV;
334+ }
335+ }
326336 return 0;
327337 }
328338
@@ -357,7 +367,6 @@ int netcp_register_module(struct netcp_module *module) · 28 unmodified lines
357367 if (ret < 0)
358368 goto fail;
359369 }
360−
361370 mutex_unlock(&netcp_modules_lock);
362371 return 0;
363372
@@ -796,7 +805,7 @@ static void netcp_rxpool_free(struct netcp_intf *netcp) · 432 unmodified lines
796805 netcp->rx_pool = NULL;
797806 }
798807
799−static void netcp_allocate_rx_buf(struct netcp_intf *netcp, int fdq)
808+static int netcp_allocate_rx_buf(struct netcp_intf *netcp, int fdq)
800809 {
801810 struct knav_dma_desc *hwdesc;
802811 unsigned int buf_len, dma_sz;
@@ -810,7 +819,7 @@ static void netcp_allocate_rx_buf(struct netcp_intf *netcp, int fdq) · 7 unmodified lines
810819 hwdesc = knav_pool_desc_get(netcp->rx_pool);
811820 if (IS_ERR_OR_NULL(hwdesc)) {
812821 dev_dbg(netcp->ndev_dev, "out of rx pool desc\n");
813− return;
822+ return -ENOMEM;
814823 }
815824
816825 if (likely(fdq == 0)) {
@@ -862,25 +871,26 @@ static void netcp_allocate_rx_buf(struct netcp_intf *netcp, int fdq) · 45 unmodified lines
862871 knav_pool_desc_map(netcp->rx_pool, hwdesc, sizeof(*hwdesc), &dma,
863872 &dma_sz);
864873 knav_queue_push(netcp->rx_fdq[fdq], dma, sizeof(*hwdesc), 0);
865− return;
874+ return 0;
866875
867876 fail:
868877 knav_pool_desc_put(netcp->rx_pool, hwdesc);
878+ return -ENOMEM;
869879 }
870880
871881 /* Refill Rx FDQ with descriptors & attached buffers */
872882 static void netcp_rxpool_refill(struct netcp_intf *netcp)
873883 {
874884 u32 fdq_deficit[KNAV_DMA_FDQ_PER_CHAN] = {0};
875− int i;
885+ int i, ret = 0;
876886
877887 /* Calculate the FDQ deficit and refill */
878888 for (i = 0; i < KNAV_DMA_FDQ_PER_CHAN && netcp->rx_fdq[i]; i++) {
879889 fdq_deficit[i] = netcp->rx_queue_depths[i] -
880890 knav_queue_get_count(netcp->rx_fdq[i]);
881891
882− while (fdq_deficit[i]--)
883− netcp_allocate_rx_buf(netcp, i);
892+ while (fdq_deficit[i]-- && !ret)
893+ ret = netcp_allocate_rx_buf(netcp, i);
884894 } /* end for fdqs */
885895 }
886896
@@ -893,12 +903,12 @@ static int netcp_rx_poll(struct napi_struct *napi, int budget) · 6 unmodified lines
893903
894904 packets = netcp_process_rx_packets(netcp, budget);
895905
906+ netcp_rxpool_refill(netcp);
896907 if (packets < budget) {
897908 napi_complete(&netcp->rx_napi);
898909 knav_queue_enable_notify(netcp->rx_queue);
899910 }
900911
901− netcp_rxpool_refill(netcp);
902912 return packets;
903913 }
904914
@@ -1384,7 +1394,6 @@ static void netcp_addr_sweep_del(struct netcp_intf *netcp) · 479 unmodified lines
13841394 continue;
13851395 dev_dbg(netcp->ndev_dev, "deleting address %pM, type %x\n",
13861396 naddr->addr, naddr->type);
1387− mutex_lock(&netcp_modules_lock);
13881397 for_each_module(netcp, priv) {
13891398 module = priv->netcp_module;
13901399 if (!module->del_addr)
@@ -1393,7 +1402,6 @@ static void netcp_addr_sweep_del(struct netcp_intf *netcp) · 2 unmodified lines
13931402 naddr);
13941403 WARN_ON(error);
13951404 }
1396− mutex_unlock(&netcp_modules_lock);
13971405 netcp_addr_del(netcp, naddr);
13981406 }
13991407 }
@@ -1410,7 +1418,7 @@ static void netcp_addr_sweep_add(struct netcp_intf *netcp) · 10 unmodified lines
14101418 continue;
14111419 dev_dbg(netcp->ndev_dev, "adding address %pM, type %x\n",
14121420 naddr->addr, naddr->type);
1413− mutex_lock(&netcp_modules_lock);
1421+
14141422 for_each_module(netcp, priv) {
14151423 module = priv->netcp_module;
14161424 if (!module->add_addr)
@@ -1418,7 +1426,6 @@ static void netcp_addr_sweep_add(struct netcp_intf *netcp) · 1 unmodified line
14181426 error = module->add_addr(priv->module_priv, naddr);
14191427 WARN_ON(error);
14201428 }
1421− mutex_unlock(&netcp_modules_lock);
14221429 }
14231430 }
14241431
@@ -1432,6 +1439,7 @@ static void netcp_set_rx_mode(struct net_device *ndev) · 7 unmodified lines
14321439 ndev->flags & IFF_ALLMULTI ||
14331440 netdev_mc_count(ndev) > NETCP_MAX_MCAST_ADDR);
14341441
1442+ spin_lock(&netcp->lock);
14351443 /* first clear all marks */
14361444 netcp_addr_clear_mark(netcp);
14371445
@@ -1450,6 +1458,7 @@ static void netcp_set_rx_mode(struct net_device *ndev) · 12 unmodified lines
14501458 /* finally sweep and callout into modules */
14511459 netcp_addr_sweep_del(netcp);
14521460 netcp_addr_sweep_add(netcp);
1461+ spin_unlock(&netcp->lock);
14531462 }
14541463
14551464 static void netcp_free_navigator_resources(struct netcp_intf *netcp)
@@ -1614,7 +1623,6 @@ static int netcp_ndo_open(struct net_device *ndev) · 158 unmodified lines
16141623 goto fail;
16151624 }
16161625
1617− mutex_lock(&netcp_modules_lock);
16181626 for_each_module(netcp, intf_modpriv) {
16191627 module = intf_modpriv->netcp_module;
16201628 if (module->open) {
@@ -1625,7 +1633,6 @@ static int netcp_ndo_open(struct net_device *ndev) · 4 unmodified lines
16251633 }
16261634 }
16271635 }
1628− mutex_unlock(&netcp_modules_lock);
16291636
16301637 napi_enable(&netcp->rx_napi);
16311638 napi_enable(&netcp->tx_napi);
@@ -1642,7 +1649,6 @@ fail_open: · 10 unmodified lines
16421649 if (module->close)
16431650 module->close(intf_modpriv->module_priv, ndev);
16441651 }
1645− mutex_unlock(&netcp_modules_lock);
16461652
16471653 fail:
16481654 netcp_free_navigator_resources(netcp);
@@ -1666,7 +1672,6 @@ static int netcp_ndo_stop(struct net_device *ndev) · 17 unmodified lines
16661672 napi_disable(&netcp->rx_napi);
16671673 napi_disable(&netcp->tx_napi);
16681674
1669− mutex_lock(&netcp_modules_lock);
16701675 for_each_module(netcp, intf_modpriv) {
16711676 module = intf_modpriv->netcp_module;
16721677 if (module->close) {
@@ -1675,7 +1680,6 @@ static int netcp_ndo_stop(struct net_device *ndev) · 2 unmodified lines
16751680 dev_err(netcp->ndev_dev, "Close failed\n");
16761681 }
16771682 }
1678− mutex_unlock(&netcp_modules_lock);
16791683
16801684 /* Recycle Rx descriptors from completion queue */
16811685 netcp_empty_rx_queue(netcp);
@@ -1703,7 +1707,6 @@ static int netcp_ndo_ioctl(struct net_device *ndev, · 21 unmodified lines
17031707 if (!netif_running(ndev))
17041708 return -EINVAL;
17051709
1706− mutex_lock(&netcp_modules_lock);
17071710 for_each_module(netcp, intf_modpriv) {
17081711 module = intf_modpriv->netcp_module;
17091712 if (!module->ioctl)
@@ -1719,7 +1722,6 @@ static int netcp_ndo_ioctl(struct net_device *ndev, · 9 unmodified lines
17191722 }
17201723
17211724 out:
1722− mutex_unlock(&netcp_modules_lock);
17231725 return (ret == 0) ? 0 : err;
17241726 }
17251727
@@ -1754,11 +1756,12 @@ static int netcp_rx_add_vid(struct net_device *ndev, __be16 proto, u16 vid) · 28 unmodified lines
17541756 struct netcp_intf *netcp = netdev_priv(ndev);
17551757 struct netcp_intf_modpriv *intf_modpriv;
17561758 struct netcp_module *module;
1759+ unsigned long flags;
17571760 int err = 0;
17581761
17591762 dev_dbg(netcp->ndev_dev, "adding rx vlan id: %d\n", vid);
17601763
1761− mutex_lock(&netcp_modules_lock);
1764+ spin_lock_irqsave(&netcp->lock, flags);
17621765 for_each_module(netcp, intf_modpriv) {
17631766 module = intf_modpriv->netcp_module;
17641767 if ((module->add_vid) && (vid != 0)) {
@@ -1770,7 +1773,8 @@ static int netcp_rx_add_vid(struct net_device *ndev, __be16 proto, u16 vid) · 5 unmodified lines
17701773 }
17711774 }
17721775 }
1773− mutex_unlock(&netcp_modules_lock);
1776+ spin_unlock_irqrestore(&netcp->lock, flags);
1777+
17741778 return err;
17751779 }
17761780
@@ -1779,11 +1783,12 @@ static int netcp_rx_kill_vid(struct net_device *ndev, __be16 proto, u16 vid) · 2 unmodified lines
17791783 struct netcp_intf *netcp = netdev_priv(ndev);
17801784 struct netcp_intf_modpriv *intf_modpriv;
17811785 struct netcp_module *module;
1786+ unsigned long flags;
17821787 int err = 0;
17831788
17841789 dev_dbg(netcp->ndev_dev, "removing rx vlan id: %d\n", vid);
17851790
1786− mutex_lock(&netcp_modules_lock);
1791+ spin_lock_irqsave(&netcp->lock, flags);
17871792 for_each_module(netcp, intf_modpriv) {
17881793 module = intf_modpriv->netcp_module;
17891794 if (module->del_vid) {
@@ -1795,7 +1800,7 @@ static int netcp_rx_kill_vid(struct net_device *ndev, __be16 proto, u16 vid) · 5 unmodified lines
17951800 }
17961801 }
17971802 }
1798− mutex_unlock(&netcp_modules_lock);
1803+ spin_unlock_irqrestore(&netcp->lock, flags);
17991804 return err;
18001805 }
18011806
@@ -2040,7 +2045,6 @@ static int netcp_probe(struct platform_device *pdev) · 238 unmodified lines
20402045 struct device_node *child, *interfaces;
20412046 struct netcp_device *netcp_device;
20422047 struct device *dev = &pdev->dev;
2043− struct netcp_module *module;
20442048 int ret;
20452049
20462050 if (!node) {
@@ -2087,14 +2091,6 @@ static int netcp_probe(struct platform_device *pdev) · 40 unmodified lines
20872091 /* Add the device instance to the list */
20882092 list_add_tail(&netcp_device->device_list, &netcp_devices);
20892093
2090− /* Probe & attach any modules already registered */
2091− mutex_lock(&netcp_modules_lock);
2092− for_each_netcp_module(module) {
2093− ret = netcp_module_probe(netcp_device, module);
2094− if (ret < 0)
2095− dev_err(dev, "module(%s) probe failed\n", module->name);
2096− }
2097− mutex_unlock(&netcp_modules_lock);
20982094 return 0;
20992095
21002096 probe_quit_interface:
drivers/net/ethernet/ti/netcp_ethss.c+20−27
@@ -77,6 +77,7 @@ · 76 unmodified lines
7777 #define GBENU_ALE_OFFSET 0x1e000
7878 #define GBENU_HOST_PORT_NUM 0
7979 #define GBENU_NUM_ALE_ENTRIES 1024
80+#define GBENU_SGMII_MODULE_SIZE 0x100
8081
8182 /* 10G Ethernet SS defines */
8283 #define XGBE_MODULE_NAME "netcp-xgbe"
@@ -149,8 +150,8 @@ · 66 unmodified lines
149150 #define XGBE_STATS2_MODULE 2
150151
151152 /* s: 0-based slave_port */
152−#define SGMII_BASE(s) \
153− (((s) < 2) ? gbe_dev->sgmii_port_regs : gbe_dev->sgmii_port34_regs)
153+#define SGMII_BASE(d, s) \
154+ (((s) < 2) ? (d)->sgmii_port_regs : (d)->sgmii_port34_regs)
154155
155156 #define GBE_TX_QUEUE 648
156157 #define GBE_TXHOOK_ORDER 0
@@ -1997,13 +1998,8 @@ static void netcp_ethss_update_link_state(struct gbe_priv *gbe_dev, · 1840 unmodified lines
19971998 return;
19981999
19992000 if (!SLAVE_LINK_IS_XGMII(slave)) {
2000− if (gbe_dev->ss_version == GBE_SS_VERSION_14)
2001− sgmii_link_state =
2002− netcp_sgmii_get_port_link(SGMII_BASE(sp), sp);
2003− else
2004− sgmii_link_state =
2005− netcp_sgmii_get_port_link(
2006− gbe_dev->sgmii_port_regs, sp);
2001+ sgmii_link_state =
2002+ netcp_sgmii_get_port_link(SGMII_BASE(gbe_dev, sp), sp);
20072003 }
20082004
20092005 phy_link_state = gbe_phy_link_status(slave);
@@ -2100,17 +2096,11 @@ static void gbe_port_config(struct gbe_priv *gbe_dev, struct gbe_slave *slave, · 90 unmodified lines
21002096 static void gbe_sgmii_rtreset(struct gbe_priv *priv,
21012097 struct gbe_slave *slave, bool set)
21022098 {
2103− void __iomem *sgmii_port_regs;
2104−
21052099 if (SLAVE_LINK_IS_XGMII(slave))
21062100 return;
21072101
2108− if ((priv->ss_version == GBE_SS_VERSION_14) && (slave->slave_num >= 2))
2109− sgmii_port_regs = priv->sgmii_port34_regs;
2110− else
2111− sgmii_port_regs = priv->sgmii_port_regs;
2112−
2113− netcp_sgmii_rtreset(sgmii_port_regs, slave->slave_num, set);
2102+ netcp_sgmii_rtreset(SGMII_BASE(priv, slave->slave_num),
2103+ slave->slave_num, set);
21142104 }
21152105
21162106 static void gbe_slave_stop(struct gbe_intf *intf)
@@ -2136,17 +2126,12 @@ static void gbe_slave_stop(struct gbe_intf *intf) · 19 unmodified lines
21362126
21372127 static void gbe_sgmii_config(struct gbe_priv *priv, struct gbe_slave *slave)
21382128 {
2139− void __iomem *sgmii_port_regs;
2140−
2141− sgmii_port_regs = priv->sgmii_port_regs;
2142− if ((priv->ss_version == GBE_SS_VERSION_14) && (slave->slave_num >= 2))
2143− sgmii_port_regs = priv->sgmii_port34_regs;
2129+ if (SLAVE_LINK_IS_XGMII(slave))
2130+ return;
21442131
2145− if (!SLAVE_LINK_IS_XGMII(slave)) {
2146− netcp_sgmii_reset(sgmii_port_regs, slave->slave_num);
2147− netcp_sgmii_config(sgmii_port_regs, slave->slave_num,
2148− slave->link_interface);
2149− }
2132+ netcp_sgmii_reset(SGMII_BASE(priv, slave->slave_num), slave->slave_num);
2133+ netcp_sgmii_config(SGMII_BASE(priv, slave->slave_num), slave->slave_num,
2134+ slave->link_interface);
21502135 }
21512136
21522137 static int gbe_slave_open(struct gbe_intf *gbe_intf)
@@ -2997,6 +2982,14 @@ static int set_gbenu_ethss_priv(struct gbe_priv *gbe_dev, · 844 unmodified lines
29972982 gbe_dev->switch_regs = regs;
29982983
29992984 gbe_dev->sgmii_port_regs = gbe_dev->ss_regs + GBENU_SGMII_MODULE_OFFSET;
2985+
2986+ /* Although sgmii modules are mem mapped to one contiguous
2987+ * region on GBENU devices, setting sgmii_port34_regs allows
2988+ * consistent code when accessing sgmii api
2989+ */
2990+ gbe_dev->sgmii_port34_regs = gbe_dev->sgmii_port_regs +
2991+ (2 * GBENU_SGMII_MODULE_SIZE);
2992+
30002993 gbe_dev->host_port_regs = gbe_dev->switch_regs + GBENU_HOST_PORT_OFFSET;
30012994
30022995 for (i = 0; i < (gbe_dev->max_num_ports); i++)
drivers/net/ethernet/via/Kconfig+1−1
@@ -17,7 +17,7 @@ if NET_VENDOR_VIA · 16 unmodified lines
1717
1818 config VIA_RHINE
1919 tristate "VIA Rhine support"
20− depends on (PCI || OF_IRQ)
20+ depends on PCI || (OF_IRQ && GENERIC_PCI_IOMAP)
2121 depends on HAS_DMA
2222 select CRC32
2323 select MII
drivers/net/ethernet/xilinx/xilinx_emaclite.c+2−0
@@ -828,6 +828,8 @@ static int xemaclite_mdio_setup(struct net_local *lp, struct device *dev) · 827 unmodified lines
828828 if (!phydev)
829829 dev_info(dev,
830830 "MDIO of the phy is not registered yet\n");
831+ else
832+ put_device(&phydev->dev);
831833 return 0;
832834 }
833835
drivers/net/fjes/fjes_hw.c+4−4
@@ -1011,11 +1011,11 @@ static void fjes_hw_update_zone_task(struct work_struct *work) · 1010 unmodified lines
10111011 set_bit(epidx, &irq_bit);
10121012 break;
10131013 }
1014− }
1015−
1016− hw->ep_shm_info[epidx].es_status = info[epidx].es_status;
1017− hw->ep_shm_info[epidx].zone = info[epidx].zone;
10181014
1015+ hw->ep_shm_info[epidx].es_status =
1016+ info[epidx].es_status;
1017+ hw->ep_shm_info[epidx].zone = info[epidx].zone;
1018+ }
10191019 break;
10201020 }
10211021
drivers/net/geneve.c+14−18
@@ -126,6 +126,8 @@ static void geneve_rx(struct geneve_sock *gs, struct sk_buff *skb) · 125 unmodified lines
126126 __be32 addr;
127127 int err;
128128
129+ iph = ip_hdr(skb); /* outer IP header... */
130+
129131 if (gs->collect_md) {
130132 static u8 zero_vni[3];
131133
@@ -133,7 +135,6 @@ static void geneve_rx(struct geneve_sock *gs, struct sk_buff *skb) · 1 unmodified line
133135 addr = 0;
134136 } else {
135137 vni = gnvh->vni;
136− iph = ip_hdr(skb); /* Still outer IP header... */
137138 addr = iph->saddr;
138139 }
139140
@@ -178,7 +179,6 @@ static void geneve_rx(struct geneve_sock *gs, struct sk_buff *skb) · 38 unmodified lines
178179
179180 skb_reset_network_header(skb);
180181
181− iph = ip_hdr(skb); /* Now inner IP header... */
182182 err = IP_ECN_decapsulate(iph, skb);
183183
184184 if (unlikely(err)) {
@@ -626,6 +626,7 @@ static netdev_tx_t geneve_xmit(struct sk_buff *skb, struct net_device *dev) · 441 unmodified lines
626626 struct geneve_sock *gs = geneve->sock;
627627 struct ip_tunnel_info *info = NULL;
628628 struct rtable *rt = NULL;
629+ const struct iphdr *iip; /* interior IP header */
629630 struct flowi4 fl4;
630631 __u8 tos, ttl;
631632 __be16 sport;
@@ -653,6 +654,8 @@ static netdev_tx_t geneve_xmit(struct sk_buff *skb, struct net_device *dev) · 21 unmodified lines
653654 sport = udp_flow_src_port(geneve->net, skb, 1, USHRT_MAX, true);
654655 skb_reset_mac_header(skb);
655656
657+ iip = ip_hdr(skb);
658+
656659 if (info) {
657660 const struct ip_tunnel_key *key = &info->key;
658661 u8 *opts = NULL;
@@ -668,19 +671,16 @@ static netdev_tx_t geneve_xmit(struct sk_buff *skb, struct net_device *dev) · 9 unmodified lines
668671 if (unlikely(err))
669672 goto err;
670673
671− tos = key->tos;
674+ tos = ip_tunnel_ecn_encap(key->tos, iip, skb);
672675 ttl = key->ttl;
673676 df = key->tun_flags & TUNNEL_DONT_FRAGMENT ? htons(IP_DF) : 0;
674677 } else {
675− const struct iphdr *iip; /* interior IP header */
676−
677678 udp_csum = false;
678679 err = geneve_build_skb(rt, skb, 0, geneve->vni,
679680 0, NULL, udp_csum);
680681 if (unlikely(err))
681682 goto err;
682683
683− iip = ip_hdr(skb);
684684 tos = ip_tunnel_ecn_encap(fl4.flowi4_tos, iip, skb);
685685 ttl = geneve->ttl;
686686 if (!ttl && IN_MULTICAST(ntohl(fl4.daddr)))
@@ -748,12 +748,8 @@ static void geneve_setup(struct net_device *dev) · 61 unmodified lines
748748 dev->features |= NETIF_F_RXCSUM;
749749 dev->features |= NETIF_F_GSO_SOFTWARE;
750750
751− dev->vlan_features = dev->features;
752− dev->features |= NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_STAG_TX;
753−
754751 dev->hw_features |= NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_RXCSUM;
755752 dev->hw_features |= NETIF_F_GSO_SOFTWARE;
756− dev->hw_features |= NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_STAG_TX;
757753
758754 netif_keep_dst(dev);
759755 dev->priv_flags |= IFF_LIVE_ADDR_CHANGE | IFF_NO_QUEUE;
@@ -819,7 +815,7 @@ static struct geneve_dev *geneve_find_dev(struct geneve_net *gn, · 59 unmodified lines
819815
820816 static int geneve_configure(struct net *net, struct net_device *dev,
821817 __be32 rem_addr, __u32 vni, __u8 ttl, __u8 tos,
822− __u16 dst_port, bool metadata)
818+ __be16 dst_port, bool metadata)
823819 {
824820 struct geneve_net *gn = net_generic(net, geneve_net_id);
825821 struct geneve_dev *t, *geneve = netdev_priv(dev);
@@ -844,10 +840,10 @@ static int geneve_configure(struct net *net, struct net_device *dev, · 18 unmodified lines
844840
845841 geneve->ttl = ttl;
846842 geneve->tos = tos;
847− geneve->dst_port = htons(dst_port);
843+ geneve->dst_port = dst_port;
848844 geneve->collect_md = metadata;
849845
850− t = geneve_find_dev(gn, htons(dst_port), rem_addr, geneve->vni,
846+ t = geneve_find_dev(gn, dst_port, rem_addr, geneve->vni,
851847 &tun_on_same_port, &tun_collect_md);
852848 if (t)
853849 return -EBUSY;
@@ -871,7 +867,7 @@ static int geneve_configure(struct net *net, struct net_device *dev, · 17 unmodified lines
871867 static int geneve_newlink(struct net *net, struct net_device *dev,
872868 struct nlattr *tb[], struct nlattr *data[])
873869 {
874− __u16 dst_port = GENEVE_UDP_PORT;
870+ __be16 dst_port = htons(GENEVE_UDP_PORT);
875871 __u8 ttl = 0, tos = 0;
876872 bool metadata = false;
877873 __be32 rem_addr;
@@ -890,7 +886,7 @@ static int geneve_newlink(struct net *net, struct net_device *dev, · 12 unmodified lines
890886 tos = nla_get_u8(data[IFLA_GENEVE_TOS]);
891887
892888 if (data[IFLA_GENEVE_PORT])
893− dst_port = nla_get_u16(data[IFLA_GENEVE_PORT]);
889+ dst_port = nla_get_be16(data[IFLA_GENEVE_PORT]);
894890
895891 if (data[IFLA_GENEVE_COLLECT_METADATA])
896892 metadata = true;
@@ -913,7 +909,7 @@ static size_t geneve_get_size(const struct net_device *dev) · 16 unmodified lines
913909 nla_total_size(sizeof(struct in_addr)) + /* IFLA_GENEVE_REMOTE */
914910 nla_total_size(sizeof(__u8)) + /* IFLA_GENEVE_TTL */
915911 nla_total_size(sizeof(__u8)) + /* IFLA_GENEVE_TOS */
916− nla_total_size(sizeof(__u16)) + /* IFLA_GENEVE_PORT */
912+ nla_total_size(sizeof(__be16)) + /* IFLA_GENEVE_PORT */
917913 nla_total_size(0) + /* IFLA_GENEVE_COLLECT_METADATA */
918914 0;
919915 }
@@ -935,7 +931,7 @@ static int geneve_fill_info(struct sk_buff *skb, const struct net_device *dev) · 15 unmodified lines
935931 nla_put_u8(skb, IFLA_GENEVE_TOS, geneve->tos))
936932 goto nla_put_failure;
937933
938− if (nla_put_u16(skb, IFLA_GENEVE_PORT, ntohs(geneve->dst_port)))
934+ if (nla_put_be16(skb, IFLA_GENEVE_PORT, geneve->dst_port))
939935 goto nla_put_failure;
940936
941937 if (geneve->collect_md) {
@@ -975,7 +971,7 @@ struct net_device *geneve_dev_create_fb(struct net *net, const char *name, · 33 unmodified lines
975971 if (IS_ERR(dev))
976972 return dev;
977973
978− err = geneve_configure(net, dev, 0, 0, 0, 0, dst_port, true);
974+ err = geneve_configure(net, dev, 0, 0, 0, 0, htons(dst_port), true);
979975 if (err) {
980976 free_netdev(dev);
981977 return ERR_PTR(err);
drivers/net/irda/ali-ircc.c+0−6
@@ -1031,7 +1031,6 @@ static void ali_ircc_fir_change_speed(struct ali_ircc_cb *priv, __u32 baud) · 1030 unmodified lines
10311031 static void ali_ircc_sir_change_speed(struct ali_ircc_cb *priv, __u32 speed)
10321032 {
10331033 struct ali_ircc_cb *self = priv;
1034− unsigned long flags;
10351034 int iobase;
10361035 int fcr; /* FIFO control reg */
10371036 int lcr; /* Line control reg */
@@ -1061,8 +1060,6 @@ static void ali_ircc_sir_change_speed(struct ali_ircc_cb *priv, __u32 speed) · 23 unmodified lines
10611060 /* Update accounting for new speed */
10621061 self->io.speed = speed;
10631062
1064− spin_lock_irqsave(&self->lock, flags);
1065−
10661063 divisor = 115200/speed;
10671064
10681065 fcr = UART_FCR_ENABLE_FIFO;
@@ -1089,9 +1086,6 @@ static void ali_ircc_sir_change_speed(struct ali_ircc_cb *priv, __u32 speed) · 20 unmodified lines
10891086 /* without this, the connection will be broken after come back from FIR speed,
10901087 but with this, the SIR connection is harder to established */
10911088 outb((UART_MCR_DTR | UART_MCR_RTS | UART_MCR_OUT2), iobase+UART_MCR);
1092−
1093− spin_unlock_irqrestore(&self->lock, flags);
1094−
10951089 }
10961090
10971091 static void ali_ircc_change_dongle_speed(struct ali_ircc_cb *priv, int speed)
drivers/net/macvtap.c+2−2
@@ -1111,10 +1111,10 @@ static long macvtap_ioctl(struct file *file, unsigned int cmd, · 1110 unmodified lines
11111111 return 0;
11121112
11131113 case TUNSETSNDBUF:
1114− if (get_user(u, up))
1114+ if (get_user(s, sp))
11151115 return -EFAULT;
11161116
1117− q->sk.sk_sndbuf = u;
1117+ q->sk.sk_sndbuf = s;
11181118 return 0;
11191119
11201120 case TUNGETVNETHDRSZ:
drivers/net/phy/fixed_phy.c+1−1
@@ -220,7 +220,7 @@ int fixed_phy_update_state(struct phy_device *phydev, · 219 unmodified lines
220220 struct fixed_mdio_bus *fmb = &platform_fmb;
221221 struct fixed_phy *fp;
222222
223− if (!phydev || !phydev->bus)
223+ if (!phydev || phydev->bus != fmb->mii_bus)
224224 return -EINVAL;
225225
226226 list_for_each_entry(fp, &fmb->phys, node) {
drivers/net/phy/marvell.c+9−0
@@ -785,6 +785,7 @@ static int marvell_read_status(struct phy_device *phydev) · 784 unmodified lines
785785 int adv;
786786 int err;
787787 int lpa;
788+ int lpagb;
788789 int status = 0;
789790
790791 /* Update the link, but return if there
@@ -802,10 +803,17 @@ static int marvell_read_status(struct phy_device *phydev) · 11 unmodified lines
802803 if (lpa < 0)
803804 return lpa;
804805
806+ lpagb = phy_read(phydev, MII_STAT1000);
807+ if (lpagb < 0)
808+ return lpagb;
809+
805810 adv = phy_read(phydev, MII_ADVERTISE);
806811 if (adv < 0)
807812 return adv;
808813
814+ phydev->lp_advertising = mii_stat1000_to_ethtool_lpa_t(lpagb) |
815+ mii_lpa_to_ethtool_lpa_t(lpa);
816+
809817 lpa &= adv;
810818
811819 if (status & MII_M1011_PHY_STATUS_FULLDUPLEX)
@@ -853,6 +861,7 @@ static int marvell_read_status(struct phy_device *phydev) · 41 unmodified lines
853861 phydev->speed = SPEED_10;
854862
855863 phydev->pause = phydev->asym_pause = 0;
864+ phydev->lp_advertising = 0;
856865 }
857866
858867 return 0;
drivers/net/phy/mdio-bcm-unimac.c+1−0
@@ -244,6 +244,7 @@ static const struct of_device_id unimac_mdio_ids[] = { · 243 unmodified lines
244244 { .compatible = "brcm,unimac-mdio", },
245245 { /* sentinel */ },
246246 };
247+MODULE_DEVICE_TABLE(of, unimac_mdio_ids);
247248
248249 static struct platform_driver unimac_mdio_driver = {
249250 .driver = {
drivers/net/phy/mdio-gpio.c+1−0
@@ -261,6 +261,7 @@ static const struct of_device_id mdio_gpio_of_match[] = { · 260 unmodified lines
261261 { .compatible = "virtual,mdio-gpio", },
262262 { /* sentinel */ }
263263 };
264+MODULE_DEVICE_TABLE(of, mdio_gpio_of_match);
264265
265266 static struct platform_driver mdio_gpio_driver = {
266267 .probe = mdio_gpio_probe,
drivers/net/phy/mdio-mux.c+13−6
@@ -113,18 +113,18 @@ int mdio_mux_init(struct device *dev, · 112 unmodified lines
113113 if (!parent_bus_node)
114114 return -ENODEV;
115115
116− parent_bus = of_mdio_find_bus(parent_bus_node);
117− if (parent_bus == NULL) {
118− ret_val = -EPROBE_DEFER;
119− goto err_parent_bus;
120− }
121−
122116 pb = devm_kzalloc(dev, sizeof(*pb), GFP_KERNEL);
123117 if (pb == NULL) {
124118 ret_val = -ENOMEM;
125119 goto err_parent_bus;
126120 }
127121
122+ parent_bus = of_mdio_find_bus(parent_bus_node);
123+ if (parent_bus == NULL) {
124+ ret_val = -EPROBE_DEFER;
125+ goto err_parent_bus;
126+ }
127+
128128 pb->switch_data = data;
129129 pb->switch_fn = switch_fn;
130130 pb->current_child = -1;
@@ -173,6 +173,10 @@ int mdio_mux_init(struct device *dev, · 42 unmodified lines
173173 dev_info(dev, "Version " DRV_VERSION "\n");
174174 return 0;
175175 }
176+
177+ /* balance the reference of_mdio_find_bus() took */
178+ put_device(&pb->mii_bus->dev);
179+
176180 err_parent_bus:
177181 of_node_put(parent_bus_node);
178182 return ret_val;
@@ -189,6 +193,9 @@ void mdio_mux_uninit(void *mux_handle) · 10 unmodified lines
189193 mdiobus_free(cb->mii_bus);
190194 cb = cb->next;
191195 }
196+
197+ /* balance the reference of_mdio_find_bus() in mdio_mux_init() took */
198+ put_device(&pb->mii_bus->dev);
192199 }
193200 EXPORT_SYMBOL_GPL(mdio_mux_uninit);
194201
drivers/net/phy/mdio_bus.c+21−10
@@ -167,7 +167,9 @@ static int of_mdio_bus_match(struct device *dev, const void *mdio_bus_np) · 166 unmodified lines
167167 * of_mdio_find_bus - Given an mii_bus node, find the mii_bus.
168168 * @mdio_bus_np: Pointer to the mii_bus.
169169 *
170− * Returns a pointer to the mii_bus, or NULL if none found.
170+ * Returns a reference to the mii_bus, or NULL if none found. The
171+ * embedded struct device will have its reference count incremented,
172+ * and this must be put once the bus is finished with.
171173 *
172174 * Because the association of a device_node and mii_bus is made via
173175 * of_mdiobus_register(), the mii_bus cannot be found before it is
@@ -234,15 +236,18 @@ static inline void of_mdiobus_link_phydev(struct mii_bus *mdio, · 60 unmodified lines
234236 #endif
235237
236238 /**
237− * mdiobus_register - bring up all the PHYs on a given bus and attach them to bus
239+ * __mdiobus_register - bring up all the PHYs on a given bus and attach them to bus
238240 * @bus: target mii_bus
241+ * @owner: module containing bus accessor functions
239242 *
240243 * Description: Called by a bus driver to bring up all the PHYs
241− * on a given bus, and attach them to the bus.
244+ * on a given bus, and attach them to the bus. Drivers should use
245+ * mdiobus_register() rather than __mdiobus_register() unless they
246+ * need to pass a specific owner module.
242247 *
243248 * Returns 0 on success or < 0 on error.
244249 */
245−int mdiobus_register(struct mii_bus *bus)
250+int __mdiobus_register(struct mii_bus *bus, struct module *owner)
246251 {
247252 int i, err;
248253
@@ -253,6 +258,7 @@ int mdiobus_register(struct mii_bus *bus) · 4 unmodified lines
253258 BUG_ON(bus->state != MDIOBUS_ALLOCATED &&
254259 bus->state != MDIOBUS_UNREGISTERED);
255260
261+ bus->owner = owner;
256262 bus->dev.parent = bus->parent;
257263 bus->dev.class = &mdio_bus_class;
258264 bus->dev.groups = NULL;
@@ -288,13 +294,16 @@ int mdiobus_register(struct mii_bus *bus) · 29 unmodified lines
288294
289295 error:
290296 while (--i >= 0) {
291− if (bus->phy_map[i])
292− device_unregister(&bus->phy_map[i]->dev);
297+ struct phy_device *phydev = bus->phy_map[i];
298+ if (phydev) {
299+ phy_device_remove(phydev);
300+ phy_device_free(phydev);
301+ }
293302 }
294303 device_del(&bus->dev);
295304 return err;
296305 }
297−EXPORT_SYMBOL(mdiobus_register);
306+EXPORT_SYMBOL(__mdiobus_register);
298307
299308 void mdiobus_unregister(struct mii_bus *bus)
300309 {
@@ -304,9 +313,11 @@ void mdiobus_unregister(struct mii_bus *bus) · 3 unmodified lines
304313 bus->state = MDIOBUS_UNREGISTERED;
305314
306315 for (i = 0; i < PHY_MAX_ADDR; i++) {
307− if (bus->phy_map[i])
308− device_unregister(&bus->phy_map[i]->dev);
309− bus->phy_map[i] = NULL;
316+ struct phy_device *phydev = bus->phy_map[i];
317+ if (phydev) {
318+ phy_device_remove(phydev);
319+ phy_device_free(phydev);
320+ }
310321 }
311322 device_del(&bus->dev);
312323 }
drivers/net/phy/phy_device.c+48−14
@@ -383,6 +383,24 @@ int phy_device_register(struct phy_device *phydev) · 382 unmodified lines
383383 }
384384 EXPORT_SYMBOL(phy_device_register);
385385
386+/**
387+ * phy_device_remove - Remove a previously registered phy device from the MDIO bus
388+ * @phydev: phy_device structure to remove
389+ *
390+ * This doesn't free the phy_device itself, it merely reverses the effects
391+ * of phy_device_register(). Use phy_device_free() to free the device
392+ * after calling this function.
393+ */
394+void phy_device_remove(struct phy_device *phydev)
395+{
396+ struct mii_bus *bus = phydev->bus;
397+ int addr = phydev->addr;
398+
399+ device_del(&phydev->dev);
400+ bus->phy_map[addr] = NULL;
401+}
402+EXPORT_SYMBOL(phy_device_remove);
403+
386404 /**
387405 * phy_find_first - finds the first PHY device on the bus
388406 * @bus: the target MII bus
@@ -578,14 +596,22 @@ EXPORT_SYMBOL(phy_init_hw); · 189 unmodified lines
578596 * generic driver is used. The phy_device is given a ptr to
579597 * the attaching device, and given a callback for link status
580598 * change. The phy_device is returned to the attaching driver.
599+ * This function takes a reference on the phy device.
581600 */
582601 int phy_attach_direct(struct net_device *dev, struct phy_device *phydev,
583602 u32 flags, phy_interface_t interface)
584603 {
604+ struct mii_bus *bus = phydev->bus;
585605 struct device *d = &phydev->dev;
586− struct module *bus_module;
587606 int err;
588607
608+ if (!try_module_get(bus->owner)) {
609+ dev_err(&dev->dev, "failed to get the bus module\n");
610+ return -EIO;
611+ }
612+
613+ get_device(d);
614+
589615 /* Assume that if there is no driver, that it doesn't
590616 * exist, and we should use the genphy driver.
591617 */
@@ -600,20 +626,13 @@ int phy_attach_direct(struct net_device *dev, struct phy_device *phydev, · 8 unmodified lines
600626 err = device_bind_driver(d);
601627
602628 if (err)
603− return err;
629+ goto error;
604630 }
605631
606632 if (phydev->attached_dev) {
607633 dev_err(&dev->dev, "PHY already attached\n");
608− return -EBUSY;
609− }
610−
611− /* Increment the bus module reference count */
612− bus_module = phydev->bus->dev.driver ?
613− phydev->bus->dev.driver->owner : NULL;
614− if (!try_module_get(bus_module)) {
615− dev_err(&dev->dev, "failed to get the bus module\n");
616− return -EIO;
634+ err = -EBUSY;
635+ goto error;
617636 }
618637
619638 phydev->attached_dev = dev;
@@ -636,6 +655,11 @@ int phy_attach_direct(struct net_device *dev, struct phy_device *phydev, · 16 unmodified lines
636655 phy_resume(phydev);
637656
638657 return err;
658+
659+error:
660+ put_device(d);
661+ module_put(bus->owner);
662+ return err;
639663 }
640664 EXPORT_SYMBOL(phy_attach_direct);
641665
@@ -677,14 +701,15 @@ EXPORT_SYMBOL(phy_attach); · 35 unmodified lines
677701 /**
678702 * phy_detach - detach a PHY device from its network device
679703 * @phydev: target phy_device struct
704+ *
705+ * This detaches the phy device from its network device and the phy
706+ * driver, and drops the reference count taken in phy_attach_direct().
680707 */
681708 void phy_detach(struct phy_device *phydev)
682709 {
710+ struct mii_bus *bus;
683711 int i;
684712
685− if (phydev->bus->dev.driver)
686− module_put(phydev->bus->dev.driver->owner);
687−
688713 phydev->attached_dev->phydev = NULL;
689714 phydev->attached_dev = NULL;
690715 phy_suspend(phydev);
@@ -700,6 +725,15 @@ void phy_detach(struct phy_device *phydev) · 9 unmodified lines
700725 break;
701726 }
702727 }
728+
729+ /*
730+ * The phydev might go away on the put_device() below, so avoid
731+ * a use-after-free bug by reading the underlying bus first.
732+ */
733+ bus = phydev->bus;
734+
735+ put_device(&phydev->dev);
736+ module_put(bus->owner);
703737 }
704738 EXPORT_SYMBOL(phy_detach);
705739
drivers/net/phy/vitesse.c+0−14
@@ -66,7 +66,6 @@ · 65 unmodified lines
6666 #define PHY_ID_VSC8244 0x000fc6c0
6767 #define PHY_ID_VSC8514 0x00070670
6868 #define PHY_ID_VSC8574 0x000704a0
69−#define PHY_ID_VSC8641 0x00070431
7069 #define PHY_ID_VSC8662 0x00070660
7170 #define PHY_ID_VSC8221 0x000fc550
7271 #define PHY_ID_VSC8211 0x000fc4b0
@@ -272,18 +271,6 @@ static struct phy_driver vsc82xx_driver[] = { · 199 unmodified lines
272271 .ack_interrupt = &vsc824x_ack_interrupt,
273272 .config_intr = &vsc82xx_config_intr,
274273 .driver = { .owner = THIS_MODULE,},
275−}, {
276− .phy_id = PHY_ID_VSC8641,
277− .name = "Vitesse VSC8641",
278− .phy_id_mask = 0x000ffff0,
279− .features = PHY_GBIT_FEATURES,
280− .flags = PHY_HAS_INTERRUPT,
281− .config_init = &vsc824x_config_init,
282− .config_aneg = &vsc82x4_config_aneg,
283− .read_status = &genphy_read_status,
284− .ack_interrupt = &vsc824x_ack_interrupt,
285− .config_intr = &vsc82xx_config_intr,
286− .driver = { .owner = THIS_MODULE,},
287274 }, {
288275 .phy_id = PHY_ID_VSC8662,
289276 .name = "Vitesse VSC8662",
@@ -331,7 +318,6 @@ static struct mdio_device_id __maybe_unused vitesse_tbl[] = { · 41 unmodified lines
331318 { PHY_ID_VSC8244, 0x000fffc0 },
332319 { PHY_ID_VSC8514, 0x000ffff0 },
333320 { PHY_ID_VSC8574, 0x000ffff0 },
334− { PHY_ID_VSC8641, 0x000ffff0 },
335321 { PHY_ID_VSC8662, 0x000ffff0 },
336322 { PHY_ID_VSC8221, 0x000ffff0 },
337323 { PHY_ID_VSC8211, 0x000ffff0 },
drivers/net/ppp/ppp_generic.c+3−1
@@ -2755,6 +2755,7 @@ static struct ppp *ppp_create_interface(struct net *net, int unit, · 2754 unmodified lines
27552755 */
27562756 dev_net_set(dev, net);
27572757
2758+ rtnl_lock();
27582759 mutex_lock(&pn->all_ppp_mutex);
27592760
27602761 if (unit < 0) {
@@ -2785,7 +2786,7 @@ static struct ppp *ppp_create_interface(struct net *net, int unit, · 24 unmodified lines
27852786 ppp->file.index = unit;
27862787 sprintf(dev->name, "ppp%d", unit);
27872788
2788− ret = register_netdev(dev);
2789+ ret = register_netdevice(dev);
27892790 if (ret != 0) {
27902791 unit_put(&pn->units_idr, unit);
27912792 netdev_err(ppp->dev, "PPP: couldn't register device %s (%d)\n",
@@ -2797,6 +2798,7 @@ static struct ppp *ppp_create_interface(struct net *net, int unit, · 5 unmodified lines
27972798
27982799 atomic_inc(&ppp_unit_count);
27992800 mutex_unlock(&pn->all_ppp_mutex);
2801+ rtnl_unlock();
28002802
28012803 *retp = 0;
28022804 return ppp;
drivers/net/usb/Kconfig+11−0
@@ -583,4 +583,15 @@ config USB_VL600 · 582 unmodified lines
583583
584584 http://ubuntuforums.org/showpost.php?p=10589647&postcount=17
585585
586+config USB_NET_CH9200
587+ tristate "QingHeng CH9200 USB ethernet support"
588+ depends on USB_USBNET
589+ select MII
590+ help
591+ Choose this option if you have a USB ethernet adapter with a QinHeng
592+ CH9200 chipset.
593+
594+ To compile this driver as a module, choose M here: the
595+ module will be called ch9200.
596+
586597 endif # USB_NET_DRIVERS
drivers/net/usb/Makefile+1−1
@@ -38,4 +38,4 @@ obj-$(CONFIG_USB_NET_HUAWEI_CDC_NCM) += huawei_cdc_ncm.o · 37 unmodified lines
3838 obj-$(CONFIG_USB_VL600) += lg-vl600.o
3939 obj-$(CONFIG_USB_NET_QMI_WWAN) += qmi_wwan.o
4040 obj-$(CONFIG_USB_NET_CDC_MBIM) += cdc_mbim.o
41−
41+obj-$(CONFIG_USB_NET_CH9200) += ch9200.o
drivers/net/usb/ch9200.c+432−0
@@ -0,0 +1,432 @@
1+/*
2+ * USB 10M/100M ethernet adapter
3+ *
4+ * This file is licensed under the terms of the GNU General Public License
5+ * version 2. This program is licensed "as is" without any warranty of any
6+ * kind, whether express or implied
7+ *
8+ */
9+
10+#include <linux/kernel.h>
11+#include <linux/module.h>
12+#include <linux/sched.h>
13+#include <linux/stddef.h>
14+#include <linux/init.h>
15+#include <linux/netdevice.h>
16+#include <linux/etherdevice.h>
17+#include <linux/ethtool.h>
18+#include <linux/mii.h>
19+#include <linux/usb.h>
20+#include <linux/crc32.h>
21+#include <linux/usb/usbnet.h>
22+#include <linux/slab.h>
23+
24+#define CH9200_VID 0x1A86
25+#define CH9200_PID_E092 0xE092
26+
27+#define CTRL_TIMEOUT_MS 1000
28+
29+#define CONTROL_TIMEOUT_MS 1000
30+
31+#define REQUEST_READ 0x0E
32+#define REQUEST_WRITE 0x0F
33+
34+/* Address space:
35+ * 00-63 : MII
36+ * 64-128: MAC
37+ *
38+ * Note: all accesses must be 16-bit
39+ */
40+
41+#define MAC_REG_CTRL 64
42+#define MAC_REG_STATUS 66
43+#define MAC_REG_INTERRUPT_MASK 68
44+#define MAC_REG_PHY_COMMAND 70
45+#define MAC_REG_PHY_DATA 72
46+#define MAC_REG_STATION_L 74
47+#define MAC_REG_STATION_M 76
48+#define MAC_REG_STATION_H 78
49+#define MAC_REG_HASH_L 80
50+#define MAC_REG_HASH_M1 82
51+#define MAC_REG_HASH_M2 84
52+#define MAC_REG_HASH_H 86
53+#define MAC_REG_THRESHOLD 88
54+#define MAC_REG_FIFO_DEPTH 90
55+#define MAC_REG_PAUSE 92
56+#define MAC_REG_FLOW_CONTROL 94
57+
58+/* Control register bits
59+ *
60+ * Note: bits 13 and 15 are reserved
61+ */
62+#define LOOPBACK (0x01 << 14)
63+#define BASE100X (0x01 << 12)
64+#define MBPS_10 (0x01 << 11)
65+#define DUPLEX_MODE (0x01 << 10)
66+#define PAUSE_FRAME (0x01 << 9)
67+#define PROMISCUOUS (0x01 << 8)
68+#define MULTICAST (0x01 << 7)
69+#define BROADCAST (0x01 << 6)
70+#define HASH (0x01 << 5)
71+#define APPEND_PAD (0x01 << 4)
72+#define APPEND_CRC (0x01 << 3)
73+#define TRANSMITTER_ACTION (0x01 << 2)
74+#define RECEIVER_ACTION (0x01 << 1)
75+#define DMA_ACTION (0x01 << 0)
76+
77+/* Status register bits
78+ *
79+ * Note: bits 7-15 are reserved
80+ */
81+#define ALIGNMENT (0x01 << 6)
82+#define FIFO_OVER_RUN (0x01 << 5)
83+#define FIFO_UNDER_RUN (0x01 << 4)
84+#define RX_ERROR (0x01 << 3)
85+#define RX_COMPLETE (0x01 << 2)
86+#define TX_ERROR (0x01 << 1)
87+#define TX_COMPLETE (0x01 << 0)
88+
89+/* FIFO depth register bits
90+ *
91+ * Note: bits 6 and 14 are reserved
92+ */
93+
94+#define ETH_TXBD (0x01 << 15)
95+#define ETN_TX_FIFO_DEPTH (0x01 << 8)
96+#define ETH_RXBD (0x01 << 7)
97+#define ETH_RX_FIFO_DEPTH (0x01 << 0)
98+
99+static int control_read(struct usbnet *dev,
100+ unsigned char request, unsigned short value,
101+ unsigned short index, void *data, unsigned short size,
102+ int timeout)
103+{
104+ unsigned char *buf = NULL;
105+ unsigned char request_type;
106+ int err = 0;
107+
108+ if (request == REQUEST_READ)
109+ request_type = (USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_OTHER);
110+ else
111+ request_type = (USB_DIR_IN | USB_TYPE_VENDOR |
112+ USB_RECIP_DEVICE);
113+
114+ netdev_dbg(dev->net, "Control_read() index=0x%02x size=%d\n",
115+ index, size);
116+
117+ buf = kmalloc(size, GFP_KERNEL);
118+ if (!buf) {
119+ err = -ENOMEM;
120+ goto err_out;
121+ }
122+
123+ err = usb_control_msg(dev->udev,
124+ usb_rcvctrlpipe(dev->udev, 0),
125+ request, request_type, value, index, buf, size,
126+ timeout);
127+ if (err == size)
128+ memcpy(data, buf, size);
129+ else if (err >= 0)
130+ err = -EINVAL;
131+ kfree(buf);
132+
133+ return err;
134+
135+err_out:
136+ return err;
137+}
138+
139+static int control_write(struct usbnet *dev, unsigned char request,
140+ unsigned short value, unsigned short index,
141+ void *data, unsigned short size, int timeout)
142+{
143+ unsigned char *buf = NULL;
144+ unsigned char request_type;
145+ int err = 0;
146+
147+ if (request == REQUEST_WRITE)
148+ request_type = (USB_DIR_OUT | USB_TYPE_VENDOR |
149+ USB_RECIP_OTHER);
150+ else
151+ request_type = (USB_DIR_OUT | USB_TYPE_VENDOR |
152+ USB_RECIP_DEVICE);
153+
154+ netdev_dbg(dev->net, "Control_write() index=0x%02x size=%d\n",
155+ index, size);
156+
157+ if (data) {
158+ buf = kmalloc(size, GFP_KERNEL);
159+ if (!buf) {
160+ err = -ENOMEM;
161+ goto err_out;
162+ }
163+ memcpy(buf, data, size);
164+ }
165+
166+ err = usb_control_msg(dev->udev,
167+ usb_sndctrlpipe(dev->udev, 0),
168+ request, request_type, value, index, buf, size,
169+ timeout);
170+ if (err >= 0 && err < size)
171+ err = -EINVAL;
172+ kfree(buf);
173+
174+ return 0;
175+
176+err_out:
177+ return err;
178+}
179+
180+static int ch9200_mdio_read(struct net_device *netdev, int phy_id, int loc)
181+{
182+ struct usbnet *dev = netdev_priv(netdev);
183+ unsigned char buff[2];
184+
185+ netdev_dbg(netdev, "ch9200_mdio_read phy_id:%02x loc:%02x\n",
186+ phy_id, loc);
187+
188+ if (phy_id != 0)
189+ return -ENODEV;
190+
191+ control_read(dev, REQUEST_READ, 0, loc * 2, buff, 0x02,
192+ CONTROL_TIMEOUT_MS);
193+
194+ return (buff[0] | buff[1] << 8);
195+}
196+
197+static void ch9200_mdio_write(struct net_device *netdev,
198+ int phy_id, int loc, int val)
199+{
200+ struct usbnet *dev = netdev_priv(netdev);
201+ unsigned char buff[2];
202+
203+ netdev_dbg(netdev, "ch9200_mdio_write() phy_id=%02x loc:%02x\n",
204+ phy_id, loc);
205+
206+ if (phy_id != 0)
207+ return;
208+
209+ buff[0] = (unsigned char)val;
210+ buff[1] = (unsigned char)(val >> 8);
211+
212+ control_write(dev, REQUEST_WRITE, 0, loc * 2, buff, 0x02,
213+ CONTROL_TIMEOUT_MS);
214+}
215+
216+static int ch9200_link_reset(struct usbnet *dev)
217+{
218+ struct ethtool_cmd ecmd;
219+
220+ mii_check_media(&dev->mii, 1, 1);
221+ mii_ethtool_gset(&dev->mii, &ecmd);
222+
223+ netdev_dbg(dev->net, "link_reset() speed:%d duplex:%d\n",
224+ ecmd.speed, ecmd.duplex);
225+
226+ return 0;
227+}
228+
229+static void ch9200_status(struct usbnet *dev, struct urb *urb)
230+{
231+ int link;
232+ unsigned char *buf;
233+
234+ if (urb->actual_length < 16)
235+ return;
236+
237+ buf = urb->transfer_buffer;
238+ link = !!(buf[0] & 0x01);
239+
240+ if (link) {
241+ netif_carrier_on(dev->net);
242+ usbnet_defer_kevent(dev, EVENT_LINK_RESET);
243+ } else {
244+ netif_carrier_off(dev->net);
245+ }
246+}
247+
248+static struct sk_buff *ch9200_tx_fixup(struct usbnet *dev, struct sk_buff *skb,
249+ gfp_t flags)
250+{
251+ int i = 0;
252+ int len = 0;
253+ int tx_overhead = 0;
254+
255+ tx_overhead = 0x40;
256+
257+ len = skb->len;
258+ if (skb_headroom(skb) < tx_overhead) {
259+ struct sk_buff *skb2;
260+
261+ skb2 = skb_copy_expand(skb, tx_overhead, 0, flags);
262+ dev_kfree_skb_any(skb);
263+ skb = skb2;
264+ if (!skb)
265+ return NULL;
266+ }
267+
268+ __skb_push(skb, tx_overhead);
269+ /* usbnet adds padding if length is a multiple of packet size
270+ * if so, adjust length value in header
271+ */
272+ if ((skb->len % dev->maxpacket) == 0)
273+ len++;
274+
275+ skb->data[0] = len;
276+ skb->data[1] = len >> 8;
277+ skb->data[2] = 0x00;
278+ skb->data[3] = 0x80;
279+
280+ for (i = 4; i < 48; i++)
281+ skb->data[i] = 0x00;
282+
283+ skb->data[48] = len;
284+ skb->data[49] = len >> 8;
285+ skb->data[50] = 0x00;
286+ skb->data[51] = 0x80;
287+
288+ for (i = 52; i < 64; i++)
289+ skb->data[i] = 0x00;
290+
291+ return skb;
292+}
293+
294+static int ch9200_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
295+{
296+ int len = 0;
297+ int rx_overhead = 0;
298+
299+ rx_overhead = 64;
300+
301+ if (unlikely(skb->len < rx_overhead)) {
302+ dev_err(&dev->udev->dev, "unexpected tiny rx frame\n");
303+ return 0;
304+ }
305+
306+ len = (skb->data[skb->len - 16] | skb->data[skb->len - 15] << 8);
307+ skb_trim(skb, len);
308+
309+ return 1;
310+}
311+
312+static int get_mac_address(struct usbnet *dev, unsigned char *data)
313+{
314+ int err = 0;
315+ unsigned char mac_addr[0x06];
316+ int rd_mac_len = 0;
317+
318+ netdev_dbg(dev->net, "get_mac_address:\n\tusbnet VID:%0x PID:%0x\n",
319+ dev->udev->descriptor.idVendor,
320+ dev->udev->descriptor.idProduct);
321+
322+ memset(mac_addr, 0, sizeof(mac_addr));
323+ rd_mac_len = control_read(dev, REQUEST_READ, 0,
324+ MAC_REG_STATION_L, mac_addr, 0x02,
325+ CONTROL_TIMEOUT_MS);
326+ rd_mac_len += control_read(dev, REQUEST_READ, 0, MAC_REG_STATION_M,
327+ mac_addr + 2, 0x02, CONTROL_TIMEOUT_MS);
328+ rd_mac_len += control_read(dev, REQUEST_READ, 0, MAC_REG_STATION_H,
329+ mac_addr + 4, 0x02, CONTROL_TIMEOUT_MS);
330+ if (rd_mac_len != ETH_ALEN)
331+ err = -EINVAL;
332+
333+ data[0] = mac_addr[5];
334+ data[1] = mac_addr[4];
335+ data[2] = mac_addr[3];
336+ data[3] = mac_addr[2];
337+ data[4] = mac_addr[1];
338+ data[5] = mac_addr[0];
339+
340+ return err;
341+}
342+
343+static int ch9200_bind(struct usbnet *dev, struct usb_interface *intf)
344+{
345+ int retval = 0;
346+ unsigned char data[2];
347+
348+ retval = usbnet_get_endpoints(dev, intf);
349+ if (retval)
350+ return retval;
351+
352+ dev->mii.dev = dev->net;
353+ dev->mii.mdio_read = ch9200_mdio_read;
354+ dev->mii.mdio_write = ch9200_mdio_write;
355+ dev->mii.reg_num_mask = 0x1f;
356+
357+ dev->mii.phy_id_mask = 0x1f;
358+
359+ dev->hard_mtu = dev->net->mtu + dev->net->hard_header_len;
360+ dev->rx_urb_size = 24 * 64 + 16;
361+ mii_nway_restart(&dev->mii);
362+
363+ data[0] = 0x01;
364+ data[1] = 0x0F;
365+ retval = control_write(dev, REQUEST_WRITE, 0, MAC_REG_THRESHOLD, data,
366+ 0x02, CONTROL_TIMEOUT_MS);
367+
368+ data[0] = 0xA0;
369+ data[1] = 0x90;
370+ retval = control_write(dev, REQUEST_WRITE, 0, MAC_REG_FIFO_DEPTH, data,
371+ 0x02, CONTROL_TIMEOUT_MS);
372+
373+ data[0] = 0x30;
374+ data[1] = 0x00;
375+ retval = control_write(dev, REQUEST_WRITE, 0, MAC_REG_PAUSE, data,
376+ 0x02, CONTROL_TIMEOUT_MS);
377+
378+ data[0] = 0x17;
379+ data[1] = 0xD8;
380+ retval = control_write(dev, REQUEST_WRITE, 0, MAC_REG_FLOW_CONTROL,
381+ data, 0x02, CONTROL_TIMEOUT_MS);
382+
383+ /* Undocumented register */
384+ data[0] = 0x01;
385+ data[1] = 0x00;
386+ retval = control_write(dev, REQUEST_WRITE, 0, 254, data, 0x02,
387+ CONTROL_TIMEOUT_MS);
388+
389+ data[0] = 0x5F;
390+ data[1] = 0x0D;
391+ retval = control_write(dev, REQUEST_WRITE, 0, MAC_REG_CTRL, data, 0x02,
392+ CONTROL_TIMEOUT_MS);
393+
394+ retval = get_mac_address(dev, dev->net->dev_addr);
395+
396+ return retval;
397+}
398+
399+static const struct driver_info ch9200_info = {
400+ .description = "CH9200 USB to Network Adaptor",
401+ .flags = FLAG_ETHER,
402+ .bind = ch9200_bind,
403+ .rx_fixup = ch9200_rx_fixup,
404+ .tx_fixup = ch9200_tx_fixup,
405+ .status = ch9200_status,
406+ .link_reset = ch9200_link_reset,
407+ .reset = ch9200_link_reset,
408+};
409+
410+static const struct usb_device_id ch9200_products[] = {
411+ {
412+ USB_DEVICE(0x1A86, 0xE092),
413+ .driver_info = (unsigned long)&ch9200_info,
414+ },
415+ {},
416+};
417+
418+MODULE_DEVICE_TABLE(usb, ch9200_products);
419+
420+static struct usb_driver ch9200_driver = {
421+ .name = "ch9200",
422+ .id_table = ch9200_products,
423+ .probe = usbnet_probe,
424+ .disconnect = usbnet_disconnect,
425+ .suspend = usbnet_suspend,
426+ .resume = usbnet_resume,
427+};
428+
429+module_usb_driver(ch9200_driver);
430+
431+MODULE_DESCRIPTION("QinHeng CH9200 USB Network device");
432+MODULE_LICENSE("GPL");
drivers/net/vrf.c+2−1
@@ -193,7 +193,8 @@ static netdev_tx_t vrf_process_v4_outbound(struct sk_buff *skb, · 192 unmodified lines
193193 .flowi4_oif = vrf_dev->ifindex,
194194 .flowi4_iif = LOOPBACK_IFINDEX,
195195 .flowi4_tos = RT_TOS(ip4h->tos),
196− .flowi4_flags = FLOWI_FLAG_ANYSRC | FLOWI_FLAG_VRFSRC,
196+ .flowi4_flags = FLOWI_FLAG_ANYSRC | FLOWI_FLAG_VRFSRC |
197+ FLOWI_FLAG_SKIP_NH_OIF,
197198 .daddr = ip4h->daddr,
198199 };
199200
drivers/net/vxlan.c+9−6
@@ -2392,10 +2392,6 @@ static void vxlan_setup(struct net_device *dev) · 2391 unmodified lines
23922392
23932393 eth_hw_addr_random(dev);
23942394 ether_setup(dev);
2395− if (vxlan->default_dst.remote_ip.sa.sa_family == AF_INET6)
2396− dev->needed_headroom = ETH_HLEN + VXLAN6_HEADROOM;
2397− else
2398− dev->needed_headroom = ETH_HLEN + VXLAN_HEADROOM;
23992395
24002396 dev->netdev_ops = &vxlan_netdev_ops;
24012397 dev->destructor = free_netdev;
@@ -2640,8 +2636,11 @@ static int vxlan_dev_configure(struct net *src_net, struct net_device *dev, · 238 unmodified lines
26402636 dst->remote_ip.sa.sa_family = AF_INET;
26412637
26422638 if (dst->remote_ip.sa.sa_family == AF_INET6 ||
2643− vxlan->cfg.saddr.sa.sa_family == AF_INET6)
2639+ vxlan->cfg.saddr.sa.sa_family == AF_INET6) {
2640+ if (!IS_ENABLED(CONFIG_IPV6))
2641+ return -EPFNOSUPPORT;
26442642 use_ipv6 = true;
2643+ }
26452644
26462645 if (conf->remote_ifindex) {
26472646 struct net_device *lowerdev
@@ -2670,8 +2669,12 @@ static int vxlan_dev_configure(struct net *src_net, struct net_device *dev, · 22 unmodified lines
26702669
26712670 dev->needed_headroom = lowerdev->hard_header_len +
26722671 (use_ipv6 ? VXLAN6_HEADROOM : VXLAN_HEADROOM);
2673− } else if (use_ipv6)
2672+ } else if (use_ipv6) {
26742673 vxlan->flags |= VXLAN_F_IPV6;
2674+ dev->needed_headroom = ETH_HLEN + VXLAN6_HEADROOM;
2675+ } else {
2676+ dev->needed_headroom = ETH_HLEN + VXLAN_HEADROOM;
2677+ }
26752678
26762679 memcpy(&vxlan->cfg, conf, sizeof(*conf));
26772680 if (!vxlan->cfg.dst_port)
drivers/of/of_mdio.c+23−4
@@ -197,7 +197,8 @@ static int of_phy_match(struct device *dev, void *phy_np) · 196 unmodified lines
197197 * of_phy_find_device - Give a PHY node, find the phy_device
198198 * @phy_np: Pointer to the phy's device tree node
199199 *
200− * Returns a pointer to the phy_device.
200+ * If successful, returns a pointer to the phy_device with the embedded
201+ * struct device refcount incremented by one, or NULL on failure.
201202 */
202203 struct phy_device *of_phy_find_device(struct device_node *phy_np)
203204 {
@@ -217,7 +218,9 @@ EXPORT_SYMBOL(of_phy_find_device); · 13 unmodified lines
217218 * @hndlr: Link state callback for the network device
218219 * @iface: PHY data interface type
219220 *
220− * Returns a pointer to the phy_device if successful. NULL otherwise
221+ * If successful, returns a pointer to the phy_device with the embedded
222+ * struct device refcount incremented by one, or NULL on failure. The
223+ * refcount must be dropped by calling phy_disconnect() or phy_detach().
221224 */
222225 struct phy_device *of_phy_connect(struct net_device *dev,
223226 struct device_node *phy_np,
@@ -225,13 +228,19 @@ struct phy_device *of_phy_connect(struct net_device *dev, · 1 unmodified line
225228 phy_interface_t iface)
226229 {
227230 struct phy_device *phy = of_phy_find_device(phy_np);
231+ int ret;
228232
229233 if (!phy)
230234 return NULL;
231235
232236 phy->dev_flags = flags;
233237
234− return phy_connect_direct(dev, phy, hndlr, iface) ? NULL : phy;
238+ ret = phy_connect_direct(dev, phy, hndlr, iface);
239+
240+ /* refcount is held by phy_connect_direct() on success */
241+ put_device(&phy->dev);
242+
243+ return ret ? NULL : phy;
235244 }
236245 EXPORT_SYMBOL(of_phy_connect);
237246
@@ -241,17 +250,27 @@ EXPORT_SYMBOL(of_phy_connect); · 3 unmodified lines
241250 * @phy_np: Node pointer for the PHY
242251 * @flags: flags to pass to the PHY
243252 * @iface: PHY data interface type
253+ *
254+ * If successful, returns a pointer to the phy_device with the embedded
255+ * struct device refcount incremented by one, or NULL on failure. The
256+ * refcount must be dropped by calling phy_disconnect() or phy_detach().
244257 */
245258 struct phy_device *of_phy_attach(struct net_device *dev,
246259 struct device_node *phy_np, u32 flags,
247260 phy_interface_t iface)
248261 {
249262 struct phy_device *phy = of_phy_find_device(phy_np);
263+ int ret;
250264
251265 if (!phy)
252266 return NULL;
253267
254− return phy_attach_direct(dev, phy, flags, iface) ? NULL : phy;
268+ ret = phy_attach_direct(dev, phy, flags, iface);
269+
270+ /* refcount is held by phy_attach_direct() on success */
271+ put_device(&phy->dev);
272+
273+ return ret ? NULL : phy;
255274 }
256275 EXPORT_SYMBOL(of_phy_attach);
257276
drivers/of/of_pci_irq.c+14−8
@@ -38,8 +38,8 @@ int of_irq_parse_pci(const struct pci_dev *pdev, struct of_phandle_args *out_irq · 37 unmodified lines
3838 */
3939 rc = pci_read_config_byte(pdev, PCI_INTERRUPT_PIN, &pin);
4040 if (rc != 0)
41− return rc;
42− /* No pin, exit */
41+ goto err;
42+ /* No pin, exit with no error message. */
4343 if (pin == 0)
4444 return -ENODEV;
4545
@@ -53,8 +53,10 @@ int of_irq_parse_pci(const struct pci_dev *pdev, struct of_phandle_args *out_irq · 7 unmodified lines
5353 ppnode = pci_bus_to_OF_node(pdev->bus);
5454
5555 /* No node for host bridge ? give up */
56− if (ppnode == NULL)
57− return -EINVAL;
56+ if (ppnode == NULL) {
57+ rc = -EINVAL;
58+ goto err;
59+ }
5860 } else {
5961 /* We found a P2P bridge, check if it has a node */
6062 ppnode = pci_device_to_OF_node(ppdev);
@@ -86,7 +88,13 @@ int of_irq_parse_pci(const struct pci_dev *pdev, struct of_phandle_args *out_irq · 25 unmodified lines
8688 out_irq->args[0] = pin;
8789 laddr[0] = cpu_to_be32((pdev->bus->number << 16) | (pdev->devfn << 8));
8890 laddr[1] = laddr[2] = cpu_to_be32(0);
89− return of_irq_parse_raw(laddr, out_irq);
91+ rc = of_irq_parse_raw(laddr, out_irq);
92+ if (rc)
93+ goto err;
94+ return 0;
95+err:
96+ dev_err(&pdev->dev, "of_irq_parse_pci() failed with rc=%d\n", rc);
97+ return rc;
9098 }
9199 EXPORT_SYMBOL_GPL(of_irq_parse_pci);
92100
@@ -105,10 +113,8 @@ int of_irq_parse_and_map_pci(const struct pci_dev *dev, u8 slot, u8 pin) · 12 unmodified lines
105113 int ret;
106114
107115 ret = of_irq_parse_pci(dev, &oirq);
108− if (ret) {
109− dev_err(&dev->dev, "of_irq_parse_pci() failed with rc=%d\n", ret);
116+ if (ret)
110117 return 0; /* Proper return code 0 == NO_IRQ */
111− }
112118
113119 return irq_create_of_mapping(&oirq);
114120 }
drivers/parisc/dino.c+3−0
@@ -560,6 +560,9 @@ dino_fixup_bus(struct pci_bus *bus) · 559 unmodified lines
560560 } else if (bus->parent) {
561561 int i;
562562
563+ pci_read_bridge_bases(bus);
564+
565+
563566 for(i = PCI_BRIDGE_RESOURCES; i < PCI_NUM_RESOURCES; i++) {
564567 if((bus->self->resource[i].flags &
565568 (IORESOURCE_IO | IORESOURCE_MEM)) == 0)
drivers/parisc/lba_pci.c+1−0
@@ -693,6 +693,7 @@ lba_fixup_bus(struct pci_bus *bus) · 692 unmodified lines
693693 if (bus->parent) {
694694 int i;
695695 /* PCI-PCI Bridge */
696+ pci_read_bridge_bases(bus);
696697 for (i = PCI_BRIDGE_RESOURCES; i < PCI_NUM_RESOURCES; i++)
697698 pci_claim_bridge_resource(bus->self, i);
698699 } else {
drivers/pci/access.c+4−23
@@ -442,7 +442,8 @@ static const struct pci_vpd_ops pci_vpd_pci22_ops = { · 441 unmodified lines
442442 static ssize_t pci_vpd_f0_read(struct pci_dev *dev, loff_t pos, size_t count,
443443 void *arg)
444444 {
445− struct pci_dev *tdev = pci_get_slot(dev->bus, PCI_SLOT(dev->devfn));
445+ struct pci_dev *tdev = pci_get_slot(dev->bus,
446+ PCI_DEVFN(PCI_SLOT(dev->devfn), 0));
446447 ssize_t ret;
447448
448449 if (!tdev)
@@ -456,7 +457,8 @@ static ssize_t pci_vpd_f0_read(struct pci_dev *dev, loff_t pos, size_t count, · 7 unmodified lines
456457 static ssize_t pci_vpd_f0_write(struct pci_dev *dev, loff_t pos, size_t count,
457458 const void *arg)
458459 {
459− struct pci_dev *tdev = pci_get_slot(dev->bus, PCI_SLOT(dev->devfn));
460+ struct pci_dev *tdev = pci_get_slot(dev->bus,
461+ PCI_DEVFN(PCI_SLOT(dev->devfn), 0));
460462 ssize_t ret;
461463
462464 if (!tdev)
@@ -473,22 +475,6 @@ static const struct pci_vpd_ops pci_vpd_f0_ops = { · 10 unmodified lines
473475 .release = pci_vpd_pci22_release,
474476 };
475477
476−static int pci_vpd_f0_dev_check(struct pci_dev *dev)
477−{
478− struct pci_dev *tdev = pci_get_slot(dev->bus, PCI_SLOT(dev->devfn));
479− int ret = 0;
480−
481− if (!tdev)
482− return -ENODEV;
483− if (!tdev->vpd || !tdev->multifunction ||
484− dev->class != tdev->class || dev->vendor != tdev->vendor ||
485− dev->device != tdev->device)
486− ret = -ENODEV;
487−
488− pci_dev_put(tdev);
489− return ret;
490−}
491−
492478 int pci_vpd_pci22_init(struct pci_dev *dev)
493479 {
494480 struct pci_vpd_pci22 *vpd;
@@ -497,12 +483,7 @@ int pci_vpd_pci22_init(struct pci_dev *dev) · 2 unmodified lines
497483 cap = pci_find_capability(dev, PCI_CAP_ID_VPD);
498484 if (!cap)
499485 return -ENODEV;
500− if (dev->dev_flags & PCI_DEV_FLAGS_VPD_REF_F0) {
501− int ret = pci_vpd_f0_dev_check(dev);
502486
503− if (ret)
504− return ret;
505− }
506487 vpd = kzalloc(sizeof(*vpd), GFP_ATOMIC);
507488 if (!vpd)
508489 return -ENOMEM;
drivers/pci/bus.c+2−0
@@ -256,6 +256,8 @@ bool pci_bus_clip_resource(struct pci_dev *dev, int idx) · 255 unmodified lines
256256
257257 res->start = start;
258258 res->end = end;
259+ res->flags &= ~IORESOURCE_UNSET;
260+ orig_res.flags &= ~IORESOURCE_UNSET;
259261 dev_printk(KERN_DEBUG, &dev->dev, "%pR clipped to %pR\n",
260262 &orig_res, res);
261263
drivers/pci/host/pci-rcar-gen2.c+1−0
@@ -362,6 +362,7 @@ static int rcar_pci_probe(struct platform_device *pdev) · 361 unmodified lines
362362 static struct of_device_id rcar_pci_of_match[] = {
363363 { .compatible = "renesas,pci-r8a7790", },
364364 { .compatible = "renesas,pci-r8a7791", },
365+ { .compatible = "renesas,pci-r8a7794", },
365366 { },
366367 };
367368
drivers/pci/pci-driver.c+4−3
@@ -299,9 +299,10 @@ static long local_pci_probe(void *_ddi) · 298 unmodified lines
299299 * Unbound PCI devices are always put in D0, regardless of
300300 * runtime PM status. During probe, the device is set to
301301 * active and the usage count is incremented. If the driver
302− * supports runtime PM, it should call pm_runtime_put_noidle()
303− * in its probe routine and pm_runtime_get_noresume() in its
304− * remove routine.
302+ * supports runtime PM, it should call pm_runtime_put_noidle(),
303+ * or any other runtime PM helper function decrementing the usage
304+ * count, in its probe routine and pm_runtime_get_noresume() in
305+ * its remove routine.
305306 */
306307 pm_runtime_get_sync(dev);
307308 pci_dev->driver = pci_drv;
drivers/pci/probe.c+11−12
@@ -676,15 +676,20 @@ static struct irq_domain *pci_host_bridge_msi_domain(struct pci_bus *bus) · 675 unmodified lines
676676 static void pci_set_bus_msi_domain(struct pci_bus *bus)
677677 {
678678 struct irq_domain *d;
679+ struct pci_bus *b;
679680
680681 /*
681− * Either bus is the root, and we must obtain it from the
682− * firmware, or we inherit it from the bridge device.
682+ * The bus can be a root bus, a subordinate bus, or a virtual bus
683+ * created by an SR-IOV device. Walk up to the first bridge device
684+ * found or derive the domain from the host bridge.
683685 */
684− if (pci_is_root_bus(bus))
685− d = pci_host_bridge_msi_domain(bus);
686− else
687− d = dev_get_msi_domain(&bus->self->dev);
686+ for (b = bus, d = NULL; !d && !pci_is_root_bus(b); b = b->parent) {
687+ if (b->self)
688+ d = dev_get_msi_domain(&b->self->dev);
689+ }
690+
691+ if (!d)
692+ d = pci_host_bridge_msi_domain(b);
688693
689694 dev_set_msi_domain(&bus->dev, d);
690695 }
@@ -855,9 +860,6 @@ int pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max, int pass) · 164 unmodified lines
855860 child->bridge_ctl = bctl;
856861 }
857862
858− /* Read and initialize bridge resources */
859− pci_read_bridge_bases(child);
860−
861863 cmax = pci_scan_child_bus(child);
862864 if (cmax > subordinate)
863865 dev_warn(&dev->dev, "bridge has subordinate %02x but max busn %02x\n",
@@ -918,9 +920,6 @@ int pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max, int pass) · 54 unmodified lines
918920
919921 if (!is_cardbus) {
920922 child->bridge_ctl = bctl;
921−
922− /* Read and initialize bridge resources */
923− pci_read_bridge_bases(child);
924923 max = pci_scan_child_bus(child);
925924 } else {
926925 /*
drivers/pci/quirks.c+18−2
@@ -1907,11 +1907,27 @@ static void quirk_netmos(struct pci_dev *dev) · 1906 unmodified lines
19071907 DECLARE_PCI_FIXUP_CLASS_HEADER(PCI_VENDOR_ID_NETMOS, PCI_ANY_ID,
19081908 PCI_CLASS_COMMUNICATION_SERIAL, 8, quirk_netmos);
19091909
1910+/*
1911+ * Quirk non-zero PCI functions to route VPD access through function 0 for
1912+ * devices that share VPD resources between functions. The functions are
1913+ * expected to be identical devices.
1914+ */
19101915 static void quirk_f0_vpd_link(struct pci_dev *dev)
19111916 {
1912− if (!dev->multifunction || !PCI_FUNC(dev->devfn))
1917+ struct pci_dev *f0;
1918+
1919+ if (!PCI_FUNC(dev->devfn))
19131920 return;
1914− dev->dev_flags |= PCI_DEV_FLAGS_VPD_REF_F0;
1921+
1922+ f0 = pci_get_slot(dev->bus, PCI_DEVFN(PCI_SLOT(dev->devfn), 0));
1923+ if (!f0)
1924+ return;
1925+
1926+ if (f0->vpd && dev->class == f0->class &&
1927+ dev->vendor == f0->vendor && dev->device == f0->device)
1928+ dev->dev_flags |= PCI_DEV_FLAGS_VPD_REF_F0;
1929+
1930+ pci_dev_put(f0);
19151931 }
19161932 DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_INTEL, PCI_ANY_ID,
19171933 PCI_CLASS_NETWORK_ETHERNET, 8, quirk_f0_vpd_link);
drivers/regulator/anatop-regulator.c+1−0
@@ -318,6 +318,7 @@ static const struct of_device_id of_anatop_regulator_match_tbl[] = { · 317 unmodified lines
318318 { .compatible = "fsl,anatop-regulator", },
319319 { /* end */ }
320320 };
321+MODULE_DEVICE_TABLE(of, of_anatop_regulator_match_tbl);
321322
322323 static struct platform_driver anatop_regulator_driver = {
323324 .driver = {
drivers/regulator/core.c+10−11
@@ -1394,15 +1394,15 @@ static int regulator_resolve_supply(struct regulator_dev *rdev) · 1393 unmodified lines
13941394 return 0;
13951395
13961396 r = regulator_dev_lookup(dev, rdev->supply_name, &ret);
1397− if (ret == -ENODEV) {
1398− /*
1399− * No supply was specified for this regulator and
1400− * there will never be one.
1401− */
1402− return 0;
1403− }
1404−
14051397 if (!r) {
1398+ if (ret == -ENODEV) {
1399+ /*
1400+ * No supply was specified for this regulator and
1401+ * there will never be one.
1402+ */
1403+ return 0;
1404+ }
1405+
14061406 if (have_full_constraints()) {
14071407 r = dummy_regulator_rdev;
14081408 } else {
@@ -1422,11 +1422,10 @@ static int regulator_resolve_supply(struct regulator_dev *rdev) · 13 unmodified lines
14221422 return ret;
14231423
14241424 /* Cascade always-on state to supply */
1425− if (_regulator_is_enabled(rdev)) {
1425+ if (_regulator_is_enabled(rdev) && rdev->supply) {
14261426 ret = regulator_enable(rdev->supply);
14271427 if (ret < 0) {
1428− if (rdev->supply)
1429− _regulator_put(rdev->supply);
1428+ _regulator_put(rdev->supply);
14301429 return ret;
14311430 }
14321431 }
drivers/regulator/gpio-regulator.c+1−0
@@ -394,6 +394,7 @@ static const struct of_device_id regulator_gpio_of_match[] = { · 393 unmodified lines
394394 { .compatible = "regulator-gpio", },
395395 {},
396396 };
397+MODULE_DEVICE_TABLE(of, regulator_gpio_of_match);
397398 #endif
398399
399400 static struct platform_driver gpio_regulator_driver = {
drivers/regulator/pbias-regulator.c+50−6
@@ -45,6 +45,10 @@ struct pbias_regulator_data { · 44 unmodified lines
4545 int voltage;
4646 };
4747
48+struct pbias_of_data {
49+ unsigned int offset;
50+};
51+
4852 static const unsigned int pbias_volt_table[] = {
4953 1800000,
5054 3000000
@@ -102,8 +106,35 @@ static struct of_regulator_match pbias_matches[] = { · 51 unmodified lines
102106 };
103107 #define PBIAS_NUM_REGS ARRAY_SIZE(pbias_matches)
104108
109+/* Offset from SCM general area (and syscon) base */
110+
111+static const struct pbias_of_data pbias_of_data_omap2 = {
112+ .offset = 0x230,
113+};
114+
115+static const struct pbias_of_data pbias_of_data_omap3 = {
116+ .offset = 0x2b0,
117+};
118+
119+static const struct pbias_of_data pbias_of_data_omap4 = {
120+ .offset = 0x60,
121+};
122+
123+static const struct pbias_of_data pbias_of_data_omap5 = {
124+ .offset = 0x60,
125+};
126+
127+static const struct pbias_of_data pbias_of_data_dra7 = {
128+ .offset = 0xe00,
129+};
130+
105131 static const struct of_device_id pbias_of_match[] = {
106132 { .compatible = "ti,pbias-omap", },
133+ { .compatible = "ti,pbias-omap2", .data = &pbias_of_data_omap2, },
134+ { .compatible = "ti,pbias-omap3", .data = &pbias_of_data_omap3, },
135+ { .compatible = "ti,pbias-omap4", .data = &pbias_of_data_omap4, },
136+ { .compatible = "ti,pbias-omap5", .data = &pbias_of_data_omap5, },
137+ { .compatible = "ti,pbias-dra7", .data = &pbias_of_data_dra7, },
107138 {},
108139 };
109140 MODULE_DEVICE_TABLE(of, pbias_of_match);
@@ -118,6 +149,9 @@ static int pbias_regulator_probe(struct platform_device *pdev) · 8 unmodified lines
118149 const struct pbias_reg_info *info;
119150 int ret = 0;
120151 int count, idx, data_idx = 0;
152+ const struct of_device_id *match;
153+ const struct pbias_of_data *data;
154+ unsigned int offset;
121155
122156 count = of_regulator_match(&pdev->dev, np, pbias_matches,
123157 PBIAS_NUM_REGS);
@@ -133,6 +167,20 @@ static int pbias_regulator_probe(struct platform_device *pdev) · 9 unmodified lines
133167 if (IS_ERR(syscon))
134168 return PTR_ERR(syscon);
135169
170+ match = of_match_device(of_match_ptr(pbias_of_match), &pdev->dev);
171+ if (match && match->data) {
172+ data = match->data;
173+ offset = data->offset;
174+ } else {
175+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
176+ if (!res)
177+ return -EINVAL;
178+
179+ offset = res->start;
180+ dev_WARN(&pdev->dev,
181+ "using legacy dt data for pbias offset\n");
182+ }
183+
136184 cfg.regmap = syscon;
137185 cfg.dev = &pdev->dev;
138186
@@ -145,10 +193,6 @@ static int pbias_regulator_probe(struct platform_device *pdev) · 6 unmodified lines
145193 if (!info)
146194 return -ENODEV;
147195
148− res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
149− if (!res)
150− return -EINVAL;
151−
152196 drvdata[data_idx].syscon = syscon;
153197 drvdata[data_idx].info = info;
154198 drvdata[data_idx].desc.name = info->name;
@@ -158,9 +202,9 @@ static int pbias_regulator_probe(struct platform_device *pdev) · 3 unmodified lines
158202 drvdata[data_idx].desc.volt_table = pbias_volt_table;
159203 drvdata[data_idx].desc.n_voltages = 2;
160204 drvdata[data_idx].desc.enable_time = info->enable_time;
161− drvdata[data_idx].desc.vsel_reg = res->start;
205+ drvdata[data_idx].desc.vsel_reg = offset;
162206 drvdata[data_idx].desc.vsel_mask = info->vmode;
163− drvdata[data_idx].desc.enable_reg = res->start;
207+ drvdata[data_idx].desc.enable_reg = offset;
164208 drvdata[data_idx].desc.enable_mask = info->enable_mask;
165209 drvdata[data_idx].desc.enable_val = info->enable;
166210 drvdata[data_idx].desc.disable_val = info->disable_val;
drivers/regulator/tps65218-regulator.c+1−1
@@ -73,7 +73,7 @@ static const struct regulator_linear_range dcdc4_ranges[] = { · 72 unmodified lines
7373 };
7474
7575 static struct tps_info tps65218_pmic_regs[] = {
76− TPS65218_INFO(DCDC1, "DCDC1", 850000, 167500),
76+ TPS65218_INFO(DCDC1, "DCDC1", 850000, 1675000),
7777 TPS65218_INFO(DCDC2, "DCDC2", 850000, 1675000),
7878 TPS65218_INFO(DCDC3, "DCDC3", 900000, 3400000),
7979 TPS65218_INFO(DCDC4, "DCDC4", 1175000, 3400000),
drivers/regulator/vexpress.c+1−0
@@ -103,6 +103,7 @@ static const struct of_device_id vexpress_regulator_of_match[] = { · 102 unmodified lines
103103 { .compatible = "arm,vexpress-volt", },
104104 { }
105105 };
106+MODULE_DEVICE_TABLE(of, vexpress_regulator_of_match);
106107
107108 static struct platform_driver vexpress_regulator_driver = {
108109 .probe = vexpress_regulator_probe,
drivers/scsi/scsi_lib.c+1−1
@@ -1957,7 +1957,7 @@ static int scsi_mq_prep_fn(struct request *req) · 1956 unmodified lines
19571957 static void scsi_mq_done(struct scsi_cmnd *cmd)
19581958 {
19591959 trace_scsi_dispatch_cmd_done(cmd);
1960− blk_mq_complete_request(cmd->request);
1960+ blk_mq_complete_request(cmd->request, cmd->request->errors);
19611961 }
19621962
19631963 static int scsi_queue_rq(struct blk_mq_hw_ctx *hctx,
drivers/spi/spi-atmel.c+2−0
@@ -1720,6 +1720,7 @@ static int atmel_spi_runtime_resume(struct device *dev) · 1719 unmodified lines
17201720 return clk_prepare_enable(as->clk);
17211721 }
17221722
1723+#ifdef CONFIG_PM_SLEEP
17231724 static int atmel_spi_suspend(struct device *dev)
17241725 {
17251726 struct spi_master *master = dev_get_drvdata(dev);
@@ -1756,6 +1757,7 @@ static int atmel_spi_resume(struct device *dev) · 30 unmodified lines
17561757
17571758 return ret;
17581759 }
1760+#endif
17591761
17601762 static const struct dev_pm_ops atmel_spi_pm_ops = {
17611763 SET_SYSTEM_SLEEP_PM_OPS(atmel_spi_suspend, atmel_spi_resume)
drivers/spi/spi-bcm2835.c+3−3
@@ -386,14 +386,14 @@ static bool bcm2835_spi_can_dma(struct spi_master *master, · 385 unmodified lines
386386 /* otherwise we only allow transfers within the same page
387387 * to avoid wasting time on dma_mapping when it is not practical
388388 */
389− if (((size_t)tfr->tx_buf & PAGE_MASK) + tfr->len > PAGE_SIZE) {
389+ if (((size_t)tfr->tx_buf & (PAGE_SIZE - 1)) + tfr->len > PAGE_SIZE) {
390390 dev_warn_once(&spi->dev,
391391 "Unaligned spi tx-transfer bridging page\n");
392392 return false;
393393 }
394− if (((size_t)tfr->rx_buf & PAGE_MASK) + tfr->len > PAGE_SIZE) {
394+ if (((size_t)tfr->rx_buf & (PAGE_SIZE - 1)) + tfr->len > PAGE_SIZE) {
395395 dev_warn_once(&spi->dev,
396− "Unaligned spi tx-transfer bridging page\n");
396+ "Unaligned spi rx-transfer bridging page\n");
397397 return false;
398398 }
399399
drivers/spi/spi-meson-spifc.c+1−0
@@ -444,6 +444,7 @@ static const struct of_device_id meson_spifc_dt_match[] = { · 443 unmodified lines
444444 { .compatible = "amlogic,meson6-spifc", },
445445 { },
446446 };
447+MODULE_DEVICE_TABLE(of, meson_spifc_dt_match);
447448
448449 static struct platform_driver meson_spifc_driver = {
449450 .probe = meson_spifc_probe,
drivers/spi/spi-mt65xx.c+23−30
@@ -85,7 +85,7 @@ struct mtk_spi { · 84 unmodified lines
8585 void __iomem *base;
8686 u32 state;
8787 u32 pad_sel;
88− struct clk *spi_clk, *parent_clk;
88+ struct clk *parent_clk, *sel_clk, *spi_clk;
8989 struct spi_transfer *cur_transfer;
9090 u32 xfer_len;
9191 struct scatterlist *tx_sgl, *rx_sgl;
@@ -173,22 +173,6 @@ static void mtk_spi_config(struct mtk_spi *mdata, · 81 unmodified lines
173173 writel(mdata->pad_sel, mdata->base + SPI_PAD_SEL_REG);
174174 }
175175
176−static int mtk_spi_prepare_hardware(struct spi_master *master)
177−{
178− struct spi_transfer *trans;
179− struct mtk_spi *mdata = spi_master_get_devdata(master);
180− struct spi_message *msg = master->cur_msg;
181−
182− trans = list_first_entry(&msg->transfers, struct spi_transfer,
183− transfer_list);
184− if (!trans->cs_change) {
185− mdata->state = MTK_SPI_IDLE;
186− mtk_spi_reset(mdata);
187− }
188−
189− return 0;
190−}
191−
192176 static int mtk_spi_prepare_message(struct spi_master *master,
193177 struct spi_message *msg)
194178 {
@@ -228,11 +212,15 @@ static void mtk_spi_set_cs(struct spi_device *spi, bool enable) · 33 unmodified lines
228212 struct mtk_spi *mdata = spi_master_get_devdata(spi->master);
229213
230214 reg_val = readl(mdata->base + SPI_CMD_REG);
231− if (!enable)
215+ if (!enable) {
232216 reg_val |= SPI_CMD_PAUSE_EN;
233− else
217+ writel(reg_val, mdata->base + SPI_CMD_REG);
218+ } else {
234219 reg_val &= ~SPI_CMD_PAUSE_EN;
235− writel(reg_val, mdata->base + SPI_CMD_REG);
220+ writel(reg_val, mdata->base + SPI_CMD_REG);
221+ mdata->state = MTK_SPI_IDLE;
222+ mtk_spi_reset(mdata);
223+ }
236224 }
237225
238226 static void mtk_spi_prepare_transfer(struct spi_master *master,
@@ -509,7 +497,6 @@ static int mtk_spi_probe(struct platform_device *pdev) · 270 unmodified lines
509497 master->mode_bits = SPI_CPOL | SPI_CPHA;
510498
511499 master->set_cs = mtk_spi_set_cs;
512− master->prepare_transfer_hardware = mtk_spi_prepare_hardware;
513500 master->prepare_message = mtk_spi_prepare_message;
514501 master->transfer_one = mtk_spi_transfer_one;
515502 master->can_dma = mtk_spi_can_dma;
@@ -576,13 +563,6 @@ static int mtk_spi_probe(struct platform_device *pdev) · 60 unmodified lines
576563 goto err_put_master;
577564 }
578565
579− mdata->spi_clk = devm_clk_get(&pdev->dev, "spi-clk");
580− if (IS_ERR(mdata->spi_clk)) {
581− ret = PTR_ERR(mdata->spi_clk);
582− dev_err(&pdev->dev, "failed to get spi-clk: %d\n", ret);
583− goto err_put_master;
584− }
585−
586566 mdata->parent_clk = devm_clk_get(&pdev->dev, "parent-clk");
587567 if (IS_ERR(mdata->parent_clk)) {
588568 ret = PTR_ERR(mdata->parent_clk);
@@ -590,13 +570,27 @@ static int mtk_spi_probe(struct platform_device *pdev) · 1 unmodified line
590570 goto err_put_master;
591571 }
592572
573+ mdata->sel_clk = devm_clk_get(&pdev->dev, "sel-clk");
574+ if (IS_ERR(mdata->sel_clk)) {
575+ ret = PTR_ERR(mdata->sel_clk);
576+ dev_err(&pdev->dev, "failed to get sel-clk: %d\n", ret);
577+ goto err_put_master;
578+ }
579+
580+ mdata->spi_clk = devm_clk_get(&pdev->dev, "spi-clk");
581+ if (IS_ERR(mdata->spi_clk)) {
582+ ret = PTR_ERR(mdata->spi_clk);
583+ dev_err(&pdev->dev, "failed to get spi-clk: %d\n", ret);
584+ goto err_put_master;
585+ }
586+
593587 ret = clk_prepare_enable(mdata->spi_clk);
594588 if (ret < 0) {
595589 dev_err(&pdev->dev, "failed to enable spi_clk (%d)\n", ret);
596590 goto err_put_master;
597591 }
598592
599− ret = clk_set_parent(mdata->spi_clk, mdata->parent_clk);
593+ ret = clk_set_parent(mdata->sel_clk, mdata->parent_clk);
600594 if (ret < 0) {
601595 dev_err(&pdev->dev, "failed to clk_set_parent (%d)\n", ret);
602596 goto err_disable_clk;
@@ -630,7 +624,6 @@ static int mtk_spi_remove(struct platform_device *pdev) · 27 unmodified lines
630624 pm_runtime_disable(&pdev->dev);
631625
632626 mtk_spi_reset(mdata);
633− clk_disable_unprepare(mdata->spi_clk);
634627 spi_master_put(master);
635628
636629 return 0;
drivers/spi/spi-pxa2xx.c+4−0
@@ -654,6 +654,10 @@ static irqreturn_t ssp_int(int irq, void *dev_id) · 653 unmodified lines
654654 if (!(sccr1_reg & SSCR1_TIE))
655655 mask &= ~SSSR_TFS;
656656
657+ /* Ignore RX timeout interrupt if it is disabled */
658+ if (!(sccr1_reg & SSCR1_TINTE))
659+ mask &= ~SSSR_TINT;
660+
657661 if (!(status & mask))
658662 return IRQ_NONE;
659663
drivers/spi/spi-xtensa-xtfpga.c+2−2
@@ -34,13 +34,13 @@ struct xtfpga_spi { · 33 unmodified lines
3434 static inline void xtfpga_spi_write32(const struct xtfpga_spi *spi,
3535 unsigned addr, u32 val)
3636 {
37− iowrite32(val, spi->regs + addr);
37+ __raw_writel(val, spi->regs + addr);
3838 }
3939
4040 static inline unsigned int xtfpga_spi_read32(const struct xtfpga_spi *spi,
4141 unsigned addr)
4242 {
43− return ioread32(spi->regs + addr);
43+ return __raw_readl(spi->regs + addr);
4444 }
4545
4646 static inline void xtfpga_spi_wait_busy(struct xtfpga_spi *xspi)
drivers/spi/spi.c+1−2
@@ -1610,8 +1610,7 @@ static struct class spi_master_class = { · 1609 unmodified lines
16101610 *
16111611 * The caller is responsible for assigning the bus number and initializing
16121612 * the master's methods before calling spi_register_master(); and (after errors
1613− * adding the device) calling spi_master_put() and kfree() to prevent a memory
1614− * leak.
1613+ * adding the device) calling spi_master_put() to prevent a memory leak.
16151614 */
16161615 struct spi_master *spi_alloc_master(struct device *dev, unsigned size)
16171616 {
drivers/spi/spidev.c+2−1
@@ -651,7 +651,8 @@ static int spidev_release(struct inode *inode, struct file *filp) · 650 unmodified lines
651651 kfree(spidev->rx_buffer);
652652 spidev->rx_buffer = NULL;
653653
654− spidev->speed_hz = spidev->spi->max_speed_hz;
654+ if (spidev->spi)
655+ spidev->speed_hz = spidev->spi->max_speed_hz;
655656
656657 /* ... after we unbound from the underlying device? */
657658 spin_lock_irq(&spidev->spi_lock);
drivers/staging/android/TODO+20−0
@@ -5,5 +5,25 @@ TODO: · 4 unmodified lines
55 - add proper arch dependencies as needed
66 - audit userspace interfaces to make sure they are sane
77
8+
9+ion/
10+ - Remove ION_IOC_SYNC: Flushing for devices should be purely a kernel internal
11+ interface on top of dma-buf. flush_for_device needs to be added to dma-buf
12+ first.
13+ - Remove ION_IOC_CUSTOM: Atm used for cache flushing for cpu access in some
14+ vendor trees. Should be replaced with an ioctl on the dma-buf to expose the
15+ begin/end_cpu_access hooks to userspace.
16+ - Clarify the tricks ion plays with explicitly managing coherency behind the
17+ dma api's back (this is absolutely needed for high-perf gpu drivers): Add an
18+ explicit coherency management mode to flush_for_device to be used by drivers
19+ which want to manage caches themselves and which indicates whether cpu caches
20+ need flushing.
21+ - With those removed there's probably no use for ION_IOC_IMPORT anymore either
22+ since ion would just be the central allocator for shared buffers.
23+ - Add dt-binding to expose cma regions as ion heaps, with the rule that any
24+ such cma regions must already be used by some device for dma. I.e. ion only
25+ exposes existing cma regions and doesn't reserve unecessarily memory when
26+ booting a system which doesn't use ion.
27+
828 Please send patches to Greg Kroah-Hartman <greg@kroah.com> and Cc:
929 Arve Hjønnevåg <arve@android.com> and Riley Andrews <riandrews@android.com>
drivers/staging/android/ion/ion.c+3−3
@@ -1179,13 +1179,13 @@ struct ion_handle *ion_import_dma_buf(struct ion_client *client, int fd) · 1178 unmodified lines
11791179 mutex_unlock(&client->lock);
11801180 goto end;
11811181 }
1182− mutex_unlock(&client->lock);
11831182
11841183 handle = ion_handle_create(client, buffer);
1185− if (IS_ERR(handle))
1184+ if (IS_ERR(handle)) {
1185+ mutex_unlock(&client->lock);
11861186 goto end;
1187+ }
11871188
1188− mutex_lock(&client->lock);
11891189 ret = ion_handle_add(client, handle);
11901190 mutex_unlock(&client->lock);
11911191 if (ret) {
drivers/staging/fbtft/fb_uc1611.c+1−1
@@ -76,7 +76,7 @@ static int init_display(struct fbtft_par *par) · 75 unmodified lines
7676
7777 /* Set CS active high */
7878 par->spi->mode |= SPI_CS_HIGH;
79− ret = par->spi->master->setup(par->spi);
79+ ret = spi_setup(par->spi);
8080 if (ret) {
8181 dev_err(par->info->device, "Could not set SPI_CS_HIGH\n");
8282 return ret;
drivers/staging/fbtft/fb_watterott.c+2−2
@@ -169,7 +169,7 @@ static int init_display(struct fbtft_par *par) · 168 unmodified lines
169169 /* enable SPI interface by having CS and MOSI low during reset */
170170 save_mode = par->spi->mode;
171171 par->spi->mode |= SPI_CS_HIGH;
172− ret = par->spi->master->setup(par->spi); /* set CS inactive low */
172+ ret = spi_setup(par->spi); /* set CS inactive low */
173173 if (ret) {
174174 dev_err(par->info->device, "Could not set SPI_CS_HIGH\n");
175175 return ret;
@@ -180,7 +180,7 @@ static int init_display(struct fbtft_par *par) · 4 unmodified lines
180180 par->fbtftops.reset(par);
181181 mdelay(1000);
182182 par->spi->mode = save_mode;
183− ret = par->spi->master->setup(par->spi);
183+ ret = spi_setup(par->spi);
184184 if (ret) {
185185 dev_err(par->info->device, "Could not restore SPI mode\n");
186186 return ret;
drivers/staging/fbtft/fbtft-core.c+3−7
@@ -1436,15 +1436,11 @@ int fbtft_probe_common(struct fbtft_display *display, · 1435 unmodified lines
14361436
14371437 /* 9-bit SPI setup */
14381438 if (par->spi && display->buswidth == 9) {
1439− par->spi->bits_per_word = 9;
1440− ret = par->spi->master->setup(par->spi);
1441− if (ret) {
1439+ if (par->spi->master->bits_per_word_mask & SPI_BPW_MASK(9)) {
1440+ par->spi->bits_per_word = 9;
1441+ } else {
14421442 dev_warn(&par->spi->dev,
14431443 "9-bit SPI not available, emulating using 8-bit.\n");
1444− par->spi->bits_per_word = 8;
1445− ret = par->spi->master->setup(par->spi);
1446− if (ret)
1447− goto out_release;
14481444 /* allocate buffer with room for dc bits */
14491445 par->extra = devm_kzalloc(par->info->device,
14501446 par->txbuf.len + (par->txbuf.len / 8) + 8,
drivers/staging/fbtft/flexfb.c+4−7
@@ -463,15 +463,12 @@ static int flexfb_probe_common(struct spi_device *sdev, · 462 unmodified lines
463463 }
464464 par->fbtftops.write_register = fbtft_write_reg8_bus9;
465465 par->fbtftops.write_vmem = fbtft_write_vmem16_bus9;
466− sdev->bits_per_word = 9;
467− ret = sdev->master->setup(sdev);
468− if (ret) {
466+ if (par->spi->master->bits_per_word_mask
467+ & SPI_BPW_MASK(9)) {
468+ par->spi->bits_per_word = 9;
469+ } else {
469470 dev_warn(dev,
470471 "9-bit SPI not available, emulating using 8-bit.\n");
471− sdev->bits_per_word = 8;
472− ret = sdev->master->setup(sdev);
473− if (ret)
474− goto out_release;
475472 /* allocate buffer with room for dc bits */
476473 par->extra = devm_kzalloc(par->info->device,
477474 par->txbuf.len + (par->txbuf.len / 8) + 8,
drivers/staging/lustre/README.txt+6−10
@@ -14,10 +14,8 @@ Unlike shared disk storage cluster filesystems (e.g. OCFS2, GFS, GPFS), · 13 unmodified lines
1414 Lustre has independent Metadata and Data servers that clients can access
1515 in parallel to maximize performance.
1616
17−In order to use Lustre client you will need to download lustre client
18−tools from
19−https://downloads.hpdd.intel.com/public/lustre/latest-feature-release/
20−the package name is lustre-client.
17+In order to use Lustre client you will need to download the "lustre-client"
18+package that contains the userspace tools from http://lustre.org/download/
2119
2220 You will need to install and configure your Lustre servers separately.
2321
@@ -76,12 +74,10 @@ Mount Options · 52 unmodified lines
7674
7775 More Information
7876 ================
79−You can get more information at
80−OpenSFS website: http://lustre.opensfs.org/about/
81−Intel HPDD wiki: https://wiki.hpdd.intel.com
77+You can get more information at the Lustre website: http://wiki.lustre.org/
8278
83−Out of tree Lustre client and server code is available at:
84−http://git.whamcloud.com/fs/lustre-release.git
79+Source for the userspace tools and out-of-tree client and server code
80+is available at: http://git.hpdd.intel.com/fs/lustre-release.git
8581
8682 Latest binary packages:
87−http://lustre.opensfs.org/download-lustre/
83+http://lustre.org/download/
drivers/staging/most/Kconfig+1−0
@@ -1,5 +1,6 @@
11 menuconfig MOST
22 tristate "MOST driver"
3+ depends on HAS_DMA
34 select MOSTCORE
45 default n
56 ---help---
drivers/staging/most/hdm-dim2/Kconfig+1−0
@@ -5,6 +5,7 @@ · 4 unmodified lines
55 config HDM_DIM2
66 tristate "DIM2 HDM"
77 depends on AIM_NETWORK
8+ depends on HAS_IOMEM
89
910 ---help---
1011 Say Y here if you want to connect via MediaLB to network transceiver.
drivers/staging/most/hdm-usb/Kconfig+1−1
@@ -4,7 +4,7 @@ · 3 unmodified lines
44
55 config HDM_USB
66 tristate "USB HDM"
7− depends on USB
7+ depends on USB && NET
88 select AIM_NETWORK
99 ---help---
1010 Say Y here if you want to connect via USB to network tranceiver.
drivers/staging/most/mostcore/Kconfig+1−0
@@ -4,6 +4,7 @@ · 3 unmodified lines
44
55 config MOSTCORE
66 tristate "MOST Core"
7+ depends on HAS_DMA
78
89 ---help---
910 Say Y here if you want to enable MOST support.
drivers/staging/unisys/visorbus/Makefile+0−1
@@ -10,4 +10,3 @@ visorbus-y += visorchipset.o · 9 unmodified lines
1010 visorbus-y += periodic_work.o
1111
1212 ccflags-y += -Idrivers/staging/unisys/include
13−ccflags-y += -Idrivers/staging/unisys/visorutil
drivers/staging/unisys/visorbus/visorbus_main.c+9−4
@@ -37,6 +37,8 @@ static int visorbus_debugref; · 36 unmodified lines
3737 #define POLLJIFFIES_TESTWORK 100
3838 #define POLLJIFFIES_NORMALCHANNEL 10
3939
40+static int busreg_rc = -ENODEV; /* stores the result from bus registration */
41+
4042 static int visorbus_uevent(struct device *xdev, struct kobj_uevent_env *env);
4143 static int visorbus_match(struct device *xdev, struct device_driver *xdrv);
4244 static void fix_vbus_dev_info(struct visor_device *visordev);
@@ -863,6 +865,9 @@ int visorbus_register_visor_driver(struct visor_driver *drv) · 820 unmodified lines
863865 {
864866 int rc = 0;
865867
868+ if (busreg_rc < 0)
869+ return -ENODEV; /*can't register on a nonexistent bus*/
870+
866871 drv->driver.name = drv->name;
867872 drv->driver.bus = &visorbus_type;
868873 drv->driver.probe = visordriver_probe_device;
@@ -885,6 +890,8 @@ int visorbus_register_visor_driver(struct visor_driver *drv) · 16 unmodified lines
885890 if (rc < 0)
886891 return rc;
887892 rc = register_driver_attributes(drv);
893+ if (rc < 0)
894+ driver_unregister(&drv->driver);
888895 return rc;
889896 }
890897 EXPORT_SYMBOL_GPL(visorbus_register_visor_driver);
@@ -1260,10 +1267,8 @@ remove_bus_instance(struct visor_device *dev) · 369 unmodified lines
12601267 static int
12611268 create_bus_type(void)
12621269 {
1263− int rc = 0;
1264−
1265− rc = bus_register(&visorbus_type);
1266− return rc;
1270+ busreg_rc = bus_register(&visorbus_type);
1271+ return busreg_rc;
12671272 }
12681273
12691274 /** Remove the one-and-only one instance of the visor bus type (visorbus_type).
drivers/staging/unisys/visornic/visornic_main.c+11−7
@@ -1189,16 +1189,16 @@ visornic_rx(struct uiscmdrsp *cmdrsp) · 1188 unmodified lines
11891189 spin_lock_irqsave(&devdata->priv_lock, flags);
11901190 atomic_dec(&devdata->num_rcvbuf_in_iovm);
11911191
1192− /* update rcv stats - call it with priv_lock held */
1193− devdata->net_stats.rx_packets++;
1194− devdata->net_stats.rx_bytes = skb->len;
1195−
11961192 /* set length to how much was ACTUALLY received -
11971193 * NOTE: rcv_done_len includes actual length of data rcvd
11981194 * including ethhdr
11991195 */
12001196 skb->len = cmdrsp->net.rcv.rcv_done_len;
12011197
1198+ /* update rcv stats - call it with priv_lock held */
1199+ devdata->net_stats.rx_packets++;
1200+ devdata->net_stats.rx_bytes += skb->len;
1201+
12021202 /* test enabled while holding lock */
12031203 if (!(devdata->enabled && devdata->enab_dis_acked)) {
12041204 /* don't process it unless we're in enable mode and until
@@ -1924,13 +1924,16 @@ static int visornic_probe(struct visor_device *dev) · 719 unmodified lines
19241924 "%s debugfs_create_dir %s failed\n",
19251925 __func__, netdev->name);
19261926 err = -ENOMEM;
1927− goto cleanup_xmit_cmdrsp;
1927+ goto cleanup_register_netdev;
19281928 }
19291929
19301930 dev_info(&dev->device, "%s success netdev=%s\n",
19311931 __func__, netdev->name);
19321932 return 0;
19331933
1934+cleanup_register_netdev:
1935+ unregister_netdev(netdev);
1936+
19341937 cleanup_napi_add:
19351938 del_timer_sync(&devdata->irq_poll_timer);
19361939 netif_napi_del(&devdata->napi);
@@ -2128,8 +2131,9 @@ static int visornic_init(void) · 191 unmodified lines
21282131 if (!dev_num_pool)
21292132 goto cleanup_workqueue;
21302133
2131− visorbus_register_visor_driver(&visornic_driver);
2132− return 0;
2134+ err = visorbus_register_visor_driver(&visornic_driver);
2135+ if (!err)
2136+ return 0;
21332137
21342138 cleanup_workqueue:
21352139 if (visornic_timeout_reset_workqueue) {
drivers/target/iscsi/iscsi_target_parameters.c+3−2
@@ -407,6 +407,7 @@ int iscsi_create_default_params(struct iscsi_param_list **param_list_ptr) · 406 unmodified lines
407407 TYPERANGE_UTF8, USE_INITIAL_ONLY);
408408 if (!param)
409409 goto out;
410+
410411 /*
411412 * Extra parameters for ISER from RFC-5046
412413 */
@@ -496,9 +497,9 @@ int iscsi_set_keys_to_negotiate( · 83 unmodified lines
496497 } else if (!strcmp(param->name, SESSIONTYPE)) {
497498 SET_PSTATE_NEGOTIATE(param);
498499 } else if (!strcmp(param->name, IFMARKER)) {
499− SET_PSTATE_NEGOTIATE(param);
500+ SET_PSTATE_REJECT(param);
500501 } else if (!strcmp(param->name, OFMARKER)) {
501− SET_PSTATE_NEGOTIATE(param);
502+ SET_PSTATE_REJECT(param);
502503 } else if (!strcmp(param->name, IFMARKINT)) {
503504 SET_PSTATE_REJECT(param);
504505 } else if (!strcmp(param->name, OFMARKINT)) {
drivers/target/target_core_device.c+26−19
@@ -62,22 +62,13 @@ transport_lookup_cmd_lun(struct se_cmd *se_cmd, u64 unpacked_lun) · 61 unmodified lines
6262 struct se_session *se_sess = se_cmd->se_sess;
6363 struct se_node_acl *nacl = se_sess->se_node_acl;
6464 struct se_dev_entry *deve;
65+ sense_reason_t ret = TCM_NO_SENSE;
6566
6667 rcu_read_lock();
6768 deve = target_nacl_find_deve(nacl, unpacked_lun);
6869 if (deve) {
6970 atomic_long_inc(&deve->total_cmds);
7071
71− if ((se_cmd->data_direction == DMA_TO_DEVICE) &&
72− (deve->lun_flags & TRANSPORT_LUNFLAGS_READ_ONLY)) {
73− pr_err("TARGET_CORE[%s]: Detected WRITE_PROTECTED LUN"
74− " Access for 0x%08llx\n",
75− se_cmd->se_tfo->get_fabric_name(),
76− unpacked_lun);
77− rcu_read_unlock();
78− return TCM_WRITE_PROTECTED;
79− }
80−
8172 if (se_cmd->data_direction == DMA_TO_DEVICE)
8273 atomic_long_add(se_cmd->data_length,
8374 &deve->write_bytes);
@@ -93,6 +84,17 @@ transport_lookup_cmd_lun(struct se_cmd *se_cmd, u64 unpacked_lun) · 9 unmodified lines
9384
9485 percpu_ref_get(&se_lun->lun_ref);
9586 se_cmd->lun_ref_active = true;
87+
88+ if ((se_cmd->data_direction == DMA_TO_DEVICE) &&
89+ (deve->lun_flags & TRANSPORT_LUNFLAGS_READ_ONLY)) {
90+ pr_err("TARGET_CORE[%s]: Detected WRITE_PROTECTED LUN"
91+ " Access for 0x%08llx\n",
92+ se_cmd->se_tfo->get_fabric_name(),
93+ unpacked_lun);
94+ rcu_read_unlock();
95+ ret = TCM_WRITE_PROTECTED;
96+ goto ref_dev;
97+ }
9698 }
9799 rcu_read_unlock();
98100
@@ -109,12 +111,6 @@ transport_lookup_cmd_lun(struct se_cmd *se_cmd, u64 unpacked_lun) · 10 unmodified lines
109111 unpacked_lun);
110112 return TCM_NON_EXISTENT_LUN;
111113 }
112− /*
113− * Force WRITE PROTECT for virtual LUN 0
114− */
115− if ((se_cmd->data_direction != DMA_FROM_DEVICE) &&
116− (se_cmd->data_direction != DMA_NONE))
117− return TCM_WRITE_PROTECTED;
118114
119115 se_lun = se_sess->se_tpg->tpg_virt_lun0;
120116 se_cmd->se_lun = se_sess->se_tpg->tpg_virt_lun0;
@@ -123,6 +119,15 @@ transport_lookup_cmd_lun(struct se_cmd *se_cmd, u64 unpacked_lun) · 2 unmodified lines
123119
124120 percpu_ref_get(&se_lun->lun_ref);
125121 se_cmd->lun_ref_active = true;
122+
123+ /*
124+ * Force WRITE PROTECT for virtual LUN 0
125+ */
126+ if ((se_cmd->data_direction != DMA_FROM_DEVICE) &&
127+ (se_cmd->data_direction != DMA_NONE)) {
128+ ret = TCM_WRITE_PROTECTED;
129+ goto ref_dev;
130+ }
126131 }
127132 /*
128133 * RCU reference protected by percpu se_lun->lun_ref taken above that
@@ -130,6 +135,7 @@ transport_lookup_cmd_lun(struct se_cmd *se_cmd, u64 unpacked_lun) · 1 unmodified line
130135 * pointer can be kfree_rcu() by the final se_lun->lun_group put via
131136 * target_core_fabric_configfs.c:target_fabric_port_release
132137 */
138+ref_dev:
133139 se_cmd->se_dev = rcu_dereference_raw(se_lun->lun_se_dev);
134140 atomic_long_inc(&se_cmd->se_dev->num_cmds);
135141
@@ -140,7 +146,7 @@ transport_lookup_cmd_lun(struct se_cmd *se_cmd, u64 unpacked_lun) · 4 unmodified lines
140146 atomic_long_add(se_cmd->data_length,
141147 &se_cmd->se_dev->read_bytes);
142148
143− return 0;
149+ return ret;
144150 }
145151 EXPORT_SYMBOL(transport_lookup_cmd_lun);
146152
@@ -427,8 +433,6 @@ void core_disable_device_list_for_node( · 280 unmodified lines
427433
428434 hlist_del_rcu(&orig->link);
429435 clear_bit(DEF_PR_REG_ACTIVE, &orig->deve_flags);
430− rcu_assign_pointer(orig->se_lun, NULL);
431− rcu_assign_pointer(orig->se_lun_acl, NULL);
432436 orig->lun_flags = 0;
433437 orig->creation_time = 0;
434438 orig->attach_count--;
@@ -439,6 +443,9 @@ void core_disable_device_list_for_node( · 4 unmodified lines
439443 kref_put(&orig->pr_kref, target_pr_kref_release);
440444 wait_for_completion(&orig->pr_comp);
441445
446+ rcu_assign_pointer(orig->se_lun, NULL);
447+ rcu_assign_pointer(orig->se_lun_acl, NULL);
448+
442449 kfree_rcu(orig, rcu_head);
443450
444451 core_scsi3_free_pr_reg_from_nacl(dev, nacl);
drivers/target/target_core_hba.c+1−1
@@ -187,5 +187,5 @@ core_delete_hba(struct se_hba *hba) · 186 unmodified lines
187187
188188 bool target_sense_desc_format(struct se_device *dev)
189189 {
190− return dev->transport->get_blocks(dev) > U32_MAX;
190+ return (dev) ? dev->transport->get_blocks(dev) > U32_MAX : false;
191191 }
drivers/target/target_core_iblock.c+2−0
@@ -105,6 +105,8 @@ static int iblock_configure_device(struct se_device *dev) · 104 unmodified lines
105105 mode = FMODE_READ|FMODE_EXCL;
106106 if (!ib_dev->ibd_readonly)
107107 mode |= FMODE_WRITE;
108+ else
109+ dev->dev_flags |= DF_READ_ONLY;
108110
109111 bd = blkdev_get_by_path(ib_dev->ibd_udev_path, mode, ib_dev);
110112 if (IS_ERR(bd)) {
drivers/target/target_core_pr.c+67−24
@@ -618,7 +618,7 @@ static struct t10_pr_registration *__core_scsi3_do_alloc_registration( · 617 unmodified lines
618618 struct se_device *dev,
619619 struct se_node_acl *nacl,
620620 struct se_lun *lun,
621− struct se_dev_entry *deve,
621+ struct se_dev_entry *dest_deve,
622622 u64 mapped_lun,
623623 unsigned char *isid,
624624 u64 sa_res_key,
@@ -640,7 +640,29 @@ static struct t10_pr_registration *__core_scsi3_do_alloc_registration( · 15 unmodified lines
640640 INIT_LIST_HEAD(&pr_reg->pr_reg_atp_mem_list);
641641 atomic_set(&pr_reg->pr_res_holders, 0);
642642 pr_reg->pr_reg_nacl = nacl;
643− pr_reg->pr_reg_deve = deve;
643+ /*
644+ * For destination registrations for ALL_TG_PT=1 and SPEC_I_PT=1,
645+ * the se_dev_entry->pr_ref will have been already obtained by
646+ * core_get_se_deve_from_rtpi() or __core_scsi3_alloc_registration().
647+ *
648+ * Otherwise, locate se_dev_entry now and obtain a reference until
649+ * registration completes in __core_scsi3_add_registration().
650+ */
651+ if (dest_deve) {
652+ pr_reg->pr_reg_deve = dest_deve;
653+ } else {
654+ rcu_read_lock();
655+ pr_reg->pr_reg_deve = target_nacl_find_deve(nacl, mapped_lun);
656+ if (!pr_reg->pr_reg_deve) {
657+ rcu_read_unlock();
658+ pr_err("Unable to locate PR deve %s mapped_lun: %llu\n",
659+ nacl->initiatorname, mapped_lun);
660+ kmem_cache_free(t10_pr_reg_cache, pr_reg);
661+ return NULL;
662+ }
663+ kref_get(&pr_reg->pr_reg_deve->pr_kref);
664+ rcu_read_unlock();
665+ }
644666 pr_reg->pr_res_mapped_lun = mapped_lun;
645667 pr_reg->pr_aptpl_target_lun = lun->unpacked_lun;
646668 pr_reg->tg_pt_sep_rtpi = lun->lun_rtpi;
@@ -936,17 +958,29 @@ static int __core_scsi3_check_aptpl_registration( · 289 unmodified lines
936958 !(strcmp(pr_reg->pr_tport, t_port)) &&
937959 (pr_reg->pr_reg_tpgt == tpgt) &&
938960 (pr_reg->pr_aptpl_target_lun == target_lun)) {
961+ /*
962+ * Obtain the ->pr_reg_deve pointer + reference, that
963+ * is released by __core_scsi3_add_registration() below.
964+ */
965+ rcu_read_lock();
966+ pr_reg->pr_reg_deve = target_nacl_find_deve(nacl, mapped_lun);
967+ if (!pr_reg->pr_reg_deve) {
968+ pr_err("Unable to locate PR APTPL %s mapped_lun:"
969+ " %llu\n", nacl->initiatorname, mapped_lun);
970+ rcu_read_unlock();
971+ continue;
972+ }
973+ kref_get(&pr_reg->pr_reg_deve->pr_kref);
974+ rcu_read_unlock();
939975
940976 pr_reg->pr_reg_nacl = nacl;
941977 pr_reg->tg_pt_sep_rtpi = lun->lun_rtpi;
942−
943978 list_del(&pr_reg->pr_reg_aptpl_list);
944979 spin_unlock(&pr_tmpl->aptpl_reg_lock);
945980 /*
946981 * At this point all of the pointers in *pr_reg will
947982 * be setup, so go ahead and add the registration.
948983 */
949−
950984 __core_scsi3_add_registration(dev, nacl, pr_reg, 0, 0);
951985 /*
952986 * If this registration is the reservation holder,
@@ -1044,18 +1078,11 @@ static void __core_scsi3_add_registration( · 91 unmodified lines
10441078
10451079 __core_scsi3_dump_registration(tfo, dev, nacl, pr_reg, register_type);
10461080 spin_unlock(&pr_tmpl->registration_lock);
1047−
1048− rcu_read_lock();
1049− deve = pr_reg->pr_reg_deve;
1050− if (deve)
1051− set_bit(DEF_PR_REG_ACTIVE, &deve->deve_flags);
1052− rcu_read_unlock();
1053−
10541081 /*
10551082 * Skip extra processing for ALL_TG_PT=0 or REGISTER_AND_MOVE.
10561083 */
10571084 if (!pr_reg->pr_reg_all_tg_pt || register_move)
1058− return;
1085+ goto out;
10591086 /*
10601087 * Walk pr_reg->pr_reg_atp_list and add registrations for ALL_TG_PT=1
10611088 * allocated in __core_scsi3_alloc_registration()
@@ -1075,19 +1102,31 @@ static void __core_scsi3_add_registration( · 13 unmodified lines
10751102 __core_scsi3_dump_registration(tfo, dev, nacl_tmp, pr_reg_tmp,
10761103 register_type);
10771104 spin_unlock(&pr_tmpl->registration_lock);
1078−
1105+ /*
1106+ * Drop configfs group dependency reference and deve->pr_kref
1107+ * obtained from __core_scsi3_alloc_registration() code.
1108+ */
10791109 rcu_read_lock();
10801110 deve = pr_reg_tmp->pr_reg_deve;
1081− if (deve)
1111+ if (deve) {
10821112 set_bit(DEF_PR_REG_ACTIVE, &deve->deve_flags);
1113+ core_scsi3_lunacl_undepend_item(deve);
1114+ pr_reg_tmp->pr_reg_deve = NULL;
1115+ }
10831116 rcu_read_unlock();
1084−
1085− /*
1086− * Drop configfs group dependency reference from
1087− * __core_scsi3_alloc_registration()
1088− */
1089− core_scsi3_lunacl_undepend_item(pr_reg_tmp->pr_reg_deve);
10901117 }
1118+out:
1119+ /*
1120+ * Drop deve->pr_kref obtained in __core_scsi3_do_alloc_registration()
1121+ */
1122+ rcu_read_lock();
1123+ deve = pr_reg->pr_reg_deve;
1124+ if (deve) {
1125+ set_bit(DEF_PR_REG_ACTIVE, &deve->deve_flags);
1126+ kref_put(&deve->pr_kref, target_pr_kref_release);
1127+ pr_reg->pr_reg_deve = NULL;
1128+ }
1129+ rcu_read_unlock();
10911130 }
10921131
10931132 static int core_scsi3_alloc_registration(
@@ -1785,9 +1824,11 @@ core_scsi3_decode_spec_i_port( · 691 unmodified lines
17851824 dest_node_acl->initiatorname, i_buf, (dest_se_deve) ?
17861825 dest_se_deve->mapped_lun : 0);
17871826
1788− if (!dest_se_deve)
1827+ if (!dest_se_deve) {
1828+ kref_put(&local_pr_reg->pr_reg_deve->pr_kref,
1829+ target_pr_kref_release);
17891830 continue;
1790−
1831+ }
17911832 core_scsi3_lunacl_undepend_item(dest_se_deve);
17921833 core_scsi3_nodeacl_undepend_item(dest_node_acl);
17931834 core_scsi3_tpg_undepend_item(dest_tpg);
@@ -1823,9 +1864,11 @@ out: · 29 unmodified lines
18231864
18241865 kmem_cache_free(t10_pr_reg_cache, dest_pr_reg);
18251866
1826− if (!dest_se_deve)
1867+ if (!dest_se_deve) {
1868+ kref_put(&local_pr_reg->pr_reg_deve->pr_kref,
1869+ target_pr_kref_release);
18271870 continue;
1828−
1871+ }
18291872 core_scsi3_lunacl_undepend_item(dest_se_deve);
18301873 core_scsi3_nodeacl_undepend_item(dest_node_acl);
18311874 core_scsi3_tpg_undepend_item(dest_tpg);
drivers/target/target_core_tpg.c+4−1
@@ -668,7 +668,10 @@ int core_tpg_add_lun( · 667 unmodified lines
668668 list_add_tail(&lun->lun_dev_link, &dev->dev_sep_list);
669669 spin_unlock(&dev->se_port_lock);
670670
671− lun->lun_access = lun_access;
671+ if (dev->dev_flags & DF_READ_ONLY)
672+ lun->lun_access = TRANSPORT_LUNFLAGS_READ_ONLY;
673+ else
674+ lun->lun_access = lun_access;
672675 if (!(dev->se_hba->hba_flags & HBA_FLAGS_INTERNAL_USE))
673676 hlist_add_head_rcu(&lun->link, &tpg->tpg_lun_hlist);
674677 mutex_unlock(&tpg->tpg_lun_mutex);
drivers/thermal/Kconfig+9−8
@@ -163,7 +163,7 @@ config THERMAL_EMULATION · 162 unmodified lines
163163
164164 config HISI_THERMAL
165165 tristate "Hisilicon thermal driver"
166− depends on ARCH_HISI && CPU_THERMAL && OF
166+ depends on (ARCH_HISI && CPU_THERMAL && OF) || COMPILE_TEST
167167 help
168168 Enable this to plug hisilicon's thermal sensor driver into the Linux
169169 thermal framework. cpufreq is used as the cooling device to throttle
@@ -182,7 +182,7 @@ config IMX_THERMAL · 12 unmodified lines
182182
183183 config SPEAR_THERMAL
184184 bool "SPEAr thermal sensor driver"
185− depends on PLAT_SPEAR
185+ depends on PLAT_SPEAR || COMPILE_TEST
186186 depends on OF
187187 help
188188 Enable this to plug the SPEAr thermal sensor driver into the Linux
@@ -190,7 +190,7 @@ config SPEAR_THERMAL · 1 unmodified line
190190
191191 config ROCKCHIP_THERMAL
192192 tristate "Rockchip thermal driver"
193− depends on ARCH_ROCKCHIP
193+ depends on ARCH_ROCKCHIP || COMPILE_TEST
194194 depends on RESET_CONTROLLER
195195 help
196196 Rockchip thermal driver provides support for Temperature sensor
@@ -208,7 +208,7 @@ config RCAR_THERMAL · 11 unmodified lines
208208
209209 config KIRKWOOD_THERMAL
210210 tristate "Temperature sensor on Marvell Kirkwood SoCs"
211− depends on MACH_KIRKWOOD
211+ depends on MACH_KIRKWOOD || COMPILE_TEST
212212 depends on OF
213213 help
214214 Support for the Kirkwood thermal sensor driver into the Linux thermal
@@ -216,7 +216,7 @@ config KIRKWOOD_THERMAL · 1 unmodified line
216216
217217 config DOVE_THERMAL
218218 tristate "Temperature sensor on Marvell Dove SoCs"
219− depends on ARCH_DOVE || MACH_DOVE
219+ depends on ARCH_DOVE || MACH_DOVE || COMPILE_TEST
220220 depends on OF
221221 help
222222 Support for the Dove thermal sensor driver in the Linux thermal
@@ -234,7 +234,7 @@ config DB8500_THERMAL · 11 unmodified lines
234234
235235 config ARMADA_THERMAL
236236 tristate "Armada 370/XP thermal management"
237− depends on ARCH_MVEBU
237+ depends on ARCH_MVEBU || COMPILE_TEST
238238 depends on OF
239239 help
240240 Enable this option if you want to have support for thermal management
@@ -349,11 +349,12 @@ config INTEL_PCH_THERMAL · 108 unmodified lines
349349 programmable trip points and other information.
350350
351351 menu "Texas Instruments thermal drivers"
352+depends on ARCH_HAS_BANDGAP || COMPILE_TEST
352353 source "drivers/thermal/ti-soc-thermal/Kconfig"
353354 endmenu
354355
355356 menu "Samsung thermal drivers"
356−depends on ARCH_EXYNOS
357+depends on ARCH_EXYNOS || COMPILE_TEST
357358 source "drivers/thermal/samsung/Kconfig"
358359 endmenu
359360
@@ -364,7 +365,7 @@ endmenu · 4 unmodified lines
364365
365366 config QCOM_SPMI_TEMP_ALARM
366367 tristate "Qualcomm SPMI PMIC Temperature Alarm"
367− depends on OF && SPMI && IIO
368+ depends on OF && (SPMI || COMPILE_TEST) && IIO
368369 select REGMAP_SPMI
369370 help
370371 This enables a thermal sysfs driver for Qualcomm plug-and-play (QPNP)
drivers/thermal/cpu_cooling.c+31−21
@@ -262,7 +262,9 @@ static int cpufreq_thermal_notifier(struct notifier_block *nb, · 261 unmodified lines
262262 * efficiently. Power is stored in mW, frequency in KHz. The
263263 * resulting table is in ascending order.
264264 *
265− * Return: 0 on success, -E* on error.
265+ * Return: 0 on success, -EINVAL if there are no OPPs for any CPUs,
266+ * -ENOMEM if we run out of memory or -EAGAIN if an OPP was
267+ * added/enabled while the function was executing.
266268 */
267269 static int build_dyn_power_table(struct cpufreq_cooling_device *cpufreq_device,
268270 u32 capacitance)
@@ -273,8 +275,6 @@ static int build_dyn_power_table(struct cpufreq_cooling_device *cpufreq_device, · 4 unmodified lines
273275 int num_opps = 0, cpu, i, ret = 0;
274276 unsigned long freq;
275277
276− rcu_read_lock();
277−
278278 for_each_cpu(cpu, &cpufreq_device->allowed_cpus) {
279279 dev = get_cpu_device(cpu);
280280 if (!dev) {
@@ -284,24 +284,20 @@ static int build_dyn_power_table(struct cpufreq_cooling_device *cpufreq_device, · 3 unmodified lines
284284 }
285285
286286 num_opps = dev_pm_opp_get_opp_count(dev);
287− if (num_opps > 0) {
287+ if (num_opps > 0)
288288 break;
289− } else if (num_opps < 0) {
290− ret = num_opps;
291− goto unlock;
292− }
289+ else if (num_opps < 0)
290+ return num_opps;
293291 }
294292
295− if (num_opps == 0) {
296− ret = -EINVAL;
297− goto unlock;
298− }
293+ if (num_opps == 0)
294+ return -EINVAL;
299295
300296 power_table = kcalloc(num_opps, sizeof(*power_table), GFP_KERNEL);
301− if (!power_table) {
302− ret = -ENOMEM;
303− goto unlock;
304− }
297+ if (!power_table)
298+ return -ENOMEM;
299+
300+ rcu_read_lock();
305301
306302 for (freq = 0, i = 0;
307303 opp = dev_pm_opp_find_freq_ceil(dev, &freq), !IS_ERR(opp);
@@ -309,6 +305,12 @@ static int build_dyn_power_table(struct cpufreq_cooling_device *cpufreq_device, · 1 unmodified line
309305 u32 freq_mhz, voltage_mv;
310306 u64 power;
311307
308+ if (i >= num_opps) {
309+ rcu_read_unlock();
310+ ret = -EAGAIN;
311+ goto free_power_table;
312+ }
313+
312314 freq_mhz = freq / 1000000;
313315 voltage_mv = dev_pm_opp_get_voltage(opp) / 1000;
314316
@@ -326,17 +328,22 @@ static int build_dyn_power_table(struct cpufreq_cooling_device *cpufreq_device, · 11 unmodified lines
326328 power_table[i].power = power;
327329 }
328330
329− if (i == 0) {
331+ rcu_read_unlock();
332+
333+ if (i != num_opps) {
330334 ret = PTR_ERR(opp);
331− goto unlock;
335+ goto free_power_table;
332336 }
333337
334338 cpufreq_device->cpu_dev = dev;
335339 cpufreq_device->dyn_power_table = power_table;
336340 cpufreq_device->dyn_power_table_entries = i;
337341
338−unlock:
339− rcu_read_unlock();
342+ return 0;
343+
344+free_power_table:
345+ kfree(power_table);
346+
340347 return ret;
341348 }
342349
@@ -847,7 +854,7 @@ __cpufreq_cooling_register(struct device_node *np, · 504 unmodified lines
847854 ret = get_idr(&cpufreq_idr, &cpufreq_dev->id);
848855 if (ret) {
849856 cool_dev = ERR_PTR(ret);
850− goto free_table;
857+ goto free_power_table;
851858 }
852859
853860 snprintf(dev_name, sizeof(dev_name), "thermal-cpufreq-%d",
@@ -889,6 +896,8 @@ __cpufreq_cooling_register(struct device_node *np, · 35 unmodified lines
889896
890897 remove_idr:
891898 release_idr(&cpufreq_idr, cpufreq_dev->id);
899+free_power_table:
900+ kfree(cpufreq_dev->dyn_power_table);
892901 free_table:
893902 kfree(cpufreq_dev->freq_table);
894903 free_time_in_idle_timestamp:
@@ -1039,6 +1048,7 @@ void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev) · 144 unmodified lines
10391048
10401049 thermal_cooling_device_unregister(cpufreq_dev->cool_dev);
10411050 release_idr(&cpufreq_idr, cpufreq_dev->id);
1051+ kfree(cpufreq_dev->dyn_power_table);
10421052 kfree(cpufreq_dev->time_in_idle_timestamp);
10431053 kfree(cpufreq_dev->time_in_idle);
10441054 kfree(cpufreq_dev->freq_table);
drivers/thermal/db8500_cpufreq_cooling.c+1−0
@@ -72,6 +72,7 @@ static const struct of_device_id db8500_cpufreq_cooling_match[] = { · 71 unmodified lines
7272 { .compatible = "stericsson,db8500-cpufreq-cooling" },
7373 {},
7474 };
75+MODULE_DEVICE_TABLE(of, db8500_cpufreq_cooling_match);
7576 #endif
7677
7778 static struct platform_driver db8500_cpufreq_cooling_driver = {
drivers/thermal/power_allocator.c+189−64
@@ -24,6 +24,8 @@ · 23 unmodified lines
2424
2525 #include "thermal_core.h"
2626
27+#define INVALID_TRIP -1
28+
2729 #define FRAC_BITS 10
2830 #define int_to_frac(x) ((x) << FRAC_BITS)
2931 #define frac_to_int(x) ((x) >> FRAC_BITS)
@@ -56,22 +58,119 @@ static inline s64 div_frac(s64 x, s64 y) · 26 unmodified lines
5658
5759 /**
5860 * struct power_allocator_params - parameters for the power allocator governor
61+ * @allocated_tzp: whether we have allocated tzp for this thermal zone and
62+ * it needs to be freed on unbind
5963 * @err_integral: accumulated error in the PID controller.
6064 * @prev_err: error in the previous iteration of the PID controller.
6165 * Used to calculate the derivative term.
6266 * @trip_switch_on: first passive trip point of the thermal zone. The
6367 * governor switches on when this trip point is crossed.
68+ * If the thermal zone only has one passive trip point,
69+ * @trip_switch_on should be INVALID_TRIP.
6470 * @trip_max_desired_temperature: last passive trip point of the thermal
6571 * zone. The temperature we are
6672 * controlling for.
6773 */
6874 struct power_allocator_params {
75+ bool allocated_tzp;
6976 s64 err_integral;
7077 s32 prev_err;
7178 int trip_switch_on;
7279 int trip_max_desired_temperature;
7380 };
7481
82+/**
83+ * estimate_sustainable_power() - Estimate the sustainable power of a thermal zone
84+ * @tz: thermal zone we are operating in
85+ *
86+ * For thermal zones that don't provide a sustainable_power in their
87+ * thermal_zone_params, estimate one. Calculate it using the minimum
88+ * power of all the cooling devices as that gives a valid value that
89+ * can give some degree of functionality. For optimal performance of
90+ * this governor, provide a sustainable_power in the thermal zone's
91+ * thermal_zone_params.
92+ */
93+static u32 estimate_sustainable_power(struct thermal_zone_device *tz)
94+{
95+ u32 sustainable_power = 0;
96+ struct thermal_instance *instance;
97+ struct power_allocator_params *params = tz->governor_data;
98+
99+ list_for_each_entry(instance, &tz->thermal_instances, tz_node) {
100+ struct thermal_cooling_device *cdev = instance->cdev;
101+ u32 min_power;
102+
103+ if (instance->trip != params->trip_max_desired_temperature)
104+ continue;
105+
106+ if (power_actor_get_min_power(cdev, tz, &min_power))
107+ continue;
108+
109+ sustainable_power += min_power;
110+ }
111+
112+ return sustainable_power;
113+}
114+
115+/**
116+ * estimate_pid_constants() - Estimate the constants for the PID controller
117+ * @tz: thermal zone for which to estimate the constants
118+ * @sustainable_power: sustainable power for the thermal zone
119+ * @trip_switch_on: trip point number for the switch on temperature
120+ * @control_temp: target temperature for the power allocator governor
121+ * @force: whether to force the update of the constants
122+ *
123+ * This function is used to update the estimation of the PID
124+ * controller constants in struct thermal_zone_parameters.
125+ * Sustainable power is provided in case it was estimated. The
126+ * estimated sustainable_power should not be stored in the
127+ * thermal_zone_parameters so it has to be passed explicitly to this
128+ * function.
129+ *
130+ * If @force is not set, the values in the thermal zone's parameters
131+ * are preserved if they are not zero. If @force is set, the values
132+ * in thermal zone's parameters are overwritten.
133+ */
134+static void estimate_pid_constants(struct thermal_zone_device *tz,
135+ u32 sustainable_power, int trip_switch_on,
136+ int control_temp, bool force)
137+{
138+ int ret;
139+ int switch_on_temp;
140+ u32 temperature_threshold;
141+
142+ ret = tz->ops->get_trip_temp(tz, trip_switch_on, &switch_on_temp);
143+ if (ret)
144+ switch_on_temp = 0;
145+
146+ temperature_threshold = control_temp - switch_on_temp;
147+ /*
148+ * estimate_pid_constants() tries to find appropriate default
149+ * values for thermal zones that don't provide them. If a
150+ * system integrator has configured a thermal zone with two
151+ * passive trip points at the same temperature, that person
152+ * hasn't put any effort to set up the thermal zone properly
153+ * so just give up.
154+ */
155+ if (!temperature_threshold)
156+ return;
157+
158+ if (!tz->tzp->k_po || force)
159+ tz->tzp->k_po = int_to_frac(sustainable_power) /
160+ temperature_threshold;
161+
162+ if (!tz->tzp->k_pu || force)
163+ tz->tzp->k_pu = int_to_frac(2 * sustainable_power) /
164+ temperature_threshold;
165+
166+ if (!tz->tzp->k_i || force)
167+ tz->tzp->k_i = int_to_frac(10) / 1000;
168+ /*
169+ * The default for k_d and integral_cutoff is 0, so we can
170+ * leave them as they are.
171+ */
172+}
173+
75174 /**
76175 * pid_controller() - PID controller
77176 * @tz: thermal zone we are operating in
@@ -98,10 +197,20 @@ static u32 pid_controller(struct thermal_zone_device *tz, · 20 unmodified lines
98197 {
99198 s64 p, i, d, power_range;
100199 s32 err, max_power_frac;
200+ u32 sustainable_power;
101201 struct power_allocator_params *params = tz->governor_data;
102202
103203 max_power_frac = int_to_frac(max_allocatable_power);
104204
205+ if (tz->tzp->sustainable_power) {
206+ sustainable_power = tz->tzp->sustainable_power;
207+ } else {
208+ sustainable_power = estimate_sustainable_power(tz);
209+ estimate_pid_constants(tz, sustainable_power,
210+ params->trip_switch_on, control_temp,
211+ true);
212+ }
213+
105214 err = control_temp - current_temp;
106215 err = int_to_frac(err);
107216
@@ -139,7 +248,7 @@ static u32 pid_controller(struct thermal_zone_device *tz, · 31 unmodified lines
139248 power_range = p + i + d;
140249
141250 /* feed-forward the known sustainable dissipatable power */
142− power_range = tz->tzp->sustainable_power + frac_to_int(power_range);
251+ power_range = sustainable_power + frac_to_int(power_range);
143252
144253 power_range = clamp(power_range, (s64)0, (s64)max_allocatable_power);
145254
@@ -247,6 +356,11 @@ static int allocate_power(struct thermal_zone_device *tz, · 101 unmodified lines
247356 }
248357 }
249358
359+ if (!num_actors) {
360+ ret = -ENODEV;
361+ goto unlock;
362+ }
363+
250364 /*
251365 * We need to allocate five arrays of the same size:
252366 * req_power, max_power, granted_power, extra_actor_power and
@@ -340,43 +454,66 @@ unlock: · 87 unmodified lines
340454 return ret;
341455 }
342456
343−static int get_governor_trips(struct thermal_zone_device *tz,
344− struct power_allocator_params *params)
457+/**
458+ * get_governor_trips() - get the number of the two trip points that are key for this governor
459+ * @tz: thermal zone to operate on
460+ * @params: pointer to private data for this governor
461+ *
462+ * The power allocator governor works optimally with two trips points:
463+ * a "switch on" trip point and a "maximum desired temperature". These
464+ * are defined as the first and last passive trip points.
465+ *
466+ * If there is only one trip point, then that's considered to be the
467+ * "maximum desired temperature" trip point and the governor is always
468+ * on. If there are no passive or active trip points, then the
469+ * governor won't do anything. In fact, its throttle function
470+ * won't be called at all.
471+ */
472+static void get_governor_trips(struct thermal_zone_device *tz,
473+ struct power_allocator_params *params)
345474 {
346− int i, ret, last_passive;
475+ int i, last_active, last_passive;
347476 bool found_first_passive;
348477
349478 found_first_passive = false;
350− last_passive = -1;
351− ret = -EINVAL;
479+ last_active = INVALID_TRIP;
480+ last_passive = INVALID_TRIP;
352481
353482 for (i = 0; i < tz->trips; i++) {
354483 enum thermal_trip_type type;
484+ int ret;
355485
356486 ret = tz->ops->get_trip_type(tz, i, &type);
357− if (ret)
358− return ret;
487+ if (ret) {
488+ dev_warn(&tz->device,
489+ "Failed to get trip point %d type: %d\n", i,
490+ ret);
491+ continue;
492+ }
359493
360− if (!found_first_passive) {
361− if (type == THERMAL_TRIP_PASSIVE) {
494+ if (type == THERMAL_TRIP_PASSIVE) {
495+ if (!found_first_passive) {
362496 params->trip_switch_on = i;
363497 found_first_passive = true;
498+ } else {
499+ last_passive = i;
364500 }
365− } else if (type == THERMAL_TRIP_PASSIVE) {
366− last_passive = i;
501+ } else if (type == THERMAL_TRIP_ACTIVE) {
502+ last_active = i;
367503 } else {
368504 break;
369505 }
370506 }
371507
372− if (last_passive != -1) {
508+ if (last_passive != INVALID_TRIP) {
373509 params->trip_max_desired_temperature = last_passive;
374− ret = 0;
510+ } else if (found_first_passive) {
511+ params->trip_max_desired_temperature = params->trip_switch_on;
512+ params->trip_switch_on = INVALID_TRIP;
375513 } else {
376− ret = -EINVAL;
514+ params->trip_switch_on = INVALID_TRIP;
515+ params->trip_max_desired_temperature = last_active;
377516 }
378−
379− return ret;
380517 }
381518
382519 static void reset_pid_controller(struct power_allocator_params *params)
@@ -405,60 +542,45 @@ static void allow_maximum_power(struct thermal_zone_device *tz) · 22 unmodified lines
405542 * power_allocator_bind() - bind the power_allocator governor to a thermal zone
406543 * @tz: thermal zone to bind it to
407544 *
408− * Check that the thermal zone is valid for this governor, that is, it
409− * has two thermal trips. If so, initialize the PID controller
410− * parameters and bind it to the thermal zone.
545+ * Initialize the PID controller parameters and bind it to the thermal
546+ * zone.
411547 *
412− * Return: 0 on success, -EINVAL if the trips were invalid or -ENOMEM
413− * if we ran out of memory.
548+ * Return: 0 on success, or -ENOMEM if we ran out of memory.
414549 */
415550 static int power_allocator_bind(struct thermal_zone_device *tz)
416551 {
417552 int ret;
418553 struct power_allocator_params *params;
419− int switch_on_temp, control_temp;
420− u32 temperature_threshold;
421−
422− if (!tz->tzp || !tz->tzp->sustainable_power) {
423− dev_err(&tz->device,
424− "power_allocator: missing sustainable_power\n");
425− return -EINVAL;
426− }
554+ int control_temp;
427555
428556 params = kzalloc(sizeof(*params), GFP_KERNEL);
429557 if (!params)
430558 return -ENOMEM;
431559
432− ret = get_governor_trips(tz, params);
433− if (ret) {
434− dev_err(&tz->device,
435− "thermal zone %s has wrong trip setup for power allocator\n",
436− tz->type);
437− goto free;
438− }
560+ if (!tz->tzp) {
561+ tz->tzp = kzalloc(sizeof(*tz->tzp), GFP_KERNEL);
562+ if (!tz->tzp) {
563+ ret = -ENOMEM;
564+ goto free_params;
565+ }
439566
440− ret = tz->ops->get_trip_temp(tz, params->trip_switch_on,
441− &switch_on_temp);
442− if (ret)
443− goto free;
567+ params->allocated_tzp = true;
568+ }
444569
445− ret = tz->ops->get_trip_temp(tz, params->trip_max_desired_temperature,
446− &control_temp);
447− if (ret)
448− goto free;
570+ if (!tz->tzp->sustainable_power)
571+ dev_warn(&tz->device, "power_allocator: sustainable_power will be estimated\n");
449572
450− temperature_threshold = control_temp - switch_on_temp;
573+ get_governor_trips(tz, params);
451574
452− tz->tzp->k_po = tz->tzp->k_po ?:
453− int_to_frac(tz->tzp->sustainable_power) / temperature_threshold;
454− tz->tzp->k_pu = tz->tzp->k_pu ?:
455− int_to_frac(2 * tz->tzp->sustainable_power) /
456− temperature_threshold;
457− tz->tzp->k_i = tz->tzp->k_i ?: int_to_frac(10) / 1000;
458− /*
459− * The default for k_d and integral_cutoff is 0, so we can
460− * leave them as they are.
461− */
575+ if (tz->trips > 0) {
576+ ret = tz->ops->get_trip_temp(tz,
577+ params->trip_max_desired_temperature,
578+ &control_temp);
579+ if (!ret)
580+ estimate_pid_constants(tz, tz->tzp->sustainable_power,
581+ params->trip_switch_on,
582+ control_temp, false);
583+ }
462584
463585 reset_pid_controller(params);
464586
@@ -466,14 +588,23 @@ static int power_allocator_bind(struct thermal_zone_device *tz) · 1 unmodified line
466588
467589 return 0;
468590
469−free:
591+free_params:
470592 kfree(params);
593+
471594 return ret;
472595 }
473596
474597 static void power_allocator_unbind(struct thermal_zone_device *tz)
475598 {
599+ struct power_allocator_params *params = tz->governor_data;
600+
476601 dev_dbg(&tz->device, "Unbinding from thermal zone %d\n", tz->id);
602+
603+ if (params->allocated_tzp) {
604+ kfree(tz->tzp);
605+ tz->tzp = NULL;
606+ }
607+
477608 kfree(tz->governor_data);
478609 tz->governor_data = NULL;
479610 }
@@ -499,13 +630,7 @@ static int power_allocator_throttle(struct thermal_zone_device *tz, int trip) · 19 unmodified lines
499630
500631 ret = tz->ops->get_trip_temp(tz, params->trip_switch_on,
501632 &switch_on_temp);
502− if (ret) {
503− dev_warn(&tz->device,
504− "Failed to get switch on temperature: %d\n", ret);
505− return ret;
506− }
507−
508− if (current_temp < switch_on_temp) {
633+ if (!ret && (current_temp < switch_on_temp)) {
509634 tz->passive = 0;
510635 reset_pid_controller(params);
511636 allow_maximum_power(tz);
drivers/thermal/thermal_core.c+28−0
@@ -1012,6 +1012,34 @@ int power_actor_get_max_power(struct thermal_cooling_device *cdev, · 1011 unmodified lines
10121012 return cdev->ops->state2power(cdev, tz, 0, max_power);
10131013 }
10141014
1015+/**
1016+ * power_actor_get_min_power() - get the mainimum power that a cdev can consume
1017+ * @cdev: pointer to &thermal_cooling_device
1018+ * @tz: a valid thermal zone device pointer
1019+ * @min_power: pointer in which to store the minimum power
1020+ *
1021+ * Calculate the minimum power consumption in milliwatts that the
1022+ * cooling device can currently consume and store it in @min_power.
1023+ *
1024+ * Return: 0 on success, -EINVAL if @cdev doesn't support the
1025+ * power_actor API or -E* on other error.
1026+ */
1027+int power_actor_get_min_power(struct thermal_cooling_device *cdev,
1028+ struct thermal_zone_device *tz, u32 *min_power)
1029+{
1030+ unsigned long max_state;
1031+ int ret;
1032+
1033+ if (!cdev_is_power_actor(cdev))
1034+ return -EINVAL;
1035+
1036+ ret = cdev->ops->get_max_state(cdev, &max_state);
1037+ if (ret)
1038+ return ret;
1039+
1040+ return cdev->ops->state2power(cdev, tz, max_state, min_power);
1041+}
1042+
10151043 /**
10161044 * power_actor_set_power() - limit the maximum power that a cooling device can consume
10171045 * @cdev: pointer to &thermal_cooling_device
drivers/thermal/ti-soc-thermal/Kconfig+3−5
@@ -1,7 +1,5 @@
11 config TI_SOC_THERMAL
22 tristate "Texas Instruments SoCs temperature sensor driver"
3− depends on THERMAL
4− depends on ARCH_HAS_BANDGAP
53 help
64 If you say yes here you get support for the Texas Instruments
75 OMAP4460+ on die bandgap temperature sensor support. The register
@@ -24,7 +22,7 @@ config TI_THERMAL · 16 unmodified lines
2422 config OMAP4_THERMAL
2523 bool "Texas Instruments OMAP4 thermal support"
2624 depends on TI_SOC_THERMAL
27− depends on ARCH_OMAP4
25+ depends on ARCH_OMAP4 || COMPILE_TEST
2826 help
2927 If you say yes here you get thermal support for the Texas Instruments
3028 OMAP4 SoC family. The current chip supported are:
@@ -38,7 +36,7 @@ config OMAP4_THERMAL · 7 unmodified lines
3836 config OMAP5_THERMAL
3937 bool "Texas Instruments OMAP5 thermal support"
4038 depends on TI_SOC_THERMAL
41− depends on SOC_OMAP5
39+ depends on SOC_OMAP5 || COMPILE_TEST
4240 help
4341 If you say yes here you get thermal support for the Texas Instruments
4442 OMAP5 SoC family. The current chip supported are:
@@ -50,7 +48,7 @@ config OMAP5_THERMAL · 5 unmodified lines
5048 config DRA752_THERMAL
5149 bool "Texas Instruments DRA752 thermal support"
5250 depends on TI_SOC_THERMAL
53− depends on SOC_DRA7XX
51+ depends on SOC_DRA7XX || COMPILE_TEST
5452 help
5553 If you say yes here you get thermal support for the Texas Instruments
5654 DRA752 SoC family. The current chip supported are:
drivers/thunderbolt/nhi.c+1−1
@@ -643,7 +643,7 @@ static struct pci_device_id nhi_ids[] = { · 642 unmodified lines
643643 {
644644 .class = PCI_CLASS_SYSTEM_OTHER << 8, .class_mask = ~0,
645645 .vendor = PCI_VENDOR_ID_INTEL, .device = 0x156c,
646− .subvendor = 0x2222, .subdevice = 0x1111,
646+ .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID,
647647 },
648648 { 0,}
649649 };
drivers/tty/serial/8250/8250_port.c+2−0
@@ -2910,3 +2910,5 @@ int serial8250_console_setup(struct uart_port *port, char *options, bool probe) · 2909 unmodified lines
29102910 }
29112911
29122912 #endif /* CONFIG_SERIAL_8250_CONSOLE */
2913+
2914+MODULE_LICENSE("GPL");
drivers/usb/chipidea/ci_hdrc_imx.c+1−1
@@ -61,7 +61,7 @@ static const struct of_device_id ci_hdrc_imx_dt_ids[] = { · 60 unmodified lines
6161 { .compatible = "fsl,imx27-usb", .data = &imx27_usb_data},
6262 { .compatible = "fsl,imx6q-usb", .data = &imx6q_usb_data},
6363 { .compatible = "fsl,imx6sl-usb", .data = &imx6sl_usb_data},
64− { .compatible = "fsl,imx6sx-usb", .data = &imx6sl_usb_data},
64+ { .compatible = "fsl,imx6sx-usb", .data = &imx6sx_usb_data},
6565 { /* sentinel */ }
6666 };
6767 MODULE_DEVICE_TABLE(of, ci_hdrc_imx_dt_ids);
drivers/usb/chipidea/ci_hdrc_usb2.c+19−6
@@ -12,6 +12,7 @@ · 11 unmodified lines
1212 #include <linux/dma-mapping.h>
1313 #include <linux/module.h>
1414 #include <linux/of.h>
15+#include <linux/of_platform.h>
1516 #include <linux/phy/phy.h>
1617 #include <linux/platform_device.h>
1718 #include <linux/usb/chipidea.h>
@@ -30,18 +31,36 @@ static const struct ci_hdrc_platform_data ci_default_pdata = { · 12 unmodified lines
3031 .flags = CI_HDRC_DISABLE_STREAMING,
3132 };
3233
34+static struct ci_hdrc_platform_data ci_zynq_pdata = {
35+ .capoffset = DEF_CAPOFFSET,
36+};
37+
38+static const struct of_device_id ci_hdrc_usb2_of_match[] = {
39+ { .compatible = "chipidea,usb2"},
40+ { .compatible = "xlnx,zynq-usb-2.20a", .data = &ci_zynq_pdata},
41+ { }
42+};
43+MODULE_DEVICE_TABLE(of, ci_hdrc_usb2_of_match);
44+
3345 static int ci_hdrc_usb2_probe(struct platform_device *pdev)
3446 {
3547 struct device *dev = &pdev->dev;
3648 struct ci_hdrc_usb2_priv *priv;
3749 struct ci_hdrc_platform_data *ci_pdata = dev_get_platdata(dev);
3850 int ret;
51+ const struct of_device_id *match;
3952
4053 if (!ci_pdata) {
4154 ci_pdata = devm_kmalloc(dev, sizeof(*ci_pdata), GFP_KERNEL);
4255 *ci_pdata = ci_default_pdata; /* struct copy */
4356 }
4457
58+ match = of_match_device(ci_hdrc_usb2_of_match, &pdev->dev);
59+ if (match && match->data) {
60+ /* struct copy */
61+ *ci_pdata = *(struct ci_hdrc_platform_data *)match->data;
62+ }
63+
4564 priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
4665 if (!priv)
4766 return -ENOMEM;
@@ -96,12 +115,6 @@ static int ci_hdrc_usb2_remove(struct platform_device *pdev) · 48 unmodified lines
96115 return 0;
97116 }
98117
99−static const struct of_device_id ci_hdrc_usb2_of_match[] = {
100− { .compatible = "chipidea,usb2" },
101− { }
102−};
103−MODULE_DEVICE_TABLE(of, ci_hdrc_usb2_of_match);
104−
105118 static struct platform_driver ci_hdrc_usb2_driver = {
106119 .probe = ci_hdrc_usb2_probe,
107120 .remove = ci_hdrc_usb2_remove,
drivers/usb/chipidea/udc.c+44−40
@@ -656,6 +656,44 @@ __acquires(hwep->lock) · 655 unmodified lines
656656 return 0;
657657 }
658658
659+static int _ep_set_halt(struct usb_ep *ep, int value, bool check_transfer)
660+{
661+ struct ci_hw_ep *hwep = container_of(ep, struct ci_hw_ep, ep);
662+ int direction, retval = 0;
663+ unsigned long flags;
664+
665+ if (ep == NULL || hwep->ep.desc == NULL)
666+ return -EINVAL;
667+
668+ if (usb_endpoint_xfer_isoc(hwep->ep.desc))
669+ return -EOPNOTSUPP;
670+
671+ spin_lock_irqsave(hwep->lock, flags);
672+
673+ if (value && hwep->dir == TX && check_transfer &&
674+ !list_empty(&hwep->qh.queue) &&
675+ !usb_endpoint_xfer_control(hwep->ep.desc)) {
676+ spin_unlock_irqrestore(hwep->lock, flags);
677+ return -EAGAIN;
678+ }
679+
680+ direction = hwep->dir;
681+ do {
682+ retval |= hw_ep_set_halt(hwep->ci, hwep->num, hwep->dir, value);
683+
684+ if (!value)
685+ hwep->wedge = 0;
686+
687+ if (hwep->type == USB_ENDPOINT_XFER_CONTROL)
688+ hwep->dir = (hwep->dir == TX) ? RX : TX;
689+
690+ } while (hwep->dir != direction);
691+
692+ spin_unlock_irqrestore(hwep->lock, flags);
693+ return retval;
694+}
695+
696+
659697 /**
660698 * _gadget_stop_activity: stops all USB activity, flushes & disables all endpts
661699 * @gadget: gadget
@@ -1051,7 +1089,7 @@ __acquires(ci->lock) · 389 unmodified lines
10511089 num += ci->hw_ep_max / 2;
10521090
10531091 spin_unlock(&ci->lock);
1054− err = usb_ep_set_halt(&ci->ci_hw_ep[num].ep);
1092+ err = _ep_set_halt(&ci->ci_hw_ep[num].ep, 1, false);
10551093 spin_lock(&ci->lock);
10561094 if (!err)
10571095 isr_setup_status_phase(ci);
@@ -1117,8 +1155,8 @@ delegate: · 59 unmodified lines
11171155
11181156 if (err < 0) {
11191157 spin_unlock(&ci->lock);
1120− if (usb_ep_set_halt(&hwep->ep))
1121− dev_err(ci->dev, "error: ep_set_halt\n");
1158+ if (_ep_set_halt(&hwep->ep, 1, false))
1159+ dev_err(ci->dev, "error: _ep_set_halt\n");
11221160 spin_lock(&ci->lock);
11231161 }
11241162 }
@@ -1149,9 +1187,9 @@ __acquires(ci->lock) · 24 unmodified lines
11491187 err = isr_setup_status_phase(ci);
11501188 if (err < 0) {
11511189 spin_unlock(&ci->lock);
1152− if (usb_ep_set_halt(&hwep->ep))
1190+ if (_ep_set_halt(&hwep->ep, 1, false))
11531191 dev_err(ci->dev,
1154− "error: ep_set_halt\n");
1192+ "error: _ep_set_halt\n");
11551193 spin_lock(&ci->lock);
11561194 }
11571195 }
@@ -1397,41 +1435,7 @@ static int ep_dequeue(struct usb_ep *ep, struct usb_request *req) · 239 unmodified lines
13971435 */
13981436 static int ep_set_halt(struct usb_ep *ep, int value)
13991437 {
1400− struct ci_hw_ep *hwep = container_of(ep, struct ci_hw_ep, ep);
1401− int direction, retval = 0;
1402− unsigned long flags;
1403−
1404− if (ep == NULL || hwep->ep.desc == NULL)
1405− return -EINVAL;
1406−
1407− if (usb_endpoint_xfer_isoc(hwep->ep.desc))
1408− return -EOPNOTSUPP;
1409−
1410− spin_lock_irqsave(hwep->lock, flags);
1411−
1412−#ifndef STALL_IN
1413− /* g_file_storage MS compliant but g_zero fails chapter 9 compliance */
1414− if (value && hwep->type == USB_ENDPOINT_XFER_BULK && hwep->dir == TX &&
1415− !list_empty(&hwep->qh.queue)) {
1416− spin_unlock_irqrestore(hwep->lock, flags);
1417− return -EAGAIN;
1418− }
1419−#endif
1420−
1421− direction = hwep->dir;
1422− do {
1423− retval |= hw_ep_set_halt(hwep->ci, hwep->num, hwep->dir, value);
1424−
1425− if (!value)
1426− hwep->wedge = 0;
1427−
1428− if (hwep->type == USB_ENDPOINT_XFER_CONTROL)
1429− hwep->dir = (hwep->dir == TX) ? RX : TX;
1430−
1431− } while (hwep->dir != direction);
1432−
1433− spin_unlock_irqrestore(hwep->lock, flags);
1434− return retval;
1438+ return _ep_set_halt(ep, value, true);
14351439 }
14361440
14371441 /**
drivers/usb/core/config.c+3−2
@@ -112,7 +112,7 @@ static void usb_parse_ss_endpoint_companion(struct device *ddev, int cfgno, · 111 unmodified lines
112112 cfgno, inum, asnum, ep->desc.bEndpointAddress);
113113 ep->ss_ep_comp.bmAttributes = 16;
114114 } else if (usb_endpoint_xfer_isoc(&ep->desc) &&
115− desc->bmAttributes > 2) {
115+ USB_SS_MULT(desc->bmAttributes) > 3) {
116116 dev_warn(ddev, "Isoc endpoint has Mult of %d in "
117117 "config %d interface %d altsetting %d ep %d: "
118118 "setting to 3\n", desc->bmAttributes + 1,
@@ -121,7 +121,8 @@ static void usb_parse_ss_endpoint_companion(struct device *ddev, int cfgno, · 2 unmodified lines
121121 }
122122
123123 if (usb_endpoint_xfer_isoc(&ep->desc))
124− max_tx = (desc->bMaxBurst + 1) * (desc->bmAttributes + 1) *
124+ max_tx = (desc->bMaxBurst + 1) *
125+ (USB_SS_MULT(desc->bmAttributes)) *
125126 usb_endpoint_maxp(&ep->desc);
126127 else if (usb_endpoint_xfer_int(&ep->desc))
127128 max_tx = usb_endpoint_maxp(&ep->desc) *
drivers/usb/dwc3/dwc3-omap.c+2−2
@@ -514,8 +514,6 @@ static int dwc3_omap_probe(struct platform_device *pdev) · 513 unmodified lines
514514 goto err1;
515515 }
516516
517− dwc3_omap_enable_irqs(omap);
518−
519517 ret = dwc3_omap_extcon_register(omap);
520518 if (ret < 0)
521519 goto err2;
@@ -526,6 +524,8 @@ static int dwc3_omap_probe(struct platform_device *pdev) · 4 unmodified lines
526524 goto err3;
527525 }
528526
527+ dwc3_omap_enable_irqs(omap);
528+
529529 return 0;
530530
531531 err3:
drivers/usb/dwc3/gadget.c+0−4
@@ -2665,8 +2665,6 @@ static irqreturn_t dwc3_interrupt(int irq, void *_dwc) · 2664 unmodified lines
26652665 int i;
26662666 irqreturn_t ret = IRQ_NONE;
26672667
2668− spin_lock(&dwc->lock);
2669−
26702668 for (i = 0; i < dwc->num_event_buffers; i++) {
26712669 irqreturn_t status;
26722670
@@ -2675,8 +2673,6 @@ static irqreturn_t dwc3_interrupt(int irq, void *_dwc) · 2 unmodified lines
26752673 ret = status;
26762674 }
26772675
2678− spin_unlock(&dwc->lock);
2679−
26802676 return ret;
26812677 }
26822678
drivers/usb/gadget/epautoconf.c+1−0
@@ -186,6 +186,7 @@ void usb_ep_autoconfig_reset (struct usb_gadget *gadget) · 185 unmodified lines
186186
187187 list_for_each_entry (ep, &gadget->ep_list, ep_list) {
188188 ep->claimed = false;
189+ ep->driver_data = NULL;
189190 }
190191 gadget->in_epnum = 0;
191192 gadget->out_epnum = 0;
drivers/usb/gadget/udc/amd5536udc.c+20−23
@@ -3138,8 +3138,8 @@ static void udc_pci_remove(struct pci_dev *pdev) · 3137 unmodified lines
31383138 writel(AMD_BIT(UDC_DEVCFG_SOFTRESET), &dev->regs->cfg);
31393139 if (dev->irq_registered)
31403140 free_irq(pdev->irq, dev);
3141− if (dev->regs)
3142− iounmap(dev->regs);
3141+ if (dev->virt_addr)
3142+ iounmap(dev->virt_addr);
31433143 if (dev->mem_region)
31443144 release_mem_region(pci_resource_start(pdev, 0),
31453145 pci_resource_len(pdev, 0));
@@ -3226,17 +3226,13 @@ static int udc_pci_probe( · 80 unmodified lines
32263226
32273227 /* init */
32283228 dev = kzalloc(sizeof(struct udc), GFP_KERNEL);
3229− if (!dev) {
3230− retval = -ENOMEM;
3231− goto finished;
3232− }
3229+ if (!dev)
3230+ return -ENOMEM;
32333231
32343232 /* pci setup */
32353233 if (pci_enable_device(pdev) < 0) {
3236− kfree(dev);
3237− dev = NULL;
32383234 retval = -ENODEV;
3239− goto finished;
3235+ goto err_pcidev;
32403236 }
32413237 dev->active = 1;
32423238
@@ -3246,28 +3242,22 @@ static int udc_pci_probe( · 3 unmodified lines
32463242
32473243 if (!request_mem_region(resource, len, name)) {
32483244 dev_dbg(&pdev->dev, "pci device used already\n");
3249− kfree(dev);
3250− dev = NULL;
32513245 retval = -EBUSY;
3252− goto finished;
3246+ goto err_memreg;
32533247 }
32543248 dev->mem_region = 1;
32553249
32563250 dev->virt_addr = ioremap_nocache(resource, len);
32573251 if (dev->virt_addr == NULL) {
32583252 dev_dbg(&pdev->dev, "start address cannot be mapped\n");
3259− kfree(dev);
3260− dev = NULL;
32613253 retval = -EFAULT;
3262− goto finished;
3254+ goto err_ioremap;
32633255 }
32643256
32653257 if (!pdev->irq) {
32663258 dev_err(&pdev->dev, "irq not set\n");
3267− kfree(dev);
3268− dev = NULL;
32693259 retval = -ENODEV;
3270− goto finished;
3260+ goto err_irq;
32713261 }
32723262
32733263 spin_lock_init(&dev->lock);
@@ -3283,10 +3273,8 @@ static int udc_pci_probe( · 9 unmodified lines
32833273
32843274 if (request_irq(pdev->irq, udc_irq, IRQF_SHARED, name, dev) != 0) {
32853275 dev_dbg(&pdev->dev, "request_irq(%d) fail\n", pdev->irq);
3286− kfree(dev);
3287− dev = NULL;
32883276 retval = -EBUSY;
3289− goto finished;
3277+ goto err_irq;
32903278 }
32913279 dev->irq_registered = 1;
32923280
@@ -3314,8 +3302,17 @@ static int udc_pci_probe( · 21 unmodified lines
33143302 return 0;
33153303
33163304 finished:
3317− if (dev)
3318− udc_pci_remove(pdev);
3305+ udc_pci_remove(pdev);
3306+ return retval;
3307+
3308+err_irq:
3309+ iounmap(dev->virt_addr);
3310+err_ioremap:
3311+ release_mem_region(resource, len);
3312+err_memreg:
3313+ pci_disable_device(pdev);
3314+err_pcidev:
3315+ kfree(dev);
33193316 return retval;
33203317 }
33213318
drivers/usb/gadget/udc/atmel_usba_udc.c+11−0
@@ -2002,6 +2002,17 @@ static struct usba_ep * atmel_udc_of_init(struct platform_device *pdev, · 2001 unmodified lines
20022002 ep->udc = udc;
20032003 INIT_LIST_HEAD(&ep->queue);
20042004
2005+ if (ep->index == 0) {
2006+ ep->ep.caps.type_control = true;
2007+ } else {
2008+ ep->ep.caps.type_iso = ep->can_isoc;
2009+ ep->ep.caps.type_bulk = true;
2010+ ep->ep.caps.type_int = true;
2011+ }
2012+
2013+ ep->ep.caps.dir_in = true;
2014+ ep->ep.caps.dir_out = true;
2015+
20052016 if (i)
20062017 list_add_tail(&ep->ep.ep_list, &udc->gadget.ep_list);
20072018
drivers/usb/gadget/udc/bdc/bdc_core.c+1−2
@@ -324,8 +324,7 @@ static void bdc_mem_free(struct bdc *bdc) · 323 unmodified lines
324324 bdc->scratchpad.buff, bdc->scratchpad.sp_dma);
325325
326326 /* Destroy the dma pools */
327− if (bdc->bd_table_pool)
328− dma_pool_destroy(bdc->bd_table_pool);
327+ dma_pool_destroy(bdc->bd_table_pool);
329328
330329 /* Free the bdc_ep array */
331330 kfree(bdc->bdc_ep_array);
drivers/usb/gadget/udc/dummy_hcd.c+30−16
@@ -1348,6 +1348,7 @@ static int transfer(struct dummy_hcd *dum_hcd, struct urb *urb, · 1347 unmodified lines
13481348 {
13491349 struct dummy *dum = dum_hcd->dum;
13501350 struct dummy_request *req;
1351+ int sent = 0;
13511352
13521353 top:
13531354 /* if there's no request queued, the device is NAKing; return */
@@ -1385,12 +1386,15 @@ top: · 31 unmodified lines
13851386 if (len == 0)
13861387 break;
13871388
1388− /* use an extra pass for the final short packet */
1389− if (len > ep->ep.maxpacket) {
1390− rescan = 1;
1391− len -= (len % ep->ep.maxpacket);
1389+ /* send multiple of maxpacket first, then remainder */
1390+ if (len >= ep->ep.maxpacket) {
1391+ is_short = 0;
1392+ if (len % ep->ep.maxpacket)
1393+ rescan = 1;
1394+ len -= len % ep->ep.maxpacket;
1395+ } else {
1396+ is_short = 1;
13921397 }
1393− is_short = (len % ep->ep.maxpacket) != 0;
13941398
13951399 len = dummy_perform_transfer(urb, req, len);
13961400
@@ -1399,6 +1403,7 @@ top: · 2 unmodified lines
13991403 req->req.status = len;
14001404 } else {
14011405 limit -= len;
1406+ sent += len;
14021407 urb->actual_length += len;
14031408 req->req.actual += len;
14041409 }
@@ -1421,7 +1426,7 @@ top: · 16 unmodified lines
14211426 *status = -EOVERFLOW;
14221427 else
14231428 *status = 0;
1424− } else if (!to_host) {
1429+ } else {
14251430 *status = 0;
14261431 if (host_len > dev_len)
14271432 req->req.status = -EOVERFLOW;
@@ -1429,15 +1434,24 @@ top: · 1 unmodified line
14291434 req->req.status = 0;
14301435 }
14311436
1432− /* many requests terminate without a short packet */
1437+ /*
1438+ * many requests terminate without a short packet.
1439+ * send a zlp if demanded by flags.
1440+ */
14331441 } else {
1434− if (req->req.length == req->req.actual
1435− && !req->req.zero)
1436− req->req.status = 0;
1437− if (urb->transfer_buffer_length == urb->actual_length
1438− && !(urb->transfer_flags
1439− & URB_ZERO_PACKET))
1440− *status = 0;
1442+ if (req->req.length == req->req.actual) {
1443+ if (req->req.zero && to_host)
1444+ rescan = 1;
1445+ else
1446+ req->req.status = 0;
1447+ }
1448+ if (urb->transfer_buffer_length == urb->actual_length) {
1449+ if (urb->transfer_flags & URB_ZERO_PACKET &&
1450+ !to_host)
1451+ rescan = 1;
1452+ else
1453+ *status = 0;
1454+ }
14411455 }
14421456
14431457 /* device side completion --> continuable */
@@ -1460,7 +1474,7 @@ top: · 16 unmodified lines
14601474 if (rescan)
14611475 goto top;
14621476 }
1463− return limit;
1477+ return sent;
14641478 }
14651479
14661480 static int periodic_bytes(struct dummy *dum, struct dummy_ep *ep)
@@ -1890,7 +1904,7 @@ restart: · 423 unmodified lines
18901904 default:
18911905 treat_control_like_bulk:
18921906 ep->last_io = jiffies;
1893− total = transfer(dum_hcd, urb, ep, limit, &status);
1907+ total -= transfer(dum_hcd, urb, ep, limit, &status);
18941908 break;
18951909 }
18961910
drivers/usb/gadget/udc/gr_udc.c+1−2
@@ -2117,8 +2117,7 @@ static int gr_remove(struct platform_device *pdev) · 2116 unmodified lines
21172117 return -EBUSY;
21182118
21192119 gr_dfs_delete(dev);
2120− if (dev->desc_pool)
2121− dma_pool_destroy(dev->desc_pool);
2120+ dma_pool_destroy(dev->desc_pool);
21222121 platform_set_drvdata(pdev, NULL);
21232122
21242123 gr_free_request(&dev->epi[0].ep, &dev->ep0reqi->req);
drivers/usb/gadget/udc/mv_u3d_core.c+1−2
@@ -1767,8 +1767,7 @@ static int mv_u3d_remove(struct platform_device *dev) · 1766 unmodified lines
17671767 usb_del_gadget_udc(&u3d->gadget);
17681768
17691769 /* free memory allocated in probe */
1770− if (u3d->trb_pool)
1771− dma_pool_destroy(u3d->trb_pool);
1770+ dma_pool_destroy(u3d->trb_pool);
17721771
17731772 if (u3d->ep_context)
17741773 dma_free_coherent(&dev->dev, u3d->ep_context_size,
drivers/usb/gadget/udc/mv_udc_core.c+1−2
@@ -2100,8 +2100,7 @@ static int mv_udc_remove(struct platform_device *pdev) · 2099 unmodified lines
21002100 }
21012101
21022102 /* free memory allocated in probe */
2103− if (udc->dtd_pool)
2104− dma_pool_destroy(udc->dtd_pool);
2103+ dma_pool_destroy(udc->dtd_pool);
21052104
21062105 if (udc->ep_dqh)
21072106 dma_free_coherent(&pdev->dev, udc->ep_dqh_size,
drivers/usb/host/xhci-mem.c+8−9
@@ -1498,10 +1498,10 @@ int xhci_endpoint_init(struct xhci_hcd *xhci, · 1497 unmodified lines
14981498 * use Event Data TRBs, and we don't chain in a link TRB on short
14991499 * transfers, we're basically dividing by 1.
15001500 *
1501− * xHCI 1.0 specification indicates that the Average TRB Length should
1502− * be set to 8 for control endpoints.
1501+ * xHCI 1.0 and 1.1 specification indicates that the Average TRB Length
1502+ * should be set to 8 for control endpoints.
15031503 */
1504− if (usb_endpoint_xfer_control(&ep->desc) && xhci->hci_version == 0x100)
1504+ if (usb_endpoint_xfer_control(&ep->desc) && xhci->hci_version >= 0x100)
15051505 ep_ctx->tx_info |= cpu_to_le32(AVG_TRB_LENGTH_FOR_EP(8));
15061506 else
15071507 ep_ctx->tx_info |=
@@ -1792,8 +1792,7 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci) · 284 unmodified lines
17921792 int size;
17931793 int i, j, num_ports;
17941794
1795− if (timer_pending(&xhci->cmd_timer))
1796− del_timer_sync(&xhci->cmd_timer);
1795+ del_timer_sync(&xhci->cmd_timer);
17971796
17981797 /* Free the Event Ring Segment Table and the actual Event Ring */
17991798 size = sizeof(struct xhci_erst_entry)*(xhci->erst.num_entries);
@@ -2321,6 +2320,10 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags) · 521 unmodified lines
23212320
23222321 INIT_LIST_HEAD(&xhci->cmd_list);
23232322
2323+ /* init command timeout timer */
2324+ setup_timer(&xhci->cmd_timer, xhci_handle_command_timeout,
2325+ (unsigned long)xhci);
2326+
23242327 page_size = readl(&xhci->op_regs->page_size);
23252328 xhci_dbg_trace(xhci, trace_xhci_dbg_init,
23262329 "Supported page size register = 0x%x", page_size);
@@ -2505,10 +2508,6 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags) · 178 unmodified lines
25052508 "Wrote ERST address to ir_set 0.");
25062509 xhci_print_ir_set(xhci, 0);
25072510
2508− /* init command timeout timer */
2509− setup_timer(&xhci->cmd_timer, xhci_handle_command_timeout,
2510− (unsigned long)xhci);
2511−
25122511 /*
25132512 * XXX: Might need to set the Interrupter Moderation Register to
25142513 * something other than the default (~1ms minimum between interrupts).
drivers/usb/host/xhci-pci.c+45−45
@@ -180,51 +180,6 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci) · 179 unmodified lines
180180 "QUIRK: Resetting on resume");
181181 }
182182
183−/*
184− * In some Intel xHCI controllers, in order to get D3 working,
185− * through a vendor specific SSIC CONFIG register at offset 0x883c,
186− * SSIC PORT need to be marked as "unused" before putting xHCI
187− * into D3. After D3 exit, the SSIC port need to be marked as "used".
188− * Without this change, xHCI might not enter D3 state.
189− * Make sure PME works on some Intel xHCI controllers by writing 1 to clear
190− * the Internal PME flag bit in vendor specific PMCTRL register at offset 0x80a4
191− */
192−static void xhci_pme_quirk(struct usb_hcd *hcd, bool suspend)
193−{
194− struct xhci_hcd *xhci = hcd_to_xhci(hcd);
195− struct pci_dev *pdev = to_pci_dev(hcd->self.controller);
196− u32 val;
197− void __iomem *reg;
198−
199− if (pdev->vendor == PCI_VENDOR_ID_INTEL &&
200− pdev->device == PCI_DEVICE_ID_INTEL_CHERRYVIEW_XHCI) {
201−
202− reg = (void __iomem *) xhci->cap_regs + PORT2_SSIC_CONFIG_REG2;
203−
204− /* Notify SSIC that SSIC profile programming is not done */
205− val = readl(reg) & ~PROG_DONE;
206− writel(val, reg);
207−
208− /* Mark SSIC port as unused(suspend) or used(resume) */
209− val = readl(reg);
210− if (suspend)
211− val |= SSIC_PORT_UNUSED;
212− else
213− val &= ~SSIC_PORT_UNUSED;
214− writel(val, reg);
215−
216− /* Notify SSIC that SSIC profile programming is done */
217− val = readl(reg) | PROG_DONE;
218− writel(val, reg);
219− readl(reg);
220− }
221−
222− reg = (void __iomem *) xhci->cap_regs + 0x80a4;
223− val = readl(reg);
224− writel(val | BIT(28), reg);
225− readl(reg);
226−}
227−
228183 #ifdef CONFIG_ACPI
229184 static void xhci_pme_acpi_rtd3_enable(struct pci_dev *dev)
230185 {
@@ -345,6 +300,51 @@ static void xhci_pci_remove(struct pci_dev *dev) · 114 unmodified lines
345300 }
346301
347302 #ifdef CONFIG_PM
303+/*
304+ * In some Intel xHCI controllers, in order to get D3 working,
305+ * through a vendor specific SSIC CONFIG register at offset 0x883c,
306+ * SSIC PORT need to be marked as "unused" before putting xHCI
307+ * into D3. After D3 exit, the SSIC port need to be marked as "used".
308+ * Without this change, xHCI might not enter D3 state.
309+ * Make sure PME works on some Intel xHCI controllers by writing 1 to clear
310+ * the Internal PME flag bit in vendor specific PMCTRL register at offset 0x80a4
311+ */
312+static void xhci_pme_quirk(struct usb_hcd *hcd, bool suspend)
313+{
314+ struct xhci_hcd *xhci = hcd_to_xhci(hcd);
315+ struct pci_dev *pdev = to_pci_dev(hcd->self.controller);
316+ u32 val;
317+ void __iomem *reg;
318+
319+ if (pdev->vendor == PCI_VENDOR_ID_INTEL &&
320+ pdev->device == PCI_DEVICE_ID_INTEL_CHERRYVIEW_XHCI) {
321+
322+ reg = (void __iomem *) xhci->cap_regs + PORT2_SSIC_CONFIG_REG2;
323+
324+ /* Notify SSIC that SSIC profile programming is not done */
325+ val = readl(reg) & ~PROG_DONE;
326+ writel(val, reg);
327+
328+ /* Mark SSIC port as unused(suspend) or used(resume) */
329+ val = readl(reg);
330+ if (suspend)
331+ val |= SSIC_PORT_UNUSED;
332+ else
333+ val &= ~SSIC_PORT_UNUSED;
334+ writel(val, reg);
335+
336+ /* Notify SSIC that SSIC profile programming is done */
337+ val = readl(reg) | PROG_DONE;
338+ writel(val, reg);
339+ readl(reg);
340+ }
341+
342+ reg = (void __iomem *) xhci->cap_regs + 0x80a4;
343+ val = readl(reg);
344+ writel(val | BIT(28), reg);
345+ readl(reg);
346+}
347+
348348 static int xhci_pci_suspend(struct usb_hcd *hcd, bool do_wakeup)
349349 {
350350 struct xhci_hcd *xhci = hcd_to_xhci(hcd);
drivers/usb/host/xhci-ring.c+11−2
@@ -302,6 +302,15 @@ static int xhci_abort_cmd_ring(struct xhci_hcd *xhci) · 301 unmodified lines
302302 ret = xhci_handshake(&xhci->op_regs->cmd_ring,
303303 CMD_RING_RUNNING, 0, 5 * 1000 * 1000);
304304 if (ret < 0) {
305+ /* we are about to kill xhci, give it one more chance */
306+ xhci_write_64(xhci, temp_64 | CMD_RING_ABORT,
307+ &xhci->op_regs->cmd_ring);
308+ udelay(1000);
309+ ret = xhci_handshake(&xhci->op_regs->cmd_ring,
310+ CMD_RING_RUNNING, 0, 3 * 1000 * 1000);
311+ if (ret == 0)
312+ return 0;
313+
305314 xhci_err(xhci, "Stopped the command ring failed, "
306315 "maybe the host is dead\n");
307316 xhci->xhc_state |= XHCI_STATE_DYING;
@@ -3461,8 +3470,8 @@ int xhci_queue_ctrl_tx(struct xhci_hcd *xhci, gfp_t mem_flags, · 3153 unmodified lines
34613470 if (start_cycle == 0)
34623471 field |= 0x1;
34633472
3464− /* xHCI 1.0 6.4.1.2.1: Transfer Type field */
3465− if (xhci->hci_version == 0x100) {
3473+ /* xHCI 1.0/1.1 6.4.1.2.1: Transfer Type field */
3474+ if (xhci->hci_version >= 0x100) {
34663475 if (urb->transfer_buffer_length > 0) {
34673476 if (setup->bRequestType & USB_DIR_IN)
34683477 field |= TRB_TX_TYPE(TRB_DATA_IN);
drivers/usb/host/xhci.c+11−13
@@ -146,7 +146,8 @@ static int xhci_start(struct xhci_hcd *xhci) · 145 unmodified lines
146146 "waited %u microseconds.\n",
147147 XHCI_MAX_HALT_USEC);
148148 if (!ret)
149− xhci->xhc_state &= ~XHCI_STATE_HALTED;
149+ xhci->xhc_state &= ~(XHCI_STATE_HALTED | XHCI_STATE_DYING);
150+
150151 return ret;
151152 }
152153
@@ -654,15 +655,6 @@ int xhci_run(struct usb_hcd *hcd) · 501 unmodified lines
654655 }
655656 EXPORT_SYMBOL_GPL(xhci_run);
656657
657−static void xhci_only_stop_hcd(struct usb_hcd *hcd)
658−{
659− struct xhci_hcd *xhci = hcd_to_xhci(hcd);
660−
661− spin_lock_irq(&xhci->lock);
662− xhci_halt(xhci);
663− spin_unlock_irq(&xhci->lock);
664−}
665−
666658 /*
667659 * Stop xHCI driver.
668660 *
@@ -677,12 +669,14 @@ void xhci_stop(struct usb_hcd *hcd) · 8 unmodified lines
677669 u32 temp;
678670 struct xhci_hcd *xhci = hcd_to_xhci(hcd);
679671
680− if (!usb_hcd_is_primary_hcd(hcd)) {
681− xhci_only_stop_hcd(xhci->shared_hcd);
672+ if (xhci->xhc_state & XHCI_STATE_HALTED)
682673 return;
683− }
684674
675+ mutex_lock(&xhci->mutex);
685676 spin_lock_irq(&xhci->lock);
677+ xhci->xhc_state |= XHCI_STATE_HALTED;
678+ xhci->cmd_ring_state = CMD_RING_STATE_STOPPED;
679+
686680 /* Make sure the xHC is halted for a USB3 roothub
687681 * (xhci_stop() could be called as part of failed init).
688682 */
@@ -717,6 +711,7 @@ void xhci_stop(struct usb_hcd *hcd) · 28 unmodified lines
717711 xhci_dbg_trace(xhci, trace_xhci_dbg_init,
718712 "xhci_stop completed - status = %x",
719713 readl(&xhci->op_regs->status));
714+ mutex_unlock(&xhci->mutex);
720715 }
721716
722717 /*
@@ -3793,6 +3788,9 @@ static int xhci_setup_device(struct usb_hcd *hcd, struct usb_device *udev, · 3070 unmodified lines
37933788
37943789 mutex_lock(&xhci->mutex);
37953790
3791+ if (xhci->xhc_state) /* dying or halted */
3792+ goto out;
3793+
37963794 if (!udev->slot_id) {
37973795 xhci_dbg_trace(xhci, trace_xhci_dbg_address,
37983796 "Bad Slot ID %d", udev->slot_id);
drivers/usb/musb/musb_core.c+7−0
@@ -1051,6 +1051,7 @@ void musb_start(struct musb *musb) · 1050 unmodified lines
10511051 * (c) peripheral initiates, using SRP
10521052 */
10531053 if (musb->port_mode != MUSB_PORT_MODE_HOST &&
1054+ musb->xceiv->otg->state != OTG_STATE_A_WAIT_BCON &&
10541055 (devctl & MUSB_DEVCTL_VBUS) == MUSB_DEVCTL_VBUS) {
10551056 musb->is_active = 1;
10561057 } else {
@@ -2448,6 +2449,9 @@ static int musb_suspend(struct device *dev) · 1391 unmodified lines
24482449 struct musb *musb = dev_to_musb(dev);
24492450 unsigned long flags;
24502451
2452+ musb_platform_disable(musb);
2453+ musb_generic_disable(musb);
2454+
24512455 spin_lock_irqsave(&musb->lock, flags);
24522456
24532457 if (is_peripheral_active(musb)) {
@@ -2501,6 +2505,9 @@ static int musb_resume(struct device *dev) · 47 unmodified lines
25012505 pm_runtime_disable(dev);
25022506 pm_runtime_set_active(dev);
25032507 pm_runtime_enable(dev);
2508+
2509+ musb_start(musb);
2510+
25042511 return 0;
25052512 }
25062513
drivers/usb/musb/musb_cppi41.c+3−0
@@ -551,6 +551,9 @@ static int cppi41_dma_channel_abort(struct dma_channel *channel) · 550 unmodified lines
551551 } else {
552552 cppi41_set_autoreq_mode(cppi41_channel, EP_MODE_AUTOREQ_NONE);
553553
554+ /* delay to drain to cppi dma pipeline for isoch */
555+ udelay(250);
556+
554557 csr = musb_readw(epio, MUSB_RXCSR);
555558 csr &= ~(MUSB_RXCSR_H_REQPKT | MUSB_RXCSR_DMAENAB);
556559 musb_writew(epio, MUSB_RXCSR, csr);
drivers/usb/musb/musb_dsps.c+5−2
@@ -225,8 +225,11 @@ static void dsps_musb_enable(struct musb *musb) · 224 unmodified lines
225225
226226 dsps_writel(reg_base, wrp->epintr_set, epmask);
227227 dsps_writel(reg_base, wrp->coreintr_set, coremask);
228− /* start polling for ID change. */
229− mod_timer(&glue->timer, jiffies + msecs_to_jiffies(wrp->poll_timeout));
228+ /* start polling for ID change in dual-role idle mode */
229+ if (musb->xceiv->otg->state == OTG_STATE_B_IDLE &&
230+ musb->port_mode == MUSB_PORT_MODE_DUAL_ROLE)
231+ mod_timer(&glue->timer, jiffies +
232+ msecs_to_jiffies(wrp->poll_timeout));
230233 dsps_musb_try_idle(musb, 0);
231234 }
232235
drivers/usb/musb/ux500.c+2−0
@@ -379,6 +379,8 @@ static const struct of_device_id ux500_match[] = { · 378 unmodified lines
379379 {}
380380 };
381381
382+MODULE_DEVICE_TABLE(of, ux500_match);
383+
382384 static struct platform_driver ux500_driver = {
383385 .probe = ux500_probe,
384386 .remove = ux500_remove,
drivers/usb/phy/Kconfig+1−1
@@ -155,7 +155,7 @@ config USB_MSM_OTG · 154 unmodified lines
155155 config USB_QCOM_8X16_PHY
156156 tristate "Qualcomm APQ8016/MSM8916 on-chip USB PHY controller support"
157157 depends on ARCH_QCOM || COMPILE_TEST
158− depends on RESET_CONTROLLER
158+ depends on RESET_CONTROLLER && EXTCON
159159 select USB_PHY
160160 select USB_ULPI_VIEWPORT
161161 help
drivers/usb/phy/phy-generic.c+2−1
@@ -232,7 +232,8 @@ int usb_phy_gen_create_phy(struct device *dev, struct usb_phy_generic *nop, · 231 unmodified lines
232232 clk_rate = pdata->clk_rate;
233233 needs_vcc = pdata->needs_vcc;
234234 if (gpio_is_valid(pdata->gpio_reset)) {
235− err = devm_gpio_request_one(dev, pdata->gpio_reset, 0,
235+ err = devm_gpio_request_one(dev, pdata->gpio_reset,
236+ GPIOF_ACTIVE_LOW,
236237 dev_name(dev));
237238 if (!err)
238239 nop->gpiod_reset =
drivers/usb/phy/phy-isp1301.c+1−0
@@ -31,6 +31,7 @@ static const struct i2c_device_id isp1301_id[] = { · 30 unmodified lines
3131 { "isp1301", 0 },
3232 { }
3333 };
34+MODULE_DEVICE_TABLE(i2c, isp1301_id);
3435
3536 static struct i2c_client *isp1301_i2c_client;
3637
drivers/usb/serial/option.c+24−0
@@ -278,6 +278,10 @@ static void option_instat_callback(struct urb *urb); · 277 unmodified lines
278278 #define ZTE_PRODUCT_MF622 0x0001
279279 #define ZTE_PRODUCT_MF628 0x0015
280280 #define ZTE_PRODUCT_MF626 0x0031
281+#define ZTE_PRODUCT_ZM8620_X 0x0396
282+#define ZTE_PRODUCT_ME3620_MBIM 0x0426
283+#define ZTE_PRODUCT_ME3620_X 0x1432
284+#define ZTE_PRODUCT_ME3620_L 0x1433
281285 #define ZTE_PRODUCT_AC2726 0xfff1
282286 #define ZTE_PRODUCT_MG880 0xfffd
283287 #define ZTE_PRODUCT_CDMA_TECH 0xfffe
@@ -544,6 +548,18 @@ static const struct option_blacklist_info zte_mc2716_z_blacklist = { · 260 unmodified lines
544548 .sendsetup = BIT(1) | BIT(2) | BIT(3),
545549 };
546550
551+static const struct option_blacklist_info zte_me3620_mbim_blacklist = {
552+ .reserved = BIT(2) | BIT(3) | BIT(4),
553+};
554+
555+static const struct option_blacklist_info zte_me3620_xl_blacklist = {
556+ .reserved = BIT(3) | BIT(4) | BIT(5),
557+};
558+
559+static const struct option_blacklist_info zte_zm8620_x_blacklist = {
560+ .reserved = BIT(3) | BIT(4) | BIT(5),
561+};
562+
547563 static const struct option_blacklist_info huawei_cdc12_blacklist = {
548564 .reserved = BIT(1) | BIT(2),
549565 };
@@ -1591,6 +1607,14 @@ static const struct usb_device_id option_ids[] = { · 1041 unmodified lines
15911607 .driver_info = (kernel_ulong_t)&zte_ad3812_z_blacklist },
15921608 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MC2716, 0xff, 0xff, 0xff),
15931609 .driver_info = (kernel_ulong_t)&zte_mc2716_z_blacklist },
1610+ { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_ME3620_L),
1611+ .driver_info = (kernel_ulong_t)&zte_me3620_xl_blacklist },
1612+ { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_ME3620_MBIM),
1613+ .driver_info = (kernel_ulong_t)&zte_me3620_mbim_blacklist },
1614+ { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_ME3620_X),
1615+ .driver_info = (kernel_ulong_t)&zte_me3620_xl_blacklist },
1616+ { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_ZM8620_X),
1617+ .driver_info = (kernel_ulong_t)&zte_zm8620_x_blacklist },
15941618 { USB_VENDOR_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff, 0x02, 0x01) },
15951619 { USB_VENDOR_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff, 0x02, 0x05) },
15961620 { USB_VENDOR_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0xff, 0x86, 0x10) },
drivers/usb/serial/whiteheat.c+31−0
@@ -80,6 +80,8 @@ static int whiteheat_firmware_download(struct usb_serial *serial, · 79 unmodified lines
8080 static int whiteheat_firmware_attach(struct usb_serial *serial);
8181
8282 /* function prototypes for the Connect Tech WhiteHEAT serial converter */
83+static int whiteheat_probe(struct usb_serial *serial,
84+ const struct usb_device_id *id);
8385 static int whiteheat_attach(struct usb_serial *serial);
8486 static void whiteheat_release(struct usb_serial *serial);
8587 static int whiteheat_port_probe(struct usb_serial_port *port);
@@ -116,6 +118,7 @@ static struct usb_serial_driver whiteheat_device = { · 30 unmodified lines
116118 .description = "Connect Tech - WhiteHEAT",
117119 .id_table = id_table_std,
118120 .num_ports = 4,
121+ .probe = whiteheat_probe,
119122 .attach = whiteheat_attach,
120123 .release = whiteheat_release,
121124 .port_probe = whiteheat_port_probe,
@@ -217,6 +220,34 @@ static int whiteheat_firmware_attach(struct usb_serial *serial) · 95 unmodified lines
217220 /*****************************************************************************
218221 * Connect Tech's White Heat serial driver functions
219222 *****************************************************************************/
223+
224+static int whiteheat_probe(struct usb_serial *serial,
225+ const struct usb_device_id *id)
226+{
227+ struct usb_host_interface *iface_desc;
228+ struct usb_endpoint_descriptor *endpoint;
229+ size_t num_bulk_in = 0;
230+ size_t num_bulk_out = 0;
231+ size_t min_num_bulk;
232+ unsigned int i;
233+
234+ iface_desc = serial->interface->cur_altsetting;
235+
236+ for (i = 0; i < iface_desc->desc.bNumEndpoints; i++) {
237+ endpoint = &iface_desc->endpoint[i].desc;
238+ if (usb_endpoint_is_bulk_in(endpoint))
239+ ++num_bulk_in;
240+ if (usb_endpoint_is_bulk_out(endpoint))
241+ ++num_bulk_out;
242+ }
243+
244+ min_num_bulk = COMMAND_PORT + 1;
245+ if (num_bulk_in < min_num_bulk || num_bulk_out < min_num_bulk)
246+ return -ENODEV;
247+
248+ return 0;
249+}
250+
220251 static int whiteheat_attach(struct usb_serial *serial)
221252 {
222253 struct usb_serial_port *command_port;
drivers/watchdog/Kconfig+2−1
@@ -817,8 +817,9 @@ config ITCO_WDT · 816 unmodified lines
817817 tristate "Intel TCO Timer/Watchdog"
818818 depends on (X86 || IA64) && PCI
819819 select WATCHDOG_CORE
820+ depends on I2C || I2C=n
820821 select LPC_ICH if !EXPERT
821− select I2C_I801 if !EXPERT
822+ select I2C_I801 if !EXPERT && I2C
822823 ---help---
823824 Hardware driver for the intel TCO timer based watchdog devices.
824825 These drivers are included in the Intel 82801 I/O Controller
drivers/watchdog/bcm2835_wdt.c+8−2
@@ -36,6 +36,13 @@ · 35 unmodified lines
3636 #define PM_RSTC_WRCFG_FULL_RESET 0x00000020
3737 #define PM_RSTC_RESET 0x00000102
3838
39+/*
40+ * The Raspberry Pi firmware uses the RSTS register to know which partiton
41+ * to boot from. The partiton value is spread into bits 0, 2, 4, 6, 8, 10.
42+ * Partiton 63 is a special partition used by the firmware to indicate halt.
43+ */
44+#define PM_RSTS_RASPBERRYPI_HALT 0x555
45+
3946 #define SECS_TO_WDOG_TICKS(x) ((x) << 16)
4047 #define WDOG_TICKS_TO_SECS(x) ((x) >> 16)
4148
@@ -151,8 +158,7 @@ static void bcm2835_power_off(void) · 109 unmodified lines
151158 * hard reset.
152159 */
153160 val = readl_relaxed(wdt->base + PM_RSTS);
154− val &= PM_RSTC_WRCFG_CLR;
155− val |= PM_PASSWORD | PM_RSTS_HADWRH_SET;
161+ val |= PM_PASSWORD | PM_RSTS_RASPBERRYPI_HALT;
156162 writel_relaxed(val, wdt->base + PM_RSTS);
157163
158164 /* Continue with normal reset mechanism */
drivers/watchdog/gef_wdt.c+1−0
@@ -303,6 +303,7 @@ static const struct of_device_id gef_wdt_ids[] = { · 302 unmodified lines
303303 },
304304 {},
305305 };
306+MODULE_DEVICE_TABLE(of, gef_wdt_ids);
306307
307308 static struct platform_driver gef_wdt_driver = {
308309 .driver = {
drivers/watchdog/mena21_wdt.c+1−0
@@ -253,6 +253,7 @@ static const struct of_device_id a21_wdt_ids[] = { · 252 unmodified lines
253253 { .compatible = "men,a021-wdt" },
254254 { },
255255 };
256+MODULE_DEVICE_TABLE(of, a21_wdt_ids);
256257
257258 static struct platform_driver a21_wdt_driver = {
258259 .probe = a21_wdt_probe,
drivers/watchdog/moxart_wdt.c+1−0
@@ -168,6 +168,7 @@ static const struct of_device_id moxart_watchdog_match[] = { · 167 unmodified lines
168168 { .compatible = "moxa,moxart-watchdog" },
169169 { },
170170 };
171+MODULE_DEVICE_TABLE(of, moxart_watchdog_match);
171172
172173 static struct platform_driver moxart_wdt_driver = {
173174 .probe = moxart_wdt_probe,
fs/btrfs/btrfs_inode.h+0−2
@@ -44,8 +44,6 @@ · 43 unmodified lines
4444 #define BTRFS_INODE_IN_DELALLOC_LIST 9
4545 #define BTRFS_INODE_READDIO_NEED_LOCK 10
4646 #define BTRFS_INODE_HAS_PROPS 11
47−/* DIO is ready to submit */
48−#define BTRFS_INODE_DIO_READY 12
4947 /*
5048 * The following 3 bits are meant only for the btree inode.
5149 * When any of them is set, it means an error happened while writing an
fs/btrfs/disk-io.c+0−2
@@ -3765,9 +3765,7 @@ void close_ctree(struct btrfs_root *root) · 3764 unmodified lines
37653765 * block groups queued for removal, the deletion will be
37663766 * skipped when we quit the cleaner thread.
37673767 */
3768− mutex_lock(&root->fs_info->cleaner_mutex);
37693768 btrfs_delete_unused_bgs(root->fs_info);
3770− mutex_unlock(&root->fs_info->cleaner_mutex);
37713769
37723770 ret = btrfs_commit_super(root);
37733771 if (ret)
fs/btrfs/extent-tree.c+2−5
@@ -3742,10 +3742,7 @@ static int update_space_info(struct btrfs_fs_info *info, u64 flags, · 3741 unmodified lines
37423742 found->bytes_reserved = 0;
37433743 found->bytes_readonly = 0;
37443744 found->bytes_may_use = 0;
3745− if (total_bytes > 0)
3746− found->full = 0;
3747− else
3748− found->full = 1;
3745+ found->full = 0;
37493746 found->force_alloc = CHUNK_ALLOC_NO_FORCE;
37503747 found->chunk_alloc = 0;
37513748 found->flush = 0;
@@ -8668,7 +8665,7 @@ int btrfs_drop_snapshot(struct btrfs_root *root, · 4916 unmodified lines
86688665 }
86698666
86708667 if (test_bit(BTRFS_ROOT_IN_RADIX, &root->state)) {
8671− btrfs_drop_and_free_fs_root(tree_root->fs_info, root);
8668+ btrfs_add_dropped_root(trans, root);
86728669 } else {
86738670 free_extent_buffer(root->node);
86748671 free_extent_buffer(root->commit_root);
fs/btrfs/extent_io.c+57−8
@@ -2798,7 +2798,8 @@ static int submit_extent_page(int rw, struct extent_io_tree *tree, · 2797 unmodified lines
27982798 bio_end_io_t end_io_func,
27992799 int mirror_num,
28002800 unsigned long prev_bio_flags,
2801− unsigned long bio_flags)
2801+ unsigned long bio_flags,
2802+ bool force_bio_submit)
28022803 {
28032804 int ret = 0;
28042805 struct bio *bio;
@@ -2814,6 +2815,7 @@ static int submit_extent_page(int rw, struct extent_io_tree *tree, · 9 unmodified lines
28142815 contig = bio_end_sector(bio) == sector;
28152816
28162817 if (prev_bio_flags != bio_flags || !contig ||
2818+ force_bio_submit ||
28172819 merge_bio(rw, tree, page, offset, page_size, bio, bio_flags) ||
28182820 bio_add_page(bio, page, page_size, offset) < page_size) {
28192821 ret = submit_one_bio(rw, bio, mirror_num,
@@ -2910,7 +2912,8 @@ static int __do_readpage(struct extent_io_tree *tree, · 90 unmodified lines
29102912 get_extent_t *get_extent,
29112913 struct extent_map **em_cached,
29122914 struct bio **bio, int mirror_num,
2913− unsigned long *bio_flags, int rw)
2915+ unsigned long *bio_flags, int rw,
2916+ u64 *prev_em_start)
29142917 {
29152918 struct inode *inode = page->mapping->host;
29162919 u64 start = page_offset(page);
@@ -2958,6 +2961,7 @@ static int __do_readpage(struct extent_io_tree *tree, · 41 unmodified lines
29582961 }
29592962 while (cur <= end) {
29602963 unsigned long pnr = (last_byte >> PAGE_CACHE_SHIFT) + 1;
2964+ bool force_bio_submit = false;
29612965
29622966 if (cur >= last_byte) {
29632967 char *userpage;
@@ -3008,6 +3012,49 @@ static int __do_readpage(struct extent_io_tree *tree, · 44 unmodified lines
30083012 block_start = em->block_start;
30093013 if (test_bit(EXTENT_FLAG_PREALLOC, &em->flags))
30103014 block_start = EXTENT_MAP_HOLE;
3015+
3016+ /*
3017+ * If we have a file range that points to a compressed extent
3018+ * and it's followed by a consecutive file range that points to
3019+ * to the same compressed extent (possibly with a different
3020+ * offset and/or length, so it either points to the whole extent
3021+ * or only part of it), we must make sure we do not submit a
3022+ * single bio to populate the pages for the 2 ranges because
3023+ * this makes the compressed extent read zero out the pages
3024+ * belonging to the 2nd range. Imagine the following scenario:
3025+ *
3026+ * File layout
3027+ * [0 - 8K] [8K - 24K]
3028+ * | |
3029+ * | |
3030+ * points to extent X, points to extent X,
3031+ * offset 4K, length of 8K offset 0, length 16K
3032+ *
3033+ * [extent X, compressed length = 4K uncompressed length = 16K]
3034+ *
3035+ * If the bio to read the compressed extent covers both ranges,
3036+ * it will decompress extent X into the pages belonging to the
3037+ * first range and then it will stop, zeroing out the remaining
3038+ * pages that belong to the other range that points to extent X.
3039+ * So here we make sure we submit 2 bios, one for the first
3040+ * range and another one for the third range. Both will target
3041+ * the same physical extent from disk, but we can't currently
3042+ * make the compressed bio endio callback populate the pages
3043+ * for both ranges because each compressed bio is tightly
3044+ * coupled with a single extent map, and each range can have
3045+ * an extent map with a different offset value relative to the
3046+ * uncompressed data of our extent and different lengths. This
3047+ * is a corner case so we prioritize correctness over
3048+ * non-optimal behavior (submitting 2 bios for the same extent).
3049+ */
3050+ if (test_bit(EXTENT_FLAG_COMPRESSED, &em->flags) &&
3051+ prev_em_start && *prev_em_start != (u64)-1 &&
3052+ *prev_em_start != em->orig_start)
3053+ force_bio_submit = true;
3054+
3055+ if (prev_em_start)
3056+ *prev_em_start = em->orig_start;
3057+
30113058 free_extent_map(em);
30123059 em = NULL;
30133060
@@ -3057,7 +3104,8 @@ static int __do_readpage(struct extent_io_tree *tree, · 43 unmodified lines
30573104 bdev, bio, pnr,
30583105 end_bio_extent_readpage, mirror_num,
30593106 *bio_flags,
3060− this_bio_flag);
3107+ this_bio_flag,
3108+ force_bio_submit);
30613109 if (!ret) {
30623110 nr++;
30633111 *bio_flags = this_bio_flag;
@@ -3089,6 +3137,7 @@ static inline void __do_contiguous_readpages(struct extent_io_tree *tree, · 25 unmodified lines
30893137 struct inode *inode;
30903138 struct btrfs_ordered_extent *ordered;
30913139 int index;
3140+ u64 prev_em_start = (u64)-1;
30923141
30933142 inode = pages[0]->mapping->host;
30943143 while (1) {
@@ -3104,7 +3153,7 @@ static inline void __do_contiguous_readpages(struct extent_io_tree *tree, · 9 unmodified lines
31043153
31053154 for (index = 0; index < nr_pages; index++) {
31063155 __do_readpage(tree, pages[index], get_extent, em_cached, bio,
3107− mirror_num, bio_flags, rw);
3156+ mirror_num, bio_flags, rw, &prev_em_start);
31083157 page_cache_release(pages[index]);
31093158 }
31103159 }
@@ -3172,7 +3221,7 @@ static int __extent_read_full_page(struct extent_io_tree *tree, · 61 unmodified lines
31723221 }
31733222
31743223 ret = __do_readpage(tree, page, get_extent, NULL, bio, mirror_num,
3175− bio_flags, rw);
3224+ bio_flags, rw, NULL);
31763225 return ret;
31773226 }
31783227
@@ -3198,7 +3247,7 @@ int extent_read_full_page_nolock(struct extent_io_tree *tree, struct page *page, · 19 unmodified lines
31983247 int ret;
31993248
32003249 ret = __do_readpage(tree, page, get_extent, NULL, &bio, mirror_num,
3201− &bio_flags, READ);
3250+ &bio_flags, READ, NULL);
32023251 if (bio)
32033252 ret = submit_one_bio(READ, bio, mirror_num, bio_flags);
32043253 return ret;
@@ -3451,7 +3500,7 @@ static noinline_for_stack int __extent_writepage_io(struct inode *inode, · 246 unmodified lines
34513500 sector, iosize, pg_offset,
34523501 bdev, &epd->bio, max_nr,
34533502 end_bio_extent_writepage,
3454− 0, 0, 0);
3503+ 0, 0, 0, false);
34553504 if (ret)
34563505 SetPageError(page);
34573506 }
@@ -3754,7 +3803,7 @@ static noinline_for_stack int write_one_eb(struct extent_buffer *eb, · 296 unmodified lines
37543803 ret = submit_extent_page(rw, tree, wbc, p, offset >> 9,
37553804 PAGE_CACHE_SIZE, 0, bdev, &epd->bio,
37563805 -1, end_bio_extent_buffer_writepage,
3757− 0, epd->bio_flags, bio_flags);
3806+ 0, epd->bio_flags, bio_flags, false);
37583807 epd->bio_flags = bio_flags;
37593808 if (ret) {
37603809 set_btree_ioerr(p);
fs/btrfs/inode.c+23−22
@@ -5084,7 +5084,8 @@ void btrfs_evict_inode(struct inode *inode) · 5083 unmodified lines
50845084 goto no_delete;
50855085 }
50865086 /* do we really want it for ->i_nlink > 0 and zero btrfs_root_refs? */
5087− btrfs_wait_ordered_range(inode, 0, (u64)-1);
5087+ if (!special_file(inode->i_mode))
5088+ btrfs_wait_ordered_range(inode, 0, (u64)-1);
50885089
50895090 btrfs_free_io_failure_record(inode, 0, (u64)-1);
50905091
@@ -7408,6 +7409,10 @@ static struct extent_map *create_pinned_em(struct inode *inode, u64 start, · 2317 unmodified lines
74087409 return em;
74097410 }
74107411
7412+struct btrfs_dio_data {
7413+ u64 outstanding_extents;
7414+ u64 reserve;
7415+};
74117416
74127417 static int btrfs_get_blocks_direct(struct inode *inode, sector_t iblock,
74137418 struct buffer_head *bh_result, int create)
@@ -7415,10 +7420,10 @@ static int btrfs_get_blocks_direct(struct inode *inode, sector_t iblock, · 1 unmodified line
74157420 struct extent_map *em;
74167421 struct btrfs_root *root = BTRFS_I(inode)->root;
74177422 struct extent_state *cached_state = NULL;
7423+ struct btrfs_dio_data *dio_data = NULL;
74187424 u64 start = iblock << inode->i_blkbits;
74197425 u64 lockstart, lockend;
74207426 u64 len = bh_result->b_size;
7421− u64 *outstanding_extents = NULL;
74227427 int unlock_bits = EXTENT_LOCKED;
74237428 int ret = 0;
74247429
@@ -7436,7 +7441,7 @@ static int btrfs_get_blocks_direct(struct inode *inode, sector_t iblock, · 11 unmodified lines
74367441 * that anything that needs to check if there's a transction doesn't get
74377442 * confused.
74387443 */
7439− outstanding_extents = current->journal_info;
7444+ dio_data = current->journal_info;
74407445 current->journal_info = NULL;
74417446 }
74427447
@@ -7568,17 +7573,18 @@ unlock: · 125 unmodified lines
75687573 * within our reservation, otherwise we need to adjust our inode
75697574 * counter appropriately.
75707575 */
7571− if (*outstanding_extents) {
7572− (*outstanding_extents)--;
7576+ if (dio_data->outstanding_extents) {
7577+ (dio_data->outstanding_extents)--;
75737578 } else {
75747579 spin_lock(&BTRFS_I(inode)->lock);
75757580 BTRFS_I(inode)->outstanding_extents++;
75767581 spin_unlock(&BTRFS_I(inode)->lock);
75777582 }
75787583
7579− current->journal_info = outstanding_extents;
75807584 btrfs_free_reserved_data_space(inode, len);
7581− set_bit(BTRFS_INODE_DIO_READY, &BTRFS_I(inode)->runtime_flags);
7585+ WARN_ON(dio_data->reserve < len);
7586+ dio_data->reserve -= len;
7587+ current->journal_info = dio_data;
75827588 }
75837589
75847590 /*
@@ -7601,8 +7607,8 @@ unlock: · 16 unmodified lines
76017607 unlock_err:
76027608 clear_extent_bit(&BTRFS_I(inode)->io_tree, lockstart, lockend,
76037609 unlock_bits, 1, 0, &cached_state, GFP_NOFS);
7604− if (outstanding_extents)
7605− current->journal_info = outstanding_extents;
7610+ if (dio_data)
7611+ current->journal_info = dio_data;
76067612 return ret;
76077613 }
76087614
@@ -8329,7 +8335,8 @@ static ssize_t btrfs_direct_IO(struct kiocb *iocb, struct iov_iter *iter, · 720 unmodified lines
83298335 {
83308336 struct file *file = iocb->ki_filp;
83318337 struct inode *inode = file->f_mapping->host;
8332− u64 outstanding_extents = 0;
8338+ struct btrfs_root *root = BTRFS_I(inode)->root;
8339+ struct btrfs_dio_data dio_data = { 0 };
83338340 size_t count = 0;
83348341 int flags = 0;
83358342 bool wakeup = true;
@@ -8367,7 +8374,7 @@ static ssize_t btrfs_direct_IO(struct kiocb *iocb, struct iov_iter *iter, · 31 unmodified lines
83678374 ret = btrfs_delalloc_reserve_space(inode, count);
83688375 if (ret)
83698376 goto out;
8370− outstanding_extents = div64_u64(count +
8377+ dio_data.outstanding_extents = div64_u64(count +
83718378 BTRFS_MAX_EXTENT_SIZE - 1,
83728379 BTRFS_MAX_EXTENT_SIZE);
83738380
@@ -8376,7 +8383,8 @@ static ssize_t btrfs_direct_IO(struct kiocb *iocb, struct iov_iter *iter, · 2 unmodified lines
83768383 * do the accounting properly if we go over the number we
83778384 * originally calculated. Abuse current->journal_info for this.
83788385 */
8379− current->journal_info = &outstanding_extents;
8386+ dio_data.reserve = round_up(count, root->sectorsize);
8387+ current->journal_info = &dio_data;
83808388 } else if (test_bit(BTRFS_INODE_READDIO_NEED_LOCK,
83818389 &BTRFS_I(inode)->runtime_flags)) {
83828390 inode_dio_end(inode);
@@ -8391,16 +8399,9 @@ static ssize_t btrfs_direct_IO(struct kiocb *iocb, struct iov_iter *iter, · 8 unmodified lines
83918399 if (iov_iter_rw(iter) == WRITE) {
83928400 current->journal_info = NULL;
83938401 if (ret < 0 && ret != -EIOCBQUEUED) {
8394− /*
8395− * If the error comes from submitting stage,
8396− * btrfs_get_blocsk_direct() has free'd data space,
8397− * and metadata space will be handled by
8398− * finish_ordered_fn, don't do that again to make
8399− * sure bytes_may_use is correct.
8400− */
8401− if (!test_and_clear_bit(BTRFS_INODE_DIO_READY,
8402− &BTRFS_I(inode)->runtime_flags))
8403− btrfs_delalloc_release_space(inode, count);
8402+ if (dio_data.reserve)
8403+ btrfs_delalloc_release_space(inode,
8404+ dio_data.reserve);
84048405 } else if (ret >= 0 && (size_t)ret < count)
84058406 btrfs_delalloc_release_space(inode,
84068407 count - (size_t)ret);
fs/btrfs/super.c+0−2
@@ -1658,9 +1658,7 @@ static int btrfs_remount(struct super_block *sb, int *flags, char *data) · 1657 unmodified lines
16581658 * groups on disk until we're mounted read-write again
16591659 * unless we clean them up here.
16601660 */
1661− mutex_lock(&root->fs_info->cleaner_mutex);
16621661 btrfs_delete_unused_bgs(fs_info);
1663− mutex_unlock(&root->fs_info->cleaner_mutex);
16641662
16651663 btrfs_dev_replace_suspend_for_unmount(fs_info);
16661664 btrfs_scrub_cancel(fs_info);
fs/btrfs/transaction.c+32−0
@@ -117,6 +117,18 @@ static noinline void switch_commit_roots(struct btrfs_transaction *trans, · 116 unmodified lines
117117 btrfs_unpin_free_ino(root);
118118 clear_btree_io_tree(&root->dirty_log_pages);
119119 }
120+
121+ /* We can free old roots now. */
122+ spin_lock(&trans->dropped_roots_lock);
123+ while (!list_empty(&trans->dropped_roots)) {
124+ root = list_first_entry(&trans->dropped_roots,
125+ struct btrfs_root, root_list);
126+ list_del_init(&root->root_list);
127+ spin_unlock(&trans->dropped_roots_lock);
128+ btrfs_drop_and_free_fs_root(fs_info, root);
129+ spin_lock(&trans->dropped_roots_lock);
130+ }
131+ spin_unlock(&trans->dropped_roots_lock);
120132 up_write(&fs_info->commit_root_sem);
121133 }
122134
@@ -255,11 +267,13 @@ loop: · 132 unmodified lines
255267 INIT_LIST_HEAD(&cur_trans->pending_ordered);
256268 INIT_LIST_HEAD(&cur_trans->dirty_bgs);
257269 INIT_LIST_HEAD(&cur_trans->io_bgs);
270+ INIT_LIST_HEAD(&cur_trans->dropped_roots);
258271 mutex_init(&cur_trans->cache_write_mutex);
259272 cur_trans->num_dirty_bgs = 0;
260273 spin_lock_init(&cur_trans->dirty_bgs_lock);
261274 INIT_LIST_HEAD(&cur_trans->deleted_bgs);
262275 spin_lock_init(&cur_trans->deleted_bgs_lock);
276+ spin_lock_init(&cur_trans->dropped_roots_lock);
263277 list_add_tail(&cur_trans->list, &fs_info->trans_list);
264278 extent_io_tree_init(&cur_trans->dirty_pages,
265279 fs_info->btree_inode->i_mapping);
@@ -336,6 +350,24 @@ static int record_root_in_trans(struct btrfs_trans_handle *trans, · 70 unmodified lines
336350 }
337351
338352
353+void btrfs_add_dropped_root(struct btrfs_trans_handle *trans,
354+ struct btrfs_root *root)
355+{
356+ struct btrfs_transaction *cur_trans = trans->transaction;
357+
358+ /* Add ourselves to the transaction dropped list */
359+ spin_lock(&cur_trans->dropped_roots_lock);
360+ list_add_tail(&root->root_list, &cur_trans->dropped_roots);
361+ spin_unlock(&cur_trans->dropped_roots_lock);
362+
363+ /* Make sure we don't try to update the root at commit time */
364+ spin_lock(&root->fs_info->fs_roots_radix_lock);
365+ radix_tree_tag_clear(&root->fs_info->fs_roots_radix,
366+ (unsigned long)root->root_key.objectid,
367+ BTRFS_ROOT_TRANS_TAG);
368+ spin_unlock(&root->fs_info->fs_roots_radix_lock);
369+}
370+
339371 int btrfs_record_root_in_trans(struct btrfs_trans_handle *trans,
340372 struct btrfs_root *root)
341373 {
fs/btrfs/transaction.h+4−1
@@ -65,6 +65,7 @@ struct btrfs_transaction { · 64 unmodified lines
6565 struct list_head switch_commits;
6666 struct list_head dirty_bgs;
6767 struct list_head io_bgs;
68+ struct list_head dropped_roots;
6869 u64 num_dirty_bgs;
6970
7071 /*
@@ -76,6 +77,7 @@ struct btrfs_transaction { · 5 unmodified lines
7677 spinlock_t dirty_bgs_lock;
7778 struct list_head deleted_bgs;
7879 spinlock_t deleted_bgs_lock;
80+ spinlock_t dropped_roots_lock;
7981 struct btrfs_delayed_ref_root delayed_refs;
8082 int aborted;
8183 int dirty_bg_run;
@@ -216,5 +218,6 @@ int btrfs_transaction_blocked(struct btrfs_fs_info *info); · 134 unmodified lines
216218 int btrfs_transaction_in_commit(struct btrfs_fs_info *info);
217219 void btrfs_put_transaction(struct btrfs_transaction *transaction);
218220 void btrfs_apply_pending_changes(struct btrfs_fs_info *fs_info);
219−
221+void btrfs_add_dropped_root(struct btrfs_trans_handle *trans,
222+ struct btrfs_root *root);
220223 #endif
fs/cifs/cifsencrypt.c+51−2
@@ -444,6 +444,48 @@ find_domain_name(struct cifs_ses *ses, const struct nls_table *nls_cp) · 443 unmodified lines
444444 return 0;
445445 }
446446
447+/* Server has provided av pairs/target info in the type 2 challenge
448+ * packet and we have plucked it and stored within smb session.
449+ * We parse that blob here to find the server given timestamp
450+ * as part of ntlmv2 authentication (or local current time as
451+ * default in case of failure)
452+ */
453+static __le64
454+find_timestamp(struct cifs_ses *ses)
455+{
456+ unsigned int attrsize;
457+ unsigned int type;
458+ unsigned int onesize = sizeof(struct ntlmssp2_name);
459+ unsigned char *blobptr;
460+ unsigned char *blobend;
461+ struct ntlmssp2_name *attrptr;
462+
463+ if (!ses->auth_key.len || !ses->auth_key.response)
464+ return 0;
465+
466+ blobptr = ses->auth_key.response;
467+ blobend = blobptr + ses->auth_key.len;
468+
469+ while (blobptr + onesize < blobend) {
470+ attrptr = (struct ntlmssp2_name *) blobptr;
471+ type = le16_to_cpu(attrptr->type);
472+ if (type == NTLMSSP_AV_EOL)
473+ break;
474+ blobptr += 2; /* advance attr type */
475+ attrsize = le16_to_cpu(attrptr->length);
476+ blobptr += 2; /* advance attr size */
477+ if (blobptr + attrsize > blobend)
478+ break;
479+ if (type == NTLMSSP_AV_TIMESTAMP) {
480+ if (attrsize == sizeof(u64))
481+ return *((__le64 *)blobptr);
482+ }
483+ blobptr += attrsize; /* advance attr value */
484+ }
485+
486+ return cpu_to_le64(cifs_UnixTimeToNT(CURRENT_TIME));
487+}
488+
447489 static int calc_ntlmv2_hash(struct cifs_ses *ses, char *ntlmv2_hash,
448490 const struct nls_table *nls_cp)
449491 {
@@ -641,6 +683,7 @@ setup_ntlmv2_rsp(struct cifs_ses *ses, const struct nls_table *nls_cp) · 191 unmodified lines
641683 struct ntlmv2_resp *ntlmv2;
642684 char ntlmv2_hash[16];
643685 unsigned char *tiblob = NULL; /* target info blob */
686+ __le64 rsp_timestamp;
644687
645688 if (ses->server->negflavor == CIFS_NEGFLAVOR_EXTENDED) {
646689 if (!ses->domainName) {
@@ -659,6 +702,12 @@ setup_ntlmv2_rsp(struct cifs_ses *ses, const struct nls_table *nls_cp) · 12 unmodified lines
659702 }
660703 }
661704
705+ /* Must be within 5 minutes of the server (or in range +/-2h
706+ * in case of Mac OS X), so simply carry over server timestamp
707+ * (as Windows 7 does)
708+ */
709+ rsp_timestamp = find_timestamp(ses);
710+
662711 baselen = CIFS_SESS_KEY_SIZE + sizeof(struct ntlmv2_resp);
663712 tilen = ses->auth_key.len;
664713 tiblob = ses->auth_key.response;
@@ -675,8 +724,8 @@ setup_ntlmv2_rsp(struct cifs_ses *ses, const struct nls_table *nls_cp) · 10 unmodified lines
675724 (ses->auth_key.response + CIFS_SESS_KEY_SIZE);
676725 ntlmv2->blob_signature = cpu_to_le32(0x00000101);
677726 ntlmv2->reserved = 0;
678− /* Must be within 5 minutes of the server */
679− ntlmv2->time = cpu_to_le64(cifs_UnixTimeToNT(CURRENT_TIME));
727+ ntlmv2->time = rsp_timestamp;
728+
680729 get_random_bytes(&ntlmv2->client_chal, sizeof(ntlmv2->client_chal));
681730 ntlmv2->reserved2 = 0;
682731
fs/cifs/smb2ops.c+6−2
@@ -50,9 +50,13 @@ change_conf(struct TCP_Server_Info *server) · 49 unmodified lines
5050 break;
5151 default:
5252 server->echoes = true;
53− server->oplocks = true;
53+ if (enable_oplocks) {
54+ server->oplocks = true;
55+ server->oplock_credits = 1;
56+ } else
57+ server->oplocks = false;
58+
5459 server->echo_credits = 1;
55− server->oplock_credits = 1;
5660 }
5761 server->credits -= server->echo_credits + server->oplock_credits;
5862 return 0;
fs/cifs/smb2pdu.c+69−15
@@ -46,6 +46,7 @@ · 45 unmodified lines
4646 #include "smb2status.h"
4747 #include "smb2glob.h"
4848 #include "cifspdu.h"
49+#include "cifs_spnego.h"
4950
5051 /*
5152 * The following table defines the expected "StructureSize" of SMB2 requests
@@ -486,19 +487,15 @@ SMB2_negotiate(const unsigned int xid, struct cifs_ses *ses) · 434 unmodified lines
486487 cifs_dbg(FYI, "missing security blob on negprot\n");
487488
488489 rc = cifs_enable_signing(server, ses->sign);
489−#ifdef CONFIG_SMB2_ASN1 /* BB REMOVEME when updated asn1.c ready */
490490 if (rc)
491491 goto neg_exit;
492− if (blob_length)
492+ if (blob_length) {
493493 rc = decode_negTokenInit(security_blob, blob_length, server);
494− if (rc == 1)
495− rc = 0;
496− else if (rc == 0) {
497− rc = -EIO;
498− goto neg_exit;
494+ if (rc == 1)
495+ rc = 0;
496+ else if (rc == 0)
497+ rc = -EIO;
499498 }
500−#endif
501−
502499 neg_exit:
503500 free_rsp_buf(resp_buftype, rsp);
504501 return rc;
@@ -592,7 +589,8 @@ SMB2_sess_setup(const unsigned int xid, struct cifs_ses *ses, · 87 unmodified lines
592589 __le32 phase = NtLmNegotiate; /* NTLMSSP, if needed, is multistage */
593590 struct TCP_Server_Info *server = ses->server;
594591 u16 blob_length = 0;
595− char *security_blob;
592+ struct key *spnego_key = NULL;
593+ char *security_blob = NULL;
596594 char *ntlmssp_blob = NULL;
597595 bool use_spnego = false; /* else use raw ntlmssp */
598596
@@ -620,7 +618,8 @@ SMB2_sess_setup(const unsigned int xid, struct cifs_ses *ses, · 21 unmodified lines
620618 ses->ntlmssp->sesskey_per_smbsess = true;
621619
622620 /* FIXME: allow for other auth types besides NTLMSSP (e.g. krb5) */
623− ses->sectype = RawNTLMSSP;
621+ if (ses->sectype != Kerberos && ses->sectype != RawNTLMSSP)
622+ ses->sectype = RawNTLMSSP;
624623
625624 ssetup_ntlmssp_authenticate:
626625 if (phase == NtLmChallenge)
@@ -649,7 +648,48 @@ ssetup_ntlmssp_authenticate: · 22 unmodified lines
649648 iov[0].iov_base = (char *)req;
650649 /* 4 for rfc1002 length field and 1 for pad */
651650 iov[0].iov_len = get_rfc1002_length(req) + 4 - 1;
652− if (phase == NtLmNegotiate) {
651+
652+ if (ses->sectype == Kerberos) {
653+#ifdef CONFIG_CIFS_UPCALL
654+ struct cifs_spnego_msg *msg;
655+
656+ spnego_key = cifs_get_spnego_key(ses);
657+ if (IS_ERR(spnego_key)) {
658+ rc = PTR_ERR(spnego_key);
659+ spnego_key = NULL;
660+ goto ssetup_exit;
661+ }
662+
663+ msg = spnego_key->payload.data;
664+ /*
665+ * check version field to make sure that cifs.upcall is
666+ * sending us a response in an expected form
667+ */
668+ if (msg->version != CIFS_SPNEGO_UPCALL_VERSION) {
669+ cifs_dbg(VFS,
670+ "bad cifs.upcall version. Expected %d got %d",
671+ CIFS_SPNEGO_UPCALL_VERSION, msg->version);
672+ rc = -EKEYREJECTED;
673+ goto ssetup_exit;
674+ }
675+ ses->auth_key.response = kmemdup(msg->data, msg->sesskey_len,
676+ GFP_KERNEL);
677+ if (!ses->auth_key.response) {
678+ cifs_dbg(VFS,
679+ "Kerberos can't allocate (%u bytes) memory",
680+ msg->sesskey_len);
681+ rc = -ENOMEM;
682+ goto ssetup_exit;
683+ }
684+ ses->auth_key.len = msg->sesskey_len;
685+ blob_length = msg->secblob_len;
686+ iov[1].iov_base = msg->data + msg->sesskey_len;
687+ iov[1].iov_len = blob_length;
688+#else
689+ rc = -EOPNOTSUPP;
690+ goto ssetup_exit;
691+#endif /* CONFIG_CIFS_UPCALL */
692+ } else if (phase == NtLmNegotiate) { /* if not krb5 must be ntlmssp */
653693 ntlmssp_blob = kmalloc(sizeof(struct _NEGOTIATE_MESSAGE),
654694 GFP_KERNEL);
655695 if (ntlmssp_blob == NULL) {
@@ -672,6 +712,8 @@ ssetup_ntlmssp_authenticate: · 16 unmodified lines
672712 /* with raw NTLMSSP we don't encapsulate in SPNEGO */
673713 security_blob = ntlmssp_blob;
674714 }
715+ iov[1].iov_base = security_blob;
716+ iov[1].iov_len = blob_length;
675717 } else if (phase == NtLmAuthenticate) {
676718 req->hdr.SessionId = ses->Suid;
677719 ntlmssp_blob = kzalloc(sizeof(struct _NEGOTIATE_MESSAGE) + 500,
@@ -699,6 +741,8 @@ ssetup_ntlmssp_authenticate: · 21 unmodified lines
699741 } else {
700742 security_blob = ntlmssp_blob;
701743 }
744+ iov[1].iov_base = security_blob;
745+ iov[1].iov_len = blob_length;
702746 } else {
703747 cifs_dbg(VFS, "illegal ntlmssp phase\n");
704748 rc = -EIO;
@@ -710,8 +754,6 @@ ssetup_ntlmssp_authenticate: · 5 unmodified lines
710754 cpu_to_le16(sizeof(struct smb2_sess_setup_req) -
711755 1 /* pad */ - 4 /* rfc1001 len */);
712756 req->SecurityBufferLength = cpu_to_le16(blob_length);
713− iov[1].iov_base = security_blob;
714− iov[1].iov_len = blob_length;
715757
716758 inc_rfc1001_len(req, blob_length - 1 /* pad */);
717759
@@ -722,6 +764,7 @@ ssetup_ntlmssp_authenticate: · 4 unmodified lines
722764
723765 kfree(security_blob);
724766 rsp = (struct smb2_sess_setup_rsp *)iov[0].iov_base;
767+ ses->Suid = rsp->hdr.SessionId;
725768 if (resp_buftype != CIFS_NO_BUFFER &&
726769 rsp->hdr.Status == STATUS_MORE_PROCESSING_REQUIRED) {
727770 if (phase != NtLmNegotiate) {
@@ -739,7 +782,6 @@ ssetup_ntlmssp_authenticate: · 11 unmodified lines
739782 /* NTLMSSP Negotiate sent now processing challenge (response) */
740783 phase = NtLmChallenge; /* process ntlmssp challenge */
741784 rc = 0; /* MORE_PROCESSING is not an error here but expected */
742− ses->Suid = rsp->hdr.SessionId;
743785 rc = decode_ntlmssp_challenge(rsp->Buffer,
744786 le16_to_cpu(rsp->SecurityBufferLength), ses);
745787 }
@@ -796,6 +838,10 @@ keygen_exit: · 50 unmodified lines
796838 kfree(ses->auth_key.response);
797839 ses->auth_key.response = NULL;
798840 }
841+ if (spnego_key) {
842+ key_invalidate(spnego_key);
843+ key_put(spnego_key);
844+ }
799845 kfree(ses->ntlmssp);
800846
801847 return rc;
@@ -876,6 +922,12 @@ SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree, · 74 unmodified lines
876922 if (tcon && tcon->bad_network_name)
877923 return -ENOENT;
878924
925+ if ((tcon->seal) &&
926+ ((ses->server->capabilities & SMB2_GLOBAL_CAP_ENCRYPTION) == 0)) {
927+ cifs_dbg(VFS, "encryption requested but no server support");
928+ return -EOPNOTSUPP;
929+ }
930+
879931 unc_path = kmalloc(MAX_SHARENAME_LENGTH * 2, GFP_KERNEL);
880932 if (unc_path == NULL)
881933 return -ENOMEM;
@@ -955,6 +1007,8 @@ SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree, · 73 unmodified lines
9551007 ((tcon->share_flags & SHI1005_FLAGS_DFS) == 0))
9561008 cifs_dbg(VFS, "DFS capability contradicts DFS flag\n");
9571009 init_copy_chunk_defaults(tcon);
1010+ if (tcon->share_flags & SHI1005_FLAGS_ENCRYPT_DATA)
1011+ cifs_dbg(VFS, "Encrypted shares not supported");
9581012 if (tcon->ses->server->ops->validate_negotiate)
9591013 rc = tcon->ses->server->ops->validate_negotiate(xid, tcon);
9601014 tcon_exit:
fs/dax.c+12−1
@@ -569,8 +569,20 @@ int __dax_pmd_fault(struct vm_area_struct *vma, unsigned long address, · 568 unmodified lines
569569 if (!buffer_size_valid(&bh) || bh.b_size < PMD_SIZE)
570570 goto fallback;
571571
572+ sector = bh.b_blocknr << (blkbits - 9);
573+
572574 if (buffer_unwritten(&bh) || buffer_new(&bh)) {
573575 int i;
576+
577+ length = bdev_direct_access(bh.b_bdev, sector, &kaddr, &pfn,
578+ bh.b_size);
579+ if (length < 0) {
580+ result = VM_FAULT_SIGBUS;
581+ goto out;
582+ }
583+ if ((length < PMD_SIZE) || (pfn & PG_PMD_COLOUR))
584+ goto fallback;
585+
574586 for (i = 0; i < PTRS_PER_PMD; i++)
575587 clear_pmem(kaddr + i * PAGE_SIZE, PAGE_SIZE);
576588 wmb_pmem();
@@ -623,7 +635,6 @@ int __dax_pmd_fault(struct vm_area_struct *vma, unsigned long address, · 46 unmodified lines
623635 result = VM_FAULT_NOPAGE;
624636 spin_unlock(ptl);
625637 } else {
626− sector = bh.b_blocknr << (blkbits - 9);
627638 length = bdev_direct_access(bh.b_bdev, sector, &kaddr, &pfn,
628639 bh.b_size);
629640 if (length < 0) {
fs/nfs/delegation.c+5−3
@@ -113,7 +113,8 @@ out: · 112 unmodified lines
113113 return status;
114114 }
115115
116−static int nfs_delegation_claim_opens(struct inode *inode, const nfs4_stateid *stateid)
116+static int nfs_delegation_claim_opens(struct inode *inode,
117+ const nfs4_stateid *stateid, fmode_t type)
117118 {
118119 struct nfs_inode *nfsi = NFS_I(inode);
119120 struct nfs_open_context *ctx;
@@ -140,7 +141,7 @@ again: · 20 unmodified lines
140141 /* Block nfs4_proc_unlck */
141142 mutex_lock(&sp->so_delegreturn_mutex);
142143 seq = raw_seqcount_begin(&sp->so_reclaim_seqcount);
143− err = nfs4_open_delegation_recall(ctx, state, stateid);
144+ err = nfs4_open_delegation_recall(ctx, state, stateid, type);
144145 if (!err)
145146 err = nfs_delegation_claim_locks(ctx, state, stateid);
146147 if (!err && read_seqcount_retry(&sp->so_reclaim_seqcount, seq))
@@ -411,7 +412,8 @@ static int nfs_end_delegation_return(struct inode *inode, struct nfs_delegation · 264 unmodified lines
411412 do {
412413 if (test_bit(NFS_DELEGATION_REVOKED, &delegation->flags))
413414 break;
414− err = nfs_delegation_claim_opens(inode, &delegation->stateid);
415+ err = nfs_delegation_claim_opens(inode, &delegation->stateid,
416+ delegation->type);
415417 if (!issync || err != -EAGAIN)
416418 break;
417419 /*
fs/nfs/delegation.h+1−1
@@ -54,7 +54,7 @@ void nfs_delegation_reap_unclaimed(struct nfs_client *clp); · 53 unmodified lines
5454
5555 /* NFSv4 delegation-related procedures */
5656 int nfs4_proc_delegreturn(struct inode *inode, struct rpc_cred *cred, const nfs4_stateid *stateid, int issync);
57−int nfs4_open_delegation_recall(struct nfs_open_context *ctx, struct nfs4_state *state, const nfs4_stateid *stateid);
57+int nfs4_open_delegation_recall(struct nfs_open_context *ctx, struct nfs4_state *state, const nfs4_stateid *stateid, fmode_t type);
5858 int nfs4_lock_delegation_recall(struct file_lock *fl, struct nfs4_state *state, const nfs4_stateid *stateid);
5959 bool nfs4_copy_delegation_stateid(nfs4_stateid *dst, struct inode *inode, fmode_t flags);
6060
fs/nfs/direct.c+5−2
@@ -166,8 +166,11 @@ nfs_direct_select_verf(struct nfs_direct_req *dreq, · 165 unmodified lines
166166 struct nfs_writeverf *verfp = &dreq->verf;
167167
168168 #ifdef CONFIG_NFS_V4_1
169− if (ds_clp) {
170− /* pNFS is in use, use the DS verf */
169+ /*
170+ * pNFS is in use, use the DS verf except commit_through_mds is set
171+ * for layout segment where nbuckets is zero.
172+ */
173+ if (ds_clp && dreq->ds_cinfo.nbuckets > 0) {
171174 if (commit_idx >= 0 && commit_idx < dreq->ds_cinfo.nbuckets)
172175 verfp = &dreq->ds_cinfo.buckets[commit_idx].direct_verf;
173176 else
fs/nfs/filelayout/filelayout.c+12−19
@@ -629,23 +629,18 @@ out_put: · 628 unmodified lines
629629 goto out;
630630 }
631631
632−static void filelayout_free_fh_array(struct nfs4_filelayout_segment *fl)
632+static void _filelayout_free_lseg(struct nfs4_filelayout_segment *fl)
633633 {
634634 int i;
635635
636− for (i = 0; i < fl->num_fh; i++) {
637− if (!fl->fh_array[i])
638− break;
639− kfree(fl->fh_array[i]);
636+ if (fl->fh_array) {
637+ for (i = 0; i < fl->num_fh; i++) {
638+ if (!fl->fh_array[i])
639+ break;
640+ kfree(fl->fh_array[i]);
641+ }
642+ kfree(fl->fh_array);
640643 }
641− kfree(fl->fh_array);
642− fl->fh_array = NULL;
643−}
644−
645−static void
646−_filelayout_free_lseg(struct nfs4_filelayout_segment *fl)
647−{
648− filelayout_free_fh_array(fl);
649644 kfree(fl);
650645 }
651646
@@ -716,21 +711,21 @@ filelayout_decode_layout(struct pnfs_layout_hdr *flo, · 64 unmodified lines
716711 /* Do we want to use a mempool here? */
717712 fl->fh_array[i] = kmalloc(sizeof(struct nfs_fh), gfp_flags);
718713 if (!fl->fh_array[i])
719− goto out_err_free;
714+ goto out_err;
720715
721716 p = xdr_inline_decode(&stream, 4);
722717 if (unlikely(!p))
723− goto out_err_free;
718+ goto out_err;
724719 fl->fh_array[i]->size = be32_to_cpup(p++);
725720 if (sizeof(struct nfs_fh) < fl->fh_array[i]->size) {
726721 printk(KERN_ERR "NFS: Too big fh %d received %d\n",
727722 i, fl->fh_array[i]->size);
728− goto out_err_free;
723+ goto out_err;
729724 }
730725
731726 p = xdr_inline_decode(&stream, fl->fh_array[i]->size);
732727 if (unlikely(!p))
733− goto out_err_free;
728+ goto out_err;
734729 memcpy(fl->fh_array[i]->data, p, fl->fh_array[i]->size);
735730 dprintk("DEBUG: %s: fh len %d\n", __func__,
736731 fl->fh_array[i]->size);
@@ -739,8 +734,6 @@ filelayout_decode_layout(struct pnfs_layout_hdr *flo, · 2 unmodified lines
739734 __free_page(scratch);
740735 return 0;
741736
742−out_err_free:
743− filelayout_free_fh_array(fl);
744737 out_err:
745738 __free_page(scratch);
746739 return -EIO;
fs/nfs/nfs42proc.c+3−1
@@ -175,10 +175,12 @@ loff_t nfs42_proc_llseek(struct file *filep, loff_t offset, int whence) · 174 unmodified lines
175175 {
176176 struct nfs_server *server = NFS_SERVER(file_inode(filep));
177177 struct nfs4_exception exception = { };
178− int err;
178+ loff_t err;
179179
180180 do {
181181 err = _nfs42_proc_llseek(filep, offset, whence);
182+ if (err >= 0)
183+ break;
182184 if (err == -ENOTSUPP)
183185 return -EOPNOTSUPP;
184186 err = nfs4_handle_exception(server, err, &exception);
fs/nfs/nfs4proc.c+82−45
@@ -1127,6 +1127,21 @@ static int nfs4_wait_for_completion_rpc_task(struct rpc_task *task) · 1126 unmodified lines
11271127 return ret;
11281128 }
11291129
1130+static bool nfs4_mode_match_open_stateid(struct nfs4_state *state,
1131+ fmode_t fmode)
1132+{
1133+ switch(fmode & (FMODE_READ|FMODE_WRITE)) {
1134+ case FMODE_READ|FMODE_WRITE:
1135+ return state->n_rdwr != 0;
1136+ case FMODE_WRITE:
1137+ return state->n_wronly != 0;
1138+ case FMODE_READ:
1139+ return state->n_rdonly != 0;
1140+ }
1141+ WARN_ON_ONCE(1);
1142+ return false;
1143+}
1144+
11301145 static int can_open_cached(struct nfs4_state *state, fmode_t mode, int open_mode)
11311146 {
11321147 int ret = 0;
@@ -1571,17 +1586,13 @@ static struct nfs4_opendata *nfs4_open_recoverdata_alloc(struct nfs_open_context · 438 unmodified lines
15711586 return opendata;
15721587 }
15731588
1574−static int nfs4_open_recover_helper(struct nfs4_opendata *opendata, fmode_t fmode, struct nfs4_state **res)
1589+static int nfs4_open_recover_helper(struct nfs4_opendata *opendata,
1590+ fmode_t fmode)
15751591 {
15761592 struct nfs4_state *newstate;
15771593 int ret;
15781594
1579− if ((opendata->o_arg.claim == NFS4_OPEN_CLAIM_DELEGATE_CUR ||
1580− opendata->o_arg.claim == NFS4_OPEN_CLAIM_DELEG_CUR_FH) &&
1581− (opendata->o_arg.u.delegation_type & fmode) != fmode)
1582− /* This mode can't have been delegated, so we must have
1583− * a valid open_stateid to cover it - not need to reclaim.
1584− */
1595+ if (!nfs4_mode_match_open_stateid(opendata->state, fmode))
15851596 return 0;
15861597 opendata->o_arg.open_flags = 0;
15871598 opendata->o_arg.fmode = fmode;
@@ -1597,14 +1608,14 @@ static int nfs4_open_recover_helper(struct nfs4_opendata *opendata, fmode_t fmod · 9 unmodified lines
15971608 newstate = nfs4_opendata_to_nfs4_state(opendata);
15981609 if (IS_ERR(newstate))
15991610 return PTR_ERR(newstate);
1611+ if (newstate != opendata->state)
1612+ ret = -ESTALE;
16001613 nfs4_close_state(newstate, fmode);
1601− *res = newstate;
1602− return 0;
1614+ return ret;
16031615 }
16041616
16051617 static int nfs4_open_recover(struct nfs4_opendata *opendata, struct nfs4_state *state)
16061618 {
1607− struct nfs4_state *newstate;
16081619 int ret;
16091620
16101621 /* Don't trigger recovery in nfs_test_and_clear_all_open_stateid */
@@ -1615,27 +1626,15 @@ static int nfs4_open_recover(struct nfs4_opendata *opendata, struct nfs4_state * · 4 unmodified lines
16151626 clear_bit(NFS_DELEGATED_STATE, &state->flags);
16161627 clear_bit(NFS_OPEN_STATE, &state->flags);
16171628 smp_rmb();
1618− if (state->n_rdwr != 0) {
1619− ret = nfs4_open_recover_helper(opendata, FMODE_READ|FMODE_WRITE, &newstate);
1620− if (ret != 0)
1621− return ret;
1622− if (newstate != state)
1623− return -ESTALE;
1624− }
1625− if (state->n_wronly != 0) {
1626− ret = nfs4_open_recover_helper(opendata, FMODE_WRITE, &newstate);
1627− if (ret != 0)
1628− return ret;
1629− if (newstate != state)
1630− return -ESTALE;
1631− }
1632− if (state->n_rdonly != 0) {
1633− ret = nfs4_open_recover_helper(opendata, FMODE_READ, &newstate);
1634− if (ret != 0)
1635− return ret;
1636− if (newstate != state)
1637− return -ESTALE;
1638− }
1629+ ret = nfs4_open_recover_helper(opendata, FMODE_READ|FMODE_WRITE);
1630+ if (ret != 0)
1631+ return ret;
1632+ ret = nfs4_open_recover_helper(opendata, FMODE_WRITE);
1633+ if (ret != 0)
1634+ return ret;
1635+ ret = nfs4_open_recover_helper(opendata, FMODE_READ);
1636+ if (ret != 0)
1637+ return ret;
16391638 /*
16401639 * We may have performed cached opens for all three recoveries.
16411640 * Check if we need to update the current stateid.
@@ -1759,18 +1758,32 @@ static int nfs4_handle_delegation_recall_error(struct nfs_server *server, struct · 117 unmodified lines
17591758 return err;
17601759 }
17611760
1762−int nfs4_open_delegation_recall(struct nfs_open_context *ctx, struct nfs4_state *state, const nfs4_stateid *stateid)
1761+int nfs4_open_delegation_recall(struct nfs_open_context *ctx,
1762+ struct nfs4_state *state, const nfs4_stateid *stateid,
1763+ fmode_t type)
17631764 {
17641765 struct nfs_server *server = NFS_SERVER(state->inode);
17651766 struct nfs4_opendata *opendata;
1766− int err;
1767+ int err = 0;
17671768
17681769 opendata = nfs4_open_recoverdata_alloc(ctx, state,
17691770 NFS4_OPEN_CLAIM_DELEG_CUR_FH);
17701771 if (IS_ERR(opendata))
17711772 return PTR_ERR(opendata);
17721773 nfs4_stateid_copy(&opendata->o_arg.u.delegation, stateid);
1773− err = nfs4_open_recover(opendata, state);
1774+ clear_bit(NFS_DELEGATED_STATE, &state->flags);
1775+ switch (type & (FMODE_READ|FMODE_WRITE)) {
1776+ case FMODE_READ|FMODE_WRITE:
1777+ case FMODE_WRITE:
1778+ err = nfs4_open_recover_helper(opendata, FMODE_READ|FMODE_WRITE);
1779+ if (err)
1780+ break;
1781+ err = nfs4_open_recover_helper(opendata, FMODE_WRITE);
1782+ if (err)
1783+ break;
1784+ case FMODE_READ:
1785+ err = nfs4_open_recover_helper(opendata, FMODE_READ);
1786+ }
17741787 nfs4_opendata_put(opendata);
17751788 return nfs4_handle_delegation_recall_error(server, state, stateid, err);
17761789 }
@@ -2645,6 +2658,15 @@ out: · 868 unmodified lines
26452658 return err;
26462659 }
26472660
2661+static bool
2662+nfs4_wait_on_layoutreturn(struct inode *inode, struct rpc_task *task)
2663+{
2664+ if (inode == NULL || !nfs_have_layout(inode))
2665+ return false;
2666+
2667+ return pnfs_wait_on_layoutreturn(inode, task);
2668+}
2669+
26482670 struct nfs4_closedata {
26492671 struct inode *inode;
26502672 struct nfs4_state *state;
@@ -2763,6 +2785,11 @@ static void nfs4_close_prepare(struct rpc_task *task, void *data) · 112 unmodified lines
27632785 goto out_no_action;
27642786 }
27652787
2788+ if (nfs4_wait_on_layoutreturn(inode, task)) {
2789+ nfs_release_seqid(calldata->arg.seqid);
2790+ goto out_wait;
2791+ }
2792+
27662793 if (calldata->arg.fmode == 0)
27672794 task->tk_msg.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_CLOSE];
27682795 if (calldata->roc)
@@ -5308,6 +5335,9 @@ static void nfs4_delegreturn_prepare(struct rpc_task *task, void *data) · 2539 unmodified lines
53085335
53095336 d_data = (struct nfs4_delegreturndata *)data;
53105337
5338+ if (nfs4_wait_on_layoutreturn(d_data->inode, task))
5339+ return;
5340+
53115341 if (d_data->roc)
53125342 pnfs_roc_get_barrier(d_data->inode, &d_data->roc_barrier);
53135343
@@ -7800,39 +7830,46 @@ static void nfs4_layoutget_done(struct rpc_task *task, void *calldata) · 2486 unmodified lines
78007830 dprintk("%s: NFS4ERR_RECALLCONFLICT waiting %lu\n",
78017831 __func__, delay);
78027832 rpc_delay(task, delay);
7803− task->tk_status = 0;
7804− rpc_restart_call_prepare(task);
7805− goto out; /* Do not call nfs4_async_handle_error() */
7833+ /* Do not call nfs4_async_handle_error() */
7834+ goto out_restart;
78067835 }
78077836 break;
78087837 case -NFS4ERR_EXPIRED:
78097838 case -NFS4ERR_BAD_STATEID:
78107839 spin_lock(&inode->i_lock);
7811− lo = NFS_I(inode)->layout;
7812− if (!lo || list_empty(&lo->plh_segs)) {
7840+ if (nfs4_stateid_match(&lgp->args.stateid,
7841+ &lgp->args.ctx->state->stateid)) {
78137842 spin_unlock(&inode->i_lock);
78147843 /* If the open stateid was bad, then recover it. */
78157844 state = lgp->args.ctx->state;
7816− } else {
7845+ break;
7846+ }
7847+ lo = NFS_I(inode)->layout;
7848+ if (lo && nfs4_stateid_match(&lgp->args.stateid,
7849+ &lo->plh_stateid)) {
78177850 LIST_HEAD(head);
78187851
78197852 /*
78207853 * Mark the bad layout state as invalid, then retry
78217854 * with the current stateid.
78227855 */
7856+ set_bit(NFS_LAYOUT_INVALID_STID, &lo->plh_flags);
78237857 pnfs_mark_matching_lsegs_invalid(lo, &head, NULL);
78247858 spin_unlock(&inode->i_lock);
78257859 pnfs_free_lseg_list(&head);
7826−
7827− task->tk_status = 0;
7828− rpc_restart_call_prepare(task);
7829− }
7860+ } else
7861+ spin_unlock(&inode->i_lock);
7862+ goto out_restart;
78307863 }
78317864 if (nfs4_async_handle_error(task, server, state, NULL) == -EAGAIN)
7832− rpc_restart_call_prepare(task);
7865+ goto out_restart;
78337866 out:
78347867 dprintk("<-- %s\n", __func__);
78357868 return;
7869+out_restart:
7870+ task->tk_status = 0;
7871+ rpc_restart_call_prepare(task);
7872+ return;
78367873 out_overflow:
78377874 task->tk_status = -EOVERFLOW;
78387875 goto out;
fs/nfs/nfs4state.c+1−1
@@ -1481,7 +1481,7 @@ restart: · 1480 unmodified lines
14811481 spin_unlock(&state->state_lock);
14821482 }
14831483 nfs4_put_open_state(state);
1484− clear_bit(NFS4CLNT_RECLAIM_NOGRACE,
1484+ clear_bit(NFS_STATE_RECLAIM_NOGRACE,
14851485 &state->flags);
14861486 spin_lock(&sp->so_lock);
14871487 goto restart;
fs/nfs/pagelist.c+1−1
@@ -508,7 +508,7 @@ size_t nfs_generic_pg_test(struct nfs_pageio_descriptor *desc, · 507 unmodified lines
508508 * for it without upsetting the slab allocator.
509509 */
510510 if (((mirror->pg_count + req->wb_bytes) >> PAGE_SHIFT) *
511− sizeof(struct page) > PAGE_SIZE)
511+ sizeof(struct page *) > PAGE_SIZE)
512512 return 0;
513513
514514 return min(mirror->pg_bsize - mirror->pg_count, (size_t)req->wb_bytes);
fs/nfs/pnfs.c+25−10
@@ -1104,20 +1104,15 @@ bool pnfs_roc(struct inode *ino) · 1103 unmodified lines
11041104 mark_lseg_invalid(lseg, &tmp_list);
11051105 found = true;
11061106 }
1107− /* pnfs_prepare_layoutreturn() grabs lo ref and it will be put
1108− * in pnfs_roc_release(). We don't really send a layoutreturn but
1109− * still want others to view us like we are sending one!
1110− *
1111− * If pnfs_prepare_layoutreturn() fails, it means someone else is doing
1112− * LAYOUTRETURN, so we proceed like there are no layouts to return.
1113− *
1114− * ROC in three conditions:
1107+ /* ROC in two conditions:
11151108 * 1. there are ROC lsegs
11161109 * 2. we don't send layoutreturn
1117− * 3. no others are sending layoutreturn
11181110 */
1119− if (found && !layoutreturn && pnfs_prepare_layoutreturn(lo))
1111+ if (found && !layoutreturn) {
1112+ /* lo ref dropped in pnfs_roc_release() */
1113+ pnfs_get_layout_hdr(lo);
11201114 roc = true;
1115+ }
11211116
11221117 out_noroc:
11231118 spin_unlock(&ino->i_lock);
@@ -1172,6 +1167,26 @@ void pnfs_roc_get_barrier(struct inode *ino, u32 *barrier) · 48 unmodified lines
11721167 spin_unlock(&ino->i_lock);
11731168 }
11741169
1170+bool pnfs_wait_on_layoutreturn(struct inode *ino, struct rpc_task *task)
1171+{
1172+ struct nfs_inode *nfsi = NFS_I(ino);
1173+ struct pnfs_layout_hdr *lo;
1174+ bool sleep = false;
1175+
1176+ /* we might not have grabbed lo reference. so need to check under
1177+ * i_lock */
1178+ spin_lock(&ino->i_lock);
1179+ lo = nfsi->layout;
1180+ if (lo && test_bit(NFS_LAYOUT_RETURN, &lo->plh_flags))
1181+ sleep = true;
1182+ spin_unlock(&ino->i_lock);
1183+
1184+ if (sleep)
1185+ rpc_sleep_on(&NFS_SERVER(ino)->roc_rpcwaitq, task, NULL);
1186+
1187+ return sleep;
1188+}
1189+
11751190 /*
11761191 * Compare two layout segments for sorting into layout cache.
11771192 * We want to preferentially return RW over RO layouts, so ensure those
fs/nfs/pnfs.h+7−0
@@ -270,6 +270,7 @@ bool pnfs_roc(struct inode *ino); · 269 unmodified lines
270270 void pnfs_roc_release(struct inode *ino);
271271 void pnfs_roc_set_barrier(struct inode *ino, u32 barrier);
272272 void pnfs_roc_get_barrier(struct inode *ino, u32 *barrier);
273+bool pnfs_wait_on_layoutreturn(struct inode *ino, struct rpc_task *task);
273274 void pnfs_set_layoutcommit(struct inode *, struct pnfs_layout_segment *, loff_t);
274275 void pnfs_cleanup_layoutcommit(struct nfs4_layoutcommit_data *data);
275276 int pnfs_layoutcommit_inode(struct inode *inode, bool sync);
@@ -639,6 +640,12 @@ pnfs_roc_get_barrier(struct inode *ino, u32 *barrier) · 363 unmodified lines
639640 {
640641 }
641642
643+static inline bool
644+pnfs_wait_on_layoutreturn(struct inode *ino, struct rpc_task *task)
645+{
646+ return false;
647+}
648+
642649 static inline void set_pnfs_layoutdriver(struct nfs_server *s,
643650 const struct nfs_fh *mntfh, u32 id)
644651 {
fs/nfs/read.c+3−0
@@ -72,6 +72,9 @@ void nfs_pageio_reset_read_mds(struct nfs_pageio_descriptor *pgio) · 71 unmodified lines
7272 {
7373 struct nfs_pgio_mirror *mirror;
7474
75+ if (pgio->pg_ops && pgio->pg_ops->pg_cleanup)
76+ pgio->pg_ops->pg_cleanup(pgio);
77+
7578 pgio->pg_ops = &nfs_pgio_rw_ops;
7679
7780 /* read path should never have more than one mirror */
fs/nfs/write.c+3−0
@@ -1351,6 +1351,9 @@ void nfs_pageio_reset_write_mds(struct nfs_pageio_descriptor *pgio) · 1350 unmodified lines
13511351 {
13521352 struct nfs_pgio_mirror *mirror;
13531353
1354+ if (pgio->pg_ops && pgio->pg_ops->pg_cleanup)
1355+ pgio->pg_ops->pg_cleanup(pgio);
1356+
13541357 pgio->pg_ops = &nfs_pgio_rw_ops;
13551358
13561359 nfs_pageio_stop_mirroring(pgio);
fs/ocfs2/dlm/dlmmaster.c+6−3
@@ -1439,6 +1439,7 @@ int dlm_master_request_handler(struct o2net_msg *msg, u32 len, void *data, · 1438 unmodified lines
14391439 int found, ret;
14401440 int set_maybe;
14411441 int dispatch_assert = 0;
1442+ int dispatched = 0;
14421443
14431444 if (!dlm_grab(dlm))
14441445 return DLM_MASTER_RESP_NO;
@@ -1658,15 +1659,18 @@ send_response: · 213 unmodified lines
16581659 mlog(ML_ERROR, "failed to dispatch assert master work\n");
16591660 response = DLM_MASTER_RESP_ERROR;
16601661 dlm_lockres_put(res);
1661− } else
1662+ } else {
1663+ dispatched = 1;
16621664 __dlm_lockres_grab_inflight_worker(dlm, res);
1665+ }
16631666 spin_unlock(&res->spinlock);
16641667 } else {
16651668 if (res)
16661669 dlm_lockres_put(res);
16671670 }
16681671
1669− dlm_put(dlm);
1672+ if (!dispatched)
1673+ dlm_put(dlm);
16701674 return response;
16711675 }
16721676
@@ -2090,7 +2094,6 @@ int dlm_dispatch_assert_master(struct dlm_ctxt *dlm, · 417 unmodified lines
20902094
20912095
20922096 /* queue up work for dlm_assert_master_worker */
2093− dlm_grab(dlm); /* get an extra ref for the work item */
20942097 dlm_init_work_item(dlm, item, dlm_assert_master_worker, NULL);
20952098 item->u.am.lockres = res; /* already have a ref */
20962099 /* can optionally ignore node numbers higher than this node */
fs/ocfs2/dlm/dlmrecovery.c+6−2
@@ -1694,6 +1694,7 @@ int dlm_master_requery_handler(struct o2net_msg *msg, u32 len, void *data, · 1693 unmodified lines
16941694 unsigned int hash;
16951695 int master = DLM_LOCK_RES_OWNER_UNKNOWN;
16961696 u32 flags = DLM_ASSERT_MASTER_REQUERY;
1697+ int dispatched = 0;
16971698
16981699 if (!dlm_grab(dlm)) {
16991700 /* since the domain has gone away on this
@@ -1719,8 +1720,10 @@ int dlm_master_requery_handler(struct o2net_msg *msg, u32 len, void *data, · 19 unmodified lines
17191720 dlm_put(dlm);
17201721 /* sender will take care of this and retry */
17211722 return ret;
1722− } else
1723+ } else {
1724+ dispatched = 1;
17231725 __dlm_lockres_grab_inflight_worker(dlm, res);
1726+ }
17241727 spin_unlock(&res->spinlock);
17251728 } else {
17261729 /* put.. incase we are not the master */
@@ -1730,7 +1733,8 @@ int dlm_master_requery_handler(struct o2net_msg *msg, u32 len, void *data, · 3 unmodified lines
17301733 }
17311734 spin_unlock(&dlm->spinlock);
17321735
1733− dlm_put(dlm);
1736+ if (!dispatched)
1737+ dlm_put(dlm);
17341738 return master;
17351739 }
17361740
fs/ubifs/xattr.c+0−3
@@ -652,11 +652,8 @@ int ubifs_init_security(struct inode *dentry, struct inode *inode, · 651 unmodified lines
652652 {
653653 int err;
654654
655− mutex_lock(&inode->i_mutex);
656655 err = security_inode_init_security(inode, dentry, qstr,
657656 &init_xattrs, 0);
658− mutex_unlock(&inode->i_mutex);
659−
660657 if (err) {
661658 struct ubifs_info *c = dentry->i_sb->s_fs_info;
662659 ubifs_err(c, "cannot initialize security for inode %lu, error %d",
fs/userfaultfd.c+4−4
@@ -467,8 +467,8 @@ static int userfaultfd_release(struct inode *inode, struct file *file) · 466 unmodified lines
467467 * the fault_*wqh.
468468 */
469469 spin_lock(&ctx->fault_pending_wqh.lock);
470− __wake_up_locked_key(&ctx->fault_pending_wqh, TASK_NORMAL, 0, &range);
471− __wake_up_locked_key(&ctx->fault_wqh, TASK_NORMAL, 0, &range);
470+ __wake_up_locked_key(&ctx->fault_pending_wqh, TASK_NORMAL, &range);
471+ __wake_up_locked_key(&ctx->fault_wqh, TASK_NORMAL, &range);
472472 spin_unlock(&ctx->fault_pending_wqh.lock);
473473
474474 wake_up_poll(&ctx->fd_wqh, POLLHUP);
@@ -650,10 +650,10 @@ static void __wake_userfault(struct userfaultfd_ctx *ctx, · 175 unmodified lines
650650 spin_lock(&ctx->fault_pending_wqh.lock);
651651 /* wake all in the range and autoremove */
652652 if (waitqueue_active(&ctx->fault_pending_wqh))
653− __wake_up_locked_key(&ctx->fault_pending_wqh, TASK_NORMAL, 0,
653+ __wake_up_locked_key(&ctx->fault_pending_wqh, TASK_NORMAL,
654654 range);
655655 if (waitqueue_active(&ctx->fault_wqh))
656− __wake_up_locked_key(&ctx->fault_wqh, TASK_NORMAL, 0, range);
656+ __wake_up_locked_key(&ctx->fault_wqh, TASK_NORMAL, range);
657657 spin_unlock(&ctx->fault_pending_wqh.lock);
658658 }
659659
include/asm-generic/word-at-a-time.h+72−8
@@ -1,15 +1,10 @@
11 #ifndef _ASM_WORD_AT_A_TIME_H
22 #define _ASM_WORD_AT_A_TIME_H
33
4−/*
5− * This says "generic", but it's actually big-endian only.
6− * Little-endian can use more efficient versions of these
7− * interfaces, see for example
8− * arch/x86/include/asm/word-at-a-time.h
9− * for those.
10− */
11−
124 #include <linux/kernel.h>
5+#include <asm/byteorder.h>
6+
7+#ifdef __BIG_ENDIAN
138
149 struct word_at_a_time {
1510 const unsigned long high_bits, low_bits;
@@ -53,4 +48,73 @@ static inline bool has_zero(unsigned long val, unsigned long *data, const struct · 37 unmodified lines
5348 #define zero_bytemask(mask) (~1ul << __fls(mask))
5449 #endif
5550
51+#else
52+
53+/*
54+ * The optimal byte mask counting is probably going to be something
55+ * that is architecture-specific. If you have a reliably fast
56+ * bit count instruction, that might be better than the multiply
57+ * and shift, for example.
58+ */
59+struct word_at_a_time {
60+ const unsigned long one_bits, high_bits;
61+};
62+
63+#define WORD_AT_A_TIME_CONSTANTS { REPEAT_BYTE(0x01), REPEAT_BYTE(0x80) }
64+
65+#ifdef CONFIG_64BIT
66+
67+/*
68+ * Jan Achrenius on G+: microoptimized version of
69+ * the simpler "(mask & ONEBYTES) * ONEBYTES >> 56"
70+ * that works for the bytemasks without having to
71+ * mask them first.
72+ */
73+static inline long count_masked_bytes(unsigned long mask)
74+{
75+ return mask*0x0001020304050608ul >> 56;
76+}
77+
78+#else /* 32-bit case */
79+
80+/* Carl Chatfield / Jan Achrenius G+ version for 32-bit */
81+static inline long count_masked_bytes(long mask)
82+{
83+ /* (000000 0000ff 00ffff ffffff) -> ( 1 1 2 3 ) */
84+ long a = (0x0ff0001+mask) >> 23;
85+ /* Fix the 1 for 00 case */
86+ return a & mask;
87+}
88+
89+#endif
90+
91+/* Return nonzero if it has a zero */
92+static inline unsigned long has_zero(unsigned long a, unsigned long *bits, const struct word_at_a_time *c)
93+{
94+ unsigned long mask = ((a - c->one_bits) & ~a) & c->high_bits;
95+ *bits = mask;
96+ return mask;
97+}
98+
99+static inline unsigned long prep_zero_mask(unsigned long a, unsigned long bits, const struct word_at_a_time *c)
100+{
101+ return bits;
102+}
103+
104+static inline unsigned long create_zero_mask(unsigned long bits)
105+{
106+ bits = (bits - 1) & ~bits;
107+ return bits >> 7;
108+}
109+
110+/* The mask we created is directly usable as a bytemask */
111+#define zero_bytemask(mask) (mask)
112+
113+static inline unsigned long find_zero(unsigned long mask)
114+{
115+ return count_masked_bytes(mask);
116+}
117+
118+#endif /* __BIG_ENDIAN */
119+
56120 #endif /* _ASM_WORD_AT_A_TIME_H */
include/drm/drm_crtc_helper.h+1−0
@@ -240,5 +240,6 @@ extern void drm_kms_helper_hotplug_event(struct drm_device *dev); · 239 unmodified lines
240240
241241 extern void drm_kms_helper_poll_disable(struct drm_device *dev);
242242 extern void drm_kms_helper_poll_enable(struct drm_device *dev);
243+extern void drm_kms_helper_poll_enable_locked(struct drm_device *dev);
243244
244245 #endif
include/drm/drm_dp_helper.h+4−0
@@ -568,6 +568,10 @@ · 567 unmodified lines
568568 #define MODE_I2C_READ 4
569569 #define MODE_I2C_STOP 8
570570
571+/* DP 1.2 MST PORTs - Section 2.5.1 v1.2a spec */
572+#define DP_MST_PHYSICAL_PORT_0 0
573+#define DP_MST_LOGICAL_PORT_0 8
574+
571575 #define DP_LINK_STATUS_SIZE 6
572576 bool drm_dp_channel_eq_ok(const u8 link_status[DP_LINK_STATUS_SIZE],
573577 int lane_count);
include/drm/drm_dp_mst_helper.h+1−0
@@ -374,6 +374,7 @@ struct drm_dp_mst_topology_mgr; · 373 unmodified lines
374374 struct drm_dp_mst_topology_cbs {
375375 /* create a connector for a port */
376376 struct drm_connector *(*add_connector)(struct drm_dp_mst_topology_mgr *mgr, struct drm_dp_mst_port *port, const char *path);
377+ void (*register_connector)(struct drm_connector *connector);
377378 void (*destroy_connector)(struct drm_dp_mst_topology_mgr *mgr,
378379 struct drm_connector *connector);
379380 void (*hotplug)(struct drm_dp_mst_topology_mgr *mgr);
include/linux/acpi.h+1−0
@@ -217,6 +217,7 @@ struct pci_dev; · 216 unmodified lines
217217
218218 int acpi_pci_irq_enable (struct pci_dev *dev);
219219 void acpi_penalize_isa_irq(int irq, int active);
220+bool acpi_isa_irq_available(int irq);
220221 void acpi_penalize_sci_irq(int irq, int trigger, int polarity);
221222 void acpi_pci_irq_disable (struct pci_dev *dev);
222223
include/linux/backing-dev.h+9−2
@@ -13,6 +13,7 @@ · 12 unmodified lines
1313 #include <linux/sched.h>
1414 #include <linux/blkdev.h>
1515 #include <linux/writeback.h>
16+#include <linux/memcontrol.h>
1617 #include <linux/blk-cgroup.h>
1718 #include <linux/backing-dev-defs.h>
1819 #include <linux/slab.h>
@@ -252,13 +253,19 @@ int inode_congested(struct inode *inode, int cong_bits); · 233 unmodified lines
252253 * @inode: inode of interest
253254 *
254255 * cgroup writeback requires support from both the bdi and filesystem.
255− * Test whether @inode has both.
256+ * Also, both memcg and iocg have to be on the default hierarchy. Test
257+ * whether all conditions are met.
258+ *
259+ * Note that the test result may change dynamically on the same inode
260+ * depending on how memcg and iocg are configured.
256261 */
257262 static inline bool inode_cgwb_enabled(struct inode *inode)
258263 {
259264 struct backing_dev_info *bdi = inode_to_bdi(inode);
260265
261− return bdi_cap_account_dirty(bdi) &&
266+ return cgroup_on_dfl(mem_cgroup_root_css->cgroup) &&
267+ cgroup_on_dfl(blkcg_root_css->cgroup) &&
268+ bdi_cap_account_dirty(bdi) &&
262269 (bdi->capabilities & BDI_CAP_CGROUP_WRITEBACK) &&
263270 (inode->i_sb->s_iflags & SB_I_CGROUPWB);
264271 }
include/linux/blk-mq.h+1−4
@@ -145,7 +145,6 @@ enum { · 144 unmodified lines
145145 BLK_MQ_F_SHOULD_MERGE = 1 << 0,
146146 BLK_MQ_F_TAG_SHARED = 1 << 1,
147147 BLK_MQ_F_SG_MERGE = 1 << 2,
148− BLK_MQ_F_SYSFS_UP = 1 << 3,
149148 BLK_MQ_F_DEFER_ISSUE = 1 << 4,
150149 BLK_MQ_F_ALLOC_POLICY_START_BIT = 8,
151150 BLK_MQ_F_ALLOC_POLICY_BITS = 1,
@@ -215,7 +214,7 @@ void blk_mq_add_to_requeue_list(struct request *rq, bool at_head); · 63 unmodified lines
215214 void blk_mq_cancel_requeue_work(struct request_queue *q);
216215 void blk_mq_kick_requeue_list(struct request_queue *q);
217216 void blk_mq_abort_requeue_list(struct request_queue *q);
218−void blk_mq_complete_request(struct request *rq);
217+void blk_mq_complete_request(struct request *rq, int error);
219218
220219 void blk_mq_stop_hw_queue(struct blk_mq_hw_ctx *hctx);
221220 void blk_mq_start_hw_queue(struct blk_mq_hw_ctx *hctx);
@@ -224,8 +223,6 @@ void blk_mq_start_hw_queues(struct request_queue *q); · 2 unmodified lines
224223 void blk_mq_start_stopped_hw_queues(struct request_queue *q, bool async);
225224 void blk_mq_run_hw_queues(struct request_queue *q, bool async);
226225 void blk_mq_delay_queue(struct blk_mq_hw_ctx *hctx, unsigned long msecs);
227−void blk_mq_tag_busy_iter(struct blk_mq_hw_ctx *hctx, busy_iter_fn *fn,
228− void *priv);
229226 void blk_mq_all_tag_busy_iter(struct blk_mq_tags *tags, busy_tag_iter_fn *fn,
230227 void *priv);
231228 void blk_mq_freeze_queue(struct request_queue *q);
include/linux/blkdev.h+2−0
@@ -456,6 +456,8 @@ struct request_queue { · 455 unmodified lines
456456 struct blk_mq_tag_set *tag_set;
457457 struct list_head tag_set_list;
458458 struct bio_set *bio_split;
459+
460+ bool mq_sysfs_init_done;
459461 };
460462
461463 #define QUEUE_FLAG_QUEUED 1 /* uses generic tag queueing */
include/linux/iova.h+2−2
@@ -68,8 +68,8 @@ static inline unsigned long iova_pfn(struct iova_domain *iovad, dma_addr_t iova) · 67 unmodified lines
6868 return iova >> iova_shift(iovad);
6969 }
7070
71−int iommu_iova_cache_init(void);
72−void iommu_iova_cache_destroy(void);
71+int iova_cache_get(void);
72+void iova_cache_put(void);
7373
7474 struct iova *alloc_iova_mem(void);
7575 void free_iova_mem(struct iova *iova);
include/linux/memcontrol.h+0−1
@@ -242,7 +242,6 @@ struct mem_cgroup { · 241 unmodified lines
242242 * percpu counter.
243243 */
244244 struct mem_cgroup_stat_cpu __percpu *stat;
245− spinlock_t pcp_counter_lock;
246245
247246 #if defined(CONFIG_MEMCG_KMEM) && defined(CONFIG_INET)
248247 struct cg_proto tcp_mem;
include/linux/mlx5/device.h+0−11
@@ -402,17 +402,6 @@ struct mlx5_cmd_teardown_hca_mbox_out { · 401 unmodified lines
402402 u8 rsvd[8];
403403 };
404404
405−struct mlx5_cmd_query_special_contexts_mbox_in {
406− struct mlx5_inbox_hdr hdr;
407− u8 rsvd[8];
408−};
409−
410−struct mlx5_cmd_query_special_contexts_mbox_out {
411− struct mlx5_outbox_hdr hdr;
412− __be32 dump_fill_mkey;
413− __be32 resd_lkey;
414−};
415−
416405 struct mlx5_cmd_layout {
417406 u8 type;
418407 u8 rsvd0[3];
include/linux/mlx5/driver.h+0−1
@@ -845,7 +845,6 @@ void *mlx5_get_protocol_dev(struct mlx5_core_dev *mdev, int protocol); · 844 unmodified lines
845845 int mlx5_register_interface(struct mlx5_interface *intf);
846846 void mlx5_unregister_interface(struct mlx5_interface *intf);
847847 int mlx5_core_query_vendor_id(struct mlx5_core_dev *mdev, u32 *vendor_id);
848−int mlx5_core_query_special_context(struct mlx5_core_dev *dev, u32 *rsvd_lkey);
849848
850849 struct mlx5_profile {
851850 u64 mask;
include/linux/mm.h+21−0
@@ -905,6 +905,27 @@ static inline void set_page_links(struct page *page, enum zone_type zone, · 904 unmodified lines
905905 #endif
906906 }
907907
908+#ifdef CONFIG_MEMCG
909+static inline struct mem_cgroup *page_memcg(struct page *page)
910+{
911+ return page->mem_cgroup;
912+}
913+
914+static inline void set_page_memcg(struct page *page, struct mem_cgroup *memcg)
915+{
916+ page->mem_cgroup = memcg;
917+}
918+#else
919+static inline struct mem_cgroup *page_memcg(struct page *page)
920+{
921+ return NULL;
922+}
923+
924+static inline void set_page_memcg(struct page *page, struct mem_cgroup *memcg)
925+{
926+}
927+#endif
928+
908929 /*
909930 * Some inline functions in vmstat.h depend on page_zone()
910931 */
include/linux/netdevice.h+1−0
@@ -507,6 +507,7 @@ static inline void napi_enable(struct napi_struct *n) · 506 unmodified lines
507507 BUG_ON(!test_bit(NAPI_STATE_SCHED, &n->state));
508508 smp_mb__before_atomic();
509509 clear_bit(NAPI_STATE_SCHED, &n->state);
510+ clear_bit(NAPI_STATE_NPSVC, &n->state);
510511 }
511512
512513 #ifdef CONFIG_SMP
include/linux/phy.h+5−1
@@ -19,6 +19,7 @@ · 18 unmodified lines
1919 #include <linux/spinlock.h>
2020 #include <linux/ethtool.h>
2121 #include <linux/mii.h>
22+#include <linux/module.h>
2223 #include <linux/timer.h>
2324 #include <linux/workqueue.h>
2425 #include <linux/mod_devicetable.h>
@@ -153,6 +154,7 @@ struct sk_buff; · 128 unmodified lines
153154 * PHYs should register using this structure
154155 */
155156 struct mii_bus {
157+ struct module *owner;
156158 const char *name;
157159 char id[MII_BUS_ID_SIZE];
158160 void *priv;
@@ -198,7 +200,8 @@ static inline struct mii_bus *mdiobus_alloc(void) · 39 unmodified lines
198200 return mdiobus_alloc_size(0);
199201 }
200202
201−int mdiobus_register(struct mii_bus *bus);
203+int __mdiobus_register(struct mii_bus *bus, struct module *owner);
204+#define mdiobus_register(bus) __mdiobus_register(bus, THIS_MODULE)
202205 void mdiobus_unregister(struct mii_bus *bus);
203206 void mdiobus_free(struct mii_bus *bus);
204207 struct mii_bus *devm_mdiobus_alloc_size(struct device *dev, int sizeof_priv);
@@ -742,6 +745,7 @@ struct phy_device *phy_device_create(struct mii_bus *bus, int addr, int phy_id, · 537 unmodified lines
742745 struct phy_c45_device_ids *c45_ids);
743746 struct phy_device *get_phy_device(struct mii_bus *bus, int addr, bool is_c45);
744747 int phy_device_register(struct phy_device *phy);
748+void phy_device_remove(struct phy_device *phydev);
745749 int phy_init_hw(struct phy_device *phydev);
746750 int phy_suspend(struct phy_device *phydev);
747751 int phy_resume(struct phy_device *phydev);
include/linux/rcupdate.h+5−6
@@ -230,12 +230,11 @@ void __wait_rcu_gp(bool checktiny, int n, call_rcu_func_t *crcu_array, · 229 unmodified lines
230230 struct rcu_synchronize *rs_array);
231231
232232 #define _wait_rcu_gp(checktiny, ...) \
233−do { \
234− call_rcu_func_t __crcu_array[] = { __VA_ARGS__ }; \
235− const int __n = ARRAY_SIZE(__crcu_array); \
236− struct rcu_synchronize __rs_array[__n]; \
237− \
238− __wait_rcu_gp(checktiny, __n, __crcu_array, __rs_array); \
233+do { \
234+ call_rcu_func_t __crcu_array[] = { __VA_ARGS__ }; \
235+ struct rcu_synchronize __rs_array[ARRAY_SIZE(__crcu_array)]; \
236+ __wait_rcu_gp(checktiny, ARRAY_SIZE(__crcu_array), \
237+ __crcu_array, __rs_array); \
239238 } while (0)
240239
241240 #define wait_rcu_gp(...) _wait_rcu_gp(false, __VA_ARGS__)
include/linux/skbuff.h+6−3
@@ -179,6 +179,9 @@ struct nf_bridge_info { · 178 unmodified lines
179179 u8 bridged_dnat:1;
180180 __u16 frag_max_size;
181181 struct net_device *physindev;
182+
183+ /* always valid & non-NULL from FORWARD on, for physdev match */
184+ struct net_device *physoutdev;
182185 union {
183186 /* prerouting: detect dnat in orig/reply direction */
184187 __be32 ipv4_daddr;
@@ -189,9 +192,6 @@ struct nf_bridge_info { · 4 unmodified lines
189192 * skb is out in neigh layer.
190193 */
191194 char neigh_header[8];
192−
193− /* always valid & non-NULL from FORWARD on, for physdev match */
194− struct net_device *physoutdev;
195195 };
196196 };
197197 #endif
@@ -2707,6 +2707,9 @@ static inline void skb_postpull_rcsum(struct sk_buff *skb, · 2509 unmodified lines
27072707 {
27082708 if (skb->ip_summed == CHECKSUM_COMPLETE)
27092709 skb->csum = csum_sub(skb->csum, csum_partial(start, len, 0));
2710+ else if (skb->ip_summed == CHECKSUM_PARTIAL &&
2711+ skb_checksum_start_offset(skb) < 0)
2712+ skb->ip_summed = CHECKSUM_NONE;
27102713 }
27112714
27122715 unsigned char *skb_pull_rcsum(struct sk_buff *skb, unsigned int len);
include/linux/spi/spi.h+1−1
@@ -34,7 +34,7 @@ extern struct bus_type spi_bus_type; · 33 unmodified lines
3434
3535 /**
3636 * struct spi_statistics - statistics for spi transfers
37− * @clock: lock protecting this structure
37+ * @lock: lock protecting this structure
3838 *
3939 * @messages: number of spi-messages handled
4040 * @transfers: number of spi_transfers handled
include/linux/string.h+3−0
@@ -25,6 +25,9 @@ extern char * strncpy(char *,const char *, __kernel_size_t); · 24 unmodified lines
2525 #ifndef __HAVE_ARCH_STRLCPY
2626 size_t strlcpy(char *, const char *, size_t);
2727 #endif
28+#ifndef __HAVE_ARCH_STRSCPY
29+ssize_t __must_check strscpy(char *, const char *, size_t);
30+#endif
2831 #ifndef __HAVE_ARCH_STRCAT
2932 extern char * strcat(char *, const char *);
3033 #endif
include/linux/sunrpc/xprtsock.h+3−0
@@ -42,6 +42,7 @@ struct sock_xprt { · 41 unmodified lines
4242 /*
4343 * Connection of transports
4444 */
45+ unsigned long sock_state;
4546 struct delayed_work connect_worker;
4647 struct sockaddr_storage srcaddr;
4748 unsigned short srcport;
@@ -76,6 +77,8 @@ struct sock_xprt { · 28 unmodified lines
7677 */
7778 #define TCP_RPC_REPLY (1UL << 6)
7879
80+#define XPRT_SOCK_CONNECTING 1U
81+
7982 #endif /* __KERNEL__ */
8083
8184 #endif /* _LINUX_SUNRPC_XPRTSOCK_H */
include/linux/thermal.h+7−1
@@ -360,7 +360,7 @@ static inline struct thermal_zone_device * · 359 unmodified lines
360360 thermal_zone_of_sensor_register(struct device *dev, int id, void *data,
361361 const struct thermal_zone_of_device_ops *ops)
362362 {
363− return NULL;
363+ return ERR_PTR(-ENODEV);
364364 }
365365
366366 static inline
@@ -380,6 +380,8 @@ static inline bool cdev_is_power_actor(struct thermal_cooling_device *cdev) · 13 unmodified lines
380380
381381 int power_actor_get_max_power(struct thermal_cooling_device *,
382382 struct thermal_zone_device *tz, u32 *max_power);
383+int power_actor_get_min_power(struct thermal_cooling_device *,
384+ struct thermal_zone_device *tz, u32 *min_power);
383385 int power_actor_set_power(struct thermal_cooling_device *,
384386 struct thermal_instance *, u32);
385387 struct thermal_zone_device *thermal_zone_device_register(const char *, int, int,
@@ -415,6 +417,10 @@ static inline bool cdev_is_power_actor(struct thermal_cooling_device *cdev) · 29 unmodified lines
415417 static inline int power_actor_get_max_power(struct thermal_cooling_device *cdev,
416418 struct thermal_zone_device *tz, u32 *max_power)
417419 { return 0; }
420+static inline int power_actor_get_min_power(struct thermal_cooling_device *cdev,
421+ struct thermal_zone_device *tz,
422+ u32 *min_power)
423+{ return -ENODEV; }
418424 static inline int power_actor_set_power(struct thermal_cooling_device *cdev,
419425 struct thermal_instance *tz, u32 power)
420426 { return 0; }
include/linux/wait.h+2−3
@@ -147,8 +147,7 @@ __remove_wait_queue(wait_queue_head_t *head, wait_queue_t *old) · 146 unmodified lines
147147
148148 typedef int wait_bit_action_f(struct wait_bit_key *);
149149 void __wake_up(wait_queue_head_t *q, unsigned int mode, int nr, void *key);
150−void __wake_up_locked_key(wait_queue_head_t *q, unsigned int mode, int nr,
151− void *key);
150+void __wake_up_locked_key(wait_queue_head_t *q, unsigned int mode, void *key);
152151 void __wake_up_sync_key(wait_queue_head_t *q, unsigned int mode, int nr, void *key);
153152 void __wake_up_locked(wait_queue_head_t *q, unsigned int mode, int nr);
154153 void __wake_up_sync(wait_queue_head_t *q, unsigned int mode, int nr);
@@ -180,7 +179,7 @@ wait_queue_head_t *bit_waitqueue(void *, int); · 25 unmodified lines
180179 #define wake_up_poll(x, m) \
181180 __wake_up(x, TASK_NORMAL, 1, (void *) (m))
182181 #define wake_up_locked_poll(x, m) \

5 more lines aren’t shown here.

include/net/af_unix.h+5−1

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

include/net/flow.h+1−0

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

include/net/inet_timewait_sock.h+13−1

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

include/net/ip6_fib.h+2−1

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

include/net/ip6_tunnel.h+12−5

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

include/net/ip_fib.h+19−11

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

include/net/ip_tunnels.h+2−0

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

include/net/route.h+1−1

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

include/target/target_core_base.h+1−0

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

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

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

include/uapi/linux/lwtunnel.h+0−4

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

include/uapi/linux/userfaultfd.h+0−2

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

ipc/msg.c+7−7

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

ipc/shm.c+7−6

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

ipc/util.c+4−4

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

kernel/events/core.c+81−33

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

kernel/irq/proc.c+17−2

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

kernel/locking/lockdep.c+5−5

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

kernel/rcu/tree.c+5−0

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

kernel/sched/core.c+11−3

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

kernel/sched/wait.c+3−4

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

kernel/time/clocksource.c+1−1

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

lib/iommu-common.c+3−3

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

lib/rhashtable.c+1−4

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

lib/string.c+88−0

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

mm/dmapool.c+1−1

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

mm/hugetlb.c+8−0

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

mm/memcontrol.c+18−13

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

mm/migrate.c+12−2

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

mm/mmap.c+2−1

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

mm/slab.c+10−3

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

mm/vmscan.c+1−1

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

net/atm/clip.c+3−0

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

net/bluetooth/smp.c+6−6

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

net/bridge/br_multicast.c+2−2

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

net/core/dev.c+2−0

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

net/core/fib_rules.c+9−5

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

net/core/filter.c+1−1

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

net/core/net-sysfs.c+10−2

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

net/core/netpoll.c+8−2

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

net/core/rtnetlink.c+16−10

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

net/core/skbuff.c+5−4

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

net/core/sock.c+4−8

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

net/dccp/ackvec.c+4−8

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

net/dccp/ccid.c+1−2

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

net/dccp/minisocks.c+2−2

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

net/dsa/dsa.c+34−7

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

net/dsa/slave.c+8−3

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

net/dsa/tag_trailer.c+1−1

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

net/ipv4/arp.c+25−14

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

net/ipv4/fib_frontend.c+1−0

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

net/ipv4/fib_trie.c+1−1

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

net/ipv4/icmp.c+2−2

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

net/ipv4/inet_connection_sock.c+4−4

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

net/ipv4/inet_timewait_sock.c+10−6

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

net/ipv4/ip_tunnel_core.c+29−25

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

net/ipv4/route.c+5−2

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

net/ipv4/tcp_cubic.c+8−2

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

net/ipv4/tcp_minisocks.c+6−7

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

net/ipv4/tcp_output.c+1−0

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

net/ipv4/udp.c+2−1

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

net/ipv4/xfrm4_policy.c+2−0

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

net/ipv6/addrconf.c+3−4

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

net/ipv6/ip6_fib.c+19−7

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

net/ipv6/ip6_gre.c+55−38

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

net/ipv6/ip6_output.c+8−6

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

net/ipv6/ip6_tunnel.c+106−41

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

net/ipv6/route.c+12−7

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

net/l2tp/l2tp_core.c+9−2

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

net/mac80211/cfg.c+8−5

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

net/netfilter/nf_log.c+7−2

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

net/netfilter/nft_compat.c+18−6

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

net/netlink/af_netlink.c+49−14

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

net/netlink/af_netlink.h+10−0

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

net/openvswitch/Kconfig+2−1

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

net/openvswitch/conntrack.c+5−3

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

net/openvswitch/datapath.c+2−2

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

net/openvswitch/flow_netlink.c+59−23

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

net/openvswitch/flow_table.c+12−11

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

net/openvswitch/flow_table.h+1−1

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

net/packet/af_packet.c+17−15

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

net/sched/cls_fw.c+15−15

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

net/sctp/associola.c+11−9

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

net/sctp/protocol.c+41−23

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

net/sctp/sm_sideeffect.c+24−20

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

net/sunrpc/sched.c+5−9

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

net/sunrpc/xprt.c+6−0

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

net/sunrpc/xprtrdma/fmr_ops.c+0−19

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

net/sunrpc/xprtrdma/frwr_ops.c+0−5

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

net/sunrpc/xprtrdma/physical_ops.c+1−9

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

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

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

net/sunrpc/xprtrdma/xprt_rdma.h+0−1

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

net/sunrpc/xprtsock.c+11−4

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

net/tipc/msg.c+1−0

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

net/unix/af_unix.c+14−1

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

samples/kprobes/jprobe_example.c+7−7

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

samples/kprobes/kprobe_example.c+3−3

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

samples/kprobes/kretprobe_example.c+2−2

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

scripts/extract-cert.c+0−4

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

scripts/sign-file.c+77−17

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

security/keys/gc.c+4−4

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

sound/arm/Kconfig+8−7

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

sound/pci/hda/hda_tegra.c+25−5

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

sound/pci/hda/patch_realtek.c+19−12

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

sound/soc/au1x/psc-i2s.c+0−1

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

sound/soc/codecs/rt5645.c+13−9

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

sound/soc/codecs/wm0010.c+9−14

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

sound/soc/codecs/wm8960.c+18−8

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

sound/soc/codecs/wm8962.c+2−1

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

sound/soc/davinci/davinci-mcasp.c+7−7

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

sound/soc/fsl/fsl-asoc-card.c+2−1

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

sound/soc/fsl/fsl_ssi.c+3−2

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

sound/soc/intel/haswell/sst-haswell-ipc.c+12−8

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

sound/soc/mediatek/mtk-afe-pcm.c+17−0

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

sound/soc/pxa/Kconfig+0−2

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

sound/soc/pxa/pxa2xx-ac97.c+2−2

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

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

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

sound/soc/soc-utils.c+9−0

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

sound/soc/spear/Kconfig+1−1

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

sound/soc/sti/uniperif_player.c+10−4

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

sound/soc/sti/uniperif_reader.c+5−1

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

tools/build/Makefile.feature+6−2

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

tools/build/feature/Makefile+9−1

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

tools/build/feature/test-all.c+10−0

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

tools/build/feature/test-get_cpuid.c+7−0

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

tools/build/feature/test-numa_num_possible_cpus.c+6−0

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

tools/lib/traceevent/event-parse.c+20−3

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

tools/perf/Documentation/intel-pt.txt+0−15

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

tools/perf/config/Makefile+15−5

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

tools/perf/util/probe-event.c+7−6

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

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

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

tools/perf/util/stat.c+14−2

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

tools/perf/util/symbol-elf.c+14−23

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

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

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

tools/power/x86/turbostat/turbostat.c+34−5

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

tools/testing/selftests/membarrier/Makefile+3−4

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

tools/testing/selftests/membarrier/membarrier_test.c+1−4

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

tools/testing/selftests/vm/Makefile+6−3

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

tools/testing/selftests/vm/userfaultfd.c+29−25

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

virt/kvm/kvm_main.c+2−2

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