History

Merge tag 'v4.17-rc4' into patchwork

Linux 4.17-rc4 * tag 'v4.17-rc4': (920 commits) Linux 4.17-rc4 KVM: x86: remove APIC Timer periodic/oneshot spikes genksyms: fix typo in parse.tab.{c,h} generation rules kbuild: replace hardcoded bison in cmd_bison_h with $(YACC) gcc-plugins: fix build condition of SANCOV plugin MAINTAINERS: Update Kbuild entry with a few paths Revert "usb: host: ehci: Use dma_pool_zalloc()" platform/x86: Kconfig: Fix dell-laptop dependency chain. platform/x86: asus-wireless: Fix NULL pointer dereference arm64: vgic-v2: Fix proxying of cpuif access KVM: arm/arm64: vgic_init: Cleanup reference to process_maintenance KVM: arm64: Fix order of vcpu_write_sys_reg() arguments MAINTAINERS & files: Canonize the e-mails I use at files media: imx-media-csi: Fix inconsistent IS_ERR and PTR_ERR tools: power/acpi, revert to LD = gcc bdi: Fix oops in wb_workfn() RDMA/cma: Do not query GID during QP state transition to RTR IB/mlx4: Fix integer overflow when calculating optimal MTT size IB/hfi1: Fix memory leak in exception path in get_irq_affinity() IB/{hfi1, rdmavt}: Fix memory leak in hfi1_alloc_devdata() upon failure ...

Mauro Carvalho Chehab committed 8 years ago

Commit 71db1cd2 parents 7d95fb7 75bc37f999 files · +12047 −6119Browse files

Unified · Split

999 files
  1. Documentation/bpf/bpf_devel_QA.txt +9 −1
  2. Documentation/core-api/kernel-api.rst +13 −0
  3. Documentation/devicetree/bindings/input/atmel,maxtouch.txt +7 −0
  4. Documentation/devicetree/bindings/serial/amlogic,meson-uart.txt +1 −1
  5. Documentation/devicetree/bindings/serial/mvebu-uart.txt +1 −1
  6. Documentation/devicetree/bindings/serial/renesas,sci-serial.txt +2 −0
  7. Documentation/devicetree/bindings/thermal/exynos-thermal.txt +5 −18
  8. Documentation/devicetree/bindings/thermal/thermal.txt +1 −15
  9. Documentation/devicetree/bindings/timer/nuvoton,npcm7xx-timer.txt +21 −0
  10. Documentation/devicetree/bindings/timer/nxp,tpm-timer.txt +1 −1
  11. Documentation/devicetree/bindings/usb/usb-xhci.txt +4 −1
  12. Documentation/doc-guide/parse-headers.rst +2 −2
  13. Documentation/driver-api/firmware/request_firmware.rst +8 −8
  14. Documentation/driver-api/infrastructure.rst +1 −1
  15. Documentation/driver-api/usb/typec.rst +1 −1
  16. Documentation/i2c/dev-interface +14 −18
  17. Documentation/ioctl/ioctl-number.txt +0 −2
  18. Documentation/livepatch/shadow-vars.txt +29 −12
  19. Documentation/media/uapi/rc/keytable.c.rst +1 −1
  20. Documentation/media/uapi/v4l/v4l2grab.c.rst +1 −1
  21. Documentation/networking/filter.txt +3 −3
  22. Documentation/networking/ip-sysctl.txt +4 −19
  23. Documentation/power/suspend-and-cpuhotplug.txt +1 −1
  24. Documentation/process/magic-number.rst +0 −3
  25. Documentation/sphinx/parse-headers.pl +2 −2
  26. Documentation/trace/ftrace.rst +11 −3
  27. Documentation/translations/zh_CN/video4linux/v4l2-framework.txt +2 −2
  28. Documentation/virtual/kvm/api.txt +8 −1
  29. Documentation/virtual/kvm/arm/psci.txt +30 −0
  30. MAINTAINERS +49 −43
  31. Makefile +2 −2
  32. arch/arm/boot/dts/gemini-nas4220b.dts +14 −14
  33. arch/arm/boot/dts/omap4.dtsi +4 −4
  34. arch/arm/configs/gemini_defconfig +25 −2
  35. arch/arm/configs/socfpga_defconfig +1 −0
  36. arch/arm/include/asm/kvm_host.h +3 −0
  37. arch/arm/include/uapi/asm/kvm.h +6 −0
  38. arch/arm/kvm/guest.c +13 −0
  39. arch/arm/mach-omap2/Makefile +1 −5
  40. arch/arm/mach-omap2/pm-asm-offsets.c +3 −0
  41. arch/arm/mach-omap2/sleep33xx.S +0 −1
  42. arch/arm/mach-omap2/sleep43xx.S +0 −1
  43. arch/arm/mach-s3c24xx/mach-jive.c +2 −2
  44. arch/arm64/Makefile +4 −0
  45. arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi +4 −0
  46. arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts +12 −0
  47. arch/arm64/boot/dts/amlogic/meson-gxl-s905x-nexbox-a95x.dts +4 −0
  48. arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dtsi +4 −0
  49. arch/arm64/boot/dts/amlogic/meson-gxl.dtsi +61 −0
  50. arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts +4 −0
  51. arch/arm64/boot/dts/amlogic/meson-gxm.dtsi +17 −0
  52. arch/arm64/boot/dts/arm/juno-motherboard.dtsi +0 −2
  53. arch/arm64/boot/dts/broadcom/stingray/stingray-sata.dtsi +40 −40
  54. arch/arm64/include/asm/kvm_emulate.h +1 −1
  55. arch/arm64/include/asm/kvm_host.h +3 −0
  56. arch/arm64/include/asm/module.h +1 −1
  57. arch/arm64/include/asm/pgtable.h +2 −2
  58. arch/arm64/include/uapi/asm/kvm.h +6 −0
  59. arch/arm64/kernel/cpufeature.c +1 −0
  60. arch/arm64/kernel/module-plts.c +1 −1
  61. arch/arm64/kernel/module.c +1 −1
  62. arch/arm64/kernel/ptrace.c +10 −10
  63. arch/arm64/kernel/traps.c +3 −2
  64. arch/arm64/kvm/guest.c +13 −1
  65. arch/arm64/kvm/hyp/vgic-v2-cpuif-proxy.c +19 −5
  66. arch/arm64/kvm/sys_regs.c +2 −4
  67. arch/arm64/lib/Makefile +4 −0
  68. arch/arm64/mm/flush.c +1 −1
  69. arch/arm64/mm/kasan_init.c +2 −2
  70. arch/hexagon/include/asm/io.h +6 −0
  71. arch/hexagon/lib/checksum.c +1 −0
  72. arch/mips/boot/dts/img/boston.dts +6 −0
  73. arch/mips/include/asm/io.h +3 −1
  74. arch/mips/include/asm/uaccess.h +9 −2
  75. arch/mips/lib/memset.S +8 −3
  76. arch/parisc/Makefile +3 −0
  77. arch/parisc/kernel/Makefile +1 −1
  78. arch/parisc/kernel/drivers.c +4 −3
  79. arch/parisc/kernel/pci.c +1 −1
  80. arch/parisc/kernel/time.c +1 −1
  81. arch/parisc/kernel/traps.c +11 −0
  82. arch/parisc/mm/init.c +1 −1
  83. arch/powerpc/include/asm/powernv.h +1 −1
  84. arch/powerpc/kernel/eeh_pe.c +2 −1
  85. arch/powerpc/kernel/idle_book3s.S +2 −2
  86. arch/powerpc/kernel/mce_power.c +2 −5
  87. arch/powerpc/kernel/setup_64.c +11 −0
  88. arch/powerpc/kernel/smp.c +42 −7
  89. arch/powerpc/kvm/booke.c +7 −0
  90. arch/powerpc/lib/feature-fixups.c +1 −1
  91. arch/powerpc/mm/mem.c +2 −0
  92. arch/powerpc/platforms/cell/spufs/sched.c +1 −1
  93. arch/powerpc/platforms/powernv/memtrace.c +0 −17
  94. arch/powerpc/platforms/powernv/npu-dma.c +73 −15
  95. arch/powerpc/platforms/powernv/opal-rtc.c +5 −3
  96. arch/powerpc/sysdev/xive/native.c +4 −0
  97. arch/riscv/Kconfig +1 −3
  98. arch/riscv/include/asm/Kbuild +0 −1
  99. arch/riscv/kernel/vdso/Makefile +1 −1
  100. arch/s390/Kbuild +1 −0
  101. arch/s390/Kconfig +24 −8
  102. arch/s390/boot/Makefile +0 −6
  103. arch/s390/boot/compressed/.gitignore +1 −0
  104. arch/s390/configs/debug_defconfig +20 −10
  105. arch/s390/configs/gcov_defconfig +0 −661
  106. arch/s390/configs/performance_defconfig +15 −5
  107. arch/s390/defconfig +11 −2
  108. arch/s390/hypfs/inode.c +1 −1
  109. arch/s390/include/asm/kexec.h +23 −0
  110. arch/s390/include/asm/purgatory.h +17 −0
  111. arch/s390/include/asm/setup.h +27 −13
  112. arch/s390/include/asm/thread_info.h +3 −0
  113. arch/s390/include/uapi/asm/signal.h +16 −7
  114. arch/s390/kernel/Makefile +3 −0
  115. arch/s390/kernel/asm-offsets.c +5 −0
  116. arch/s390/kernel/compat_wrapper.c +1 −0
  117. arch/s390/kernel/kexec_elf.c +147 −0
  118. arch/s390/kernel/kexec_image.c +76 −0
  119. arch/s390/kernel/machine_kexec_file.c +245 −0
  120. arch/s390/kernel/module.c +2 −2
  121. arch/s390/kernel/nospec-branch.c +1 −0
  122. arch/s390/kernel/perf_cpum_cf_events.c +5 −4
  123. arch/s390/kernel/process.c +10 −0
  124. arch/s390/kernel/setup.c +1 −0
  125. arch/s390/kernel/syscalls/syscall.tbl +1 −0
  126. arch/s390/kernel/uprobes.c +9 −0
  127. arch/s390/purgatory/.gitignore +2 −0
  128. arch/s390/purgatory/Makefile +37 −0
  129. arch/s390/purgatory/head.S +279 −0
  130. arch/s390/purgatory/purgatory.c +42 −0
  131. arch/sparc/include/uapi/asm/oradax.h +1 −1
  132. arch/sparc/kernel/vio.c +1 −1
  133. arch/x86/Kconfig +4 −0
  134. arch/x86/entry/entry_64_compat.S +4 −4
  135. arch/x86/events/intel/core.c +6 −3
  136. arch/x86/events/intel/uncore_snbep.c +37 −0
  137. arch/x86/include/asm/asm.h +0 −2
  138. arch/x86/include/asm/cpufeatures.h +1 −0
  139. arch/x86/include/asm/ftrace.h +17 −2
  140. arch/x86/include/asm/irq_vectors.h +0 −7
  141. arch/x86/include/asm/jailhouse_para.h +1 −1
  142. arch/x86/include/asm/kvm_host.h +1 −0
  143. arch/x86/include/asm/pgtable.h +5 −0
  144. arch/x86/include/asm/pgtable_64_types.h +4 −4
  145. arch/x86/include/asm/processor.h +0 −2
  146. arch/x86/include/uapi/asm/msgbuf.h +31 −0
  147. arch/x86/include/uapi/asm/shmbuf.h +42 −0
  148. arch/x86/kernel/acpi/boot.c +4 −0
  149. arch/x86/kernel/cpu/common.c +5 −1
  150. arch/x86/kernel/cpu/intel.c +3 −0
  151. arch/x86/kernel/cpu/microcode/core.c +2 −4
  152. arch/x86/kernel/cpu/microcode/intel.c +0 −2
  153. arch/x86/kernel/jailhouse.c +1 −1
  154. arch/x86/kernel/kexec-bzimage64.c +2 −3
  155. arch/x86/kernel/ldt.c +1 −1
  156. arch/x86/kernel/pci-nommu.c +0 −90
  157. arch/x86/kernel/setup.c +6 −0
  158. arch/x86/kernel/smpboot.c +42 −5
  159. arch/x86/kernel/tsc.c +12 −12
  160. arch/x86/kvm/lapic.c +20 −17
  161. arch/x86/kvm/svm.c +18 −13
  162. arch/x86/kvm/vmx.c +59 −50
  163. arch/x86/kvm/x86.c +12 −3
  164. arch/x86/kvm/x86.h +0 −7
  165. arch/x86/mm/dump_pagetables.c +6 −5
  166. arch/x86/mm/pageattr.c +32 −12
  167. arch/x86/mm/pti.c +23 −3
  168. arch/x86/net/bpf_jit_comp.c +14 −4
  169. arch/x86/power/hibernate_64.c +1 −1
  170. arch/x86/xen/enlighten_pv.c +31 −55
  171. block/bfq-iosched.c +9 −1
  172. block/blk-cgroup.c +12 −16
  173. block/blk-core.c +8 −7
  174. block/blk-mq.c +66 −15
  175. block/blk-mq.h +6 −1
  176. block/genhd.c +12 −0
  177. block/partition-generic.c +6 −4
  178. crypto/api.c +8 −3
  179. crypto/drbg.c +2 −0
  180. drivers/acpi/acpi_video.c +25 −2
  181. drivers/acpi/acpi_watchdog.c +49 −10
  182. drivers/acpi/button.c +23 −1
  183. drivers/acpi/scan.c +1 −1
  184. drivers/acpi/sleep.c +13 −0
  185. drivers/amba/bus.c +11 −6
  186. drivers/android/binder.c +8 −0
  187. drivers/atm/iphase.c +2 −2
  188. drivers/base/dma-coherent.c +3 −2
  189. drivers/base/dma-mapping.c +2 −4
  190. drivers/base/firmware_loader/fallback.c +2 −2
  191. drivers/base/firmware_loader/fallback.h +1 −1
  192. drivers/block/loop.c +43 −21
  193. drivers/block/loop.h +0 −1
  194. drivers/block/rbd.c +69 −32
  195. drivers/block/swim.c +22 −27
  196. drivers/block/swim3.c +3 −3
  197. drivers/bus/Kconfig +1 −0
  198. drivers/cdrom/cdrom.c +1 −1
  199. drivers/char/random.c +137 −35
  200. drivers/char/virtio_console.c +71 −86
  201. drivers/clk/clk-cs2000-cp.c +1 −1
  202. drivers/clk/clk-mux.c +9 −1
  203. drivers/clk/clk-stm32mp1.c +23 −31
  204. drivers/clk/clk.c +4 −3
  205. drivers/clk/meson/clk-regmap.c +10 −1
  206. drivers/clk/meson/gxbb-aoclk.h +0 −2
  207. drivers/clk/meson/meson8b.c +3 −2
  208. drivers/clocksource/Kconfig +8 −0
  209. drivers/clocksource/Makefile +1 −0
  210. drivers/clocksource/timer-imx-tpm.c +34 −11
  211. drivers/clocksource/timer-npcm7xx.c +215 −0
  212. drivers/cpufreq/Kconfig.arm +0 −10
  213. drivers/cpufreq/brcmstb-avs-cpufreq.c +1 −322
  214. drivers/cpufreq/cppc_cpufreq.c +44 −2
  215. drivers/cpufreq/powernv-cpufreq.c +11 −3
  216. drivers/dax/device.c +2 −0
  217. drivers/firmware/arm_scmi/clock.c +1 −1
  218. drivers/fpga/altera-ps-spi.c +1 −1
  219. drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +5 −2
  220. drivers/gpu/drm/amd/amdkfd/Kconfig +1 −0
  221. drivers/gpu/drm/amd/amdkfd/kfd_chardev.c +9 −8
  222. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +9 −1
  223. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c +0 −7
  224. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c +3 −2
  225. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +22 −32
  226. drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c +10 −6
  227. drivers/gpu/drm/amd/powerplay/inc/vega12/smu9_driver_if.h +3 −1
  228. drivers/gpu/drm/bridge/dumb-vga-dac.c +3 −1
  229. drivers/gpu/drm/drm_dp_dual_mode_helper.c +32 −7
  230. drivers/gpu/drm/drm_edid.c +3 −8
  231. drivers/gpu/drm/exynos/exynos_drm_fb.c +14 −59
  232. drivers/gpu/drm/i915/gvt/cmd_parser.c +1 −0
  233. drivers/gpu/drm/i915/gvt/display.c +10 −0
  234. drivers/gpu/drm/i915/gvt/dmabuf.c +1 −0
  235. drivers/gpu/drm/i915/gvt/fb_decoder.c +9 −18
  236. drivers/gpu/drm/i915/gvt/gtt.c +45 −7
  237. drivers/gpu/drm/i915/gvt/gtt.h +1 −1
  238. drivers/gpu/drm/i915/gvt/handlers.c +1 −0
  239. drivers/gpu/drm/i915/gvt/kvmgt.c +1 −1
  240. drivers/gpu/drm/i915/i915_drv.c +15 −12
  241. drivers/gpu/drm/i915/i915_gem_execbuffer.c +1 −1
  242. drivers/gpu/drm/i915/i915_pmu.c +27 −10
  243. drivers/gpu/drm/i915/intel_audio.c +1 −1
  244. drivers/gpu/drm/i915/intel_bios.c +9 −4
  245. drivers/gpu/drm/i915/intel_cdclk.c +14 −2
  246. drivers/gpu/drm/i915/intel_csr.c +1 −0
  247. drivers/gpu/drm/i915/intel_drv.h +2 −2
  248. drivers/gpu/drm/i915/intel_fbdev.c +1 −1
  249. drivers/gpu/drm/i915/intel_lrc.c +9 −0
  250. drivers/gpu/drm/i915/intel_runtime_pm.c +5 −6
  251. drivers/gpu/drm/msm/disp/mdp4/mdp4_crtc.c +1 −0
  252. drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c +1 −0
  253. drivers/gpu/drm/msm/disp/mdp_format.c +2 −1
  254. drivers/gpu/drm/msm/disp/mdp_kms.h +1 −1
  255. drivers/gpu/drm/msm/dsi/dsi_host.c +12 −4
  256. drivers/gpu/drm/msm/dsi/phy/dsi_phy.c +109 −0
  257. drivers/gpu/drm/msm/dsi/phy/dsi_phy.h +2 −0
  258. drivers/gpu/drm/msm/dsi/phy/dsi_phy_10nm.c +0 −28
  259. drivers/gpu/drm/msm/msm_fb.c +2 −1
  260. drivers/gpu/drm/msm/msm_fbdev.c +2 −9
  261. drivers/gpu/drm/msm/msm_gem.c +11 −9
  262. drivers/gpu/drm/msm/msm_kms.h +4 −1
  263. drivers/gpu/drm/qxl/qxl_cmd.c +2 −4
  264. drivers/gpu/drm/qxl/qxl_drv.h +1 −0
  265. drivers/gpu/drm/qxl/qxl_ioctl.c +2 −2
  266. drivers/gpu/drm/qxl/qxl_release.c +9 −9
  267. drivers/gpu/drm/sun4i/sun4i_lvds.c +0 −55
  268. drivers/gpu/drm/vc4/vc4_bo.c +2 −0
  269. drivers/gpu/drm/vc4/vc4_crtc.c +45 −1
  270. drivers/gpu/drm/vc4/vc4_validate_shaders.c +1 −0
  271. drivers/gpu/drm/virtio/virtgpu_vq.c +2 −2
  272. drivers/gpu/drm/vmwgfx/vmwgfx_fb.c +10 −21
  273. drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +11 −3
  274. drivers/hid/hid-ids.h +3 −0
  275. drivers/hid/hid-input.c +17 −7
  276. drivers/hid/hidraw.c +5 −0
  277. drivers/hid/i2c-hid/i2c-hid.c +13 −0
  278. drivers/hid/wacom_wac.c +46 −30
  279. drivers/hwmon/k10temp.c +14 −3
  280. drivers/hwmon/nct6683.c +2 −2
  281. drivers/hwmon/scmi-hwmon.c +4 −1
  282. drivers/i2c/busses/Kconfig +0 −3
  283. drivers/i2c/busses/i2c-sprd.c +18 −4
  284. drivers/i2c/i2c-dev.c +1 −1
  285. drivers/infiniband/Kconfig +4 −1
  286. drivers/infiniband/core/cache.c +35 −20
  287. drivers/infiniband/core/cma.c +43 −17
  288. drivers/infiniband/core/iwpm_util.c +4 −1
  289. drivers/infiniband/core/mad.c +2 −2
  290. drivers/infiniband/core/roce_gid_mgmt.c +14 −12
  291. drivers/infiniband/core/ucma.c +28 −16
  292. drivers/infiniband/core/uverbs_cmd.c +6 −0
  293. drivers/infiniband/core/uverbs_ioctl.c +9 −0
  294. drivers/infiniband/core/uverbs_std_types_flow_action.c +6 −6
  295. drivers/infiniband/core/verbs.c +1 −0
  296. drivers/infiniband/hw/cxgb4/cq.c +10 −1
  297. drivers/infiniband/hw/cxgb4/device.c +8 −1
  298. drivers/infiniband/hw/cxgb4/iw_cxgb4.h +5 −1
  299. drivers/infiniband/hw/cxgb4/qp.c +2 −2
  300. drivers/infiniband/hw/cxgb4/resource.c +24 −2
  301. drivers/infiniband/hw/hfi1/affinity.c +5 −6
  302. drivers/infiniband/hw/hfi1/driver.c +15 −4
  303. drivers/infiniband/hw/hfi1/hfi.h +4 −4
  304. drivers/infiniband/hw/hfi1/init.c +31 −12
  305. drivers/infiniband/hw/hfi1/pcie.c +0 −3
  306. drivers/infiniband/hw/hfi1/platform.c +1 −0
  307. drivers/infiniband/hw/hfi1/qsfp.c +2 −0
  308. drivers/infiniband/hw/hfi1/ruc.c +40 −10
  309. drivers/infiniband/hw/hfi1/ud.c +2 −2
  310. drivers/infiniband/hw/hns/hns_roce_hem.c +6 −6
  311. drivers/infiniband/hw/hns/hns_roce_hw_v2.c +29 −20
  312. drivers/infiniband/hw/hns/hns_roce_qp.c +1 −1
  313. drivers/infiniband/hw/mlx4/mr.c +1 −1
  314. drivers/infiniband/hw/mlx4/qp.c +2 −1
  315. drivers/infiniband/hw/mlx5/Kconfig +1 −0
  316. drivers/infiniband/hw/mlx5/main.c +3 −6
  317. drivers/infiniband/hw/mlx5/mr.c +23 −9
  318. drivers/infiniband/hw/mlx5/qp.c +13 −9
  319. drivers/infiniband/hw/nes/nes_nic.c +1 −1
  320. drivers/infiniband/sw/rxe/rxe_opcode.c +1 −1
  321. drivers/infiniband/sw/rxe/rxe_req.c +0 −1
  322. drivers/infiniband/sw/rxe/rxe_resp.c +1 −5
  323. drivers/infiniband/ulp/ipoib/ipoib_main.c +1 −1
  324. drivers/infiniband/ulp/srp/Kconfig +1 −1
  325. drivers/infiniband/ulp/srpt/Kconfig +1 −1
  326. drivers/input/evdev.c +6 −1
  327. drivers/input/input-leds.c +4 −4
  328. drivers/input/mouse/alps.c +1 −1
  329. drivers/input/rmi4/rmi_spi.c +5 −2
  330. drivers/input/touchscreen/Kconfig +1 −1
  331. drivers/input/touchscreen/atmel_mxt_ts.c +124 −76
  332. drivers/iommu/amd_iommu.c +1 −1
  333. drivers/iommu/dma-iommu.c +25 −29
  334. drivers/iommu/dmar.c +1 −1
  335. drivers/iommu/intel_irq_remapping.c +1 −1
  336. drivers/iommu/rockchip-iommu.c +9 −2
  337. drivers/irqchip/qcom-irq-combiner.c +2 −2
  338. drivers/isdn/mISDN/dsp_hwec.c +5 −3
  339. drivers/isdn/mISDN/l1oip_core.c +11 −3
  340. drivers/md/bcache/alloc.c +4 −1
  341. drivers/md/bcache/bcache.h +4 −0
  342. drivers/md/bcache/debug.c +1 −2
  343. drivers/md/bcache/io.c +3 −5
  344. drivers/md/bcache/request.c +1 −4
  345. drivers/md/bcache/super.c +52 −23
  346. drivers/md/bcache/writeback.c +3 −1
  347. drivers/md/md.c +4 −2
  348. drivers/md/raid1.c +20 −5
  349. drivers/media/i2c/saa7115.c +1 −1
  350. drivers/media/i2c/saa711x_regs.h +1 −1
  351. drivers/media/i2c/tda7432.c +1 −1
  352. drivers/media/i2c/tvp5150.c +1 −1
  353. drivers/media/i2c/tvp5150_reg.h +1 −1
  354. drivers/media/i2c/tvp7002.c +1 −1
  355. drivers/media/i2c/tvp7002_reg.h +1 −1
  356. drivers/media/media-devnode.c +1 −1
  357. drivers/media/pci/bt8xx/bttv-audio-hook.c +1 −1
  358. drivers/media/pci/bt8xx/bttv-audio-hook.h +1 −1
  359. drivers/media/pci/bt8xx/bttv-cards.c +2 −2
  360. drivers/media/pci/bt8xx/bttv-driver.c +1 −1
  361. drivers/media/pci/bt8xx/bttv-i2c.c +1 −1
  362. drivers/media/pci/cx23885/cx23885-input.c +1 −1
  363. drivers/media/pci/cx88/cx88-alsa.c +2 −2
  364. drivers/media/pci/cx88/cx88-blackbird.c +1 −1
  365. drivers/media/pci/cx88/cx88-core.c +1 −1
  366. drivers/media/pci/cx88/cx88-i2c.c +1 −1
  367. drivers/media/pci/cx88/cx88-video.c +1 −1
  368. drivers/media/radio/radio-aimslab.c +1 −1
  369. drivers/media/radio/radio-aztech.c +1 −1
  370. drivers/media/radio/radio-gemtek.c +1 −1
  371. drivers/media/radio/radio-maxiradio.c +1 −1
  372. drivers/media/radio/radio-rtrack2.c +1 −1
  373. drivers/media/radio/radio-sf16fmi.c +1 −1
  374. drivers/media/radio/radio-terratec.c +1 −1
  375. drivers/media/radio/radio-trust.c +1 −1
  376. drivers/media/radio/radio-typhoon.c +1 −1
  377. drivers/media/radio/radio-zoltrix.c +1 −1
  378. drivers/media/rc/keymaps/rc-avermedia-m135a.c +1 −1
  379. drivers/media/rc/keymaps/rc-encore-enltv-fm53.c +1 −1
  380. drivers/media/rc/keymaps/rc-encore-enltv2.c +1 −1
  381. drivers/media/rc/keymaps/rc-kaiomy.c +1 −1
  382. drivers/media/rc/keymaps/rc-kworld-plus-tv-analog.c +1 −1
  383. drivers/media/rc/keymaps/rc-pixelview-new.c +1 −1
  384. drivers/media/tuners/tea5761.c +2 −2
  385. drivers/media/tuners/tea5767.c +2 −2
  386. drivers/media/tuners/tuner-xc2028-types.h +1 −1
  387. drivers/media/tuners/tuner-xc2028.c +2 −2
  388. drivers/media/tuners/tuner-xc2028.h +1 −1
  389. drivers/media/usb/em28xx/em28xx-camera.c +1 −1
  390. drivers/media/usb/em28xx/em28xx-cards.c +1 −1
  391. drivers/media/usb/em28xx/em28xx-core.c +2 −2
  392. drivers/media/usb/em28xx/em28xx-dvb.c +2 −2
  393. drivers/media/usb/em28xx/em28xx-i2c.c +1 −1
  394. drivers/media/usb/em28xx/em28xx-input.c +1 −1
  395. drivers/media/usb/em28xx/em28xx-video.c +2 −2
  396. drivers/media/usb/em28xx/em28xx.h +1 −1
  397. drivers/media/usb/gspca/zc3xx-reg.h +1 −1
  398. drivers/media/usb/tm6000/tm6000-cards.c +1 −1
  399. drivers/media/usb/tm6000/tm6000-core.c +1 −1
  400. drivers/media/usb/tm6000/tm6000-i2c.c +1 −1
  401. drivers/media/usb/tm6000/tm6000-regs.h +1 −1
  402. drivers/media/usb/tm6000/tm6000-usb-isoc.h +1 −1
  403. drivers/media/usb/tm6000/tm6000-video.c +1 −1
  404. drivers/media/usb/tm6000/tm6000.h +1 −1
  405. drivers/media/v4l2-core/v4l2-dev.c +2 −2
  406. drivers/media/v4l2-core/v4l2-ioctl.c +1 −1
  407. drivers/media/v4l2-core/videobuf-core.c +3 −3
  408. drivers/media/v4l2-core/videobuf-dma-contig.c +1 −1
  409. drivers/media/v4l2-core/videobuf-dma-sg.c +3 −3
  410. drivers/media/v4l2-core/videobuf-vmalloc.c +2 −2
  411. drivers/memory/emif-asm-offsets.c +1 −71
  412. drivers/message/fusion/mptsas.c +1 −0
  413. drivers/mmc/host/renesas_sdhi_internal_dmac.c +33 −6
  414. drivers/mmc/host/sdhci-pci-core.c +23 −2
  415. drivers/mtd/chips/cfi_cmdset_0001.c +28 −5
  416. drivers/mtd/chips/cfi_cmdset_0002.c +6 −3
  417. drivers/mtd/nand/core.c +0 −3
  418. drivers/mtd/nand/raw/marvell_nand.c +8 −17
  419. drivers/mtd/nand/raw/tango_nand.c +1 −1
  420. drivers/mtd/spi-nor/cadence-quadspi.c +17 −2
  421. drivers/net/bonding/bond_main.c +1 −2
  422. drivers/net/dsa/mv88e6xxx/hwtstamp.c +10 −2
  423. drivers/net/ethernet/amd/xgbe/xgbe-common.h +8 −0
  424. drivers/net/ethernet/amd/xgbe/xgbe-debugfs.c +16 −0
  425. drivers/net/ethernet/amd/xgbe/xgbe-main.c +1 −0
  426. drivers/net/ethernet/amd/xgbe/xgbe-mdio.c +19 −5
  427. drivers/net/ethernet/amd/xgbe/xgbe-pci.c +2 −0
  428. drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c +178 −18
  429. drivers/net/ethernet/amd/xgbe/xgbe.h +9 −0
  430. drivers/net/ethernet/broadcom/bcmsysport.c +13 −5
  431. drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c +27 −22
  432. drivers/net/ethernet/broadcom/bnxt/bnxt_nvm_defs.h +0 −2
  433. drivers/net/ethernet/freescale/ucc_geth_ethtool.c +1 −1
  434. drivers/net/ethernet/hisilicon/hns/hnae.h +1 −1
  435. drivers/net/ethernet/ibm/ibmvnic.c +56 −33
  436. drivers/net/ethernet/ibm/ibmvnic.h +0 −1
  437. drivers/net/ethernet/intel/ice/ice_adminq_cmd.h +1 −1
  438. drivers/net/ethernet/intel/ice/ice_common.c +17 −5
  439. drivers/net/ethernet/intel/ice/ice_hw_autogen.h +0 −2
  440. drivers/net/ethernet/intel/ice/ice_main.c +0 −4
  441. drivers/net/ethernet/intel/ice/ice_sched.c +2 −2
  442. drivers/net/ethernet/intel/igb/igb_main.c +16 −1
  443. drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +1 −1
  444. drivers/net/ethernet/marvell/mvpp2.c +31 −13
  445. drivers/net/ethernet/mellanox/mlx4/main.c +1 −1
  446. drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c +5 −3
  447. drivers/net/ethernet/mellanox/mlx5/core/en_rep.c +3 −2
  448. drivers/net/ethernet/mellanox/mlx5/core/en_selftest.c +1 −1
  449. drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +2 −1
  450. drivers/net/ethernet/mellanox/mlx5/core/en_tx.c +10 −10
  451. drivers/net/ethernet/mellanox/mlx5/core/fs_core.c +16 −10
  452. drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c +5 −7
  453. drivers/net/ethernet/netronome/nfp/flower/action.c +8 −2
  454. drivers/net/ethernet/netronome/nfp/flower/cmsg.c +37 −7
  455. drivers/net/ethernet/netronome/nfp/flower/cmsg.h +6 −1
  456. drivers/net/ethernet/netronome/nfp/flower/main.c +5 −3
  457. drivers/net/ethernet/netronome/nfp/flower/main.h +6 −2
  458. drivers/net/ethernet/netronome/nfp/nfp_app_nic.c +1 −1
  459. drivers/net/ethernet/netronome/nfp/nfp_main.h +3 −1
  460. drivers/net/ethernet/netronome/nfp/nfp_net_main.c +18 −13
  461. drivers/net/ethernet/netronome/nfp/nfpcore/nfp_mutex.c +4 −1
  462. drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp.c +1 −2
  463. drivers/net/ethernet/qlogic/qed/qed_ll2.c +1 −1
  464. drivers/net/ethernet/qlogic/qed/qed_roce.c +1 −1
  465. drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c +6 −5
  466. drivers/net/ethernet/realtek/8139too.c +1 −1
  467. drivers/net/ethernet/sfc/ef10.c +50 −38
  468. drivers/net/ethernet/sfc/efx.c +143 −0
  469. drivers/net/ethernet/sfc/efx.h +21 −0
  470. drivers/net/ethernet/sfc/farch.c +34 −7
  471. drivers/net/ethernet/sfc/net_driver.h +61 −0
  472. drivers/net/ethernet/sfc/rx.c +90 −34
  473. drivers/net/ethernet/stmicro/stmmac/dwmac4.h +1 −1
  474. drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c +0 −7
  475. drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +6 −1
  476. drivers/net/ethernet/ti/cpsw.c +3 −1
  477. drivers/net/macsec.c +2 −3
  478. drivers/net/phy/marvell.c +9 −0
  479. drivers/net/phy/microchip.c +177 −1
  480. drivers/net/phy/phy_device.c +10 −1
  481. drivers/net/ppp/pppoe.c +4 −0
  482. drivers/net/team/team.c +31 −7
  483. drivers/net/tun.c +1 −6
  484. drivers/net/usb/qmi_wwan.c +14 −0
  485. drivers/net/virtio_net.c +48 −31
  486. drivers/net/vmxnet3/vmxnet3_drv.c +13 −4
  487. drivers/net/vmxnet3/vmxnet3_int.h +2 −2
  488. drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c +20 −16
  489. drivers/net/wireless/intel/iwlwifi/fw/api/scan.h +5 −8
  490. drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c +95 −16
  491. drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.h +4 −2
  492. drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +2 −1
  493. drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c +0 −15
  494. drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c +7 −4
  495. drivers/net/wireless/realtek/rtlwifi/wifi.h +5 −0
  496. drivers/nvdimm/Kconfig +1 −2
  497. drivers/nvdimm/dimm_devs.c +12 −10
  498. drivers/nvdimm/of_pmem.c +1 −1
  499. drivers/nvme/host/Kconfig +1 −1
  500. drivers/nvme/host/core.c +2 −25
  501. drivers/nvme/host/fabrics.c +6 −0
  502. drivers/nvme/host/multipath.c +23 −1
  503. drivers/nvme/host/nvme.h +12 −0
  504. drivers/nvme/target/Kconfig +1 −1
  505. drivers/nvme/target/loop.c +6 −0
  506. drivers/of/fdt.c +5 −2
  507. drivers/parisc/ccio-dma.c +1 −1
  508. drivers/pci/dwc/pcie-kirin.c +1 −1
  509. drivers/pci/host/pci-aardvark.c +30 −23
  510. drivers/pci/pci-driver.c +3 −2
  511. drivers/pci/pci.c +2 −2
  512. drivers/platform/x86/Kconfig +1 −1
  513. drivers/platform/x86/asus-wireless.c +3 −1
  514. drivers/rapidio/devices/rio_mport_cdev.c +9 −10
  515. drivers/remoteproc/qcom_q6v5_pil.c +2 −0
  516. drivers/remoteproc/remoteproc_core.c +2 −2
  517. drivers/rpmsg/rpmsg_char.c +2 −0
  518. drivers/rtc/rtc-opal.c +23 −14
  519. drivers/s390/block/dasd_alias.c +11 −2
  520. drivers/s390/block/dasd_diag.c +0 −1
  521. drivers/s390/char/sclp_early_core.c +1 −1
  522. drivers/s390/cio/chsc.c +11 −3
  523. drivers/s390/cio/vfio_ccw_fsm.c +12 −7
  524. drivers/s390/net/qeth_core.h +0 −2
  525. drivers/s390/net/qeth_core_main.c +71 −87
  526. drivers/s390/net/qeth_core_mpc.h +12 −0
  527. drivers/s390/net/qeth_l2_main.c +33 −27
  528. drivers/s390/net/smsgiucv.c +1 −1
  529. drivers/sbus/char/oradax.c +1 −1
  530. drivers/scsi/fnic/fnic_trace.c +1 −1
  531. drivers/scsi/isci/port_config.c +1 −2
  532. drivers/scsi/megaraid/megaraid_sas_fusion.c +3 −3
  533. drivers/scsi/scsi_debug.c +24 −9
  534. drivers/scsi/scsi_transport_iscsi.c +18 −11
  535. drivers/scsi/sd.c +2 −0
  536. drivers/scsi/sd_zbc.c +82 −58
  537. drivers/scsi/storvsc_drv.c +5 −2
  538. drivers/scsi/ufs/ufshcd.c +40 −0
  539. drivers/slimbus/messaging.c +1 −1
  540. drivers/soc/bcm/raspberrypi-power.c +1 −1
  541. drivers/staging/media/imx/imx-media-csi.c +1 −1
  542. drivers/staging/wilc1000/host_interface.c +1 −1
  543. drivers/target/target_core_iblock.c +4 −4
  544. drivers/target/target_core_pscsi.c +2 −0
  545. drivers/tty/n_gsm.c +22 −1
  546. drivers/tty/serial/earlycon.c +4 −2
  547. drivers/tty/serial/imx.c +18 −1
  548. drivers/tty/serial/mvebu-uart.c +0 −1
  549. drivers/tty/serial/qcom_geni_serial.c +6 −4
  550. drivers/tty/serial/xilinx_uartps.c +1 −1
  551. drivers/tty/tty_io.c +4 −1
  552. drivers/tty/tty_ldisc.c +13 −16
  553. drivers/uio/uio_hv_generic.c +23 −49
  554. drivers/usb/Kconfig +1 −0
  555. drivers/usb/core/config.c +3 −1
  556. drivers/usb/core/hcd.c +13 −6
  557. drivers/usb/core/hub.c +9 −1
  558. drivers/usb/core/phy.c +66 −27
  559. drivers/usb/core/phy.h +21 −1
  560. drivers/usb/core/quirks.c +3 −0
  561. drivers/usb/dwc2/core.h +2 −0
  562. drivers/usb/dwc2/gadget.c +21 −0
  563. drivers/usb/dwc2/hcd.c +8 −5
  564. drivers/usb/dwc2/pci.c +3 −1
  565. drivers/usb/dwc3/gadget.c +2 −2
  566. drivers/usb/gadget/function/f_phonet.c +1 −1
  567. drivers/usb/host/ehci-mem.c +2 −1
  568. drivers/usb/host/ehci-sched.c +4 −2
  569. drivers/usb/host/xhci-dbgtty.c +5 −3
  570. drivers/usb/host/xhci-pci.c +4 −1
  571. drivers/usb/host/xhci-plat.c +23 −9
  572. drivers/usb/host/xhci.c +1 −0
  573. drivers/usb/host/xhci.h +2 −1
  574. drivers/usb/musb/musb_dsps.c +0 −2
  575. drivers/usb/musb/musb_gadget.c +2 −1
  576. drivers/usb/musb/musb_host.c +4 −1
  577. drivers/usb/serial/Kconfig +1 −0
  578. drivers/usb/serial/cp210x.c +1 −0
  579. drivers/usb/serial/ftdi_sio.c +2 −1
  580. drivers/usb/serial/option.c +5 −0
  581. drivers/usb/serial/usb-serial-simple.c +7 −0
  582. drivers/usb/serial/visor.c +35 −34
  583. drivers/usb/typec/tcpm.c +1 −0
  584. drivers/usb/typec/tps6598x.c +39 −8
  585. drivers/usb/typec/ucsi/Makefile +1 −1
  586. drivers/usb/typec/ucsi/ucsi.c +1 −1
  587. drivers/usb/usbip/stub_main.c +5 −0
  588. drivers/usb/usbip/usbip_common.h +1 −1
  589. drivers/usb/usbip/usbip_event.c +0 −4
  590. drivers/usb/usbip/vhci_hcd.c +13 −0
  591. drivers/virt/vboxguest/vboxguest_core.c +38 −32
  592. drivers/virt/vboxguest/vboxguest_core.h +9 −0
  593. drivers/virt/vboxguest/vboxguest_linux.c +16 −3
  594. drivers/virt/vboxguest/vboxguest_utils.c +13 −4
  595. drivers/watchdog/aspeed_wdt.c +7 −0
  596. drivers/watchdog/renesas_wdt.c +4 −2
  597. drivers/watchdog/sch311x_wdt.c +1 −1
  598. drivers/watchdog/w83977f_wdt.c +1 −1
  599. drivers/watchdog/wafer5823wdt.c +1 −1
  600. drivers/xen/xen-pciback/conf_space_quirks.c +1 −1
  601. drivers/xen/xen-pciback/pci_stub.c +4 −4
  602. drivers/xen/xenbus/xenbus_dev_frontend.c +2 −1
  603. fs/afs/server.c +8 −1
  604. fs/autofs4/root.c +1 −1
  605. fs/binfmt_elf.c +4 −4
  606. fs/btrfs/ctree.h +25 −0
  607. fs/btrfs/delayed-inode.c +16 −4
  608. fs/btrfs/delayed-ref.c +14 −5
  609. fs/btrfs/delayed-ref.h +1 −0
  610. fs/btrfs/disk-io.c +1 −0
  611. fs/btrfs/extent-tree.c +64 −16
  612. fs/btrfs/file.c +1 −1
  613. fs/btrfs/inode.c +12 −8
  614. fs/btrfs/print-tree.c +15 −10
  615. fs/btrfs/print-tree.h +1 −1
  616. fs/btrfs/qgroup.c +41 −2
  617. fs/btrfs/relocation.c +1 −1
  618. fs/btrfs/send.c +4 −0
  619. fs/btrfs/transaction.c +1 −0
  620. fs/btrfs/transaction.h +14 −0
  621. fs/ceph/inode.c +7 −3
  622. fs/ceph/xattr.c +25 −3
  623. fs/cifs/Kconfig +1 −1
  624. fs/cifs/cifs_debug.h +1 −1
  625. fs/cifs/cifssmb.c +3 −0
  626. fs/cifs/connect.c +16 −16
  627. fs/cifs/dir.c +5 −4
  628. fs/cifs/file.c +1 −1
  629. fs/cifs/smb2ops.c +16 −6
  630. fs/cifs/smb2pdu.c +7 −6
  631. fs/cifs/smb2pdu.h +1 −1
  632. fs/cifs/smbdirect.c +18 −24
  633. fs/cifs/transport.c +6 −3
  634. fs/ecryptfs/crypto.c +28 −13
  635. fs/ecryptfs/file.c +16 −5
  636. fs/ecryptfs/inode.c +1 −2
  637. fs/ecryptfs/keystore.c +1 −1
  638. fs/ext2/file.c +2 −2
  639. fs/ext4/balloc.c +5 −4
  640. fs/ext4/extents.c +11 −5
  641. fs/ext4/super.c +1 −0
  642. fs/fs-writeback.c +5 −4
  643. fs/isofs/compress.c +16 −3
  644. fs/isofs/inode.c +3 −0
  645. fs/jbd2/transaction.c +1 −0
  646. fs/jffs2/super.c +1 −1
  647. fs/namespace.c +3 −2
  648. fs/notify/fanotify/fanotify.c +15 −19
  649. fs/notify/fsnotify.c +11 −14
  650. fs/orangefs/super.c +5 −0
  651. fs/proc/base.c +6 −0
  652. fs/proc/loadavg.c +1 −1
  653. fs/proc/task_mmu.c +5 −1
  654. fs/quota/dquot.c +1 −1
  655. fs/super.c +4 −5
  656. fs/udf/unicode.c +6 −0
  657. fs/xfs/libxfs/xfs_attr.c +8 −1
  658. fs/xfs/libxfs/xfs_bmap.c +4 −0
  659. fs/xfs/libxfs/xfs_inode_buf.c +21 −0
  660. fs/xfs/xfs_file.c +19 −5
  661. include/asm-generic/vmlinux.lds.h +1 −1
  662. include/drm/drm_hdcp.h +1 −1
  663. include/dt-bindings/clock/stm32mp1-clks.h +2 −2
  664. include/kvm/arm_psci.h +14 −2
  665. include/kvm/arm_vgic.h +1 −0
  666. include/linux/backing-dev-defs.h +5 −0
  667. include/linux/backing-dev.h +16 −14
  668. include/linux/blk-mq.h +3 −0
  669. include/linux/blkdev.h +6 −0
  670. include/linux/bpf.h +5 −3
  671. include/linux/clk-provider.h +3 −0
  672. include/linux/compiler-clang.h +3 −0
  673. include/linux/coresight-pmu.h +1 −12
  674. include/linux/device.h +4 −2
  675. include/linux/ethtool.h +2 −0
  676. include/linux/fsnotify_backend.h +2 −4
  677. include/linux/genhd.h +3 −1
  678. include/linux/hid.h +8 −1
  679. include/linux/hrtimer.h +2 −0
  680. include/linux/if_vlan.h +5 −2
  681. include/linux/livepatch.h +13 −6
  682. include/linux/microchipphy.h +8 −0
  683. include/linux/mlx5/driver.h +3 −9
  684. include/linux/mtd/flashchip.h +1 −0
  685. include/linux/remoteproc.h +1 −1
  686. include/linux/serial_core.h +14 −7
  687. include/linux/shrinker.h +5 −2
  688. include/linux/stringhash.h +2 −2
  689. include/linux/textsearch.h +2 −2
  690. include/linux/thread_info.h +1 −5
  691. include/linux/ti-emif-sram.h +75 −0
  692. include/linux/timekeeper_internal.h +0 −2
  693. include/linux/timekeeping.h +25 −12
  694. include/linux/timekeeping32.h +0 −3
  695. include/linux/timer.h +0 −2
  696. include/linux/tty.h +1 −1
  697. include/linux/usb/composite.h +1 −1
  698. include/linux/vbox_utils.h +0 −23
  699. include/linux/virtio.h +3 −0
  700. include/linux/wait_bit.h +17 −0
  701. include/media/i2c/tvp7002.h +1 −1
  702. include/media/videobuf-core.h +2 −2
  703. include/media/videobuf-dma-sg.h +2 −2
  704. include/media/videobuf-vmalloc.h +1 −1
  705. include/net/ife.h +2 −1
  706. include/net/llc_conn.h +1 −0
  707. include/net/tls.h +1 −0
  708. include/scsi/scsi_dbg.h +0 −2
  709. include/soc/bcm2835/raspberrypi-firmware.h +2 −2
  710. include/sound/control.h +5 −2
  711. include/trace/events/initcall.h +11 −3
  712. include/trace/events/ufs.h +27 −0
  713. include/trace/events/workqueue.h +2 −0
  714. include/uapi/linux/if_infiniband.h +1 −1
  715. include/uapi/linux/kvm.h +7 −0
  716. include/uapi/linux/perf_event.h +15 −3
  717. include/uapi/linux/random.h +3 −0
  718. include/uapi/linux/rds.h +1 −1
  719. include/uapi/linux/sysctl.h +0 −18
  720. include/uapi/linux/time.h +0 −1
  721. include/uapi/linux/tls.h +1 −1
  722. include/uapi/linux/virtio_balloon.h +15 −0
  723. include/uapi/rdma/cxgb3-abi.h +1 −1
  724. include/uapi/rdma/cxgb4-abi.h +1 −1
  725. include/uapi/rdma/hns-abi.h +1 −1
  726. include/uapi/rdma/ib_user_cm.h +1 −1
  727. include/uapi/rdma/ib_user_ioctl_verbs.h +1 −1
  728. include/uapi/rdma/ib_user_mad.h +1 −1
  729. include/uapi/rdma/ib_user_sa.h +1 −1
  730. include/uapi/rdma/ib_user_verbs.h +1 −1
  731. include/uapi/rdma/mlx4-abi.h +1 −1
  732. include/uapi/rdma/mlx5-abi.h +1 −1
  733. include/uapi/rdma/mthca-abi.h +1 −1
  734. include/uapi/rdma/nes-abi.h +1 −1
  735. include/uapi/rdma/qedr-abi.h +1 −1
  736. include/uapi/rdma/rdma_user_cm.h +1 −1
  737. include/uapi/rdma/rdma_user_ioctl.h +1 −1
  738. include/uapi/rdma/rdma_user_rxe.h +1 −1
  739. include/xen/interface/io/sndif.h +306 −16
  740. kernel/bpf/arraymap.c +2 −1
  741. kernel/bpf/core.c +29 −16
  742. kernel/bpf/sockmap.c +73 −29
  743. kernel/bpf/syscall.c +2 −2
  744. kernel/events/callchain.c +11 −14
  745. kernel/events/core.c +6 −2
  746. kernel/events/uprobes.c +3 −4
  747. kernel/fork.c +1 −2
  748. kernel/kprobes.c +1 −1
  749. kernel/livepatch/shadow.c +71 −37
  750. kernel/module.c +2 −1
  751. kernel/sysctl_binary.c +1 −19
  752. kernel/time/clocksource.c +44 −19
  753. kernel/time/hrtimer.c +14 −2
  754. kernel/time/posix-cpu-timers.c +3 −1
  755. kernel/time/posix-stubs.c +0 −2
  756. kernel/time/posix-timers.c +17 −9
  757. kernel/time/tick-common.c +0 −15
  758. kernel/time/tick-internal.h +0 −6
  759. kernel/time/tick-oneshot.c +5 −6
  760. kernel/time/tick-sched.c +5 −14
  761. kernel/time/timekeeping.c +37 −48
  762. kernel/time/timekeeping.h +1 −0
  763. kernel/trace/bpf_trace.c +21 −4
  764. kernel/trace/ftrace.c +2 −2
  765. kernel/trace/trace.c +1 −1
  766. kernel/trace/trace_entries.h +1 −1
  767. kernel/trace/trace_events_filter.c +7 −7
  768. kernel/trace/trace_events_hist.c +12 −0
  769. kernel/trace/trace_kprobe.c +0 −2
  770. kernel/trace/trace_stack.c +1 −1
  771. kernel/trace/trace_uprobe.c +14 −21
  772. kernel/tracepoint.c +2 −2
  773. lib/dma-direct.c +2 −1
  774. lib/errseq.c +9 −14
  775. lib/kobject.c +5 −6
  776. lib/swiotlb.c +1 −1
  777. lib/textsearch.c +23 −17
  778. mm/backing-dev.c +2 −1
  779. mm/filemap.c +4 −5
  780. mm/huge_memory.c +4 −1
  781. mm/memcontrol.c +1 −1
  782. mm/migrate.c +19 −3
  783. mm/mmap.c +10 −1
  784. mm/page-writeback.c +9 −9
  785. mm/rmap.c +0 −3
  786. mm/vmscan.c +20 −1
  787. net/bridge/br_if.c +2 −2
  788. net/bridge/netfilter/ebtables.c +6 −5
  789. net/caif/chnl_net.c +1 −1
  790. net/ceph/messenger.c +7 −0
  791. net/ceph/mon_client.c +11 −3
  792. net/compat.c +4 −2
  793. net/core/dev.c +1 −1
  794. net/core/dev_addr_lists.c +1 −1
  795. net/core/ethtool.c +5 −0
  796. net/core/filter.c +1 −0
  797. net/core/neighbour.c +26 −14
  798. net/dccp/ccids/ccid2.c +12 −2
  799. net/dccp/timer.c +1 −1
  800. net/dns_resolver/dns_key.c +5 −7
  801. net/ife/ife.c +36 −2
  802. net/ipv4/ip_output.c +5 −3
  803. net/ipv4/route.c +53 −65
  804. net/ipv4/tcp.c +9 −6
  805. net/ipv4/tcp_bbr.c +3 −1
  806. net/ipv4/tcp_input.c +2 −5
  807. net/ipv6/netfilter/Kconfig +28 −27
  808. net/ipv6/route.c +8 −1
  809. net/ipv6/seg6_iptunnel.c +1 −1
  810. net/l2tp/l2tp_core.c +20 −20
  811. net/l2tp/l2tp_core.h +2 −1
  812. net/l2tp/l2tp_debugfs.c +16 −2
  813. net/l2tp/l2tp_netlink.c +8 −3
  814. net/l2tp/l2tp_ppp.c +27 −7
  815. net/llc/af_llc.c +12 −2
  816. net/llc/llc_c_ac.c +1 −8
  817. net/llc/llc_conn.c +21 −1
  818. net/netfilter/Kconfig +1 −0
  819. net/netfilter/ipvs/ip_vs_ctl.c +0 −8
  820. net/netfilter/ipvs/ip_vs_sync.c +80 −75
  821. net/netfilter/nf_conntrack_expect.c +4 −1
  822. net/netfilter/nf_conntrack_extend.c +2 −0
  823. net/netfilter/nf_conntrack_sip.c +12 −4
  824. net/netfilter/nf_tables_api.c +38 −31
  825. net/netfilter/xt_connmark.c +29 −20
  826. net/packet/af_packet.c +58 −25
  827. net/packet/internal.h +5 −5
  828. net/qrtr/qrtr.c +1 −0
  829. net/rds/ib_cm.c +2 −1
  830. net/rds/recv.c +1 −0
  831. net/sched/act_ife.c +7 −2
  832. net/sched/sch_fq.c +25 −12
  833. net/sctp/inqueue.c +1 −1
  834. net/sctp/ipv6.c +32 −29
  835. net/sctp/sm_statefuns.c +7 −1
  836. net/sctp/stream.c +2 −0
  837. net/smc/af_smc.c +33 −38
  838. net/smc/smc_core.c +19 −3
  839. net/smc/smc_core.h +2 −1
  840. net/strparser/strparser.c +4 −5
  841. net/sunrpc/rpc_pipe.c +1 −0
  842. net/tipc/monitor.c +1 −1
  843. net/tipc/name_table.c +21 −13
  844. net/tipc/name_table.h +1 −1
  845. net/tipc/net.c +2 −0
  846. net/tipc/netlink.c +4 −1
  847. net/tipc/node.c +5 −8
  848. net/tipc/socket.c +3 −1
  849. net/tipc/subscr.c +4 −1
  850. net/tls/tls_main.c +7 −0
  851. net/tls/tls_sw.c +9 −1
  852. net/vmw_vsock/af_vsock.c +6 −0
  853. samples/livepatch/livepatch-shadow-fix1.c +32 −11
  854. samples/livepatch/livepatch-shadow-fix2.c +18 −15
  855. samples/sockmap/Makefile +5 −2
  856. scripts/Makefile.gcc-plugins +1 −1
  857. scripts/Makefile.lib +1 −1
  858. scripts/extract_xc3028.pl +1 −1
  859. scripts/genksyms/Makefile +2 −2
  860. scripts/mod/sumversion.c +1 −8
  861. scripts/split-man.pl +1 −1
  862. security/commoncap.c +2 −0
  863. sound/core/control.c +1 −1
  864. sound/core/pcm_compat.c +6 −3
  865. sound/core/pcm_native.c +15 −15
  866. sound/core/rawmidi_compat.c +12 −6
  867. sound/core/seq/oss/seq_oss_event.c +9 −6
  868. sound/core/seq/oss/seq_oss_midi.c +2 −0
  869. sound/core/seq/oss/seq_oss_synth.c +49 −36
  870. sound/core/seq/oss/seq_oss_synth.h +2 −1
  871. sound/core/seq/seq_virmidi.c +2 −2
  872. sound/drivers/aloop.c +15 −2
  873. sound/drivers/opl3/opl3_synth.c +5 −2
  874. sound/firewire/amdtp-stream.c +3 −2
  875. sound/firewire/dice/dice-stream.c +1 −1
  876. sound/firewire/dice/dice.c +1 −1
  877. sound/pci/asihpi/hpimsginit.c +9 −4
  878. sound/pci/asihpi/hpioctl.c +3 −1
  879. sound/pci/hda/hda_hwdep.c +11 −1
  880. sound/pci/hda/hda_intel.c +2 −1
  881. sound/pci/hda/patch_hdmi.c +8 −1
  882. sound/pci/hda/patch_realtek.c +9 −1
  883. sound/pci/rme9652/hdspm.c +14 −10
  884. sound/pci/rme9652/rme9652.c +4 −2
  885. sound/soc/amd/acp-da7219-max98357a.c +1 −1
  886. sound/soc/codecs/adau17x1.c +20 −6
  887. sound/soc/codecs/adau17x1.h +2 −1
  888. sound/soc/codecs/msm8916-wcd-analog.c +6 −3
  889. sound/soc/codecs/rt5514.c +3 −0
  890. sound/soc/fsl/fsl_esai.c +7 −0
  891. sound/soc/fsl/fsl_ssi.c +11 −3
  892. sound/soc/intel/Kconfig +13 −9
  893. sound/soc/omap/omap-dmic.c +11 −3
  894. sound/soc/sh/rcar/core.c +2 −2
  895. sound/soc/soc-topology.c +9 −5
  896. sound/usb/line6/midi.c +1 −1
  897. sound/usb/mixer.c +4 −3
  898. sound/usb/mixer_maps.c +3 −0
  899. sound/usb/stream.c +1 −1
  900. sound/usb/usx2y/us122l.c +1 −1
  901. sound/usb/usx2y/usX2Yhwdep.c +1 −1
  902. sound/usb/usx2y/usx2yhwdeppcm.c +1 −1
  903. tools/arch/arm/include/uapi/asm/kvm.h +9 −0
  904. tools/arch/x86/include/asm/required-features.h +1 −7
  905. tools/arch/x86/include/uapi/asm/kvm.h +18 −1
  906. tools/bpf/Makefile +2 −0
  907. tools/bpf/bpf_dbg.c +5 −2
  908. tools/include/linux/compiler.h +15 −5
  909. tools/include/linux/coresight-pmu.h +1 −12
  910. tools/include/uapi/asm-generic/mman-common.h +3 −0
  911. tools/include/uapi/linux/bpf.h +1 −0
  912. tools/include/uapi/linux/if_link.h +39 −0
  913. tools/include/uapi/linux/kvm.h +20 −1
  914. tools/include/uapi/linux/perf_event.h +15 −3
  915. tools/include/uapi/sound/asound.h +1 −0
  916. tools/lib/subcmd/parse-options.c +3 −3
  917. tools/objtool/Makefile +2 −2
  918. tools/perf/Documentation/perf-config.txt +5 −0
  919. tools/perf/Documentation/perf-mem.txt +31 −11
  920. tools/perf/Documentation/perf-sched.txt +2 −2
  921. tools/perf/Documentation/perf-script.txt +9 −8
  922. tools/perf/Documentation/perf-stat.txt +1 −1
  923. tools/perf/Makefile.config +2 −2
  924. tools/perf/arch/arm/include/arch-tests.h +12 −0
  925. tools/perf/arch/arm/tests/Build +2 −0
  926. tools/perf/arch/arm/tests/arch-tests.c +16 −0
  927. tools/perf/arch/arm/util/auxtrace.c +1 −12
  928. tools/perf/arch/arm/util/cs-etm.c +1 −12
  929. tools/perf/arch/arm/util/cs-etm.h +1 −12
  930. tools/perf/arch/arm/util/pmu.c +1 −12
  931. tools/perf/arch/s390/util/auxtrace.c +1 −0
  932. tools/perf/arch/s390/util/header.c +0 −18
  933. tools/perf/arch/x86/Makefile +1 −1
  934. tools/perf/arch/x86/annotate/instructions.c +66 −1
  935. tools/perf/arch/x86/entry/syscalls/syscall_64.tbl +358 −354
  936. tools/perf/builtin-help.c +1 −1
  937. tools/perf/builtin-mem.c +2 −2
  938. tools/perf/builtin-script.c +6 −3
  939. tools/perf/builtin-stat.c +40 −14
  940. tools/perf/builtin-version.c +3 −0
  941. tools/perf/perf.c +2 −2
  942. tools/perf/pmu-events/arch/s390/mapfile.csv +5 −5
  943. tools/perf/tests/attr/test-record-group-sampling +3 −0
  944. tools/perf/tests/bpf-script-example.c +1 −1
  945. tools/perf/tests/bpf-script-test-kbuild.c +0 −1
  946. tools/perf/tests/builtin-test.c +1 −0
  947. tools/perf/tests/mmap-basic.c +1 −1
  948. tools/perf/tests/shell/record+probe_libc_inet_pton.sh +2 −4
  949. tools/perf/trace/beauty/mmap.c +3 −0
  950. tools/perf/ui/browsers/annotate.c +5 −0
  951. tools/perf/ui/browsers/hists.c +1 −1
  952. tools/perf/util/annotate.c +21 −5
  953. tools/perf/util/annotate.h +9 −0
  954. tools/perf/util/cs-etm-decoder/cs-etm-decoder.c +1 −2
  955. tools/perf/util/cs-etm.c +1 −2
  956. tools/perf/util/cs-etm.h +1 −12
  957. tools/perf/util/event.c +3 −1
  958. tools/perf/util/evsel.c +16 −8
  959. tools/perf/util/evsel.h +1 −0
  960. tools/perf/util/generate-cmdlist.sh +1 −1
  961. tools/perf/util/header.c +2 −1
  962. tools/perf/util/machine.c +18 −12
  963. tools/perf/util/parse-events.y +4 −4
  964. tools/perf/util/pmu.c +14 −14
  965. tools/perf/util/symbol.c +3 −5
  966. tools/perf/util/syscalltbl.c +3 −3
  967. tools/perf/util/trace-event-scripting.c +2 −2
  968. tools/power/acpi/Makefile.config +1 −0
  969. tools/testing/nvdimm/test/nfit.c +65 −19
  970. tools/testing/selftests/bpf/.gitignore +3 −0
  971. tools/testing/selftests/bpf/test_progs.c +2 −2
  972. tools/testing/selftests/bpf/test_sock.c +1 −0
  973. tools/testing/selftests/bpf/test_sock_addr.c +1 −0
  974. tools/testing/selftests/bpf/test_sock_addr.sh +2 −2
  975. tools/testing/selftests/filesystems/Makefile +3 −5
  976. tools/testing/selftests/firmware/Makefile +1 −0
  977. tools/testing/selftests/firmware/fw_lib.sh +6 −4
  978. tools/testing/selftests/firmware/fw_run_tests.sh +1 −1
  979. tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-extended-error-support.tc +1 −1
  980. tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-multi-actions-accept.tc +44 −0
  981. tools/testing/selftests/kvm/Makefile +3 −2
  982. tools/testing/selftests/kvm/include/kvm_util.h +9 −6
  983. tools/testing/selftests/kvm/include/vmx.h +494 −0
  984. tools/testing/selftests/kvm/lib/kvm_util.c +13 −7
  985. tools/testing/selftests/kvm/lib/sparsebit.c +2 −2
  986. tools/testing/selftests/kvm/lib/vmx.c +243 −0
  987. tools/testing/selftests/kvm/vmx_tsc_adjust_test.c +231 −0
  988. tools/testing/selftests/lib.mk +4 −4
  989. tools/testing/selftests/net/Makefile +1 −0
  990. tools/testing/selftests/x86/test_syscall_vdso.c +21 −14
  991. virt/kvm/arm/arm.c +10 −5
  992. virt/kvm/arm/psci.c +60 −0
  993. virt/kvm/arm/vgic/vgic-init.c +1 −1
  994. virt/kvm/arm/vgic/vgic-mmio-v2.c +5 −0
  995. virt/kvm/arm/vgic/vgic-mmio.c +8 −2
  996. virt/kvm/arm/vgic/vgic-v2.c +22 −16
  997. virt/kvm/arm/vgic/vgic-v3.c +29 −20
  998. virt/kvm/arm/vgic/vgic.c +25 −27
  999. virt/kvm/arm/vgic/vgic.h +14 −0
Documentation/bpf/bpf_devel_QA.txt+9−1
@@ -557,6 +557,14 @@ A: Although LLVM IR generation and optimization try to stay architecture · 556 unmodified lines
557557 pulls in some header files containing file scope host assembly codes.
558558 - You can add "-fno-jump-tables" to work around the switch table issue.
559559
560− Otherwise, you can use bpf target.
560+ Otherwise, you can use bpf target. Additionally, you _must_ use bpf target
561+ when:
562+
563+ - Your program uses data structures with pointer or long / unsigned long
564+ types that interface with BPF helpers or context data structures. Access
565+ into these structures is verified by the BPF verifier and may result
566+ in verification failures if the native architecture is not aligned with
567+ the BPF architecture, e.g. 64-bit. An example of this is
568+ BPF_PROG_TYPE_SK_MSG require '-target bpf'
561569
562570 Happy BPF hacking!
Documentation/core-api/kernel-api.rst+13−0
@@ -136,6 +136,19 @@ Sorting · 135 unmodified lines
136136 .. kernel-doc:: lib/list_sort.c
137137 :export:
138138
139+Text Searching
140+--------------
141+
142+.. kernel-doc:: lib/textsearch.c
143+ :doc: ts_intro
144+
145+.. kernel-doc:: lib/textsearch.c
146+ :export:
147+
148+.. kernel-doc:: include/linux/textsearch.h
149+ :functions: textsearch_find textsearch_next \
150+ textsearch_get_pattern textsearch_get_pattern_len
151+
139152 UUID/GUID
140153 ---------
141154
Documentation/devicetree/bindings/input/atmel,maxtouch.txt+7−0
@@ -4,6 +4,13 @@ Required properties: · 3 unmodified lines
44 - compatible:
55 atmel,maxtouch
66
7+ The following compatibles have been used in various products but are
8+ deprecated:
9+ atmel,qt602240_ts
10+ atmel,atmel_mxt_ts
11+ atmel,atmel_mxt_tp
12+ atmel,mXT224
13+
714 - reg: The I2C address of the device
815
916 - interrupts: The sink for the touchpad's IRQ output
Documentation/devicetree/bindings/serial/amlogic,meson-uart.txt+1−1
@@ -21,7 +21,7 @@ Required properties: · 20 unmodified lines
2121 - interrupts : identifier to the device interrupt
2222 - clocks : a list of phandle + clock-specifier pairs, one for each
2323 entry in clock names.
24−- clocks-names :
24+- clock-names :
2525 * "xtal" for external xtal clock identifier
2626 * "pclk" for the bus core clock, either the clk81 clock or the gate clock
2727 * "baud" for the source of the baudrate generator, can be either the xtal
Documentation/devicetree/bindings/serial/mvebu-uart.txt+1−1
@@ -24,7 +24,7 @@ Required properties: · 23 unmodified lines
2424 - Must contain two elements for the extended variant of the IP
2525 (marvell,armada-3700-uart-ext): "uart-tx" and "uart-rx",
2626 respectively the UART TX interrupt and the UART RX interrupt. A
27− corresponding interrupts-names property must be defined.
27+ corresponding interrupt-names property must be defined.
2828 - For backward compatibility reasons, a single element interrupts
2929 property is also supported for the standard variant of the IP,
3030 containing only the UART sum interrupt. This form is deprecated
Documentation/devicetree/bindings/serial/renesas,sci-serial.txt+2−0
@@ -17,6 +17,8 @@ Required properties: · 16 unmodified lines
1717 - "renesas,scifa-r8a7745" for R8A7745 (RZ/G1E) SCIFA compatible UART.
1818 - "renesas,scifb-r8a7745" for R8A7745 (RZ/G1E) SCIFB compatible UART.
1919 - "renesas,hscif-r8a7745" for R8A7745 (RZ/G1E) HSCIF compatible UART.
20+ - "renesas,scif-r8a77470" for R8A77470 (RZ/G1C) SCIF compatible UART.
21+ - "renesas,hscif-r8a77470" for R8A77470 (RZ/G1C) HSCIF compatible UART.
2022 - "renesas,scif-r8a7778" for R8A7778 (R-Car M1) SCIF compatible UART.
2123 - "renesas,scif-r8a7779" for R8A7779 (R-Car H1) SCIF compatible UART.
2224 - "renesas,scif-r8a7790" for R8A7790 (R-Car H2) SCIF compatible UART.
Documentation/devicetree/bindings/thermal/exynos-thermal.txt+5−18
@@ -49,19 +49,6 @@ on the SoC (only first trip points defined in DT will be configured): · 48 unmodified lines
4949 - samsung,exynos5433-tmu: 8
5050 - samsung,exynos7-tmu: 8
5151
52−Following properties are mandatory (depending on SoC):
53−- samsung,tmu_gain: Gain value for internal TMU operation.
54−- samsung,tmu_reference_voltage: Value of TMU IP block's reference voltage
55−- samsung,tmu_noise_cancel_mode: Mode for noise cancellation
56−- samsung,tmu_efuse_value: Default level of temperature - it is needed when
57− in factory fusing produced wrong value
58−- samsung,tmu_min_efuse_value: Minimum temperature fused value
59−- samsung,tmu_max_efuse_value: Maximum temperature fused value
60−- samsung,tmu_first_point_trim: First point trimming value
61−- samsung,tmu_second_point_trim: Second point trimming value
62−- samsung,tmu_default_temp_offset: Default temperature offset
63−- samsung,tmu_cal_type: Callibration type
64−
6552 ** Optional properties:
6653
6754 - vtmu-supply: This entry is optional and provides the regulator node supplying
@@ -78,7 +65,7 @@ Example 1): · 10 unmodified lines
7865 clocks = <&clock 383>;
7966 clock-names = "tmu_apbif";
8067 vtmu-supply = <&tmu_regulator_node>;
81− #include "exynos4412-tmu-sensor-conf.dtsi"
68+ #thermal-sensor-cells = <0>;
8269 };
8370
8471 Example 2):
@@ -89,7 +76,7 @@ Example 2): · 4 unmodified lines
8976 interrupts = <0 58 0>;
9077 clocks = <&clock 21>;
9178 clock-names = "tmu_apbif";
92− #include "exynos5440-tmu-sensor-conf.dtsi"
79+ #thermal-sensor-cells = <0>;
9380 };
9481
9582 Example 3): (In case of Exynos5420 "with misplaced TRIMINFO register")
@@ -99,7 +86,7 @@ Example 3): (In case of Exynos5420 "with misplaced TRIMINFO register") · 3 unmodified lines
9986 interrupts = <0 184 0>;
10087 clocks = <&clock 318>, <&clock 318>;
10188 clock-names = "tmu_apbif", "tmu_triminfo_apbif";
102− #include "exynos4412-tmu-sensor-conf.dtsi"
89+ #thermal-sensor-cells = <0>;
10390 };
10491
10592 tmu_cpu3: tmu@1006c000 {
@@ -108,7 +95,7 @@ Example 3): (In case of Exynos5420 "with misplaced TRIMINFO register") · 2 unmodified lines
10895 interrupts = <0 185 0>;
10996 clocks = <&clock 318>, <&clock 319>;
11097 clock-names = "tmu_apbif", "tmu_triminfo_apbif";
111− #include "exynos4412-tmu-sensor-conf.dtsi"
98+ #thermal-sensor-cells = <0>;
11299 };
113100
114101 tmu_gpu: tmu@100a0000 {
@@ -117,7 +104,7 @@ Example 3): (In case of Exynos5420 "with misplaced TRIMINFO register") · 2 unmodified lines
117104 interrupts = <0 215 0>;
118105 clocks = <&clock 319>, <&clock 318>;
119106 clock-names = "tmu_apbif", "tmu_triminfo_apbif";
120− #include "exynos4412-tmu-sensor-conf.dtsi"
107+ #thermal-sensor-cells = <0>;
121108 };
122109
123110 Note: For multi-instance tmu each instance should have an alias correctly
Documentation/devicetree/bindings/thermal/thermal.txt+1−15
@@ -55,8 +55,7 @@ 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 by the cooling-min-level and cooling-max-level
59−properties) should be defined in a particular device's binding.
58+should be defined in a particular device's binding.
6059 For more examples of cooling devices, refer to the example sections below.
6160
6261 Required properties:
@@ -69,15 +68,6 @@ Required properties: · 6 unmodified lines
6968 See Cooling device maps section below for more details
7069 on how consumers refer to cooling devices.
7170
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−
8171 * Trip points
8272
8373 The trip node is a node to describe a point in the temperature domain
@@ -226,8 +216,6 @@ cpus { · 142 unmodified lines
226216 396000 950000
227217 198000 850000
228218 >;
229− cooling-min-level = <0>;
230− cooling-max-level = <3>;
231219 #cooling-cells = <2>; /* min followed by max */
232220 };
233221 ...
@@ -241,8 +229,6 @@ cpus { · 7 unmodified lines
241229 */
242230 fan0: fan@48 {
243231 ...
244− cooling-min-level = <0>;
245− cooling-max-level = <9>;
246232 #cooling-cells = <2>; /* min followed by max */
247233 };
248234 };
Documentation/devicetree/bindings/timer/nuvoton,npcm7xx-timer.txt+21−0
@@ -0,0 +1,21 @@
1+Nuvoton NPCM7xx timer
2+
3+Nuvoton NPCM7xx have three timer modules, each timer module provides five 24-bit
4+timer counters.
5+
6+Required properties:
7+- compatible : "nuvoton,npcm750-timer" for Poleg NPCM750.
8+- reg : Offset and length of the register set for the device.
9+- interrupts : Contain the timer interrupt with flags for
10+ falling edge.
11+- clocks : phandle of timer reference clock (usually a 25 MHz clock).
12+
13+Example:
14+
15+timer@f0008000 {
16+ compatible = "nuvoton,npcm750-timer";
17+ interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
18+ reg = <0xf0008000 0x50>;
19+ clocks = <&clk NPCM7XX_CLK_TIMER>;
20+};
21+
Documentation/devicetree/bindings/timer/nxp,tpm-timer.txt+1−1
@@ -15,7 +15,7 @@ Required properties: · 14 unmodified lines
1515 - interrupts : Should be the clock event device interrupt.
1616 - clocks : The clocks provided by the SoC to drive the timer, must contain
1717 an entry for each entry in clock-names.
18−- clock-names : Must include the following entries: "igp" and "per".
18+- clock-names : Must include the following entries: "ipg" and "per".
1919
2020 Example:
2121 tpm5: tpm@40260000 {
Documentation/devicetree/bindings/usb/usb-xhci.txt+4−1
@@ -28,7 +28,10 @@ Required properties: · 27 unmodified lines
2828 - interrupts: one XHCI interrupt should be described here.
2929
3030 Optional properties:
31− - clocks: reference to a clock
31+ - clocks: reference to the clocks
32+ - clock-names: mandatory if there is a second clock, in this case
33+ the name must be "core" for the first clock and "reg" for the
34+ second one
3235 - usb2-lpm-disable: indicate if we don't want to enable USB2 HW LPM
3336 - usb3-lpm-capable: determines if platform is USB3 LPM capable
3437 - quirk-broken-port-ped: set if the controller has broken port disable mechanism
Documentation/doc-guide/parse-headers.rst+2−2
@@ -177,14 +177,14 @@ BUGS · 176 unmodified lines
177177 ****
178178
179179
180−Report bugs to Mauro Carvalho Chehab <mchehab@s-opensource.com>
180+Report bugs to Mauro Carvalho Chehab <mchehab@kernel.org>
181181
182182
183183 COPYRIGHT
184184 *********
185185
186186
187−Copyright (c) 2016 by Mauro Carvalho Chehab <mchehab@s-opensource.com>.
187+Copyright (c) 2016 by Mauro Carvalho Chehab <mchehab+samsung@kernel.org>.
188188
189189 License GPLv2: GNU GPL version 2 <http://gnu.org/licenses/gpl.html>.
190190
Documentation/driver-api/firmware/request_firmware.rst+8−8
@@ -17,17 +17,17 @@ an error is returned. · 16 unmodified lines
1717
1818 request_firmware
1919 ----------------
20−.. kernel-doc:: drivers/base/firmware_class.c
20+.. kernel-doc:: drivers/base/firmware_loader/main.c
2121 :functions: request_firmware
2222
2323 request_firmware_direct
2424 -----------------------
25−.. kernel-doc:: drivers/base/firmware_class.c
25+.. kernel-doc:: drivers/base/firmware_loader/main.c
2626 :functions: request_firmware_direct
2727
2828 request_firmware_into_buf
2929 -------------------------
30−.. kernel-doc:: drivers/base/firmware_class.c
30+.. kernel-doc:: drivers/base/firmware_loader/main.c
3131 :functions: request_firmware_into_buf
3232
3333 Asynchronous firmware requests
@@ -41,7 +41,7 @@ in atomic contexts. · 7 unmodified lines
4141
4242 request_firmware_nowait
4343 -----------------------
44−.. kernel-doc:: drivers/base/firmware_class.c
44+.. kernel-doc:: drivers/base/firmware_loader/main.c
4545 :functions: request_firmware_nowait
4646
4747 Special optimizations on reboot
@@ -50,12 +50,12 @@ Special optimizations on reboot · 2 unmodified lines
5050 Some devices have an optimization in place to enable the firmware to be
5151 retained during system reboot. When such optimizations are used the driver
5252 author must ensure the firmware is still available on resume from suspend,
53−this can be done with firmware_request_cache() insted of requesting for the
54−firmare to be loaded.
53+this can be done with firmware_request_cache() instead of requesting for the
54+firmware to be loaded.
5555
5656 firmware_request_cache()
57−-----------------------
58−.. kernel-doc:: drivers/base/firmware_class.c
57+------------------------
58+.. kernel-doc:: drivers/base/firmware_loader/main.c
5959 :functions: firmware_request_cache
6060
6161 request firmware API expected driver use
Documentation/driver-api/infrastructure.rst+1−1
@@ -28,7 +28,7 @@ Device Drivers Base · 27 unmodified lines
2828 .. kernel-doc:: drivers/base/node.c
2929 :internal:
3030
31−.. kernel-doc:: drivers/base/firmware_class.c
31+.. kernel-doc:: drivers/base/firmware_loader/main.c
3232 :export:
3333
3434 .. kernel-doc:: drivers/base/transport_class.c
Documentation/driver-api/usb/typec.rst+1−1
@@ -210,7 +210,7 @@ If the connector is dual-role capable, there may also be a switch for the data · 209 unmodified lines
210210 role. USB Type-C Connector Class does not supply separate API for them. The
211211 port drivers can use USB Role Class API with those.
212212
213−Illustration of the muxes behind a connector that supports an alternate mode:
213+Illustration of the muxes behind a connector that supports an alternate mode::
214214
215215 ------------------------
216216 | Connector |
Documentation/i2c/dev-interface+14−18
@@ -9,8 +9,8 @@ i2c adapters present on your system at a given time. i2cdetect is part of · 8 unmodified lines
99 the i2c-tools package.
1010
1111 I2C device files are character device files with major device number 89
12−and a minor device number corresponding to the number assigned as
13−explained above. They should be called "i2c-%d" (i2c-0, i2c-1, ...,
12+and a minor device number corresponding to the number assigned as
13+explained above. They should be called "i2c-%d" (i2c-0, i2c-1, ...,
1414 i2c-10, ...). All 256 minor device numbers are reserved for i2c.
1515
1616
@@ -23,11 +23,6 @@ First, you need to include these two headers: · 6 unmodified lines
2323 #include <linux/i2c-dev.h>
2424 #include <i2c/smbus.h>
2525
26−(Please note that there are two files named "i2c-dev.h" out there. One is
27−distributed with the Linux kernel and the other one is included in the
28−source tree of i2c-tools. They used to be different in content but since 2012
29−they're identical. You should use "linux/i2c-dev.h").
30−
3126 Now, you have to decide which adapter you want to access. You should
3227 inspect /sys/class/i2c-dev/ or run "i2cdetect -l" to decide this.
3328 Adapter numbers are assigned somewhat dynamically, so you can not
@@ -38,7 +33,7 @@ Next thing, open the device file, as follows: · 4 unmodified lines
3833 int file;
3934 int adapter_nr = 2; /* probably dynamically determined */
4035 char filename[20];
41−
36+
4237 snprintf(filename, 19, "/dev/i2c-%d", adapter_nr);
4338 file = open(filename, O_RDWR);
4439 if (file < 0) {
@@ -72,8 +67,10 @@ the device supports them. Both are illustrated below. · 27 unmodified lines
7267 /* res contains the read word */
7368 }
7469
75− /* Using I2C Write, equivalent of
76− i2c_smbus_write_word_data(file, reg, 0x6543) */
70+ /*
71+ * Using I2C Write, equivalent of
72+ * i2c_smbus_write_word_data(file, reg, 0x6543)
73+ */
7774 buf[0] = reg;
7875 buf[1] = 0x43;
7976 buf[2] = 0x65;
@@ -140,14 +137,14 @@ ioctl(file, I2C_RDWR, struct i2c_rdwr_ioctl_data *msgset) · 60 unmodified lines
140137 set in each message, overriding the values set with the above ioctl's.
141138
142139 ioctl(file, I2C_SMBUS, struct i2c_smbus_ioctl_data *args)
143− Not meant to be called directly; instead, use the access functions
144− below.
140+ If possible, use the provided i2c_smbus_* methods described below instead
141+ of issuing direct ioctls.
145142
146143 You can do plain i2c transactions by using read(2) and write(2) calls.
147144 You do not need to pass the address byte; instead, set it through
148145 ioctl I2C_SLAVE before you try to access the device.
149146
150−You can do SMBus level transactions (see documentation file smbus-protocol
147+You can do SMBus level transactions (see documentation file smbus-protocol
151148 for details) through the following functions:
152149 __s32 i2c_smbus_write_quick(int file, __u8 value);
153150 __s32 i2c_smbus_read_byte(int file);
@@ -158,7 +155,7 @@ for details) through the following functions: · 4 unmodified lines
158155 __s32 i2c_smbus_write_word_data(int file, __u8 command, __u16 value);
159156 __s32 i2c_smbus_process_call(int file, __u8 command, __u16 value);
160157 __s32 i2c_smbus_read_block_data(int file, __u8 command, __u8 *values);
161− __s32 i2c_smbus_write_block_data(int file, __u8 command, __u8 length,
158+ __s32 i2c_smbus_write_block_data(int file, __u8 command, __u8 length,
162159 __u8 *values);
163160 All these transactions return -1 on failure; you can read errno to see
164161 what happened. The 'write' transactions return 0 on success; the
@@ -166,10 +163,9 @@ what happened. The 'write' transactions return 0 on success; the · 1 unmodified line
166163 returns the number of values read. The block buffers need not be longer
167164 than 32 bytes.
168165
169−The above functions are all inline functions, that resolve to calls to
170−the i2c_smbus_access function, that on its turn calls a specific ioctl
171−with the data in a specific format. Read the source code if you
172−want to know what happens behind the screens.
166+The above functions are made available by linking against the libi2c library,
167+which is provided by the i2c-tools project. See:
168+https://git.kernel.org/pub/scm/utils/i2c-tools/i2c-tools.git/.
173169
174170
175171 Implementation details
Documentation/ioctl/ioctl-number.txt+0−2
@@ -217,7 +217,6 @@ Code Seq#(hex) Include File Comments · 216 unmodified lines
217217 'd' 02-40 pcmcia/ds.h conflict!
218218 'd' F0-FF linux/digi1.h
219219 'e' all linux/digi1.h conflict!
220−'e' 00-1F drivers/net/irda/irtty-sir.h conflict!
221220 'f' 00-1F linux/ext2_fs.h conflict!
222221 'f' 00-1F linux/ext3_fs.h conflict!
223222 'f' 00-0F fs/jfs/jfs_dinode.h conflict!
@@ -247,7 +246,6 @@ Code Seq#(hex) Include File Comments · 23 unmodified lines
247246 'm' all linux/synclink.h conflict!
248247 'm' 00-19 drivers/message/fusion/mptctl.h conflict!
249248 'm' 00 drivers/scsi/megaraid/megaraid_ioctl.h conflict!
250−'m' 00-1F net/irda/irmod.h conflict!
251249 'n' 00-7F linux/ncp_fs.h and fs/ncpfs/ioctl.c
252250 'n' 80-8F uapi/linux/nilfs2_api.h NILFS2
253251 'n' E0-FF linux/matroxfb.h matroxfb
Documentation/livepatch/shadow-vars.txt+29−12
@@ -34,9 +34,13 @@ meta-data and shadow-data: · 33 unmodified lines
3434 - data[] - storage for shadow data
3535
3636 It is important to note that the klp_shadow_alloc() and
37−klp_shadow_get_or_alloc() calls, described below, store a *copy* of the
38−data that the functions are provided. Callers should provide whatever
39−mutual exclusion is required of the shadow data.
37+klp_shadow_get_or_alloc() are zeroing the variable by default.
38+They also allow to call a custom constructor function when a non-zero
39+value is needed. Callers should provide whatever mutual exclusion
40+is required.
41+
42+Note that the constructor is called under klp_shadow_lock spinlock. It allows
43+to do actions that can be done only once when a new variable is allocated.
4044
4145 * klp_shadow_get() - retrieve a shadow variable data pointer
4246 - search hashtable for <obj, id> pair
@@ -47,7 +51,7 @@ mutual exclusion is required of the shadow data. · 4 unmodified lines
4751 - WARN and return NULL
4852 - if <obj, id> doesn't already exist
4953 - allocate a new shadow variable
50− - copy data into the new shadow variable
54+ - initialize the variable using a custom constructor and data when provided
5155 - add <obj, id> to the global hashtable
5256
5357 * klp_shadow_get_or_alloc() - get existing or alloc a new shadow variable
@@ -56,16 +60,20 @@ mutual exclusion is required of the shadow data. · 2 unmodified lines
5660 - return existing shadow variable
5761 - if <obj, id> doesn't already exist
5862 - allocate a new shadow variable
59− - copy data into the new shadow variable
63+ - initialize the variable using a custom constructor and data when provided
6064 - add <obj, id> pair to the global hashtable
6165
6266 * klp_shadow_free() - detach and free a <obj, id> shadow variable
6367 - find and remove a <obj, id> reference from global hashtable
64− - if found, free shadow variable
68+ - if found
69+ - call destructor function if defined
70+ - free shadow variable
6571
6672 * klp_shadow_free_all() - detach and free all <*, id> shadow variables
6773 - find and remove any <*, id> references from global hashtable
68− - if found, free shadow variable
74+ - if found
75+ - call destructor function if defined
76+ - free shadow variable
6977
7078
7179 2. Use cases
@@ -107,7 +115,8 @@ struct sta_info *sta_info_alloc(struct ieee80211_sub_if_data *sdata, · 35 unmodified lines
107115 sta = kzalloc(sizeof(*sta) + hw->sta_data_size, gfp);
108116
109117 /* Attach a corresponding shadow variable, then initialize it */
110− ps_lock = klp_shadow_alloc(sta, PS_LOCK, NULL, sizeof(*ps_lock), gfp);
118+ ps_lock = klp_shadow_alloc(sta, PS_LOCK, sizeof(*ps_lock), gfp,
119+ NULL, NULL);
111120 if (!ps_lock)
112121 goto shadow_fail;
113122 spin_lock_init(ps_lock);
@@ -131,7 +140,7 @@ variable: · 17 unmodified lines
131140
132141 void sta_info_free(struct ieee80211_local *local, struct sta_info *sta)
133142 {
134− klp_shadow_free(sta, PS_LOCK);
143+ klp_shadow_free(sta, PS_LOCK, NULL);
135144 kfree(sta);
136145 ...
137146
@@ -148,16 +157,24 @@ shadow variables to parents already in-flight. · 10 unmodified lines
148157 For commit 1d147bfa6429, a good spot to allocate a shadow spinlock is
149158 inside ieee80211_sta_ps_deliver_wakeup():
150159
160+int ps_lock_shadow_ctor(void *obj, void *shadow_data, void *ctor_data)
161+{
162+ spinlock_t *lock = shadow_data;
163+
164+ spin_lock_init(lock);
165+ return 0;
166+}
167+
151168 #define PS_LOCK 1
152169 void ieee80211_sta_ps_deliver_wakeup(struct sta_info *sta)
153170 {
154− DEFINE_SPINLOCK(ps_lock_fallback);
155171 spinlock_t *ps_lock;
156172
157173 /* sync with ieee80211_tx_h_unicast_ps_buf */
158174 ps_lock = klp_shadow_get_or_alloc(sta, PS_LOCK,
159− &ps_lock_fallback, sizeof(ps_lock_fallback),
160− GFP_ATOMIC);
175+ sizeof(*ps_lock), GFP_ATOMIC,
176+ ps_lock_shadow_ctor, NULL);
177+
161178 if (ps_lock)
162179 spin_lock(ps_lock);
163180 ...
Documentation/media/uapi/rc/keytable.c.rst+1−1
@@ -7,7 +7,7 @@ file: uapi/v4l/keytable.c · 6 unmodified lines
77
88 /* keytable.c - This program allows checking/replacing keys at IR
99
10− Copyright (C) 2006-2009 Mauro Carvalho Chehab <mchehab@infradead.org>
10+ Copyright (C) 2006-2009 Mauro Carvalho Chehab <mchehab@kernel.org>
1111
1212 This program is free software; you can redistribute it and/or modify
1313 it under the terms of the GNU General Public License as published by
Documentation/media/uapi/v4l/v4l2grab.c.rst+1−1
@@ -6,7 +6,7 @@ file: media/v4l/v4l2grab.c · 5 unmodified lines
66 .. code-block:: c
77
88 /* V4L2 video picture grabber
9− Copyright (C) 2009 Mauro Carvalho Chehab <mchehab@infradead.org>
9+ Copyright (C) 2009 Mauro Carvalho Chehab <mchehab@kernel.org>
1010
1111 This program is free software; you can redistribute it and/or modify
1212 it under the terms of the GNU General Public License as published by
Documentation/networking/filter.txt+3−3
@@ -169,7 +169,7 @@ access to BPF code as well. · 168 unmodified lines
169169 BPF engine and instruction set
170170 ------------------------------
171171
172−Under tools/net/ there's a small helper tool called bpf_asm which can
172+Under tools/bpf/ there's a small helper tool called bpf_asm which can
173173 be used to write low-level filters for example scenarios mentioned in the
174174 previous section. Asm-like syntax mentioned here has been implemented in
175175 bpf_asm and will be used for further explanations (instead of dealing with
@@ -359,7 +359,7 @@ $ ./bpf_asm -c foo · 183 unmodified lines
359359 In particular, as usage with xt_bpf or cls_bpf can result in more complex BPF
360360 filters that might not be obvious at first, it's good to test filters before
361361 attaching to a live system. For that purpose, there's a small tool called
362−bpf_dbg under tools/net/ in the kernel source directory. This debugger allows
362+bpf_dbg under tools/bpf/ in the kernel source directory. This debugger allows
363363 for testing BPF filters against given pcap files, single stepping through the
364364 BPF code on the pcap's packets and to do BPF machine register dumps.
365365
@@ -483,7 +483,7 @@ Example output from dmesg: · 117 unmodified lines
483483 [ 3389.935851] JIT code: 00000030: 00 e8 28 94 ff e0 83 f8 01 75 07 b8 ff ff 00 00
484484 [ 3389.935852] JIT code: 00000040: eb 02 31 c0 c9 c3
485485
486−In the kernel source tree under tools/net/, there's bpf_jit_disasm for
486+In the kernel source tree under tools/bpf/, there's bpf_jit_disasm for
487487 generating disassembly out of the kernel log's hexdump:
488488
489489 # ./bpf_jit_disasm
Documentation/networking/ip-sysctl.txt+4−19
@@ -1390,26 +1390,26 @@ mld_qrv - INTEGER · 1389 unmodified lines
13901390 Default: 2 (as specified by RFC3810 9.1)
13911391 Minimum: 1 (as specified by RFC6636 4.5)
13921392
1393−max_dst_opts_cnt - INTEGER
1393+max_dst_opts_number - INTEGER
13941394 Maximum number of non-padding TLVs allowed in a Destination
13951395 options extension header. If this value is less than zero
13961396 then unknown options are disallowed and the number of known
13971397 TLVs allowed is the absolute value of this number.
13981398 Default: 8
13991399
1400−max_hbh_opts_cnt - INTEGER
1400+max_hbh_opts_number - INTEGER
14011401 Maximum number of non-padding TLVs allowed in a Hop-by-Hop
14021402 options extension header. If this value is less than zero
14031403 then unknown options are disallowed and the number of known
14041404 TLVs allowed is the absolute value of this number.
14051405 Default: 8
14061406
1407−max dst_opts_len - INTEGER
1407+max_dst_opts_length - INTEGER
14081408 Maximum length allowed for a Destination options extension
14091409 header.
14101410 Default: INT_MAX (unlimited)
14111411
1412−max hbh_opts_len - INTEGER
1412+max_hbh_length - INTEGER
14131413 Maximum length allowed for a Hop-by-Hop options extension
14141414 header.
14151415 Default: INT_MAX (unlimited)
@@ -2126,18 +2126,3 @@ max_dgram_qlen - INTEGER · 710 unmodified lines
21262126
21272127 Default: 10
21282128
2129−
2130−UNDOCUMENTED:
2131−
2132−/proc/sys/net/irda/*
2133− fast_poll_increase FIXME
2134− warn_noreply_time FIXME
2135− discovery_slots FIXME
2136− slot_timeout FIXME
2137− max_baud_rate FIXME
2138− discovery_timeout FIXME
2139− lap_keepalive_time FIXME
2140− max_noreply_time FIXME
2141− max_tx_data_size FIXME
2142− max_tx_window FIXME
2143− min_tx_turn_time FIXME
Documentation/power/suspend-and-cpuhotplug.txt+1−1
@@ -168,7 +168,7 @@ update on the CPUs, as discussed below: · 167 unmodified lines
168168
169169 [Please bear in mind that the kernel requests the microcode images from
170170 userspace, using the request_firmware() function defined in
171−drivers/base/firmware_class.c]
171+drivers/base/firmware_loader/main.c]
172172
173173
174174 a. When all the CPUs are identical:
Documentation/process/magic-number.rst+0−3
@@ -157,8 +157,5 @@ memory management. See ``include/sound/sndmagic.h`` for complete list of them. M · 156 unmodified lines
157157 OSS sound drivers have their magic numbers constructed from the soundcard PCI
158158 ID - these are not listed here as well.
159159
160−IrDA subsystem also uses large number of own magic numbers, see
161−``include/net/irda/irda.h`` for a complete list of them.
162−
163160 HFS is another larger user of magic numbers - you can find them in
164161 ``fs/hfs/hfs.h``.
Documentation/sphinx/parse-headers.pl+2−2
@@ -387,11 +387,11 @@ tree for more details. · 386 unmodified lines
387387
388388 =head1 BUGS
389389
390−Report bugs to Mauro Carvalho Chehab <mchehab@s-opensource.com>
390+Report bugs to Mauro Carvalho Chehab <mchehab@kernel.org>
391391
392392 =head1 COPYRIGHT
393393
394−Copyright (c) 2016 by Mauro Carvalho Chehab <mchehab@s-opensource.com>.
394+Copyright (c) 2016 by Mauro Carvalho Chehab <mchehab+samsung@kernel.org>.
395395
396396 License GPLv2: GNU GPL version 2 <http://gnu.org/licenses/gpl.html>.
397397
Documentation/trace/ftrace.rst+11−3
@@ -461,9 +461,17 @@ of ftrace. Here is a list of some of the key files: · 460 unmodified lines
461461 and ticks at the same rate as the hardware clocksource.
462462
463463 boot:
464− Same as mono. Used to be a separate clock which accounted
465− for the time spent in suspend while CLOCK_MONOTONIC did
466− not.
464+ This is the boot clock (CLOCK_BOOTTIME) and is based on the
465+ fast monotonic clock, but also accounts for time spent in
466+ suspend. Since the clock access is designed for use in
467+ tracing in the suspend path, some side effects are possible
468+ if clock is accessed after the suspend time is accounted before
469+ the fast mono clock is updated. In this case, the clock update
470+ appears to happen slightly sooner than it normally would have.
471+ Also on 32-bit systems, it's possible that the 64-bit boot offset
472+ sees a partial update. These effects are rare and post
473+ processing should be able to handle them. See comments in the
474+ ktime_get_boot_fast_ns() function for more information.
467475
468476 To set a clock, simply echo the clock name into this file::
469477
Documentation/translations/zh_CN/video4linux/v4l2-framework.txt+2−2
@@ -6,7 +6,7 @@ communicating in English you can also ask the Chinese maintainer for · 5 unmodified lines
66 help. Contact the Chinese maintainer if this translation is outdated
77 or if there is a problem with the translation.
88
9−Maintainer: Mauro Carvalho Chehab <mchehab@infradead.org>
9+Maintainer: Mauro Carvalho Chehab <mchehab@kernel.org>
1010 Chinese maintainer: Fu Wei <tekkamanninja@gmail.com>
1111 ---------------------------------------------------------------------
1212 Documentation/video4linux/v4l2-framework.txt 的中文翻译
@@ -14,7 +14,7 @@ Documentation/video4linux/v4l2-framework.txt 的中文翻译 · 1 unmodified line
1414 如果想评论或更新本文的内容,请直接联系原文档的维护者。如果你使用英文
1515 交流有困难的话,也可以向中文版维护者求助。如果本翻译更新不及时或者翻
1616 译存在问题,请联系中文版维护者。
17−英文版维护者: Mauro Carvalho Chehab <mchehab@infradead.org>
17+英文版维护者: Mauro Carvalho Chehab <mchehab@kernel.org>
1818 中文版维护者: 傅炜 Fu Wei <tekkamanninja@gmail.com>
1919 中文版翻译者: 傅炜 Fu Wei <tekkamanninja@gmail.com>
2020 中文版校译者: 傅炜 Fu Wei <tekkamanninja@gmail.com>
Documentation/virtual/kvm/api.txt+8−1
@@ -1960,6 +1960,9 @@ ARM 32-bit VFP control registers have the following id bit patterns: · 1959 unmodified lines
19601960 ARM 64-bit FP registers have the following id bit patterns:
19611961 0x4030 0000 0012 0 <regno:12>
19621962
1963+ARM firmware pseudo-registers have the following bit pattern:
1964+ 0x4030 0000 0014 <regno:16>
1965+
19631966
19641967 arm64 registers are mapped using the lower 32 bits. The upper 16 of
19651968 that is the register group type, or coprocessor number:
@@ -1976,6 +1979,9 @@ arm64 CCSIDR registers are demultiplexed by CSSELR value: · 10 unmodified lines
19761979 arm64 system registers have the following id bit patterns:
19771980 0x6030 0000 0013 <op0:2> <op1:3> <crn:4> <crm:4> <op2:3>
19781981
1982+arm64 firmware pseudo-registers have the following bit pattern:
1983+ 0x6030 0000 0014 <regno:16>
1984+
19791985
19801986 MIPS registers are mapped using the lower 32 bits. The upper 16 of that is
19811987 the register group type:
@@ -2510,7 +2516,8 @@ Possible features: · 528 unmodified lines
25102516 and execute guest code when KVM_RUN is called.
25112517 - KVM_ARM_VCPU_EL1_32BIT: Starts the CPU in a 32bit mode.
25122518 Depends on KVM_CAP_ARM_EL1_32BIT (arm64 only).
2513− - KVM_ARM_VCPU_PSCI_0_2: Emulate PSCI v0.2 for the CPU.
2519+ - KVM_ARM_VCPU_PSCI_0_2: Emulate PSCI v0.2 (or a future revision
2520+ backward compatible with v0.2) for the CPU.
25142521 Depends on KVM_CAP_ARM_PSCI_0_2.
25152522 - KVM_ARM_VCPU_PMU_V3: Emulate PMUv3 for the CPU.
25162523 Depends on KVM_CAP_ARM_PMU_V3.
Documentation/virtual/kvm/arm/psci.txt+30−0
@@ -0,0 +1,30 @@
1+KVM implements the PSCI (Power State Coordination Interface)
2+specification in order to provide services such as CPU on/off, reset
3+and power-off to the guest.
4+
5+The PSCI specification is regularly updated to provide new features,
6+and KVM implements these updates if they make sense from a virtualization
7+point of view.
8+
9+This means that a guest booted on two different versions of KVM can
10+observe two different "firmware" revisions. This could cause issues if
11+a given guest is tied to a particular PSCI revision (unlikely), or if
12+a migration causes a different PSCI version to be exposed out of the
13+blue to an unsuspecting guest.
14+
15+In order to remedy this situation, KVM exposes a set of "firmware
16+pseudo-registers" that can be manipulated using the GET/SET_ONE_REG
17+interface. These registers can be saved/restored by userspace, and set
18+to a convenient value if required.
19+
20+The following register is defined:
21+
22+* KVM_REG_ARM_PSCI_VERSION:
23+
24+ - Only valid if the vcpu has the KVM_ARM_VCPU_PSCI_0_2 feature set
25+ (and thus has already been initialized)
26+ - Returns the current PSCI version on GET_ONE_REG (defaulting to the
27+ highest PSCI version implemented by KVM and compatible with v0.2)
28+ - Allows any PSCI version implemented by KVM and compatible with
29+ v0.2 to be set with SET_ONE_REG
30+ - Affects the whole VM (even if the register view is per-vcpu)
MAINTAINERS+49−43
@@ -564,8 +564,9 @@ S: Maintained · 563 unmodified lines
564564 F: drivers/media/dvb-frontends/af9033*
565565
566566 AFFS FILE SYSTEM
567+M: David Sterba <dsterba@suse.com>
567568 L: linux-fsdevel@vger.kernel.org
568−S: Orphan
569+S: Odd Fixes
569570 F: Documentation/filesystems/affs.txt
570571 F: fs/affs/
571572
@@ -905,6 +906,8 @@ ANDROID ION DRIVER · 333 unmodified lines
905906 M: Laura Abbott <labbott@redhat.com>
906907 M: Sumit Semwal <sumit.semwal@linaro.org>
907908 L: devel@driverdev.osuosl.org
909+L: dri-devel@lists.freedesktop.org
910+L: linaro-mm-sig@lists.linaro.org (moderated for non-subscribers)
908911 S: Supported
909912 F: drivers/staging/android/ion
910913 F: drivers/staging/android/uapi/ion.h
@@ -1208,7 +1211,6 @@ F: drivers/*/*alpine* · 297 unmodified lines
12081211 ARM/ARTPEC MACHINE SUPPORT
12091212 M: Jesper Nilsson <jesper.nilsson@axis.com>
12101213 M: Lars Persson <lars.persson@axis.com>
1211−M: Niklas Cassel <niklas.cassel@axis.com>
12121214 S: Maintained
12131215 L: linux-arm-kernel@axis.com
12141216 F: arch/arm/mach-artpec
@@ -1373,7 +1375,8 @@ F: arch/arm/mach-ebsa110/ · 158 unmodified lines
13731375 F: drivers/net/ethernet/amd/am79c961a.*
13741376
13751377 ARM/ENERGY MICRO (SILICON LABS) EFM32 SUPPORT
1376−M: Uwe Kleine-König <kernel@pengutronix.de>
1378+M: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
1379+R: Pengutronix Kernel Team <kernel@pengutronix.de>
13771380 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
13781381 S: Maintained
13791382 N: efm32
@@ -1401,7 +1404,8 @@ F: arch/arm/mach-footbridge/ · 21 unmodified lines
14011404
14021405 ARM/FREESCALE IMX / MXC ARM ARCHITECTURE
14031406 M: Shawn Guo <shawnguo@kernel.org>
1404−M: Sascha Hauer <kernel@pengutronix.de>
1407+M: Sascha Hauer <s.hauer@pengutronix.de>
1408+R: Pengutronix Kernel Team <kernel@pengutronix.de>
14051409 R: Fabio Estevam <fabio.estevam@nxp.com>
14061410 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
14071411 S: Maintained
@@ -1416,7 +1420,8 @@ F: include/soc/imx/ · 8 unmodified lines
14161420
14171421 ARM/FREESCALE VYBRID ARM ARCHITECTURE
14181422 M: Shawn Guo <shawnguo@kernel.org>
1419−M: Sascha Hauer <kernel@pengutronix.de>
1423+M: Sascha Hauer <s.hauer@pengutronix.de>
1424+R: Pengutronix Kernel Team <kernel@pengutronix.de>
14201425 R: Stefan Agner <stefan@agner.ch>
14211426 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
14221427 S: Maintained
@@ -2549,7 +2554,6 @@ F: Documentation/devicetree/bindings/sound/axentia,* · 1126 unmodified lines
25492554 F: sound/soc/atmel/tse850-pcm5142.c
25502555
25512556 AZ6007 DVB DRIVER
2552−M: Mauro Carvalho Chehab <mchehab@s-opensource.com>
25532557 M: Mauro Carvalho Chehab <mchehab@kernel.org>
25542558 L: linux-media@vger.kernel.org
25552559 W: https://linuxtv.org
@@ -2614,7 +2618,7 @@ S: Maintained · 58 unmodified lines
26142618 F: drivers/net/hamradio/baycom*
26152619
26162620 BCACHE (BLOCK LAYER CACHE)
2617−M: Michael Lyle <mlyle@lyle.org>
2621+M: Coly Li <colyli@suse.de>
26182622 M: Kent Overstreet <kent.overstreet@gmail.com>
26192623 L: linux-bcache@vger.kernel.org
26202624 W: http://bcache.evilpiepirate.org
@@ -3078,7 +3082,6 @@ F: include/linux/btrfs* · 457 unmodified lines
30783082 F: include/uapi/linux/btrfs*
30793083
30803084 BTTV VIDEO4LINUX DRIVER
3081−M: Mauro Carvalho Chehab <mchehab@s-opensource.com>
30823085 M: Mauro Carvalho Chehab <mchehab@kernel.org>
30833086 L: linux-media@vger.kernel.org
30843087 W: https://linuxtv.org
@@ -3807,7 +3810,6 @@ S: Maintained · 722 unmodified lines
38073810 F: drivers/media/dvb-frontends/cx24120*
38083811
38093812 CX88 VIDEO4LINUX DRIVER
3810−M: Mauro Carvalho Chehab <mchehab@s-opensource.com>
38113813 M: Mauro Carvalho Chehab <mchehab@kernel.org>
38123814 L: linux-media@vger.kernel.org
38133815 W: https://linuxtv.org
@@ -4245,6 +4247,9 @@ F: include/trace/events/fs_dax.h · 431 unmodified lines
42454247
42464248 DEVICE DIRECT ACCESS (DAX)
42474249 M: Dan Williams <dan.j.williams@intel.com>
4250+M: Dave Jiang <dave.jiang@intel.com>
4251+M: Ross Zwisler <ross.zwisler@linux.intel.com>
4252+M: Vishal Verma <vishal.l.verma@intel.com>
42484253 L: linux-nvdimm@lists.01.org
42494254 S: Supported
42504255 F: drivers/dax/
@@ -5045,7 +5050,6 @@ F: drivers/edac/thunderx_edac* · 794 unmodified lines
50455050
50465051 EDAC-CORE
50475052 M: Borislav Petkov <bp@alien8.de>
5048−M: Mauro Carvalho Chehab <mchehab@s-opensource.com>
50495053 M: Mauro Carvalho Chehab <mchehab@kernel.org>
50505054 L: linux-edac@vger.kernel.org
50515055 T: git git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp.git for-next
@@ -5074,7 +5078,6 @@ S: Maintained · 22 unmodified lines
50745078 F: drivers/edac/fsl_ddr_edac.*
50755079
50765080 EDAC-GHES
5077−M: Mauro Carvalho Chehab <mchehab@s-opensource.com>
50785081 M: Mauro Carvalho Chehab <mchehab@kernel.org>
50795082 L: linux-edac@vger.kernel.org
50805083 S: Maintained
@@ -5091,21 +5094,18 @@ S: Maintained · 10 unmodified lines
50915094 F: drivers/edac/i5000_edac.c
50925095
50935096 EDAC-I5400
5094−M: Mauro Carvalho Chehab <mchehab@s-opensource.com>
50955097 M: Mauro Carvalho Chehab <mchehab@kernel.org>
50965098 L: linux-edac@vger.kernel.org
50975099 S: Maintained
50985100 F: drivers/edac/i5400_edac.c
50995101
51005102 EDAC-I7300
5101−M: Mauro Carvalho Chehab <mchehab@s-opensource.com>
51025103 M: Mauro Carvalho Chehab <mchehab@kernel.org>
51035104 L: linux-edac@vger.kernel.org
51045105 S: Maintained
51055106 F: drivers/edac/i7300_edac.c
51065107
51075108 EDAC-I7CORE
5108−M: Mauro Carvalho Chehab <mchehab@s-opensource.com>
51095109 M: Mauro Carvalho Chehab <mchehab@kernel.org>
51105110 L: linux-edac@vger.kernel.org
51115111 S: Maintained
@@ -5155,7 +5155,6 @@ S: Maintained · 43 unmodified lines
51555155 F: drivers/edac/r82600_edac.c
51565156
51575157 EDAC-SBRIDGE
5158−M: Mauro Carvalho Chehab <mchehab@s-opensource.com>
51595158 M: Mauro Carvalho Chehab <mchehab@kernel.org>
51605159 L: linux-edac@vger.kernel.org
51615160 S: Maintained
@@ -5214,7 +5213,6 @@ S: Maintained · 52 unmodified lines
52145213 F: drivers/net/ethernet/ibm/ehea/
52155214
52165215 EM28XX VIDEO4LINUX DRIVER
5217−M: Mauro Carvalho Chehab <mchehab@s-opensource.com>
52185216 M: Mauro Carvalho Chehab <mchehab@kernel.org>
52195217 L: linux-media@vger.kernel.org
52205218 W: https://linuxtv.org
@@ -5652,7 +5650,8 @@ F: drivers/net/ethernet/freescale/fec.h · 431 unmodified lines
56525650 F: Documentation/devicetree/bindings/net/fsl-fec.txt
56535651
56545652 FREESCALE IMX / MXC FRAMEBUFFER DRIVER
5655−M: Sascha Hauer <kernel@pengutronix.de>
5653+M: Sascha Hauer <s.hauer@pengutronix.de>
5654+R: Pengutronix Kernel Team <kernel@pengutronix.de>
56565655 L: linux-fbdev@vger.kernel.org
56575656 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
56585657 S: Maintained
@@ -5784,6 +5783,14 @@ F: fs/crypto/ · 125 unmodified lines
57845783 F: include/linux/fscrypt*.h
57855784 F: Documentation/filesystems/fscrypt.rst
57865785
5786+FSNOTIFY: FILESYSTEM NOTIFICATION INFRASTRUCTURE
5787+M: Jan Kara <jack@suse.cz>
5788+R: Amir Goldstein <amir73il@gmail.com>
5789+L: linux-fsdevel@vger.kernel.org
5790+S: Maintained
5791+F: fs/notify/
5792+F: include/linux/fsnotify*.h
5793+
57875794 FUJITSU LAPTOP EXTRAS
57885795 M: Jonathan Woithe <jwoithe@just42.net>
57895796 L: platform-driver-x86@vger.kernel.org
@@ -6256,7 +6263,7 @@ S: Odd Fixes · 466 unmodified lines
62566263 F: drivers/media/usb/hdpvr/
62576264
62586265 HEWLETT PACKARD ENTERPRISE ILO NMI WATCHDOG DRIVER
6259−M: Jimmy Vance <jimmy.vance@hpe.com>
6266+M: Jerry Hoemann <jerry.hoemann@hpe.com>
62606267 S: Supported
62616268 F: Documentation/watchdog/hpwdt.txt
62626269 F: drivers/watchdog/hpwdt.c
@@ -7396,16 +7403,6 @@ S: Obsolete · 1133 unmodified lines
73967403 F: include/uapi/linux/ipx.h
73977404 F: drivers/staging/ipx/
73987405
7399−IRDA SUBSYSTEM
7400−M: Samuel Ortiz <samuel@sortiz.org>
7401−L: irda-users@lists.sourceforge.net (subscribers-only)
7402−L: netdev@vger.kernel.org
7403−W: http://irda.sourceforge.net/
7404−S: Obsolete
7405−T: git git://git.kernel.org/pub/scm/linux/kernel/git/sameo/irda-2.6.git
7406−F: Documentation/networking/irda.txt
7407−F: drivers/staging/irda/
7408−
74097406 IRQ DOMAINS (IRQ NUMBER MAPPING LIBRARY)
74107407 M: Marc Zyngier <marc.zyngier@arm.com>
74117408 S: Maintained
@@ -7670,9 +7667,11 @@ L: linux-kbuild@vger.kernel.org · 258 unmodified lines
76707667 S: Maintained
76717668 F: Documentation/kbuild/
76727669 F: Makefile
7673−F: scripts/Makefile.*
7670+F: scripts/Kbuild*
7671+F: scripts/Makefile*
76747672 F: scripts/basic/
76757673 F: scripts/mk*
7674+F: scripts/mod/
76767675 F: scripts/package/
76777676
76787677 KERNEL JANITORS
@@ -7738,7 +7737,7 @@ F: arch/x86/include/asm/svm.h · 59 unmodified lines
77387737 F: arch/x86/kvm/svm.c
77397738
77407739 KERNEL VIRTUAL MACHINE FOR ARM (KVM/arm)
7741−M: Christoffer Dall <christoffer.dall@linaro.org>
7740+M: Christoffer Dall <christoffer.dall@arm.com>
77427741 M: Marc Zyngier <marc.zyngier@arm.com>
77437742 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
77447743 L: kvmarm@lists.cs.columbia.edu
@@ -7752,7 +7751,7 @@ F: virt/kvm/arm/ · 7 unmodified lines
77527751 F: include/kvm/arm_*
77537752
77547753 KERNEL VIRTUAL MACHINE FOR ARM64 (KVM/arm64)
7755−M: Christoffer Dall <christoffer.dall@linaro.org>
7754+M: Christoffer Dall <christoffer.dall@arm.com>
77567755 M: Marc Zyngier <marc.zyngier@arm.com>
77577756 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
77587757 L: kvmarm@lists.cs.columbia.edu
@@ -8048,6 +8047,9 @@ F: tools/lib/lockdep/ · 289 unmodified lines
80488047
80498048 LIBNVDIMM BLK: MMIO-APERTURE DRIVER
80508049 M: Ross Zwisler <ross.zwisler@linux.intel.com>
8050+M: Dan Williams <dan.j.williams@intel.com>
8051+M: Vishal Verma <vishal.l.verma@intel.com>
8052+M: Dave Jiang <dave.jiang@intel.com>
80518053 L: linux-nvdimm@lists.01.org
80528054 Q: https://patchwork.kernel.org/project/linux-nvdimm/list/
80538055 S: Supported
@@ -8056,6 +8058,9 @@ F: drivers/nvdimm/region_devs.c · 2 unmodified lines
80568058
80578059 LIBNVDIMM BTT: BLOCK TRANSLATION TABLE
80588060 M: Vishal Verma <vishal.l.verma@intel.com>
8061+M: Dan Williams <dan.j.williams@intel.com>
8062+M: Ross Zwisler <ross.zwisler@linux.intel.com>
8063+M: Dave Jiang <dave.jiang@intel.com>
80598064 L: linux-nvdimm@lists.01.org
80608065 Q: https://patchwork.kernel.org/project/linux-nvdimm/list/
80618066 S: Supported
@@ -8063,6 +8068,9 @@ F: drivers/nvdimm/btt* · 1 unmodified line
80638068
80648069 LIBNVDIMM PMEM: PERSISTENT MEMORY DRIVER
80658070 M: Ross Zwisler <ross.zwisler@linux.intel.com>
8071+M: Dan Williams <dan.j.williams@intel.com>
8072+M: Vishal Verma <vishal.l.verma@intel.com>
8073+M: Dave Jiang <dave.jiang@intel.com>
80668074 L: linux-nvdimm@lists.01.org
80678075 Q: https://patchwork.kernel.org/project/linux-nvdimm/list/
80688076 S: Supported
@@ -8078,6 +8086,9 @@ F: Documentation/devicetree/bindings/pmem/pmem-region.txt · 9 unmodified lines
80788086
80798087 LIBNVDIMM: NON-VOLATILE MEMORY DEVICE SUBSYSTEM
80808088 M: Dan Williams <dan.j.williams@intel.com>
8089+M: Ross Zwisler <ross.zwisler@linux.intel.com>
8090+M: Vishal Verma <vishal.l.verma@intel.com>
8091+M: Dave Jiang <dave.jiang@intel.com>
80818092 L: linux-nvdimm@lists.01.org
80828093 Q: https://patchwork.kernel.org/project/linux-nvdimm/list/
80838094 T: git git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm.git
@@ -8852,7 +8863,6 @@ F: Documentation/devicetree/bindings/media/nvidia,tegra-vde.txt · 768 unmodified lines
88528863 F: drivers/staging/media/tegra-vde/
88538864
88548865 MEDIA INPUT INFRASTRUCTURE (V4L/DVB)
8855−M: Mauro Carvalho Chehab <mchehab@s-opensource.com>
88568866 M: Mauro Carvalho Chehab <mchehab@kernel.org>
88578867 P: LinuxTV.org Project
88588868 L: linux-media@vger.kernel.org
@@ -9706,6 +9716,7 @@ W: https://fedorahosted.org/dropwatch/ · 847 unmodified lines
97069716 F: net/core/drop_monitor.c
97079717
97089718 NETWORKING DRIVERS
9719+M: "David S. Miller" <davem@davemloft.net>
97099720 L: netdev@vger.kernel.org
97109721 W: http://www.linuxfoundation.org/en/Net
97119722 Q: http://patchwork.ozlabs.org/project/netdev/list/
@@ -9765,6 +9776,7 @@ F: include/uapi/linux/net_namespace.h · 53 unmodified lines
97659776 F: tools/testing/selftests/net/
97669777 F: lib/net_utils.c
97679778 F: lib/random32.c
9779+F: Documentation/networking/
97689780
97699781 NETWORKING [IPSEC]
97709782 M: Steffen Klassert <steffen.klassert@secunet.com>
@@ -10881,7 +10893,6 @@ F: drivers/pci/host/ · 1110 unmodified lines
1088110893 F: drivers/pci/dwc/
1088210894
1088310895 PCIE DRIVER FOR AXIS ARTPEC
10884−M: Niklas Cassel <niklas.cassel@axis.com>
1088510896 M: Jesper Nilsson <jesper.nilsson@axis.com>
1088610897 L: linux-arm-kernel@axis.com
1088710898 L: linux-pci@vger.kernel.org
@@ -12240,7 +12251,6 @@ S: Odd Fixes · 1352 unmodified lines
1224012251 F: drivers/media/i2c/saa6588*
1224112252
1224212253 SAA7134 VIDEO4LINUX DRIVER
12243−M: Mauro Carvalho Chehab <mchehab@s-opensource.com>
1224412254 M: Mauro Carvalho Chehab <mchehab@kernel.org>
1224512255 L: linux-media@vger.kernel.org
1224612256 W: https://linuxtv.org
@@ -12479,6 +12489,7 @@ F: drivers/scsi/st_*.h · 232 unmodified lines
1247912489 SCTP PROTOCOL
1248012490 M: Vlad Yasevich <vyasevich@gmail.com>
1248112491 M: Neil Horman <nhorman@tuxdriver.com>
12492+M: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
1248212493 L: linux-sctp@vger.kernel.org
1248312494 W: http://lksctp.sourceforge.net
1248412495 S: Maintained
@@ -12744,7 +12755,6 @@ S: Maintained · 259 unmodified lines
1274412755 F: drivers/media/radio/si4713/radio-usb-si4713.c
1274512756
1274612757 SIANO DVB DRIVER
12747−M: Mauro Carvalho Chehab <mchehab@s-opensource.com>
1274812758 M: Mauro Carvalho Chehab <mchehab@kernel.org>
1274912759 L: linux-media@vger.kernel.org
1275012760 W: https://linuxtv.org
@@ -12816,7 +12826,8 @@ F: include/linux/siphash.h · 65 unmodified lines
1281612826
1281712827 SIOX
1281812828 M: Gavin Schenk <g.schenk@eckelmann.de>
12819−M: Uwe Kleine-König <kernel@pengutronix.de>
12829+M: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
12830+R: Pengutronix Kernel Team <kernel@pengutronix.de>
1282012831 S: Supported
1282112832 F: drivers/siox/*
1282212833 F: include/trace/events/siox.h
@@ -13734,7 +13745,6 @@ S: Maintained · 911 unmodified lines
1373413745 F: drivers/media/i2c/tda9840*
1373513746
1373613747 TEA5761 TUNER DRIVER
13737−M: Mauro Carvalho Chehab <mchehab@s-opensource.com>
1373813748 M: Mauro Carvalho Chehab <mchehab@kernel.org>
1373913749 L: linux-media@vger.kernel.org
1374013750 W: https://linuxtv.org
@@ -13743,7 +13753,6 @@ S: Odd fixes · 2 unmodified lines
1374313753 F: drivers/media/tuners/tea5761.*
1374413754
1374513755 TEA5767 TUNER DRIVER
13746−M: Mauro Carvalho Chehab <mchehab@s-opensource.com>
1374713756 M: Mauro Carvalho Chehab <mchehab@kernel.org>
1374813757 L: linux-media@vger.kernel.org
1374913758 W: https://linuxtv.org
@@ -13833,7 +13842,6 @@ S: Supported · 83 unmodified lines
1383313842 F: drivers/iommu/tegra*
1383413843
1383513844 TEGRA KBC DRIVER
13836−M: Rakesh Iyer <riyer@nvidia.com>
1383713845 M: Laxman Dewangan <ldewangan@nvidia.com>
1383813846 S: Supported
1383913847 F: drivers/input/keyboard/tegra-kbc.c
@@ -13936,7 +13944,7 @@ THUNDERBOLT DRIVER · 96 unmodified lines
1393613944 M: Andreas Noever <andreas.noever@gmail.com>
1393713945 M: Michael Jamet <michael.jamet@intel.com>
1393813946 M: Mika Westerberg <mika.westerberg@linux.intel.com>
13939−M: Yehezkel Bernat <yehezkel.bernat@intel.com>
13947+M: Yehezkel Bernat <YehezkelShB@gmail.com>
1394013948 T: git git://git.kernel.org/pub/scm/linux/kernel/git/westeri/thunderbolt.git
1394113949 S: Maintained
1394213950 F: Documentation/admin-guide/thunderbolt.rst
@@ -13946,7 +13954,7 @@ F: include/linux/thunderbolt.h · 3 unmodified lines
1394613954 THUNDERBOLT NETWORK DRIVER
1394713955 M: Michael Jamet <michael.jamet@intel.com>
1394813956 M: Mika Westerberg <mika.westerberg@linux.intel.com>
13949−M: Yehezkel Bernat <yehezkel.bernat@intel.com>
13957+M: Yehezkel Bernat <YehezkelShB@gmail.com>
1395013958 L: netdev@vger.kernel.org
1395113959 S: Maintained
1395213960 F: drivers/net/thunderbolt.c
@@ -14160,7 +14168,6 @@ F: Documentation/networking/tlan.txt · 207 unmodified lines
1416014168 F: drivers/net/ethernet/ti/tlan.*
1416114169
1416214170 TM6000 VIDEO4LINUX DRIVER
14163−M: Mauro Carvalho Chehab <mchehab@s-opensource.com>
1416414171 M: Mauro Carvalho Chehab <mchehab@kernel.org>
1416514172 L: linux-media@vger.kernel.org
1416614173 W: https://linuxtv.org
@@ -15393,7 +15400,6 @@ S: Maintained · 1226 unmodified lines
1539315400 F: arch/x86/entry/vdso/
1539415401
1539515402 XC2028/3028 TUNER DRIVER
15396−M: Mauro Carvalho Chehab <mchehab@s-opensource.com>
1539715403 M: Mauro Carvalho Chehab <mchehab@kernel.org>
1539815404 L: linux-media@vger.kernel.org
1539915405 W: https://linuxtv.org
Makefile+2−2
@@ -2,8 +2,8 @@ · 1 unmodified line
22 VERSION = 4
33 PATCHLEVEL = 17
44 SUBLEVEL = 0
5−EXTRAVERSION = -rc1
6−NAME = Fearless Coyote
5+EXTRAVERSION = -rc4
6+NAME = Merciless Moray
77
88 # *DOCUMENTATION*
99 # To see a list of typical targets execute "make help"
arch/arm/boot/dts/gemini-nas4220b.dts+14−14
@@ -134,37 +134,37 @@ · 133 unmodified lines
134134 function = "gmii";
135135 groups = "gmii_gmac0_grp";
136136 };
137− /* Settings come from OpenWRT */
137+ /* Settings come from OpenWRT, pins on SL3516 */
138138 conf0 {
139− pins = "R8 GMAC0 RXDV", "U11 GMAC1 RXDV";
139+ pins = "V8 GMAC0 RXDV", "T10 GMAC1 RXDV";
140140 skew-delay = <0>;
141141 };
142142 conf1 {
143− pins = "T8 GMAC0 RXC", "T11 GMAC1 RXC";
143+ pins = "Y7 GMAC0 RXC", "Y11 GMAC1 RXC";
144144 skew-delay = <15>;
145145 };
146146 conf2 {
147− pins = "P8 GMAC0 TXEN", "V11 GMAC1 TXEN";
147+ pins = "T8 GMAC0 TXEN", "W11 GMAC1 TXEN";
148148 skew-delay = <7>;
149149 };
150150 conf3 {
151− pins = "V7 GMAC0 TXC";
151+ pins = "U8 GMAC0 TXC";
152152 skew-delay = <11>;
153153 };
154154 conf4 {
155− pins = "P10 GMAC1 TXC";
155+ pins = "V11 GMAC1 TXC";
156156 skew-delay = <10>;
157157 };
158158 conf5 {
159159 /* The data lines all have default skew */
160− pins = "U8 GMAC0 RXD0", "V8 GMAC0 RXD1",
161− "P9 GMAC0 RXD2", "R9 GMAC0 RXD3",
162− "U7 GMAC0 TXD0", "T7 GMAC0 TXD1",
163− "R7 GMAC0 TXD2", "P7 GMAC0 TXD3",
164− "R11 GMAC1 RXD0", "P11 GMAC1 RXD1",
165− "V12 GMAC1 RXD2", "U12 GMAC1 RXD3",
166− "R10 GMAC1 TXD0", "T10 GMAC1 TXD1",
167− "U10 GMAC1 TXD2", "V10 GMAC1 TXD3";
160+ pins = "W8 GMAC0 RXD0", "V9 GMAC0 RXD1",
161+ "Y8 GMAC0 RXD2", "U9 GMAC0 RXD3",
162+ "T7 GMAC0 TXD0", "U6 GMAC0 TXD1",
163+ "V7 GMAC0 TXD2", "U7 GMAC0 TXD3",
164+ "Y12 GMAC1 RXD0", "V12 GMAC1 RXD1",
165+ "T11 GMAC1 RXD2", "W12 GMAC1 RXD3",
166+ "U10 GMAC1 TXD0", "Y10 GMAC1 TXD1",
167+ "W10 GMAC1 TXD2", "T9 GMAC1 TXD3";
168168 skew-delay = <7>;
169169 };
170170 /* Set up drive strength on GMAC0 to 16 mA */
arch/arm/boot/dts/omap4.dtsi+4−4
@@ -163,10 +163,10 @@ · 162 unmodified lines
163163
164164 cm2: cm2@8000 {
165165 compatible = "ti,omap4-cm2", "simple-bus";
166− reg = <0x8000 0x3000>;
166+ reg = <0x8000 0x2000>;
167167 #address-cells = <1>;
168168 #size-cells = <1>;
169− ranges = <0 0x8000 0x3000>;
169+ ranges = <0 0x8000 0x2000>;
170170
171171 cm2_clocks: clocks {
172172 #address-cells = <1>;
@@ -250,11 +250,11 @@ · 77 unmodified lines
250250
251251 prm: prm@6000 {
252252 compatible = "ti,omap4-prm";
253− reg = <0x6000 0x3000>;
253+ reg = <0x6000 0x2000>;
254254 interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>;
255255 #address-cells = <1>;
256256 #size-cells = <1>;
257− ranges = <0 0x6000 0x3000>;
257+ ranges = <0 0x6000 0x2000>;
258258
259259 prm_clocks: clocks {
260260 #address-cells = <1>;
arch/arm/configs/gemini_defconfig+25−2
@@ -1,6 +1,7 @@
11 # CONFIG_LOCALVERSION_AUTO is not set
22 CONFIG_SYSVIPC=y
33 CONFIG_NO_HZ_IDLE=y
4+CONFIG_HIGH_RES_TIMERS=y
45 CONFIG_BSD_PROCESS_ACCT=y
56 CONFIG_USER_NS=y
67 CONFIG_RELAY=y
@@ -12,15 +13,21 @@ CONFIG_ARCH_GEMINI=y · 5 unmodified lines
1213 CONFIG_PCI=y
1314 CONFIG_PREEMPT=y
1415 CONFIG_AEABI=y
16+CONFIG_HIGHMEM=y
17+CONFIG_CMA=y
1518 CONFIG_CMDLINE="console=ttyS0,115200n8"
1619 CONFIG_KEXEC=y
1720 CONFIG_BINFMT_MISC=y
1821 CONFIG_PM=y
22+CONFIG_NET=y
23+CONFIG_UNIX=y
24+CONFIG_INET=y
1925 CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
2026 CONFIG_DEVTMPFS=y
2127 CONFIG_MTD=y
2228 CONFIG_MTD_BLOCK=y
2329 CONFIG_MTD_CFI=y
30+CONFIG_MTD_JEDECPROBE=y
2431 CONFIG_MTD_CFI_INTELEXT=y
2532 CONFIG_MTD_CFI_AMDSTD=y
2633 CONFIG_MTD_CFI_STAA=y
@@ -33,6 +40,11 @@ CONFIG_BLK_DEV_SD=y · 6 unmodified lines
3340 # CONFIG_SCSI_LOWLEVEL is not set
3441 CONFIG_ATA=y
3542 CONFIG_PATA_FTIDE010=y
43+CONFIG_NETDEVICES=y
44+CONFIG_GEMINI_ETHERNET=y
45+CONFIG_MDIO_BITBANG=y
46+CONFIG_MDIO_GPIO=y
47+CONFIG_REALTEK_PHY=y
3648 CONFIG_INPUT_EVDEV=y
3749 CONFIG_KEYBOARD_GPIO=y
3850 # CONFIG_INPUT_MOUSE is not set
@@ -43,9 +55,19 @@ CONFIG_SERIAL_8250_NR_UARTS=1 · 4 unmodified lines
4355 CONFIG_SERIAL_8250_RUNTIME_UARTS=1
4456 CONFIG_SERIAL_OF_PLATFORM=y
4557 # CONFIG_HW_RANDOM is not set
46−# CONFIG_HWMON is not set
58+CONFIG_I2C_GPIO=y
59+CONFIG_SPI=y
60+CONFIG_SPI_GPIO=y
61+CONFIG_SENSORS_GPIO_FAN=y
62+CONFIG_SENSORS_LM75=y
63+CONFIG_THERMAL=y
4764 CONFIG_WATCHDOG=y
48−CONFIG_GEMINI_WATCHDOG=y
65+CONFIG_REGULATOR=y
66+CONFIG_REGULATOR_FIXED_VOLTAGE=y
67+CONFIG_DRM=y
68+CONFIG_DRM_PANEL_ILITEK_IL9322=y
69+CONFIG_DRM_TVE200=y
70+CONFIG_LOGO=y
4971 CONFIG_USB=y
5072 CONFIG_USB_MON=y
5173 CONFIG_USB_FOTG210_HCD=y
@@ -54,6 +76,7 @@ CONFIG_NEW_LEDS=y · 2 unmodified lines
5476 CONFIG_LEDS_CLASS=y
5577 CONFIG_LEDS_GPIO=y
5678 CONFIG_LEDS_TRIGGERS=y
79+CONFIG_LEDS_TRIGGER_DISK=y
5780 CONFIG_LEDS_TRIGGER_HEARTBEAT=y
5881 CONFIG_RTC_CLASS=y
5982 CONFIG_DMADEVICES=y
arch/arm/configs/socfpga_defconfig+1−0
@@ -57,6 +57,7 @@ CONFIG_MTD_M25P80=y · 56 unmodified lines
5757 CONFIG_MTD_NAND=y
5858 CONFIG_MTD_NAND_DENALI_DT=y
5959 CONFIG_MTD_SPI_NOR=y
60+# CONFIG_MTD_SPI_NOR_USE_4K_SECTORS is not set
6061 CONFIG_SPI_CADENCE_QUADSPI=y
6162 CONFIG_OF_OVERLAY=y
6263 CONFIG_OF_CONFIGFS=y
arch/arm/include/asm/kvm_host.h+3−0
@@ -77,6 +77,9 @@ struct kvm_arch { · 76 unmodified lines
7777 /* Interrupt controller */
7878 struct vgic_dist vgic;
7979 int max_vcpus;
80+
81+ /* Mandated version of PSCI */
82+ u32 psci_version;
8083 };
8184
8285 #define KVM_NR_MEM_OBJS 40
arch/arm/include/uapi/asm/kvm.h+6−0
@@ -195,6 +195,12 @@ struct kvm_arch_memory_slot { · 194 unmodified lines
195195 #define KVM_REG_ARM_VFP_FPINST 0x1009
196196 #define KVM_REG_ARM_VFP_FPINST2 0x100A
197197
198+/* KVM-as-firmware specific pseudo-registers */
199+#define KVM_REG_ARM_FW (0x0014 << KVM_REG_ARM_COPROC_SHIFT)
200+#define KVM_REG_ARM_FW_REG(r) (KVM_REG_ARM | KVM_REG_SIZE_U64 | \
201+ KVM_REG_ARM_FW | ((r) & 0xffff))
202+#define KVM_REG_ARM_PSCI_VERSION KVM_REG_ARM_FW_REG(0)
203+
198204 /* Device Control API: ARM VGIC */
199205 #define KVM_DEV_ARM_VGIC_GRP_ADDR 0
200206 #define KVM_DEV_ARM_VGIC_GRP_DIST_REGS 1
arch/arm/kvm/guest.c+13−0
@@ -22,6 +22,7 @@ · 21 unmodified lines
2222 #include <linux/module.h>
2323 #include <linux/vmalloc.h>
2424 #include <linux/fs.h>
25+#include <kvm/arm_psci.h>
2526 #include <asm/cputype.h>
2627 #include <linux/uaccess.h>
2728 #include <asm/kvm.h>
@@ -176,6 +177,7 @@ static unsigned long num_core_regs(void) · 148 unmodified lines
176177 unsigned long kvm_arm_num_regs(struct kvm_vcpu *vcpu)
177178 {
178179 return num_core_regs() + kvm_arm_num_coproc_regs(vcpu)
180+ + kvm_arm_get_fw_num_regs(vcpu)
179181 + NUM_TIMER_REGS;
180182 }
181183
@@ -196,6 +198,11 @@ int kvm_arm_copy_reg_indices(struct kvm_vcpu *vcpu, u64 __user *uindices) · 14 unmodified lines
196198 uindices++;
197199 }
198200
201+ ret = kvm_arm_copy_fw_reg_indices(vcpu, uindices);
202+ if (ret)
203+ return ret;
204+ uindices += kvm_arm_get_fw_num_regs(vcpu);
205+
199206 ret = copy_timer_indices(vcpu, uindices);
200207 if (ret)
201208 return ret;
@@ -214,6 +221,9 @@ int kvm_arm_get_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg) · 12 unmodified lines
214221 if ((reg->id & KVM_REG_ARM_COPROC_MASK) == KVM_REG_ARM_CORE)
215222 return get_core_reg(vcpu, reg);
216223
224+ if ((reg->id & KVM_REG_ARM_COPROC_MASK) == KVM_REG_ARM_FW)
225+ return kvm_arm_get_fw_reg(vcpu, reg);
226+
217227 if (is_timer_reg(reg->id))
218228 return get_timer_reg(vcpu, reg);
219229
@@ -230,6 +240,9 @@ int kvm_arm_set_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg) · 10 unmodified lines
230240 if ((reg->id & KVM_REG_ARM_COPROC_MASK) == KVM_REG_ARM_CORE)
231241 return set_core_reg(vcpu, reg);
232242
243+ if ((reg->id & KVM_REG_ARM_COPROC_MASK) == KVM_REG_ARM_FW)
244+ return kvm_arm_set_fw_reg(vcpu, reg);
245+
233246 if (is_timer_reg(reg->id))
234247 return set_timer_reg(vcpu, reg);
235248
arch/arm/mach-omap2/Makefile+1−5
@@ -243,8 +243,4 @@ arch/arm/mach-omap2/pm-asm-offsets.s: arch/arm/mach-omap2/pm-asm-offsets.c · 242 unmodified lines
243243 include/generated/ti-pm-asm-offsets.h: arch/arm/mach-omap2/pm-asm-offsets.s FORCE
244244 $(call filechk,offsets,__TI_PM_ASM_OFFSETS_H__)
245245
246−# For rule to generate ti-emif-asm-offsets.h dependency
247−include drivers/memory/Makefile.asm-offsets
248−
249−arch/arm/mach-omap2/sleep33xx.o: include/generated/ti-pm-asm-offsets.h include/generated/ti-emif-asm-offsets.h
250−arch/arm/mach-omap2/sleep43xx.o: include/generated/ti-pm-asm-offsets.h include/generated/ti-emif-asm-offsets.h
246+$(obj)/sleep33xx.o $(obj)/sleep43xx.o: include/generated/ti-pm-asm-offsets.h
arch/arm/mach-omap2/pm-asm-offsets.c+3−0
@@ -7,9 +7,12 @@ · 6 unmodified lines
77
88 #include <linux/kbuild.h>
99 #include <linux/platform_data/pm33xx.h>
10+#include <linux/ti-emif-sram.h>
1011
1112 int main(void)
1213 {
14+ ti_emif_asm_offsets();
15+
1316 DEFINE(AMX3_PM_WFI_FLAGS_OFFSET,
1417 offsetof(struct am33xx_pm_sram_data, wfi_flags));
1518 DEFINE(AMX3_PM_L2_AUX_CTRL_VAL_OFFSET,
arch/arm/mach-omap2/sleep33xx.S+0−1
@@ -6,7 +6,6 @@ · 5 unmodified lines
66 * Dave Gerlach, Vaibhav Bedia
77 */
88
9−#include <generated/ti-emif-asm-offsets.h>
109 #include <generated/ti-pm-asm-offsets.h>
1110 #include <linux/linkage.h>
1211 #include <linux/ti-emif-sram.h>
arch/arm/mach-omap2/sleep43xx.S+0−1
@@ -6,7 +6,6 @@ · 5 unmodified lines
66 * Dave Gerlach, Vaibhav Bedia
77 */
88
9−#include <generated/ti-emif-asm-offsets.h>
109 #include <generated/ti-pm-asm-offsets.h>
1110 #include <linux/linkage.h>
1211 #include <linux/ti-emif-sram.h>
arch/arm/mach-s3c24xx/mach-jive.c+2−2
@@ -427,9 +427,9 @@ static struct gpiod_lookup_table jive_wm8750_gpiod_table = { · 426 unmodified lines
427427 .dev_id = "spi_gpio",
428428 .table = {
429429 GPIO_LOOKUP("GPIOB", 4,
430− "gpio-sck", GPIO_ACTIVE_HIGH),
430+ "sck", GPIO_ACTIVE_HIGH),
431431 GPIO_LOOKUP("GPIOB", 9,
432− "gpio-mosi", GPIO_ACTIVE_HIGH),
432+ "mosi", GPIO_ACTIVE_HIGH),
433433 GPIO_LOOKUP("GPIOH", 10,
434434 "cs", GPIO_ACTIVE_HIGH),
435435 { },
arch/arm64/Makefile+4−0
@@ -56,7 +56,11 @@ KBUILD_AFLAGS += $(lseinstr) $(brokengasinst) · 55 unmodified lines
5656 KBUILD_CFLAGS += $(call cc-option,-mabi=lp64)
5757 KBUILD_AFLAGS += $(call cc-option,-mabi=lp64)
5858
59+ifeq ($(cc-name),clang)
60+KBUILD_CFLAGS += -DCONFIG_ARCH_SUPPORTS_INT128
61+else
5962 KBUILD_CFLAGS += $(call cc-ifversion, -ge, 0500, -DCONFIG_ARCH_SUPPORTS_INT128)
63+endif
6064
6165 ifeq ($(CONFIG_CPU_BIG_ENDIAN), y)
6266 KBUILD_CPPFLAGS += -mbig-endian
arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi+4−0
@@ -212,3 +212,7 @@ · 211 unmodified lines
212212 pinctrl-0 = <&uart_ao_a_pins>;
213213 pinctrl-names = "default";
214214 };
215+
216+&usb0 {
217+ status = "okay";
218+};
arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts+12−0
@@ -271,3 +271,15 @@ · 270 unmodified lines
271271 pinctrl-0 = <&uart_ao_a_pins>;
272272 pinctrl-names = "default";
273273 };
274+
275+&usb0 {
276+ status = "okay";
277+};
278+
279+&usb2_phy0 {
280+ /*
281+ * even though the schematics don't show it:
282+ * HDMI_5V is also used as supply for the USB VBUS.
283+ */
284+ phy-supply = <&hdmi_5v>;
285+};
arch/arm64/boot/dts/amlogic/meson-gxl-s905x-nexbox-a95x.dts+4−0
@@ -215,3 +215,7 @@ · 214 unmodified lines
215215 pinctrl-0 = <&uart_ao_a_pins>;
216216 pinctrl-names = "default";
217217 };
218+
219+&usb0 {
220+ status = "okay";
221+};
arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dtsi+4−0
@@ -185,3 +185,7 @@ · 184 unmodified lines
185185 pinctrl-0 = <&uart_ao_a_pins>;
186186 pinctrl-names = "default";
187187 };
188+
189+&usb0 {
190+ status = "okay";
191+};
arch/arm64/boot/dts/amlogic/meson-gxl.dtsi+61−0
@@ -20,6 +20,67 @@ · 19 unmodified lines
2020 no-map;
2121 };
2222 };
23+
24+ soc {
25+ usb0: usb@c9000000 {
26+ status = "disabled";
27+ compatible = "amlogic,meson-gxl-dwc3";
28+ #address-cells = <2>;
29+ #size-cells = <2>;
30+ ranges;
31+
32+ clocks = <&clkc CLKID_USB>;
33+ clock-names = "usb_general";
34+ resets = <&reset RESET_USB_OTG>;
35+ reset-names = "usb_otg";
36+
37+ dwc3: dwc3@c9000000 {
38+ compatible = "snps,dwc3";
39+ reg = <0x0 0xc9000000 0x0 0x100000>;
40+ interrupts = <GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>;
41+ dr_mode = "host";
42+ maximum-speed = "high-speed";
43+ snps,dis_u2_susphy_quirk;
44+ phys = <&usb3_phy>, <&usb2_phy0>, <&usb2_phy1>;
45+ };
46+ };
47+ };
48+};
49+
50+&apb {
51+ usb2_phy0: phy@78000 {
52+ compatible = "amlogic,meson-gxl-usb2-phy";
53+ #phy-cells = <0>;
54+ reg = <0x0 0x78000 0x0 0x20>;
55+ clocks = <&clkc CLKID_USB>;
56+ clock-names = "phy";
57+ resets = <&reset RESET_USB_OTG>;
58+ reset-names = "phy";
59+ status = "okay";
60+ };
61+
62+ usb2_phy1: phy@78020 {
63+ compatible = "amlogic,meson-gxl-usb2-phy";
64+ #phy-cells = <0>;
65+ reg = <0x0 0x78020 0x0 0x20>;
66+ clocks = <&clkc CLKID_USB>;
67+ clock-names = "phy";
68+ resets = <&reset RESET_USB_OTG>;
69+ reset-names = "phy";
70+ status = "okay";
71+ };
72+
73+ usb3_phy: phy@78080 {
74+ compatible = "amlogic,meson-gxl-usb3-phy";
75+ #phy-cells = <0>;
76+ reg = <0x0 0x78080 0x0 0x20>;
77+ interrupts = <GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>;
78+ clocks = <&clkc CLKID_USB>, <&clkc_AO CLKID_AO_CEC_32K>;
79+ clock-names = "phy", "peripheral";
80+ resets = <&reset RESET_USB_OTG>, <&reset RESET_USB_OTG>;
81+ reset-names = "phy", "peripheral";
82+ status = "okay";
83+ };
2384 };
2485
2586 &ethmac {
arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts+4−0
@@ -406,3 +406,7 @@ · 405 unmodified lines
406406 status = "okay";
407407 vref-supply = <&vddio_ao18>;
408408 };
409+
410+&usb0 {
411+ status = "okay";
412+};
arch/arm64/boot/dts/amlogic/meson-gxm.dtsi+17−0
@@ -80,6 +80,19 @@ · 79 unmodified lines
8080 };
8181 };
8282
83+&apb {
84+ usb2_phy2: phy@78040 {
85+ compatible = "amlogic,meson-gxl-usb2-phy";
86+ #phy-cells = <0>;
87+ reg = <0x0 0x78040 0x0 0x20>;
88+ clocks = <&clkc CLKID_USB>;
89+ clock-names = "phy";
90+ resets = <&reset RESET_USB_OTG>;
91+ reset-names = "phy";
92+ status = "okay";
93+ };
94+};
95+
8396 &clkc_AO {
8497 compatible = "amlogic,meson-gxm-aoclkc", "amlogic,meson-gx-aoclkc";
8598 };
@@ -100,3 +113,7 @@ · 14 unmodified lines
100113 &hdmi_tx {
101114 compatible = "amlogic,meson-gxm-dw-hdmi", "amlogic,meson-gx-dw-hdmi";
102115 };
116+
117+&dwc3 {
118+ phys = <&usb3_phy>, <&usb2_phy0>, <&usb2_phy1>, <&usb2_phy2>;
119+};
arch/arm64/boot/dts/arm/juno-motherboard.dtsi+0−2
@@ -56,8 +56,6 @@ · 55 unmodified lines
5656
5757 gpio_keys {
5858 compatible = "gpio-keys";
59− #address-cells = <1>;
60− #size-cells = <0>;
6159
6260 power-button {
6361 debounce_interval = <50>;
arch/arm64/boot/dts/broadcom/stingray/stingray-sata.dtsi+40−40
@@ -36,11 +36,11 @@ · 35 unmodified lines
3636 #size-cells = <1>;
3737 ranges = <0x0 0x0 0x67d00000 0x00800000>;
3838
39− sata0: ahci@210000 {
39+ sata0: ahci@0 {
4040 compatible = "brcm,iproc-ahci", "generic-ahci";
41− reg = <0x00210000 0x1000>;
41+ reg = <0x00000000 0x1000>;
4242 reg-names = "ahci";
43− interrupts = <GIC_SPI 339 IRQ_TYPE_LEVEL_HIGH>;
43+ interrupts = <GIC_SPI 321 IRQ_TYPE_LEVEL_HIGH>;
4444 #address-cells = <1>;
4545 #size-cells = <0>;
4646 status = "disabled";
@@ -52,9 +52,9 @@ · 5 unmodified lines
5252 };
5353 };
5454
55− sata_phy0: sata_phy@212100 {
55+ sata_phy0: sata_phy@2100 {
5656 compatible = "brcm,iproc-sr-sata-phy";
57− reg = <0x00212100 0x1000>;
57+ reg = <0x00002100 0x1000>;
5858 reg-names = "phy";
5959 #address-cells = <1>;
6060 #size-cells = <0>;
@@ -66,11 +66,11 @@ · 5 unmodified lines
6666 };
6767 };
6868
69− sata1: ahci@310000 {
69+ sata1: ahci@10000 {
7070 compatible = "brcm,iproc-ahci", "generic-ahci";
71− reg = <0x00310000 0x1000>;
71+ reg = <0x00010000 0x1000>;
7272 reg-names = "ahci";
73− interrupts = <GIC_SPI 347 IRQ_TYPE_LEVEL_HIGH>;
73+ interrupts = <GIC_SPI 323 IRQ_TYPE_LEVEL_HIGH>;
7474 #address-cells = <1>;
7575 #size-cells = <0>;
7676 status = "disabled";
@@ -82,9 +82,9 @@ · 5 unmodified lines
8282 };
8383 };
8484
85− sata_phy1: sata_phy@312100 {
85+ sata_phy1: sata_phy@12100 {
8686 compatible = "brcm,iproc-sr-sata-phy";
87− reg = <0x00312100 0x1000>;
87+ reg = <0x00012100 0x1000>;
8888 reg-names = "phy";
8989 #address-cells = <1>;
9090 #size-cells = <0>;
@@ -96,11 +96,11 @@ · 5 unmodified lines
9696 };
9797 };
9898
99− sata2: ahci@120000 {
99+ sata2: ahci@20000 {
100100 compatible = "brcm,iproc-ahci", "generic-ahci";
101− reg = <0x00120000 0x1000>;
101+ reg = <0x00020000 0x1000>;
102102 reg-names = "ahci";
103− interrupts = <GIC_SPI 333 IRQ_TYPE_LEVEL_HIGH>;
103+ interrupts = <GIC_SPI 325 IRQ_TYPE_LEVEL_HIGH>;
104104 #address-cells = <1>;
105105 #size-cells = <0>;
106106 status = "disabled";
@@ -112,9 +112,9 @@ · 5 unmodified lines
112112 };
113113 };
114114
115− sata_phy2: sata_phy@122100 {
115+ sata_phy2: sata_phy@22100 {
116116 compatible = "brcm,iproc-sr-sata-phy";
117− reg = <0x00122100 0x1000>;
117+ reg = <0x00022100 0x1000>;
118118 reg-names = "phy";
119119 #address-cells = <1>;
120120 #size-cells = <0>;
@@ -126,11 +126,11 @@ · 5 unmodified lines
126126 };
127127 };
128128
129− sata3: ahci@130000 {
129+ sata3: ahci@30000 {
130130 compatible = "brcm,iproc-ahci", "generic-ahci";
131− reg = <0x00130000 0x1000>;
131+ reg = <0x00030000 0x1000>;
132132 reg-names = "ahci";
133− interrupts = <GIC_SPI 335 IRQ_TYPE_LEVEL_HIGH>;
133+ interrupts = <GIC_SPI 327 IRQ_TYPE_LEVEL_HIGH>;
134134 #address-cells = <1>;
135135 #size-cells = <0>;
136136 status = "disabled";
@@ -142,9 +142,9 @@ · 5 unmodified lines
142142 };
143143 };
144144
145− sata_phy3: sata_phy@132100 {
145+ sata_phy3: sata_phy@32100 {
146146 compatible = "brcm,iproc-sr-sata-phy";
147− reg = <0x00132100 0x1000>;
147+ reg = <0x00032100 0x1000>;
148148 reg-names = "phy";
149149 #address-cells = <1>;
150150 #size-cells = <0>;
@@ -156,11 +156,11 @@ · 5 unmodified lines
156156 };
157157 };
158158
159− sata4: ahci@330000 {
159+ sata4: ahci@100000 {
160160 compatible = "brcm,iproc-ahci", "generic-ahci";
161− reg = <0x00330000 0x1000>;
161+ reg = <0x00100000 0x1000>;
162162 reg-names = "ahci";
163− interrupts = <GIC_SPI 351 IRQ_TYPE_LEVEL_HIGH>;
163+ interrupts = <GIC_SPI 329 IRQ_TYPE_LEVEL_HIGH>;
164164 #address-cells = <1>;
165165 #size-cells = <0>;
166166 status = "disabled";
@@ -172,9 +172,9 @@ · 5 unmodified lines
172172 };
173173 };
174174
175− sata_phy4: sata_phy@332100 {
175+ sata_phy4: sata_phy@102100 {
176176 compatible = "brcm,iproc-sr-sata-phy";
177− reg = <0x00332100 0x1000>;
177+ reg = <0x00102100 0x1000>;
178178 reg-names = "phy";
179179 #address-cells = <1>;
180180 #size-cells = <0>;
@@ -186,11 +186,11 @@ · 5 unmodified lines
186186 };
187187 };
188188
189− sata5: ahci@400000 {
189+ sata5: ahci@110000 {
190190 compatible = "brcm,iproc-ahci", "generic-ahci";
191− reg = <0x00400000 0x1000>;
191+ reg = <0x00110000 0x1000>;
192192 reg-names = "ahci";
193− interrupts = <GIC_SPI 353 IRQ_TYPE_LEVEL_HIGH>;
193+ interrupts = <GIC_SPI 331 IRQ_TYPE_LEVEL_HIGH>;
194194 #address-cells = <1>;
195195 #size-cells = <0>;
196196 status = "disabled";
@@ -202,9 +202,9 @@ · 5 unmodified lines
202202 };
203203 };
204204
205− sata_phy5: sata_phy@402100 {
205+ sata_phy5: sata_phy@112100 {
206206 compatible = "brcm,iproc-sr-sata-phy";
207− reg = <0x00402100 0x1000>;
207+ reg = <0x00112100 0x1000>;
208208 reg-names = "phy";
209209 #address-cells = <1>;
210210 #size-cells = <0>;
@@ -216,11 +216,11 @@ · 5 unmodified lines
216216 };
217217 };
218218
219− sata6: ahci@410000 {
219+ sata6: ahci@120000 {
220220 compatible = "brcm,iproc-ahci", "generic-ahci";
221− reg = <0x00410000 0x1000>;
221+ reg = <0x00120000 0x1000>;
222222 reg-names = "ahci";
223− interrupts = <GIC_SPI 355 IRQ_TYPE_LEVEL_HIGH>;
223+ interrupts = <GIC_SPI 333 IRQ_TYPE_LEVEL_HIGH>;
224224 #address-cells = <1>;
225225 #size-cells = <0>;
226226 status = "disabled";
@@ -232,9 +232,9 @@ · 5 unmodified lines
232232 };
233233 };
234234
235− sata_phy6: sata_phy@412100 {
235+ sata_phy6: sata_phy@122100 {
236236 compatible = "brcm,iproc-sr-sata-phy";
237− reg = <0x00412100 0x1000>;
237+ reg = <0x00122100 0x1000>;
238238 reg-names = "phy";
239239 #address-cells = <1>;
240240 #size-cells = <0>;
@@ -246,11 +246,11 @@ · 5 unmodified lines
246246 };
247247 };
248248
249− sata7: ahci@420000 {
249+ sata7: ahci@130000 {
250250 compatible = "brcm,iproc-ahci", "generic-ahci";
251− reg = <0x00420000 0x1000>;
251+ reg = <0x00130000 0x1000>;
252252 reg-names = "ahci";
253− interrupts = <GIC_SPI 357 IRQ_TYPE_LEVEL_HIGH>;
253+ interrupts = <GIC_SPI 335 IRQ_TYPE_LEVEL_HIGH>;
254254 #address-cells = <1>;
255255 #size-cells = <0>;
256256 status = "disabled";
@@ -262,9 +262,9 @@ · 5 unmodified lines
262262 };
263263 };
264264
265− sata_phy7: sata_phy@422100 {
265+ sata_phy7: sata_phy@132100 {
266266 compatible = "brcm,iproc-sr-sata-phy";
267− reg = <0x00422100 0x1000>;
267+ reg = <0x00132100 0x1000>;
268268 reg-names = "phy";
269269 #address-cells = <1>;
270270 #size-cells = <0>;
arch/arm64/include/asm/kvm_emulate.h+1−1
@@ -333,7 +333,7 @@ static inline void kvm_vcpu_set_be(struct kvm_vcpu *vcpu) · 332 unmodified lines
333333 } else {
334334 u64 sctlr = vcpu_read_sys_reg(vcpu, SCTLR_EL1);
335335 sctlr |= (1 << 25);
336− vcpu_write_sys_reg(vcpu, SCTLR_EL1, sctlr);
336+ vcpu_write_sys_reg(vcpu, sctlr, SCTLR_EL1);
337337 }
338338 }
339339
arch/arm64/include/asm/kvm_host.h+3−0
@@ -75,6 +75,9 @@ struct kvm_arch { · 74 unmodified lines
7575
7676 /* Interrupt controller */
7777 struct vgic_dist vgic;
78+
79+ /* Mandated version of PSCI */
80+ u32 psci_version;
7881 };
7982
8083 #define KVM_NR_MEM_OBJS 40
arch/arm64/include/asm/module.h+1−1
@@ -39,7 +39,7 @@ struct mod_arch_specific { · 38 unmodified lines
3939 u64 module_emit_plt_entry(struct module *mod, void *loc, const Elf64_Rela *rela,
4040 Elf64_Sym *sym);
4141
42−u64 module_emit_adrp_veneer(struct module *mod, void *loc, u64 val);
42+u64 module_emit_veneer_for_adrp(struct module *mod, void *loc, u64 val);
4343
4444 #ifdef CONFIG_RANDOMIZE_BASE
4545 extern u64 module_alloc_base;
arch/arm64/include/asm/pgtable.h+2−2
@@ -230,7 +230,7 @@ static inline void set_pte(pte_t *ptep, pte_t pte) · 229 unmodified lines
230230 }
231231 }
232232
233−extern void __sync_icache_dcache(pte_t pteval, unsigned long addr);
233+extern void __sync_icache_dcache(pte_t pteval);
234234
235235 /*
236236 * PTE bits configuration in the presence of hardware Dirty Bit Management
@@ -253,7 +253,7 @@ static inline void set_pte_at(struct mm_struct *mm, unsigned long addr, · 16 unmodified lines
253253 pte_t old_pte;
254254
255255 if (pte_present(pte) && pte_user_exec(pte) && !pte_special(pte))
256− __sync_icache_dcache(pte, addr);
256+ __sync_icache_dcache(pte);
257257
258258 /*
259259 * If the existing pte is valid, check for potential race with
arch/arm64/include/uapi/asm/kvm.h+6−0
@@ -206,6 +206,12 @@ struct kvm_arch_memory_slot { · 205 unmodified lines
206206 #define KVM_REG_ARM_TIMER_CNT ARM64_SYS_REG(3, 3, 14, 3, 2)
207207 #define KVM_REG_ARM_TIMER_CVAL ARM64_SYS_REG(3, 3, 14, 0, 2)
208208
209+/* KVM-as-firmware specific pseudo-registers */
210+#define KVM_REG_ARM_FW (0x0014 << KVM_REG_ARM_COPROC_SHIFT)
211+#define KVM_REG_ARM_FW_REG(r) (KVM_REG_ARM64 | KVM_REG_SIZE_U64 | \
212+ KVM_REG_ARM_FW | ((r) & 0xffff))
213+#define KVM_REG_ARM_PSCI_VERSION KVM_REG_ARM_FW_REG(0)
214+
209215 /* Device Control API: ARM VGIC */
210216 #define KVM_DEV_ARM_VGIC_GRP_ADDR 0
211217 #define KVM_DEV_ARM_VGIC_GRP_DIST_REGS 1
arch/arm64/kernel/cpufeature.c+1−0
@@ -868,6 +868,7 @@ static bool unmap_kernel_at_el0(const struct arm64_cpu_capabilities *entry, · 867 unmodified lines
868868 static const struct midr_range kpti_safe_list[] = {
869869 MIDR_ALL_VERSIONS(MIDR_CAVIUM_THUNDERX2),
870870 MIDR_ALL_VERSIONS(MIDR_BRCM_VULCAN),
871+ { /* sentinel */ }
871872 };
872873 char const *str = "command line option";
873874
arch/arm64/kernel/module-plts.c+1−1
@@ -43,7 +43,7 @@ u64 module_emit_plt_entry(struct module *mod, void *loc, const Elf64_Rela *rela, · 42 unmodified lines
4343 }
4444
4545 #ifdef CONFIG_ARM64_ERRATUM_843419
46−u64 module_emit_adrp_veneer(struct module *mod, void *loc, u64 val)
46+u64 module_emit_veneer_for_adrp(struct module *mod, void *loc, u64 val)
4747 {
4848 struct mod_plt_sec *pltsec = !in_init(mod, loc) ? &mod->arch.core :
4949 &mod->arch.init;
arch/arm64/kernel/module.c+1−1
@@ -215,7 +215,7 @@ static int reloc_insn_adrp(struct module *mod, __le32 *place, u64 val) · 214 unmodified lines
215215 insn &= ~BIT(31);
216216 } else {
217217 /* out of range for ADR -> emit a veneer */
218− val = module_emit_adrp_veneer(mod, place, val & ~0xfff);
218+ val = module_emit_veneer_for_adrp(mod, place, val & ~0xfff);
219219 if (!val)
220220 return -ENOEXEC;
221221 insn = aarch64_insn_gen_branch_imm((u64)place, val,
arch/arm64/kernel/ptrace.c+10−10
@@ -25,6 +25,7 @@ · 24 unmodified lines
2525 #include <linux/sched/signal.h>
2626 #include <linux/sched/task_stack.h>
2727 #include <linux/mm.h>
28+#include <linux/nospec.h>
2829 #include <linux/smp.h>
2930 #include <linux/ptrace.h>
3031 #include <linux/user.h>
@@ -249,15 +250,20 @@ static struct perf_event *ptrace_hbp_get_event(unsigned int note_type, · 218 unmodified lines
249250
250251 switch (note_type) {
251252 case NT_ARM_HW_BREAK:
252− if (idx < ARM_MAX_BRP)
253− bp = tsk->thread.debug.hbp_break[idx];
253+ if (idx >= ARM_MAX_BRP)
254+ goto out;
255+ idx = array_index_nospec(idx, ARM_MAX_BRP);
256+ bp = tsk->thread.debug.hbp_break[idx];
254257 break;
255258 case NT_ARM_HW_WATCH:
256− if (idx < ARM_MAX_WRP)
257− bp = tsk->thread.debug.hbp_watch[idx];
259+ if (idx >= ARM_MAX_WRP)
260+ goto out;
261+ idx = array_index_nospec(idx, ARM_MAX_WRP);
262+ bp = tsk->thread.debug.hbp_watch[idx];
258263 break;
259264 }
260265
266+out:
261267 return bp;
262268 }
263269
@@ -1458,9 +1464,7 @@ static int compat_ptrace_gethbpregs(struct task_struct *tsk, compat_long_t num, · 1194 unmodified lines
14581464 {
14591465 int ret;
14601466 u32 kdata;
1461− mm_segment_t old_fs = get_fs();
14621467
1463− set_fs(KERNEL_DS);
14641468 /* Watchpoint */
14651469 if (num < 0) {
14661470 ret = compat_ptrace_hbp_get(NT_ARM_HW_WATCH, tsk, num, &kdata);
@@ -1471,7 +1475,6 @@ static int compat_ptrace_gethbpregs(struct task_struct *tsk, compat_long_t num, · 4 unmodified lines
14711475 } else {
14721476 ret = compat_ptrace_hbp_get(NT_ARM_HW_BREAK, tsk, num, &kdata);
14731477 }
1474− set_fs(old_fs);
14751478
14761479 if (!ret)
14771480 ret = put_user(kdata, data);
@@ -1484,7 +1487,6 @@ static int compat_ptrace_sethbpregs(struct task_struct *tsk, compat_long_t num, · 6 unmodified lines
14841487 {
14851488 int ret;
14861489 u32 kdata = 0;
1487− mm_segment_t old_fs = get_fs();
14881490
14891491 if (num == 0)
14901492 return 0;
@@ -1493,12 +1495,10 @@ static int compat_ptrace_sethbpregs(struct task_struct *tsk, compat_long_t num, · 2 unmodified lines
14931495 if (ret)
14941496 return ret;
14951497
1496− set_fs(KERNEL_DS);
14971498 if (num < 0)
14981499 ret = compat_ptrace_hbp_set(NT_ARM_HW_WATCH, tsk, num, &kdata);
14991500 else
15001501 ret = compat_ptrace_hbp_set(NT_ARM_HW_BREAK, tsk, num, &kdata);
1501− set_fs(old_fs);
15021502
15031503 return ret;
15041504 }
arch/arm64/kernel/traps.c+3−2
@@ -277,7 +277,8 @@ void arm64_skip_faulting_instruction(struct pt_regs *regs, unsigned long size) · 276 unmodified lines
277277 * If we were single stepping, we want to get the step exception after
278278 * we return from the trap.
279279 */
280− user_fastforward_single_step(current);
280+ if (user_mode(regs))
281+ user_fastforward_single_step(current);
281282 }
282283
283284 static LIST_HEAD(undef_hook);
@@ -366,7 +367,7 @@ void force_signal_inject(int signal, int code, unsigned long address) · 82 unmodified lines
366367 }
367368
368369 /* Force signals we don't understand to SIGKILL */
369− if (WARN_ON(signal != SIGKILL ||
370+ if (WARN_ON(signal != SIGKILL &&
370371 siginfo_layout(signal, code) != SIL_FAULT)) {
371372 signal = SIGKILL;
372373 }
arch/arm64/kvm/guest.c+13−1
@@ -25,6 +25,7 @@ · 24 unmodified lines
2525 #include <linux/module.h>
2626 #include <linux/vmalloc.h>
2727 #include <linux/fs.h>
28+#include <kvm/arm_psci.h>
2829 #include <asm/cputype.h>
2930 #include <linux/uaccess.h>
3031 #include <asm/kvm.h>
@@ -205,7 +206,7 @@ static int get_timer_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg) · 174 unmodified lines
205206 unsigned long kvm_arm_num_regs(struct kvm_vcpu *vcpu)
206207 {
207208 return num_core_regs() + kvm_arm_num_sys_reg_descs(vcpu)
208− + NUM_TIMER_REGS;
209+ + kvm_arm_get_fw_num_regs(vcpu) + NUM_TIMER_REGS;
209210 }
210211
211212 /**
@@ -225,6 +226,11 @@ int kvm_arm_copy_reg_indices(struct kvm_vcpu *vcpu, u64 __user *uindices) · 13 unmodified lines
225226 uindices++;
226227 }
227228
229+ ret = kvm_arm_copy_fw_reg_indices(vcpu, uindices);
230+ if (ret)
231+ return ret;
232+ uindices += kvm_arm_get_fw_num_regs(vcpu);
233+
228234 ret = copy_timer_indices(vcpu, uindices);
229235 if (ret)
230236 return ret;
@@ -243,6 +249,9 @@ int kvm_arm_get_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg) · 12 unmodified lines
243249 if ((reg->id & KVM_REG_ARM_COPROC_MASK) == KVM_REG_ARM_CORE)
244250 return get_core_reg(vcpu, reg);
245251
252+ if ((reg->id & KVM_REG_ARM_COPROC_MASK) == KVM_REG_ARM_FW)
253+ return kvm_arm_get_fw_reg(vcpu, reg);
254+
246255 if (is_timer_reg(reg->id))
247256 return get_timer_reg(vcpu, reg);
248257
@@ -259,6 +268,9 @@ int kvm_arm_set_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg) · 10 unmodified lines
259268 if ((reg->id & KVM_REG_ARM_COPROC_MASK) == KVM_REG_ARM_CORE)
260269 return set_core_reg(vcpu, reg);
261270
271+ if ((reg->id & KVM_REG_ARM_COPROC_MASK) == KVM_REG_ARM_FW)
272+ return kvm_arm_set_fw_reg(vcpu, reg);
273+
262274 if (is_timer_reg(reg->id))
263275 return set_timer_reg(vcpu, reg);
264276
arch/arm64/kvm/hyp/vgic-v2-cpuif-proxy.c+19−5
@@ -18,11 +18,20 @@ · 17 unmodified lines
1818 #include <linux/compiler.h>
1919 #include <linux/irqchip/arm-gic.h>
2020 #include <linux/kvm_host.h>
21+#include <linux/swab.h>
2122
2223 #include <asm/kvm_emulate.h>
2324 #include <asm/kvm_hyp.h>
2425 #include <asm/kvm_mmu.h>
2526
27+static bool __hyp_text __is_be(struct kvm_vcpu *vcpu)
28+{
29+ if (vcpu_mode_is_32bit(vcpu))
30+ return !!(read_sysreg_el2(spsr) & COMPAT_PSR_E_BIT);
31+
32+ return !!(read_sysreg(SCTLR_EL1) & SCTLR_ELx_EE);
33+}
34+
2635 /*
2736 * __vgic_v2_perform_cpuif_access -- perform a GICV access on behalf of the
2837 * guest.
@@ -64,14 +73,19 @@ int __hyp_text __vgic_v2_perform_cpuif_access(struct kvm_vcpu *vcpu) · 35 unmodified lines
6473 addr += fault_ipa - vgic->vgic_cpu_base;
6574
6675 if (kvm_vcpu_dabt_iswrite(vcpu)) {
67− u32 data = vcpu_data_guest_to_host(vcpu,
68− vcpu_get_reg(vcpu, rd),
69− sizeof(u32));
76+ u32 data = vcpu_get_reg(vcpu, rd);
77+ if (__is_be(vcpu)) {
78+ /* guest pre-swabbed data, undo this for writel() */
79+ data = swab32(data);
80+ }
7081 writel_relaxed(data, addr);
7182 } else {
7283 u32 data = readl_relaxed(addr);
73− vcpu_set_reg(vcpu, rd, vcpu_data_host_to_guest(vcpu, data,
74− sizeof(u32)));
84+ if (__is_be(vcpu)) {
85+ /* guest expects swabbed data */
86+ data = swab32(data);
87+ }
88+ vcpu_set_reg(vcpu, rd, data);
7589 }
7690
7791 return 1;
arch/arm64/kvm/sys_regs.c+2−4
@@ -996,14 +996,12 @@ static u64 read_id_reg(struct sys_reg_desc const *r, bool raz) · 995 unmodified lines
996996
997997 if (id == SYS_ID_AA64PFR0_EL1) {
998998 if (val & (0xfUL << ID_AA64PFR0_SVE_SHIFT))
999− pr_err_once("kvm [%i]: SVE unsupported for guests, suppressing\n",
1000− task_pid_nr(current));
999+ kvm_debug("SVE unsupported for guests, suppressing\n");
10011000
10021001 val &= ~(0xfUL << ID_AA64PFR0_SVE_SHIFT);
10031002 } else if (id == SYS_ID_AA64MMFR1_EL1) {
10041003 if (val & (0xfUL << ID_AA64MMFR1_LOR_SHIFT))
1005− pr_err_once("kvm [%i]: LORegions unsupported for guests, suppressing\n",
1006− task_pid_nr(current));
1004+ kvm_debug("LORegions unsupported for guests, suppressing\n");
10071005
10081006 val &= ~(0xfUL << ID_AA64MMFR1_LOR_SHIFT);
10091007 }
arch/arm64/lib/Makefile+4−0
@@ -19,5 +19,9 @@ CFLAGS_atomic_ll_sc.o := -fcall-used-x0 -ffixed-x1 -ffixed-x2 \ · 18 unmodified lines
1919 -fcall-saved-x13 -fcall-saved-x14 -fcall-saved-x15 \
2020 -fcall-saved-x18 -fomit-frame-pointer
2121 CFLAGS_REMOVE_atomic_ll_sc.o := -pg
22+GCOV_PROFILE_atomic_ll_sc.o := n
23+KASAN_SANITIZE_atomic_ll_sc.o := n
24+KCOV_INSTRUMENT_atomic_ll_sc.o := n
25+UBSAN_SANITIZE_atomic_ll_sc.o := n
2226
2327 lib-$(CONFIG_ARCH_HAS_UACCESS_FLUSHCACHE) += uaccess_flushcache.o
arch/arm64/mm/flush.c+1−1
@@ -58,7 +58,7 @@ void copy_to_user_page(struct vm_area_struct *vma, struct page *page, · 57 unmodified lines
5858 flush_ptrace_access(vma, page, uaddr, dst, len);
5959 }
6060
61−void __sync_icache_dcache(pte_t pte, unsigned long addr)
61+void __sync_icache_dcache(pte_t pte)
6262 {
6363 struct page *page = pte_page(pte);
6464
arch/arm64/mm/kasan_init.c+2−2
@@ -204,7 +204,7 @@ void __init kasan_init(void) · 203 unmodified lines
204204 clear_pgds(KASAN_SHADOW_START, KASAN_SHADOW_END);
205205
206206 kasan_map_populate(kimg_shadow_start, kimg_shadow_end,
207− pfn_to_nid(virt_to_pfn(lm_alias(_text))));
207+ early_pfn_to_nid(virt_to_pfn(lm_alias(_text))));
208208
209209 kasan_populate_zero_shadow((void *)KASAN_SHADOW_START,
210210 (void *)mod_shadow_start);
@@ -224,7 +224,7 @@ void __init kasan_init(void) · 13 unmodified lines
224224
225225 kasan_map_populate((unsigned long)kasan_mem_to_shadow(start),
226226 (unsigned long)kasan_mem_to_shadow(end),
227− pfn_to_nid(virt_to_pfn(start)));
227+ early_pfn_to_nid(virt_to_pfn(start)));
228228 }
229229
230230 /*
arch/hexagon/include/asm/io.h+6−0
@@ -216,6 +216,12 @@ static inline void memcpy_toio(volatile void __iomem *dst, const void *src, · 215 unmodified lines
216216 memcpy((void *) dst, src, count);
217217 }
218218
219+static inline void memset_io(volatile void __iomem *addr, int value,
220+ size_t size)
221+{
222+ memset((void __force *)addr, value, size);
223+}
224+
219225 #define PCI_IO_ADDR (volatile void __iomem *)
220226
221227 /*
arch/hexagon/lib/checksum.c+1−0
@@ -199,3 +199,4 @@ csum_partial_copy_nocheck(const void *src, void *dst, int len, __wsum sum) · 198 unmodified lines
199199 memcpy(dst, src, len);
200200 return csum_partial(dst, len, sum);
201201 }
202+EXPORT_SYMBOL(csum_partial_copy_nocheck);
arch/mips/boot/dts/img/boston.dts+6−0
@@ -51,6 +51,8 @@ · 50 unmodified lines
5151 ranges = <0x02000000 0 0x40000000
5252 0x40000000 0 0x40000000>;
5353
54+ bus-range = <0x00 0xff>;
55+
5456 interrupt-map-mask = <0 0 0 7>;
5557 interrupt-map = <0 0 0 1 &pci0_intc 1>,
5658 <0 0 0 2 &pci0_intc 2>,
@@ -79,6 +81,8 @@ · 22 unmodified lines
7981 ranges = <0x02000000 0 0x20000000
8082 0x20000000 0 0x20000000>;
8183
84+ bus-range = <0x00 0xff>;
85+
8286 interrupt-map-mask = <0 0 0 7>;
8387 interrupt-map = <0 0 0 1 &pci1_intc 1>,
8488 <0 0 0 2 &pci1_intc 2>,
@@ -107,6 +111,8 @@ · 22 unmodified lines
107111 ranges = <0x02000000 0 0x16000000
108112 0x16000000 0 0x100000>;
109113
114+ bus-range = <0x00 0xff>;
115+
110116 interrupt-map-mask = <0 0 0 7>;
111117 interrupt-map = <0 0 0 1 &pci2_intc 1>,
112118 <0 0 0 2 &pci2_intc 2>,
arch/mips/include/asm/io.h+3−1
@@ -307,7 +307,7 @@ static inline void iounmap(const volatile void __iomem *addr) · 306 unmodified lines
307307 #if defined(CONFIG_CPU_CAVIUM_OCTEON) || defined(CONFIG_LOONGSON3_ENHANCEMENT)
308308 #define war_io_reorder_wmb() wmb()
309309 #else
310−#define war_io_reorder_wmb() do { } while (0)
310+#define war_io_reorder_wmb() barrier()
311311 #endif
312312
313313 #define __BUILD_MEMORY_SINGLE(pfx, bwlq, type, irq) \
@@ -377,6 +377,8 @@ static inline type pfx##read##bwlq(const volatile void __iomem *mem) \ · 63 unmodified lines
377377 BUG(); \
378378 } \
379379 \
380+ /* prevent prefetching of coherent DMA data prematurely */ \
381+ rmb(); \
380382 return pfx##ioswab##bwlq(__mem, __val); \
381383 }
382384
arch/mips/include/asm/uaccess.h+9−2
@@ -654,6 +654,13 @@ __clear_user(void __user *addr, __kernel_size_t size) · 653 unmodified lines
654654 {
655655 __kernel_size_t res;
656656
657+#ifdef CONFIG_CPU_MICROMIPS
658+/* micromips memset / bzero also clobbers t7 & t8 */
659+#define bzero_clobbers "$4", "$5", "$6", __UA_t0, __UA_t1, "$15", "$24", "$31"
660+#else
661+#define bzero_clobbers "$4", "$5", "$6", __UA_t0, __UA_t1, "$31"
662+#endif /* CONFIG_CPU_MICROMIPS */
663+
657664 if (eva_kernel_access()) {
658665 __asm__ __volatile__(
659666 "move\t$4, %1\n\t"
@@ -663,7 +670,7 @@ __clear_user(void __user *addr, __kernel_size_t size) · 3 unmodified lines
663670 "move\t%0, $6"
664671 : "=r" (res)
665672 : "r" (addr), "r" (size)
666− : "$4", "$5", "$6", __UA_t0, __UA_t1, "$31");
673+ : bzero_clobbers);
667674 } else {
668675 might_fault();
669676 __asm__ __volatile__(
@@ -674,7 +681,7 @@ __clear_user(void __user *addr, __kernel_size_t size) · 4 unmodified lines
674681 "move\t%0, $6"
675682 : "=r" (res)
676683 : "r" (addr), "r" (size)
677− : "$4", "$5", "$6", __UA_t0, __UA_t1, "$31");
684+ : bzero_clobbers);
678685 }
679686
680687 return res;
arch/mips/lib/memset.S+8−3
@@ -219,7 +219,7 @@ · 218 unmodified lines
219219 1: PTR_ADDIU a0, 1 /* fill bytewise */
220220 R10KCBARRIER(0(ra))
221221 bne t1, a0, 1b
222− sb a1, -1(a0)
222+ EX(sb, a1, -1(a0), .Lsmall_fixup\@)
223223
224224 2: jr ra /* done */
225225 move a2, zero
@@ -252,13 +252,18 @@ · 26 unmodified lines
252252 PTR_L t0, TI_TASK($28)
253253 andi a2, STORMASK
254254 LONG_L t0, THREAD_BUADDR(t0)
255− LONG_ADDU a2, t1
255+ LONG_ADDU a2, a0
256256 jr ra
257257 LONG_SUBU a2, t0
258258
259259 .Llast_fixup\@:
260260 jr ra
261− andi v1, a2, STORMASK
261+ nop
262+
263+.Lsmall_fixup\@:
264+ PTR_SUBU a2, t1, a0
265+ jr ra
266+ PTR_ADDIU a2, 1
262267
263268 .endm
264269
arch/parisc/Makefile+3−0
@@ -123,6 +123,9 @@ INSTALL_TARGETS = zinstall install · 122 unmodified lines
123123
124124 PHONY += bzImage $(BOOT_TARGETS) $(INSTALL_TARGETS)
125125
126+# Default kernel to build
127+all: bzImage
128+
126129 zImage: vmlinuz
127130 Image: vmlinux
128131
arch/parisc/kernel/Makefile+1−1
@@ -23,7 +23,7 @@ obj-$(CONFIG_SMP) += smp.o · 22 unmodified lines
2323 obj-$(CONFIG_PA11) += pci-dma.o
2424 obj-$(CONFIG_PCI) += pci.o
2525 obj-$(CONFIG_MODULES) += module.o
26−obj-$(CONFIG_64BIT) += binfmt_elf32.o sys_parisc32.o signal32.o
26+obj-$(CONFIG_64BIT) += sys_parisc32.o signal32.o
2727 obj-$(CONFIG_STACKTRACE)+= stacktrace.o
2828 obj-$(CONFIG_AUDIT) += audit.o
2929 obj64-$(CONFIG_AUDIT) += compat_audit.o
arch/parisc/kernel/drivers.c+4−3
@@ -448,7 +448,8 @@ static int match_by_id(struct device * dev, void * data) · 447 unmodified lines
448448 * Checks all the children of @parent for a matching @id. If none
449449 * found, it allocates a new device and returns it.
450450 */
451−static struct parisc_device * alloc_tree_node(struct device *parent, char id)
451+static struct parisc_device * __init alloc_tree_node(
452+ struct device *parent, char id)
452453 {
453454 struct match_id_data d = {
454455 .id = id,
@@ -825,8 +826,8 @@ static void walk_lower_bus(struct parisc_device *dev) · 370 unmodified lines
825826 * devices which are not physically connected (such as extra serial &
826827 * keyboard ports). This problem is not yet solved.
827828 */
828−static void walk_native_bus(unsigned long io_io_low, unsigned long io_io_high,
829− struct device *parent)
829+static void __init walk_native_bus(unsigned long io_io_low,
830+ unsigned long io_io_high, struct device *parent)
830831 {
831832 int i, devices_found = 0;
832833 unsigned long hpa = io_io_low;
arch/parisc/kernel/pci.c+1−1
@@ -174,7 +174,7 @@ void pcibios_set_master(struct pci_dev *dev) · 173 unmodified lines
174174 * pcibios_init_bridge() initializes cache line and default latency
175175 * for pci controllers and pci-pci bridges
176176 */
177−void __init pcibios_init_bridge(struct pci_dev *dev)
177+void __ref pcibios_init_bridge(struct pci_dev *dev)
178178 {
179179 unsigned short bridge_ctl, bridge_ctl_new;
180180
arch/parisc/kernel/time.c+1−1
@@ -205,7 +205,7 @@ static int __init rtc_init(void) · 204 unmodified lines
205205 device_initcall(rtc_init);
206206 #endif
207207
208−void read_persistent_clock(struct timespec *ts)
208+void read_persistent_clock64(struct timespec64 *ts)
209209 {
210210 static struct pdc_tod tod_data;
211211 if (pdc_tod_read(&tod_data) == 0) {
arch/parisc/kernel/traps.c+11−0
@@ -837,6 +837,17 @@ void __init initialize_ivt(const void *iva) · 836 unmodified lines
837837 if (pdc_instr(&instr) == PDC_OK)
838838 ivap[0] = instr;
839839
840+ /*
841+ * Rules for the checksum of the HPMC handler:
842+ * 1. The IVA does not point to PDC/PDH space (ie: the OS has installed
843+ * its own IVA).
844+ * 2. The word at IVA + 32 is nonzero.
845+ * 3. If Length (IVA + 60) is not zero, then Length (IVA + 60) and
846+ * Address (IVA + 56) are word-aligned.
847+ * 4. The checksum of the 8 words starting at IVA + 32 plus the sum of
848+ * the Length/4 words starting at Address is zero.
849+ */
850+
840851 /* Compute Checksum for HPMC handler */
841852 length = os_hpmc_size;
842853 ivap[7] = length;
arch/parisc/mm/init.c+1−1
@@ -516,7 +516,7 @@ static void __init map_pages(unsigned long start_vaddr, · 515 unmodified lines
516516 }
517517 }
518518
519−void free_initmem(void)
519+void __ref free_initmem(void)
520520 {
521521 unsigned long init_begin = (unsigned long)__init_begin;
522522 unsigned long init_end = (unsigned long)__init_end;
arch/powerpc/include/asm/powernv.h+1−1
@@ -15,7 +15,7 @@ · 14 unmodified lines
1515 extern void powernv_set_nmmu_ptcr(unsigned long ptcr);
1616 extern struct npu_context *pnv_npu2_init_context(struct pci_dev *gpdev,
1717 unsigned long flags,
18− struct npu_context *(*cb)(struct npu_context *, void *),
18+ void (*cb)(struct npu_context *, void *),
1919 void *priv);
2020 extern void pnv_npu2_destroy_context(struct npu_context *context,
2121 struct pci_dev *gpdev);
arch/powerpc/kernel/eeh_pe.c+2−1
@@ -807,7 +807,8 @@ static void eeh_restore_bridge_bars(struct eeh_dev *edev) · 806 unmodified lines
807807 eeh_ops->write_config(pdn, 15*4, 4, edev->config_space[15]);
808808
809809 /* PCI Command: 0x4 */
810− eeh_ops->write_config(pdn, PCI_COMMAND, 4, edev->config_space[1]);
810+ eeh_ops->write_config(pdn, PCI_COMMAND, 4, edev->config_space[1] |
811+ PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER);
811812
812813 /* Check the PCIe link is ready */
813814 eeh_bridge_check_link(edev);
arch/powerpc/kernel/idle_book3s.S+2−2
@@ -553,12 +553,12 @@ ALT_FTR_SECTION_END_IFSET(CPU_FTR_ARCH_300) · 552 unmodified lines
553553 #ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE
554554 lbz r0,HSTATE_HWTHREAD_STATE(r13)
555555 cmpwi r0,KVM_HWTHREAD_IN_KERNEL
556− beq 1f
556+ beq 0f
557557 li r0,KVM_HWTHREAD_IN_KERNEL
558558 stb r0,HSTATE_HWTHREAD_STATE(r13)
559559 /* Order setting hwthread_state vs. testing hwthread_req */
560560 sync
561− lbz r0,HSTATE_HWTHREAD_REQ(r13)
561+0: lbz r0,HSTATE_HWTHREAD_REQ(r13)
562562 cmpwi r0,0
563563 beq 1f
564564 b kvm_start_guest
arch/powerpc/kernel/mce_power.c+2−5
@@ -441,7 +441,6 @@ static int mce_handle_ierror(struct pt_regs *regs, · 440 unmodified lines
441441 if (pfn != ULONG_MAX) {
442442 *phys_addr =
443443 (pfn << PAGE_SHIFT);
444− handled = 1;
445444 }
446445 }
447446 }
@@ -532,9 +531,7 @@ static int mce_handle_derror(struct pt_regs *regs, · 84 unmodified lines
532531 * kernel/exception-64s.h
533532 */
534533 if (get_paca()->in_mce < MAX_MCE_DEPTH)
535− if (!mce_find_instr_ea_and_pfn(regs, addr,
536− phys_addr))
537− handled = 1;
534+ mce_find_instr_ea_and_pfn(regs, addr, phys_addr);
538535 }
539536 found = 1;
540537 }
@@ -572,7 +569,7 @@ static long mce_handle_error(struct pt_regs *regs, · 31 unmodified lines
572569 const struct mce_ierror_table itable[])
573570 {
574571 struct mce_error_info mce_err = { 0 };
575− uint64_t addr, phys_addr;
572+ uint64_t addr, phys_addr = ULONG_MAX;
576573 uint64_t srr1 = regs->msr;
577574 long handled;
578575
arch/powerpc/kernel/setup_64.c+11−0
@@ -890,6 +890,17 @@ static void __ref init_fallback_flush(void) · 889 unmodified lines
890890 return;
891891
892892 l1d_size = ppc64_caches.l1d.size;
893+
894+ /*
895+ * If there is no d-cache-size property in the device tree, l1d_size
896+ * could be zero. That leads to the loop in the asm wrapping around to
897+ * 2^64-1, and then walking off the end of the fallback area and
898+ * eventually causing a page fault which is fatal. Just default to
899+ * something vaguely sane.
900+ */
901+ if (!l1d_size)
902+ l1d_size = (64 * 1024);
903+
893904 limit = min(ppc64_bolted_size(), ppc64_rma_size);
894905
895906 /*
arch/powerpc/kernel/smp.c+42−7
@@ -566,10 +566,35 @@ void crash_send_ipi(void (*crash_ipi_callback)(struct pt_regs *)) · 565 unmodified lines
566566 #endif
567567
568568 #ifdef CONFIG_NMI_IPI
569−static void stop_this_cpu(struct pt_regs *regs)
570−#else
569+static void nmi_stop_this_cpu(struct pt_regs *regs)
570+{
571+ /*
572+ * This is a special case because it never returns, so the NMI IPI
573+ * handling would never mark it as done, which makes any later
574+ * smp_send_nmi_ipi() call spin forever. Mark it done now.
575+ *
576+ * IRQs are already hard disabled by the smp_handle_nmi_ipi.
577+ */
578+ nmi_ipi_lock();
579+ nmi_ipi_busy_count--;
580+ nmi_ipi_unlock();
581+
582+ /* Remove this CPU */
583+ set_cpu_online(smp_processor_id(), false);
584+
585+ spin_begin();
586+ while (1)
587+ spin_cpu_relax();
588+}
589+
590+void smp_send_stop(void)
591+{
592+ smp_send_nmi_ipi(NMI_IPI_ALL_OTHERS, nmi_stop_this_cpu, 1000000);
593+}
594+
595+#else /* CONFIG_NMI_IPI */
596+
571597 static void stop_this_cpu(void *dummy)
572−#endif
573598 {
574599 /* Remove this CPU */
575600 set_cpu_online(smp_processor_id(), false);
@@ -582,12 +607,22 @@ static void stop_this_cpu(void *dummy) · 6 unmodified lines
582607
583608 void smp_send_stop(void)
584609 {
585−#ifdef CONFIG_NMI_IPI
586− smp_send_nmi_ipi(NMI_IPI_ALL_OTHERS, stop_this_cpu, 1000000);
587−#else
610+ static bool stopped = false;
611+
612+ /*
613+ * Prevent waiting on csd lock from a previous smp_send_stop.
614+ * This is racy, but in general callers try to do the right
615+ * thing and only fire off one smp_send_stop (e.g., see
616+ * kernel/panic.c)
617+ */
618+ if (stopped)
619+ return;
620+
621+ stopped = true;
622+
588623 smp_call_function(stop_this_cpu, NULL, 0);
589−#endif
590624 }
625+#endif /* CONFIG_NMI_IPI */
591626
592627 struct thread_info *current_set[NR_CPUS];
593628
arch/powerpc/kvm/booke.c+7−0
@@ -305,6 +305,13 @@ void kvmppc_core_queue_fpunavail(struct kvm_vcpu *vcpu) · 304 unmodified lines
305305 kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_FP_UNAVAIL);
306306 }
307307
308+#ifdef CONFIG_ALTIVEC
309+void kvmppc_core_queue_vec_unavail(struct kvm_vcpu *vcpu)
310+{
311+ kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_ALTIVEC_UNAVAIL);
312+}
313+#endif
314+
308315 void kvmppc_core_queue_dec(struct kvm_vcpu *vcpu)
309316 {
310317 kvmppc_booke_queue_irqprio(vcpu, BOOKE_IRQPRIO_DECREMENTER);
arch/powerpc/lib/feature-fixups.c+1−1
@@ -55,7 +55,7 @@ static int patch_alt_instruction(unsigned int *src, unsigned int *dest, · 54 unmodified lines
5555 unsigned int *target = (unsigned int *)branch_target(src);
5656
5757 /* Branch within the section doesn't need translating */
58− if (target < alt_start || target >= alt_end) {
58+ if (target < alt_start || target > alt_end) {
5959 instr = translate_branch(dest, src);
6060 if (!instr)
6161 return 1;
arch/powerpc/mm/mem.c+2−0
@@ -133,6 +133,7 @@ int __meminit arch_add_memory(int nid, u64 start, u64 size, struct vmem_altmap * · 132 unmodified lines
133133 start, start + size, rc);
134134 return -EFAULT;
135135 }
136+ flush_inval_dcache_range(start, start + size);
136137
137138 return __add_pages(nid, start_pfn, nr_pages, altmap, want_memblock);
138139 }
@@ -159,6 +160,7 @@ int __meminit arch_remove_memory(u64 start, u64 size, struct vmem_altmap *altmap · 20 unmodified lines
159160
160161 /* Remove htab bolted mappings for this section of memory */
161162 start = (unsigned long)__va(start);
163+ flush_inval_dcache_range(start, start + size);
162164 ret = remove_section_mapping(start, start + size);
163165
164166 /* Ensure all vmalloc mappings are flushed in case they also
arch/powerpc/platforms/cell/spufs/sched.c+1−1
@@ -1093,7 +1093,7 @@ static int show_spu_loadavg(struct seq_file *s, void *private) · 1092 unmodified lines
10931093 LOAD_INT(c), LOAD_FRAC(c),
10941094 count_active_contexts(),
10951095 atomic_read(&nr_spu_contexts),
1096− idr_get_cursor(&task_active_pid_ns(current)->idr));
1096+ idr_get_cursor(&task_active_pid_ns(current)->idr) - 1);
10971097 return 0;
10981098 }
10991099
arch/powerpc/platforms/powernv/memtrace.c+0−17
@@ -82,19 +82,6 @@ static const struct file_operations memtrace_fops = { · 81 unmodified lines
8282 .open = simple_open,
8383 };
8484
85−static void flush_memory_region(u64 base, u64 size)
86−{
87− unsigned long line_size = ppc64_caches.l1d.size;
88− u64 end = base + size;
89− u64 addr;
90−
91− base = round_down(base, line_size);
92− end = round_up(end, line_size);
93−
94− for (addr = base; addr < end; addr += line_size)
95− asm volatile("dcbf 0,%0" : "=r" (addr) :: "memory");
96−}
97−
9885 static int check_memblock_online(struct memory_block *mem, void *arg)
9986 {
10087 if (mem->state != MEM_ONLINE)
@@ -132,10 +119,6 @@ static bool memtrace_offline_pages(u32 nid, u64 start_pfn, u64 nr_pages) · 31 unmodified lines
132119 walk_memory_range(start_pfn, end_pfn, (void *)MEM_OFFLINE,
133120 change_memblock_state);
134121
135− /* RCU grace period? */
136− flush_memory_region((u64)__va(start_pfn << PAGE_SHIFT),
137− nr_pages << PAGE_SHIFT);
138−
139122 lock_device_hotplug();
140123 remove_memory(nid, start_pfn << PAGE_SHIFT, nr_pages << PAGE_SHIFT);
141124 unlock_device_hotplug();
arch/powerpc/platforms/powernv/npu-dma.c+73−15
@@ -33,6 +33,19 @@ · 32 unmodified lines
3333
3434 #define npu_to_phb(x) container_of(x, struct pnv_phb, npu)
3535
36+/*
37+ * spinlock to protect initialisation of an npu_context for a particular
38+ * mm_struct.
39+ */
40+static DEFINE_SPINLOCK(npu_context_lock);
41+
42+/*
43+ * When an address shootdown range exceeds this threshold we invalidate the
44+ * entire TLB on the GPU for the given PID rather than each specific address in
45+ * the range.
46+ */
47+#define ATSD_THRESHOLD (2*1024*1024)
48+
3649 /*
3750 * Other types of TCE cache invalidation are not functional in the
3851 * hardware.
@@ -401,7 +414,7 @@ struct npu_context { · 362 unmodified lines
401414 bool nmmu_flush;
402415
403416 /* Callback to stop translation requests on a given GPU */
404− struct npu_context *(*release_cb)(struct npu_context *, void *);
417+ void (*release_cb)(struct npu_context *context, void *priv);
405418
406419 /*
407420 * Private pointer passed to the above callback for usage by
@@ -671,11 +684,19 @@ static void pnv_npu2_mn_invalidate_range(struct mmu_notifier *mn, · 263 unmodified lines
671684 struct npu_context *npu_context = mn_to_npu_context(mn);
672685 unsigned long address;
673686
674− for (address = start; address < end; address += PAGE_SIZE)
675− mmio_invalidate(npu_context, 1, address, false);
687+ if (end - start > ATSD_THRESHOLD) {
688+ /*
689+ * Just invalidate the entire PID if the address range is too
690+ * large.
691+ */
692+ mmio_invalidate(npu_context, 0, 0, true);
693+ } else {
694+ for (address = start; address < end; address += PAGE_SIZE)
695+ mmio_invalidate(npu_context, 1, address, false);
676696
677− /* Do the flush only on the final addess == end */
678− mmio_invalidate(npu_context, 1, address, true);
697+ /* Do the flush only on the final addess == end */
698+ mmio_invalidate(npu_context, 1, address, true);
699+ }
679700 }
680701
681702 static const struct mmu_notifier_ops nv_nmmu_notifier_ops = {
@@ -696,11 +717,12 @@ static const struct mmu_notifier_ops nv_nmmu_notifier_ops = { · 14 unmodified lines
696717 * Returns an error if there no contexts are currently available or a
697718 * npu_context which should be passed to pnv_npu2_handle_fault().
698719 *
699− * mmap_sem must be held in write mode.
720+ * mmap_sem must be held in write mode and must not be called from interrupt
721+ * context.
700722 */
701723 struct npu_context *pnv_npu2_init_context(struct pci_dev *gpdev,
702724 unsigned long flags,
703− struct npu_context *(*cb)(struct npu_context *, void *),
725+ void (*cb)(struct npu_context *, void *),
704726 void *priv)
705727 {
706728 int rc;
@@ -743,7 +765,9 @@ struct npu_context *pnv_npu2_init_context(struct pci_dev *gpdev, · 36 unmodified lines
743765 /*
744766 * Setup the NPU context table for a particular GPU. These need to be
745767 * per-GPU as we need the tables to filter ATSDs when there are no
746− * active contexts on a particular GPU.
768+ * active contexts on a particular GPU. It is safe for these to be
769+ * called concurrently with destroy as the OPAL call takes appropriate
770+ * locks and refcounts on init/destroy.
747771 */
748772 rc = opal_npu_init_context(nphb->opal_id, mm->context.id, flags,
749773 PCI_DEVID(gpdev->bus->number, gpdev->devfn));
@@ -754,8 +778,29 @@ struct npu_context *pnv_npu2_init_context(struct pci_dev *gpdev, · 4 unmodified lines
754778 * We store the npu pci device so we can more easily get at the
755779 * associated npus.
756780 */
781+ spin_lock(&npu_context_lock);
757782 npu_context = mm->context.npu_context;
783+ if (npu_context) {
784+ if (npu_context->release_cb != cb ||
785+ npu_context->priv != priv) {
786+ spin_unlock(&npu_context_lock);
787+ opal_npu_destroy_context(nphb->opal_id, mm->context.id,
788+ PCI_DEVID(gpdev->bus->number,
789+ gpdev->devfn));
790+ return ERR_PTR(-EINVAL);
791+ }
792+
793+ WARN_ON(!kref_get_unless_zero(&npu_context->kref));
794+ }
795+ spin_unlock(&npu_context_lock);
796+
758797 if (!npu_context) {
798+ /*
799+ * We can set up these fields without holding the
800+ * npu_context_lock as the npu_context hasn't been returned to
801+ * the caller meaning it can't be destroyed. Parallel allocation
802+ * is protected against by mmap_sem.
803+ */
759804 rc = -ENOMEM;
760805 npu_context = kzalloc(sizeof(struct npu_context), GFP_KERNEL);
761806 if (npu_context) {
@@ -774,8 +819,6 @@ struct npu_context *pnv_npu2_init_context(struct pci_dev *gpdev, · 12 unmodified lines
774819 }
775820
776821 mm->context.npu_context = npu_context;
777− } else {
778− WARN_ON(!kref_get_unless_zero(&npu_context->kref));
779822 }
780823
781824 npu_context->release_cb = cb;
@@ -814,15 +857,16 @@ static void pnv_npu2_release_context(struct kref *kref) · 32 unmodified lines
814857 mm_context_remove_copro(npu_context->mm);
815858
816859 npu_context->mm->context.npu_context = NULL;
817− mmu_notifier_unregister(&npu_context->mn,
818− npu_context->mm);
819−
820− kfree(npu_context);
821860 }
822861
862+/*
863+ * Destroy a context on the given GPU. May free the npu_context if it is no
864+ * longer active on any GPUs. Must not be called from interrupt context.
865+ */
823866 void pnv_npu2_destroy_context(struct npu_context *npu_context,
824867 struct pci_dev *gpdev)
825868 {
869+ int removed;
826870 struct pnv_phb *nphb;
827871 struct npu *npu;
828872 struct pci_dev *npdev = pnv_pci_get_npu_dev(gpdev, 0);
@@ -844,7 +888,21 @@ void pnv_npu2_destroy_context(struct npu_context *npu_context, · 15 unmodified lines
844888 WRITE_ONCE(npu_context->npdev[npu->index][nvlink_index], NULL);
845889 opal_npu_destroy_context(nphb->opal_id, npu_context->mm->context.id,
846890 PCI_DEVID(gpdev->bus->number, gpdev->devfn));
847− kref_put(&npu_context->kref, pnv_npu2_release_context);
891+ spin_lock(&npu_context_lock);
892+ removed = kref_put(&npu_context->kref, pnv_npu2_release_context);
893+ spin_unlock(&npu_context_lock);
894+
895+ /*
896+ * We need to do this outside of pnv_npu2_release_context so that it is
897+ * outside the spinlock as mmu_notifier_destroy uses SRCU.
898+ */
899+ if (removed) {
900+ mmu_notifier_unregister(&npu_context->mn,
901+ npu_context->mm);
902+
903+ kfree(npu_context);
904+ }
905+
848906 }
849907 EXPORT_SYMBOL(pnv_npu2_destroy_context);
850908
arch/powerpc/platforms/powernv/opal-rtc.c+5−3
@@ -48,10 +48,12 @@ unsigned long __init opal_get_boot_time(void) · 47 unmodified lines
4848
4949 while (rc == OPAL_BUSY || rc == OPAL_BUSY_EVENT) {
5050 rc = opal_rtc_read(&__y_m_d, &__h_m_s_ms);
51− if (rc == OPAL_BUSY_EVENT)
51+ if (rc == OPAL_BUSY_EVENT) {
52+ mdelay(OPAL_BUSY_DELAY_MS);
5253 opal_poll_events(NULL);
53− else if (rc == OPAL_BUSY)
54− mdelay(10);
54+ } else if (rc == OPAL_BUSY) {
55+ mdelay(OPAL_BUSY_DELAY_MS);
56+ }
5557 }
5658 if (rc != OPAL_SUCCESS)
5759 return 0;
arch/powerpc/sysdev/xive/native.c+4−0
@@ -389,6 +389,10 @@ static void xive_native_setup_cpu(unsigned int cpu, struct xive_cpu *xc) · 388 unmodified lines
389389 if (xive_pool_vps == XIVE_INVALID_VP)
390390 return;
391391
392+ /* Check if pool VP already active, if it is, pull it */
393+ if (in_be32(xive_tima + TM_QW2_HV_POOL + TM_WORD2) & TM_QW2W2_VP)
394+ in_be64(xive_tima + TM_SPC_PULL_POOL_CTX);
395+
392396 /* Enable the pool VP */
393397 vp = xive_pool_vps + cpu;
394398 pr_debug("CPU %d setting up pool VP 0x%x\n", cpu, vp);
arch/riscv/Kconfig+1−3
@@ -11,6 +11,7 @@ config RISCV · 10 unmodified lines
1111 select ARCH_WANT_FRAME_POINTERS
1212 select CLONE_BACKWARDS
1313 select COMMON_CLK
14+ select DMA_DIRECT_OPS
1415 select GENERIC_CLOCKEVENTS
1516 select GENERIC_CPU_DEVICES
1617 select GENERIC_IRQ_SHOW
@@ -89,9 +90,6 @@ config PGTABLE_LEVELS · 72 unmodified lines
8990 config HAVE_KPROBES
9091 def_bool n
9192
92−config DMA_DIRECT_OPS
93− def_bool y
94−
9593 menu "Platform type"
9694
9795 choice
arch/riscv/include/asm/Kbuild+0−1
@@ -15,7 +15,6 @@ generic-y += fcntl.h · 14 unmodified lines
1515 generic-y += futex.h
1616 generic-y += hardirq.h
1717 generic-y += hash.h
18−generic-y += handle_irq.h
1918 generic-y += hw_irq.h
2019 generic-y += ioctl.h
2120 generic-y += ioctls.h
arch/riscv/kernel/vdso/Makefile+1−1
@@ -52,7 +52,7 @@ $(obj)/%.so: $(obj)/%.so.dbg FORCE · 51 unmodified lines
5252 # Add -lgcc so rv32 gets static muldi3 and lshrdi3 definitions.
5353 # Make sure only to export the intended __vdso_xxx symbol offsets.
5454 quiet_cmd_vdsold = VDSOLD $@
55− cmd_vdsold = $(CC) $(KCFLAGS) -nostdlib $(SYSCFLAGS_$(@F)) \
55+ cmd_vdsold = $(CC) $(KCFLAGS) $(call cc-option, -no-pie) -nostdlib $(SYSCFLAGS_$(@F)) \
5656 -Wl,-T,$(filter-out FORCE,$^) -o $@.tmp -lgcc && \
5757 $(CROSS_COMPILE)objcopy \
5858 $(patsubst %, -G __vdso_%, $(vdso-syms)) $@.tmp $@
arch/s390/Kbuild+1−0
@@ -8,3 +8,4 @@ obj-$(CONFIG_APPLDATA_BASE) += appldata/ · 7 unmodified lines
88 obj-y += net/
99 obj-$(CONFIG_PCI) += pci/
1010 obj-$(CONFIG_NUMA) += numa/
11+obj-$(CONFIG_ARCH_HAS_KEXEC_PURGATORY) += purgatory/
arch/s390/Kconfig+24−8
@@ -47,10 +47,6 @@ config PGSTE · 46 unmodified lines
4747 config ARCH_SUPPORTS_DEBUG_PAGEALLOC
4848 def_bool y
4949
50−config KEXEC
51− def_bool y
52− select KEXEC_CORE
53−
5450 config AUDIT_ARCH
5551 def_bool y
5652
@@ -290,12 +286,12 @@ config MARCH_Z13 · 233 unmodified lines
290286 older machines.
291287
292288 config MARCH_Z14
293− bool "IBM z14"
289+ bool "IBM z14 ZR1 and z14"
294290 select HAVE_MARCH_Z14_FEATURES
295291 help
296− Select this to enable optimizations for IBM z14 (3906 series).
297− The kernel will be slightly faster but will not work on older
298− machines.
292+ Select this to enable optimizations for IBM z14 ZR1 and z14 (3907
293+ and 3906 series). The kernel will be slightly faster but will not
294+ work on older machines.
299295
300296 endchoice
301297
@@ -525,6 +521,26 @@ source kernel/Kconfig.preempt · 223 unmodified lines
525521
526522 source kernel/Kconfig.hz
527523
524+config KEXEC
525+ def_bool y
526+ select KEXEC_CORE
527+
528+config KEXEC_FILE
529+ bool "kexec file based system call"
530+ select KEXEC_CORE
531+ select BUILD_BIN2C
532+ depends on CRYPTO
533+ depends on CRYPTO_SHA256
534+ depends on CRYPTO_SHA256_S390
535+ help
536+ Enable the kexec file based system call. In contrast to the normal
537+ kexec system call this system call takes file descriptors for the
538+ kernel and initramfs as arguments.
539+
540+config ARCH_HAS_KEXEC_PURGATORY
541+ def_bool y
542+ depends on KEXEC_FILE
543+
528544 config ARCH_RANDOM
529545 def_bool y
530546 prompt "s390 architectural random number generation API"
arch/s390/boot/Makefile+0−6
@@ -3,12 +3,6 @@ · 2 unmodified lines
33 # Makefile for the linux s390-specific parts of the memory manager.
44 #
55
6−COMPILE_VERSION := __linux_compile_version_id__`hostname | \
7− tr -c '[0-9A-Za-z]' '_'`__`date | \
8− tr -c '[0-9A-Za-z]' '_'`_t
9−
10−ccflags-y := -DCOMPILE_VERSION=$(COMPILE_VERSION) -gstabs -I.
11−
126 targets := image
137 targets += bzImage
148 subdir- := compressed
arch/s390/boot/compressed/.gitignore+1−0
@@ -1,3 +1,4 @@
11 sizes.h
22 vmlinux
33 vmlinux.lds
4+vmlinux.bin.full
arch/s390/configs/debug_defconfigrenamed from arch/s390/configs/default_defconfig+20−10
@@ -24,13 +24,13 @@ CONFIG_CPUSETS=y · 23 unmodified lines
2424 CONFIG_CGROUP_DEVICE=y
2525 CONFIG_CGROUP_CPUACCT=y
2626 CONFIG_CGROUP_PERF=y
27−CONFIG_CHECKPOINT_RESTORE=y
2827 CONFIG_NAMESPACES=y
2928 CONFIG_USER_NS=y
3029 CONFIG_SCHED_AUTOGROUP=y
3130 CONFIG_BLK_DEV_INITRD=y
3231 CONFIG_EXPERT=y
3332 # CONFIG_SYSFS_SYSCALL is not set
33+CONFIG_CHECKPOINT_RESTORE=y
3434 CONFIG_BPF_SYSCALL=y
3535 CONFIG_USERFAULTFD=y
3636 # CONFIG_COMPAT_BRK is not set
@@ -59,10 +59,11 @@ CONFIG_CFQ_GROUP_IOSCHED=y · 22 unmodified lines
5959 CONFIG_DEFAULT_DEADLINE=y
6060 CONFIG_LIVEPATCH=y
6161 CONFIG_TUNE_ZEC12=y
62−CONFIG_NR_CPUS=256
62+CONFIG_NR_CPUS=512
6363 CONFIG_NUMA=y
6464 CONFIG_PREEMPT=y
6565 CONFIG_HZ_100=y
66+CONFIG_KEXEC_FILE=y
6667 CONFIG_MEMORY_HOTPLUG=y
6768 CONFIG_MEMORY_HOTREMOVE=y
6869 CONFIG_KSM=y
@@ -305,7 +306,6 @@ CONFIG_IP6_NF_SECURITY=m · 236 unmodified lines
305306 CONFIG_IP6_NF_NAT=m
306307 CONFIG_IP6_NF_TARGET_MASQUERADE=m
307308 CONFIG_NF_TABLES_BRIDGE=m
308−CONFIG_NET_SCTPPROBE=m
309309 CONFIG_RDS=m
310310 CONFIG_RDS_RDMA=m
311311 CONFIG_RDS_TCP=m
@@ -364,11 +364,11 @@ CONFIG_NET_ACT_SIMP=m · 52 unmodified lines
364364 CONFIG_NET_ACT_SKBEDIT=m
365365 CONFIG_NET_ACT_CSUM=m
366366 CONFIG_DNS_RESOLVER=y
367+CONFIG_OPENVSWITCH=m
367368 CONFIG_NETLINK_DIAG=m
368369 CONFIG_CGROUP_NET_PRIO=y
369370 CONFIG_BPF_JIT=y
370371 CONFIG_NET_PKTGEN=m
371−CONFIG_NET_TCPPROBE=m
372372 CONFIG_DEVTMPFS=y
373373 CONFIG_DMA_CMA=y
374374 CONFIG_CMA_SIZE_MBYTES=0
@@ -380,9 +380,9 @@ CONFIG_BLK_DEV_DRBD=m · 5 unmodified lines
380380 CONFIG_BLK_DEV_NBD=m
381381 CONFIG_BLK_DEV_RAM=y
382382 CONFIG_BLK_DEV_RAM_SIZE=32768
383−CONFIG_BLK_DEV_RAM_DAX=y
384383 CONFIG_VIRTIO_BLK=y
385384 CONFIG_BLK_DEV_RBD=m
385+CONFIG_BLK_DEV_NVME=m
386386 CONFIG_ENCLOSURE_SERVICES=m
387387 CONFIG_GENWQE=m
388388 CONFIG_RAID_ATTRS=m
@@ -461,6 +461,7 @@ CONFIG_PPTP=m · 72 unmodified lines
461461 CONFIG_PPPOL2TP=m
462462 CONFIG_PPP_ASYNC=m
463463 CONFIG_PPP_SYNC_TTY=m
464+CONFIG_INPUT_EVDEV=y
464465 # CONFIG_INPUT_KEYBOARD is not set
465466 # CONFIG_INPUT_MOUSE is not set
466467 # CONFIG_SERIO is not set
@@ -474,6 +475,9 @@ CONFIG_WATCHDOG=y · 7 unmodified lines
474475 CONFIG_WATCHDOG_NOWAYOUT=y
475476 CONFIG_SOFT_WATCHDOG=m
476477 CONFIG_DIAG288_WATCHDOG=m
478+CONFIG_DRM=y
479+CONFIG_DRM_VIRTIO_GPU=y
480+CONFIG_FRAMEBUFFER_CONSOLE=y
477481 # CONFIG_HID is not set
478482 # CONFIG_USB_SUPPORT is not set
479483 CONFIG_INFINIBAND=m
@@ -482,7 +486,9 @@ CONFIG_MLX4_INFINIBAND=m · 2 unmodified lines
482486 CONFIG_MLX5_INFINIBAND=m
483487 CONFIG_VFIO=m
484488 CONFIG_VFIO_PCI=m
489+CONFIG_VIRTIO_PCI=m
485490 CONFIG_VIRTIO_BALLOON=m
491+CONFIG_VIRTIO_INPUT=y
486492 CONFIG_EXT4_FS=y
487493 CONFIG_EXT4_FS_POSIX_ACL=y
488494 CONFIG_EXT4_FS_SECURITY=y
@@ -641,6 +647,8 @@ CONFIG_ATOMIC64_SELFTEST=y · 152 unmodified lines
641647 CONFIG_TEST_BPF=m
642648 CONFIG_BUG_ON_DATA_CORRUPTION=y
643649 CONFIG_S390_PTDUMP=y
650+CONFIG_PERSISTENT_KEYRINGS=y
651+CONFIG_BIG_KEYS=y
644652 CONFIG_ENCRYPTED_KEYS=m
645653 CONFIG_SECURITY=y
646654 CONFIG_SECURITY_NETWORK=y
@@ -649,17 +657,20 @@ CONFIG_SECURITY_SELINUX=y · 2 unmodified lines
649657 CONFIG_SECURITY_SELINUX_BOOTPARAM=y
650658 CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=0
651659 CONFIG_SECURITY_SELINUX_DISABLE=y
660+CONFIG_INTEGRITY_SIGNATURE=y
661+CONFIG_INTEGRITY_ASYMMETRIC_KEYS=y
652662 CONFIG_IMA=y
663+CONFIG_IMA_DEFAULT_HASH_SHA256=y
664+CONFIG_IMA_WRITE_POLICY=y
653665 CONFIG_IMA_APPRAISE=y
654−CONFIG_CRYPTO_RSA=m
655666 CONFIG_CRYPTO_DH=m
656667 CONFIG_CRYPTO_ECDH=m
657668 CONFIG_CRYPTO_USER=m
669+# CONFIG_CRYPTO_MANAGER_DISABLE_TESTS is not set
658670 CONFIG_CRYPTO_PCRYPT=m
659671 CONFIG_CRYPTO_CRYPTD=m
660672 CONFIG_CRYPTO_MCRYPTD=m
661673 CONFIG_CRYPTO_TEST=m
662−CONFIG_CRYPTO_GCM=m
663674 CONFIG_CRYPTO_CHACHA20POLY1305=m
664675 CONFIG_CRYPTO_LRW=m
665676 CONFIG_CRYPTO_PCBC=m
@@ -707,9 +718,8 @@ CONFIG_CRYPTO_DES_S390=m · 41 unmodified lines
707718 CONFIG_CRYPTO_AES_S390=m
708719 CONFIG_CRYPTO_GHASH_S390=m
709720 CONFIG_CRYPTO_CRC32_S390=y
710−CONFIG_ASYMMETRIC_KEY_TYPE=y
711−CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE=m
712−CONFIG_X509_CERTIFICATE_PARSER=m
721+CONFIG_PKCS7_MESSAGE_PARSER=y
722+CONFIG_SYSTEM_TRUSTED_KEYRING=y
713723 CONFIG_CRC7=m
714724 CONFIG_CRC8=m
715725 CONFIG_RANDOM32_SELFTEST=y
arch/s390/configs/gcov_defconfig+0−661
@@ -1,661 +0,0 @@
1−CONFIG_SYSVIPC=y
2−CONFIG_POSIX_MQUEUE=y
3−CONFIG_AUDIT=y
4−CONFIG_NO_HZ_IDLE=y
5−CONFIG_HIGH_RES_TIMERS=y
6−CONFIG_BSD_PROCESS_ACCT=y
7−CONFIG_BSD_PROCESS_ACCT_V3=y
8−CONFIG_TASKSTATS=y
9−CONFIG_TASK_DELAY_ACCT=y
10−CONFIG_TASK_XACCT=y
11−CONFIG_TASK_IO_ACCOUNTING=y
12−CONFIG_IKCONFIG=y
13−CONFIG_IKCONFIG_PROC=y
14−CONFIG_NUMA_BALANCING=y
15−# CONFIG_NUMA_BALANCING_DEFAULT_ENABLED is not set
16−CONFIG_MEMCG=y
17−CONFIG_MEMCG_SWAP=y
18−CONFIG_BLK_CGROUP=y
19−CONFIG_CFS_BANDWIDTH=y
20−CONFIG_RT_GROUP_SCHED=y
21−CONFIG_CGROUP_PIDS=y
22−CONFIG_CGROUP_FREEZER=y
23−CONFIG_CGROUP_HUGETLB=y
24−CONFIG_CPUSETS=y
25−CONFIG_CGROUP_DEVICE=y
26−CONFIG_CGROUP_CPUACCT=y
27−CONFIG_CGROUP_PERF=y
28−CONFIG_CHECKPOINT_RESTORE=y
29−CONFIG_NAMESPACES=y
30−CONFIG_USER_NS=y
31−CONFIG_SCHED_AUTOGROUP=y
32−CONFIG_BLK_DEV_INITRD=y
33−CONFIG_EXPERT=y
34−# CONFIG_SYSFS_SYSCALL is not set
35−CONFIG_BPF_SYSCALL=y
36−CONFIG_USERFAULTFD=y
37−# CONFIG_COMPAT_BRK is not set
38−CONFIG_PROFILING=y
39−CONFIG_OPROFILE=m
40−CONFIG_KPROBES=y
41−CONFIG_JUMP_LABEL=y
42−CONFIG_GCOV_KERNEL=y
43−CONFIG_GCOV_PROFILE_ALL=y
44−CONFIG_MODULES=y
45−CONFIG_MODULE_FORCE_LOAD=y
46−CONFIG_MODULE_UNLOAD=y
47−CONFIG_MODULE_FORCE_UNLOAD=y
48−CONFIG_MODVERSIONS=y
49−CONFIG_MODULE_SRCVERSION_ALL=y
50−CONFIG_BLK_DEV_INTEGRITY=y
51−CONFIG_BLK_DEV_THROTTLING=y
52−CONFIG_BLK_WBT=y
53−CONFIG_BLK_WBT_SQ=y
54−CONFIG_PARTITION_ADVANCED=y
55−CONFIG_IBM_PARTITION=y
56−CONFIG_BSD_DISKLABEL=y
57−CONFIG_MINIX_SUBPARTITION=y
58−CONFIG_SOLARIS_X86_PARTITION=y
59−CONFIG_UNIXWARE_DISKLABEL=y
60−CONFIG_CFQ_GROUP_IOSCHED=y
61−CONFIG_DEFAULT_DEADLINE=y
62−CONFIG_LIVEPATCH=y
63−CONFIG_TUNE_ZEC12=y
64−CONFIG_NR_CPUS=512
65−CONFIG_NUMA=y
66−CONFIG_HZ_100=y
67−CONFIG_MEMORY_HOTPLUG=y
68−CONFIG_MEMORY_HOTREMOVE=y
69−CONFIG_KSM=y
70−CONFIG_TRANSPARENT_HUGEPAGE=y
71−CONFIG_CLEANCACHE=y
72−CONFIG_FRONTSWAP=y
73−CONFIG_MEM_SOFT_DIRTY=y
74−CONFIG_ZSWAP=y
75−CONFIG_ZBUD=m
76−CONFIG_ZSMALLOC=m
77−CONFIG_ZSMALLOC_STAT=y
78−CONFIG_DEFERRED_STRUCT_PAGE_INIT=y
79−CONFIG_IDLE_PAGE_TRACKING=y
80−CONFIG_PCI=y
81−CONFIG_HOTPLUG_PCI=y
82−CONFIG_HOTPLUG_PCI_S390=y
83−CONFIG_CHSC_SCH=y
84−CONFIG_CRASH_DUMP=y
85−CONFIG_BINFMT_MISC=m
86−CONFIG_HIBERNATION=y
87−CONFIG_NET=y
88−CONFIG_PACKET=y
89−CONFIG_PACKET_DIAG=m
90−CONFIG_UNIX=y
91−CONFIG_UNIX_DIAG=m
92−CONFIG_XFRM_USER=m
93−CONFIG_NET_KEY=m
94−CONFIG_SMC=m
95−CONFIG_SMC_DIAG=m
96−CONFIG_INET=y
97−CONFIG_IP_MULTICAST=y
98−CONFIG_IP_ADVANCED_ROUTER=y
99−CONFIG_IP_MULTIPLE_TABLES=y
100−CONFIG_IP_ROUTE_MULTIPATH=y
101−CONFIG_IP_ROUTE_VERBOSE=y
102−CONFIG_NET_IPIP=m
103−CONFIG_NET_IPGRE_DEMUX=m
104−CONFIG_NET_IPGRE=m
105−CONFIG_NET_IPGRE_BROADCAST=y
106−CONFIG_IP_MROUTE=y
107−CONFIG_IP_MROUTE_MULTIPLE_TABLES=y
108−CONFIG_IP_PIMSM_V1=y
109−CONFIG_IP_PIMSM_V2=y
110−CONFIG_SYN_COOKIES=y
111−CONFIG_NET_IPVTI=m
112−CONFIG_INET_AH=m
113−CONFIG_INET_ESP=m
114−CONFIG_INET_IPCOMP=m
115−CONFIG_INET_XFRM_MODE_TRANSPORT=m
116−CONFIG_INET_XFRM_MODE_TUNNEL=m
117−CONFIG_INET_XFRM_MODE_BEET=m
118−CONFIG_INET_DIAG=m
119−CONFIG_INET_UDP_DIAG=m
120−CONFIG_TCP_CONG_ADVANCED=y
121−CONFIG_TCP_CONG_HSTCP=m
122−CONFIG_TCP_CONG_HYBLA=m
123−CONFIG_TCP_CONG_SCALABLE=m
124−CONFIG_TCP_CONG_LP=m
125−CONFIG_TCP_CONG_VENO=m
126−CONFIG_TCP_CONG_YEAH=m
127−CONFIG_TCP_CONG_ILLINOIS=m
128−CONFIG_IPV6_ROUTER_PREF=y
129−CONFIG_INET6_AH=m
130−CONFIG_INET6_ESP=m
131−CONFIG_INET6_IPCOMP=m
132−CONFIG_IPV6_MIP6=m
133−CONFIG_INET6_XFRM_MODE_TRANSPORT=m
134−CONFIG_INET6_XFRM_MODE_TUNNEL=m
135−CONFIG_INET6_XFRM_MODE_BEET=m
136−CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m
137−CONFIG_IPV6_VTI=m
138−CONFIG_IPV6_SIT=m
139−CONFIG_IPV6_GRE=m
140−CONFIG_IPV6_MULTIPLE_TABLES=y
141−CONFIG_IPV6_SUBTREES=y
142−CONFIG_NETFILTER=y
143−CONFIG_NF_CONNTRACK=m
144−CONFIG_NF_CONNTRACK_SECMARK=y
145−CONFIG_NF_CONNTRACK_EVENTS=y
146−CONFIG_NF_CONNTRACK_TIMEOUT=y
147−CONFIG_NF_CONNTRACK_TIMESTAMP=y
148−CONFIG_NF_CONNTRACK_AMANDA=m
149−CONFIG_NF_CONNTRACK_FTP=m
150−CONFIG_NF_CONNTRACK_H323=m
151−CONFIG_NF_CONNTRACK_IRC=m
152−CONFIG_NF_CONNTRACK_NETBIOS_NS=m
153−CONFIG_NF_CONNTRACK_SNMP=m
154−CONFIG_NF_CONNTRACK_PPTP=m
155−CONFIG_NF_CONNTRACK_SANE=m
156−CONFIG_NF_CONNTRACK_SIP=m
157−CONFIG_NF_CONNTRACK_TFTP=m
158−CONFIG_NF_CT_NETLINK=m
159−CONFIG_NF_CT_NETLINK_TIMEOUT=m
160−CONFIG_NF_TABLES=m
161−CONFIG_NFT_EXTHDR=m
162−CONFIG_NFT_META=m
163−CONFIG_NFT_CT=m
164−CONFIG_NFT_COUNTER=m
165−CONFIG_NFT_LOG=m
166−CONFIG_NFT_LIMIT=m
167−CONFIG_NFT_NAT=m
168−CONFIG_NFT_COMPAT=m
169−CONFIG_NFT_HASH=m
170−CONFIG_NETFILTER_XT_SET=m
171−CONFIG_NETFILTER_XT_TARGET_AUDIT=m
172−CONFIG_NETFILTER_XT_TARGET_CHECKSUM=m
173−CONFIG_NETFILTER_XT_TARGET_CLASSIFY=m
174−CONFIG_NETFILTER_XT_TARGET_CONNMARK=m
175−CONFIG_NETFILTER_XT_TARGET_CONNSECMARK=m
176−CONFIG_NETFILTER_XT_TARGET_CT=m
177−CONFIG_NETFILTER_XT_TARGET_DSCP=m
178−CONFIG_NETFILTER_XT_TARGET_HMARK=m
179−CONFIG_NETFILTER_XT_TARGET_IDLETIMER=m
180−CONFIG_NETFILTER_XT_TARGET_LOG=m
181−CONFIG_NETFILTER_XT_TARGET_MARK=m
182−CONFIG_NETFILTER_XT_TARGET_NFLOG=m
183−CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m
184−CONFIG_NETFILTER_XT_TARGET_TEE=m
185−CONFIG_NETFILTER_XT_TARGET_TPROXY=m
186−CONFIG_NETFILTER_XT_TARGET_TRACE=m
187−CONFIG_NETFILTER_XT_TARGET_SECMARK=m
188−CONFIG_NETFILTER_XT_TARGET_TCPMSS=m
189−CONFIG_NETFILTER_XT_TARGET_TCPOPTSTRIP=m
190−CONFIG_NETFILTER_XT_MATCH_ADDRTYPE=m
191−CONFIG_NETFILTER_XT_MATCH_BPF=m
192−CONFIG_NETFILTER_XT_MATCH_CLUSTER=m
193−CONFIG_NETFILTER_XT_MATCH_COMMENT=m
194−CONFIG_NETFILTER_XT_MATCH_CONNBYTES=m
195−CONFIG_NETFILTER_XT_MATCH_CONNLABEL=m
196−CONFIG_NETFILTER_XT_MATCH_CONNLIMIT=m
197−CONFIG_NETFILTER_XT_MATCH_CONNMARK=m
198−CONFIG_NETFILTER_XT_MATCH_CONNTRACK=m
199−CONFIG_NETFILTER_XT_MATCH_CPU=m
200−CONFIG_NETFILTER_XT_MATCH_DCCP=m
201−CONFIG_NETFILTER_XT_MATCH_DEVGROUP=m
202−CONFIG_NETFILTER_XT_MATCH_DSCP=m
203−CONFIG_NETFILTER_XT_MATCH_ESP=m
204−CONFIG_NETFILTER_XT_MATCH_HASHLIMIT=m
205−CONFIG_NETFILTER_XT_MATCH_HELPER=m
206−CONFIG_NETFILTER_XT_MATCH_IPRANGE=m
207−CONFIG_NETFILTER_XT_MATCH_IPVS=m
208−CONFIG_NETFILTER_XT_MATCH_LENGTH=m
209−CONFIG_NETFILTER_XT_MATCH_LIMIT=m
210−CONFIG_NETFILTER_XT_MATCH_MAC=m
211−CONFIG_NETFILTER_XT_MATCH_MARK=m
212−CONFIG_NETFILTER_XT_MATCH_MULTIPORT=m
213−CONFIG_NETFILTER_XT_MATCH_NFACCT=m
214−CONFIG_NETFILTER_XT_MATCH_OSF=m
215−CONFIG_NETFILTER_XT_MATCH_OWNER=m
216−CONFIG_NETFILTER_XT_MATCH_POLICY=m
217−CONFIG_NETFILTER_XT_MATCH_PHYSDEV=m
218−CONFIG_NETFILTER_XT_MATCH_PKTTYPE=m
219−CONFIG_NETFILTER_XT_MATCH_QUOTA=m
220−CONFIG_NETFILTER_XT_MATCH_RATEEST=m
221−CONFIG_NETFILTER_XT_MATCH_REALM=m
222−CONFIG_NETFILTER_XT_MATCH_RECENT=m
223−CONFIG_NETFILTER_XT_MATCH_STATE=m
224−CONFIG_NETFILTER_XT_MATCH_STATISTIC=m
225−CONFIG_NETFILTER_XT_MATCH_STRING=m
226−CONFIG_NETFILTER_XT_MATCH_TCPMSS=m
227−CONFIG_NETFILTER_XT_MATCH_TIME=m
228−CONFIG_NETFILTER_XT_MATCH_U32=m
229−CONFIG_IP_SET=m
230−CONFIG_IP_SET_BITMAP_IP=m
231−CONFIG_IP_SET_BITMAP_IPMAC=m
232−CONFIG_IP_SET_BITMAP_PORT=m
233−CONFIG_IP_SET_HASH_IP=m
234−CONFIG_IP_SET_HASH_IPPORT=m
235−CONFIG_IP_SET_HASH_IPPORTIP=m
236−CONFIG_IP_SET_HASH_IPPORTNET=m
237−CONFIG_IP_SET_HASH_NETPORTNET=m
238−CONFIG_IP_SET_HASH_NET=m
239−CONFIG_IP_SET_HASH_NETNET=m
240−CONFIG_IP_SET_HASH_NETPORT=m
241−CONFIG_IP_SET_HASH_NETIFACE=m
242−CONFIG_IP_SET_LIST_SET=m
243−CONFIG_IP_VS=m
244−CONFIG_IP_VS_PROTO_TCP=y
245−CONFIG_IP_VS_PROTO_UDP=y
246−CONFIG_IP_VS_PROTO_ESP=y
247−CONFIG_IP_VS_PROTO_AH=y
248−CONFIG_IP_VS_RR=m
249−CONFIG_IP_VS_WRR=m
250−CONFIG_IP_VS_LC=m
251−CONFIG_IP_VS_WLC=m
252−CONFIG_IP_VS_LBLC=m
253−CONFIG_IP_VS_LBLCR=m
254−CONFIG_IP_VS_DH=m
255−CONFIG_IP_VS_SH=m
256−CONFIG_IP_VS_SED=m
257−CONFIG_IP_VS_NQ=m
258−CONFIG_IP_VS_FTP=m
259−CONFIG_IP_VS_PE_SIP=m
260−CONFIG_NF_CONNTRACK_IPV4=m
261−CONFIG_NF_TABLES_IPV4=m
262−CONFIG_NFT_CHAIN_ROUTE_IPV4=m
263−CONFIG_NF_TABLES_ARP=m
264−CONFIG_NFT_CHAIN_NAT_IPV4=m
265−CONFIG_IP_NF_IPTABLES=m
266−CONFIG_IP_NF_MATCH_AH=m
267−CONFIG_IP_NF_MATCH_ECN=m
268−CONFIG_IP_NF_MATCH_RPFILTER=m
269−CONFIG_IP_NF_MATCH_TTL=m
270−CONFIG_IP_NF_FILTER=m
271−CONFIG_IP_NF_TARGET_REJECT=m
272−CONFIG_IP_NF_NAT=m
273−CONFIG_IP_NF_TARGET_MASQUERADE=m
274−CONFIG_IP_NF_MANGLE=m
275−CONFIG_IP_NF_TARGET_CLUSTERIP=m
276−CONFIG_IP_NF_TARGET_ECN=m
277−CONFIG_IP_NF_TARGET_TTL=m
278−CONFIG_IP_NF_RAW=m
279−CONFIG_IP_NF_SECURITY=m
280−CONFIG_IP_NF_ARPTABLES=m
281−CONFIG_IP_NF_ARPFILTER=m
282−CONFIG_IP_NF_ARP_MANGLE=m
283−CONFIG_NF_CONNTRACK_IPV6=m
284−CONFIG_NF_TABLES_IPV6=m
285−CONFIG_NFT_CHAIN_ROUTE_IPV6=m
286−CONFIG_NFT_CHAIN_NAT_IPV6=m
287−CONFIG_IP6_NF_IPTABLES=m
288−CONFIG_IP6_NF_MATCH_AH=m
289−CONFIG_IP6_NF_MATCH_EUI64=m
290−CONFIG_IP6_NF_MATCH_FRAG=m
291−CONFIG_IP6_NF_MATCH_OPTS=m
292−CONFIG_IP6_NF_MATCH_HL=m
293−CONFIG_IP6_NF_MATCH_IPV6HEADER=m
294−CONFIG_IP6_NF_MATCH_MH=m
295−CONFIG_IP6_NF_MATCH_RPFILTER=m
296−CONFIG_IP6_NF_MATCH_RT=m
297−CONFIG_IP6_NF_TARGET_HL=m
298−CONFIG_IP6_NF_FILTER=m
299−CONFIG_IP6_NF_TARGET_REJECT=m
300−CONFIG_IP6_NF_MANGLE=m
301−CONFIG_IP6_NF_RAW=m
302−CONFIG_IP6_NF_SECURITY=m
303−CONFIG_IP6_NF_NAT=m
304−CONFIG_IP6_NF_TARGET_MASQUERADE=m
305−CONFIG_NF_TABLES_BRIDGE=m
306−CONFIG_NET_SCTPPROBE=m
307−CONFIG_RDS=m
308−CONFIG_RDS_RDMA=m
309−CONFIG_RDS_TCP=m
310−CONFIG_L2TP=m
311−CONFIG_L2TP_DEBUGFS=m
312−CONFIG_L2TP_V3=y
313−CONFIG_L2TP_IP=m
314−CONFIG_L2TP_ETH=m
315−CONFIG_BRIDGE=m
316−CONFIG_VLAN_8021Q=m
317−CONFIG_VLAN_8021Q_GVRP=y
318−CONFIG_NET_SCHED=y
319−CONFIG_NET_SCH_CBQ=m
320−CONFIG_NET_SCH_HTB=m
321−CONFIG_NET_SCH_HFSC=m
322−CONFIG_NET_SCH_PRIO=m
323−CONFIG_NET_SCH_MULTIQ=m
324−CONFIG_NET_SCH_RED=m
325−CONFIG_NET_SCH_SFB=m
326−CONFIG_NET_SCH_SFQ=m
327−CONFIG_NET_SCH_TEQL=m
328−CONFIG_NET_SCH_TBF=m
329−CONFIG_NET_SCH_GRED=m
330−CONFIG_NET_SCH_DSMARK=m
331−CONFIG_NET_SCH_NETEM=m
332−CONFIG_NET_SCH_DRR=m
333−CONFIG_NET_SCH_MQPRIO=m
334−CONFIG_NET_SCH_CHOKE=m
335−CONFIG_NET_SCH_QFQ=m
336−CONFIG_NET_SCH_CODEL=m
337−CONFIG_NET_SCH_FQ_CODEL=m
338−CONFIG_NET_SCH_INGRESS=m
339−CONFIG_NET_SCH_PLUG=m
340−CONFIG_NET_CLS_BASIC=m
341−CONFIG_NET_CLS_TCINDEX=m
342−CONFIG_NET_CLS_ROUTE4=m
343−CONFIG_NET_CLS_FW=m
344−CONFIG_NET_CLS_U32=m
345−CONFIG_CLS_U32_PERF=y
346−CONFIG_CLS_U32_MARK=y
347−CONFIG_NET_CLS_RSVP=m
348−CONFIG_NET_CLS_RSVP6=m
349−CONFIG_NET_CLS_FLOW=m
350−CONFIG_NET_CLS_CGROUP=y
351−CONFIG_NET_CLS_BPF=m
352−CONFIG_NET_CLS_ACT=y
353−CONFIG_NET_ACT_POLICE=m
354−CONFIG_NET_ACT_GACT=m
355−CONFIG_GACT_PROB=y
356−CONFIG_NET_ACT_MIRRED=m
357−CONFIG_NET_ACT_IPT=m
358−CONFIG_NET_ACT_NAT=m
359−CONFIG_NET_ACT_PEDIT=m
360−CONFIG_NET_ACT_SIMP=m
361−CONFIG_NET_ACT_SKBEDIT=m
362−CONFIG_NET_ACT_CSUM=m
363−CONFIG_DNS_RESOLVER=y
364−CONFIG_NETLINK_DIAG=m
365−CONFIG_CGROUP_NET_PRIO=y
366−CONFIG_BPF_JIT=y
367−CONFIG_NET_PKTGEN=m
368−CONFIG_NET_TCPPROBE=m
369−CONFIG_DEVTMPFS=y
370−CONFIG_DMA_CMA=y
371−CONFIG_CMA_SIZE_MBYTES=0
372−CONFIG_CONNECTOR=y
373−CONFIG_ZRAM=m
374−CONFIG_BLK_DEV_LOOP=m
375−CONFIG_BLK_DEV_CRYPTOLOOP=m
376−CONFIG_BLK_DEV_DRBD=m
377−CONFIG_BLK_DEV_NBD=m
378−CONFIG_BLK_DEV_RAM=y
379−CONFIG_BLK_DEV_RAM_SIZE=32768
380−CONFIG_BLK_DEV_RAM_DAX=y
381−CONFIG_VIRTIO_BLK=y
382−CONFIG_ENCLOSURE_SERVICES=m
383−CONFIG_GENWQE=m
384−CONFIG_RAID_ATTRS=m
385−CONFIG_SCSI=y
386−CONFIG_BLK_DEV_SD=y
387−CONFIG_CHR_DEV_ST=m
388−CONFIG_CHR_DEV_OSST=m
389−CONFIG_BLK_DEV_SR=m
390−CONFIG_CHR_DEV_SG=y
391−CONFIG_CHR_DEV_SCH=m
392−CONFIG_SCSI_ENCLOSURE=m
393−CONFIG_SCSI_CONSTANTS=y
394−CONFIG_SCSI_LOGGING=y
395−CONFIG_SCSI_SPI_ATTRS=m
396−CONFIG_SCSI_FC_ATTRS=y
397−CONFIG_SCSI_SAS_LIBSAS=m
398−CONFIG_SCSI_SRP_ATTRS=m
399−CONFIG_ISCSI_TCP=m
400−CONFIG_SCSI_DEBUG=m
401−CONFIG_ZFCP=y
402−CONFIG_SCSI_VIRTIO=m
403−CONFIG_SCSI_DH=y
404−CONFIG_SCSI_DH_RDAC=m
405−CONFIG_SCSI_DH_HP_SW=m
406−CONFIG_SCSI_DH_EMC=m
407−CONFIG_SCSI_DH_ALUA=m
408−CONFIG_SCSI_OSD_INITIATOR=m
409−CONFIG_SCSI_OSD_ULD=m
410−CONFIG_MD=y
411−CONFIG_BLK_DEV_MD=y
412−CONFIG_MD_LINEAR=m
413−CONFIG_MD_MULTIPATH=m
414−CONFIG_MD_FAULTY=m
415−CONFIG_BLK_DEV_DM=m
416−CONFIG_DM_CRYPT=m
417−CONFIG_DM_SNAPSHOT=m
418−CONFIG_DM_THIN_PROVISIONING=m
419−CONFIG_DM_MIRROR=m
420−CONFIG_DM_LOG_USERSPACE=m
421−CONFIG_DM_RAID=m
422−CONFIG_DM_ZERO=m
423−CONFIG_DM_MULTIPATH=m
424−CONFIG_DM_MULTIPATH_QL=m
425−CONFIG_DM_MULTIPATH_ST=m
426−CONFIG_DM_DELAY=m
427−CONFIG_DM_UEVENT=y
428−CONFIG_DM_FLAKEY=m
429−CONFIG_DM_VERITY=m
430−CONFIG_DM_SWITCH=m
431−CONFIG_NETDEVICES=y
432−CONFIG_BONDING=m
433−CONFIG_DUMMY=m
434−CONFIG_EQUALIZER=m
435−CONFIG_IFB=m
436−CONFIG_MACVLAN=m
437−CONFIG_MACVTAP=m
438−CONFIG_VXLAN=m
439−CONFIG_TUN=m
440−CONFIG_VETH=m
441−CONFIG_VIRTIO_NET=m
442−CONFIG_NLMON=m
443−# CONFIG_NET_VENDOR_ARC is not set
444−# CONFIG_NET_VENDOR_CHELSIO is not set
445−# CONFIG_NET_VENDOR_INTEL is not set
446−# CONFIG_NET_VENDOR_MARVELL is not set
447−CONFIG_MLX4_EN=m
448−CONFIG_MLX5_CORE=m
449−CONFIG_MLX5_CORE_EN=y
450−# CONFIG_NET_VENDOR_NATSEMI is not set
451−CONFIG_PPP=m
452−CONFIG_PPP_BSDCOMP=m
453−CONFIG_PPP_DEFLATE=m
454−CONFIG_PPP_MPPE=m
455−CONFIG_PPPOE=m
456−CONFIG_PPTP=m
457−CONFIG_PPPOL2TP=m
458−CONFIG_PPP_ASYNC=m
459−CONFIG_PPP_SYNC_TTY=m
460−# CONFIG_INPUT_KEYBOARD is not set
461−# CONFIG_INPUT_MOUSE is not set
462−# CONFIG_SERIO is not set
463−CONFIG_LEGACY_PTY_COUNT=0
464−CONFIG_HW_RANDOM_VIRTIO=m
465−CONFIG_RAW_DRIVER=m
466−CONFIG_HANGCHECK_TIMER=m
467−CONFIG_TN3270_FS=y
468−# CONFIG_HWMON is not set
469−CONFIG_WATCHDOG=y
470−CONFIG_WATCHDOG_NOWAYOUT=y
471−CONFIG_SOFT_WATCHDOG=m
472−CONFIG_DIAG288_WATCHDOG=m
473−# CONFIG_HID is not set
474−# CONFIG_USB_SUPPORT is not set
475−CONFIG_INFINIBAND=m
476−CONFIG_INFINIBAND_USER_ACCESS=m
477−CONFIG_MLX4_INFINIBAND=m
478−CONFIG_MLX5_INFINIBAND=m
479−CONFIG_VFIO=m
480−CONFIG_VFIO_PCI=m
481−CONFIG_VIRTIO_BALLOON=m
482−CONFIG_EXT4_FS=y
483−CONFIG_EXT4_FS_POSIX_ACL=y
484−CONFIG_EXT4_FS_SECURITY=y
485−CONFIG_EXT4_ENCRYPTION=y
486−CONFIG_JBD2_DEBUG=y
487−CONFIG_JFS_FS=m
488−CONFIG_JFS_POSIX_ACL=y
489−CONFIG_JFS_SECURITY=y
490−CONFIG_JFS_STATISTICS=y
491−CONFIG_XFS_FS=y
492−CONFIG_XFS_QUOTA=y
493−CONFIG_XFS_POSIX_ACL=y
494−CONFIG_XFS_RT=y
495−CONFIG_GFS2_FS=m
496−CONFIG_GFS2_FS_LOCKING_DLM=y
497−CONFIG_OCFS2_FS=m
498−CONFIG_BTRFS_FS=y
499−CONFIG_BTRFS_FS_POSIX_ACL=y
500−CONFIG_NILFS2_FS=m
501−CONFIG_FS_DAX=y
502−CONFIG_EXPORTFS_BLOCK_OPS=y
503−CONFIG_FANOTIFY=y
504−CONFIG_FANOTIFY_ACCESS_PERMISSIONS=y
505−CONFIG_QUOTA_NETLINK_INTERFACE=y
506−CONFIG_QFMT_V1=m
507−CONFIG_QFMT_V2=m
508−CONFIG_AUTOFS4_FS=m
509−CONFIG_FUSE_FS=y
510−CONFIG_CUSE=m
511−CONFIG_OVERLAY_FS=m
512−CONFIG_OVERLAY_FS_REDIRECT_DIR=y
513−CONFIG_FSCACHE=m
514−CONFIG_CACHEFILES=m
515−CONFIG_ISO9660_FS=y
516−CONFIG_JOLIET=y
517−CONFIG_ZISOFS=y
518−CONFIG_UDF_FS=m
519−CONFIG_MSDOS_FS=m
520−CONFIG_VFAT_FS=m
521−CONFIG_NTFS_FS=m
522−CONFIG_NTFS_RW=y
523−CONFIG_PROC_KCORE=y
524−CONFIG_TMPFS=y
525−CONFIG_TMPFS_POSIX_ACL=y
526−CONFIG_HUGETLBFS=y
527−CONFIG_CONFIGFS_FS=m
528−CONFIG_ECRYPT_FS=m
529−CONFIG_CRAMFS=m
530−CONFIG_SQUASHFS=m
531−CONFIG_SQUASHFS_XATTR=y
532−CONFIG_SQUASHFS_LZO=y
533−CONFIG_SQUASHFS_XZ=y
534−CONFIG_ROMFS_FS=m
535−CONFIG_NFS_FS=m
536−CONFIG_NFS_V3_ACL=y
537−CONFIG_NFS_V4=m
538−CONFIG_NFS_SWAP=y
539−CONFIG_NFSD=m
540−CONFIG_NFSD_V3_ACL=y
541−CONFIG_NFSD_V4=y
542−CONFIG_NFSD_V4_SECURITY_LABEL=y
543−CONFIG_CIFS=m
544−CONFIG_CIFS_STATS=y
545−CONFIG_CIFS_STATS2=y
546−CONFIG_CIFS_WEAK_PW_HASH=y
547−CONFIG_CIFS_UPCALL=y
548−CONFIG_CIFS_XATTR=y
549−CONFIG_CIFS_POSIX=y
550−# CONFIG_CIFS_DEBUG is not set
551−CONFIG_CIFS_DFS_UPCALL=y
552−CONFIG_NLS_DEFAULT="utf8"
553−CONFIG_NLS_CODEPAGE_437=m
554−CONFIG_NLS_CODEPAGE_850=m
555−CONFIG_NLS_ASCII=m
556−CONFIG_NLS_ISO8859_1=m
557−CONFIG_NLS_ISO8859_15=m
558−CONFIG_NLS_UTF8=m
559−CONFIG_DLM=m
560−CONFIG_PRINTK_TIME=y
561−CONFIG_DEBUG_INFO=y
562−CONFIG_DEBUG_INFO_DWARF4=y
563−CONFIG_GDB_SCRIPTS=y
564−# CONFIG_ENABLE_MUST_CHECK is not set
565−CONFIG_FRAME_WARN=1024
566−CONFIG_UNUSED_SYMBOLS=y
567−CONFIG_MAGIC_SYSRQ=y
568−CONFIG_DEBUG_MEMORY_INIT=y
569−CONFIG_PANIC_ON_OOPS=y
570−CONFIG_RCU_TORTURE_TEST=m
571−CONFIG_RCU_CPU_STALL_TIMEOUT=60
572−CONFIG_LATENCYTOP=y
573−CONFIG_SCHED_TRACER=y
574−CONFIG_FTRACE_SYSCALLS=y
575−CONFIG_STACK_TRACER=y
576−CONFIG_BLK_DEV_IO_TRACE=y
577−CONFIG_FUNCTION_PROFILER=y
578−CONFIG_HIST_TRIGGERS=y
579−CONFIG_LKDTM=m
580−CONFIG_PERCPU_TEST=m
581−CONFIG_ATOMIC64_SELFTEST=y
582−CONFIG_TEST_BPF=m
583−CONFIG_BUG_ON_DATA_CORRUPTION=y
584−CONFIG_S390_PTDUMP=y
585−CONFIG_PERSISTENT_KEYRINGS=y
586−CONFIG_BIG_KEYS=y
587−CONFIG_ENCRYPTED_KEYS=m
588−CONFIG_SECURITY=y
589−CONFIG_SECURITY_NETWORK=y
590−CONFIG_SECURITY_SELINUX=y
591−CONFIG_SECURITY_SELINUX_BOOTPARAM=y
592−CONFIG_SECURITY_SELINUX_BOOTPARAM_VALUE=0
593−CONFIG_SECURITY_SELINUX_DISABLE=y
594−CONFIG_INTEGRITY_SIGNATURE=y
595−CONFIG_INTEGRITY_ASYMMETRIC_KEYS=y
596−CONFIG_IMA=y
597−CONFIG_IMA_WRITE_POLICY=y
598−CONFIG_IMA_APPRAISE=y
599−CONFIG_CRYPTO_DH=m
600−CONFIG_CRYPTO_ECDH=m
601−CONFIG_CRYPTO_USER=m
602−# CONFIG_CRYPTO_MANAGER_DISABLE_TESTS is not set
603−CONFIG_CRYPTO_PCRYPT=m
604−CONFIG_CRYPTO_CRYPTD=m
605−CONFIG_CRYPTO_MCRYPTD=m
606−CONFIG_CRYPTO_TEST=m
607−CONFIG_CRYPTO_CHACHA20POLY1305=m
608−CONFIG_CRYPTO_LRW=m
609−CONFIG_CRYPTO_PCBC=m
610−CONFIG_CRYPTO_KEYWRAP=m
611−CONFIG_CRYPTO_XCBC=m
612−CONFIG_CRYPTO_VMAC=m
613−CONFIG_CRYPTO_CRC32=m
614−CONFIG_CRYPTO_MICHAEL_MIC=m
615−CONFIG_CRYPTO_RMD128=m
616−CONFIG_CRYPTO_RMD160=m
617−CONFIG_CRYPTO_RMD256=m
618−CONFIG_CRYPTO_RMD320=m
619−CONFIG_CRYPTO_SHA512=m
620−CONFIG_CRYPTO_SHA3=m
621−CONFIG_CRYPTO_TGR192=m
622−CONFIG_CRYPTO_WP512=m
623−CONFIG_CRYPTO_AES_TI=m
624−CONFIG_CRYPTO_ANUBIS=m
625−CONFIG_CRYPTO_BLOWFISH=m
626−CONFIG_CRYPTO_CAMELLIA=m
627−CONFIG_CRYPTO_CAST5=m
628−CONFIG_CRYPTO_CAST6=m
629−CONFIG_CRYPTO_FCRYPT=m
630−CONFIG_CRYPTO_KHAZAD=m
631−CONFIG_CRYPTO_SALSA20=m
632−CONFIG_CRYPTO_SEED=m
633−CONFIG_CRYPTO_SERPENT=m
634−CONFIG_CRYPTO_TEA=m
635−CONFIG_CRYPTO_TWOFISH=m
636−CONFIG_CRYPTO_842=m
637−CONFIG_CRYPTO_LZ4=m
638−CONFIG_CRYPTO_LZ4HC=m
639−CONFIG_CRYPTO_ANSI_CPRNG=m
640−CONFIG_CRYPTO_USER_API_HASH=m
641−CONFIG_CRYPTO_USER_API_SKCIPHER=m
642−CONFIG_CRYPTO_USER_API_RNG=m
643−CONFIG_CRYPTO_USER_API_AEAD=m
644−CONFIG_ZCRYPT=m
645−CONFIG_PKEY=m
646−CONFIG_CRYPTO_PAES_S390=m
647−CONFIG_CRYPTO_SHA1_S390=m
648−CONFIG_CRYPTO_SHA256_S390=m
649−CONFIG_CRYPTO_SHA512_S390=m
650−CONFIG_CRYPTO_DES_S390=m
651−CONFIG_CRYPTO_AES_S390=m
652−CONFIG_CRYPTO_GHASH_S390=m
653−CONFIG_CRYPTO_CRC32_S390=y
654−CONFIG_CRC7=m
655−CONFIG_CRC8=m
656−CONFIG_CORDIC=m
657−CONFIG_CMM=m
658−CONFIG_APPLDATA_BASE=y
659−CONFIG_KVM=m
660−CONFIG_KVM_S390_UCONTROL=y
661−CONFIG_VHOST_NET=m
arch/s390/configs/performance_defconfig+15−5
@@ -25,13 +25,13 @@ CONFIG_CPUSETS=y · 24 unmodified lines
2525 CONFIG_CGROUP_DEVICE=y
2626 CONFIG_CGROUP_CPUACCT=y
2727 CONFIG_CGROUP_PERF=y
28−CONFIG_CHECKPOINT_RESTORE=y
2928 CONFIG_NAMESPACES=y
3029 CONFIG_USER_NS=y
3130 CONFIG_SCHED_AUTOGROUP=y
3231 CONFIG_BLK_DEV_INITRD=y
3332 CONFIG_EXPERT=y
3433 # CONFIG_SYSFS_SYSCALL is not set
34+CONFIG_CHECKPOINT_RESTORE=y
3535 CONFIG_BPF_SYSCALL=y
3636 CONFIG_USERFAULTFD=y
3737 # CONFIG_COMPAT_BRK is not set
@@ -45,6 +45,8 @@ CONFIG_MODULE_UNLOAD=y · 7 unmodified lines
4545 CONFIG_MODULE_FORCE_UNLOAD=y
4646 CONFIG_MODVERSIONS=y
4747 CONFIG_MODULE_SRCVERSION_ALL=y
48+CONFIG_MODULE_SIG=y
49+CONFIG_MODULE_SIG_SHA256=y
4850 CONFIG_BLK_DEV_INTEGRITY=y
4951 CONFIG_BLK_DEV_THROTTLING=y
5052 CONFIG_BLK_WBT=y
@@ -62,6 +64,7 @@ CONFIG_TUNE_ZEC12=y · 11 unmodified lines
6264 CONFIG_NR_CPUS=512
6365 CONFIG_NUMA=y
6466 CONFIG_HZ_100=y
67+CONFIG_KEXEC_FILE=y
6568 CONFIG_MEMORY_HOTPLUG=y
6669 CONFIG_MEMORY_HOTREMOVE=y
6770 CONFIG_KSM=y
@@ -301,7 +304,6 @@ CONFIG_IP6_NF_SECURITY=m · 233 unmodified lines
301304 CONFIG_IP6_NF_NAT=m
302305 CONFIG_IP6_NF_TARGET_MASQUERADE=m
303306 CONFIG_NF_TABLES_BRIDGE=m
304−CONFIG_NET_SCTPPROBE=m
305307 CONFIG_RDS=m
306308 CONFIG_RDS_RDMA=m
307309 CONFIG_RDS_TCP=m
@@ -359,11 +361,11 @@ CONFIG_NET_ACT_SIMP=m · 51 unmodified lines
359361 CONFIG_NET_ACT_SKBEDIT=m
360362 CONFIG_NET_ACT_CSUM=m
361363 CONFIG_DNS_RESOLVER=y
364+CONFIG_OPENVSWITCH=m
362365 CONFIG_NETLINK_DIAG=m
363366 CONFIG_CGROUP_NET_PRIO=y
364367 CONFIG_BPF_JIT=y
365368 CONFIG_NET_PKTGEN=m
366−CONFIG_NET_TCPPROBE=m
367369 CONFIG_DEVTMPFS=y
368370 CONFIG_DMA_CMA=y
369371 CONFIG_CMA_SIZE_MBYTES=0
@@ -375,8 +377,9 @@ CONFIG_BLK_DEV_DRBD=m · 5 unmodified lines
375377 CONFIG_BLK_DEV_NBD=m
376378 CONFIG_BLK_DEV_RAM=y
377379 CONFIG_BLK_DEV_RAM_SIZE=32768
378−CONFIG_BLK_DEV_RAM_DAX=y
379380 CONFIG_VIRTIO_BLK=y
381+CONFIG_BLK_DEV_RBD=m
382+CONFIG_BLK_DEV_NVME=m
380383 CONFIG_ENCLOSURE_SERVICES=m
381384 CONFIG_GENWQE=m
382385 CONFIG_RAID_ATTRS=m
@@ -455,6 +458,7 @@ CONFIG_PPTP=m · 72 unmodified lines
455458 CONFIG_PPPOL2TP=m
456459 CONFIG_PPP_ASYNC=m
457460 CONFIG_PPP_SYNC_TTY=m
461+CONFIG_INPUT_EVDEV=y
458462 # CONFIG_INPUT_KEYBOARD is not set
459463 # CONFIG_INPUT_MOUSE is not set
460464 # CONFIG_SERIO is not set
@@ -468,6 +472,9 @@ CONFIG_WATCHDOG=y · 7 unmodified lines
468472 CONFIG_WATCHDOG_NOWAYOUT=y
469473 CONFIG_SOFT_WATCHDOG=m
470474 CONFIG_DIAG288_WATCHDOG=m
475+CONFIG_DRM=y
476+CONFIG_DRM_VIRTIO_GPU=y
477+CONFIG_FRAMEBUFFER_CONSOLE=y
471478 # CONFIG_HID is not set
472479 # CONFIG_USB_SUPPORT is not set
473480 CONFIG_INFINIBAND=m
@@ -476,7 +483,9 @@ CONFIG_MLX4_INFINIBAND=m · 2 unmodified lines
476483 CONFIG_MLX5_INFINIBAND=m
477484 CONFIG_VFIO=m
478485 CONFIG_VFIO_PCI=m
486+CONFIG_VIRTIO_PCI=m
479487 CONFIG_VIRTIO_BALLOON=m
488+CONFIG_VIRTIO_INPUT=y
480489 CONFIG_EXT4_FS=y
481490 CONFIG_EXT4_FS_POSIX_ACL=y
482491 CONFIG_EXT4_FS_SECURITY=y
@@ -507,7 +516,6 @@ CONFIG_AUTOFS4_FS=m · 24 unmodified lines
507516 CONFIG_FUSE_FS=y
508517 CONFIG_CUSE=m
509518 CONFIG_OVERLAY_FS=m
510−CONFIG_OVERLAY_FS_REDIRECT_DIR=y
511519 CONFIG_FSCACHE=m
512520 CONFIG_CACHEFILES=m
513521 CONFIG_ISO9660_FS=y
@@ -592,8 +600,10 @@ CONFIG_SECURITY_SELINUX_DISABLE=y · 78 unmodified lines
592600 CONFIG_INTEGRITY_SIGNATURE=y
593601 CONFIG_INTEGRITY_ASYMMETRIC_KEYS=y
594602 CONFIG_IMA=y
603+CONFIG_IMA_DEFAULT_HASH_SHA256=y
595604 CONFIG_IMA_WRITE_POLICY=y
596605 CONFIG_IMA_APPRAISE=y
606+CONFIG_CRYPTO_FIPS=y
597607 CONFIG_CRYPTO_DH=m
598608 CONFIG_CRYPTO_ECDH=m
599609 CONFIG_CRYPTO_USER=m
arch/s390/defconfig+11−2
@@ -8,6 +8,7 @@ CONFIG_TASKSTATS=y · 7 unmodified lines
88 CONFIG_TASK_DELAY_ACCT=y
99 CONFIG_TASK_XACCT=y
1010 CONFIG_TASK_IO_ACCOUNTING=y
11+# CONFIG_CPU_ISOLATION is not set
1112 CONFIG_IKCONFIG=y
1213 CONFIG_IKCONFIG_PROC=y
1314 CONFIG_CGROUPS=y
@@ -23,12 +24,12 @@ CONFIG_CPUSETS=y · 9 unmodified lines
2324 CONFIG_CGROUP_DEVICE=y
2425 CONFIG_CGROUP_CPUACCT=y
2526 CONFIG_CGROUP_PERF=y
26−CONFIG_CHECKPOINT_RESTORE=y
2727 CONFIG_NAMESPACES=y
2828 CONFIG_USER_NS=y
2929 CONFIG_BLK_DEV_INITRD=y
3030 CONFIG_EXPERT=y
3131 # CONFIG_SYSFS_SYSCALL is not set
32+CONFIG_CHECKPOINT_RESTORE=y
3233 CONFIG_BPF_SYSCALL=y
3334 CONFIG_USERFAULTFD=y
3435 # CONFIG_COMPAT_BRK is not set
@@ -47,6 +48,7 @@ CONFIG_LIVEPATCH=y · 12 unmodified lines
4748 CONFIG_NR_CPUS=256
4849 CONFIG_NUMA=y
4950 CONFIG_HZ_100=y
51+CONFIG_KEXEC_FILE=y
5052 CONFIG_MEMORY_HOTPLUG=y
5153 CONFIG_MEMORY_HOTREMOVE=y
5254 CONFIG_KSM=y
@@ -129,10 +131,13 @@ CONFIG_EQUALIZER=m · 76 unmodified lines
129131 CONFIG_TUN=m
130132 CONFIG_VIRTIO_NET=y
131133 # CONFIG_NET_VENDOR_ALACRITECH is not set
134+# CONFIG_NET_VENDOR_CORTINA is not set
132135 # CONFIG_NET_VENDOR_SOLARFLARE is not set
136+# CONFIG_NET_VENDOR_SOCIONEXT is not set
133137 # CONFIG_NET_VENDOR_SYNOPSYS is not set
134138 # CONFIG_INPUT is not set
135139 # CONFIG_SERIO is not set
140+# CONFIG_VT is not set
136141 CONFIG_DEVKMEM=y
137142 CONFIG_RAW_DRIVER=m
138143 CONFIG_VIRTIO_BALLOON=y
@@ -177,13 +182,15 @@ CONFIG_TRACER_SNAPSHOT_PER_CPU_SWAP=y · 38 unmodified lines
177182 CONFIG_STACK_TRACER=y
178183 CONFIG_BLK_DEV_IO_TRACE=y
179184 CONFIG_FUNCTION_PROFILER=y
180−CONFIG_KPROBES_SANITY_TEST=y
185+# CONFIG_RUNTIME_TESTING_MENU is not set
181186 CONFIG_S390_PTDUMP=y
182187 CONFIG_CRYPTO_CRYPTD=m
188+CONFIG_CRYPTO_AUTHENC=m
183189 CONFIG_CRYPTO_TEST=m
184190 CONFIG_CRYPTO_CCM=m
185191 CONFIG_CRYPTO_GCM=m
186192 CONFIG_CRYPTO_CBC=y
193+CONFIG_CRYPTO_CFB=m
187194 CONFIG_CRYPTO_CTS=m
188195 CONFIG_CRYPTO_LRW=m
189196 CONFIG_CRYPTO_PCBC=m
@@ -213,6 +220,8 @@ CONFIG_CRYPTO_KHAZAD=m · 23 unmodified lines
213220 CONFIG_CRYPTO_SALSA20=m
214221 CONFIG_CRYPTO_SEED=m
215222 CONFIG_CRYPTO_SERPENT=m
223+CONFIG_CRYPTO_SM4=m
224+CONFIG_CRYPTO_SPECK=m
216225 CONFIG_CRYPTO_TEA=m
217226 CONFIG_CRYPTO_TWOFISH=m
218227 CONFIG_CRYPTO_DEFLATE=m
arch/s390/hypfs/inode.c+1−1
@@ -320,7 +320,7 @@ static void hypfs_kill_super(struct super_block *sb) · 319 unmodified lines
320320
321321 if (sb->s_root)
322322 hypfs_delete_tree(sb->s_root);
323− if (sb_info->update_file)
323+ if (sb_info && sb_info->update_file)
324324 hypfs_remove(sb_info->update_file);
325325 kfree(sb->s_fs_info);
326326 sb->s_fs_info = NULL;
arch/s390/include/asm/kexec.h+23−0
@@ -46,4 +46,27 @@ · 45 unmodified lines
4646 static inline void crash_setup_regs(struct pt_regs *newregs,
4747 struct pt_regs *oldregs) { }
4848
49+struct kimage;
50+struct s390_load_data {
51+ /* Pointer to the kernel buffer. Used to register cmdline etc.. */
52+ void *kernel_buf;
53+
54+ /* Total size of loaded segments in memory. Used as an offset. */
55+ size_t memsz;
56+
57+ /* Load address of initrd. Used to register INITRD_START in kernel. */
58+ unsigned long initrd_load_addr;
59+};
60+
61+int kexec_file_add_purgatory(struct kimage *image,
62+ struct s390_load_data *data);
63+int kexec_file_add_initrd(struct kimage *image,
64+ struct s390_load_data *data,
65+ char *initrd, unsigned long initrd_len);
66+int *kexec_file_update_kernel(struct kimage *iamge,
67+ struct s390_load_data *data);
68+
69+extern const struct kexec_file_ops s390_kexec_image_ops;
70+extern const struct kexec_file_ops s390_kexec_elf_ops;
71+
4972 #endif /*_S390_KEXEC_H */
arch/s390/include/asm/purgatory.h+17−0
@@ -0,0 +1,17 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+/*
3+ * Copyright IBM Corp. 2018
4+ *
5+ * Author(s): Philipp Rudo <prudo@linux.vnet.ibm.com>
6+ */
7+
8+#ifndef _S390_PURGATORY_H_
9+#define _S390_PURGATORY_H_
10+#ifndef __ASSEMBLY__
11+
12+#include <linux/purgatory.h>
13+
14+int verify_sha256_digest(void);
15+
16+#endif /* __ASSEMBLY__ */
17+#endif /* _S390_PURGATORY_H_ */
arch/s390/include/asm/setup.h+27−13
@@ -1,7 +1,7 @@
11 /* SPDX-License-Identifier: GPL-2.0 */
22 /*
33 * S390 version
4− * Copyright IBM Corp. 1999, 2010
4+ * Copyright IBM Corp. 1999, 2017
55 */
66 #ifndef _ASM_S390_SETUP_H
77 #define _ASM_S390_SETUP_H
@@ -37,17 +37,31 @@ · 29 unmodified lines
3737 #define LPP_MAGIC _BITUL(31)
3838 #define LPP_PID_MASK _AC(0xffffffff, UL)
3939
40+/* Offsets to entry points in kernel/head.S */
41+
42+#define STARTUP_NORMAL_OFFSET 0x10000
43+#define STARTUP_KDUMP_OFFSET 0x10010
44+
45+/* Offsets to parameters in kernel/head.S */
46+
47+#define IPL_DEVICE_OFFSET 0x10400
48+#define INITRD_START_OFFSET 0x10408
49+#define INITRD_SIZE_OFFSET 0x10410
50+#define OLDMEM_BASE_OFFSET 0x10418
51+#define OLDMEM_SIZE_OFFSET 0x10420
52+#define COMMAND_LINE_OFFSET 0x10480
53+
4054 #ifndef __ASSEMBLY__
4155
4256 #include <asm/lowcore.h>
4357 #include <asm/types.h>
4458
45−#define IPL_DEVICE (*(unsigned long *) (0x10400))
46−#define INITRD_START (*(unsigned long *) (0x10408))
47−#define INITRD_SIZE (*(unsigned long *) (0x10410))
48−#define OLDMEM_BASE (*(unsigned long *) (0x10418))
49−#define OLDMEM_SIZE (*(unsigned long *) (0x10420))
50−#define COMMAND_LINE ((char *) (0x10480))
59+#define IPL_DEVICE (*(unsigned long *) (IPL_DEVICE_OFFSET))
60+#define INITRD_START (*(unsigned long *) (INITRD_START_OFFSET))
61+#define INITRD_SIZE (*(unsigned long *) (INITRD_SIZE_OFFSET))
62+#define OLDMEM_BASE (*(unsigned long *) (OLDMEM_BASE_OFFSET))
63+#define OLDMEM_SIZE (*(unsigned long *) (OLDMEM_SIZE_OFFSET))
64+#define COMMAND_LINE ((char *) (COMMAND_LINE_OFFSET))
5165
5266 extern int memory_end_set;
5367 extern unsigned long memory_end;
@@ -121,12 +135,12 @@ extern void (*_machine_power_off)(void); · 67 unmodified lines
121135
122136 #else /* __ASSEMBLY__ */
123137
124−#define IPL_DEVICE 0x10400
125−#define INITRD_START 0x10408
126−#define INITRD_SIZE 0x10410
127−#define OLDMEM_BASE 0x10418
128−#define OLDMEM_SIZE 0x10420
129−#define COMMAND_LINE 0x10480
138+#define IPL_DEVICE (IPL_DEVICE_OFFSET)
139+#define INITRD_START (INITRD_START_OFFSET)
140+#define INITRD_SIZE (INITRD_SIZE_OFFSET)
141+#define OLDMEM_BASE (OLDMEM_BASE_OFFSET)
142+#define OLDMEM_SIZE (OLDMEM_SIZE_OFFSET)
143+#define COMMAND_LINE (COMMAND_LINE_OFFSET)
130144
131145 #endif /* __ASSEMBLY__ */
132146 #endif /* _ASM_S390_SETUP_H */
arch/s390/include/asm/thread_info.h+3−0
@@ -45,6 +45,9 @@ struct thread_info { · 44 unmodified lines
4545 void arch_release_task_struct(struct task_struct *tsk);
4646 int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src);
4747
48+void arch_setup_new_exec(void);
49+#define arch_setup_new_exec arch_setup_new_exec
50+
4851 #endif
4952
5053 /*
arch/s390/include/uapi/asm/signal.h+16−7
@@ -97,22 +97,31 @@ typedef unsigned long sigset_t; · 96 unmodified lines
9797 #include <asm-generic/signal-defs.h>
9898
9999 #ifndef __KERNEL__
100−/* Here we must cater to libcs that poke about in kernel headers. */
101100
101+/*
102+ * There are two system calls in regard to sigaction, sys_rt_sigaction
103+ * and sys_sigaction. Internally the kernel uses the struct old_sigaction
104+ * for the older sys_sigaction system call, and the kernel version of the
105+ * struct sigaction for the newer sys_rt_sigaction.
106+ *
107+ * The uapi definition for struct sigaction has made a strange distinction
108+ * between 31-bit and 64-bit in the past. For 64-bit the uapi structure
109+ * looks like the kernel struct sigaction, but for 31-bit it used to
110+ * look like the kernel struct old_sigaction. That practically made the
111+ * structure unusable for either system call. To get around this problem
112+ * the glibc always had its own definitions for the sigaction structures.
113+ *
114+ * The current struct sigaction uapi definition below is suitable for the
115+ * sys_rt_sigaction system call only.
116+ */
102117 struct sigaction {
103118 union {
104119 __sighandler_t _sa_handler;
105120 void (*_sa_sigaction)(int, struct siginfo *, void *);
106121 } _u;
107−#ifndef __s390x__ /* lovely */
108− sigset_t sa_mask;
109− unsigned long sa_flags;
110− void (*sa_restorer)(void);
111−#else /* __s390x__ */
112122 unsigned long sa_flags;
113123 void (*sa_restorer)(void);
114124 sigset_t sa_mask;
115−#endif /* __s390x__ */
116125 };
117126
118127 #define sa_handler _u._sa_handler
arch/s390/kernel/Makefile+3−0
@@ -82,6 +82,9 @@ obj-$(CONFIG_FUNCTION_TRACER) += mcount.o ftrace.o · 81 unmodified lines
8282 obj-$(CONFIG_CRASH_DUMP) += crash_dump.o
8383 obj-$(CONFIG_UPROBES) += uprobes.o
8484
85+obj-$(CONFIG_KEXEC_FILE) += machine_kexec_file.o kexec_image.o
86+obj-$(CONFIG_KEXEC_FILE) += kexec_elf.o
87+
8588 obj-$(CONFIG_PERF_EVENTS) += perf_event.o perf_cpum_cf.o perf_cpum_sf.o
8689 obj-$(CONFIG_PERF_EVENTS) += perf_cpum_cf_events.o perf_regs.o
8790
arch/s390/kernel/asm-offsets.c+5−0
@@ -10,6 +10,7 @@ · 9 unmodified lines
1010 #include <linux/kbuild.h>
1111 #include <linux/kvm_host.h>
1212 #include <linux/sched.h>
13+#include <linux/purgatory.h>
1314 #include <asm/idle.h>
1415 #include <asm/vdso.h>
1516 #include <asm/pgtable.h>
@@ -204,5 +205,9 @@ int main(void) · 188 unmodified lines
204205 OFFSET(__GMAP_ASCE, gmap, asce);
205206 OFFSET(__SIE_PROG0C, kvm_s390_sie_block, prog0c);
206207 OFFSET(__SIE_PROG20, kvm_s390_sie_block, prog20);
208+ /* kexec_sha_region */
209+ OFFSET(__KEXEC_SHA_REGION_START, kexec_sha_region, start);
210+ OFFSET(__KEXEC_SHA_REGION_LEN, kexec_sha_region, len);
211+ DEFINE(__KEXEC_SHA_REGION_SIZE, sizeof(struct kexec_sha_region));
207212 return 0;
208213 }
arch/s390/kernel/compat_wrapper.c+1−0
@@ -182,3 +182,4 @@ COMPAT_SYSCALL_WRAP6(copy_file_range, int, fd_in, loff_t __user *, off_in, int, · 181 unmodified lines
182182 COMPAT_SYSCALL_WRAP2(s390_guarded_storage, int, command, struct gs_cb *, gs_cb);
183183 COMPAT_SYSCALL_WRAP5(statx, int, dfd, const char __user *, path, unsigned, flags, unsigned, mask, struct statx __user *, buffer);
184184 COMPAT_SYSCALL_WRAP4(s390_sthyi, unsigned long, code, void __user *, info, u64 __user *, rc, unsigned long, flags);
185+COMPAT_SYSCALL_WRAP5(kexec_file_load, int, kernel_fd, int, initrd_fd, unsigned long, cmdline_len, const char __user *, cmdline_ptr, unsigned long, flags)
arch/s390/kernel/kexec_elf.c+147−0
@@ -0,0 +1,147 @@
1+// SPDX-License-Identifier: GPL-2.0
2+/*
3+ * ELF loader for kexec_file_load system call.
4+ *
5+ * Copyright IBM Corp. 2018
6+ *
7+ * Author(s): Philipp Rudo <prudo@linux.vnet.ibm.com>
8+ */
9+
10+#include <linux/errno.h>
11+#include <linux/kernel.h>
12+#include <linux/kexec.h>
13+#include <asm/setup.h>
14+
15+static int kexec_file_add_elf_kernel(struct kimage *image,
16+ struct s390_load_data *data,
17+ char *kernel, unsigned long kernel_len)
18+{
19+ struct kexec_buf buf;
20+ const Elf_Ehdr *ehdr;
21+ const Elf_Phdr *phdr;
22+ int i, ret;
23+
24+ ehdr = (Elf_Ehdr *)kernel;
25+ buf.image = image;
26+
27+ phdr = (void *)ehdr + ehdr->e_phoff;
28+ for (i = 0; i < ehdr->e_phnum; i++, phdr++) {
29+ if (phdr->p_type != PT_LOAD)
30+ continue;
31+
32+ buf.buffer = kernel + phdr->p_offset;
33+ buf.bufsz = phdr->p_filesz;
34+
35+ buf.mem = ALIGN(phdr->p_paddr, phdr->p_align);
36+ buf.memsz = phdr->p_memsz;
37+
38+ if (phdr->p_paddr == 0) {
39+ data->kernel_buf = buf.buffer;
40+ data->memsz += STARTUP_NORMAL_OFFSET;
41+
42+ buf.buffer += STARTUP_NORMAL_OFFSET;
43+ buf.bufsz -= STARTUP_NORMAL_OFFSET;
44+
45+ buf.mem += STARTUP_NORMAL_OFFSET;
46+ buf.memsz -= STARTUP_NORMAL_OFFSET;
47+ }
48+
49+ if (image->type == KEXEC_TYPE_CRASH)
50+ buf.mem += crashk_res.start;
51+
52+ ret = kexec_add_buffer(&buf);
53+ if (ret)
54+ return ret;
55+
56+ data->memsz += buf.memsz;
57+ }
58+
59+ return 0;
60+}
61+
62+static void *s390_elf_load(struct kimage *image,
63+ char *kernel, unsigned long kernel_len,
64+ char *initrd, unsigned long initrd_len,
65+ char *cmdline, unsigned long cmdline_len)
66+{
67+ struct s390_load_data data = {0};
68+ const Elf_Ehdr *ehdr;
69+ const Elf_Phdr *phdr;
70+ size_t size;
71+ int i, ret;
72+
73+ /* image->fobs->probe already checked for valid ELF magic number. */
74+ ehdr = (Elf_Ehdr *)kernel;
75+
76+ if (ehdr->e_type != ET_EXEC ||
77+ ehdr->e_ident[EI_CLASS] != ELFCLASS64 ||
78+ !elf_check_arch(ehdr))
79+ return ERR_PTR(-EINVAL);
80+
81+ if (!ehdr->e_phnum || ehdr->e_phentsize != sizeof(Elf_Phdr))
82+ return ERR_PTR(-EINVAL);
83+
84+ size = ehdr->e_ehsize + ehdr->e_phoff;
85+ size += ehdr->e_phentsize * ehdr->e_phnum;
86+ if (size > kernel_len)
87+ return ERR_PTR(-EINVAL);
88+
89+ phdr = (void *)ehdr + ehdr->e_phoff;
90+ size = ALIGN(size, phdr->p_align);
91+ for (i = 0; i < ehdr->e_phnum; i++, phdr++) {
92+ if (phdr->p_type == PT_INTERP)
93+ return ERR_PTR(-EINVAL);
94+
95+ if (phdr->p_offset > kernel_len)
96+ return ERR_PTR(-EINVAL);
97+
98+ size += ALIGN(phdr->p_filesz, phdr->p_align);
99+ }
100+
101+ if (size > kernel_len)
102+ return ERR_PTR(-EINVAL);
103+
104+ ret = kexec_file_add_elf_kernel(image, &data, kernel, kernel_len);
105+ if (ret)
106+ return ERR_PTR(ret);
107+
108+ if (!data.memsz)
109+ return ERR_PTR(-EINVAL);
110+
111+ if (initrd) {
112+ ret = kexec_file_add_initrd(image, &data, initrd, initrd_len);
113+ if (ret)
114+ return ERR_PTR(ret);
115+ }
116+
117+ ret = kexec_file_add_purgatory(image, &data);
118+ if (ret)
119+ return ERR_PTR(ret);
120+
121+ return kexec_file_update_kernel(image, &data);
122+}
123+
124+static int s390_elf_probe(const char *buf, unsigned long len)
125+{
126+ const Elf_Ehdr *ehdr;
127+
128+ if (len < sizeof(Elf_Ehdr))
129+ return -ENOEXEC;
130+
131+ ehdr = (Elf_Ehdr *)buf;
132+
133+ /* Only check the ELF magic number here and do proper validity check
134+ * in the loader. Any check here that fails would send the erroneous
135+ * ELF file to the image loader that does not care what it gets.
136+ * (Most likely) causing behavior not intended by the user.
137+ */
138+ if (memcmp(ehdr->e_ident, ELFMAG, SELFMAG) != 0)
139+ return -ENOEXEC;
140+
141+ return 0;
142+}
143+
144+const struct kexec_file_ops s390_kexec_elf_ops = {
145+ .probe = s390_elf_probe,
146+ .load = s390_elf_load,
147+};
arch/s390/kernel/kexec_image.c+76−0
@@ -0,0 +1,76 @@
1+// SPDX-License-Identifier: GPL-2.0
2+/*
3+ * Image loader for kexec_file_load system call.
4+ *
5+ * Copyright IBM Corp. 2018
6+ *
7+ * Author(s): Philipp Rudo <prudo@linux.vnet.ibm.com>
8+ */
9+
10+#include <linux/errno.h>
11+#include <linux/kernel.h>
12+#include <linux/kexec.h>
13+#include <asm/setup.h>
14+
15+static int kexec_file_add_image_kernel(struct kimage *image,
16+ struct s390_load_data *data,
17+ char *kernel, unsigned long kernel_len)
18+{
19+ struct kexec_buf buf;
20+ int ret;
21+
22+ buf.image = image;
23+
24+ buf.buffer = kernel + STARTUP_NORMAL_OFFSET;
25+ buf.bufsz = kernel_len - STARTUP_NORMAL_OFFSET;
26+
27+ buf.mem = STARTUP_NORMAL_OFFSET;
28+ if (image->type == KEXEC_TYPE_CRASH)
29+ buf.mem += crashk_res.start;
30+ buf.memsz = buf.bufsz;
31+
32+ ret = kexec_add_buffer(&buf);
33+
34+ data->kernel_buf = kernel;
35+ data->memsz += buf.memsz + STARTUP_NORMAL_OFFSET;
36+
37+ return ret;
38+}
39+
40+static void *s390_image_load(struct kimage *image,
41+ char *kernel, unsigned long kernel_len,
42+ char *initrd, unsigned long initrd_len,
43+ char *cmdline, unsigned long cmdline_len)
44+{
45+ struct s390_load_data data = {0};
46+ int ret;
47+
48+ ret = kexec_file_add_image_kernel(image, &data, kernel, kernel_len);
49+ if (ret)
50+ return ERR_PTR(ret);
51+
52+ if (initrd) {
53+ ret = kexec_file_add_initrd(image, &data, initrd, initrd_len);
54+ if (ret)
55+ return ERR_PTR(ret);
56+ }
57+
58+ ret = kexec_file_add_purgatory(image, &data);
59+ if (ret)
60+ return ERR_PTR(ret);
61+
62+ return kexec_file_update_kernel(image, &data);
63+}
64+
65+static int s390_image_probe(const char *buf, unsigned long len)
66+{
67+ /* Can't reliably tell if an image is valid. Therefore give the
68+ * user whatever he wants.
69+ */
70+ return 0;
71+}
72+
73+const struct kexec_file_ops s390_kexec_image_ops = {
74+ .probe = s390_image_probe,
75+ .load = s390_image_load,
76+};
arch/s390/kernel/machine_kexec_file.c+245−0
@@ -0,0 +1,245 @@
1+// SPDX-License-Identifier: GPL-2.0
2+/*
3+ * s390 code for kexec_file_load system call
4+ *
5+ * Copyright IBM Corp. 2018
6+ *
7+ * Author(s): Philipp Rudo <prudo@linux.vnet.ibm.com>
8+ */
9+
10+#include <linux/elf.h>
11+#include <linux/kexec.h>
12+#include <asm/setup.h>
13+
14+const struct kexec_file_ops * const kexec_file_loaders[] = {
15+ &s390_kexec_elf_ops,
16+ &s390_kexec_image_ops,
17+ NULL,
18+};
19+
20+int *kexec_file_update_kernel(struct kimage *image,
21+ struct s390_load_data *data)
22+{
23+ unsigned long *loc;
24+
25+ if (image->cmdline_buf_len >= ARCH_COMMAND_LINE_SIZE)
26+ return ERR_PTR(-EINVAL);
27+
28+ if (image->cmdline_buf_len)
29+ memcpy(data->kernel_buf + COMMAND_LINE_OFFSET,
30+ image->cmdline_buf, image->cmdline_buf_len);
31+
32+ if (image->type == KEXEC_TYPE_CRASH) {
33+ loc = (unsigned long *)(data->kernel_buf + OLDMEM_BASE_OFFSET);
34+ *loc = crashk_res.start;
35+
36+ loc = (unsigned long *)(data->kernel_buf + OLDMEM_SIZE_OFFSET);
37+ *loc = crashk_res.end - crashk_res.start + 1;
38+ }
39+
40+ if (image->initrd_buf) {
41+ loc = (unsigned long *)(data->kernel_buf + INITRD_START_OFFSET);
42+ *loc = data->initrd_load_addr;
43+
44+ loc = (unsigned long *)(data->kernel_buf + INITRD_SIZE_OFFSET);
45+ *loc = image->initrd_buf_len;
46+ }
47+
48+ return NULL;
49+}
50+
51+static int kexec_file_update_purgatory(struct kimage *image)
52+{
53+ u64 entry, type;
54+ int ret;
55+
56+ if (image->type == KEXEC_TYPE_CRASH) {
57+ entry = STARTUP_KDUMP_OFFSET;
58+ type = KEXEC_TYPE_CRASH;
59+ } else {
60+ entry = STARTUP_NORMAL_OFFSET;
61+ type = KEXEC_TYPE_DEFAULT;
62+ }
63+
64+ ret = kexec_purgatory_get_set_symbol(image, "kernel_entry", &entry,
65+ sizeof(entry), false);
66+ if (ret)
67+ return ret;
68+
69+ ret = kexec_purgatory_get_set_symbol(image, "kernel_type", &type,
70+ sizeof(type), false);
71+ if (ret)
72+ return ret;
73+
74+ if (image->type == KEXEC_TYPE_CRASH) {
75+ u64 crash_size;
76+
77+ ret = kexec_purgatory_get_set_symbol(image, "crash_start",
78+ &crashk_res.start,
79+ sizeof(crashk_res.start),
80+ false);
81+ if (ret)
82+ return ret;
83+
84+ crash_size = crashk_res.end - crashk_res.start + 1;
85+ ret = kexec_purgatory_get_set_symbol(image, "crash_size",
86+ &crash_size,
87+ sizeof(crash_size),
88+ false);
89+ }
90+ return ret;
91+}
92+
93+int kexec_file_add_purgatory(struct kimage *image, struct s390_load_data *data)
94+{
95+ struct kexec_buf buf;
96+ int ret;
97+
98+ buf.image = image;
99+
100+ data->memsz = ALIGN(data->memsz, PAGE_SIZE);
101+ buf.mem = data->memsz;
102+ if (image->type == KEXEC_TYPE_CRASH)
103+ buf.mem += crashk_res.start;
104+
105+ ret = kexec_load_purgatory(image, &buf);
106+ if (ret)
107+ return ret;
108+
109+ ret = kexec_file_update_purgatory(image);
110+ return ret;
111+}
112+
113+int kexec_file_add_initrd(struct kimage *image, struct s390_load_data *data,
114+ char *initrd, unsigned long initrd_len)
115+{
116+ struct kexec_buf buf;
117+ int ret;
118+
119+ buf.image = image;
120+
121+ buf.buffer = initrd;
122+ buf.bufsz = initrd_len;
123+
124+ data->memsz = ALIGN(data->memsz, PAGE_SIZE);
125+ buf.mem = data->memsz;
126+ if (image->type == KEXEC_TYPE_CRASH)
127+ buf.mem += crashk_res.start;
128+ buf.memsz = buf.bufsz;
129+
130+ data->initrd_load_addr = buf.mem;
131+ data->memsz += buf.memsz;
132+
133+ ret = kexec_add_buffer(&buf);
134+ return ret;
135+}
136+
137+/*
138+ * The kernel is loaded to a fixed location. Turn off kexec_locate_mem_hole
139+ * and provide kbuf->mem by hand.
140+ */
141+int arch_kexec_walk_mem(struct kexec_buf *kbuf,
142+ int (*func)(struct resource *, void *))
143+{
144+ return 1;
145+}
146+
147+int arch_kexec_apply_relocations_add(struct purgatory_info *pi,
148+ Elf_Shdr *section,
149+ const Elf_Shdr *relsec,
150+ const Elf_Shdr *symtab)
151+{
152+ Elf_Rela *relas;
153+ int i;
154+
155+ relas = (void *)pi->ehdr + relsec->sh_offset;
156+
157+ for (i = 0; i < relsec->sh_size / sizeof(*relas); i++) {
158+ const Elf_Sym *sym; /* symbol to relocate */
159+ unsigned long addr; /* final location after relocation */
160+ unsigned long val; /* relocated symbol value */
161+ void *loc; /* tmp location to modify */
162+
163+ sym = (void *)pi->ehdr + symtab->sh_offset;
164+ sym += ELF64_R_SYM(relas[i].r_info);
165+
166+ if (sym->st_shndx == SHN_UNDEF)
167+ return -ENOEXEC;
168+
169+ if (sym->st_shndx == SHN_COMMON)
170+ return -ENOEXEC;
171+
172+ if (sym->st_shndx >= pi->ehdr->e_shnum &&
173+ sym->st_shndx != SHN_ABS)
174+ return -ENOEXEC;
175+
176+ loc = pi->purgatory_buf;
177+ loc += section->sh_offset;
178+ loc += relas[i].r_offset;
179+
180+ val = sym->st_value;
181+ if (sym->st_shndx != SHN_ABS)
182+ val += pi->sechdrs[sym->st_shndx].sh_addr;
183+ val += relas[i].r_addend;
184+
185+ addr = section->sh_addr + relas[i].r_offset;
186+
187+ switch (ELF64_R_TYPE(relas[i].r_info)) {
188+ case R_390_8: /* Direct 8 bit. */
189+ *(u8 *)loc = val;
190+ break;
191+ case R_390_12: /* Direct 12 bit. */
192+ *(u16 *)loc &= 0xf000;
193+ *(u16 *)loc |= val & 0xfff;
194+ break;
195+ case R_390_16: /* Direct 16 bit. */
196+ *(u16 *)loc = val;
197+ break;
198+ case R_390_20: /* Direct 20 bit. */
199+ *(u32 *)loc &= 0xf00000ff;
200+ *(u32 *)loc |= (val & 0xfff) << 16; /* DL */
201+ *(u32 *)loc |= (val & 0xff000) >> 4; /* DH */
202+ break;
203+ case R_390_32: /* Direct 32 bit. */
204+ *(u32 *)loc = val;
205+ break;
206+ case R_390_64: /* Direct 64 bit. */
207+ *(u64 *)loc = val;
208+ break;
209+ case R_390_PC16: /* PC relative 16 bit. */
210+ *(u16 *)loc = (val - addr);
211+ break;
212+ case R_390_PC16DBL: /* PC relative 16 bit shifted by 1. */
213+ *(u16 *)loc = (val - addr) >> 1;
214+ break;
215+ case R_390_PC32DBL: /* PC relative 32 bit shifted by 1. */
216+ *(u32 *)loc = (val - addr) >> 1;
217+ break;
218+ case R_390_PC32: /* PC relative 32 bit. */
219+ *(u32 *)loc = (val - addr);
220+ break;
221+ case R_390_PC64: /* PC relative 64 bit. */
222+ *(u64 *)loc = (val - addr);
223+ break;
224+ default:
225+ break;
226+ }
227+ }
228+ return 0;
229+}
230+
231+int arch_kexec_kernel_image_probe(struct kimage *image, void *buf,
232+ unsigned long buf_len)
233+{
234+ /* A kernel must be at least large enough to contain head.S. During
235+ * load memory in head.S will be accessed, e.g. to register the next
236+ * command line. If the next kernel were smaller the current kernel
237+ * will panic at load.
238+ *
239+ * 0x11000 = sizeof(head.S)
240+ */
241+ if (buf_len < 0x11000)
242+ return -ENOEXEC;
243+
244+ return kexec_image_probe_default(image, buf, buf_len);
245+}
arch/s390/kernel/module.c+2−2
@@ -465,11 +465,11 @@ int module_finalize(const Elf_Ehdr *hdr, · 464 unmodified lines
465465 apply_alternatives(aseg, aseg + s->sh_size);
466466
467467 if (IS_ENABLED(CONFIG_EXPOLINE) &&
468− (!strcmp(".nospec_call_table", secname)))
468+ (!strncmp(".s390_indirect", secname, 14)))
469469 nospec_revert(aseg, aseg + s->sh_size);
470470
471471 if (IS_ENABLED(CONFIG_EXPOLINE) &&
472− (!strcmp(".nospec_return_table", secname)))
472+ (!strncmp(".s390_return", secname, 12)))
473473 nospec_revert(aseg, aseg + s->sh_size);
474474 }
475475
arch/s390/kernel/nospec-branch.c+1−0
@@ -1,6 +1,7 @@
11 // SPDX-License-Identifier: GPL-2.0
22 #include <linux/module.h>
33 #include <linux/device.h>
4+#include <linux/cpu.h>
45 #include <asm/nospec-branch.h>
56
67 static int __init nobp_setup_early(char *str)
arch/s390/kernel/perf_cpum_cf_events.c+5−4
@@ -123,7 +123,7 @@ CPUMF_EVENT_ATTR(cf_zec12, L1I_OFFBOOK_L3_SOURCED_WRITES_IV, 0x00a1); · 122 unmodified lines
123123 CPUMF_EVENT_ATTR(cf_zec12, TX_NC_TABORT, 0x00b1);
124124 CPUMF_EVENT_ATTR(cf_zec12, TX_C_TABORT_NO_SPECIAL, 0x00b2);
125125 CPUMF_EVENT_ATTR(cf_zec12, TX_C_TABORT_SPECIAL, 0x00b3);
126−CPUMF_EVENT_ATTR(cf_z13, L1D_WRITES_RO_EXCL, 0x0080);
126+CPUMF_EVENT_ATTR(cf_z13, L1D_RO_EXCL_WRITES, 0x0080);
127127 CPUMF_EVENT_ATTR(cf_z13, DTLB1_WRITES, 0x0081);
128128 CPUMF_EVENT_ATTR(cf_z13, DTLB1_MISSES, 0x0082);
129129 CPUMF_EVENT_ATTR(cf_z13, DTLB1_HPAGE_WRITES, 0x0083);
@@ -179,7 +179,7 @@ CPUMF_EVENT_ATTR(cf_z13, TX_C_TABORT_NO_SPECIAL, 0x00db); · 49 unmodified lines
179179 CPUMF_EVENT_ATTR(cf_z13, TX_C_TABORT_SPECIAL, 0x00dc);
180180 CPUMF_EVENT_ATTR(cf_z13, MT_DIAG_CYCLES_ONE_THR_ACTIVE, 0x01c0);
181181 CPUMF_EVENT_ATTR(cf_z13, MT_DIAG_CYCLES_TWO_THR_ACTIVE, 0x01c1);
182−CPUMF_EVENT_ATTR(cf_z14, L1D_WRITES_RO_EXCL, 0x0080);
182+CPUMF_EVENT_ATTR(cf_z14, L1D_RO_EXCL_WRITES, 0x0080);
183183 CPUMF_EVENT_ATTR(cf_z14, DTLB2_WRITES, 0x0081);
184184 CPUMF_EVENT_ATTR(cf_z14, DTLB2_MISSES, 0x0082);
185185 CPUMF_EVENT_ATTR(cf_z14, DTLB2_HPAGE_WRITES, 0x0083);
@@ -371,7 +371,7 @@ static struct attribute *cpumcf_zec12_pmu_event_attr[] __initdata = { · 185 unmodified lines
371371 };
372372
373373 static struct attribute *cpumcf_z13_pmu_event_attr[] __initdata = {
374− CPUMF_EVENT_PTR(cf_z13, L1D_WRITES_RO_EXCL),
374+ CPUMF_EVENT_PTR(cf_z13, L1D_RO_EXCL_WRITES),
375375 CPUMF_EVENT_PTR(cf_z13, DTLB1_WRITES),
376376 CPUMF_EVENT_PTR(cf_z13, DTLB1_MISSES),
377377 CPUMF_EVENT_PTR(cf_z13, DTLB1_HPAGE_WRITES),
@@ -431,7 +431,7 @@ static struct attribute *cpumcf_z13_pmu_event_attr[] __initdata = { · 53 unmodified lines
431431 };
432432
433433 static struct attribute *cpumcf_z14_pmu_event_attr[] __initdata = {
434− CPUMF_EVENT_PTR(cf_z14, L1D_WRITES_RO_EXCL),
434+ CPUMF_EVENT_PTR(cf_z14, L1D_RO_EXCL_WRITES),
435435 CPUMF_EVENT_PTR(cf_z14, DTLB2_WRITES),
436436 CPUMF_EVENT_PTR(cf_z14, DTLB2_MISSES),
437437 CPUMF_EVENT_PTR(cf_z14, DTLB2_HPAGE_WRITES),
@@ -583,6 +583,7 @@ __init const struct attribute_group **cpumf_cf_event_group(void) · 145 unmodified lines
583583 model = cpumcf_z13_pmu_event_attr;
584584 break;
585585 case 0x3906:
586+ case 0x3907:
586587 model = cpumcf_z14_pmu_event_attr;
587588 break;
588589 default:
arch/s390/kernel/process.c+10−0
@@ -29,6 +29,7 @@ · 28 unmodified lines
2929 #include <linux/random.h>
3030 #include <linux/export.h>
3131 #include <linux/init_task.h>
32+#include <asm/cpu_mf.h>
3233 #include <asm/io.h>
3334 #include <asm/processor.h>
3435 #include <asm/vtimer.h>
@@ -48,6 +49,15 @@ void flush_thread(void) · 13 unmodified lines
4849 {
4950 }
5051
52+void arch_setup_new_exec(void)
53+{
54+ if (S390_lowcore.current_pid != current->pid) {
55+ S390_lowcore.current_pid = current->pid;
56+ if (test_facility(40))
57+ lpp(&S390_lowcore.lpp);
58+ }
59+}
60+
5161 void arch_release_task_struct(struct task_struct *tsk)
5262 {
5363 runtime_instr_release(tsk);
arch/s390/kernel/setup.c+1−0
@@ -821,6 +821,7 @@ static int __init setup_hwcaps(void) · 820 unmodified lines
821821 strcpy(elf_platform, "z13");
822822 break;
823823 case 0x3906:
824+ case 0x3907:
824825 strcpy(elf_platform, "z14");
825826 break;
826827 }
arch/s390/kernel/syscalls/syscall.tbl+1−0
@@ -388,3 +388,4 @@ · 387 unmodified lines
388388 378 common s390_guarded_storage sys_s390_guarded_storage compat_sys_s390_guarded_storage
389389 379 common statx sys_statx compat_sys_statx
390390 380 common s390_sthyi sys_s390_sthyi compat_sys_s390_sthyi
391+381 common kexec_file_load sys_kexec_file_load compat_sys_kexec_file_load
arch/s390/kernel/uprobes.c+9−0
@@ -150,6 +150,15 @@ unsigned long arch_uretprobe_hijack_return_addr(unsigned long trampoline, · 149 unmodified lines
150150 return orig;
151151 }
152152
153+bool arch_uretprobe_is_alive(struct return_instance *ret, enum rp_check ctx,
154+ struct pt_regs *regs)
155+{
156+ if (ctx == RP_CHECK_CHAIN_CALL)
157+ return user_stack_pointer(regs) <= ret->stack;
158+ else
159+ return user_stack_pointer(regs) < ret->stack;
160+}
161+
153162 /* Instruction Emulation */
154163
155164 static void adjust_psw_addr(psw_t *psw, unsigned long len)
arch/s390/purgatory/.gitignore+2−0
@@ -0,0 +1,2 @@
1+kexec-purgatory.c
2+purgatory.ro
arch/s390/purgatory/Makefile+37−0
@@ -0,0 +1,37 @@
1+# SPDX-License-Identifier: GPL-2.0
2+
3+OBJECT_FILES_NON_STANDARD := y
4+
5+purgatory-y := head.o purgatory.o string.o sha256.o mem.o
6+
7+targets += $(purgatory-y) purgatory.ro kexec-purgatory.c
8+PURGATORY_OBJS = $(addprefix $(obj)/,$(purgatory-y))
9+
10+$(obj)/sha256.o: $(srctree)/lib/sha256.c
11+ $(call if_changed_rule,cc_o_c)
12+
13+$(obj)/mem.o: $(srctree)/arch/s390/lib/mem.S
14+ $(call if_changed_rule,as_o_S)
15+
16+$(obj)/string.o: $(srctree)/arch/s390/lib/string.c
17+ $(call if_changed_rule,cc_o_c)
18+
19+LDFLAGS_purgatory.ro := -e purgatory_start -r --no-undefined -nostdlib
20+LDFLAGS_purgatory.ro += -z nodefaultlib
21+KBUILD_CFLAGS := -fno-strict-aliasing -Wall -Wstrict-prototypes
22+KBUILD_CFLAGS += -Wno-pointer-sign -Wno-sign-compare
23+KBUILD_CFLAGS += -fno-zero-initialized-in-bss -fno-builtin -ffreestanding
24+KBUILD_CFLAGS += -c -MD -Os -m64
25+KBUILD_CFLAGS += $(call cc-option,-fno-PIE)
26+
27+$(obj)/purgatory.ro: $(PURGATORY_OBJS) FORCE
28+ $(call if_changed,ld)
29+
30+CMD_BIN2C = $(objtree)/scripts/basic/bin2c
31+quiet_cmd_bin2c = BIN2C $@
32+ cmd_bin2c = $(CMD_BIN2C) kexec_purgatory < $< > $@
33+
34+$(obj)/kexec-purgatory.c: $(obj)/purgatory.ro FORCE
35+ $(call if_changed,bin2c)
36+
37+obj-$(CONFIG_ARCH_HAS_KEXEC_PURGATORY) += kexec-purgatory.o
arch/s390/purgatory/head.S+279−0
@@ -0,0 +1,279 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+/*
3+ * Purgatory setup code
4+ *
5+ * Copyright IBM Corp. 2018
6+ *
7+ * Author(s): Philipp Rudo <prudo@linux.vnet.ibm.com>
8+ */
9+
10+#include <linux/linkage.h>
11+#include <asm/asm-offsets.h>
12+#include <asm/page.h>
13+#include <asm/sigp.h>
14+
15+/* The purgatory is the code running between two kernels. It's main purpose
16+ * is to verify that the next kernel was not corrupted after load and to
17+ * start it.
18+ *
19+ * If the next kernel is a crash kernel there are some peculiarities to
20+ * consider:
21+ *
22+ * First the purgatory is called twice. Once only to verify the
23+ * sha digest. So if the crash kernel got corrupted the old kernel can try
24+ * to trigger a stand-alone dumper. And once to actually load the crash kernel.
25+ *
26+ * Second the purgatory also has to swap the crash memory region with its
27+ * destination at address 0. As the purgatory is part of crash memory this
28+ * requires some finesse. The tactic here is that the purgatory first copies
29+ * itself to the end of the destination and then swaps the rest of the
30+ * memory running from there.
31+ */
32+
33+#define bufsz purgatory_end-stack
34+
35+.macro MEMCPY dst,src,len
36+ lgr %r0,\dst
37+ lgr %r1,\len
38+ lgr %r2,\src
39+ lgr %r3,\len
40+
41+20: mvcle %r0,%r2,0
42+ jo 20b
43+.endm
44+
45+.macro MEMSWAP dst,src,buf,len
46+10: cghi \len,bufsz
47+ jh 11f
48+ lgr %r4,\len
49+ j 12f
50+11: lghi %r4,bufsz
51+
52+12: MEMCPY \buf,\dst,%r4
53+ MEMCPY \dst,\src,%r4
54+ MEMCPY \src,\buf,%r4
55+
56+ agr \dst,%r4
57+ agr \src,%r4
58+ sgr \len,%r4
59+
60+ cghi \len,0
61+ jh 10b
62+.endm
63+
64+.macro START_NEXT_KERNEL base
65+ lg %r4,kernel_entry-\base(%r13)
66+ lg %r5,load_psw_mask-\base(%r13)
67+ ogr %r4,%r5
68+ stg %r4,0(%r0)
69+
70+ xgr %r0,%r0
71+ diag %r0,%r0,0x308
72+.endm
73+
74+.text
75+.align PAGE_SIZE
76+ENTRY(purgatory_start)
77+ /* The purgatory might be called after a diag308 so better set
78+ * architecture and addressing mode.
79+ */
80+ lhi %r1,1
81+ sigp %r1,%r0,SIGP_SET_ARCHITECTURE
82+ sam64
83+
84+ larl %r5,gprregs
85+ stmg %r6,%r15,0(%r5)
86+
87+ basr %r13,0
88+.base_crash:
89+
90+ /* Setup stack */
91+ larl %r15,purgatory_end
92+ aghi %r15,-160
93+
94+ /* If the next kernel is KEXEC_TYPE_CRASH the purgatory is called
95+ * directly with a flag passed in %r2 whether the purgatory shall do
96+ * checksum verification only (%r2 = 0 -> verification only).
97+ *
98+ * Check now and preserve over C function call by storing in
99+ * %r10 whith
100+ * 1 -> checksum verification only
101+ * 0 -> load new kernel
102+ */
103+ lghi %r10,0
104+ lg %r11,kernel_type-.base_crash(%r13)
105+ cghi %r11,1 /* KEXEC_TYPE_CRASH */
106+ jne .do_checksum_verification
107+ cghi %r2,0 /* checksum verification only */
108+ jne .do_checksum_verification
109+ lghi %r10,1
110+
111+.do_checksum_verification:
112+ brasl %r14,verify_sha256_digest
113+
114+ cghi %r10,1 /* checksum verification only */
115+ je .return_old_kernel
116+ cghi %r2,0 /* checksum match */
117+ jne .disabled_wait
118+
119+ /* If the next kernel is a crash kernel the purgatory has to swap
120+ * the mem regions first.
121+ */
122+ cghi %r11,1 /* KEXEC_TYPE_CRASH */
123+ je .start_crash_kernel
124+
125+ /* start normal kernel */
126+ START_NEXT_KERNEL .base_crash
127+
128+.return_old_kernel:
129+ lmg %r6,%r15,gprregs-.base_crash(%r13)
130+ br %r14
131+
132+.disabled_wait:
133+ lpswe disabled_wait_psw-.base_crash(%r13)
134+
135+.start_crash_kernel:
136+ /* Location of purgatory_start in crash memory */
137+ lgr %r8,%r13
138+ aghi %r8,-(.base_crash-purgatory_start)
139+
140+ /* Destination for this code i.e. end of memory to be swapped. */
141+ lg %r9,crash_size-.base_crash(%r13)
142+ aghi %r9,-(purgatory_end-purgatory_start)
143+
144+ /* Destination in crash memory, i.e. same as r9 but in crash memory. */
145+ lg %r10,crash_start-.base_crash(%r13)
146+ agr %r10,%r9
147+
148+ /* Buffer location (in crash memory) and size. As the purgatory is
149+ * behind the point of no return it can re-use the stack as buffer.
150+ */
151+ lghi %r11,bufsz
152+ larl %r12,stack
153+
154+ MEMCPY %r12,%r9,%r11 /* dst -> (crash) buf */
155+ MEMCPY %r9,%r8,%r11 /* self -> dst */
156+
157+ /* Jump to new location. */
158+ lgr %r7,%r9
159+ aghi %r7,.jump_to_dst-purgatory_start
160+ br %r7
161+
162+.jump_to_dst:
163+ basr %r13,0
164+.base_dst:
165+
166+ /* clear buffer */
167+ MEMCPY %r12,%r10,%r11 /* (crash) buf -> (crash) dst */
168+
169+ /* Load new buffer location after jump */
170+ larl %r7,stack
171+ aghi %r10,stack-purgatory_start
172+ MEMCPY %r10,%r7,%r11 /* (new) buf -> (crash) buf */
173+
174+ /* Now the code is set up to run from its designated location. Start
175+ * swapping the rest of crash memory now.
176+ *
177+ * The registers will be used as follow:
178+ *
179+ * %r0-%r4 reserved for macros defined above
180+ * %r5-%r6 tmp registers
181+ * %r7 pointer to current struct sha region
182+ * %r8 index to iterate over all sha regions
183+ * %r9 pointer in crash memory
184+ * %r10 pointer in old kernel
185+ * %r11 total size (still) to be moved
186+ * %r12 pointer to buffer
187+ */
188+ lgr %r12,%r7
189+ lgr %r11,%r9
190+ lghi %r10,0
191+ lg %r9,crash_start-.base_dst(%r13)
192+ lghi %r8,16 /* KEXEC_SEGMENTS_MAX */
193+ larl %r7,purgatory_sha_regions
194+
195+ j .loop_first
196+
197+ /* Loop over all purgatory_sha_regions. */
198+.loop_next:
199+ aghi %r8,-1
200+ cghi %r8,0
201+ je .loop_out
202+
203+ aghi %r7,__KEXEC_SHA_REGION_SIZE
204+
205+.loop_first:
206+ lg %r5,__KEXEC_SHA_REGION_START(%r7)
207+ cghi %r5,0
208+ je .loop_next
209+
210+ /* Copy [end last sha region, start current sha region) */
211+ /* Note: kexec_sha_region->start points in crash memory */
212+ sgr %r5,%r9
213+ MEMCPY %r9,%r10,%r5
214+
215+ agr %r9,%r5
216+ agr %r10,%r5
217+ sgr %r11,%r5
218+
219+ /* Swap sha region */
220+ lg %r6,__KEXEC_SHA_REGION_LEN(%r7)
221+ MEMSWAP %r9,%r10,%r12,%r6
222+ sg %r11,__KEXEC_SHA_REGION_LEN(%r7)
223+ j .loop_next
224+
225+.loop_out:
226+ /* Copy rest of crash memory */
227+ MEMCPY %r9,%r10,%r11
228+
229+ /* start crash kernel */
230+ START_NEXT_KERNEL .base_dst
231+
232+
233+load_psw_mask:
234+ .long 0x00080000,0x80000000
235+
236+ .align 8
237+disabled_wait_psw:
238+ .quad 0x0002000180000000
239+ .quad 0x0000000000000000 + .do_checksum_verification
240+
241+gprregs:
242+ .rept 10
243+ .quad 0
244+ .endr
245+
246+purgatory_sha256_digest:
247+ .global purgatory_sha256_digest
248+ .rept 32 /* SHA256_DIGEST_SIZE */
249+ .byte 0
250+ .endr
251+
252+purgatory_sha_regions:
253+ .global purgatory_sha_regions
254+ .rept 16 * __KEXEC_SHA_REGION_SIZE /* KEXEC_SEGMENTS_MAX */
255+ .byte 0
256+ .endr
257+
258+kernel_entry:
259+ .global kernel_entry
260+ .quad 0
261+
262+kernel_type:
263+ .global kernel_type
264+ .quad 0
265+
266+crash_start:
267+ .global crash_start
268+ .quad 0
269+
270+crash_size:
271+ .global crash_size
272+ .quad 0
273+
274+ .align PAGE_SIZE
275+stack:
276+ /* The buffer to move this code must be as big as the code. */
277+ .skip stack-purgatory_start
278+ .align PAGE_SIZE
279+purgatory_end:
arch/s390/purgatory/purgatory.c+42−0
@@ -0,0 +1,42 @@
1+// SPDX-License-Identifier: GPL-2.0
2+/*
3+ * Purgatory code running between two kernels.
4+ *
5+ * Copyright IBM Corp. 2018
6+ *
7+ * Author(s): Philipp Rudo <prudo@linux.vnet.ibm.com>
8+ */
9+
10+#include <linux/kexec.h>
11+#include <linux/sha256.h>
12+#include <linux/string.h>
13+#include <asm/purgatory.h>
14+
15+struct kexec_sha_region purgatory_sha_regions[KEXEC_SEGMENT_MAX];
16+u8 purgatory_sha256_digest[SHA256_DIGEST_SIZE];
17+
18+u64 kernel_entry;
19+u64 kernel_type;
20+
21+u64 crash_start;
22+u64 crash_size;
23+
24+int verify_sha256_digest(void)
25+{
26+ struct kexec_sha_region *ptr, *end;
27+ u8 digest[SHA256_DIGEST_SIZE];
28+ struct sha256_state sctx;
29+
30+ sha256_init(&sctx);
31+ end = purgatory_sha_regions + ARRAY_SIZE(purgatory_sha_regions);
32+
33+ for (ptr = purgatory_sha_regions; ptr < end; ptr++)
34+ sha256_update(&sctx, (uint8_t *)(ptr->start), ptr->len);
35+
36+ sha256_final(&sctx, digest);
37+
38+ if (memcmp(digest, purgatory_sha256_digest, sizeof(digest)))
39+ return 1;
40+
41+ return 0;
42+}
arch/sparc/include/uapi/asm/oradax.h+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * This program is free software: you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
6− * the Free Software Foundation, either version 3 of the License, or
6+ * the Free Software Foundation, either version 2 of the License, or
77 * (at your option) any later version.
88 *
99 * This program is distributed in the hope that it will be useful,
arch/sparc/kernel/vio.c+1−1
@@ -403,7 +403,7 @@ static struct vio_dev *vio_create_one(struct mdesc_handle *hp, u64 mp, · 402 unmodified lines
403403 if (err) {
404404 printk(KERN_ERR "VIO: Could not register device %s, err=%d\n",
405405 dev_name(&vdev->dev), err);
406− kfree(vdev);
406+ put_device(&vdev->dev);
407407 return NULL;
408408 }
409409 if (vdev->dp)
arch/x86/Kconfig+4−0
@@ -52,6 +52,7 @@ config X86 · 51 unmodified lines
5252 select ARCH_HAS_DEVMEM_IS_ALLOWED
5353 select ARCH_HAS_ELF_RANDOMIZE
5454 select ARCH_HAS_FAST_MULTIPLIER
55+ select ARCH_HAS_FILTER_PGPROT
5556 select ARCH_HAS_FORTIFY_SOURCE
5657 select ARCH_HAS_GCOV_PROFILE_ALL
5758 select ARCH_HAS_KCOV if X86_64
@@ -273,6 +274,9 @@ config ARCH_HAS_CPU_RELAX · 215 unmodified lines
273274 config ARCH_HAS_CACHE_LINE_SIZE
274275 def_bool y
275276
277+config ARCH_HAS_FILTER_PGPROT
278+ def_bool y
279+
276280 config HAVE_SETUP_PER_CPU_AREA
277281 def_bool y
278282
arch/x86/entry/entry_64_compat.S+4−4
@@ -84,13 +84,13 @@ ENTRY(entry_SYSENTER_compat) · 83 unmodified lines
8484 pushq %rdx /* pt_regs->dx */
8585 pushq %rcx /* pt_regs->cx */
8686 pushq $-ENOSYS /* pt_regs->ax */
87− pushq $0 /* pt_regs->r8 = 0 */
87+ pushq %r8 /* pt_regs->r8 */
8888 xorl %r8d, %r8d /* nospec r8 */
89− pushq $0 /* pt_regs->r9 = 0 */
89+ pushq %r9 /* pt_regs->r9 */
9090 xorl %r9d, %r9d /* nospec r9 */
91− pushq $0 /* pt_regs->r10 = 0 */
91+ pushq %r10 /* pt_regs->r10 */
9292 xorl %r10d, %r10d /* nospec r10 */
93− pushq $0 /* pt_regs->r11 = 0 */
93+ pushq %r11 /* pt_regs->r11 */
9494 xorl %r11d, %r11d /* nospec r11 */
9595 pushq %rbx /* pt_regs->rbx */
9696 xorl %ebx, %ebx /* nospec rbx */
arch/x86/events/intel/core.c+6−3
@@ -3339,7 +3339,8 @@ static void intel_pmu_cpu_starting(int cpu) · 3338 unmodified lines
33393339
33403340 cpuc->lbr_sel = NULL;
33413341
3342− flip_smm_bit(&x86_pmu.attr_freeze_on_smi);
3342+ if (x86_pmu.version > 1)
3343+ flip_smm_bit(&x86_pmu.attr_freeze_on_smi);
33433344
33443345 if (!cpuc->shared_regs)
33453346 return;
@@ -3502,6 +3503,8 @@ static __initconst const struct x86_pmu core_pmu = { · 156 unmodified lines
35023503 .cpu_dying = intel_pmu_cpu_dying,
35033504 };
35043505
3506+static struct attribute *intel_pmu_attrs[];
3507+
35053508 static __initconst const struct x86_pmu intel_pmu = {
35063509 .name = "Intel",
35073510 .handle_irq = intel_pmu_handle_irq,
@@ -3533,6 +3536,8 @@ static __initconst const struct x86_pmu intel_pmu = { · 25 unmodified lines
35333536 .format_attrs = intel_arch3_formats_attr,
35343537 .events_sysfs_show = intel_event_sysfs_show,
35353538
3539+ .attrs = intel_pmu_attrs,
3540+
35363541 .cpu_prepare = intel_pmu_cpu_prepare,
35373542 .cpu_starting = intel_pmu_cpu_starting,
35383543 .cpu_dying = intel_pmu_cpu_dying,
@@ -3911,8 +3916,6 @@ __init int intel_pmu_init(void) · 372 unmodified lines
39113916
39123917 x86_pmu.max_pebs_events = min_t(unsigned, MAX_PEBS_EVENTS, x86_pmu.num_counters);
39133918
3914−
3915− x86_pmu.attrs = intel_pmu_attrs;
39163919 /*
39173920 * Quirk: v2 perfmon does not report fixed-purpose events, so
39183921 * assume at least 3 events, when not running in a hypervisor:
arch/x86/events/intel/uncore_snbep.c+37−0
@@ -3028,10 +3028,27 @@ static struct intel_uncore_type bdx_uncore_cbox = { · 3027 unmodified lines
30283028 .format_group = &hswep_uncore_cbox_format_group,
30293029 };
30303030
3031+static struct intel_uncore_type bdx_uncore_sbox = {
3032+ .name = "sbox",
3033+ .num_counters = 4,
3034+ .num_boxes = 4,
3035+ .perf_ctr_bits = 48,
3036+ .event_ctl = HSWEP_S0_MSR_PMON_CTL0,
3037+ .perf_ctr = HSWEP_S0_MSR_PMON_CTR0,
3038+ .event_mask = HSWEP_S_MSR_PMON_RAW_EVENT_MASK,
3039+ .box_ctl = HSWEP_S0_MSR_PMON_BOX_CTL,
3040+ .msr_offset = HSWEP_SBOX_MSR_OFFSET,
3041+ .ops = &hswep_uncore_sbox_msr_ops,
3042+ .format_group = &hswep_uncore_sbox_format_group,
3043+};
3044+
3045+#define BDX_MSR_UNCORE_SBOX 3
3046+
30313047 static struct intel_uncore_type *bdx_msr_uncores[] = {
30323048 &bdx_uncore_ubox,
30333049 &bdx_uncore_cbox,
30343050 &hswep_uncore_pcu,
3051+ &bdx_uncore_sbox,
30353052 NULL,
30363053 };
30373054
@@ -3043,10 +3060,25 @@ static struct event_constraint bdx_uncore_pcu_constraints[] = { · 5 unmodified lines
30433060
30443061 void bdx_uncore_cpu_init(void)
30453062 {
3063+ int pkg = topology_phys_to_logical_pkg(0);
3064+
30463065 if (bdx_uncore_cbox.num_boxes > boot_cpu_data.x86_max_cores)
30473066 bdx_uncore_cbox.num_boxes = boot_cpu_data.x86_max_cores;
30483067 uncore_msr_uncores = bdx_msr_uncores;
30493068
3069+ /* BDX-DE doesn't have SBOX */
3070+ if (boot_cpu_data.x86_model == 86) {
3071+ uncore_msr_uncores[BDX_MSR_UNCORE_SBOX] = NULL;
3072+ /* Detect systems with no SBOXes */
3073+ } else if (uncore_extra_pci_dev[pkg].dev[HSWEP_PCI_PCU_3]) {
3074+ struct pci_dev *pdev;
3075+ u32 capid4;
3076+
3077+ pdev = uncore_extra_pci_dev[pkg].dev[HSWEP_PCI_PCU_3];
3078+ pci_read_config_dword(pdev, 0x94, &capid4);
3079+ if (((capid4 >> 6) & 0x3) == 0)
3080+ bdx_msr_uncores[BDX_MSR_UNCORE_SBOX] = NULL;
3081+ }
30503082 hswep_uncore_pcu.constraints = bdx_uncore_pcu_constraints;
30513083 }
30523084
@@ -3264,6 +3296,11 @@ static const struct pci_device_id bdx_uncore_pci_ids[] = { · 211 unmodified lines
32643296 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x6f46),
32653297 .driver_data = UNCORE_PCI_DEV_DATA(UNCORE_EXTRA_PCI_DEV, 2),
32663298 },
3299+ { /* PCU.3 (for Capability registers) */
3300+ PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x6fc0),
3301+ .driver_data = UNCORE_PCI_DEV_DATA(UNCORE_EXTRA_PCI_DEV,
3302+ HSWEP_PCI_PCU_3),
3303+ },
32673304 { /* end: all zeroes */ }
32683305 };
32693306
arch/x86/include/asm/asm.h+0−2
@@ -136,7 +136,6 @@ · 135 unmodified lines
136136 #endif
137137
138138 #ifndef __ASSEMBLY__
139−#ifndef __BPF__
140139 /*
141140 * This output constraint should be used for any inline asm which has a "call"
142141 * instruction. Otherwise the asm may be inserted before the frame pointer
@@ -146,6 +145,5 @@ · 3 unmodified lines
146145 register unsigned long current_stack_pointer asm(_ASM_SP);
147146 #define ASM_CALL_CONSTRAINT "+r" (current_stack_pointer)
148147 #endif
149−#endif
150148
151149 #endif /* _ASM_X86_ASM_H */
arch/x86/include/asm/cpufeatures.h+1−0
@@ -320,6 +320,7 @@ · 319 unmodified lines
320320 #define X86_FEATURE_AVX512_VPOPCNTDQ (16*32+14) /* POPCNT for vectors of DW/QW */
321321 #define X86_FEATURE_LA57 (16*32+16) /* 5-level page tables */
322322 #define X86_FEATURE_RDPID (16*32+22) /* RDPID instruction */
323+#define X86_FEATURE_CLDEMOTE (16*32+25) /* CLDEMOTE instruction */
323324
324325 /* AMD-defined CPU features, CPUID level 0x80000007 (EBX), word 17 */
325326 #define X86_FEATURE_OVERFLOW_RECOV (17*32+ 0) /* MCA overflow recovery support */
arch/x86/include/asm/ftrace.h+17−2
@@ -46,7 +46,21 @@ int ftrace_int3_handler(struct pt_regs *regs); · 45 unmodified lines
4646 #endif /* CONFIG_FUNCTION_TRACER */
4747
4848
49−#if !defined(__ASSEMBLY__) && !defined(COMPILE_OFFSETS)
49+#ifndef __ASSEMBLY__
50+
51+#define ARCH_HAS_SYSCALL_MATCH_SYM_NAME
52+static inline bool arch_syscall_match_sym_name(const char *sym, const char *name)
53+{
54+ /*
55+ * Compare the symbol name with the system call name. Skip the
56+ * "__x64_sys", "__ia32_sys" or simple "sys" prefix.
57+ */
58+ return !strcmp(sym + 3, name + 3) ||
59+ (!strncmp(sym, "__x64_", 6) && !strcmp(sym + 9, name + 3)) ||
60+ (!strncmp(sym, "__ia32_", 7) && !strcmp(sym + 10, name + 3));
61+}
62+
63+#ifndef COMPILE_OFFSETS
5064
5165 #if defined(CONFIG_FTRACE_SYSCALLS) && defined(CONFIG_IA32_EMULATION)
5266 #include <asm/compat.h>
@@ -67,6 +81,7 @@ static inline bool arch_trace_is_compat_syscall(struct pt_regs *regs) · 14 unmodified lines
6781 return false;
6882 }
6983 #endif /* CONFIG_FTRACE_SYSCALLS && CONFIG_IA32_EMULATION */
70−#endif /* !__ASSEMBLY__ && !COMPILE_OFFSETS */
84+#endif /* !COMPILE_OFFSETS */
85+#endif /* !__ASSEMBLY__ */
7186
7287 #endif /* _ASM_X86_FTRACE_H */
arch/x86/include/asm/irq_vectors.h+0−7
@@ -34,11 +34,6 @@ · 33 unmodified lines
3434 * (0x80 is the syscall vector, 0x30-0x3f are for ISA)
3535 */
3636 #define FIRST_EXTERNAL_VECTOR 0x20
37−/*
38− * We start allocating at 0x21 to spread out vectors evenly between
39− * priority levels. (0x80 is the syscall vector)
40− */
41−#define VECTOR_OFFSET_START 1
4237
4338 /*
4439 * Reserve the lowest usable vector (and hence lowest priority) 0x20 for
@@ -119,8 +114,6 @@ · 74 unmodified lines
119114 #define FIRST_SYSTEM_VECTOR NR_VECTORS
120115 #endif
121116
122−#define FPU_IRQ 13
123−
124117 /*
125118 * Size the maximum number of interrupts.
126119 *
arch/x86/include/asm/jailhouse_para.h+1−1
@@ -1,4 +1,4 @@
1−/* SPDX-License-Identifier: GPL2.0 */
1+/* SPDX-License-Identifier: GPL-2.0 */
22
33 /*
44 * Jailhouse paravirt detection
arch/x86/include/asm/kvm_host.h+1−0
@@ -1013,6 +1013,7 @@ struct kvm_x86_ops { · 1012 unmodified lines
10131013
10141014 bool (*has_wbinvd_exit)(void);
10151015
1016+ u64 (*read_l1_tsc_offset)(struct kvm_vcpu *vcpu);
10161017 void (*write_tsc_offset)(struct kvm_vcpu *vcpu, u64 offset);
10171018
10181019 void (*get_exit_info)(struct kvm_vcpu *vcpu, u64 *info1, u64 *info2);
arch/x86/include/asm/pgtable.h+5−0
@@ -601,6 +601,11 @@ static inline pgprot_t pgprot_modify(pgprot_t oldprot, pgprot_t newprot) · 600 unmodified lines
601601
602602 #define canon_pgprot(p) __pgprot(massage_pgprot(p))
603603
604+static inline pgprot_t arch_filter_pgprot(pgprot_t prot)
605+{
606+ return canon_pgprot(prot);
607+}
608+
604609 static inline int is_new_memtype_allowed(u64 paddr, unsigned long size,
605610 enum page_cache_mode pcm,
606611 enum page_cache_mode new_pcm)
arch/x86/include/asm/pgtable_64_types.h+4−4
@@ -105,14 +105,14 @@ extern unsigned int ptrs_per_p4d; · 104 unmodified lines
105105 #define LDT_PGD_ENTRY (pgtable_l5_enabled ? LDT_PGD_ENTRY_L5 : LDT_PGD_ENTRY_L4)
106106 #define LDT_BASE_ADDR (LDT_PGD_ENTRY << PGDIR_SHIFT)
107107
108−#define __VMALLOC_BASE_L4 0xffffc90000000000
109−#define __VMALLOC_BASE_L5 0xffa0000000000000
108+#define __VMALLOC_BASE_L4 0xffffc90000000000UL
109+#define __VMALLOC_BASE_L5 0xffa0000000000000UL
110110
111111 #define VMALLOC_SIZE_TB_L4 32UL
112112 #define VMALLOC_SIZE_TB_L5 12800UL
113113
114−#define __VMEMMAP_BASE_L4 0xffffea0000000000
115−#define __VMEMMAP_BASE_L5 0xffd4000000000000
114+#define __VMEMMAP_BASE_L4 0xffffea0000000000UL
115+#define __VMEMMAP_BASE_L5 0xffd4000000000000UL
116116
117117 #ifdef CONFIG_DYNAMIC_MEMORY_LAYOUT
118118 # define VMALLOC_START vmalloc_base
arch/x86/include/asm/processor.h+0−2
@@ -749,13 +749,11 @@ enum idle_boot_override {IDLE_NO_OVERRIDE=0, IDLE_HALT, IDLE_NOMWAIT, · 748 unmodified lines
749749 extern void enable_sep_cpu(void);
750750 extern int sysenter_setup(void);
751751
752−extern void early_trap_init(void);
753752 void early_trap_pf_init(void);
754753
755754 /* Defined in head.S */
756755 extern struct desc_ptr early_gdt_descr;
757756
758−extern void cpu_set_gdt(int);
759757 extern void switch_to_new_gdt(int);
760758 extern void load_direct_gdt(int);
761759 extern void load_fixmap_gdt(int);
arch/x86/include/uapi/asm/msgbuf.h+31−0
@@ -1 +1,32 @@
1+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2+#ifndef __ASM_X64_MSGBUF_H
3+#define __ASM_X64_MSGBUF_H
4+
5+#if !defined(__x86_64__) || !defined(__ILP32__)
16 #include <asm-generic/msgbuf.h>
7+#else
8+/*
9+ * The msqid64_ds structure for x86 architecture with x32 ABI.
10+ *
11+ * On x86-32 and x86-64 we can just use the generic definition, but
12+ * x32 uses the same binary layout as x86_64, which is differnet
13+ * from other 32-bit architectures.
14+ */
15+
16+struct msqid64_ds {
17+ struct ipc64_perm msg_perm;
18+ __kernel_time_t msg_stime; /* last msgsnd time */
19+ __kernel_time_t msg_rtime; /* last msgrcv time */
20+ __kernel_time_t msg_ctime; /* last change time */
21+ __kernel_ulong_t msg_cbytes; /* current number of bytes on queue */
22+ __kernel_ulong_t msg_qnum; /* number of messages in queue */
23+ __kernel_ulong_t msg_qbytes; /* max number of bytes on queue */
24+ __kernel_pid_t msg_lspid; /* pid of last msgsnd */
25+ __kernel_pid_t msg_lrpid; /* last receive pid */
26+ __kernel_ulong_t __unused4;
27+ __kernel_ulong_t __unused5;
28+};
29+
30+#endif
31+
32+#endif /* __ASM_GENERIC_MSGBUF_H */
arch/x86/include/uapi/asm/shmbuf.h+42−0
@@ -1 +1,43 @@
1+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2+#ifndef __ASM_X86_SHMBUF_H
3+#define __ASM_X86_SHMBUF_H
4+
5+#if !defined(__x86_64__) || !defined(__ILP32__)
16 #include <asm-generic/shmbuf.h>
7+#else
8+/*
9+ * The shmid64_ds structure for x86 architecture with x32 ABI.
10+ *
11+ * On x86-32 and x86-64 we can just use the generic definition, but
12+ * x32 uses the same binary layout as x86_64, which is differnet
13+ * from other 32-bit architectures.
14+ */
15+
16+struct shmid64_ds {
17+ struct ipc64_perm shm_perm; /* operation perms */
18+ size_t shm_segsz; /* size of segment (bytes) */
19+ __kernel_time_t shm_atime; /* last attach time */
20+ __kernel_time_t shm_dtime; /* last detach time */
21+ __kernel_time_t shm_ctime; /* last change time */
22+ __kernel_pid_t shm_cpid; /* pid of creator */
23+ __kernel_pid_t shm_lpid; /* pid of last operator */
24+ __kernel_ulong_t shm_nattch; /* no. of current attaches */
25+ __kernel_ulong_t __unused4;
26+ __kernel_ulong_t __unused5;
27+};
28+
29+struct shminfo64 {
30+ __kernel_ulong_t shmmax;
31+ __kernel_ulong_t shmmin;
32+ __kernel_ulong_t shmmni;
33+ __kernel_ulong_t shmseg;
34+ __kernel_ulong_t shmall;
35+ __kernel_ulong_t __unused1;
36+ __kernel_ulong_t __unused2;
37+ __kernel_ulong_t __unused3;
38+ __kernel_ulong_t __unused4;
39+};
40+
41+#endif
42+
43+#endif /* __ASM_X86_SHMBUF_H */
arch/x86/kernel/acpi/boot.c+4−0
@@ -215,6 +215,10 @@ acpi_parse_x2apic(struct acpi_subtable_header *header, const unsigned long end) · 214 unmodified lines
215215 apic_id = processor->local_apic_id;
216216 enabled = processor->lapic_flags & ACPI_MADT_ENABLED;
217217
218+ /* Ignore invalid ID */
219+ if (apic_id == 0xffffffff)
220+ return 0;
221+
218222 /*
219223 * We need to register disabled CPU as well to permit
220224 * counting disabled CPUs. This allows us to size
arch/x86/kernel/cpu/common.c+5−1
@@ -848,6 +848,11 @@ void get_cpu_cap(struct cpuinfo_x86 *c) · 847 unmodified lines
848848 c->x86_power = edx;
849849 }
850850
851+ if (c->extended_cpuid_level >= 0x80000008) {
852+ cpuid(0x80000008, &eax, &ebx, &ecx, &edx);
853+ c->x86_capability[CPUID_8000_0008_EBX] = ebx;
854+ }
855+
851856 if (c->extended_cpuid_level >= 0x8000000a)
852857 c->x86_capability[CPUID_8000_000A_EDX] = cpuid_edx(0x8000000a);
853858
@@ -871,7 +876,6 @@ static void get_cpu_address_sizes(struct cpuinfo_x86 *c) · 17 unmodified lines
871876
872877 c->x86_virt_bits = (eax >> 8) & 0xff;
873878 c->x86_phys_bits = eax & 0xff;
874− c->x86_capability[CPUID_8000_0008_EBX] = ebx;
875879 }
876880 #ifdef CONFIG_X86_32
877881 else if (cpu_has(c, X86_FEATURE_PAE) || cpu_has(c, X86_FEATURE_PSE36))
arch/x86/kernel/cpu/intel.c+3−0
@@ -835,6 +835,9 @@ static const struct _tlb_table intel_tlb_table[] = { · 834 unmodified lines
835835 { 0x5d, TLB_DATA_4K_4M, 256, " TLB_DATA 4 KByte and 4 MByte pages" },
836836 { 0x61, TLB_INST_4K, 48, " TLB_INST 4 KByte pages, full associative" },
837837 { 0x63, TLB_DATA_1G, 4, " TLB_DATA 1 GByte pages, 4-way set associative" },
838+ { 0x6b, TLB_DATA_4K, 256, " TLB_DATA 4 KByte pages, 8-way associative" },
839+ { 0x6c, TLB_DATA_2M_4M, 128, " TLB_DATA 2 MByte or 4 MByte pages, 8-way associative" },
840+ { 0x6d, TLB_DATA_1G, 16, " TLB_DATA 1 GByte pages, fully associative" },
838841 { 0x76, TLB_INST_2M_4M, 8, " TLB_INST 2-MByte or 4-MByte pages, fully associative" },
839842 { 0xb0, TLB_INST_4K, 128, " TLB_INST 4 KByte pages, 4-way set associative" },
840843 { 0xb1, TLB_INST_2M_4M, 4, " TLB_INST 2M pages, 4-way, 8 entries or 4M pages, 4-way entries" },
arch/x86/kernel/cpu/microcode/core.c+2−4
@@ -564,14 +564,12 @@ static int __reload_late(void *info) · 563 unmodified lines
564564 apply_microcode_local(&err);
565565 spin_unlock(&update_lock);
566566
567+ /* siblings return UCODE_OK because their engine got updated already */
567568 if (err > UCODE_NFOUND) {
568569 pr_warn("Error reloading microcode on CPU %d\n", cpu);
569− return -1;
570− /* siblings return UCODE_OK because their engine got updated already */
570+ ret = -1;
571571 } else if (err == UCODE_UPDATED || err == UCODE_OK) {
572572 ret = 1;
573− } else {
574− return ret;
575573 }
576574
577575 /*
arch/x86/kernel/cpu/microcode/intel.c+0−2
@@ -485,7 +485,6 @@ static void show_saved_mc(void) · 484 unmodified lines
485485 */
486486 static void save_mc_for_early(u8 *mc, unsigned int size)
487487 {
488−#ifdef CONFIG_HOTPLUG_CPU
489488 /* Synchronization during CPU hotplug. */
490489 static DEFINE_MUTEX(x86_cpu_microcode_mutex);
491490
@@ -495,7 +494,6 @@ static void save_mc_for_early(u8 *mc, unsigned int size) · 3 unmodified lines
495494 show_saved_mc();
496495
497496 mutex_unlock(&x86_cpu_microcode_mutex);
498−#endif
499497 }
500498
501499 static bool load_builtin_intel_microcode(struct cpio_data *cp)
arch/x86/kernel/jailhouse.c+1−1
@@ -1,4 +1,4 @@
1−// SPDX-License-Identifier: GPL2.0
1+// SPDX-License-Identifier: GPL-2.0
22 /*
33 * Jailhouse paravirt_ops implementation
44 *
arch/x86/kernel/kexec-bzimage64.c+2−3
@@ -398,11 +398,10 @@ static void *bzImage64_load(struct kimage *image, char *kernel, · 397 unmodified lines
398398 * little bit simple
399399 */
400400 efi_map_sz = efi_get_runtime_map_size();
401− efi_map_sz = ALIGN(efi_map_sz, 16);
402401 params_cmdline_sz = sizeof(struct boot_params) + cmdline_len +
403402 MAX_ELFCOREHDR_STR_LEN;
404403 params_cmdline_sz = ALIGN(params_cmdline_sz, 16);
405− kbuf.bufsz = params_cmdline_sz + efi_map_sz +
404+ kbuf.bufsz = params_cmdline_sz + ALIGN(efi_map_sz, 16) +
406405 sizeof(struct setup_data) +
407406 sizeof(struct efi_setup_data);
408407
@@ -410,7 +409,7 @@ static void *bzImage64_load(struct kimage *image, char *kernel, · 1 unmodified line
410409 if (!params)
411410 return ERR_PTR(-ENOMEM);
412411 efi_map_offset = params_cmdline_sz;
413− efi_setup_data_offset = efi_map_offset + efi_map_sz;
412+ efi_setup_data_offset = efi_map_offset + ALIGN(efi_map_sz, 16);
414413
415414 /* Copy setup header onto bootparams. Documentation/x86/boot.txt */
416415 setup_header_size = 0x0202 + kernel[0x0201] - setup_hdr_offset;
arch/x86/kernel/ldt.c+1−1
@@ -166,7 +166,7 @@ map_ldt_struct(struct mm_struct *mm, struct ldt_struct *ldt, int slot) · 165 unmodified lines
166166 */
167167 pte_prot = __pgprot(__PAGE_KERNEL_RO & ~_PAGE_GLOBAL);
168168 /* Filter out unsuppored __PAGE_KERNEL* bits: */
169− pgprot_val(pte_prot) |= __supported_pte_mask;
169+ pgprot_val(pte_prot) &= __supported_pte_mask;
170170 pte = pfn_pte(pfn, pte_prot);
171171 set_pte_at(mm, va, ptep, pte);
172172 pte_unmap_unlock(ptep, ptl);
arch/x86/kernel/pci-nommu.c+0−90
@@ -1,90 +0,0 @@
1−// SPDX-License-Identifier: GPL-2.0
2−/* Fallback functions when the main IOMMU code is not compiled in. This
3− code is roughly equivalent to i386. */
4−#include <linux/dma-direct.h>
5−#include <linux/scatterlist.h>
6−#include <linux/string.h>
7−#include <linux/gfp.h>
8−#include <linux/pci.h>
9−#include <linux/mm.h>
10−
11−#include <asm/processor.h>
12−#include <asm/iommu.h>
13−#include <asm/dma.h>
14−
15−#define NOMMU_MAPPING_ERROR 0
16−
17−static int
18−check_addr(char *name, struct device *hwdev, dma_addr_t bus, size_t size)
19−{
20− if (hwdev && !dma_capable(hwdev, bus, size)) {
21− if (*hwdev->dma_mask >= DMA_BIT_MASK(32))
22− printk(KERN_ERR
23− "nommu_%s: overflow %Lx+%zu of device mask %Lx\n",
24− name, (long long)bus, size,
25− (long long)*hwdev->dma_mask);
26− return 0;
27− }
28− return 1;
29−}
30−
31−static dma_addr_t nommu_map_page(struct device *dev, struct page *page,
32− unsigned long offset, size_t size,
33− enum dma_data_direction dir,
34− unsigned long attrs)
35−{
36− dma_addr_t bus = phys_to_dma(dev, page_to_phys(page)) + offset;
37− WARN_ON(size == 0);
38− if (!check_addr("map_single", dev, bus, size))
39− return NOMMU_MAPPING_ERROR;
40− return bus;
41−}
42−
43−/* Map a set of buffers described by scatterlist in streaming
44− * mode for DMA. This is the scatter-gather version of the
45− * above pci_map_single interface. Here the scatter gather list
46− * elements are each tagged with the appropriate dma address
47− * and length. They are obtained via sg_dma_{address,length}(SG).
48− *
49− * NOTE: An implementation may be able to use a smaller number of
50− * DMA address/length pairs than there are SG table elements.
51− * (for example via virtual mapping capabilities)
52− * The routine returns the number of addr/length pairs actually
53− * used, at most nents.
54− *
55− * Device ownership issues as mentioned above for pci_map_single are
56− * the same here.
57− */
58−static int nommu_map_sg(struct device *hwdev, struct scatterlist *sg,
59− int nents, enum dma_data_direction dir,
60− unsigned long attrs)
61−{
62− struct scatterlist *s;
63− int i;
64−
65− WARN_ON(nents == 0 || sg[0].length == 0);
66−
67− for_each_sg(sg, s, nents, i) {
68− BUG_ON(!sg_page(s));
69− s->dma_address = sg_phys(s);
70− if (!check_addr("map_sg", hwdev, s->dma_address, s->length))
71− return 0;
72− s->dma_length = s->length;
73− }
74− return nents;
75−}
76−
77−static int nommu_mapping_error(struct device *dev, dma_addr_t dma_addr)
78−{
79− return dma_addr == NOMMU_MAPPING_ERROR;
80−}
81−
82−const struct dma_map_ops nommu_dma_ops = {
83− .alloc = dma_generic_alloc_coherent,
84− .free = dma_generic_free_coherent,
85− .map_sg = nommu_map_sg,
86− .map_page = nommu_map_page,
87− .is_phys = 1,
88− .mapping_error = nommu_mapping_error,
89− .dma_supported = x86_dma_supported,
90−};
arch/x86/kernel/setup.c+6−0
@@ -50,6 +50,7 @@ · 49 unmodified lines
5050 #include <linux/init_ohci1394_dma.h>
5151 #include <linux/kvm_para.h>
5252 #include <linux/dma-contiguous.h>
53+#include <xen/xen.h>
5354
5455 #include <linux/errno.h>
5556 #include <linux/kernel.h>
@@ -534,6 +535,11 @@ static void __init reserve_crashkernel(void) · 478 unmodified lines
534535 high = true;
535536 }
536537
538+ if (xen_pv_domain()) {
539+ pr_info("Ignoring crashkernel for a Xen PV domain\n");
540+ return;
541+ }
542+
537543 /* 0 means: find the address automatically */
538544 if (crash_base <= 0) {
539545 /*
arch/x86/kernel/smpboot.c+42−5
@@ -77,6 +77,8 @@ · 76 unmodified lines
7777 #include <asm/i8259.h>
7878 #include <asm/misc.h>
7979 #include <asm/qspinlock.h>
80+#include <asm/intel-family.h>
81+#include <asm/cpu_device_id.h>
8082
8183 /* Number of siblings per CPU package */
8284 int smp_num_siblings = 1;
@@ -390,15 +392,47 @@ static bool match_smt(struct cpuinfo_x86 *c, struct cpuinfo_x86 *o) · 307 unmodified lines
390392 return false;
391393 }
392394
395+/*
396+ * Define snc_cpu[] for SNC (Sub-NUMA Cluster) CPUs.
397+ *
398+ * These are Intel CPUs that enumerate an LLC that is shared by
399+ * multiple NUMA nodes. The LLC on these systems is shared for
400+ * off-package data access but private to the NUMA node (half
401+ * of the package) for on-package access.
402+ *
403+ * CPUID (the source of the information about the LLC) can only
404+ * enumerate the cache as being shared *or* unshared, but not
405+ * this particular configuration. The CPU in this case enumerates
406+ * the cache to be shared across the entire package (spanning both
407+ * NUMA nodes).
408+ */
409+
410+static const struct x86_cpu_id snc_cpu[] = {
411+ { X86_VENDOR_INTEL, 6, INTEL_FAM6_SKYLAKE_X },
412+ {}
413+};
414+
393415 static bool match_llc(struct cpuinfo_x86 *c, struct cpuinfo_x86 *o)
394416 {
395417 int cpu1 = c->cpu_index, cpu2 = o->cpu_index;
396418
397− if (per_cpu(cpu_llc_id, cpu1) != BAD_APICID &&
398− per_cpu(cpu_llc_id, cpu1) == per_cpu(cpu_llc_id, cpu2))
399− return topology_sane(c, o, "llc");
419+ /* Do not match if we do not have a valid APICID for cpu: */
420+ if (per_cpu(cpu_llc_id, cpu1) == BAD_APICID)
421+ return false;
400422
401− return false;
423+ /* Do not match if LLC id does not match: */
424+ if (per_cpu(cpu_llc_id, cpu1) != per_cpu(cpu_llc_id, cpu2))
425+ return false;
426+
427+ /*
428+ * Allow the SNC topology without warning. Return of false
429+ * means 'c' does not share the LLC of 'o'. This will be
430+ * reflected to userspace.
431+ */
432+ if (!topology_same_node(c, o) && x86_match_cpu(snc_cpu))
433+ return false;
434+
435+ return topology_sane(c, o, "llc");
402436 }
403437
404438 /*
@@ -456,7 +490,8 @@ static struct sched_domain_topology_level x86_topology[] = { · 51 unmodified lines
456490
457491 /*
458492 * Set if a package/die has multiple NUMA nodes inside.
459− * AMD Magny-Cours and Intel Cluster-on-Die have this.
493+ * AMD Magny-Cours, Intel Cluster-on-Die, and Intel
494+ * Sub-NUMA Clustering have this.
460495 */
461496 static bool x86_has_numa_in_package;
462497
@@ -1536,6 +1571,8 @@ static inline void mwait_play_dead(void) · 1073 unmodified lines
15361571 void *mwait_ptr;
15371572 int i;
15381573
1574+ if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD)
1575+ return;
15391576 if (!this_cpu_has(X86_FEATURE_MWAIT))
15401577 return;
15411578 if (!this_cpu_has(X86_FEATURE_CLFLUSH))
arch/x86/kernel/tsc.c+12−12
@@ -317,7 +317,7 @@ static unsigned long calc_hpet_ref(u64 deltatsc, u64 hpet1, u64 hpet2) · 316 unmodified lines
317317 hpet2 -= hpet1;
318318 tmp = ((u64)hpet2 * hpet_readl(HPET_PERIOD));
319319 do_div(tmp, 1000000);
320− do_div(deltatsc, tmp);
320+ deltatsc = div64_u64(deltatsc, tmp);
321321
322322 return (unsigned long) deltatsc;
323323 }
@@ -1067,6 +1067,7 @@ static struct clocksource clocksource_tsc_early = { · 743 unmodified lines
10671067 .resume = tsc_resume,
10681068 .mark_unstable = tsc_cs_mark_unstable,
10691069 .tick_stable = tsc_cs_tick_stable,
1070+ .list = LIST_HEAD_INIT(clocksource_tsc_early.list),
10701071 };
10711072
10721073 /*
@@ -1086,6 +1087,7 @@ static struct clocksource clocksource_tsc = { · 13 unmodified lines
10861087 .resume = tsc_resume,
10871088 .mark_unstable = tsc_cs_mark_unstable,
10881089 .tick_stable = tsc_cs_tick_stable,
1090+ .list = LIST_HEAD_INIT(clocksource_tsc.list),
10891091 };
10901092
10911093 void mark_tsc_unstable(char *reason)
@@ -1098,13 +1100,9 @@ void mark_tsc_unstable(char *reason) · 6 unmodified lines
10981100 clear_sched_clock_stable();
10991101 disable_sched_clock_irqtime();
11001102 pr_info("Marking TSC unstable due to %s\n", reason);
1101− /* Change only the rating, when not registered */
1102− if (clocksource_tsc.mult) {
1103− clocksource_mark_unstable(&clocksource_tsc);
1104− } else {
1105− clocksource_tsc.flags |= CLOCK_SOURCE_UNSTABLE;
1106− clocksource_tsc.rating = 0;
1107− }
1103+
1104+ clocksource_mark_unstable(&clocksource_tsc_early);
1105+ clocksource_mark_unstable(&clocksource_tsc);
11081106 }
11091107
11101108 EXPORT_SYMBOL_GPL(mark_tsc_unstable);
@@ -1244,7 +1242,7 @@ static void tsc_refine_calibration_work(struct work_struct *work) · 133 unmodified lines
12441242
12451243 /* Don't bother refining TSC on unstable systems */
12461244 if (tsc_unstable)
1247− return;
1245+ goto unreg;
12481246
12491247 /*
12501248 * Since the work is started early in boot, we may be
@@ -1297,11 +1295,12 @@ static void tsc_refine_calibration_work(struct work_struct *work) · 46 unmodified lines
12971295
12981296 out:
12991297 if (tsc_unstable)
1300− return;
1298+ goto unreg;
13011299
13021300 if (boot_cpu_has(X86_FEATURE_ART))
13031301 art_related_clocksource = &clocksource_tsc;
13041302 clocksource_register_khz(&clocksource_tsc, tsc_khz);
1303+unreg:
13051304 clocksource_unregister(&clocksource_tsc_early);
13061305 }
13071306
@@ -1311,8 +1310,8 @@ static int __init init_tsc_clocksource(void) · 3 unmodified lines
13111310 if (!boot_cpu_has(X86_FEATURE_TSC) || tsc_disabled > 0 || !tsc_khz)
13121311 return 0;
13131312
1314− if (check_tsc_unstable())
1315− return 0;
1313+ if (tsc_unstable)
1314+ goto unreg;
13161315
13171316 if (tsc_clocksource_reliable)
13181317 clocksource_tsc.flags &= ~CLOCK_SOURCE_MUST_VERIFY;
@@ -1328,6 +1327,7 @@ static int __init init_tsc_clocksource(void) · 9 unmodified lines
13281327 if (boot_cpu_has(X86_FEATURE_ART))
13291328 art_related_clocksource = &clocksource_tsc;
13301329 clocksource_register_khz(&clocksource_tsc, tsc_khz);
1330+unreg:
13311331 clocksource_unregister(&clocksource_tsc_early);
13321332 return 0;
13331333 }
arch/x86/kvm/lapic.c+20−17
@@ -1463,23 +1463,6 @@ static void start_sw_tscdeadline(struct kvm_lapic *apic) · 1462 unmodified lines
14631463 local_irq_restore(flags);
14641464 }
14651465
1466−static void start_sw_period(struct kvm_lapic *apic)
1467−{
1468− if (!apic->lapic_timer.period)
1469− return;
1470−
1471− if (apic_lvtt_oneshot(apic) &&
1472− ktime_after(ktime_get(),
1473− apic->lapic_timer.target_expiration)) {
1474− apic_timer_expired(apic);
1475− return;
1476− }
1477−
1478− hrtimer_start(&apic->lapic_timer.timer,
1479− apic->lapic_timer.target_expiration,
1480− HRTIMER_MODE_ABS_PINNED);
1481−}
1482−
14831466 static void update_target_expiration(struct kvm_lapic *apic, uint32_t old_divisor)
14841467 {
14851468 ktime_t now, remaining;
@@ -1546,6 +1529,26 @@ static void advance_periodic_target_expiration(struct kvm_lapic *apic) · 60 unmodified lines
15461529 apic->lapic_timer.period);
15471530 }
15481531
1532+static void start_sw_period(struct kvm_lapic *apic)
1533+{
1534+ if (!apic->lapic_timer.period)
1535+ return;
1536+
1537+ if (ktime_after(ktime_get(),
1538+ apic->lapic_timer.target_expiration)) {
1539+ apic_timer_expired(apic);
1540+
1541+ if (apic_lvtt_oneshot(apic))
1542+ return;
1543+
1544+ advance_periodic_target_expiration(apic);
1545+ }
1546+
1547+ hrtimer_start(&apic->lapic_timer.timer,
1548+ apic->lapic_timer.target_expiration,
1549+ HRTIMER_MODE_ABS_PINNED);
1550+}
1551+
15491552 bool kvm_lapic_hv_timer_in_use(struct kvm_vcpu *vcpu)
15501553 {
15511554 if (!lapic_in_kernel(vcpu))
arch/x86/kvm/svm.c+18−13
@@ -1423,12 +1423,23 @@ static void init_sys_seg(struct vmcb_seg *seg, uint32_t type) · 1422 unmodified lines
14231423 seg->base = 0;
14241424 }
14251425
1426+static u64 svm_read_l1_tsc_offset(struct kvm_vcpu *vcpu)
1427+{
1428+ struct vcpu_svm *svm = to_svm(vcpu);
1429+
1430+ if (is_guest_mode(vcpu))
1431+ return svm->nested.hsave->control.tsc_offset;
1432+
1433+ return vcpu->arch.tsc_offset;
1434+}
1435+
14261436 static void svm_write_tsc_offset(struct kvm_vcpu *vcpu, u64 offset)
14271437 {
14281438 struct vcpu_svm *svm = to_svm(vcpu);
14291439 u64 g_tsc_offset = 0;
14301440
14311441 if (is_guest_mode(vcpu)) {
1442+ /* Write L1's TSC offset. */
14321443 g_tsc_offset = svm->vmcb->control.tsc_offset -
14331444 svm->nested.hsave->control.tsc_offset;
14341445 svm->nested.hsave->control.tsc_offset = offset;
@@ -3322,6 +3333,7 @@ static int nested_svm_vmexit(struct vcpu_svm *svm) · 1887 unmodified lines
33223333 /* Restore the original control entries */
33233334 copy_vmcb_control_area(vmcb, hsave);
33243335
3336+ svm->vcpu.arch.tsc_offset = svm->vmcb->control.tsc_offset;
33253337 kvm_clear_exception_queue(&svm->vcpu);
33263338 kvm_clear_interrupt_queue(&svm->vcpu);
33273339
@@ -3482,10 +3494,12 @@ static void enter_svm_guest_mode(struct vcpu_svm *svm, u64 vmcb_gpa, · 154 unmodified lines
34823494 /* We don't want to see VMMCALLs from a nested guest */
34833495 clr_intercept(svm, INTERCEPT_VMMCALL);
34843496
3497+ svm->vcpu.arch.tsc_offset += nested_vmcb->control.tsc_offset;
3498+ svm->vmcb->control.tsc_offset = svm->vcpu.arch.tsc_offset;
3499+
34853500 svm->vmcb->control.virt_ext = nested_vmcb->control.virt_ext;
34863501 svm->vmcb->control.int_vector = nested_vmcb->control.int_vector;
34873502 svm->vmcb->control.int_state = nested_vmcb->control.int_state;
3488− svm->vmcb->control.tsc_offset += nested_vmcb->control.tsc_offset;
34893503 svm->vmcb->control.event_inj = nested_vmcb->control.event_inj;
34903504 svm->vmcb->control.event_inj_err = nested_vmcb->control.event_inj_err;
34913505
@@ -4035,12 +4049,6 @@ static int svm_get_msr(struct kvm_vcpu *vcpu, struct msr_data *msr_info) · 543 unmodified lines
40354049 struct vcpu_svm *svm = to_svm(vcpu);
40364050
40374051 switch (msr_info->index) {
4038− case MSR_IA32_TSC: {
4039− msr_info->data = svm->vmcb->control.tsc_offset +
4040− kvm_scale_tsc(vcpu, rdtsc());
4041−
4042− break;
4043− }
40444052 case MSR_STAR:
40454053 msr_info->data = svm->vmcb->save.star;
40464054 break;
@@ -4193,9 +4201,6 @@ static int svm_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr) · 146 unmodified lines
41934201 svm->vmcb->save.g_pat = data;
41944202 mark_dirty(svm->vmcb, VMCB_NPT);
41954203 break;
4196− case MSR_IA32_TSC:
4197− kvm_write_tsc(vcpu, msr);
4198− break;
41994204 case MSR_IA32_SPEC_CTRL:
42004205 if (!msr->host_initiated &&
42014206 !guest_cpuid_has(vcpu, X86_FEATURE_IBRS))
@@ -5265,9 +5270,8 @@ static int svm_update_pi_irte(struct kvm *kvm, unsigned int host_irq, · 1063 unmodified lines
52655270 }
52665271
52675272 if (!ret && svm) {
5268− trace_kvm_pi_irte_update(svm->vcpu.vcpu_id,
5269− host_irq, e->gsi,
5270− vcpu_info.vector,
5273+ trace_kvm_pi_irte_update(host_irq, svm->vcpu.vcpu_id,
5274+ e->gsi, vcpu_info.vector,
52715275 vcpu_info.pi_desc_addr, set);
52725276 }
52735277
@@ -7102,6 +7106,7 @@ static struct kvm_x86_ops svm_x86_ops __ro_after_init = { · 1828 unmodified lines
71027106
71037107 .has_wbinvd_exit = svm_has_wbinvd_exit,
71047108
7109+ .read_l1_tsc_offset = svm_read_l1_tsc_offset,
71057110 .write_tsc_offset = svm_write_tsc_offset,
71067111
71077112 .set_tdp_cr3 = set_tdp_cr3,
arch/x86/kvm/vmx.c+59−50
@@ -2880,18 +2880,15 @@ static void setup_msrs(struct vcpu_vmx *vmx) · 2879 unmodified lines
28802880 vmx_update_msr_bitmap(&vmx->vcpu);
28812881 }
28822882
2883−/*
2884− * reads and returns guest's timestamp counter "register"
2885− * guest_tsc = (host_tsc * tsc multiplier) >> 48 + tsc_offset
2886− * -- Intel TSC Scaling for Virtualization White Paper, sec 1.3
2887− */
2888−static u64 guest_read_tsc(struct kvm_vcpu *vcpu)
2883+static u64 vmx_read_l1_tsc_offset(struct kvm_vcpu *vcpu)
28892884 {
2890− u64 host_tsc, tsc_offset;
2885+ struct vmcs12 *vmcs12 = get_vmcs12(vcpu);
28912886
2892− host_tsc = rdtsc();
2893− tsc_offset = vmcs_read64(TSC_OFFSET);
2894− return kvm_scale_tsc(vcpu, host_tsc) + tsc_offset;
2887+ if (is_guest_mode(vcpu) &&
2888+ (vmcs12->cpu_based_vm_exec_control & CPU_BASED_USE_TSC_OFFSETING))
2889+ return vcpu->arch.tsc_offset - vmcs12->tsc_offset;
2890+
2891+ return vcpu->arch.tsc_offset;
28952892 }
28962893
28972894 /*
@@ -3524,9 +3521,6 @@ static int vmx_get_msr(struct kvm_vcpu *vcpu, struct msr_data *msr_info) · 626 unmodified lines
35243521 #endif
35253522 case MSR_EFER:
35263523 return kvm_get_msr_common(vcpu, msr_info);
3527− case MSR_IA32_TSC:
3528− msr_info->data = guest_read_tsc(vcpu);
3529− break;
35303524 case MSR_IA32_SPEC_CTRL:
35313525 if (!msr_info->host_initiated &&
35323526 !guest_cpuid_has(vcpu, X86_FEATURE_IBRS) &&
@@ -3646,9 +3640,6 @@ static int vmx_set_msr(struct kvm_vcpu *vcpu, struct msr_data *msr_info) · 113 unmodified lines
36463640 return 1;
36473641 vmcs_write64(GUEST_BNDCFGS, data);
36483642 break;
3649− case MSR_IA32_TSC:
3650− kvm_write_tsc(vcpu, msr_info);
3651− break;
36523643 case MSR_IA32_SPEC_CTRL:
36533644 if (!msr_info->host_initiated &&
36543645 !guest_cpuid_has(vcpu, X86_FEATURE_IBRS) &&
@@ -4553,12 +4544,6 @@ static void vmx_flush_tlb(struct kvm_vcpu *vcpu, bool invalidate_gpa) · 898 unmodified lines
45534544 __vmx_flush_tlb(vcpu, to_vmx(vcpu)->vpid, invalidate_gpa);
45544545 }
45554546
4556−static void vmx_flush_tlb_ept_only(struct kvm_vcpu *vcpu)
4557−{
4558− if (enable_ept)
4559− vmx_flush_tlb(vcpu, true);
4560−}
4561−
45624547 static void vmx_decache_cr0_guest_bits(struct kvm_vcpu *vcpu)
45634548 {
45644549 ulong cr0_guest_owned_bits = vcpu->arch.cr0_guest_owned_bits;
@@ -9287,7 +9272,7 @@ static void vmx_set_virtual_x2apic_mode(struct kvm_vcpu *vcpu, bool set) · 4722 unmodified lines
92879272 } else {
92889273 sec_exec_control &= ~SECONDARY_EXEC_VIRTUALIZE_X2APIC_MODE;
92899274 sec_exec_control |= SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES;
9290− vmx_flush_tlb_ept_only(vcpu);
9275+ vmx_flush_tlb(vcpu, true);
92919276 }
92929277 vmcs_write32(SECONDARY_VM_EXEC_CONTROL, sec_exec_control);
92939278
@@ -9315,7 +9300,7 @@ static void vmx_set_apic_access_page_addr(struct kvm_vcpu *vcpu, hpa_t hpa) · 21 unmodified lines
93159300 !nested_cpu_has2(get_vmcs12(&vmx->vcpu),
93169301 SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES)) {
93179302 vmcs_write64(APIC_ACCESS_ADDR, hpa);
9318− vmx_flush_tlb_ept_only(vcpu);
9303+ vmx_flush_tlb(vcpu, true);
93199304 }
93209305 }
93219306
@@ -10608,6 +10593,16 @@ static inline bool nested_vmx_prepare_msr_bitmap(struct kvm_vcpu *vcpu, · 1286 unmodified lines
1060810593 return true;
1060910594 }
1061010595
10596+static int nested_vmx_check_apic_access_controls(struct kvm_vcpu *vcpu,
10597+ struct vmcs12 *vmcs12)
10598+{
10599+ if (nested_cpu_has2(vmcs12, SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES) &&
10600+ !page_address_valid(vcpu, vmcs12->apic_access_addr))
10601+ return -EINVAL;
10602+ else
10603+ return 0;
10604+}
10605+
1061110606 static int nested_vmx_check_apicv_controls(struct kvm_vcpu *vcpu,
1061210607 struct vmcs12 *vmcs12)
1061310608 {
@@ -11176,11 +11171,8 @@ static int prepare_vmcs02(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12, · 562 unmodified lines
1117611171 vmcs_write64(GUEST_IA32_PAT, vmx->vcpu.arch.pat);
1117711172 }
1117811173
11179− if (vmcs12->cpu_based_vm_exec_control & CPU_BASED_USE_TSC_OFFSETING)
11180− vmcs_write64(TSC_OFFSET,
11181− vcpu->arch.tsc_offset + vmcs12->tsc_offset);
11182− else
11183− vmcs_write64(TSC_OFFSET, vcpu->arch.tsc_offset);
11174+ vmcs_write64(TSC_OFFSET, vcpu->arch.tsc_offset);
11175+
1118411176 if (kvm_has_tsc_control)
1118511177 decache_tsc_multiplier(vmx);
1118611178
@@ -11222,7 +11214,7 @@ static int prepare_vmcs02(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12, · 35 unmodified lines
1122211214 }
1122311215 } else if (nested_cpu_has2(vmcs12,
1122411216 SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES)) {
11225− vmx_flush_tlb_ept_only(vcpu);
11217+ vmx_flush_tlb(vcpu, true);
1122611218 }
1122711219
1122811220 /*
@@ -11299,6 +11291,9 @@ static int check_vmentry_prereqs(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12) · 70 unmodified lines
1129911291 if (nested_vmx_check_msr_bitmap_controls(vcpu, vmcs12))
1130011292 return VMXERR_ENTRY_INVALID_CONTROL_FIELD;
1130111293
11294+ if (nested_vmx_check_apic_access_controls(vcpu, vmcs12))
11295+ return VMXERR_ENTRY_INVALID_CONTROL_FIELD;
11296+
1130211297 if (nested_vmx_check_tpr_shadow_controls(vcpu, vmcs12))
1130311298 return VMXERR_ENTRY_INVALID_CONTROL_FIELD;
1130411299
@@ -11420,6 +11415,7 @@ static int enter_vmx_non_root_mode(struct kvm_vcpu *vcpu, bool from_vmentry) · 115 unmodified lines
1142011415 struct vmcs12 *vmcs12 = get_vmcs12(vcpu);
1142111416 u32 msr_entry_idx;
1142211417 u32 exit_qual;
11418+ int r;
1142311419
1142411420 enter_guest_mode(vcpu);
1142511421
@@ -11429,26 +11425,21 @@ static int enter_vmx_non_root_mode(struct kvm_vcpu *vcpu, bool from_vmentry) · 3 unmodified lines
1142911425 vmx_switch_vmcs(vcpu, &vmx->nested.vmcs02);
1143011426 vmx_segment_cache_clear(vmx);
1143111427
11432− if (prepare_vmcs02(vcpu, vmcs12, from_vmentry, &exit_qual)) {
11433− leave_guest_mode(vcpu);
11434− vmx_switch_vmcs(vcpu, &vmx->vmcs01);
11435− nested_vmx_entry_failure(vcpu, vmcs12,
11436− EXIT_REASON_INVALID_STATE, exit_qual);
11437− return 1;
11438− }
11428+ if (vmcs12->cpu_based_vm_exec_control & CPU_BASED_USE_TSC_OFFSETING)
11429+ vcpu->arch.tsc_offset += vmcs12->tsc_offset;
11430+
11431+ r = EXIT_REASON_INVALID_STATE;
11432+ if (prepare_vmcs02(vcpu, vmcs12, from_vmentry, &exit_qual))
11433+ goto fail;
1143911434
1144011435 nested_get_vmcs12_pages(vcpu, vmcs12);
1144111436
11437+ r = EXIT_REASON_MSR_LOAD_FAIL;
1144211438 msr_entry_idx = nested_vmx_load_msr(vcpu,
1144311439 vmcs12->vm_entry_msr_load_addr,
1144411440 vmcs12->vm_entry_msr_load_count);
11445− if (msr_entry_idx) {
11446− leave_guest_mode(vcpu);
11447− vmx_switch_vmcs(vcpu, &vmx->vmcs01);
11448− nested_vmx_entry_failure(vcpu, vmcs12,
11449− EXIT_REASON_MSR_LOAD_FAIL, msr_entry_idx);
11450− return 1;
11451− }
11441+ if (msr_entry_idx)
11442+ goto fail;
1145211443
1145311444 /*
1145411445 * Note no nested_vmx_succeed or nested_vmx_fail here. At this point
@@ -11457,6 +11448,14 @@ static int enter_vmx_non_root_mode(struct kvm_vcpu *vcpu, bool from_vmentry) · 2 unmodified lines
1145711448 * the success flag) when L2 exits (see nested_vmx_vmexit()).
1145811449 */
1145911450 return 0;
11451+
11452+fail:
11453+ if (vmcs12->cpu_based_vm_exec_control & CPU_BASED_USE_TSC_OFFSETING)
11454+ vcpu->arch.tsc_offset -= vmcs12->tsc_offset;
11455+ leave_guest_mode(vcpu);
11456+ vmx_switch_vmcs(vcpu, &vmx->vmcs01);
11457+ nested_vmx_entry_failure(vcpu, vmcs12, r, exit_qual);
11458+ return 1;
1146011459 }
1146111460
1146211461 /*
@@ -12028,6 +12027,9 @@ static void nested_vmx_vmexit(struct kvm_vcpu *vcpu, u32 exit_reason, · 565 unmodified lines
1202812027
1202912028 leave_guest_mode(vcpu);
1203012029
12030+ if (vmcs12->cpu_based_vm_exec_control & CPU_BASED_USE_TSC_OFFSETING)
12031+ vcpu->arch.tsc_offset -= vmcs12->tsc_offset;
12032+
1203112033 if (likely(!vmx->fail)) {
1203212034 if (exit_reason == -1)
1203312035 sync_vmcs12(vcpu, vmcs12);
@@ -12065,7 +12067,7 @@ static void nested_vmx_vmexit(struct kvm_vcpu *vcpu, u32 exit_reason, · 31 unmodified lines
1206512067 } else if (!nested_cpu_has_ept(vmcs12) &&
1206612068 nested_cpu_has2(vmcs12,
1206712069 SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES)) {
12068− vmx_flush_tlb_ept_only(vcpu);
12070+ vmx_flush_tlb(vcpu, true);
1206912071 }
1207012072
1207112073 /* This is needed for same reason as it was needed in prepare_vmcs02 */
@@ -12224,10 +12226,16 @@ static inline int u64_shl_div_u64(u64 a, unsigned int shift, · 152 unmodified lines
1222412226
1222512227 static int vmx_set_hv_timer(struct kvm_vcpu *vcpu, u64 guest_deadline_tsc)
1222612228 {
12227− struct vcpu_vmx *vmx = to_vmx(vcpu);
12228− u64 tscl = rdtsc();
12229− u64 guest_tscl = kvm_read_l1_tsc(vcpu, tscl);
12230− u64 delta_tsc = max(guest_deadline_tsc, guest_tscl) - guest_tscl;
12229+ struct vcpu_vmx *vmx;
12230+ u64 tscl, guest_tscl, delta_tsc;
12231+
12232+ if (kvm_mwait_in_guest(vcpu->kvm))
12233+ return -EOPNOTSUPP;
12234+
12235+ vmx = to_vmx(vcpu);
12236+ tscl = rdtsc();
12237+ guest_tscl = kvm_read_l1_tsc(vcpu, tscl);
12238+ delta_tsc = max(guest_deadline_tsc, guest_tscl) - guest_tscl;
1223112239
1223212240 /* Convert to host delta tsc if tsc scaling is enabled */
1223312241 if (vcpu->arch.tsc_scaling_ratio != kvm_default_tsc_scaling_ratio &&
@@ -12533,7 +12541,7 @@ static int vmx_update_pi_irte(struct kvm *kvm, unsigned int host_irq, · 299 unmodified lines
1253312541 vcpu_info.pi_desc_addr = __pa(vcpu_to_pi_desc(vcpu));
1253412542 vcpu_info.vector = irq.vector;
1253512543
12536− trace_kvm_pi_irte_update(vcpu->vcpu_id, host_irq, e->gsi,
12544+ trace_kvm_pi_irte_update(host_irq, vcpu->vcpu_id, e->gsi,
1253712545 vcpu_info.vector, vcpu_info.pi_desc_addr, set);
1253812546
1253912547 if (set)
@@ -12712,6 +12720,7 @@ static struct kvm_x86_ops vmx_x86_ops __ro_after_init = { · 172 unmodified lines
1271212720
1271312721 .has_wbinvd_exit = cpu_has_vmx_wbinvd_exit,
1271412722
12723+ .read_l1_tsc_offset = vmx_read_l1_tsc_offset,
1271512724 .write_tsc_offset = vmx_write_tsc_offset,
1271612725
1271712726 .set_tdp_cr3 = vmx_set_cr3,
arch/x86/kvm/x86.c+12−3
@@ -1490,7 +1490,7 @@ static void kvm_track_tsc_matching(struct kvm_vcpu *vcpu) · 1489 unmodified lines
14901490
14911491 static void update_ia32_tsc_adjust_msr(struct kvm_vcpu *vcpu, s64 offset)
14921492 {
1493− u64 curr_offset = vcpu->arch.tsc_offset;
1493+ u64 curr_offset = kvm_x86_ops->read_l1_tsc_offset(vcpu);
14941494 vcpu->arch.ia32_tsc_adjust_msr += offset - curr_offset;
14951495 }
14961496
@@ -1532,7 +1532,9 @@ static u64 kvm_compute_tsc_offset(struct kvm_vcpu *vcpu, u64 target_tsc) · 35 unmodified lines
15321532
15331533 u64 kvm_read_l1_tsc(struct kvm_vcpu *vcpu, u64 host_tsc)
15341534 {
1535− return vcpu->arch.tsc_offset + kvm_scale_tsc(vcpu, host_tsc);
1535+ u64 tsc_offset = kvm_x86_ops->read_l1_tsc_offset(vcpu);
1536+
1537+ return tsc_offset + kvm_scale_tsc(vcpu, host_tsc);
15361538 }
15371539 EXPORT_SYMBOL_GPL(kvm_read_l1_tsc);
15381540
@@ -2362,6 +2364,9 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info) · 823 unmodified lines
23622364 return 1;
23632365 vcpu->arch.smbase = data;
23642366 break;
2367+ case MSR_IA32_TSC:
2368+ kvm_write_tsc(vcpu, msr_info);
2369+ break;
23652370 case MSR_SMI_COUNT:
23662371 if (!msr_info->host_initiated)
23672372 return 1;
@@ -2605,6 +2610,9 @@ int kvm_get_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info) · 237 unmodified lines
26052610 case MSR_IA32_UCODE_REV:
26062611 msr_info->data = vcpu->arch.microcode_version;
26072612 break;
2613+ case MSR_IA32_TSC:
2614+ msr_info->data = kvm_scale_tsc(vcpu, rdtsc()) + vcpu->arch.tsc_offset;
2615+ break;
26082616 case MSR_MTRRcap:
26092617 case 0x200 ... 0x2ff:
26102618 return kvm_mtrr_get_msr(vcpu, msr_info->index, &msr_info->data);
@@ -2819,7 +2827,8 @@ out: · 208 unmodified lines
28192827 static inline bool kvm_can_mwait_in_guest(void)
28202828 {
28212829 return boot_cpu_has(X86_FEATURE_MWAIT) &&
2822− !boot_cpu_has_bug(X86_BUG_MONITOR);
2830+ !boot_cpu_has_bug(X86_BUG_MONITOR) &&
2831+ boot_cpu_has(X86_FEATURE_ARAT);
28232832 }
28242833
28252834 int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
arch/x86/kvm/x86.h+0−7
@@ -302,13 +302,6 @@ static inline u64 nsec_to_cycles(struct kvm_vcpu *vcpu, u64 nsec) · 301 unmodified lines
302302 __rem; \
303303 })
304304
305−#define KVM_X86_DISABLE_EXITS_MWAIT (1 << 0)
306−#define KVM_X86_DISABLE_EXITS_HTL (1 << 1)
307−#define KVM_X86_DISABLE_EXITS_PAUSE (1 << 2)
308−#define KVM_X86_DISABLE_VALID_EXITS (KVM_X86_DISABLE_EXITS_MWAIT | \
309− KVM_X86_DISABLE_EXITS_HTL | \
310− KVM_X86_DISABLE_EXITS_PAUSE)
311−
312305 static inline bool kvm_mwait_in_guest(struct kvm *kvm)
313306 {
314307 return kvm->arch.mwait_in_guest;
arch/x86/mm/dump_pagetables.c+6−5
@@ -18,6 +18,7 @@ · 17 unmodified lines
1818 #include <linux/init.h>
1919 #include <linux/sched.h>
2020 #include <linux/seq_file.h>
21+#include <linux/highmem.h>
2122
2223 #include <asm/pgtable.h>
2324
@@ -334,16 +335,16 @@ static void walk_pte_level(struct seq_file *m, struct pg_state *st, pmd_t addr, · 310 unmodified lines
334335 pgprotval_t eff_in, unsigned long P)
335336 {
336337 int i;
337− pte_t *start;
338+ pte_t *pte;
338339 pgprotval_t prot, eff;
339340
340− start = (pte_t *)pmd_page_vaddr(addr);
341341 for (i = 0; i < PTRS_PER_PTE; i++) {
342− prot = pte_flags(*start);
343− eff = effective_prot(eff_in, prot);
344342 st->current_address = normalize_addr(P + i * PTE_LEVEL_MULT);
343+ pte = pte_offset_map(&addr, st->current_address);
344+ prot = pte_flags(*pte);
345+ eff = effective_prot(eff_in, prot);
345346 note_page(m, st, __pgprot(prot), eff, 5);
346− start++;
347+ pte_unmap(pte);
347348 }
348349 }
349350 #ifdef CONFIG_KASAN
arch/x86/mm/pageattr.c+32−12
@@ -93,6 +93,18 @@ void arch_report_meminfo(struct seq_file *m) · 92 unmodified lines
9393 static inline void split_page_count(int level) { }
9494 #endif
9595
96+static inline int
97+within(unsigned long addr, unsigned long start, unsigned long end)
98+{
99+ return addr >= start && addr < end;
100+}
101+
102+static inline int
103+within_inclusive(unsigned long addr, unsigned long start, unsigned long end)
104+{
105+ return addr >= start && addr <= end;
106+}
107+
96108 #ifdef CONFIG_X86_64
97109
98110 static inline unsigned long highmap_start_pfn(void)
@@ -106,20 +118,25 @@ static inline unsigned long highmap_end_pfn(void) · 7 unmodified lines
106118 return __pa_symbol(roundup(_brk_end, PMD_SIZE) - 1) >> PAGE_SHIFT;
107119 }
108120
109−#endif
110−
111−static inline int
112−within(unsigned long addr, unsigned long start, unsigned long end)
121+static bool __cpa_pfn_in_highmap(unsigned long pfn)
113122 {
114− return addr >= start && addr < end;
123+ /*
124+ * Kernel text has an alias mapping at a high address, known
125+ * here as "highmap".
126+ */
127+ return within_inclusive(pfn, highmap_start_pfn(), highmap_end_pfn());
115128 }
116129
117−static inline int
118−within_inclusive(unsigned long addr, unsigned long start, unsigned long end)
130+#else
131+
132+static bool __cpa_pfn_in_highmap(unsigned long pfn)
119133 {
120− return addr >= start && addr <= end;
134+ /* There is no highmap on 32-bit */
135+ return false;
121136 }
122137
138+#endif
139+
123140 /*
124141 * Flushing functions
125142 */
@@ -172,7 +189,7 @@ static void __cpa_flush_all(void *arg) · 46 unmodified lines
172189
173190 static void cpa_flush_all(unsigned long cache)
174191 {
175− BUG_ON(irqs_disabled());
192+ BUG_ON(irqs_disabled() && !early_boot_irqs_disabled);
176193
177194 on_each_cpu(__cpa_flush_all, (void *) cache, 1);
178195 }
@@ -236,7 +253,7 @@ static void cpa_flush_array(unsigned long *start, int numpages, int cache, · 57 unmodified lines
236253 unsigned long do_wbinvd = cache && numpages >= 1024; /* 4M threshold */
237254 #endif
238255
239− BUG_ON(irqs_disabled());
256+ BUG_ON(irqs_disabled() && !early_boot_irqs_disabled);
240257
241258 on_each_cpu(__cpa_flush_all, (void *) do_wbinvd, 1);
242259
@@ -1183,6 +1200,10 @@ static int __cpa_process_fault(struct cpa_data *cpa, unsigned long vaddr, · 940 unmodified lines
11831200 cpa->numpages = 1;
11841201 cpa->pfn = __pa(vaddr) >> PAGE_SHIFT;
11851202 return 0;
1203+
1204+ } else if (__cpa_pfn_in_highmap(cpa->pfn)) {
1205+ /* Faults in the highmap are OK, so do not warn: */
1206+ return -EFAULT;
11861207 } else {
11871208 WARN(1, KERN_WARNING "CPA: called for zero pte. "
11881209 "vaddr = %lx cpa->vaddr = %lx\n", vaddr,
@@ -1335,8 +1356,7 @@ static int cpa_process_alias(struct cpa_data *cpa) · 146 unmodified lines
13351356 * to touch the high mapped kernel as well:
13361357 */
13371358 if (!within(vaddr, (unsigned long)_text, _brk_end) &&
1338− within_inclusive(cpa->pfn, highmap_start_pfn(),
1339− highmap_end_pfn())) {
1359+ __cpa_pfn_in_highmap(cpa->pfn)) {
13401360 unsigned long temp_cpa_vaddr = (cpa->pfn << PAGE_SHIFT) +
13411361 __START_KERNEL_map - phys_base;
13421362 alias_cpa = *cpa;
arch/x86/mm/pti.c+23−3
@@ -421,6 +421,16 @@ static inline bool pti_kernel_image_global_ok(void) · 420 unmodified lines
421421 if (boot_cpu_has(X86_FEATURE_K8))
422422 return false;
423423
424+ /*
425+ * RANDSTRUCT derives its hardening benefits from the
426+ * attacker's lack of knowledge about the layout of kernel
427+ * data structures. Keep the kernel image non-global in
428+ * cases where RANDSTRUCT is in use to help keep the layout a
429+ * secret.
430+ */
431+ if (IS_ENABLED(CONFIG_GCC_PLUGIN_RANDSTRUCT))
432+ return false;
433+
424434 return true;
425435 }
426436
@@ -430,12 +440,24 @@ static inline bool pti_kernel_image_global_ok(void) · 3 unmodified lines
430440 */
431441 void pti_clone_kernel_text(void)
432442 {
443+ /*
444+ * rodata is part of the kernel image and is normally
445+ * readable on the filesystem or on the web. But, do not
446+ * clone the areas past rodata, they might contain secrets.
447+ */
433448 unsigned long start = PFN_ALIGN(_text);
434− unsigned long end = ALIGN((unsigned long)_end, PMD_PAGE_SIZE);
449+ unsigned long end = (unsigned long)__end_rodata_hpage_align;
435450
436451 if (!pti_kernel_image_global_ok())
437452 return;
438453
454+ pr_debug("mapping partial kernel image into user address space\n");
455+
456+ /*
457+ * Note that this will undo _some_ of the work that
458+ * pti_set_kernel_image_nonglobal() did to clear the
459+ * global bit.
460+ */
439461 pti_clone_pmds(start, end, _PAGE_RW);
440462 }
441463
@@ -458,8 +480,6 @@ void pti_set_kernel_image_nonglobal(void) · 16 unmodified lines
458480 if (pti_kernel_image_global_ok())
459481 return;
460482
461− pr_debug("set kernel image non-global\n");
462−
463483 set_memory_nonglobal(start, (end - start) >> PAGE_SHIFT);
464484 }
465485
arch/x86/net/bpf_jit_comp.c+14−4
@@ -1027,7 +1027,17 @@ emit_cond_jmp: /* convert BPF opcode to x86 */ · 1026 unmodified lines
10271027 break;
10281028
10291029 case BPF_JMP | BPF_JA:
1030− jmp_offset = addrs[i + insn->off] - addrs[i];
1030+ if (insn->off == -1)
1031+ /* -1 jmp instructions will always jump
1032+ * backwards two bytes. Explicitly handling
1033+ * this case avoids wasting too many passes
1034+ * when there are long sequences of replaced
1035+ * dead code.
1036+ */
1037+ jmp_offset = -2;
1038+ else
1039+ jmp_offset = addrs[i + insn->off] - addrs[i];
1040+
10311041 if (!jmp_offset)
10321042 /* optimize out nop jumps */
10331043 break;
@@ -1226,6 +1236,7 @@ skip_init_addrs: · 192 unmodified lines
12261236 for (pass = 0; pass < 20 || image; pass++) {
12271237 proglen = do_jit(prog, addrs, image, oldproglen, &ctx);
12281238 if (proglen <= 0) {
1239+out_image:
12291240 image = NULL;
12301241 if (header)
12311242 bpf_jit_binary_free(header);
@@ -1236,8 +1247,7 @@ skip_init_addrs: · 4 unmodified lines
12361247 if (proglen != oldproglen) {
12371248 pr_err("bpf_jit: proglen=%d != oldproglen=%d\n",
12381249 proglen, oldproglen);
1239− prog = orig_prog;
1240− goto out_addrs;
1250+ goto out_image;
12411251 }
12421252 break;
12431253 }
@@ -1273,7 +1283,7 @@ skip_init_addrs: · 29 unmodified lines
12731283 prog = orig_prog;
12741284 }
12751285
1276− if (!prog->is_func || extra_pass) {
1286+ if (!image || !prog->is_func || extra_pass) {
12771287 out_addrs:
12781288 kfree(addrs);
12791289 kfree(jit_data);
arch/x86/power/hibernate_64.c+1−1
@@ -98,7 +98,7 @@ static int set_up_temporary_text_mapping(pgd_t *pgd) · 97 unmodified lines
9898 set_pgd(pgd + pgd_index(restore_jump_address), new_pgd);
9999 } else {
100100 /* No p4d for 4-level paging: point the pgd to the pud page table */
101− pgd_t new_pgd = __pgd(__pa(p4d) | pgprot_val(pgtable_prot));
101+ pgd_t new_pgd = __pgd(__pa(pud) | pgprot_val(pgtable_prot));
102102 set_pgd(pgd + pgd_index(restore_jump_address), new_pgd);
103103 }
104104
arch/x86/xen/enlighten_pv.c+31−55
@@ -421,45 +421,33 @@ static void xen_load_gdt(const struct desc_ptr *dtr) · 420 unmodified lines
421421 {
422422 unsigned long va = dtr->address;
423423 unsigned int size = dtr->size + 1;
424− unsigned pages = DIV_ROUND_UP(size, PAGE_SIZE);
425− unsigned long frames[pages];
426− int f;
427−
428− /*
429− * A GDT can be up to 64k in size, which corresponds to 8192
430− * 8-byte entries, or 16 4k pages..
431− */
424+ unsigned long pfn, mfn;
425+ int level;
426+ pte_t *ptep;
427+ void *virt;
432428
433− BUG_ON(size > 65536);
429+ /* @size should be at most GDT_SIZE which is smaller than PAGE_SIZE. */
430+ BUG_ON(size > PAGE_SIZE);
434431 BUG_ON(va & ~PAGE_MASK);
435432
436− for (f = 0; va < dtr->address + size; va += PAGE_SIZE, f++) {
437− int level;
438− pte_t *ptep;
439− unsigned long pfn, mfn;
440− void *virt;
441−
442− /*
443− * The GDT is per-cpu and is in the percpu data area.
444− * That can be virtually mapped, so we need to do a
445− * page-walk to get the underlying MFN for the
446− * hypercall. The page can also be in the kernel's
447− * linear range, so we need to RO that mapping too.
448− */
449− ptep = lookup_address(va, &level);
450− BUG_ON(ptep == NULL);
451−
452− pfn = pte_pfn(*ptep);
453− mfn = pfn_to_mfn(pfn);
454− virt = __va(PFN_PHYS(pfn));
433+ /*
434+ * The GDT is per-cpu and is in the percpu data area.
435+ * That can be virtually mapped, so we need to do a
436+ * page-walk to get the underlying MFN for the
437+ * hypercall. The page can also be in the kernel's
438+ * linear range, so we need to RO that mapping too.
439+ */
440+ ptep = lookup_address(va, &level);
441+ BUG_ON(ptep == NULL);
455442
456− frames[f] = mfn;
443+ pfn = pte_pfn(*ptep);
444+ mfn = pfn_to_mfn(pfn);
445+ virt = __va(PFN_PHYS(pfn));
457446
458− make_lowmem_page_readonly((void *)va);
459− make_lowmem_page_readonly(virt);
460− }
447+ make_lowmem_page_readonly((void *)va);
448+ make_lowmem_page_readonly(virt);
461449
462− if (HYPERVISOR_set_gdt(frames, size / sizeof(struct desc_struct)))
450+ if (HYPERVISOR_set_gdt(&mfn, size / sizeof(struct desc_struct)))
463451 BUG();
464452 }
465453
@@ -470,34 +458,22 @@ static void __init xen_load_gdt_boot(const struct desc_ptr *dtr) · 4 unmodified lines
470458 {
471459 unsigned long va = dtr->address;
472460 unsigned int size = dtr->size + 1;
473− unsigned pages = DIV_ROUND_UP(size, PAGE_SIZE);
474− unsigned long frames[pages];
475− int f;
476−
477− /*
478− * A GDT can be up to 64k in size, which corresponds to 8192
479− * 8-byte entries, or 16 4k pages..
480− */
461+ unsigned long pfn, mfn;
462+ pte_t pte;
481463
482− BUG_ON(size > 65536);
464+ /* @size should be at most GDT_SIZE which is smaller than PAGE_SIZE. */
465+ BUG_ON(size > PAGE_SIZE);
483466 BUG_ON(va & ~PAGE_MASK);
484467
485− for (f = 0; va < dtr->address + size; va += PAGE_SIZE, f++) {
486− pte_t pte;
487− unsigned long pfn, mfn;
468+ pfn = virt_to_pfn(va);
469+ mfn = pfn_to_mfn(pfn);
488470
489− pfn = virt_to_pfn(va);
490− mfn = pfn_to_mfn(pfn);
471+ pte = pfn_pte(pfn, PAGE_KERNEL_RO);
491472
492− pte = pfn_pte(pfn, PAGE_KERNEL_RO);
493−
494− if (HYPERVISOR_update_va_mapping((unsigned long)va, pte, 0))
495− BUG();
496−
497− frames[f] = mfn;
498− }
473+ if (HYPERVISOR_update_va_mapping((unsigned long)va, pte, 0))
474+ BUG();
499475
500− if (HYPERVISOR_set_gdt(frames, size / sizeof(struct desc_struct)))
476+ if (HYPERVISOR_set_gdt(&mfn, size / sizeof(struct desc_struct)))
501477 BUG();
502478 }
503479
block/bfq-iosched.c+9−1
@@ -4934,8 +4934,16 @@ static void bfq_prepare_request(struct request *rq, struct bio *bio) · 4933 unmodified lines
49344934 bool new_queue = false;
49354935 bool bfqq_already_existing = false, split = false;
49364936
4937− if (!rq->elv.icq)
4937+ /*
4938+ * Even if we don't have an icq attached, we should still clear
4939+ * the scheduler pointers, as they might point to previously
4940+ * allocated bic/bfqq structs.
4941+ */
4942+ if (!rq->elv.icq) {
4943+ rq->elv.priv[0] = rq->elv.priv[1] = NULL;
49384944 return;
4945+ }
4946+
49394947 bic = icq_to_bic(rq->elv.icq);
49404948
49414949 spin_lock_irq(&bfqd->lock);
block/blk-cgroup.c+12−16
@@ -1177,26 +1177,20 @@ int blkcg_init_queue(struct request_queue *q) · 1176 unmodified lines
11771177
11781178 preloaded = !radix_tree_preload(GFP_KERNEL);
11791179
1180− /*
1181− * Make sure the root blkg exists and count the existing blkgs. As
1182− * @q is bypassing at this point, blkg_lookup_create() can't be
1183− * used. Open code insertion.
1184− */
1180+ /* Make sure the root blkg exists. */
11851181 rcu_read_lock();
11861182 spin_lock_irq(q->queue_lock);
11871183 blkg = blkg_create(&blkcg_root, q, new_blkg);
1184+ if (IS_ERR(blkg))
1185+ goto err_unlock;
1186+ q->root_blkg = blkg;
1187+ q->root_rl.blkg = blkg;
11881188 spin_unlock_irq(q->queue_lock);
11891189 rcu_read_unlock();
11901190
11911191 if (preloaded)
11921192 radix_tree_preload_end();
11931193
1194− if (IS_ERR(blkg))
1195− return PTR_ERR(blkg);
1196−
1197− q->root_blkg = blkg;
1198− q->root_rl.blkg = blkg;
1199−
12001194 ret = blk_throtl_init(q);
12011195 if (ret) {
12021196 spin_lock_irq(q->queue_lock);
@@ -1204,6 +1198,13 @@ int blkcg_init_queue(struct request_queue *q) · 1 unmodified line
12041198 spin_unlock_irq(q->queue_lock);
12051199 }
12061200 return ret;
1201+
1202+err_unlock:
1203+ spin_unlock_irq(q->queue_lock);
1204+ rcu_read_unlock();
1205+ if (preloaded)
1206+ radix_tree_preload_end();
1207+ return PTR_ERR(blkg);
12071208 }
12081209
12091210 /**
@@ -1410,9 +1411,6 @@ void blkcg_deactivate_policy(struct request_queue *q, · 200 unmodified lines
14101411 __clear_bit(pol->plid, q->blkcg_pols);
14111412
14121413 list_for_each_entry(blkg, &q->blkg_list, q_node) {
1413− /* grab blkcg lock too while removing @pd from @blkg */
1414− spin_lock(&blkg->blkcg->lock);
1415−
14161414 if (blkg->pd[pol->plid]) {
14171415 if (!blkg->pd[pol->plid]->offline &&
14181416 pol->pd_offline_fn) {
@@ -1422,8 +1420,6 @@ void blkcg_deactivate_policy(struct request_queue *q, · 3 unmodified lines
14221420 pol->pd_free_fn(blkg->pd[pol->plid]);
14231421 blkg->pd[pol->plid] = NULL;
14241422 }
1425−
1426− spin_unlock(&blkg->blkcg->lock);
14271423 }
14281424
14291425 spin_unlock_irq(q->queue_lock);
block/blk-core.c+8−7
@@ -201,6 +201,10 @@ void blk_rq_init(struct request_queue *q, struct request *rq) · 200 unmodified lines
201201 rq->part = NULL;
202202 seqcount_init(&rq->gstate_seq);
203203 u64_stats_init(&rq->aborted_gstate_sync);
204+ /*
205+ * See comment of blk_mq_init_request
206+ */
207+ WRITE_ONCE(rq->gstate, MQ_RQ_GEN_INC);
204208 }
205209 EXPORT_SYMBOL(blk_rq_init);
206210
@@ -915,7 +919,6 @@ int blk_queue_enter(struct request_queue *q, blk_mq_req_flags_t flags) · 708 unmodified lines
915919
916920 while (true) {
917921 bool success = false;
918− int ret;
919922
920923 rcu_read_lock();
921924 if (percpu_ref_tryget_live(&q->q_usage_counter)) {
@@ -947,14 +950,12 @@ int blk_queue_enter(struct request_queue *q, blk_mq_req_flags_t flags) · 25 unmodified lines
947950 */
948951 smp_rmb();
949952
950− ret = wait_event_interruptible(q->mq_freeze_wq,
951− (atomic_read(&q->mq_freeze_depth) == 0 &&
952− (preempt || !blk_queue_preempt_only(q))) ||
953− blk_queue_dying(q));
953+ wait_event(q->mq_freeze_wq,
954+ (atomic_read(&q->mq_freeze_depth) == 0 &&
955+ (preempt || !blk_queue_preempt_only(q))) ||
956+ blk_queue_dying(q));
954957 if (blk_queue_dying(q))
955958 return -ENODEV;
956− if (ret)
957− return ret;
958959 }
959960 }
960961
block/blk-mq.c+66−15
@@ -95,18 +95,15 @@ static void blk_mq_check_inflight(struct blk_mq_hw_ctx *hctx, · 94 unmodified lines
9595 {
9696 struct mq_inflight *mi = priv;
9797
98− if (blk_mq_rq_state(rq) == MQ_RQ_IN_FLIGHT) {
99− /*
100− * index[0] counts the specific partition that was asked
101− * for. index[1] counts the ones that are active on the
102− * whole device, so increment that if mi->part is indeed
103− * a partition, and not a whole device.
104− */
105− if (rq->part == mi->part)
106− mi->inflight[0]++;
107− if (mi->part->partno)
108− mi->inflight[1]++;
109− }
98+ /*
99+ * index[0] counts the specific partition that was asked for. index[1]
100+ * counts the ones that are active on the whole device, so increment
101+ * that if mi->part is indeed a partition, and not a whole device.
102+ */
103+ if (rq->part == mi->part)
104+ mi->inflight[0]++;
105+ if (mi->part->partno)
106+ mi->inflight[1]++;
110107 }
111108
112109 void blk_mq_in_flight(struct request_queue *q, struct hd_struct *part,
@@ -118,6 +115,25 @@ void blk_mq_in_flight(struct request_queue *q, struct hd_struct *part, · 5 unmodified lines
118115 blk_mq_queue_tag_busy_iter(q, blk_mq_check_inflight, &mi);
119116 }
120117
118+static void blk_mq_check_inflight_rw(struct blk_mq_hw_ctx *hctx,
119+ struct request *rq, void *priv,
120+ bool reserved)
121+{
122+ struct mq_inflight *mi = priv;
123+
124+ if (rq->part == mi->part)
125+ mi->inflight[rq_data_dir(rq)]++;
126+}
127+
128+void blk_mq_in_flight_rw(struct request_queue *q, struct hd_struct *part,
129+ unsigned int inflight[2])
130+{
131+ struct mq_inflight mi = { .part = part, .inflight = inflight, };
132+
133+ inflight[0] = inflight[1] = 0;
134+ blk_mq_queue_tag_busy_iter(q, blk_mq_check_inflight_rw, &mi);
135+}
136+
121137 void blk_freeze_queue_start(struct request_queue *q)
122138 {
123139 int freeze_depth;
@@ -2042,6 +2058,13 @@ static int blk_mq_init_request(struct blk_mq_tag_set *set, struct request *rq, · 1918 unmodified lines
20422058
20432059 seqcount_init(&rq->gstate_seq);
20442060 u64_stats_init(&rq->aborted_gstate_sync);
2061+ /*
2062+ * start gstate with gen 1 instead of 0, otherwise it will be equal
2063+ * to aborted_gstate, and be identified timed out by
2064+ * blk_mq_terminate_expired.
2065+ */
2066+ WRITE_ONCE(rq->gstate, MQ_RQ_GEN_INC);
2067+
20452068 return 0;
20462069 }
20472070
@@ -2329,7 +2352,7 @@ static void blk_mq_free_map_and_requests(struct blk_mq_tag_set *set, · 281 unmodified lines
23292352
23302353 static void blk_mq_map_swqueue(struct request_queue *q)
23312354 {
2332− unsigned int i;
2355+ unsigned int i, hctx_idx;
23332356 struct blk_mq_hw_ctx *hctx;
23342357 struct blk_mq_ctx *ctx;
23352358 struct blk_mq_tag_set *set = q->tag_set;
@@ -2346,8 +2369,23 @@ static void blk_mq_map_swqueue(struct request_queue *q) · 10 unmodified lines
23462369
23472370 /*
23482371 * Map software to hardware queues.
2372+ *
2373+ * If the cpu isn't present, the cpu is mapped to first hctx.
23492374 */
23502375 for_each_possible_cpu(i) {
2376+ hctx_idx = q->mq_map[i];
2377+ /* unmapped hw queue can be remapped after CPU topo changed */
2378+ if (!set->tags[hctx_idx] &&
2379+ !__blk_mq_alloc_rq_map(set, hctx_idx)) {
2380+ /*
2381+ * If tags initialization fail for some hctx,
2382+ * that hctx won't be brought online. In this
2383+ * case, remap the current ctx to hctx[0] which
2384+ * is guaranteed to always have tags allocated
2385+ */
2386+ q->mq_map[i] = 0;
2387+ }
2388+
23512389 ctx = per_cpu_ptr(q->queue_ctx, i);
23522390 hctx = blk_mq_map_queue(q, i);
23532391
@@ -2359,8 +2397,21 @@ static void blk_mq_map_swqueue(struct request_queue *q) · 5 unmodified lines
23592397 mutex_unlock(&q->sysfs_lock);
23602398
23612399 queue_for_each_hw_ctx(q, hctx, i) {
2362− /* every hctx should get mapped by at least one CPU */
2363− WARN_ON(!hctx->nr_ctx);
2400+ /*
2401+ * If no software queues are mapped to this hardware queue,
2402+ * disable it and free the request entries.
2403+ */
2404+ if (!hctx->nr_ctx) {
2405+ /* Never unmap queue 0. We need it as a
2406+ * fallback in case of a new remap fails
2407+ * allocation
2408+ */
2409+ if (i && set->tags[i])
2410+ blk_mq_free_map_and_requests(set, i);
2411+
2412+ hctx->tags = NULL;
2413+ continue;
2414+ }
23642415
23652416 hctx->tags = set->tags[i];
23662417 WARN_ON(!hctx->tags);
block/blk-mq.h+6−1
@@ -7,6 +7,9 @@ · 6 unmodified lines
77
88 struct blk_mq_tag_set;
99
10+/**
11+ * struct blk_mq_ctx - State for a software queue facing the submitting CPUs
12+ */
1013 struct blk_mq_ctx {
1114 struct {
1215 spinlock_t lock;
@@ -185,7 +188,9 @@ static inline bool blk_mq_hw_queue_mapped(struct blk_mq_hw_ctx *hctx) · 172 unmodified lines
185188 }
186189
187190 void blk_mq_in_flight(struct request_queue *q, struct hd_struct *part,
188− unsigned int inflight[2]);
191+ unsigned int inflight[2]);
192+void blk_mq_in_flight_rw(struct request_queue *q, struct hd_struct *part,
193+ unsigned int inflight[2]);
189194
190195 static inline void blk_mq_put_dispatch_budget(struct blk_mq_hw_ctx *hctx)
191196 {
block/genhd.c+12−0
@@ -82,6 +82,18 @@ void part_in_flight(struct request_queue *q, struct hd_struct *part, · 81 unmodified lines
8282 }
8383 }
8484
85+void part_in_flight_rw(struct request_queue *q, struct hd_struct *part,
86+ unsigned int inflight[2])
87+{
88+ if (q->mq_ops) {
89+ blk_mq_in_flight_rw(q, part, inflight);
90+ return;
91+ }
92+
93+ inflight[0] = atomic_read(&part->in_flight[0]);
94+ inflight[1] = atomic_read(&part->in_flight[1]);
95+}
96+
8597 struct hd_struct *__disk_get_part(struct gendisk *disk, int partno)
8698 {
8799 struct disk_part_tbl *ptbl = rcu_dereference(disk->part_tbl);
block/partition-generic.c+6−4
@@ -145,13 +145,15 @@ ssize_t part_stat_show(struct device *dev, · 144 unmodified lines
145145 jiffies_to_msecs(part_stat_read(p, time_in_queue)));
146146 }
147147
148−ssize_t part_inflight_show(struct device *dev,
149− struct device_attribute *attr, char *buf)
148+ssize_t part_inflight_show(struct device *dev, struct device_attribute *attr,
149+ char *buf)
150150 {
151151 struct hd_struct *p = dev_to_part(dev);
152+ struct request_queue *q = part_to_disk(p)->queue;
153+ unsigned int inflight[2];
152154
153− return sprintf(buf, "%8u %8u\n", atomic_read(&p->in_flight[0]),
154− atomic_read(&p->in_flight[1]));
155+ part_in_flight_rw(q, p, inflight);
156+ return sprintf(buf, "%8u %8u\n", inflight[0], inflight[1]);
155157 }
156158
157159 #ifdef CONFIG_FAIL_MAKE_REQUEST
crypto/api.c+8−3
@@ -204,9 +204,14 @@ static struct crypto_alg *crypto_alg_lookup(const char *name, u32 type, · 203 unmodified lines
204204
205205 down_read(&crypto_alg_sem);
206206 alg = __crypto_alg_lookup(name, type | test, mask | test);
207− if (!alg && test)
208− alg = __crypto_alg_lookup(name, type, mask) ?
209− ERR_PTR(-ELIBBAD) : NULL;
207+ if (!alg && test) {
208+ alg = __crypto_alg_lookup(name, type, mask);
209+ if (alg && !crypto_is_larval(alg)) {
210+ /* Test failed */
211+ crypto_mod_put(alg);
212+ alg = ERR_PTR(-ELIBBAD);
213+ }
214+ }
210215 up_read(&crypto_alg_sem);
211216
212217 return alg;
crypto/drbg.c+2−0
@@ -1134,8 +1134,10 @@ static inline void drbg_dealloc_state(struct drbg_state *drbg) · 1133 unmodified lines
11341134 if (!drbg)
11351135 return;
11361136 kzfree(drbg->Vbuf);
1137+ drbg->Vbuf = NULL;
11371138 drbg->V = NULL;
11381139 kzfree(drbg->Cbuf);
1140+ drbg->Cbuf = NULL;
11391141 drbg->C = NULL;
11401142 kzfree(drbg->scratchpadbuf);
11411143 drbg->scratchpadbuf = NULL;
drivers/acpi/acpi_video.c+25−2
@@ -2123,6 +2123,25 @@ static int __init intel_opregion_present(void) · 2122 unmodified lines
21232123 return opregion;
21242124 }
21252125
2126+static bool dmi_is_desktop(void)
2127+{
2128+ const char *chassis_type;
2129+
2130+ chassis_type = dmi_get_system_info(DMI_CHASSIS_TYPE);
2131+ if (!chassis_type)
2132+ return false;
2133+
2134+ if (!strcmp(chassis_type, "3") || /* 3: Desktop */
2135+ !strcmp(chassis_type, "4") || /* 4: Low Profile Desktop */
2136+ !strcmp(chassis_type, "5") || /* 5: Pizza Box */
2137+ !strcmp(chassis_type, "6") || /* 6: Mini Tower */
2138+ !strcmp(chassis_type, "7") || /* 7: Tower */
2139+ !strcmp(chassis_type, "11")) /* 11: Main Server Chassis */
2140+ return true;
2141+
2142+ return false;
2143+}
2144+
21262145 int acpi_video_register(void)
21272146 {
21282147 int ret = 0;
@@ -2143,8 +2162,12 @@ int acpi_video_register(void) · 14 unmodified lines
21432162 * win8 ready (where we also prefer the native backlight driver, so
21442163 * normally the acpi_video code should not register there anyways).
21452164 */
2146− if (only_lcd == -1)
2147− only_lcd = acpi_osi_is_win8();
2165+ if (only_lcd == -1) {
2166+ if (dmi_is_desktop() && acpi_osi_is_win8())
2167+ only_lcd = true;
2168+ else
2169+ only_lcd = false;
2170+ }
21482171
21492172 dmi_check_system(video_dmi_table);
21502173
drivers/acpi/acpi_watchdog.c+49−10
@@ -12,23 +12,64 @@ · 11 unmodified lines
1212 #define pr_fmt(fmt) "ACPI: watchdog: " fmt
1313
1414 #include <linux/acpi.h>
15+#include <linux/dmi.h>
1516 #include <linux/ioport.h>
1617 #include <linux/platform_device.h>
1718
1819 #include "internal.h"
1920
21+static const struct dmi_system_id acpi_watchdog_skip[] = {
22+ {
23+ /*
24+ * On Lenovo Z50-70 there are two issues with the WDAT
25+ * table. First some of the instructions use RTC SRAM
26+ * to store persistent information. This does not work well
27+ * with Linux RTC driver. Second, more important thing is
28+ * that the instructions do not actually reset the system.
29+ *
30+ * On this particular system iTCO_wdt seems to work just
31+ * fine so we prefer that over WDAT for now.
32+ *
33+ * See also https://bugzilla.kernel.org/show_bug.cgi?id=199033.
34+ */
35+ .ident = "Lenovo Z50-70",
36+ .matches = {
37+ DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
38+ DMI_MATCH(DMI_PRODUCT_NAME, "20354"),
39+ DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo Z50-70"),
40+ },
41+ },
42+ {}
43+};
44+
45+static const struct acpi_table_wdat *acpi_watchdog_get_wdat(void)
46+{
47+ const struct acpi_table_wdat *wdat = NULL;
48+ acpi_status status;
49+
50+ if (acpi_disabled)
51+ return NULL;
52+
53+ if (dmi_check_system(acpi_watchdog_skip))
54+ return NULL;
55+
56+ status = acpi_get_table(ACPI_SIG_WDAT, 0,
57+ (struct acpi_table_header **)&wdat);
58+ if (ACPI_FAILURE(status)) {
59+ /* It is fine if there is no WDAT */
60+ return NULL;
61+ }
62+
63+ return wdat;
64+}
65+
2066 /**
2167 * Returns true if this system should prefer ACPI based watchdog instead of
2268 * the native one (which are typically the same hardware).
2369 */
2470 bool acpi_has_watchdog(void)
2571 {
26− struct acpi_table_header hdr;
27−
28− if (acpi_disabled)
29− return false;
30−
31− return ACPI_SUCCESS(acpi_get_table_header(ACPI_SIG_WDAT, 0, &hdr));
72+ return !!acpi_watchdog_get_wdat();
3273 }
3374 EXPORT_SYMBOL_GPL(acpi_has_watchdog);
3475
@@ -41,12 +82,10 @@ void __init acpi_watchdog_init(void) · 6 unmodified lines
4182 struct platform_device *pdev;
4283 struct resource *resources;
4384 size_t nresources = 0;
44− acpi_status status;
4585 int i;
4686
47− status = acpi_get_table(ACPI_SIG_WDAT, 0,
48− (struct acpi_table_header **)&wdat);
49− if (ACPI_FAILURE(status)) {
87+ wdat = acpi_watchdog_get_wdat();
88+ if (!wdat) {
5089 /* It is fine if there is no WDAT */
5190 return;
5291 }
drivers/acpi/button.c+23−1
@@ -635,4 +635,26 @@ module_param_call(lid_init_state, · 634 unmodified lines
635635 NULL, 0644);
636636 MODULE_PARM_DESC(lid_init_state, "Behavior for reporting LID initial state");
637637
638−module_acpi_driver(acpi_button_driver);
638+static int acpi_button_register_driver(struct acpi_driver *driver)
639+{
640+ /*
641+ * Modules such as nouveau.ko and i915.ko have a link time dependency
642+ * on acpi_lid_open(), and would therefore not be loadable on ACPI
643+ * capable kernels booted in non-ACPI mode if the return value of
644+ * acpi_bus_register_driver() is returned from here with ACPI disabled
645+ * when this driver is built as a module.
646+ */
647+ if (acpi_disabled)
648+ return 0;
649+
650+ return acpi_bus_register_driver(driver);
651+}
652+
653+static void acpi_button_unregister_driver(struct acpi_driver *driver)
654+{
655+ if (!acpi_disabled)
656+ acpi_bus_unregister_driver(driver);
657+}
658+
659+module_driver(acpi_button_driver, acpi_button_register_driver,
660+ acpi_button_unregister_driver);
drivers/acpi/scan.c+1−1
@@ -2166,10 +2166,10 @@ int __init acpi_scan_init(void) · 2165 unmodified lines
21662166 acpi_cmos_rtc_init();
21672167 acpi_container_init();
21682168 acpi_memory_hotplug_init();
2169+ acpi_watchdog_init();
21692170 acpi_pnp_init();
21702171 acpi_int340x_thermal_init();
21712172 acpi_amba_init();
2172− acpi_watchdog_init();
21732173 acpi_init_lpit();
21742174
21752175 acpi_scan_add_handler(&generic_device_handler);
drivers/acpi/sleep.c+13−0
@@ -364,6 +364,19 @@ static const struct dmi_system_id acpisleep_dmi_table[] __initconst = { · 363 unmodified lines
364364 DMI_MATCH(DMI_PRODUCT_NAME, "XPS 13 9360"),
365365 },
366366 },
367+ /*
368+ * ThinkPad X1 Tablet(2016) cannot do suspend-to-idle using
369+ * the Low Power S0 Idle firmware interface (see
370+ * https://bugzilla.kernel.org/show_bug.cgi?id=199057).
371+ */
372+ {
373+ .callback = init_no_lps0,
374+ .ident = "ThinkPad X1 Tablet(2016)",
375+ .matches = {
376+ DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
377+ DMI_MATCH(DMI_PRODUCT_NAME, "20GGA00L00"),
378+ },
379+ },
367380 {},
368381 };
369382
drivers/amba/bus.c+11−6
@@ -69,11 +69,12 @@ static ssize_t driver_override_show(struct device *_dev, · 68 unmodified lines
6969 struct device_attribute *attr, char *buf)
7070 {
7171 struct amba_device *dev = to_amba_device(_dev);
72+ ssize_t len;
7273
73− if (!dev->driver_override)
74− return 0;
75−
76− return sprintf(buf, "%s\n", dev->driver_override);
74+ device_lock(_dev);
75+ len = sprintf(buf, "%s\n", dev->driver_override);
76+ device_unlock(_dev);
77+ return len;
7778 }
7879
7980 static ssize_t driver_override_store(struct device *_dev,
@@ -81,9 +82,10 @@ static ssize_t driver_override_store(struct device *_dev, · 1 unmodified line
8182 const char *buf, size_t count)
8283 {
8384 struct amba_device *dev = to_amba_device(_dev);
84− char *driver_override, *old = dev->driver_override, *cp;
85+ char *driver_override, *old, *cp;
8586
86− if (count > PATH_MAX)
87+ /* We need to keep extra room for a newline */
88+ if (count >= (PAGE_SIZE - 1))
8789 return -EINVAL;
8890
8991 driver_override = kstrndup(buf, count, GFP_KERNEL);
@@ -94,12 +96,15 @@ static ssize_t driver_override_store(struct device *_dev, · 4 unmodified lines
9496 if (cp)
9597 *cp = '\0';
9698
99+ device_lock(_dev);
100+ old = dev->driver_override;
97101 if (strlen(driver_override)) {
98102 dev->driver_override = driver_override;
99103 } else {
100104 kfree(driver_override);
101105 dev->driver_override = NULL;
102106 }
107+ device_unlock(_dev);
103108
104109 kfree(old);
105110
drivers/android/binder.c+8−0
@@ -2839,6 +2839,14 @@ static void binder_transaction(struct binder_proc *proc, · 2838 unmodified lines
28392839 else
28402840 return_error = BR_DEAD_REPLY;
28412841 mutex_unlock(&context->context_mgr_node_lock);
2842+ if (target_node && target_proc == proc) {
2843+ binder_user_error("%d:%d got transaction to context manager from process owning it\n",
2844+ proc->pid, thread->pid);
2845+ return_error = BR_FAILED_REPLY;
2846+ return_error_param = -EINVAL;
2847+ return_error_line = __LINE__;
2848+ goto err_invalid_target_handle;
2849+ }
28422850 }
28432851 if (!target_node) {
28442852 /*
drivers/atm/iphase.c+2−2
@@ -671,7 +671,7 @@ static void ia_tx_poll (IADEV *iadev) { · 670 unmodified lines
671671 if ((vcc->pop) && (skb1->len != 0))
672672 {
673673 vcc->pop(vcc, skb1);
674− IF_EVENT(printk("Tansmit Done - skb 0x%lx return\n",
674+ IF_EVENT(printk("Transmit Done - skb 0x%lx return\n",
675675 (long)skb1);)
676676 }
677677 else
@@ -1665,7 +1665,7 @@ static void tx_intr(struct atm_dev *dev) · 987 unmodified lines
16651665 status = readl(iadev->seg_reg+SEG_INTR_STATUS_REG);
16661666 if (status & TRANSMIT_DONE){
16671667
1668− IF_EVENT(printk("Tansmit Done Intr logic run\n");)
1668+ IF_EVENT(printk("Transmit Done Intr logic run\n");)
16691669 spin_lock_irqsave(&iadev->tx_lock, flags);
16701670 ia_tx_poll(iadev);
16711671 spin_unlock_irqrestore(&iadev->tx_lock, flags);
drivers/base/dma-coherent.c+3−2
@@ -312,8 +312,9 @@ static int __dma_mmap_from_coherent(struct dma_coherent_mem *mem, · 311 unmodified lines
312312 * This checks whether the memory was allocated from the per-device
313313 * coherent memory pool and if so, maps that memory to the provided vma.
314314 *
315− * Returns 1 if we correctly mapped the memory, or 0 if the caller should
316− * proceed with mapping memory from generic pools.
315+ * Returns 1 if @vaddr belongs to the device coherent pool and the caller
316+ * should return @ret, or 0 if they should proceed with mapping memory from
317+ * generic areas.
317318 */
318319 int dma_mmap_from_dev_coherent(struct device *dev, struct vm_area_struct *vma,
319320 void *vaddr, size_t size, int *ret)
drivers/base/dma-mapping.c+2−4
@@ -226,7 +226,6 @@ int dma_common_mmap(struct device *dev, struct vm_area_struct *vma, · 225 unmodified lines
226226 #ifndef CONFIG_ARCH_NO_COHERENT_DMA_MMAP
227227 unsigned long user_count = vma_pages(vma);
228228 unsigned long count = PAGE_ALIGN(size) >> PAGE_SHIFT;
229− unsigned long pfn = page_to_pfn(virt_to_page(cpu_addr));
230229 unsigned long off = vma->vm_pgoff;
231230
232231 vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
@@ -234,12 +233,11 @@ int dma_common_mmap(struct device *dev, struct vm_area_struct *vma, · 1 unmodified line
234233 if (dma_mmap_from_dev_coherent(dev, vma, cpu_addr, size, &ret))
235234 return ret;
236235
237− if (off < count && user_count <= (count - off)) {
236+ if (off < count && user_count <= (count - off))
238237 ret = remap_pfn_range(vma, vma->vm_start,
239− pfn + off,
238+ page_to_pfn(virt_to_page(cpu_addr)) + off,
240239 user_count << PAGE_SHIFT,
241240 vma->vm_page_prot);
242− }
243241 #endif /* !CONFIG_ARCH_NO_COHERENT_DMA_MMAP */
244242
245243 return ret;
drivers/base/firmware_loader/fallback.c+2−2
@@ -537,8 +537,8 @@ exit: · 536 unmodified lines
537537 }
538538
539539 /**
540− * fw_load_sysfs_fallback - load a firmware via the syfs fallback mechanism
541− * @fw_sysfs: firmware syfs information for the firmware to load
540+ * fw_load_sysfs_fallback - load a firmware via the sysfs fallback mechanism
541+ * @fw_sysfs: firmware sysfs information for the firmware to load
542542 * @opt_flags: flags of options, FW_OPT_*
543543 * @timeout: timeout to wait for the load
544544 *
drivers/base/firmware_loader/fallback.h+1−1
@@ -6,7 +6,7 @@ · 5 unmodified lines
66 #include <linux/device.h>
77
88 /**
9− * struct firmware_fallback_config - firmware fallback configuratioon settings
9+ * struct firmware_fallback_config - firmware fallback configuration settings
1010 *
1111 * Helps describe and fine tune the fallback mechanism.
1212 *
drivers/block/loop.c+43−21
@@ -451,25 +451,47 @@ static int lo_req_flush(struct loop_device *lo, struct request *rq) · 450 unmodified lines
451451 static void lo_complete_rq(struct request *rq)
452452 {
453453 struct loop_cmd *cmd = blk_mq_rq_to_pdu(rq);
454+ blk_status_t ret = BLK_STS_OK;
454455
455− if (unlikely(req_op(cmd->rq) == REQ_OP_READ && cmd->use_aio &&
456− cmd->ret >= 0 && cmd->ret < blk_rq_bytes(cmd->rq))) {
457− struct bio *bio = cmd->rq->bio;
458−
459− bio_advance(bio, cmd->ret);
460− zero_fill_bio(bio);
456+ if (!cmd->use_aio || cmd->ret < 0 || cmd->ret == blk_rq_bytes(rq) ||
457+ req_op(rq) != REQ_OP_READ) {
458+ if (cmd->ret < 0)
459+ ret = BLK_STS_IOERR;
460+ goto end_io;
461461 }
462462
463− blk_mq_end_request(rq, cmd->ret < 0 ? BLK_STS_IOERR : BLK_STS_OK);
463+ /*
464+ * Short READ - if we got some data, advance our request and
465+ * retry it. If we got no data, end the rest with EIO.
466+ */
467+ if (cmd->ret) {
468+ blk_update_request(rq, BLK_STS_OK, cmd->ret);
469+ cmd->ret = 0;
470+ blk_mq_requeue_request(rq, true);
471+ } else {
472+ if (cmd->use_aio) {
473+ struct bio *bio = rq->bio;
474+
475+ while (bio) {
476+ zero_fill_bio(bio);
477+ bio = bio->bi_next;
478+ }
479+ }
480+ ret = BLK_STS_IOERR;
481+end_io:
482+ blk_mq_end_request(rq, ret);
483+ }
464484 }
465485
466486 static void lo_rw_aio_do_completion(struct loop_cmd *cmd)
467487 {
488+ struct request *rq = blk_mq_rq_from_pdu(cmd);
489+
468490 if (!atomic_dec_and_test(&cmd->ref))
469491 return;
470492 kfree(cmd->bvec);
471493 cmd->bvec = NULL;
472− blk_mq_complete_request(cmd->rq);
494+ blk_mq_complete_request(rq);
473495 }
474496
475497 static void lo_rw_aio_complete(struct kiocb *iocb, long ret, long ret2)
@@ -487,7 +509,7 @@ static int lo_rw_aio(struct loop_device *lo, struct loop_cmd *cmd, · 11 unmodified lines
487509 {
488510 struct iov_iter iter;
489511 struct bio_vec *bvec;
490− struct request *rq = cmd->rq;
512+ struct request *rq = blk_mq_rq_from_pdu(cmd);
491513 struct bio *bio = rq->bio;
492514 struct file *file = lo->lo_backing_file;
493515 unsigned int offset;
@@ -1702,15 +1724,16 @@ EXPORT_SYMBOL(loop_unregister_transfer); · 1208 unmodified lines
17021724 static blk_status_t loop_queue_rq(struct blk_mq_hw_ctx *hctx,
17031725 const struct blk_mq_queue_data *bd)
17041726 {
1705− struct loop_cmd *cmd = blk_mq_rq_to_pdu(bd->rq);
1706− struct loop_device *lo = cmd->rq->q->queuedata;
1727+ struct request *rq = bd->rq;
1728+ struct loop_cmd *cmd = blk_mq_rq_to_pdu(rq);
1729+ struct loop_device *lo = rq->q->queuedata;
17071730
1708− blk_mq_start_request(bd->rq);
1731+ blk_mq_start_request(rq);
17091732
17101733 if (lo->lo_state != Lo_bound)
17111734 return BLK_STS_IOERR;
17121735
1713− switch (req_op(cmd->rq)) {
1736+ switch (req_op(rq)) {
17141737 case REQ_OP_FLUSH:
17151738 case REQ_OP_DISCARD:
17161739 case REQ_OP_WRITE_ZEROES:
@@ -1723,8 +1746,8 @@ static blk_status_t loop_queue_rq(struct blk_mq_hw_ctx *hctx, · 6 unmodified lines
17231746
17241747 /* always use the first bio's css */
17251748 #ifdef CONFIG_BLK_CGROUP
1726− if (cmd->use_aio && cmd->rq->bio && cmd->rq->bio->bi_css) {
1727− cmd->css = cmd->rq->bio->bi_css;
1749+ if (cmd->use_aio && rq->bio && rq->bio->bi_css) {
1750+ cmd->css = rq->bio->bi_css;
17281751 css_get(cmd->css);
17291752 } else
17301753 #endif
@@ -1736,8 +1759,9 @@ static blk_status_t loop_queue_rq(struct blk_mq_hw_ctx *hctx, · 5 unmodified lines
17361759
17371760 static void loop_handle_cmd(struct loop_cmd *cmd)
17381761 {
1739− const bool write = op_is_write(req_op(cmd->rq));
1740− struct loop_device *lo = cmd->rq->q->queuedata;
1762+ struct request *rq = blk_mq_rq_from_pdu(cmd);
1763+ const bool write = op_is_write(req_op(rq));
1764+ struct loop_device *lo = rq->q->queuedata;
17411765 int ret = 0;
17421766
17431767 if (write && (lo->lo_flags & LO_FLAGS_READ_ONLY)) {
@@ -1745,12 +1769,12 @@ static void loop_handle_cmd(struct loop_cmd *cmd) · 1 unmodified line
17451769 goto failed;
17461770 }
17471771
1748− ret = do_req_filebacked(lo, cmd->rq);
1772+ ret = do_req_filebacked(lo, rq);
17491773 failed:
17501774 /* complete non-aio request */
17511775 if (!cmd->use_aio || ret) {
17521776 cmd->ret = ret ? -EIO : 0;
1753− blk_mq_complete_request(cmd->rq);
1777+ blk_mq_complete_request(rq);
17541778 }
17551779 }
17561780
@@ -1767,9 +1791,7 @@ static int loop_init_request(struct blk_mq_tag_set *set, struct request *rq, · 10 unmodified lines
17671791 {
17681792 struct loop_cmd *cmd = blk_mq_rq_to_pdu(rq);
17691793
1770− cmd->rq = rq;
17711794 kthread_init_work(&cmd->work, loop_queue_work);
1772−
17731795 return 0;
17741796 }
17751797
drivers/block/loop.h+0−1
@@ -66,7 +66,6 @@ struct loop_device { · 65 unmodified lines
6666
6767 struct loop_cmd {
6868 struct kthread_work work;
69− struct request *rq;
7069 bool use_aio; /* use AIO interface to handle I/O */
7170 atomic_t ref; /* only for aio */
7271 long ret;
drivers/block/rbd.c+69−32
@@ -732,6 +732,7 @@ static struct rbd_client *rbd_client_find(struct ceph_options *ceph_opts) · 731 unmodified lines
732732 */
733733 enum {
734734 Opt_queue_depth,
735+ Opt_lock_timeout,
735736 Opt_last_int,
736737 /* int args above */
737738 Opt_last_string,
@@ -740,11 +741,13 @@ enum { · 2 unmodified lines
740741 Opt_read_write,
741742 Opt_lock_on_read,
742743 Opt_exclusive,
744+ Opt_notrim,
743745 Opt_err
744746 };
745747
746748 static match_table_t rbd_opts_tokens = {
747749 {Opt_queue_depth, "queue_depth=%d"},
750+ {Opt_lock_timeout, "lock_timeout=%d"},
748751 /* int args above */
749752 /* string args above */
750753 {Opt_read_only, "read_only"},
@@ -753,20 +756,25 @@ static match_table_t rbd_opts_tokens = { · 2 unmodified lines
753756 {Opt_read_write, "rw"}, /* Alternate spelling */
754757 {Opt_lock_on_read, "lock_on_read"},
755758 {Opt_exclusive, "exclusive"},
759+ {Opt_notrim, "notrim"},
756760 {Opt_err, NULL}
757761 };
758762
759763 struct rbd_options {
760764 int queue_depth;
765+ unsigned long lock_timeout;
761766 bool read_only;
762767 bool lock_on_read;
763768 bool exclusive;
769+ bool trim;
764770 };
765771
766772 #define RBD_QUEUE_DEPTH_DEFAULT BLKDEV_MAX_RQ
773+#define RBD_LOCK_TIMEOUT_DEFAULT 0 /* no timeout */
767774 #define RBD_READ_ONLY_DEFAULT false
768775 #define RBD_LOCK_ON_READ_DEFAULT false
769776 #define RBD_EXCLUSIVE_DEFAULT false
777+#define RBD_TRIM_DEFAULT true
770778
771779 static int parse_rbd_opts_token(char *c, void *private)
772780 {
@@ -796,6 +804,14 @@ static int parse_rbd_opts_token(char *c, void *private) · 23 unmodified lines
796804 }
797805 rbd_opts->queue_depth = intval;
798806 break;
807+ case Opt_lock_timeout:
808+ /* 0 is "wait forever" (i.e. infinite timeout) */
809+ if (intval < 0 || intval > INT_MAX / 1000) {
810+ pr_err("lock_timeout out of range\n");
811+ return -EINVAL;
812+ }
813+ rbd_opts->lock_timeout = msecs_to_jiffies(intval * 1000);
814+ break;
799815 case Opt_read_only:
800816 rbd_opts->read_only = true;
801817 break;
@@ -808,6 +824,9 @@ static int parse_rbd_opts_token(char *c, void *private) · 6 unmodified lines
808824 case Opt_exclusive:
809825 rbd_opts->exclusive = true;
810826 break;
827+ case Opt_notrim:
828+ rbd_opts->trim = false;
829+ break;
811830 default:
812831 /* libceph prints "bad option" msg */
813832 return -EINVAL;
@@ -1392,7 +1411,7 @@ static bool rbd_img_is_write(struct rbd_img_request *img_req) · 578 unmodified lines
13921411 case OBJ_OP_DISCARD:
13931412 return true;
13941413 default:
1395− rbd_assert(0);
1414+ BUG();
13961415 }
13971416 }
13981417
@@ -2466,7 +2485,7 @@ again: · 1067 unmodified lines
24662485 }
24672486 return false;
24682487 default:
2469− rbd_assert(0);
2488+ BUG();
24702489 }
24712490 }
24722491
@@ -2494,7 +2513,7 @@ static bool __rbd_obj_handle_request(struct rbd_obj_request *obj_req) · 21 unmodified lines
24942513 }
24952514 return false;
24962515 default:
2497− rbd_assert(0);
2516+ BUG();
24982517 }
24992518 }
25002519
@@ -3533,9 +3552,22 @@ static int rbd_obj_method_sync(struct rbd_device *rbd_dev, · 1032 unmodified lines
35333552 /*
35343553 * lock_rwsem must be held for read
35353554 */
3536−static void rbd_wait_state_locked(struct rbd_device *rbd_dev)
3555+static int rbd_wait_state_locked(struct rbd_device *rbd_dev, bool may_acquire)
35373556 {
35383557 DEFINE_WAIT(wait);
3558+ unsigned long timeout;
3559+ int ret = 0;
3560+
3561+ if (test_bit(RBD_DEV_FLAG_BLACKLISTED, &rbd_dev->flags))
3562+ return -EBLACKLISTED;
3563+
3564+ if (rbd_dev->lock_state == RBD_LOCK_STATE_LOCKED)
3565+ return 0;
3566+
3567+ if (!may_acquire) {
3568+ rbd_warn(rbd_dev, "exclusive lock required");
3569+ return -EROFS;
3570+ }
35393571
35403572 do {
35413573 /*
@@ -3547,12 +3579,22 @@ static void rbd_wait_state_locked(struct rbd_device *rbd_dev) · 5 unmodified lines
35473579 prepare_to_wait_exclusive(&rbd_dev->lock_waitq, &wait,
35483580 TASK_UNINTERRUPTIBLE);
35493581 up_read(&rbd_dev->lock_rwsem);
3550− schedule();
3582+ timeout = schedule_timeout(ceph_timeout_jiffies(
3583+ rbd_dev->opts->lock_timeout));
35513584 down_read(&rbd_dev->lock_rwsem);
3552− } while (rbd_dev->lock_state != RBD_LOCK_STATE_LOCKED &&
3553− !test_bit(RBD_DEV_FLAG_BLACKLISTED, &rbd_dev->flags));
3585+ if (test_bit(RBD_DEV_FLAG_BLACKLISTED, &rbd_dev->flags)) {
3586+ ret = -EBLACKLISTED;
3587+ break;
3588+ }
3589+ if (!timeout) {
3590+ rbd_warn(rbd_dev, "timed out waiting for lock");
3591+ ret = -ETIMEDOUT;
3592+ break;
3593+ }
3594+ } while (rbd_dev->lock_state != RBD_LOCK_STATE_LOCKED);
35543595
35553596 finish_wait(&rbd_dev->lock_waitq, &wait);
3597+ return ret;
35563598 }
35573599
35583600 static void rbd_queue_workfn(struct work_struct *work)
@@ -3638,19 +3680,10 @@ static void rbd_queue_workfn(struct work_struct *work) · 79 unmodified lines
36383680 (op_type != OBJ_OP_READ || rbd_dev->opts->lock_on_read);
36393681 if (must_be_locked) {
36403682 down_read(&rbd_dev->lock_rwsem);
3641− if (rbd_dev->lock_state != RBD_LOCK_STATE_LOCKED &&
3642− !test_bit(RBD_DEV_FLAG_BLACKLISTED, &rbd_dev->flags)) {
3643− if (rbd_dev->opts->exclusive) {
3644− rbd_warn(rbd_dev, "exclusive lock required");
3645− result = -EROFS;
3646− goto err_unlock;
3647− }
3648− rbd_wait_state_locked(rbd_dev);
3649− }
3650− if (test_bit(RBD_DEV_FLAG_BLACKLISTED, &rbd_dev->flags)) {
3651− result = -EBLACKLISTED;
3683+ result = rbd_wait_state_locked(rbd_dev,
3684+ !rbd_dev->opts->exclusive);
3685+ if (result)
36523686 goto err_unlock;
3653− }
36543687 }
36553688
36563689 img_request = rbd_img_request_create(rbd_dev, op_type, snapc);
@@ -3902,7 +3935,8 @@ static int rbd_init_disk(struct rbd_device *rbd_dev) · 245 unmodified lines
39023935 {
39033936 struct gendisk *disk;
39043937 struct request_queue *q;
3905− u64 segment_size;
3938+ unsigned int objset_bytes =
3939+ rbd_dev->layout.object_size * rbd_dev->layout.stripe_count;
39063940 int err;
39073941
39083942 /* create gendisk info */
@@ -3942,20 +3976,19 @@ static int rbd_init_disk(struct rbd_device *rbd_dev) · 33 unmodified lines
39423976 blk_queue_flag_set(QUEUE_FLAG_NONROT, q);
39433977 /* QUEUE_FLAG_ADD_RANDOM is off by default for blk-mq */
39443978
3945− /* set io sizes to object size */
3946− segment_size = rbd_obj_bytes(&rbd_dev->header);
3947− blk_queue_max_hw_sectors(q, segment_size / SECTOR_SIZE);
3979+ blk_queue_max_hw_sectors(q, objset_bytes >> SECTOR_SHIFT);
39483980 q->limits.max_sectors = queue_max_hw_sectors(q);
39493981 blk_queue_max_segments(q, USHRT_MAX);
39503982 blk_queue_max_segment_size(q, UINT_MAX);
3951− blk_queue_io_min(q, segment_size);
3952− blk_queue_io_opt(q, segment_size);
3983+ blk_queue_io_min(q, objset_bytes);
3984+ blk_queue_io_opt(q, objset_bytes);
39533985
3954− /* enable the discard support */
3955− blk_queue_flag_set(QUEUE_FLAG_DISCARD, q);
3956− q->limits.discard_granularity = segment_size;
3957− blk_queue_max_discard_sectors(q, segment_size / SECTOR_SIZE);
3958− blk_queue_max_write_zeroes_sectors(q, segment_size / SECTOR_SIZE);
3986+ if (rbd_dev->opts->trim) {
3987+ blk_queue_flag_set(QUEUE_FLAG_DISCARD, q);
3988+ q->limits.discard_granularity = objset_bytes;
3989+ blk_queue_max_discard_sectors(q, objset_bytes >> SECTOR_SHIFT);
3990+ blk_queue_max_write_zeroes_sectors(q, objset_bytes >> SECTOR_SHIFT);
3991+ }
39593992
39603993 if (!ceph_test_opt(rbd_dev->rbd_client->client, NOCRC))
39613994 q->backing_dev_info->capabilities |= BDI_CAP_STABLE_WRITES;
@@ -5179,8 +5212,10 @@ static int rbd_add_parse_args(const char *buf, · 1217 unmodified lines
51795212
51805213 rbd_opts->read_only = RBD_READ_ONLY_DEFAULT;
51815214 rbd_opts->queue_depth = RBD_QUEUE_DEPTH_DEFAULT;
5215+ rbd_opts->lock_timeout = RBD_LOCK_TIMEOUT_DEFAULT;
51825216 rbd_opts->lock_on_read = RBD_LOCK_ON_READ_DEFAULT;
51835217 rbd_opts->exclusive = RBD_EXCLUSIVE_DEFAULT;
5218+ rbd_opts->trim = RBD_TRIM_DEFAULT;
51845219
51855220 copts = ceph_parse_options(options, mon_addrs,
51865221 mon_addrs + mon_addrs_size - 1,
@@ -5216,6 +5251,8 @@ static void rbd_dev_image_unlock(struct rbd_device *rbd_dev) · 29 unmodified lines
52165251
52175252 static int rbd_add_acquire_lock(struct rbd_device *rbd_dev)
52185253 {
5254+ int ret;
5255+
52195256 if (!(rbd_dev->header.features & RBD_FEATURE_EXCLUSIVE_LOCK)) {
52205257 rbd_warn(rbd_dev, "exclusive-lock feature is not enabled");
52215258 return -EINVAL;
@@ -5223,9 +5260,9 @@ static int rbd_add_acquire_lock(struct rbd_device *rbd_dev) · 1 unmodified line
52235260
52245261 /* FIXME: "rbd map --exclusive" should be in interruptible */
52255262 down_read(&rbd_dev->lock_rwsem);
5226− rbd_wait_state_locked(rbd_dev);
5263+ ret = rbd_wait_state_locked(rbd_dev, true);
52275264 up_read(&rbd_dev->lock_rwsem);
5228− if (test_bit(RBD_DEV_FLAG_BLACKLISTED, &rbd_dev->flags)) {
5265+ if (ret) {
52295266 rbd_warn(rbd_dev, "failed to acquire exclusive lock");
52305267 return -EROFS;
52315268 }
drivers/block/swim.c+22−27
@@ -110,7 +110,7 @@ struct iwm { · 109 unmodified lines
110110 /* Select values for swim_select and swim_readbit */
111111
112112 #define READ_DATA_0 0x074
113−#define TWOMEG_DRIVE 0x075
113+#define ONEMEG_DRIVE 0x075
114114 #define SINGLE_SIDED 0x076
115115 #define DRIVE_PRESENT 0x077
116116 #define DISK_IN 0x170
@@ -118,9 +118,9 @@ struct iwm { · 1 unmodified line
118118 #define TRACK_ZERO 0x172
119119 #define TACHO 0x173
120120 #define READ_DATA_1 0x174
121−#define MFM_MODE 0x175
121+#define GCR_MODE 0x175
122122 #define SEEK_COMPLETE 0x176
123−#define ONEMEG_MEDIA 0x177
123+#define TWOMEG_MEDIA 0x177
124124
125125 /* Bits in handshake register */
126126
@@ -612,7 +612,6 @@ static void setup_medium(struct floppy_state *fs) · 485 unmodified lines
612612 struct floppy_struct *g;
613613 fs->disk_in = 1;
614614 fs->write_protected = swim_readbit(base, WRITE_PROT);
615− fs->type = swim_readbit(base, ONEMEG_MEDIA);
616615
617616 if (swim_track00(base))
618617 printk(KERN_ERR
@@ -620,6 +619,9 @@ static void setup_medium(struct floppy_state *fs) · 1 unmodified line
620619
621620 swim_track00(base);
622621
622+ fs->type = swim_readbit(base, TWOMEG_MEDIA) ?
623+ HD_MEDIA : DD_MEDIA;
624+ fs->head_number = swim_readbit(base, SINGLE_SIDED) ? 1 : 2;
623625 get_floppy_geometry(fs, 0, &g);
624626 fs->total_secs = g->size;
625627 fs->secpercyl = g->head * g->sect;
@@ -646,7 +648,7 @@ static int floppy_open(struct block_device *bdev, fmode_t mode) · 20 unmodified lines
646648
647649 swim_write(base, setup, S_IBM_DRIVE | S_FCLK_DIV2);
648650 udelay(10);
649− swim_drive(base, INTERNAL_DRIVE);
651+ swim_drive(base, fs->location);
650652 swim_motor(base, ON);
651653 swim_action(base, SETMFM);
652654 if (fs->ejected)
@@ -656,6 +658,8 @@ static int floppy_open(struct block_device *bdev, fmode_t mode) · 3 unmodified lines
656658 goto out;
657659 }
658660
661+ set_capacity(fs->disk, fs->total_secs);
662+
659663 if (mode & FMODE_NDELAY)
660664 return 0;
661665
@@ -727,14 +731,9 @@ static int floppy_ioctl(struct block_device *bdev, fmode_t mode, · 65 unmodified lines
727731 if (copy_to_user((void __user *) param, (void *) &floppy_type,
728732 sizeof(struct floppy_struct)))
729733 return -EFAULT;
730− break;
731−
732− default:
733− printk(KERN_DEBUG "SWIM floppy_ioctl: unknown cmd %d\n",
734− cmd);
735− return -ENOSYS;
734+ return 0;
736735 }
737− return 0;
736+ return -ENOTTY;
738737 }
739738
740739 static int floppy_getgeo(struct block_device *bdev, struct hd_geometry *geo)
@@ -795,7 +794,7 @@ static struct kobject *floppy_find(dev_t dev, int *part, void *data) · 54 unmodified lines
795794 struct swim_priv *swd = data;
796795 int drive = (*part & 3);
797796
798− if (drive > swd->floppy_count)
797+ if (drive >= swd->floppy_count)
799798 return NULL;
800799
801800 *part = 0;
@@ -813,10 +812,9 @@ static int swim_add_floppy(struct swim_priv *swd, enum drive_location location) · 11 unmodified lines
813812
814813 swim_motor(base, OFF);
815814
816− if (swim_readbit(base, SINGLE_SIDED))
817− fs->head_number = 1;
818− else
819− fs->head_number = 2;
815+ fs->type = HD_MEDIA;
816+ fs->head_number = 2;
817+
820818 fs->ref_count = 0;
821819 fs->ejected = 1;
822820
@@ -834,10 +832,12 @@ static int swim_floppy_init(struct swim_priv *swd) · 11 unmodified lines
834832 /* scan floppy drives */
835833
836834 swim_drive(base, INTERNAL_DRIVE);
837− if (swim_readbit(base, DRIVE_PRESENT))
835+ if (swim_readbit(base, DRIVE_PRESENT) &&
836+ !swim_readbit(base, ONEMEG_DRIVE))
838837 swim_add_floppy(swd, INTERNAL_DRIVE);
839838 swim_drive(base, EXTERNAL_DRIVE);
840− if (swim_readbit(base, DRIVE_PRESENT))
839+ if (swim_readbit(base, DRIVE_PRESENT) &&
840+ !swim_readbit(base, ONEMEG_DRIVE))
841841 swim_add_floppy(swd, EXTERNAL_DRIVE);
842842
843843 /* register floppy drives */
@@ -861,7 +861,6 @@ static int swim_floppy_init(struct swim_priv *swd) · 17 unmodified lines
861861 &swd->lock);
862862 if (!swd->unit[drive].disk->queue) {
863863 err = -ENOMEM;
864− put_disk(swd->unit[drive].disk);
865864 goto exit_put_disks;
866865 }
867866 blk_queue_bounce_limit(swd->unit[drive].disk->queue,
@@ -911,7 +910,7 @@ static int swim_probe(struct platform_device *dev) · 43 unmodified lines
911910 goto out;
912911 }
913912
914− swim_base = ioremap(res->start, resource_size(res));
913+ swim_base = (struct swim __iomem *)res->start;
915914 if (!swim_base) {
916915 ret = -ENOMEM;
917916 goto out_release_io;
@@ -923,7 +922,7 @@ static int swim_probe(struct platform_device *dev) · 5 unmodified lines
923922 if (!get_swim_mode(swim_base)) {
924923 printk(KERN_INFO "SWIM device not found !\n");
925924 ret = -ENODEV;
926− goto out_iounmap;
925+ goto out_release_io;
927926 }
928927
929928 /* set platform driver data */
@@ -931,7 +930,7 @@ static int swim_probe(struct platform_device *dev) · 1 unmodified line
931930 swd = kzalloc(sizeof(struct swim_priv), GFP_KERNEL);
932931 if (!swd) {
933932 ret = -ENOMEM;
934− goto out_iounmap;
933+ goto out_release_io;
935934 }
936935 platform_set_drvdata(dev, swd);
937936
@@ -945,8 +944,6 @@ static int swim_probe(struct platform_device *dev) · 7 unmodified lines
945944
946945 out_kfree:
947946 kfree(swd);
948−out_iounmap:
949− iounmap(swim_base);
950947 out_release_io:
951948 release_mem_region(res->start, resource_size(res));
952949 out:
@@ -974,8 +971,6 @@ static int swim_remove(struct platform_device *dev) · 21 unmodified lines
974971 for (drive = 0; drive < swd->floppy_count; drive++)
975972 floppy_eject(&swd->unit[drive]);
976973
977− iounmap(swd->base);
978−
979974 res = platform_get_resource(dev, IORESOURCE_MEM, 0);
980975 if (res)
981976 release_mem_region(res->start, resource_size(res));
drivers/block/swim3.c+3−3
@@ -148,7 +148,7 @@ struct swim3 { · 147 unmodified lines
148148 #define MOTOR_ON 2
149149 #define RELAX 3 /* also eject in progress */
150150 #define READ_DATA_0 4
151−#define TWOMEG_DRIVE 5
151+#define ONEMEG_DRIVE 5
152152 #define SINGLE_SIDED 6 /* drive or diskette is 4MB type? */
153153 #define DRIVE_PRESENT 7
154154 #define DISK_IN 8
@@ -156,9 +156,9 @@ struct swim3 { · 1 unmodified line
156156 #define TRACK_ZERO 10
157157 #define TACHO 11
158158 #define READ_DATA_1 12
159−#define MFM_MODE 13
159+#define GCR_MODE 13
160160 #define SEEK_COMPLETE 14
161−#define ONEMEG_MEDIA 15
161+#define TWOMEG_MEDIA 15
162162
163163 /* Definitions of values used in writing and formatting */
164164 #define DATA_ESCAPE 0x99
drivers/bus/Kconfig+1−0
@@ -33,6 +33,7 @@ config HISILICON_LPC · 32 unmodified lines
3333 bool "Support for ISA I/O space on HiSilicon Hip06/7"
3434 depends on ARM64 && (ARCH_HISI || COMPILE_TEST)
3535 select INDIRECT_PIO
36+ select MFD_CORE if ACPI
3637 help
3738 Driver to enable I/O access to devices attached to the Low Pin
3839 Count bus on the HiSilicon Hip06/7 SoC.
drivers/cdrom/cdrom.c+1−1
@@ -2371,7 +2371,7 @@ static int cdrom_ioctl_media_changed(struct cdrom_device_info *cdi, · 2370 unmodified lines
23712371 if (!CDROM_CAN(CDC_SELECT_DISC) || arg == CDSL_CURRENT)
23722372 return media_changed(cdi, 1);
23732373
2374− if ((unsigned int)arg >= cdi->capacity)
2374+ if (arg >= cdi->capacity)
23752375 return -EINVAL;
23762376
23772377 info = kmalloc(sizeof(*info), GFP_KERNEL);
drivers/char/random.c+137−35
@@ -261,6 +261,7 @@ · 260 unmodified lines
261261 #include <linux/ptrace.h>
262262 #include <linux/workqueue.h>
263263 #include <linux/irq.h>
264+#include <linux/ratelimit.h>
264265 #include <linux/syscalls.h>
265266 #include <linux/completion.h>
266267 #include <linux/uuid.h>
@@ -427,8 +428,9 @@ struct crng_state primary_crng = { · 160 unmodified lines
427428 * its value (from 0->1->2).
428429 */
429430 static int crng_init = 0;
430−#define crng_ready() (likely(crng_init > 0))
431+#define crng_ready() (likely(crng_init > 1))
431432 static int crng_init_cnt = 0;
433+static unsigned long crng_global_init_time = 0;
432434 #define CRNG_INIT_CNT_THRESH (2*CHACHA20_KEY_SIZE)
433435 static void _extract_crng(struct crng_state *crng,
434436 __u32 out[CHACHA20_BLOCK_WORDS]);
@@ -437,6 +439,16 @@ static void _crng_backtrack_protect(struct crng_state *crng, · 2 unmodified lines
437439 static void process_random_ready_list(void);
438440 static void _get_random_bytes(void *buf, int nbytes);
439441
442+static struct ratelimit_state unseeded_warning =
443+ RATELIMIT_STATE_INIT("warn_unseeded_randomness", HZ, 3);
444+static struct ratelimit_state urandom_warning =
445+ RATELIMIT_STATE_INIT("warn_urandom_randomness", HZ, 3);
446+
447+static int ratelimit_disable __read_mostly;
448+
449+module_param_named(ratelimit_disable, ratelimit_disable, int, 0644);
450+MODULE_PARM_DESC(ratelimit_disable, "Disable random ratelimit suppression");
451+
440452 /**********************************************************************
441453 *
442454 * OS independent entropy store. Here are the functions which handle
@@ -787,6 +799,43 @@ static void crng_initialize(struct crng_state *crng) · 344 unmodified lines
787799 crng->init_time = jiffies - CRNG_RESEED_INTERVAL - 1;
788800 }
789801
802+#ifdef CONFIG_NUMA
803+static void do_numa_crng_init(struct work_struct *work)
804+{
805+ int i;
806+ struct crng_state *crng;
807+ struct crng_state **pool;
808+
809+ pool = kcalloc(nr_node_ids, sizeof(*pool), GFP_KERNEL|__GFP_NOFAIL);
810+ for_each_online_node(i) {
811+ crng = kmalloc_node(sizeof(struct crng_state),
812+ GFP_KERNEL | __GFP_NOFAIL, i);
813+ spin_lock_init(&crng->lock);
814+ crng_initialize(crng);
815+ pool[i] = crng;
816+ }
817+ mb();
818+ if (cmpxchg(&crng_node_pool, NULL, pool)) {
819+ for_each_node(i)
820+ kfree(pool[i]);
821+ kfree(pool);
822+ }
823+}
824+
825+static DECLARE_WORK(numa_crng_init_work, do_numa_crng_init);
826+
827+static void numa_crng_init(void)
828+{
829+ schedule_work(&numa_crng_init_work);
830+}
831+#else
832+static void numa_crng_init(void) {}
833+#endif
834+
835+/*
836+ * crng_fast_load() can be called by code in the interrupt service
837+ * path. So we can't afford to dilly-dally.
838+ */
790839 static int crng_fast_load(const char *cp, size_t len)
791840 {
792841 unsigned long flags;
@@ -794,7 +843,7 @@ static int crng_fast_load(const char *cp, size_t len) · 1 unmodified line
794843
795844 if (!spin_trylock_irqsave(&primary_crng.lock, flags))
796845 return 0;
797− if (crng_ready()) {
846+ if (crng_init != 0) {
798847 spin_unlock_irqrestore(&primary_crng.lock, flags);
799848 return 0;
800849 }
@@ -813,6 +862,51 @@ static int crng_fast_load(const char *cp, size_t len) · 12 unmodified lines
813862 return 1;
814863 }
815864
865+/*
866+ * crng_slow_load() is called by add_device_randomness, which has two
867+ * attributes. (1) We can't trust the buffer passed to it is
868+ * guaranteed to be unpredictable (so it might not have any entropy at
869+ * all), and (2) it doesn't have the performance constraints of
870+ * crng_fast_load().
871+ *
872+ * So we do something more comprehensive which is guaranteed to touch
873+ * all of the primary_crng's state, and which uses a LFSR with a
874+ * period of 255 as part of the mixing algorithm. Finally, we do
875+ * *not* advance crng_init_cnt since buffer we may get may be something
876+ * like a fixed DMI table (for example), which might very well be
877+ * unique to the machine, but is otherwise unvarying.
878+ */
879+static int crng_slow_load(const char *cp, size_t len)
880+{
881+ unsigned long flags;
882+ static unsigned char lfsr = 1;
883+ unsigned char tmp;
884+ unsigned i, max = CHACHA20_KEY_SIZE;
885+ const char * src_buf = cp;
886+ char * dest_buf = (char *) &primary_crng.state[4];
887+
888+ if (!spin_trylock_irqsave(&primary_crng.lock, flags))
889+ return 0;
890+ if (crng_init != 0) {
891+ spin_unlock_irqrestore(&primary_crng.lock, flags);
892+ return 0;
893+ }
894+ if (len > max)
895+ max = len;
896+
897+ for (i = 0; i < max ; i++) {
898+ tmp = lfsr;
899+ lfsr >>= 1;
900+ if (tmp & 1)
901+ lfsr ^= 0xE1;
902+ tmp = dest_buf[i % CHACHA20_KEY_SIZE];
903+ dest_buf[i % CHACHA20_KEY_SIZE] ^= src_buf[i % len] ^ lfsr;
904+ lfsr += (tmp << 3) | (tmp >> 5);
905+ }
906+ spin_unlock_irqrestore(&primary_crng.lock, flags);
907+ return 1;
908+}
909+
816910 static void crng_reseed(struct crng_state *crng, struct entropy_store *r)
817911 {
818912 unsigned long flags;
@@ -831,7 +925,7 @@ static void crng_reseed(struct crng_state *crng, struct entropy_store *r) · 12 unmodified lines
831925 _crng_backtrack_protect(&primary_crng, buf.block,
832926 CHACHA20_KEY_SIZE);
833927 }
834− spin_lock_irqsave(&primary_crng.lock, flags);
928+ spin_lock_irqsave(&crng->lock, flags);
835929 for (i = 0; i < 8; i++) {
836930 unsigned long rv;
837931 if (!arch_get_random_seed_long(&rv) &&
@@ -841,13 +935,26 @@ static void crng_reseed(struct crng_state *crng, struct entropy_store *r) · 3 unmodified lines
841935 }
842936 memzero_explicit(&buf, sizeof(buf));
843937 crng->init_time = jiffies;
844− spin_unlock_irqrestore(&primary_crng.lock, flags);
938+ spin_unlock_irqrestore(&crng->lock, flags);
845939 if (crng == &primary_crng && crng_init < 2) {
846940 invalidate_batched_entropy();
941+ numa_crng_init();
847942 crng_init = 2;
848943 process_random_ready_list();
849944 wake_up_interruptible(&crng_init_wait);
850945 pr_notice("random: crng init done\n");
946+ if (unseeded_warning.missed) {
947+ pr_notice("random: %d get_random_xx warning(s) missed "
948+ "due to ratelimiting\n",
949+ unseeded_warning.missed);
950+ unseeded_warning.missed = 0;
951+ }
952+ if (urandom_warning.missed) {
953+ pr_notice("random: %d urandom warning(s) missed "
954+ "due to ratelimiting\n",
955+ urandom_warning.missed);
956+ urandom_warning.missed = 0;
957+ }
851958 }
852959 }
853960
@@ -856,8 +963,9 @@ static void _extract_crng(struct crng_state *crng, · 2 unmodified lines
856963 {
857964 unsigned long v, flags;
858965
859− if (crng_init > 1 &&
860− time_after(jiffies, crng->init_time + CRNG_RESEED_INTERVAL))
966+ if (crng_ready() &&
967+ (time_after(crng_global_init_time, crng->init_time) ||
968+ time_after(jiffies, crng->init_time + CRNG_RESEED_INTERVAL)))
861969 crng_reseed(crng, crng == &primary_crng ? &input_pool : NULL);
862970 spin_lock_irqsave(&crng->lock, flags);
863971 if (arch_get_random_long(&v))
@@ -981,10 +1089,8 @@ void add_device_randomness(const void *buf, unsigned int size) · 117 unmodified lines
9811089 unsigned long time = random_get_entropy() ^ jiffies;
9821090 unsigned long flags;
9831091
984− if (!crng_ready()) {
985− crng_fast_load(buf, size);
986− return;
987− }
1092+ if (!crng_ready() && size)
1093+ crng_slow_load(buf, size);
9881094
9891095 trace_add_device_randomness(size, _RET_IP_);
9901096 spin_lock_irqsave(&input_pool.lock, flags);
@@ -1139,7 +1245,7 @@ void add_interrupt_randomness(int irq, int irq_flags) · 148 unmodified lines
11391245 fast_mix(fast_pool);
11401246 add_interrupt_bench(cycles);
11411247
1142− if (!crng_ready()) {
1248+ if (unlikely(crng_init == 0)) {
11431249 if ((fast_pool->count >= 64) &&
11441250 crng_fast_load((char *) fast_pool->pool,
11451251 sizeof(fast_pool->pool))) {
@@ -1489,8 +1595,9 @@ static void _warn_unseeded_randomness(const char *func_name, void *caller, · 343 unmodified lines
14891595 #ifndef CONFIG_WARN_ALL_UNSEEDED_RANDOM
14901596 print_once = true;
14911597 #endif
1492− pr_notice("random: %s called from %pS with crng_init=%d\n",
1493− func_name, caller, crng_init);
1598+ if (__ratelimit(&unseeded_warning))
1599+ pr_notice("random: %s called from %pS with crng_init=%d\n",
1600+ func_name, caller, crng_init);
14941601 }
14951602
14961603 /*
@@ -1680,28 +1787,14 @@ static void init_std_data(struct entropy_store *r) · 183 unmodified lines
16801787 */
16811788 static int rand_initialize(void)
16821789 {
1683−#ifdef CONFIG_NUMA
1684− int i;
1685− struct crng_state *crng;
1686− struct crng_state **pool;
1687−#endif
1688−
16891790 init_std_data(&input_pool);
16901791 init_std_data(&blocking_pool);
16911792 crng_initialize(&primary_crng);
1692−
1693−#ifdef CONFIG_NUMA
1694− pool = kcalloc(nr_node_ids, sizeof(*pool), GFP_KERNEL|__GFP_NOFAIL);
1695− for_each_online_node(i) {
1696− crng = kmalloc_node(sizeof(struct crng_state),
1697− GFP_KERNEL | __GFP_NOFAIL, i);
1698− spin_lock_init(&crng->lock);
1699− crng_initialize(crng);
1700− pool[i] = crng;
1793+ crng_global_init_time = jiffies;
1794+ if (ratelimit_disable) {
1795+ urandom_warning.interval = 0;
1796+ unseeded_warning.interval = 0;
17011797 }
1702− mb();
1703− crng_node_pool = pool;
1704−#endif
17051798 return 0;
17061799 }
17071800 early_initcall(rand_initialize);
@@ -1769,9 +1862,10 @@ urandom_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos) · 61 unmodified lines
17691862
17701863 if (!crng_ready() && maxwarn > 0) {
17711864 maxwarn--;
1772− printk(KERN_NOTICE "random: %s: uninitialized urandom read "
1773− "(%zd bytes read)\n",
1774− current->comm, nbytes);
1865+ if (__ratelimit(&urandom_warning))
1866+ printk(KERN_NOTICE "random: %s: uninitialized "
1867+ "urandom read (%zd bytes read)\n",
1868+ current->comm, nbytes);
17751869 spin_lock_irqsave(&primary_crng.lock, flags);
17761870 crng_init_cnt = 0;
17771871 spin_unlock_irqrestore(&primary_crng.lock, flags);
@@ -1875,6 +1969,14 @@ static long random_ioctl(struct file *f, unsigned int cmd, unsigned long arg) · 97 unmodified lines
18751969 input_pool.entropy_count = 0;
18761970 blocking_pool.entropy_count = 0;
18771971 return 0;
1972+ case RNDRESEEDCRNG:
1973+ if (!capable(CAP_SYS_ADMIN))
1974+ return -EPERM;
1975+ if (crng_init < 2)
1976+ return -ENODATA;
1977+ crng_reseed(&primary_crng, NULL);
1978+ crng_global_init_time = jiffies - 1;
1979+ return 0;
18781980 default:
18791981 return -EINVAL;
18801982 }
@@ -2212,7 +2314,7 @@ void add_hwgenerator_randomness(const char *buffer, size_t count, · 331 unmodified lines
22122314 {
22132315 struct entropy_store *poolp = &input_pool;
22142316
2215− if (!crng_ready()) {
2317+ if (unlikely(crng_init == 0)) {
22162318 crng_fast_load(buffer, count);
22172319 return;
22182320 }
drivers/char/virtio_console.c+71−86
@@ -422,7 +422,7 @@ static void reclaim_dma_bufs(void) · 421 unmodified lines
422422 }
423423 }
424424
425−static struct port_buffer *alloc_buf(struct virtqueue *vq, size_t buf_size,
425+static struct port_buffer *alloc_buf(struct virtio_device *vdev, size_t buf_size,
426426 int pages)
427427 {
428428 struct port_buffer *buf;
@@ -445,16 +445,16 @@ static struct port_buffer *alloc_buf(struct virtqueue *vq, size_t buf_size, · 16 unmodified lines
445445 return buf;
446446 }
447447
448− if (is_rproc_serial(vq->vdev)) {
448+ if (is_rproc_serial(vdev)) {
449449 /*
450450 * Allocate DMA memory from ancestor. When a virtio
451451 * device is created by remoteproc, the DMA memory is
452452 * associated with the grandparent device:
453453 * vdev => rproc => platform-dev.
454454 */
455− if (!vq->vdev->dev.parent || !vq->vdev->dev.parent->parent)
455+ if (!vdev->dev.parent || !vdev->dev.parent->parent)
456456 goto free_buf;
457− buf->dev = vq->vdev->dev.parent->parent;
457+ buf->dev = vdev->dev.parent->parent;
458458
459459 /* Increase device refcnt to avoid freeing it */
460460 get_device(buf->dev);
@@ -838,7 +838,7 @@ static ssize_t port_fops_write(struct file *filp, const char __user *ubuf, · 377 unmodified lines
838838
839839 count = min((size_t)(32 * 1024), count);
840840
841− buf = alloc_buf(port->out_vq, count, 0);
841+ buf = alloc_buf(port->portdev->vdev, count, 0);
842842 if (!buf)
843843 return -ENOMEM;
844844
@@ -957,7 +957,7 @@ static ssize_t port_fops_splice_write(struct pipe_inode_info *pipe, · 112 unmodified lines
957957 if (ret < 0)
958958 goto error_out;
959959
960− buf = alloc_buf(port->out_vq, 0, pipe->nrbufs);
960+ buf = alloc_buf(port->portdev->vdev, 0, pipe->nrbufs);
961961 if (!buf) {
962962 ret = -ENOMEM;
963963 goto error_out;
@@ -1374,7 +1374,7 @@ static unsigned int fill_queue(struct virtqueue *vq, spinlock_t *lock) · 410 unmodified lines
13741374
13751375 nr_added_bufs = 0;
13761376 do {
1377− buf = alloc_buf(vq, PAGE_SIZE, 0);
1377+ buf = alloc_buf(vq->vdev, PAGE_SIZE, 0);
13781378 if (!buf)
13791379 break;
13801380
@@ -1402,7 +1402,6 @@ static int add_port(struct ports_device *portdev, u32 id) · 21 unmodified lines
14021402 {
14031403 char debugfs_name[16];
14041404 struct port *port;
1405− struct port_buffer *buf;
14061405 dev_t devt;
14071406 unsigned int nr_added_bufs;
14081407 int err;
@@ -1513,8 +1512,6 @@ static int add_port(struct ports_device *portdev, u32 id) · 104 unmodified lines
15131512 return 0;
15141513
15151514 free_inbufs:
1516− while ((buf = virtqueue_detach_unused_buf(port->in_vq)))
1517− free_buf(buf, true);
15181515 free_device:
15191516 device_destroy(pdrvdata.class, port->dev->devt);
15201517 free_cdev:
@@ -1539,34 +1536,14 @@ static void remove_port(struct kref *kref) · 18 unmodified lines
15391536
15401537 static void remove_port_data(struct port *port)
15411538 {
1542− struct port_buffer *buf;
1543−
15441539 spin_lock_irq(&port->inbuf_lock);
15451540 /* Remove unused data this port might have received. */
15461541 discard_port_data(port);
15471542 spin_unlock_irq(&port->inbuf_lock);
15481543
1549− /* Remove buffers we queued up for the Host to send us data in. */
1550− do {
1551− spin_lock_irq(&port->inbuf_lock);
1552− buf = virtqueue_detach_unused_buf(port->in_vq);
1553− spin_unlock_irq(&port->inbuf_lock);
1554− if (buf)
1555− free_buf(buf, true);
1556− } while (buf);
1557−
15581544 spin_lock_irq(&port->outvq_lock);
15591545 reclaim_consumed_buffers(port);
15601546 spin_unlock_irq(&port->outvq_lock);
1561−
1562− /* Free pending buffers from the out-queue. */
1563− do {
1564− spin_lock_irq(&port->outvq_lock);
1565− buf = virtqueue_detach_unused_buf(port->out_vq);
1566− spin_unlock_irq(&port->outvq_lock);
1567− if (buf)
1568− free_buf(buf, true);
1569− } while (buf);
15701547 }
15711548
15721549 /*
@@ -1791,13 +1768,24 @@ static void control_work_handler(struct work_struct *work) · 218 unmodified lines
17911768 spin_unlock(&portdev->c_ivq_lock);
17921769 }
17931770
1771+static void flush_bufs(struct virtqueue *vq, bool can_sleep)
1772+{
1773+ struct port_buffer *buf;
1774+ unsigned int len;
1775+
1776+ while ((buf = virtqueue_get_buf(vq, &len)))
1777+ free_buf(buf, can_sleep);
1778+}
1779+
17941780 static void out_intr(struct virtqueue *vq)
17951781 {
17961782 struct port *port;
17971783
17981784 port = find_port_by_vq(vq->vdev->priv, vq);
1799− if (!port)
1785+ if (!port) {
1786+ flush_bufs(vq, false);
18001787 return;
1788+ }
18011789
18021790 wake_up_interruptible(&port->waitqueue);
18031791 }
@@ -1808,8 +1796,10 @@ static void in_intr(struct virtqueue *vq) · 4 unmodified lines
18081796 unsigned long flags;
18091797
18101798 port = find_port_by_vq(vq->vdev->priv, vq);
1811− if (!port)
1799+ if (!port) {
1800+ flush_bufs(vq, false);
18121801 return;
1802+ }
18131803
18141804 spin_lock_irqsave(&port->inbuf_lock, flags);
18151805 port->inbuf = get_inbuf(port);
@@ -1984,24 +1974,54 @@ static const struct file_operations portdev_fops = { · 168 unmodified lines
19841974
19851975 static void remove_vqs(struct ports_device *portdev)
19861976 {
1977+ struct virtqueue *vq;
1978+
1979+ virtio_device_for_each_vq(portdev->vdev, vq) {
1980+ struct port_buffer *buf;
1981+
1982+ flush_bufs(vq, true);
1983+ while ((buf = virtqueue_detach_unused_buf(vq)))
1984+ free_buf(buf, true);
1985+ }
19871986 portdev->vdev->config->del_vqs(portdev->vdev);
19881987 kfree(portdev->in_vqs);
19891988 kfree(portdev->out_vqs);
19901989 }
19911990
1992−static void remove_controlq_data(struct ports_device *portdev)
1991+static void virtcons_remove(struct virtio_device *vdev)
19931992 {
1994− struct port_buffer *buf;
1995− unsigned int len;
1993+ struct ports_device *portdev;
1994+ struct port *port, *port2;
19961995
1997− if (!use_multiport(portdev))
1998− return;
1996+ portdev = vdev->priv;
19991997
2000− while ((buf = virtqueue_get_buf(portdev->c_ivq, &len)))
2001− free_buf(buf, true);
1998+ spin_lock_irq(&pdrvdata_lock);
1999+ list_del(&portdev->list);
2000+ spin_unlock_irq(&pdrvdata_lock);
20022001
2003− while ((buf = virtqueue_detach_unused_buf(portdev->c_ivq)))
2004− free_buf(buf, true);
2002+ /* Disable interrupts for vqs */
2003+ vdev->config->reset(vdev);
2004+ /* Finish up work that's lined up */
2005+ if (use_multiport(portdev))
2006+ cancel_work_sync(&portdev->control_work);
2007+ else
2008+ cancel_work_sync(&portdev->config_work);
2009+
2010+ list_for_each_entry_safe(port, port2, &portdev->ports, list)
2011+ unplug_port(port);
2012+
2013+ unregister_chrdev(portdev->chr_major, "virtio-portsdev");
2014+
2015+ /*
2016+ * When yanking out a device, we immediately lose the
2017+ * (device-side) queues. So there's no point in keeping the
2018+ * guest side around till we drop our final reference. This
2019+ * also means that any ports which are in an open state will
2020+ * have to just stop using the port, as the vqs are going
2021+ * away.
2022+ */
2023+ remove_vqs(portdev);
2024+ kfree(portdev);
20052025 }
20062026
20072027 /*
@@ -2070,6 +2090,7 @@ static int virtcons_probe(struct virtio_device *vdev) · 62 unmodified lines
20702090
20712091 spin_lock_init(&portdev->ports_lock);
20722092 INIT_LIST_HEAD(&portdev->ports);
2093+ INIT_LIST_HEAD(&portdev->list);
20732094
20742095 virtio_device_ready(portdev->vdev);
20752096
@@ -2087,8 +2108,15 @@ static int virtcons_probe(struct virtio_device *vdev) · 11 unmodified lines
20872108 if (!nr_added_bufs) {
20882109 dev_err(&vdev->dev,
20892110 "Error allocating buffers for control queue\n");
2090− err = -ENOMEM;
2091− goto free_vqs;
2111+ /*
2112+ * The host might want to notify mgmt sw about device
2113+ * add failure.
2114+ */
2115+ __send_control_msg(portdev, VIRTIO_CONSOLE_BAD_ID,
2116+ VIRTIO_CONSOLE_DEVICE_READY, 0);
2117+ /* Device was functional: we need full cleanup. */
2118+ virtcons_remove(vdev);
2119+ return -ENOMEM;
20922120 }
20932121 } else {
20942122 /*
@@ -2119,11 +2147,6 @@ static int virtcons_probe(struct virtio_device *vdev) · 24 unmodified lines
21192147
21202148 return 0;
21212149
2122−free_vqs:
2123− /* The host might want to notify mgmt sw about device add failure */
2124− __send_control_msg(portdev, VIRTIO_CONSOLE_BAD_ID,
2125− VIRTIO_CONSOLE_DEVICE_READY, 0);
2126− remove_vqs(portdev);
21272150 free_chrdev:
21282151 unregister_chrdev(portdev->chr_major, "virtio-portsdev");
21292152 free:
@@ -2132,43 +2155,6 @@ fail: · 2 unmodified lines
21322155 return err;
21332156 }
21342157
2135−static void virtcons_remove(struct virtio_device *vdev)
2136−{
2137− struct ports_device *portdev;
2138− struct port *port, *port2;
2139−
2140− portdev = vdev->priv;
2141−
2142− spin_lock_irq(&pdrvdata_lock);
2143− list_del(&portdev->list);
2144− spin_unlock_irq(&pdrvdata_lock);
2145−
2146− /* Disable interrupts for vqs */
2147− vdev->config->reset(vdev);
2148− /* Finish up work that's lined up */
2149− if (use_multiport(portdev))
2150− cancel_work_sync(&portdev->control_work);
2151− else
2152− cancel_work_sync(&portdev->config_work);
2153−
2154− list_for_each_entry_safe(port, port2, &portdev->ports, list)
2155− unplug_port(port);
2156−
2157− unregister_chrdev(portdev->chr_major, "virtio-portsdev");
2158−
2159− /*
2160− * When yanking out a device, we immediately lose the
2161− * (device-side) queues. So there's no point in keeping the
2162− * guest side around till we drop our final reference. This
2163− * also means that any ports which are in an open state will
2164− * have to just stop using the port, as the vqs are going
2165− * away.
2166− */
2167− remove_controlq_data(portdev);
2168− remove_vqs(portdev);
2169− kfree(portdev);
2170−}
2171−
21722158 static struct virtio_device_id id_table[] = {
21732159 { VIRTIO_ID_CONSOLE, VIRTIO_DEV_ANY_ID },
21742160 { 0 },
@@ -2209,7 +2195,6 @@ static int virtcons_freeze(struct virtio_device *vdev) · 34 unmodified lines
22092195 */
22102196 if (use_multiport(portdev))
22112197 virtqueue_disable_cb(portdev->c_ivq);
2212− remove_controlq_data(portdev);
22132198
22142199 list_for_each_entry(port, &portdev->ports, list) {
22152200 virtqueue_disable_cb(port->in_vq);
drivers/clk/clk-cs2000-cp.c+1−1
@@ -541,7 +541,7 @@ probe_err: · 540 unmodified lines
541541 return ret;
542542 }
543543
544−static int cs2000_resume(struct device *dev)
544+static int __maybe_unused cs2000_resume(struct device *dev)
545545 {
546546 struct cs2000_priv *priv = dev_get_drvdata(dev);
547547
drivers/clk/clk-mux.c+9−1
@@ -112,10 +112,18 @@ static int clk_mux_set_parent(struct clk_hw *hw, u8 index) · 111 unmodified lines
112112 return 0;
113113 }
114114
115+static int clk_mux_determine_rate(struct clk_hw *hw,
116+ struct clk_rate_request *req)
117+{
118+ struct clk_mux *mux = to_clk_mux(hw);
119+
120+ return clk_mux_determine_rate_flags(hw, req, mux->flags);
121+}
122+
115123 const struct clk_ops clk_mux_ops = {
116124 .get_parent = clk_mux_get_parent,
117125 .set_parent = clk_mux_set_parent,
118− .determine_rate = __clk_mux_determine_rate,
126+ .determine_rate = clk_mux_determine_rate,
119127 };
120128 EXPORT_SYMBOL_GPL(clk_mux_ops);
121129
drivers/clk/clk-stm32mp1.c+23−31
@@ -216,7 +216,7 @@ static const char * const usart1_src[] = { · 215 unmodified lines
216216 "pclk5", "pll3_q", "ck_hsi", "ck_csi", "pll4_q", "ck_hse"
217217 };
218218
219−const char * const usart234578_src[] = {
219+static const char * const usart234578_src[] = {
220220 "pclk1", "pll4_q", "ck_hsi", "ck_csi", "ck_hse"
221221 };
222222
@@ -224,10 +224,6 @@ static const char * const usart6_src[] = { · 1 unmodified line
224224 "pclk2", "pll4_q", "ck_hsi", "ck_csi", "ck_hse"
225225 };
226226
227−static const char * const dfsdm_src[] = {
228− "pclk2", "ck_mcu"
229−};
230−
231227 static const char * const fdcan_src[] = {
232228 "ck_hse", "pll3_q", "pll4_q"
233229 };
@@ -316,10 +312,8 @@ struct stm32_clk_mgate { · 82 unmodified lines
316312 struct clock_config {
317313 u32 id;
318314 const char *name;
319− union {
320− const char *parent_name;
321− const char * const *parent_names;
322− };
315+ const char *parent_name;
316+ const char * const *parent_names;
323317 int num_parents;
324318 unsigned long flags;
325319 void *cfg;
@@ -469,7 +463,7 @@ static void mp1_gate_clk_disable(struct clk_hw *hw) · 143 unmodified lines
469463 }
470464 }
471465
472−const struct clk_ops mp1_gate_clk_ops = {
466+static const struct clk_ops mp1_gate_clk_ops = {
473467 .enable = mp1_gate_clk_enable,
474468 .disable = mp1_gate_clk_disable,
475469 .is_enabled = clk_gate_is_enabled,
@@ -698,7 +692,7 @@ static void mp1_mgate_clk_disable(struct clk_hw *hw) · 222 unmodified lines
698692 mp1_gate_clk_disable(hw);
699693 }
700694
701−const struct clk_ops mp1_mgate_clk_ops = {
695+static const struct clk_ops mp1_mgate_clk_ops = {
702696 .enable = mp1_mgate_clk_enable,
703697 .disable = mp1_mgate_clk_disable,
704698 .is_enabled = clk_gate_is_enabled,
@@ -732,7 +726,7 @@ static int clk_mmux_set_parent(struct clk_hw *hw, u8 index) · 27 unmodified lines
732726 return 0;
733727 }
734728
735−const struct clk_ops clk_mmux_ops = {
729+static const struct clk_ops clk_mmux_ops = {
736730 .get_parent = clk_mmux_get_parent,
737731 .set_parent = clk_mmux_set_parent,
738732 .determine_rate = __clk_mux_determine_rate,
@@ -1048,10 +1042,10 @@ struct stm32_pll_cfg { · 309 unmodified lines
10481042 u32 offset;
10491043 };
10501044
1051−struct clk_hw *_clk_register_pll(struct device *dev,
1052− struct clk_hw_onecell_data *clk_data,
1053− void __iomem *base, spinlock_t *lock,
1054− const struct clock_config *cfg)
1045+static struct clk_hw *_clk_register_pll(struct device *dev,
1046+ struct clk_hw_onecell_data *clk_data,
1047+ void __iomem *base, spinlock_t *lock,
1048+ const struct clock_config *cfg)
10551049 {
10561050 struct stm32_pll_cfg *stm_pll_cfg = cfg->cfg;
10571051
@@ -1405,7 +1399,8 @@ enum { · 347 unmodified lines
14051399 G_USBH,
14061400 G_ETHSTP,
14071401 G_RTCAPB,
1408− G_TZC,
1402+ G_TZC1,
1403+ G_TZC2,
14091404 G_TZPC,
14101405 G_IWDG1,
14111406 G_BSEC,
@@ -1417,7 +1412,7 @@ enum { · 5 unmodified lines
14171412 G_LAST
14181413 };
14191414
1420−struct stm32_mgate mp1_mgate[G_LAST];
1415+static struct stm32_mgate mp1_mgate[G_LAST];
14211416
14221417 #define _K_GATE(_id, _gate_offset, _gate_bit_idx, _gate_flags,\
14231418 _mgate, _ops)\
@@ -1440,7 +1435,7 @@ struct stm32_mgate mp1_mgate[G_LAST]; · 16 unmodified lines
14401435 &mp1_mgate[_id], &mp1_mgate_clk_ops)
14411436
14421437 /* Peripheral gates */
1443−struct stm32_gate_cfg per_gate_cfg[G_LAST] = {
1438+static struct stm32_gate_cfg per_gate_cfg[G_LAST] = {
14441439 /* Multi gates */
14451440 K_GATE(G_MDIO, RCC_APB1ENSETR, 31, 0),
14461441 K_MGATE(G_DAC12, RCC_APB1ENSETR, 29, 0),
@@ -1506,7 +1501,8 @@ struct stm32_gate_cfg per_gate_cfg[G_LAST] = { · 59 unmodified lines
15061501 K_GATE(G_BSEC, RCC_APB5ENSETR, 16, 0),
15071502 K_GATE(G_IWDG1, RCC_APB5ENSETR, 15, 0),
15081503 K_GATE(G_TZPC, RCC_APB5ENSETR, 13, 0),
1509− K_GATE(G_TZC, RCC_APB5ENSETR, 12, 0),
1504+ K_GATE(G_TZC2, RCC_APB5ENSETR, 12, 0),
1505+ K_GATE(G_TZC1, RCC_APB5ENSETR, 11, 0),
15101506 K_GATE(G_RTCAPB, RCC_APB5ENSETR, 8, 0),
15111507 K_MGATE(G_USART1, RCC_APB5ENSETR, 4, 0),
15121508 K_MGATE(G_I2C6, RCC_APB5ENSETR, 3, 0),
@@ -1600,7 +1596,7 @@ enum { · 87 unmodified lines
16001596 M_LAST
16011597 };
16021598
1603−struct stm32_mmux ker_mux[M_LAST];
1599+static struct stm32_mmux ker_mux[M_LAST];
16041600
16051601 #define _K_MUX(_id, _offset, _shift, _width, _mux_flags, _mmux, _ops)\
16061602 [_id] = {\
@@ -1623,7 +1619,7 @@ struct stm32_mmux ker_mux[M_LAST]; · 16 unmodified lines
16231619 _K_MUX(_id, _offset, _shift, _width, _mux_flags,\
16241620 &ker_mux[_id], &clk_mmux_ops)
16251621
1626−const struct stm32_mux_cfg ker_mux_cfg[M_LAST] = {
1622+static const struct stm32_mux_cfg ker_mux_cfg[M_LAST] = {
16271623 /* Kernel multi mux */
16281624 K_MMUX(M_SDMMC12, RCC_SDMMC12CKSELR, 0, 3, 0),
16291625 K_MMUX(M_SPI23, RCC_SPI2S23CKSELR, 0, 3, 0),
@@ -1860,7 +1856,8 @@ static const struct clock_config stm32mp1_clock_cfg[] = { · 230 unmodified lines
18601856 PCLK(USART1, "usart1", "pclk5", 0, G_USART1),
18611857 PCLK(RTCAPB, "rtcapb", "pclk5", CLK_IGNORE_UNUSED |
18621858 CLK_IS_CRITICAL, G_RTCAPB),
1863− PCLK(TZC, "tzc", "pclk5", CLK_IGNORE_UNUSED, G_TZC),
1859+ PCLK(TZC1, "tzc1", "ck_axi", CLK_IGNORE_UNUSED, G_TZC1),
1860+ PCLK(TZC2, "tzc2", "ck_axi", CLK_IGNORE_UNUSED, G_TZC2),
18641861 PCLK(TZPC, "tzpc", "pclk5", CLK_IGNORE_UNUSED, G_TZPC),
18651862 PCLK(IWDG1, "iwdg1", "pclk5", 0, G_IWDG1),
18661863 PCLK(BSEC, "bsec", "pclk5", CLK_IGNORE_UNUSED, G_BSEC),
@@ -1916,8 +1913,7 @@ static const struct clock_config stm32mp1_clock_cfg[] = { · 49 unmodified lines
19161913 KCLK(RNG1_K, "rng1_k", rng_src, 0, G_RNG1, M_RNG1),
19171914 KCLK(RNG2_K, "rng2_k", rng_src, 0, G_RNG2, M_RNG2),
19181915 KCLK(USBPHY_K, "usbphy_k", usbphy_src, 0, G_USBPHY, M_USBPHY),
1919− KCLK(STGEN_K, "stgen_k", stgen_src, CLK_IGNORE_UNUSED,
1920− G_STGEN, M_STGEN),
1916+ KCLK(STGEN_K, "stgen_k", stgen_src, CLK_IS_CRITICAL, G_STGEN, M_STGEN),
19211917 KCLK(SPDIF_K, "spdif_k", spdif_src, 0, G_SPDIF, M_SPDIF),
19221918 KCLK(SPI1_K, "spi1_k", spi123_src, 0, G_SPI1, M_SPI1),
19231919 KCLK(SPI2_K, "spi2_k", spi123_src, 0, G_SPI2, M_SPI23),
@@ -1948,8 +1944,8 @@ static const struct clock_config stm32mp1_clock_cfg[] = { · 24 unmodified lines
19481944 KCLK(FDCAN_K, "fdcan_k", fdcan_src, 0, G_FDCAN, M_FDCAN),
19491945 KCLK(SAI1_K, "sai1_k", sai_src, 0, G_SAI1, M_SAI1),
19501946 KCLK(SAI2_K, "sai2_k", sai2_src, 0, G_SAI2, M_SAI2),
1951− KCLK(SAI3_K, "sai3_k", sai_src, 0, G_SAI2, M_SAI3),
1952− KCLK(SAI4_K, "sai4_k", sai_src, 0, G_SAI2, M_SAI4),
1947+ KCLK(SAI3_K, "sai3_k", sai_src, 0, G_SAI3, M_SAI3),
1948+ KCLK(SAI4_K, "sai4_k", sai_src, 0, G_SAI4, M_SAI4),
19531949 KCLK(ADC12_K, "adc12_k", adc12_src, 0, G_ADC12, M_ADC12),
19541950 KCLK(DSI_K, "dsi_k", dsi_src, 0, G_DSI, M_DSI),
19551951 KCLK(ADFSDM_K, "adfsdm_k", sai_src, 0, G_ADFSDM, M_SAI1),
@@ -1992,10 +1988,6 @@ static const struct clock_config stm32mp1_clock_cfg[] = { · 36 unmodified lines
19921988 _DIV(RCC_MCO2CFGR, 4, 4, 0, NULL)),
19931989
19941990 /* Debug clocks */
1995− FIXED_FACTOR(NO_ID, "ck_axi_div2", "ck_axi", 0, 1, 2),
1996−
1997− GATE(DBG, "ck_apb_dbg", "ck_axi_div2", 0, RCC_DBGCFGR, 8, 0),
1998−
19991991 GATE(CK_DBG, "ck_sys_dbg", "ck_axi", 0, RCC_DBGCFGR, 8, 0),
20001992
20011993 COMPOSITE(CK_TRACE, "ck_trace", ck_trace_src, CLK_OPS_PARENT_ENABLE,
drivers/clk/clk.c+4−3
@@ -426,9 +426,9 @@ static bool mux_is_better_rate(unsigned long rate, unsigned long now, · 425 unmodified lines
426426 return now <= rate && now > best;
427427 }
428428
429−static int
430−clk_mux_determine_rate_flags(struct clk_hw *hw, struct clk_rate_request *req,
431− unsigned long flags)
429+int clk_mux_determine_rate_flags(struct clk_hw *hw,
430+ struct clk_rate_request *req,
431+ unsigned long flags)
432432 {
433433 struct clk_core *core = hw->core, *parent, *best_parent = NULL;
434434 int i, num_parents, ret;
@@ -488,6 +488,7 @@ out: · 53 unmodified lines
488488
489489 return 0;
490490 }
491+EXPORT_SYMBOL_GPL(clk_mux_determine_rate_flags);
491492
492493 struct clk *__clk_lookup(const char *name)
493494 {
drivers/clk/meson/clk-regmap.c+10−1
@@ -153,10 +153,19 @@ static int clk_regmap_mux_set_parent(struct clk_hw *hw, u8 index) · 152 unmodified lines
153153 val << mux->shift);
154154 }
155155
156+static int clk_regmap_mux_determine_rate(struct clk_hw *hw,
157+ struct clk_rate_request *req)
158+{
159+ struct clk_regmap *clk = to_clk_regmap(hw);
160+ struct clk_regmap_mux_data *mux = clk_get_regmap_mux_data(clk);
161+
162+ return clk_mux_determine_rate_flags(hw, req, mux->flags);
163+}
164+
156165 const struct clk_ops clk_regmap_mux_ops = {
157166 .get_parent = clk_regmap_mux_get_parent,
158167 .set_parent = clk_regmap_mux_set_parent,
159− .determine_rate = __clk_mux_determine_rate,
168+ .determine_rate = clk_regmap_mux_determine_rate,
160169 };
161170 EXPORT_SYMBOL_GPL(clk_regmap_mux_ops);
162171
drivers/clk/meson/gxbb-aoclk.h+0−2
@@ -17,8 +17,6 @@ · 16 unmodified lines
1717 #define AO_RTC_ALT_CLK_CNTL0 0x94
1818 #define AO_RTC_ALT_CLK_CNTL1 0x98
1919
20−extern const struct clk_ops meson_aoclk_gate_regmap_ops;
21−
2220 struct aoclk_cec_32k {
2321 struct clk_hw hw;
2422 struct regmap *regmap;
drivers/clk/meson/meson8b.c+3−2
@@ -253,7 +253,7 @@ static struct clk_fixed_factor meson8b_fclk_div3_div = { · 252 unmodified lines
253253 .mult = 1,
254254 .div = 3,
255255 .hw.init = &(struct clk_init_data){
256− .name = "fclk_div_div3",
256+ .name = "fclk_div3_div",
257257 .ops = &clk_fixed_factor_ops,
258258 .parent_names = (const char *[]){ "fixed_pll" },
259259 .num_parents = 1,
@@ -632,7 +632,8 @@ static struct clk_regmap meson8b_cpu_clk = { · 372 unmodified lines
632632 .hw.init = &(struct clk_init_data){
633633 .name = "cpu_clk",
634634 .ops = &clk_regmap_mux_ro_ops,
635− .parent_names = (const char *[]){ "xtal", "cpu_out_sel" },
635+ .parent_names = (const char *[]){ "xtal",
636+ "cpu_scale_out_sel" },
636637 .num_parents = 2,
637638 .flags = (CLK_SET_RATE_PARENT |
638639 CLK_SET_RATE_NO_REPARENT),
drivers/clocksource/Kconfig+8−0
@@ -133,6 +133,14 @@ config VT8500_TIMER · 132 unmodified lines
133133 help
134134 Enables support for the VT8500 driver.
135135
136+config NPCM7XX_TIMER
137+ bool "NPCM7xx timer driver" if COMPILE_TEST
138+ depends on HAS_IOMEM
139+ select CLKSRC_MMIO
140+ help
141+ Enable 24-bit TIMER0 and TIMER1 counters in the NPCM7xx architecture,
142+ While TIMER0 serves as clockevent and TIMER1 serves as clocksource.
143+
136144 config CADENCE_TTC_TIMER
137145 bool "Cadence TTC timer driver" if COMPILE_TEST
138146 depends on COMMON_CLK
drivers/clocksource/Makefile+1−0
@@ -56,6 +56,7 @@ obj-$(CONFIG_CLKSRC_NPS) += timer-nps.o · 55 unmodified lines
5656 obj-$(CONFIG_OXNAS_RPS_TIMER) += timer-oxnas-rps.o
5757 obj-$(CONFIG_OWL_TIMER) += owl-timer.o
5858 obj-$(CONFIG_SPRD_TIMER) += timer-sprd.o
59+obj-$(CONFIG_NPCM7XX_TIMER) += timer-npcm7xx.o
5960
6061 obj-$(CONFIG_ARC_TIMERS) += arc_timer.o
6162 obj-$(CONFIG_ARM_ARCH_TIMER) += arm_arch_timer.o
drivers/clocksource/timer-imx-tpm.c+34−11
@@ -17,9 +17,14 @@ · 16 unmodified lines
1717 #include <linux/of_irq.h>
1818 #include <linux/sched_clock.h>
1919
20+#define TPM_PARAM 0x4
21+#define TPM_PARAM_WIDTH_SHIFT 16
22+#define TPM_PARAM_WIDTH_MASK (0xff << 16)
2023 #define TPM_SC 0x10
2124 #define TPM_SC_CMOD_INC_PER_CNT (0x1 << 3)
2225 #define TPM_SC_CMOD_DIV_DEFAULT 0x3
26+#define TPM_SC_CMOD_DIV_MAX 0x7
27+#define TPM_SC_TOF_MASK (0x1 << 7)
2328 #define TPM_CNT 0x14
2429 #define TPM_MOD 0x18
2530 #define TPM_STATUS 0x1c
@@ -29,8 +34,11 @@ · 3 unmodified lines
2934 #define TPM_C0SC_MODE_SHIFT 2
3035 #define TPM_C0SC_MODE_MASK 0x3c
3136 #define TPM_C0SC_MODE_SW_COMPARE 0x4
37+#define TPM_C0SC_CHF_MASK (0x1 << 7)
3238 #define TPM_C0V 0x24
3339
40+static int counter_width;
41+static int rating;
3442 static void __iomem *timer_base;
3543 static struct clock_event_device clockevent_tpm;
3644
@@ -83,10 +91,11 @@ static int __init tpm_clocksource_init(unsigned long rate) · 46 unmodified lines
8391 tpm_delay_timer.freq = rate;
8492 register_current_timer_delay(&tpm_delay_timer);
8593
86− sched_clock_register(tpm_read_sched_clock, 32, rate);
94+ sched_clock_register(tpm_read_sched_clock, counter_width, rate);
8795
8896 return clocksource_mmio_init(timer_base + TPM_CNT, "imx-tpm",
89− rate, 200, 32, clocksource_mmio_readl_up);
97+ rate, rating, counter_width,
98+ clocksource_mmio_readl_up);
9099 }
91100
92101 static int tpm_set_next_event(unsigned long delta,
@@ -105,7 +114,7 @@ static int tpm_set_next_event(unsigned long delta, · 12 unmodified lines
105114 * of writing CNT registers which may cause the min_delta event got
106115 * missed, so we need add a ETIME check here in case it happened.
107116 */
108− return (int)((next - now) <= 0) ? -ETIME : 0;
117+ return (int)(next - now) <= 0 ? -ETIME : 0;
109118 }
110119
111120 static int tpm_set_state_oneshot(struct clock_event_device *evt)
@@ -139,7 +148,6 @@ static struct clock_event_device clockevent_tpm = { · 27 unmodified lines
139148 .set_state_oneshot = tpm_set_state_oneshot,
140149 .set_next_event = tpm_set_next_event,
141150 .set_state_shutdown = tpm_set_state_shutdown,
142− .rating = 200,
143151 };
144152
145153 static int __init tpm_clockevent_init(unsigned long rate, int irq)
@@ -149,10 +157,11 @@ static int __init tpm_clockevent_init(unsigned long rate, int irq) · 3 unmodified lines
149157 ret = request_irq(irq, tpm_timer_interrupt, IRQF_TIMER | IRQF_IRQPOLL,
150158 "i.MX7ULP TPM Timer", &clockevent_tpm);
151159
160+ clockevent_tpm.rating = rating;
152161 clockevent_tpm.cpumask = cpumask_of(0);
153162 clockevent_tpm.irq = irq;
154− clockevents_config_and_register(&clockevent_tpm,
155− rate, 300, 0xfffffffe);
163+ clockevents_config_and_register(&clockevent_tpm, rate, 300,
164+ GENMASK(counter_width - 1, 1));
156165
157166 return ret;
158167 }
@@ -179,7 +188,7 @@ static int __init tpm_timer_init(struct device_node *np) · 20 unmodified lines
179188 ipg = of_clk_get_by_name(np, "ipg");
180189 per = of_clk_get_by_name(np, "per");
181190 if (IS_ERR(ipg) || IS_ERR(per)) {
182− pr_err("tpm: failed to get igp or per clk\n");
191+ pr_err("tpm: failed to get ipg or per clk\n");
183192 ret = -ENODEV;
184193 goto err_clk_get;
185194 }
@@ -197,6 +206,11 @@ static int __init tpm_timer_init(struct device_node *np) · 11 unmodified lines
197206 goto err_per_clk_enable;
198207 }
199208
209+ counter_width = (readl(timer_base + TPM_PARAM) & TPM_PARAM_WIDTH_MASK)
210+ >> TPM_PARAM_WIDTH_SHIFT;
211+ /* use rating 200 for 32-bit counter and 150 for 16-bit counter */
212+ rating = counter_width == 0x20 ? 200 : 150;
213+
200214 /*
201215 * Initialize tpm module to a known state
202216 * 1) Counter disabled
@@ -205,16 +219,25 @@ static int __init tpm_timer_init(struct device_node *np) · 2 unmodified lines
205219 * 4) Channel0 disabled
206220 * 5) DMA transfers disabled
207221 */
222+ /* make sure counter is disabled */
208223 writel(0, timer_base + TPM_SC);
224+ /* TOF is W1C */
225+ writel(TPM_SC_TOF_MASK, timer_base + TPM_SC);
209226 writel(0, timer_base + TPM_CNT);
210− writel(0, timer_base + TPM_C0SC);
227+ /* CHF is W1C */
228+ writel(TPM_C0SC_CHF_MASK, timer_base + TPM_C0SC);
211229
212− /* increase per cnt, div 8 by default */
213− writel(TPM_SC_CMOD_INC_PER_CNT | TPM_SC_CMOD_DIV_DEFAULT,
230+ /*
231+ * increase per cnt,
232+ * div 8 for 32-bit counter and div 128 for 16-bit counter
233+ */
234+ writel(TPM_SC_CMOD_INC_PER_CNT |
235+ (counter_width == 0x20 ?
236+ TPM_SC_CMOD_DIV_DEFAULT : TPM_SC_CMOD_DIV_MAX),
214237 timer_base + TPM_SC);
215238
216239 /* set MOD register to maximum for free running mode */
217− writel(0xffffffff, timer_base + TPM_MOD);
240+ writel(GENMASK(counter_width - 1, 0), timer_base + TPM_MOD);
218241
219242 rate = clk_get_rate(per) >> 3;
220243 ret = tpm_clocksource_init(rate);
drivers/clocksource/timer-npcm7xx.c+215−0
@@ -0,0 +1,215 @@
1+// SPDX-License-Identifier: GPL-2.0
2+/*
3+ * Copyright (C) 2014-2018 Nuvoton Technologies tomer.maimon@nuvoton.com
4+ * All rights reserved.
5+ *
6+ * Copyright 2017 Google, Inc.
7+ */
8+
9+#include <linux/kernel.h>
10+#include <linux/sched.h>
11+#include <linux/init.h>
12+#include <linux/interrupt.h>
13+#include <linux/err.h>
14+#include <linux/clk.h>
15+#include <linux/io.h>
16+#include <linux/clockchips.h>
17+#include <linux/of_irq.h>
18+#include <linux/of_address.h>
19+#include "timer-of.h"
20+
21+/* Timers registers */
22+#define NPCM7XX_REG_TCSR0 0x0 /* Timer 0 Control and Status Register */
23+#define NPCM7XX_REG_TICR0 0x8 /* Timer 0 Initial Count Register */
24+#define NPCM7XX_REG_TCSR1 0x4 /* Timer 1 Control and Status Register */
25+#define NPCM7XX_REG_TICR1 0xc /* Timer 1 Initial Count Register */
26+#define NPCM7XX_REG_TDR1 0x14 /* Timer 1 Data Register */
27+#define NPCM7XX_REG_TISR 0x18 /* Timer Interrupt Status Register */
28+
29+/* Timers control */
30+#define NPCM7XX_Tx_RESETINT 0x1f
31+#define NPCM7XX_Tx_PERIOD BIT(27)
32+#define NPCM7XX_Tx_INTEN BIT(29)
33+#define NPCM7XX_Tx_COUNTEN BIT(30)
34+#define NPCM7XX_Tx_ONESHOT 0x0
35+#define NPCM7XX_Tx_OPER GENMASK(3, 27)
36+#define NPCM7XX_Tx_MIN_PRESCALE 0x1
37+#define NPCM7XX_Tx_TDR_MASK_BITS 24
38+#define NPCM7XX_Tx_MAX_CNT 0xFFFFFF
39+#define NPCM7XX_T0_CLR_INT 0x1
40+#define NPCM7XX_Tx_CLR_CSR 0x0
41+
42+/* Timers operating mode */
43+#define NPCM7XX_START_PERIODIC_Tx (NPCM7XX_Tx_PERIOD | NPCM7XX_Tx_COUNTEN | \
44+ NPCM7XX_Tx_INTEN | \
45+ NPCM7XX_Tx_MIN_PRESCALE)
46+
47+#define NPCM7XX_START_ONESHOT_Tx (NPCM7XX_Tx_ONESHOT | NPCM7XX_Tx_COUNTEN | \
48+ NPCM7XX_Tx_INTEN | \
49+ NPCM7XX_Tx_MIN_PRESCALE)
50+
51+#define NPCM7XX_START_Tx (NPCM7XX_Tx_COUNTEN | NPCM7XX_Tx_PERIOD | \
52+ NPCM7XX_Tx_MIN_PRESCALE)
53+
54+#define NPCM7XX_DEFAULT_CSR (NPCM7XX_Tx_CLR_CSR | NPCM7XX_Tx_MIN_PRESCALE)
55+
56+static int npcm7xx_timer_resume(struct clock_event_device *evt)
57+{
58+ struct timer_of *to = to_timer_of(evt);
59+ u32 val;
60+
61+ val = readl(timer_of_base(to) + NPCM7XX_REG_TCSR0);
62+ val |= NPCM7XX_Tx_COUNTEN;
63+ writel(val, timer_of_base(to) + NPCM7XX_REG_TCSR0);
64+
65+ return 0;
66+}
67+
68+static int npcm7xx_timer_shutdown(struct clock_event_device *evt)
69+{
70+ struct timer_of *to = to_timer_of(evt);
71+ u32 val;
72+
73+ val = readl(timer_of_base(to) + NPCM7XX_REG_TCSR0);
74+ val &= ~NPCM7XX_Tx_COUNTEN;
75+ writel(val, timer_of_base(to) + NPCM7XX_REG_TCSR0);
76+
77+ return 0;
78+}
79+
80+static int npcm7xx_timer_oneshot(struct clock_event_device *evt)
81+{
82+ struct timer_of *to = to_timer_of(evt);
83+ u32 val;
84+
85+ val = readl(timer_of_base(to) + NPCM7XX_REG_TCSR0);
86+ val &= ~NPCM7XX_Tx_OPER;
87+
88+ val = readl(timer_of_base(to) + NPCM7XX_REG_TCSR0);
89+ val |= NPCM7XX_START_ONESHOT_Tx;
90+ writel(val, timer_of_base(to) + NPCM7XX_REG_TCSR0);
91+
92+ return 0;
93+}
94+
95+static int npcm7xx_timer_periodic(struct clock_event_device *evt)
96+{
97+ struct timer_of *to = to_timer_of(evt);
98+ u32 val;
99+
100+ val = readl(timer_of_base(to) + NPCM7XX_REG_TCSR0);
101+ val &= ~NPCM7XX_Tx_OPER;
102+
103+ writel(timer_of_period(to), timer_of_base(to) + NPCM7XX_REG_TICR0);
104+ val |= NPCM7XX_START_PERIODIC_Tx;
105+
106+ writel(val, timer_of_base(to) + NPCM7XX_REG_TCSR0);
107+
108+ return 0;
109+}
110+
111+static int npcm7xx_clockevent_set_next_event(unsigned long evt,
112+ struct clock_event_device *clk)
113+{
114+ struct timer_of *to = to_timer_of(clk);
115+ u32 val;
116+
117+ writel(evt, timer_of_base(to) + NPCM7XX_REG_TICR0);
118+ val = readl(timer_of_base(to) + NPCM7XX_REG_TCSR0);
119+ val |= NPCM7XX_START_Tx;
120+ writel(val, timer_of_base(to) + NPCM7XX_REG_TCSR0);
121+
122+ return 0;
123+}
124+
125+static irqreturn_t npcm7xx_timer0_interrupt(int irq, void *dev_id)
126+{
127+ struct clock_event_device *evt = (struct clock_event_device *)dev_id;
128+ struct timer_of *to = to_timer_of(evt);
129+
130+ writel(NPCM7XX_T0_CLR_INT, timer_of_base(to) + NPCM7XX_REG_TISR);
131+
132+ evt->event_handler(evt);
133+
134+ return IRQ_HANDLED;
135+}
136+
137+static struct timer_of npcm7xx_to = {
138+ .flags = TIMER_OF_IRQ | TIMER_OF_BASE | TIMER_OF_CLOCK,
139+
140+ .clkevt = {
141+ .name = "npcm7xx-timer0",
142+ .features = CLOCK_EVT_FEAT_PERIODIC |
143+ CLOCK_EVT_FEAT_ONESHOT,
144+ .set_next_event = npcm7xx_clockevent_set_next_event,
145+ .set_state_shutdown = npcm7xx_timer_shutdown,
146+ .set_state_periodic = npcm7xx_timer_periodic,
147+ .set_state_oneshot = npcm7xx_timer_oneshot,
148+ .tick_resume = npcm7xx_timer_resume,
149+ .rating = 300,
150+ },
151+
152+ .of_irq = {
153+ .handler = npcm7xx_timer0_interrupt,
154+ .flags = IRQF_TIMER | IRQF_IRQPOLL,
155+ },
156+};
157+
158+static void __init npcm7xx_clockevents_init(void)
159+{
160+ writel(NPCM7XX_DEFAULT_CSR,
161+ timer_of_base(&npcm7xx_to) + NPCM7XX_REG_TCSR0);
162+
163+ writel(NPCM7XX_Tx_RESETINT,
164+ timer_of_base(&npcm7xx_to) + NPCM7XX_REG_TISR);
165+
166+ npcm7xx_to.clkevt.cpumask = cpumask_of(0);
167+ clockevents_config_and_register(&npcm7xx_to.clkevt,
168+ timer_of_rate(&npcm7xx_to),
169+ 0x1, NPCM7XX_Tx_MAX_CNT);
170+}
171+
172+static void __init npcm7xx_clocksource_init(void)
173+{
174+ u32 val;
175+
176+ writel(NPCM7XX_DEFAULT_CSR,
177+ timer_of_base(&npcm7xx_to) + NPCM7XX_REG_TCSR1);
178+ writel(NPCM7XX_Tx_MAX_CNT,
179+ timer_of_base(&npcm7xx_to) + NPCM7XX_REG_TICR1);
180+
181+ val = readl(timer_of_base(&npcm7xx_to) + NPCM7XX_REG_TCSR1);
182+ val |= NPCM7XX_START_Tx;
183+ writel(val, timer_of_base(&npcm7xx_to) + NPCM7XX_REG_TCSR1);
184+
185+ clocksource_mmio_init(timer_of_base(&npcm7xx_to) +
186+ NPCM7XX_REG_TDR1,
187+ "npcm7xx-timer1", timer_of_rate(&npcm7xx_to),
188+ 200, (unsigned int)NPCM7XX_Tx_TDR_MASK_BITS,
189+ clocksource_mmio_readl_down);
190+}
191+
192+static int __init npcm7xx_timer_init(struct device_node *np)
193+{
194+ int ret;
195+
196+ ret = timer_of_init(np, &npcm7xx_to);
197+ if (ret)
198+ return ret;
199+
200+ /* Clock input is divided by PRESCALE + 1 before it is fed */
201+ /* to the counter */
202+ npcm7xx_to.of_clk.rate = npcm7xx_to.of_clk.rate /
203+ (NPCM7XX_Tx_MIN_PRESCALE + 1);
204+
205+ npcm7xx_clocksource_init();
206+ npcm7xx_clockevents_init();
207+
208+ pr_info("Enabling NPCM7xx clocksource timer base: %px, IRQ: %d ",
209+ timer_of_base(&npcm7xx_to), timer_of_irq(&npcm7xx_to));
210+
211+ return 0;
212+}
213+
214+TIMER_OF_DECLARE(npcm7xx, "nuvoton,npcm750-timer", npcm7xx_timer_init);
215+
drivers/cpufreq/Kconfig.arm+0−10
@@ -71,16 +71,6 @@ config ARM_BRCMSTB_AVS_CPUFREQ · 70 unmodified lines
7171
7272 Say Y, if you have a Broadcom SoC with AVS support for DFS or DVFS.
7373
74−config ARM_BRCMSTB_AVS_CPUFREQ_DEBUG
75− bool "Broadcom STB AVS CPUfreq driver sysfs debug capability"
76− depends on ARM_BRCMSTB_AVS_CPUFREQ
77− help
78− Enabling this option turns on debug support via sysfs under
79− /sys/kernel/debug/brcmstb-avs-cpufreq. It is possible to read all and
80− write some AVS mailbox registers through sysfs entries.
81−
82− If in doubt, say N.
83−
8474 config ARM_EXYNOS5440_CPUFREQ
8575 tristate "SAMSUNG EXYNOS5440"
8676 depends on SOC_EXYNOS5440
drivers/cpufreq/brcmstb-avs-cpufreq.c+1−322
@@ -49,13 +49,6 @@ · 48 unmodified lines
4949 #include <linux/platform_device.h>
5050 #include <linux/semaphore.h>
5151
52−#ifdef CONFIG_ARM_BRCMSTB_AVS_CPUFREQ_DEBUG
53−#include <linux/ctype.h>
54−#include <linux/debugfs.h>
55−#include <linux/slab.h>
56−#include <linux/uaccess.h>
57−#endif
58−
5952 /* Max number of arguments AVS calls take */
6053 #define AVS_MAX_CMD_ARGS 4
6154 /*
@@ -182,88 +175,11 @@ struct private_data { · 120 unmodified lines
182175 void __iomem *base;
183176 void __iomem *avs_intr_base;
184177 struct device *dev;
185−#ifdef CONFIG_ARM_BRCMSTB_AVS_CPUFREQ_DEBUG
186− struct dentry *debugfs;
187−#endif
188178 struct completion done;
189179 struct semaphore sem;
190180 struct pmap pmap;
191181 };
192182
193−#ifdef CONFIG_ARM_BRCMSTB_AVS_CPUFREQ_DEBUG
194−
195−enum debugfs_format {
196− DEBUGFS_NORMAL,
197− DEBUGFS_FLOAT,
198− DEBUGFS_REV,
199−};
200−
201−struct debugfs_data {
202− struct debugfs_entry *entry;
203− struct private_data *priv;
204−};
205−
206−struct debugfs_entry {
207− char *name;
208− u32 offset;
209− fmode_t mode;
210− enum debugfs_format format;
211−};
212−
213−#define DEBUGFS_ENTRY(name, mode, format) { \
214− #name, AVS_MBOX_##name, mode, format \
215−}
216−
217−/*
218− * These are used for debugfs only. Otherwise we use AVS_MBOX_PARAM() directly.
219− */
220−#define AVS_MBOX_PARAM1 AVS_MBOX_PARAM(0)
221−#define AVS_MBOX_PARAM2 AVS_MBOX_PARAM(1)
222−#define AVS_MBOX_PARAM3 AVS_MBOX_PARAM(2)
223−#define AVS_MBOX_PARAM4 AVS_MBOX_PARAM(3)
224−
225−/*
226− * This table stores the name, access permissions and offset for each hardware
227− * register and is used to generate debugfs entries.
228− */
229−static struct debugfs_entry debugfs_entries[] = {
230− DEBUGFS_ENTRY(COMMAND, S_IWUSR, DEBUGFS_NORMAL),
231− DEBUGFS_ENTRY(STATUS, S_IWUSR, DEBUGFS_NORMAL),
232− DEBUGFS_ENTRY(VOLTAGE0, 0, DEBUGFS_FLOAT),
233− DEBUGFS_ENTRY(TEMP0, 0, DEBUGFS_FLOAT),
234− DEBUGFS_ENTRY(PV0, 0, DEBUGFS_FLOAT),
235− DEBUGFS_ENTRY(MV0, 0, DEBUGFS_FLOAT),
236− DEBUGFS_ENTRY(PARAM1, S_IWUSR, DEBUGFS_NORMAL),
237− DEBUGFS_ENTRY(PARAM2, S_IWUSR, DEBUGFS_NORMAL),
238− DEBUGFS_ENTRY(PARAM3, S_IWUSR, DEBUGFS_NORMAL),
239− DEBUGFS_ENTRY(PARAM4, S_IWUSR, DEBUGFS_NORMAL),
240− DEBUGFS_ENTRY(REVISION, 0, DEBUGFS_REV),
241− DEBUGFS_ENTRY(PSTATE, 0, DEBUGFS_NORMAL),
242− DEBUGFS_ENTRY(HEARTBEAT, 0, DEBUGFS_NORMAL),
243− DEBUGFS_ENTRY(MAGIC, S_IWUSR, DEBUGFS_NORMAL),
244− DEBUGFS_ENTRY(SIGMA_HVT, 0, DEBUGFS_NORMAL),
245− DEBUGFS_ENTRY(SIGMA_SVT, 0, DEBUGFS_NORMAL),
246− DEBUGFS_ENTRY(VOLTAGE1, 0, DEBUGFS_FLOAT),
247− DEBUGFS_ENTRY(TEMP1, 0, DEBUGFS_FLOAT),
248− DEBUGFS_ENTRY(PV1, 0, DEBUGFS_FLOAT),
249− DEBUGFS_ENTRY(MV1, 0, DEBUGFS_FLOAT),
250− DEBUGFS_ENTRY(FREQUENCY, 0, DEBUGFS_NORMAL),
251−};
252−
253−static int brcm_avs_target_index(struct cpufreq_policy *, unsigned int);
254−
255−static char *__strtolower(char *s)
256−{
257− char *p;
258−
259− for (p = s; *p; p++)
260− *p = tolower(*p);
261−
262− return s;
263−}
264−
265−#endif /* CONFIG_ARM_BRCMSTB_AVS_CPUFREQ_DEBUG */
266−
267183 static void __iomem *__map_region(const char *name)
268184 {
269185 struct device_node *np;
@@ -516,238 +432,6 @@ brcm_avs_get_freq_table(struct device *dev, struct private_data *priv) · 246 unmodified lines
516432 return table;
517433 }
518434
519−#ifdef CONFIG_ARM_BRCMSTB_AVS_CPUFREQ_DEBUG
520−
521−#define MANT(x) (unsigned int)(abs((x)) / 1000)
522−#define FRAC(x) (unsigned int)(abs((x)) - abs((x)) / 1000 * 1000)
523−
524−static int brcm_avs_debug_show(struct seq_file *s, void *data)
525−{
526− struct debugfs_data *dbgfs = s->private;
527− void __iomem *base;
528− u32 val, offset;
529−
530− if (!dbgfs) {
531− seq_puts(s, "No device pointer\n");
532− return 0;
533− }
534−
535− base = dbgfs->priv->base;
536− offset = dbgfs->entry->offset;
537− val = readl(base + offset);
538− switch (dbgfs->entry->format) {
539− case DEBUGFS_NORMAL:
540− seq_printf(s, "%u\n", val);
541− break;
542− case DEBUGFS_FLOAT:
543− seq_printf(s, "%d.%03d\n", MANT(val), FRAC(val));
544− break;
545− case DEBUGFS_REV:
546− seq_printf(s, "%c.%c.%c.%c\n", (val >> 24 & 0xff),
547− (val >> 16 & 0xff), (val >> 8 & 0xff),
548− val & 0xff);
549− break;
550− }
551− seq_printf(s, "0x%08x\n", val);
552−
553− return 0;
554−}
555−
556−#undef MANT
557−#undef FRAC
558−
559−static ssize_t brcm_avs_seq_write(struct file *file, const char __user *buf,
560− size_t size, loff_t *ppos)
561−{
562− struct seq_file *s = file->private_data;
563− struct debugfs_data *dbgfs = s->private;
564− struct private_data *priv = dbgfs->priv;
565− void __iomem *base, *avs_intr_base;
566− bool use_issue_command = false;
567− unsigned long val, offset;
568− char str[128];
569− int ret;
570− char *str_ptr = str;
571−
572− if (size >= sizeof(str))
573− return -E2BIG;
574−
575− memset(str, 0, sizeof(str));
576− ret = copy_from_user(str, buf, size);
577− if (ret)
578− return ret;
579−
580− base = priv->base;
581− avs_intr_base = priv->avs_intr_base;
582− offset = dbgfs->entry->offset;
583− /*
584− * Special case writing to "command" entry only: if the string starts
585− * with a 'c', we use the driver's __issue_avs_command() function.
586− * Otherwise, we perform a raw write. This should allow testing of raw
587− * access as well as using the higher level function. (Raw access
588− * doesn't clear the firmware return status after issuing the command.)
589− */
590− if (str_ptr[0] == 'c' && offset == AVS_MBOX_COMMAND) {
591− use_issue_command = true;
592− str_ptr++;
593− }
594− if (kstrtoul(str_ptr, 0, &val) != 0)
595− return -EINVAL;
596−
597− /*
598− * Setting the P-state is a special case. We need to update the CPU
599− * frequency we report.
600− */
601− if (val == AVS_CMD_SET_PSTATE) {
602− struct cpufreq_policy *policy;
603− unsigned int pstate;
604−
605− policy = cpufreq_cpu_get(smp_processor_id());
606− /* Read back the P-state we are about to set */
607− pstate = readl(base + AVS_MBOX_PARAM(0));
608− if (use_issue_command) {
609− ret = brcm_avs_target_index(policy, pstate);
610− return ret ? ret : size;
611− }
612− policy->cur = policy->freq_table[pstate].frequency;
613− }
614−
615− if (use_issue_command) {
616− ret = __issue_avs_command(priv, val, false, NULL);
617− } else {
618− /* Locking here is not perfect, but is only for debug. */
619− ret = down_interruptible(&priv->sem);
620− if (ret)
621− return ret;
622−
623− writel(val, base + offset);
624− /* We have to wake up the firmware to process a command. */
625− if (offset == AVS_MBOX_COMMAND)
626− writel(AVS_CPU_L2_INT_MASK,
627− avs_intr_base + AVS_CPU_L2_SET0);
628− up(&priv->sem);
629− }
630−
631− return ret ? ret : size;
632−}
633−
634−static struct debugfs_entry *__find_debugfs_entry(const char *name)
635−{
636− int i;
637−
638− for (i = 0; i < ARRAY_SIZE(debugfs_entries); i++)
639− if (strcasecmp(debugfs_entries[i].name, name) == 0)
640− return &debugfs_entries[i];
641−
642− return NULL;
643−}
644−
645−static int brcm_avs_debug_open(struct inode *inode, struct file *file)
646−{
647− struct debugfs_data *data;
648− fmode_t fmode;
649− int ret;
650−
651− /*
652− * seq_open(), which is called by single_open(), clears "write" access.
653− * We need write access to some files, so we preserve our access mode
654− * and restore it.
655− */
656− fmode = file->f_mode;
657− /*
658− * Check access permissions even for root. We don't want to be writing
659− * to read-only registers. Access for regular users has already been
660− * checked by the VFS layer.
661− */
662− if ((fmode & FMODE_WRITER) && !(inode->i_mode & S_IWUSR))
663− return -EACCES;
664−
665− data = kmalloc(sizeof(*data), GFP_KERNEL);
666− if (!data)
667− return -ENOMEM;
668− /*
669− * We use the same file system operations for all our debug files. To
670− * produce specific output, we look up the file name upon opening a
671− * debugfs entry and map it to a memory offset. This offset is then used
672− * in the generic "show" function to read a specific register.
673− */
674− data->entry = __find_debugfs_entry(file->f_path.dentry->d_iname);
675− data->priv = inode->i_private;
676−
677− ret = single_open(file, brcm_avs_debug_show, data);
678− if (ret)
679− kfree(data);
680− file->f_mode = fmode;
681−
682− return ret;
683−}
684−
685−static int brcm_avs_debug_release(struct inode *inode, struct file *file)
686−{
687− struct seq_file *seq_priv = file->private_data;
688− struct debugfs_data *data = seq_priv->private;
689−
690− kfree(data);
691− return single_release(inode, file);
692−}
693−
694−static const struct file_operations brcm_avs_debug_ops = {
695− .open = brcm_avs_debug_open,
696− .read = seq_read,
697− .write = brcm_avs_seq_write,
698− .llseek = seq_lseek,
699− .release = brcm_avs_debug_release,
700−};
701−
702−static void brcm_avs_cpufreq_debug_init(struct platform_device *pdev)
703−{
704− struct private_data *priv = platform_get_drvdata(pdev);
705− struct dentry *dir;
706− int i;
707−
708− if (!priv)
709− return;
710−
711− dir = debugfs_create_dir(BRCM_AVS_CPUFREQ_NAME, NULL);
712− if (IS_ERR_OR_NULL(dir))
713− return;
714− priv->debugfs = dir;
715−
716− for (i = 0; i < ARRAY_SIZE(debugfs_entries); i++) {
717− /*
718− * The DEBUGFS_ENTRY macro generates uppercase strings. We
719− * convert them to lowercase before creating the debugfs
720− * entries.
721− */
722− char *entry = __strtolower(debugfs_entries[i].name);
723− fmode_t mode = debugfs_entries[i].mode;
724−
725− if (!debugfs_create_file(entry, S_IFREG | S_IRUGO | mode,
726− dir, priv, &brcm_avs_debug_ops)) {
727− priv->debugfs = NULL;
728− debugfs_remove_recursive(dir);
729− break;
730− }
731− }
732−}
733−
734−static void brcm_avs_cpufreq_debug_exit(struct platform_device *pdev)
735−{
736− struct private_data *priv = platform_get_drvdata(pdev);
737−
738− if (priv && priv->debugfs) {
739− debugfs_remove_recursive(priv->debugfs);
740− priv->debugfs = NULL;
741− }
742−}
743−
744−#else
745−
746−static void brcm_avs_cpufreq_debug_init(struct platform_device *pdev) {}
747−static void brcm_avs_cpufreq_debug_exit(struct platform_device *pdev) {}
748−
749−#endif /* CONFIG_ARM_BRCMSTB_AVS_CPUFREQ_DEBUG */
750−
751435 /*
752436 * To ensure the right firmware is running we need to
753437 * - check the MAGIC matches what we expect
@@ -1016,11 +700,8 @@ static int brcm_avs_cpufreq_probe(struct platform_device *pdev) · 262 unmodified lines
1016700 return ret;
1017701
1018702 brcm_avs_driver.driver_data = pdev;
1019− ret = cpufreq_register_driver(&brcm_avs_driver);
1020− if (!ret)
1021− brcm_avs_cpufreq_debug_init(pdev);
1022703
1023− return ret;
704+ return cpufreq_register_driver(&brcm_avs_driver);
1024705 }
1025706
1026707 static int brcm_avs_cpufreq_remove(struct platform_device *pdev)
@@ -1032,8 +713,6 @@ static int brcm_avs_cpufreq_remove(struct platform_device *pdev) · 5 unmodified lines
1032713 if (ret)
1033714 return ret;
1034715
1035− brcm_avs_cpufreq_debug_exit(pdev);
1036−
1037716 priv = platform_get_drvdata(pdev);
1038717 iounmap(priv->base);
1039718 iounmap(priv->avs_intr_base);
drivers/cpufreq/cppc_cpufreq.c+44−2
@@ -126,6 +126,49 @@ static void cppc_cpufreq_stop_cpu(struct cpufreq_policy *policy) · 125 unmodified lines
126126 cpu->perf_caps.lowest_perf, cpu_num, ret);
127127 }
128128
129+/*
130+ * The PCC subspace describes the rate at which platform can accept commands
131+ * on the shared PCC channel (including READs which do not count towards freq
132+ * trasition requests), so ideally we need to use the PCC values as a fallback
133+ * if we don't have a platform specific transition_delay_us
134+ */
135+#ifdef CONFIG_ARM64
136+#include <asm/cputype.h>
137+
138+static unsigned int cppc_cpufreq_get_transition_delay_us(int cpu)
139+{
140+ unsigned long implementor = read_cpuid_implementor();
141+ unsigned long part_num = read_cpuid_part_number();
142+ unsigned int delay_us = 0;
143+
144+ switch (implementor) {
145+ case ARM_CPU_IMP_QCOM:
146+ switch (part_num) {
147+ case QCOM_CPU_PART_FALKOR_V1:
148+ case QCOM_CPU_PART_FALKOR:
149+ delay_us = 10000;
150+ break;
151+ default:
152+ delay_us = cppc_get_transition_latency(cpu) / NSEC_PER_USEC;
153+ break;
154+ }
155+ break;
156+ default:
157+ delay_us = cppc_get_transition_latency(cpu) / NSEC_PER_USEC;
158+ break;
159+ }
160+
161+ return delay_us;
162+}
163+
164+#else
165+
166+static unsigned int cppc_cpufreq_get_transition_delay_us(int cpu)
167+{
168+ return cppc_get_transition_latency(cpu) / NSEC_PER_USEC;
169+}
170+#endif
171+
129172 static int cppc_cpufreq_cpu_init(struct cpufreq_policy *policy)
130173 {
131174 struct cppc_cpudata *cpu;
@@ -162,8 +205,7 @@ static int cppc_cpufreq_cpu_init(struct cpufreq_policy *policy) · 30 unmodified lines
162205 cpu->perf_caps.highest_perf;
163206 policy->cpuinfo.max_freq = cppc_dmi_max_khz;
164207
165− policy->transition_delay_us = cppc_get_transition_latency(cpu_num) /
166− NSEC_PER_USEC;
208+ policy->transition_delay_us = cppc_cpufreq_get_transition_delay_us(cpu_num);
167209 policy->shared_type = cpu->shared_type;
168210
169211 if (policy->shared_type == CPUFREQ_SHARED_TYPE_ANY) {
drivers/cpufreq/powernv-cpufreq.c+11−3
@@ -679,6 +679,16 @@ void gpstate_timer_handler(struct timer_list *t) · 678 unmodified lines
679679
680680 if (!spin_trylock(&gpstates->gpstate_lock))
681681 return;
682+ /*
683+ * If the timer has migrated to the different cpu then bring
684+ * it back to one of the policy->cpus
685+ */
686+ if (!cpumask_test_cpu(raw_smp_processor_id(), policy->cpus)) {
687+ gpstates->timer.expires = jiffies + msecs_to_jiffies(1);
688+ add_timer_on(&gpstates->timer, cpumask_first(policy->cpus));
689+ spin_unlock(&gpstates->gpstate_lock);
690+ return;
691+ }
682692
683693 /*
684694 * If PMCR was last updated was using fast_swtich then
@@ -718,10 +728,8 @@ void gpstate_timer_handler(struct timer_list *t) · 33 unmodified lines
718728 if (gpstate_idx != gpstates->last_lpstate_idx)
719729 queue_gpstate_timer(gpstates);
720730
731+ set_pstate(&freq_data);
721732 spin_unlock(&gpstates->gpstate_lock);
722−
723− /* Timer may get migrated to a different cpu on cpu hot unplug */
724− smp_call_function_any(policy->cpus, set_pstate, &freq_data, 1);
725733 }
726734
727735 /*
drivers/dax/device.c+2−0
@@ -19,6 +19,7 @@ · 18 unmodified lines
1919 #include <linux/dax.h>
2020 #include <linux/fs.h>
2121 #include <linux/mm.h>
22+#include <linux/mman.h>
2223 #include "dax-private.h"
2324 #include "dax.h"
2425
@@ -540,6 +541,7 @@ static const struct file_operations dax_fops = { · 515 unmodified lines
540541 .release = dax_release,
541542 .get_unmapped_area = dax_get_unmapped_area,
542543 .mmap = dax_mmap,
544+ .mmap_supported_flags = MAP_SYNC,
543545 };
544546
545547 static void dev_dax_release(struct device *dev)
drivers/firmware/arm_scmi/clock.c+1−1
@@ -284,7 +284,7 @@ scmi_clock_info_get(const struct scmi_handle *handle, u32 clk_id) · 283 unmodified lines
284284 struct clock_info *ci = handle->clk_priv;
285285 struct scmi_clock_info *clk = ci->clk + clk_id;
286286
287− if (!clk->name || !clk->name[0])
287+ if (!clk->name[0])
288288 return NULL;
289289
290290 return clk;
drivers/fpga/altera-ps-spi.c+1−1
@@ -249,7 +249,7 @@ static int altera_ps_probe(struct spi_device *spi) · 248 unmodified lines
249249
250250 conf->data = of_id->data;
251251 conf->spi = spi;
252− conf->config = devm_gpiod_get(&spi->dev, "nconfig", GPIOD_OUT_HIGH);
252+ conf->config = devm_gpiod_get(&spi->dev, "nconfig", GPIOD_OUT_LOW);
253253 if (IS_ERR(conf->config)) {
254254 dev_err(&spi->dev, "Failed to get config gpio: %ld\n",
255255 PTR_ERR(conf->config));
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c+5−2
@@ -1459,10 +1459,11 @@ static const u32 sgpr_init_compute_shader[] = · 1458 unmodified lines
14591459 static const u32 vgpr_init_regs[] =
14601460 {
14611461 mmCOMPUTE_STATIC_THREAD_MGMT_SE0, 0xffffffff,
1462− mmCOMPUTE_RESOURCE_LIMITS, 0,
1462+ mmCOMPUTE_RESOURCE_LIMITS, 0x1000000, /* CU_GROUP_COUNT=1 */
14631463 mmCOMPUTE_NUM_THREAD_X, 256*4,
14641464 mmCOMPUTE_NUM_THREAD_Y, 1,
14651465 mmCOMPUTE_NUM_THREAD_Z, 1,
1466+ mmCOMPUTE_PGM_RSRC1, 0x100004f, /* VGPRS=15 (64 logical VGPRs), SGPRS=1 (16 SGPRs), BULKY=1 */
14661467 mmCOMPUTE_PGM_RSRC2, 20,
14671468 mmCOMPUTE_USER_DATA_0, 0xedcedc00,
14681469 mmCOMPUTE_USER_DATA_1, 0xedcedc01,
@@ -1479,10 +1480,11 @@ static const u32 vgpr_init_regs[] = · 10 unmodified lines
14791480 static const u32 sgpr1_init_regs[] =
14801481 {
14811482 mmCOMPUTE_STATIC_THREAD_MGMT_SE0, 0x0f,
1482− mmCOMPUTE_RESOURCE_LIMITS, 0x1000000,
1483+ mmCOMPUTE_RESOURCE_LIMITS, 0x1000000, /* CU_GROUP_COUNT=1 */
14831484 mmCOMPUTE_NUM_THREAD_X, 256*5,
14841485 mmCOMPUTE_NUM_THREAD_Y, 1,
14851486 mmCOMPUTE_NUM_THREAD_Z, 1,
1487+ mmCOMPUTE_PGM_RSRC1, 0x240, /* SGPRS=9 (80 GPRS) */
14861488 mmCOMPUTE_PGM_RSRC2, 20,
14871489 mmCOMPUTE_USER_DATA_0, 0xedcedc00,
14881490 mmCOMPUTE_USER_DATA_1, 0xedcedc01,
@@ -1503,6 +1505,7 @@ static const u32 sgpr2_init_regs[] = · 14 unmodified lines
15031505 mmCOMPUTE_NUM_THREAD_X, 256*5,
15041506 mmCOMPUTE_NUM_THREAD_Y, 1,
15051507 mmCOMPUTE_NUM_THREAD_Z, 1,
1508+ mmCOMPUTE_PGM_RSRC1, 0x240, /* SGPRS=9 (80 GPRS) */
15061509 mmCOMPUTE_PGM_RSRC2, 20,
15071510 mmCOMPUTE_USER_DATA_0, 0xedcedc00,
15081511 mmCOMPUTE_USER_DATA_1, 0xedcedc01,
drivers/gpu/drm/amd/amdkfd/Kconfig+1−0
@@ -6,5 +6,6 @@ config HSA_AMD · 5 unmodified lines
66 tristate "HSA kernel driver for AMD GPU devices"
77 depends on DRM_AMDGPU && X86_64
88 imply AMD_IOMMU_V2
9+ select MMU_NOTIFIER
910 help
1011 Enable this if you want to use HSA features on AMD GPU devices.
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c+9−8
@@ -749,12 +749,13 @@ static int kfd_ioctl_get_clock_counters(struct file *filep, · 748 unmodified lines
749749 struct timespec64 time;
750750
751751 dev = kfd_device_by_id(args->gpu_id);
752− if (dev == NULL)
753− return -EINVAL;
754−
755− /* Reading GPU clock counter from KGD */
756− args->gpu_clock_counter =
757− dev->kfd2kgd->get_gpu_clock_counter(dev->kgd);
752+ if (dev)
753+ /* Reading GPU clock counter from KGD */
754+ args->gpu_clock_counter =
755+ dev->kfd2kgd->get_gpu_clock_counter(dev->kgd);
756+ else
757+ /* Node without GPU resource */
758+ args->gpu_clock_counter = 0;
758759
759760 /* No access to rdtsc. Using raw monotonic time */
760761 getrawmonotonic64(&time);
@@ -1147,7 +1148,7 @@ err_unlock: · 386 unmodified lines
11471148 return ret;
11481149 }
11491150
1150−bool kfd_dev_is_large_bar(struct kfd_dev *dev)
1151+static bool kfd_dev_is_large_bar(struct kfd_dev *dev)
11511152 {
11521153 struct kfd_local_mem_info mem_info;
11531154
@@ -1421,7 +1422,7 @@ static int kfd_ioctl_unmap_memory_from_gpu(struct file *filep, · 267 unmodified lines
14211422
14221423 pdd = kfd_get_process_device_data(dev, p);
14231424 if (!pdd) {
1424− err = PTR_ERR(pdd);
1425+ err = -EINVAL;
14251426 goto bind_process_to_device_failed;
14261427 }
14271428
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c+9−1
@@ -4557,6 +4557,7 @@ static int dm_update_crtcs_state(struct dc *dc, · 4556 unmodified lines
45574557 struct amdgpu_dm_connector *aconnector = NULL;
45584558 struct drm_connector_state *new_con_state = NULL;
45594559 struct dm_connector_state *dm_conn_state = NULL;
4560+ struct drm_plane_state *new_plane_state = NULL;
45604561
45614562 new_stream = NULL;
45624563
@@ -4564,6 +4565,13 @@ static int dm_update_crtcs_state(struct dc *dc, · 1 unmodified line
45644565 dm_new_crtc_state = to_dm_crtc_state(new_crtc_state);
45654566 acrtc = to_amdgpu_crtc(crtc);
45664567
4568+ new_plane_state = drm_atomic_get_new_plane_state(state, new_crtc_state->crtc->primary);
4569+
4570+ if (new_crtc_state->enable && new_plane_state && !new_plane_state->fb) {
4571+ ret = -EINVAL;
4572+ goto fail;
4573+ }
4574+
45674575 aconnector = amdgpu_dm_find_first_crtc_matching_connector(state, crtc);
45684576
45694577 /* TODO This hack should go away */
@@ -4760,7 +4768,7 @@ static int dm_update_planes_state(struct dc *dc, · 190 unmodified lines
47604768 if (!dm_old_crtc_state->stream)
47614769 continue;
47624770
4763− DRM_DEBUG_DRIVER("Disabling DRM plane: %d on DRM crtc %d\n",
4771+ DRM_DEBUG_ATOMIC("Disabling DRM plane: %d on DRM crtc %d\n",
47644772 plane->base.id, old_plane_crtc->base.id);
47654773
47664774 if (!dc_remove_plane_from_context(
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c+0−7
@@ -138,13 +138,6 @@ int amdgpu_dm_set_regamma_lut(struct dm_crtc_state *crtc) · 137 unmodified lines
138138 lut = (struct drm_color_lut *)blob->data;
139139 lut_size = blob->length / sizeof(struct drm_color_lut);
140140
141− if (__is_lut_linear(lut, lut_size)) {
142− /* Set to bypass if lut is set to linear */
143− stream->out_transfer_func->type = TF_TYPE_BYPASS;
144− stream->out_transfer_func->tf = TRANSFER_FUNCTION_LINEAR;
145− return 0;
146− }
147−
148141 gamma = dc_create_gamma();
149142 if (!gamma)
150143 return -ENOMEM;
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c+3−2
@@ -329,14 +329,15 @@ void amdgpu_dm_irq_fini(struct amdgpu_device *adev) · 328 unmodified lines
329329 {
330330 int src;
331331 struct irq_list_head *lh;
332+ unsigned long irq_table_flags;
332333 DRM_DEBUG_KMS("DM_IRQ: releasing resources.\n");
333−
334334 for (src = 0; src < DAL_IRQ_SOURCES_NUMBER; src++) {
335−
335+ DM_IRQ_TABLE_LOCK(adev, irq_table_flags);
336336 /* The handler was removed from the table,
337337 * it means it is safe to flush all the 'work'
338338 * (because no code can schedule a new one). */
339339 lh = &adev->dm.irq_handler_list_low_tab[src];
340+ DM_IRQ_TABLE_UNLOCK(adev, irq_table_flags);
340341 flush_work(&lh->work);
341342 }
342343 }
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c+22−32
@@ -161,6 +161,11 @@ dm_dp_mst_connector_destroy(struct drm_connector *connector) · 160 unmodified lines
161161 struct amdgpu_dm_connector *amdgpu_dm_connector = to_amdgpu_dm_connector(connector);
162162 struct amdgpu_encoder *amdgpu_encoder = amdgpu_dm_connector->mst_encoder;
163163
164+ if (amdgpu_dm_connector->edid) {
165+ kfree(amdgpu_dm_connector->edid);
166+ amdgpu_dm_connector->edid = NULL;
167+ }
168+
164169 drm_encoder_cleanup(&amdgpu_encoder->base);
165170 kfree(amdgpu_encoder);
166171 drm_connector_cleanup(connector);
@@ -181,28 +186,22 @@ static const struct drm_connector_funcs dm_dp_mst_connector_funcs = { · 14 unmodified lines
181186 void dm_dp_mst_dc_sink_create(struct drm_connector *connector)
182187 {
183188 struct amdgpu_dm_connector *aconnector = to_amdgpu_dm_connector(connector);
184− struct edid *edid;
185189 struct dc_sink *dc_sink;
186190 struct dc_sink_init_data init_params = {
187191 .link = aconnector->dc_link,
188192 .sink_signal = SIGNAL_TYPE_DISPLAY_PORT_MST };
189193
194+ /* FIXME none of this is safe. we shouldn't touch aconnector here in
195+ * atomic_check
196+ */
197+
190198 /*
191199 * TODO: Need to further figure out why ddc.algo is NULL while MST port exists
192200 */
193201 if (!aconnector->port || !aconnector->port->aux.ddc.algo)
194202 return;
195203
196− edid = drm_dp_mst_get_edid(connector, &aconnector->mst_port->mst_mgr, aconnector->port);
197−
198− if (!edid) {
199− drm_mode_connector_update_edid_property(
200− &aconnector->base,
201− NULL);
202− return;
203− }
204−
205− aconnector->edid = edid;
204+ ASSERT(aconnector->edid);
206205
207206 dc_sink = dc_link_add_remote_sink(
208207 aconnector->dc_link,
@@ -215,9 +214,6 @@ void dm_dp_mst_dc_sink_create(struct drm_connector *connector) · 6 unmodified lines
215214
216215 amdgpu_dm_add_sink_to_freesync_module(
217216 connector, aconnector->edid);
218−
219− drm_mode_connector_update_edid_property(
220− &aconnector->base, aconnector->edid);
221217 }
222218
223219 static int dm_dp_mst_get_modes(struct drm_connector *connector)
@@ -230,10 +226,6 @@ static int dm_dp_mst_get_modes(struct drm_connector *connector) · 6 unmodified lines
230226
231227 if (!aconnector->edid) {
232228 struct edid *edid;
233− struct dc_sink *dc_sink;
234− struct dc_sink_init_data init_params = {
235− .link = aconnector->dc_link,
236− .sink_signal = SIGNAL_TYPE_DISPLAY_PORT_MST };
237229 edid = drm_dp_mst_get_edid(connector, &aconnector->mst_port->mst_mgr, aconnector->port);
238230
239231 if (!edid) {
@@ -244,11 +236,17 @@ static int dm_dp_mst_get_modes(struct drm_connector *connector) · 4 unmodified lines
244236 }
245237
246238 aconnector->edid = edid;
239+ }
247240
241+ if (!aconnector->dc_sink) {
242+ struct dc_sink *dc_sink;
243+ struct dc_sink_init_data init_params = {
244+ .link = aconnector->dc_link,
245+ .sink_signal = SIGNAL_TYPE_DISPLAY_PORT_MST };
248246 dc_sink = dc_link_add_remote_sink(
249247 aconnector->dc_link,
250− (uint8_t *)edid,
251− (edid->extensions + 1) * EDID_LENGTH,
248+ (uint8_t *)aconnector->edid,
249+ (aconnector->edid->extensions + 1) * EDID_LENGTH,
252250 &init_params);
253251
254252 dc_sink->priv = aconnector;
@@ -256,12 +254,12 @@ static int dm_dp_mst_get_modes(struct drm_connector *connector) · 1 unmodified line
256254
257255 if (aconnector->dc_sink)
258256 amdgpu_dm_add_sink_to_freesync_module(
259− connector, edid);
260−
261− drm_mode_connector_update_edid_property(
262− &aconnector->base, edid);
257+ connector, aconnector->edid);
263258 }
264259
260+ drm_mode_connector_update_edid_property(
261+ &aconnector->base, aconnector->edid);
262+
265263 ret = drm_add_edid_modes(connector, aconnector->edid);
266264
267265 return ret;
@@ -424,14 +422,6 @@ static void dm_dp_destroy_mst_connector(struct drm_dp_mst_topology_mgr *mgr, · 156 unmodified lines
424422 dc_sink_release(aconnector->dc_sink);
425423 aconnector->dc_sink = NULL;
426424 }
427− if (aconnector->edid) {
428− kfree(aconnector->edid);
429− aconnector->edid = NULL;
430− }
431−
432− drm_mode_connector_update_edid_property(
433− &aconnector->base,
434− NULL);
435425
436426 aconnector->mst_connected = false;
437427 }
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c+10−6
@@ -4743,23 +4743,27 @@ static void smu7_check_dpm_table_updated(struct pp_hwmgr *hwmgr) · 4742 unmodified lines
47434743
47444744 for (i=0; i < dep_table->count; i++) {
47454745 if (dep_table->entries[i].vddc != odn_dep_table->entries[i].vddc) {
4746− data->need_update_smu7_dpm_table |= DPMTABLE_OD_UPDATE_VDDC;
4747− break;
4746+ data->need_update_smu7_dpm_table |= DPMTABLE_OD_UPDATE_VDDC | DPMTABLE_OD_UPDATE_MCLK;
4747+ return;
47484748 }
47494749 }
4750− if (i == dep_table->count)
4750+ if (i == dep_table->count && data->need_update_smu7_dpm_table & DPMTABLE_OD_UPDATE_VDDC) {
47514751 data->need_update_smu7_dpm_table &= ~DPMTABLE_OD_UPDATE_VDDC;
4752+ data->need_update_smu7_dpm_table |= DPMTABLE_OD_UPDATE_MCLK;
4753+ }
47524754
47534755 dep_table = table_info->vdd_dep_on_sclk;
47544756 odn_dep_table = (struct phm_ppt_v1_clock_voltage_dependency_table *)&(odn_table->vdd_dependency_on_sclk);
47554757 for (i=0; i < dep_table->count; i++) {
47564758 if (dep_table->entries[i].vddc != odn_dep_table->entries[i].vddc) {
4757− data->need_update_smu7_dpm_table |= DPMTABLE_OD_UPDATE_VDDC;
4758− break;
4759+ data->need_update_smu7_dpm_table |= DPMTABLE_OD_UPDATE_VDDC | DPMTABLE_OD_UPDATE_SCLK;
4760+ return;
47594761 }
47604762 }
4761− if (i == dep_table->count)
4763+ if (i == dep_table->count && data->need_update_smu7_dpm_table & DPMTABLE_OD_UPDATE_VDDC) {
47624764 data->need_update_smu7_dpm_table &= ~DPMTABLE_OD_UPDATE_VDDC;
4765+ data->need_update_smu7_dpm_table |= DPMTABLE_OD_UPDATE_SCLK;
4766+ }
47634767 }
47644768
47654769 static int smu7_odn_edit_dpm_table(struct pp_hwmgr *hwmgr,
drivers/gpu/drm/amd/powerplay/inc/vega12/smu9_driver_if.h+3−1
@@ -412,8 +412,10 @@ typedef struct { · 411 unmodified lines
412412 QuadraticInt_t ReservedEquation2;
413413 QuadraticInt_t ReservedEquation3;
414414
415+ uint16_t MinVoltageUlvGfx;
416+ uint16_t MinVoltageUlvSoc;
415417
416− uint32_t Reserved[15];
418+ uint32_t Reserved[14];
417419
418420
419421
drivers/gpu/drm/bridge/dumb-vga-dac.c+3−1
@@ -56,7 +56,9 @@ static int dumb_vga_get_modes(struct drm_connector *connector) · 55 unmodified lines
5656 }
5757
5858 drm_mode_connector_update_edid_property(connector, edid);
59− return drm_add_edid_modes(connector, edid);
59+ ret = drm_add_edid_modes(connector, edid);
60+ kfree(edid);
61+ return ret;
6062
6163 fallback:
6264 /*
drivers/gpu/drm/drm_dp_dual_mode_helper.c+32−7
@@ -350,19 +350,44 @@ int drm_dp_dual_mode_set_tmds_output(enum drm_dp_dual_mode_type type, · 349 unmodified lines
350350 {
351351 uint8_t tmds_oen = enable ? 0 : DP_DUAL_MODE_TMDS_DISABLE;
352352 ssize_t ret;
353+ int retry;
353354
354355 if (type < DRM_DP_DUAL_MODE_TYPE2_DVI)
355356 return 0;
356357
357− ret = drm_dp_dual_mode_write(adapter, DP_DUAL_MODE_TMDS_OEN,
358− &tmds_oen, sizeof(tmds_oen));
359− if (ret) {
360− DRM_DEBUG_KMS("Failed to %s TMDS output buffers\n",
361− enable ? "enable" : "disable");
362− return ret;
358+ /*
359+ * LSPCON adapters in low-power state may ignore the first write, so
360+ * read back and verify the written value a few times.
361+ */
362+ for (retry = 0; retry < 3; retry++) {
363+ uint8_t tmp;
364+
365+ ret = drm_dp_dual_mode_write(adapter, DP_DUAL_MODE_TMDS_OEN,
366+ &tmds_oen, sizeof(tmds_oen));
367+ if (ret) {
368+ DRM_DEBUG_KMS("Failed to %s TMDS output buffers (%d attempts)\n",
369+ enable ? "enable" : "disable",
370+ retry + 1);
371+ return ret;
372+ }
373+
374+ ret = drm_dp_dual_mode_read(adapter, DP_DUAL_MODE_TMDS_OEN,
375+ &tmp, sizeof(tmp));
376+ if (ret) {
377+ DRM_DEBUG_KMS("I2C read failed during TMDS output buffer %s (%d attempts)\n",
378+ enable ? "enabling" : "disabling",
379+ retry + 1);
380+ return ret;
381+ }
382+
383+ if (tmp == tmds_oen)
384+ return 0;
363385 }
364386
365− return 0;
387+ DRM_DEBUG_KMS("I2C write value mismatch during TMDS output buffer %s\n",
388+ enable ? "enabling" : "disabling");
389+
390+ return -EIO;
366391 }
367392 EXPORT_SYMBOL(drm_dp_dual_mode_set_tmds_output);
368393
drivers/gpu/drm/drm_edid.c+3−8
@@ -4451,6 +4451,7 @@ drm_reset_display_info(struct drm_connector *connector) · 4450 unmodified lines
44514451 info->max_tmds_clock = 0;
44524452 info->dvi_dual = false;
44534453 info->has_hdmi_infoframe = false;
4454+ memset(&info->hdmi, 0, sizeof(info->hdmi));
44544455
44554456 info->non_desktop = 0;
44564457 }
@@ -4462,17 +4463,11 @@ u32 drm_add_display_info(struct drm_connector *connector, const struct edid *edi · 5 unmodified lines
44624463
44634464 u32 quirks = edid_get_quirks(edid);
44644465
4466+ drm_reset_display_info(connector);
4467+
44654468 info->width_mm = edid->width_cm * 10;
44664469 info->height_mm = edid->height_cm * 10;
44674470
4468− /* driver figures it out in this case */
4469− info->bpc = 0;
4470− info->color_formats = 0;
4471− info->cea_rev = 0;
4472− info->max_tmds_clock = 0;
4473− info->dvi_dual = false;
4474− info->has_hdmi_infoframe = false;
4475−
44764471 info->non_desktop = !!(quirks & EDID_QUIRK_NON_DESKTOP);
44774472
44784473 DRM_DEBUG_KMS("non_desktop set to %d\n", info->non_desktop);
drivers/gpu/drm/exynos/exynos_drm_fb.c+14−59
@@ -18,6 +18,7 @@ · 17 unmodified lines
1818 #include <drm/drm_fb_helper.h>
1919 #include <drm/drm_atomic.h>
2020 #include <drm/drm_atomic_helper.h>
21+#include <drm/drm_gem_framebuffer_helper.h>
2122 #include <uapi/drm/exynos_drm.h>
2223
2324 #include "exynos_drm_drv.h"
@@ -26,20 +27,6 @@ · 2 unmodified lines
2627 #include "exynos_drm_iommu.h"
2728 #include "exynos_drm_crtc.h"
2829
29−#define to_exynos_fb(x) container_of(x, struct exynos_drm_fb, fb)
30−
31−/*
32− * exynos specific framebuffer structure.
33− *
34− * @fb: drm framebuffer obejct.
35− * @exynos_gem: array of exynos specific gem object containing a gem object.
36− */
37−struct exynos_drm_fb {
38− struct drm_framebuffer fb;
39− struct exynos_drm_gem *exynos_gem[MAX_FB_BUFFER];
40− dma_addr_t dma_addr[MAX_FB_BUFFER];
41−};
42−
4330 static int check_fb_gem_memory_type(struct drm_device *drm_dev,
4431 struct exynos_drm_gem *exynos_gem)
4532 {
@@ -66,40 +53,9 @@ static int check_fb_gem_memory_type(struct drm_device *drm_dev, · 20 unmodified lines
6653 return 0;
6754 }
6855
69−static void exynos_drm_fb_destroy(struct drm_framebuffer *fb)
70−{
71− struct exynos_drm_fb *exynos_fb = to_exynos_fb(fb);
72− unsigned int i;
73−
74− drm_framebuffer_cleanup(fb);
75−
76− for (i = 0; i < ARRAY_SIZE(exynos_fb->exynos_gem); i++) {
77− struct drm_gem_object *obj;
78−
79− if (exynos_fb->exynos_gem[i] == NULL)
80− continue;
81−
82− obj = &exynos_fb->exynos_gem[i]->base;
83− drm_gem_object_unreference_unlocked(obj);
84− }
85−
86− kfree(exynos_fb);
87− exynos_fb = NULL;
88−}
89−
90−static int exynos_drm_fb_create_handle(struct drm_framebuffer *fb,
91− struct drm_file *file_priv,
92− unsigned int *handle)
93−{
94− struct exynos_drm_fb *exynos_fb = to_exynos_fb(fb);
95−
96− return drm_gem_handle_create(file_priv,
97− &exynos_fb->exynos_gem[0]->base, handle);
98−}
99−
10056 static const struct drm_framebuffer_funcs exynos_drm_fb_funcs = {
101− .destroy = exynos_drm_fb_destroy,
102− .create_handle = exynos_drm_fb_create_handle,
57+ .destroy = drm_gem_fb_destroy,
58+ .create_handle = drm_gem_fb_create_handle,
10359 };
10460
10561 struct drm_framebuffer *
@@ -108,12 +64,12 @@ exynos_drm_framebuffer_init(struct drm_device *dev, · 2 unmodified lines
10864 struct exynos_drm_gem **exynos_gem,
10965 int count)
11066 {
111− struct exynos_drm_fb *exynos_fb;
67+ struct drm_framebuffer *fb;
11268 int i;
11369 int ret;
11470
115− exynos_fb = kzalloc(sizeof(*exynos_fb), GFP_KERNEL);
116− if (!exynos_fb)
71+ fb = kzalloc(sizeof(*fb), GFP_KERNEL);
72+ if (!fb)
11773 return ERR_PTR(-ENOMEM);
11874
11975 for (i = 0; i < count; i++) {
@@ -121,23 +77,21 @@ exynos_drm_framebuffer_init(struct drm_device *dev, · 1 unmodified line
12177 if (ret < 0)
12278 goto err;
12379
124− exynos_fb->exynos_gem[i] = exynos_gem[i];
125− exynos_fb->dma_addr[i] = exynos_gem[i]->dma_addr
126− + mode_cmd->offsets[i];
80+ fb->obj[i] = &exynos_gem[i]->base;
12781 }
12882
129− drm_helper_mode_fill_fb_struct(dev, &exynos_fb->fb, mode_cmd);
83+ drm_helper_mode_fill_fb_struct(dev, fb, mode_cmd);
13084
131− ret = drm_framebuffer_init(dev, &exynos_fb->fb, &exynos_drm_fb_funcs);
85+ ret = drm_framebuffer_init(dev, fb, &exynos_drm_fb_funcs);
13286 if (ret < 0) {
13387 DRM_ERROR("failed to initialize framebuffer\n");
13488 goto err;
13589 }
13690
137− return &exynos_fb->fb;
91+ return fb;
13892
13993 err:
140− kfree(exynos_fb);
94+ kfree(fb);
14195 return ERR_PTR(ret);
14296 }
14397
@@ -191,12 +145,13 @@ err: · 47 unmodified lines
191145
192146 dma_addr_t exynos_drm_fb_dma_addr(struct drm_framebuffer *fb, int index)
193147 {
194− struct exynos_drm_fb *exynos_fb = to_exynos_fb(fb);
148+ struct exynos_drm_gem *exynos_gem;
195149
196150 if (WARN_ON_ONCE(index >= MAX_FB_BUFFER))
197151 return 0;
198152
199− return exynos_fb->dma_addr[index];
153+ exynos_gem = to_exynos_gem(fb->obj[index]);
154+ return exynos_gem->dma_addr + fb->offsets[index];
200155 }
201156
202157 static struct drm_mode_config_helper_funcs exynos_drm_mode_config_helpers = {
drivers/gpu/drm/i915/gvt/cmd_parser.c+1−0
@@ -1080,6 +1080,7 @@ static int cmd_handler_mi_user_interrupt(struct parser_exec_state *s) · 1079 unmodified lines
10801080 {
10811081 set_bit(cmd_interrupt_events[s->ring_id].mi_user_interrupt,
10821082 s->workload->pending_events);
1083+ patch_value(s, cmd_ptr(s, 0), MI_NOOP);
10831084 return 0;
10841085 }
10851086
drivers/gpu/drm/i915/gvt/display.c+10−0
@@ -169,6 +169,8 @@ static u8 dpcd_fix_data[DPCD_HEADER_SIZE] = { · 168 unmodified lines
169169 static void emulate_monitor_status_change(struct intel_vgpu *vgpu)
170170 {
171171 struct drm_i915_private *dev_priv = vgpu->gvt->dev_priv;
172+ int pipe;
173+
172174 vgpu_vreg_t(vgpu, SDEISR) &= ~(SDE_PORTB_HOTPLUG_CPT |
173175 SDE_PORTC_HOTPLUG_CPT |
174176 SDE_PORTD_HOTPLUG_CPT);
@@ -267,6 +269,14 @@ static void emulate_monitor_status_change(struct intel_vgpu *vgpu) · 92 unmodified lines
267269 if (IS_BROADWELL(dev_priv))
268270 vgpu_vreg_t(vgpu, PCH_ADPA) &= ~ADPA_CRT_HOTPLUG_MONITOR_MASK;
269271
272+ /* Disable Primary/Sprite/Cursor plane */
273+ for_each_pipe(dev_priv, pipe) {
274+ vgpu_vreg_t(vgpu, DSPCNTR(pipe)) &= ~DISPLAY_PLANE_ENABLE;
275+ vgpu_vreg_t(vgpu, SPRCTL(pipe)) &= ~SPRITE_ENABLE;
276+ vgpu_vreg_t(vgpu, CURCNTR(pipe)) &= ~CURSOR_MODE;
277+ vgpu_vreg_t(vgpu, CURCNTR(pipe)) |= CURSOR_MODE_DISABLE;
278+ }
279+
270280 vgpu_vreg_t(vgpu, PIPECONF(PIPE_A)) |= PIPECONF_ENABLE;
271281 }
272282
drivers/gpu/drm/i915/gvt/dmabuf.c+1−0
@@ -323,6 +323,7 @@ static void update_fb_info(struct vfio_device_gfx_plane_info *gvt_dmabuf, · 322 unmodified lines
323323 struct intel_vgpu_fb_info *fb_info)
324324 {
325325 gvt_dmabuf->drm_format = fb_info->drm_format;
326+ gvt_dmabuf->drm_format_mod = fb_info->drm_format_mod;
326327 gvt_dmabuf->width = fb_info->width;
327328 gvt_dmabuf->height = fb_info->height;
328329 gvt_dmabuf->stride = fb_info->stride;
drivers/gpu/drm/i915/gvt/fb_decoder.c+9−18
@@ -245,16 +245,13 @@ int intel_vgpu_decode_primary_plane(struct intel_vgpu *vgpu, · 244 unmodified lines
245245 plane->hw_format = fmt;
246246
247247 plane->base = vgpu_vreg_t(vgpu, DSPSURF(pipe)) & I915_GTT_PAGE_MASK;
248− if (!intel_gvt_ggtt_validate_range(vgpu, plane->base, 0)) {
249− gvt_vgpu_err("invalid gma address: %lx\n",
250− (unsigned long)plane->base);
248+ if (!intel_gvt_ggtt_validate_range(vgpu, plane->base, 0))
251249 return -EINVAL;
252− }
253250
254251 plane->base_gpa = intel_vgpu_gma_to_gpa(vgpu->gtt.ggtt_mm, plane->base);
255252 if (plane->base_gpa == INTEL_GVT_INVALID_ADDR) {
256− gvt_vgpu_err("invalid gma address: %lx\n",
257− (unsigned long)plane->base);
253+ gvt_vgpu_err("Translate primary plane gma 0x%x to gpa fail\n",
254+ plane->base);
258255 return -EINVAL;
259256 }
260257
@@ -371,16 +368,13 @@ int intel_vgpu_decode_cursor_plane(struct intel_vgpu *vgpu, · 110 unmodified lines
371368 alpha_plane, alpha_force);
372369
373370 plane->base = vgpu_vreg_t(vgpu, CURBASE(pipe)) & I915_GTT_PAGE_MASK;
374− if (!intel_gvt_ggtt_validate_range(vgpu, plane->base, 0)) {
375− gvt_vgpu_err("invalid gma address: %lx\n",
376− (unsigned long)plane->base);
371+ if (!intel_gvt_ggtt_validate_range(vgpu, plane->base, 0))
377372 return -EINVAL;
378− }
379373
380374 plane->base_gpa = intel_vgpu_gma_to_gpa(vgpu->gtt.ggtt_mm, plane->base);
381375 if (plane->base_gpa == INTEL_GVT_INVALID_ADDR) {
382− gvt_vgpu_err("invalid gma address: %lx\n",
383− (unsigned long)plane->base);
376+ gvt_vgpu_err("Translate cursor plane gma 0x%x to gpa fail\n",
377+ plane->base);
384378 return -EINVAL;
385379 }
386380
@@ -476,16 +470,13 @@ int intel_vgpu_decode_sprite_plane(struct intel_vgpu *vgpu, · 89 unmodified lines
476470 plane->drm_format = drm_format;
477471
478472 plane->base = vgpu_vreg_t(vgpu, SPRSURF(pipe)) & I915_GTT_PAGE_MASK;
479− if (!intel_gvt_ggtt_validate_range(vgpu, plane->base, 0)) {
480− gvt_vgpu_err("invalid gma address: %lx\n",
481− (unsigned long)plane->base);
473+ if (!intel_gvt_ggtt_validate_range(vgpu, plane->base, 0))
482474 return -EINVAL;
483− }
484475
485476 plane->base_gpa = intel_vgpu_gma_to_gpa(vgpu->gtt.ggtt_mm, plane->base);
486477 if (plane->base_gpa == INTEL_GVT_INVALID_ADDR) {
487− gvt_vgpu_err("invalid gma address: %lx\n",
488− (unsigned long)plane->base);
478+ gvt_vgpu_err("Translate sprite plane gma 0x%x to gpa fail\n",
479+ plane->base);
489480 return -EINVAL;
490481 }
491482
drivers/gpu/drm/i915/gvt/gtt.c+45−7
@@ -530,6 +530,16 @@ static void ggtt_set_guest_entry(struct intel_vgpu_mm *mm, · 529 unmodified lines
530530 false, 0, mm->vgpu);
531531 }
532532
533+static void ggtt_get_host_entry(struct intel_vgpu_mm *mm,
534+ struct intel_gvt_gtt_entry *entry, unsigned long index)
535+{
536+ struct intel_gvt_gtt_pte_ops *pte_ops = mm->vgpu->gvt->gtt.pte_ops;
537+
538+ GEM_BUG_ON(mm->type != INTEL_GVT_MM_GGTT);
539+
540+ pte_ops->get_entry(NULL, entry, index, false, 0, mm->vgpu);
541+}
542+
533543 static void ggtt_set_host_entry(struct intel_vgpu_mm *mm,
534544 struct intel_gvt_gtt_entry *entry, unsigned long index)
535545 {
@@ -1818,6 +1828,18 @@ int intel_vgpu_emulate_ggtt_mmio_read(struct intel_vgpu *vgpu, unsigned int off, · 1282 unmodified lines
18181828 return ret;
18191829 }
18201830
1831+static void ggtt_invalidate_pte(struct intel_vgpu *vgpu,
1832+ struct intel_gvt_gtt_entry *entry)
1833+{
1834+ struct intel_gvt_gtt_pte_ops *pte_ops = vgpu->gvt->gtt.pte_ops;
1835+ unsigned long pfn;
1836+
1837+ pfn = pte_ops->get_pfn(entry);
1838+ if (pfn != vgpu->gvt->gtt.scratch_mfn)
1839+ intel_gvt_hypervisor_dma_unmap_guest_page(vgpu,
1840+ pfn << PAGE_SHIFT);
1841+}
1842+
18211843 static int emulate_ggtt_mmio_write(struct intel_vgpu *vgpu, unsigned int off,
18221844 void *p_data, unsigned int bytes)
18231845 {
@@ -1844,10 +1866,10 @@ static int emulate_ggtt_mmio_write(struct intel_vgpu *vgpu, unsigned int off, · 20 unmodified lines
18441866
18451867 memcpy((void *)&e.val64 + (off & (info->gtt_entry_size - 1)), p_data,
18461868 bytes);
1847− m = e;
18481869
18491870 if (ops->test_present(&e)) {
18501871 gfn = ops->get_pfn(&e);
1872+ m = e;
18511873
18521874 /* one PTE update may be issued in multiple writes and the
18531875 * first write may not construct a valid gfn
@@ -1868,8 +1890,12 @@ static int emulate_ggtt_mmio_write(struct intel_vgpu *vgpu, unsigned int off, · 14 unmodified lines
18681890 ops->set_pfn(&m, gvt->gtt.scratch_mfn);
18691891 } else
18701892 ops->set_pfn(&m, dma_addr >> PAGE_SHIFT);
1871− } else
1893+ } else {
1894+ ggtt_get_host_entry(ggtt_mm, &m, g_gtt_index);
1895+ ggtt_invalidate_pte(vgpu, &m);
18721896 ops->set_pfn(&m, gvt->gtt.scratch_mfn);
1897+ ops->clear_present(&m);
1898+ }
18731899
18741900 out:
18751901 ggtt_set_host_entry(ggtt_mm, &m, g_gtt_index);
@@ -2030,7 +2056,7 @@ int intel_vgpu_init_gtt(struct intel_vgpu *vgpu) · 154 unmodified lines
20302056 return PTR_ERR(gtt->ggtt_mm);
20312057 }
20322058
2033− intel_vgpu_reset_ggtt(vgpu);
2059+ intel_vgpu_reset_ggtt(vgpu, false);
20342060
20352061 return create_scratch_page_tree(vgpu);
20362062 }
@@ -2315,17 +2341,19 @@ void intel_vgpu_invalidate_ppgtt(struct intel_vgpu *vgpu) · 278 unmodified lines
23152341 /**
23162342 * intel_vgpu_reset_ggtt - reset the GGTT entry
23172343 * @vgpu: a vGPU
2344+ * @invalidate_old: invalidate old entries
23182345 *
23192346 * This function is called at the vGPU create stage
23202347 * to reset all the GGTT entries.
23212348 *
23222349 */
2323−void intel_vgpu_reset_ggtt(struct intel_vgpu *vgpu)
2350+void intel_vgpu_reset_ggtt(struct intel_vgpu *vgpu, bool invalidate_old)
23242351 {
23252352 struct intel_gvt *gvt = vgpu->gvt;
23262353 struct drm_i915_private *dev_priv = gvt->dev_priv;
23272354 struct intel_gvt_gtt_pte_ops *pte_ops = vgpu->gvt->gtt.pte_ops;
23282355 struct intel_gvt_gtt_entry entry = {.type = GTT_TYPE_GGTT_PTE};
2356+ struct intel_gvt_gtt_entry old_entry;
23292357 u32 index;
23302358 u32 num_entries;
23312359
@@ -2334,13 +2362,23 @@ void intel_vgpu_reset_ggtt(struct intel_vgpu *vgpu) · 2 unmodified lines
23342362
23352363 index = vgpu_aperture_gmadr_base(vgpu) >> PAGE_SHIFT;
23362364 num_entries = vgpu_aperture_sz(vgpu) >> PAGE_SHIFT;
2337− while (num_entries--)
2365+ while (num_entries--) {
2366+ if (invalidate_old) {
2367+ ggtt_get_host_entry(vgpu->gtt.ggtt_mm, &old_entry, index);
2368+ ggtt_invalidate_pte(vgpu, &old_entry);
2369+ }
23382370 ggtt_set_host_entry(vgpu->gtt.ggtt_mm, &entry, index++);
2371+ }
23392372
23402373 index = vgpu_hidden_gmadr_base(vgpu) >> PAGE_SHIFT;
23412374 num_entries = vgpu_hidden_sz(vgpu) >> PAGE_SHIFT;
2342− while (num_entries--)
2375+ while (num_entries--) {
2376+ if (invalidate_old) {
2377+ ggtt_get_host_entry(vgpu->gtt.ggtt_mm, &old_entry, index);
2378+ ggtt_invalidate_pte(vgpu, &old_entry);
2379+ }
23432380 ggtt_set_host_entry(vgpu->gtt.ggtt_mm, &entry, index++);
2381+ }
23442382
23452383 ggtt_invalidate(dev_priv);
23462384 }
@@ -2360,5 +2398,5 @@ void intel_vgpu_reset_gtt(struct intel_vgpu *vgpu) · 13 unmodified lines
23602398 * removing the shadow pages.
23612399 */
23622400 intel_vgpu_destroy_all_ppgtt_mm(vgpu);
2363− intel_vgpu_reset_ggtt(vgpu);
2401+ intel_vgpu_reset_ggtt(vgpu, true);
23642402 }
drivers/gpu/drm/i915/gvt/gtt.h+1−1
@@ -193,7 +193,7 @@ struct intel_vgpu_gtt { · 192 unmodified lines
193193
194194 extern int intel_vgpu_init_gtt(struct intel_vgpu *vgpu);
195195 extern void intel_vgpu_clean_gtt(struct intel_vgpu *vgpu);
196−void intel_vgpu_reset_ggtt(struct intel_vgpu *vgpu);
196+void intel_vgpu_reset_ggtt(struct intel_vgpu *vgpu, bool invalidate_old);
197197 void intel_vgpu_invalidate_ppgtt(struct intel_vgpu *vgpu);
198198
199199 extern int intel_gvt_init_gtt(struct intel_gvt *gvt);
drivers/gpu/drm/i915/gvt/handlers.c+1−0
@@ -1150,6 +1150,7 @@ static int handle_g2v_notification(struct intel_vgpu *vgpu, int notification) · 1149 unmodified lines
11501150 switch (notification) {
11511151 case VGT_G2V_PPGTT_L3_PAGE_TABLE_CREATE:
11521152 root_entry_type = GTT_TYPE_PPGTT_ROOT_L3_ENTRY;
1153+ /* fall through */
11531154 case VGT_G2V_PPGTT_L4_PAGE_TABLE_CREATE:
11541155 mm = intel_vgpu_get_ppgtt_mm(vgpu, root_entry_type, pdps);
11551156 return PTR_ERR_OR_ZERO(mm);
drivers/gpu/drm/i915/gvt/kvmgt.c+1−1
@@ -1301,7 +1301,7 @@ static long intel_vgpu_ioctl(struct mdev_device *mdev, unsigned int cmd, · 1300 unmodified lines
13011301
13021302 }
13031303
1304− return 0;
1304+ return -ENOTTY;
13051305 }
13061306
13071307 static ssize_t
drivers/gpu/drm/i915/i915_drv.c+15−12
@@ -1105,30 +1105,32 @@ static int i915_driver_init_hw(struct drm_i915_private *dev_priv) · 1104 unmodified lines
11051105
11061106 ret = i915_ggtt_probe_hw(dev_priv);
11071107 if (ret)
1108− return ret;
1108+ goto err_perf;
11091109
1110− /* WARNING: Apparently we must kick fbdev drivers before vgacon,
1111− * otherwise the vga fbdev driver falls over. */
1110+ /*
1111+ * WARNING: Apparently we must kick fbdev drivers before vgacon,
1112+ * otherwise the vga fbdev driver falls over.
1113+ */
11121114 ret = i915_kick_out_firmware_fb(dev_priv);
11131115 if (ret) {
11141116 DRM_ERROR("failed to remove conflicting framebuffer drivers\n");
1115− goto out_ggtt;
1117+ goto err_ggtt;
11161118 }
11171119
11181120 ret = i915_kick_out_vgacon(dev_priv);
11191121 if (ret) {
11201122 DRM_ERROR("failed to remove conflicting VGA console\n");
1121− goto out_ggtt;
1123+ goto err_ggtt;
11221124 }
11231125
11241126 ret = i915_ggtt_init_hw(dev_priv);
11251127 if (ret)
1126− return ret;
1128+ goto err_ggtt;
11271129
11281130 ret = i915_ggtt_enable_hw(dev_priv);
11291131 if (ret) {
11301132 DRM_ERROR("failed to enable GGTT\n");
1131− goto out_ggtt;
1133+ goto err_ggtt;
11321134 }
11331135
11341136 pci_set_master(pdev);
@@ -1139,7 +1141,7 @@ static int i915_driver_init_hw(struct drm_i915_private *dev_priv) · 4 unmodified lines
11391141 if (ret) {
11401142 DRM_ERROR("failed to set DMA mask\n");
11411143
1142− goto out_ggtt;
1144+ goto err_ggtt;
11431145 }
11441146 }
11451147
@@ -1157,7 +1159,7 @@ static int i915_driver_init_hw(struct drm_i915_private *dev_priv) · 11 unmodified lines
11571159 if (ret) {
11581160 DRM_ERROR("failed to set DMA mask\n");
11591161
1160− goto out_ggtt;
1162+ goto err_ggtt;
11611163 }
11621164 }
11631165
@@ -1190,13 +1192,14 @@ static int i915_driver_init_hw(struct drm_i915_private *dev_priv) · 26 unmodified lines
11901192
11911193 ret = intel_gvt_init(dev_priv);
11921194 if (ret)
1193− goto out_ggtt;
1195+ goto err_ggtt;
11941196
11951197 return 0;
11961198
1197−out_ggtt:
1199+err_ggtt:
11981200 i915_ggtt_cleanup_hw(dev_priv);
1199−
1201+err_perf:
1202+ i915_perf_fini(dev_priv);
12001203 return ret;
12011204 }
12021205
drivers/gpu/drm/i915/i915_gem_execbuffer.c+1−1
@@ -728,7 +728,7 @@ static int eb_lookup_vmas(struct i915_execbuffer *eb) · 727 unmodified lines
728728
729729 err = radix_tree_insert(handles_vma, handle, vma);
730730 if (unlikely(err)) {
731− kfree(lut);
731+ kmem_cache_free(eb->i915->luts, lut);
732732 goto err_obj;
733733 }
734734
drivers/gpu/drm/i915/i915_pmu.c+27−10
@@ -473,20 +473,37 @@ static u64 get_rc6(struct drm_i915_private *i915) · 472 unmodified lines
473473 spin_lock_irqsave(&i915->pmu.lock, flags);
474474 spin_lock(&kdev->power.lock);
475475
476− if (!i915->pmu.sample[__I915_SAMPLE_RC6_ESTIMATED].cur)
477− i915->pmu.suspended_jiffies_last =
478− kdev->power.suspended_jiffies;
476+ /*
477+ * After the above branch intel_runtime_pm_get_if_in_use failed
478+ * to get the runtime PM reference we cannot assume we are in
479+ * runtime suspend since we can either: a) race with coming out
480+ * of it before we took the power.lock, or b) there are other
481+ * states than suspended which can bring us here.
482+ *
483+ * We need to double-check that we are indeed currently runtime
484+ * suspended and if not we cannot do better than report the last
485+ * known RC6 value.
486+ */
487+ if (kdev->power.runtime_status == RPM_SUSPENDED) {
488+ if (!i915->pmu.sample[__I915_SAMPLE_RC6_ESTIMATED].cur)
489+ i915->pmu.suspended_jiffies_last =
490+ kdev->power.suspended_jiffies;
479491
480− val = kdev->power.suspended_jiffies -
481− i915->pmu.suspended_jiffies_last;
482− val += jiffies - kdev->power.accounting_timestamp;
492+ val = kdev->power.suspended_jiffies -
493+ i915->pmu.suspended_jiffies_last;
494+ val += jiffies - kdev->power.accounting_timestamp;
483495
484− spin_unlock(&kdev->power.lock);
496+ val = jiffies_to_nsecs(val);
497+ val += i915->pmu.sample[__I915_SAMPLE_RC6].cur;
485498
486− val = jiffies_to_nsecs(val);
487− val += i915->pmu.sample[__I915_SAMPLE_RC6].cur;
488− i915->pmu.sample[__I915_SAMPLE_RC6_ESTIMATED].cur = val;
499+ i915->pmu.sample[__I915_SAMPLE_RC6_ESTIMATED].cur = val;
500+ } else if (i915->pmu.sample[__I915_SAMPLE_RC6_ESTIMATED].cur) {
501+ val = i915->pmu.sample[__I915_SAMPLE_RC6_ESTIMATED].cur;
502+ } else {
503+ val = i915->pmu.sample[__I915_SAMPLE_RC6].cur;
504+ }
489505
506+ spin_unlock(&kdev->power.lock);
490507 spin_unlock_irqrestore(&i915->pmu.lock, flags);
491508 }
492509
drivers/gpu/drm/i915/intel_audio.c+1−1
@@ -729,7 +729,7 @@ static void i915_audio_component_codec_wake_override(struct device *kdev, · 728 unmodified lines
729729 struct drm_i915_private *dev_priv = kdev_to_i915(kdev);
730730 u32 tmp;
731731
732− if (!IS_GEN9_BC(dev_priv))
732+ if (!IS_GEN9(dev_priv))
733733 return;
734734
735735 i915_audio_component_get_power(kdev);
drivers/gpu/drm/i915/intel_bios.c+9−4
@@ -1256,7 +1256,6 @@ static void parse_ddi_port(struct drm_i915_private *dev_priv, enum port port, · 1255 unmodified lines
12561256 return;
12571257
12581258 aux_channel = child->aux_channel;
1259− ddc_pin = child->ddc_pin;
12601259
12611260 is_dvi = child->device_type & DEVICE_TYPE_TMDS_DVI_SIGNALING;
12621261 is_dp = child->device_type & DEVICE_TYPE_DISPLAYPORT_OUTPUT;
@@ -1303,9 +1302,15 @@ static void parse_ddi_port(struct drm_i915_private *dev_priv, enum port port, · 40 unmodified lines
13031302 DRM_DEBUG_KMS("Port %c is internal DP\n", port_name(port));
13041303
13051304 if (is_dvi) {
1306− info->alternate_ddc_pin = map_ddc_pin(dev_priv, ddc_pin);
1307−
1308− sanitize_ddc_pin(dev_priv, port);
1305+ ddc_pin = map_ddc_pin(dev_priv, child->ddc_pin);
1306+ if (intel_gmbus_is_valid_pin(dev_priv, ddc_pin)) {
1307+ info->alternate_ddc_pin = ddc_pin;
1308+ sanitize_ddc_pin(dev_priv, port);
1309+ } else {
1310+ DRM_DEBUG_KMS("Port %c has invalid DDC pin %d, "
1311+ "sticking to defaults\n",
1312+ port_name(port), ddc_pin);
1313+ }
13091314 }
13101315
13111316 if (is_dp) {
drivers/gpu/drm/i915/intel_cdclk.c+14−2
@@ -2140,10 +2140,22 @@ int intel_crtc_compute_min_cdclk(const struct intel_crtc_state *crtc_state) · 2139 unmodified lines
21402140 }
21412141 }
21422142
2143− /* According to BSpec, "The CD clock frequency must be at least twice
2143+ /*
2144+ * According to BSpec, "The CD clock frequency must be at least twice
21442145 * the frequency of the Azalia BCLK." and BCLK is 96 MHz by default.
2146+ *
2147+ * FIXME: Check the actual, not default, BCLK being used.
2148+ *
2149+ * FIXME: This does not depend on ->has_audio because the higher CDCLK
2150+ * is required for audio probe, also when there are no audio capable
2151+ * displays connected at probe time. This leads to unnecessarily high
2152+ * CDCLK when audio is not required.
2153+ *
2154+ * FIXME: This limit is only applied when there are displays connected
2155+ * at probe time. If we probe without displays, we'll still end up using
2156+ * the platform minimum CDCLK, failing audio probe.
21452157 */
2146− if (crtc_state->has_audio && INTEL_GEN(dev_priv) >= 9)
2158+ if (INTEL_GEN(dev_priv) >= 9)
21472159 min_cdclk = max(2 * 96000, min_cdclk);
21482160
21492161 /*
drivers/gpu/drm/i915/intel_csr.c+1−0
@@ -35,6 +35,7 @@ · 34 unmodified lines
3535 */
3636
3737 #define I915_CSR_GLK "i915/glk_dmc_ver1_04.bin"
38+MODULE_FIRMWARE(I915_CSR_GLK);
3839 #define GLK_CSR_VERSION_REQUIRED CSR_VERSION(1, 4)
3940
4041 #define I915_CSR_CNL "i915/cnl_dmc_ver1_07.bin"
drivers/gpu/drm/i915/intel_drv.h+2−2
@@ -49,12 +49,12 @@ · 48 unmodified lines
4949 * check the condition before the timeout.
5050 */
5151 #define __wait_for(OP, COND, US, Wmin, Wmax) ({ \
52− unsigned long timeout__ = jiffies + usecs_to_jiffies(US) + 1; \
52+ const ktime_t end__ = ktime_add_ns(ktime_get_raw(), 1000ll * (US)); \
5353 long wait__ = (Wmin); /* recommended min for usleep is 10 us */ \
5454 int ret__; \
5555 might_sleep(); \
5656 for (;;) { \
57− bool expired__ = time_after(jiffies, timeout__); \
57+ const bool expired__ = ktime_after(ktime_get_raw(), end__); \
5858 OP; \
5959 if (COND) { \
6060 ret__ = 0; \
drivers/gpu/drm/i915/intel_fbdev.c+1−1
@@ -806,7 +806,7 @@ void intel_fbdev_output_poll_changed(struct drm_device *dev) · 805 unmodified lines
806806 return;
807807
808808 intel_fbdev_sync(ifbdev);
809− if (ifbdev->vma)
809+ if (ifbdev->vma || ifbdev->helper.deferred_setup)
810810 drm_fb_helper_hotplug_event(&ifbdev->helper);
811811 }
812812
drivers/gpu/drm/i915/intel_lrc.c+9−0
@@ -577,6 +577,8 @@ static void execlists_dequeue(struct intel_engine_cs *engine) · 576 unmodified lines
577577 * know the next preemption status we see corresponds
578578 * to this ELSP update.
579579 */
580+ GEM_BUG_ON(!execlists_is_active(execlists,
581+ EXECLISTS_ACTIVE_USER));
580582 GEM_BUG_ON(!port_count(&port[0]));
581583 if (port_count(&port[0]) > 1)
582584 goto unlock;
@@ -738,6 +740,8 @@ execlists_cancel_port_requests(struct intel_engine_execlists * const execlists) · 155 unmodified lines
738740 memset(port, 0, sizeof(*port));
739741 port++;
740742 }
743+
744+ execlists_clear_active(execlists, EXECLISTS_ACTIVE_USER);
741745 }
742746
743747 static void execlists_cancel_requests(struct intel_engine_cs *engine)
@@ -1001,6 +1005,11 @@ static void execlists_submission_tasklet(unsigned long data) · 257 unmodified lines
10011005
10021006 if (fw)
10031007 intel_uncore_forcewake_put(dev_priv, execlists->fw_domains);
1008+
1009+ /* If the engine is now idle, so should be the flag; and vice versa. */
1010+ GEM_BUG_ON(execlists_is_active(&engine->execlists,
1011+ EXECLISTS_ACTIVE_USER) ==
1012+ !port_isset(engine->execlists.port));
10041013 }
10051014
10061015 static void queue_request(struct intel_engine_cs *engine,
drivers/gpu/drm/i915/intel_runtime_pm.c+5−6
@@ -641,19 +641,18 @@ void skl_enable_dc6(struct drm_i915_private *dev_priv) · 640 unmodified lines
641641
642642 DRM_DEBUG_KMS("Enabling DC6\n");
643643
644− gen9_set_dc_state(dev_priv, DC_STATE_EN_UPTO_DC6);
644+ /* Wa Display #1183: skl,kbl,cfl */
645+ if (IS_GEN9_BC(dev_priv))
646+ I915_WRITE(GEN8_CHICKEN_DCPR_1, I915_READ(GEN8_CHICKEN_DCPR_1) |
647+ SKL_SELECT_ALTERNATE_DC_EXIT);
645648
649+ gen9_set_dc_state(dev_priv, DC_STATE_EN_UPTO_DC6);
646650 }
647651
648652 void skl_disable_dc6(struct drm_i915_private *dev_priv)
649653 {
650654 DRM_DEBUG_KMS("Disabling DC6\n");
651655
652− /* Wa Display #1183: skl,kbl,cfl */
653− if (IS_GEN9_BC(dev_priv))
654− I915_WRITE(GEN8_CHICKEN_DCPR_1, I915_READ(GEN8_CHICKEN_DCPR_1) |
655− SKL_SELECT_ALTERNATE_DC_EXIT);
656−
657656 gen9_set_dc_state(dev_priv, DC_STATE_DISABLE);
658657 }
659658
drivers/gpu/drm/msm/disp/mdp4/mdp4_crtc.c+1−0
@@ -351,6 +351,7 @@ static void mdp4_crtc_atomic_flush(struct drm_crtc *crtc, · 350 unmodified lines
351351
352352 spin_lock_irqsave(&dev->event_lock, flags);
353353 mdp4_crtc->event = crtc->state->event;
354+ crtc->state->event = NULL;
354355 spin_unlock_irqrestore(&dev->event_lock, flags);
355356
356357 blend_setup(crtc);
drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c+1−0
@@ -708,6 +708,7 @@ static void mdp5_crtc_atomic_flush(struct drm_crtc *crtc, · 707 unmodified lines
708708
709709 spin_lock_irqsave(&dev->event_lock, flags);
710710 mdp5_crtc->event = crtc->state->event;
711+ crtc->state->event = NULL;
711712 spin_unlock_irqrestore(&dev->event_lock, flags);
712713
713714 /*
drivers/gpu/drm/msm/disp/mdp_format.c+2−1
@@ -171,7 +171,8 @@ uint32_t mdp_get_formats(uint32_t *pixel_formats, uint32_t max_formats, · 170 unmodified lines
171171 return i;
172172 }
173173
174−const struct msm_format *mdp_get_format(struct msm_kms *kms, uint32_t format)
174+const struct msm_format *mdp_get_format(struct msm_kms *kms, uint32_t format,
175+ uint64_t modifier)
175176 {
176177 int i;
177178 for (i = 0; i < ARRAY_SIZE(formats); i++) {
drivers/gpu/drm/msm/disp/mdp_kms.h+1−1
@@ -98,7 +98,7 @@ struct mdp_format { · 97 unmodified lines
9898 #define MDP_FORMAT_IS_YUV(mdp_format) ((mdp_format)->is_yuv)
9999
100100 uint32_t mdp_get_formats(uint32_t *formats, uint32_t max_formats, bool rgb_only);
101−const struct msm_format *mdp_get_format(struct msm_kms *kms, uint32_t format);
101+const struct msm_format *mdp_get_format(struct msm_kms *kms, uint32_t format, uint64_t modifier);
102102
103103 /* MDP capabilities */
104104 #define MDP_CAP_SMP BIT(0) /* Shared Memory Pool */
drivers/gpu/drm/msm/dsi/dsi_host.c+12−4
@@ -173,6 +173,7 @@ struct msm_dsi_host { · 172 unmodified lines
173173
174174 bool registered;
175175 bool power_on;
176+ bool enabled;
176177 int irq;
177178 };
178179
@@ -775,7 +776,7 @@ static inline enum dsi_cmd_dst_format dsi_get_cmd_fmt( · 596 unmodified lines
775776 switch (mipi_fmt) {
776777 case MIPI_DSI_FMT_RGB888: return CMD_DST_FORMAT_RGB888;
777778 case MIPI_DSI_FMT_RGB666_PACKED:
778− case MIPI_DSI_FMT_RGB666: return VID_DST_FORMAT_RGB666;
779+ case MIPI_DSI_FMT_RGB666: return CMD_DST_FORMAT_RGB666;
779780 case MIPI_DSI_FMT_RGB565: return CMD_DST_FORMAT_RGB565;
780781 default: return CMD_DST_FORMAT_RGB888;
781782 }
@@ -986,13 +987,19 @@ static void dsi_set_tx_power_mode(int mode, struct msm_dsi_host *msm_host) · 204 unmodified lines
986987
987988 static void dsi_wait4video_done(struct msm_dsi_host *msm_host)
988989 {
990+ u32 ret = 0;
991+ struct device *dev = &msm_host->pdev->dev;
992+
989993 dsi_intr_ctrl(msm_host, DSI_IRQ_MASK_VIDEO_DONE, 1);
990994
991995 reinit_completion(&msm_host->video_comp);
992996
993− wait_for_completion_timeout(&msm_host->video_comp,
997+ ret = wait_for_completion_timeout(&msm_host->video_comp,
994998 msecs_to_jiffies(70));
995999
1000+ if (ret <= 0)
1001+ dev_err(dev, "wait for video done timed out\n");
1002+
9961003 dsi_intr_ctrl(msm_host, DSI_IRQ_MASK_VIDEO_DONE, 0);
9971004 }
9981005
@@ -1001,7 +1008,7 @@ static void dsi_wait4video_eng_busy(struct msm_dsi_host *msm_host) · 2 unmodified lines
10011008 if (!(msm_host->mode_flags & MIPI_DSI_MODE_VIDEO))
10021009 return;
10031010
1004− if (msm_host->power_on) {
1011+ if (msm_host->power_on && msm_host->enabled) {
10051012 dsi_wait4video_done(msm_host);
10061013 /* delay 4 ms to skip BLLP */
10071014 usleep_range(2000, 4000);
@@ -2203,7 +2210,7 @@ int msm_dsi_host_enable(struct mipi_dsi_host *host) · 1195 unmodified lines
22032210 * pm_runtime_put_autosuspend(&msm_host->pdev->dev);
22042211 * }
22052212 */
2206−
2213+ msm_host->enabled = true;
22072214 return 0;
22082215 }
22092216
@@ -2211,6 +2218,7 @@ int msm_dsi_host_disable(struct mipi_dsi_host *host) · 1 unmodified line
22112218 {
22122219 struct msm_dsi_host *msm_host = to_msm_dsi_host(host);
22132220
2221+ msm_host->enabled = false;
22142222 dsi_op_mode_config(msm_host,
22152223 !!(msm_host->mode_flags & MIPI_DSI_MODE_VIDEO), false);
22162224
drivers/gpu/drm/msm/dsi/phy/dsi_phy.c+109−0
@@ -265,6 +265,115 @@ int msm_dsi_dphy_timing_calc_v2(struct msm_dsi_dphy_timing *timing, · 264 unmodified lines
265265 return 0;
266266 }
267267
268+int msm_dsi_dphy_timing_calc_v3(struct msm_dsi_dphy_timing *timing,
269+ struct msm_dsi_phy_clk_request *clk_req)
270+{
271+ const unsigned long bit_rate = clk_req->bitclk_rate;
272+ const unsigned long esc_rate = clk_req->escclk_rate;
273+ s32 ui, ui_x8, lpx;
274+ s32 tmax, tmin;
275+ s32 pcnt0 = 50;
276+ s32 pcnt1 = 50;
277+ s32 pcnt2 = 10;
278+ s32 pcnt3 = 30;
279+ s32 pcnt4 = 10;
280+ s32 pcnt5 = 2;
281+ s32 coeff = 1000; /* Precision, should avoid overflow */
282+ s32 hb_en, hb_en_ckln;
283+ s32 temp;
284+
285+ if (!bit_rate || !esc_rate)
286+ return -EINVAL;
287+
288+ timing->hs_halfbyte_en = 0;
289+ hb_en = 0;
290+ timing->hs_halfbyte_en_ckln = 0;
291+ hb_en_ckln = 0;
292+
293+ ui = mult_frac(NSEC_PER_MSEC, coeff, bit_rate / 1000);
294+ ui_x8 = ui << 3;
295+ lpx = mult_frac(NSEC_PER_MSEC, coeff, esc_rate / 1000);
296+
297+ temp = S_DIV_ROUND_UP(38 * coeff, ui_x8);
298+ tmin = max_t(s32, temp, 0);
299+ temp = (95 * coeff) / ui_x8;
300+ tmax = max_t(s32, temp, 0);
301+ timing->clk_prepare = linear_inter(tmax, tmin, pcnt0, 0, false);
302+
303+ temp = 300 * coeff - (timing->clk_prepare << 3) * ui;
304+ tmin = S_DIV_ROUND_UP(temp, ui_x8) - 1;
305+ tmax = (tmin > 255) ? 511 : 255;
306+ timing->clk_zero = linear_inter(tmax, tmin, pcnt5, 0, false);
307+
308+ tmin = DIV_ROUND_UP(60 * coeff + 3 * ui, ui_x8);
309+ temp = 105 * coeff + 12 * ui - 20 * coeff;
310+ tmax = (temp + 3 * ui) / ui_x8;
311+ timing->clk_trail = linear_inter(tmax, tmin, pcnt3, 0, false);
312+
313+ temp = S_DIV_ROUND_UP(40 * coeff + 4 * ui, ui_x8);
314+ tmin = max_t(s32, temp, 0);
315+ temp = (85 * coeff + 6 * ui) / ui_x8;
316+ tmax = max_t(s32, temp, 0);
317+ timing->hs_prepare = linear_inter(tmax, tmin, pcnt1, 0, false);
318+
319+ temp = 145 * coeff + 10 * ui - (timing->hs_prepare << 3) * ui;
320+ tmin = S_DIV_ROUND_UP(temp, ui_x8) - 1;
321+ tmax = 255;
322+ timing->hs_zero = linear_inter(tmax, tmin, pcnt4, 0, false);
323+
324+ tmin = DIV_ROUND_UP(60 * coeff + 4 * ui, ui_x8) - 1;
325+ temp = 105 * coeff + 12 * ui - 20 * coeff;
326+ tmax = (temp / ui_x8) - 1;
327+ timing->hs_trail = linear_inter(tmax, tmin, pcnt3, 0, false);
328+
329+ temp = 50 * coeff + ((hb_en << 2) - 8) * ui;
330+ timing->hs_rqst = S_DIV_ROUND_UP(temp, ui_x8);
331+
332+ tmin = DIV_ROUND_UP(100 * coeff, ui_x8) - 1;
333+ tmax = 255;
334+ timing->hs_exit = linear_inter(tmax, tmin, pcnt2, 0, false);
335+
336+ temp = 50 * coeff + ((hb_en_ckln << 2) - 8) * ui;
337+ timing->hs_rqst_ckln = S_DIV_ROUND_UP(temp, ui_x8);
338+
339+ temp = 60 * coeff + 52 * ui - 43 * ui;
340+ tmin = DIV_ROUND_UP(temp, ui_x8) - 1;
341+ tmax = 63;
342+ timing->shared_timings.clk_post =
343+ linear_inter(tmax, tmin, pcnt2, 0, false);
344+
345+ temp = 8 * ui + (timing->clk_prepare << 3) * ui;
346+ temp += (((timing->clk_zero + 3) << 3) + 11) * ui;
347+ temp += hb_en_ckln ? (((timing->hs_rqst_ckln << 3) + 4) * ui) :
348+ (((timing->hs_rqst_ckln << 3) + 8) * ui);
349+ tmin = S_DIV_ROUND_UP(temp, ui_x8) - 1;
350+ tmax = 63;
351+ if (tmin > tmax) {
352+ temp = linear_inter(tmax << 1, tmin, pcnt2, 0, false);
353+ timing->shared_timings.clk_pre = temp >> 1;
354+ timing->shared_timings.clk_pre_inc_by_2 = 1;
355+ } else {
356+ timing->shared_timings.clk_pre =
357+ linear_inter(tmax, tmin, pcnt2, 0, false);
358+ timing->shared_timings.clk_pre_inc_by_2 = 0;
359+ }
360+
361+ timing->ta_go = 3;
362+ timing->ta_sure = 0;
363+ timing->ta_get = 4;
364+
365+ DBG("%d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d",
366+ timing->shared_timings.clk_pre, timing->shared_timings.clk_post,
367+ timing->shared_timings.clk_pre_inc_by_2, timing->clk_zero,
368+ timing->clk_trail, timing->clk_prepare, timing->hs_exit,
369+ timing->hs_zero, timing->hs_prepare, timing->hs_trail,
370+ timing->hs_rqst, timing->hs_rqst_ckln, timing->hs_halfbyte_en,
371+ timing->hs_halfbyte_en_ckln, timing->hs_prep_dly,
372+ timing->hs_prep_dly_ckln);
373+
374+ return 0;
375+}
376+
268377 void msm_dsi_phy_set_src_pll(struct msm_dsi_phy *phy, int pll_id, u32 reg,
269378 u32 bit_mask)
270379 {
drivers/gpu/drm/msm/dsi/phy/dsi_phy.h+2−0
@@ -101,6 +101,8 @@ int msm_dsi_dphy_timing_calc(struct msm_dsi_dphy_timing *timing, · 100 unmodified lines
101101 struct msm_dsi_phy_clk_request *clk_req);
102102 int msm_dsi_dphy_timing_calc_v2(struct msm_dsi_dphy_timing *timing,
103103 struct msm_dsi_phy_clk_request *clk_req);
104+int msm_dsi_dphy_timing_calc_v3(struct msm_dsi_dphy_timing *timing,
105+ struct msm_dsi_phy_clk_request *clk_req);
104106 void msm_dsi_phy_set_src_pll(struct msm_dsi_phy *phy, int pll_id, u32 reg,
105107 u32 bit_mask);
106108 int msm_dsi_phy_init_common(struct msm_dsi_phy *phy);
drivers/gpu/drm/msm/dsi/phy/dsi_phy_10nm.c+0−28
@@ -79,34 +79,6 @@ static void dsi_phy_hw_v3_0_lane_settings(struct msm_dsi_phy *phy) · 78 unmodified lines
7979 dsi_phy_write(lane_base + REG_DSI_10nm_PHY_LN_TX_DCTRL(3), 0x04);
8080 }
8181
82−static int msm_dsi_dphy_timing_calc_v3(struct msm_dsi_dphy_timing *timing,
83− struct msm_dsi_phy_clk_request *clk_req)
84−{
85− /*
86− * TODO: These params need to be computed, they're currently hardcoded
87− * for a 1440x2560@60Hz panel with a byteclk of 100.618 Mhz, and a
88− * default escape clock of 19.2 Mhz.
89− */
90−
91− timing->hs_halfbyte_en = 0;
92− timing->clk_zero = 0x1c;
93− timing->clk_prepare = 0x07;
94− timing->clk_trail = 0x07;
95− timing->hs_exit = 0x23;
96− timing->hs_zero = 0x21;
97− timing->hs_prepare = 0x07;
98− timing->hs_trail = 0x07;
99− timing->hs_rqst = 0x05;
100− timing->ta_sure = 0x00;
101− timing->ta_go = 0x03;
102− timing->ta_get = 0x04;
103−
104− timing->shared_timings.clk_pre = 0x2d;
105− timing->shared_timings.clk_post = 0x0d;
106−
107− return 0;
108−}
109−
11082 static int dsi_10nm_phy_enable(struct msm_dsi_phy *phy, int src_pll_id,
11183 struct msm_dsi_phy_clk_request *clk_req)
11284 {
drivers/gpu/drm/msm/msm_fb.c+2−1
@@ -183,7 +183,8 @@ static struct drm_framebuffer *msm_framebuffer_init(struct drm_device *dev, · 182 unmodified lines
183183 hsub = drm_format_horz_chroma_subsampling(mode_cmd->pixel_format);
184184 vsub = drm_format_vert_chroma_subsampling(mode_cmd->pixel_format);
185185
186− format = kms->funcs->get_format(kms, mode_cmd->pixel_format);
186+ format = kms->funcs->get_format(kms, mode_cmd->pixel_format,
187+ mode_cmd->modifier[0]);
187188 if (!format) {
188189 dev_err(dev->dev, "unsupported pixel format: %4.4s\n",
189190 (char *)&mode_cmd->pixel_format);
drivers/gpu/drm/msm/msm_fbdev.c+2−9
@@ -92,8 +92,7 @@ static int msm_fbdev_create(struct drm_fb_helper *helper, · 91 unmodified lines
9292
9393 if (IS_ERR(fb)) {
9494 dev_err(dev->dev, "failed to allocate fb\n");
95− ret = PTR_ERR(fb);
96− goto fail;
95+ return PTR_ERR(fb);
9796 }
9897
9998 bo = msm_framebuffer_bo(fb, 0);
@@ -151,13 +150,7 @@ static int msm_fbdev_create(struct drm_fb_helper *helper, · 51 unmodified lines
151150
152151 fail_unlock:
153152 mutex_unlock(&dev->struct_mutex);
154−fail:
155−
156− if (ret) {
157− if (fb)
158− drm_framebuffer_remove(fb);
159− }
160−
153+ drm_framebuffer_remove(fb);
161154 return ret;
162155 }
163156
drivers/gpu/drm/msm/msm_gem.c+11−9
@@ -132,17 +132,19 @@ static void put_pages(struct drm_gem_object *obj) · 131 unmodified lines
132132 struct msm_gem_object *msm_obj = to_msm_bo(obj);
133133
134134 if (msm_obj->pages) {
135− /* For non-cached buffers, ensure the new pages are clean
136− * because display controller, GPU, etc. are not coherent:
137− */
138− if (msm_obj->flags & (MSM_BO_WC|MSM_BO_UNCACHED))
139− dma_unmap_sg(obj->dev->dev, msm_obj->sgt->sgl,
140− msm_obj->sgt->nents, DMA_BIDIRECTIONAL);
135+ if (msm_obj->sgt) {
136+ /* For non-cached buffers, ensure the new
137+ * pages are clean because display controller,
138+ * GPU, etc. are not coherent:
139+ */
140+ if (msm_obj->flags & (MSM_BO_WC|MSM_BO_UNCACHED))
141+ dma_unmap_sg(obj->dev->dev, msm_obj->sgt->sgl,
142+ msm_obj->sgt->nents,
143+ DMA_BIDIRECTIONAL);
141144
142− if (msm_obj->sgt)
143145 sg_free_table(msm_obj->sgt);
144−
145− kfree(msm_obj->sgt);
146+ kfree(msm_obj->sgt);
147+ }
146148
147149 if (use_pages(obj))
148150 drm_gem_put_pages(obj, msm_obj->pages, true, false);
drivers/gpu/drm/msm/msm_kms.h+4−1
@@ -48,8 +48,11 @@ struct msm_kms_funcs { · 47 unmodified lines
4848 /* functions to wait for atomic commit completed on each CRTC */
4949 void (*wait_for_crtc_commit_done)(struct msm_kms *kms,
5050 struct drm_crtc *crtc);
51+ /* get msm_format w/ optional format modifiers from drm_mode_fb_cmd2 */
52+ const struct msm_format *(*get_format)(struct msm_kms *kms,
53+ const uint32_t format,
54+ const uint64_t modifiers);
5155 /* misc: */
52− const struct msm_format *(*get_format)(struct msm_kms *kms, uint32_t format);
5356 long (*round_pixclk)(struct msm_kms *kms, unsigned long rate,
5457 struct drm_encoder *encoder);
5558 int (*set_split_display)(struct msm_kms *kms,
drivers/gpu/drm/qxl/qxl_cmd.c+2−4
@@ -179,10 +179,9 @@ qxl_push_command_ring_release(struct qxl_device *qdev, struct qxl_release *relea · 178 unmodified lines
179179 uint32_t type, bool interruptible)
180180 {
181181 struct qxl_command cmd;
182− struct qxl_bo_list *entry = list_first_entry(&release->bos, struct qxl_bo_list, tv.head);
183182
184183 cmd.type = type;
185− cmd.data = qxl_bo_physical_address(qdev, to_qxl_bo(entry->tv.bo), release->release_offset);
184+ cmd.data = qxl_bo_physical_address(qdev, release->release_bo, release->release_offset);
186185
187186 return qxl_ring_push(qdev->command_ring, &cmd, interruptible);
188187 }
@@ -192,10 +191,9 @@ qxl_push_cursor_ring_release(struct qxl_device *qdev, struct qxl_release *releas · 3 unmodified lines
192191 uint32_t type, bool interruptible)
193192 {
194193 struct qxl_command cmd;
195− struct qxl_bo_list *entry = list_first_entry(&release->bos, struct qxl_bo_list, tv.head);
196194
197195 cmd.type = type;
198− cmd.data = qxl_bo_physical_address(qdev, to_qxl_bo(entry->tv.bo), release->release_offset);
196+ cmd.data = qxl_bo_physical_address(qdev, release->release_bo, release->release_offset);
199197
200198 return qxl_ring_push(qdev->cursor_ring, &cmd, interruptible);
201199 }
drivers/gpu/drm/qxl/qxl_drv.h+1−0
@@ -167,6 +167,7 @@ struct qxl_release { · 166 unmodified lines
167167
168168 int id;
169169 int type;
170+ struct qxl_bo *release_bo;
170171 uint32_t release_offset;
171172 uint32_t surface_release_id;
172173 struct ww_acquire_ctx ticket;
drivers/gpu/drm/qxl/qxl_ioctl.c+2−2
@@ -182,9 +182,9 @@ static int qxl_process_single_command(struct qxl_device *qdev, · 181 unmodified lines
182182 goto out_free_reloc;
183183
184184 /* TODO copy slow path code from i915 */
185− fb_cmd = qxl_bo_kmap_atomic_page(qdev, cmd_bo, (release->release_offset & PAGE_SIZE));
185+ fb_cmd = qxl_bo_kmap_atomic_page(qdev, cmd_bo, (release->release_offset & PAGE_MASK));
186186 unwritten = __copy_from_user_inatomic_nocache
187− (fb_cmd + sizeof(union qxl_release_info) + (release->release_offset & ~PAGE_SIZE),
187+ (fb_cmd + sizeof(union qxl_release_info) + (release->release_offset & ~PAGE_MASK),
188188 u64_to_user_ptr(cmd->command), cmd->command_size);
189189
190190 {
drivers/gpu/drm/qxl/qxl_release.c+9−9
@@ -173,6 +173,7 @@ qxl_release_free_list(struct qxl_release *release) · 172 unmodified lines
173173 list_del(&entry->tv.head);
174174 kfree(entry);
175175 }
176+ release->release_bo = NULL;
176177 }
177178
178179 void
@@ -296,7 +297,6 @@ int qxl_alloc_surface_release_reserved(struct qxl_device *qdev, · 117 unmodified lines
296297 {
297298 if (surface_cmd_type == QXL_SURFACE_CMD_DESTROY && create_rel) {
298299 int idr_ret;
299− struct qxl_bo_list *entry = list_first_entry(&create_rel->bos, struct qxl_bo_list, tv.head);
300300 struct qxl_bo *bo;
301301 union qxl_release_info *info;
302302
@@ -304,8 +304,9 @@ int qxl_alloc_surface_release_reserved(struct qxl_device *qdev, · 1 unmodified line
304304 idr_ret = qxl_release_alloc(qdev, QXL_RELEASE_SURFACE_CMD, release);
305305 if (idr_ret < 0)
306306 return idr_ret;
307− bo = to_qxl_bo(entry->tv.bo);
307+ bo = create_rel->release_bo;
308308
309+ (*release)->release_bo = bo;
309310 (*release)->release_offset = create_rel->release_offset + 64;
310311
311312 qxl_release_list_add(*release, bo);
@@ -365,6 +366,7 @@ int qxl_alloc_release_reserved(struct qxl_device *qdev, unsigned long size, · 53 unmodified lines
365366
366367 bo = qxl_bo_ref(qdev->current_release_bo[cur_idx]);
367368
369+ (*release)->release_bo = bo;
368370 (*release)->release_offset = qdev->current_release_bo_offset[cur_idx] * release_size_per_bo[cur_idx];
369371 qdev->current_release_bo_offset[cur_idx]++;
370372
@@ -408,13 +410,12 @@ union qxl_release_info *qxl_release_map(struct qxl_device *qdev, · 37 unmodified lines
408410 {
409411 void *ptr;
410412 union qxl_release_info *info;
411− struct qxl_bo_list *entry = list_first_entry(&release->bos, struct qxl_bo_list, tv.head);
412− struct qxl_bo *bo = to_qxl_bo(entry->tv.bo);
413+ struct qxl_bo *bo = release->release_bo;
413414
414− ptr = qxl_bo_kmap_atomic_page(qdev, bo, release->release_offset & PAGE_SIZE);
415+ ptr = qxl_bo_kmap_atomic_page(qdev, bo, release->release_offset & PAGE_MASK);
415416 if (!ptr)
416417 return NULL;
417− info = ptr + (release->release_offset & ~PAGE_SIZE);
418+ info = ptr + (release->release_offset & ~PAGE_MASK);
418419 return info;
419420 }
420421
@@ -422,11 +423,10 @@ void qxl_release_unmap(struct qxl_device *qdev, · 1 unmodified line
422423 struct qxl_release *release,
423424 union qxl_release_info *info)
424425 {
425− struct qxl_bo_list *entry = list_first_entry(&release->bos, struct qxl_bo_list, tv.head);
426− struct qxl_bo *bo = to_qxl_bo(entry->tv.bo);
426+ struct qxl_bo *bo = release->release_bo;
427427 void *ptr;
428428
429− ptr = ((void *)info) - (release->release_offset & ~PAGE_SIZE);
429+ ptr = ((void *)info) - (release->release_offset & ~PAGE_MASK);
430430 qxl_bo_kunmap_atomic_page(qdev, bo, ptr);
431431 }
432432
drivers/gpu/drm/sun4i/sun4i_lvds.c+0−55
@@ -94,64 +94,9 @@ static void sun4i_lvds_encoder_disable(struct drm_encoder *encoder) · 93 unmodified lines
9494 }
9595 }
9696
97−static enum drm_mode_status sun4i_lvds_encoder_mode_valid(struct drm_encoder *crtc,
98− const struct drm_display_mode *mode)
99−{
100− struct sun4i_lvds *lvds = drm_encoder_to_sun4i_lvds(crtc);
101− struct sun4i_tcon *tcon = lvds->tcon;
102− u32 hsync = mode->hsync_end - mode->hsync_start;
103− u32 vsync = mode->vsync_end - mode->vsync_start;
104− unsigned long rate = mode->clock * 1000;
105− long rounded_rate;
106−
107− DRM_DEBUG_DRIVER("Validating modes...\n");
108−
109− if (hsync < 1)
110− return MODE_HSYNC_NARROW;
111−
112− if (hsync > 0x3ff)
113− return MODE_HSYNC_WIDE;
114−
115− if ((mode->hdisplay < 1) || (mode->htotal < 1))
116− return MODE_H_ILLEGAL;
117−
118− if ((mode->hdisplay > 0x7ff) || (mode->htotal > 0xfff))
119− return MODE_BAD_HVALUE;
120−
121− DRM_DEBUG_DRIVER("Horizontal parameters OK\n");
122−
123− if (vsync < 1)
124− return MODE_VSYNC_NARROW;
125−
126− if (vsync > 0x3ff)
127− return MODE_VSYNC_WIDE;
128−
129− if ((mode->vdisplay < 1) || (mode->vtotal < 1))
130− return MODE_V_ILLEGAL;
131−
132− if ((mode->vdisplay > 0x7ff) || (mode->vtotal > 0xfff))
133− return MODE_BAD_VVALUE;
134−
135− DRM_DEBUG_DRIVER("Vertical parameters OK\n");
136−
137− tcon->dclk_min_div = 7;
138− tcon->dclk_max_div = 7;
139− rounded_rate = clk_round_rate(tcon->dclk, rate);
140− if (rounded_rate < rate)
141− return MODE_CLOCK_LOW;
142−
143− if (rounded_rate > rate)
144− return MODE_CLOCK_HIGH;
145−
146− DRM_DEBUG_DRIVER("Clock rate OK\n");
147−
148− return MODE_OK;
149−}
150−
15197 static const struct drm_encoder_helper_funcs sun4i_lvds_enc_helper_funcs = {
15298 .disable = sun4i_lvds_encoder_disable,
15399 .enable = sun4i_lvds_encoder_enable,
154− .mode_valid = sun4i_lvds_encoder_mode_valid,
155100 };
156101
157102 static const struct drm_encoder_funcs sun4i_lvds_enc_funcs = {
drivers/gpu/drm/vc4/vc4_bo.c+2−0
@@ -195,6 +195,7 @@ static void vc4_bo_destroy(struct vc4_bo *bo) · 194 unmodified lines
195195 vc4_bo_set_label(obj, -1);
196196
197197 if (bo->validated_shader) {
198+ kfree(bo->validated_shader->uniform_addr_offsets);
198199 kfree(bo->validated_shader->texture_samples);
199200 kfree(bo->validated_shader);
200201 bo->validated_shader = NULL;
@@ -591,6 +592,7 @@ void vc4_free_object(struct drm_gem_object *gem_bo) · 390 unmodified lines
591592 }
592593
593594 if (bo->validated_shader) {
595+ kfree(bo->validated_shader->uniform_addr_offsets);
594596 kfree(bo->validated_shader->texture_samples);
595597 kfree(bo->validated_shader);
596598 bo->validated_shader = NULL;
drivers/gpu/drm/vc4/vc4_crtc.c+45−1
@@ -760,6 +760,7 @@ static irqreturn_t vc4_crtc_irq_handler(int irq, void *data) · 759 unmodified lines
760760 struct vc4_async_flip_state {
761761 struct drm_crtc *crtc;
762762 struct drm_framebuffer *fb;
763+ struct drm_framebuffer *old_fb;
763764 struct drm_pending_vblank_event *event;
764765
765766 struct vc4_seqno_cb cb;
@@ -789,6 +790,23 @@ vc4_async_page_flip_complete(struct vc4_seqno_cb *cb) · 23 unmodified lines
789790
790791 drm_crtc_vblank_put(crtc);
791792 drm_framebuffer_put(flip_state->fb);
793+
794+ /* Decrement the BO usecnt in order to keep the inc/dec calls balanced
795+ * when the planes are updated through the async update path.
796+ * FIXME: we should move to generic async-page-flip when it's
797+ * available, so that we can get rid of this hand-made cleanup_fb()
798+ * logic.
799+ */
800+ if (flip_state->old_fb) {
801+ struct drm_gem_cma_object *cma_bo;
802+ struct vc4_bo *bo;
803+
804+ cma_bo = drm_fb_cma_get_gem_obj(flip_state->old_fb, 0);
805+ bo = to_vc4_bo(&cma_bo->base);
806+ vc4_bo_dec_usecnt(bo);
807+ drm_framebuffer_put(flip_state->old_fb);
808+ }
809+
792810 kfree(flip_state);
793811
794812 up(&vc4->async_modeset);
@@ -813,9 +831,22 @@ static int vc4_async_page_flip(struct drm_crtc *crtc, · 18 unmodified lines
813831 struct drm_gem_cma_object *cma_bo = drm_fb_cma_get_gem_obj(fb, 0);
814832 struct vc4_bo *bo = to_vc4_bo(&cma_bo->base);
815833
834+ /* Increment the BO usecnt here, so that we never end up with an
835+ * unbalanced number of vc4_bo_{dec,inc}_usecnt() calls when the
836+ * plane is later updated through the non-async path.
837+ * FIXME: we should move to generic async-page-flip when it's
838+ * available, so that we can get rid of this hand-made prepare_fb()
839+ * logic.
840+ */
841+ ret = vc4_bo_inc_usecnt(bo);
842+ if (ret)
843+ return ret;
844+
816845 flip_state = kzalloc(sizeof(*flip_state), GFP_KERNEL);
817− if (!flip_state)
846+ if (!flip_state) {
847+ vc4_bo_dec_usecnt(bo);
818848 return -ENOMEM;
849+ }
819850
820851 drm_framebuffer_get(fb);
821852 flip_state->fb = fb;
@@ -826,10 +857,23 @@ static int vc4_async_page_flip(struct drm_crtc *crtc, · 4 unmodified lines
826857 ret = down_interruptible(&vc4->async_modeset);
827858 if (ret) {
828859 drm_framebuffer_put(fb);
860+ vc4_bo_dec_usecnt(bo);
829861 kfree(flip_state);
830862 return ret;
831863 }
832864
865+ /* Save the current FB before it's replaced by the new one in
866+ * drm_atomic_set_fb_for_plane(). We'll need the old FB in
867+ * vc4_async_page_flip_complete() to decrement the BO usecnt and keep
868+ * it consistent.
869+ * FIXME: we should move to generic async-page-flip when it's
870+ * available, so that we can get rid of this hand-made cleanup_fb()
871+ * logic.
872+ */
873+ flip_state->old_fb = plane->state->fb;
874+ if (flip_state->old_fb)
875+ drm_framebuffer_get(flip_state->old_fb);
876+
833877 WARN_ON(drm_crtc_vblank_get(crtc) != 0);
834878
835879 /* Immediately update the plane's legacy fb pointer, so that later
drivers/gpu/drm/vc4/vc4_validate_shaders.c+1−0
@@ -942,6 +942,7 @@ vc4_validate_shader(struct drm_gem_cma_object *shader_obj) · 941 unmodified lines
942942 fail:
943943 kfree(validation_state.branch_targets);
944944 if (validated_shader) {
945+ kfree(validated_shader->uniform_addr_offsets);
945946 kfree(validated_shader->texture_samples);
946947 kfree(validated_shader);
947948 }
drivers/gpu/drm/virtio/virtgpu_vq.c+2−2
@@ -293,7 +293,7 @@ retry: · 292 unmodified lines
293293 ret = virtqueue_add_sgs(vq, sgs, outcnt, incnt, vbuf, GFP_ATOMIC);
294294 if (ret == -ENOSPC) {
295295 spin_unlock(&vgdev->ctrlq.qlock);
296− wait_event(vgdev->ctrlq.ack_queue, vq->num_free);
296+ wait_event(vgdev->ctrlq.ack_queue, vq->num_free >= outcnt + incnt);
297297 spin_lock(&vgdev->ctrlq.qlock);
298298 goto retry;
299299 } else {
@@ -368,7 +368,7 @@ retry: · 68 unmodified lines
368368 ret = virtqueue_add_sgs(vq, sgs, outcnt, 0, vbuf, GFP_ATOMIC);
369369 if (ret == -ENOSPC) {
370370 spin_unlock(&vgdev->cursorq.qlock);
371− wait_event(vgdev->cursorq.ack_queue, vq->num_free);
371+ wait_event(vgdev->cursorq.ack_queue, vq->num_free >= outcnt);
372372 spin_lock(&vgdev->cursorq.qlock);
373373 goto retry;
374374 } else {
drivers/gpu/drm/vmwgfx/vmwgfx_fb.c+10−21
@@ -441,11 +441,11 @@ static int vmwgfx_set_config_internal(struct drm_mode_set *set) · 440 unmodified lines
441441 struct drm_crtc *crtc = set->crtc;
442442 struct drm_framebuffer *fb;
443443 struct drm_crtc *tmp;
444− struct drm_modeset_acquire_ctx *ctx;
445444 struct drm_device *dev = set->crtc->dev;
445+ struct drm_modeset_acquire_ctx ctx;
446446 int ret;
447447
448− ctx = dev->mode_config.acquire_ctx;
448+ drm_modeset_acquire_init(&ctx, 0);
449449
450450 restart:
451451 /*
@@ -458,7 +458,7 @@ restart: · 6 unmodified lines
458458
459459 fb = set->fb;
460460
461− ret = crtc->funcs->set_config(set, ctx);
461+ ret = crtc->funcs->set_config(set, &ctx);
462462 if (ret == 0) {
463463 crtc->primary->crtc = crtc;
464464 crtc->primary->fb = fb;
@@ -473,20 +473,13 @@ restart: · 8 unmodified lines
473473 }
474474
475475 if (ret == -EDEADLK) {
476− dev->mode_config.acquire_ctx = NULL;
477−
478−retry_locking:
479− drm_modeset_backoff(ctx);
480−
481− ret = drm_modeset_lock_all_ctx(dev, ctx);
482− if (ret)
483− goto retry_locking;
484−
485− dev->mode_config.acquire_ctx = ctx;
486−
476+ drm_modeset_backoff(&ctx);
487477 goto restart;
488478 }
489479
480+ drm_modeset_drop_locks(&ctx);
481+ drm_modeset_acquire_fini(&ctx);
482+
490483 return ret;
491484 }
492485
@@ -624,7 +617,6 @@ static int vmw_fb_set_par(struct fb_info *info) · 131 unmodified lines
624617 }
625618
626619 mutex_lock(&par->bo_mutex);
627− drm_modeset_lock_all(vmw_priv->dev);
628620 ret = vmw_fb_kms_framebuffer(info);
629621 if (ret)
630622 goto out_unlock;
@@ -657,7 +649,6 @@ out_unlock: · 26 unmodified lines
657649 drm_mode_destroy(vmw_priv->dev, old_mode);
658650 par->set_mode = mode;
659651
660− drm_modeset_unlock_all(vmw_priv->dev);
661652 mutex_unlock(&par->bo_mutex);
662653
663654 return ret;
@@ -713,18 +704,14 @@ int vmw_fb_init(struct vmw_private *vmw_priv) · 49 unmodified lines
713704 par->max_width = fb_width;
714705 par->max_height = fb_height;
715706
716− drm_modeset_lock_all(vmw_priv->dev);
717707 ret = vmw_kms_fbdev_init_data(vmw_priv, 0, par->max_width,
718708 par->max_height, &par->con,
719709 &par->crtc, &init_mode);
720− if (ret) {
721− drm_modeset_unlock_all(vmw_priv->dev);
710+ if (ret)
722711 goto err_kms;
723− }
724712
725713 info->var.xres = init_mode->hdisplay;
726714 info->var.yres = init_mode->vdisplay;
727− drm_modeset_unlock_all(vmw_priv->dev);
728715
729716 /*
730717 * Create buffers and alloc memory
@@ -832,7 +819,9 @@ int vmw_fb_close(struct vmw_private *vmw_priv) · 101 unmodified lines
832819 cancel_delayed_work_sync(&par->local_work);
833820 unregister_framebuffer(info);
834821
822+ mutex_lock(&par->bo_mutex);
835823 (void) vmw_fb_kms_detach(par, true, true);
824+ mutex_unlock(&par->bo_mutex);
836825
837826 vfree(par->vmalloc);
838827 framebuffer_release(info);
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c+11−3
@@ -2595,6 +2595,7 @@ void vmw_kms_helper_resource_finish(struct vmw_validation_ctx *ctx, · 2594 unmodified lines
25952595 vmw_kms_helper_buffer_finish(res->dev_priv, NULL, ctx->buf,
25962596 out_fence, NULL);
25972597
2598+ vmw_dmabuf_unreference(&ctx->buf);
25982599 vmw_resource_unreserve(res, false, NULL, 0);
25992600 mutex_unlock(&res->dev_priv->cmdbuf_mutex);
26002601 }
@@ -2680,7 +2681,9 @@ int vmw_kms_fbdev_init_data(struct vmw_private *dev_priv, · 79 unmodified lines
26802681 struct vmw_display_unit *du;
26812682 struct drm_display_mode *mode;
26822683 int i = 0;
2684+ int ret = 0;
26832685
2686+ mutex_lock(&dev_priv->dev->mode_config.mutex);
26842687 list_for_each_entry(con, &dev_priv->dev->mode_config.connector_list,
26852688 head) {
26862689 if (i == unit)
@@ -2691,7 +2694,8 @@ int vmw_kms_fbdev_init_data(struct vmw_private *dev_priv, · 4 unmodified lines
26912694
26922695 if (i != unit) {
26932696 DRM_ERROR("Could not find initial display unit.\n");
2694− return -EINVAL;
2697+ ret = -EINVAL;
2698+ goto out_unlock;
26952699 }
26962700
26972701 if (list_empty(&con->modes))
@@ -2699,7 +2703,8 @@ int vmw_kms_fbdev_init_data(struct vmw_private *dev_priv, · 1 unmodified line
26992703
27002704 if (list_empty(&con->modes)) {
27012705 DRM_ERROR("Could not find initial display mode.\n");
2702− return -EINVAL;
2706+ ret = -EINVAL;
2707+ goto out_unlock;
27032708 }
27042709
27052710 du = vmw_connector_to_du(con);
@@ -2720,7 +2725,10 @@ int vmw_kms_fbdev_init_data(struct vmw_private *dev_priv, · 14 unmodified lines
27202725 head);
27212726 }
27222727
2723− return 0;
2728+ out_unlock:
2729+ mutex_unlock(&dev_priv->dev->mode_config.mutex);
2730+
2731+ return ret;
27242732 }
27252733
27262734 /**
drivers/hid/hid-ids.h+3−0
@@ -525,6 +525,9 @@ · 524 unmodified lines
525525 #define I2C_VENDOR_ID_HANTICK 0x0911
526526 #define I2C_PRODUCT_ID_HANTICK_5288 0x5288
527527
528+#define I2C_VENDOR_ID_RAYD 0x2386
529+#define I2C_PRODUCT_ID_RAYD_3118 0x3118
530+
528531 #define USB_VENDOR_ID_HANWANG 0x0b57
529532 #define USB_DEVICE_ID_HANWANG_TABLET_FIRST 0x5000
530533 #define USB_DEVICE_ID_HANWANG_TABLET_LAST 0x8fff
drivers/hid/hid-input.c+17−7
@@ -387,7 +387,8 @@ static int hidinput_get_battery_property(struct power_supply *psy, · 386 unmodified lines
387387 break;
388388
389389 case POWER_SUPPLY_PROP_CAPACITY:
390− if (dev->battery_report_type == HID_FEATURE_REPORT) {
390+ if (dev->battery_status != HID_BATTERY_REPORTED &&
391+ !dev->battery_avoid_query) {
391392 value = hidinput_query_battery_capacity(dev);
392393 if (value < 0)
393394 return value;
@@ -403,17 +404,17 @@ static int hidinput_get_battery_property(struct power_supply *psy, · 9 unmodified lines
403404 break;
404405
405406 case POWER_SUPPLY_PROP_STATUS:
406− if (!dev->battery_reported &&
407− dev->battery_report_type == HID_FEATURE_REPORT) {
407+ if (dev->battery_status != HID_BATTERY_REPORTED &&
408+ !dev->battery_avoid_query) {
408409 value = hidinput_query_battery_capacity(dev);
409410 if (value < 0)
410411 return value;
411412
412413 dev->battery_capacity = value;
413− dev->battery_reported = true;
414+ dev->battery_status = HID_BATTERY_QUERIED;
414415 }
415416
416− if (!dev->battery_reported)
417+ if (dev->battery_status == HID_BATTERY_UNKNOWN)
417418 val->intval = POWER_SUPPLY_STATUS_UNKNOWN;
418419 else if (dev->battery_capacity == 100)
419420 val->intval = POWER_SUPPLY_STATUS_FULL;
@@ -486,6 +487,14 @@ static int hidinput_setup_battery(struct hid_device *dev, unsigned report_type, · 66 unmodified lines
486487 dev->battery_report_type = report_type;
487488 dev->battery_report_id = field->report->id;
488489
490+ /*
491+ * Stylus is normally not connected to the device and thus we
492+ * can't query the device and get meaningful battery strength.
493+ * We have to wait for the device to report it on its own.
494+ */
495+ dev->battery_avoid_query = report_type == HID_INPUT_REPORT &&
496+ field->physical == HID_DG_STYLUS;
497+
489498 dev->battery = power_supply_register(&dev->dev, psy_desc, &psy_cfg);
490499 if (IS_ERR(dev->battery)) {
491500 error = PTR_ERR(dev->battery);
@@ -530,9 +539,10 @@ static void hidinput_update_battery(struct hid_device *dev, int value) · 38 unmodified lines
530539
531540 capacity = hidinput_scale_battery_capacity(dev, value);
532541
533− if (!dev->battery_reported || capacity != dev->battery_capacity) {
542+ if (dev->battery_status != HID_BATTERY_REPORTED ||
543+ capacity != dev->battery_capacity) {
534544 dev->battery_capacity = capacity;
535− dev->battery_reported = true;
545+ dev->battery_status = HID_BATTERY_REPORTED;
536546 power_supply_changed(dev->battery);
537547 }
538548 }
drivers/hid/hidraw.c+5−0
@@ -192,6 +192,11 @@ static ssize_t hidraw_get_report(struct file *file, char __user *buffer, size_t · 191 unmodified lines
192192 int ret = 0, len;
193193 unsigned char report_number;
194194
195+ if (!hidraw_table[minor] || !hidraw_table[minor]->exist) {
196+ ret = -ENODEV;
197+ goto out;
198+ }
199+
195200 dev = hidraw_table[minor]->hid;
196201
197202 if (!dev->ll_driver->raw_request) {
drivers/hid/i2c-hid/i2c-hid.c+13−0
@@ -47,6 +47,7 @@ · 46 unmodified lines
4747 /* quirks to control the device */
4848 #define I2C_HID_QUIRK_SET_PWR_WAKEUP_DEV BIT(0)
4949 #define I2C_HID_QUIRK_NO_IRQ_AFTER_RESET BIT(1)
50+#define I2C_HID_QUIRK_RESEND_REPORT_DESCR BIT(2)
5051
5152 /* flags */
5253 #define I2C_HID_STARTED 0
@@ -171,6 +172,8 @@ static const struct i2c_hid_quirks { · 118 unmodified lines
171172 I2C_HID_QUIRK_SET_PWR_WAKEUP_DEV },
172173 { I2C_VENDOR_ID_HANTICK, I2C_PRODUCT_ID_HANTICK_5288,
173174 I2C_HID_QUIRK_NO_IRQ_AFTER_RESET },
175+ { I2C_VENDOR_ID_RAYD, I2C_PRODUCT_ID_RAYD_3118,
176+ I2C_HID_QUIRK_RESEND_REPORT_DESCR },
174177 { 0, 0 }
175178 };
176179
@@ -1220,6 +1223,16 @@ static int i2c_hid_resume(struct device *dev) · 1043 unmodified lines
12201223 if (ret)
12211224 return ret;
12221225
1226+ /* RAYDIUM device (2386:3118) need to re-send report descr cmd
1227+ * after resume, after this it will be back normal.
1228+ * otherwise it issues too many incomplete reports.
1229+ */
1230+ if (ihid->quirks & I2C_HID_QUIRK_RESEND_REPORT_DESCR) {
1231+ ret = i2c_hid_command(client, &hid_report_descr_cmd, NULL, 0);
1232+ if (ret)
1233+ return ret;
1234+ }
1235+
12231236 if (hid->driver && hid->driver->reset_resume) {
12241237 ret = hid->driver->reset_resume(hid);
12251238 return ret;
drivers/hid/wacom_wac.c+46−30
@@ -689,6 +689,45 @@ static int wacom_intuos_get_tool_type(int tool_id) · 688 unmodified lines
689689 return tool_type;
690690 }
691691
692+static void wacom_exit_report(struct wacom_wac *wacom)
693+{
694+ struct input_dev *input = wacom->pen_input;
695+ struct wacom_features *features = &wacom->features;
696+ unsigned char *data = wacom->data;
697+ int idx = (features->type == INTUOS) ? (data[1] & 0x01) : 0;
698+
699+ /*
700+ * Reset all states otherwise we lose the initial states
701+ * when in-prox next time
702+ */
703+ input_report_abs(input, ABS_X, 0);
704+ input_report_abs(input, ABS_Y, 0);
705+ input_report_abs(input, ABS_DISTANCE, 0);
706+ input_report_abs(input, ABS_TILT_X, 0);
707+ input_report_abs(input, ABS_TILT_Y, 0);
708+ if (wacom->tool[idx] >= BTN_TOOL_MOUSE) {
709+ input_report_key(input, BTN_LEFT, 0);
710+ input_report_key(input, BTN_MIDDLE, 0);
711+ input_report_key(input, BTN_RIGHT, 0);
712+ input_report_key(input, BTN_SIDE, 0);
713+ input_report_key(input, BTN_EXTRA, 0);
714+ input_report_abs(input, ABS_THROTTLE, 0);
715+ input_report_abs(input, ABS_RZ, 0);
716+ } else {
717+ input_report_abs(input, ABS_PRESSURE, 0);
718+ input_report_key(input, BTN_STYLUS, 0);
719+ input_report_key(input, BTN_STYLUS2, 0);
720+ input_report_key(input, BTN_TOUCH, 0);
721+ input_report_abs(input, ABS_WHEEL, 0);
722+ if (features->type >= INTUOS3S)
723+ input_report_abs(input, ABS_Z, 0);
724+ }
725+ input_report_key(input, wacom->tool[idx], 0);
726+ input_report_abs(input, ABS_MISC, 0); /* reset tool id */
727+ input_event(input, EV_MSC, MSC_SERIAL, wacom->serial[idx]);
728+ wacom->id[idx] = 0;
729+}
730+
692731 static int wacom_intuos_inout(struct wacom_wac *wacom)
693732 {
694733 struct wacom_features *features = &wacom->features;
@@ -741,36 +780,7 @@ static int wacom_intuos_inout(struct wacom_wac *wacom) · 46 unmodified lines
741780 if (!wacom->id[idx])
742781 return 1;
743782
744− /*
745− * Reset all states otherwise we lose the initial states
746− * when in-prox next time
747− */
748− input_report_abs(input, ABS_X, 0);
749− input_report_abs(input, ABS_Y, 0);
750− input_report_abs(input, ABS_DISTANCE, 0);
751− input_report_abs(input, ABS_TILT_X, 0);
752− input_report_abs(input, ABS_TILT_Y, 0);
753− if (wacom->tool[idx] >= BTN_TOOL_MOUSE) {
754− input_report_key(input, BTN_LEFT, 0);
755− input_report_key(input, BTN_MIDDLE, 0);
756− input_report_key(input, BTN_RIGHT, 0);
757− input_report_key(input, BTN_SIDE, 0);
758− input_report_key(input, BTN_EXTRA, 0);
759− input_report_abs(input, ABS_THROTTLE, 0);
760− input_report_abs(input, ABS_RZ, 0);
761− } else {
762− input_report_abs(input, ABS_PRESSURE, 0);
763− input_report_key(input, BTN_STYLUS, 0);
764− input_report_key(input, BTN_STYLUS2, 0);
765− input_report_key(input, BTN_TOUCH, 0);
766− input_report_abs(input, ABS_WHEEL, 0);
767− if (features->type >= INTUOS3S)
768− input_report_abs(input, ABS_Z, 0);
769− }
770− input_report_key(input, wacom->tool[idx], 0);
771− input_report_abs(input, ABS_MISC, 0); /* reset tool id */
772− input_event(input, EV_MSC, MSC_SERIAL, wacom->serial[idx]);
773− wacom->id[idx] = 0;
783+ wacom_exit_report(wacom);
774784 return 2;
775785 }
776786
@@ -1235,6 +1245,12 @@ static void wacom_intuos_pro2_bt_pen(struct wacom_wac *wacom) · 458 unmodified lines
12351245 if (!valid)
12361246 continue;
12371247
1248+ if (!prox) {
1249+ wacom->shared->stylus_in_proximity = false;
1250+ wacom_exit_report(wacom);
1251+ input_sync(pen_input);
1252+ return;
1253+ }
12381254 if (range) {
12391255 input_report_abs(pen_input, ABS_X, get_unaligned_le16(&frame[1]));
12401256 input_report_abs(pen_input, ABS_Y, get_unaligned_le16(&frame[3]));
drivers/hwmon/k10temp.c+14−3
@@ -40,6 +40,10 @@ static DEFINE_MUTEX(nb_smu_ind_mutex); · 39 unmodified lines
4040 #define PCI_DEVICE_ID_AMD_17H_DF_F3 0x1463
4141 #endif
4242
43+#ifndef PCI_DEVICE_ID_AMD_17H_RR_NB
44+#define PCI_DEVICE_ID_AMD_17H_RR_NB 0x15d0
45+#endif
46+
4347 /* CPUID function 0x80000001, ebx */
4448 #define CPUID_PKGTYPE_MASK 0xf0000000
4549 #define CPUID_PKGTYPE_F 0x00000000
@@ -72,6 +76,7 @@ struct k10temp_data { · 26 unmodified lines
7276 struct pci_dev *pdev;
7377 void (*read_tempreg)(struct pci_dev *pdev, u32 *regval);
7478 int temp_offset;
79+ u32 temp_adjust_mask;
7580 };
7681
7782 struct tctl_offset {
@@ -84,6 +89,7 @@ static const struct tctl_offset tctl_offset_table[] = { · 6 unmodified lines
8489 { 0x17, "AMD Ryzen 5 1600X", 20000 },
8590 { 0x17, "AMD Ryzen 7 1700X", 20000 },
8691 { 0x17, "AMD Ryzen 7 1800X", 20000 },
92+ { 0x17, "AMD Ryzen 7 2700X", 10000 },
8793 { 0x17, "AMD Ryzen Threadripper 1950X", 27000 },
8894 { 0x17, "AMD Ryzen Threadripper 1920X", 27000 },
8995 { 0x17, "AMD Ryzen Threadripper 1900X", 27000 },
@@ -129,6 +135,8 @@ static ssize_t temp1_input_show(struct device *dev, · 39 unmodified lines
129135
130136 data->read_tempreg(data->pdev, &regval);
131137 temp = (regval >> 21) * 125;
138+ if (regval & data->temp_adjust_mask)
139+ temp -= 49000;
132140 if (temp > data->temp_offset)
133141 temp -= data->temp_offset;
134142 else
@@ -259,12 +267,14 @@ static int k10temp_probe(struct pci_dev *pdev, · 124 unmodified lines
259267 data->pdev = pdev;
260268
261269 if (boot_cpu_data.x86 == 0x15 && (boot_cpu_data.x86_model == 0x60 ||
262− boot_cpu_data.x86_model == 0x70))
270+ boot_cpu_data.x86_model == 0x70)) {
263271 data->read_tempreg = read_tempreg_nb_f15;
264− else if (boot_cpu_data.x86 == 0x17)
272+ } else if (boot_cpu_data.x86 == 0x17) {
273+ data->temp_adjust_mask = 0x80000;
265274 data->read_tempreg = read_tempreg_nb_f17;
266− else
275+ } else {
267276 data->read_tempreg = read_tempreg_pci;
277+ }
268278
269279 for (i = 0; i < ARRAY_SIZE(tctl_offset_table); i++) {
270280 const struct tctl_offset *entry = &tctl_offset_table[i];
@@ -292,6 +302,7 @@ static const struct pci_device_id k10temp_id_table[] = { · 21 unmodified lines
292302 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_16H_NB_F3) },
293303 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_16H_M30H_NB_F3) },
294304 { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_17H_DF_F3) },
305+ { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_17H_RR_NB) },
295306 {}
296307 };
297308 MODULE_DEVICE_TABLE(pci, k10temp_id_table);
drivers/hwmon/nct6683.c+2−2
@@ -1380,8 +1380,8 @@ static int __init nct6683_find(int sioaddr, struct nct6683_sio_data *sio_data) · 1379 unmodified lines
13801380 /* Activate logical device if needed */
13811381 val = superio_inb(sioaddr, SIO_REG_ENABLE);
13821382 if (!(val & 0x01)) {
1383− pr_err("EC is disabled\n");
1384− goto fail;
1383+ pr_warn("Forcibly enabling EC access. Data may be unusable.\n");
1384+ superio_outb(sioaddr, SIO_REG_ENABLE, val | 0x01);
13851385 }
13861386
13871387 superio_exit(sioaddr);
drivers/hwmon/scmi-hwmon.c+4−1
@@ -170,7 +170,10 @@ static int scmi_hwmon_probe(struct scmi_device *sdev) · 169 unmodified lines
170170 scmi_chip_info.info = ptr_scmi_ci;
171171 chip_info = &scmi_chip_info;
172172
173− for (type = 0; type < hwmon_max && nr_count[type]; type++) {
173+ for (type = 0; type < hwmon_max; type++) {
174+ if (!nr_count[type])
175+ continue;
176+
174177 scmi_hwmon_add_chan_info(scmi_hwmon_chan, dev, nr_count[type],
175178 type, hwmon_attributes[type]);
176179 *ptr_scmi_ci++ = scmi_hwmon_chan++;
drivers/i2c/busses/Kconfig+0−3
@@ -707,7 +707,6 @@ config I2C_MPC · 706 unmodified lines
707707 config I2C_MT65XX
708708 tristate "MediaTek I2C adapter"
709709 depends on ARCH_MEDIATEK || COMPILE_TEST
710− depends on HAS_DMA
711710 help
712711 This selects the MediaTek(R) Integrated Inter Circuit bus driver
713712 for MT65xx and MT81xx.
@@ -885,7 +884,6 @@ config I2C_SH7760 · 171 unmodified lines
885884
886885 config I2C_SH_MOBILE
887886 tristate "SuperH Mobile I2C Controller"
888− depends on HAS_DMA
889887 depends on ARCH_SHMOBILE || ARCH_RENESAS || COMPILE_TEST
890888 help
891889 If you say yes to this option, support will be included for the
@@ -1098,7 +1096,6 @@ config I2C_XLP9XX · 206 unmodified lines
10981096
10991097 config I2C_RCAR
11001098 tristate "Renesas R-Car I2C Controller"
1101− depends on HAS_DMA
11021099 depends on ARCH_RENESAS || COMPILE_TEST
11031100 select I2C_SLAVE
11041101 help
drivers/i2c/busses/i2c-sprd.c+18−4
@@ -86,6 +86,7 @@ struct sprd_i2c { · 85 unmodified lines
8686 u32 count;
8787 int irq;
8888 int err;
89+ bool is_suspended;
8990 };
9091
9192 static void sprd_i2c_set_count(struct sprd_i2c *i2c_dev, u32 count)
@@ -283,6 +284,9 @@ static int sprd_i2c_master_xfer(struct i2c_adapter *i2c_adap, · 191 unmodified lines
283284 struct sprd_i2c *i2c_dev = i2c_adap->algo_data;
284285 int im, ret;
285286
287+ if (i2c_dev->is_suspended)
288+ return -EBUSY;
289+
286290 ret = pm_runtime_get_sync(i2c_dev->dev);
287291 if (ret < 0)
288292 return ret;
@@ -364,13 +368,12 @@ static irqreturn_t sprd_i2c_isr_thread(int irq, void *dev_id) · 75 unmodified lines
364368 struct sprd_i2c *i2c_dev = dev_id;
365369 struct i2c_msg *msg = i2c_dev->msg;
366370 bool ack = !(readl(i2c_dev->base + I2C_STATUS) & I2C_RX_ACK);
367− u32 i2c_count = readl(i2c_dev->base + I2C_COUNT);
368371 u32 i2c_tran;
369372
370373 if (msg->flags & I2C_M_RD)
371374 i2c_tran = i2c_dev->count >= I2C_FIFO_FULL_THLD;
372375 else
373− i2c_tran = i2c_count;
376+ i2c_tran = i2c_dev->count;
374377
375378 /*
376379 * If we got one ACK from slave when writing data, and we did not
@@ -408,14 +411,13 @@ static irqreturn_t sprd_i2c_isr(int irq, void *dev_id) · 31 unmodified lines
408411 {
409412 struct sprd_i2c *i2c_dev = dev_id;
410413 struct i2c_msg *msg = i2c_dev->msg;
411− u32 i2c_count = readl(i2c_dev->base + I2C_COUNT);
412414 bool ack = !(readl(i2c_dev->base + I2C_STATUS) & I2C_RX_ACK);
413415 u32 i2c_tran;
414416
415417 if (msg->flags & I2C_M_RD)
416418 i2c_tran = i2c_dev->count >= I2C_FIFO_FULL_THLD;
417419 else
418− i2c_tran = i2c_count;
420+ i2c_tran = i2c_dev->count;
419421
420422 /*
421423 * If we did not get one ACK from slave when writing data, then we
@@ -586,11 +588,23 @@ static int sprd_i2c_remove(struct platform_device *pdev) · 164 unmodified lines
586588
587589 static int __maybe_unused sprd_i2c_suspend_noirq(struct device *pdev)
588590 {
591+ struct sprd_i2c *i2c_dev = dev_get_drvdata(pdev);
592+
593+ i2c_lock_adapter(&i2c_dev->adap);
594+ i2c_dev->is_suspended = true;
595+ i2c_unlock_adapter(&i2c_dev->adap);
596+
589597 return pm_runtime_force_suspend(pdev);
590598 }
591599
592600 static int __maybe_unused sprd_i2c_resume_noirq(struct device *pdev)
593601 {
602+ struct sprd_i2c *i2c_dev = dev_get_drvdata(pdev);
603+
604+ i2c_lock_adapter(&i2c_dev->adap);
605+ i2c_dev->is_suspended = false;
606+ i2c_unlock_adapter(&i2c_dev->adap);
607+
594608 return pm_runtime_force_resume(pdev);
595609 }
596610
drivers/i2c/i2c-dev.c+1−1
@@ -280,7 +280,7 @@ static noinline int i2cdev_ioctl_rdwr(struct i2c_client *client, · 279 unmodified lines
280280 */
281281 if (msgs[i].flags & I2C_M_RECV_LEN) {
282282 if (!(msgs[i].flags & I2C_M_RD) ||
283− msgs[i].buf[0] < 1 ||
283+ msgs[i].len < 1 || msgs[i].buf[0] < 1 ||
284284 msgs[i].len < msgs[i].buf[0] +
285285 I2C_SMBUS_BLOCK_MAX) {
286286 res = -EINVAL;
drivers/infiniband/Kconfig+4−1
@@ -61,9 +61,12 @@ config INFINIBAND_ON_DEMAND_PAGING · 60 unmodified lines
6161 pages on demand instead.
6262
6363 config INFINIBAND_ADDR_TRANS
64− bool
64+ bool "RDMA/CM"
6565 depends on INFINIBAND
6666 default y
67+ ---help---
68+ Support for RDMA communication manager (CM).
69+ This allows for a generic connection abstraction over RDMA.
6770
6871 config INFINIBAND_ADDR_TRANS_CONFIGFS
6972 bool
drivers/infiniband/core/cache.c+35−20
@@ -291,14 +291,18 @@ static int find_gid(struct ib_gid_table *table, const union ib_gid *gid, · 290 unmodified lines
291291 * so lookup free slot only if requested.
292292 */
293293 if (pempty && empty < 0) {
294− if (data->props & GID_TABLE_ENTRY_INVALID) {
295− /* Found an invalid (free) entry; allocate it */
296− if (data->props & GID_TABLE_ENTRY_DEFAULT) {
297− if (default_gid)
298− empty = curr_index;
299− } else {
300− empty = curr_index;
301− }
294+ if (data->props & GID_TABLE_ENTRY_INVALID &&
295+ (default_gid ==
296+ !!(data->props & GID_TABLE_ENTRY_DEFAULT))) {
297+ /*
298+ * Found an invalid (free) entry; allocate it.
299+ * If default GID is requested, then our
300+ * found slot must be one of the DEFAULT
301+ * reserved slots or we fail.
302+ * This ensures that only DEFAULT reserved
303+ * slots are used for default property GIDs.
304+ */
305+ empty = curr_index;
302306 }
303307 }
304308
@@ -420,8 +424,10 @@ int ib_cache_gid_add(struct ib_device *ib_dev, u8 port, · 115 unmodified lines
420424 return ret;
421425 }
422426
423−int ib_cache_gid_del(struct ib_device *ib_dev, u8 port,
424− union ib_gid *gid, struct ib_gid_attr *attr)
427+static int
428+_ib_cache_gid_del(struct ib_device *ib_dev, u8 port,
429+ union ib_gid *gid, struct ib_gid_attr *attr,
430+ unsigned long mask, bool default_gid)
425431 {
426432 struct ib_gid_table *table;
427433 int ret = 0;
@@ -431,11 +437,7 @@ int ib_cache_gid_del(struct ib_device *ib_dev, u8 port, · 3 unmodified lines
431437
432438 mutex_lock(&table->lock);
433439
434− ix = find_gid(table, gid, attr, false,
435− GID_ATTR_FIND_MASK_GID |
436− GID_ATTR_FIND_MASK_GID_TYPE |
437− GID_ATTR_FIND_MASK_NETDEV,
438− NULL);
440+ ix = find_gid(table, gid, attr, default_gid, mask, NULL);
439441 if (ix < 0) {
440442 ret = -EINVAL;
441443 goto out_unlock;
@@ -452,6 +454,17 @@ out_unlock: · 10 unmodified lines
452454 return ret;
453455 }
454456
457+int ib_cache_gid_del(struct ib_device *ib_dev, u8 port,
458+ union ib_gid *gid, struct ib_gid_attr *attr)
459+{
460+ unsigned long mask = GID_ATTR_FIND_MASK_GID |
461+ GID_ATTR_FIND_MASK_GID_TYPE |
462+ GID_ATTR_FIND_MASK_DEFAULT |
463+ GID_ATTR_FIND_MASK_NETDEV;
464+
465+ return _ib_cache_gid_del(ib_dev, port, gid, attr, mask, false);
466+}
467+
455468 int ib_cache_gid_del_all_netdev_gids(struct ib_device *ib_dev, u8 port,
456469 struct net_device *ndev)
457470 {
@@ -728,7 +741,7 @@ void ib_cache_gid_set_default_gid(struct ib_device *ib_dev, u8 port, · 270 unmodified lines
728741 unsigned long gid_type_mask,
729742 enum ib_cache_gid_default_mode mode)
730743 {
731− union ib_gid gid;
744+ union ib_gid gid = { };
732745 struct ib_gid_attr gid_attr;
733746 struct ib_gid_table *table;
734747 unsigned int gid_type;
@@ -736,7 +749,9 @@ void ib_cache_gid_set_default_gid(struct ib_device *ib_dev, u8 port, · 1 unmodified line
736749
737750 table = ib_dev->cache.ports[port - rdma_start_port(ib_dev)].gid;
738751
739− make_default_gid(ndev, &gid);
752+ mask = GID_ATTR_FIND_MASK_GID_TYPE |
753+ GID_ATTR_FIND_MASK_DEFAULT |
754+ GID_ATTR_FIND_MASK_NETDEV;
740755 memset(&gid_attr, 0, sizeof(gid_attr));
741756 gid_attr.ndev = ndev;
742757
@@ -747,12 +762,12 @@ void ib_cache_gid_set_default_gid(struct ib_device *ib_dev, u8 port, · 4 unmodified lines
747762 gid_attr.gid_type = gid_type;
748763
749764 if (mode == IB_CACHE_GID_DEFAULT_MODE_SET) {
750− mask = GID_ATTR_FIND_MASK_GID_TYPE |
751− GID_ATTR_FIND_MASK_DEFAULT;
765+ make_default_gid(ndev, &gid);
752766 __ib_cache_gid_add(ib_dev, port, &gid,
753767 &gid_attr, mask, true);
754768 } else if (mode == IB_CACHE_GID_DEFAULT_MODE_DELETE) {
755− ib_cache_gid_del(ib_dev, port, &gid, &gid_attr);
769+ _ib_cache_gid_del(ib_dev, port, &gid,
770+ &gid_attr, mask, true);
756771 }
757772 }
758773 }
drivers/infiniband/core/cma.c+43−17
@@ -382,6 +382,8 @@ struct cma_hdr { · 381 unmodified lines
382382 #define CMA_VERSION 0x00
383383
384384 struct cma_req_info {
385+ struct sockaddr_storage listen_addr_storage;
386+ struct sockaddr_storage src_addr_storage;
385387 struct ib_device *device;
386388 int port;
387389 union ib_gid local_gid;
@@ -866,7 +868,6 @@ static int cma_modify_qp_rtr(struct rdma_id_private *id_priv, · 478 unmodified lines
866868 {
867869 struct ib_qp_attr qp_attr;
868870 int qp_attr_mask, ret;
869− union ib_gid sgid;
870871
871872 mutex_lock(&id_priv->qp_mutex);
872873 if (!id_priv->id.qp) {
@@ -889,12 +890,6 @@ static int cma_modify_qp_rtr(struct rdma_id_private *id_priv, · 16 unmodified lines
889890 if (ret)
890891 goto out;
891892
892− ret = ib_query_gid(id_priv->id.device, id_priv->id.port_num,
893− rdma_ah_read_grh(&qp_attr.ah_attr)->sgid_index,
894− &sgid, NULL);
895− if (ret)
896− goto out;
897−
898893 BUG_ON(id_priv->cma_dev->device != id_priv->id.device);
899894
900895 if (conn_param)
@@ -1340,11 +1335,11 @@ static bool validate_net_dev(struct net_device *net_dev, · 439 unmodified lines
13401335 }
13411336
13421337 static struct net_device *cma_get_net_dev(struct ib_cm_event *ib_event,
1343− const struct cma_req_info *req)
1338+ struct cma_req_info *req)
13441339 {
1345− struct sockaddr_storage listen_addr_storage, src_addr_storage;
1346− struct sockaddr *listen_addr = (struct sockaddr *)&listen_addr_storage,
1347− *src_addr = (struct sockaddr *)&src_addr_storage;
1340+ struct sockaddr *listen_addr =
1341+ (struct sockaddr *)&req->listen_addr_storage;
1342+ struct sockaddr *src_addr = (struct sockaddr *)&req->src_addr_storage;
13481343 struct net_device *net_dev;
13491344 const union ib_gid *gid = req->has_gid ? &req->local_gid : NULL;
13501345 int err;
@@ -1359,11 +1354,6 @@ static struct net_device *cma_get_net_dev(struct ib_cm_event *ib_event, · 8 unmodified lines
13591354 if (!net_dev)
13601355 return ERR_PTR(-ENODEV);
13611356
1362− if (!validate_net_dev(net_dev, listen_addr, src_addr)) {
1363− dev_put(net_dev);
1364− return ERR_PTR(-EHOSTUNREACH);
1365− }
1366−
13671357 return net_dev;
13681358 }
13691359
@@ -1490,15 +1480,51 @@ static struct rdma_id_private *cma_id_from_event(struct ib_cm_id *cm_id, · 120 unmodified lines
14901480 }
14911481 }
14921482
1483+ /*
1484+ * Net namespace might be getting deleted while route lookup,
1485+ * cm_id lookup is in progress. Therefore, perform netdevice
1486+ * validation, cm_id lookup under rcu lock.
1487+ * RCU lock along with netdevice state check, synchronizes with
1488+ * netdevice migrating to different net namespace and also avoids
1489+ * case where net namespace doesn't get deleted while lookup is in
1490+ * progress.
1491+ * If the device state is not IFF_UP, its properties such as ifindex
1492+ * and nd_net cannot be trusted to remain valid without rcu lock.
1493+ * net/core/dev.c change_net_namespace() ensures to synchronize with
1494+ * ongoing operations on net device after device is closed using
1495+ * synchronize_net().
1496+ */
1497+ rcu_read_lock();
1498+ if (*net_dev) {
1499+ /*
1500+ * If netdevice is down, it is likely that it is administratively
1501+ * down or it might be migrating to different namespace.
1502+ * In that case avoid further processing, as the net namespace
1503+ * or ifindex may change.
1504+ */
1505+ if (((*net_dev)->flags & IFF_UP) == 0) {
1506+ id_priv = ERR_PTR(-EHOSTUNREACH);
1507+ goto err;
1508+ }
1509+
1510+ if (!validate_net_dev(*net_dev,
1511+ (struct sockaddr *)&req.listen_addr_storage,
1512+ (struct sockaddr *)&req.src_addr_storage)) {
1513+ id_priv = ERR_PTR(-EHOSTUNREACH);
1514+ goto err;
1515+ }
1516+ }
1517+
14931518 bind_list = cma_ps_find(*net_dev ? dev_net(*net_dev) : &init_net,
14941519 rdma_ps_from_service_id(req.service_id),
14951520 cma_port_from_service_id(req.service_id));
14961521 id_priv = cma_find_listener(bind_list, cm_id, ib_event, &req, *net_dev);
1522+err:
1523+ rcu_read_unlock();
14971524 if (IS_ERR(id_priv) && *net_dev) {
14981525 dev_put(*net_dev);
14991526 *net_dev = NULL;
15001527 }
1501−
15021528 return id_priv;
15031529 }
15041530
drivers/infiniband/core/iwpm_util.c+4−1
@@ -114,7 +114,7 @@ int iwpm_create_mapinfo(struct sockaddr_storage *local_sockaddr, · 113 unmodified lines
114114 struct sockaddr_storage *mapped_sockaddr,
115115 u8 nl_client)
116116 {
117− struct hlist_head *hash_bucket_head;
117+ struct hlist_head *hash_bucket_head = NULL;
118118 struct iwpm_mapping_info *map_info;
119119 unsigned long flags;
120120 int ret = -EINVAL;
@@ -142,6 +142,9 @@ int iwpm_create_mapinfo(struct sockaddr_storage *local_sockaddr, · 21 unmodified lines
142142 }
143143 }
144144 spin_unlock_irqrestore(&iwpm_mapinfo_lock, flags);
145+
146+ if (!hash_bucket_head)
147+ kfree(map_info);
145148 return ret;
146149 }
147150
drivers/infiniband/core/mad.c+2−2
@@ -59,7 +59,7 @@ module_param_named(recv_queue_size, mad_recvq_size, int, 0444); · 58 unmodified lines
5959 MODULE_PARM_DESC(recv_queue_size, "Size of receive queue in number of work requests");
6060
6161 static struct list_head ib_mad_port_list;
62−static u32 ib_mad_client_id = 0;
62+static atomic_t ib_mad_client_id = ATOMIC_INIT(0);
6363
6464 /* Port list lock */
6565 static DEFINE_SPINLOCK(ib_mad_port_list_lock);
@@ -377,7 +377,7 @@ struct ib_mad_agent *ib_register_mad_agent(struct ib_device *device, · 311 unmodified lines
377377 }
378378
379379 spin_lock_irqsave(&port_priv->reg_lock, flags);
380− mad_agent_priv->agent.hi_tid = ++ib_mad_client_id;
380+ mad_agent_priv->agent.hi_tid = atomic_inc_return(&ib_mad_client_id);
381381
382382 /*
383383 * Make sure MAD registration (if supplied)
drivers/infiniband/core/roce_gid_mgmt.c+14−12
@@ -255,6 +255,7 @@ static void bond_delete_netdev_default_gids(struct ib_device *ib_dev, · 254 unmodified lines
255255 struct net_device *rdma_ndev)
256256 {
257257 struct net_device *real_dev = rdma_vlan_dev_real_dev(event_ndev);
258+ unsigned long gid_type_mask;
258259
259260 if (!rdma_ndev)
260261 return;
@@ -264,21 +265,22 @@ static void bond_delete_netdev_default_gids(struct ib_device *ib_dev, · 3 unmodified lines
264265
265266 rcu_read_lock();
266267
267− if (rdma_is_upper_dev_rcu(rdma_ndev, event_ndev) &&
268− is_eth_active_slave_of_bonding_rcu(rdma_ndev, real_dev) ==
269− BONDING_SLAVE_STATE_INACTIVE) {
270− unsigned long gid_type_mask;
271−
268+ if (((rdma_ndev != event_ndev &&
269+ !rdma_is_upper_dev_rcu(rdma_ndev, event_ndev)) ||
270+ is_eth_active_slave_of_bonding_rcu(rdma_ndev, real_dev)
271+ ==
272+ BONDING_SLAVE_STATE_INACTIVE)) {
272273 rcu_read_unlock();
274+ return;
275+ }
273276
274− gid_type_mask = roce_gid_type_mask_support(ib_dev, port);
277+ rcu_read_unlock();
275278
276− ib_cache_gid_set_default_gid(ib_dev, port, rdma_ndev,
277− gid_type_mask,
278− IB_CACHE_GID_DEFAULT_MODE_DELETE);
279− } else {
280− rcu_read_unlock();
281− }
279+ gid_type_mask = roce_gid_type_mask_support(ib_dev, port);
280+
281+ ib_cache_gid_set_default_gid(ib_dev, port, rdma_ndev,
282+ gid_type_mask,
283+ IB_CACHE_GID_DEFAULT_MODE_DELETE);
282284 }
283285
284286 static void enum_netdev_ipv4_ips(struct ib_device *ib_dev,
drivers/infiniband/core/ucma.c+28−16
@@ -159,6 +159,23 @@ static void ucma_put_ctx(struct ucma_context *ctx) · 158 unmodified lines
159159 complete(&ctx->comp);
160160 }
161161
162+/*
163+ * Same as ucm_get_ctx but requires that ->cm_id->device is valid, eg that the
164+ * CM_ID is bound.
165+ */
166+static struct ucma_context *ucma_get_ctx_dev(struct ucma_file *file, int id)
167+{
168+ struct ucma_context *ctx = ucma_get_ctx(file, id);
169+
170+ if (IS_ERR(ctx))
171+ return ctx;
172+ if (!ctx->cm_id->device) {
173+ ucma_put_ctx(ctx);
174+ return ERR_PTR(-EINVAL);
175+ }
176+ return ctx;
177+}
178+
162179 static void ucma_close_event_id(struct work_struct *work)
163180 {
164181 struct ucma_event *uevent_close = container_of(work, struct ucma_event, close_work);
@@ -683,7 +700,7 @@ static ssize_t ucma_resolve_ip(struct ucma_file *file, · 518 unmodified lines
683700 if (copy_from_user(&cmd, inbuf, sizeof(cmd)))
684701 return -EFAULT;
685702
686− if (!rdma_addr_size_in6(&cmd.src_addr) ||
703+ if ((cmd.src_addr.sin6_family && !rdma_addr_size_in6(&cmd.src_addr)) ||
687704 !rdma_addr_size_in6(&cmd.dst_addr))
688705 return -EINVAL;
689706
@@ -734,7 +751,7 @@ static ssize_t ucma_resolve_route(struct ucma_file *file, · 44 unmodified lines
734751 if (copy_from_user(&cmd, inbuf, sizeof(cmd)))
735752 return -EFAULT;
736753
737− ctx = ucma_get_ctx(file, cmd.id);
754+ ctx = ucma_get_ctx_dev(file, cmd.id);
738755 if (IS_ERR(ctx))
739756 return PTR_ERR(ctx);
740757
@@ -1050,7 +1067,7 @@ static ssize_t ucma_connect(struct ucma_file *file, const char __user *inbuf, · 309 unmodified lines
10501067 if (!cmd.conn_param.valid)
10511068 return -EINVAL;
10521069
1053− ctx = ucma_get_ctx(file, cmd.id);
1070+ ctx = ucma_get_ctx_dev(file, cmd.id);
10541071 if (IS_ERR(ctx))
10551072 return PTR_ERR(ctx);
10561073
@@ -1092,7 +1109,7 @@ static ssize_t ucma_accept(struct ucma_file *file, const char __user *inbuf, · 35 unmodified lines
10921109 if (copy_from_user(&cmd, inbuf, sizeof(cmd)))
10931110 return -EFAULT;
10941111
1095− ctx = ucma_get_ctx(file, cmd.id);
1112+ ctx = ucma_get_ctx_dev(file, cmd.id);
10961113 if (IS_ERR(ctx))
10971114 return PTR_ERR(ctx);
10981115
@@ -1120,7 +1137,7 @@ static ssize_t ucma_reject(struct ucma_file *file, const char __user *inbuf, · 21 unmodified lines
11201137 if (copy_from_user(&cmd, inbuf, sizeof(cmd)))
11211138 return -EFAULT;
11221139
1123− ctx = ucma_get_ctx(file, cmd.id);
1140+ ctx = ucma_get_ctx_dev(file, cmd.id);
11241141 if (IS_ERR(ctx))
11251142 return PTR_ERR(ctx);
11261143
@@ -1139,7 +1156,7 @@ static ssize_t ucma_disconnect(struct ucma_file *file, const char __user *inbuf, · 12 unmodified lines
11391156 if (copy_from_user(&cmd, inbuf, sizeof(cmd)))
11401157 return -EFAULT;
11411158
1142− ctx = ucma_get_ctx(file, cmd.id);
1159+ ctx = ucma_get_ctx_dev(file, cmd.id);
11431160 if (IS_ERR(ctx))
11441161 return PTR_ERR(ctx);
11451162
@@ -1167,15 +1184,10 @@ static ssize_t ucma_init_qp_attr(struct ucma_file *file, · 21 unmodified lines
11671184 if (cmd.qp_state > IB_QPS_ERR)
11681185 return -EINVAL;
11691186
1170− ctx = ucma_get_ctx(file, cmd.id);
1187+ ctx = ucma_get_ctx_dev(file, cmd.id);
11711188 if (IS_ERR(ctx))
11721189 return PTR_ERR(ctx);
11731190
1174− if (!ctx->cm_id->device) {
1175− ret = -EINVAL;
1176− goto out;
1177− }
1178−
11791191 resp.qp_attr_mask = 0;
11801192 memset(&qp_attr, 0, sizeof qp_attr);
11811193 qp_attr.qp_state = cmd.qp_state;
@@ -1316,13 +1328,13 @@ static ssize_t ucma_set_option(struct ucma_file *file, const char __user *inbuf, · 134 unmodified lines
13161328 if (copy_from_user(&cmd, inbuf, sizeof(cmd)))
13171329 return -EFAULT;
13181330
1331+ if (unlikely(cmd.optlen > KMALLOC_MAX_SIZE))
1332+ return -EINVAL;
1333+
13191334 ctx = ucma_get_ctx(file, cmd.id);
13201335 if (IS_ERR(ctx))
13211336 return PTR_ERR(ctx);
13221337
1323− if (unlikely(cmd.optlen > KMALLOC_MAX_SIZE))
1324− return -EINVAL;
1325−
13261338 optval = memdup_user(u64_to_user_ptr(cmd.optval),
13271339 cmd.optlen);
13281340 if (IS_ERR(optval)) {
@@ -1384,7 +1396,7 @@ static ssize_t ucma_process_join(struct ucma_file *file, · 55 unmodified lines
13841396 else
13851397 return -EINVAL;
13861398
1387− ctx = ucma_get_ctx(file, cmd->id);
1399+ ctx = ucma_get_ctx_dev(file, cmd->id);
13881400 if (IS_ERR(ctx))
13891401 return PTR_ERR(ctx);
13901402
drivers/infiniband/core/uverbs_cmd.c+6−0
@@ -691,6 +691,7 @@ ssize_t ib_uverbs_reg_mr(struct ib_uverbs_file *file, · 690 unmodified lines
691691
692692 mr->device = pd->device;
693693 mr->pd = pd;
694+ mr->dm = NULL;
694695 mr->uobject = uobj;
695696 atomic_inc(&pd->usecnt);
696697 mr->res.type = RDMA_RESTRACK_MR;
@@ -765,6 +766,11 @@ ssize_t ib_uverbs_rereg_mr(struct ib_uverbs_file *file, · 68 unmodified lines
765766
766767 mr = uobj->object;
767768
769+ if (mr->dm) {
770+ ret = -EINVAL;
771+ goto put_uobjs;
772+ }
773+
768774 if (cmd.flags & IB_MR_REREG_ACCESS) {
769775 ret = ib_check_mr_access(cmd.access_flags);
770776 if (ret)
drivers/infiniband/core/uverbs_ioctl.c+9−0
@@ -234,6 +234,15 @@ static int uverbs_validate_kernel_mandatory(const struct uverbs_method_spec *met · 233 unmodified lines
234234 return -EINVAL;
235235 }
236236
237+ for (; i < method_spec->num_buckets; i++) {
238+ struct uverbs_attr_spec_hash *attr_spec_bucket =
239+ method_spec->attr_buckets[i];
240+
241+ if (!bitmap_empty(attr_spec_bucket->mandatory_attrs_bitmask,
242+ attr_spec_bucket->num_attrs))
243+ return -EINVAL;
244+ }
245+
237246 return 0;
238247 }
239248
drivers/infiniband/core/uverbs_std_types_flow_action.c+6−6
@@ -363,28 +363,28 @@ static int UVERBS_HANDLER(UVERBS_METHOD_FLOW_ACTION_ESP_MODIFY)(struct ib_device · 362 unmodified lines
363363
364364 static const struct uverbs_attr_spec uverbs_flow_action_esp_keymat[] = {
365365 [IB_UVERBS_FLOW_ACTION_ESP_KEYMAT_AES_GCM] = {
366− .ptr = {
366+ { .ptr = {
367367 .type = UVERBS_ATTR_TYPE_PTR_IN,
368368 UVERBS_ATTR_TYPE(struct ib_uverbs_flow_action_esp_keymat_aes_gcm),
369369 .flags = UVERBS_ATTR_SPEC_F_MIN_SZ_OR_ZERO,
370− },
370+ } },
371371 },
372372 };
373373
374374 static const struct uverbs_attr_spec uverbs_flow_action_esp_replay[] = {
375375 [IB_UVERBS_FLOW_ACTION_ESP_REPLAY_NONE] = {
376− .ptr = {
376+ { .ptr = {
377377 .type = UVERBS_ATTR_TYPE_PTR_IN,
378378 /* No need to specify any data */
379379 .len = 0,
380− }
380+ } }
381381 },
382382 [IB_UVERBS_FLOW_ACTION_ESP_REPLAY_BMP] = {
383− .ptr = {
383+ { .ptr = {
384384 .type = UVERBS_ATTR_TYPE_PTR_IN,
385385 UVERBS_ATTR_STRUCT(struct ib_uverbs_flow_action_esp_replay_bmp, size),
386386 .flags = UVERBS_ATTR_SPEC_F_MIN_SZ_OR_ZERO,
387− }
387+ } }
388388 },
389389 };
390390
drivers/infiniband/core/verbs.c+1−0
@@ -1656,6 +1656,7 @@ struct ib_mr *ib_alloc_mr(struct ib_pd *pd, · 1655 unmodified lines
16561656 if (!IS_ERR(mr)) {
16571657 mr->device = pd->device;
16581658 mr->pd = pd;
1659+ mr->dm = NULL;
16591660 mr->uobject = NULL;
16601661 atomic_inc(&pd->usecnt);
16611662 mr->need_inval = false;
drivers/infiniband/hw/cxgb4/cq.c+10−1
@@ -315,7 +315,7 @@ static void advance_oldest_read(struct t4_wq *wq) · 314 unmodified lines
315315 * Deal with out-of-order and/or completions that complete
316316 * prior unsignalled WRs.
317317 */
318−void c4iw_flush_hw_cq(struct c4iw_cq *chp)
318+void c4iw_flush_hw_cq(struct c4iw_cq *chp, struct c4iw_qp *flush_qhp)
319319 {
320320 struct t4_cqe *hw_cqe, *swcqe, read_cqe;
321321 struct c4iw_qp *qhp;
@@ -339,6 +339,13 @@ void c4iw_flush_hw_cq(struct c4iw_cq *chp) · 17 unmodified lines
339339 if (qhp == NULL)
340340 goto next_cqe;
341341
342+ if (flush_qhp != qhp) {
343+ spin_lock(&qhp->lock);
344+
345+ if (qhp->wq.flushed == 1)
346+ goto next_cqe;
347+ }
348+
342349 if (CQE_OPCODE(hw_cqe) == FW_RI_TERMINATE)
343350 goto next_cqe;
344351
@@ -390,6 +397,8 @@ void c4iw_flush_hw_cq(struct c4iw_cq *chp) · 45 unmodified lines
390397 next_cqe:
391398 t4_hwcq_consume(&chp->cq);
392399 ret = t4_next_hw_cqe(&chp->cq, &hw_cqe);
400+ if (qhp && flush_qhp != qhp)
401+ spin_unlock(&qhp->lock);
393402 }
394403 }
395404
drivers/infiniband/hw/cxgb4/device.c+8−1
@@ -875,6 +875,11 @@ static int c4iw_rdev_open(struct c4iw_rdev *rdev) · 874 unmodified lines
875875
876876 rdev->status_page->db_off = 0;
877877
878+ init_completion(&rdev->rqt_compl);
879+ init_completion(&rdev->pbl_compl);
880+ kref_init(&rdev->rqt_kref);
881+ kref_init(&rdev->pbl_kref);
882+
878883 return 0;
879884 err_free_status_page_and_wr_log:
880885 if (c4iw_wr_log && rdev->wr_log)
@@ -893,13 +898,15 @@ destroy_resource: · 12 unmodified lines
893898
894899 static void c4iw_rdev_close(struct c4iw_rdev *rdev)
895900 {
896− destroy_workqueue(rdev->free_workq);
897901 kfree(rdev->wr_log);
898902 c4iw_release_dev_ucontext(rdev, &rdev->uctx);
899903 free_page((unsigned long)rdev->status_page);
900904 c4iw_pblpool_destroy(rdev);
901905 c4iw_rqtpool_destroy(rdev);
906+ wait_for_completion(&rdev->pbl_compl);
907+ wait_for_completion(&rdev->rqt_compl);
902908 c4iw_ocqp_pool_destroy(rdev);
909+ destroy_workqueue(rdev->free_workq);
903910 c4iw_destroy_resource(&rdev->resource);
904911 }
905912
drivers/infiniband/hw/cxgb4/iw_cxgb4.h+5−1
@@ -185,6 +185,10 @@ struct c4iw_rdev { · 184 unmodified lines
185185 struct wr_log_entry *wr_log;
186186 int wr_log_size;
187187 struct workqueue_struct *free_workq;
188+ struct completion rqt_compl;
189+ struct completion pbl_compl;
190+ struct kref rqt_kref;
191+ struct kref pbl_kref;
188192 };
189193
190194 static inline int c4iw_fatal_error(struct c4iw_rdev *rdev)
@@ -1049,7 +1053,7 @@ u32 c4iw_pblpool_alloc(struct c4iw_rdev *rdev, int size); · 858 unmodified lines
10491053 void c4iw_pblpool_free(struct c4iw_rdev *rdev, u32 addr, int size);
10501054 u32 c4iw_ocqp_pool_alloc(struct c4iw_rdev *rdev, int size);
10511055 void c4iw_ocqp_pool_free(struct c4iw_rdev *rdev, u32 addr, int size);
1052−void c4iw_flush_hw_cq(struct c4iw_cq *chp);
1056+void c4iw_flush_hw_cq(struct c4iw_cq *chp, struct c4iw_qp *flush_qhp);
10531057 void c4iw_count_rcqes(struct t4_cq *cq, struct t4_wq *wq, int *count);
10541058 int c4iw_ep_disconnect(struct c4iw_ep *ep, int abrupt, gfp_t gfp);
10551059 int c4iw_flush_rq(struct t4_wq *wq, struct t4_cq *cq, int count);
drivers/infiniband/hw/cxgb4/qp.c+2−2
@@ -1343,12 +1343,12 @@ static void __flush_qp(struct c4iw_qp *qhp, struct c4iw_cq *rchp, · 1342 unmodified lines
13431343 qhp->wq.flushed = 1;
13441344 t4_set_wq_in_error(&qhp->wq);
13451345
1346− c4iw_flush_hw_cq(rchp);
1346+ c4iw_flush_hw_cq(rchp, qhp);
13471347 c4iw_count_rcqes(&rchp->cq, &qhp->wq, &count);
13481348 rq_flushed = c4iw_flush_rq(&qhp->wq, &rchp->cq, count);
13491349
13501350 if (schp != rchp)
1351− c4iw_flush_hw_cq(schp);
1351+ c4iw_flush_hw_cq(schp, qhp);
13521352 sq_flushed = c4iw_flush_sq(qhp);
13531353
13541354 spin_unlock(&qhp->lock);
drivers/infiniband/hw/cxgb4/resource.c+24−2
@@ -260,12 +260,22 @@ u32 c4iw_pblpool_alloc(struct c4iw_rdev *rdev, int size) · 259 unmodified lines
260260 rdev->stats.pbl.cur += roundup(size, 1 << MIN_PBL_SHIFT);
261261 if (rdev->stats.pbl.cur > rdev->stats.pbl.max)
262262 rdev->stats.pbl.max = rdev->stats.pbl.cur;
263+ kref_get(&rdev->pbl_kref);
263264 } else
264265 rdev->stats.pbl.fail++;
265266 mutex_unlock(&rdev->stats.lock);
266267 return (u32)addr;
267268 }
268269
270+static void destroy_pblpool(struct kref *kref)
271+{
272+ struct c4iw_rdev *rdev;
273+
274+ rdev = container_of(kref, struct c4iw_rdev, pbl_kref);
275+ gen_pool_destroy(rdev->pbl_pool);
276+ complete(&rdev->pbl_compl);
277+}
278+
269279 void c4iw_pblpool_free(struct c4iw_rdev *rdev, u32 addr, int size)
270280 {
271281 pr_debug("addr 0x%x size %d\n", addr, size);
@@ -273,6 +283,7 @@ void c4iw_pblpool_free(struct c4iw_rdev *rdev, u32 addr, int size) · 1 unmodified line
273283 rdev->stats.pbl.cur -= roundup(size, 1 << MIN_PBL_SHIFT);
274284 mutex_unlock(&rdev->stats.lock);
275285 gen_pool_free(rdev->pbl_pool, (unsigned long)addr, size);
286+ kref_put(&rdev->pbl_kref, destroy_pblpool);
276287 }
277288
278289 int c4iw_pblpool_create(struct c4iw_rdev *rdev)
@@ -310,7 +321,7 @@ int c4iw_pblpool_create(struct c4iw_rdev *rdev) · 31 unmodified lines
310321
311322 void c4iw_pblpool_destroy(struct c4iw_rdev *rdev)
312323 {
313− gen_pool_destroy(rdev->pbl_pool);
324+ kref_put(&rdev->pbl_kref, destroy_pblpool);
314325 }
315326
316327 /*
@@ -331,12 +342,22 @@ u32 c4iw_rqtpool_alloc(struct c4iw_rdev *rdev, int size) · 14 unmodified lines
331342 rdev->stats.rqt.cur += roundup(size << 6, 1 << MIN_RQT_SHIFT);
332343 if (rdev->stats.rqt.cur > rdev->stats.rqt.max)
333344 rdev->stats.rqt.max = rdev->stats.rqt.cur;
345+ kref_get(&rdev->rqt_kref);
334346 } else
335347 rdev->stats.rqt.fail++;
336348 mutex_unlock(&rdev->stats.lock);
337349 return (u32)addr;
338350 }
339351
352+static void destroy_rqtpool(struct kref *kref)
353+{
354+ struct c4iw_rdev *rdev;
355+
356+ rdev = container_of(kref, struct c4iw_rdev, rqt_kref);
357+ gen_pool_destroy(rdev->rqt_pool);
358+ complete(&rdev->rqt_compl);
359+}
360+
340361 void c4iw_rqtpool_free(struct c4iw_rdev *rdev, u32 addr, int size)
341362 {
342363 pr_debug("addr 0x%x size %d\n", addr, size << 6);
@@ -344,6 +365,7 @@ void c4iw_rqtpool_free(struct c4iw_rdev *rdev, u32 addr, int size) · 1 unmodified line
344365 rdev->stats.rqt.cur -= roundup(size << 6, 1 << MIN_RQT_SHIFT);
345366 mutex_unlock(&rdev->stats.lock);
346367 gen_pool_free(rdev->rqt_pool, (unsigned long)addr, size << 6);
368+ kref_put(&rdev->rqt_kref, destroy_rqtpool);
347369 }
348370
349371 int c4iw_rqtpool_create(struct c4iw_rdev *rdev)
@@ -380,7 +402,7 @@ int c4iw_rqtpool_create(struct c4iw_rdev *rdev) · 30 unmodified lines
380402
381403 void c4iw_rqtpool_destroy(struct c4iw_rdev *rdev)
382404 {
383− gen_pool_destroy(rdev->rqt_pool);
405+ kref_put(&rdev->rqt_kref, destroy_rqtpool);
384406 }
385407
386408 /*
drivers/infiniband/hw/hfi1/affinity.c+5−6
@@ -412,7 +412,6 @@ static void hfi1_cleanup_sdma_notifier(struct hfi1_msix_entry *msix) · 411 unmodified lines
412412 static int get_irq_affinity(struct hfi1_devdata *dd,
413413 struct hfi1_msix_entry *msix)
414414 {
415− int ret;
416415 cpumask_var_t diff;
417416 struct hfi1_affinity_node *entry;
418417 struct cpu_mask_set *set = NULL;
@@ -424,10 +423,6 @@ static int get_irq_affinity(struct hfi1_devdata *dd, · 5 unmodified lines
424423 extra[0] = '\0';
425424 cpumask_clear(&msix->mask);
426425
427− ret = zalloc_cpumask_var(&diff, GFP_KERNEL);
428− if (!ret)
429− return -ENOMEM;
430−
431426 entry = node_affinity_lookup(dd->node);
432427
433428 switch (msix->type) {
@@ -458,6 +453,9 @@ static int get_irq_affinity(struct hfi1_devdata *dd, · 24 unmodified lines
458453 * finds its CPU here.
459454 */
460455 if (cpu == -1 && set) {
456+ if (!zalloc_cpumask_var(&diff, GFP_KERNEL))
457+ return -ENOMEM;
458+
461459 if (cpumask_equal(&set->mask, &set->used)) {
462460 /*
463461 * We've used up all the CPUs, bump up the generation
@@ -469,6 +467,8 @@ static int get_irq_affinity(struct hfi1_devdata *dd, · 5 unmodified lines
469467 cpumask_andnot(diff, &set->mask, &set->used);
470468 cpu = cpumask_first(diff);
471469 cpumask_set_cpu(cpu, &set->used);
470+
471+ free_cpumask_var(diff);
472472 }
473473
474474 cpumask_set_cpu(cpu, &msix->mask);
@@ -482,7 +482,6 @@ static int get_irq_affinity(struct hfi1_devdata *dd, · 7 unmodified lines
482482 hfi1_setup_sdma_notifier(msix);
483483 }
484484
485− free_cpumask_var(diff);
486485 return 0;
487486 }
488487
drivers/infiniband/hw/hfi1/driver.c+15−4
@@ -433,31 +433,43 @@ void hfi1_process_ecn_slowpath(struct rvt_qp *qp, struct hfi1_packet *pkt, · 432 unmodified lines
433433 bool do_cnp)
434434 {
435435 struct hfi1_ibport *ibp = to_iport(qp->ibqp.device, qp->port_num);
436+ struct hfi1_pportdata *ppd = ppd_from_ibp(ibp);
436437 struct ib_other_headers *ohdr = pkt->ohdr;
437438 struct ib_grh *grh = pkt->grh;
438439 u32 rqpn = 0, bth1;
439− u16 pkey, rlid, dlid = ib_get_dlid(pkt->hdr);
440+ u16 pkey;
441+ u32 rlid, slid, dlid = 0;
440442 u8 hdr_type, sc, svc_type;
441443 bool is_mcast = false;
442444
445+ /* can be called from prescan */
443446 if (pkt->etype == RHF_RCV_TYPE_BYPASS) {
444447 is_mcast = hfi1_is_16B_mcast(dlid);
445448 pkey = hfi1_16B_get_pkey(pkt->hdr);
446449 sc = hfi1_16B_get_sc(pkt->hdr);
450+ dlid = hfi1_16B_get_dlid(pkt->hdr);
451+ slid = hfi1_16B_get_slid(pkt->hdr);
447452 hdr_type = HFI1_PKT_TYPE_16B;
448453 } else {
449454 is_mcast = (dlid > be16_to_cpu(IB_MULTICAST_LID_BASE)) &&
450455 (dlid != be16_to_cpu(IB_LID_PERMISSIVE));
451456 pkey = ib_bth_get_pkey(ohdr);
452457 sc = hfi1_9B_get_sc5(pkt->hdr, pkt->rhf);
458+ dlid = ib_get_dlid(pkt->hdr);
459+ slid = ib_get_slid(pkt->hdr);
453460 hdr_type = HFI1_PKT_TYPE_9B;
454461 }
455462
456463 switch (qp->ibqp.qp_type) {
464+ case IB_QPT_UD:
465+ dlid = ppd->lid;
466+ rlid = slid;
467+ rqpn = ib_get_sqpn(pkt->ohdr);
468+ svc_type = IB_CC_SVCTYPE_UD;
469+ break;
457470 case IB_QPT_SMI:
458471 case IB_QPT_GSI:
459− case IB_QPT_UD:
460− rlid = ib_get_slid(pkt->hdr);
472+ rlid = slid;
461473 rqpn = ib_get_sqpn(pkt->ohdr);
462474 svc_type = IB_CC_SVCTYPE_UD;
463475 break;
@@ -482,7 +494,6 @@ void hfi1_process_ecn_slowpath(struct rvt_qp *qp, struct hfi1_packet *pkt, · 18 unmodified lines
482494 dlid, rlid, sc, grh);
483495
484496 if (!is_mcast && (bth1 & IB_BECN_SMASK)) {
485− struct hfi1_pportdata *ppd = ppd_from_ibp(ibp);
486497 u32 lqpn = bth1 & RVT_QPN_MASK;
487498 u8 sl = ibp->sc_to_sl[sc];
488499
drivers/infiniband/hw/hfi1/hfi.h+4−4
@@ -1537,13 +1537,13 @@ void set_link_ipg(struct hfi1_pportdata *ppd); · 1536 unmodified lines
15371537 void process_becn(struct hfi1_pportdata *ppd, u8 sl, u32 rlid, u32 lqpn,
15381538 u32 rqpn, u8 svc_type);
15391539 void return_cnp(struct hfi1_ibport *ibp, struct rvt_qp *qp, u32 remote_qpn,
1540− u32 pkey, u32 slid, u32 dlid, u8 sc5,
1540+ u16 pkey, u32 slid, u32 dlid, u8 sc5,
15411541 const struct ib_grh *old_grh);
15421542 void return_cnp_16B(struct hfi1_ibport *ibp, struct rvt_qp *qp,
1543− u32 remote_qpn, u32 pkey, u32 slid, u32 dlid,
1543+ u32 remote_qpn, u16 pkey, u32 slid, u32 dlid,
15441544 u8 sc5, const struct ib_grh *old_grh);
15451545 typedef void (*hfi1_handle_cnp)(struct hfi1_ibport *ibp, struct rvt_qp *qp,
1546− u32 remote_qpn, u32 pkey, u32 slid, u32 dlid,
1546+ u32 remote_qpn, u16 pkey, u32 slid, u32 dlid,
15471547 u8 sc5, const struct ib_grh *old_grh);
15481548
15491549 #define PKEY_CHECK_INVALID -1
@@ -2437,7 +2437,7 @@ static inline void hfi1_make_16b_hdr(struct hfi1_16b_header *hdr, · 887 unmodified lines
24372437 ((slid >> OPA_16B_SLID_SHIFT) << OPA_16B_SLID_HIGH_SHIFT);
24382438 lrh2 = (lrh2 & ~OPA_16B_DLID_MASK) |
24392439 ((dlid >> OPA_16B_DLID_SHIFT) << OPA_16B_DLID_HIGH_SHIFT);
2440− lrh2 = (lrh2 & ~OPA_16B_PKEY_MASK) | (pkey << OPA_16B_PKEY_SHIFT);
2440+ lrh2 = (lrh2 & ~OPA_16B_PKEY_MASK) | ((u32)pkey << OPA_16B_PKEY_SHIFT);
24412441 lrh2 = (lrh2 & ~OPA_16B_L4_MASK) | l4;
24422442
24432443 hdr->lrh[0] = lrh0;
drivers/infiniband/hw/hfi1/init.c+31−12
@@ -88,9 +88,9 @@ · 87 unmodified lines
8888 * pio buffers per ctxt, etc.) Zero means use one user context per CPU.
8989 */
9090 int num_user_contexts = -1;
91−module_param_named(num_user_contexts, num_user_contexts, uint, S_IRUGO);
91+module_param_named(num_user_contexts, num_user_contexts, int, 0444);
9292 MODULE_PARM_DESC(
93− num_user_contexts, "Set max number of user contexts to use");
93+ num_user_contexts, "Set max number of user contexts to use (default: -1 will use the real (non-HT) CPU count)");
9494
9595 uint krcvqs[RXE_NUM_DATA_VL];
9696 int krcvqsset;
@@ -1209,30 +1209,49 @@ static void finalize_asic_data(struct hfi1_devdata *dd, · 1112 unmodified lines
12091209 kfree(ad);
12101210 }
12111211
1212−static void __hfi1_free_devdata(struct kobject *kobj)
1212+/**
1213+ * hfi1_clean_devdata - cleans up per-unit data structure
1214+ * @dd: pointer to a valid devdata structure
1215+ *
1216+ * It cleans up all data structures set up by
1217+ * by hfi1_alloc_devdata().
1218+ */
1219+static void hfi1_clean_devdata(struct hfi1_devdata *dd)
12131220 {
1214− struct hfi1_devdata *dd =
1215− container_of(kobj, struct hfi1_devdata, kobj);
12161221 struct hfi1_asic_data *ad;
12171222 unsigned long flags;
12181223
12191224 spin_lock_irqsave(&hfi1_devs_lock, flags);
1220− idr_remove(&hfi1_unit_table, dd->unit);
1221− list_del(&dd->list);
1225+ if (!list_empty(&dd->list)) {
1226+ idr_remove(&hfi1_unit_table, dd->unit);
1227+ list_del_init(&dd->list);
1228+ }
12221229 ad = release_asic_data(dd);
12231230 spin_unlock_irqrestore(&hfi1_devs_lock, flags);
1224− if (ad)
1225− finalize_asic_data(dd, ad);
1231+
1232+ finalize_asic_data(dd, ad);
12261233 free_platform_config(dd);
12271234 rcu_barrier(); /* wait for rcu callbacks to complete */
12281235 free_percpu(dd->int_counter);
12291236 free_percpu(dd->rcv_limit);
12301237 free_percpu(dd->send_schedule);
12311238 free_percpu(dd->tx_opstats);
1239+ dd->int_counter = NULL;
1240+ dd->rcv_limit = NULL;
1241+ dd->send_schedule = NULL;
1242+ dd->tx_opstats = NULL;
12321243 sdma_clean(dd, dd->num_sdma);
12331244 rvt_dealloc_device(&dd->verbs_dev.rdi);
12341245 }
12351246
1247+static void __hfi1_free_devdata(struct kobject *kobj)
1248+{
1249+ struct hfi1_devdata *dd =
1250+ container_of(kobj, struct hfi1_devdata, kobj);
1251+
1252+ hfi1_clean_devdata(dd);
1253+}
1254+
12361255 static struct kobj_type hfi1_devdata_type = {
12371256 .release = __hfi1_free_devdata,
12381257 };
@@ -1265,6 +1284,8 @@ struct hfi1_devdata *hfi1_alloc_devdata(struct pci_dev *pdev, size_t extra) · 26 unmodified lines
12651284 return ERR_PTR(-ENOMEM);
12661285 dd->num_pports = nports;
12671286 dd->pport = (struct hfi1_pportdata *)(dd + 1);
1287+ dd->pcidev = pdev;
1288+ pci_set_drvdata(pdev, dd);
12681289
12691290 INIT_LIST_HEAD(&dd->list);
12701291 idr_preload(GFP_KERNEL);
@@ -1331,9 +1352,7 @@ struct hfi1_devdata *hfi1_alloc_devdata(struct pci_dev *pdev, size_t extra) · 60 unmodified lines
13311352 return dd;
13321353
13331354 bail:
1334− if (!list_empty(&dd->list))
1335− list_del_init(&dd->list);
1336− rvt_dealloc_device(&dd->verbs_dev.rdi);
1355+ hfi1_clean_devdata(dd);
13371356 return ERR_PTR(ret);
13381357 }
13391358
drivers/infiniband/hw/hfi1/pcie.c+0−3
@@ -163,9 +163,6 @@ int hfi1_pcie_ddinit(struct hfi1_devdata *dd, struct pci_dev *pdev) · 162 unmodified lines
163163 resource_size_t addr;
164164 int ret = 0;
165165
166− dd->pcidev = pdev;
167− pci_set_drvdata(pdev, dd);
168−
169166 addr = pci_resource_start(pdev, 0);
170167 len = pci_resource_len(pdev, 0);
171168
drivers/infiniband/hw/hfi1/platform.c+1−0
@@ -199,6 +199,7 @@ void free_platform_config(struct hfi1_devdata *dd) · 198 unmodified lines
199199 {
200200 /* Release memory allocated for eprom or fallback file read. */
201201 kfree(dd->platform_config.data);
202+ dd->platform_config.data = NULL;
202203 }
203204
204205 void get_port_type(struct hfi1_pportdata *ppd)
drivers/infiniband/hw/hfi1/qsfp.c+2−0
@@ -204,6 +204,8 @@ static void clean_i2c_bus(struct hfi1_i2c_bus *bus) · 203 unmodified lines
204204
205205 void clean_up_i2c(struct hfi1_devdata *dd, struct hfi1_asic_data *ad)
206206 {
207+ if (!ad)
208+ return;
207209 clean_i2c_bus(ad->i2c_bus0);
208210 ad->i2c_bus0 = NULL;
209211 clean_i2c_bus(ad->i2c_bus1);
drivers/infiniband/hw/hfi1/ruc.c+40−10
@@ -733,6 +733,20 @@ static inline void hfi1_make_ruc_bth(struct rvt_qp *qp, · 732 unmodified lines
733733 ohdr->bth[2] = cpu_to_be32(bth2);
734734 }
735735
736+/**
737+ * hfi1_make_ruc_header_16B - build a 16B header
738+ * @qp: the queue pair
739+ * @ohdr: a pointer to the destination header memory
740+ * @bth0: bth0 passed in from the RC/UC builder
741+ * @bth2: bth2 passed in from the RC/UC builder
742+ * @middle: non zero implies indicates ahg "could" be used
743+ * @ps: the current packet state
744+ *
745+ * This routine may disarm ahg under these situations:
746+ * - packet needs a GRH
747+ * - BECN needed
748+ * - migration state not IB_MIG_MIGRATED
749+ */
736750 static inline void hfi1_make_ruc_header_16B(struct rvt_qp *qp,
737751 struct ib_other_headers *ohdr,
738752 u32 bth0, u32 bth2, int middle,
@@ -777,6 +791,12 @@ static inline void hfi1_make_ruc_header_16B(struct rvt_qp *qp, · 38 unmodified lines
777791 else
778792 middle = 0;
779793
794+ if (qp->s_flags & RVT_S_ECN) {
795+ qp->s_flags &= ~RVT_S_ECN;
796+ /* we recently received a FECN, so return a BECN */
797+ becn = true;
798+ middle = 0;
799+ }
780800 if (middle)
781801 build_ahg(qp, bth2);
782802 else
@@ -784,11 +804,6 @@ static inline void hfi1_make_ruc_header_16B(struct rvt_qp *qp, · 1 unmodified line
784804
785805 bth0 |= pkey;
786806 bth0 |= extra_bytes << 20;
787− if (qp->s_flags & RVT_S_ECN) {
788− qp->s_flags &= ~RVT_S_ECN;
789− /* we recently received a FECN, so return a BECN */
790− becn = true;
791− }
792807 hfi1_make_ruc_bth(qp, ohdr, bth0, bth1, bth2);
793808
794809 if (!ppd->lid)
@@ -806,6 +821,20 @@ static inline void hfi1_make_ruc_header_16B(struct rvt_qp *qp, · 11 unmodified lines
806821 pkey, becn, 0, l4, priv->s_sc);
807822 }
808823
824+/**
825+ * hfi1_make_ruc_header_9B - build a 9B header
826+ * @qp: the queue pair
827+ * @ohdr: a pointer to the destination header memory
828+ * @bth0: bth0 passed in from the RC/UC builder
829+ * @bth2: bth2 passed in from the RC/UC builder
830+ * @middle: non zero implies indicates ahg "could" be used
831+ * @ps: the current packet state
832+ *
833+ * This routine may disarm ahg under these situations:
834+ * - packet needs a GRH
835+ * - BECN needed
836+ * - migration state not IB_MIG_MIGRATED
837+ */
809838 static inline void hfi1_make_ruc_header_9B(struct rvt_qp *qp,
810839 struct ib_other_headers *ohdr,
811840 u32 bth0, u32 bth2, int middle,
@@ -839,6 +868,12 @@ static inline void hfi1_make_ruc_header_9B(struct rvt_qp *qp, · 27 unmodified lines
839868 else
840869 middle = 0;
841870
871+ if (qp->s_flags & RVT_S_ECN) {
872+ qp->s_flags &= ~RVT_S_ECN;
873+ /* we recently received a FECN, so return a BECN */
874+ bth1 |= (IB_BECN_MASK << IB_BECN_SHIFT);
875+ middle = 0;
876+ }
842877 if (middle)
843878 build_ahg(qp, bth2);
844879 else
@@ -846,11 +881,6 @@ static inline void hfi1_make_ruc_header_9B(struct rvt_qp *qp, · 1 unmodified line
846881
847882 bth0 |= pkey;
848883 bth0 |= extra_bytes << 20;
849− if (qp->s_flags & RVT_S_ECN) {
850− qp->s_flags &= ~RVT_S_ECN;
851− /* we recently received a FECN, so return a BECN */
852− bth1 |= (IB_BECN_MASK << IB_BECN_SHIFT);
853− }
854884 hfi1_make_ruc_bth(qp, ohdr, bth0, bth1, bth2);
855885 hfi1_make_ib_hdr(&ps->s_txreq->phdr.hdr.ibh,
856886 lrh0,
drivers/infiniband/hw/hfi1/ud.c+2−2
@@ -628,7 +628,7 @@ int hfi1_lookup_pkey_idx(struct hfi1_ibport *ibp, u16 pkey) · 627 unmodified lines
628628 }
629629
630630 void return_cnp_16B(struct hfi1_ibport *ibp, struct rvt_qp *qp,
631− u32 remote_qpn, u32 pkey, u32 slid, u32 dlid,
631+ u32 remote_qpn, u16 pkey, u32 slid, u32 dlid,
632632 u8 sc5, const struct ib_grh *old_grh)
633633 {
634634 u64 pbc, pbc_flags = 0;
@@ -687,7 +687,7 @@ void return_cnp_16B(struct hfi1_ibport *ibp, struct rvt_qp *qp, · 52 unmodified lines
687687 }
688688
689689 void return_cnp(struct hfi1_ibport *ibp, struct rvt_qp *qp, u32 remote_qpn,
690− u32 pkey, u32 slid, u32 dlid, u8 sc5,
690+ u16 pkey, u32 slid, u32 dlid, u8 sc5,
691691 const struct ib_grh *old_grh)
692692 {
693693 u64 pbc, pbc_flags = 0;
drivers/infiniband/hw/hns/hns_roce_hem.c+6−6
@@ -912,7 +912,7 @@ int hns_roce_init_hem_table(struct hns_roce_dev *hr_dev, · 911 unmodified lines
912912 obj_per_chunk = buf_chunk_size / obj_size;
913913 num_hem = (nobj + obj_per_chunk - 1) / obj_per_chunk;
914914 bt_chunk_num = bt_chunk_size / 8;
915− if (table->type >= HEM_TYPE_MTT)
915+ if (type >= HEM_TYPE_MTT)
916916 num_bt_l0 = bt_chunk_num;
917917
918918 table->hem = kcalloc(num_hem, sizeof(*table->hem),
@@ -920,7 +920,7 @@ int hns_roce_init_hem_table(struct hns_roce_dev *hr_dev, · 1 unmodified line
920920 if (!table->hem)
921921 goto err_kcalloc_hem_buf;
922922
923− if (check_whether_bt_num_3(table->type, hop_num)) {
923+ if (check_whether_bt_num_3(type, hop_num)) {
924924 unsigned long num_bt_l1;
925925
926926 num_bt_l1 = (num_hem + bt_chunk_num - 1) /
@@ -939,8 +939,8 @@ int hns_roce_init_hem_table(struct hns_roce_dev *hr_dev, · 12 unmodified lines
939939 goto err_kcalloc_l1_dma;
940940 }
941941
942− if (check_whether_bt_num_2(table->type, hop_num) ||
943− check_whether_bt_num_3(table->type, hop_num)) {
942+ if (check_whether_bt_num_2(type, hop_num) ||
943+ check_whether_bt_num_3(type, hop_num)) {
944944 table->bt_l0 = kcalloc(num_bt_l0, sizeof(*table->bt_l0),
945945 GFP_KERNEL);
946946 if (!table->bt_l0)
@@ -1039,14 +1039,14 @@ void hns_roce_cleanup_hem_table(struct hns_roce_dev *hr_dev, · 92 unmodified lines
10391039 void hns_roce_cleanup_hem(struct hns_roce_dev *hr_dev)
10401040 {
10411041 hns_roce_cleanup_hem_table(hr_dev, &hr_dev->cq_table.table);
1042− hns_roce_cleanup_hem_table(hr_dev, &hr_dev->qp_table.irrl_table);
10431042 if (hr_dev->caps.trrl_entry_sz)
10441043 hns_roce_cleanup_hem_table(hr_dev,
10451044 &hr_dev->qp_table.trrl_table);
1045+ hns_roce_cleanup_hem_table(hr_dev, &hr_dev->qp_table.irrl_table);
10461046 hns_roce_cleanup_hem_table(hr_dev, &hr_dev->qp_table.qp_table);
10471047 hns_roce_cleanup_hem_table(hr_dev, &hr_dev->mr_table.mtpt_table);
1048− hns_roce_cleanup_hem_table(hr_dev, &hr_dev->mr_table.mtt_table);
10491048 if (hns_roce_check_whether_mhop(hr_dev, HEM_TYPE_CQE))
10501049 hns_roce_cleanup_hem_table(hr_dev,
10511050 &hr_dev->mr_table.mtt_cqe_table);
1051+ hns_roce_cleanup_hem_table(hr_dev, &hr_dev->mr_table.mtt_table);
10521052 }
drivers/infiniband/hw/hns/hns_roce_hw_v2.c+29−20
@@ -71,6 +71,11 @@ static int set_rwqe_data_seg(struct ib_qp *ibqp, struct ib_send_wr *wr, · 70 unmodified lines
7171 return -EINVAL;
7272 }
7373
74+ if (wr->opcode == IB_WR_RDMA_READ) {
75+ dev_err(hr_dev->dev, "Not support inline data!\n");
76+ return -EINVAL;
77+ }
78+
7479 for (i = 0; i < wr->num_sge; i++) {
7580 memcpy(wqe, ((void *)wr->sg_list[i].addr),
7681 wr->sg_list[i].length);
@@ -148,7 +153,7 @@ static int hns_roce_v2_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, · 71 unmodified lines
148153 ibqp->qp_type != IB_QPT_GSI &&
149154 ibqp->qp_type != IB_QPT_UD)) {
150155 dev_err(dev, "Not supported QP(0x%x)type!\n", ibqp->qp_type);
151− *bad_wr = NULL;
156+ *bad_wr = wr;
152157 return -EOPNOTSUPP;
153158 }
154159
@@ -182,7 +187,8 @@ static int hns_roce_v2_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, · 27 unmodified lines
182187 qp->sq.wrid[(qp->sq.head + nreq) & (qp->sq.wqe_cnt - 1)] =
183188 wr->wr_id;
184189
185− owner_bit = ~(qp->sq.head >> ilog2(qp->sq.wqe_cnt)) & 0x1;
190+ owner_bit =
191+ ~(((qp->sq.head + nreq) >> ilog2(qp->sq.wqe_cnt)) & 0x1);
186192
187193 /* Corresponding to the QP type, wqe process separately */
188194 if (ibqp->qp_type == IB_QPT_GSI) {
@@ -456,6 +462,7 @@ static int hns_roce_v2_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, · 267 unmodified lines
456462 } else {
457463 dev_err(dev, "Illegal qp_type(0x%x)\n", ibqp->qp_type);
458464 spin_unlock_irqrestore(&qp->sq.lock, flags);
465+ *bad_wr = wr;
459466 return -EOPNOTSUPP;
460467 }
461468 }
@@ -2592,10 +2599,12 @@ static void modify_qp_init_to_init(struct ib_qp *ibqp, · 2130 unmodified lines
25922599 roce_set_field(qpc_mask->byte_4_sqpn_tst, V2_QPC_BYTE_4_SQPN_M,
25932600 V2_QPC_BYTE_4_SQPN_S, 0);
25942601
2595− roce_set_field(context->byte_56_dqpn_err, V2_QPC_BYTE_56_DQPN_M,
2596− V2_QPC_BYTE_56_DQPN_S, hr_qp->qpn);
2597− roce_set_field(qpc_mask->byte_56_dqpn_err, V2_QPC_BYTE_56_DQPN_M,
2598− V2_QPC_BYTE_56_DQPN_S, 0);
2602+ if (attr_mask & IB_QP_DEST_QPN) {
2603+ roce_set_field(context->byte_56_dqpn_err, V2_QPC_BYTE_56_DQPN_M,
2604+ V2_QPC_BYTE_56_DQPN_S, hr_qp->qpn);
2605+ roce_set_field(qpc_mask->byte_56_dqpn_err,
2606+ V2_QPC_BYTE_56_DQPN_M, V2_QPC_BYTE_56_DQPN_S, 0);
2607+ }
25992608 roce_set_field(context->byte_168_irrl_idx,
26002609 V2_QPC_BYTE_168_SQ_SHIFT_BAK_M,
26012610 V2_QPC_BYTE_168_SQ_SHIFT_BAK_S,
@@ -2650,8 +2659,7 @@ static int modify_qp_init_to_rtr(struct ib_qp *ibqp, · 48 unmodified lines
26502659 return -EINVAL;
26512660 }
26522661
2653− if ((attr_mask & IB_QP_ALT_PATH) || (attr_mask & IB_QP_ACCESS_FLAGS) ||
2654− (attr_mask & IB_QP_PKEY_INDEX) || (attr_mask & IB_QP_QKEY)) {
2662+ if (attr_mask & IB_QP_ALT_PATH) {
26552663 dev_err(dev, "INIT2RTR attr_mask (0x%x) error\n", attr_mask);
26562664 return -EINVAL;
26572665 }
@@ -2800,10 +2808,12 @@ static int modify_qp_init_to_rtr(struct ib_qp *ibqp, · 142 unmodified lines
28002808 V2_QPC_BYTE_140_RR_MAX_S, 0);
28012809 }
28022810
2803− roce_set_field(context->byte_56_dqpn_err, V2_QPC_BYTE_56_DQPN_M,
2804− V2_QPC_BYTE_56_DQPN_S, attr->dest_qp_num);
2805− roce_set_field(qpc_mask->byte_56_dqpn_err, V2_QPC_BYTE_56_DQPN_M,
2806− V2_QPC_BYTE_56_DQPN_S, 0);
2811+ if (attr_mask & IB_QP_DEST_QPN) {
2812+ roce_set_field(context->byte_56_dqpn_err, V2_QPC_BYTE_56_DQPN_M,
2813+ V2_QPC_BYTE_56_DQPN_S, attr->dest_qp_num);
2814+ roce_set_field(qpc_mask->byte_56_dqpn_err,
2815+ V2_QPC_BYTE_56_DQPN_M, V2_QPC_BYTE_56_DQPN_S, 0);
2816+ }
28072817
28082818 /* Configure GID index */
28092819 port_num = rdma_ah_get_port_num(&attr->ah_attr);
@@ -2845,7 +2855,7 @@ static int modify_qp_init_to_rtr(struct ib_qp *ibqp, · 35 unmodified lines
28452855 if (ibqp->qp_type == IB_QPT_GSI || ibqp->qp_type == IB_QPT_UD)
28462856 roce_set_field(context->byte_24_mtu_tc, V2_QPC_BYTE_24_MTU_M,
28472857 V2_QPC_BYTE_24_MTU_S, IB_MTU_4096);
2848− else
2858+ else if (attr_mask & IB_QP_PATH_MTU)
28492859 roce_set_field(context->byte_24_mtu_tc, V2_QPC_BYTE_24_MTU_M,
28502860 V2_QPC_BYTE_24_MTU_S, attr->path_mtu);
28512861
@@ -2922,11 +2932,9 @@ static int modify_qp_rtr_to_rts(struct ib_qp *ibqp, · 70 unmodified lines
29222932 return -EINVAL;
29232933 }
29242934
2925− /* If exist optional param, return error */
2926− if ((attr_mask & IB_QP_ALT_PATH) || (attr_mask & IB_QP_ACCESS_FLAGS) ||
2927− (attr_mask & IB_QP_QKEY) || (attr_mask & IB_QP_PATH_MIG_STATE) ||
2928− (attr_mask & IB_QP_CUR_STATE) ||
2929− (attr_mask & IB_QP_MIN_RNR_TIMER)) {
2935+ /* Not support alternate path and path migration */
2936+ if ((attr_mask & IB_QP_ALT_PATH) ||
2937+ (attr_mask & IB_QP_PATH_MIG_STATE)) {
29302938 dev_err(dev, "RTR2RTS attr_mask (0x%x)error\n", attr_mask);
29312939 return -EINVAL;
29322940 }
@@ -3161,7 +3169,8 @@ static int hns_roce_v2_modify_qp(struct ib_qp *ibqp, · 228 unmodified lines
31613169 (cur_state == IB_QPS_RTR && new_state == IB_QPS_ERR) ||
31623170 (cur_state == IB_QPS_RTS && new_state == IB_QPS_ERR) ||
31633171 (cur_state == IB_QPS_SQD && new_state == IB_QPS_ERR) ||
3164− (cur_state == IB_QPS_SQE && new_state == IB_QPS_ERR)) {
3172+ (cur_state == IB_QPS_SQE && new_state == IB_QPS_ERR) ||
3173+ (cur_state == IB_QPS_ERR && new_state == IB_QPS_ERR)) {
31653174 /* Nothing */
31663175 ;
31673176 } else {
@@ -4478,7 +4487,7 @@ static int hns_roce_v2_create_eq(struct hns_roce_dev *hr_dev, · 1310 unmodified lines
44784487 ret = hns_roce_cmd_mbox(hr_dev, mailbox->dma, 0, eq->eqn, 0,
44794488 eq_cmd, HNS_ROCE_CMD_TIMEOUT_MSECS);
44804489 if (ret) {
4481− dev_err(dev, "[mailbox cmd] creat eqc failed.\n");
4490+ dev_err(dev, "[mailbox cmd] create eqc failed.\n");
44824491 goto err_cmd_mbox;
44834492 }
44844493
drivers/infiniband/hw/hns/hns_roce_qp.c+1−1
@@ -620,7 +620,7 @@ static int hns_roce_create_qp_common(struct hns_roce_dev *hr_dev, · 619 unmodified lines
620620 to_hr_ucontext(ib_pd->uobject->context),
621621 ucmd.db_addr, &hr_qp->rdb);
622622 if (ret) {
623− dev_err(dev, "rp record doorbell map failed!\n");
623+ dev_err(dev, "rq record doorbell map failed!\n");
624624 goto err_mtt;
625625 }
626626 }
drivers/infiniband/hw/mlx4/mr.c+1−1
@@ -346,7 +346,7 @@ int mlx4_ib_umem_calc_optimal_mtt_size(struct ib_umem *umem, u64 start_va, · 345 unmodified lines
346346 /* Add to the first block the misalignment that it suffers from. */
347347 total_len += (first_block_start & ((1ULL << block_shift) - 1ULL));
348348 last_block_end = current_block_start + current_block_len;
349− last_block_aligned_end = round_up(last_block_end, 1 << block_shift);
349+ last_block_aligned_end = round_up(last_block_end, 1ULL << block_shift);
350350 total_len += (last_block_aligned_end - last_block_end);
351351
352352 if (total_len & ((1ULL << block_shift) - 1ULL))
drivers/infiniband/hw/mlx4/qp.c+2−1
@@ -673,7 +673,8 @@ static int set_qp_rss(struct mlx4_ib_dev *dev, struct mlx4_ib_rss *rss_ctx, · 672 unmodified lines
673673 MLX4_IB_RX_HASH_SRC_PORT_TCP |
674674 MLX4_IB_RX_HASH_DST_PORT_TCP |
675675 MLX4_IB_RX_HASH_SRC_PORT_UDP |
676− MLX4_IB_RX_HASH_DST_PORT_UDP)) {
676+ MLX4_IB_RX_HASH_DST_PORT_UDP |
677+ MLX4_IB_RX_HASH_INNER)) {
677678 pr_debug("RX Hash fields_mask has unsupported mask (0x%llx)\n",
678679 ucmd->rx_hash_fields_mask);
679680 return (-EOPNOTSUPP);
drivers/infiniband/hw/mlx5/Kconfig+1−0
@@ -1,6 +1,7 @@
11 config MLX5_INFINIBAND
22 tristate "Mellanox Connect-IB HCA support"
33 depends on NETDEVICES && ETHERNET && PCI && MLX5_CORE
4+ depends on INFINIBAND_USER_ACCESS || INFINIBAND_USER_ACCESS=n
45 ---help---
56 This driver provides low-level InfiniBand support for
67 Mellanox Connect-IB PCI Express host channel adapters (HCAs).
drivers/infiniband/hw/mlx5/main.c+3−6
@@ -52,7 +52,6 @@ · 51 unmodified lines
5252 #include <linux/mlx5/port.h>
5353 #include <linux/mlx5/vport.h>
5454 #include <linux/mlx5/fs.h>
55−#include <linux/mlx5/fs_helpers.h>
5655 #include <linux/list.h>
5756 #include <rdma/ib_smi.h>
5857 #include <rdma/ib_umem.h>
@@ -180,7 +179,7 @@ static int mlx5_netdev_event(struct notifier_block *this, · 121 unmodified lines
180179 if (rep_ndev == ndev)
181180 roce->netdev = (event == NETDEV_UNREGISTER) ?
182181 NULL : ndev;
183− } else if (ndev->dev.parent == &ibdev->mdev->pdev->dev) {
182+ } else if (ndev->dev.parent == &mdev->pdev->dev) {
184183 roce->netdev = (event == NETDEV_UNREGISTER) ?
185184 NULL : ndev;
186185 }
@@ -4757,7 +4756,7 @@ mlx5_ib_get_vector_affinity(struct ib_device *ibdev, int comp_vector) · 4570 unmodified lines
47574756 {
47584757 struct mlx5_ib_dev *dev = to_mdev(ibdev);
47594758
4760− return mlx5_get_vector_affinity(dev->mdev, comp_vector);
4759+ return mlx5_get_vector_affinity_hint(dev->mdev, comp_vector);
47614760 }
47624761
47634762 /* The mlx5_ib_multiport_mutex should be held when calling this function */
@@ -5427,9 +5426,7 @@ static void mlx5_ib_stage_cong_debugfs_cleanup(struct mlx5_ib_dev *dev) · 663 unmodified lines
54275426 static int mlx5_ib_stage_uar_init(struct mlx5_ib_dev *dev)
54285427 {
54295428 dev->mdev->priv.uar = mlx5_get_uars_page(dev->mdev);
5430− if (!dev->mdev->priv.uar)
5431− return -ENOMEM;
5432− return 0;
5429+ return PTR_ERR_OR_ZERO(dev->mdev->priv.uar);
54335430 }
54345431
54355432 static void mlx5_ib_stage_uar_cleanup(struct mlx5_ib_dev *dev)
drivers/infiniband/hw/mlx5/mr.c+23−9
@@ -866,25 +866,28 @@ static int mr_umem_get(struct ib_pd *pd, u64 start, u64 length, · 865 unmodified lines
866866 int *order)
867867 {
868868 struct mlx5_ib_dev *dev = to_mdev(pd->device);
869+ struct ib_umem *u;
869870 int err;
870871
871− *umem = ib_umem_get(pd->uobject->context, start, length,
872− access_flags, 0);
873− err = PTR_ERR_OR_ZERO(*umem);
872+ *umem = NULL;
873+
874+ u = ib_umem_get(pd->uobject->context, start, length, access_flags, 0);
875+ err = PTR_ERR_OR_ZERO(u);
874876 if (err) {
875− *umem = NULL;
876− mlx5_ib_err(dev, "umem get failed (%d)\n", err);
877+ mlx5_ib_dbg(dev, "umem get failed (%d)\n", err);
877878 return err;
878879 }
879880
880− mlx5_ib_cont_pages(*umem, start, MLX5_MKEY_PAGE_SHIFT_MASK, npages,
881+ mlx5_ib_cont_pages(u, start, MLX5_MKEY_PAGE_SHIFT_MASK, npages,
881882 page_shift, ncont, order);
882883 if (!*npages) {
883884 mlx5_ib_warn(dev, "avoid zero region\n");
884− ib_umem_release(*umem);
885+ ib_umem_release(u);
885886 return -EINVAL;
886887 }
887888
889+ *umem = u;
890+
888891 mlx5_ib_dbg(dev, "npages %d, ncont %d, order %d, page_shift %d\n",
889892 *npages, *ncont, *order, *page_shift);
890893
@@ -1458,13 +1461,12 @@ int mlx5_ib_rereg_user_mr(struct ib_mr *ib_mr, int flags, u64 start, · 567 unmodified lines
14581461 int access_flags = flags & IB_MR_REREG_ACCESS ?
14591462 new_access_flags :
14601463 mr->access_flags;
1461− u64 addr = (flags & IB_MR_REREG_TRANS) ? virt_addr : mr->umem->address;
1462− u64 len = (flags & IB_MR_REREG_TRANS) ? length : mr->umem->length;
14631464 int page_shift = 0;
14641465 int upd_flags = 0;
14651466 int npages = 0;
14661467 int ncont = 0;
14671468 int order = 0;
1469+ u64 addr, len;
14681470 int err;
14691471
14701472 mlx5_ib_dbg(dev, "start 0x%llx, virt_addr 0x%llx, length 0x%llx, access_flags 0x%x\n",
@@ -1472,6 +1474,17 @@ int mlx5_ib_rereg_user_mr(struct ib_mr *ib_mr, int flags, u64 start, · 1 unmodified line
14721474
14731475 atomic_sub(mr->npages, &dev->mdev->priv.reg_pages);
14741476
1477+ if (!mr->umem)
1478+ return -EINVAL;
1479+
1480+ if (flags & IB_MR_REREG_TRANS) {
1481+ addr = virt_addr;
1482+ len = length;
1483+ } else {
1484+ addr = mr->umem->address;
1485+ len = mr->umem->length;
1486+ }
1487+
14751488 if (flags != IB_MR_REREG_PD) {
14761489 /*
14771490 * Replace umem. This needs to be done whether or not UMR is
@@ -1479,6 +1492,7 @@ int mlx5_ib_rereg_user_mr(struct ib_mr *ib_mr, int flags, u64 start, · 1 unmodified line
14791492 */
14801493 flags |= IB_MR_REREG_TRANS;
14811494 ib_umem_release(mr->umem);
1495+ mr->umem = NULL;
14821496 err = mr_umem_get(pd, addr, len, access_flags, &mr->umem,
14831497 &npages, &page_shift, &ncont, &order);
14841498 if (err)
drivers/infiniband/hw/mlx5/qp.c+13−9
@@ -259,7 +259,11 @@ static int set_rq_size(struct mlx5_ib_dev *dev, struct ib_qp_cap *cap, · 258 unmodified lines
259259 } else {
260260 if (ucmd) {
261261 qp->rq.wqe_cnt = ucmd->rq_wqe_count;
262+ if (ucmd->rq_wqe_shift > BITS_PER_BYTE * sizeof(ucmd->rq_wqe_shift))
263+ return -EINVAL;
262264 qp->rq.wqe_shift = ucmd->rq_wqe_shift;
265+ if ((1 << qp->rq.wqe_shift) / sizeof(struct mlx5_wqe_data_seg) < qp->wq_sig)
266+ return -EINVAL;
263267 qp->rq.max_gs = (1 << qp->rq.wqe_shift) / sizeof(struct mlx5_wqe_data_seg) - qp->wq_sig;
264268 qp->rq.max_post = qp->rq.wqe_cnt;
265269 } else {
@@ -2451,18 +2455,18 @@ enum { · 2185 unmodified lines
24512455
24522456 static int ib_rate_to_mlx5(struct mlx5_ib_dev *dev, u8 rate)
24532457 {
2454− if (rate == IB_RATE_PORT_CURRENT) {
2458+ if (rate == IB_RATE_PORT_CURRENT)
24552459 return 0;
2456− } else if (rate < IB_RATE_2_5_GBPS || rate > IB_RATE_300_GBPS) {
2460+
2461+ if (rate < IB_RATE_2_5_GBPS || rate > IB_RATE_300_GBPS)
24572462 return -EINVAL;
2458− } else {
2459− while (rate != IB_RATE_2_5_GBPS &&
2460− !(1 << (rate + MLX5_STAT_RATE_OFFSET) &
2461− MLX5_CAP_GEN(dev->mdev, stat_rate_support)))
2462− --rate;
2463− }
24642463
2465− return rate + MLX5_STAT_RATE_OFFSET;
2464+ while (rate != IB_RATE_PORT_CURRENT &&
2465+ !(1 << (rate + MLX5_STAT_RATE_OFFSET) &
2466+ MLX5_CAP_GEN(dev->mdev, stat_rate_support)))
2467+ --rate;
2468+
2469+ return rate ? rate + MLX5_STAT_RATE_OFFSET : rate;
24662470 }
24672471
24682472 static int modify_raw_packet_eth_prio(struct mlx5_core_dev *dev,
drivers/infiniband/hw/nes/nes_nic.c+1−1
@@ -461,7 +461,7 @@ static bool nes_nic_send(struct sk_buff *skb, struct net_device *netdev) · 460 unmodified lines
461461 /**
462462 * nes_netdev_start_xmit
463463 */
464−static int nes_netdev_start_xmit(struct sk_buff *skb, struct net_device *netdev)
464+static netdev_tx_t nes_netdev_start_xmit(struct sk_buff *skb, struct net_device *netdev)
465465 {
466466 struct nes_vnic *nesvnic = netdev_priv(netdev);
467467 struct nes_device *nesdev = nesvnic->nesdev;
drivers/infiniband/sw/rxe/rxe_opcode.c+1−1
@@ -390,7 +390,7 @@ struct rxe_opcode_info rxe_opcode[RXE_NUM_OPCODE] = { · 389 unmodified lines
390390 .name = "IB_OPCODE_RC_SEND_ONLY_INV",
391391 .mask = RXE_IETH_MASK | RXE_PAYLOAD_MASK | RXE_REQ_MASK
392392 | RXE_COMP_MASK | RXE_RWR_MASK | RXE_SEND_MASK
393− | RXE_END_MASK,
393+ | RXE_END_MASK | RXE_START_MASK,
394394 .length = RXE_BTH_BYTES + RXE_IETH_BYTES,
395395 .offset = {
396396 [RXE_BTH] = 0,
drivers/infiniband/sw/rxe/rxe_req.c+0−1
@@ -728,7 +728,6 @@ next_wqe: · 727 unmodified lines
728728 rollback_state(wqe, qp, &rollback_wqe, rollback_psn);
729729
730730 if (ret == -EAGAIN) {
731− kfree_skb(skb);
732731 rxe_run_task(&qp->req.task, 1);
733732 goto exit;
734733 }
drivers/infiniband/sw/rxe/rxe_resp.c+1−5
@@ -742,7 +742,6 @@ static enum resp_states read_reply(struct rxe_qp *qp, · 741 unmodified lines
742742 err = rxe_xmit_packet(rxe, qp, &ack_pkt, skb);
743743 if (err) {
744744 pr_err("Failed sending RDMA reply.\n");
745− kfree_skb(skb);
746745 return RESPST_ERR_RNR;
747746 }
748747
@@ -954,10 +953,8 @@ static int send_ack(struct rxe_qp *qp, struct rxe_pkt_info *pkt, · 205 unmodified lines
954953 }
955954
956955 err = rxe_xmit_packet(rxe, qp, &ack_pkt, skb);
957− if (err) {
956+ if (err)
958957 pr_err_ratelimited("Failed sending ack\n");
959− kfree_skb(skb);
960− }
961958
962959 err1:
963960 return err;
@@ -1141,7 +1138,6 @@ static enum resp_states duplicate_request(struct rxe_qp *qp, · 177 unmodified lines
11411138 if (rc) {
11421139 pr_err("Failed resending result. This flow is not handled - skb ignored\n");
11431140 rxe_drop_ref(qp);
1144− kfree_skb(skb_copy);
11451141 rc = RESPST_CLEANUP;
11461142 goto out;
11471143 }
drivers/infiniband/ulp/ipoib/ipoib_main.c+1−1
@@ -1094,7 +1094,7 @@ drop_and_unlock: · 1093 unmodified lines
10941094 spin_unlock_irqrestore(&priv->lock, flags);
10951095 }
10961096
1097−static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev)
1097+static netdev_tx_t ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev)
10981098 {
10991099 struct ipoib_dev_priv *priv = ipoib_priv(dev);
11001100 struct rdma_netdev *rn = netdev_priv(dev);
drivers/infiniband/ulp/srp/Kconfig+1−1
@@ -1,6 +1,6 @@
11 config INFINIBAND_SRP
22 tristate "InfiniBand SCSI RDMA Protocol"
3− depends on SCSI
3+ depends on SCSI && INFINIBAND_ADDR_TRANS
44 select SCSI_SRP_ATTRS
55 ---help---
66 Support for the SCSI RDMA Protocol over InfiniBand. This
drivers/infiniband/ulp/srpt/Kconfig+1−1
@@ -1,6 +1,6 @@
11 config INFINIBAND_SRPT
22 tristate "InfiniBand SCSI RDMA Protocol target support"
3− depends on INFINIBAND && TARGET_CORE
3+ depends on INFINIBAND && INFINIBAND_ADDR_TRANS && TARGET_CORE
44 ---help---
55
66 Support for the SCSI RDMA Protocol (SRP) Target driver. The
drivers/input/evdev.c+6−1
@@ -31,6 +31,7 @@ · 30 unmodified lines
3131 enum evdev_clock_type {
3232 EV_CLK_REAL = 0,
3333 EV_CLK_MONO,
34+ EV_CLK_BOOT,
3435 EV_CLK_MAX
3536 };
3637
@@ -197,10 +198,12 @@ static int evdev_set_clk_type(struct evdev_client *client, unsigned int clkid) · 160 unmodified lines
197198 case CLOCK_REALTIME:
198199 clk_type = EV_CLK_REAL;
199200 break;
200− case CLOCK_BOOTTIME:
201201 case CLOCK_MONOTONIC:
202202 clk_type = EV_CLK_MONO;
203203 break;
204+ case CLOCK_BOOTTIME:
205+ clk_type = EV_CLK_BOOT;
206+ break;
204207 default:
205208 return -EINVAL;
206209 }
@@ -311,6 +314,8 @@ static void evdev_events(struct input_handle *handle, · 104 unmodified lines
311314
312315 ev_time[EV_CLK_MONO] = ktime_get();
313316 ev_time[EV_CLK_REAL] = ktime_mono_to_real(ev_time[EV_CLK_MONO]);
317+ ev_time[EV_CLK_BOOT] = ktime_mono_to_any(ev_time[EV_CLK_MONO],
318+ TK_OFFS_BOOT);
314319
315320 rcu_read_lock();
316321
drivers/input/input-leds.c+4−4
@@ -88,6 +88,7 @@ static int input_leds_connect(struct input_handler *handler, · 87 unmodified lines
8888 const struct input_device_id *id)
8989 {
9090 struct input_leds *leds;
91+ struct input_led *led;
9192 unsigned int num_leds;
9293 unsigned int led_code;
9394 int led_no;
@@ -119,14 +120,13 @@ static int input_leds_connect(struct input_handler *handler, · 25 unmodified lines
119120
120121 led_no = 0;
121122 for_each_set_bit(led_code, dev->ledbit, LED_CNT) {
122− struct input_led *led = &leds->leds[led_no];
123+ if (!input_led_info[led_code].name)
124+ continue;
123125
126+ led = &leds->leds[led_no];
124127 led->handle = &leds->handle;
125128 led->code = led_code;
126129
127− if (!input_led_info[led_code].name)
128− continue;
129−
130130 led->cdev.name = kasprintf(GFP_KERNEL, "%s::%s",
131131 dev_name(&dev->dev),
132132 input_led_info[led_code].name);
drivers/input/mouse/alps.c+1−1
@@ -583,7 +583,7 @@ static void alps_process_trackstick_packet_v3(struct psmouse *psmouse) · 582 unmodified lines
583583
584584 x = (s8)(((packet[0] & 0x20) << 2) | (packet[1] & 0x7f));
585585 y = (s8)(((packet[0] & 0x10) << 3) | (packet[2] & 0x7f));
586− z = packet[4] & 0x7c;
586+ z = packet[4] & 0x7f;
587587
588588 /*
589589 * The x and y values tend to be quite large, and when used
drivers/input/rmi4/rmi_spi.c+5−2
@@ -147,8 +147,11 @@ static int rmi_spi_xfer(struct rmi_spi_xport *rmi_spi, · 146 unmodified lines
147147 if (len > RMI_SPI_XFER_SIZE_LIMIT)
148148 return -EINVAL;
149149
150− if (rmi_spi->xfer_buf_size < len)
151− rmi_spi_manage_pools(rmi_spi, len);
150+ if (rmi_spi->xfer_buf_size < len) {
151+ ret = rmi_spi_manage_pools(rmi_spi, len);
152+ if (ret < 0)
153+ return ret;
154+ }
152155
153156 if (addr == 0)
154157 /*
drivers/input/touchscreen/Kconfig+1−1
@@ -362,7 +362,7 @@ config TOUCHSCREEN_HIDEEP · 361 unmodified lines
362362
363363 If unsure, say N.
364364
365− To compile this driver as a moudle, choose M here : the
365+ To compile this driver as a module, choose M here : the
366366 module will be called hideep_ts.
367367
368368 config TOUCHSCREEN_ILI210X
drivers/input/touchscreen/atmel_mxt_ts.c+124−76
@@ -280,7 +280,8 @@ struct mxt_data { · 279 unmodified lines
280280 struct input_dev *input_dev;
281281 char phys[64]; /* device physical location */
282282 struct mxt_object *object_table;
283− struct mxt_info info;
283+ struct mxt_info *info;
284+ void *raw_info_block;
284285 unsigned int irq;
285286 unsigned int max_x;
286287 unsigned int max_y;
@@ -460,12 +461,13 @@ static int mxt_lookup_bootloader_address(struct mxt_data *data, bool retry) · 173 unmodified lines
460461 {
461462 u8 appmode = data->client->addr;
462463 u8 bootloader;
464+ u8 family_id = data->info ? data->info->family_id : 0;
463465
464466 switch (appmode) {
465467 case 0x4a:
466468 case 0x4b:
467469 /* Chips after 1664S use different scheme */
468− if (retry || data->info.family_id >= 0xa2) {
470+ if (retry || family_id >= 0xa2) {
469471 bootloader = appmode - 0x24;
470472 break;
471473 }
@@ -692,7 +694,7 @@ mxt_get_object(struct mxt_data *data, u8 type) · 220 unmodified lines
692694 struct mxt_object *object;
693695 int i;
694696
695− for (i = 0; i < data->info.object_num; i++) {
697+ for (i = 0; i < data->info->object_num; i++) {
696698 object = data->object_table + i;
697699 if (object->type == type)
698700 return object;
@@ -1462,12 +1464,12 @@ static int mxt_update_cfg(struct mxt_data *data, const struct firmware *cfg) · 763 unmodified lines
14621464 data_pos += offset;
14631465 }
14641466
1465− if (cfg_info.family_id != data->info.family_id) {
1467+ if (cfg_info.family_id != data->info->family_id) {
14661468 dev_err(dev, "Family ID mismatch!\n");
14671469 return -EINVAL;
14681470 }
14691471
1470− if (cfg_info.variant_id != data->info.variant_id) {
1472+ if (cfg_info.variant_id != data->info->variant_id) {
14711473 dev_err(dev, "Variant ID mismatch!\n");
14721474 return -EINVAL;
14731475 }
@@ -1512,7 +1514,7 @@ static int mxt_update_cfg(struct mxt_data *data, const struct firmware *cfg) · 38 unmodified lines
15121514
15131515 /* Malloc memory to store configuration */
15141516 cfg_start_ofs = MXT_OBJECT_START +
1515− data->info.object_num * sizeof(struct mxt_object) +
1517+ data->info->object_num * sizeof(struct mxt_object) +
15161518 MXT_INFO_CHECKSUM_SIZE;
15171519 config_mem_size = data->mem_size - cfg_start_ofs;
15181520 config_mem = kzalloc(config_mem_size, GFP_KERNEL);
@@ -1563,20 +1565,6 @@ release_mem: · 44 unmodified lines
15631565 return ret;
15641566 }
15651567
1566−static int mxt_get_info(struct mxt_data *data)
1567−{
1568− struct i2c_client *client = data->client;
1569− struct mxt_info *info = &data->info;
1570− int error;
1571−
1572− /* Read 7-byte info block starting at address 0 */
1573− error = __mxt_read_reg(client, 0, sizeof(*info), info);
1574− if (error)
1575− return error;
1576−
1577− return 0;
1578−}
1579−
15801568 static void mxt_free_input_device(struct mxt_data *data)
15811569 {
15821570 if (data->input_dev) {
@@ -1591,9 +1579,10 @@ static void mxt_free_object_table(struct mxt_data *data) · 8 unmodified lines
15911579 video_unregister_device(&data->dbg.vdev);
15921580 v4l2_device_unregister(&data->dbg.v4l2);
15931581 #endif
1594−
1595− kfree(data->object_table);
15961582 data->object_table = NULL;
1583+ data->info = NULL;
1584+ kfree(data->raw_info_block);
1585+ data->raw_info_block = NULL;
15971586 kfree(data->msg_buf);
15981587 data->msg_buf = NULL;
15991588 data->T5_address = 0;
@@ -1609,34 +1598,18 @@ static void mxt_free_object_table(struct mxt_data *data) · 9 unmodified lines
16091598 data->max_reportid = 0;
16101599 }
16111600
1612−static int mxt_get_object_table(struct mxt_data *data)
1601+static int mxt_parse_object_table(struct mxt_data *data,
1602+ struct mxt_object *object_table)
16131603 {
16141604 struct i2c_client *client = data->client;
1615− size_t table_size;
1616− struct mxt_object *object_table;
1617− int error;
16181605 int i;
16191606 u8 reportid;
16201607 u16 end_address;
16211608
1622− table_size = data->info.object_num * sizeof(struct mxt_object);
1623− object_table = kzalloc(table_size, GFP_KERNEL);
1624− if (!object_table) {
1625− dev_err(&data->client->dev, "Failed to allocate memory\n");
1626− return -ENOMEM;
1627− }
1628−
1629− error = __mxt_read_reg(client, MXT_OBJECT_START, table_size,
1630− object_table);
1631− if (error) {
1632− kfree(object_table);
1633− return error;
1634− }
1635−
16361609 /* Valid Report IDs start counting from 1 */
16371610 reportid = 1;
16381611 data->mem_size = 0;
1639− for (i = 0; i < data->info.object_num; i++) {
1612+ for (i = 0; i < data->info->object_num; i++) {
16401613 struct mxt_object *object = object_table + i;
16411614 u8 min_id, max_id;
16421615
@@ -1660,8 +1633,8 @@ static int mxt_get_object_table(struct mxt_data *data) · 17 unmodified lines
16601633
16611634 switch (object->type) {
16621635 case MXT_GEN_MESSAGE_T5:
1663− if (data->info.family_id == 0x80 &&
1664− data->info.version < 0x20) {
1636+ if (data->info->family_id == 0x80 &&
1637+ data->info->version < 0x20) {
16651638 /*
16661639 * On mXT224 firmware versions prior to V2.0
16671640 * read and discard unused CRC byte otherwise
@@ -1716,24 +1689,102 @@ static int mxt_get_object_table(struct mxt_data *data) · 48 unmodified lines
17161689 /* If T44 exists, T5 position has to be directly after */
17171690 if (data->T44_address && (data->T5_address != data->T44_address + 1)) {
17181691 dev_err(&client->dev, "Invalid T44 position\n");
1719− error = -EINVAL;
1720− goto free_object_table;
1692+ return -EINVAL;
17211693 }
17221694
17231695 data->msg_buf = kcalloc(data->max_reportid,
17241696 data->T5_msg_size, GFP_KERNEL);
1725− if (!data->msg_buf) {
1726− dev_err(&client->dev, "Failed to allocate message buffer\n");
1697+ if (!data->msg_buf)
1698+ return -ENOMEM;
1699+
1700+ return 0;
1701+}
1702+
1703+static int mxt_read_info_block(struct mxt_data *data)
1704+{
1705+ struct i2c_client *client = data->client;
1706+ int error;
1707+ size_t size;
1708+ void *id_buf, *buf;
1709+ uint8_t num_objects;
1710+ u32 calculated_crc;
1711+ u8 *crc_ptr;
1712+
1713+ /* If info block already allocated, free it */
1714+ if (data->raw_info_block)
1715+ mxt_free_object_table(data);
1716+
1717+ /* Read 7-byte ID information block starting at address 0 */
1718+ size = sizeof(struct mxt_info);
1719+ id_buf = kzalloc(size, GFP_KERNEL);
1720+ if (!id_buf)
1721+ return -ENOMEM;
1722+
1723+ error = __mxt_read_reg(client, 0, size, id_buf);
1724+ if (error)
1725+ goto err_free_mem;
1726+
1727+ /* Resize buffer to give space for rest of info block */
1728+ num_objects = ((struct mxt_info *)id_buf)->object_num;
1729+ size += (num_objects * sizeof(struct mxt_object))
1730+ + MXT_INFO_CHECKSUM_SIZE;
1731+
1732+ buf = krealloc(id_buf, size, GFP_KERNEL);
1733+ if (!buf) {
17271734 error = -ENOMEM;
1728− goto free_object_table;
1735+ goto err_free_mem;
1736+ }
1737+ id_buf = buf;
1738+
1739+ /* Read rest of info block */
1740+ error = __mxt_read_reg(client, MXT_OBJECT_START,
1741+ size - MXT_OBJECT_START,
1742+ id_buf + MXT_OBJECT_START);
1743+ if (error)
1744+ goto err_free_mem;
1745+
1746+ /* Extract & calculate checksum */
1747+ crc_ptr = id_buf + size - MXT_INFO_CHECKSUM_SIZE;
1748+ data->info_crc = crc_ptr[0] | (crc_ptr[1] << 8) | (crc_ptr[2] << 16);
1749+
1750+ calculated_crc = mxt_calculate_crc(id_buf, 0,
1751+ size - MXT_INFO_CHECKSUM_SIZE);
1752+
1753+ /*
1754+ * CRC mismatch can be caused by data corruption due to I2C comms
1755+ * issue or else device is not using Object Based Protocol (eg i2c-hid)
1756+ */
1757+ if ((data->info_crc == 0) || (data->info_crc != calculated_crc)) {
1758+ dev_err(&client->dev,
1759+ "Info Block CRC error calculated=0x%06X read=0x%06X\n",
1760+ calculated_crc, data->info_crc);
1761+ error = -EIO;
1762+ goto err_free_mem;
1763+ }
1764+
1765+ data->raw_info_block = id_buf;
1766+ data->info = (struct mxt_info *)id_buf;
1767+
1768+ dev_info(&client->dev,
1769+ "Family: %u Variant: %u Firmware V%u.%u.%02X Objects: %u\n",
1770+ data->info->family_id, data->info->variant_id,
1771+ data->info->version >> 4, data->info->version & 0xf,
1772+ data->info->build, data->info->object_num);
1773+
1774+ /* Parse object table information */
1775+ error = mxt_parse_object_table(data, id_buf + MXT_OBJECT_START);
1776+ if (error) {
1777+ dev_err(&client->dev, "Error %d parsing object table\n", error);
1778+ mxt_free_object_table(data);
1779+ goto err_free_mem;
17291780 }
17301781
1731− data->object_table = object_table;
1782+ data->object_table = (struct mxt_object *)(id_buf + MXT_OBJECT_START);
17321783
17331784 return 0;
17341785
1735−free_object_table:
1736− mxt_free_object_table(data);
1786+err_free_mem:
1787+ kfree(id_buf);
17371788 return error;
17381789 }
17391790
@@ -2046,7 +2097,7 @@ static int mxt_initialize(struct mxt_data *data) · 306 unmodified lines
20462097 int error;
20472098
20482099 while (1) {
2049− error = mxt_get_info(data);
2100+ error = mxt_read_info_block(data);
20502101 if (!error)
20512102 break;
20522103
@@ -2077,16 +2128,9 @@ static int mxt_initialize(struct mxt_data *data) · 24 unmodified lines
20772128 msleep(MXT_FW_RESET_TIME);
20782129 }
20792130
2080− /* Get object table information */
2081− error = mxt_get_object_table(data);
2082− if (error) {
2083− dev_err(&client->dev, "Error %d reading object table\n", error);
2084− return error;
2085− }
2086−
20872131 error = mxt_acquire_irq(data);
20882132 if (error)
2089− goto err_free_object_table;
2133+ return error;
20902134
20912135 error = request_firmware_nowait(THIS_MODULE, true, MXT_CFG_NAME,
20922136 &client->dev, GFP_KERNEL, data,
@@ -2094,14 +2138,10 @@ static int mxt_initialize(struct mxt_data *data) · 1 unmodified line
20942138 if (error) {
20952139 dev_err(&client->dev, "Failed to invoke firmware loader: %d\n",
20962140 error);
2097− goto err_free_object_table;
2141+ return error;
20982142 }
20992143
21002144 return 0;
2101−
2102−err_free_object_table:
2103− mxt_free_object_table(data);
2104− return error;
21052145 }
21062146
21072147 static int mxt_set_t7_power_cfg(struct mxt_data *data, u8 sleep)
@@ -2162,7 +2202,7 @@ recheck: · 54 unmodified lines
21622202 static u16 mxt_get_debug_value(struct mxt_data *data, unsigned int x,
21632203 unsigned int y)
21642204 {
2165− struct mxt_info *info = &data->info;
2205+ struct mxt_info *info = data->info;
21662206 struct mxt_dbg *dbg = &data->dbg;
21672207 unsigned int ofs, page;
21682208 unsigned int col = 0;
@@ -2490,7 +2530,7 @@ static const struct video_device mxt_video_device = { · 321 unmodified lines
24902530
24912531 static void mxt_debug_init(struct mxt_data *data)
24922532 {
2493− struct mxt_info *info = &data->info;
2533+ struct mxt_info *info = data->info;
24942534 struct mxt_dbg *dbg = &data->dbg;
24952535 struct mxt_object *object;
24962536 int error;
@@ -2576,7 +2616,6 @@ static int mxt_configure_objects(struct mxt_data *data, · 79 unmodified lines
25762616 const struct firmware *cfg)
25772617 {
25782618 struct device *dev = &data->client->dev;
2579− struct mxt_info *info = &data->info;
25802619 int error;
25812620
25822621 error = mxt_init_t7_power_cfg(data);
@@ -2601,11 +2640,6 @@ static int mxt_configure_objects(struct mxt_data *data, · 18 unmodified lines
26012640
26022641 mxt_debug_init(data);
26032642
2604− dev_info(dev,
2605− "Family: %u Variant: %u Firmware V%u.%u.%02X Objects: %u\n",
2606− info->family_id, info->variant_id, info->version >> 4,
2607− info->version & 0xf, info->build, info->object_num);
2608−
26092643 return 0;
26102644 }
26112645
@@ -2614,7 +2648,7 @@ static ssize_t mxt_fw_version_show(struct device *dev, · 2 unmodified lines
26142648 struct device_attribute *attr, char *buf)
26152649 {
26162650 struct mxt_data *data = dev_get_drvdata(dev);
2617− struct mxt_info *info = &data->info;
2651+ struct mxt_info *info = data->info;
26182652 return scnprintf(buf, PAGE_SIZE, "%u.%u.%02X\n",
26192653 info->version >> 4, info->version & 0xf, info->build);
26202654 }
@@ -2624,7 +2658,7 @@ static ssize_t mxt_hw_version_show(struct device *dev, · 3 unmodified lines
26242658 struct device_attribute *attr, char *buf)
26252659 {
26262660 struct mxt_data *data = dev_get_drvdata(dev);
2627− struct mxt_info *info = &data->info;
2661+ struct mxt_info *info = data->info;
26282662 return scnprintf(buf, PAGE_SIZE, "%u.%u\n",
26292663 info->family_id, info->variant_id);
26302664 }
@@ -2663,7 +2697,7 @@ static ssize_t mxt_object_show(struct device *dev, · 32 unmodified lines
26632697 return -ENOMEM;
26642698
26652699 error = 0;
2666− for (i = 0; i < data->info.object_num; i++) {
2700+ for (i = 0; i < data->info->object_num; i++) {
26672701 object = data->object_table + i;
26682702
26692703 if (!mxt_object_readable(object->type))
@@ -3034,6 +3068,15 @@ static const struct dmi_system_id mxt_dmi_table[] = { · 364 unmodified lines
30343068 },
30353069 .driver_data = samus_platform_data,
30363070 },
3071+ {
3072+ /* Samsung Chromebook Pro */
3073+ .ident = "Samsung Chromebook Pro",
3074+ .matches = {
3075+ DMI_MATCH(DMI_SYS_VENDOR, "Google"),
3076+ DMI_MATCH(DMI_PRODUCT_NAME, "Caroline"),
3077+ },
3078+ .driver_data = samus_platform_data,
3079+ },
30373080 {
30383081 /* Other Google Chromebooks */
30393082 .ident = "Chromebook",
@@ -3254,6 +3297,11 @@ static SIMPLE_DEV_PM_OPS(mxt_pm_ops, mxt_suspend, mxt_resume); · 214 unmodified lines
32543297
32553298 static const struct of_device_id mxt_of_match[] = {
32563299 { .compatible = "atmel,maxtouch", },
3300+ /* Compatibles listed below are deprecated */
3301+ { .compatible = "atmel,qt602240_ts", },
3302+ { .compatible = "atmel,atmel_mxt_ts", },
3303+ { .compatible = "atmel,atmel_mxt_tp", },
3304+ { .compatible = "atmel,mXT224", },
32573305 {},
32583306 };
32593307 MODULE_DEVICE_TABLE(of, mxt_of_match);
drivers/iommu/amd_iommu.c+1−1
@@ -83,7 +83,6 @@ · 82 unmodified lines
8383
8484 static DEFINE_SPINLOCK(amd_iommu_devtable_lock);
8585 static DEFINE_SPINLOCK(pd_bitmap_lock);
86−static DEFINE_SPINLOCK(iommu_table_lock);
8786
8887 /* List of all available dev_data structures */
8988 static LLIST_HEAD(dev_data_list);
@@ -3562,6 +3561,7 @@ EXPORT_SYMBOL(amd_iommu_device_info); · 3472 unmodified lines
35623561 *****************************************************************************/
35633562
35643563 static struct irq_chip amd_ir_chip;
3564+static DEFINE_SPINLOCK(iommu_table_lock);
35653565
35663566 static void set_dte_irq_entry(u16 devid, struct irq_remap_table *table)
35673567 {
drivers/iommu/dma-iommu.c+25−29
@@ -167,40 +167,16 @@ EXPORT_SYMBOL(iommu_put_dma_cookie); · 166 unmodified lines
167167 * @list: Reserved region list from iommu_get_resv_regions()
168168 *
169169 * IOMMU drivers can use this to implement their .get_resv_regions callback
170− * for general non-IOMMU-specific reservations. Currently, this covers host
171− * bridge windows for PCI devices and GICv3 ITS region reservation on ACPI
172− * based ARM platforms that may require HW MSI reservation.
170+ * for general non-IOMMU-specific reservations. Currently, this covers GICv3
171+ * ITS region reservation on ACPI based ARM platforms that may require HW MSI
172+ * reservation.
173173 */
174174 void iommu_dma_get_resv_regions(struct device *dev, struct list_head *list)
175175 {
176− struct pci_host_bridge *bridge;
177− struct resource_entry *window;
178−
179− if (!is_of_node(dev->iommu_fwspec->iommu_fwnode) &&
180− iort_iommu_msi_get_resv_regions(dev, list) < 0)
181− return;
182−
183− if (!dev_is_pci(dev))
184− return;
185−
186− bridge = pci_find_host_bridge(to_pci_dev(dev)->bus);
187− resource_list_for_each_entry(window, &bridge->windows) {
188− struct iommu_resv_region *region;
189− phys_addr_t start;
190− size_t length;
191−
192− if (resource_type(window->res) != IORESOURCE_MEM)
193− continue;
194176
195− start = window->res->start - window->offset;
196− length = window->res->end - window->res->start + 1;
197− region = iommu_alloc_resv_region(start, length, 0,
198− IOMMU_RESV_RESERVED);
199− if (!region)
200− return;
177+ if (!is_of_node(dev->iommu_fwspec->iommu_fwnode))
178+ iort_iommu_msi_get_resv_regions(dev, list);
201179
202− list_add_tail(&region->list, list);
203− }
204180 }
205181 EXPORT_SYMBOL(iommu_dma_get_resv_regions);
206182
@@ -229,6 +205,23 @@ static int cookie_init_hw_msi_region(struct iommu_dma_cookie *cookie, · 22 unmodified lines
229205 return 0;
230206 }
231207
208+static void iova_reserve_pci_windows(struct pci_dev *dev,
209+ struct iova_domain *iovad)
210+{
211+ struct pci_host_bridge *bridge = pci_find_host_bridge(dev->bus);
212+ struct resource_entry *window;
213+ unsigned long lo, hi;
214+
215+ resource_list_for_each_entry(window, &bridge->windows) {
216+ if (resource_type(window->res) != IORESOURCE_MEM)
217+ continue;
218+
219+ lo = iova_pfn(iovad, window->res->start - window->offset);
220+ hi = iova_pfn(iovad, window->res->end - window->offset);
221+ reserve_iova(iovad, lo, hi);
222+ }
223+}
224+
232225 static int iova_reserve_iommu_regions(struct device *dev,
233226 struct iommu_domain *domain)
234227 {
@@ -238,6 +231,9 @@ static int iova_reserve_iommu_regions(struct device *dev, · 3 unmodified lines
238231 LIST_HEAD(resv_regions);
239232 int ret = 0;
240233
234+ if (dev_is_pci(dev))
235+ iova_reserve_pci_windows(to_pci_dev(dev), iovad);
236+
241237 iommu_get_resv_regions(dev, &resv_regions);
242238 list_for_each_entry(region, &resv_regions, list) {
243239 unsigned long lo, hi;
drivers/iommu/dmar.c+1−1
@@ -1345,7 +1345,7 @@ void qi_flush_dev_iotlb(struct intel_iommu *iommu, u16 sid, u16 qdep, · 1344 unmodified lines
13451345 struct qi_desc desc;
13461346
13471347 if (mask) {
1348− BUG_ON(addr & ((1 << (VTD_PAGE_SHIFT + mask)) - 1));
1348+ WARN_ON_ONCE(addr & ((1ULL << (VTD_PAGE_SHIFT + mask)) - 1));
13491349 addr |= (1ULL << (VTD_PAGE_SHIFT + mask - 1)) - 1;
13501350 desc.high = QI_DEV_IOTLB_ADDR(addr) | QI_DEV_IOTLB_SIZE;
13511351 } else
drivers/iommu/intel_irq_remapping.c+1−1
@@ -1136,7 +1136,7 @@ static void intel_ir_reconfigure_irte(struct irq_data *irqd, bool force) · 1135 unmodified lines
11361136 irte->dest_id = IRTE_DEST(cfg->dest_apicid);
11371137
11381138 /* Update the hardware only if the interrupt is in remapped mode. */
1139− if (!force || ir_data->irq_2_iommu.mode == IRQ_REMAPPING)
1139+ if (force || ir_data->irq_2_iommu.mode == IRQ_REMAPPING)
11401140 modify_irte(&ir_data->irq_2_iommu, irte);
11411141 }
11421142
drivers/iommu/rockchip-iommu.c+9−2
@@ -1098,7 +1098,7 @@ static int rk_iommu_of_xlate(struct device *dev, · 1097 unmodified lines
10981098 data->iommu = platform_get_drvdata(iommu_dev);
10991099 dev->archdata.iommu = data;
11001100
1101− of_dev_put(iommu_dev);
1101+ platform_device_put(iommu_dev);
11021102
11031103 return 0;
11041104 }
@@ -1175,8 +1175,15 @@ static int rk_iommu_probe(struct platform_device *pdev) · 70 unmodified lines
11751175 for (i = 0; i < iommu->num_clocks; ++i)
11761176 iommu->clocks[i].id = rk_iommu_clocks[i];
11771177
1178+ /*
1179+ * iommu clocks should be present for all new devices and devicetrees
1180+ * but there are older devicetrees without clocks out in the wild.
1181+ * So clocks as optional for the time being.
1182+ */
11781183 err = devm_clk_bulk_get(iommu->dev, iommu->num_clocks, iommu->clocks);
1179− if (err)
1184+ if (err == -ENOENT)
1185+ iommu->num_clocks = 0;
1186+ else if (err)
11801187 return err;
11811188
11821189 err = clk_bulk_prepare(iommu->num_clocks, iommu->clocks);
drivers/irqchip/qcom-irq-combiner.c+2−2
@@ -1,4 +1,4 @@
1−/* Copyright (c) 2015-2016, The Linux Foundation. All rights reserved.
1+/* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved.
22 *
33 * This program is free software; you can redistribute it and/or modify
44 * it under the terms of the GNU General Public License version 2 and
@@ -68,7 +68,7 @@ static void combiner_handle_irq(struct irq_desc *desc) · 63 unmodified lines
6868
6969 bit = readl_relaxed(combiner->regs[reg].addr);
7070 status = bit & combiner->regs[reg].enabled;
71− if (!status)
71+ if (bit && !status)
7272 pr_warn_ratelimited("Unexpected IRQ on CPU%d: (%08x %08lx %p)\n",
7373 smp_processor_id(), bit,
7474 combiner->regs[reg].enabled,
drivers/isdn/mISDN/dsp_hwec.c+5−3
@@ -68,12 +68,12 @@ void dsp_hwec_enable(struct dsp *dsp, const char *arg) · 67 unmodified lines
6868 goto _do;
6969
7070 {
71− char _dup[len + 1];
7271 char *dup, *tok, *name, *val;
7372 int tmp;
7473
75− strcpy(_dup, arg);
76− dup = _dup;
74+ dup = kstrdup(arg, GFP_ATOMIC);
75+ if (!dup)
76+ return;
7777
7878 while ((tok = strsep(&dup, ","))) {
7979 if (!strlen(tok))
@@ -89,6 +89,8 @@ void dsp_hwec_enable(struct dsp *dsp, const char *arg) · 9 unmodified lines
8989 deftaps = tmp;
9090 }
9191 }
92+
93+ kfree(dup);
9294 }
9395
9496 _do:
drivers/isdn/mISDN/l1oip_core.c+11−3
@@ -279,7 +279,7 @@ l1oip_socket_send(struct l1oip *hc, u8 localcodec, u8 channel, u32 chanmask, · 278 unmodified lines
279279 u16 timebase, u8 *buf, int len)
280280 {
281281 u8 *p;
282− u8 frame[len + 32];
282+ u8 frame[MAX_DFRAME_LEN_L1 + 32];
283283 struct socket *socket = NULL;
284284
285285 if (debug & DEBUG_L1OIP_MSG)
@@ -902,7 +902,11 @@ handle_dmsg(struct mISDNchannel *ch, struct sk_buff *skb) · 616 unmodified lines
902902 p = skb->data;
903903 l = skb->len;
904904 while (l) {
905− ll = (l < L1OIP_MAX_PERFRAME) ? l : L1OIP_MAX_PERFRAME;
905+ /*
906+ * This is technically bounded by L1OIP_MAX_PERFRAME but
907+ * MAX_DFRAME_LEN_L1 < L1OIP_MAX_PERFRAME
908+ */
909+ ll = (l < MAX_DFRAME_LEN_L1) ? l : MAX_DFRAME_LEN_L1;
906910 l1oip_socket_send(hc, 0, dch->slot, 0,
907911 hc->chan[dch->slot].tx_counter++, p, ll);
908912 p += ll;
@@ -1140,7 +1144,11 @@ handle_bmsg(struct mISDNchannel *ch, struct sk_buff *skb) · 231 unmodified lines
11401144 p = skb->data;
11411145 l = skb->len;
11421146 while (l) {
1143− ll = (l < L1OIP_MAX_PERFRAME) ? l : L1OIP_MAX_PERFRAME;
1147+ /*
1148+ * This is technically bounded by L1OIP_MAX_PERFRAME but
1149+ * MAX_DFRAME_LEN_L1 < L1OIP_MAX_PERFRAME
1150+ */
1151+ ll = (l < MAX_DFRAME_LEN_L1) ? l : MAX_DFRAME_LEN_L1;
11441152 l1oip_socket_send(hc, hc->codec, bch->slot, 0,
11451153 hc->chan[bch->slot].tx_counter, p, ll);
11461154 hc->chan[bch->slot].tx_counter += ll;
drivers/md/bcache/alloc.c+4−1
@@ -290,7 +290,7 @@ do { \ · 289 unmodified lines
290290 if (kthread_should_stop() || \
291291 test_bit(CACHE_SET_IO_DISABLE, &ca->set->flags)) { \
292292 set_current_state(TASK_RUNNING); \
293− return 0; \
293+ goto out; \
294294 } \
295295 \
296296 schedule(); \
@@ -378,6 +378,9 @@ retry_invalidate: · 81 unmodified lines
378378 bch_prio_write(ca);
379379 }
380380 }
381+out:
382+ wait_for_kthread_stop();
383+ return 0;
381384 }
382385
383386 /* Allocation */
drivers/md/bcache/bcache.h+4−0
@@ -392,6 +392,8 @@ struct cached_dev { · 391 unmodified lines
392392 #define DEFAULT_CACHED_DEV_ERROR_LIMIT 64
393393 atomic_t io_errors;
394394 unsigned error_limit;
395+
396+ char backing_dev_name[BDEVNAME_SIZE];
395397 };
396398
397399 enum alloc_reserve {
@@ -464,6 +466,8 @@ struct cache { · 66 unmodified lines
464466 atomic_long_t meta_sectors_written;
465467 atomic_long_t btree_sectors_written;
466468 atomic_long_t sectors_written;
469+
470+ char cache_dev_name[BDEVNAME_SIZE];
467471 };
468472
469473 struct gc_stat {
drivers/md/bcache/debug.c+1−2
@@ -106,7 +106,6 @@ void bch_btree_verify(struct btree *b) · 105 unmodified lines
106106
107107 void bch_data_verify(struct cached_dev *dc, struct bio *bio)
108108 {
109− char name[BDEVNAME_SIZE];
110109 struct bio *check;
111110 struct bio_vec bv, cbv;
112111 struct bvec_iter iter, citer = { 0 };
@@ -134,7 +133,7 @@ void bch_data_verify(struct cached_dev *dc, struct bio *bio) · 21 unmodified lines
134133 bv.bv_len),
135134 dc->disk.c,
136135 "verify failed at dev %s sector %llu",
137− bdevname(dc->bdev, name),
136+ dc->backing_dev_name,
138137 (uint64_t) bio->bi_iter.bi_sector);
139138
140139 kunmap_atomic(p1);
drivers/md/bcache/io.c+3−5
@@ -52,7 +52,6 @@ void bch_submit_bbio(struct bio *bio, struct cache_set *c, · 51 unmodified lines
5252 /* IO errors */
5353 void bch_count_backing_io_errors(struct cached_dev *dc, struct bio *bio)
5454 {
55− char buf[BDEVNAME_SIZE];
5655 unsigned errors;
5756
5857 WARN_ONCE(!dc, "NULL pointer of struct cached_dev");
@@ -60,7 +59,7 @@ void bch_count_backing_io_errors(struct cached_dev *dc, struct bio *bio) · 1 unmodified line
6059 errors = atomic_add_return(1, &dc->io_errors);
6160 if (errors < dc->error_limit)
6261 pr_err("%s: IO error on backing device, unrecoverable",
63− bio_devname(bio, buf));
62+ dc->backing_dev_name);
6463 else
6564 bch_cached_dev_error(dc);
6665 }
@@ -105,19 +104,18 @@ void bch_count_io_errors(struct cache *ca, · 38 unmodified lines
105104 }
106105
107106 if (error) {
108− char buf[BDEVNAME_SIZE];
109107 unsigned errors = atomic_add_return(1 << IO_ERROR_SHIFT,
110108 &ca->io_errors);
111109 errors >>= IO_ERROR_SHIFT;
112110
113111 if (errors < ca->set->error_limit)
114112 pr_err("%s: IO error on %s%s",
115− bdevname(ca->bdev, buf), m,
113+ ca->cache_dev_name, m,
116114 is_read ? ", recovering." : ".");
117115 else
118116 bch_cache_set_error(ca->set,
119117 "%s: too many IO errors %s",
120− bdevname(ca->bdev, buf), m);
118+ ca->cache_dev_name, m);
121119 }
122120 }
123121
drivers/md/bcache/request.c+1−4
@@ -649,11 +649,8 @@ static void backing_request_endio(struct bio *bio) · 648 unmodified lines
649649 */
650650 if (unlikely(s->iop.writeback &&
651651 bio->bi_opf & REQ_PREFLUSH)) {
652− char buf[BDEVNAME_SIZE];
653−
654− bio_devname(bio, buf);
655652 pr_err("Can't flush %s: returned bi_status %i",
656− buf, bio->bi_status);
653+ dc->backing_dev_name, bio->bi_status);
657654 } else {
658655 /* set to orig_bio->bi_status in bio_complete() */
659656 s->iop.status = bio->bi_status;
drivers/md/bcache/super.c+52−23
@@ -936,7 +936,6 @@ static void cancel_writeback_rate_update_dwork(struct cached_dev *dc) · 935 unmodified lines
936936 static void cached_dev_detach_finish(struct work_struct *w)
937937 {
938938 struct cached_dev *dc = container_of(w, struct cached_dev, detach);
939− char buf[BDEVNAME_SIZE];
940939 struct closure cl;
941940 closure_init_stack(&cl);
942941
@@ -967,7 +966,7 @@ static void cached_dev_detach_finish(struct work_struct *w) · 24 unmodified lines
967966
968967 mutex_unlock(&bch_register_lock);
969968
970− pr_info("Caching disabled for %s", bdevname(dc->bdev, buf));
969+ pr_info("Caching disabled for %s", dc->backing_dev_name);
971970
972971 /* Drop ref we took in cached_dev_detach() */
973972 closure_put(&dc->disk.cl);
@@ -999,29 +998,28 @@ int bch_cached_dev_attach(struct cached_dev *dc, struct cache_set *c, · 25 unmodified lines
999998 {
1000999 uint32_t rtime = cpu_to_le32(get_seconds());
10011000 struct uuid_entry *u;
1002− char buf[BDEVNAME_SIZE];
10031001 struct cached_dev *exist_dc, *t;
10041002
1005− bdevname(dc->bdev, buf);
1006−
10071003 if ((set_uuid && memcmp(set_uuid, c->sb.set_uuid, 16)) ||
10081004 (!set_uuid && memcmp(dc->sb.set_uuid, c->sb.set_uuid, 16)))
10091005 return -ENOENT;
10101006
10111007 if (dc->disk.c) {
1012− pr_err("Can't attach %s: already attached", buf);
1008+ pr_err("Can't attach %s: already attached",
1009+ dc->backing_dev_name);
10131010 return -EINVAL;
10141011 }
10151012
10161013 if (test_bit(CACHE_SET_STOPPING, &c->flags)) {
1017− pr_err("Can't attach %s: shutting down", buf);
1014+ pr_err("Can't attach %s: shutting down",
1015+ dc->backing_dev_name);
10181016 return -EINVAL;
10191017 }
10201018
10211019 if (dc->sb.block_size < c->sb.block_size) {
10221020 /* Will die */
10231021 pr_err("Couldn't attach %s: block size less than set's block size",
1024− buf);
1022+ dc->backing_dev_name);
10251023 return -EINVAL;
10261024 }
10271025
@@ -1029,7 +1027,7 @@ int bch_cached_dev_attach(struct cached_dev *dc, struct cache_set *c, · 1 unmodified line
10291027 list_for_each_entry_safe(exist_dc, t, &c->cached_devs, list) {
10301028 if (!memcmp(dc->sb.uuid, exist_dc->sb.uuid, 16)) {
10311029 pr_err("Tried to attach %s but duplicate UUID already attached",
1032− buf);
1030+ dc->backing_dev_name);
10331031
10341032 return -EINVAL;
10351033 }
@@ -1047,13 +1045,15 @@ int bch_cached_dev_attach(struct cached_dev *dc, struct cache_set *c, · 11 unmodified lines
10471045
10481046 if (!u) {
10491047 if (BDEV_STATE(&dc->sb) == BDEV_STATE_DIRTY) {
1050− pr_err("Couldn't find uuid for %s in set", buf);
1048+ pr_err("Couldn't find uuid for %s in set",
1049+ dc->backing_dev_name);
10511050 return -ENOENT;
10521051 }
10531052
10541053 u = uuid_find_empty(c);
10551054 if (!u) {
1056− pr_err("Not caching %s, no room for UUID", buf);
1055+ pr_err("Not caching %s, no room for UUID",
1056+ dc->backing_dev_name);
10571057 return -EINVAL;
10581058 }
10591059 }
@@ -1112,7 +1112,8 @@ int bch_cached_dev_attach(struct cached_dev *dc, struct cache_set *c, · 52 unmodified lines
11121112 up_write(&dc->writeback_lock);
11131113
11141114 pr_info("Caching %s as %s on set %pU",
1115− bdevname(dc->bdev, buf), dc->disk.disk->disk_name,
1115+ dc->backing_dev_name,
1116+ dc->disk.disk->disk_name,
11161117 dc->disk.c->sb.set_uuid);
11171118 return 0;
11181119 }
@@ -1225,10 +1226,10 @@ static void register_bdev(struct cache_sb *sb, struct page *sb_page, · 106 unmodified lines
12251226 struct block_device *bdev,
12261227 struct cached_dev *dc)
12271228 {
1228− char name[BDEVNAME_SIZE];
12291229 const char *err = "cannot allocate memory";
12301230 struct cache_set *c;
12311231
1232+ bdevname(bdev, dc->backing_dev_name);
12321233 memcpy(&dc->sb, sb, sizeof(struct cache_sb));
12331234 dc->bdev = bdev;
12341235 dc->bdev->bd_holder = dc;
@@ -1237,6 +1238,7 @@ static void register_bdev(struct cache_sb *sb, struct page *sb_page, · 2 unmodified lines
12371238 bio_first_bvec_all(&dc->sb_bio)->bv_page = sb_page;
12381239 get_page(sb_page);
12391240
1241+
12401242 if (cached_dev_init(dc, sb->block_size << 9))
12411243 goto err;
12421244
@@ -1247,7 +1249,7 @@ static void register_bdev(struct cache_sb *sb, struct page *sb_page, · 4 unmodified lines
12471249 if (bch_cache_accounting_add_kobjs(&dc->accounting, &dc->disk.kobj))
12481250 goto err;
12491251
1250− pr_info("registered backing device %s", bdevname(bdev, name));
1252+ pr_info("registered backing device %s", dc->backing_dev_name);
12511253
12521254 list_add(&dc->list, &uncached_devices);
12531255 list_for_each_entry(c, &bch_cache_sets, list)
@@ -1259,7 +1261,7 @@ static void register_bdev(struct cache_sb *sb, struct page *sb_page, · 5 unmodified lines
12591261
12601262 return;
12611263 err:
1262− pr_notice("error %s: %s", bdevname(bdev, name), err);
1264+ pr_notice("error %s: %s", dc->backing_dev_name, err);
12631265 bcache_device_stop(&dc->disk);
12641266 }
12651267
@@ -1367,7 +1369,7 @@ int bch_flash_dev_create(struct cache_set *c, uint64_t size) · 101 unmodified lines
13671369
13681370 bool bch_cached_dev_error(struct cached_dev *dc)
13691371 {
1370− char name[BDEVNAME_SIZE];
1372+ struct cache_set *c;
13711373
13721374 if (!dc || test_bit(BCACHE_DEV_CLOSING, &dc->disk.flags))
13731375 return false;
@@ -1377,7 +1379,22 @@ bool bch_cached_dev_error(struct cached_dev *dc) · 3 unmodified lines
13771379 smp_mb();
13781380
13791381 pr_err("stop %s: too many IO errors on backing device %s\n",
1380− dc->disk.disk->disk_name, bdevname(dc->bdev, name));
1382+ dc->disk.disk->disk_name, dc->backing_dev_name);
1383+
1384+ /*
1385+ * If the cached device is still attached to a cache set,
1386+ * even dc->io_disable is true and no more I/O requests
1387+ * accepted, cache device internal I/O (writeback scan or
1388+ * garbage collection) may still prevent bcache device from
1389+ * being stopped. So here CACHE_SET_IO_DISABLE should be
1390+ * set to c->flags too, to make the internal I/O to cache
1391+ * device rejected and stopped immediately.
1392+ * If c is NULL, that means the bcache device is not attached
1393+ * to any cache set, then no CACHE_SET_IO_DISABLE bit to set.
1394+ */
1395+ c = dc->disk.c;
1396+ if (c && test_and_set_bit(CACHE_SET_IO_DISABLE, &c->flags))
1397+ pr_info("CACHE_SET_IO_DISABLE already set");
13811398
13821399 bcache_device_stop(&dc->disk);
13831400 return true;
@@ -1395,7 +1412,7 @@ bool bch_cache_set_error(struct cache_set *c, const char *fmt, ...) · 11 unmodified lines
13951412 return false;
13961413
13971414 if (test_and_set_bit(CACHE_SET_IO_DISABLE, &c->flags))
1398− pr_warn("CACHE_SET_IO_DISABLE already set");
1415+ pr_info("CACHE_SET_IO_DISABLE already set");
13991416
14001417 /* XXX: we can be called from atomic context
14011418 acquire_console_sem();
@@ -1539,6 +1556,20 @@ static void conditional_stop_bcache_device(struct cache_set *c, · 137 unmodified lines
15391556 */
15401557 pr_warn("stop_when_cache_set_failed of %s is \"auto\" and cache is dirty, stop it to avoid potential data corruption.",
15411558 d->disk->disk_name);
1559+ /*
1560+ * There might be a small time gap that cache set is
1561+ * released but bcache device is not. Inside this time
1562+ * gap, regular I/O requests will directly go into
1563+ * backing device as no cache set attached to. This
1564+ * behavior may also introduce potential inconsistence
1565+ * data in writeback mode while cache is dirty.
1566+ * Therefore before calling bcache_device_stop() due
1567+ * to a broken cache device, dc->io_disable should be
1568+ * explicitly set to true.
1569+ */
1570+ dc->io_disable = true;
1571+ /* make others know io_disable is true earlier */
1572+ smp_mb();
15421573 bcache_device_stop(d);
15431574 } else {
15441575 /*
@@ -2003,12 +2034,10 @@ static int cache_alloc(struct cache *ca) · 458 unmodified lines
20032034 static int register_cache(struct cache_sb *sb, struct page *sb_page,
20042035 struct block_device *bdev, struct cache *ca)
20052036 {
2006− char name[BDEVNAME_SIZE];
20072037 const char *err = NULL; /* must be set for any error case */
20082038 int ret = 0;
20092039
2010− bdevname(bdev, name);
2011−
2040+ bdevname(bdev, ca->cache_dev_name);
20122041 memcpy(&ca->sb, sb, sizeof(struct cache_sb));
20132042 ca->bdev = bdev;
20142043 ca->bdev->bd_holder = ca;
@@ -2045,14 +2074,14 @@ static int register_cache(struct cache_sb *sb, struct page *sb_page, · 30 unmodified lines
20452074 goto out;
20462075 }
20472076
2048− pr_info("registered cache device %s", name);
2077+ pr_info("registered cache device %s", ca->cache_dev_name);
20492078
20502079 out:
20512080 kobject_put(&ca->kobj);
20522081
20532082 err:
20542083 if (err)
2055− pr_notice("error %s: %s", name, err);
2084+ pr_notice("error %s: %s", ca->cache_dev_name, err);
20562085
20572086 return ret;
20582087 }
drivers/md/bcache/writeback.c+3−1
@@ -244,8 +244,10 @@ static void dirty_endio(struct bio *bio) · 243 unmodified lines
244244 struct keybuf_key *w = bio->bi_private;
245245 struct dirty_io *io = w->private;
246246
247− if (bio->bi_status)
247+ if (bio->bi_status) {
248248 SET_KEY_DIRTY(&w->key, false);
249+ bch_count_backing_io_errors(io->dc, bio);
250+ }
249251
250252 closure_put(&io->cl);
251253 }
drivers/md/md.c+4−2
@@ -9256,8 +9256,10 @@ void md_reload_sb(struct mddev *mddev, int nr) · 9255 unmodified lines
92569256 check_sb_changes(mddev, rdev);
92579257
92589258 /* Read all rdev's to update recovery_offset */
9259− rdev_for_each_rcu(rdev, mddev)
9260− read_rdev(mddev, rdev);
9259+ rdev_for_each_rcu(rdev, mddev) {
9260+ if (!test_bit(Faulty, &rdev->flags))
9261+ read_rdev(mddev, rdev);
9262+ }
92619263 }
92629264 EXPORT_SYMBOL(md_reload_sb);
92639265
drivers/md/raid1.c+20−5
@@ -854,7 +854,7 @@ static void flush_pending_writes(struct r1conf *conf) · 853 unmodified lines
854854 * there is no normal IO happeing. It must arrange to call
855855 * lower_barrier when the particular background IO completes.
856856 */
857−static void raise_barrier(struct r1conf *conf, sector_t sector_nr)
857+static sector_t raise_barrier(struct r1conf *conf, sector_t sector_nr)
858858 {
859859 int idx = sector_to_idx(sector_nr);
860860
@@ -885,13 +885,23 @@ static void raise_barrier(struct r1conf *conf, sector_t sector_nr) · 24 unmodified lines
885885 * max resync count which allowed on current I/O barrier bucket.
886886 */
887887 wait_event_lock_irq(conf->wait_barrier,
888− !conf->array_frozen &&
888+ (!conf->array_frozen &&
889889 !atomic_read(&conf->nr_pending[idx]) &&
890− atomic_read(&conf->barrier[idx]) < RESYNC_DEPTH,
890+ atomic_read(&conf->barrier[idx]) < RESYNC_DEPTH) ||
891+ test_bit(MD_RECOVERY_INTR, &conf->mddev->recovery),
891892 conf->resync_lock);
892893
894+ if (test_bit(MD_RECOVERY_INTR, &conf->mddev->recovery)) {
895+ atomic_dec(&conf->barrier[idx]);
896+ spin_unlock_irq(&conf->resync_lock);
897+ wake_up(&conf->wait_barrier);
898+ return -EINTR;
899+ }
900+
893901 atomic_inc(&conf->nr_sync_pending);
894902 spin_unlock_irq(&conf->resync_lock);
903+
904+ return 0;
895905 }
896906
897907 static void lower_barrier(struct r1conf *conf, sector_t sector_nr)
@@ -1092,6 +1102,8 @@ static void alloc_behind_master_bio(struct r1bio *r1_bio, · 194 unmodified lines
10921102 goto skip_copy;
10931103 }
10941104
1105+ behind_bio->bi_write_hint = bio->bi_write_hint;
1106+
10951107 while (i < vcnt && size) {
10961108 struct page *page;
10971109 int len = min_t(int, PAGE_SIZE, size);
@@ -2662,9 +2674,12 @@ static sector_t raid1_sync_request(struct mddev *mddev, sector_t sector_nr, · 1564 unmodified lines
26622674
26632675 bitmap_cond_end_sync(mddev->bitmap, sector_nr,
26642676 mddev_is_clustered(mddev) && (sector_nr + 2 * RESYNC_SECTORS > conf->cluster_sync_high));
2665− r1_bio = raid1_alloc_init_r1buf(conf);
26662677
2667− raise_barrier(conf, sector_nr);
2678+
2679+ if (raise_barrier(conf, sector_nr))
2680+ return 0;
2681+
2682+ r1_bio = raid1_alloc_init_r1buf(conf);
26682683
26692684 rcu_read_lock();
26702685 /*
drivers/media/i2c/saa7115.c+1−1
@@ -20,7 +20,7 @@ · 19 unmodified lines
2020 //
2121 // VBI support (2004) and cleanups (2005) by Hans Verkuil <hverkuil@xs4all.nl>
2222 //
23−// Copyright (c) 2005-2006 Mauro Carvalho Chehab <mchehab@infradead.org>
23+// Copyright (c) 2005-2006 Mauro Carvalho Chehab <mchehab@kernel.org>
2424 // SAA7111, SAA7113 and SAA7118 support
2525
2626 #include "saa711x_regs.h"
drivers/media/i2c/saa711x_regs.h+1−1
@@ -2,7 +2,7 @@ · 1 unmodified line
22 * SPDX-License-Identifier: GPL-2.0+
33 * saa711x - Philips SAA711x video decoder register specifications
44 *
5− * Copyright (c) 2006 Mauro Carvalho Chehab <mchehab@infradead.org>
5+ * Copyright (c) 2006 Mauro Carvalho Chehab <mchehab@kernel.org>
66 */
77
88 #define R_00_CHIP_VERSION 0x00
drivers/media/i2c/tda7432.c+1−1
@@ -8,7 +8,7 @@ · 7 unmodified lines
88 * Muting and tone control by Jonathan Isom <jisom@ematic.com>
99 *
1010 * Copyright (c) 2000 Eric Sandeen <eric_sandeen@bigfoot.com>
11− * Copyright (c) 2006 Mauro Carvalho Chehab <mchehab@infradead.org>
11+ * Copyright (c) 2006 Mauro Carvalho Chehab <mchehab@kernel.org>
1212 * This code is placed under the terms of the GNU General Public License
1313 * Based on tda9855.c by Steve VanDeBogart (vandebo@uclink.berkeley.edu)
1414 * Which was based on tda8425.c by Greg Alexander (c) 1998
drivers/media/i2c/tvp5150.c+1−1
@@ -2,7 +2,7 @@ · 1 unmodified line
22 //
33 // tvp5150 - Texas Instruments TVP5150A/AM1 and TVP5151 video decoder driver
44 //
5−// Copyright (c) 2005,2006 Mauro Carvalho Chehab <mchehab@infradead.org>
5+// Copyright (c) 2005,2006 Mauro Carvalho Chehab <mchehab@kernel.org>
66
77 #include <dt-bindings/media/tvp5150.h>
88 #include <linux/i2c.h>
drivers/media/i2c/tvp5150_reg.h+1−1
@@ -3,7 +3,7 @@ · 2 unmodified lines
33 *
44 * tvp5150 - Texas Instruments TVP5150A/AM1 video decoder registers
55 *
6− * Copyright (c) 2005,2006 Mauro Carvalho Chehab <mchehab@infradead.org>
6+ * Copyright (c) 2005,2006 Mauro Carvalho Chehab <mchehab@kernel.org>
77 */
88
99 #define TVP5150_VD_IN_SRC_SEL_1 0x00 /* Video input source selection #1 */
drivers/media/i2c/tvp7002.c+1−1
@@ -5,7 +5,7 @@ · 4 unmodified lines
55 * Author: Santiago Nunez-Corrales <santiago.nunez@ridgerun.com>
66 *
77 * This code is partially based upon the TVP5150 driver
8− * written by Mauro Carvalho Chehab (mchehab@infradead.org),
8+ * written by Mauro Carvalho Chehab <mchehab@kernel.org>,
99 * the TVP514x driver written by Vaibhav Hiremath <hvaibhav@ti.com>
1010 * and the TVP7002 driver in the TI LSP 2.10.00.14. Revisions by
1111 * Muralidharan Karicheri and Snehaprabha Narnakaje (TI).
drivers/media/i2c/tvp7002_reg.h+1−1
@@ -5,7 +5,7 @@ · 4 unmodified lines
55 * Author: Santiago Nunez-Corrales <santiago.nunez@ridgerun.com>
66 *
77 * This code is partially based upon the TVP5150 driver
8− * written by Mauro Carvalho Chehab (mchehab@infradead.org),
8+ * written by Mauro Carvalho Chehab <mchehab@kernel.org>,
99 * the TVP514x driver written by Vaibhav Hiremath <hvaibhav@ti.com>
1010 * and the TVP7002 driver in the TI LSP 2.10.00.14
1111 *
drivers/media/media-devnode.c+1−1
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 * Copyright (C) 2010 Nokia Corporation
55 *
66 * Based on drivers/media/video/v4l2_dev.c code authored by
7− * Mauro Carvalho Chehab <mchehab@infradead.org> (version 2)
7+ * Mauro Carvalho Chehab <mchehab@kernel.org> (version 2)
88 * Alan Cox, <alan@lxorguk.ukuu.org.uk> (version 1)
99 *
1010 * Contacts: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
drivers/media/pci/bt8xx/bttv-audio-hook.c+1−1
@@ -1,7 +1,7 @@
11 /*
22 * Handlers for board audio hooks, splitted from bttv-cards
33 *
4− * Copyright (c) 2006 Mauro Carvalho Chehab (mchehab@infradead.org)
4+ * Copyright (c) 2006 Mauro Carvalho Chehab <mchehab@kernel.org>
55 * This code is placed under the terms of the GNU General Public License
66 */
77
drivers/media/pci/bt8xx/bttv-audio-hook.h+1−1
@@ -1,7 +1,7 @@
11 /*
22 * Handlers for board audio hooks, splitted from bttv-cards
33 *
4− * Copyright (c) 2006 Mauro Carvalho Chehab (mchehab@infradead.org)
4+ * Copyright (c) 2006 Mauro Carvalho Chehab <mchehab@kernel.org>
55 * This code is placed under the terms of the GNU General Public License
66 */
77
drivers/media/pci/bt8xx/bttv-cards.c+2−2
@@ -2447,7 +2447,7 @@ struct tvcard bttv_tvcards[] = { · 2446 unmodified lines
24472447 },
24482448 /* ---- card 0x88---------------------------------- */
24492449 [BTTV_BOARD_ACORP_Y878F] = {
2450− /* Mauro Carvalho Chehab <mchehab@infradead.org> */
2450+ /* Mauro Carvalho Chehab <mchehab@kernel.org> */
24512451 .name = "Acorp Y878F",
24522452 .video_inputs = 3,
24532453 /* .audio_inputs= 1, */
@@ -2688,7 +2688,7 @@ struct tvcard bttv_tvcards[] = { · 234 unmodified lines
26882688 },
26892689 [BTTV_BOARD_ENLTV_FM_2] = {
26902690 /* Encore TV Tuner Pro ENL TV-FM-2
2691− Mauro Carvalho Chehab <mchehab@infradead.org */
2691+ Mauro Carvalho Chehab <mchehab@kernel.org> */
26922692 .name = "Encore ENL TV-FM-2",
26932693 .video_inputs = 3,
26942694 /* .audio_inputs= 1, */
drivers/media/pci/bt8xx/bttv-driver.c+1−1
@@ -13,7 +13,7 @@ · 12 unmodified lines
1313 (c) 2005-2006 Nickolay V. Shmyrev <nshmyrev@yandex.ru>
1414
1515 Fixes to be fully V4L2 compliant by
16− (c) 2006 Mauro Carvalho Chehab <mchehab@infradead.org>
16+ (c) 2006 Mauro Carvalho Chehab <mchehab@kernel.org>
1717
1818 Cropping and overscan support
1919 Copyright (C) 2005, 2006 Michael H. Schimek <mschimek@gmx.at>
drivers/media/pci/bt8xx/bttv-i2c.c+1−1
@@ -8,7 +8,7 @@ · 7 unmodified lines
88 & Marcus Metzler (mocm@thp.uni-koeln.de)
99 (c) 1999-2003 Gerd Knorr <kraxel@bytesex.org>
1010
11− (c) 2005 Mauro Carvalho Chehab <mchehab@infradead.org>
11+ (c) 2005 Mauro Carvalho Chehab <mchehab@kernel.org>
1212 - Multituner support and i2c address binding
1313
1414 This program is free software; you can redistribute it and/or modify
drivers/media/pci/cx23885/cx23885-input.c+1−1
@@ -13,7 +13,7 @@ · 12 unmodified lines
1313 * Copyright (C) 2008 <srinivasa.deevi at conexant dot com>
1414 * Copyright (C) 2005 Ludovico Cavedon <cavedon@sssup.it>
1515 * Markus Rechberger <mrechberger@gmail.com>
16− * Mauro Carvalho Chehab <mchehab@infradead.org>
16+ * Mauro Carvalho Chehab <mchehab@kernel.org>
1717 * Sascha Sommer <saschasommer@freenet.de>
1818 * Copyright (C) 2004, 2005 Chris Pascoe
1919 * Copyright (C) 2003, 2004 Gerd Knorr
drivers/media/pci/cx88/cx88-alsa.c+2−2
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 *
55 * (c) 2007 Trent Piepho <xyzzy@speakeasy.org>
66 * (c) 2005,2006 Ricardo Cerqueira <v4l@cerqueira.org>
7− * (c) 2005 Mauro Carvalho Chehab <mchehab@infradead.org>
7+ * (c) 2005 Mauro Carvalho Chehab <mchehab@kernel.org>
88 * Based on a dummy cx88 module by Gerd Knorr <kraxel@bytesex.org>
99 * Based on dummy.c by Jaroslav Kysela <perex@perex.cz>
1010 *
@@ -103,7 +103,7 @@ MODULE_PARM_DESC(index, "Index value for cx88x capture interface(s)."); · 92 unmodified lines
103103
104104 MODULE_DESCRIPTION("ALSA driver module for cx2388x based TV cards");
105105 MODULE_AUTHOR("Ricardo Cerqueira");
106−MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@infradead.org>");
106+MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@kernel.org>");
107107 MODULE_LICENSE("GPL");
108108 MODULE_VERSION(CX88_VERSION);
109109
drivers/media/pci/cx88/cx88-blackbird.c+1−1
@@ -5,7 +5,7 @@ · 4 unmodified lines
55 * (c) 2004 Jelle Foks <jelle@foks.us>
66 * (c) 2004 Gerd Knorr <kraxel@bytesex.org>
77 *
8− * (c) 2005-2006 Mauro Carvalho Chehab <mchehab@infradead.org>
8+ * (c) 2005-2006 Mauro Carvalho Chehab <mchehab@kernel.org>
99 * - video_ioctl2 conversion
1010 *
1111 * Includes parts from the ivtv driver <http://sourceforge.net/projects/ivtv/>
drivers/media/pci/cx88/cx88-core.c+1−1
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 *
55 * (c) 2003 Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]
66 *
7− * (c) 2005-2006 Mauro Carvalho Chehab <mchehab@infradead.org>
7+ * (c) 2005-2006 Mauro Carvalho Chehab <mchehab@kernel.org>
88 * - Multituner support
99 * - video_ioctl2 conversion
1010 * - PAL/M fixes
drivers/media/pci/cx88/cx88-i2c.c+1−1
@@ -8,7 +8,7 @@ · 7 unmodified lines
88 * (c) 2002 Yurij Sysoev <yurij@naturesoft.net>
99 * (c) 1999-2003 Gerd Knorr <kraxel@bytesex.org>
1010 *
11− * (c) 2005 Mauro Carvalho Chehab <mchehab@infradead.org>
11+ * (c) 2005 Mauro Carvalho Chehab <mchehab@kernel.org>
1212 * - Multituner support and i2c address binding
1313 *
1414 * This program is free software; you can redistribute it and/or modify
drivers/media/pci/cx88/cx88-video.c+1−1
@@ -5,7 +5,7 @@ · 4 unmodified lines
55 *
66 * (c) 2003-04 Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]
77 *
8− * (c) 2005-2006 Mauro Carvalho Chehab <mchehab@infradead.org>
8+ * (c) 2005-2006 Mauro Carvalho Chehab <mchehab@kernel.org>
99 * - Multituner support
1010 * - video_ioctl2 conversion
1111 * - PAL/M fixes
drivers/media/radio/radio-aimslab.c+1−1
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 * Copyright 1997 M. Kirkwood
55 *
66 * Converted to the radio-isa framework by Hans Verkuil <hans.verkuil@cisco.com>
7− * Converted to V4L2 API by Mauro Carvalho Chehab <mchehab@infradead.org>
7+ * Converted to V4L2 API by Mauro Carvalho Chehab <mchehab@kernel.org>
88 * Converted to new API by Alan Cox <alan@lxorguk.ukuu.org.uk>
99 * Various bugfixes and enhancements by Russell Kroll <rkroll@exploits.org>
1010 *
drivers/media/radio/radio-aztech.c+1−1
@@ -2,7 +2,7 @@ · 1 unmodified line
22 * radio-aztech.c - Aztech radio card driver
33 *
44 * Converted to the radio-isa framework by Hans Verkuil <hans.verkuil@xs4all.nl>
5− * Converted to V4L2 API by Mauro Carvalho Chehab <mchehab@infradead.org>
5+ * Converted to V4L2 API by Mauro Carvalho Chehab <mchehab@kernel.org>
66 * Adapted to support the Video for Linux API by
77 * Russell Kroll <rkroll@exploits.org>. Based on original tuner code by:
88 *
drivers/media/radio/radio-gemtek.c+1−1
@@ -15,7 +15,7 @@ · 14 unmodified lines
1515 * Various bugfixes and enhancements by Russell Kroll <rkroll@exploits.org>
1616 *
1717 * Converted to the radio-isa framework by Hans Verkuil <hans.verkuil@cisco.com>
18− * Converted to V4L2 API by Mauro Carvalho Chehab <mchehab@infradead.org>
18+ * Converted to V4L2 API by Mauro Carvalho Chehab <mchehab@kernel.org>
1919 *
2020 * Note: this card seems to swap the left and right audio channels!
2121 *
drivers/media/radio/radio-maxiradio.c+1−1
@@ -27,7 +27,7 @@ · 26 unmodified lines
2727 * BUGS:
2828 * - card unmutes if you change frequency
2929 *
30− * (c) 2006, 2007 by Mauro Carvalho Chehab <mchehab@infradead.org>:
30+ * (c) 2006, 2007 by Mauro Carvalho Chehab <mchehab@kernel.org>:
3131 * - Conversion to V4L2 API
3232 * - Uses video_ioctl2 for parsing and to add debug support
3333 */
drivers/media/radio/radio-rtrack2.c+1−1
@@ -7,7 +7,7 @@ · 6 unmodified lines
77 * Various bugfixes and enhancements by Russell Kroll <rkroll@exploits.org>
88 *
99 * Converted to the radio-isa framework by Hans Verkuil <hans.verkuil@cisco.com>
10− * Converted to V4L2 API by Mauro Carvalho Chehab <mchehab@infradead.org>
10+ * Converted to V4L2 API by Mauro Carvalho Chehab <mchehab@kernel.org>
1111 *
1212 * Fully tested with actual hardware and the v4l2-compliance tool.
1313 */
drivers/media/radio/radio-sf16fmi.c+1−1
@@ -13,7 +13,7 @@ · 12 unmodified lines
1313 * No volume control - only mute/unmute - you have to use line volume
1414 * control on SB-part of SF16-FMI/SF16-FMP/SF16-FMD
1515 *
16− * Converted to V4L2 API by Mauro Carvalho Chehab <mchehab@infradead.org>
16+ * Converted to V4L2 API by Mauro Carvalho Chehab <mchehab@kernel.org>
1717 */
1818
1919 #include <linux/kernel.h> /* __setup */
drivers/media/radio/radio-terratec.c+1−1
@@ -17,7 +17,7 @@ · 16 unmodified lines
1717 * Volume Control is done digitally
1818 *
1919 * Converted to the radio-isa framework by Hans Verkuil <hans.verkuil@cisco.com>
20− * Converted to V4L2 API by Mauro Carvalho Chehab <mchehab@infradead.org>
20+ * Converted to V4L2 API by Mauro Carvalho Chehab <mchehab@kernel.org>
2121 */
2222
2323 #include <linux/module.h> /* Modules */
drivers/media/radio/radio-trust.c+1−1
@@ -12,7 +12,7 @@ · 11 unmodified lines
1212 * Scott McGrath (smcgrath@twilight.vtc.vsc.edu)
1313 * William McGrath (wmcgrath@twilight.vtc.vsc.edu)
1414 *
15− * Converted to V4L2 API by Mauro Carvalho Chehab <mchehab@infradead.org>
15+ * Converted to V4L2 API by Mauro Carvalho Chehab <mchehab@kernel.org>
1616 */
1717
1818 #include <stdarg.h>
drivers/media/radio/radio-typhoon.c+1−1
@@ -25,7 +25,7 @@ · 24 unmodified lines
2525 * The frequency change is necessary since the card never seems to be
2626 * completely silent.
2727 *
28− * Converted to V4L2 API by Mauro Carvalho Chehab <mchehab@infradead.org>
28+ * Converted to V4L2 API by Mauro Carvalho Chehab <mchehab@kernel.org>
2929 */
3030
3131 #include <linux/module.h> /* Modules */
drivers/media/radio/radio-zoltrix.c+1−1
@@ -27,7 +27,7 @@ · 26 unmodified lines
2727 * 2002-07-15 - Fix Stereo typo
2828 *
2929 * 2006-07-24 - Converted to V4L2 API
30− * by Mauro Carvalho Chehab <mchehab@infradead.org>
30+ * by Mauro Carvalho Chehab <mchehab@kernel.org>
3131 *
3232 * Converted to the radio-isa framework by Hans Verkuil <hans.verkuil@cisco.com>
3333 *
drivers/media/rc/keymaps/rc-avermedia-m135a.c+1−1
@@ -12,7 +12,7 @@ · 11 unmodified lines
1212 *
1313 * On Avermedia M135A with IR model RM-JX, the same codes exist on both
1414 * Positivo (BR) and original IR, initial version and remote control codes
15− * added by Mauro Carvalho Chehab <mchehab@infradead.org>
15+ * added by Mauro Carvalho Chehab <mchehab@kernel.org>
1616 *
1717 * Positivo also ships Avermedia M135A with model RM-K6, extra control
1818 * codes added by Herton Ronaldo Krzesinski <herton@mandriva.com.br>
drivers/media/rc/keymaps/rc-encore-enltv-fm53.c+1−1
@@ -9,7 +9,7 @@ · 8 unmodified lines
99 #include <linux/module.h>
1010
1111 /* Encore ENLTV-FM v5.3
12− Mauro Carvalho Chehab <mchehab@infradead.org>
12+ Mauro Carvalho Chehab <mchehab@kernel.org>
1313 */
1414
1515 static struct rc_map_table encore_enltv_fm53[] = {
drivers/media/rc/keymaps/rc-encore-enltv2.c+1−1
@@ -9,7 +9,7 @@ · 8 unmodified lines
99 #include <linux/module.h>
1010
1111 /* Encore ENLTV2-FM - silver plastic - "Wand Media" written at the botton
12− Mauro Carvalho Chehab <mchehab@infradead.org> */
12+ Mauro Carvalho Chehab <mchehab@kernel.org> */
1313
1414 static struct rc_map_table encore_enltv2[] = {
1515 { 0x4c, KEY_POWER2 },
drivers/media/rc/keymaps/rc-kaiomy.c+1−1
@@ -9,7 +9,7 @@ · 8 unmodified lines
99 #include <linux/module.h>
1010
1111 /* Kaiomy TVnPC U2
12− Mauro Carvalho Chehab <mchehab@infradead.org>
12+ Mauro Carvalho Chehab <mchehab@kernel.org>
1313 */
1414
1515 static struct rc_map_table kaiomy[] = {
drivers/media/rc/keymaps/rc-kworld-plus-tv-analog.c+1−1
@@ -9,7 +9,7 @@ · 8 unmodified lines
99 #include <linux/module.h>
1010
1111 /* Kworld Plus TV Analog Lite PCI IR
12− Mauro Carvalho Chehab <mchehab@infradead.org>
12+ Mauro Carvalho Chehab <mchehab@kernel.org>
1313 */
1414
1515 static struct rc_map_table kworld_plus_tv_analog[] = {
drivers/media/rc/keymaps/rc-pixelview-new.c+1−1
@@ -9,7 +9,7 @@ · 8 unmodified lines
99 #include <linux/module.h>
1010
1111 /*
12− Mauro Carvalho Chehab <mchehab@infradead.org>
12+ Mauro Carvalho Chehab <mchehab@kernel.org>
1313 present on PV MPEG 8000GT
1414 */
1515
drivers/media/tuners/tea5761.c+2−2
@@ -2,7 +2,7 @@ · 1 unmodified line
22 // For Philips TEA5761 FM Chip
33 // I2C address is always 0x20 (0x10 at 7-bit mode).
44 //
5−// Copyright (c) 2005-2007 Mauro Carvalho Chehab (mchehab@infradead.org)
5+// Copyright (c) 2005-2007 Mauro Carvalho Chehab <mchehab@kernel.org>
66
77 #include <linux/i2c.h>
88 #include <linux/slab.h>
@@ -337,5 +337,5 @@ EXPORT_SYMBOL_GPL(tea5761_attach); · 328 unmodified lines
337337 EXPORT_SYMBOL_GPL(tea5761_autodetection);
338338
339339 MODULE_DESCRIPTION("Philips TEA5761 FM tuner driver");
340−MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@infradead.org>");
340+MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@kernel.org>");
341341 MODULE_LICENSE("GPL v2");
drivers/media/tuners/tea5767.c+2−2
@@ -2,7 +2,7 @@ · 1 unmodified line
22 // For Philips TEA5767 FM Chip used on some TV Cards like Prolink Pixelview
33 // I2C address is always 0xC0.
44 //
5−// Copyright (c) 2005 Mauro Carvalho Chehab (mchehab@infradead.org)
5+// Copyright (c) 2005 Mauro Carvalho Chehab <mchehab@kernel.org>
66 //
77 // tea5767 autodetection thanks to Torsten Seeboth and Atsushi Nakagawa
88 // from their contributions on DScaler.
@@ -469,5 +469,5 @@ EXPORT_SYMBOL_GPL(tea5767_attach); · 460 unmodified lines
469469 EXPORT_SYMBOL_GPL(tea5767_autodetection);
470470
471471 MODULE_DESCRIPTION("Philips TEA5767 FM tuner driver");
472−MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@infradead.org>");
472+MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@kernel.org>");
473473 MODULE_LICENSE("GPL v2");
drivers/media/tuners/tuner-xc2028-types.h+1−1
@@ -5,7 +5,7 @@ · 4 unmodified lines
55 * This file includes internal tipes to be used inside tuner-xc2028.
66 * Shouldn't be included outside tuner-xc2028
77 *
8− * Copyright (c) 2007-2008 Mauro Carvalho Chehab (mchehab@infradead.org)
8+ * Copyright (c) 2007-2008 Mauro Carvalho Chehab <mchehab@kernel.org>
99 */
1010
1111 /* xc3028 firmware types */
drivers/media/tuners/tuner-xc2028.c+2−2
@@ -1,7 +1,7 @@
11 // SPDX-License-Identifier: GPL-2.0
22 // tuner-xc2028
33 //
4−// Copyright (c) 2007-2008 Mauro Carvalho Chehab (mchehab@infradead.org)
4+// Copyright (c) 2007-2008 Mauro Carvalho Chehab <mchehab@kernel.org>
55 //
66 // Copyright (c) 2007 Michel Ludwig (michel.ludwig@gmail.com)
77 // - frontend interface
@@ -1518,7 +1518,7 @@ EXPORT_SYMBOL(xc2028_attach); · 1510 unmodified lines
15181518
15191519 MODULE_DESCRIPTION("Xceive xc2028/xc3028 tuner driver");
15201520 MODULE_AUTHOR("Michel Ludwig <michel.ludwig@gmail.com>");
1521−MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@infradead.org>");
1521+MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@kernel.org>");
15221522 MODULE_LICENSE("GPL v2");
15231523 MODULE_FIRMWARE(XC2028_DEFAULT_FIRMWARE);
15241524 MODULE_FIRMWARE(XC3028L_DEFAULT_FIRMWARE);
drivers/media/tuners/tuner-xc2028.h+1−1
@@ -2,7 +2,7 @@ · 1 unmodified line
22 * SPDX-License-Identifier: GPL-2.0
33 * tuner-xc2028
44 *
5− * Copyright (c) 2007-2008 Mauro Carvalho Chehab (mchehab@infradead.org)
5+ * Copyright (c) 2007-2008 Mauro Carvalho Chehab <mchehab@kernel.org>
66 */
77
88 #ifndef __TUNER_XC2028_H__
drivers/media/usb/em28xx/em28xx-camera.c+1−1
@@ -2,7 +2,7 @@ · 1 unmodified line
22 //
33 // em28xx-camera.c - driver for Empia EM25xx/27xx/28xx USB video capture devices
44 //
5−// Copyright (C) 2009 Mauro Carvalho Chehab <mchehab@infradead.org>
5+// Copyright (C) 2009 Mauro Carvalho Chehab <mchehab@kernel.org>
66 // Copyright (C) 2013 Frank Schäfer <fschaefer.oss@googlemail.com>
77 //
88 // This program is free software; you can redistribute it and/or modify
drivers/media/usb/em28xx/em28xx-cards.c+1−1
@@ -5,7 +5,7 @@ · 4 unmodified lines
55 //
66 // Copyright (C) 2005 Ludovico Cavedon <cavedon@sssup.it>
77 // Markus Rechberger <mrechberger@gmail.com>
8−// Mauro Carvalho Chehab <mchehab@infradead.org>
8+// Mauro Carvalho Chehab <mchehab@kernel.org>
99 // Sascha Sommer <saschasommer@freenet.de>
1010 // Copyright (C) 2012 Frank Schäfer <fschaefer.oss@googlemail.com>
1111 //
drivers/media/usb/em28xx/em28xx-core.c+2−2
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 //
55 // Copyright (C) 2005 Ludovico Cavedon <cavedon@sssup.it>
66 // Markus Rechberger <mrechberger@gmail.com>
7−// Mauro Carvalho Chehab <mchehab@infradead.org>
7+// Mauro Carvalho Chehab <mchehab@kernel.org>
88 // Sascha Sommer <saschasommer@freenet.de>
99 // Copyright (C) 2012 Frank Schäfer <fschaefer.oss@googlemail.com>
1010 //
@@ -32,7 +32,7 @@ · 21 unmodified lines
3232
3333 #define DRIVER_AUTHOR "Ludovico Cavedon <cavedon@sssup.it>, " \
3434 "Markus Rechberger <mrechberger@gmail.com>, " \
35− "Mauro Carvalho Chehab <mchehab@infradead.org>, " \
35+ "Mauro Carvalho Chehab <mchehab@kernel.org>, " \
3636 "Sascha Sommer <saschasommer@freenet.de>"
3737
3838 MODULE_AUTHOR(DRIVER_AUTHOR);
drivers/media/usb/em28xx/em28xx-dvb.c+2−2
@@ -2,7 +2,7 @@ · 1 unmodified line
22 //
33 // DVB device driver for em28xx
44 //
5−// (c) 2008-2011 Mauro Carvalho Chehab <mchehab@infradead.org>
5+// (c) 2008-2011 Mauro Carvalho Chehab <mchehab@kernel.org>
66 //
77 // (c) 2008 Devin Heitmueller <devin.heitmueller@gmail.com>
88 // - Fixes for the driver to properly work with HVR-950
@@ -63,7 +63,7 @@ · 54 unmodified lines
6363 #include "tc90522.h"
6464 #include "qm1d1c0042.h"
6565
66−MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@infradead.org>");
66+MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@kernel.org>");
6767 MODULE_LICENSE("GPL v2");
6868 MODULE_DESCRIPTION(DRIVER_DESC " - digital TV interface");
6969 MODULE_VERSION(EM28XX_VERSION);
drivers/media/usb/em28xx/em28xx-i2c.c+1−1
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 //
55 // Copyright (C) 2005 Ludovico Cavedon <cavedon@sssup.it>
66 // Markus Rechberger <mrechberger@gmail.com>
7−// Mauro Carvalho Chehab <mchehab@infradead.org>
7+// Mauro Carvalho Chehab <mchehab@kernel.org>
88 // Sascha Sommer <saschasommer@freenet.de>
99 // Copyright (C) 2013 Frank Schäfer <fschaefer.oss@googlemail.com>
1010 //
drivers/media/usb/em28xx/em28xx-input.c+1−1
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 //
55 // Copyright (C) 2005 Ludovico Cavedon <cavedon@sssup.it>
66 // Markus Rechberger <mrechberger@gmail.com>
7−// Mauro Carvalho Chehab <mchehab@infradead.org>
7+// Mauro Carvalho Chehab <mchehab@kernel.org>
88 // Sascha Sommer <saschasommer@freenet.de>
99 //
1010 // This program is free software; you can redistribute it and/or modify
drivers/media/usb/em28xx/em28xx-video.c+2−2
@@ -5,7 +5,7 @@ · 4 unmodified lines
55 //
66 // Copyright (C) 2005 Ludovico Cavedon <cavedon@sssup.it>
77 // Markus Rechberger <mrechberger@gmail.com>
8−// Mauro Carvalho Chehab <mchehab@infradead.org>
8+// Mauro Carvalho Chehab <mchehab@kernel.org>
99 // Sascha Sommer <saschasommer@freenet.de>
1010 // Copyright (C) 2012 Frank Schäfer <fschaefer.oss@googlemail.com>
1111 //
@@ -44,7 +44,7 @@ · 32 unmodified lines
4444
4545 #define DRIVER_AUTHOR "Ludovico Cavedon <cavedon@sssup.it>, " \
4646 "Markus Rechberger <mrechberger@gmail.com>, " \
47− "Mauro Carvalho Chehab <mchehab@infradead.org>, " \
47+ "Mauro Carvalho Chehab <mchehab@kernel.org>, " \
4848 "Sascha Sommer <saschasommer@freenet.de>"
4949
5050 static unsigned int isoc_debug;
drivers/media/usb/em28xx/em28xx.h+1−1
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 *
55 * Copyright (C) 2005 Markus Rechberger <mrechberger@gmail.com>
66 * Ludovico Cavedon <cavedon@sssup.it>
7− * Mauro Carvalho Chehab <mchehab@infradead.org>
7+ * Mauro Carvalho Chehab <mchehab@kernel.org>
88 * Copyright (C) 2012 Frank Schäfer <fschaefer.oss@googlemail.com>
99 *
1010 * Based on the em2800 driver from Sascha Sommer <saschasommer@freenet.de>
drivers/media/usb/gspca/zc3xx-reg.h+1−1
@@ -1,7 +1,7 @@
11 /*
22 * zc030x registers
33 *
4− * Copyright (c) 2008 Mauro Carvalho Chehab <mchehab@infradead.org>
4+ * Copyright (c) 2008 Mauro Carvalho Chehab <mchehab@kernel.org>
55 *
66 * The register aliases used here came from this driver:
77 * http://zc0302.sourceforge.net/zc0302.php
drivers/media/usb/tm6000/tm6000-cards.c+1−1
@@ -1,7 +1,7 @@
11 // SPDX-License-Identifier: GPL-2.0
22 // tm6000-cards.c - driver for TM5600/TM6000/TM6010 USB video capture devices
33 //
4−// Copyright (c) 2006-2007 Mauro Carvalho Chehab <mchehab@infradead.org>
4+// Copyright (c) 2006-2007 Mauro Carvalho Chehab <mchehab@kernel.org>
55
66 #include <linux/init.h>
77 #include <linux/module.h>
drivers/media/usb/tm6000/tm6000-core.c+1−1
@@ -1,7 +1,7 @@
11 // SPDX-License-Identifier: GPL-2.0
22 // tm6000-core.c - driver for TM5600/TM6000/TM6010 USB video capture devices
33 //
4−// Copyright (c) 2006-2007 Mauro Carvalho Chehab <mchehab@infradead.org>
4+// Copyright (c) 2006-2007 Mauro Carvalho Chehab <mchehab@kernel.org>
55 //
66 // Copyright (c) 2007 Michel Ludwig <michel.ludwig@gmail.com>
77 // - DVB-T support
drivers/media/usb/tm6000/tm6000-i2c.c+1−1
@@ -1,7 +1,7 @@
11 // SPDX-License-Identifier: GPL-2.0
22 // tm6000-i2c.c - driver for TM5600/TM6000/TM6010 USB video capture devices
33 //
4−// Copyright (c) 2006-2007 Mauro Carvalho Chehab <mchehab@infradead.org>
4+// Copyright (c) 2006-2007 Mauro Carvalho Chehab <mchehab@kernel.org>
55 //
66 // Copyright (c) 2007 Michel Ludwig <michel.ludwig@gmail.com>
77 // - Fix SMBus Read Byte command
drivers/media/usb/tm6000/tm6000-regs.h+1−1
@@ -2,7 +2,7 @@ · 1 unmodified line
22 * SPDX-License-Identifier: GPL-2.0
33 * tm6000-regs.h - driver for TM5600/TM6000/TM6010 USB video capture devices
44 *
5− * Copyright (c) 2006-2007 Mauro Carvalho Chehab <mchehab@infradead.org>
5+ * Copyright (c) 2006-2007 Mauro Carvalho Chehab <mchehab@kernel.org>
66 */
77
88 /*
drivers/media/usb/tm6000/tm6000-usb-isoc.h+1−1
@@ -2,7 +2,7 @@ · 1 unmodified line
22 * SPDX-License-Identifier: GPL-2.0
33 * tm6000-buf.c - driver for TM5600/TM6000/TM6010 USB video capture devices
44 *
5− * Copyright (c) 2006-2007 Mauro Carvalho Chehab <mchehab@infradead.org>
5+ * Copyright (c) 2006-2007 Mauro Carvalho Chehab <mchehab@kernel.org>
66 */
77
88 #include <linux/videodev2.h>
drivers/media/usb/tm6000/tm6000-video.c+1−1
@@ -1,7 +1,7 @@
11 // SPDX-License-Identifier: GPL-2.0
22 // tm6000-video.c - driver for TM5600/TM6000/TM6010 USB video capture devices
33 //
4−// Copyright (c) 2006-2007 Mauro Carvalho Chehab <mchehab@infradead.org>
4+// Copyright (c) 2006-2007 Mauro Carvalho Chehab <mchehab@kernel.org>
55 //
66 // Copyright (c) 2007 Michel Ludwig <michel.ludwig@gmail.com>
77 // - Fixed module load/unload
drivers/media/usb/tm6000/tm6000.h+1−1
@@ -2,7 +2,7 @@ · 1 unmodified line
22 * SPDX-License-Identifier: GPL-2.0
33 * tm6000.h - driver for TM5600/TM6000/TM6010 USB video capture devices
44 *
5− * Copyright (c) 2006-2007 Mauro Carvalho Chehab <mchehab@infradead.org>
5+ * Copyright (c) 2006-2007 Mauro Carvalho Chehab <mchehab@kernel.org>
66 *
77 * Copyright (c) 2007 Michel Ludwig <michel.ludwig@gmail.com>
88 * - DVB-T support
drivers/media/v4l2-core/v4l2-dev.c+2−2
@@ -10,7 +10,7 @@ · 9 unmodified lines
1010 * 2 of the License, or (at your option) any later version.
1111 *
1212 * Authors: Alan Cox, <alan@lxorguk.ukuu.org.uk> (version 1)
13− * Mauro Carvalho Chehab <mchehab@infradead.org> (version 2)
13+ * Mauro Carvalho Chehab <mchehab@kernel.org> (version 2)
1414 *
1515 * Fixes: 20000516 Claudio Matsuoka <claudio@conectiva.com>
1616 * - Added procfs support
@@ -1079,7 +1079,7 @@ static void __exit videodev_exit(void) · 1062 unmodified lines
10791079 subsys_initcall(videodev_init);
10801080 module_exit(videodev_exit)
10811081
1082−MODULE_AUTHOR("Alan Cox, Mauro Carvalho Chehab <mchehab@infradead.org>");
1082+MODULE_AUTHOR("Alan Cox, Mauro Carvalho Chehab <mchehab@kernel.org>");
10831083 MODULE_DESCRIPTION("Device registrar for Video4Linux drivers v2");
10841084 MODULE_LICENSE("GPL");
10851085 MODULE_ALIAS_CHARDEV_MAJOR(VIDEO_MAJOR);
drivers/media/v4l2-core/v4l2-ioctl.c+1−1
@@ -9,7 +9,7 @@ · 8 unmodified lines
99 * 2 of the License, or (at your option) any later version.
1010 *
1111 * Authors: Alan Cox, <alan@lxorguk.ukuu.org.uk> (version 1)
12− * Mauro Carvalho Chehab <mchehab@infradead.org> (version 2)
12+ * Mauro Carvalho Chehab <mchehab@kernel.org> (version 2)
1313 */
1414
1515 #include <linux/mm.h>
drivers/media/v4l2-core/videobuf-core.c+3−3
@@ -1,11 +1,11 @@
11 /*
22 * generic helper functions for handling video4linux capture buffers
33 *
4− * (c) 2007 Mauro Carvalho Chehab, <mchehab@infradead.org>
4+ * (c) 2007 Mauro Carvalho Chehab, <mchehab@kernel.org>
55 *
66 * Highly based on video-buf written originally by:
77 * (c) 2001,02 Gerd Knorr <kraxel@bytesex.org>
8− * (c) 2006 Mauro Carvalho Chehab, <mchehab@infradead.org>
8+ * (c) 2006 Mauro Carvalho Chehab, <mchehab@kernel.org>
99 * (c) 2006 Ted Walther and John Sokol
1010 *
1111 * This program is free software; you can redistribute it and/or modify
@@ -38,7 +38,7 @@ static int debug; · 26 unmodified lines
3838 module_param(debug, int, 0644);
3939
4040 MODULE_DESCRIPTION("helper module to manage video4linux buffers");
41−MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@infradead.org>");
41+MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@kernel.org>");
4242 MODULE_LICENSE("GPL");
4343
4444 #define dprintk(level, fmt, arg...) \
drivers/media/v4l2-core/videobuf-dma-contig.c+1−1
@@ -7,7 +7,7 @@ · 6 unmodified lines
77 * Copyright (c) 2008 Magnus Damm
88 *
99 * Based on videobuf-vmalloc.c,
10− * (c) 2007 Mauro Carvalho Chehab, <mchehab@infradead.org>
10+ * (c) 2007 Mauro Carvalho Chehab, <mchehab@kernel.org>
1111 *
1212 * This program is free software; you can redistribute it and/or modify
1313 * it under the terms of the GNU General Public License as published by
drivers/media/v4l2-core/videobuf-dma-sg.c+3−3
@@ -6,11 +6,11 @@ · 5 unmodified lines
66 * into PAGE_SIZE chunks). They also assume the driver does not need
77 * to touch the video data.
88 *
9− * (c) 2007 Mauro Carvalho Chehab, <mchehab@infradead.org>
9+ * (c) 2007 Mauro Carvalho Chehab, <mchehab@kernel.org>
1010 *
1111 * Highly based on video-buf written originally by:
1212 * (c) 2001,02 Gerd Knorr <kraxel@bytesex.org>
13− * (c) 2006 Mauro Carvalho Chehab, <mchehab@infradead.org>
13+ * (c) 2006 Mauro Carvalho Chehab, <mchehab@kernel.org>
1414 * (c) 2006 Ted Walther and John Sokol
1515 *
1616 * This program is free software; you can redistribute it and/or modify
@@ -48,7 +48,7 @@ static int debug; · 31 unmodified lines
4848 module_param(debug, int, 0644);
4949
5050 MODULE_DESCRIPTION("helper module to manage video4linux dma sg buffers");
51−MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@infradead.org>");
51+MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@kernel.org>");
5252 MODULE_LICENSE("GPL");
5353
5454 #define dprintk(level, fmt, arg...) \
drivers/media/v4l2-core/videobuf-vmalloc.c+2−2
@@ -6,7 +6,7 @@ · 5 unmodified lines
66 * into PAGE_SIZE chunks). They also assume the driver does not need
77 * to touch the video data.
88 *
9− * (c) 2007 Mauro Carvalho Chehab, <mchehab@infradead.org>
9+ * (c) 2007 Mauro Carvalho Chehab, <mchehab@kernel.org>
1010 *
1111 * This program is free software; you can redistribute it and/or modify
1212 * it under the terms of the GNU General Public License as published by
@@ -41,7 +41,7 @@ static int debug; · 28 unmodified lines
4141 module_param(debug, int, 0644);
4242
4343 MODULE_DESCRIPTION("helper module to manage video4linux vmalloc buffers");
44−MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@infradead.org>");
44+MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@kernel.org>");
4545 MODULE_LICENSE("GPL");
4646
4747 #define dprintk(level, fmt, arg...) \
drivers/memory/emif-asm-offsets.c+1−71
@@ -16,77 +16,7 @@ · 15 unmodified lines
1616
1717 int main(void)
1818 {
19− DEFINE(EMIF_SDCFG_VAL_OFFSET,
20− offsetof(struct emif_regs_amx3, emif_sdcfg_val));
21− DEFINE(EMIF_TIMING1_VAL_OFFSET,
22− offsetof(struct emif_regs_amx3, emif_timing1_val));
23− DEFINE(EMIF_TIMING2_VAL_OFFSET,
24− offsetof(struct emif_regs_amx3, emif_timing2_val));
25− DEFINE(EMIF_TIMING3_VAL_OFFSET,
26− offsetof(struct emif_regs_amx3, emif_timing3_val));
27− DEFINE(EMIF_REF_CTRL_VAL_OFFSET,
28− offsetof(struct emif_regs_amx3, emif_ref_ctrl_val));
29− DEFINE(EMIF_ZQCFG_VAL_OFFSET,
30− offsetof(struct emif_regs_amx3, emif_zqcfg_val));
31− DEFINE(EMIF_PMCR_VAL_OFFSET,
32− offsetof(struct emif_regs_amx3, emif_pmcr_val));
33− DEFINE(EMIF_PMCR_SHDW_VAL_OFFSET,
34− offsetof(struct emif_regs_amx3, emif_pmcr_shdw_val));
35− DEFINE(EMIF_RD_WR_LEVEL_RAMP_CTRL_OFFSET,
36− offsetof(struct emif_regs_amx3, emif_rd_wr_level_ramp_ctrl));
37− DEFINE(EMIF_RD_WR_EXEC_THRESH_OFFSET,
38− offsetof(struct emif_regs_amx3, emif_rd_wr_exec_thresh));
39− DEFINE(EMIF_COS_CONFIG_OFFSET,
40− offsetof(struct emif_regs_amx3, emif_cos_config));
41− DEFINE(EMIF_PRIORITY_TO_COS_MAPPING_OFFSET,
42− offsetof(struct emif_regs_amx3, emif_priority_to_cos_mapping));
43− DEFINE(EMIF_CONNECT_ID_SERV_1_MAP_OFFSET,
44− offsetof(struct emif_regs_amx3, emif_connect_id_serv_1_map));
45− DEFINE(EMIF_CONNECT_ID_SERV_2_MAP_OFFSET,
46− offsetof(struct emif_regs_amx3, emif_connect_id_serv_2_map));
47− DEFINE(EMIF_OCP_CONFIG_VAL_OFFSET,
48− offsetof(struct emif_regs_amx3, emif_ocp_config_val));
49− DEFINE(EMIF_LPDDR2_NVM_TIM_OFFSET,
50− offsetof(struct emif_regs_amx3, emif_lpddr2_nvm_tim));
51− DEFINE(EMIF_LPDDR2_NVM_TIM_SHDW_OFFSET,
52− offsetof(struct emif_regs_amx3, emif_lpddr2_nvm_tim_shdw));
53− DEFINE(EMIF_DLL_CALIB_CTRL_VAL_OFFSET,
54− offsetof(struct emif_regs_amx3, emif_dll_calib_ctrl_val));
55− DEFINE(EMIF_DLL_CALIB_CTRL_VAL_SHDW_OFFSET,
56− offsetof(struct emif_regs_amx3, emif_dll_calib_ctrl_val_shdw));
57− DEFINE(EMIF_DDR_PHY_CTLR_1_OFFSET,
58− offsetof(struct emif_regs_amx3, emif_ddr_phy_ctlr_1));
59− DEFINE(EMIF_EXT_PHY_CTRL_VALS_OFFSET,
60− offsetof(struct emif_regs_amx3, emif_ext_phy_ctrl_vals));
61− DEFINE(EMIF_REGS_AMX3_SIZE, sizeof(struct emif_regs_amx3));
62−
63− BLANK();
64−
65− DEFINE(EMIF_PM_BASE_ADDR_VIRT_OFFSET,
66− offsetof(struct ti_emif_pm_data, ti_emif_base_addr_virt));
67− DEFINE(EMIF_PM_BASE_ADDR_PHYS_OFFSET,
68− offsetof(struct ti_emif_pm_data, ti_emif_base_addr_phys));
69− DEFINE(EMIF_PM_CONFIG_OFFSET,
70− offsetof(struct ti_emif_pm_data, ti_emif_sram_config));
71− DEFINE(EMIF_PM_REGS_VIRT_OFFSET,
72− offsetof(struct ti_emif_pm_data, regs_virt));
73− DEFINE(EMIF_PM_REGS_PHYS_OFFSET,
74− offsetof(struct ti_emif_pm_data, regs_phys));
75− DEFINE(EMIF_PM_DATA_SIZE, sizeof(struct ti_emif_pm_data));
76−
77− BLANK();
78−
79− DEFINE(EMIF_PM_SAVE_CONTEXT_OFFSET,
80− offsetof(struct ti_emif_pm_functions, save_context));
81− DEFINE(EMIF_PM_RESTORE_CONTEXT_OFFSET,
82− offsetof(struct ti_emif_pm_functions, restore_context));
83− DEFINE(EMIF_PM_ENTER_SR_OFFSET,
84− offsetof(struct ti_emif_pm_functions, enter_sr));
85− DEFINE(EMIF_PM_EXIT_SR_OFFSET,
86− offsetof(struct ti_emif_pm_functions, exit_sr));
87− DEFINE(EMIF_PM_ABORT_SR_OFFSET,
88− offsetof(struct ti_emif_pm_functions, abort_sr));
89− DEFINE(EMIF_PM_FUNCTIONS_SIZE, sizeof(struct ti_emif_pm_functions));
19+ ti_emif_asm_offsets();
9020
9121 return 0;
9222 }
drivers/message/fusion/mptsas.c+1−0
@@ -1994,6 +1994,7 @@ static struct scsi_host_template mptsas_driver_template = { · 1993 unmodified lines
19941994 .cmd_per_lun = 7,
19951995 .use_clustering = ENABLE_CLUSTERING,
19961996 .shost_attrs = mptscsih_host_attrs,
1997+ .no_write_same = 1,
19971998 };
19981999
19992000 static int mptsas_get_linkerrors(struct sas_phy *phy)
drivers/mmc/host/renesas_sdhi_internal_dmac.c+33−6
@@ -9,6 +9,7 @@ · 8 unmodified lines
99 * published by the Free Software Foundation.
1010 */
1111
12+#include <linux/bitops.h>
1213 #include <linux/device.h>
1314 #include <linux/dma-mapping.h>
1415 #include <linux/io-64-nonatomic-hi-lo.h>
@@ -62,6 +63,17 @@ · 47 unmodified lines
6263 * need a custom accessor.
6364 */
6465
66+static unsigned long global_flags;
67+/*
68+ * Workaround for avoiding to use RX DMAC by multiple channels.
69+ * On R-Car H3 ES1.* and M3-W ES1.0, when multiple SDHI channels use
70+ * RX DMAC simultaneously, sometimes hundreds of bytes data are not
71+ * stored into the system memory even if the DMAC interrupt happened.
72+ * So, this driver then uses one RX DMAC channel only.
73+ */
74+#define SDHI_INTERNAL_DMAC_ONE_RX_ONLY 0
75+#define SDHI_INTERNAL_DMAC_RX_IN_USE 1
76+
6577 /* Definitions for sampling clocks */
6678 static struct renesas_sdhi_scc rcar_gen3_scc_taps[] = {
6779 {
@@ -126,6 +138,9 @@ renesas_sdhi_internal_dmac_abort_dma(struct tmio_mmc_host *host) { · 58 unmodified lines
126138 renesas_sdhi_internal_dmac_dm_write(host, DM_CM_RST,
127139 RST_RESERVED_BITS | val);
128140
141+ if (host->data && host->data->flags & MMC_DATA_READ)
142+ clear_bit(SDHI_INTERNAL_DMAC_RX_IN_USE, &global_flags);
143+
129144 renesas_sdhi_internal_dmac_enable_dma(host, true);
130145 }
131146
@@ -155,6 +170,9 @@ renesas_sdhi_internal_dmac_start_dma(struct tmio_mmc_host *host, · 23 unmodified lines
155170 if (data->flags & MMC_DATA_READ) {
156171 dtran_mode |= DTRAN_MODE_CH_NUM_CH1;
157172 dir = DMA_FROM_DEVICE;
173+ if (test_bit(SDHI_INTERNAL_DMAC_ONE_RX_ONLY, &global_flags) &&
174+ test_and_set_bit(SDHI_INTERNAL_DMAC_RX_IN_USE, &global_flags))
175+ goto force_pio;
158176 } else {
159177 dtran_mode |= DTRAN_MODE_CH_NUM_CH0;
160178 dir = DMA_TO_DEVICE;
@@ -208,6 +226,9 @@ static void renesas_sdhi_internal_dmac_complete_tasklet_fn(unsigned long arg) · 47 unmodified lines
208226 renesas_sdhi_internal_dmac_enable_dma(host, false);
209227 dma_unmap_sg(&host->pdev->dev, host->sg_ptr, host->sg_len, dir);
210228
229+ if (dir == DMA_FROM_DEVICE)
230+ clear_bit(SDHI_INTERNAL_DMAC_RX_IN_USE, &global_flags);
231+
211232 tmio_mmc_do_data_irq(host);
212233 out:
213234 spin_unlock_irq(&host->lock);
@@ -251,18 +272,24 @@ static const struct tmio_mmc_dma_ops renesas_sdhi_internal_dmac_dma_ops = { · 37 unmodified lines
251272 * implementation as others may use a different implementation.
252273 */
253274 static const struct soc_device_attribute gen3_soc_whitelist[] = {
254− { .soc_id = "r8a7795", .revision = "ES1.*" },
255− { .soc_id = "r8a7795", .revision = "ES2.0" },
256− { .soc_id = "r8a7796", .revision = "ES1.0" },
257− { .soc_id = "r8a77995", .revision = "ES1.0" },
258− { /* sentinel */ }
275+ { .soc_id = "r8a7795", .revision = "ES1.*",
276+ .data = (void *)BIT(SDHI_INTERNAL_DMAC_ONE_RX_ONLY) },
277+ { .soc_id = "r8a7795", .revision = "ES2.0" },
278+ { .soc_id = "r8a7796", .revision = "ES1.0",
279+ .data = (void *)BIT(SDHI_INTERNAL_DMAC_ONE_RX_ONLY) },
280+ { .soc_id = "r8a77995", .revision = "ES1.0" },
281+ { /* sentinel */ }
259282 };
260283
261284 static int renesas_sdhi_internal_dmac_probe(struct platform_device *pdev)
262285 {
263− if (!soc_device_match(gen3_soc_whitelist))
286+ const struct soc_device_attribute *soc = soc_device_match(gen3_soc_whitelist);
287+
288+ if (!soc)
264289 return -ENODEV;
265290
291+ global_flags |= (unsigned long)soc->data;
292+
266293 return renesas_sdhi_probe(pdev, &renesas_sdhi_internal_dmac_dma_ops);
267294 }
268295
drivers/mmc/host/sdhci-pci-core.c+23−2
@@ -1312,7 +1312,7 @@ static void amd_enable_manual_tuning(struct pci_dev *pdev) · 1311 unmodified lines
13121312 pci_write_config_dword(pdev, AMD_SD_MISC_CONTROL, val);
13131313 }
13141314
1315−static int amd_execute_tuning(struct sdhci_host *host, u32 opcode)
1315+static int amd_execute_tuning_hs200(struct sdhci_host *host, u32 opcode)
13161316 {
13171317 struct sdhci_pci_slot *slot = sdhci_priv(host);
13181318 struct pci_dev *pdev = slot->chip->pdev;
@@ -1351,6 +1351,27 @@ static int amd_execute_tuning(struct sdhci_host *host, u32 opcode) · 32 unmodified lines
13511351 return 0;
13521352 }
13531353
1354+static int amd_execute_tuning(struct mmc_host *mmc, u32 opcode)
1355+{
1356+ struct sdhci_host *host = mmc_priv(mmc);
1357+
1358+ /* AMD requires custom HS200 tuning */
1359+ if (host->timing == MMC_TIMING_MMC_HS200)
1360+ return amd_execute_tuning_hs200(host, opcode);
1361+
1362+ /* Otherwise perform standard SDHCI tuning */
1363+ return sdhci_execute_tuning(mmc, opcode);
1364+}
1365+
1366+static int amd_probe_slot(struct sdhci_pci_slot *slot)
1367+{
1368+ struct mmc_host_ops *ops = &slot->host->mmc_host_ops;
1369+
1370+ ops->execute_tuning = amd_execute_tuning;
1371+
1372+ return 0;
1373+}
1374+
13541375 static int amd_probe(struct sdhci_pci_chip *chip)
13551376 {
13561377 struct pci_dev *smbus_dev;
@@ -1385,12 +1406,12 @@ static const struct sdhci_ops amd_sdhci_pci_ops = { · 28 unmodified lines
13851406 .set_bus_width = sdhci_set_bus_width,
13861407 .reset = sdhci_reset,
13871408 .set_uhs_signaling = sdhci_set_uhs_signaling,
1388− .platform_execute_tuning = amd_execute_tuning,
13891409 };
13901410
13911411 static const struct sdhci_pci_fixes sdhci_amd = {
13921412 .probe = amd_probe,
13931413 .ops = &amd_sdhci_pci_ops,
1414+ .probe_slot = amd_probe_slot,
13941415 };
13951416
13961417 static const struct pci_device_id pci_ids[] = {
drivers/mtd/chips/cfi_cmdset_0001.c+28−5
@@ -45,6 +45,7 @@ · 44 unmodified lines
4545 #define I82802AB 0x00ad
4646 #define I82802AC 0x00ac
4747 #define PF38F4476 0x881c
48+#define M28F00AP30 0x8963
4849 /* STMicroelectronics chips */
4950 #define M50LPW080 0x002F
5051 #define M50FLW080A 0x0080
@@ -375,6 +376,17 @@ static void cfi_fixup_major_minor(struct cfi_private *cfi, · 324 unmodified lines
375376 extp->MinorVersion = '1';
376377 }
377378
379+static int cfi_is_micron_28F00AP30(struct cfi_private *cfi, struct flchip *chip)
380+{
381+ /*
382+ * Micron(was Numonyx) 1Gbit bottom boot are buggy w.r.t
383+ * Erase Supend for their small Erase Blocks(0x8000)
384+ */
385+ if (cfi->mfr == CFI_MFR_INTEL && cfi->id == M28F00AP30)
386+ return 1;
387+ return 0;
388+}
389+
378390 static inline struct cfi_pri_intelext *
379391 read_pri_intelext(struct map_info *map, __u16 adr)
380392 {
@@ -831,21 +843,30 @@ static int chip_ready (struct map_info *map, struct flchip *chip, unsigned long · 450 unmodified lines
831843 (mode == FL_WRITING && (cfip->SuspendCmdSupport & 1))))
832844 goto sleep;
833845
846+ /* Do not allow suspend iff read/write to EB address */
847+ if ((adr & chip->in_progress_block_mask) ==
848+ chip->in_progress_block_addr)
849+ goto sleep;
850+
851+ /* do not suspend small EBs, buggy Micron Chips */
852+ if (cfi_is_micron_28F00AP30(cfi, chip) &&
853+ (chip->in_progress_block_mask == ~(0x8000-1)))
854+ goto sleep;
834855
835856 /* Erase suspend */
836− map_write(map, CMD(0xB0), adr);
857+ map_write(map, CMD(0xB0), chip->in_progress_block_addr);
837858
838859 /* If the flash has finished erasing, then 'erase suspend'
839860 * appears to make some (28F320) flash devices switch to
840861 * 'read' mode. Make sure that we switch to 'read status'
841862 * mode so we get the right data. --rmk
842863 */
843− map_write(map, CMD(0x70), adr);
864+ map_write(map, CMD(0x70), chip->in_progress_block_addr);
844865 chip->oldstate = FL_ERASING;
845866 chip->state = FL_ERASE_SUSPENDING;
846867 chip->erase_suspended = 1;
847868 for (;;) {
848− status = map_read(map, adr);
869+ status = map_read(map, chip->in_progress_block_addr);
849870 if (map_word_andequal(map, status, status_OK, status_OK))
850871 break;
851872
@@ -1041,8 +1062,8 @@ static void put_chip(struct map_info *map, struct flchip *chip, unsigned long ad · 189 unmodified lines
10411062 sending the 0x70 (Read Status) command to an erasing
10421063 chip and expecting it to be ignored, that's what we
10431064 do. */
1044− map_write(map, CMD(0xd0), adr);
1045− map_write(map, CMD(0x70), adr);
1065+ map_write(map, CMD(0xd0), chip->in_progress_block_addr);
1066+ map_write(map, CMD(0x70), chip->in_progress_block_addr);
10461067 chip->oldstate = FL_READY;
10471068 chip->state = FL_ERASING;
10481069 break;
@@ -1933,6 +1954,8 @@ static int __xipram do_erase_oneblock(struct map_info *map, struct flchip *chip, · 884 unmodified lines
19331954 map_write(map, CMD(0xD0), adr);
19341955 chip->state = FL_ERASING;
19351956 chip->erase_suspended = 0;
1957+ chip->in_progress_block_addr = adr;
1958+ chip->in_progress_block_mask = ~(len - 1);
19361959
19371960 ret = INVAL_CACHE_AND_WAIT(map, chip, adr,
19381961 adr, len,
drivers/mtd/chips/cfi_cmdset_0002.c+6−3
@@ -816,9 +816,10 @@ static int get_chip(struct map_info *map, struct flchip *chip, unsigned long adr · 815 unmodified lines
816816 (mode == FL_WRITING && (cfip->EraseSuspend & 0x2))))
817817 goto sleep;
818818
819− /* We could check to see if we're trying to access the sector
820− * that is currently being erased. However, no user will try
821− * anything like that so we just wait for the timeout. */
819+ /* Do not allow suspend iff read/write to EB address */
820+ if ((adr & chip->in_progress_block_mask) ==
821+ chip->in_progress_block_addr)
822+ goto sleep;
822823
823824 /* Erase suspend */
824825 /* It's harmless to issue the Erase-Suspend and Erase-Resume
@@ -2267,6 +2268,7 @@ static int __xipram do_erase_chip(struct map_info *map, struct flchip *chip) · 1442 unmodified lines
22672268 chip->state = FL_ERASING;
22682269 chip->erase_suspended = 0;
22692270 chip->in_progress_block_addr = adr;
2271+ chip->in_progress_block_mask = ~(map->size - 1);
22702272
22712273 INVALIDATE_CACHE_UDELAY(map, chip,
22722274 adr, map->size,
@@ -2356,6 +2358,7 @@ static int __xipram do_erase_oneblock(struct map_info *map, struct flchip *chip, · 83 unmodified lines
23562358 chip->state = FL_ERASING;
23572359 chip->erase_suspended = 0;
23582360 chip->in_progress_block_addr = adr;
2361+ chip->in_progress_block_mask = ~(len - 1);
23592362
23602363 INVALIDATE_CACHE_UDELAY(map, chip,
23612364 adr, len,
drivers/mtd/nand/core.c+0−3
@@ -162,7 +162,6 @@ int nanddev_mtd_erase(struct mtd_info *mtd, struct erase_info *einfo) · 161 unmodified lines
162162 ret = nanddev_erase(nand, &pos);
163163 if (ret) {
164164 einfo->fail_addr = nanddev_pos_to_offs(nand, &pos);
165− einfo->state = MTD_ERASE_FAILED;
166165
167166 return ret;
168167 }
@@ -170,8 +169,6 @@ int nanddev_mtd_erase(struct mtd_info *mtd, struct erase_info *einfo) · 1 unmodified line
170169 nanddev_pos_next_eraseblock(nand, &pos);
171170 }
172171
173− einfo->state = MTD_ERASE_DONE;
174−
175172 return 0;
176173 }
177174 EXPORT_SYMBOL_GPL(nanddev_mtd_erase);
drivers/mtd/nand/raw/marvell_nand.c+8−17
@@ -2299,29 +2299,20 @@ static int marvell_nand_chip_init(struct device *dev, struct marvell_nfc *nfc, · 2298 unmodified lines
22992299 /*
23002300 * The legacy "num-cs" property indicates the number of CS on the only
23012301 * chip connected to the controller (legacy bindings does not support
2302− * more than one chip). CS are only incremented one by one while the RB
2303− * pin is always the #0.
2302+ * more than one chip). The CS and RB pins are always the #0.
23042303 *
23052304 * When not using legacy bindings, a couple of "reg" and "nand-rb"
23062305 * properties must be filled. For each chip, expressed as a subnode,
23072306 * "reg" points to the CS lines and "nand-rb" to the RB line.
23082307 */
2309− if (pdata) {
2308+ if (pdata || nfc->caps->legacy_of_bindings) {
23102309 nsels = 1;
2311− } else if (nfc->caps->legacy_of_bindings &&
2312− !of_get_property(np, "num-cs", &nsels)) {
2313− dev_err(dev, "missing num-cs property\n");
2314− return -EINVAL;
2315− } else if (!of_get_property(np, "reg", &nsels)) {
2316− dev_err(dev, "missing reg property\n");
2317− return -EINVAL;
2318− }
2319−
2320− if (!pdata)
2321− nsels /= sizeof(u32);
2322− if (!nsels) {
2323− dev_err(dev, "invalid reg property size\n");
2324− return -EINVAL;
2310+ } else {
2311+ nsels = of_property_count_elems_of_size(np, "reg", sizeof(u32));
2312+ if (nsels <= 0) {
2313+ dev_err(dev, "missing/invalid reg property\n");
2314+ return -EINVAL;
2315+ }
23252316 }
23262317
23272318 /* Alloc the nand chip structure */
drivers/mtd/nand/raw/tango_nand.c+1−1
@@ -645,7 +645,7 @@ static int tango_nand_probe(struct platform_device *pdev) · 644 unmodified lines
645645
646646 writel_relaxed(MODE_RAW, nfc->pbus_base + PBUS_PAD_MODE);
647647
648− clk = clk_get(&pdev->dev, NULL);
648+ clk = devm_clk_get(&pdev->dev, NULL);
649649 if (IS_ERR(clk))
650650 return PTR_ERR(clk);
651651
drivers/mtd/spi-nor/cadence-quadspi.c+17−2
@@ -501,7 +501,9 @@ static int cqspi_indirect_read_execute(struct spi_nor *nor, u8 *rxbuf, · 500 unmodified lines
501501 void __iomem *reg_base = cqspi->iobase;
502502 void __iomem *ahb_base = cqspi->ahb_base;
503503 unsigned int remaining = n_rx;
504+ unsigned int mod_bytes = n_rx % 4;
504505 unsigned int bytes_to_read = 0;
506+ u8 *rxbuf_end = rxbuf + n_rx;
505507 int ret = 0;
506508
507509 writel(from_addr, reg_base + CQSPI_REG_INDIRECTRDSTARTADDR);
@@ -530,11 +532,24 @@ static int cqspi_indirect_read_execute(struct spi_nor *nor, u8 *rxbuf, · 22 unmodified lines
530532 }
531533
532534 while (bytes_to_read != 0) {
535+ unsigned int word_remain = round_down(remaining, 4);
536+
533537 bytes_to_read *= cqspi->fifo_width;
534538 bytes_to_read = bytes_to_read > remaining ?
535539 remaining : bytes_to_read;
536− ioread32_rep(ahb_base, rxbuf,
537− DIV_ROUND_UP(bytes_to_read, 4));
540+ bytes_to_read = round_down(bytes_to_read, 4);
541+ /* Read 4 byte word chunks then single bytes */
542+ if (bytes_to_read) {
543+ ioread32_rep(ahb_base, rxbuf,
544+ (bytes_to_read / 4));
545+ } else if (!word_remain && mod_bytes) {
546+ unsigned int temp = ioread32(ahb_base);
547+
548+ bytes_to_read = mod_bytes;
549+ memcpy(rxbuf, &temp, min((unsigned int)
550+ (rxbuf_end - rxbuf),
551+ bytes_to_read));
552+ }
538553 rxbuf += bytes_to_read;
539554 remaining -= bytes_to_read;
540555 bytes_to_read = cqspi_get_rd_sram_level(cqspi);
drivers/net/bonding/bond_main.c+1−2
@@ -1660,8 +1660,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev, · 1659 unmodified lines
16601660 } /* switch(bond_mode) */
16611661
16621662 #ifdef CONFIG_NET_POLL_CONTROLLER
1663− slave_dev->npinfo = bond->dev->npinfo;
1664− if (slave_dev->npinfo) {
1663+ if (bond->dev->npinfo) {
16651664 if (slave_enable_netpoll(new_slave)) {
16661665 netdev_info(bond_dev, "master_dev is using netpoll, but new slave device does not support netpoll\n");
16671666 res = -EBUSY;
drivers/net/dsa/mv88e6xxx/hwtstamp.c+10−2
@@ -285,10 +285,18 @@ static void mv88e6xxx_get_rxts(struct mv88e6xxx_chip *chip, · 284 unmodified lines
285285 struct sk_buff_head *rxq)
286286 {
287287 u16 buf[4] = { 0 }, status, seq_id;
288− u64 ns, timelo, timehi;
289288 struct skb_shared_hwtstamps *shwt;
289+ struct sk_buff_head received;
290+ u64 ns, timelo, timehi;
291+ unsigned long flags;
290292 int err;
291293
294+ /* The latched timestamp belongs to one of the received frames. */
295+ __skb_queue_head_init(&received);
296+ spin_lock_irqsave(&rxq->lock, flags);
297+ skb_queue_splice_tail_init(rxq, &received);
298+ spin_unlock_irqrestore(&rxq->lock, flags);
299+
292300 mutex_lock(&chip->reg_lock);
293301 err = mv88e6xxx_port_ptp_read(chip, ps->port_id,
294302 reg, buf, ARRAY_SIZE(buf));
@@ -311,7 +319,7 @@ static void mv88e6xxx_get_rxts(struct mv88e6xxx_chip *chip, · 16 unmodified lines
311319 /* Since the device can only handle one time stamp at a time,
312320 * we purge any extra frames from the queue.
313321 */
314− for ( ; skb; skb = skb_dequeue(rxq)) {
322+ for ( ; skb; skb = __skb_dequeue(&received)) {
315323 if (mv88e6xxx_ts_valid(status) && seq_match(skb, seq_id)) {
316324 ns = timehi << 16 | timelo;
317325
drivers/net/ethernet/amd/xgbe/xgbe-common.h+8−0
@@ -1321,6 +1321,10 @@ · 1320 unmodified lines
13211321 #define MDIO_VEND2_AN_STAT 0x8002
13221322 #endif
13231323
1324+#ifndef MDIO_VEND2_PMA_CDR_CONTROL
1325+#define MDIO_VEND2_PMA_CDR_CONTROL 0x8056
1326+#endif
1327+
13241328 #ifndef MDIO_CTRL1_SPEED1G
13251329 #define MDIO_CTRL1_SPEED1G (MDIO_CTRL1_SPEED10G & ~BMCR_SPEED100)
13261330 #endif
@@ -1369,6 +1373,10 @@ · 42 unmodified lines
13691373 #define XGBE_AN_CL37_TX_CONFIG_MASK 0x08
13701374 #define XGBE_AN_CL37_MII_CTRL_8BIT 0x0100
13711375
1376+#define XGBE_PMA_CDR_TRACK_EN_MASK 0x01
1377+#define XGBE_PMA_CDR_TRACK_EN_OFF 0x00
1378+#define XGBE_PMA_CDR_TRACK_EN_ON 0x01
1379+
13721380 /* Bit setting and getting macros
13731381 * The get macro will extract the current bit field value from within
13741382 * the variable
drivers/net/ethernet/amd/xgbe/xgbe-debugfs.c+16−0
@@ -519,6 +519,22 @@ void xgbe_debugfs_init(struct xgbe_prv_data *pdata) · 518 unmodified lines
519519 "debugfs_create_file failed\n");
520520 }
521521
522+ if (pdata->vdata->an_cdr_workaround) {
523+ pfile = debugfs_create_bool("an_cdr_workaround", 0600,
524+ pdata->xgbe_debugfs,
525+ &pdata->debugfs_an_cdr_workaround);
526+ if (!pfile)
527+ netdev_err(pdata->netdev,
528+ "debugfs_create_bool failed\n");
529+
530+ pfile = debugfs_create_bool("an_cdr_track_early", 0600,
531+ pdata->xgbe_debugfs,
532+ &pdata->debugfs_an_cdr_track_early);
533+ if (!pfile)
534+ netdev_err(pdata->netdev,
535+ "debugfs_create_bool failed\n");
536+ }
537+
522538 kfree(buf);
523539 }
524540
drivers/net/ethernet/amd/xgbe/xgbe-main.c+1−0
@@ -349,6 +349,7 @@ int xgbe_config_netdev(struct xgbe_prv_data *pdata) · 348 unmodified lines
349349 XGMAC_SET_BITS(pdata->rss_options, MAC_RSSCR, UDP4TE, 1);
350350
351351 /* Call MDIO/PHY initialization routine */
352+ pdata->debugfs_an_cdr_workaround = pdata->vdata->an_cdr_workaround;
352353 ret = pdata->phy_if.phy_init(pdata);
353354 if (ret)
354355 return ret;
drivers/net/ethernet/amd/xgbe/xgbe-mdio.c+19−5
@@ -432,11 +432,16 @@ static void xgbe_an73_disable(struct xgbe_prv_data *pdata) · 431 unmodified lines
432432 xgbe_an73_set(pdata, false, false);
433433 xgbe_an73_disable_interrupts(pdata);
434434
435+ pdata->an_start = 0;
436+
435437 netif_dbg(pdata, link, pdata->netdev, "CL73 AN disabled\n");
436438 }
437439
438440 static void xgbe_an_restart(struct xgbe_prv_data *pdata)
439441 {
442+ if (pdata->phy_if.phy_impl.an_pre)
443+ pdata->phy_if.phy_impl.an_pre(pdata);
444+
440445 switch (pdata->an_mode) {
441446 case XGBE_AN_MODE_CL73:
442447 case XGBE_AN_MODE_CL73_REDRV:
@@ -453,6 +458,9 @@ static void xgbe_an_restart(struct xgbe_prv_data *pdata) · 10 unmodified lines
453458
454459 static void xgbe_an_disable(struct xgbe_prv_data *pdata)
455460 {
461+ if (pdata->phy_if.phy_impl.an_post)
462+ pdata->phy_if.phy_impl.an_post(pdata);
463+
456464 switch (pdata->an_mode) {
457465 case XGBE_AN_MODE_CL73:
458466 case XGBE_AN_MODE_CL73_REDRV:
@@ -505,11 +513,11 @@ static enum xgbe_an xgbe_an73_tx_training(struct xgbe_prv_data *pdata, · 46 unmodified lines
505513 XMDIO_WRITE(pdata, MDIO_MMD_PMAPMD, MDIO_PMA_10GBR_PMD_CTRL,
506514 reg);
507515
508− if (pdata->phy_if.phy_impl.kr_training_post)
509− pdata->phy_if.phy_impl.kr_training_post(pdata);
510−
511516 netif_dbg(pdata, link, pdata->netdev,
512517 "KR training initiated\n");
518+
519+ if (pdata->phy_if.phy_impl.kr_training_post)
520+ pdata->phy_if.phy_impl.kr_training_post(pdata);
513521 }
514522
515523 return XGBE_AN_PAGE_RECEIVED;
@@ -637,11 +645,11 @@ static enum xgbe_an xgbe_an73_incompat_link(struct xgbe_prv_data *pdata) · 121 unmodified lines
637645 return XGBE_AN_NO_LINK;
638646 }
639647
640− xgbe_an73_disable(pdata);
648+ xgbe_an_disable(pdata);
641649
642650 xgbe_switch_mode(pdata);
643651
644− xgbe_an73_restart(pdata);
652+ xgbe_an_restart(pdata);
645653
646654 return XGBE_AN_INCOMPAT_LINK;
647655 }
@@ -820,6 +828,9 @@ static void xgbe_an37_state_machine(struct xgbe_prv_data *pdata) · 172 unmodified lines
820828 pdata->an_result = pdata->an_state;
821829 pdata->an_state = XGBE_AN_READY;
822830
831+ if (pdata->phy_if.phy_impl.an_post)
832+ pdata->phy_if.phy_impl.an_post(pdata);
833+
823834 netif_dbg(pdata, link, pdata->netdev, "CL37 AN result: %s\n",
824835 xgbe_state_as_string(pdata->an_result));
825836 }
@@ -903,6 +914,9 @@ again: · 77 unmodified lines
903914 pdata->kx_state = XGBE_RX_BPA;
904915 pdata->an_start = 0;
905916
917+ if (pdata->phy_if.phy_impl.an_post)
918+ pdata->phy_if.phy_impl.an_post(pdata);
919+
906920 netif_dbg(pdata, link, pdata->netdev, "CL73 AN result: %s\n",
907921 xgbe_state_as_string(pdata->an_result));
908922 }
drivers/net/ethernet/amd/xgbe/xgbe-pci.c+2−0
@@ -456,6 +456,7 @@ static const struct xgbe_version_data xgbe_v2a = { · 455 unmodified lines
456456 .irq_reissue_support = 1,
457457 .tx_desc_prefetch = 5,
458458 .rx_desc_prefetch = 5,
459+ .an_cdr_workaround = 1,
459460 };
460461
461462 static const struct xgbe_version_data xgbe_v2b = {
@@ -470,6 +471,7 @@ static const struct xgbe_version_data xgbe_v2b = { · 8 unmodified lines
470471 .irq_reissue_support = 1,
471472 .tx_desc_prefetch = 5,
472473 .rx_desc_prefetch = 5,
474+ .an_cdr_workaround = 1,
473475 };
474476
475477 static const struct pci_device_id xgbe_pci_table[] = {
drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c+178−18
@@ -147,6 +147,14 @@ · 146 unmodified lines
147147 /* Rate-change complete wait/retry count */
148148 #define XGBE_RATECHANGE_COUNT 500
149149
150+/* CDR delay values for KR support (in usec) */
151+#define XGBE_CDR_DELAY_INIT 10000
152+#define XGBE_CDR_DELAY_INC 10000
153+#define XGBE_CDR_DELAY_MAX 100000
154+
155+/* RRC frequency during link status check */
156+#define XGBE_RRC_FREQUENCY 10
157+
150158 enum xgbe_port_mode {
151159 XGBE_PORT_MODE_RSVD = 0,
152160 XGBE_PORT_MODE_BACKPLANE,
@@ -245,6 +253,10 @@ enum xgbe_sfp_speed { · 92 unmodified lines
245253 #define XGBE_SFP_BASE_VENDOR_SN 4
246254 #define XGBE_SFP_BASE_VENDOR_SN_LEN 16
247255
256+#define XGBE_SFP_EXTD_OPT1 1
257+#define XGBE_SFP_EXTD_OPT1_RX_LOS BIT(1)
258+#define XGBE_SFP_EXTD_OPT1_TX_FAULT BIT(3)
259+
248260 #define XGBE_SFP_EXTD_DIAG 28
249261 #define XGBE_SFP_EXTD_DIAG_ADDR_CHANGE BIT(2)
250262
@@ -324,6 +336,7 @@ struct xgbe_phy_data { · 73 unmodified lines
324336
325337 unsigned int sfp_gpio_address;
326338 unsigned int sfp_gpio_mask;
339+ unsigned int sfp_gpio_inputs;
327340 unsigned int sfp_gpio_rx_los;
328341 unsigned int sfp_gpio_tx_fault;
329342 unsigned int sfp_gpio_mod_absent;
@@ -355,6 +368,10 @@ struct xgbe_phy_data { · 25 unmodified lines
355368 unsigned int redrv_addr;
356369 unsigned int redrv_lane;
357370 unsigned int redrv_model;
371+
372+ /* KR AN support */
373+ unsigned int phy_cdr_notrack;
374+ unsigned int phy_cdr_delay;
358375 };
359376
360377 /* I2C, MDIO and GPIO lines are muxed, so only one device at a time */
@@ -974,6 +991,49 @@ static void xgbe_phy_sfp_external_phy(struct xgbe_prv_data *pdata) · 613 unmodified lines
974991 phy_data->sfp_phy_avail = 1;
975992 }
976993
994+static bool xgbe_phy_check_sfp_rx_los(struct xgbe_phy_data *phy_data)
995+{
996+ u8 *sfp_extd = phy_data->sfp_eeprom.extd;
997+
998+ if (!(sfp_extd[XGBE_SFP_EXTD_OPT1] & XGBE_SFP_EXTD_OPT1_RX_LOS))
999+ return false;
1000+
1001+ if (phy_data->sfp_gpio_mask & XGBE_GPIO_NO_RX_LOS)
1002+ return false;
1003+
1004+ if (phy_data->sfp_gpio_inputs & (1 << phy_data->sfp_gpio_rx_los))
1005+ return true;
1006+
1007+ return false;
1008+}
1009+
1010+static bool xgbe_phy_check_sfp_tx_fault(struct xgbe_phy_data *phy_data)
1011+{
1012+ u8 *sfp_extd = phy_data->sfp_eeprom.extd;
1013+
1014+ if (!(sfp_extd[XGBE_SFP_EXTD_OPT1] & XGBE_SFP_EXTD_OPT1_TX_FAULT))
1015+ return false;
1016+
1017+ if (phy_data->sfp_gpio_mask & XGBE_GPIO_NO_TX_FAULT)
1018+ return false;
1019+
1020+ if (phy_data->sfp_gpio_inputs & (1 << phy_data->sfp_gpio_tx_fault))
1021+ return true;
1022+
1023+ return false;
1024+}
1025+
1026+static bool xgbe_phy_check_sfp_mod_absent(struct xgbe_phy_data *phy_data)
1027+{
1028+ if (phy_data->sfp_gpio_mask & XGBE_GPIO_NO_MOD_ABSENT)
1029+ return false;
1030+
1031+ if (phy_data->sfp_gpio_inputs & (1 << phy_data->sfp_gpio_mod_absent))
1032+ return true;
1033+
1034+ return false;
1035+}
1036+
9771037 static bool xgbe_phy_belfuse_parse_quirks(struct xgbe_prv_data *pdata)
9781038 {
9791039 struct xgbe_phy_data *phy_data = pdata->phy_data;
@@ -1019,6 +1079,10 @@ static void xgbe_phy_sfp_parse_eeprom(struct xgbe_prv_data *pdata) · 39 unmodified lines
10191079 if (sfp_base[XGBE_SFP_BASE_EXT_ID] != XGBE_SFP_EXT_ID_SFP)
10201080 return;
10211081
1082+ /* Update transceiver signals (eeprom extd/options) */
1083+ phy_data->sfp_tx_fault = xgbe_phy_check_sfp_tx_fault(phy_data);
1084+ phy_data->sfp_rx_los = xgbe_phy_check_sfp_rx_los(phy_data);
1085+
10221086 if (xgbe_phy_sfp_parse_quirks(pdata))
10231087 return;
10241088
@@ -1184,7 +1248,6 @@ put: · 159 unmodified lines
11841248 static void xgbe_phy_sfp_signals(struct xgbe_prv_data *pdata)
11851249 {
11861250 struct xgbe_phy_data *phy_data = pdata->phy_data;
1187− unsigned int gpio_input;
11881251 u8 gpio_reg, gpio_ports[2];
11891252 int ret;
11901253
@@ -1199,23 +1262,9 @@ static void xgbe_phy_sfp_signals(struct xgbe_prv_data *pdata) · 8 unmodified lines
11991262 return;
12001263 }
12011264
1202− gpio_input = (gpio_ports[1] << 8) | gpio_ports[0];
1203−
1204− if (phy_data->sfp_gpio_mask & XGBE_GPIO_NO_MOD_ABSENT) {
1205− /* No GPIO, just assume the module is present for now */
1206− phy_data->sfp_mod_absent = 0;
1207− } else {
1208− if (!(gpio_input & (1 << phy_data->sfp_gpio_mod_absent)))
1209− phy_data->sfp_mod_absent = 0;
1210− }
1211−
1212− if (!(phy_data->sfp_gpio_mask & XGBE_GPIO_NO_RX_LOS) &&
1213− (gpio_input & (1 << phy_data->sfp_gpio_rx_los)))
1214− phy_data->sfp_rx_los = 1;
1265+ phy_data->sfp_gpio_inputs = (gpio_ports[1] << 8) | gpio_ports[0];
12151266
1216− if (!(phy_data->sfp_gpio_mask & XGBE_GPIO_NO_TX_FAULT) &&
1217− (gpio_input & (1 << phy_data->sfp_gpio_tx_fault)))
1218− phy_data->sfp_tx_fault = 1;
1267+ phy_data->sfp_mod_absent = xgbe_phy_check_sfp_mod_absent(phy_data);
12191268 }
12201269
12211270 static void xgbe_phy_sfp_mod_absent(struct xgbe_prv_data *pdata)
@@ -2361,7 +2410,7 @@ static int xgbe_phy_link_status(struct xgbe_prv_data *pdata, int *an_restart) · 1139 unmodified lines
23612410 return 1;
23622411
23632412 /* No link, attempt a receiver reset cycle */
2364− if (phy_data->rrc_count++) {
2413+ if (phy_data->rrc_count++ > XGBE_RRC_FREQUENCY) {
23652414 phy_data->rrc_count = 0;
23662415 xgbe_phy_rrc(pdata);
23672416 }
@@ -2669,6 +2718,103 @@ static bool xgbe_phy_port_enabled(struct xgbe_prv_data *pdata) · 301 unmodified lines
26692718 return true;
26702719 }
26712720
2721+static void xgbe_phy_cdr_track(struct xgbe_prv_data *pdata)
2722+{
2723+ struct xgbe_phy_data *phy_data = pdata->phy_data;
2724+
2725+ if (!pdata->debugfs_an_cdr_workaround)
2726+ return;
2727+
2728+ if (!phy_data->phy_cdr_notrack)
2729+ return;
2730+
2731+ usleep_range(phy_data->phy_cdr_delay,
2732+ phy_data->phy_cdr_delay + 500);
2733+
2734+ XMDIO_WRITE_BITS(pdata, MDIO_MMD_PMAPMD, MDIO_VEND2_PMA_CDR_CONTROL,
2735+ XGBE_PMA_CDR_TRACK_EN_MASK,
2736+ XGBE_PMA_CDR_TRACK_EN_ON);
2737+
2738+ phy_data->phy_cdr_notrack = 0;
2739+}
2740+
2741+static void xgbe_phy_cdr_notrack(struct xgbe_prv_data *pdata)
2742+{
2743+ struct xgbe_phy_data *phy_data = pdata->phy_data;
2744+
2745+ if (!pdata->debugfs_an_cdr_workaround)
2746+ return;
2747+
2748+ if (phy_data->phy_cdr_notrack)
2749+ return;
2750+
2751+ XMDIO_WRITE_BITS(pdata, MDIO_MMD_PMAPMD, MDIO_VEND2_PMA_CDR_CONTROL,
2752+ XGBE_PMA_CDR_TRACK_EN_MASK,
2753+ XGBE_PMA_CDR_TRACK_EN_OFF);
2754+
2755+ xgbe_phy_rrc(pdata);
2756+
2757+ phy_data->phy_cdr_notrack = 1;
2758+}
2759+
2760+static void xgbe_phy_kr_training_post(struct xgbe_prv_data *pdata)
2761+{
2762+ if (!pdata->debugfs_an_cdr_track_early)
2763+ xgbe_phy_cdr_track(pdata);
2764+}
2765+
2766+static void xgbe_phy_kr_training_pre(struct xgbe_prv_data *pdata)
2767+{
2768+ if (pdata->debugfs_an_cdr_track_early)
2769+ xgbe_phy_cdr_track(pdata);
2770+}
2771+
2772+static void xgbe_phy_an_post(struct xgbe_prv_data *pdata)
2773+{
2774+ struct xgbe_phy_data *phy_data = pdata->phy_data;
2775+
2776+ switch (pdata->an_mode) {
2777+ case XGBE_AN_MODE_CL73:
2778+ case XGBE_AN_MODE_CL73_REDRV:
2779+ if (phy_data->cur_mode != XGBE_MODE_KR)
2780+ break;
2781+
2782+ xgbe_phy_cdr_track(pdata);
2783+
2784+ switch (pdata->an_result) {
2785+ case XGBE_AN_READY:
2786+ case XGBE_AN_COMPLETE:
2787+ break;
2788+ default:
2789+ if (phy_data->phy_cdr_delay < XGBE_CDR_DELAY_MAX)
2790+ phy_data->phy_cdr_delay += XGBE_CDR_DELAY_INC;
2791+ else
2792+ phy_data->phy_cdr_delay = XGBE_CDR_DELAY_INIT;
2793+ break;
2794+ }
2795+ break;
2796+ default:
2797+ break;
2798+ }
2799+}
2800+
2801+static void xgbe_phy_an_pre(struct xgbe_prv_data *pdata)
2802+{
2803+ struct xgbe_phy_data *phy_data = pdata->phy_data;
2804+
2805+ switch (pdata->an_mode) {
2806+ case XGBE_AN_MODE_CL73:
2807+ case XGBE_AN_MODE_CL73_REDRV:
2808+ if (phy_data->cur_mode != XGBE_MODE_KR)
2809+ break;
2810+
2811+ xgbe_phy_cdr_notrack(pdata);
2812+ break;
2813+ default:
2814+ break;
2815+ }
2816+}
2817+
26722818 static void xgbe_phy_stop(struct xgbe_prv_data *pdata)
26732819 {
26742820 struct xgbe_phy_data *phy_data = pdata->phy_data;
@@ -2680,6 +2826,9 @@ static void xgbe_phy_stop(struct xgbe_prv_data *pdata) · 5 unmodified lines
26802826 xgbe_phy_sfp_reset(phy_data);
26812827 xgbe_phy_sfp_mod_absent(pdata);
26822828
2829+ /* Reset CDR support */
2830+ xgbe_phy_cdr_track(pdata);
2831+
26832832 /* Power off the PHY */
26842833 xgbe_phy_power_off(pdata);
26852834
@@ -2712,6 +2861,9 @@ static int xgbe_phy_start(struct xgbe_prv_data *pdata) · 26 unmodified lines
27122861 /* Start in highest supported mode */
27132862 xgbe_phy_set_mode(pdata, phy_data->start_mode);
27142863
2864+ /* Reset CDR support */
2865+ xgbe_phy_cdr_track(pdata);
2866+
27152867 /* After starting the I2C controller, we can check for an SFP */
27162868 switch (phy_data->port_mode) {
27172869 case XGBE_PORT_MODE_SFP:
@@ -3019,6 +3171,8 @@ static int xgbe_phy_init(struct xgbe_prv_data *pdata) · 301 unmodified lines
30193171 }
30203172 }
30213173
3174+ phy_data->phy_cdr_delay = XGBE_CDR_DELAY_INIT;
3175+
30223176 /* Register for driving external PHYs */
30233177 mii = devm_mdiobus_alloc(pdata->dev);
30243178 if (!mii) {
@@ -3071,4 +3225,10 @@ void xgbe_init_function_ptrs_phy_v2(struct xgbe_phy_if *phy_if) · 46 unmodified lines
30713225 phy_impl->an_advertising = xgbe_phy_an_advertising;
30723226
30733227 phy_impl->an_outcome = xgbe_phy_an_outcome;
3228+
3229+ phy_impl->an_pre = xgbe_phy_an_pre;
3230+ phy_impl->an_post = xgbe_phy_an_post;
3231+
3232+ phy_impl->kr_training_pre = xgbe_phy_kr_training_pre;
3233+ phy_impl->kr_training_post = xgbe_phy_kr_training_post;
30743234 }
drivers/net/ethernet/amd/xgbe/xgbe.h+9−0
@@ -833,6 +833,7 @@ struct xgbe_hw_if { · 832 unmodified lines
833833 /* This structure represents implementation specific routines for an
834834 * implementation of a PHY. All routines are required unless noted below.
835835 * Optional routines:
836+ * an_pre, an_post
836837 * kr_training_pre, kr_training_post
837838 */
838839 struct xgbe_phy_impl_if {
@@ -875,6 +876,10 @@ struct xgbe_phy_impl_if { · 36 unmodified lines
875876 /* Process results of auto-negotiation */
876877 enum xgbe_mode (*an_outcome)(struct xgbe_prv_data *);
877878
879+ /* Pre/Post auto-negotiation support */
880+ void (*an_pre)(struct xgbe_prv_data *);
881+ void (*an_post)(struct xgbe_prv_data *);
882+
878883 /* Pre/Post KR training enablement support */
879884 void (*kr_training_pre)(struct xgbe_prv_data *);
880885 void (*kr_training_post)(struct xgbe_prv_data *);
@@ -989,6 +994,7 @@ struct xgbe_version_data { · 108 unmodified lines
989994 unsigned int irq_reissue_support;
990995 unsigned int tx_desc_prefetch;
991996 unsigned int rx_desc_prefetch;
997+ unsigned int an_cdr_workaround;
992998 };
993999
9941000 struct xgbe_vxlan_data {
@@ -1257,6 +1263,9 @@ struct xgbe_prv_data { · 262 unmodified lines
12571263 unsigned int debugfs_xprop_reg;
12581264
12591265 unsigned int debugfs_xi2c_reg;
1266+
1267+ bool debugfs_an_cdr_workaround;
1268+ bool debugfs_an_cdr_track_early;
12601269 };
12611270
12621271 /* Function prototypes*/
drivers/net/ethernet/broadcom/bcmsysport.c+13−5
@@ -2144,14 +2144,21 @@ static const struct net_device_ops bcm_sysport_netdev_ops = { · 2143 unmodified lines
21442144 .ndo_select_queue = bcm_sysport_select_queue,
21452145 };
21462146
2147−static int bcm_sysport_map_queues(struct net_device *dev,
2147+static int bcm_sysport_map_queues(struct notifier_block *nb,
21482148 struct dsa_notifier_register_info *info)
21492149 {
2150− struct bcm_sysport_priv *priv = netdev_priv(dev);
21512150 struct bcm_sysport_tx_ring *ring;
2151+ struct bcm_sysport_priv *priv;
21522152 struct net_device *slave_dev;
21532153 unsigned int num_tx_queues;
21542154 unsigned int q, start, port;
2155+ struct net_device *dev;
2156+
2157+ priv = container_of(nb, struct bcm_sysport_priv, dsa_notifier);
2158+ if (priv->netdev != info->master)
2159+ return 0;
2160+
2161+ dev = info->master;
21552162
21562163 /* We can't be setting up queue inspection for non directly attached
21572164 * switches
@@ -2174,11 +2181,12 @@ static int bcm_sysport_map_queues(struct net_device *dev, · 16 unmodified lines
21742181 if (priv->is_lite)
21752182 netif_set_real_num_tx_queues(slave_dev,
21762183 slave_dev->num_tx_queues / 2);
2184+
21772185 num_tx_queues = slave_dev->real_num_tx_queues;
21782186
21792187 if (priv->per_port_num_tx_queues &&
21802188 priv->per_port_num_tx_queues != num_tx_queues)
2181− netdev_warn(slave_dev, "asymetric number of per-port queues\n");
2189+ netdev_warn(slave_dev, "asymmetric number of per-port queues\n");
21822190
21832191 priv->per_port_num_tx_queues = num_tx_queues;
21842192
@@ -2201,7 +2209,7 @@ static int bcm_sysport_map_queues(struct net_device *dev, · 16 unmodified lines
22012209 return 0;
22022210 }
22032211
2204−static int bcm_sysport_dsa_notifier(struct notifier_block *unused,
2212+static int bcm_sysport_dsa_notifier(struct notifier_block *nb,
22052213 unsigned long event, void *ptr)
22062214 {
22072215 struct dsa_notifier_register_info *info;
@@ -2211,7 +2219,7 @@ static int bcm_sysport_dsa_notifier(struct notifier_block *unused, · 3 unmodified lines
22112219
22122220 info = ptr;
22132221
2214− return notifier_from_errno(bcm_sysport_map_queues(info->master, info));
2222+ return notifier_from_errno(bcm_sysport_map_queues(nb, info));
22152223 }
22162224
22172225 #define REV_FMT "v%2x.%02x"
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c+27−22
@@ -1927,22 +1927,39 @@ static char *bnxt_parse_pkglog(int desired_field, u8 *data, size_t datalen) · 1926 unmodified lines
19271927 return retval;
19281928 }
19291929
1930−static char *bnxt_get_pkgver(struct net_device *dev, char *buf, size_t buflen)
1930+static void bnxt_get_pkgver(struct net_device *dev)
19311931 {
1932+ struct bnxt *bp = netdev_priv(dev);
19321933 u16 index = 0;
1933− u32 datalen;
1934+ char *pkgver;
1935+ u32 pkglen;
1936+ u8 *pkgbuf;
1937+ int len;
19341938
19351939 if (bnxt_find_nvram_item(dev, BNX_DIR_TYPE_PKG_LOG,
19361940 BNX_DIR_ORDINAL_FIRST, BNX_DIR_EXT_NONE,
1937− &index, NULL, &datalen) != 0)
1938− return NULL;
1941+ &index, NULL, &pkglen) != 0)
1942+ return;
19391943
1940− memset(buf, 0, buflen);
1941− if (bnxt_get_nvram_item(dev, index, 0, datalen, buf) != 0)
1942− return NULL;
1944+ pkgbuf = kzalloc(pkglen, GFP_KERNEL);
1945+ if (!pkgbuf) {
1946+ dev_err(&bp->pdev->dev, "Unable to allocate memory for pkg version, length = %u\n",
1947+ pkglen);
1948+ return;
1949+ }
1950+
1951+ if (bnxt_get_nvram_item(dev, index, 0, pkglen, pkgbuf))
1952+ goto err;
19431953
1944− return bnxt_parse_pkglog(BNX_PKG_LOG_FIELD_IDX_PKG_VERSION, buf,
1945− datalen);
1954+ pkgver = bnxt_parse_pkglog(BNX_PKG_LOG_FIELD_IDX_PKG_VERSION, pkgbuf,
1955+ pkglen);
1956+ if (pkgver && *pkgver != 0 && isdigit(*pkgver)) {
1957+ len = strlen(bp->fw_ver_str);
1958+ snprintf(bp->fw_ver_str + len, FW_VER_STR_LEN - len - 1,
1959+ "/pkg %s", pkgver);
1960+ }
1961+err:
1962+ kfree(pkgbuf);
19461963 }
19471964
19481965 static int bnxt_get_eeprom(struct net_device *dev,
@@ -2615,22 +2632,10 @@ void bnxt_ethtool_init(struct bnxt *bp) · 666 unmodified lines
26152632 struct hwrm_selftest_qlist_input req = {0};
26162633 struct bnxt_test_info *test_info;
26172634 struct net_device *dev = bp->dev;
2618− char *pkglog;
26192635 int i, rc;
26202636
2621− pkglog = kzalloc(BNX_PKG_LOG_MAX_LENGTH, GFP_KERNEL);
2622− if (pkglog) {
2623− char *pkgver;
2624− int len;
2637+ bnxt_get_pkgver(dev);
26252638
2626− pkgver = bnxt_get_pkgver(dev, pkglog, BNX_PKG_LOG_MAX_LENGTH);
2627− if (pkgver && *pkgver != 0 && isdigit(*pkgver)) {
2628− len = strlen(bp->fw_ver_str);
2629− snprintf(bp->fw_ver_str + len, FW_VER_STR_LEN - len - 1,
2630− "/pkg %s", pkgver);
2631− }
2632− kfree(pkglog);
2633− }
26342639 if (bp->hwrm_spec_code < 0x10704 || !BNXT_SINGLE_PF(bp))
26352640 return;
26362641
drivers/net/ethernet/broadcom/bnxt/bnxt_nvm_defs.h+0−2
@@ -59,8 +59,6 @@ enum bnxt_nvm_directory_type { · 58 unmodified lines
5959 #define BNX_DIR_ATTR_NO_CHKSUM (1 << 0)
6060 #define BNX_DIR_ATTR_PROP_STREAM (1 << 1)
6161
62−#define BNX_PKG_LOG_MAX_LENGTH 4096
63−
6462 enum bnxnvm_pkglog_field_index {
6563 BNX_PKG_LOG_FIELD_IDX_INSTALLED_TIMESTAMP = 0,
6664 BNX_PKG_LOG_FIELD_IDX_PKG_DESCRIPTION = 1,
drivers/net/ethernet/freescale/ucc_geth_ethtool.c+1−1
@@ -61,7 +61,7 @@ static const char hw_stat_gstrings[][ETH_GSTRING_LEN] = { · 60 unmodified lines
6161 static const char tx_fw_stat_gstrings[][ETH_GSTRING_LEN] = {
6262 "tx-single-collision",
6363 "tx-multiple-collision",
64− "tx-late-collsion",
64+ "tx-late-collision",
6565 "tx-aborted-frames",
6666 "tx-lost-frames",
6767 "tx-carrier-sense-errors",
drivers/net/ethernet/hisilicon/hns/hnae.h+1−1
@@ -87,7 +87,7 @@ do { \ · 86 unmodified lines
8787
8888 #define HNAE_AE_REGISTER 0x1
8989
90−#define RCB_RING_NAME_LEN 16
90+#define RCB_RING_NAME_LEN (IFNAMSIZ + 4)
9191
9292 #define HNAE_LOWEST_LATENCY_COAL_PARAM 30
9393 #define HNAE_LOW_LATENCY_COAL_PARAM 80
drivers/net/ethernet/ibm/ibmvnic.c+56−33
@@ -794,46 +794,61 @@ static int ibmvnic_login(struct net_device *netdev) · 793 unmodified lines
794794 {
795795 struct ibmvnic_adapter *adapter = netdev_priv(netdev);
796796 unsigned long timeout = msecs_to_jiffies(30000);
797− struct device *dev = &adapter->vdev->dev;
797+ int retry_count = 0;
798798 int rc;
799799
800800 do {
801− if (adapter->renegotiate) {
802− adapter->renegotiate = false;
801+ if (retry_count > IBMVNIC_MAX_QUEUES) {
802+ netdev_warn(netdev, "Login attempts exceeded\n");
803+ return -1;
804+ }
805+
806+ adapter->init_done_rc = 0;
807+ reinit_completion(&adapter->init_done);
808+ rc = send_login(adapter);
809+ if (rc) {
810+ netdev_warn(netdev, "Unable to login\n");
811+ return rc;
812+ }
813+
814+ if (!wait_for_completion_timeout(&adapter->init_done,
815+ timeout)) {
816+ netdev_warn(netdev, "Login timed out\n");
817+ return -1;
818+ }
819+
820+ if (adapter->init_done_rc == PARTIALSUCCESS) {
821+ retry_count++;
803822 release_sub_crqs(adapter, 1);
804823
824+ adapter->init_done_rc = 0;
805825 reinit_completion(&adapter->init_done);
806826 send_cap_queries(adapter);
807827 if (!wait_for_completion_timeout(&adapter->init_done,
808828 timeout)) {
809− dev_err(dev, "Capabilities query timeout\n");
829+ netdev_warn(netdev,
830+ "Capabilities query timed out\n");
810831 return -1;
811832 }
833+
812834 rc = init_sub_crqs(adapter);
813835 if (rc) {
814− dev_err(dev,
815− "Initialization of SCRQ's failed\n");
836+ netdev_warn(netdev,
837+ "SCRQ initialization failed\n");
816838 return -1;
817839 }
840+
818841 rc = init_sub_crq_irqs(adapter);
819842 if (rc) {
820− dev_err(dev,
821− "Initialization of SCRQ's irqs failed\n");
843+ netdev_warn(netdev,
844+ "SCRQ irq initialization failed\n");
822845 return -1;
823846 }
824− }
825−
826− reinit_completion(&adapter->init_done);
827− rc = send_login(adapter);
828− if (rc) {
829− dev_err(dev, "Unable to attempt device login\n");
830− return rc;
831− } else if (!wait_for_completion_timeout(&adapter->init_done,
832− timeout)) {
833− dev_err(dev, "Login timeout\n");
847+ } else if (adapter->init_done_rc) {
848+ netdev_warn(netdev, "Adapter login failed\n");
834849 return -1;
835850 }
836− } while (adapter->renegotiate);
851+ } while (adapter->init_done_rc == PARTIALSUCCESS);
837852
838853 /* handle pending MAC address changes after successful login */
839854 if (adapter->mac_change_pending) {
@@ -1034,16 +1049,14 @@ static int __ibmvnic_open(struct net_device *netdev) · 194 unmodified lines
10341049 netdev_dbg(netdev, "Enabling rx_scrq[%d] irq\n", i);
10351050 if (prev_state == VNIC_CLOSED)
10361051 enable_irq(adapter->rx_scrq[i]->irq);
1037− else
1038− enable_scrq_irq(adapter, adapter->rx_scrq[i]);
1052+ enable_scrq_irq(adapter, adapter->rx_scrq[i]);
10391053 }
10401054
10411055 for (i = 0; i < adapter->req_tx_queues; i++) {
10421056 netdev_dbg(netdev, "Enabling tx_scrq[%d] irq\n", i);
10431057 if (prev_state == VNIC_CLOSED)
10441058 enable_irq(adapter->tx_scrq[i]->irq);
1045− else
1046− enable_scrq_irq(adapter, adapter->tx_scrq[i]);
1059+ enable_scrq_irq(adapter, adapter->tx_scrq[i]);
10471060 }
10481061
10491062 rc = set_link_state(adapter, IBMVNIC_LOGICAL_LNK_UP);
@@ -1115,7 +1128,7 @@ static void clean_rx_pools(struct ibmvnic_adapter *adapter) · 65 unmodified lines
11151128 if (!adapter->rx_pool)
11161129 return;
11171130
1118− rx_scrqs = be32_to_cpu(adapter->login_rsp_buf->num_rxadd_subcrqs);
1131+ rx_scrqs = adapter->num_active_rx_pools;
11191132 rx_entries = adapter->req_rx_add_entries_per_subcrq;
11201133
11211134 /* Free any remaining skbs in the rx buffer pools */
@@ -1164,7 +1177,7 @@ static void clean_tx_pools(struct ibmvnic_adapter *adapter) · 42 unmodified lines
11641177 if (!adapter->tx_pool || !adapter->tso_pool)
11651178 return;
11661179
1167− tx_scrqs = be32_to_cpu(adapter->login_rsp_buf->num_txsubm_subcrqs);
1180+ tx_scrqs = adapter->num_active_tx_pools;
11681181
11691182 /* Free any remaining skbs in the tx buffer pools */
11701183 for (i = 0; i < tx_scrqs; i++) {
@@ -1184,6 +1197,7 @@ static void ibmvnic_disable_irqs(struct ibmvnic_adapter *adapter) · 13 unmodified lines
11841197 if (adapter->tx_scrq[i]->irq) {
11851198 netdev_dbg(netdev,
11861199 "Disabling tx_scrq[%d] irq\n", i);
1200+ disable_scrq_irq(adapter, adapter->tx_scrq[i]);
11871201 disable_irq(adapter->tx_scrq[i]->irq);
11881202 }
11891203 }
@@ -1193,6 +1207,7 @@ static void ibmvnic_disable_irqs(struct ibmvnic_adapter *adapter) · 3 unmodified lines
11931207 if (adapter->rx_scrq[i]->irq) {
11941208 netdev_dbg(netdev,
11951209 "Disabling rx_scrq[%d] irq\n", i);
1210+ disable_scrq_irq(adapter, adapter->rx_scrq[i]);
11961211 disable_irq(adapter->rx_scrq[i]->irq);
11971212 }
11981213 }
@@ -1828,7 +1843,8 @@ static int do_reset(struct ibmvnic_adapter *adapter, · 629 unmodified lines
18281843 for (i = 0; i < adapter->req_rx_queues; i++)
18291844 napi_schedule(&adapter->napi[i]);
18301845
1831− if (adapter->reset_reason != VNIC_RESET_FAILOVER)
1846+ if (adapter->reset_reason != VNIC_RESET_FAILOVER &&
1847+ adapter->reset_reason != VNIC_RESET_CHANGE_PARAM)
18321848 netdev_notify_peers(netdev);
18331849
18341850 netif_carrier_on(netdev);
@@ -2601,12 +2617,19 @@ static int enable_scrq_irq(struct ibmvnic_adapter *adapter, · 766 unmodified lines
26012617 {
26022618 struct device *dev = &adapter->vdev->dev;
26032619 unsigned long rc;
2620+ u64 val;
26042621
26052622 if (scrq->hw_irq > 0x100000000ULL) {
26062623 dev_err(dev, "bad hw_irq = %lx\n", scrq->hw_irq);
26072624 return 1;
26082625 }
26092626
2627+ val = (0xff000000) | scrq->hw_irq;
2628+ rc = plpar_hcall_norets(H_EOI, val);
2629+ if (rc)
2630+ dev_err(dev, "H_EOI FAILED irq 0x%llx. rc=%ld\n",
2631+ val, rc);
2632+
26102633 rc = plpar_hcall_norets(H_VIOCTL, adapter->vdev->unit_address,
26112634 H_ENABLE_VIO_INTERRUPT, scrq->hw_irq, 0, 0);
26122635 if (rc)
@@ -3170,7 +3193,7 @@ static int send_version_xchg(struct ibmvnic_adapter *adapter) · 557 unmodified lines
31703193 struct vnic_login_client_data {
31713194 u8 type;
31723195 __be16 len;
3173− char name;
3196+ char name[];
31743197 } __packed;
31753198
31763199 static int vnic_client_data_len(struct ibmvnic_adapter *adapter)
@@ -3199,21 +3222,21 @@ static void vnic_add_client_data(struct ibmvnic_adapter *adapter, · 22 unmodified lines
31993222 vlcd->type = 1;
32003223 len = strlen(os_name) + 1;
32013224 vlcd->len = cpu_to_be16(len);
3202− strncpy(&vlcd->name, os_name, len);
3203− vlcd = (struct vnic_login_client_data *)((char *)&vlcd->name + len);
3225+ strncpy(vlcd->name, os_name, len);
3226+ vlcd = (struct vnic_login_client_data *)(vlcd->name + len);
32043227
32053228 /* Type 2 - LPAR name */
32063229 vlcd->type = 2;
32073230 len = strlen(utsname()->nodename) + 1;
32083231 vlcd->len = cpu_to_be16(len);
3209− strncpy(&vlcd->name, utsname()->nodename, len);
3210− vlcd = (struct vnic_login_client_data *)((char *)&vlcd->name + len);
3232+ strncpy(vlcd->name, utsname()->nodename, len);
3233+ vlcd = (struct vnic_login_client_data *)(vlcd->name + len);
32113234
32123235 /* Type 3 - device name */
32133236 vlcd->type = 3;
32143237 len = strlen(adapter->netdev->name) + 1;
32153238 vlcd->len = cpu_to_be16(len);
3216− strncpy(&vlcd->name, adapter->netdev->name, len);
3239+ strncpy(vlcd->name, adapter->netdev->name, len);
32173240 }
32183241
32193242 static int send_login(struct ibmvnic_adapter *adapter)
@@ -3942,7 +3965,7 @@ static int handle_login_rsp(union ibmvnic_crq *login_rsp_crq, · 722 unmodified lines
39423965 * to resend the login buffer with fewer queues requested.
39433966 */
39443967 if (login_rsp_crq->generic.rc.code) {
3945− adapter->renegotiate = true;
3968+ adapter->init_done_rc = login_rsp_crq->generic.rc.code;
39463969 complete(&adapter->init_done);
39473970 return 0;
39483971 }
drivers/net/ethernet/ibm/ibmvnic.h+0−1
@@ -1035,7 +1035,6 @@ struct ibmvnic_adapter { · 1034 unmodified lines
10351035
10361036 struct ibmvnic_sub_crq_queue **tx_scrq;
10371037 struct ibmvnic_sub_crq_queue **rx_scrq;
1038− bool renegotiate;
10391038
10401039 /* rx structs */
10411040 struct napi_struct *napi;
drivers/net/ethernet/intel/ice/ice_adminq_cmd.h+1−1
@@ -586,7 +586,7 @@ struct ice_sw_rule_lg_act { · 585 unmodified lines
586586 #define ICE_LG_ACT_MIRROR_VSI_ID_S 3
587587 #define ICE_LG_ACT_MIRROR_VSI_ID_M (0x3FF << ICE_LG_ACT_MIRROR_VSI_ID_S)
588588
589− /* Action type = 5 - Large Action */
589+ /* Action type = 5 - Generic Value */
590590 #define ICE_LG_ACT_GENERIC 0x5
591591 #define ICE_LG_ACT_GENERIC_VALUE_S 3
592592 #define ICE_LG_ACT_GENERIC_VALUE_M (0xFFFF << ICE_LG_ACT_GENERIC_VALUE_S)
drivers/net/ethernet/intel/ice/ice_common.c+17−5
@@ -78,6 +78,7 @@ ice_aq_manage_mac_read(struct ice_hw *hw, void *buf, u16 buf_size, · 77 unmodified lines
7878 struct ice_aq_desc desc;
7979 enum ice_status status;
8080 u16 flags;
81+ u8 i;
8182
8283 cmd = &desc.params.mac_read;
8384
@@ -98,8 +99,16 @@ ice_aq_manage_mac_read(struct ice_hw *hw, void *buf, u16 buf_size, · 14 unmodified lines
9899 return ICE_ERR_CFG;
99100 }
100101
101− ether_addr_copy(hw->port_info->mac.lan_addr, resp->mac_addr);
102− ether_addr_copy(hw->port_info->mac.perm_addr, resp->mac_addr);
102+ /* A single port can report up to two (LAN and WoL) addresses */
103+ for (i = 0; i < cmd->num_addr; i++)
104+ if (resp[i].addr_type == ICE_AQC_MAN_MAC_ADDR_TYPE_LAN) {
105+ ether_addr_copy(hw->port_info->mac.lan_addr,
106+ resp[i].mac_addr);
107+ ether_addr_copy(hw->port_info->mac.perm_addr,
108+ resp[i].mac_addr);
109+ break;
110+ }
111+
103112 return 0;
104113 }
105114
@@ -464,9 +473,12 @@ enum ice_status ice_init_hw(struct ice_hw *hw) · 358 unmodified lines
464473 if (status)
465474 goto err_unroll_sched;
466475
467− /* Get port MAC information */
468− mac_buf_len = sizeof(struct ice_aqc_manage_mac_read_resp);
469− mac_buf = devm_kzalloc(ice_hw_to_dev(hw), mac_buf_len, GFP_KERNEL);
476+ /* Get MAC information */
477+ /* A single port can report up to two (LAN and WoL) addresses */
478+ mac_buf = devm_kcalloc(ice_hw_to_dev(hw), 2,
479+ sizeof(struct ice_aqc_manage_mac_read_resp),
480+ GFP_KERNEL);
481+ mac_buf_len = 2 * sizeof(struct ice_aqc_manage_mac_read_resp);
470482
471483 if (!mac_buf) {
472484 status = ICE_ERR_NO_MEMORY;
drivers/net/ethernet/intel/ice/ice_hw_autogen.h+0−2
@@ -121,8 +121,6 @@ · 120 unmodified lines
121121 #define PFINT_FW_CTL_CAUSE_ENA_S 30
122122 #define PFINT_FW_CTL_CAUSE_ENA_M BIT(PFINT_FW_CTL_CAUSE_ENA_S)
123123 #define PFINT_OICR 0x0016CA00
124−#define PFINT_OICR_INTEVENT_S 0
125−#define PFINT_OICR_INTEVENT_M BIT(PFINT_OICR_INTEVENT_S)
126124 #define PFINT_OICR_HLP_RDY_S 14
127125 #define PFINT_OICR_HLP_RDY_M BIT(PFINT_OICR_HLP_RDY_S)
128126 #define PFINT_OICR_CPM_RDY_S 15
drivers/net/ethernet/intel/ice/ice_main.c+0−4
@@ -1722,9 +1722,6 @@ static irqreturn_t ice_misc_intr(int __always_unused irq, void *data) · 1721 unmodified lines
17221722 oicr = rd32(hw, PFINT_OICR);
17231723 ena_mask = rd32(hw, PFINT_OICR_ENA);
17241724
1725− if (!(oicr & PFINT_OICR_INTEVENT_M))
1726− goto ena_intr;
1727−
17281725 if (oicr & PFINT_OICR_GRST_M) {
17291726 u32 reset;
17301727 /* we have a reset warning */
@@ -1782,7 +1779,6 @@ static irqreturn_t ice_misc_intr(int __always_unused irq, void *data) · 51 unmodified lines
17821779 }
17831780 ret = IRQ_HANDLED;
17841781
1785−ena_intr:
17861782 /* re-enable interrupt causes that are not handled during this pass */
17871783 wr32(hw, PFINT_OICR_ENA, ena_mask);
17881784 if (!test_bit(__ICE_DOWN, pf->state)) {
drivers/net/ethernet/intel/ice/ice_sched.c+2−2
@@ -751,14 +751,14 @@ ice_sched_add_nodes_to_layer(struct ice_port_info *pi, · 750 unmodified lines
751751 u16 num_added = 0;
752752 u32 temp;
753753
754+ *num_nodes_added = 0;
755+
754756 if (!num_nodes)
755757 return status;
756758
757759 if (!parent || layer < hw->sw_entry_point_layer)
758760 return ICE_ERR_PARAM;
759761
760− *num_nodes_added = 0;
761−
762762 /* max children per node per layer */
763763 max_child_nodes =
764764 le16_to_cpu(hw->layer_info[parent->tx_sched_layer].max_children);
drivers/net/ethernet/intel/igb/igb_main.c+16−1
@@ -1700,7 +1700,22 @@ static void igb_configure_cbs(struct igb_adapter *adapter, int queue, · 1699 unmodified lines
17001700 WARN_ON(hw->mac.type != e1000_i210);
17011701 WARN_ON(queue < 0 || queue > 1);
17021702
1703− if (enable) {
1703+ if (enable || queue == 0) {
1704+ /* i210 does not allow the queue 0 to be in the Strict
1705+ * Priority mode while the Qav mode is enabled, so,
1706+ * instead of disabling strict priority mode, we give
1707+ * queue 0 the maximum of credits possible.
1708+ *
1709+ * See section 8.12.19 of the i210 datasheet, "Note:
1710+ * Queue0 QueueMode must be set to 1b when
1711+ * TransmitMode is set to Qav."
1712+ */
1713+ if (queue == 0 && !enable) {
1714+ /* max "linkspeed" idleslope in kbps */
1715+ idleslope = 1000000;
1716+ hicredit = ETH_FRAME_LEN;
1717+ }
1718+
17041719 set_tx_desc_fetch_prio(hw, queue, TX_QUEUE_PRIO_HIGH);
17051720 set_queue_mode(hw, queue, QUEUE_MODE_STREAM_RESERVATION);
17061721
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c+1−1
@@ -3420,7 +3420,7 @@ static int ixgbevf_setup_all_tx_resources(struct ixgbevf_adapter *adapter) · 3419 unmodified lines
34203420 if (!err)
34213421 continue;
34223422 hw_dbg(&adapter->hw, "Allocation for XDP Queue %u failed\n", j);
3423− break;
3423+ goto err_setup_tx;
34243424 }
34253425
34263426 return 0;
drivers/net/ethernet/marvell/mvpp2.c+31−13
@@ -663,7 +663,7 @@ enum mvpp2_tag_type { · 662 unmodified lines
663663 #define MVPP2_PE_VID_FILT_RANGE_END (MVPP2_PRS_TCAM_SRAM_SIZE - 31)
664664 #define MVPP2_PE_VID_FILT_RANGE_START (MVPP2_PE_VID_FILT_RANGE_END - \
665665 MVPP2_PRS_VLAN_FILT_RANGE_SIZE + 1)
666−#define MVPP2_PE_LAST_FREE_TID (MVPP2_PE_VID_FILT_RANGE_START - 1)
666+#define MVPP2_PE_LAST_FREE_TID (MVPP2_PE_MAC_RANGE_START - 1)
667667 #define MVPP2_PE_IP6_EXT_PROTO_UN (MVPP2_PRS_TCAM_SRAM_SIZE - 30)
668668 #define MVPP2_PE_IP6_ADDR_UN (MVPP2_PRS_TCAM_SRAM_SIZE - 29)
669669 #define MVPP2_PE_IP4_ADDR_UN (MVPP2_PRS_TCAM_SRAM_SIZE - 28)
@@ -916,6 +916,8 @@ static struct { · 246 unmodified lines
916916
917917 #define MVPP2_MIB_COUNTERS_STATS_DELAY (1 * HZ)
918918
919+#define MVPP2_DESC_DMA_MASK DMA_BIT_MASK(40)
920+
919921 /* Definitions */
920922
921923 /* Shared Packet Processor resources */
@@ -940,6 +942,7 @@ struct mvpp2 { · 18 unmodified lines
940942 struct clk *pp_clk;
941943 struct clk *gop_clk;
942944 struct clk *mg_clk;
945+ struct clk *mg_core_clk;
943946 struct clk *axi_clk;
944947
945948 /* List of pointers to port structures */
@@ -1429,7 +1432,7 @@ static dma_addr_t mvpp2_txdesc_dma_addr_get(struct mvpp2_port *port, · 483 unmodified lines
14291432 if (port->priv->hw_version == MVPP21)
14301433 return tx_desc->pp21.buf_dma_addr;
14311434 else
1432− return tx_desc->pp22.buf_dma_addr_ptp & GENMASK_ULL(40, 0);
1435+ return tx_desc->pp22.buf_dma_addr_ptp & MVPP2_DESC_DMA_MASK;
14331436 }
14341437
14351438 static void mvpp2_txdesc_dma_addr_set(struct mvpp2_port *port,
@@ -1447,7 +1450,7 @@ static void mvpp2_txdesc_dma_addr_set(struct mvpp2_port *port, · 11 unmodified lines
14471450 } else {
14481451 u64 val = (u64)addr;
14491452
1450− tx_desc->pp22.buf_dma_addr_ptp &= ~GENMASK_ULL(40, 0);
1453+ tx_desc->pp22.buf_dma_addr_ptp &= ~MVPP2_DESC_DMA_MASK;
14511454 tx_desc->pp22.buf_dma_addr_ptp |= val;
14521455 tx_desc->pp22.packet_offset = offset;
14531456 }
@@ -1507,7 +1510,7 @@ static dma_addr_t mvpp2_rxdesc_dma_addr_get(struct mvpp2_port *port, · 53 unmodified lines
15071510 if (port->priv->hw_version == MVPP21)
15081511 return rx_desc->pp21.buf_dma_addr;
15091512 else
1510− return rx_desc->pp22.buf_dma_addr_key_hash & GENMASK_ULL(40, 0);
1513+ return rx_desc->pp22.buf_dma_addr_key_hash & MVPP2_DESC_DMA_MASK;
15111514 }
15121515
15131516 static unsigned long mvpp2_rxdesc_cookie_get(struct mvpp2_port *port,
@@ -1516,7 +1519,7 @@ static unsigned long mvpp2_rxdesc_cookie_get(struct mvpp2_port *port, · 2 unmodified lines
15161519 if (port->priv->hw_version == MVPP21)
15171520 return rx_desc->pp21.buf_cookie;
15181521 else
1519− return rx_desc->pp22.buf_cookie_misc & GENMASK_ULL(40, 0);
1522+ return rx_desc->pp22.buf_cookie_misc & MVPP2_DESC_DMA_MASK;
15201523 }
15211524
15221525 static size_t mvpp2_rxdesc_size_get(struct mvpp2_port *port,
@@ -8766,18 +8769,27 @@ static int mvpp2_probe(struct platform_device *pdev) · 7243 unmodified lines
87668769 err = clk_prepare_enable(priv->mg_clk);
87678770 if (err < 0)
87688771 goto err_gop_clk;
8772+
8773+ priv->mg_core_clk = devm_clk_get(&pdev->dev, "mg_core_clk");
8774+ if (IS_ERR(priv->mg_core_clk)) {
8775+ priv->mg_core_clk = NULL;
8776+ } else {
8777+ err = clk_prepare_enable(priv->mg_core_clk);
8778+ if (err < 0)
8779+ goto err_mg_clk;
8780+ }
87698781 }
87708782
87718783 priv->axi_clk = devm_clk_get(&pdev->dev, "axi_clk");
87728784 if (IS_ERR(priv->axi_clk)) {
87738785 err = PTR_ERR(priv->axi_clk);
87748786 if (err == -EPROBE_DEFER)
8775− goto err_gop_clk;
8787+ goto err_mg_core_clk;
87768788 priv->axi_clk = NULL;
87778789 } else {
87788790 err = clk_prepare_enable(priv->axi_clk);
87798791 if (err < 0)
8780− goto err_gop_clk;
8792+ goto err_mg_core_clk;
87818793 }
87828794
87838795 /* Get system's tclk rate */
@@ -8789,9 +8801,9 @@ static int mvpp2_probe(struct platform_device *pdev) · 5 unmodified lines
87898801 }
87908802
87918803 if (priv->hw_version == MVPP22) {
8792− err = dma_set_mask(&pdev->dev, DMA_BIT_MASK(40));
8804+ err = dma_set_mask(&pdev->dev, MVPP2_DESC_DMA_MASK);
87938805 if (err)
8794− goto err_mg_clk;
8806+ goto err_axi_clk;
87958807 /* Sadly, the BM pools all share the same register to
87968808 * store the high 32 bits of their address. So they
87978809 * must all have the same high 32 bits, which forces
@@ -8799,14 +8811,14 @@ static int mvpp2_probe(struct platform_device *pdev) · 1 unmodified line
87998811 */
88008812 err = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
88018813 if (err)
8802− goto err_mg_clk;
8814+ goto err_axi_clk;
88038815 }
88048816
88058817 /* Initialize network controller */
88068818 err = mvpp2_init(pdev, priv);
88078819 if (err < 0) {
88088820 dev_err(&pdev->dev, "failed to initialize controller\n");
8809− goto err_mg_clk;
8821+ goto err_axi_clk;
88108822 }
88118823
88128824 /* Initialize ports */
@@ -8819,7 +8831,7 @@ static int mvpp2_probe(struct platform_device *pdev) · 6 unmodified lines
88198831 if (priv->port_count == 0) {
88208832 dev_err(&pdev->dev, "no ports enabled\n");
88218833 err = -ENODEV;
8822− goto err_mg_clk;
8834+ goto err_axi_clk;
88238835 }
88248836
88258837 /* Statistics must be gathered regularly because some of them (like
@@ -8847,8 +8859,13 @@ err_port_probe: · 21 unmodified lines
88478859 mvpp2_port_remove(priv->port_list[i]);
88488860 i++;
88498861 }
8850−err_mg_clk:
8862+err_axi_clk:
88518863 clk_disable_unprepare(priv->axi_clk);
8864+
8865+err_mg_core_clk:
8866+ if (priv->hw_version == MVPP22)
8867+ clk_disable_unprepare(priv->mg_core_clk);
8868+err_mg_clk:
88528869 if (priv->hw_version == MVPP22)
88538870 clk_disable_unprepare(priv->mg_clk);
88548871 err_gop_clk:
@@ -8895,6 +8912,7 @@ static int mvpp2_remove(struct platform_device *pdev) · 40 unmodified lines
88958912 return 0;
88968913
88978914 clk_disable_unprepare(priv->axi_clk);
8915+ clk_disable_unprepare(priv->mg_core_clk);
88988916 clk_disable_unprepare(priv->mg_clk);
88998917 clk_disable_unprepare(priv->pp_clk);
89008918 clk_disable_unprepare(priv->gop_clk);
drivers/net/ethernet/mellanox/mlx4/main.c+1−1
@@ -1317,7 +1317,7 @@ static int mlx4_mf_unbond(struct mlx4_dev *dev) · 1316 unmodified lines
13171317
13181318 ret = mlx4_unbond_fs_rules(dev);
13191319 if (ret)
1320− mlx4_warn(dev, "multifunction unbond for flow rules failedi (%d)\n", ret);
1320+ mlx4_warn(dev, "multifunction unbond for flow rules failed (%d)\n", ret);
13211321 ret1 = mlx4_unbond_mac_table(dev);
13221322 if (ret1) {
13231323 mlx4_warn(dev, "multifunction unbond for MAC table failed (%d)\n", ret1);
drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c+5−3
@@ -1007,12 +1007,14 @@ static void mlx5e_trust_update_sq_inline_mode(struct mlx5e_priv *priv) · 1006 unmodified lines
10071007
10081008 mutex_lock(&priv->state_lock);
10091009
1010− if (!test_bit(MLX5E_STATE_OPENED, &priv->state))
1011− goto out;
1012−
10131010 new_channels.params = priv->channels.params;
10141011 mlx5e_trust_update_tx_min_inline_mode(priv, &new_channels.params);
10151012
1013+ if (!test_bit(MLX5E_STATE_OPENED, &priv->state)) {
1014+ priv->channels.params = new_channels.params;
1015+ goto out;
1016+ }
1017+
10161018 /* Skip if tx_min_inline is the same */
10171019 if (new_channels.params.tx_min_inline_mode ==
10181020 priv->channels.params.tx_min_inline_mode)
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c+3−2
@@ -877,13 +877,14 @@ static const struct net_device_ops mlx5e_netdev_ops_rep = { · 876 unmodified lines
877877 };
878878
879879 static void mlx5e_build_rep_params(struct mlx5_core_dev *mdev,
880− struct mlx5e_params *params)
880+ struct mlx5e_params *params, u16 mtu)
881881 {
882882 u8 cq_period_mode = MLX5_CAP_GEN(mdev, cq_period_start_from_cqe) ?
883883 MLX5_CQ_PERIOD_MODE_START_FROM_CQE :
884884 MLX5_CQ_PERIOD_MODE_START_FROM_EQE;
885885
886886 params->hard_mtu = MLX5E_ETH_HARD_MTU;
887+ params->sw_mtu = mtu;
887888 params->log_sq_size = MLX5E_REP_PARAMS_LOG_SQ_SIZE;
888889 params->rq_wq_type = MLX5_WQ_TYPE_LINKED_LIST;
889890 params->log_rq_mtu_frames = MLX5E_REP_PARAMS_LOG_RQ_SIZE;
@@ -931,7 +932,7 @@ static void mlx5e_init_rep(struct mlx5_core_dev *mdev, · 41 unmodified lines
931932
932933 priv->channels.params.num_channels = profile->max_nch(mdev);
933934
934− mlx5e_build_rep_params(mdev, &priv->channels.params);
935+ mlx5e_build_rep_params(mdev, &priv->channels.params, netdev->mtu);
935936 mlx5e_build_rep_netdev(netdev);
936937
937938 mlx5e_timestamp_init(priv);
drivers/net/ethernet/mellanox/mlx5/core/en_selftest.c+1−1
@@ -290,7 +290,7 @@ static int mlx5e_test_loopback(struct mlx5e_priv *priv) · 289 unmodified lines
290290
291291 if (!test_bit(MLX5E_STATE_OPENED, &priv->state)) {
292292 netdev_err(priv->netdev,
293− "\tCan't perform loobpack test while device is down\n");
293+ "\tCan't perform loopback test while device is down\n");
294294 return -ENODEV;
295295 }
296296
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c+2−1
@@ -1864,7 +1864,8 @@ static bool modify_header_match_supported(struct mlx5_flow_spec *spec, · 1863 unmodified lines
18641864 }
18651865
18661866 ip_proto = MLX5_GET(fte_match_set_lyr_2_4, headers_v, ip_protocol);
1867− if (modify_ip_header && ip_proto != IPPROTO_TCP && ip_proto != IPPROTO_UDP) {
1867+ if (modify_ip_header && ip_proto != IPPROTO_TCP &&
1868+ ip_proto != IPPROTO_UDP && ip_proto != IPPROTO_ICMP) {
18681869 pr_info("can't offload re-write of ip proto %d\n", ip_proto);
18691870 return false;
18701871 }
drivers/net/ethernet/mellanox/mlx5/core/en_tx.c+10−10
@@ -255,7 +255,7 @@ mlx5e_txwqe_build_dsegs(struct mlx5e_txqsq *sq, struct sk_buff *skb, · 254 unmodified lines
255255 dma_addr = dma_map_single(sq->pdev, skb_data, headlen,
256256 DMA_TO_DEVICE);
257257 if (unlikely(dma_mapping_error(sq->pdev, dma_addr)))
258− return -ENOMEM;
258+ goto dma_unmap_wqe_err;
259259
260260 dseg->addr = cpu_to_be64(dma_addr);
261261 dseg->lkey = sq->mkey_be;
@@ -273,7 +273,7 @@ mlx5e_txwqe_build_dsegs(struct mlx5e_txqsq *sq, struct sk_buff *skb, · 11 unmodified lines
273273 dma_addr = skb_frag_dma_map(sq->pdev, frag, 0, fsz,
274274 DMA_TO_DEVICE);
275275 if (unlikely(dma_mapping_error(sq->pdev, dma_addr)))
276− return -ENOMEM;
276+ goto dma_unmap_wqe_err;
277277
278278 dseg->addr = cpu_to_be64(dma_addr);
279279 dseg->lkey = sq->mkey_be;
@@ -285,6 +285,10 @@ mlx5e_txwqe_build_dsegs(struct mlx5e_txqsq *sq, struct sk_buff *skb, · 5 unmodified lines
285285 }
286286
287287 return num_dma;
288+
289+dma_unmap_wqe_err:
290+ mlx5e_dma_unmap_wqe_err(sq, num_dma);
291+ return -ENOMEM;
288292 }
289293
290294 static inline void
@@ -380,17 +384,15 @@ static netdev_tx_t mlx5e_sq_xmit(struct mlx5e_txqsq *sq, struct sk_buff *skb, · 89 unmodified lines
380384 num_dma = mlx5e_txwqe_build_dsegs(sq, skb, skb_data, headlen,
381385 (struct mlx5_wqe_data_seg *)cseg + ds_cnt);
382386 if (unlikely(num_dma < 0))
383− goto dma_unmap_wqe_err;
387+ goto err_drop;
384388
385389 mlx5e_txwqe_complete(sq, skb, opcode, ds_cnt + num_dma,
386390 num_bytes, num_dma, wi, cseg);
387391
388392 return NETDEV_TX_OK;
389393
390−dma_unmap_wqe_err:
394+err_drop:
391395 sq->stats.dropped++;
392− mlx5e_dma_unmap_wqe_err(sq, wi->num_dma);
393−
394396 dev_kfree_skb_any(skb);
395397
396398 return NETDEV_TX_OK;
@@ -645,17 +647,15 @@ netdev_tx_t mlx5i_sq_xmit(struct mlx5e_txqsq *sq, struct sk_buff *skb, · 248 unmodified lines
645647 num_dma = mlx5e_txwqe_build_dsegs(sq, skb, skb_data, headlen,
646648 (struct mlx5_wqe_data_seg *)cseg + ds_cnt);
647649 if (unlikely(num_dma < 0))
648− goto dma_unmap_wqe_err;
650+ goto err_drop;
649651
650652 mlx5e_txwqe_complete(sq, skb, opcode, ds_cnt + num_dma,
651653 num_bytes, num_dma, wi, cseg);
652654
653655 return NETDEV_TX_OK;
654656
655−dma_unmap_wqe_err:
657+err_drop:
656658 sq->stats.dropped++;
657− mlx5e_dma_unmap_wqe_err(sq, wi->num_dma);
658−
659659 dev_kfree_skb_any(skb);
660660
661661 return NETDEV_TX_OK;
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c+16−10
@@ -187,6 +187,7 @@ static void del_sw_ns(struct fs_node *node); · 186 unmodified lines
187187 static void del_sw_hw_rule(struct fs_node *node);
188188 static bool mlx5_flow_dests_cmp(struct mlx5_flow_destination *d1,
189189 struct mlx5_flow_destination *d2);
190+static void cleanup_root_ns(struct mlx5_flow_root_namespace *root_ns);
190191 static struct mlx5_flow_rule *
191192 find_flow_rule(struct fs_fte *fte,
192193 struct mlx5_flow_destination *dest);
@@ -481,7 +482,8 @@ static void del_sw_hw_rule(struct fs_node *node) · 288 unmodified lines
481482
482483 if (rule->dest_attr.type == MLX5_FLOW_DESTINATION_TYPE_COUNTER &&
483484 --fte->dests_size) {
484− modify_mask = BIT(MLX5_SET_FTE_MODIFY_ENABLE_MASK_ACTION);
485+ modify_mask = BIT(MLX5_SET_FTE_MODIFY_ENABLE_MASK_ACTION) |
486+ BIT(MLX5_SET_FTE_MODIFY_ENABLE_MASK_FLOW_COUNTERS);
485487 fte->action.action &= ~MLX5_FLOW_CONTEXT_ACTION_COUNT;
486488 update_fte = true;
487489 goto out;
@@ -2351,23 +2353,27 @@ static int create_anchor_flow_table(struct mlx5_flow_steering *steering) · 1863 unmodified lines
23512353
23522354 static int init_root_ns(struct mlx5_flow_steering *steering)
23532355 {
2356+ int err;
2357+
23542358 steering->root_ns = create_root_ns(steering, FS_FT_NIC_RX);
23552359 if (!steering->root_ns)
2356− goto cleanup;
2360+ return -ENOMEM;
23572361
2358− if (init_root_tree(steering, &root_fs, &steering->root_ns->ns.node))
2359− goto cleanup;
2362+ err = init_root_tree(steering, &root_fs, &steering->root_ns->ns.node);
2363+ if (err)
2364+ goto out_err;
23602365
23612366 set_prio_attrs(steering->root_ns);
2362−
2363− if (create_anchor_flow_table(steering))
2364− goto cleanup;
2367+ err = create_anchor_flow_table(steering);
2368+ if (err)
2369+ goto out_err;
23652370
23662371 return 0;
23672372
2368−cleanup:
2369− mlx5_cleanup_fs(steering->dev);
2370− return -ENOMEM;
2373+out_err:
2374+ cleanup_root_ns(steering->root_ns);
2375+ steering->root_ns = NULL;
2376+ return err;
23712377 }
23722378
23732379 static void clean_tree(struct fs_node *node)
drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c+5−7
@@ -1718,13 +1718,11 @@ __mlxsw_sp_port_mdb_del(struct mlxsw_sp_port *mlxsw_sp_port, · 1717 unmodified lines
17181718 struct net_device *dev = mlxsw_sp_port->dev;
17191719 int err;
17201720
1721− if (bridge_port->bridge_device->multicast_enabled) {
1722− if (bridge_port->bridge_device->multicast_enabled) {
1723− err = mlxsw_sp_port_smid_set(mlxsw_sp_port, mid->mid,
1724− false);
1725− if (err)
1726− netdev_err(dev, "Unable to remove port from SMID\n");
1727− }
1721+ if (bridge_port->bridge_device->multicast_enabled &&
1722+ !bridge_port->mrouter) {
1723+ err = mlxsw_sp_port_smid_set(mlxsw_sp_port, mid->mid, false);
1724+ if (err)
1725+ netdev_err(dev, "Unable to remove port from SMID\n");
17281726 }
17291727
17301728 err = mlxsw_sp_port_remove_from_mid(mlxsw_sp_port, mid);
drivers/net/ethernet/netronome/nfp/flower/action.c+8−2
@@ -183,17 +183,21 @@ static int · 182 unmodified lines
183183 nfp_fl_set_ipv4_udp_tun(struct nfp_fl_set_ipv4_udp_tun *set_tun,
184184 const struct tc_action *action,
185185 struct nfp_fl_pre_tunnel *pre_tun,
186− enum nfp_flower_tun_type tun_type)
186+ enum nfp_flower_tun_type tun_type,
187+ struct net_device *netdev)
187188 {
188189 size_t act_size = sizeof(struct nfp_fl_set_ipv4_udp_tun);
189190 struct ip_tunnel_info *ip_tun = tcf_tunnel_info(action);
190191 u32 tmp_set_ip_tun_type_index = 0;
191192 /* Currently support one pre-tunnel so index is always 0. */
192193 int pretun_idx = 0;
194+ struct net *net;
193195
194196 if (ip_tun->options_len)
195197 return -EOPNOTSUPP;
196198
199+ net = dev_net(netdev);
200+
197201 set_tun->head.jump_id = NFP_FL_ACTION_OPCODE_SET_IPV4_TUNNEL;
198202 set_tun->head.len_lw = act_size >> NFP_FL_LW_SIZ;
199203
@@ -204,6 +208,7 @@ nfp_fl_set_ipv4_udp_tun(struct nfp_fl_set_ipv4_udp_tun *set_tun, · 4 unmodified lines
204208
205209 set_tun->tun_type_index = cpu_to_be32(tmp_set_ip_tun_type_index);
206210 set_tun->tun_id = ip_tun->key.tun_id;
211+ set_tun->ttl = net->ipv4.sysctl_ip_default_ttl;
207212
208213 /* Complete pre_tunnel action. */
209214 pre_tun->ipv4_dst = ip_tun->key.u.ipv4.dst;
@@ -511,7 +516,8 @@ nfp_flower_loop_action(const struct tc_action *a, · 301 unmodified lines
511516 *a_len += sizeof(struct nfp_fl_pre_tunnel);
512517
513518 set_tun = (void *)&nfp_fl->action_data[*a_len];
514− err = nfp_fl_set_ipv4_udp_tun(set_tun, a, pre_tun, *tun_type);
519+ err = nfp_fl_set_ipv4_udp_tun(set_tun, a, pre_tun, *tun_type,
520+ netdev);
515521 if (err)
516522 return err;
517523 *a_len += sizeof(struct nfp_fl_set_ipv4_udp_tun);
drivers/net/ethernet/netronome/nfp/flower/cmsg.c+37−7
@@ -258,9 +258,6 @@ nfp_flower_cmsg_process_one_rx(struct nfp_app *app, struct sk_buff *skb) · 257 unmodified lines
258258 case NFP_FLOWER_CMSG_TYPE_ACTIVE_TUNS:
259259 nfp_tunnel_keep_alive(app, skb);
260260 break;
261− case NFP_FLOWER_CMSG_TYPE_TUN_NEIGH:
262− /* Acks from the NFP that the route is added - ignore. */
263− break;
264261 default:
265262 nfp_flower_cmsg_warn(app, "Cannot handle invalid repr control type %u\n",
266263 type);
@@ -275,18 +272,49 @@ out: · 8 unmodified lines
275272
276273 void nfp_flower_cmsg_process_rx(struct work_struct *work)
277274 {
275+ struct sk_buff_head cmsg_joined;
278276 struct nfp_flower_priv *priv;
279277 struct sk_buff *skb;
280278
281279 priv = container_of(work, struct nfp_flower_priv, cmsg_work);
280+ skb_queue_head_init(&cmsg_joined);
281+
282+ spin_lock_bh(&priv->cmsg_skbs_high.lock);
283+ skb_queue_splice_tail_init(&priv->cmsg_skbs_high, &cmsg_joined);
284+ spin_unlock_bh(&priv->cmsg_skbs_high.lock);
282285
283− while ((skb = skb_dequeue(&priv->cmsg_skbs)))
286+ spin_lock_bh(&priv->cmsg_skbs_low.lock);
287+ skb_queue_splice_tail_init(&priv->cmsg_skbs_low, &cmsg_joined);
288+ spin_unlock_bh(&priv->cmsg_skbs_low.lock);
289+
290+ while ((skb = __skb_dequeue(&cmsg_joined)))
284291 nfp_flower_cmsg_process_one_rx(priv->app, skb);
285292 }
286293
287−void nfp_flower_cmsg_rx(struct nfp_app *app, struct sk_buff *skb)
294+static void
295+nfp_flower_queue_ctl_msg(struct nfp_app *app, struct sk_buff *skb, int type)
288296 {
289297 struct nfp_flower_priv *priv = app->priv;
298+ struct sk_buff_head *skb_head;
299+
300+ if (type == NFP_FLOWER_CMSG_TYPE_PORT_REIFY ||
301+ type == NFP_FLOWER_CMSG_TYPE_PORT_MOD)
302+ skb_head = &priv->cmsg_skbs_high;
303+ else
304+ skb_head = &priv->cmsg_skbs_low;
305+
306+ if (skb_queue_len(skb_head) >= NFP_FLOWER_WORKQ_MAX_SKBS) {
307+ nfp_flower_cmsg_warn(app, "Dropping queued control messages\n");
308+ dev_kfree_skb_any(skb);
309+ return;
310+ }
311+
312+ skb_queue_tail(skb_head, skb);
313+ schedule_work(&priv->cmsg_work);
314+}
315+
316+void nfp_flower_cmsg_rx(struct nfp_app *app, struct sk_buff *skb)
317+{
290318 struct nfp_flower_cmsg_hdr *cmsg_hdr;
291319
292320 cmsg_hdr = nfp_flower_cmsg_get_hdr(skb);
@@ -306,8 +334,10 @@ void nfp_flower_cmsg_rx(struct nfp_app *app, struct sk_buff *skb) · 13 unmodified lines
306334 nfp_flower_process_mtu_ack(app, skb)) {
307335 /* Handle MTU acks outside wq to prevent RTNL conflict. */
308336 dev_consume_skb_any(skb);
337+ } else if (cmsg_hdr->type == NFP_FLOWER_CMSG_TYPE_TUN_NEIGH) {
338+ /* Acks from the NFP that the route is added - ignore. */
339+ dev_consume_skb_any(skb);
309340 } else {
310− skb_queue_tail(&priv->cmsg_skbs, skb);
311− schedule_work(&priv->cmsg_work);
341+ nfp_flower_queue_ctl_msg(app, skb, cmsg_hdr->type);
312342 }
313343 }
drivers/net/ethernet/netronome/nfp/flower/cmsg.h+6−1
@@ -108,6 +108,8 @@ · 107 unmodified lines
108108 #define NFP_FL_IPV4_TUNNEL_TYPE GENMASK(7, 4)
109109 #define NFP_FL_IPV4_PRE_TUN_INDEX GENMASK(2, 0)
110110
111+#define NFP_FLOWER_WORKQ_MAX_SKBS 30000
112+
111113 #define nfp_flower_cmsg_warn(app, fmt, args...) \
112114 do { \
113115 if (net_ratelimit()) \
@@ -188,7 +190,10 @@ struct nfp_fl_set_ipv4_udp_tun { · 74 unmodified lines
188190 __be16 reserved;
189191 __be64 tun_id __packed;
190192 __be32 tun_type_index;
191− __be32 extra[3];
193+ __be16 reserved2;
194+ u8 ttl;
195+ u8 reserved3;
196+ __be32 extra[2];
192197 };
193198
194199 /* Metadata with L2 (1W/4B)
drivers/net/ethernet/netronome/nfp/flower/main.c+5−3
@@ -360,7 +360,7 @@ nfp_flower_spawn_phy_reprs(struct nfp_app *app, struct nfp_flower_priv *priv) · 359 unmodified lines
360360 }
361361
362362 SET_NETDEV_DEV(repr, &priv->nn->pdev->dev);
363− nfp_net_get_mac_addr(app->pf, port);
363+ nfp_net_get_mac_addr(app->pf, repr, port);
364364
365365 cmsg_port_id = nfp_flower_cmsg_phys_port(phys_port);
366366 err = nfp_repr_init(app, repr,
@@ -519,7 +519,8 @@ static int nfp_flower_init(struct nfp_app *app) · 152 unmodified lines
519519
520520 app->priv = app_priv;
521521 app_priv->app = app;
522− skb_queue_head_init(&app_priv->cmsg_skbs);
522+ skb_queue_head_init(&app_priv->cmsg_skbs_high);
523+ skb_queue_head_init(&app_priv->cmsg_skbs_low);
523524 INIT_WORK(&app_priv->cmsg_work, nfp_flower_cmsg_process_rx);
524525 init_waitqueue_head(&app_priv->reify_wait_queue);
525526
@@ -549,7 +550,8 @@ static void nfp_flower_clean(struct nfp_app *app) · 23 unmodified lines
549550 {
550551 struct nfp_flower_priv *app_priv = app->priv;
551552
552− skb_queue_purge(&app_priv->cmsg_skbs);
553+ skb_queue_purge(&app_priv->cmsg_skbs_high);
554+ skb_queue_purge(&app_priv->cmsg_skbs_low);
553555 flush_work(&app_priv->cmsg_work);
554556
555557 nfp_flower_metadata_cleanup(app);
drivers/net/ethernet/netronome/nfp/flower/main.h+6−2
@@ -107,7 +107,10 @@ struct nfp_mtu_conf { · 106 unmodified lines
107107 * @mask_table: Hash table used to store masks
108108 * @flow_table: Hash table used to store flower rules
109109 * @cmsg_work: Workqueue for control messages processing
110− * @cmsg_skbs: List of skbs for control message processing
110+ * @cmsg_skbs_high: List of higher priority skbs for control message
111+ * processing
112+ * @cmsg_skbs_low: List of lower priority skbs for control message
113+ * processing
111114 * @nfp_mac_off_list: List of MAC addresses to offload
112115 * @nfp_mac_index_list: List of unique 8-bit indexes for non NFP netdevs
113116 * @nfp_ipv4_off_list: List of IPv4 addresses to offload
@@ -136,7 +139,8 @@ struct nfp_flower_priv { · 22 unmodified lines
136139 DECLARE_HASHTABLE(mask_table, NFP_FLOWER_MASK_HASH_BITS);
137140 DECLARE_HASHTABLE(flow_table, NFP_FLOWER_HASH_BITS);
138141 struct work_struct cmsg_work;
139− struct sk_buff_head cmsg_skbs;
142+ struct sk_buff_head cmsg_skbs_high;
143+ struct sk_buff_head cmsg_skbs_low;
140144 struct list_head nfp_mac_off_list;
141145 struct list_head nfp_mac_index_list;
142146 struct list_head nfp_ipv4_off_list;
drivers/net/ethernet/netronome/nfp/nfp_app_nic.c+1−1
@@ -69,7 +69,7 @@ int nfp_app_nic_vnic_alloc(struct nfp_app *app, struct nfp_net *nn, · 68 unmodified lines
6969 if (err)
7070 return err < 0 ? err : 0;
7171
72− nfp_net_get_mac_addr(app->pf, nn->port);
72+ nfp_net_get_mac_addr(app->pf, nn->dp.netdev, nn->port);
7373
7474 return 0;
7575 }
drivers/net/ethernet/netronome/nfp/nfp_main.h+3−1
@@ -171,7 +171,9 @@ void nfp_net_pci_remove(struct nfp_pf *pf); · 170 unmodified lines
171171 int nfp_hwmon_register(struct nfp_pf *pf);
172172 void nfp_hwmon_unregister(struct nfp_pf *pf);
173173
174−void nfp_net_get_mac_addr(struct nfp_pf *pf, struct nfp_port *port);
174+void
175+nfp_net_get_mac_addr(struct nfp_pf *pf, struct net_device *netdev,
176+ struct nfp_port *port);
175177
176178 bool nfp_ctrl_tx(struct nfp_net *nn, struct sk_buff *skb);
177179
drivers/net/ethernet/netronome/nfp/nfp_net_main.c+18−13
@@ -67,23 +67,26 @@ · 66 unmodified lines
6767 /**
6868 * nfp_net_get_mac_addr() - Get the MAC address.
6969 * @pf: NFP PF handle
70+ * @netdev: net_device to set MAC address on
7071 * @port: NFP port structure
7172 *
7273 * First try to get the MAC address from NSP ETH table. If that
7374 * fails generate a random address.
7475 */
75−void nfp_net_get_mac_addr(struct nfp_pf *pf, struct nfp_port *port)
76+void
77+nfp_net_get_mac_addr(struct nfp_pf *pf, struct net_device *netdev,
78+ struct nfp_port *port)
7679 {
7780 struct nfp_eth_table_port *eth_port;
7881
7982 eth_port = __nfp_port_get_eth_port(port);
8083 if (!eth_port) {
81− eth_hw_addr_random(port->netdev);
84+ eth_hw_addr_random(netdev);
8285 return;
8386 }
8487
85− ether_addr_copy(port->netdev->dev_addr, eth_port->mac_addr);
86− ether_addr_copy(port->netdev->perm_addr, eth_port->mac_addr);
88+ ether_addr_copy(netdev->dev_addr, eth_port->mac_addr);
89+ ether_addr_copy(netdev->perm_addr, eth_port->mac_addr);
8790 }
8891
8992 static struct nfp_eth_table_port *
@@ -511,16 +514,18 @@ static int nfp_net_pci_map_mem(struct nfp_pf *pf) · 421 unmodified lines
511514 return PTR_ERR(mem);
512515 }
513516
514− min_size = NFP_MAC_STATS_SIZE * (pf->eth_tbl->max_index + 1);
515− pf->mac_stats_mem = nfp_rtsym_map(pf->rtbl, "_mac_stats",
516− "net.macstats", min_size,
517− &pf->mac_stats_bar);
518− if (IS_ERR(pf->mac_stats_mem)) {
519− if (PTR_ERR(pf->mac_stats_mem) != -ENOENT) {
520− err = PTR_ERR(pf->mac_stats_mem);
521− goto err_unmap_ctrl;
517+ if (pf->eth_tbl) {
518+ min_size = NFP_MAC_STATS_SIZE * (pf->eth_tbl->max_index + 1);
519+ pf->mac_stats_mem = nfp_rtsym_map(pf->rtbl, "_mac_stats",
520+ "net.macstats", min_size,
521+ &pf->mac_stats_bar);
522+ if (IS_ERR(pf->mac_stats_mem)) {
523+ if (PTR_ERR(pf->mac_stats_mem) != -ENOENT) {
524+ err = PTR_ERR(pf->mac_stats_mem);
525+ goto err_unmap_ctrl;
526+ }
527+ pf->mac_stats_mem = NULL;
522528 }
523− pf->mac_stats_mem = NULL;
524529 }
525530
526531 pf->vf_cfg_mem = nfp_net_pf_map_rtsym(pf, "net.vfcfg",
drivers/net/ethernet/netronome/nfp/nfpcore/nfp_mutex.c+4−1
@@ -211,8 +211,11 @@ int nfp_cpp_mutex_lock(struct nfp_cpp_mutex *mutex) · 210 unmodified lines
211211 break;
212212
213213 err = msleep_interruptible(timeout_ms);
214− if (err != 0)
214+ if (err != 0) {
215+ nfp_info(mutex->cpp,
216+ "interrupted waiting for NFP mutex\n");
215217 return -ERESTARTSYS;
218+ }
216219
217220 if (time_is_before_eq_jiffies(warn_at)) {
218221 warn_at = jiffies + NFP_MUTEX_WAIT_NEXT_WARN * HZ;
drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp.c+1−2
@@ -281,8 +281,7 @@ nfp_nsp_wait_reg(struct nfp_cpp *cpp, u64 *reg, u32 nsp_cpp, u64 addr, · 280 unmodified lines
281281 if ((*reg & mask) == val)
282282 return 0;
283283
284− if (msleep_interruptible(25))
285− return -ERESTARTSYS;
284+ msleep(25);
286285
287286 if (time_after(start_time, wait_until))
288287 return -ETIMEDOUT;
drivers/net/ethernet/qlogic/qed/qed_ll2.c+1−1
@@ -2370,7 +2370,7 @@ static int qed_ll2_start_xmit(struct qed_dev *cdev, struct sk_buff *skb) · 2369 unmodified lines
23702370 u8 flags = 0;
23712371
23722372 if (unlikely(skb->ip_summed != CHECKSUM_NONE)) {
2373− DP_INFO(cdev, "Cannot transmit a checksumed packet\n");
2373+ DP_INFO(cdev, "Cannot transmit a checksummed packet\n");
23742374 return -EINVAL;
23752375 }
23762376
drivers/net/ethernet/qlogic/qed/qed_roce.c+1−1
@@ -848,7 +848,7 @@ int qed_roce_query_qp(struct qed_hwfn *p_hwfn, · 847 unmodified lines
848848
849849 if (!(qp->resp_offloaded)) {
850850 DP_NOTICE(p_hwfn,
851− "The responder's qp should be offloded before requester's\n");
851+ "The responder's qp should be offloaded before requester's\n");
852852 return -EINVAL;
853853 }
854854
drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c+6−5
@@ -350,15 +350,16 @@ static int rmnet_fill_info(struct sk_buff *skb, const struct net_device *dev) · 349 unmodified lines
350350
351351 real_dev = priv->real_dev;
352352
353− if (!rmnet_is_real_dev_registered(real_dev))
354− return -ENODEV;
355−
356353 if (nla_put_u16(skb, IFLA_RMNET_MUX_ID, priv->mux_id))
357354 goto nla_put_failure;
358355
359− port = rmnet_get_port_rtnl(real_dev);
356+ if (rmnet_is_real_dev_registered(real_dev)) {
357+ port = rmnet_get_port_rtnl(real_dev);
358+ f.flags = port->data_format;
359+ } else {
360+ f.flags = 0;
361+ }
360362
361− f.flags = port->data_format;
362363 f.mask = ~0;
363364
364365 if (nla_put(skb, IFLA_RMNET_FLAGS, sizeof(f), &f))
drivers/net/ethernet/realtek/8139too.c+1−1
@@ -2224,7 +2224,7 @@ static void rtl8139_poll_controller(struct net_device *dev) · 2223 unmodified lines
22242224 struct rtl8139_private *tp = netdev_priv(dev);
22252225 const int irq = tp->pci_dev->irq;
22262226
2227− disable_irq(irq);
2227+ disable_irq_nosync(irq);
22282228 rtl8139_interrupt(irq, dev);
22292229 enable_irq(irq);
22302230 }
drivers/net/ethernet/sfc/ef10.c+50−38
@@ -3999,29 +3999,6 @@ static void efx_ef10_prepare_flr(struct efx_nic *efx) · 3998 unmodified lines
39993999 atomic_set(&efx->active_queues, 0);
40004000 }
40014001
4002−static bool efx_ef10_filter_equal(const struct efx_filter_spec *left,
4003− const struct efx_filter_spec *right)
4004−{
4005− if ((left->match_flags ^ right->match_flags) |
4006− ((left->flags ^ right->flags) &
4007− (EFX_FILTER_FLAG_RX | EFX_FILTER_FLAG_TX)))
4008− return false;
4009−
4010− return memcmp(&left->outer_vid, &right->outer_vid,
4011− sizeof(struct efx_filter_spec) -
4012− offsetof(struct efx_filter_spec, outer_vid)) == 0;
4013−}
4014−
4015−static unsigned int efx_ef10_filter_hash(const struct efx_filter_spec *spec)
4016−{
4017− BUILD_BUG_ON(offsetof(struct efx_filter_spec, outer_vid) & 3);
4018− return jhash2((const u32 *)&spec->outer_vid,
4019− (sizeof(struct efx_filter_spec) -
4020− offsetof(struct efx_filter_spec, outer_vid)) / 4,
4021− 0);
4022− /* XXX should we randomise the initval? */
4023−}
4024−
40254002 /* Decide whether a filter should be exclusive or else should allow
40264003 * delivery to additional recipients. Currently we decide that
40274004 * filters for specific local unicast MAC and IP addresses are
@@ -4346,7 +4323,7 @@ static s32 efx_ef10_filter_insert(struct efx_nic *efx, · 318 unmodified lines
43464323 goto out_unlock;
43474324 match_pri = rc;
43484325
4349− hash = efx_ef10_filter_hash(spec);
4326+ hash = efx_filter_spec_hash(spec);
43504327 is_mc_recip = efx_filter_is_mc_recipient(spec);
43514328 if (is_mc_recip)
43524329 bitmap_zero(mc_rem_map, EFX_EF10_FILTER_SEARCH_LIMIT);
@@ -4378,7 +4355,7 @@ static s32 efx_ef10_filter_insert(struct efx_nic *efx, · 25 unmodified lines
43784355 if (!saved_spec) {
43794356 if (ins_index < 0)
43804357 ins_index = i;
4381− } else if (efx_ef10_filter_equal(spec, saved_spec)) {
4358+ } else if (efx_filter_spec_equal(spec, saved_spec)) {
43824359 if (spec->priority < saved_spec->priority &&
43834360 spec->priority != EFX_FILTER_PRI_AUTO) {
43844361 rc = -EPERM;
@@ -4762,28 +4739,63 @@ static s32 efx_ef10_filter_get_rx_ids(struct efx_nic *efx, · 377 unmodified lines
47624739 static bool efx_ef10_filter_rfs_expire_one(struct efx_nic *efx, u32 flow_id,
47634740 unsigned int filter_idx)
47644741 {
4742+ struct efx_filter_spec *spec, saved_spec;
47654743 struct efx_ef10_filter_table *table;
4766− struct efx_filter_spec *spec;
4767− bool ret;
4744+ struct efx_arfs_rule *rule = NULL;
4745+ bool ret = true, force = false;
4746+ u16 arfs_id;
47684747
47694748 down_read(&efx->filter_sem);
47704749 table = efx->filter_state;
47714750 down_write(&table->lock);
47724751 spec = efx_ef10_filter_entry_spec(table, filter_idx);
47734752
4774− if (!spec || spec->priority != EFX_FILTER_PRI_HINT) {
4775− ret = true;
4753+ if (!spec || spec->priority != EFX_FILTER_PRI_HINT)
47764754 goto out_unlock;
4777− }
47784755
4779− if (!rps_may_expire_flow(efx->net_dev, spec->dmaq_id,
4780− flow_id, filter_idx)) {
4756+ spin_lock_bh(&efx->rps_hash_lock);
4757+ if (!efx->rps_hash_table) {
4758+ /* In the absence of the table, we always return 0 to ARFS. */
4759+ arfs_id = 0;
4760+ } else {
4761+ rule = efx_rps_hash_find(efx, spec);
4762+ if (!rule)
4763+ /* ARFS table doesn't know of this filter, so remove it */
4764+ goto expire;
4765+ arfs_id = rule->arfs_id;
4766+ ret = efx_rps_check_rule(rule, filter_idx, &force);
4767+ if (force)
4768+ goto expire;
4769+ if (!ret) {
4770+ spin_unlock_bh(&efx->rps_hash_lock);
4771+ goto out_unlock;
4772+ }
4773+ }
4774+ if (!rps_may_expire_flow(efx->net_dev, spec->dmaq_id, flow_id, arfs_id))
47814775 ret = false;
4782− goto out_unlock;
4776+ else if (rule)
4777+ rule->filter_id = EFX_ARFS_FILTER_ID_REMOVING;
4778+expire:
4779+ saved_spec = *spec; /* remove operation will kfree spec */
4780+ spin_unlock_bh(&efx->rps_hash_lock);
4781+ /* At this point (since we dropped the lock), another thread might queue
4782+ * up a fresh insertion request (but the actual insertion will be held
4783+ * up by our possession of the filter table lock). In that case, it
4784+ * will set rule->filter_id to EFX_ARFS_FILTER_ID_PENDING, meaning that
4785+ * the rule is not removed by efx_rps_hash_del() below.
4786+ */
4787+ if (ret)
4788+ ret = efx_ef10_filter_remove_internal(efx, 1U << spec->priority,
4789+ filter_idx, true) == 0;
4790+ /* While we can't safely dereference rule (we dropped the lock), we can
4791+ * still test it for NULL.
4792+ */
4793+ if (ret && rule) {
4794+ /* Expiring, so remove entry from ARFS table */
4795+ spin_lock_bh(&efx->rps_hash_lock);
4796+ efx_rps_hash_del(efx, &saved_spec);
4797+ spin_unlock_bh(&efx->rps_hash_lock);
47834798 }
4784−
4785− ret = efx_ef10_filter_remove_internal(efx, 1U << spec->priority,
4786− filter_idx, true) == 0;
47874799 out_unlock:
47884800 up_write(&table->lock);
47894801 up_read(&efx->filter_sem);
@@ -5265,7 +5277,7 @@ static int efx_ef10_filter_insert_addr_list(struct efx_nic *efx, · 475 unmodified lines
52655277 ids = vlan->uc;
52665278 }
52675279
5268− filter_flags = efx_rss_enabled(efx) ? EFX_FILTER_FLAG_RX_RSS : 0;
5280+ filter_flags = efx_rss_active(&efx->rss_context) ? EFX_FILTER_FLAG_RX_RSS : 0;
52695281
52705282 /* Insert/renew filters */
52715283 for (i = 0; i < addr_count; i++) {
@@ -5334,7 +5346,7 @@ static int efx_ef10_filter_insert_def(struct efx_nic *efx, · 62 unmodified lines
53345346 int rc;
53355347 u16 *id;
53365348
5337− filter_flags = efx_rss_enabled(efx) ? EFX_FILTER_FLAG_RX_RSS : 0;
5349+ filter_flags = efx_rss_active(&efx->rss_context) ? EFX_FILTER_FLAG_RX_RSS : 0;
53385350
53395351 efx_filter_init_rx(&spec, EFX_FILTER_PRI_AUTO, filter_flags, 0);
53405352
drivers/net/ethernet/sfc/efx.c+143−0
@@ -3027,6 +3027,10 @@ static int efx_init_struct(struct efx_nic *efx, · 3026 unmodified lines
30273027 mutex_init(&efx->mac_lock);
30283028 #ifdef CONFIG_RFS_ACCEL
30293029 mutex_init(&efx->rps_mutex);
3030+ spin_lock_init(&efx->rps_hash_lock);
3031+ /* Failure to allocate is not fatal, but may degrade ARFS performance */
3032+ efx->rps_hash_table = kcalloc(EFX_ARFS_HASH_TABLE_SIZE,
3033+ sizeof(*efx->rps_hash_table), GFP_KERNEL);
30303034 #endif
30313035 efx->phy_op = &efx_dummy_phy_operations;
30323036 efx->mdio.dev = net_dev;
@@ -3070,6 +3074,10 @@ static void efx_fini_struct(struct efx_nic *efx) · 37 unmodified lines
30703074 {
30713075 int i;
30723076
3077+#ifdef CONFIG_RFS_ACCEL
3078+ kfree(efx->rps_hash_table);
3079+#endif
3080+
30733081 for (i = 0; i < EFX_MAX_CHANNELS; i++)
30743082 kfree(efx->channel[i]);
30753083
@@ -3092,6 +3100,141 @@ void efx_update_sw_stats(struct efx_nic *efx, u64 *stats) · 16 unmodified lines
30923100 stats[GENERIC_STAT_rx_noskb_drops] = atomic_read(&efx->n_rx_noskb_drops);
30933101 }
30943102
3103+bool efx_filter_spec_equal(const struct efx_filter_spec *left,
3104+ const struct efx_filter_spec *right)
3105+{
3106+ if ((left->match_flags ^ right->match_flags) |
3107+ ((left->flags ^ right->flags) &
3108+ (EFX_FILTER_FLAG_RX | EFX_FILTER_FLAG_TX)))
3109+ return false;
3110+
3111+ return memcmp(&left->outer_vid, &right->outer_vid,
3112+ sizeof(struct efx_filter_spec) -
3113+ offsetof(struct efx_filter_spec, outer_vid)) == 0;
3114+}
3115+
3116+u32 efx_filter_spec_hash(const struct efx_filter_spec *spec)
3117+{
3118+ BUILD_BUG_ON(offsetof(struct efx_filter_spec, outer_vid) & 3);
3119+ return jhash2((const u32 *)&spec->outer_vid,
3120+ (sizeof(struct efx_filter_spec) -
3121+ offsetof(struct efx_filter_spec, outer_vid)) / 4,
3122+ 0);
3123+}
3124+
3125+#ifdef CONFIG_RFS_ACCEL
3126+bool efx_rps_check_rule(struct efx_arfs_rule *rule, unsigned int filter_idx,
3127+ bool *force)
3128+{
3129+ if (rule->filter_id == EFX_ARFS_FILTER_ID_PENDING) {
3130+ /* ARFS is currently updating this entry, leave it */
3131+ return false;
3132+ }
3133+ if (rule->filter_id == EFX_ARFS_FILTER_ID_ERROR) {
3134+ /* ARFS tried and failed to update this, so it's probably out
3135+ * of date. Remove the filter and the ARFS rule entry.
3136+ */
3137+ rule->filter_id = EFX_ARFS_FILTER_ID_REMOVING;
3138+ *force = true;
3139+ return true;
3140+ } else if (WARN_ON(rule->filter_id != filter_idx)) { /* can't happen */
3141+ /* ARFS has moved on, so old filter is not needed. Since we did
3142+ * not mark the rule with EFX_ARFS_FILTER_ID_REMOVING, it will
3143+ * not be removed by efx_rps_hash_del() subsequently.
3144+ */
3145+ *force = true;
3146+ return true;
3147+ }
3148+ /* Remove it iff ARFS wants to. */
3149+ return true;
3150+}
3151+
3152+struct hlist_head *efx_rps_hash_bucket(struct efx_nic *efx,
3153+ const struct efx_filter_spec *spec)
3154+{
3155+ u32 hash = efx_filter_spec_hash(spec);
3156+
3157+ WARN_ON(!spin_is_locked(&efx->rps_hash_lock));
3158+ if (!efx->rps_hash_table)
3159+ return NULL;
3160+ return &efx->rps_hash_table[hash % EFX_ARFS_HASH_TABLE_SIZE];
3161+}
3162+
3163+struct efx_arfs_rule *efx_rps_hash_find(struct efx_nic *efx,
3164+ const struct efx_filter_spec *spec)
3165+{
3166+ struct efx_arfs_rule *rule;
3167+ struct hlist_head *head;
3168+ struct hlist_node *node;
3169+
3170+ head = efx_rps_hash_bucket(efx, spec);
3171+ if (!head)
3172+ return NULL;
3173+ hlist_for_each(node, head) {
3174+ rule = container_of(node, struct efx_arfs_rule, node);
3175+ if (efx_filter_spec_equal(spec, &rule->spec))
3176+ return rule;
3177+ }
3178+ return NULL;
3179+}
3180+
3181+struct efx_arfs_rule *efx_rps_hash_add(struct efx_nic *efx,
3182+ const struct efx_filter_spec *spec,
3183+ bool *new)
3184+{
3185+ struct efx_arfs_rule *rule;
3186+ struct hlist_head *head;
3187+ struct hlist_node *node;
3188+
3189+ head = efx_rps_hash_bucket(efx, spec);
3190+ if (!head)
3191+ return NULL;
3192+ hlist_for_each(node, head) {
3193+ rule = container_of(node, struct efx_arfs_rule, node);
3194+ if (efx_filter_spec_equal(spec, &rule->spec)) {
3195+ *new = false;
3196+ return rule;
3197+ }
3198+ }
3199+ rule = kmalloc(sizeof(*rule), GFP_ATOMIC);
3200+ *new = true;
3201+ if (rule) {
3202+ memcpy(&rule->spec, spec, sizeof(rule->spec));
3203+ hlist_add_head(&rule->node, head);
3204+ }
3205+ return rule;
3206+}
3207+
3208+void efx_rps_hash_del(struct efx_nic *efx, const struct efx_filter_spec *spec)
3209+{
3210+ struct efx_arfs_rule *rule;
3211+ struct hlist_head *head;
3212+ struct hlist_node *node;
3213+
3214+ head = efx_rps_hash_bucket(efx, spec);
3215+ if (WARN_ON(!head))
3216+ return;
3217+ hlist_for_each(node, head) {
3218+ rule = container_of(node, struct efx_arfs_rule, node);
3219+ if (efx_filter_spec_equal(spec, &rule->spec)) {
3220+ /* Someone already reused the entry. We know that if
3221+ * this check doesn't fire (i.e. filter_id == REMOVING)
3222+ * then the REMOVING mark was put there by our caller,
3223+ * because caller is holding a lock on filter table and
3224+ * only holders of that lock set REMOVING.
3225+ */
3226+ if (rule->filter_id != EFX_ARFS_FILTER_ID_REMOVING)
3227+ return;
3228+ hlist_del(node);
3229+ kfree(rule);
3230+ return;
3231+ }
3232+ }
3233+ /* We didn't find it. */
3234+ WARN_ON(1);
3235+}
3236+#endif
3237+
30953238 /* RSS contexts. We're using linked lists and crappy O(n) algorithms, because
30963239 * (a) this is an infrequent control-plane operation and (b) n is small (max 64)
30973240 */
drivers/net/ethernet/sfc/efx.h+21−0
@@ -186,6 +186,27 @@ static inline void efx_filter_rfs_expire(struct work_struct *data) {} · 185 unmodified lines
186186 #endif
187187 bool efx_filter_is_mc_recipient(const struct efx_filter_spec *spec);
188188
189+bool efx_filter_spec_equal(const struct efx_filter_spec *left,
190+ const struct efx_filter_spec *right);
191+u32 efx_filter_spec_hash(const struct efx_filter_spec *spec);
192+
193+#ifdef CONFIG_RFS_ACCEL
194+bool efx_rps_check_rule(struct efx_arfs_rule *rule, unsigned int filter_idx,
195+ bool *force);
196+
197+struct efx_arfs_rule *efx_rps_hash_find(struct efx_nic *efx,
198+ const struct efx_filter_spec *spec);
199+
200+/* @new is written to indicate if entry was newly added (true) or if an old
201+ * entry was found and returned (false).
202+ */
203+struct efx_arfs_rule *efx_rps_hash_add(struct efx_nic *efx,
204+ const struct efx_filter_spec *spec,
205+ bool *new);
206+
207+void efx_rps_hash_del(struct efx_nic *efx, const struct efx_filter_spec *spec);
208+#endif
209+
189210 /* RSS contexts */
190211 struct efx_rss_context *efx_alloc_rss_context_entry(struct efx_nic *efx);
191212 struct efx_rss_context *efx_find_rss_context_entry(struct efx_nic *efx, u32 id);
drivers/net/ethernet/sfc/farch.c+34−7
@@ -2905,18 +2905,45 @@ bool efx_farch_filter_rfs_expire_one(struct efx_nic *efx, u32 flow_id, · 2904 unmodified lines
29052905 {
29062906 struct efx_farch_filter_state *state = efx->filter_state;
29072907 struct efx_farch_filter_table *table;
2908− bool ret = false;
2908+ bool ret = false, force = false;
2909+ u16 arfs_id;
29092910
29102911 down_write(&state->lock);
2912+ spin_lock_bh(&efx->rps_hash_lock);
29112913 table = &state->table[EFX_FARCH_FILTER_TABLE_RX_IP];
29122914 if (test_bit(index, table->used_bitmap) &&
2913− table->spec[index].priority == EFX_FILTER_PRI_HINT &&
2914− rps_may_expire_flow(efx->net_dev, table->spec[index].dmaq_id,
2915− flow_id, index)) {
2916− efx_farch_filter_table_clear_entry(efx, table, index);
2917− ret = true;
2915+ table->spec[index].priority == EFX_FILTER_PRI_HINT) {
2916+ struct efx_arfs_rule *rule = NULL;
2917+ struct efx_filter_spec spec;
2918+
2919+ efx_farch_filter_to_gen_spec(&spec, &table->spec[index]);
2920+ if (!efx->rps_hash_table) {
2921+ /* In the absence of the table, we always returned 0 to
2922+ * ARFS, so use the same to query it.
2923+ */
2924+ arfs_id = 0;
2925+ } else {
2926+ rule = efx_rps_hash_find(efx, &spec);
2927+ if (!rule) {
2928+ /* ARFS table doesn't know of this filter, remove it */
2929+ force = true;
2930+ } else {
2931+ arfs_id = rule->arfs_id;
2932+ if (!efx_rps_check_rule(rule, index, &force))
2933+ goto out_unlock;
2934+ }
2935+ }
2936+ if (force || rps_may_expire_flow(efx->net_dev, spec.dmaq_id,
2937+ flow_id, arfs_id)) {
2938+ if (rule)
2939+ rule->filter_id = EFX_ARFS_FILTER_ID_REMOVING;
2940+ efx_rps_hash_del(efx, &spec);
2941+ efx_farch_filter_table_clear_entry(efx, table, index);
2942+ ret = true;
2943+ }
29182944 }
2919−
2945+out_unlock:
2946+ spin_unlock_bh(&efx->rps_hash_lock);
29202947 up_write(&state->lock);
29212948 return ret;
29222949 }
drivers/net/ethernet/sfc/net_driver.h+61−0
@@ -733,6 +733,56 @@ struct efx_rss_context { · 732 unmodified lines
733733 u32 rx_indir_table[128];
734734 };
735735
736+#ifdef CONFIG_RFS_ACCEL
737+/* Order of these is important, since filter_id >= %EFX_ARFS_FILTER_ID_PENDING
738+ * is used to test if filter does or will exist.
739+ */
740+#define EFX_ARFS_FILTER_ID_PENDING -1
741+#define EFX_ARFS_FILTER_ID_ERROR -2
742+#define EFX_ARFS_FILTER_ID_REMOVING -3
743+/**
744+ * struct efx_arfs_rule - record of an ARFS filter and its IDs
745+ * @node: linkage into hash table
746+ * @spec: details of the filter (used as key for hash table). Use efx->type to
747+ * determine which member to use.
748+ * @rxq_index: channel to which the filter will steer traffic.
749+ * @arfs_id: filter ID which was returned to ARFS
750+ * @filter_id: index in software filter table. May be
751+ * %EFX_ARFS_FILTER_ID_PENDING if filter was not inserted yet,
752+ * %EFX_ARFS_FILTER_ID_ERROR if filter insertion failed, or
753+ * %EFX_ARFS_FILTER_ID_REMOVING if expiry is currently removing the filter.
754+ */
755+struct efx_arfs_rule {
756+ struct hlist_node node;
757+ struct efx_filter_spec spec;
758+ u16 rxq_index;
759+ u16 arfs_id;
760+ s32 filter_id;
761+};
762+
763+/* Size chosen so that the table is one page (4kB) */
764+#define EFX_ARFS_HASH_TABLE_SIZE 512
765+
766+/**
767+ * struct efx_async_filter_insertion - Request to asynchronously insert a filter
768+ * @net_dev: Reference to the netdevice
769+ * @spec: The filter to insert
770+ * @work: Workitem for this request
771+ * @rxq_index: Identifies the channel for which this request was made
772+ * @flow_id: Identifies the kernel-side flow for which this request was made
773+ */
774+struct efx_async_filter_insertion {
775+ struct net_device *net_dev;
776+ struct efx_filter_spec spec;
777+ struct work_struct work;
778+ u16 rxq_index;
779+ u32 flow_id;
780+};
781+
782+/* Maximum number of ARFS workitems that may be in flight on an efx_nic */
783+#define EFX_RPS_MAX_IN_FLIGHT 8
784+#endif /* CONFIG_RFS_ACCEL */
785+
736786 /**
737787 * struct efx_nic - an Efx NIC
738788 * @name: Device name (net device name or bus id before net device registered)
@@ -850,6 +900,12 @@ struct efx_rss_context { · 111 unmodified lines
850900 * @rps_expire_channel: Next channel to check for expiry
851901 * @rps_expire_index: Next index to check for expiry in
852902 * @rps_expire_channel's @rps_flow_id
903+ * @rps_slot_map: bitmap of in-flight entries in @rps_slot
904+ * @rps_slot: array of ARFS insertion requests for efx_filter_rfs_work()
905+ * @rps_hash_lock: Protects ARFS filter mapping state (@rps_hash_table and
906+ * @rps_next_id).
907+ * @rps_hash_table: Mapping between ARFS filters and their various IDs
908+ * @rps_next_id: next arfs_id for an ARFS filter
853909 * @active_queues: Count of RX and TX queues that haven't been flushed and drained.
854910 * @rxq_flush_pending: Count of number of receive queues that need to be flushed.
855911 * Decremented when the efx_flush_rx_queue() is called.
@@ -1004,6 +1060,11 @@ struct efx_nic { · 148 unmodified lines
10041060 struct mutex rps_mutex;
10051061 unsigned int rps_expire_channel;
10061062 unsigned int rps_expire_index;
1063+ unsigned long rps_slot_map;
1064+ struct efx_async_filter_insertion rps_slot[EFX_RPS_MAX_IN_FLIGHT];
1065+ spinlock_t rps_hash_lock;
1066+ struct hlist_head *rps_hash_table;
1067+ u32 rps_next_id;
10071068 #endif
10081069
10091070 atomic_t active_queues;
drivers/net/ethernet/sfc/rx.c+90−34
@@ -827,31 +827,38 @@ MODULE_PARM_DESC(rx_refill_threshold, · 826 unmodified lines
827827
828828 #ifdef CONFIG_RFS_ACCEL
829829
830−/**
831− * struct efx_async_filter_insertion - Request to asynchronously insert a filter
832− * @net_dev: Reference to the netdevice
833− * @spec: The filter to insert
834− * @work: Workitem for this request
835− * @rxq_index: Identifies the channel for which this request was made
836− * @flow_id: Identifies the kernel-side flow for which this request was made
837− */
838−struct efx_async_filter_insertion {
839− struct net_device *net_dev;
840− struct efx_filter_spec spec;
841− struct work_struct work;
842− u16 rxq_index;
843− u32 flow_id;
844−};
845−
846830 static void efx_filter_rfs_work(struct work_struct *data)
847831 {
848832 struct efx_async_filter_insertion *req = container_of(data, struct efx_async_filter_insertion,
849833 work);
850834 struct efx_nic *efx = netdev_priv(req->net_dev);
851835 struct efx_channel *channel = efx_get_channel(efx, req->rxq_index);
836+ int slot_idx = req - efx->rps_slot;
837+ struct efx_arfs_rule *rule;
838+ u16 arfs_id = 0;
852839 int rc;
853840
854− rc = efx->type->filter_insert(efx, &req->spec, false);
841+ rc = efx->type->filter_insert(efx, &req->spec, true);
842+ if (rc >= 0)
843+ rc %= efx->type->max_rx_ip_filters;
844+ if (efx->rps_hash_table) {
845+ spin_lock_bh(&efx->rps_hash_lock);
846+ rule = efx_rps_hash_find(efx, &req->spec);
847+ /* The rule might have already gone, if someone else's request
848+ * for the same spec was already worked and then expired before
849+ * we got around to our work. In that case we have nothing
850+ * tying us to an arfs_id, meaning that as soon as the filter
851+ * is considered for expiry it will be removed.
852+ */
853+ if (rule) {
854+ if (rc < 0)
855+ rule->filter_id = EFX_ARFS_FILTER_ID_ERROR;
856+ else
857+ rule->filter_id = rc;
858+ arfs_id = rule->arfs_id;
859+ }
860+ spin_unlock_bh(&efx->rps_hash_lock);
861+ }
855862 if (rc >= 0) {
856863 /* Remember this so we can check whether to expire the filter
857864 * later.
@@ -863,23 +870,23 @@ static void efx_filter_rfs_work(struct work_struct *data) · 5 unmodified lines
863870
864871 if (req->spec.ether_type == htons(ETH_P_IP))
865872 netif_info(efx, rx_status, efx->net_dev,
866− "steering %s %pI4:%u:%pI4:%u to queue %u [flow %u filter %d]\n",
873+ "steering %s %pI4:%u:%pI4:%u to queue %u [flow %u filter %d id %u]\n",
867874 (req->spec.ip_proto == IPPROTO_TCP) ? "TCP" : "UDP",
868875 req->spec.rem_host, ntohs(req->spec.rem_port),
869876 req->spec.loc_host, ntohs(req->spec.loc_port),
870− req->rxq_index, req->flow_id, rc);
877+ req->rxq_index, req->flow_id, rc, arfs_id);
871878 else
872879 netif_info(efx, rx_status, efx->net_dev,
873− "steering %s [%pI6]:%u:[%pI6]:%u to queue %u [flow %u filter %d]\n",
880+ "steering %s [%pI6]:%u:[%pI6]:%u to queue %u [flow %u filter %d id %u]\n",
874881 (req->spec.ip_proto == IPPROTO_TCP) ? "TCP" : "UDP",
875882 req->spec.rem_host, ntohs(req->spec.rem_port),
876883 req->spec.loc_host, ntohs(req->spec.loc_port),
877− req->rxq_index, req->flow_id, rc);
884+ req->rxq_index, req->flow_id, rc, arfs_id);
878885 }
879886
880887 /* Release references */
888+ clear_bit(slot_idx, &efx->rps_slot_map);
881889 dev_put(req->net_dev);
882− kfree(req);
883890 }
884891
885892 int efx_filter_rfs(struct net_device *net_dev, const struct sk_buff *skb,
@@ -887,23 +894,39 @@ int efx_filter_rfs(struct net_device *net_dev, const struct sk_buff *skb, · 1 unmodified line
887894 {
888895 struct efx_nic *efx = netdev_priv(net_dev);
889896 struct efx_async_filter_insertion *req;
897+ struct efx_arfs_rule *rule;
890898 struct flow_keys fk;
899+ int slot_idx;
900+ bool new;
901+ int rc;
891902
892− if (flow_id == RPS_FLOW_ID_INVALID)
893− return -EINVAL;
903+ /* find a free slot */
904+ for (slot_idx = 0; slot_idx < EFX_RPS_MAX_IN_FLIGHT; slot_idx++)
905+ if (!test_and_set_bit(slot_idx, &efx->rps_slot_map))
906+ break;
907+ if (slot_idx >= EFX_RPS_MAX_IN_FLIGHT)
908+ return -EBUSY;
894909
895− if (!skb_flow_dissect_flow_keys(skb, &fk, 0))
896− return -EPROTONOSUPPORT;
910+ if (flow_id == RPS_FLOW_ID_INVALID) {
911+ rc = -EINVAL;
912+ goto out_clear;
913+ }
897914
898− if (fk.basic.n_proto != htons(ETH_P_IP) && fk.basic.n_proto != htons(ETH_P_IPV6))
899− return -EPROTONOSUPPORT;
900− if (fk.control.flags & FLOW_DIS_IS_FRAGMENT)
901− return -EPROTONOSUPPORT;
915+ if (!skb_flow_dissect_flow_keys(skb, &fk, 0)) {
916+ rc = -EPROTONOSUPPORT;
917+ goto out_clear;
918+ }
902919
903− req = kmalloc(sizeof(*req), GFP_ATOMIC);
904− if (!req)
905− return -ENOMEM;
920+ if (fk.basic.n_proto != htons(ETH_P_IP) && fk.basic.n_proto != htons(ETH_P_IPV6)) {
921+ rc = -EPROTONOSUPPORT;
922+ goto out_clear;
923+ }
924+ if (fk.control.flags & FLOW_DIS_IS_FRAGMENT) {
925+ rc = -EPROTONOSUPPORT;
926+ goto out_clear;
927+ }
906928
929+ req = efx->rps_slot + slot_idx;
907930 efx_filter_init_rx(&req->spec, EFX_FILTER_PRI_HINT,
908931 efx->rx_scatter ? EFX_FILTER_FLAG_RX_SCATTER : 0,
909932 rxq_index);
@@ -927,12 +950,45 @@ int efx_filter_rfs(struct net_device *net_dev, const struct sk_buff *skb, · 17 unmodified lines
927950 req->spec.rem_port = fk.ports.src;
928951 req->spec.loc_port = fk.ports.dst;
929952
953+ if (efx->rps_hash_table) {
954+ /* Add it to ARFS hash table */
955+ spin_lock(&efx->rps_hash_lock);
956+ rule = efx_rps_hash_add(efx, &req->spec, &new);
957+ if (!rule) {
958+ rc = -ENOMEM;
959+ goto out_unlock;
960+ }
961+ if (new)
962+ rule->arfs_id = efx->rps_next_id++ % RPS_NO_FILTER;
963+ rc = rule->arfs_id;
964+ /* Skip if existing or pending filter already does the right thing */
965+ if (!new && rule->rxq_index == rxq_index &&
966+ rule->filter_id >= EFX_ARFS_FILTER_ID_PENDING)
967+ goto out_unlock;
968+ rule->rxq_index = rxq_index;
969+ rule->filter_id = EFX_ARFS_FILTER_ID_PENDING;
970+ spin_unlock(&efx->rps_hash_lock);
971+ } else {
972+ /* Without an ARFS hash table, we just use arfs_id 0 for all
973+ * filters. This means if multiple flows hash to the same
974+ * flow_id, all but the most recently touched will be eligible
975+ * for expiry.
976+ */
977+ rc = 0;
978+ }
979+
980+ /* Queue the request */
930981 dev_hold(req->net_dev = net_dev);
931982 INIT_WORK(&req->work, efx_filter_rfs_work);
932983 req->rxq_index = rxq_index;
933984 req->flow_id = flow_id;
934985 schedule_work(&req->work);
935− return 0;
986+ return rc;
987+out_unlock:
988+ spin_unlock(&efx->rps_hash_lock);
989+out_clear:
990+ clear_bit(slot_idx, &efx->rps_slot_map);
991+ return rc;
936992 }
937993
938994 bool __efx_filter_rfs_expire(struct efx_nic *efx, unsigned int quota)
drivers/net/ethernet/stmicro/stmmac/dwmac4.h+1−1
@@ -347,7 +347,7 @@ enum power_event { · 346 unmodified lines
347347 #define MTL_RX_OVERFLOW_INT BIT(16)
348348
349349 /* Default operating mode of the MAC */
350−#define GMAC_CORE_INIT (GMAC_CONFIG_JD | GMAC_CONFIG_PS | GMAC_CONFIG_ACS | \
350+#define GMAC_CORE_INIT (GMAC_CONFIG_JD | GMAC_CONFIG_PS | \
351351 GMAC_CONFIG_BE | GMAC_CONFIG_DCRS)
352352
353353 /* To dump the core regs excluding the Address Registers */
drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c+0−7
@@ -31,13 +31,6 @@ static void dwmac4_core_init(struct mac_device_info *hw, · 30 unmodified lines
3131
3232 value |= GMAC_CORE_INIT;
3333
34− /* Clear ACS bit because Ethernet switch tagging formats such as
35− * Broadcom tags can look like invalid LLC/SNAP packets and cause the
36− * hardware to truncate packets on reception.
37− */
38− if (netdev_uses_dsa(dev))
39− value &= ~GMAC_CONFIG_ACS;
40−
4134 if (mtu > 1500)
4235 value |= GMAC_CONFIG_2K;
4336 if (mtu > 2000)
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c+6−1
@@ -3495,8 +3495,13 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue) · 3494 unmodified lines
34953495
34963496 /* ACS is set; GMAC core strips PAD/FCS for IEEE 802.3
34973497 * Type frames (LLC/LLC-SNAP)
3498+ *
3499+ * llc_snap is never checked in GMAC >= 4, so this ACS
3500+ * feature is always disabled and packets need to be
3501+ * stripped manually.
34983502 */
3499− if (unlikely(status != llc_snap))
3503+ if (unlikely(priv->synopsys_id >= DWMAC_CORE_4_00) ||
3504+ unlikely(status != llc_snap))
35003505 frame_len -= ETH_FCS_LEN;
35013506
35023507 if (netif_msg_rx_status(priv)) {
drivers/net/ethernet/ti/cpsw.c+3−1
@@ -129,7 +129,7 @@ do { \ · 128 unmodified lines
129129
130130 #define RX_PRIORITY_MAPPING 0x76543210
131131 #define TX_PRIORITY_MAPPING 0x33221100
132−#define CPDMA_TX_PRIORITY_MAP 0x01234567
132+#define CPDMA_TX_PRIORITY_MAP 0x76543210
133133
134134 #define CPSW_VLAN_AWARE BIT(1)
135135 #define CPSW_RX_VLAN_ENCAP BIT(2)
@@ -1340,6 +1340,8 @@ static inline void cpsw_add_dual_emac_def_ale_entries( · 1204 unmodified lines
13401340 cpsw_ale_add_ucast(cpsw->ale, priv->mac_addr,
13411341 HOST_PORT_NUM, ALE_VLAN |
13421342 ALE_SECURE, slave->port_vlan);
1343+ cpsw_ale_control_set(cpsw->ale, slave_port,
1344+ ALE_PORT_DROP_UNKNOWN_VLAN, 1);
13431345 }
13441346
13451347 static void soft_reset_slave(struct cpsw_slave *slave)
drivers/net/macsec.c+2−3
@@ -3277,7 +3277,7 @@ static int macsec_newlink(struct net *net, struct net_device *dev, · 3276 unmodified lines
32773277
32783278 err = netdev_upper_dev_link(real_dev, dev, extack);
32793279 if (err < 0)
3280− goto put_dev;
3280+ goto unregister;
32813281
32823282 /* need to be already registered so that ->init has run and
32833283 * the MAC addr is set
@@ -3316,8 +3316,7 @@ del_dev: · 32 unmodified lines
33163316 macsec_del_dev(macsec);
33173317 unlink:
33183318 netdev_upper_dev_unlink(real_dev, dev);
3319−put_dev:
3320− dev_put(real_dev);
3319+unregister:
33213320 unregister_netdevice(dev);
33223321 return err;
33233322 }
drivers/net/phy/marvell.c+9−0
@@ -1393,6 +1393,15 @@ static int m88e1318_set_wol(struct phy_device *phydev, · 1392 unmodified lines
13931393 if (err < 0)
13941394 goto error;
13951395
1396+ /* If WOL event happened once, the LED[2] interrupt pin
1397+ * will not be cleared unless we reading the interrupt status
1398+ * register. If interrupts are in use, the normal interrupt
1399+ * handling will clear the WOL event. Clear the WOL event
1400+ * before enabling it if !phy_interrupt_is_valid()
1401+ */
1402+ if (!phy_interrupt_is_valid(phydev))
1403+ phy_read(phydev, MII_M1011_IEVENT);
1404+
13961405 /* Enable the WOL interrupt */
13971406 err = __phy_modify(phydev, MII_88E1318S_PHY_CSIER, 0,
13981407 MII_88E1318S_PHY_CSIER_WOL_EIE);
drivers/net/phy/microchip.c+177−1
@@ -20,6 +20,7 @@ · 19 unmodified lines
2020 #include <linux/ethtool.h>
2121 #include <linux/phy.h>
2222 #include <linux/microchipphy.h>
23+#include <linux/delay.h>
2324
2425 #define DRIVER_AUTHOR "WOOJUNG HUH <woojung.huh@microchip.com>"
2526 #define DRIVER_DESC "Microchip LAN88XX PHY driver"
@@ -30,6 +31,16 @@ struct lan88xx_priv { · 4 unmodified lines
3031 __u32 wolopts;
3132 };
3233
34+static int lan88xx_read_page(struct phy_device *phydev)
35+{
36+ return __phy_read(phydev, LAN88XX_EXT_PAGE_ACCESS);
37+}
38+
39+static int lan88xx_write_page(struct phy_device *phydev, int page)
40+{
41+ return __phy_write(phydev, LAN88XX_EXT_PAGE_ACCESS, page);
42+}
43+
3344 static int lan88xx_phy_config_intr(struct phy_device *phydev)
3445 {
3546 int rc;
@@ -66,6 +77,150 @@ static int lan88xx_suspend(struct phy_device *phydev) · 30 unmodified lines
6677 return 0;
6778 }
6879
80+static int lan88xx_TR_reg_set(struct phy_device *phydev, u16 regaddr,
81+ u32 data)
82+{
83+ int val, save_page, ret = 0;
84+ u16 buf;
85+
86+ /* Save current page */
87+ save_page = phy_save_page(phydev);
88+ if (save_page < 0) {
89+ pr_warn("Failed to get current page\n");
90+ goto err;
91+ }
92+
93+ /* Switch to TR page */
94+ lan88xx_write_page(phydev, LAN88XX_EXT_PAGE_ACCESS_TR);
95+
96+ ret = __phy_write(phydev, LAN88XX_EXT_PAGE_TR_LOW_DATA,
97+ (data & 0xFFFF));
98+ if (ret < 0) {
99+ pr_warn("Failed to write TR low data\n");
100+ goto err;
101+ }
102+
103+ ret = __phy_write(phydev, LAN88XX_EXT_PAGE_TR_HIGH_DATA,
104+ (data & 0x00FF0000) >> 16);
105+ if (ret < 0) {
106+ pr_warn("Failed to write TR high data\n");
107+ goto err;
108+ }
109+
110+ /* Config control bits [15:13] of register */
111+ buf = (regaddr & ~(0x3 << 13));/* Clr [14:13] to write data in reg */
112+ buf |= 0x8000; /* Set [15] to Packet transmit */
113+
114+ ret = __phy_write(phydev, LAN88XX_EXT_PAGE_TR_CR, buf);
115+ if (ret < 0) {
116+ pr_warn("Failed to write data in reg\n");
117+ goto err;
118+ }
119+
120+ usleep_range(1000, 2000);/* Wait for Data to be written */
121+ val = __phy_read(phydev, LAN88XX_EXT_PAGE_TR_CR);
122+ if (!(val & 0x8000))
123+ pr_warn("TR Register[0x%X] configuration failed\n", regaddr);
124+err:
125+ return phy_restore_page(phydev, save_page, ret);
126+}
127+
128+static void lan88xx_config_TR_regs(struct phy_device *phydev)
129+{
130+ int err;
131+
132+ /* Get access to Channel 0x1, Node 0xF , Register 0x01.
133+ * Write 24-bit value 0x12B00A to register. Setting MrvlTrFix1000Kf,
134+ * MrvlTrFix1000Kp, MasterEnableTR bits.
135+ */
136+ err = lan88xx_TR_reg_set(phydev, 0x0F82, 0x12B00A);
137+ if (err < 0)
138+ pr_warn("Failed to Set Register[0x0F82]\n");
139+
140+ /* Get access to Channel b'10, Node b'1101, Register 0x06.
141+ * Write 24-bit value 0xD2C46F to register. Setting SSTrKf1000Slv,
142+ * SSTrKp1000Mas bits.
143+ */
144+ err = lan88xx_TR_reg_set(phydev, 0x168C, 0xD2C46F);
145+ if (err < 0)
146+ pr_warn("Failed to Set Register[0x168C]\n");
147+
148+ /* Get access to Channel b'10, Node b'1111, Register 0x11.
149+ * Write 24-bit value 0x620 to register. Setting rem_upd_done_thresh
150+ * bits
151+ */
152+ err = lan88xx_TR_reg_set(phydev, 0x17A2, 0x620);
153+ if (err < 0)
154+ pr_warn("Failed to Set Register[0x17A2]\n");
155+
156+ /* Get access to Channel b'10, Node b'1101, Register 0x10.
157+ * Write 24-bit value 0xEEFFDD to register. Setting
158+ * eee_TrKp1Long_1000, eee_TrKp2Long_1000, eee_TrKp3Long_1000,
159+ * eee_TrKp1Short_1000,eee_TrKp2Short_1000, eee_TrKp3Short_1000 bits.
160+ */
161+ err = lan88xx_TR_reg_set(phydev, 0x16A0, 0xEEFFDD);
162+ if (err < 0)
163+ pr_warn("Failed to Set Register[0x16A0]\n");
164+
165+ /* Get access to Channel b'10, Node b'1101, Register 0x13.
166+ * Write 24-bit value 0x071448 to register. Setting
167+ * slv_lpi_tr_tmr_val1, slv_lpi_tr_tmr_val2 bits.
168+ */
169+ err = lan88xx_TR_reg_set(phydev, 0x16A6, 0x071448);
170+ if (err < 0)
171+ pr_warn("Failed to Set Register[0x16A6]\n");
172+
173+ /* Get access to Channel b'10, Node b'1101, Register 0x12.
174+ * Write 24-bit value 0x13132F to register. Setting
175+ * slv_sigdet_timer_val1, slv_sigdet_timer_val2 bits.
176+ */
177+ err = lan88xx_TR_reg_set(phydev, 0x16A4, 0x13132F);
178+ if (err < 0)
179+ pr_warn("Failed to Set Register[0x16A4]\n");
180+
181+ /* Get access to Channel b'10, Node b'1101, Register 0x14.
182+ * Write 24-bit value 0x0 to register. Setting eee_3level_delay,
183+ * eee_TrKf_freeze_delay bits.
184+ */
185+ err = lan88xx_TR_reg_set(phydev, 0x16A8, 0x0);
186+ if (err < 0)
187+ pr_warn("Failed to Set Register[0x16A8]\n");
188+
189+ /* Get access to Channel b'01, Node b'1111, Register 0x34.
190+ * Write 24-bit value 0x91B06C to register. Setting
191+ * FastMseSearchThreshLong1000, FastMseSearchThreshShort1000,
192+ * FastMseSearchUpdGain1000 bits.
193+ */
194+ err = lan88xx_TR_reg_set(phydev, 0x0FE8, 0x91B06C);
195+ if (err < 0)
196+ pr_warn("Failed to Set Register[0x0FE8]\n");
197+
198+ /* Get access to Channel b'01, Node b'1111, Register 0x3E.
199+ * Write 24-bit value 0xC0A028 to register. Setting
200+ * FastMseKp2ThreshLong1000, FastMseKp2ThreshShort1000,
201+ * FastMseKp2UpdGain1000, FastMseKp2ExitEn1000 bits.
202+ */
203+ err = lan88xx_TR_reg_set(phydev, 0x0FFC, 0xC0A028);
204+ if (err < 0)
205+ pr_warn("Failed to Set Register[0x0FFC]\n");
206+
207+ /* Get access to Channel b'01, Node b'1111, Register 0x35.
208+ * Write 24-bit value 0x041600 to register. Setting
209+ * FastMseSearchPhShNum1000, FastMseSearchClksPerPh1000,
210+ * FastMsePhChangeDelay1000 bits.
211+ */
212+ err = lan88xx_TR_reg_set(phydev, 0x0FEA, 0x041600);
213+ if (err < 0)
214+ pr_warn("Failed to Set Register[0x0FEA]\n");
215+
216+ /* Get access to Channel b'10, Node b'1101, Register 0x03.
217+ * Write 24-bit value 0x000004 to register. Setting TrFreeze bits.
218+ */
219+ err = lan88xx_TR_reg_set(phydev, 0x1686, 0x000004);
220+ if (err < 0)
221+ pr_warn("Failed to Set Register[0x1686]\n");
222+}
223+
69224 static int lan88xx_probe(struct phy_device *phydev)
70225 {
71226 struct device *dev = &phydev->mdio.dev;
@@ -132,6 +287,25 @@ static void lan88xx_set_mdix(struct phy_device *phydev) · 60 unmodified lines
132287 phy_write(phydev, LAN88XX_EXT_PAGE_ACCESS, LAN88XX_EXT_PAGE_SPACE_0);
133288 }
134289
290+static int lan88xx_config_init(struct phy_device *phydev)
291+{
292+ int val;
293+
294+ genphy_config_init(phydev);
295+ /*Zerodetect delay enable */
296+ val = phy_read_mmd(phydev, MDIO_MMD_PCS,
297+ PHY_ARDENNES_MMD_DEV_3_PHY_CFG);
298+ val |= PHY_ARDENNES_MMD_DEV_3_PHY_CFG_ZD_DLY_EN_;
299+
300+ phy_write_mmd(phydev, MDIO_MMD_PCS, PHY_ARDENNES_MMD_DEV_3_PHY_CFG,
301+ val);
302+
303+ /* Config DSP registers */
304+ lan88xx_config_TR_regs(phydev);
305+
306+ return 0;
307+}
308+
135309 static int lan88xx_config_aneg(struct phy_device *phydev)
136310 {
137311 lan88xx_set_mdix(phydev);
@@ -151,7 +325,7 @@ static struct phy_driver microchip_phy_driver[] = { · 13 unmodified lines
151325 .probe = lan88xx_probe,
152326 .remove = lan88xx_remove,
153327
154− .config_init = genphy_config_init,
328+ .config_init = lan88xx_config_init,
155329 .config_aneg = lan88xx_config_aneg,
156330
157331 .ack_interrupt = lan88xx_phy_ack_interrupt,
@@ -160,6 +334,8 @@ static struct phy_driver microchip_phy_driver[] = { · 2 unmodified lines
160334 .suspend = lan88xx_suspend,
161335 .resume = genphy_resume,
162336 .set_wol = lan88xx_set_wol,
337+ .read_page = lan88xx_read_page,
338+ .write_page = lan88xx_write_page,
163339 } };
164340
165341 module_phy_driver(microchip_phy_driver);
drivers/net/phy/phy_device.c+10−1
@@ -535,8 +535,17 @@ static int get_phy_id(struct mii_bus *bus, int addr, u32 *phy_id, · 534 unmodified lines
535535
536536 /* Grab the bits from PHYIR1, and put them in the upper half */
537537 phy_reg = mdiobus_read(bus, addr, MII_PHYSID1);
538− if (phy_reg < 0)
538+ if (phy_reg < 0) {
539+ /* if there is no device, return without an error so scanning
540+ * the bus works properly
541+ */
542+ if (phy_reg == -EIO || phy_reg == -ENODEV) {
543+ *phy_id = 0xffffffff;
544+ return 0;
545+ }
546+
539547 return -EIO;
548+ }
540549
541550 *phy_id = (phy_reg & 0xffff) << 16;
542551
drivers/net/ppp/pppoe.c+4−0
@@ -620,6 +620,10 @@ static int pppoe_connect(struct socket *sock, struct sockaddr *uservaddr, · 619 unmodified lines
620620 lock_sock(sk);
621621
622622 error = -EINVAL;
623+
624+ if (sockaddr_len != sizeof(struct sockaddr_pppox))
625+ goto end;
626+
623627 if (sp->sa_protocol != PX_PROTO_OE)
624628 goto end;
625629
drivers/net/team/team.c+31−7
@@ -261,6 +261,17 @@ static void __team_option_inst_mark_removed_port(struct team *team, · 260 unmodified lines
261261 }
262262 }
263263
264+static bool __team_option_inst_tmp_find(const struct list_head *opts,
265+ const struct team_option_inst *needle)
266+{
267+ struct team_option_inst *opt_inst;
268+
269+ list_for_each_entry(opt_inst, opts, tmp_list)
270+ if (opt_inst == needle)
271+ return true;
272+ return false;
273+}
274+
264275 static int __team_options_register(struct team *team,
265276 const struct team_option *option,
266277 size_t option_count)
@@ -1061,14 +1072,11 @@ static void team_port_leave(struct team *team, struct team_port *port) · 794 unmodified lines
10611072 }
10621073
10631074 #ifdef CONFIG_NET_POLL_CONTROLLER
1064−static int team_port_enable_netpoll(struct team *team, struct team_port *port)
1075+static int __team_port_enable_netpoll(struct team_port *port)
10651076 {
10661077 struct netpoll *np;
10671078 int err;
10681079
1069− if (!team->dev->npinfo)
1070− return 0;
1071−
10721080 np = kzalloc(sizeof(*np), GFP_KERNEL);
10731081 if (!np)
10741082 return -ENOMEM;
@@ -1082,6 +1090,14 @@ static int team_port_enable_netpoll(struct team *team, struct team_port *port) · 7 unmodified lines
10821090 return err;
10831091 }
10841092
1093+static int team_port_enable_netpoll(struct team_port *port)
1094+{
1095+ if (!port->team->dev->npinfo)
1096+ return 0;
1097+
1098+ return __team_port_enable_netpoll(port);
1099+}
1100+
10851101 static void team_port_disable_netpoll(struct team_port *port)
10861102 {
10871103 struct netpoll *np = port->np;
@@ -1096,7 +1112,7 @@ static void team_port_disable_netpoll(struct team_port *port) · 8 unmodified lines
10961112 kfree(np);
10971113 }
10981114 #else
1099−static int team_port_enable_netpoll(struct team *team, struct team_port *port)
1115+static int team_port_enable_netpoll(struct team_port *port)
11001116 {
11011117 return 0;
11021118 }
@@ -1210,7 +1226,7 @@ static int team_port_add(struct team *team, struct net_device *port_dev, · 107 unmodified lines
12101226 goto err_vids_add;
12111227 }
12121228
1213− err = team_port_enable_netpoll(team, port);
1229+ err = team_port_enable_netpoll(port);
12141230 if (err) {
12151231 netdev_err(dev, "Failed to enable netpoll on device %s\n",
12161232 portname);
@@ -1907,7 +1923,7 @@ static int team_netpoll_setup(struct net_device *dev, · 690 unmodified lines
19071923
19081924 mutex_lock(&team->lock);
19091925 list_for_each_entry(port, &team->port_list, list) {
1910− err = team_port_enable_netpoll(team, port);
1926+ err = __team_port_enable_netpoll(port);
19111927 if (err) {
19121928 __team_netpoll_cleanup(team);
19131929 break;
@@ -2568,6 +2584,14 @@ static int team_nl_cmd_options_set(struct sk_buff *skb, struct genl_info *info) · 654 unmodified lines
25682584 if (err)
25692585 goto team_put;
25702586 opt_inst->changed = true;
2587+
2588+ /* dumb/evil user-space can send us duplicate opt,
2589+ * keep only the last one
2590+ */
2591+ if (__team_option_inst_tmp_find(&opt_inst_list,
2592+ opt_inst))
2593+ continue;
2594+
25712595 list_add(&opt_inst->tmp_list, &opt_inst_list);
25722596 }
25732597 if (!opt_found) {
drivers/net/tun.c+1−6
@@ -1102,12 +1102,7 @@ static netdev_tx_t tun_net_xmit(struct sk_buff *skb, struct net_device *dev) · 1101 unmodified lines
11021102 goto drop;
11031103
11041104 len = run_ebpf_filter(tun, skb, len);
1105−
1106− /* Trim extra bytes since we may insert vlan proto & TCI
1107− * in tun_put_user().
1108− */
1109− len -= skb_vlan_tag_present(skb) ? sizeof(struct veth) : 0;
1110− if (len <= 0 || pskb_trim(skb, len))
1105+ if (len == 0 || pskb_trim(skb, len))
11111106 goto drop;
11121107
11131108 if (unlikely(skb_orphan_frags_rx(skb, GFP_ATOMIC)))
drivers/net/usb/qmi_wwan.c+14−0
@@ -1098,6 +1098,7 @@ static const struct usb_device_id products[] = { · 1097 unmodified lines
10981098 {QMI_FIXED_INTF(0x05c6, 0x9080, 8)},
10991099 {QMI_FIXED_INTF(0x05c6, 0x9083, 3)},
11001100 {QMI_FIXED_INTF(0x05c6, 0x9084, 4)},
1101+ {QMI_FIXED_INTF(0x05c6, 0x90b2, 3)}, /* ublox R410M */
11011102 {QMI_FIXED_INTF(0x05c6, 0x920d, 0)},
11021103 {QMI_FIXED_INTF(0x05c6, 0x920d, 5)},
11031104 {QMI_QUIRK_SET_DTR(0x05c6, 0x9625, 4)}, /* YUGA CLM920-NC5 */
@@ -1107,6 +1108,7 @@ static const struct usb_device_id products[] = { · 3 unmodified lines
11071108 {QMI_FIXED_INTF(0x1435, 0xd181, 3)}, /* Wistron NeWeb D18Q1 */
11081109 {QMI_FIXED_INTF(0x1435, 0xd181, 4)}, /* Wistron NeWeb D18Q1 */
11091110 {QMI_FIXED_INTF(0x1435, 0xd181, 5)}, /* Wistron NeWeb D18Q1 */
1111+ {QMI_FIXED_INTF(0x1435, 0xd191, 4)}, /* Wistron NeWeb D19Q1 */
11101112 {QMI_FIXED_INTF(0x16d8, 0x6003, 0)}, /* CMOTech 6003 */
11111113 {QMI_FIXED_INTF(0x16d8, 0x6007, 0)}, /* CMOTech CHE-628S */
11121114 {QMI_FIXED_INTF(0x16d8, 0x6008, 0)}, /* CMOTech CMU-301 */
@@ -1342,6 +1344,18 @@ static int qmi_wwan_probe(struct usb_interface *intf, · 229 unmodified lines
13421344 id->driver_info = (unsigned long)&qmi_wwan_info;
13431345 }
13441346
1347+ /* There are devices where the same interface number can be
1348+ * configured as different functions. We should only bind to
1349+ * vendor specific functions when matching on interface number
1350+ */
1351+ if (id->match_flags & USB_DEVICE_ID_MATCH_INT_NUMBER &&
1352+ desc->bInterfaceClass != USB_CLASS_VENDOR_SPEC) {
1353+ dev_dbg(&intf->dev,
1354+ "Rejecting interface number match for class %02x\n",
1355+ desc->bInterfaceClass);
1356+ return -ENODEV;
1357+ }
1358+
13451359 /* Quectel EC20 quirk where we've QMI on interface 4 instead of 0 */
13461360 if (quectel_ec20_detected(intf) && desc->bInterfaceNumber == 0) {
13471361 dev_dbg(&intf->dev, "Quectel EC20 quirk, skipping interface 0\n");
drivers/net/virtio_net.c+48−31
@@ -147,6 +147,17 @@ struct receive_queue { · 146 unmodified lines
147147 struct xdp_rxq_info xdp_rxq;
148148 };
149149
150+/* Control VQ buffers: protected by the rtnl lock */
151+struct control_buf {
152+ struct virtio_net_ctrl_hdr hdr;
153+ virtio_net_ctrl_ack status;
154+ struct virtio_net_ctrl_mq mq;
155+ u8 promisc;
156+ u8 allmulti;
157+ __virtio16 vid;
158+ __virtio64 offloads;
159+};
160+
150161 struct virtnet_info {
151162 struct virtio_device *vdev;
152163 struct virtqueue *cvq;
@@ -192,14 +203,7 @@ struct virtnet_info { · 39 unmodified lines
192203 struct hlist_node node;
193204 struct hlist_node node_dead;
194205
195− /* Control VQ buffers: protected by the rtnl lock */
196− struct virtio_net_ctrl_hdr ctrl_hdr;
197− virtio_net_ctrl_ack ctrl_status;
198− struct virtio_net_ctrl_mq ctrl_mq;
199− u8 ctrl_promisc;
200− u8 ctrl_allmulti;
201− u16 ctrl_vid;
202− u64 ctrl_offloads;
206+ struct control_buf *ctrl;
203207
204208 /* Ethtool settings */
205209 u8 duplex;
@@ -1269,7 +1273,9 @@ static int virtnet_poll(struct napi_struct *napi, int budget) · 1063 unmodified lines
12691273 {
12701274 struct receive_queue *rq =
12711275 container_of(napi, struct receive_queue, napi);
1272− unsigned int received;
1276+ struct virtnet_info *vi = rq->vq->vdev->priv;
1277+ struct send_queue *sq;
1278+ unsigned int received, qp;
12731279 bool xdp_xmit = false;
12741280
12751281 virtnet_poll_cleantx(rq);
@@ -1280,8 +1286,13 @@ static int virtnet_poll(struct napi_struct *napi, int budget) · 4 unmodified lines
12801286 if (received < budget)
12811287 virtqueue_napi_complete(napi, rq->vq, received);
12821288
1283− if (xdp_xmit)
1289+ if (xdp_xmit) {
1290+ qp = vi->curr_queue_pairs - vi->xdp_queue_pairs +
1291+ smp_processor_id();
1292+ sq = &vi->sq[qp];
1293+ virtqueue_kick(sq->vq);
12841294 xdp_do_flush_map();
1295+ }
12851296
12861297 return received;
12871298 }
@@ -1454,25 +1465,25 @@ static bool virtnet_send_command(struct virtnet_info *vi, u8 class, u8 cmd, · 166 unmodified lines
14541465 /* Caller should know better */
14551466 BUG_ON(!virtio_has_feature(vi->vdev, VIRTIO_NET_F_CTRL_VQ));
14561467
1457− vi->ctrl_status = ~0;
1458− vi->ctrl_hdr.class = class;
1459− vi->ctrl_hdr.cmd = cmd;
1468+ vi->ctrl->status = ~0;
1469+ vi->ctrl->hdr.class = class;
1470+ vi->ctrl->hdr.cmd = cmd;
14601471 /* Add header */
1461− sg_init_one(&hdr, &vi->ctrl_hdr, sizeof(vi->ctrl_hdr));
1472+ sg_init_one(&hdr, &vi->ctrl->hdr, sizeof(vi->ctrl->hdr));
14621473 sgs[out_num++] = &hdr;
14631474
14641475 if (out)
14651476 sgs[out_num++] = out;
14661477
14671478 /* Add return status. */
1468− sg_init_one(&stat, &vi->ctrl_status, sizeof(vi->ctrl_status));
1479+ sg_init_one(&stat, &vi->ctrl->status, sizeof(vi->ctrl->status));
14691480 sgs[out_num] = &stat;
14701481
14711482 BUG_ON(out_num + 1 > ARRAY_SIZE(sgs));
14721483 virtqueue_add_sgs(vi->cvq, sgs, out_num, 1, vi, GFP_ATOMIC);
14731484
14741485 if (unlikely(!virtqueue_kick(vi->cvq)))
1475− return vi->ctrl_status == VIRTIO_NET_OK;
1486+ return vi->ctrl->status == VIRTIO_NET_OK;
14761487
14771488 /* Spin for a response, the kick causes an ioport write, trapping
14781489 * into the hypervisor, so the request should be handled immediately.
@@ -1481,7 +1492,7 @@ static bool virtnet_send_command(struct virtnet_info *vi, u8 class, u8 cmd, · 2 unmodified lines
14811492 !virtqueue_is_broken(vi->cvq))
14821493 cpu_relax();
14831494
1484− return vi->ctrl_status == VIRTIO_NET_OK;
1495+ return vi->ctrl->status == VIRTIO_NET_OK;
14851496 }
14861497
14871498 static int virtnet_set_mac_address(struct net_device *dev, void *p)
@@ -1593,8 +1604,8 @@ static int _virtnet_set_queues(struct virtnet_info *vi, u16 queue_pairs) · 105 unmodified lines
15931604 if (!vi->has_cvq || !virtio_has_feature(vi->vdev, VIRTIO_NET_F_MQ))
15941605 return 0;
15951606
1596− vi->ctrl_mq.virtqueue_pairs = cpu_to_virtio16(vi->vdev, queue_pairs);
1597− sg_init_one(&sg, &vi->ctrl_mq, sizeof(vi->ctrl_mq));
1607+ vi->ctrl->mq.virtqueue_pairs = cpu_to_virtio16(vi->vdev, queue_pairs);
1608+ sg_init_one(&sg, &vi->ctrl->mq, sizeof(vi->ctrl->mq));
15981609
15991610 if (!virtnet_send_command(vi, VIRTIO_NET_CTRL_MQ,
16001611 VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET, &sg)) {
@@ -1653,22 +1664,22 @@ static void virtnet_set_rx_mode(struct net_device *dev) · 52 unmodified lines
16531664 if (!virtio_has_feature(vi->vdev, VIRTIO_NET_F_CTRL_RX))
16541665 return;
16551666
1656− vi->ctrl_promisc = ((dev->flags & IFF_PROMISC) != 0);
1657− vi->ctrl_allmulti = ((dev->flags & IFF_ALLMULTI) != 0);
1667+ vi->ctrl->promisc = ((dev->flags & IFF_PROMISC) != 0);
1668+ vi->ctrl->allmulti = ((dev->flags & IFF_ALLMULTI) != 0);
16581669
1659− sg_init_one(sg, &vi->ctrl_promisc, sizeof(vi->ctrl_promisc));
1670+ sg_init_one(sg, &vi->ctrl->promisc, sizeof(vi->ctrl->promisc));
16601671
16611672 if (!virtnet_send_command(vi, VIRTIO_NET_CTRL_RX,
16621673 VIRTIO_NET_CTRL_RX_PROMISC, sg))
16631674 dev_warn(&dev->dev, "Failed to %sable promisc mode.\n",
1664− vi->ctrl_promisc ? "en" : "dis");
1675+ vi->ctrl->promisc ? "en" : "dis");
16651676
1666− sg_init_one(sg, &vi->ctrl_allmulti, sizeof(vi->ctrl_allmulti));
1677+ sg_init_one(sg, &vi->ctrl->allmulti, sizeof(vi->ctrl->allmulti));
16671678
16681679 if (!virtnet_send_command(vi, VIRTIO_NET_CTRL_RX,
16691680 VIRTIO_NET_CTRL_RX_ALLMULTI, sg))
16701681 dev_warn(&dev->dev, "Failed to %sable allmulti mode.\n",
1671− vi->ctrl_allmulti ? "en" : "dis");
1682+ vi->ctrl->allmulti ? "en" : "dis");
16721683
16731684 uc_count = netdev_uc_count(dev);
16741685 mc_count = netdev_mc_count(dev);
@@ -1714,8 +1725,8 @@ static int virtnet_vlan_rx_add_vid(struct net_device *dev, · 39 unmodified lines
17141725 struct virtnet_info *vi = netdev_priv(dev);
17151726 struct scatterlist sg;
17161727
1717− vi->ctrl_vid = vid;
1718− sg_init_one(&sg, &vi->ctrl_vid, sizeof(vi->ctrl_vid));
1728+ vi->ctrl->vid = cpu_to_virtio16(vi->vdev, vid);
1729+ sg_init_one(&sg, &vi->ctrl->vid, sizeof(vi->ctrl->vid));
17191730
17201731 if (!virtnet_send_command(vi, VIRTIO_NET_CTRL_VLAN,
17211732 VIRTIO_NET_CTRL_VLAN_ADD, &sg))
@@ -1729,8 +1740,8 @@ static int virtnet_vlan_rx_kill_vid(struct net_device *dev, · 7 unmodified lines
17291740 struct virtnet_info *vi = netdev_priv(dev);
17301741 struct scatterlist sg;
17311742
1732− vi->ctrl_vid = vid;
1733− sg_init_one(&sg, &vi->ctrl_vid, sizeof(vi->ctrl_vid));
1743+ vi->ctrl->vid = cpu_to_virtio16(vi->vdev, vid);
1744+ sg_init_one(&sg, &vi->ctrl->vid, sizeof(vi->ctrl->vid));
17341745
17351746 if (!virtnet_send_command(vi, VIRTIO_NET_CTRL_VLAN,
17361747 VIRTIO_NET_CTRL_VLAN_DEL, &sg))
@@ -2126,9 +2137,9 @@ static int virtnet_restore_up(struct virtio_device *vdev) · 389 unmodified lines
21262137 static int virtnet_set_guest_offloads(struct virtnet_info *vi, u64 offloads)
21272138 {
21282139 struct scatterlist sg;
2129− vi->ctrl_offloads = cpu_to_virtio64(vi->vdev, offloads);
2140+ vi->ctrl->offloads = cpu_to_virtio64(vi->vdev, offloads);
21302141
2131− sg_init_one(&sg, &vi->ctrl_offloads, sizeof(vi->ctrl_offloads));
2142+ sg_init_one(&sg, &vi->ctrl->offloads, sizeof(vi->ctrl->offloads));
21322143
21332144 if (!virtnet_send_command(vi, VIRTIO_NET_CTRL_GUEST_OFFLOADS,
21342145 VIRTIO_NET_CTRL_GUEST_OFFLOADS_SET, &sg)) {
@@ -2351,6 +2362,7 @@ static void virtnet_free_queues(struct virtnet_info *vi) · 216 unmodified lines
23512362
23522363 kfree(vi->rq);
23532364 kfree(vi->sq);
2365+ kfree(vi->ctrl);
23542366 }
23552367
23562368 static void _free_receive_bufs(struct virtnet_info *vi)
@@ -2543,6 +2555,9 @@ static int virtnet_alloc_queues(struct virtnet_info *vi) · 186 unmodified lines
25432555 {
25442556 int i;
25452557
2558+ vi->ctrl = kzalloc(sizeof(*vi->ctrl), GFP_KERNEL);
2559+ if (!vi->ctrl)
2560+ goto err_ctrl;
25462561 vi->sq = kzalloc(sizeof(*vi->sq) * vi->max_queue_pairs, GFP_KERNEL);
25472562 if (!vi->sq)
25482563 goto err_sq;
@@ -2571,6 +2586,8 @@ static int virtnet_alloc_queues(struct virtnet_info *vi) · 22 unmodified lines
25712586 err_rq:
25722587 kfree(vi->sq);
25732588 err_sq:
2589+ kfree(vi->ctrl);
2590+err_ctrl:
25742591 return -ENOMEM;
25752592 }
25762593
drivers/net/vmxnet3/vmxnet3_drv.c+13−4
@@ -1218,6 +1218,7 @@ vmxnet3_get_hdr_len(struct vmxnet3_adapter *adapter, struct sk_buff *skb, · 1217 unmodified lines
12181218 union {
12191219 void *ptr;
12201220 struct ethhdr *eth;
1221+ struct vlan_ethhdr *veth;
12211222 struct iphdr *ipv4;
12221223 struct ipv6hdr *ipv6;
12231224 struct tcphdr *tcp;
@@ -1228,16 +1229,24 @@ vmxnet3_get_hdr_len(struct vmxnet3_adapter *adapter, struct sk_buff *skb, · 4 unmodified lines
12281229 if (unlikely(sizeof(struct iphdr) + sizeof(struct tcphdr) > maplen))
12291230 return 0;
12301231
1232+ if (skb->protocol == cpu_to_be16(ETH_P_8021Q) ||
1233+ skb->protocol == cpu_to_be16(ETH_P_8021AD))
1234+ hlen = sizeof(struct vlan_ethhdr);
1235+ else
1236+ hlen = sizeof(struct ethhdr);
1237+
12311238 hdr.eth = eth_hdr(skb);
12321239 if (gdesc->rcd.v4) {
1233− BUG_ON(hdr.eth->h_proto != htons(ETH_P_IP));
1234− hdr.ptr += sizeof(struct ethhdr);
1240+ BUG_ON(hdr.eth->h_proto != htons(ETH_P_IP) &&
1241+ hdr.veth->h_vlan_encapsulated_proto != htons(ETH_P_IP));
1242+ hdr.ptr += hlen;
12351243 BUG_ON(hdr.ipv4->protocol != IPPROTO_TCP);
12361244 hlen = hdr.ipv4->ihl << 2;
12371245 hdr.ptr += hdr.ipv4->ihl << 2;
12381246 } else if (gdesc->rcd.v6) {
1239− BUG_ON(hdr.eth->h_proto != htons(ETH_P_IPV6));
1240− hdr.ptr += sizeof(struct ethhdr);
1247+ BUG_ON(hdr.eth->h_proto != htons(ETH_P_IPV6) &&
1248+ hdr.veth->h_vlan_encapsulated_proto != htons(ETH_P_IPV6));
1249+ hdr.ptr += hlen;
12411250 /* Use an estimated value, since we also need to handle
12421251 * TSO case.
12431252 */
drivers/net/vmxnet3/vmxnet3_int.h+2−2
@@ -69,10 +69,10 @@ · 68 unmodified lines
6969 /*
7070 * Version numbers
7171 */
72−#define VMXNET3_DRIVER_VERSION_STRING "1.4.13.0-k"
72+#define VMXNET3_DRIVER_VERSION_STRING "1.4.14.0-k"
7373
7474 /* a 32-bit int, each byte encode a verion number in VMXNET3_DRIVER_VERSION */
75−#define VMXNET3_DRIVER_VERSION_NUM 0x01040d00
75+#define VMXNET3_DRIVER_VERSION_NUM 0x01040e00
7676
7777 #if defined(CONFIG_PCI_MSI)
7878 /* RSS only makes sense if MSI-X is supported. */
drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c+20−16
@@ -459,7 +459,7 @@ static void brcmf_fw_free_request(struct brcmf_fw_request *req) · 458 unmodified lines
459459 kfree(req);
460460 }
461461
462−static void brcmf_fw_request_nvram_done(const struct firmware *fw, void *ctx)
462+static int brcmf_fw_request_nvram_done(const struct firmware *fw, void *ctx)
463463 {
464464 struct brcmf_fw *fwctx = ctx;
465465 struct brcmf_fw_item *cur;
@@ -498,13 +498,10 @@ static void brcmf_fw_request_nvram_done(const struct firmware *fw, void *ctx) · 32 unmodified lines
498498 brcmf_dbg(TRACE, "nvram %p len %d\n", nvram, nvram_length);
499499 cur->nv_data.data = nvram;
500500 cur->nv_data.len = nvram_length;
501− return;
501+ return 0;
502502
503503 fail:
504− brcmf_dbg(TRACE, "failed: dev=%s\n", dev_name(fwctx->dev));
505− fwctx->done(fwctx->dev, -ENOENT, NULL);
506− brcmf_fw_free_request(fwctx->req);
507− kfree(fwctx);
504+ return -ENOENT;
508505 }
509506
510507 static int brcmf_fw_request_next_item(struct brcmf_fw *fwctx, bool async)
@@ -553,20 +550,27 @@ static void brcmf_fw_request_done(const struct firmware *fw, void *ctx) · 42 unmodified lines
553550 brcmf_dbg(TRACE, "enter: firmware %s %sfound\n", cur->path,
554551 fw ? "" : "not ");
555552
556− if (fw) {
557− if (cur->type == BRCMF_FW_TYPE_BINARY)
558− cur->binary = fw;
559− else if (cur->type == BRCMF_FW_TYPE_NVRAM)
560− brcmf_fw_request_nvram_done(fw, fwctx);
561− else
562− release_firmware(fw);
563− } else if (cur->type == BRCMF_FW_TYPE_NVRAM) {
564− brcmf_fw_request_nvram_done(NULL, fwctx);
565− } else if (!(cur->flags & BRCMF_FW_REQF_OPTIONAL)) {
553+ if (!fw)
566554 ret = -ENOENT;
555+
556+ switch (cur->type) {
557+ case BRCMF_FW_TYPE_NVRAM:
558+ ret = brcmf_fw_request_nvram_done(fw, fwctx);
559+ break;
560+ case BRCMF_FW_TYPE_BINARY:
561+ cur->binary = fw;
562+ break;
563+ default:
564+ /* something fishy here so bail out early */
565+ brcmf_err("unknown fw type: %d\n", cur->type);
566+ release_firmware(fw);
567+ ret = -EINVAL;
567568 goto fail;
568569 }
569570
571+ if (ret < 0 && !(cur->flags & BRCMF_FW_REQF_OPTIONAL))
572+ goto fail;
573+
570574 do {
571575 if (++fwctx->curpos == fwctx->req->n_items) {
572576 ret = 0;
drivers/net/wireless/intel/iwlwifi/fw/api/scan.h+5−8
@@ -8,6 +8,7 @@ · 7 unmodified lines
88 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
99 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
1010 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
11+ * Copyright(c) 2018 Intel Corporation
1112 *
1213 * This program is free software; you can redistribute it and/or modify
1314 * it under the terms of version 2 of the GNU General Public License as
@@ -30,7 +31,7 @@ · 16 unmodified lines
3031 * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved.
3132 * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH
3233 * Copyright(c) 2016 - 2017 Intel Deutschland GmbH
33− * Copyright(c) 2018 Intel Corporation
34+ * Copyright(c) 2018 Intel Corporation
3435 * All rights reserved.
3536 *
3637 * Redistribution and use in source and binary forms, with or without
@@ -749,13 +750,9 @@ struct iwl_scan_req_umac { · 712 unmodified lines
749750 } __packed;
750751
751752 #define IWL_SCAN_REQ_UMAC_SIZE_V8 sizeof(struct iwl_scan_req_umac)
752−#define IWL_SCAN_REQ_UMAC_SIZE_V7 (sizeof(struct iwl_scan_req_umac) - \
753− 4 * sizeof(u8))
754−#define IWL_SCAN_REQ_UMAC_SIZE_V6 (sizeof(struct iwl_scan_req_umac) - \
755− 2 * sizeof(u8) - sizeof(__le16))
756−#define IWL_SCAN_REQ_UMAC_SIZE_V1 (sizeof(struct iwl_scan_req_umac) - \
757− 2 * sizeof(__le32) - 2 * sizeof(u8) - \
758− sizeof(__le16))
753+#define IWL_SCAN_REQ_UMAC_SIZE_V7 48
754+#define IWL_SCAN_REQ_UMAC_SIZE_V6 44
755+#define IWL_SCAN_REQ_UMAC_SIZE_V1 36
759756
760757 /**
761758 * struct iwl_umac_scan_abort
drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c+95−16
@@ -76,6 +76,7 @@ · 75 unmodified lines
7676 #include "iwl-io.h"
7777 #include "iwl-csr.h"
7878 #include "fw/acpi.h"
79+#include "fw/api/nvm-reg.h"
7980
8081 /* NVM offsets (in words) definitions */
8182 enum nvm_offsets {
@@ -146,8 +147,8 @@ static const u8 iwl_ext_nvm_channels[] = { · 64 unmodified lines
146147 149, 153, 157, 161, 165, 169, 173, 177, 181
147148 };
148149
149−#define IWL_NUM_CHANNELS ARRAY_SIZE(iwl_nvm_channels)
150−#define IWL_NUM_CHANNELS_EXT ARRAY_SIZE(iwl_ext_nvm_channels)
150+#define IWL_NVM_NUM_CHANNELS ARRAY_SIZE(iwl_nvm_channels)
151+#define IWL_NVM_NUM_CHANNELS_EXT ARRAY_SIZE(iwl_ext_nvm_channels)
151152 #define NUM_2GHZ_CHANNELS 14
152153 #define NUM_2GHZ_CHANNELS_EXT 14
153154 #define FIRST_2GHZ_HT_MINUS 5
@@ -301,11 +302,11 @@ static int iwl_init_channel_map(struct device *dev, const struct iwl_cfg *cfg, · 147 unmodified lines
301302 const u8 *nvm_chan;
302303
303304 if (cfg->nvm_type != IWL_NVM_EXT) {
304− num_of_ch = IWL_NUM_CHANNELS;
305+ num_of_ch = IWL_NVM_NUM_CHANNELS;
305306 nvm_chan = &iwl_nvm_channels[0];
306307 num_2ghz_channels = NUM_2GHZ_CHANNELS;
307308 } else {
308− num_of_ch = IWL_NUM_CHANNELS_EXT;
309+ num_of_ch = IWL_NVM_NUM_CHANNELS_EXT;
309310 nvm_chan = &iwl_ext_nvm_channels[0];
310311 num_2ghz_channels = NUM_2GHZ_CHANNELS_EXT;
311312 }
@@ -720,12 +721,12 @@ iwl_parse_nvm_data(struct iwl_trans *trans, const struct iwl_cfg *cfg, · 408 unmodified lines
720721 if (cfg->nvm_type != IWL_NVM_EXT)
721722 data = kzalloc(sizeof(*data) +
722723 sizeof(struct ieee80211_channel) *
723− IWL_NUM_CHANNELS,
724+ IWL_NVM_NUM_CHANNELS,
724725 GFP_KERNEL);
725726 else
726727 data = kzalloc(sizeof(*data) +
727728 sizeof(struct ieee80211_channel) *
728− IWL_NUM_CHANNELS_EXT,
729+ IWL_NVM_NUM_CHANNELS_EXT,
729730 GFP_KERNEL);
730731 if (!data)
731732 return NULL;
@@ -842,24 +843,34 @@ static u32 iwl_nvm_get_regdom_bw_flags(const u8 *nvm_chan, · 110 unmodified lines
842843 return flags;
843844 }
844845
846+struct regdb_ptrs {
847+ struct ieee80211_wmm_rule *rule;
848+ u32 token;
849+};
850+
845851 struct ieee80211_regdomain *
846852 iwl_parse_nvm_mcc_info(struct device *dev, const struct iwl_cfg *cfg,
847− int num_of_ch, __le32 *channels, u16 fw_mcc)
853+ int num_of_ch, __le32 *channels, u16 fw_mcc,
854+ u16 geo_info)
848855 {
849856 int ch_idx;
850857 u16 ch_flags;
851858 u32 reg_rule_flags, prev_reg_rule_flags = 0;
852859 const u8 *nvm_chan = cfg->nvm_type == IWL_NVM_EXT ?
853860 iwl_ext_nvm_channels : iwl_nvm_channels;
854− struct ieee80211_regdomain *regd;
855− int size_of_regd;
861+ struct ieee80211_regdomain *regd, *copy_rd;
862+ int size_of_regd, regd_to_copy, wmms_to_copy;
863+ int size_of_wmms = 0;
856864 struct ieee80211_reg_rule *rule;
865+ struct ieee80211_wmm_rule *wmm_rule, *d_wmm, *s_wmm;
866+ struct regdb_ptrs *regdb_ptrs;
857867 enum nl80211_band band;
858868 int center_freq, prev_center_freq = 0;
859− int valid_rules = 0;
869+ int valid_rules = 0, n_wmms = 0;
870+ int i;
860871 bool new_rule;
861872 int max_num_ch = cfg->nvm_type == IWL_NVM_EXT ?
862− IWL_NUM_CHANNELS_EXT : IWL_NUM_CHANNELS;
873+ IWL_NVM_NUM_CHANNELS_EXT : IWL_NVM_NUM_CHANNELS;
863874
864875 if (WARN_ON_ONCE(num_of_ch > NL80211_MAX_SUPP_REG_RULES))
865876 return ERR_PTR(-EINVAL);
@@ -875,10 +886,26 @@ iwl_parse_nvm_mcc_info(struct device *dev, const struct iwl_cfg *cfg, · 9 unmodified lines
875886 sizeof(struct ieee80211_regdomain) +
876887 num_of_ch * sizeof(struct ieee80211_reg_rule);
877888
878− regd = kzalloc(size_of_regd, GFP_KERNEL);
889+ if (geo_info & GEO_WMM_ETSI_5GHZ_INFO)
890+ size_of_wmms =
891+ num_of_ch * sizeof(struct ieee80211_wmm_rule);
892+
893+ regd = kzalloc(size_of_regd + size_of_wmms, GFP_KERNEL);
879894 if (!regd)
880895 return ERR_PTR(-ENOMEM);
881896
897+ regdb_ptrs = kcalloc(num_of_ch, sizeof(*regdb_ptrs), GFP_KERNEL);
898+ if (!regdb_ptrs) {
899+ copy_rd = ERR_PTR(-ENOMEM);
900+ goto out;
901+ }
902+
903+ /* set alpha2 from FW. */
904+ regd->alpha2[0] = fw_mcc >> 8;
905+ regd->alpha2[1] = fw_mcc & 0xff;
906+
907+ wmm_rule = (struct ieee80211_wmm_rule *)((u8 *)regd + size_of_regd);
908+
882909 for (ch_idx = 0; ch_idx < num_of_ch; ch_idx++) {
883910 ch_flags = (u16)__le32_to_cpup(channels + ch_idx);
884911 band = (ch_idx < NUM_2GHZ_CHANNELS) ?
@@ -927,14 +954,66 @@ iwl_parse_nvm_mcc_info(struct device *dev, const struct iwl_cfg *cfg, · 42 unmodified lines
927954
928955 iwl_nvm_print_channel_flags(dev, IWL_DL_LAR,
929956 nvm_chan[ch_idx], ch_flags);
957+
958+ if (!(geo_info & GEO_WMM_ETSI_5GHZ_INFO) ||
959+ band == NL80211_BAND_2GHZ)
960+ continue;
961+
962+ if (!reg_query_regdb_wmm(regd->alpha2, center_freq,
963+ &regdb_ptrs[n_wmms].token, wmm_rule)) {
964+ /* Add only new rules */
965+ for (i = 0; i < n_wmms; i++) {
966+ if (regdb_ptrs[i].token ==
967+ regdb_ptrs[n_wmms].token) {
968+ rule->wmm_rule = regdb_ptrs[i].rule;
969+ break;
970+ }
971+ }
972+ if (i == n_wmms) {
973+ rule->wmm_rule = wmm_rule;
974+ regdb_ptrs[n_wmms++].rule = wmm_rule;
975+ wmm_rule++;
976+ }
977+ }
930978 }
931979
932980 regd->n_reg_rules = valid_rules;
981+ regd->n_wmm_rules = n_wmms;
933982
934− /* set alpha2 from FW. */
935− regd->alpha2[0] = fw_mcc >> 8;
936− regd->alpha2[1] = fw_mcc & 0xff;
983+ /*
984+ * Narrow down regdom for unused regulatory rules to prevent hole
985+ * between reg rules to wmm rules.
986+ */
987+ regd_to_copy = sizeof(struct ieee80211_regdomain) +
988+ valid_rules * sizeof(struct ieee80211_reg_rule);
989+
990+ wmms_to_copy = sizeof(struct ieee80211_wmm_rule) * n_wmms;
991+
992+ copy_rd = kzalloc(regd_to_copy + wmms_to_copy, GFP_KERNEL);
993+ if (!copy_rd) {
994+ copy_rd = ERR_PTR(-ENOMEM);
995+ goto out;
996+ }
997+
998+ memcpy(copy_rd, regd, regd_to_copy);
999+ memcpy((u8 *)copy_rd + regd_to_copy, (u8 *)regd + size_of_regd,
1000+ wmms_to_copy);
1001+
1002+ d_wmm = (struct ieee80211_wmm_rule *)((u8 *)copy_rd + regd_to_copy);
1003+ s_wmm = (struct ieee80211_wmm_rule *)((u8 *)regd + size_of_regd);
1004+
1005+ for (i = 0; i < regd->n_reg_rules; i++) {
1006+ if (!regd->reg_rules[i].wmm_rule)
1007+ continue;
1008+
1009+ copy_rd->reg_rules[i].wmm_rule = d_wmm +
1010+ (regd->reg_rules[i].wmm_rule - s_wmm) /
1011+ sizeof(struct ieee80211_wmm_rule);
1012+ }
9371013
938− return regd;
1014+out:
1015+ kfree(regdb_ptrs);
1016+ kfree(regd);
1017+ return copy_rd;
9391018 }
9401019 IWL_EXPORT_SYMBOL(iwl_parse_nvm_mcc_info);
drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.h+4−2
@@ -101,12 +101,14 @@ void iwl_init_sbands(struct device *dev, const struct iwl_cfg *cfg, · 100 unmodified lines
101101 *
102102 * This function parses the regulatory channel data received as a
103103 * MCC_UPDATE_CMD command. It returns a newly allocation regulatory domain,
104− * to be fed into the regulatory core. An ERR_PTR is returned on error.
104+ * to be fed into the regulatory core. In case the geo_info is set handle
105+ * accordingly. An ERR_PTR is returned on error.
105106 * If not given to the regulatory core, the user is responsible for freeing
106107 * the regdomain returned here with kfree.
107108 */
108109 struct ieee80211_regdomain *
109110 iwl_parse_nvm_mcc_info(struct device *dev, const struct iwl_cfg *cfg,
110− int num_of_ch, __le32 *channels, u16 fw_mcc);
111+ int num_of_ch, __le32 *channels, u16 fw_mcc,
112+ u16 geo_info);
111113
112114 #endif /* __iwl_nvm_parse_h__ */
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c+2−1
@@ -311,7 +311,8 @@ struct ieee80211_regdomain *iwl_mvm_get_regdomain(struct wiphy *wiphy, · 310 unmodified lines
311311 regd = iwl_parse_nvm_mcc_info(mvm->trans->dev, mvm->cfg,
312312 __le32_to_cpu(resp->n_channels),
313313 resp->channels,
314− __le16_to_cpu(resp->mcc));
314+ __le16_to_cpu(resp->mcc),
315+ __le16_to_cpu(resp->geo_info));
315316 /* Store the return source id */
316317 src_id = resp->source_id;
317318 kfree(resp);
drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c+0−15
@@ -158,16 +158,6 @@ static u8 halbtc_get_wifi_central_chnl(struct btc_coexist *btcoexist) · 157 unmodified lines
158158
159159 static u8 rtl_get_hwpg_single_ant_path(struct rtl_priv *rtlpriv)
160160 {
161− struct rtl_mod_params *mod_params = rtlpriv->cfg->mod_params;
162−
163− /* override ant_num / ant_path */
164− if (mod_params->ant_sel) {
165− rtlpriv->btcoexist.btc_info.ant_num =
166− (mod_params->ant_sel == 1 ? ANT_X2 : ANT_X1);
167−
168− rtlpriv->btcoexist.btc_info.single_ant_path =
169− (mod_params->ant_sel == 1 ? 0 : 1);
170− }
171161 return rtlpriv->btcoexist.btc_info.single_ant_path;
172162 }
173163
@@ -178,7 +168,6 @@ static u8 rtl_get_hwpg_bt_type(struct rtl_priv *rtlpriv) · 4 unmodified lines
178168
179169 static u8 rtl_get_hwpg_ant_num(struct rtl_priv *rtlpriv)
180170 {
181− struct rtl_mod_params *mod_params = rtlpriv->cfg->mod_params;
182171 u8 num;
183172
184173 if (rtlpriv->btcoexist.btc_info.ant_num == ANT_X2)
@@ -186,10 +175,6 @@ static u8 rtl_get_hwpg_ant_num(struct rtl_priv *rtlpriv) · 1 unmodified line
186175 else
187176 num = 1;
188177
189− /* override ant_num / ant_path */
190− if (mod_params->ant_sel)
191− num = (mod_params->ant_sel == 1 ? ANT_X2 : ANT_X1) + 1;
192−
193178 return num;
194179 }
195180
drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c+7−4
@@ -848,6 +848,9 @@ static bool _rtl8723be_init_mac(struct ieee80211_hw *hw) · 847 unmodified lines
848848 return false;
849849 }
850850
851+ if (rtlpriv->cfg->ops->get_btc_status())
852+ rtlpriv->btcoexist.btc_ops->btc_power_on_setting(rtlpriv);
853+
851854 bytetmp = rtl_read_byte(rtlpriv, REG_MULTI_FUNC_CTRL);
852855 rtl_write_byte(rtlpriv, REG_MULTI_FUNC_CTRL, bytetmp | BIT(3));
853856
@@ -2696,21 +2699,21 @@ void rtl8723be_read_bt_coexist_info_from_hwpg(struct ieee80211_hw *hw, · 1842 unmodified lines
26962699 rtlpriv->btcoexist.btc_info.bt_type = BT_RTL8723B;
26972700 rtlpriv->btcoexist.btc_info.ant_num = (value & 0x1);
26982701 rtlpriv->btcoexist.btc_info.single_ant_path =
2699− (value & 0x40); /*0xc3[6]*/
2702+ (value & 0x40 ? ANT_AUX : ANT_MAIN); /*0xc3[6]*/
27002703 } else {
27012704 rtlpriv->btcoexist.btc_info.btcoexist = 0;
27022705 rtlpriv->btcoexist.btc_info.bt_type = BT_RTL8723B;
27032706 rtlpriv->btcoexist.btc_info.ant_num = ANT_X2;
2704− rtlpriv->btcoexist.btc_info.single_ant_path = 0;
2707+ rtlpriv->btcoexist.btc_info.single_ant_path = ANT_MAIN;
27052708 }
27062709
27072710 /* override ant_num / ant_path */
27082711 if (mod_params->ant_sel) {
27092712 rtlpriv->btcoexist.btc_info.ant_num =
2710− (mod_params->ant_sel == 1 ? ANT_X2 : ANT_X1);
2713+ (mod_params->ant_sel == 1 ? ANT_X1 : ANT_X2);
27112714
27122715 rtlpriv->btcoexist.btc_info.single_ant_path =
2713− (mod_params->ant_sel == 1 ? 0 : 1);
2716+ (mod_params->ant_sel == 1 ? ANT_AUX : ANT_MAIN);
27142717 }
27152718 }
27162719
drivers/net/wireless/realtek/rtlwifi/wifi.h+5−0
@@ -2823,6 +2823,11 @@ enum bt_ant_num { · 2822 unmodified lines
28232823 ANT_X1 = 1,
28242824 };
28252825
2826+enum bt_ant_path {
2827+ ANT_MAIN = 0,
2828+ ANT_AUX = 1,
2829+};
2830+
28262831 enum bt_co_type {
28272832 BT_2WIRE = 0,
28282833 BT_ISSC_3WIRE = 1,
drivers/nvdimm/Kconfig+1−2
@@ -103,8 +103,7 @@ config NVDIMM_DAX · 102 unmodified lines
103103 Select Y if unsure
104104
105105 config OF_PMEM
106− # FIXME: make tristate once OF_NUMA dependency removed
107− bool "Device-tree support for persistent memory regions"
106+ tristate "Device-tree support for persistent memory regions"
108107 depends on OF
109108 default LIBNVDIMM
110109 help
drivers/nvdimm/dimm_devs.c+12−10
@@ -88,9 +88,9 @@ int nvdimm_init_nsarea(struct nvdimm_drvdata *ndd) · 87 unmodified lines
8888 int nvdimm_init_config_data(struct nvdimm_drvdata *ndd)
8989 {
9090 struct nvdimm_bus *nvdimm_bus = walk_to_nvdimm_bus(ndd->dev);
91+ int rc = validate_dimm(ndd), cmd_rc = 0;
9192 struct nd_cmd_get_config_data_hdr *cmd;
9293 struct nvdimm_bus_descriptor *nd_desc;
93− int rc = validate_dimm(ndd);
9494 u32 max_cmd_size, config_size;
9595 size_t offset;
9696
@@ -124,9 +124,11 @@ int nvdimm_init_config_data(struct nvdimm_drvdata *ndd) · 27 unmodified lines
124124 cmd->in_offset = offset;
125125 rc = nd_desc->ndctl(nd_desc, to_nvdimm(ndd->dev),
126126 ND_CMD_GET_CONFIG_DATA, cmd,
127− cmd->in_length + sizeof(*cmd), NULL);
128− if (rc || cmd->status) {
129− rc = -ENXIO;
127+ cmd->in_length + sizeof(*cmd), &cmd_rc);
128+ if (rc < 0)
129+ break;
130+ if (cmd_rc < 0) {
131+ rc = cmd_rc;
130132 break;
131133 }
132134 memcpy(ndd->data + offset, cmd->out_buf, cmd->in_length);
@@ -140,9 +142,9 @@ int nvdimm_init_config_data(struct nvdimm_drvdata *ndd) · 7 unmodified lines
140142 int nvdimm_set_config_data(struct nvdimm_drvdata *ndd, size_t offset,
141143 void *buf, size_t len)
142144 {
143− int rc = validate_dimm(ndd);
144145 size_t max_cmd_size, buf_offset;
145146 struct nd_cmd_set_config_hdr *cmd;
147+ int rc = validate_dimm(ndd), cmd_rc = 0;
146148 struct nvdimm_bus *nvdimm_bus = walk_to_nvdimm_bus(ndd->dev);
147149 struct nvdimm_bus_descriptor *nd_desc = nvdimm_bus->nd_desc;
148150
@@ -164,7 +166,6 @@ int nvdimm_set_config_data(struct nvdimm_drvdata *ndd, size_t offset, · 15 unmodified lines
164166 for (buf_offset = 0; len; len -= cmd->in_length,
165167 buf_offset += cmd->in_length) {
166168 size_t cmd_size;
167− u32 *status;
168169
169170 cmd->in_offset = offset + buf_offset;
170171 cmd->in_length = min(max_cmd_size, len);
@@ -172,12 +173,13 @@ int nvdimm_set_config_data(struct nvdimm_drvdata *ndd, size_t offset, · 1 unmodified line
172173
173174 /* status is output in the last 4-bytes of the command buffer */
174175 cmd_size = sizeof(*cmd) + cmd->in_length + sizeof(u32);
175− status = ((void *) cmd) + cmd_size - sizeof(u32);
176176
177177 rc = nd_desc->ndctl(nd_desc, to_nvdimm(ndd->dev),
178− ND_CMD_SET_CONFIG_DATA, cmd, cmd_size, NULL);
179− if (rc || *status) {
180− rc = rc ? rc : -ENXIO;
178+ ND_CMD_SET_CONFIG_DATA, cmd, cmd_size, &cmd_rc);
179+ if (rc < 0)
180+ break;
181+ if (cmd_rc < 0) {
182+ rc = cmd_rc;
181183 break;
182184 }
183185 }
drivers/nvdimm/of_pmem.c+1−1
@@ -67,7 +67,7 @@ static int of_pmem_region_probe(struct platform_device *pdev) · 66 unmodified lines
6767 */
6868 memset(&ndr_desc, 0, sizeof(ndr_desc));
6969 ndr_desc.attr_groups = region_attr_groups;
70− ndr_desc.numa_node = of_node_to_nid(np);
70+ ndr_desc.numa_node = dev_to_node(&pdev->dev);
7171 ndr_desc.res = &pdev->resource[i];
7272 ndr_desc.of_node = np;
7373 set_bit(ND_REGION_PAGEMAP, &ndr_desc.flags);
drivers/nvme/host/Kconfig+1−1
@@ -27,7 +27,7 @@ config NVME_FABRICS · 26 unmodified lines
2727
2828 config NVME_RDMA
2929 tristate "NVM Express over Fabrics RDMA host driver"
30− depends on INFINIBAND && BLOCK
30+ depends on INFINIBAND && INFINIBAND_ADDR_TRANS && BLOCK
3131 select NVME_CORE
3232 select NVME_FABRICS
3333 select SG_POOL
drivers/nvme/host/core.c+2−25
@@ -764,6 +764,7 @@ static int nvme_submit_user_cmd(struct request_queue *q, · 763 unmodified lines
764764 ret = PTR_ERR(meta);
765765 goto out_unmap;
766766 }
767+ req->cmd_flags |= REQ_INTEGRITY;
767768 }
768769 }
769770
@@ -2997,31 +2998,7 @@ static void nvme_alloc_ns(struct nvme_ctrl *ctrl, unsigned nsid) · 2227 unmodified lines
29972998 if (nvme_init_ns_head(ns, nsid, id))
29982999 goto out_free_id;
29993000 nvme_setup_streams_ns(ctrl, ns);
3000−
3001−#ifdef CONFIG_NVME_MULTIPATH
3002− /*
3003− * If multipathing is enabled we need to always use the subsystem
3004− * instance number for numbering our devices to avoid conflicts
3005− * between subsystems that have multiple controllers and thus use
3006− * the multipath-aware subsystem node and those that have a single
3007− * controller and use the controller node directly.
3008− */
3009− if (ns->head->disk) {
3010− sprintf(disk_name, "nvme%dc%dn%d", ctrl->subsys->instance,
3011− ctrl->cntlid, ns->head->instance);
3012− flags = GENHD_FL_HIDDEN;
3013− } else {
3014− sprintf(disk_name, "nvme%dn%d", ctrl->subsys->instance,
3015− ns->head->instance);
3016− }
3017−#else
3018− /*
3019− * But without the multipath code enabled, multiple controller per
3020− * subsystems are visible as devices and thus we cannot use the
3021− * subsystem instance.
3022− */
3023− sprintf(disk_name, "nvme%dn%d", ctrl->instance, ns->head->instance);
3024−#endif
3001+ nvme_set_disk_name(disk_name, ns, ctrl, &flags);
30253002
30263003 if ((ctrl->quirks & NVME_QUIRK_LIGHTNVM) && id->vs[0] == 0x1) {
30273004 if (nvme_nvm_register(ns, disk_name, node)) {
drivers/nvme/host/fabrics.c+6−0
@@ -668,6 +668,7 @@ static int nvmf_parse_options(struct nvmf_ctrl_options *opts, · 667 unmodified lines
668668 ret = -ENOMEM;
669669 goto out;
670670 }
671+ kfree(opts->transport);
671672 opts->transport = p;
672673 break;
673674 case NVMF_OPT_NQN:
@@ -676,6 +677,7 @@ static int nvmf_parse_options(struct nvmf_ctrl_options *opts, · 2 unmodified lines
676677 ret = -ENOMEM;
677678 goto out;
678679 }
680+ kfree(opts->subsysnqn);
679681 opts->subsysnqn = p;
680682 nqnlen = strlen(opts->subsysnqn);
681683 if (nqnlen >= NVMF_NQN_SIZE) {
@@ -698,6 +700,7 @@ static int nvmf_parse_options(struct nvmf_ctrl_options *opts, · 16 unmodified lines
698700 ret = -ENOMEM;
699701 goto out;
700702 }
703+ kfree(opts->traddr);
701704 opts->traddr = p;
702705 break;
703706 case NVMF_OPT_TRSVCID:
@@ -706,6 +709,7 @@ static int nvmf_parse_options(struct nvmf_ctrl_options *opts, · 2 unmodified lines
706709 ret = -ENOMEM;
707710 goto out;
708711 }
712+ kfree(opts->trsvcid);
709713 opts->trsvcid = p;
710714 break;
711715 case NVMF_OPT_QUEUE_SIZE:
@@ -792,6 +796,7 @@ static int nvmf_parse_options(struct nvmf_ctrl_options *opts, · 80 unmodified lines
792796 ret = -EINVAL;
793797 goto out;
794798 }
799+ nvmf_host_put(opts->host);
795800 opts->host = nvmf_host_add(p);
796801 kfree(p);
797802 if (!opts->host) {
@@ -817,6 +822,7 @@ static int nvmf_parse_options(struct nvmf_ctrl_options *opts, · 19 unmodified lines
817822 ret = -ENOMEM;
818823 goto out;
819824 }
825+ kfree(opts->host_traddr);
820826 opts->host_traddr = p;
821827 break;
822828 case NVMF_OPT_HOST_ID:
drivers/nvme/host/multipath.c+23−1
@@ -15,10 +15,32 @@ · 14 unmodified lines
1515 #include "nvme.h"
1616
1717 static bool multipath = true;
18−module_param(multipath, bool, 0644);
18+module_param(multipath, bool, 0444);
1919 MODULE_PARM_DESC(multipath,
2020 "turn on native support for multiple controllers per subsystem");
2121
22+/*
23+ * If multipathing is enabled we need to always use the subsystem instance
24+ * number for numbering our devices to avoid conflicts between subsystems that
25+ * have multiple controllers and thus use the multipath-aware subsystem node
26+ * and those that have a single controller and use the controller node
27+ * directly.
28+ */
29+void nvme_set_disk_name(char *disk_name, struct nvme_ns *ns,
30+ struct nvme_ctrl *ctrl, int *flags)
31+{
32+ if (!multipath) {
33+ sprintf(disk_name, "nvme%dn%d", ctrl->instance, ns->head->instance);
34+ } else if (ns->head->disk) {
35+ sprintf(disk_name, "nvme%dc%dn%d", ctrl->subsys->instance,
36+ ctrl->cntlid, ns->head->instance);
37+ *flags = GENHD_FL_HIDDEN;
38+ } else {
39+ sprintf(disk_name, "nvme%dn%d", ctrl->subsys->instance,
40+ ns->head->instance);
41+ }
42+}
43+
2244 void nvme_failover_req(struct request *req)
2345 {
2446 struct nvme_ns *ns = req->q->queuedata;
drivers/nvme/host/nvme.h+12−0
@@ -436,6 +436,8 @@ extern const struct attribute_group nvme_ns_id_attr_group; · 435 unmodified lines
436436 extern const struct block_device_operations nvme_ns_head_ops;
437437
438438 #ifdef CONFIG_NVME_MULTIPATH
439+void nvme_set_disk_name(char *disk_name, struct nvme_ns *ns,
440+ struct nvme_ctrl *ctrl, int *flags);
439441 void nvme_failover_req(struct request *req);
440442 bool nvme_req_needs_failover(struct request *req, blk_status_t error);
441443 void nvme_kick_requeue_lists(struct nvme_ctrl *ctrl);
@@ -461,6 +463,16 @@ static inline void nvme_mpath_check_last_path(struct nvme_ns *ns) · 19 unmodified lines
461463 }
462464
463465 #else
466+/*
467+ * Without the multipath code enabled, multiple controller per subsystems are
468+ * visible as devices and thus we cannot use the subsystem instance.
469+ */
470+static inline void nvme_set_disk_name(char *disk_name, struct nvme_ns *ns,
471+ struct nvme_ctrl *ctrl, int *flags)
472+{
473+ sprintf(disk_name, "nvme%dn%d", ctrl->instance, ns->head->instance);
474+}
475+
464476 static inline void nvme_failover_req(struct request *req)
465477 {
466478 }
drivers/nvme/target/Kconfig+1−1
@@ -27,7 +27,7 @@ config NVME_TARGET_LOOP · 26 unmodified lines
2727
2828 config NVME_TARGET_RDMA
2929 tristate "NVMe over Fabrics RDMA target support"
30− depends on INFINIBAND
30+ depends on INFINIBAND && INFINIBAND_ADDR_TRANS
3131 depends on NVME_TARGET
3232 select SGL_ALLOC
3333 help
drivers/nvme/target/loop.c+6−0
@@ -469,6 +469,12 @@ static void nvme_loop_reset_ctrl_work(struct work_struct *work) · 468 unmodified lines
469469 nvme_stop_ctrl(&ctrl->ctrl);
470470 nvme_loop_shutdown_ctrl(ctrl);
471471
472+ if (!nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_CONNECTING)) {
473+ /* state change failure should never happen */
474+ WARN_ON_ONCE(1);
475+ return;
476+ }
477+
472478 ret = nvme_loop_configure_admin_queue(ctrl);
473479 if (ret)
474480 goto out_disable;
drivers/of/fdt.c+5−2
@@ -942,7 +942,7 @@ int __init early_init_dt_scan_chosen_stdout(void) · 941 unmodified lines
942942 int offset;
943943 const char *p, *q, *options = NULL;
944944 int l;
945− const struct earlycon_id *match;
945+ const struct earlycon_id **p_match;
946946 const void *fdt = initial_boot_params;
947947
948948 offset = fdt_path_offset(fdt, "/chosen");
@@ -969,7 +969,10 @@ int __init early_init_dt_scan_chosen_stdout(void) · 20 unmodified lines
969969 return 0;
970970 }
971971
972− for (match = __earlycon_table; match < __earlycon_table_end; match++) {
972+ for (p_match = __earlycon_table; p_match < __earlycon_table_end;
973+ p_match++) {
974+ const struct earlycon_id *match = *p_match;
975+
973976 if (!match->compatible[0])
974977 continue;
975978
drivers/parisc/ccio-dma.c+1−1
@@ -1263,7 +1263,7 @@ static struct parisc_driver ccio_driver __refdata = { · 1262 unmodified lines
12631263 * I/O Page Directory, the resource map, and initalizing the
12641264 * U2/Uturn chip into virtual mode.
12651265 */
1266−static void
1266+static void __init
12671267 ccio_ioc_init(struct ioc *ioc)
12681268 {
12691269 int i;
drivers/pci/dwc/pcie-kirin.c+1−1
@@ -486,7 +486,7 @@ static int kirin_pcie_probe(struct platform_device *pdev) · 485 unmodified lines
486486 return ret;
487487
488488 kirin_pcie->gpio_id_reset = of_get_named_gpio(dev->of_node,
489− "reset-gpio", 0);
489+ "reset-gpios", 0);
490490 if (kirin_pcie->gpio_id_reset < 0)
491491 return -ENODEV;
492492
drivers/pci/host/pci-aardvark.c+30−23
@@ -29,6 +29,7 @@ · 28 unmodified lines
2929 #define PCIE_CORE_DEV_CTRL_STATS_MAX_PAYLOAD_SZ_SHIFT 5
3030 #define PCIE_CORE_DEV_CTRL_STATS_SNOOP_DISABLE (0 << 11)
3131 #define PCIE_CORE_DEV_CTRL_STATS_MAX_RD_REQ_SIZE_SHIFT 12
32+#define PCIE_CORE_DEV_CTRL_STATS_MAX_RD_REQ_SZ 0x2
3233 #define PCIE_CORE_LINK_CTRL_STAT_REG 0xd0
3334 #define PCIE_CORE_LINK_L0S_ENTRY BIT(0)
3435 #define PCIE_CORE_LINK_TRAINING BIT(5)
@@ -100,7 +101,8 @@ · 65 unmodified lines
100101 #define PCIE_ISR1_MASK_REG (CONTROL_BASE_ADDR + 0x4C)
101102 #define PCIE_ISR1_POWER_STATE_CHANGE BIT(4)
102103 #define PCIE_ISR1_FLUSH BIT(5)
103−#define PCIE_ISR1_ALL_MASK GENMASK(5, 4)
104+#define PCIE_ISR1_INTX_ASSERT(val) BIT(8 + (val))
105+#define PCIE_ISR1_ALL_MASK GENMASK(11, 4)
104106 #define PCIE_MSI_ADDR_LOW_REG (CONTROL_BASE_ADDR + 0x50)
105107 #define PCIE_MSI_ADDR_HIGH_REG (CONTROL_BASE_ADDR + 0x54)
106108 #define PCIE_MSI_STATUS_REG (CONTROL_BASE_ADDR + 0x58)
@@ -172,8 +174,6 @@ · 65 unmodified lines
172174 #define PCIE_CONFIG_WR_TYPE0 0xa
173175 #define PCIE_CONFIG_WR_TYPE1 0xb
174176
175−/* PCI_BDF shifts 8bit, so we need extra 4bit shift */
176−#define PCIE_BDF(dev) (dev << 4)
177177 #define PCIE_CONF_BUS(bus) (((bus) & 0xff) << 20)
178178 #define PCIE_CONF_DEV(dev) (((dev) & 0x1f) << 15)
179179 #define PCIE_CONF_FUNC(fun) (((fun) & 0x7) << 12)
@@ -296,7 +296,8 @@ static void advk_pcie_setup_hw(struct advk_pcie *pcie) · 116 unmodified lines
296296 reg = PCIE_CORE_DEV_CTRL_STATS_RELAX_ORDER_DISABLE |
297297 (7 << PCIE_CORE_DEV_CTRL_STATS_MAX_PAYLOAD_SZ_SHIFT) |
298298 PCIE_CORE_DEV_CTRL_STATS_SNOOP_DISABLE |
299− PCIE_CORE_DEV_CTRL_STATS_MAX_RD_REQ_SIZE_SHIFT;
299+ (PCIE_CORE_DEV_CTRL_STATS_MAX_RD_REQ_SZ <<
300+ PCIE_CORE_DEV_CTRL_STATS_MAX_RD_REQ_SIZE_SHIFT);
300301 advk_writel(pcie, reg, PCIE_CORE_DEV_CTRL_STATS_REG);
301302
302303 /* Program PCIe Control 2 to disable strict ordering */
@@ -437,7 +438,7 @@ static int advk_pcie_rd_conf(struct pci_bus *bus, u32 devfn, · 134 unmodified lines
437438 u32 reg;
438439 int ret;
439440
440− if (PCI_SLOT(devfn) != 0) {
441+ if ((bus->number == pcie->root_bus_nr) && PCI_SLOT(devfn) != 0) {
441442 *val = 0xffffffff;
442443 return PCIBIOS_DEVICE_NOT_FOUND;
443444 }
@@ -456,7 +457,7 @@ static int advk_pcie_rd_conf(struct pci_bus *bus, u32 devfn, · 12 unmodified lines
456457 advk_writel(pcie, reg, PIO_CTRL);
457458
458459 /* Program the address registers */
459− reg = PCIE_BDF(devfn) | PCIE_CONF_REG(where);
460+ reg = PCIE_CONF_ADDR(bus->number, devfn, where);
460461 advk_writel(pcie, reg, PIO_ADDR_LS);
461462 advk_writel(pcie, 0, PIO_ADDR_MS);
462463
@@ -491,7 +492,7 @@ static int advk_pcie_wr_conf(struct pci_bus *bus, u32 devfn, · 28 unmodified lines
491492 int offset;
492493 int ret;
493494
494− if (PCI_SLOT(devfn) != 0)
495+ if ((bus->number == pcie->root_bus_nr) && PCI_SLOT(devfn) != 0)
495496 return PCIBIOS_DEVICE_NOT_FOUND;
496497
497498 if (where % size)
@@ -609,9 +610,9 @@ static void advk_pcie_irq_mask(struct irq_data *d) · 111 unmodified lines
609610 irq_hw_number_t hwirq = irqd_to_hwirq(d);
610611 u32 mask;
611612
612− mask = advk_readl(pcie, PCIE_ISR0_MASK_REG);
613− mask |= PCIE_ISR0_INTX_ASSERT(hwirq);
614− advk_writel(pcie, mask, PCIE_ISR0_MASK_REG);
613+ mask = advk_readl(pcie, PCIE_ISR1_MASK_REG);
614+ mask |= PCIE_ISR1_INTX_ASSERT(hwirq);
615+ advk_writel(pcie, mask, PCIE_ISR1_MASK_REG);
615616 }
616617
617618 static void advk_pcie_irq_unmask(struct irq_data *d)
@@ -620,9 +621,9 @@ static void advk_pcie_irq_unmask(struct irq_data *d) · 2 unmodified lines
620621 irq_hw_number_t hwirq = irqd_to_hwirq(d);
621622 u32 mask;
622623
623− mask = advk_readl(pcie, PCIE_ISR0_MASK_REG);
624− mask &= ~PCIE_ISR0_INTX_ASSERT(hwirq);
625− advk_writel(pcie, mask, PCIE_ISR0_MASK_REG);
624+ mask = advk_readl(pcie, PCIE_ISR1_MASK_REG);
625+ mask &= ~PCIE_ISR1_INTX_ASSERT(hwirq);
626+ advk_writel(pcie, mask, PCIE_ISR1_MASK_REG);
626627 }
627628
628629 static int advk_pcie_irq_map(struct irq_domain *h,
@@ -765,29 +766,35 @@ static void advk_pcie_handle_msi(struct advk_pcie *pcie) · 136 unmodified lines
765766
766767 static void advk_pcie_handle_int(struct advk_pcie *pcie)
767768 {
768− u32 val, mask, status;
769+ u32 isr0_val, isr0_mask, isr0_status;
770+ u32 isr1_val, isr1_mask, isr1_status;
769771 int i, virq;
770772
771− val = advk_readl(pcie, PCIE_ISR0_REG);
772− mask = advk_readl(pcie, PCIE_ISR0_MASK_REG);
773− status = val & ((~mask) & PCIE_ISR0_ALL_MASK);
773+ isr0_val = advk_readl(pcie, PCIE_ISR0_REG);
774+ isr0_mask = advk_readl(pcie, PCIE_ISR0_MASK_REG);
775+ isr0_status = isr0_val & ((~isr0_mask) & PCIE_ISR0_ALL_MASK);
776+
777+ isr1_val = advk_readl(pcie, PCIE_ISR1_REG);
778+ isr1_mask = advk_readl(pcie, PCIE_ISR1_MASK_REG);
779+ isr1_status = isr1_val & ((~isr1_mask) & PCIE_ISR1_ALL_MASK);
774780
775− if (!status) {
776− advk_writel(pcie, val, PCIE_ISR0_REG);
781+ if (!isr0_status && !isr1_status) {
782+ advk_writel(pcie, isr0_val, PCIE_ISR0_REG);
783+ advk_writel(pcie, isr1_val, PCIE_ISR1_REG);
777784 return;
778785 }
779786
780787 /* Process MSI interrupts */
781− if (status & PCIE_ISR0_MSI_INT_PENDING)
788+ if (isr0_status & PCIE_ISR0_MSI_INT_PENDING)
782789 advk_pcie_handle_msi(pcie);
783790
784791 /* Process legacy interrupts */
785792 for (i = 0; i < PCI_NUM_INTX; i++) {
786− if (!(status & PCIE_ISR0_INTX_ASSERT(i)))
793+ if (!(isr1_status & PCIE_ISR1_INTX_ASSERT(i)))
787794 continue;
788795
789− advk_writel(pcie, PCIE_ISR0_INTX_ASSERT(i),
790− PCIE_ISR0_REG);
796+ advk_writel(pcie, PCIE_ISR1_INTX_ASSERT(i),
797+ PCIE_ISR1_REG);
791798
792799 virq = irq_find_mapping(pcie->irq_domain, i);
793800 generic_handle_irq(virq);
drivers/pci/pci-driver.c+3−2
@@ -958,10 +958,11 @@ static int pci_pm_freeze(struct device *dev) · 957 unmodified lines
958958 * devices should not be touched during freeze/thaw transitions,
959959 * however.
960960 */
961− if (!dev_pm_test_driver_flags(dev, DPM_FLAG_SMART_SUSPEND))
961+ if (!dev_pm_smart_suspend_and_suspended(dev)) {
962962 pm_runtime_resume(dev);
963+ pci_dev->state_saved = false;
964+ }
963965
964− pci_dev->state_saved = false;
965966 if (pm->freeze) {
966967 int error;
967968
drivers/pci/pci.c+2−2
@@ -5273,11 +5273,11 @@ void pcie_print_link_status(struct pci_dev *dev) · 5272 unmodified lines
52735273 bw_avail = pcie_bandwidth_available(dev, &limiting_dev, &speed, &width);
52745274
52755275 if (bw_avail >= bw_cap)
5276− pci_info(dev, "%u.%03u Gb/s available bandwidth (%s x%d link)\n",
5276+ pci_info(dev, "%u.%03u Gb/s available PCIe bandwidth (%s x%d link)\n",
52775277 bw_cap / 1000, bw_cap % 1000,
52785278 PCIE_SPEED2STR(speed_cap), width_cap);
52795279 else
5280− pci_info(dev, "%u.%03u Gb/s available bandwidth, limited by %s x%d link at %s (capable of %u.%03u Gb/s with %s x%d link)\n",
5280+ pci_info(dev, "%u.%03u Gb/s available PCIe bandwidth, limited by %s x%d link at %s (capable of %u.%03u Gb/s with %s x%d link)\n",
52815281 bw_avail / 1000, bw_avail % 1000,
52825282 PCIE_SPEED2STR(speed), width,
52835283 limiting_dev ? pci_name(limiting_dev) : "<unknown>",
drivers/platform/x86/Kconfig+1−1
@@ -154,7 +154,7 @@ config DELL_LAPTOP · 153 unmodified lines
154154 depends on ACPI_VIDEO || ACPI_VIDEO = n
155155 depends on RFKILL || RFKILL = n
156156 depends on SERIO_I8042
157− select DELL_SMBIOS
157+ depends on DELL_SMBIOS
158158 select POWER_SUPPLY
159159 select LEDS_CLASS
160160 select NEW_LEDS
drivers/platform/x86/asus-wireless.c+3−1
@@ -178,8 +178,10 @@ static int asus_wireless_remove(struct acpi_device *adev) · 177 unmodified lines
178178 {
179179 struct asus_wireless_data *data = acpi_driver_data(adev);
180180
181− if (data->wq)
181+ if (data->wq) {
182+ devm_led_classdev_unregister(&adev->dev, &data->led);
182183 destroy_workqueue(data->wq);
184+ }
183185 return 0;
184186 }
185187
drivers/rapidio/devices/rio_mport_cdev.c+9−10
@@ -740,10 +740,7 @@ static int do_dma_request(struct mport_dma_req *req, · 739 unmodified lines
740740 tx->callback = dma_xfer_callback;
741741 tx->callback_param = req;
742742
743− req->dmach = chan;
744− req->sync = sync;
745743 req->status = DMA_IN_PROGRESS;
746− init_completion(&req->req_comp);
747744 kref_get(&req->refcount);
748745
749746 cookie = dmaengine_submit(tx);
@@ -831,13 +828,20 @@ rio_dma_transfer(struct file *filp, u32 transfer_mode, · 81 unmodified lines
831828 if (!req)
832829 return -ENOMEM;
833830
834− kref_init(&req->refcount);
835−
836831 ret = get_dma_channel(priv);
837832 if (ret) {
838833 kfree(req);
839834 return ret;
840835 }
836+ chan = priv->dmach;
837+
838+ kref_init(&req->refcount);
839+ init_completion(&req->req_comp);
840+ req->dir = dir;
841+ req->filp = filp;
842+ req->priv = priv;
843+ req->dmach = chan;
844+ req->sync = sync;
841845
842846 /*
843847 * If parameter loc_addr != NULL, we are transferring data from/to
@@ -925,11 +929,6 @@ rio_dma_transfer(struct file *filp, u32 transfer_mode, · 81 unmodified lines
925929 xfer->offset, xfer->length);
926930 }
927931
928− req->dir = dir;
929− req->filp = filp;
930− req->priv = priv;
931− chan = priv->dmach;
932−
933932 nents = dma_map_sg(chan->device->dev,
934933 req->sgt.sgl, req->sgt.nents, dir);
935934 if (nents == 0) {
drivers/remoteproc/qcom_q6v5_pil.c+2−0
@@ -1083,6 +1083,7 @@ static int q6v5_alloc_memory_region(struct q6v5 *qproc) · 1082 unmodified lines
10831083 dev_err(qproc->dev, "unable to resolve mba region\n");
10841084 return ret;
10851085 }
1086+ of_node_put(node);
10861087
10871088 qproc->mba_phys = r.start;
10881089 qproc->mba_size = resource_size(&r);
@@ -1100,6 +1101,7 @@ static int q6v5_alloc_memory_region(struct q6v5 *qproc) · 11 unmodified lines
11001101 dev_err(qproc->dev, "unable to resolve mpss region\n");
11011102 return ret;
11021103 }
1104+ of_node_put(node);
11031105
11041106 qproc->mpss_phys = qproc->mpss_reloc = r.start;
11051107 qproc->mpss_size = resource_size(&r);
drivers/remoteproc/remoteproc_core.c+2−2
@@ -1163,7 +1163,7 @@ int rproc_trigger_recovery(struct rproc *rproc) · 1162 unmodified lines
11631163 if (ret)
11641164 return ret;
11651165
1166− ret = rproc_stop(rproc, false);
1166+ ret = rproc_stop(rproc, true);
11671167 if (ret)
11681168 goto unlock_mutex;
11691169
@@ -1316,7 +1316,7 @@ void rproc_shutdown(struct rproc *rproc) · 146 unmodified lines
13161316 if (!atomic_dec_and_test(&rproc->power))
13171317 goto out;
13181318
1319− ret = rproc_stop(rproc, true);
1319+ ret = rproc_stop(rproc, false);
13201320 if (ret) {
13211321 atomic_inc(&rproc->power);
13221322 goto out;
drivers/rpmsg/rpmsg_char.c+2−0
@@ -581,4 +581,6 @@ static void rpmsg_chrdev_exit(void) · 580 unmodified lines
581581 unregister_chrdev_region(rpmsg_major, RPMSG_DEV_MAX);
582582 }
583583 module_exit(rpmsg_chrdev_exit);
584+
585+MODULE_ALIAS("rpmsg:rpmsg_chrdev");
584586 MODULE_LICENSE("GPL v2");
drivers/rtc/rtc-opal.c+23−14
@@ -57,7 +57,7 @@ static void tm_to_opal(struct rtc_time *tm, u32 *y_m_d, u64 *h_m_s_ms) · 56 unmodified lines
5757
5858 static int opal_get_rtc_time(struct device *dev, struct rtc_time *tm)
5959 {
60− long rc = OPAL_BUSY;
60+ s64 rc = OPAL_BUSY;
6161 int retries = 10;
6262 u32 y_m_d;
6363 u64 h_m_s_ms;
@@ -66,13 +66,17 @@ static int opal_get_rtc_time(struct device *dev, struct rtc_time *tm) · 2 unmodified lines
6666
6767 while (rc == OPAL_BUSY || rc == OPAL_BUSY_EVENT) {
6868 rc = opal_rtc_read(&__y_m_d, &__h_m_s_ms);
69− if (rc == OPAL_BUSY_EVENT)
69+ if (rc == OPAL_BUSY_EVENT) {
70+ msleep(OPAL_BUSY_DELAY_MS);
7071 opal_poll_events(NULL);
71− else if (retries-- && (rc == OPAL_HARDWARE
72− || rc == OPAL_INTERNAL_ERROR))
73− msleep(10);
74− else if (rc != OPAL_BUSY && rc != OPAL_BUSY_EVENT)
75− break;
72+ } else if (rc == OPAL_BUSY) {
73+ msleep(OPAL_BUSY_DELAY_MS);
74+ } else if (rc == OPAL_HARDWARE || rc == OPAL_INTERNAL_ERROR) {
75+ if (retries--) {
76+ msleep(10); /* Wait 10ms before retry */
77+ rc = OPAL_BUSY; /* go around again */
78+ }
79+ }
7680 }
7781
7882 if (rc != OPAL_SUCCESS)
@@ -87,21 +91,26 @@ static int opal_get_rtc_time(struct device *dev, struct rtc_time *tm) · 8 unmodified lines
8791
8892 static int opal_set_rtc_time(struct device *dev, struct rtc_time *tm)
8993 {
90− long rc = OPAL_BUSY;
94+ s64 rc = OPAL_BUSY;
9195 int retries = 10;
9296 u32 y_m_d = 0;
9397 u64 h_m_s_ms = 0;
9498
9599 tm_to_opal(tm, &y_m_d, &h_m_s_ms);
100+
96101 while (rc == OPAL_BUSY || rc == OPAL_BUSY_EVENT) {
97102 rc = opal_rtc_write(y_m_d, h_m_s_ms);
98− if (rc == OPAL_BUSY_EVENT)
103+ if (rc == OPAL_BUSY_EVENT) {
104+ msleep(OPAL_BUSY_DELAY_MS);
99105 opal_poll_events(NULL);
100− else if (retries-- && (rc == OPAL_HARDWARE
101− || rc == OPAL_INTERNAL_ERROR))
102− msleep(10);
103− else if (rc != OPAL_BUSY && rc != OPAL_BUSY_EVENT)
104− break;
106+ } else if (rc == OPAL_BUSY) {
107+ msleep(OPAL_BUSY_DELAY_MS);
108+ } else if (rc == OPAL_HARDWARE || rc == OPAL_INTERNAL_ERROR) {
109+ if (retries--) {
110+ msleep(10); /* Wait 10ms before retry */
111+ rc = OPAL_BUSY; /* go around again */
112+ }
113+ }
105114 }
106115
107116 return rc == OPAL_SUCCESS ? 0 : -EIO;
drivers/s390/block/dasd_alias.c+11−2
@@ -592,13 +592,22 @@ static int _schedule_lcu_update(struct alias_lcu *lcu, · 591 unmodified lines
592592 int dasd_alias_add_device(struct dasd_device *device)
593593 {
594594 struct dasd_eckd_private *private = device->private;
595− struct alias_lcu *lcu;
595+ __u8 uaddr = private->uid.real_unit_addr;
596+ struct alias_lcu *lcu = private->lcu;
596597 unsigned long flags;
597598 int rc;
598599
599− lcu = private->lcu;
600600 rc = 0;
601601 spin_lock_irqsave(&lcu->lock, flags);
602+ /*
603+ * Check if device and lcu type differ. If so, the uac data may be
604+ * outdated and needs to be updated.
605+ */
606+ if (private->uid.type != lcu->uac->unit[uaddr].ua_type) {
607+ lcu->flags |= UPDATE_PENDING;
608+ DBF_DEV_EVENT(DBF_WARNING, device, "%s",
609+ "uid type mismatch - trigger rescan");
610+ }
602611 if (!(lcu->flags & UPDATE_PENDING)) {
603612 rc = _add_device_to_lcu(lcu, device, device);
604613 if (rc)
drivers/s390/block/dasd_diag.c+0−1
@@ -27,7 +27,6 @@ · 26 unmodified lines
2727 #include <asm/io.h>
2828 #include <asm/irq.h>
2929 #include <asm/vtoc.h>
30−#include <asm/diag.h>
3130
3231 #include "dasd_int.h"
3332 #include "dasd_diag.h"
drivers/s390/char/sclp_early_core.c+1−1
@@ -18,7 +18,7 @@ int sclp_init_state __section(.data) = sclp_init_state_uninitialized; · 17 unmodified lines
1818 * Used to keep track of the size of the event masks. Qemu until version 2.11
1919 * only supports 4 and needs a workaround.
2020 */
21−bool sclp_mask_compat_mode;
21+bool sclp_mask_compat_mode __section(.data);
2222
2323 void sclp_early_wait_irq(void)
2424 {
drivers/s390/cio/chsc.c+11−3
@@ -452,6 +452,7 @@ static void chsc_process_sei_link_incident(struct chsc_sei_nt0_area *sei_area) · 451 unmodified lines
452452
453453 static void chsc_process_sei_res_acc(struct chsc_sei_nt0_area *sei_area)
454454 {
455+ struct channel_path *chp;
455456 struct chp_link link;
456457 struct chp_id chpid;
457458 int status;
@@ -464,10 +465,17 @@ static void chsc_process_sei_res_acc(struct chsc_sei_nt0_area *sei_area) · 6 unmodified lines
464465 chpid.id = sei_area->rsid;
465466 /* allocate a new channel path structure, if needed */
466467 status = chp_get_status(chpid);
467− if (status < 0)
468− chp_new(chpid);
469− else if (!status)
468+ if (!status)
470469 return;
470+
471+ if (status < 0) {
472+ chp_new(chpid);
473+ } else {
474+ chp = chpid_to_chp(chpid);
475+ mutex_lock(&chp->lock);
476+ chp_update_desc(chp);
477+ mutex_unlock(&chp->lock);
478+ }
471479 memset(&link, 0, sizeof(struct chp_link));
472480 link.chpid = chpid;
473481 if ((sei_area->vf & 0xc0) != 0) {
drivers/s390/cio/vfio_ccw_fsm.c+12−7
@@ -20,12 +20,12 @@ static int fsm_io_helper(struct vfio_ccw_private *private) · 19 unmodified lines
2020 int ccode;
2121 __u8 lpm;
2222 unsigned long flags;
23+ int ret;
2324
2425 sch = private->sch;
2526
2627 spin_lock_irqsave(sch->lock, flags);
2728 private->state = VFIO_CCW_STATE_BUSY;
28− spin_unlock_irqrestore(sch->lock, flags);
2929
3030 orb = cp_get_orb(&private->cp, (u32)(addr_t)sch, sch->lpm);
3131
@@ -38,10 +38,12 @@ static int fsm_io_helper(struct vfio_ccw_private *private) · 6 unmodified lines
3838 * Initialize device status information
3939 */
4040 sch->schib.scsw.cmd.actl |= SCSW_ACTL_START_PEND;
41− return 0;
41+ ret = 0;
42+ break;
4243 case 1: /* Status pending */
4344 case 2: /* Busy */
44− return -EBUSY;
45+ ret = -EBUSY;
46+ break;
4547 case 3: /* Device/path not operational */
4648 {
4749 lpm = orb->cmd.lpm;
@@ -51,13 +53,16 @@ static int fsm_io_helper(struct vfio_ccw_private *private) · 3 unmodified lines
5153 sch->lpm = 0;
5254
5355 if (cio_update_schib(sch))
54− return -ENODEV;
55−
56− return sch->lpm ? -EACCES : -ENODEV;
56+ ret = -ENODEV;
57+ else
58+ ret = sch->lpm ? -EACCES : -ENODEV;
59+ break;
5760 }
5861 default:
59− return ccode;
62+ ret = ccode;
6063 }
64+ spin_unlock_irqrestore(sch->lock, flags);
65+ return ret;
6166 }
6267
6368 static void fsm_notoper(struct vfio_ccw_private *private,
drivers/s390/net/qeth_core.h+0−2
@@ -557,7 +557,6 @@ enum qeth_prot_versions { · 556 unmodified lines
557557 enum qeth_cmd_buffer_state {
558558 BUF_STATE_FREE,
559559 BUF_STATE_LOCKED,
560− BUF_STATE_PROCESSED,
561560 };
562561
563562 enum qeth_cq {
@@ -601,7 +600,6 @@ struct qeth_channel { · 37 unmodified lines
601600 struct qeth_cmd_buffer iob[QETH_CMD_BUFFER_NO];
602601 atomic_t irq_pending;
603602 int io_buf_no;
604− int buf_no;
605603 };
606604
607605 /**
drivers/s390/net/qeth_core_main.c+71−87
@@ -706,7 +706,6 @@ void qeth_clear_ipacmd_list(struct qeth_card *card) · 705 unmodified lines
706706 qeth_put_reply(reply);
707707 }
708708 spin_unlock_irqrestore(&card->lock, flags);
709− atomic_set(&card->write.irq_pending, 0);
710709 }
711710 EXPORT_SYMBOL_GPL(qeth_clear_ipacmd_list);
712711
@@ -818,7 +817,6 @@ void qeth_clear_cmd_buffers(struct qeth_channel *channel) · 105 unmodified lines
818817
819818 for (cnt = 0; cnt < QETH_CMD_BUFFER_NO; cnt++)
820819 qeth_release_buffer(channel, &channel->iob[cnt]);
821− channel->buf_no = 0;
822820 channel->io_buf_no = 0;
823821 }
824822 EXPORT_SYMBOL_GPL(qeth_clear_cmd_buffers);
@@ -924,7 +922,6 @@ static int qeth_setup_channel(struct qeth_channel *channel) · 99 unmodified lines
924922 kfree(channel->iob[cnt].data);
925923 return -ENOMEM;
926924 }
927− channel->buf_no = 0;
928925 channel->io_buf_no = 0;
929926 atomic_set(&channel->irq_pending, 0);
930927 spin_lock_init(&channel->iob_lock);
@@ -1100,16 +1097,9 @@ static void qeth_irq(struct ccw_device *cdev, unsigned long intparm, · 169 unmodified lines
11001097 {
11011098 int rc;
11021099 int cstat, dstat;
1103− struct qeth_cmd_buffer *buffer;
1100+ struct qeth_cmd_buffer *iob = NULL;
11041101 struct qeth_channel *channel;
11051102 struct qeth_card *card;
1106− struct qeth_cmd_buffer *iob;
1107− __u8 index;
1108−
1109− if (__qeth_check_irb_error(cdev, intparm, irb))
1110− return;
1111− cstat = irb->scsw.cmd.cstat;
1112− dstat = irb->scsw.cmd.dstat;
11131103
11141104 card = CARD_FROM_CDEV(cdev);
11151105 if (!card)
@@ -1127,6 +1117,19 @@ static void qeth_irq(struct ccw_device *cdev, unsigned long intparm, · 11 unmodified lines
11271117 channel = &card->data;
11281118 QETH_CARD_TEXT(card, 5, "data");
11291119 }
1120+
1121+ if (qeth_intparm_is_iob(intparm))
1122+ iob = (struct qeth_cmd_buffer *) __va((addr_t)intparm);
1123+
1124+ if (__qeth_check_irb_error(cdev, intparm, irb)) {
1125+ /* IO was terminated, free its resources. */
1126+ if (iob)
1127+ qeth_release_buffer(iob->channel, iob);
1128+ atomic_set(&channel->irq_pending, 0);
1129+ wake_up(&card->wait_q);
1130+ return;
1131+ }
1132+
11301133 atomic_set(&channel->irq_pending, 0);
11311134
11321135 if (irb->scsw.cmd.fctl & (SCSW_FCTL_CLEAR_FUNC))
@@ -1150,6 +1153,10 @@ static void qeth_irq(struct ccw_device *cdev, unsigned long intparm, · 17 unmodified lines
11501153 /* we don't have to handle this further */
11511154 intparm = 0;
11521155 }
1156+
1157+ cstat = irb->scsw.cmd.cstat;
1158+ dstat = irb->scsw.cmd.dstat;
1159+
11531160 if ((dstat & DEV_STAT_UNIT_EXCEP) ||
11541161 (dstat & DEV_STAT_UNIT_CHECK) ||
11551162 (cstat)) {
@@ -1182,25 +1189,15 @@ static void qeth_irq(struct ccw_device *cdev, unsigned long intparm, · 26 unmodified lines
11821189 channel->state = CH_STATE_RCD_DONE;
11831190 goto out;
11841191 }
1185− if (intparm) {
1186− buffer = (struct qeth_cmd_buffer *) __va((addr_t)intparm);
1187− buffer->state = BUF_STATE_PROCESSED;
1188− }
11891192 if (channel == &card->data)
11901193 return;
11911194 if (channel == &card->read &&
11921195 channel->state == CH_STATE_UP)
11931196 __qeth_issue_next_read(card);
11941197
1195− iob = channel->iob;
1196− index = channel->buf_no;
1197− while (iob[index].state == BUF_STATE_PROCESSED) {
1198− if (iob[index].callback != NULL)
1199− iob[index].callback(channel, iob + index);
1198+ if (iob && iob->callback)
1199+ iob->callback(iob->channel, iob);
12001200
1201− index = (index + 1) % QETH_CMD_BUFFER_NO;
1202− }
1203− channel->buf_no = index;
12041201 out:
12051202 wake_up(&card->wait_q);
12061203 return;
@@ -1870,8 +1867,8 @@ static int qeth_idx_activate_get_answer(struct qeth_channel *channel, · 663 unmodified lines
18701867 atomic_cmpxchg(&channel->irq_pending, 0, 1) == 0);
18711868 QETH_DBF_TEXT(SETUP, 6, "noirqpnd");
18721869 spin_lock_irqsave(get_ccwdev_lock(channel->ccwdev), flags);
1873− rc = ccw_device_start(channel->ccwdev,
1874− &channel->ccw, (addr_t) iob, 0, 0);
1870+ rc = ccw_device_start_timeout(channel->ccwdev, &channel->ccw,
1871+ (addr_t) iob, 0, 0, QETH_TIMEOUT);
18751872 spin_unlock_irqrestore(get_ccwdev_lock(channel->ccwdev), flags);
18761873
18771874 if (rc) {
@@ -1888,7 +1885,6 @@ static int qeth_idx_activate_get_answer(struct qeth_channel *channel, · 10 unmodified lines
18881885 if (channel->state != CH_STATE_UP) {
18891886 rc = -ETIME;
18901887 QETH_DBF_TEXT_(SETUP, 2, "3err%d", rc);
1891− qeth_clear_cmd_buffers(channel);
18921888 } else
18931889 rc = 0;
18941890 return rc;
@@ -1942,8 +1938,8 @@ static int qeth_idx_activate_channel(struct qeth_channel *channel, · 47 unmodified lines
19421938 atomic_cmpxchg(&channel->irq_pending, 0, 1) == 0);
19431939 QETH_DBF_TEXT(SETUP, 6, "noirqpnd");
19441940 spin_lock_irqsave(get_ccwdev_lock(channel->ccwdev), flags);
1945− rc = ccw_device_start(channel->ccwdev,
1946− &channel->ccw, (addr_t) iob, 0, 0);
1941+ rc = ccw_device_start_timeout(channel->ccwdev, &channel->ccw,
1942+ (addr_t) iob, 0, 0, QETH_TIMEOUT);
19471943 spin_unlock_irqrestore(get_ccwdev_lock(channel->ccwdev), flags);
19481944
19491945 if (rc) {
@@ -1964,7 +1960,6 @@ static int qeth_idx_activate_channel(struct qeth_channel *channel, · 14 unmodified lines
19641960 QETH_DBF_MESSAGE(2, "%s IDX activate timed out\n",
19651961 dev_name(&channel->ccwdev->dev));
19661962 QETH_DBF_TEXT_(SETUP, 2, "2err%d", -ETIME);
1967− qeth_clear_cmd_buffers(channel);
19681963 return -ETIME;
19691964 }
19701965 return qeth_idx_activate_get_answer(channel, idx_reply_cb);
@@ -2166,8 +2161,8 @@ int qeth_send_control_data(struct qeth_card *card, int len, · 195 unmodified lines
21662161
21672162 QETH_CARD_TEXT(card, 6, "noirqpnd");
21682163 spin_lock_irqsave(get_ccwdev_lock(card->write.ccwdev), flags);
2169− rc = ccw_device_start(card->write.ccwdev, &card->write.ccw,
2170− (addr_t) iob, 0, 0);
2164+ rc = ccw_device_start_timeout(CARD_WDEV(card), &card->write.ccw,
2165+ (addr_t) iob, 0, 0, event_timeout);
21712166 spin_unlock_irqrestore(get_ccwdev_lock(card->write.ccwdev), flags);
21722167 if (rc) {
21732168 QETH_DBF_MESSAGE(2, "%s qeth_send_control_data: "
@@ -2199,8 +2194,6 @@ int qeth_send_control_data(struct qeth_card *card, int len, · 25 unmodified lines
21992194 }
22002195 }
22012196
2202− if (reply->rc == -EIO)
2203− goto error;
22042197 rc = reply->rc;
22052198 qeth_put_reply(reply);
22062199 return rc;
@@ -2211,10 +2204,6 @@ time_err: · 4 unmodified lines
22112204 list_del_init(&reply->list);
22122205 spin_unlock_irqrestore(&reply->card->lock, flags);
22132206 atomic_inc(&reply->received);
2214−error:
2215− atomic_set(&card->write.irq_pending, 0);
2216− qeth_release_buffer(iob->channel, iob);
2217− card->write.buf_no = (card->write.buf_no + 1) % QETH_CMD_BUFFER_NO;
22182207 rc = reply->rc;
22192208 qeth_put_reply(reply);
22202209 return rc;
@@ -3033,28 +3022,23 @@ static int qeth_send_startlan(struct qeth_card *card) · 812 unmodified lines
30333022 return rc;
30343023 }
30353024
3036−static int qeth_default_setadapterparms_cb(struct qeth_card *card,
3037− struct qeth_reply *reply, unsigned long data)
3025+static int qeth_setadpparms_inspect_rc(struct qeth_ipa_cmd *cmd)
30383026 {
3039− struct qeth_ipa_cmd *cmd;
3040−
3041− QETH_CARD_TEXT(card, 4, "defadpcb");
3042−
3043− cmd = (struct qeth_ipa_cmd *) data;
3044− if (cmd->hdr.return_code == 0)
3027+ if (!cmd->hdr.return_code)
30453028 cmd->hdr.return_code =
30463029 cmd->data.setadapterparms.hdr.return_code;
3047− return 0;
3030+ return cmd->hdr.return_code;
30483031 }
30493032
30503033 static int qeth_query_setadapterparms_cb(struct qeth_card *card,
30513034 struct qeth_reply *reply, unsigned long data)
30523035 {
3053− struct qeth_ipa_cmd *cmd;
3036+ struct qeth_ipa_cmd *cmd = (struct qeth_ipa_cmd *) data;
30543037
30553038 QETH_CARD_TEXT(card, 3, "quyadpcb");
3039+ if (qeth_setadpparms_inspect_rc(cmd))
3040+ return 0;
30563041
3057− cmd = (struct qeth_ipa_cmd *) data;
30583042 if (cmd->data.setadapterparms.data.query_cmds_supp.lan_type & 0x7f) {
30593043 card->info.link_type =
30603044 cmd->data.setadapterparms.data.query_cmds_supp.lan_type;
@@ -3062,7 +3046,7 @@ static int qeth_query_setadapterparms_cb(struct qeth_card *card, · 1 unmodified line
30623046 }
30633047 card->options.adp.supported_funcs =
30643048 cmd->data.setadapterparms.data.query_cmds_supp.supported_cmds;
3065− return qeth_default_setadapterparms_cb(card, reply, (unsigned long)cmd);
3049+ return 0;
30663050 }
30673051
30683052 static struct qeth_cmd_buffer *qeth_get_adapter_cmd(struct qeth_card *card,
@@ -3154,22 +3138,20 @@ EXPORT_SYMBOL_GPL(qeth_query_ipassists); · 85 unmodified lines
31543138 static int qeth_query_switch_attributes_cb(struct qeth_card *card,
31553139 struct qeth_reply *reply, unsigned long data)
31563140 {
3157− struct qeth_ipa_cmd *cmd;
3158− struct qeth_switch_info *sw_info;
3141+ struct qeth_ipa_cmd *cmd = (struct qeth_ipa_cmd *) data;
31593142 struct qeth_query_switch_attributes *attrs;
3143+ struct qeth_switch_info *sw_info;
31603144
31613145 QETH_CARD_TEXT(card, 2, "qswiatcb");
3162− cmd = (struct qeth_ipa_cmd *) data;
3163− sw_info = (struct qeth_switch_info *)reply->param;
3164− if (cmd->data.setadapterparms.hdr.return_code == 0) {
3165− attrs = &cmd->data.setadapterparms.data.query_switch_attributes;
3166− sw_info->capabilities = attrs->capabilities;
3167− sw_info->settings = attrs->settings;
3168− QETH_CARD_TEXT_(card, 2, "%04x%04x", sw_info->capabilities,
3169− sw_info->settings);
3170− }
3171− qeth_default_setadapterparms_cb(card, reply, (unsigned long) cmd);
3146+ if (qeth_setadpparms_inspect_rc(cmd))
3147+ return 0;
31723148
3149+ sw_info = (struct qeth_switch_info *)reply->param;
3150+ attrs = &cmd->data.setadapterparms.data.query_switch_attributes;
3151+ sw_info->capabilities = attrs->capabilities;
3152+ sw_info->settings = attrs->settings;
3153+ QETH_CARD_TEXT_(card, 2, "%04x%04x", sw_info->capabilities,
3154+ sw_info->settings);
31733155 return 0;
31743156 }
31753157
@@ -4207,16 +4189,13 @@ EXPORT_SYMBOL_GPL(qeth_do_send_packet); · 1031 unmodified lines
42074189 static int qeth_setadp_promisc_mode_cb(struct qeth_card *card,
42084190 struct qeth_reply *reply, unsigned long data)
42094191 {
4210− struct qeth_ipa_cmd *cmd;
4192+ struct qeth_ipa_cmd *cmd = (struct qeth_ipa_cmd *) data;
42114193 struct qeth_ipacmd_setadpparms *setparms;
42124194
42134195 QETH_CARD_TEXT(card, 4, "prmadpcb");
42144196
4215− cmd = (struct qeth_ipa_cmd *) data;

138 more lines aren’t shown here.

drivers/s390/net/qeth_core_mpc.h+12−0

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

drivers/s390/net/qeth_l2_main.c+33−27

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

drivers/s390/net/smsgiucv.c+1−1

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

drivers/sbus/char/oradax.c+1−1

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

drivers/scsi/fnic/fnic_trace.c+1−1

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

drivers/scsi/isci/port_config.c+1−2

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

drivers/scsi/megaraid/megaraid_sas_fusion.c+3−3

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

drivers/scsi/scsi_debug.c+24−9

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

drivers/scsi/scsi_transport_iscsi.c+18−11

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

drivers/scsi/sd.c+2−0

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

drivers/scsi/sd_zbc.c+82−58

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

drivers/scsi/storvsc_drv.c+5−2

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

drivers/scsi/ufs/ufshcd.c+40−0

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

drivers/slimbus/messaging.c+1−1

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

drivers/soc/bcm/raspberrypi-power.c+1−1

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

drivers/staging/media/imx/imx-media-csi.c+1−1

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

drivers/staging/wilc1000/host_interface.c+1−1

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

drivers/target/target_core_iblock.c+4−4

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

drivers/target/target_core_pscsi.c+2−0

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

drivers/tty/n_gsm.c+22−1

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

drivers/tty/serial/earlycon.c+4−2

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

drivers/tty/serial/imx.c+18−1

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

drivers/tty/serial/mvebu-uart.c+0−1

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

drivers/tty/serial/qcom_geni_serial.c+6−4

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

drivers/tty/serial/xilinx_uartps.c+1−1

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

drivers/tty/tty_io.c+4−1

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

drivers/tty/tty_ldisc.c+13−16

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

drivers/uio/uio_hv_generic.c+23−49

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

drivers/usb/Kconfig+1−0

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

drivers/usb/core/config.c+3−1

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

drivers/usb/core/hcd.c+13−6

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

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

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

drivers/usb/core/phy.c+66−27

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

drivers/usb/core/phy.h+21−1

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

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

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

drivers/usb/dwc2/core.h+2−0

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

drivers/usb/dwc2/gadget.c+21−0

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

drivers/usb/dwc2/hcd.c+8−5

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

drivers/usb/dwc2/pci.c+3−1

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

drivers/usb/dwc3/gadget.c+2−2

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

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

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

drivers/usb/host/ehci-mem.c+2−1

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

drivers/usb/host/ehci-sched.c+4−2

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

drivers/usb/host/xhci-dbgtty.c+5−3

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

drivers/usb/host/xhci-pci.c+4−1

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

drivers/usb/host/xhci-plat.c+23−9

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

drivers/usb/host/xhci.c+1−0

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

drivers/usb/host/xhci.h+2−1

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

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

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

drivers/usb/musb/musb_gadget.c+2−1

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

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

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

drivers/usb/serial/Kconfig+1−0

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

drivers/usb/serial/cp210x.c+1−0

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

drivers/usb/serial/ftdi_sio.c+2−1

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

drivers/usb/serial/option.c+5−0

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

drivers/usb/serial/usb-serial-simple.c+7−0

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

drivers/usb/serial/visor.c+35−34

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

drivers/usb/typec/tcpm.c+1−0

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

drivers/usb/typec/tps6598x.c+39−8

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

drivers/usb/typec/ucsi/Makefile+1−1

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

drivers/usb/typec/ucsi/ucsi.c+1−1

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

drivers/usb/usbip/stub_main.c+5−0

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

drivers/usb/usbip/usbip_common.h+1−1

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

drivers/usb/usbip/usbip_event.c+0−4

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

drivers/usb/usbip/vhci_hcd.c+13−0

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

drivers/virt/vboxguest/vboxguest_core.c+38−32

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

drivers/virt/vboxguest/vboxguest_core.h+9−0

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

drivers/virt/vboxguest/vboxguest_linux.c+16−3

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

drivers/virt/vboxguest/vboxguest_utils.c+13−4

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

drivers/watchdog/aspeed_wdt.c+7−0

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

drivers/watchdog/renesas_wdt.c+4−2

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

drivers/watchdog/sch311x_wdt.c+1−1

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

drivers/watchdog/w83977f_wdt.c+1−1

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

drivers/watchdog/wafer5823wdt.c+1−1

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

drivers/xen/xen-pciback/conf_space_quirks.c+1−1

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

drivers/xen/xen-pciback/pci_stub.c+4−4

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

drivers/xen/xenbus/xenbus_dev_frontend.c+2−1

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

fs/afs/server.c+8−1

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

fs/autofs4/root.c+1−1

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

fs/binfmt_elf.c+4−4

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

fs/btrfs/ctree.h+25−0

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

fs/btrfs/delayed-inode.c+16−4

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

fs/btrfs/delayed-ref.c+14−5

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

fs/btrfs/delayed-ref.h+1−0

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

fs/btrfs/disk-io.c+1−0

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

fs/btrfs/extent-tree.c+64−16

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

fs/btrfs/file.c+1−1

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

fs/btrfs/inode.c+12−8

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

fs/btrfs/print-tree.c+15−10

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

fs/btrfs/print-tree.h+1−1

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

fs/btrfs/qgroup.c+41−2

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

fs/btrfs/relocation.c+1−1

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

fs/btrfs/send.c+4−0

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

fs/btrfs/transaction.c+1−0

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

fs/btrfs/transaction.h+14−0

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

fs/ceph/inode.c+7−3

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

fs/ceph/xattr.c+25−3

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

fs/cifs/Kconfig+1−1

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

fs/cifs/cifs_debug.h+1−1

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

fs/cifs/cifssmb.c+3−0

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

fs/cifs/connect.c+16−16

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

fs/cifs/dir.c+5−4

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

fs/cifs/file.c+1−1

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

fs/cifs/smb2ops.c+16−6

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

fs/cifs/smb2pdu.c+7−6

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

fs/cifs/smb2pdu.h+1−1

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

fs/cifs/smbdirect.c+18−24

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

fs/cifs/transport.c+6−3

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

fs/ecryptfs/crypto.c+28−13

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

fs/ecryptfs/file.c+16−5

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

fs/ecryptfs/inode.c+1−2

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

fs/ecryptfs/keystore.c+1−1

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

fs/ext2/file.c+2−2

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

fs/ext4/balloc.c+5−4

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

fs/ext4/extents.c+11−5

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

fs/ext4/super.c+1−0

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

fs/fs-writeback.c+5−4

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

fs/isofs/compress.c+16−3

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

fs/isofs/inode.c+3−0

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

fs/jbd2/transaction.c+1−0

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

fs/jffs2/super.c+1−1

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

fs/namespace.c+3−2

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

fs/notify/fanotify/fanotify.c+15−19

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

fs/notify/fsnotify.c+11−14

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

fs/orangefs/super.c+5−0

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

fs/proc/base.c+6−0

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

fs/proc/loadavg.c+1−1

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

fs/proc/task_mmu.c+5−1

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

fs/quota/dquot.c+1−1

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

fs/super.c+4−5

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

fs/udf/unicode.c+6−0

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

fs/xfs/libxfs/xfs_attr.c+8−1

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

fs/xfs/libxfs/xfs_bmap.c+4−0

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

fs/xfs/libxfs/xfs_inode_buf.c+21−0

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

fs/xfs/xfs_file.c+19−5

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

include/asm-generic/vmlinux.lds.h+1−1

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

include/drm/drm_hdcp.h+1−1

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

include/dt-bindings/clock/stm32mp1-clks.h+2−2

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

include/kvm/arm_psci.h+14−2

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

include/kvm/arm_vgic.h+1−0

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

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

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

include/linux/backing-dev.h+16−14

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

include/linux/blk-mq.h+3−0

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

include/linux/blkdev.h+6−0

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

include/linux/bpf.h+5−3

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

include/linux/clk-provider.h+3−0

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

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

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

include/linux/coresight-pmu.h+1−12

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

include/linux/device.h+4−2

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

include/linux/ethtool.h+2−0

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

include/linux/fsnotify_backend.h+2−4

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

include/linux/genhd.h+3−1

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

include/linux/hid.h+8−1

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

include/linux/hrtimer.h+2−0

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

include/linux/if_vlan.h+5−2

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

include/linux/livepatch.h+13−6

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

include/linux/microchipphy.h+8−0

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

include/linux/mlx5/driver.h+3−9

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

include/linux/mtd/flashchip.h+1−0

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

include/linux/remoteproc.h+1−1

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

include/linux/serial_core.h+14−7

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

include/linux/shrinker.h+5−2

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

include/linux/stringhash.h+2−2

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

include/linux/textsearch.h+2−2

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

include/linux/thread_info.h+1−5

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

include/linux/ti-emif-sram.h+75−0

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

include/linux/timekeeper_internal.h+0−2

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

include/linux/timekeeping.h+25−12

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

include/linux/timekeeping32.h+0−3

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

include/linux/timer.h+0−2

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

include/linux/tty.h+1−1

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

include/linux/usb/composite.h+1−1

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

include/linux/vbox_utils.h+0−23

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

include/linux/virtio.h+3−0

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

include/linux/wait_bit.h+17−0

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

include/media/i2c/tvp7002.h+1−1

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

include/media/videobuf-core.h+2−2

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

include/media/videobuf-dma-sg.h+2−2

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

include/media/videobuf-vmalloc.h+1−1

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

include/net/ife.h+2−1

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

include/net/llc_conn.h+1−0

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

include/net/tls.h+1−0

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

include/scsi/scsi_dbg.h+0−2

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

include/soc/bcm2835/raspberrypi-firmware.h+2−2

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

include/sound/control.h+5−2

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

include/trace/events/initcall.h+11−3

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

include/trace/events/ufs.h+27−0

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

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

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

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

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

include/uapi/linux/kvm.h+7−0

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

include/uapi/linux/perf_event.h+15−3

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

include/uapi/linux/random.h+3−0

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

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

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

include/uapi/linux/sysctl.h+0−18

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

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

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

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

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

include/uapi/linux/virtio_balloon.h+15−0

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

include/uapi/rdma/cxgb3-abi.h+1−1

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

include/uapi/rdma/cxgb4-abi.h+1−1

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

include/uapi/rdma/hns-abi.h+1−1

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

include/uapi/rdma/ib_user_cm.h+1−1

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

include/uapi/rdma/ib_user_ioctl_verbs.h+1−1

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

include/uapi/rdma/ib_user_mad.h+1−1

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

include/uapi/rdma/ib_user_sa.h+1−1

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

include/uapi/rdma/ib_user_verbs.h+1−1

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

include/uapi/rdma/mlx4-abi.h+1−1

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

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

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

include/uapi/rdma/mthca-abi.h+1−1

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

include/uapi/rdma/nes-abi.h+1−1

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

include/uapi/rdma/qedr-abi.h+1−1

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

include/uapi/rdma/rdma_user_cm.h+1−1

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

include/uapi/rdma/rdma_user_ioctl.h+1−1

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

include/uapi/rdma/rdma_user_rxe.h+1−1

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

include/xen/interface/io/sndif.h+306−16

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

kernel/bpf/arraymap.c+2−1

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

kernel/bpf/core.c+29−16

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

kernel/bpf/sockmap.c+73−29

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

kernel/bpf/syscall.c+2−2

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

kernel/events/callchain.c+11−14

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

kernel/events/core.c+6−2

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

kernel/events/uprobes.c+3−4

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

kernel/fork.c+1−2

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

kernel/kprobes.c+1−1

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

kernel/livepatch/shadow.c+71−37

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

kernel/module.c+2−1

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

kernel/sysctl_binary.c+1−19

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

kernel/time/clocksource.c+44−19

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

kernel/time/hrtimer.c+14−2

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

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

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

kernel/time/posix-stubs.c+0−2

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

kernel/time/posix-timers.c+17−9

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

kernel/time/tick-common.c+0−15

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

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

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

kernel/time/tick-oneshot.c+5−6

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

kernel/time/tick-sched.c+5−14

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

kernel/time/timekeeping.c+37−48

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

kernel/time/timekeeping.h+1−0

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

kernel/trace/bpf_trace.c+21−4

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

kernel/trace/ftrace.c+2−2

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

kernel/trace/trace.c+1−1

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

kernel/trace/trace_entries.h+1−1

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

kernel/trace/trace_events_filter.c+7−7

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

kernel/trace/trace_events_hist.c+12−0

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

kernel/trace/trace_kprobe.c+0−2

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

kernel/trace/trace_stack.c+1−1

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

kernel/trace/trace_uprobe.c+14−21

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

kernel/tracepoint.c+2−2

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

lib/dma-direct.c+2−1

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

lib/errseq.c+9−14

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

lib/kobject.c+5−6

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

lib/swiotlb.c+1−1

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

lib/textsearch.c+23−17

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

mm/backing-dev.c+2−1

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

mm/filemap.c+4−5

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

mm/huge_memory.c+4−1

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

mm/memcontrol.c+1−1

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

mm/migrate.c+19−3

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

mm/mmap.c+10−1

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

mm/page-writeback.c+9−9

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

mm/rmap.c+0−3

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

mm/vmscan.c+20−1

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

net/bridge/br_if.c+2−2

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

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

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

net/caif/chnl_net.c+1−1

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

net/ceph/messenger.c+7−0

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

net/ceph/mon_client.c+11−3

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

net/compat.c+4−2

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

net/core/dev.c+1−1

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

net/core/dev_addr_lists.c+1−1

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

net/core/ethtool.c+5−0

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

net/core/filter.c+1−0

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

net/core/neighbour.c+26−14

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

net/dccp/ccids/ccid2.c+12−2

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

net/dccp/timer.c+1−1

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

net/dns_resolver/dns_key.c+5−7

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

net/ife/ife.c+36−2

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

net/ipv4/ip_output.c+5−3

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

net/ipv4/route.c+53−65

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

net/ipv4/tcp.c+9−6

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

net/ipv4/tcp_bbr.c+3−1

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

net/ipv4/tcp_input.c+2−5

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

net/ipv6/netfilter/Kconfig+28−27

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

net/ipv6/route.c+8−1

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

net/ipv6/seg6_iptunnel.c+1−1

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

net/l2tp/l2tp_core.c+20−20

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

net/l2tp/l2tp_core.h+2−1

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

net/l2tp/l2tp_debugfs.c+16−2

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

net/l2tp/l2tp_netlink.c+8−3

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

net/l2tp/l2tp_ppp.c+27−7

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

net/llc/af_llc.c+12−2

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

net/llc/llc_c_ac.c+1−8

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

net/llc/llc_conn.c+21−1

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

net/netfilter/Kconfig+1−0

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

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

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

net/netfilter/ipvs/ip_vs_sync.c+80−75

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

net/netfilter/nf_conntrack_expect.c+4−1

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

net/netfilter/nf_conntrack_extend.c+2−0

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

net/netfilter/nf_conntrack_sip.c+12−4

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

net/netfilter/nf_tables_api.c+38−31

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

net/netfilter/xt_connmark.c+29−20

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

net/packet/af_packet.c+58−25

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

net/packet/internal.h+5−5

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

net/qrtr/qrtr.c+1−0

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

net/rds/ib_cm.c+2−1

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

net/rds/recv.c+1−0

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

net/sched/act_ife.c+7−2

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

net/sched/sch_fq.c+25−12

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

net/sctp/inqueue.c+1−1

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

net/sctp/ipv6.c+32−29

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

net/sctp/sm_statefuns.c+7−1

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

net/sctp/stream.c+2−0

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

net/smc/af_smc.c+33−38

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

net/smc/smc_core.c+19−3

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

net/smc/smc_core.h+2−1

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

net/strparser/strparser.c+4−5

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

net/sunrpc/rpc_pipe.c+1−0

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

net/tipc/monitor.c+1−1

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

net/tipc/name_table.c+21−13

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

net/tipc/name_table.h+1−1

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

net/tipc/net.c+2−0

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

net/tipc/netlink.c+4−1

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

net/tipc/node.c+5−8

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

net/tipc/socket.c+3−1

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

net/tipc/subscr.c+4−1

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

net/tls/tls_main.c+7−0

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

net/tls/tls_sw.c+9−1

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

net/vmw_vsock/af_vsock.c+6−0

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

samples/livepatch/livepatch-shadow-fix1.c+32−11

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

samples/livepatch/livepatch-shadow-fix2.c+18−15

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

samples/sockmap/Makefile+5−2

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

scripts/Makefile.gcc-plugins+1−1

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

scripts/Makefile.lib+1−1

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

scripts/extract_xc3028.pl+1−1

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

scripts/genksyms/Makefile+2−2

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

scripts/mod/sumversion.c+1−8

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

scripts/split-man.pl+1−1

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

security/commoncap.c+2−0

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

sound/core/control.c+1−1

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

sound/core/pcm_compat.c+6−3

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

sound/core/pcm_native.c+15−15

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

sound/core/rawmidi_compat.c+12−6

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

sound/core/seq/oss/seq_oss_event.c+9−6

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

sound/core/seq/oss/seq_oss_midi.c+2−0

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

sound/core/seq/oss/seq_oss_synth.c+49−36

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

sound/core/seq/oss/seq_oss_synth.h+2−1

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

sound/core/seq/seq_virmidi.c+2−2

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

sound/drivers/aloop.c+15−2

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

sound/drivers/opl3/opl3_synth.c+5−2

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

sound/firewire/amdtp-stream.c+3−2

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

sound/firewire/dice/dice-stream.c+1−1

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

sound/firewire/dice/dice.c+1−1

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

sound/pci/asihpi/hpimsginit.c+9−4

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

sound/pci/asihpi/hpioctl.c+3−1

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

sound/pci/hda/hda_hwdep.c+11−1

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

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

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

sound/pci/hda/patch_hdmi.c+8−1

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

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

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

sound/pci/rme9652/hdspm.c+14−10

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

sound/pci/rme9652/rme9652.c+4−2

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

sound/soc/amd/acp-da7219-max98357a.c+1−1

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

sound/soc/codecs/adau17x1.c+20−6

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

sound/soc/codecs/adau17x1.h+2−1

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

sound/soc/codecs/msm8916-wcd-analog.c+6−3

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

sound/soc/codecs/rt5514.c+3−0

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

sound/soc/fsl/fsl_esai.c+7−0

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

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

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

sound/soc/intel/Kconfig+13−9

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

sound/soc/omap/omap-dmic.c+11−3

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

sound/soc/sh/rcar/core.c+2−2

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

sound/soc/soc-topology.c+9−5

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

sound/usb/line6/midi.c+1−1

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

sound/usb/mixer.c+4−3

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

sound/usb/mixer_maps.c+3−0

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

sound/usb/stream.c+1−1

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

sound/usb/usx2y/us122l.c+1−1

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

sound/usb/usx2y/usX2Yhwdep.c+1−1

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

sound/usb/usx2y/usx2yhwdeppcm.c+1−1

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

tools/arch/arm/include/uapi/asm/kvm.h+9−0

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

tools/arch/x86/include/asm/required-features.h+1−7

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

tools/arch/x86/include/uapi/asm/kvm.h+18−1

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

tools/bpf/Makefile+2−0

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

tools/bpf/bpf_dbg.c+5−2

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

tools/include/linux/compiler.h+15−5

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

tools/include/linux/coresight-pmu.h+1−12

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

tools/include/uapi/asm-generic/mman-common.h+3−0

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

tools/include/uapi/linux/bpf.h+1−0

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

tools/include/uapi/linux/if_link.h+39−0

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

tools/include/uapi/linux/kvm.h+20−1

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

tools/include/uapi/linux/perf_event.h+15−3

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

tools/include/uapi/sound/asound.h+1−0

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

tools/lib/subcmd/parse-options.c+3−3

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

tools/objtool/Makefile+2−2

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

tools/perf/Documentation/perf-config.txt+5−0

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

tools/perf/Documentation/perf-mem.txt+31−11

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

tools/perf/Documentation/perf-sched.txt+2−2

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

tools/perf/Documentation/perf-script.txt+9−8

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

tools/perf/Documentation/perf-stat.txt+1−1

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

tools/perf/Makefile.config+2−2

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

tools/perf/arch/arm/include/arch-tests.h+12−0

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

tools/perf/arch/arm/tests/Build+2−0

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

tools/perf/arch/arm/tests/arch-tests.c+16−0

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

tools/perf/arch/arm/util/auxtrace.c+1−12

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

tools/perf/arch/arm/util/cs-etm.c+1−12

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

tools/perf/arch/arm/util/cs-etm.h+1−12

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

tools/perf/arch/arm/util/pmu.c+1−12

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

tools/perf/arch/s390/util/auxtrace.c+1−0

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

tools/perf/arch/s390/util/header.c+0−18

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

tools/perf/arch/x86/Makefile+1−1

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

tools/perf/arch/x86/annotate/instructions.c+66−1

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

tools/perf/arch/x86/entry/syscalls/syscall_64.tbl+358−354

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

tools/perf/builtin-help.c+1−1

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

tools/perf/builtin-mem.c+2−2

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

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

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

tools/perf/builtin-stat.c+40−14

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

tools/perf/builtin-version.c+3−0

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

tools/perf/perf.c+2−2

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

tools/perf/pmu-events/arch/s390/mapfile.csv+5−5

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

tools/perf/tests/attr/test-record-group-sampling+3−0

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

tools/perf/tests/bpf-script-example.c+1−1

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

tools/perf/tests/bpf-script-test-kbuild.c+0−1

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

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

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

tools/perf/tests/mmap-basic.c+1−1

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

tools/perf/tests/shell/record+probe_libc_inet_pton.sh+2−4

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

tools/perf/trace/beauty/mmap.c+3−0

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

tools/perf/ui/browsers/annotate.c+5−0

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

tools/perf/ui/browsers/hists.c+1−1

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

tools/perf/util/annotate.c+21−5

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

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

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

tools/perf/util/cs-etm-decoder/cs-etm-decoder.c+1−2

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

tools/perf/util/cs-etm.c+1−2

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

tools/perf/util/cs-etm.h+1−12

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

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

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

tools/perf/util/evsel.c+16−8

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

tools/perf/util/evsel.h+1−0

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

tools/perf/util/generate-cmdlist.sh+1−1

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

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

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

tools/perf/util/machine.c+18−12

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

tools/perf/util/parse-events.y+4−4

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

tools/perf/util/pmu.c+14−14

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

tools/perf/util/symbol.c+3−5

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

tools/perf/util/syscalltbl.c+3−3

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

tools/perf/util/trace-event-scripting.c+2−2

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

tools/power/acpi/Makefile.config+1−0

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

tools/testing/nvdimm/test/nfit.c+65−19

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

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

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

tools/testing/selftests/bpf/test_progs.c+2−2

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

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

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

tools/testing/selftests/bpf/test_sock_addr.c+1−0

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

tools/testing/selftests/bpf/test_sock_addr.sh+2−2

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

tools/testing/selftests/filesystems/Makefile+3−5

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

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

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

tools/testing/selftests/firmware/fw_lib.sh+6−4

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

tools/testing/selftests/firmware/fw_run_tests.sh+1−1

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

tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-extended-error-support.tc+1−1

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

tools/testing/selftests/ftrace/test.d/trigger/inter-event/trigger-multi-actions-accept.tc+44−0

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

tools/testing/selftests/kvm/Makefile+3−2

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

tools/testing/selftests/kvm/include/kvm_util.h+9−6

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

tools/testing/selftests/kvm/include/vmx.h+494−0

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

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

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

tools/testing/selftests/kvm/lib/sparsebit.c+2−2

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

tools/testing/selftests/kvm/lib/vmx.c+243−0

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

tools/testing/selftests/kvm/vmx_tsc_adjust_test.c+231−0

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

tools/testing/selftests/lib.mk+4−4

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

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

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

tools/testing/selftests/x86/test_syscall_vdso.c+21−14

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

virt/kvm/arm/arm.c+10−5

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

virt/kvm/arm/psci.c+60−0

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

virt/kvm/arm/vgic/vgic-init.c+1−1

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

virt/kvm/arm/vgic/vgic-mmio-v2.c+5−0

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

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

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

virt/kvm/arm/vgic/vgic-v2.c+22−16

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

virt/kvm/arm/vgic/vgic-v3.c+29−20

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

virt/kvm/arm/vgic/vgic.c+25−27

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

virt/kvm/arm/vgic/vgic.h+14−0

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