History

Merge v4.18-rc3 into drm-next

Two requests have come in for a backmerge, and I've got some pull reqs on rc2, so this just makes sense.

Dave Airlie committed 8 years ago

Commit f29135e2 parents eab9766 021c917702 files · +6937 −3712Browse files

Unified · Split

702 files
  1. Documentation/admin-guide/pm/intel_pstate.rst +13 −3
  2. Documentation/core-api/kernel-api.rst +1 −1
  3. Documentation/devicetree/bindings/input/sprd,sc27xx-vibra.txt +23 −0
  4. Documentation/driver-api/infrastructure.rst +2 −2
  5. Documentation/filesystems/Locking +1 −6
  6. Documentation/filesystems/cifs/AUTHORS +4 −3
  7. Documentation/filesystems/cifs/CHANGES +3 −0
  8. Documentation/filesystems/cifs/TODO +9 −8
  9. Documentation/filesystems/vfs.txt +0 −13
  10. Documentation/kbuild/kconfig-language.txt +6 −0
  11. Documentation/networking/e100.rst +57 −55
  12. Documentation/networking/e1000.rst +39 −37
  13. Documentation/networking/strparser.txt +1 −1
  14. Documentation/trace/histogram.txt +12 −11
  15. Documentation/usb/gadget_configfs.txt +1 −1
  16. Documentation/virtual/kvm/api.txt +1 −1
  17. MAINTAINERS +36 −14
  18. Makefile +1 −1
  19. arch/alpha/Kconfig +0 −5
  20. arch/alpha/lib/Makefile +0 −2
  21. arch/alpha/lib/dec_and_lock.c +0 −44
  22. arch/arm/Kconfig +7 −1
  23. arch/arm/boot/dts/armada-385-synology-ds116.dts +1 −1
  24. arch/arm/boot/dts/bcm-cygnus.dtsi +12 −12
  25. arch/arm/boot/dts/bcm-hr2.dtsi +12 −12
  26. arch/arm/boot/dts/bcm-nsp.dtsi +16 −16
  27. arch/arm/boot/dts/bcm5301x.dtsi +1 −1
  28. arch/arm/boot/dts/da850.dtsi +1 −5
  29. arch/arm/boot/dts/imx6q.dtsi +1 −1
  30. arch/arm/boot/dts/imx6sx.dtsi +1 −1
  31. arch/arm/boot/dts/socfpga.dtsi +2 −2
  32. arch/arm/boot/dts/socfpga_arria10.dtsi +2 −3
  33. arch/arm/common/Makefile +1 −1
  34. arch/arm/configs/multi_v7_defconfig +155 −223
  35. arch/arm/kernel/signal.c +2 −2
  36. arch/arm/mach-bcm/Kconfig +1 −0
  37. arch/arm/mach-davinci/board-da850-evm.c +1 −1
  38. arch/arm/mach-socfpga/Kconfig +1 −0
  39. arch/arm/xen/enlighten.c +4 −3
  40. arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi +2 −4
  41. arch/arm64/boot/dts/amlogic/meson-axg-s400.dts +14 −1
  42. arch/arm64/boot/dts/amlogic/meson-axg.dtsi +2 −2
  43. arch/arm64/boot/dts/amlogic/meson-gx.dtsi +9 −3
  44. arch/arm64/boot/dts/amlogic/meson-gxl-mali.dtsi +1 −1
  45. arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts +0 −3
  46. arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dtsi +7 −0
  47. arch/arm64/boot/dts/amlogic/meson-gxl.dtsi +0 −8
  48. arch/arm64/boot/dts/broadcom/northstar2/ns2.dtsi +4 −4
  49. arch/arm64/boot/dts/broadcom/stingray/bcm958742k.dts +4 −0
  50. arch/arm64/boot/dts/broadcom/stingray/bcm958742t.dts +4 −0
  51. arch/arm64/boot/dts/broadcom/stingray/stingray.dtsi +2 −2
  52. arch/arm64/boot/dts/hisilicon/hi3660-hikey960.dts +2 −0
  53. arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts +2 −0
  54. arch/arm64/boot/dts/marvell/armada-cp110.dtsi +1 −1
  55. arch/arm64/boot/dts/qcom/apq8096-db820c.dtsi +1 −1
  56. arch/arm64/boot/dts/qcom/msm8916.dtsi +2 −2
  57. arch/arm64/boot/dts/socionext/uniphier-ld11-global.dts +1 −1
  58. arch/arm64/boot/dts/socionext/uniphier-ld20-global.dts +1 −1
  59. arch/arm64/configs/defconfig +39 −63
  60. arch/arm64/crypto/aes-glue.c +1 −1
  61. arch/arm64/include/asm/alternative.h +6 −1
  62. arch/arm64/include/asm/kvm_host.h +1 −0
  63. arch/arm64/include/asm/pgtable.h +1 −5
  64. arch/arm64/include/asm/sysreg.h +11 −0
  65. arch/arm64/kernel/alternative.c +44 −7
  66. arch/arm64/kernel/cpufeature.c +1 −1
  67. arch/arm64/kernel/module.c +2 −3
  68. arch/arm64/kernel/smp.c +1 −1
  69. arch/arm64/kvm/fpsimd.c +27 −9
  70. arch/arm64/mm/dma-mapping.c +5 −4
  71. arch/arm64/mm/proc.S +3 −2
  72. arch/microblaze/Kconfig.debug +0 −7
  73. arch/microblaze/include/asm/setup.h +0 −5
  74. arch/microblaze/include/asm/unistd.h +1 −1
  75. arch/microblaze/include/uapi/asm/unistd.h +2 −0
  76. arch/microblaze/kernel/Makefile +1 −3
  77. arch/microblaze/kernel/heartbeat.c +0 −72
  78. arch/microblaze/kernel/platform.c +0 −29
  79. arch/microblaze/kernel/reset.c +6 −5
  80. arch/microblaze/kernel/syscall_table.S +2 −0
  81. arch/microblaze/kernel/timer.c +0 −7
  82. arch/mips/Kconfig +1 −0
  83. arch/mips/ath79/mach-pb44.c +1 −1
  84. arch/mips/bcm47xx/setup.c +6 −0
  85. arch/mips/include/asm/io.h +2 −0
  86. arch/mips/include/asm/mipsregs.h +3 −0
  87. arch/mips/include/uapi/asm/unistd.h +12 −6
  88. arch/mips/kernel/entry.S +8 −0
  89. arch/mips/kernel/mcount.S +12 −15
  90. arch/mips/kernel/scall32-o32.S +2 −0
  91. arch/mips/kernel/scall64-64.S +2 −0
  92. arch/mips/kernel/scall64-n32.S +2 −0
  93. arch/mips/kernel/scall64-o32.S +2 −0
  94. arch/mips/kernel/signal.c +3 −0
  95. arch/parisc/Kconfig +3 −3
  96. arch/parisc/Makefile +0 −4
  97. arch/parisc/include/asm/signal.h +0 −8
  98. arch/parisc/include/uapi/asm/unistd.h +2 −1
  99. arch/parisc/kernel/drivers.c +9 −16
  100. arch/parisc/kernel/syscall_table.S +1 −0
  101. arch/parisc/kernel/unwind.c +2 −2
  102. arch/powerpc/Makefile +1 −0
  103. arch/powerpc/include/asm/book3s/32/pgalloc.h +1 −1
  104. arch/powerpc/include/asm/book3s/64/pgtable-4k.h +21 −0
  105. arch/powerpc/include/asm/book3s/64/pgtable-64k.h +9 −0
  106. arch/powerpc/include/asm/book3s/64/pgtable.h +5 −0
  107. arch/powerpc/include/asm/nmi.h +1 −1
  108. arch/powerpc/include/asm/nohash/32/pgalloc.h +1 −1
  109. arch/powerpc/include/asm/nohash/64/pgalloc.h +1 −0
  110. arch/powerpc/include/asm/systbl.h +1 −0
  111. arch/powerpc/include/asm/unistd.h +1 −1
  112. arch/powerpc/include/uapi/asm/unistd.h +1 −0
  113. arch/powerpc/kernel/dt_cpu_ftrs.c +2 −1
  114. arch/powerpc/kernel/pci_32.c +0 −4
  115. arch/powerpc/kernel/pci_64.c +0 −4
  116. arch/powerpc/kernel/rtas.c +0 −4
  117. arch/powerpc/kernel/setup-common.c +10 −2
  118. arch/powerpc/kernel/setup_64.c +8 −0
  119. arch/powerpc/kernel/signal.c +2 −2
  120. arch/powerpc/kernel/signal_32.c +0 −8
  121. arch/powerpc/kernel/signal_64.c +0 −4
  122. arch/powerpc/kernel/smp.c +0 −6
  123. arch/powerpc/kernel/stacktrace.c +2 −2
  124. arch/powerpc/kernel/syscalls.c +0 −4
  125. arch/powerpc/mm/hugetlbpage.c +2 −1
  126. arch/powerpc/mm/pgtable-book3s64.c +12 −0
  127. arch/powerpc/mm/subpage-prot.c +0 −4
  128. arch/powerpc/mm/tlb-radix.c +77 −21
  129. arch/powerpc/platforms/powermac/time.c +20 −9
  130. arch/s390/include/asm/css_chars.h +32 −30
  131. arch/x86/Makefile +0 −6
  132. arch/x86/boot/compressed/eboot.c +1 −1
  133. arch/x86/entry/common.c +1 −1
  134. arch/x86/entry/entry_32.S +1 −1
  135. arch/x86/entry/entry_64_compat.S +8 −8
  136. arch/x86/include/asm/barrier.h +1 −1
  137. arch/x86/include/asm/pgalloc.h +3 −0
  138. arch/x86/include/asm/pgtable.h +1 −1
  139. arch/x86/include/asm/pgtable_64.h +2 −2
  140. arch/x86/include/asm/vmx.h +3 −0
  141. arch/x86/kernel/apic/x2apic_uv_x.c +57 −3
  142. arch/x86/kernel/cpu/bugs.c +4 −0
  143. arch/x86/kernel/cpu/cacheinfo.c +1 −1
  144. arch/x86/kernel/cpu/common.c +3 −0
  145. arch/x86/kernel/cpu/mcheck/mce-severity.c +5 −0
  146. arch/x86/kernel/cpu/mcheck/mce.c +28 −16
  147. arch/x86/kernel/cpu/microcode/intel.c +4 −1
  148. arch/x86/kernel/e820.c +12 −3
  149. arch/x86/kernel/head64.c +1 −1
  150. arch/x86/kernel/quirks.c +9 −2
  151. arch/x86/kernel/signal.c +1 −1
  152. arch/x86/kernel/traps.c +8 −6
  153. arch/x86/kernel/uprobes.c +1 −1
  154. arch/x86/kvm/vmx.c +67 −0
  155. arch/x86/kvm/x86.h +9 −0
  156. arch/x86/mm/fault.c +7 −14
  157. arch/x86/mm/init_64.c +16 −4
  158. arch/x86/platform/efi/efi_64.c +2 −2
  159. arch/x86/xen/enlighten.c +7 −0
  160. arch/x86/xen/enlighten_pv.c +1 −0
  161. arch/x86/xen/enlighten_pvh.c +1 −0
  162. arch/x86/xen/smp_pv.c +5 −0
  163. block/bio.c +0 −3
  164. block/blk-core.c +5 −7
  165. block/blk-mq-debugfs.c +1 −1
  166. block/blk-mq.c +12 −1
  167. block/blk-softirq.c +1 −0
  168. block/blk-timeout.c +1 −0
  169. block/sed-opal.c +2 −2
  170. certs/blacklist.h +1 −1
  171. crypto/af_alg.c +10 −3
  172. crypto/algif_aead.c +2 −2
  173. crypto/algif_skcipher.c +2 −2
  174. crypto/asymmetric_keys/x509_cert_parser.c +9 −0
  175. crypto/morus640.c +2 −1
  176. crypto/sha3_generic.c +1 −1
  177. drivers/acpi/acpi_lpss.c +11 −7
  178. drivers/acpi/ec.c +20 −0
  179. drivers/acpi/osl.c +72 −0
  180. drivers/base/Makefile +0 −3
  181. drivers/base/core.c +11 −4
  182. drivers/base/power/domain.c +3 −4
  183. drivers/block/drbd/drbd_req.c +2 −2
  184. drivers/block/nbd.c +34 −8
  185. drivers/block/null_blk.c +1 −1
  186. drivers/bluetooth/hci_nokia.c +1 −1
  187. drivers/char/hw_random/core.c +9 −2
  188. drivers/char/random.c +13 −16
  189. drivers/clocksource/timer-stm32.c +3 −1
  190. drivers/cpufreq/intel_pstate.c +22 −5
  191. drivers/cpufreq/qcom-cpufreq-kryo.c +26 −7
  192. drivers/crypto/chelsio/chtls/chtls_io.c +2 −3
  193. drivers/dax/super.c +8 −0
  194. drivers/firmware/dmi-id.c +2 −0
  195. drivers/firmware/dmi_scan.c +1 −0
  196. drivers/firmware/efi/libstub/tpm.c +1 −1
  197. drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +9 −1
  198. drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c +1 −1
  199. drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +10 −14
  200. drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h +1 −0
  201. drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +7 −7
  202. drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.h +1 −1
  203. drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +27 −6
  204. drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +5 −3
  205. drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c +36 −3
  206. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +8 −8
  207. drivers/gpu/drm/amd/powerplay/hwmgr/vega10_powertune.c +1 −1
  208. drivers/gpu/drm/arm/malidp_drv.c +2 −1
  209. drivers/gpu/drm/arm/malidp_hw.c +2 −1
  210. drivers/gpu/drm/arm/malidp_planes.c +6 −3
  211. drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c +1 −1
  212. drivers/gpu/drm/bridge/sil-sii8620.c +117 −192
  213. drivers/gpu/drm/drm_drv.c +7 −7
  214. drivers/gpu/drm/i915/i915_drv.h +0 −3
  215. drivers/gpu/drm/meson/meson_drv.c +8 −4
  216. drivers/gpu/drm/nouveau/dispnv50/curs507a.c +1 −1
  217. drivers/gpu/drm/nouveau/dispnv50/wndw.c +8 −5
  218. drivers/gpu/drm/qxl/qxl_display.c +5 −2
  219. drivers/gpu/drm/sun4i/sun4i_tcon.c +0 −25
  220. drivers/hid/hid-google-hammer.c +2 −0
  221. drivers/hid/hid-ids.h +1 −0
  222. drivers/hid/hid-steam.c +5 −5
  223. drivers/hid/intel-ish-hid/ipc/pci-ish.c +7 −15
  224. drivers/hid/wacom_sys.c +8 −0
  225. drivers/hwmon/dell-smm-hwmon.c +7 −0
  226. drivers/hwmon/nct6775.c +1 −1
  227. drivers/i2c/algos/i2c-algo-bit.c +4 −4
  228. drivers/i2c/busses/i2c-gpio.c +2 −2
  229. drivers/i2c/i2c-core-smbus.c +9 −5
  230. drivers/iio/accel/mma8452.c +1 −1
  231. drivers/iio/imu/inv_mpu6050/inv_mpu_core.c +2 −0
  232. drivers/iio/light/tsl2772.c +2 −0
  233. drivers/iio/pressure/bmp280-core.c +2 −3
  234. drivers/infiniband/core/uverbs_main.c +10 −4
  235. drivers/infiniband/core/verbs.c +8 −6
  236. drivers/infiniband/hw/mlx4/mr.c +5 −2
  237. drivers/infiniband/hw/mlx5/main.c +21 −15
  238. drivers/infiniband/hw/qedr/verbs.c +3 −0
  239. drivers/infiniband/sw/rxe/rxe_req.c +4 −1
  240. drivers/input/input-mt.c +8 −4
  241. drivers/input/joystick/xpad.c +1 −1
  242. drivers/input/keyboard/goldfish_events.c +5 −4
  243. drivers/input/misc/Kconfig +10 −0
  244. drivers/input/misc/Makefile +1 −0
  245. drivers/input/misc/sc27xx-vibra.c +154 −0
  246. drivers/input/mouse/elan_i2c.h +2 −0
  247. drivers/input/mouse/elan_i2c_core.c +2 −1
  248. drivers/input/mouse/elan_i2c_smbus.c +8 −2
  249. drivers/input/mouse/elantech.c +9 −2
  250. drivers/input/mouse/psmouse-base.c +6 −6
  251. drivers/input/rmi4/Kconfig +1 −0
  252. drivers/input/rmi4/rmi_2d_sensor.c +16 −18
  253. drivers/input/rmi4/rmi_bus.c +49 −1
  254. drivers/input/rmi4/rmi_bus.h +9 −1
  255. drivers/input/rmi4/rmi_driver.c +20 −32
  256. drivers/input/rmi4/rmi_f01.c +5 −5
  257. drivers/input/rmi4/rmi_f03.c +5 −4
  258. drivers/input/rmi4/rmi_f11.c +16 −26
  259. drivers/input/rmi4/rmi_f12.c +4 −4
  260. drivers/input/rmi4/rmi_f30.c +5 −4
  261. drivers/input/rmi4/rmi_f34.c +3 −2
  262. drivers/input/rmi4/rmi_f54.c +0 −6
  263. drivers/input/touchscreen/silead.c +1 −0
  264. drivers/irqchip/irq-gic-v2m.c +1 −1
  265. drivers/irqchip/irq-gic-v3-its.c +50 −12
  266. drivers/irqchip/irq-ls-scfg-msi.c +7 −3
  267. drivers/isdn/mISDN/socket.c +1 −1
  268. drivers/lightnvm/Kconfig +1 −1
  269. drivers/md/dm-raid.c +1 −1
  270. drivers/md/dm-table.c +4 −3
  271. drivers/md/dm-thin-metadata.c +0 −9
  272. drivers/md/dm-thin.c +9 −2
  273. drivers/md/dm-writecache.c +5 −5
  274. drivers/md/dm-zoned-target.c +1 −1
  275. drivers/md/dm.c +3 −5
  276. drivers/mtd/chips/cfi_cmdset_0002.c +11 −8
  277. drivers/mtd/devices/mtd_dataflash.c +2 −2
  278. drivers/mtd/nand/raw/denali_dt.c +5 −1
  279. drivers/mtd/nand/raw/mxc_nand.c +4 −1
  280. drivers/mtd/nand/raw/nand_base.c +1 −1
  281. drivers/mtd/nand/raw/nand_macronix.c +36 −12
  282. drivers/mtd/nand/raw/nand_micron.c +2 −0
  283. drivers/net/ethernet/amd/Kconfig +1 −1
  284. drivers/net/ethernet/apm/xgene-v2/Kconfig +0 −1
  285. drivers/net/ethernet/apm/xgene/Kconfig +0 −1
  286. drivers/net/ethernet/arc/Kconfig +4 −2
  287. drivers/net/ethernet/broadcom/Kconfig +0 −2
  288. drivers/net/ethernet/cadence/macb_ptp.c +1 −4
  289. drivers/net/ethernet/calxeda/Kconfig +1 −1
  290. drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +1 −1
  291. drivers/net/ethernet/cisco/enic/enic_clsf.c +1 −2
  292. drivers/net/ethernet/cisco/enic/enic_main.c +6 −6
  293. drivers/net/ethernet/faraday/ftgmac100.c +2 −2
  294. drivers/net/ethernet/hisilicon/Kconfig +1 −1
  295. drivers/net/ethernet/intel/i40e/i40e_txrx.c +3 −4
  296. drivers/net/ethernet/marvell/Kconfig +3 −5
  297. drivers/net/ethernet/marvell/mvneta.c +1 −1
  298. drivers/net/ethernet/mellanox/mlxsw/Kconfig +1 −1
  299. drivers/net/ethernet/mscc/ocelot.c +6 −5
  300. drivers/net/ethernet/qlogic/qed/qed_dcbx.c +4 −7
  301. drivers/net/ethernet/qlogic/qed/qed_ll2.c +9 −2
  302. drivers/net/ethernet/qlogic/qed/qed_main.c +10 −2
  303. drivers/net/ethernet/realtek/r8169.c +1 −1
  304. drivers/net/ethernet/renesas/Kconfig +0 −2
  305. drivers/net/ethernet/sfc/efx.c +1 −0
  306. drivers/net/ethernet/stmicro/stmmac/Kconfig +1 −1
  307. drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c +14 −4
  308. drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +10 −0
  309. drivers/net/ethernet/sun/sungem.c +12 −10
  310. drivers/net/ethernet/ti/davinci_cpdma.c +1 −1
  311. drivers/net/ethernet/ti/davinci_emac.c +17 −2
  312. drivers/net/hamradio/bpqether.c +2 −6
  313. drivers/net/ipvlan/ipvlan_main.c +3 −1
  314. drivers/net/net_failover.c +1 −1
  315. drivers/net/ppp/pppoe.c +1 −1
  316. drivers/net/usb/cdc_ncm.c +1 −2
  317. drivers/net/usb/qmi_wwan.c +1 −0
  318. drivers/net/wireless/broadcom/brcm80211/Kconfig +0 −1
  319. drivers/net/wireless/quantenna/qtnfmac/Kconfig +1 −1
  320. drivers/net/xen-netfront.c +6 −5
  321. drivers/nfc/pn533/usb.c +2 −2
  322. drivers/nvdimm/pmem.c +2 −1
  323. drivers/nvme/host/core.c +1 −0
  324. drivers/nvme/host/fc.c +3 −3
  325. drivers/nvme/host/nvme.h +1 −0
  326. drivers/nvme/host/pci.c +38 −6
  327. drivers/nvme/host/rdma.c +40 −36
  328. drivers/nvme/target/core.c +8 −0
  329. drivers/opp/core.c +1 −1
  330. drivers/pci/Makefile +3 −3
  331. drivers/pci/controller/Kconfig +0 −3
  332. drivers/pci/hotplug/acpi_pcihp.c +9 −1
  333. drivers/perf/xgene_pmu.c +1 −1
  334. drivers/pinctrl/actions/pinctrl-owl.c +1 −1
  335. drivers/pinctrl/devicetree.c +5 −2
  336. drivers/pinctrl/mediatek/pinctrl-mt7622.c +5 −1
  337. drivers/pinctrl/mediatek/pinctrl-mtk-common.c +0 −5
  338. drivers/pinctrl/pinctrl-single.c +11 −3
  339. drivers/ptp/ptp_chardev.c +2 −2
  340. drivers/ptp/ptp_qoriq.c +1 −1
  341. drivers/s390/block/dasd.c +56 −115
  342. drivers/s390/block/dasd_alias.c +3 −3
  343. drivers/s390/block/dasd_diag.c +2 −1
  344. drivers/s390/block/dasd_eckd.c +25 −21
  345. drivers/s390/block/dasd_eer.c +5 −5
  346. drivers/s390/block/dasd_fba.c +4 −2
  347. drivers/s390/block/dasd_int.h +5 −21
  348. drivers/s390/cio/Makefile +1 −0
  349. drivers/s390/cio/vfio_ccw_cp.c +75 −65
  350. drivers/s390/cio/vfio_ccw_drv.c +4 −1
  351. drivers/s390/cio/vfio_ccw_fsm.c +16 −1
  352. drivers/s390/cio/vfio_ccw_trace.h +54 −0
  353. drivers/scsi/ipr.c +0 −2
  354. drivers/scsi/qla2xxx/qla_target.c +3 −4
  355. drivers/scsi/scsi_debug.c +1 −1
  356. drivers/scsi/scsi_transport_fc.c +1 −1
  357. drivers/scsi/xen-scsifront.c +26 −7
  358. drivers/soc/imx/gpcv2.c +9 −4
  359. drivers/soc/qcom/Kconfig +2 −1
  360. drivers/soc/renesas/rcar-sysc.c +29 −6
  361. drivers/staging/android/ion/ion_heap.c +1 −1
  362. drivers/staging/comedi/drivers/quatech_daqp_cs.c +1 −1
  363. drivers/staging/typec/Kconfig +1 −0
  364. drivers/target/target_core_user.c +36 −8
  365. drivers/tty/n_tty.c +32 −23
  366. drivers/tty/serdev/core.c +1 −0
  367. drivers/tty/serial/8250/8250_pci.c +0 −2
  368. drivers/tty/vt/vt.c +2 −2
  369. drivers/usb/chipidea/host.c +4 −1
  370. drivers/usb/class/cdc-acm.c +3 −0
  371. drivers/usb/dwc2/core.h +3 −0
  372. drivers/usb/dwc2/gadget.c +12 −8
  373. drivers/usb/dwc2/hcd.c +87 −6
  374. drivers/usb/dwc2/hcd.h +8 −0
  375. drivers/usb/dwc2/hcd_intr.c +9 −2
  376. drivers/usb/dwc2/hcd_queue.c +4 −1
  377. drivers/usb/dwc3/core.c +13 −10
  378. drivers/usb/dwc3/dwc3-of-simple.c +2 −1
  379. drivers/usb/dwc3/dwc3-pci.c +2 −0
  380. drivers/usb/dwc3/dwc3-qcom.c +5 −8
  381. drivers/usb/gadget/composite.c +3 −0
  382. drivers/usb/gadget/function/f_fs.c +18 −8
  383. drivers/usb/host/xhci-mem.c +2 −2
  384. drivers/usb/host/xhci-tegra.c +3 −3
  385. drivers/usb/host/xhci-trace.h +31 −5
  386. drivers/usb/host/xhci.c +43 −4
  387. drivers/usb/host/xhci.h +4 −0
  388. drivers/usb/serial/cp210x.c +14 −0
  389. drivers/usb/typec/tcpm.c +6 −4
  390. drivers/usb/typec/ucsi/ucsi.c +13 −0
  391. drivers/usb/typec/ucsi/ucsi_acpi.c +5 −0
  392. drivers/vhost/net.c +2 −1
  393. drivers/xen/Makefile +1 −1
  394. drivers/xen/events/events_base.c +0 −2
  395. drivers/xen/grant-table.c +2 −2
  396. drivers/xen/manage.c +15 −3
  397. drivers/xen/privcmd-buf.c +210 −0
  398. drivers/xen/privcmd.c +9 −0
  399. drivers/xen/privcmd.h +3 −0
  400. drivers/xen/xen-scsiback.c +13 −3
  401. fs/aio.c +1 −147
  402. fs/btrfs/extent_io.c +4 −1
  403. fs/btrfs/inode.c +5 −2
  404. fs/btrfs/ioctl.c +5 −5
  405. fs/btrfs/qgroup.c +13 −4
  406. fs/ceph/inode.c +1 −0
  407. fs/cifs/cifs_debug.c +29 −0
  408. fs/cifs/cifsencrypt.c +15 −5
  409. fs/cifs/cifsglob.h +37 −3
  410. fs/cifs/cifsproto.h +2 −5
  411. fs/cifs/cifssmb.c +4 −4
  412. fs/cifs/connect.c +4 −4
  413. fs/cifs/inode.c +11 −2
  414. fs/cifs/misc.c +6 −3
  415. fs/cifs/smb2misc.c +17 −2
  416. fs/cifs/smb2ops.c +210 −67
  417. fs/cifs/smb2pdu.c +284 −49
  418. fs/cifs/smb2pdu.h +20 −3
  419. fs/cifs/smb2proto.h +6 −0
  420. fs/cifs/smb2transport.c +7 −11
  421. fs/cifs/smbdirect.c +5 −14
  422. fs/cifs/trace.h +2 −1
  423. fs/cifs/transport.c +78 −95
  424. fs/eventfd.c +6 −13
  425. fs/eventpoll.c +5 −10
  426. fs/ext2/ext2.h +0 −2
  427. fs/ext2/super.c +3 −3
  428. fs/jfs/xattr.c +6 −4
  429. fs/nfs/delegation.c +3 −1
  430. fs/nfs/flexfilelayout/flexfilelayout.c +16 −5
  431. fs/nfs/nfs4proc.c +26 −7
  432. fs/nfs/pnfs.h +5 −0
  433. fs/pipe.c +9 −13
  434. fs/proc/base.c +23 −5
  435. fs/proc/generic.c +10 −1
  436. fs/quota/dquot.c +2 −5
  437. fs/select.c +0 −23
  438. fs/timerfd.c +11 −11
  439. fs/udf/balloc.c +2 −3
  440. fs/udf/directory.c +4 −4
  441. fs/udf/inode.c +4 −4
  442. fs/udf/namei.c +3 −11
  443. fs/udf/udfdecl.h +7 −2
  444. fs/xfs/libxfs/xfs_ag_resv.c +27 −4
  445. fs/xfs/libxfs/xfs_bmap.c +26 −0
  446. fs/xfs/libxfs/xfs_bmap.h +2 −0
  447. fs/xfs/libxfs/xfs_format.h +5 −0
  448. fs/xfs/libxfs/xfs_inode_buf.c +47 −29
  449. fs/xfs/libxfs/xfs_rtbitmap.c +2 −2
  450. fs/xfs/xfs_bmap_util.c +52 −54
  451. fs/xfs/xfs_fsmap.c +2 −2
  452. fs/xfs/xfs_fsops.c +1 −1
  453. fs/xfs/xfs_inode.c +21 −36
  454. fs/xfs/xfs_iomap.c +14 −1
  455. fs/xfs/xfs_trans.c +6 −1
  456. include/acpi/processor.h +1 −2
  457. include/asm-generic/qspinlock_types.h +1 −1
  458. include/crypto/if_alg.h +2 −1
  459. include/linux/acpi.h +3 −0
  460. include/linux/atmdev.h +15 −0
  461. include/linux/backing-dev-defs.h +1 −1
  462. include/linux/blkdev.h +2 −2
  463. include/linux/bpf.h +12 −0
  464. include/linux/compat.h +7 −1
  465. include/linux/compiler-gcc.h +25 −0
  466. include/linux/compiler_types.h +18 −0
  467. include/linux/dax.h +1 −1
  468. include/linux/dma-contiguous.h +1 −1
  469. include/linux/filter.h +60 −23
  470. include/linux/fs.h +0 −2
  471. include/linux/iio/buffer-dma.h +1 −1
  472. include/linux/input/mt.h +1 −1
  473. include/linux/irq.h +1 −0
  474. include/linux/irqdesc.h +0 −5
  475. include/linux/kernel.h +1 −1
  476. include/linux/memory.h +1 −0
  477. include/linux/mod_devicetable.h +1 −0
  478. include/linux/net.h +0 −1
  479. include/linux/nfs_xdr.h +2 −0
  480. include/linux/pm_domain.h +3 −3
  481. include/linux/poll.h +6 −6
  482. include/linux/refcount.h +3 −1
  483. include/linux/rmi.h +2 −0
  484. include/linux/scatterlist.h +0 −18
  485. include/linux/sched.h +12 −11
  486. include/linux/skbuff.h +2 −1
  487. include/linux/slub_def.h +4 −0
  488. include/linux/spinlock.h +5 −0
  489. include/linux/syscalls.h +4 −0
  490. include/net/bluetooth/bluetooth.h +1 −1
  491. include/net/ip6_fib.h +3 −2
  492. include/net/iucv/af_iucv.h +2 −0
  493. include/net/sctp/sctp.h +2 −1
  494. include/net/tcp.h +2 −1
  495. include/net/tls.h +4 −2
  496. include/net/udp.h +1 −1
  497. include/rdma/ib_verbs.h +8 −5
  498. include/uapi/linux/aio_abi.h +4 −2
  499. include/uapi/linux/nbd.h +3 −0
  500. include/uapi/linux/target_core_user.h +3 −1
  501. include/xen/xen.h +5 −1
  502. init/Kconfig +3 −8
  503. kernel/Makefile +1 −0
  504. kernel/bpf/core.c +62 −7
  505. kernel/bpf/devmap.c +14 −0
  506. kernel/bpf/syscall.c +3 −9
  507. kernel/dma/Kconfig +50 −0
  508. kernel/dma/Makefile +11 −0
  509. kernel/dma/coherent.c +0 −0
  510. kernel/dma/contiguous.c +0 −0
  511. kernel/dma/debug.c +0 −0
  512. kernel/dma/direct.c +0 −0
  513. kernel/dma/mapping.c +1 −1
  514. kernel/dma/noncoherent.c +0 −0
  515. kernel/dma/swiotlb.c +1 −0
  516. kernel/dma/virt.c +0 −2
  517. kernel/events/core.c +1 −1
  518. kernel/events/ring_buffer.c +3 −3
  519. kernel/irq/debugfs.c +1 −0
  520. kernel/locking/lockdep.c +6 −6
  521. kernel/locking/rwsem.c +1 −0
  522. kernel/rseq.c +4 −3
  523. kernel/softirq.c +5 −1
  524. kernel/time/hrtimer.c +1 −1
  525. kernel/time/posix-cpu-timers.c +0 −2
  526. kernel/time/time.c +4 −2
  527. kernel/trace/trace.c +1 −5
  528. kernel/trace/trace_events_filter.c +9 −1
  529. lib/Kconfig +1 −46
  530. lib/Kconfig.kasan +1 −0
  531. lib/Makefile +1 −11
  532. lib/dec_and_lock.c +16 −0
  533. lib/percpu_ida.c +1 −1
  534. lib/refcount.c +28 −0
  535. lib/scatterlist.c +0 −6
  536. lib/test_printf.c +0 −7
  537. mm/backing-dev.c +7 −13
  538. mm/memblock.c +0 −1
  539. mm/slab_common.c +4 −0
  540. mm/slub.c +6 −1
  541. mm/vmstat.c +0 −2
  542. net/appletalk/ddp.c +1 −1
  543. net/atm/br2684.c +1 −2
  544. net/atm/clip.c +1 −2
  545. net/atm/common.c +9 −5
  546. net/atm/common.h +1 −1
  547. net/atm/lec.c +1 −2
  548. net/atm/mpc.c +1 −2
  549. net/atm/pppoatm.c +1 −2
  550. net/atm/pvc.c +1 −1
  551. net/atm/raw.c +2 −2
  552. net/atm/svc.c +1 −1
  553. net/ax25/af_ax25.c +1 −1
  554. net/bluetooth/af_bluetooth.c +5 −2
  555. net/bluetooth/hci_sock.c +1 −1
  556. net/bluetooth/l2cap_sock.c +1 −1
  557. net/bluetooth/rfcomm/sock.c +1 −1
  558. net/bluetooth/sco.c +1 −1
  559. net/bpfilter/.gitignore +1 −0
  560. net/bpfilter/Makefile +4 −2
  561. net/caif/caif_socket.c +8 −4
  562. net/can/bcm.c +1 −1
  563. net/can/raw.c +1 −1
  564. net/core/datagram.c +9 −4
  565. net/core/dev.c +2 −2
  566. net/core/filter.c +4 −17
  567. net/dccp/ccids/ccid3.c +9 −7
  568. net/dccp/dccp.h +2 −1
  569. net/dccp/ipv4.c +1 −1
  570. net/dccp/ipv6.c +1 −1
  571. net/dccp/proto.c +11 −2
  572. net/decnet/af_decnet.c +3 −3
  573. net/ieee802154/socket.c +2 −2
  574. net/ipv4/af_inet.c +4 −4
  575. net/ipv4/inet_hashtables.c +2 −2
  576. net/ipv4/ip_output.c +2 −1
  577. net/ipv4/tcp.c +17 −6
  578. net/ipv4/udp.c +5 −5
  579. net/ipv6/af_inet6.c +2 −2
  580. net/ipv6/inet6_hashtables.c +2 −2
  581. net/ipv6/ip6_fib.c +3 −2
  582. net/ipv6/ip6_output.c +2 −1
  583. net/ipv6/mcast.c +6 −3
  584. net/ipv6/raw.c +2 −2
  585. net/iucv/af_iucv.c +5 −2
  586. net/kcm/kcmsock.c +5 −5
  587. net/key/af_key.c +1 −1
  588. net/l2tp/l2tp_ip.c +1 −1
  589. net/l2tp/l2tp_ip6.c +1 −1
  590. net/l2tp/l2tp_ppp.c +1 −1
  591. net/llc/af_llc.c +1 −1
  592. net/ncsi/ncsi-aen.c +5 −5
  593. net/ncsi/ncsi-manage.c +22 −27
  594. net/netlink/af_netlink.c +1 −1
  595. net/netrom/af_netrom.c +1 −1
  596. net/nfc/llcp_sock.c +6 −3
  597. net/nfc/rawsock.c +2 −2
  598. net/packet/af_packet.c +12 −13
  599. net/phonet/socket.c +6 −3
  600. net/qrtr/qrtr.c +1 −1
  601. net/rose/af_rose.c +1 −1
  602. net/rxrpc/af_rxrpc.c +7 −3
  603. net/sched/act_ife.c +5 −7
  604. net/sched/cls_flower.c +17 −4
  605. net/sched/sch_blackhole.c +1 −1
  606. net/sched/sch_hfsc.c +2 −2
  607. net/sctp/chunk.c +3 −1
  608. net/sctp/ipv6.c +1 −1
  609. net/sctp/protocol.c +1 −1
  610. net/sctp/socket.c +3 −1
  611. net/smc/af_smc.c +9 −3
  612. net/socket.c +7 −43
  613. net/strparser/strparser.c +1 −4
  614. net/sunrpc/xprt.c +7 −3
  615. net/tipc/socket.c +9 −5
  616. net/tls/tls_main.c +1 −1
  617. net/tls/tls_sw.c +10 −9
  618. net/unix/af_unix.c +19 −11
  619. net/vmw_vsock/af_vsock.c +13 −6
  620. net/vmw_vsock/virtio_transport.c +1 −1
  621. net/x25/af_x25.c +1 −1
  622. net/xdp/xsk.c +7 −3
  623. scripts/Makefile.build +1 −1
  624. scripts/checkpatch.pl +0 −6
  625. scripts/gcc-x86_64-has-stack-protector.sh +1 −1
  626. scripts/kconfig/expr.h +3 −0
  627. scripts/kconfig/preprocess.c +1 −1
  628. scripts/kconfig/zconf.y +6 −2
  629. security/keys/dh.c +4 −2
  630. security/selinux/selinuxfs.c +33 −45
  631. security/smack/smack_lsm.c +1 −0
  632. sound/core/seq/seq_clientmgr.c +2 −1
  633. sound/core/timer.c +1 −1
  634. sound/pci/hda/hda_codec.c +3 −2
  635. sound/pci/hda/hda_codec.h +1 −0
  636. sound/pci/hda/patch_ca0132.c +23 −41
  637. sound/pci/hda/patch_hdmi.c +5 −0
  638. sound/pci/hda/patch_realtek.c +17 −3
  639. sound/pci/lx6464es/lx6464es.c +1 −0
  640. tools/arch/arm/include/uapi/asm/kvm.h +1 −0
  641. tools/arch/arm64/include/uapi/asm/kvm.h +1 −0
  642. tools/arch/powerpc/include/uapi/asm/kvm.h +1 −0
  643. tools/arch/powerpc/include/uapi/asm/unistd.h +1 −0
  644. tools/arch/x86/include/asm/cpufeatures.h +2 −0
  645. tools/bpf/bpftool/perf.c +3 −2
  646. tools/bpf/bpftool/prog.c +3 −1
  647. tools/include/uapi/drm/drm.h +7 −0
  648. tools/include/uapi/linux/bpf.h +1 −1
  649. tools/include/uapi/linux/if_link.h +2 −0
  650. tools/include/uapi/linux/kvm.h +1 −0
  651. tools/objtool/check.c +1 −0
  652. tools/perf/Documentation/perf-stat.txt +3 −0
  653. tools/perf/arch/powerpc/util/skip-callchain-idx.c +1 −1
  654. tools/perf/arch/x86/entry/syscalls/syscall_64.tbl +2 −0
  655. tools/perf/bench/numa.c +3 −2
  656. tools/perf/builtin-annotate.c +10 −1
  657. tools/perf/builtin-c2c.c +5 −5
  658. tools/perf/builtin-report.c +2 −1
  659. tools/perf/builtin-script.c +39 −3
  660. tools/perf/builtin-stat.c +28 −20
  661. tools/perf/tests/parse-events.c +20 −5
  662. tools/perf/tests/topology.c +1 −0
  663. tools/perf/ui/gtk/hists.c +1 −1
  664. tools/perf/util/c++/clang.cpp +9 −2
  665. tools/perf/util/header.c +10 −2
  666. tools/perf/util/hist.c +8 −4
  667. tools/perf/util/hist.h +2 −2
  668. tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c +1 −1
  669. tools/perf/util/parse-events.y +5 −0
  670. tools/perf/util/pmu.c +97 −2
  671. tools/perf/util/sort.h +3 −1
  672. tools/power/x86/turbostat/turbostat.8 +1 −1
  673. tools/power/x86/turbostat/turbostat.c +166 −74
  674. tools/testing/selftests/bpf/config +10 −0
  675. tools/testing/selftests/bpf/test_offload.py +10 −2
  676. tools/testing/selftests/bpf/test_tunnel.sh +14 −12
  677. tools/testing/selftests/net/.gitignore +1 −0
  678. tools/testing/selftests/net/config +2 −0
  679. tools/testing/selftests/pstore/pstore_post_reboot_tests +4 −1
  680. tools/testing/selftests/rseq/param_test.c +24 −0
  681. tools/testing/selftests/rseq/rseq-arm.h +1 −0
  682. tools/testing/selftests/rseq/rseq-mips.h +725 −0
  683. tools/testing/selftests/rseq/rseq.h +2 −0
  684. tools/testing/selftests/rseq/run_param_test.sh +0 −0
  685. tools/testing/selftests/sparc64/Makefile +12 −8
  686. tools/testing/selftests/sparc64/drivers/Makefile +1 −1
  687. tools/testing/selftests/static_keys/test_static_keys.sh +13 −0
  688. tools/testing/selftests/sync/config +4 −0
  689. tools/testing/selftests/sysctl/sysctl.sh +13 −7
  690. tools/testing/selftests/user/test_user_copy.sh +7 −0
  691. tools/testing/selftests/vm/compaction_test.c +3 −1
  692. tools/testing/selftests/vm/mlock2-tests.c +7 −5
  693. tools/testing/selftests/vm/run_vmtests +4 −1
  694. tools/testing/selftests/vm/userfaultfd.c +3 −1
  695. tools/testing/selftests/x86/sigreturn.c +36 −23
  696. tools/testing/selftests/zram/zram.sh +4 −1
  697. tools/testing/selftests/zram/zram_lib.sh +4 −1
  698. tools/virtio/linux/scatterlist.h +0 −18
  699. virt/kvm/Kconfig +1 −1
  700. virt/kvm/arm/mmu.c +2 −0
  701. virt/kvm/arm/vgic/vgic-v3.c +0 −5
  702. virt/kvm/kvm_main.c +9 −10
Documentation/admin-guide/pm/intel_pstate.rst+13−3
@@ -324,8 +324,7 @@ Global Attributes · 323 unmodified lines
324324
325325 ``intel_pstate`` exposes several global attributes (files) in ``sysfs`` to
326326 control its functionality at the system level. They are located in the
327−``/sys/devices/system/cpu/cpufreq/intel_pstate/`` directory and affect all
328−CPUs.
327+``/sys/devices/system/cpu/intel_pstate/`` directory and affect all CPUs.
329328
330329 Some of them are not present if the ``intel_pstate=per_cpu_perf_limits``
331330 argument is passed to the kernel in the command line.
@@ -379,6 +378,17 @@ argument is passed to the kernel in the command line. · 47 unmodified lines
379378 but it affects the maximum possible value of per-policy P-state limits
380379 (see `Interpretation of Policy Attributes`_ below for details).
381380
381+``hwp_dynamic_boost``
382+ This attribute is only present if ``intel_pstate`` works in the
383+ `active mode with the HWP feature enabled <Active Mode With HWP_>`_ in
384+ the processor. If set (equal to 1), it causes the minimum P-state limit
385+ to be increased dynamically for a short time whenever a task previously
386+ waiting on I/O is selected to run on a given logical CPU (the purpose
387+ of this mechanism is to improve performance).
388+
389+ This setting has no effect on logical CPUs whose minimum P-state limit
390+ is directly set to the highest non-turbo P-state or above it.
391+
382392 .. _status_attr:
383393
384394 ``status``
@@ -410,7 +420,7 @@ argument is passed to the kernel in the command line. · 25 unmodified lines
410420 That only is supported in some configurations, though (for example, if
411421 the `HWP feature is enabled in the processor <Active Mode With HWP_>`_,
412422 the operation mode of the driver cannot be changed), and if it is not
413− supported in the current configuration, writes to this attribute with
423+ supported in the current configuration, writes to this attribute will
414424 fail with an appropriate error.
415425
416426 Interpretation of Policy Attributes
Documentation/core-api/kernel-api.rst+1−1
@@ -284,7 +284,7 @@ Resources Management · 283 unmodified lines
284284 MTRR Handling
285285 -------------
286286
287−.. kernel-doc:: arch/x86/kernel/cpu/mtrr/main.c
287+.. kernel-doc:: arch/x86/kernel/cpu/mtrr/mtrr.c
288288 :export:
289289
290290 Security Framework
Documentation/devicetree/bindings/input/sprd,sc27xx-vibra.txt+23−0
@@ -0,0 +1,23 @@
1+Spreadtrum SC27xx PMIC Vibrator
2+
3+Required properties:
4+- compatible: should be "sprd,sc2731-vibrator".
5+- reg: address of vibrator control register.
6+
7+Example :
8+
9+ sc2731_pmic: pmic@0 {
10+ compatible = "sprd,sc2731";
11+ reg = <0>;
12+ spi-max-frequency = <26000000>;
13+ interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;
14+ interrupt-controller;
15+ #interrupt-cells = <2>;
16+ #address-cells = <1>;
17+ #size-cells = <0>;
18+
19+ vibrator@eb4 {
20+ compatible = "sprd,sc2731-vibrator";
21+ reg = <0xeb4>;
22+ };
23+ };
Documentation/driver-api/infrastructure.rst+2−2
@@ -49,10 +49,10 @@ Device Drivers Base · 48 unmodified lines
4949 Device Drivers DMA Management
5050 -----------------------------
5151
52−.. kernel-doc:: drivers/base/dma-coherent.c
52+.. kernel-doc:: kernel/dma/coherent.c
5353 :export:
5454
55−.. kernel-doc:: drivers/base/dma-mapping.c
55+.. kernel-doc:: kernel/dma/mapping.c
5656 :export:
5757
5858 Device drivers PnP support
Documentation/filesystems/Locking+1−6
@@ -441,8 +441,6 @@ prototypes: · 440 unmodified lines
441441 int (*iterate) (struct file *, struct dir_context *);
442442 int (*iterate_shared) (struct file *, struct dir_context *);
443443 __poll_t (*poll) (struct file *, struct poll_table_struct *);
444− struct wait_queue_head * (*get_poll_head)(struct file *, __poll_t);
445− __poll_t (*poll_mask) (struct file *, __poll_t);
446444 long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long);
447445 long (*compat_ioctl) (struct file *, unsigned int, unsigned long);
448446 int (*mmap) (struct file *, struct vm_area_struct *);
@@ -473,7 +471,7 @@ prototypes: · 24 unmodified lines
473471 };
474472
475473 locking rules:
476− All except for ->poll_mask may block.
474+ All may block.
477475
478476 ->llseek() locking has moved from llseek to the individual llseek
479477 implementations. If your fs is not using generic_file_llseek, you
@@ -505,9 +503,6 @@ in sys_read() and friends. · 25 unmodified lines
505503 the lease within the individual filesystem to record the result of the
506504 operation
507505
508−->poll_mask can be called with or without the waitqueue lock for the waitqueue
509−returned from ->get_poll_head.
510−
511506 --------------------------- dquot_operations -------------------------------
512507 prototypes:
513508 int (*write_dquot) (struct dquot *);
Documentation/filesystems/cifs/AUTHORS+4−3
@@ -42,9 +42,11 @@ Jeff Layton (many, many fixes, as well as great work on the cifs Kerberos code) · 41 unmodified lines
4242 Scott Lovenberg
4343 Pavel Shilovsky (for great work adding SMB2 support, and various SMB3 features)
4444 Aurelien Aptel (for DFS SMB3 work and some key bug fixes)
45−Ronnie Sahlberg (for SMB3 xattr work and bug fixes)
45+Ronnie Sahlberg (for SMB3 xattr work, bug fixes, and lots of great work on compounding)
4646 Shirish Pargaonkar (for many ACL patches over the years)
4747 Sachin Prabhu (many bug fixes, including for reconnect, copy offload and security)
48+Paulo Alcantara
49+Long Li (some great work on RDMA, SMB Direct)
4850
4951
5052 Test case and Bug Report contributors
@@ -58,5 +60,4 @@ mention to the Stanford Checker (SWAT) which pointed out many minor · 7 unmodified lines
5860 bugs in error paths. Valuable suggestions also have come from Al Viro
5961 and Dave Miller.
6062
61−And thanks to the IBM LTC and Power test teams and SuSE testers for
62−finding multiple bugs during excellent stress test runs.
63+And thanks to the IBM LTC and Power test teams and SuSE and Citrix and RedHat testers for finding multiple bugs during excellent stress test runs.
Documentation/filesystems/cifs/CHANGES+3−0
@@ -1,3 +1,6 @@
1+See https://wiki.samba.org/index.php/LinuxCIFSKernel for
2+more current information.
3+
14 Version 1.62
25 ------------
36 Add sockopt=TCP_NODELAY mount option. EA (xattr) routines hardened
Documentation/filesystems/cifs/TODO+9−8
@@ -9,14 +9,14 @@ is a partial list of the known problems and missing features: · 8 unmodified lines
99
1010 a) SMB3 (and SMB3.02) missing optional features:
1111 - multichannel (started), integration with RDMA
12− - directory leases (improved metadata caching)
13− - T10 copy offload (copy chunk, and "Duplicate Extents" ioctl
12+ - directory leases (improved metadata caching), started (root dir only)
13+ - T10 copy offload ie "ODX" (copy chunk, and "Duplicate Extents" ioctl
1414 currently the only two server side copy mechanisms supported)
1515
1616 b) improved sparse file support
1717
1818 c) Directory entry caching relies on a 1 second timer, rather than
19−using Directory Leases
19+using Directory Leases, currently only the root file handle is cached longer
2020
2121 d) quota support (needs minor kernel change since quota calls
2222 to make it to network filesystems or deviceless filesystems)
@@ -42,6 +42,8 @@ mount or a per server basis to client UIDs or nobody if no mapping · 19 unmodified lines
4242 exists. Also better integration with winbind for resolving SID owners
4343
4444 k) Add tools to take advantage of more smb3 specific ioctls and features
45+(passthrough ioctl/fsctl for sending various SMB3 fsctls to the server
46+is in progress)
4547
4648 l) encrypted file support
4749
@@ -71,9 +73,8 @@ t) split cifs and smb3 support into separate modules so legacy (and less · 23 unmodified lines
7173 secure) CIFS dialect can be disabled in environments that don't need it
7274 and simplify the code.
7375
74−u) Finish up SMB3.1.1 dialect support
75−
76−v) POSIX Extensions for SMB3.1.1
76+v) POSIX Extensions for SMB3.1.1 (started, create and mkdir support added
77+so far).
7778
7879 KNOWN BUGS
7980 ====================================
@@ -92,8 +93,8 @@ Misc testing to do · 12 unmodified lines
9293 1) check out max path names and max path name components against various server
9394 types. Try nested symlinks (8 deep). Return max path name in stat -f information
9495
95−2) Improve xfstest's cifs enablement and adapt xfstests where needed to test
96−cifs better
96+2) Improve xfstest's cifs/smb3 enablement and adapt xfstests where needed to test
97+cifs/smb3 better
9798
9899 3) Additional performance testing and optimization using iozone and similar -
99100 there are some easy changes that can be done to parallelize sequential writes,
Documentation/filesystems/vfs.txt+0−13
@@ -857,8 +857,6 @@ struct file_operations { · 856 unmodified lines
857857 ssize_t (*write_iter) (struct kiocb *, struct iov_iter *);
858858 int (*iterate) (struct file *, struct dir_context *);
859859 __poll_t (*poll) (struct file *, struct poll_table_struct *);
860− struct wait_queue_head * (*get_poll_head)(struct file *, __poll_t);
861− __poll_t (*poll_mask) (struct file *, __poll_t);
862860 long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long);
863861 long (*compat_ioctl) (struct file *, unsigned int, unsigned long);
864862 int (*mmap) (struct file *, struct vm_area_struct *);
@@ -903,17 +901,6 @@ otherwise noted. · 38 unmodified lines
903901 activity on this file and (optionally) go to sleep until there
904902 is activity. Called by the select(2) and poll(2) system calls
905903
906− get_poll_head: Returns the struct wait_queue_head that callers can
907− wait on. Callers need to check the returned events using ->poll_mask
908− once woken. Can return NULL to indicate polling is not supported,
909− or any error code using the ERR_PTR convention to indicate that a
910− grave error occured and ->poll_mask shall not be called.
911−
912− poll_mask: return the mask of EPOLL* values describing the file descriptor
913− state. Called either before going to sleep on the waitqueue returned by
914− get_poll_head, or after it has been woken. If ->get_poll_head and
915− ->poll_mask are implemented ->poll does not need to be implement.
916−
917904 unlocked_ioctl: called by the ioctl(2) system call.
918905
919906 compat_ioctl: called by the ioctl(2) system call when 32 bit system calls
Documentation/kbuild/kconfig-language.txt+6−0
@@ -430,6 +430,12 @@ This sets the config program's title bar if the config program chooses · 429 unmodified lines
430430 to use it. It should be placed at the top of the configuration, before any
431431 other statement.
432432
433+'#' Kconfig source file comment:
434+
435+An unquoted '#' character anywhere in a source file line indicates
436+the beginning of a source file comment. The remainder of that line
437+is a comment.
438+
433439
434440 Kconfig hints
435441 -------------
Documentation/networking/e100.rst+57−55
@@ -1,3 +1,4 @@
1+==============================================================
12 Linux* Base Driver for the Intel(R) PRO/100 Family of Adapters
23 ==============================================================
34
@@ -86,83 +87,84 @@ Event Log Message Level: The driver uses the message level flag to log events · 82 unmodified lines
8687 Additional Configurations
8788 =========================
8889
89− Configuring the Driver on Different Distributions
90− -------------------------------------------------
90+Configuring the Driver on Different Distributions
91+-------------------------------------------------
9192
92− Configuring a network driver to load properly when the system is started is
93− distribution dependent. Typically, the configuration process involves adding
94− an alias line to /etc/modprobe.d/*.conf as well as editing other system
95− startup scripts and/or configuration files. Many popular Linux
96− distributions ship with tools to make these changes for you. To learn the
97− proper way to configure a network device for your system, refer to your
98− distribution documentation. If during this process you are asked for the
99− driver or module name, the name for the Linux Base Driver for the Intel
100− PRO/100 Family of Adapters is e100.
93+Configuring a network driver to load properly when the system is started
94+is distribution dependent. Typically, the configuration process involves
95+adding an alias line to /etc/modprobe.d/*.conf as well as editing other
96+system startup scripts and/or configuration files. Many popular Linux
97+distributions ship with tools to make these changes for you. To learn
98+the proper way to configure a network device for your system, refer to
99+your distribution documentation. If during this process you are asked
100+for the driver or module name, the name for the Linux Base Driver for
101+the Intel PRO/100 Family of Adapters is e100.
101102
102− As an example, if you install the e100 driver for two PRO/100 adapters
103− (eth0 and eth1), add the following to a configuration file in /etc/modprobe.d/
103+As an example, if you install the e100 driver for two PRO/100 adapters
104+(eth0 and eth1), add the following to a configuration file in
105+/etc/modprobe.d/::
104106
105107 alias eth0 e100
106108 alias eth1 e100
107109
108− Viewing Link Messages
109− ---------------------
110− In order to see link messages and other Intel driver information on your
111− console, you must set the dmesg level up to six. This can be done by
112− entering the following on the command line before loading the e100 driver::
113−
114− dmesg -n 6
110+Viewing Link Messages
111+---------------------
115112
116− If you wish to see all messages issued by the driver, including debug
117− messages, set the dmesg level to eight.
113+In order to see link messages and other Intel driver information on your
114+console, you must set the dmesg level up to six. This can be done by
115+entering the following on the command line before loading the e100
116+driver::
118117
119− NOTE: This setting is not saved across reboots.
118+ dmesg -n 6
120119
120+If you wish to see all messages issued by the driver, including debug
121+messages, set the dmesg level to eight.
121122
122− ethtool
123− -------
123+NOTE: This setting is not saved across reboots.
124124
125− The driver utilizes the ethtool interface for driver configuration and
126− diagnostics, as well as displaying statistical information. The ethtool
127− version 1.6 or later is required for this functionality.
125+ethtool
126+-------
128127
129− The latest release of ethtool can be found from
130− https://www.kernel.org/pub/software/network/ethtool/
128+The driver utilizes the ethtool interface for driver configuration and
129+diagnostics, as well as displaying statistical information. The ethtool
130+version 1.6 or later is required for this functionality.
131131
132− Enabling Wake on LAN* (WoL)
133− ---------------------------
134− WoL is provided through the ethtool* utility. For instructions on enabling
135− WoL with ethtool, refer to the ethtool man page.
132+The latest release of ethtool can be found from
133+https://www.kernel.org/pub/software/network/ethtool/
136134
137− WoL will be enabled on the system during the next shut down or reboot. For
138− this driver version, in order to enable WoL, the e100 driver must be
139− loaded when shutting down or rebooting the system.
135+Enabling Wake on LAN* (WoL)
136+---------------------------
137+WoL is provided through the ethtool* utility. For instructions on
138+enabling WoL with ethtool, refer to the ethtool man page. WoL will be
139+enabled on the system during the next shut down or reboot. For this
140+driver version, in order to enable WoL, the e100 driver must be loaded
141+when shutting down or rebooting the system.
140142
141− NAPI
142− ----
143+NAPI
144+----
143145
144− NAPI (Rx polling mode) is supported in the e100 driver.
146+NAPI (Rx polling mode) is supported in the e100 driver.
145147
146− See https://wiki.linuxfoundation.org/networking/napi for more information
147− on NAPI.
148+See https://wiki.linuxfoundation.org/networking/napi for more
149+information on NAPI.
148150
149− Multiple Interfaces on Same Ethernet Broadcast Network
150− ------------------------------------------------------
151+Multiple Interfaces on Same Ethernet Broadcast Network
152+------------------------------------------------------
151153
152− Due to the default ARP behavior on Linux, it is not possible to have
153− one system on two IP networks in the same Ethernet broadcast domain
154− (non-partitioned switch) behave as expected. All Ethernet interfaces
155− will respond to IP traffic for any IP address assigned to the system.
156− This results in unbalanced receive traffic.
154+Due to the default ARP behavior on Linux, it is not possible to have one
155+system on two IP networks in the same Ethernet broadcast domain
156+(non-partitioned switch) behave as expected. All Ethernet interfaces
157+will respond to IP traffic for any IP address assigned to the system.
158+This results in unbalanced receive traffic.
157159
158− If you have multiple interfaces in a server, either turn on ARP
159− filtering by
160+If you have multiple interfaces in a server, either turn on ARP
161+filtering by
160162
161− (1) entering:: echo 1 > /proc/sys/net/ipv4/conf/all/arp_filter
162− (this only works if your kernel's version is higher than 2.4.5), or
163+(1) entering:: echo 1 > /proc/sys/net/ipv4/conf/all/arp_filter
164+ (this only works if your kernel's version is higher than 2.4.5), or
163165
164− (2) installing the interfaces in separate broadcast domains (either
165− in different switches or in a switch partitioned to VLANs).
166+(2) installing the interfaces in separate broadcast domains (either
167+ in different switches or in a switch partitioned to VLANs).
166168
167169
168170 Support
Documentation/networking/e1000.rst+39−37
@@ -1,3 +1,4 @@
1+===========================================================
12 Linux* Base Driver for Intel(R) Ethernet Network Connection
23 ===========================================================
34
@@ -354,57 +355,58 @@ previously mentioned to force the adapter to the same speed and duplex. · 350 unmodified lines
354355 Additional Configurations
355356 =========================
356357
357− Jumbo Frames
358− ------------
359− Jumbo Frames support is enabled by changing the MTU to a value larger than
360− the default of 1500. Use the ifconfig command to increase the MTU size.
361− For example::
358+Jumbo Frames
359+------------
360+Jumbo Frames support is enabled by changing the MTU to a value larger
361+than the default of 1500. Use the ifconfig command to increase the MTU
362+size. For example::
362363
363364 ifconfig eth<x> mtu 9000 up
364365
365− This setting is not saved across reboots. It can be made permanent if
366− you add::
366+This setting is not saved across reboots. It can be made permanent if
367+you add::
367368
368369 MTU=9000
369370
370− to the file /etc/sysconfig/network-scripts/ifcfg-eth<x>. This example
371− applies to the Red Hat distributions; other distributions may store this
372− setting in a different location.
371+to the file /etc/sysconfig/network-scripts/ifcfg-eth<x>. This example
372+applies to the Red Hat distributions; other distributions may store this
373+setting in a different location.
374+
375+Notes: Degradation in throughput performance may be observed in some
376+Jumbo frames environments. If this is observed, increasing the
377+application's socket buffer size and/or increasing the
378+/proc/sys/net/ipv4/tcp_*mem entry values may help. See the specific
379+application manual and /usr/src/linux*/Documentation/
380+networking/ip-sysctl.txt for more details.
373381
374− Notes:
375− Degradation in throughput performance may be observed in some Jumbo frames
376− environments. If this is observed, increasing the application's socket buffer
377− size and/or increasing the /proc/sys/net/ipv4/tcp_*mem entry values may help.
378− See the specific application manual and /usr/src/linux*/Documentation/
379− networking/ip-sysctl.txt for more details.
382+- The maximum MTU setting for Jumbo Frames is 16110. This value
383+ coincides with the maximum Jumbo Frames size of 16128.
380384
381− - The maximum MTU setting for Jumbo Frames is 16110. This value coincides
382− with the maximum Jumbo Frames size of 16128.
385+- Using Jumbo frames at 10 or 100 Mbps is not supported and may result
386+ in poor performance or loss of link.
383387
384− - Using Jumbo frames at 10 or 100 Mbps is not supported and may result in
385− poor performance or loss of link.
388+- Adapters based on the Intel(R) 82542 and 82573V/E controller do not
389+ support Jumbo Frames. These correspond to the following product names:
390+ Intel(R) PRO/1000 Gigabit Server Adapter Intel(R) PRO/1000 PM Network
391+ Connection
386392
387− - Adapters based on the Intel(R) 82542 and 82573V/E controller do not
388− support Jumbo Frames. These correspond to the following product names:
389− Intel(R) PRO/1000 Gigabit Server Adapter
390− Intel(R) PRO/1000 PM Network Connection
393+ethtool
394+-------
395+The driver utilizes the ethtool interface for driver configuration and
396+diagnostics, as well as displaying statistical information. The ethtool
397+version 1.6 or later is required for this functionality.
391398
392− ethtool
393− -------
394− The driver utilizes the ethtool interface for driver configuration and
395− diagnostics, as well as displaying statistical information. The ethtool
396− version 1.6 or later is required for this functionality.
399+The latest release of ethtool can be found from
400+https://www.kernel.org/pub/software/network/ethtool/
397401
398− The latest release of ethtool can be found from
399− https://www.kernel.org/pub/software/network/ethtool/
402+Enabling Wake on LAN* (WoL)
403+---------------------------
404+WoL is configured through the ethtool* utility.
400405
401− Enabling Wake on LAN* (WoL)
402− ---------------------------
403− WoL is configured through the ethtool* utility.
406+WoL will be enabled on the system during the next shut down or reboot.
407+For this driver version, in order to enable WoL, the e1000 driver must be
408+loaded when shutting down or rebooting the system.
404409
405− WoL will be enabled on the system during the next shut down or reboot.
406− For this driver version, in order to enable WoL, the e1000 driver must be
407− loaded when shutting down or rebooting the system.
408410
409411 Support
410412 =======
Documentation/networking/strparser.txt+1−1
@@ -48,7 +48,7 @@ void strp_pause(struct strparser *strp) · 47 unmodified lines
4848 Temporarily pause a stream parser. Message parsing is suspended
4949 and no new messages are delivered to the upper layer.
5050
51−void strp_pause(struct strparser *strp)
51+void strp_unpause(struct strparser *strp)
5252
5353 Unpause a paused stream parser.
5454
Documentation/trace/histogram.txt+12−11
@@ -1729,35 +1729,35 @@ If a variable isn't a key variable or prefixed with 'vals=', the · 1728 unmodified lines
17291729 associated event field will be saved in a variable but won't be summed
17301730 as a value:
17311731
1732− # echo 'hist:keys=next_pid:ts1=common_timestamp ... >> event/trigger
1732+ # echo 'hist:keys=next_pid:ts1=common_timestamp ...' >> event/trigger
17331733
17341734 Multiple variables can be assigned at the same time. The below would
17351735 result in both ts0 and b being created as variables, with both
17361736 common_timestamp and field1 additionally being summed as values:
17371737
1738− # echo 'hist:keys=pid:vals=$ts0,$b:ts0=common_timestamp,b=field1 ... >> \
1738+ # echo 'hist:keys=pid:vals=$ts0,$b:ts0=common_timestamp,b=field1 ...' >> \
17391739 event/trigger
17401740
17411741 Note that variable assignments can appear either preceding or
17421742 following their use. The command below behaves identically to the
17431743 command above:
17441744
1745− # echo 'hist:keys=pid:ts0=common_timestamp,b=field1:vals=$ts0,$b ... >> \
1745+ # echo 'hist:keys=pid:ts0=common_timestamp,b=field1:vals=$ts0,$b ...' >> \
17461746 event/trigger
17471747
17481748 Any number of variables not bound to a 'vals=' prefix can also be
17491749 assigned by simply separating them with colons. Below is the same
17501750 thing but without the values being summed in the histogram:
17511751
1752− # echo 'hist:keys=pid:ts0=common_timestamp:b=field1 ... >> event/trigger
1752+ # echo 'hist:keys=pid:ts0=common_timestamp:b=field1 ...' >> event/trigger
17531753
17541754 Variables set as above can be referenced and used in expressions on
17551755 another event.
17561756
17571757 For example, here's how a latency can be calculated:
17581758
1759− # echo 'hist:keys=pid,prio:ts0=common_timestamp ... >> event1/trigger
1760− # echo 'hist:keys=next_pid:wakeup_lat=common_timestamp-$ts0 ... >> event2/trigger
1759+ # echo 'hist:keys=pid,prio:ts0=common_timestamp ...' >> event1/trigger
1760+ # echo 'hist:keys=next_pid:wakeup_lat=common_timestamp-$ts0 ...' >> event2/trigger
17611761
17621762 In the first line above, the event's timetamp is saved into the
17631763 variable ts0. In the next line, ts0 is subtracted from the second
@@ -1766,7 +1766,7 @@ yet another variable, 'wakeup_lat'. The hist trigger below in turn · 2 unmodified lines
17661766 makes use of the wakeup_lat variable to compute a combined latency
17671767 using the same key and variable from yet another event:
17681768
1769− # echo 'hist:key=pid:wakeupswitch_lat=$wakeup_lat+$switchtime_lat ... >> event3/trigger
1769+ # echo 'hist:key=pid:wakeupswitch_lat=$wakeup_lat+$switchtime_lat ...' >> event3/trigger
17701770
17711771 2.2.2 Synthetic Events
17721772 ----------------------
@@ -1807,10 +1807,11 @@ the command that defined it with a '!': · 34 unmodified lines
18071807 At this point, there isn't yet an actual 'wakeup_latency' event
18081808 instantiated in the event subsytem - for this to happen, a 'hist
18091809 trigger action' needs to be instantiated and bound to actual fields
1810−and variables defined on other events (see Section 6.3.3 below).
1810+and variables defined on other events (see Section 2.2.3 below on
1811+how that is done using hist trigger 'onmatch' action). Once that is
1812+done, the 'wakeup_latency' synthetic event instance is created.
18111813
1812−Once that is done, an event instance is created, and a histogram can
1813−be defined using it:
1814+A histogram can now be defined for the new synthetic event:
18141815
18151816 # echo 'hist:keys=pid,prio,lat.log2:sort=pid,lat' >> \
18161817 /sys/kernel/debug/tracing/events/synthetic/wakeup_latency/trigger
@@ -1960,7 +1961,7 @@ hist trigger specification. · 143 unmodified lines
19601961 back to that pid, the timestamp difference is calculated. If the
19611962 resulting latency, stored in wakeup_lat, exceeds the current
19621963 maximum latency, the values specified in the save() fields are
1963− recoreded:
1964+ recorded:
19641965
19651966 # echo 'hist:keys=pid:ts0=common_timestamp.usecs \
19661967 if comm=="cyclictest"' >> \
Documentation/usb/gadget_configfs.txt+1−1
@@ -226,7 +226,7 @@ $ rm configs/<config name>.<number>/<function> · 225 unmodified lines
226226 where <config name>.<number> specify the configuration and <function> is
227227 a symlink to a function being removed from the configuration, e.g.:
228228
229−$ rm configfs/c.1/ncm.usb0
229+$ rm configs/c.1/ncm.usb0
230230
231231 ...
232232 ...
Documentation/virtual/kvm/api.txt+1−1
@@ -4610,7 +4610,7 @@ This capability indicates that kvm will implement the interfaces to handle · 4609 unmodified lines
46104610 reset, migration and nested KVM for branch prediction blocking. The stfle
46114611 facility 82 should not be provided to the guest without this capability.
46124612
4613−8.14 KVM_CAP_HYPERV_TLBFLUSH
4613+8.18 KVM_CAP_HYPERV_TLBFLUSH
46144614
46154615 Architectures: x86
46164616
MAINTAINERS+36−14
@@ -2971,9 +2971,13 @@ N: bcm585* · 2970 unmodified lines
29712971 N: bcm586*
29722972 N: bcm88312
29732973 N: hr2
2974−F: arch/arm64/boot/dts/broadcom/ns2*
2974+N: stingray
2975+F: arch/arm64/boot/dts/broadcom/northstar2/*
2976+F: arch/arm64/boot/dts/broadcom/stingray/*
29752977 F: drivers/clk/bcm/clk-ns*
2978+F: drivers/clk/bcm/clk-sr*
29762979 F: drivers/pinctrl/bcm/pinctrl-ns*
2980+F: include/dt-bindings/clock/bcm-sr*
29772981
29782982 BROADCOM KONA GPIO DRIVER
29792983 M: Ray Jui <rjui@broadcom.com>
@@ -4360,12 +4364,7 @@ L: iommu@lists.linux-foundation.org · 1380 unmodified lines
43604364 T: git git://git.infradead.org/users/hch/dma-mapping.git
43614365 W: http://git.infradead.org/users/hch/dma-mapping.git
43624366 S: Supported
4363−F: lib/dma-debug.c
4364−F: lib/dma-direct.c
4365−F: lib/dma-noncoherent.c
4366−F: lib/dma-virt.c
4367−F: drivers/base/dma-mapping.c
4368−F: drivers/base/dma-coherent.c
4367+F: kernel/dma/
43694368 F: include/asm-generic/dma-mapping.h
43704369 F: include/linux/dma-direct.h
43714370 F: include/linux/dma-mapping.h
@@ -5674,7 +5673,7 @@ F: drivers/crypto/caam/ · 1302 unmodified lines
56745673 F: Documentation/devicetree/bindings/crypto/fsl-sec4.txt
56755674
56765675 FREESCALE DIU FRAMEBUFFER DRIVER
5677−M: Timur Tabi <timur@tabi.org>
5676+M: Timur Tabi <timur@kernel.org>
56785677 L: linux-fbdev@vger.kernel.org
56795678 S: Maintained
56805679 F: drivers/video/fbdev/fsl-diu-fb.*
@@ -5774,7 +5773,7 @@ S: Maintained · 93 unmodified lines
57745773 F: drivers/net/wan/fsl_ucc_hdlc*
57755774
57765775 FREESCALE QUICC ENGINE UCC UART DRIVER
5777−M: Timur Tabi <timur@tabi.org>
5776+M: Timur Tabi <timur@kernel.org>
57785777 L: linuxppc-dev@lists.ozlabs.org
57795778 S: Maintained
57805779 F: drivers/tty/serial/ucc_uart.c
@@ -5798,7 +5797,7 @@ F: drivers/net/ethernet/freescale/fs_enet/ · 17 unmodified lines
57985797 F: include/linux/fs_enet_pd.h
57995798
58005799 FREESCALE SOC SOUND DRIVERS
5801−M: Timur Tabi <timur@tabi.org>
5800+M: Timur Tabi <timur@kernel.org>
58025801 M: Nicolin Chen <nicoleotsuka@gmail.com>
58035802 M: Xiubo Li <Xiubo.Lee@gmail.com>
58045803 R: Fabio Estevam <fabio.estevam@nxp.com>
@@ -9756,6 +9755,11 @@ L: linux-scsi@vger.kernel.org · 3951 unmodified lines
97569755 S: Maintained
97579756 F: drivers/scsi/NCR_D700.*
97589757
9758+NCSI LIBRARY:
9759+M: Samuel Mendoza-Jonas <sam@mendozajonas.com>
9760+S: Maintained
9761+F: net/ncsi/
9762+
97599763 NCT6775 HARDWARE MONITOR DRIVER
97609764 M: Guenter Roeck <linux@roeck-us.net>
97619765 L: linux-hwmon@vger.kernel.org
@@ -9882,6 +9886,7 @@ M: Andrew Lunn <andrew@lunn.ch> · 120 unmodified lines
98829886 M: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
98839887 M: Florian Fainelli <f.fainelli@gmail.com>
98849888 S: Maintained
9889+F: Documentation/devicetree/bindings/net/dsa/
98859890 F: net/dsa/
98869891 F: include/net/dsa.h
98879892 F: include/linux/dsa/
@@ -11476,6 +11481,15 @@ W: http://wireless.kernel.org/en/users/Drivers/p54 · 1588 unmodified lines
1147611481 S: Obsolete
1147711482 F: drivers/net/wireless/intersil/prism54/
1147811483
11484+PROC FILESYSTEM
11485+R: Alexey Dobriyan <adobriyan@gmail.com>
11486+L: linux-kernel@vger.kernel.org
11487+L: linux-fsdevel@vger.kernel.org
11488+S: Maintained
11489+F: fs/proc/
11490+F: include/linux/proc_fs.h
11491+F: tools/testing/selftests/proc/
11492+
1147911493 PROC SYSCTL
1148011494 M: "Luis R. Rodriguez" <mcgrof@kernel.org>
1148111495 M: Kees Cook <keescook@chromium.org>
@@ -11808,9 +11822,9 @@ F: Documentation/devicetree/bindings/opp/kryo-cpufreq.txt · 326 unmodified lines
1180811822 F: drivers/cpufreq/qcom-cpufreq-kryo.c
1180911823
1181011824 QUALCOMM EMAC GIGABIT ETHERNET DRIVER
11811−M: Timur Tabi <timur@codeaurora.org>
11825+M: Timur Tabi <timur@kernel.org>
1181211826 L: netdev@vger.kernel.org
11813−S: Supported
11827+S: Maintained
1181411828 F: drivers/net/ethernet/qualcomm/emac/
1181511829
1181611830 QUALCOMM HEXAGON ARCHITECTURE
@@ -13648,7 +13662,7 @@ M: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> · 1831 unmodified lines
1364813662 L: iommu@lists.linux-foundation.org
1364913663 T: git git://git.kernel.org/pub/scm/linux/kernel/git/konrad/swiotlb.git
1365013664 S: Supported
13651−F: lib/swiotlb.c
13665+F: kernel/dma/swiotlb.c
1365213666 F: arch/*/kernel/pci-swiotlb.c
1365313667 F: include/linux/swiotlb.h
1365413668
@@ -15572,9 +15586,17 @@ M: x86@kernel.org · 1917 unmodified lines
1557215586 L: linux-kernel@vger.kernel.org
1557315587 T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/core
1557415588 S: Maintained
15589+F: Documentation/devicetree/bindings/x86/
1557515590 F: Documentation/x86/
1557615591 F: arch/x86/
1557715592
15593+X86 ENTRY CODE
15594+M: Andy Lutomirski <luto@kernel.org>
15595+L: linux-kernel@vger.kernel.org
15596+T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/asm
15597+S: Maintained
15598+F: arch/x86/entry/
15599+
1557815600 X86 MCE INFRASTRUCTURE
1557915601 M: Tony Luck <tony.luck@intel.com>
1558015602 M: Borislav Petkov <bp@alien8.de>
@@ -15597,7 +15619,7 @@ F: drivers/platform/x86/ · 16 unmodified lines
1559715619 F: drivers/platform/olpc/
1559815620
1559915621 X86 VDSO
15600−M: Andy Lutomirski <luto@amacapital.net>
15622+M: Andy Lutomirski <luto@kernel.org>
1560115623 L: linux-kernel@vger.kernel.org
1560215624 T: git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/vdso
1560315625 S: Maintained
Makefile+1−1
@@ -2,7 +2,7 @@ · 1 unmodified line
22 VERSION = 4
33 PATCHLEVEL = 18
44 SUBLEVEL = 0
5−EXTRAVERSION = -rc1
5+EXTRAVERSION = -rc3
66 NAME = Merciless Moray
77
88 # *DOCUMENTATION*
arch/alpha/Kconfig+0−5
@@ -555,11 +555,6 @@ config SMP · 554 unmodified lines
555555
556556 If you don't know what to do here, say N.
557557
558−config HAVE_DEC_LOCK
559− bool
560− depends on SMP
561− default y
562−
563558 config NR_CPUS
564559 int "Maximum number of CPUs (2-32)"
565560 range 2 32
arch/alpha/lib/Makefile+0−2
@@ -35,8 +35,6 @@ lib-y = __divqu.o __remqu.o __divlu.o __remlu.o \ · 34 unmodified lines
3535 callback_srm.o srm_puts.o srm_printk.o \
3636 fls.o
3737
38−lib-$(CONFIG_SMP) += dec_and_lock.o
39−
4038 # The division routines are built from single source, with different defines.
4139 AFLAGS___divqu.o = -DDIV
4240 AFLAGS___remqu.o = -DREM
arch/alpha/lib/dec_and_lock.c+0−44
@@ -1,44 +0,0 @@
1−// SPDX-License-Identifier: GPL-2.0
2−/*
3− * arch/alpha/lib/dec_and_lock.c
4− *
5− * ll/sc version of atomic_dec_and_lock()
6− *
7− */
8−
9−#include <linux/spinlock.h>
10−#include <linux/atomic.h>
11−#include <linux/export.h>
12−
13− asm (".text \n\
14− .global _atomic_dec_and_lock \n\
15− .ent _atomic_dec_and_lock \n\
16− .align 4 \n\
17−_atomic_dec_and_lock: \n\
18− .prologue 0 \n\
19−1: ldl_l $1, 0($16) \n\
20− subl $1, 1, $1 \n\
21− beq $1, 2f \n\
22− stl_c $1, 0($16) \n\
23− beq $1, 4f \n\
24− mb \n\
25− clr $0 \n\
26− ret \n\
27−2: br $29, 3f \n\
28−3: ldgp $29, 0($29) \n\
29− br $atomic_dec_and_lock_1..ng \n\
30− .subsection 2 \n\
31−4: br 1b \n\
32− .previous \n\
33− .end _atomic_dec_and_lock");
34−
35−static int __used atomic_dec_and_lock_1(atomic_t *atomic, spinlock_t *lock)
36−{
37− /* Slow path */
38− spin_lock(lock);
39− if (atomic_dec_and_test(atomic))
40− return 1;
41− spin_unlock(lock);
42− return 0;
43−}
44−EXPORT_SYMBOL(_atomic_dec_and_lock);
arch/arm/Kconfig+7−1
@@ -1245,8 +1245,14 @@ config PCI · 1244 unmodified lines
12451245 VESA. If you have PCI, say Y, otherwise N.
12461246
12471247 config PCI_DOMAINS
1248− bool
1248+ bool "Support for multiple PCI domains"
12491249 depends on PCI
1250+ help
1251+ Enable PCI domains kernel management. Say Y if your machine
1252+ has a PCI bus hierarchy that requires more than one PCI
1253+ domain (aka segment) to be correctly managed. Say N otherwise.
1254+
1255+ If you don't know what to do here, say N.
12501256
12511257 config PCI_DOMAINS_GENERIC
12521258 def_bool PCI_DOMAINS
arch/arm/boot/dts/armada-385-synology-ds116.dts+1−1
@@ -139,7 +139,7 @@ · 138 unmodified lines
139139 3700 5
140140 3900 6
141141 4000 7>;
142− cooling-cells = <2>;
142+ #cooling-cells = <2>;
143143 };
144144
145145 gpio-leds {
arch/arm/boot/dts/bcm-cygnus.dtsi+12−12
@@ -216,7 +216,7 @@ · 215 unmodified lines
216216 reg = <0x18008000 0x100>;
217217 #address-cells = <1>;
218218 #size-cells = <0>;
219− interrupts = <GIC_SPI 85 IRQ_TYPE_NONE>;
219+ interrupts = <GIC_SPI 85 IRQ_TYPE_LEVEL_HIGH>;
220220 clock-frequency = <100000>;
221221 status = "disabled";
222222 };
@@ -245,7 +245,7 @@ · 22 unmodified lines
245245 reg = <0x1800b000 0x100>;
246246 #address-cells = <1>;
247247 #size-cells = <0>;
248− interrupts = <GIC_SPI 86 IRQ_TYPE_NONE>;
248+ interrupts = <GIC_SPI 86 IRQ_TYPE_LEVEL_HIGH>;
249249 clock-frequency = <100000>;
250250 status = "disabled";
251251 };
@@ -256,7 +256,7 @@ · 4 unmodified lines
256256
257257 #interrupt-cells = <1>;
258258 interrupt-map-mask = <0 0 0 0>;
259− interrupt-map = <0 0 0 0 &gic GIC_SPI 100 IRQ_TYPE_NONE>;
259+ interrupt-map = <0 0 0 0 &gic GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>;
260260
261261 linux,pci-domain = <0>;
262262
@@ -278,10 +278,10 @@ · 15 unmodified lines
278278 compatible = "brcm,iproc-msi";
279279 msi-controller;
280280 interrupt-parent = <&gic>;
281− interrupts = <GIC_SPI 96 IRQ_TYPE_NONE>,
282− <GIC_SPI 97 IRQ_TYPE_NONE>,
283− <GIC_SPI 98 IRQ_TYPE_NONE>,
284− <GIC_SPI 99 IRQ_TYPE_NONE>;
281+ interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>,
282+ <GIC_SPI 97 IRQ_TYPE_LEVEL_HIGH>,
283+ <GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>,
284+ <GIC_SPI 99 IRQ_TYPE_LEVEL_HIGH>;
285285 };
286286 };
287287
@@ -291,7 +291,7 @@ · 3 unmodified lines
291291
292292 #interrupt-cells = <1>;
293293 interrupt-map-mask = <0 0 0 0>;
294− interrupt-map = <0 0 0 0 &gic GIC_SPI 106 IRQ_TYPE_NONE>;
294+ interrupt-map = <0 0 0 0 &gic GIC_SPI 106 IRQ_TYPE_LEVEL_HIGH>;
295295
296296 linux,pci-domain = <1>;
297297
@@ -313,10 +313,10 @@ · 15 unmodified lines
313313 compatible = "brcm,iproc-msi";
314314 msi-controller;
315315 interrupt-parent = <&gic>;
316− interrupts = <GIC_SPI 102 IRQ_TYPE_NONE>,
317− <GIC_SPI 103 IRQ_TYPE_NONE>,
318− <GIC_SPI 104 IRQ_TYPE_NONE>,
319− <GIC_SPI 105 IRQ_TYPE_NONE>;
316+ interrupts = <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>,
317+ <GIC_SPI 103 IRQ_TYPE_LEVEL_HIGH>,
318+ <GIC_SPI 104 IRQ_TYPE_LEVEL_HIGH>,
319+ <GIC_SPI 105 IRQ_TYPE_LEVEL_HIGH>;
320320 };
321321 };
322322
arch/arm/boot/dts/bcm-hr2.dtsi+12−12
@@ -264,7 +264,7 @@ · 263 unmodified lines
264264 reg = <0x38000 0x50>;
265265 #address-cells = <1>;
266266 #size-cells = <0>;
267− interrupts = <GIC_SPI 95 IRQ_TYPE_NONE>;
267+ interrupts = <GIC_SPI 95 IRQ_TYPE_LEVEL_HIGH>;
268268 clock-frequency = <100000>;
269269 };
270270
@@ -279,7 +279,7 @@ · 8 unmodified lines
279279 reg = <0x3b000 0x50>;
280280 #address-cells = <1>;
281281 #size-cells = <0>;
282− interrupts = <GIC_SPI 96 IRQ_TYPE_NONE>;
282+ interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>;
283283 clock-frequency = <100000>;
284284 };
285285 };
@@ -300,7 +300,7 @@ · 14 unmodified lines
300300
301301 #interrupt-cells = <1>;
302302 interrupt-map-mask = <0 0 0 0>;
303− interrupt-map = <0 0 0 0 &gic GIC_SPI 186 IRQ_TYPE_NONE>;
303+ interrupt-map = <0 0 0 0 &gic GIC_SPI 186 IRQ_TYPE_LEVEL_HIGH>;
304304
305305 linux,pci-domain = <0>;
306306
@@ -322,10 +322,10 @@ · 15 unmodified lines
322322 compatible = "brcm,iproc-msi";
323323 msi-controller;
324324 interrupt-parent = <&gic>;
325− interrupts = <GIC_SPI 182 IRQ_TYPE_NONE>,
326− <GIC_SPI 183 IRQ_TYPE_NONE>,
327− <GIC_SPI 184 IRQ_TYPE_NONE>,
328− <GIC_SPI 185 IRQ_TYPE_NONE>;
325+ interrupts = <GIC_SPI 182 IRQ_TYPE_LEVEL_HIGH>,
326+ <GIC_SPI 183 IRQ_TYPE_LEVEL_HIGH>,
327+ <GIC_SPI 184 IRQ_TYPE_LEVEL_HIGH>,
328+ <GIC_SPI 185 IRQ_TYPE_LEVEL_HIGH>;
329329 brcm,pcie-msi-inten;
330330 };
331331 };
@@ -336,7 +336,7 @@ · 4 unmodified lines
336336
337337 #interrupt-cells = <1>;
338338 interrupt-map-mask = <0 0 0 0>;
339− interrupt-map = <0 0 0 0 &gic GIC_SPI 192 IRQ_TYPE_NONE>;
339+ interrupt-map = <0 0 0 0 &gic GIC_SPI 192 IRQ_TYPE_LEVEL_HIGH>;
340340
341341 linux,pci-domain = <1>;
342342
@@ -358,10 +358,10 @@ · 15 unmodified lines
358358 compatible = "brcm,iproc-msi";
359359 msi-controller;
360360 interrupt-parent = <&gic>;
361− interrupts = <GIC_SPI 188 IRQ_TYPE_NONE>,
362− <GIC_SPI 189 IRQ_TYPE_NONE>,
363− <GIC_SPI 190 IRQ_TYPE_NONE>,
364− <GIC_SPI 191 IRQ_TYPE_NONE>;
361+ interrupts = <GIC_SPI 188 IRQ_TYPE_LEVEL_HIGH>,
362+ <GIC_SPI 189 IRQ_TYPE_LEVEL_HIGH>,
363+ <GIC_SPI 190 IRQ_TYPE_LEVEL_HIGH>,
364+ <GIC_SPI 191 IRQ_TYPE_LEVEL_HIGH>;
365365 brcm,pcie-msi-inten;
366366 };
367367 };
arch/arm/boot/dts/bcm-nsp.dtsi+16−16
@@ -391,7 +391,7 @@ · 390 unmodified lines
391391 reg = <0x38000 0x50>;
392392 #address-cells = <1>;
393393 #size-cells = <0>;
394− interrupts = <GIC_SPI 89 IRQ_TYPE_NONE>;
394+ interrupts = <GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH>;
395395 clock-frequency = <100000>;
396396 dma-coherent;
397397 status = "disabled";
@@ -496,7 +496,7 @@ · 98 unmodified lines
496496
497497 #interrupt-cells = <1>;
498498 interrupt-map-mask = <0 0 0 0>;
499− interrupt-map = <0 0 0 0 &gic GIC_SPI 131 IRQ_TYPE_NONE>;
499+ interrupt-map = <0 0 0 0 &gic GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>;
500500
501501 linux,pci-domain = <0>;
502502
@@ -519,10 +519,10 @@ · 16 unmodified lines
519519 compatible = "brcm,iproc-msi";
520520 msi-controller;
521521 interrupt-parent = <&gic>;
522− interrupts = <GIC_SPI 127 IRQ_TYPE_NONE>,
523− <GIC_SPI 128 IRQ_TYPE_NONE>,
524− <GIC_SPI 129 IRQ_TYPE_NONE>,
525− <GIC_SPI 130 IRQ_TYPE_NONE>;
522+ interrupts = <GIC_SPI 127 IRQ_TYPE_LEVEL_HIGH>,
523+ <GIC_SPI 128 IRQ_TYPE_LEVEL_HIGH>,
524+ <GIC_SPI 129 IRQ_TYPE_LEVEL_HIGH>,
525+ <GIC_SPI 130 IRQ_TYPE_LEVEL_HIGH>;
526526 brcm,pcie-msi-inten;
527527 };
528528 };
@@ -533,7 +533,7 @@ · 4 unmodified lines
533533
534534 #interrupt-cells = <1>;
535535 interrupt-map-mask = <0 0 0 0>;
536− interrupt-map = <0 0 0 0 &gic GIC_SPI 137 IRQ_TYPE_NONE>;
536+ interrupt-map = <0 0 0 0 &gic GIC_SPI 137 IRQ_TYPE_LEVEL_HIGH>;
537537
538538 linux,pci-domain = <1>;
539539
@@ -556,10 +556,10 @@ · 16 unmodified lines
556556 compatible = "brcm,iproc-msi";
557557 msi-controller;
558558 interrupt-parent = <&gic>;
559− interrupts = <GIC_SPI 133 IRQ_TYPE_NONE>,
560− <GIC_SPI 134 IRQ_TYPE_NONE>,
561− <GIC_SPI 135 IRQ_TYPE_NONE>,
562− <GIC_SPI 136 IRQ_TYPE_NONE>;
559+ interrupts = <GIC_SPI 133 IRQ_TYPE_LEVEL_HIGH>,
560+ <GIC_SPI 134 IRQ_TYPE_LEVEL_HIGH>,
561+ <GIC_SPI 135 IRQ_TYPE_LEVEL_HIGH>,
562+ <GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>;
563563 brcm,pcie-msi-inten;
564564 };
565565 };
@@ -570,7 +570,7 @@ · 4 unmodified lines
570570
571571 #interrupt-cells = <1>;
572572 interrupt-map-mask = <0 0 0 0>;
573− interrupt-map = <0 0 0 0 &gic GIC_SPI 143 IRQ_TYPE_NONE>;
573+ interrupt-map = <0 0 0 0 &gic GIC_SPI 143 IRQ_TYPE_LEVEL_HIGH>;
574574
575575 linux,pci-domain = <2>;
576576
@@ -593,10 +593,10 @@ · 16 unmodified lines
593593 compatible = "brcm,iproc-msi";
594594 msi-controller;
595595 interrupt-parent = <&gic>;
596− interrupts = <GIC_SPI 139 IRQ_TYPE_NONE>,
597− <GIC_SPI 140 IRQ_TYPE_NONE>,
598− <GIC_SPI 141 IRQ_TYPE_NONE>,
599− <GIC_SPI 142 IRQ_TYPE_NONE>;
596+ interrupts = <GIC_SPI 139 IRQ_TYPE_LEVEL_HIGH>,
597+ <GIC_SPI 140 IRQ_TYPE_LEVEL_HIGH>,
598+ <GIC_SPI 141 IRQ_TYPE_LEVEL_HIGH>,
599+ <GIC_SPI 142 IRQ_TYPE_LEVEL_HIGH>;
600600 brcm,pcie-msi-inten;
601601 };
602602 };
arch/arm/boot/dts/bcm5301x.dtsi+1−1
@@ -365,7 +365,7 @@ · 364 unmodified lines
365365 i2c0: i2c@18009000 {
366366 compatible = "brcm,iproc-i2c";
367367 reg = <0x18009000 0x50>;
368− interrupts = <GIC_SPI 121 IRQ_TYPE_NONE>;
368+ interrupts = <GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>;
369369 #address-cells = <1>;
370370 #size-cells = <0>;
371371 clock-frequency = <100000>;
arch/arm/boot/dts/da850.dtsi+1−5
@@ -549,11 +549,7 @@ · 548 unmodified lines
549549 gpio-controller;
550550 #gpio-cells = <2>;
551551 reg = <0x226000 0x1000>;
552− interrupts = <42 IRQ_TYPE_EDGE_BOTH
553− 43 IRQ_TYPE_EDGE_BOTH 44 IRQ_TYPE_EDGE_BOTH
554− 45 IRQ_TYPE_EDGE_BOTH 46 IRQ_TYPE_EDGE_BOTH
555− 47 IRQ_TYPE_EDGE_BOTH 48 IRQ_TYPE_EDGE_BOTH
556− 49 IRQ_TYPE_EDGE_BOTH 50 IRQ_TYPE_EDGE_BOTH>;
552+ interrupts = <42 43 44 45 46 47 48 49 50>;
557553 ti,ngpio = <144>;
558554 ti,davinci-gpio-unbanked = <0>;
559555 status = "disabled";
arch/arm/boot/dts/imx6q.dtsi+1−1
@@ -90,7 +90,7 @@ · 89 unmodified lines
9090 clocks = <&clks IMX6Q_CLK_ECSPI5>,
9191 <&clks IMX6Q_CLK_ECSPI5>;
9292 clock-names = "ipg", "per";
93− dmas = <&sdma 11 7 1>, <&sdma 12 7 2>;
93+ dmas = <&sdma 11 8 1>, <&sdma 12 8 2>;
9494 dma-names = "rx", "tx";
9595 status = "disabled";
9696 };
arch/arm/boot/dts/imx6sx.dtsi+1−1
@@ -1344,7 +1344,7 @@ · 1343 unmodified lines
13441344 ranges = <0x81000000 0 0 0x08f80000 0 0x00010000 /* downstream I/O */
13451345 0x82000000 0 0x08000000 0x08000000 0 0x00f00000>; /* non-prefetchable memory */
13461346 num-lanes = <1>;
1347− interrupts = <GIC_SPI 123 IRQ_TYPE_LEVEL_HIGH>;
1347+ interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>;
13481348 interrupt-names = "msi";
13491349 #interrupt-cells = <1>;
13501350 interrupt-map-mask = <0 0 0 0x7>;
arch/arm/boot/dts/socfpga.dtsi+2−2
@@ -748,13 +748,13 @@ · 747 unmodified lines
748748 nand0: nand@ff900000 {
749749 #address-cells = <0x1>;
750750 #size-cells = <0x1>;
751− compatible = "denali,denali-nand-dt";
751+ compatible = "altr,socfpga-denali-nand";
752752 reg = <0xff900000 0x100000>,
753753 <0xffb80000 0x10000>;
754754 reg-names = "nand_data", "denali_reg";
755755 interrupts = <0x0 0x90 0x4>;
756756 dma-mask = <0xffffffff>;
757− clocks = <&nand_clk>;
757+ clocks = <&nand_x_clk>;
758758 status = "disabled";
759759 };
760760
arch/arm/boot/dts/socfpga_arria10.dtsi+2−3
@@ -593,8 +593,7 @@ · 592 unmodified lines
593593 #size-cells = <0>;
594594 reg = <0xffda5000 0x100>;
595595 interrupts = <0 102 4>;
596− num-chipselect = <4>;
597− bus-num = <0>;
596+ num-cs = <4>;
598597 /*32bit_access;*/
599598 tx-dma-channel = <&pdma 16>;
600599 rx-dma-channel = <&pdma 17>;
@@ -633,7 +632,7 @@ · 32 unmodified lines
633632 nand: nand@ffb90000 {
634633 #address-cells = <1>;
635634 #size-cells = <1>;
636− compatible = "denali,denali-nand-dt", "altr,socfpga-denali-nand";
635+ compatible = "altr,socfpga-denali-nand";
637636 reg = <0xffb90000 0x72000>,
638637 <0xffb80000 0x10000>;
639638 reg-names = "nand_data", "denali_reg";
arch/arm/common/Makefile+1−1
@@ -10,7 +10,7 @@ obj-$(CONFIG_DMABOUNCE) += dmabounce.o · 9 unmodified lines
1010 obj-$(CONFIG_SHARP_LOCOMO) += locomo.o
1111 obj-$(CONFIG_SHARP_PARAM) += sharpsl_param.o
1212 obj-$(CONFIG_SHARP_SCOOP) += scoop.o
13−obj-$(CONFIG_SMP) += secure_cntvoff.o
13+obj-$(CONFIG_CPU_V7) += secure_cntvoff.o
1414 obj-$(CONFIG_PCI_HOST_ITE8152) += it8152.o
1515 obj-$(CONFIG_MCPM) += mcpm_head.o mcpm_entry.o mcpm_platsmp.o vlock.o
1616 CFLAGS_REMOVE_mcpm_entry.o = -pg
arch/arm/configs/multi_v7_defconfig+155−223
@@ -1,5 +1,4 @@
11 CONFIG_SYSVIPC=y
2−CONFIG_FHANDLE=y
32 CONFIG_NO_HZ=y
43 CONFIG_HIGH_RES_TIMERS=y
54 CONFIG_CGROUPS=y
@@ -10,20 +9,10 @@ CONFIG_MODULES=y · 4 unmodified lines
109 CONFIG_MODULE_UNLOAD=y
1110 CONFIG_PARTITION_ADVANCED=y
1211 CONFIG_CMDLINE_PARTITION=y
13−CONFIG_ARCH_MULTI_V7=y
14−# CONFIG_ARCH_MULTI_V5 is not set
15−# CONFIG_ARCH_MULTI_V4 is not set
1612 CONFIG_ARCH_VIRT=y
1713 CONFIG_ARCH_ALPINE=y
1814 CONFIG_ARCH_ARTPEC=y
1915 CONFIG_MACH_ARTPEC6=y
20−CONFIG_ARCH_MVEBU=y
21−CONFIG_MACH_ARMADA_370=y
22−CONFIG_MACH_ARMADA_375=y
23−CONFIG_MACH_ARMADA_38X=y
24−CONFIG_MACH_ARMADA_39X=y
25−CONFIG_MACH_ARMADA_XP=y
26−CONFIG_MACH_DOVE=y
2716 CONFIG_ARCH_AT91=y
2817 CONFIG_SOC_SAMA5D2=y
2918 CONFIG_SOC_SAMA5D3=y
@@ -32,9 +21,9 @@ CONFIG_ARCH_BCM=y · 2 unmodified lines
3221 CONFIG_ARCH_BCM_CYGNUS=y
3322 CONFIG_ARCH_BCM_HR2=y
3423 CONFIG_ARCH_BCM_NSP=y
35−CONFIG_ARCH_BCM_21664=y
36−CONFIG_ARCH_BCM_281XX=y
3724 CONFIG_ARCH_BCM_5301X=y
25+CONFIG_ARCH_BCM_281XX=y
26+CONFIG_ARCH_BCM_21664=y
3827 CONFIG_ARCH_BCM2835=y
3928 CONFIG_ARCH_BCM_63XX=y
4029 CONFIG_ARCH_BRCMSTB=y
@@ -43,14 +32,14 @@ CONFIG_MACH_BERLIN_BG2=y · 2 unmodified lines
4332 CONFIG_MACH_BERLIN_BG2CD=y
4433 CONFIG_MACH_BERLIN_BG2Q=y
4534 CONFIG_ARCH_DIGICOLOR=y
35+CONFIG_ARCH_EXYNOS=y
36+CONFIG_EXYNOS5420_MCPM=y
4637 CONFIG_ARCH_HIGHBANK=y
4738 CONFIG_ARCH_HISI=y
4839 CONFIG_ARCH_HI3xxx=y
49−CONFIG_ARCH_HIX5HD2=y
5040 CONFIG_ARCH_HIP01=y
5141 CONFIG_ARCH_HIP04=y
52−CONFIG_ARCH_KEYSTONE=y
53−CONFIG_ARCH_MESON=y
42+CONFIG_ARCH_HIX5HD2=y
5443 CONFIG_ARCH_MXC=y
5544 CONFIG_SOC_IMX50=y
5645 CONFIG_SOC_IMX51=y
@@ -60,29 +49,30 @@ CONFIG_SOC_IMX6SL=y · 3 unmodified lines
6049 CONFIG_SOC_IMX6SX=y
6150 CONFIG_SOC_IMX6UL=y
6251 CONFIG_SOC_IMX7D=y
63−CONFIG_SOC_VF610=y
6452 CONFIG_SOC_LS1021A=y
53+CONFIG_SOC_VF610=y
54+CONFIG_ARCH_KEYSTONE=y
55+CONFIG_ARCH_MEDIATEK=y
56+CONFIG_ARCH_MESON=y
57+CONFIG_ARCH_MVEBU=y
58+CONFIG_MACH_ARMADA_370=y
59+CONFIG_MACH_ARMADA_375=y
60+CONFIG_MACH_ARMADA_38X=y
61+CONFIG_MACH_ARMADA_39X=y
62+CONFIG_MACH_ARMADA_XP=y
63+CONFIG_MACH_DOVE=y
6564 CONFIG_ARCH_OMAP3=y
6665 CONFIG_ARCH_OMAP4=y
6766 CONFIG_SOC_OMAP5=y
6867 CONFIG_SOC_AM33XX=y
6968 CONFIG_SOC_AM43XX=y
7069 CONFIG_SOC_DRA7XX=y
70+CONFIG_ARCH_SIRF=y
7171 CONFIG_ARCH_QCOM=y
72−CONFIG_ARCH_MEDIATEK=y
7372 CONFIG_ARCH_MSM8X60=y
7473 CONFIG_ARCH_MSM8960=y
7574 CONFIG_ARCH_MSM8974=y
7675 CONFIG_ARCH_ROCKCHIP=y
77−CONFIG_ARCH_SOCFPGA=y
78−CONFIG_PLAT_SPEAR=y
79−CONFIG_ARCH_SPEAR13XX=y
80−CONFIG_MACH_SPEAR1310=y
81−CONFIG_MACH_SPEAR1340=y
82−CONFIG_ARCH_STI=y
83−CONFIG_ARCH_STM32=y
84−CONFIG_ARCH_EXYNOS=y
85−CONFIG_EXYNOS5420_MCPM=y
8676 CONFIG_ARCH_RENESAS=y
8777 CONFIG_ARCH_EMEV2=y
8878 CONFIG_ARCH_R7S72100=y
@@ -99,40 +89,33 @@ CONFIG_ARCH_R8A7792=y · 10 unmodified lines
9989 CONFIG_ARCH_R8A7793=y
10090 CONFIG_ARCH_R8A7794=y
10191 CONFIG_ARCH_SH73A0=y
92+CONFIG_ARCH_SOCFPGA=y
93+CONFIG_PLAT_SPEAR=y
94+CONFIG_ARCH_SPEAR13XX=y
95+CONFIG_MACH_SPEAR1310=y
96+CONFIG_MACH_SPEAR1340=y
97+CONFIG_ARCH_STI=y
98+CONFIG_ARCH_STM32=y
10299 CONFIG_ARCH_SUNXI=y
103−CONFIG_ARCH_SIRF=y
104100 CONFIG_ARCH_TEGRA=y
105−CONFIG_ARCH_TEGRA_2x_SOC=y
106−CONFIG_ARCH_TEGRA_3x_SOC=y
107−CONFIG_ARCH_TEGRA_114_SOC=y
108−CONFIG_ARCH_TEGRA_124_SOC=y
109101 CONFIG_ARCH_UNIPHIER=y
110102 CONFIG_ARCH_U8500=y
111−CONFIG_MACH_HREFV60=y
112−CONFIG_MACH_SNOWBALL=y
113103 CONFIG_ARCH_VEXPRESS=y
114104 CONFIG_ARCH_VEXPRESS_TC2_PM=y
115105 CONFIG_ARCH_WM8850=y
116106 CONFIG_ARCH_ZYNQ=y
117−CONFIG_TRUSTED_FOUNDATIONS=y
118−CONFIG_PCI=y
119−CONFIG_PCI_HOST_GENERIC=y
120−CONFIG_PCI_DRA7XX=y
121−CONFIG_PCI_DRA7XX_EP=y
122−CONFIG_PCI_KEYSTONE=y
123−CONFIG_PCI_MSI=y
107+CONFIG_PCIEPORTBUS=y
124108 CONFIG_PCI_MVEBU=y
125109 CONFIG_PCI_TEGRA=y
126110 CONFIG_PCI_RCAR_GEN2=y
127111 CONFIG_PCIE_RCAR=y
128−CONFIG_PCIEPORTBUS=y
112+CONFIG_PCI_DRA7XX_EP=y
113+CONFIG_PCI_KEYSTONE=y
129114 CONFIG_PCI_ENDPOINT=y
130115 CONFIG_PCI_ENDPOINT_CONFIGFS=y
131116 CONFIG_PCI_EPF_TEST=m
132117 CONFIG_SMP=y
133118 CONFIG_NR_CPUS=16
134−CONFIG_HIGHPTE=y
135−CONFIG_CMA=y
136119 CONFIG_SECCOMP=y
137120 CONFIG_ARM_APPENDED_DTB=y
138121 CONFIG_ARM_ATAG_DTB_COMPAT=y
@@ -145,14 +128,14 @@ CONFIG_CPU_FREQ_GOV_POWERSAVE=m · 6 unmodified lines
145128 CONFIG_CPU_FREQ_GOV_USERSPACE=m
146129 CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m
147130 CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y
131+CONFIG_CPUFREQ_DT=y
148132 CONFIG_ARM_IMX6Q_CPUFREQ=y
149133 CONFIG_QORIQ_CPUFREQ=y
150134 CONFIG_CPU_IDLE=y
151135 CONFIG_ARM_CPUIDLE=y
152−CONFIG_NEON=y
153−CONFIG_KERNEL_MODE_NEON=y
154136 CONFIG_ARM_ZYNQ_CPUIDLE=y
155137 CONFIG_ARM_EXYNOS_CPUIDLE=y
138+CONFIG_KERNEL_MODE_NEON=y
156139 CONFIG_NET=y
157140 CONFIG_PACKET=y
158141 CONFIG_UNIX=y
@@ -170,23 +153,13 @@ CONFIG_IPV6_MIP6=m · 11 unmodified lines
170153 CONFIG_IPV6_TUNNEL=m
171154 CONFIG_IPV6_MULTIPLE_TABLES=y
172155 CONFIG_NET_DSA=m
173−CONFIG_NET_SWITCHDEV=y
174156 CONFIG_CAN=y
175−CONFIG_CAN_RAW=y
176−CONFIG_CAN_BCM=y
177−CONFIG_CAN_DEV=y
178157 CONFIG_CAN_AT91=m
179158 CONFIG_CAN_FLEXCAN=m
180−CONFIG_CAN_RCAR=m
159+CONFIG_CAN_SUN4I=y
181160 CONFIG_CAN_XILINXCAN=y
161+CONFIG_CAN_RCAR=m
182162 CONFIG_CAN_MCP251X=y
183−CONFIG_NET_DSA_BCM_SF2=m
184−CONFIG_B53=m
185−CONFIG_B53_SPI_DRIVER=m
186−CONFIG_B53_MDIO_DRIVER=m
187−CONFIG_B53_MMAP_DRIVER=m
188−CONFIG_B53_SRAB_DRIVER=m
189−CONFIG_CAN_SUN4I=y
190163 CONFIG_BT=m
191164 CONFIG_BT_HCIUART=m
192165 CONFIG_BT_HCIUART_BCM=y
@@ -199,11 +172,9 @@ CONFIG_RFKILL_INPUT=y · 6 unmodified lines
199172 CONFIG_RFKILL_GPIO=y
200173 CONFIG_DEVTMPFS=y
201174 CONFIG_DEVTMPFS_MOUNT=y
202−CONFIG_DMA_CMA=y
203175 CONFIG_CMA_SIZE_MBYTES=64
204176 CONFIG_OMAP_OCP2SCP=y
205177 CONFIG_SIMPLE_PM_BUS=y
206−CONFIG_SUNXI_RSB=y
207178 CONFIG_MTD=y
208179 CONFIG_MTD_CMDLINE_PARTS=y
209180 CONFIG_MTD_BLOCK=y
@@ -236,7 +207,6 @@ CONFIG_PCI_ENDPOINT_TEST=m · 26 unmodified lines
236207 CONFIG_EEPROM_AT24=y
237208 CONFIG_BLK_DEV_SD=y
238209 CONFIG_BLK_DEV_SR=y
239−CONFIG_SCSI_MULTI_LUN=y
240210 CONFIG_ATA=y
241211 CONFIG_SATA_AHCI=y
242212 CONFIG_SATA_AHCI_PLATFORM=y
@@ -251,14 +221,20 @@ CONFIG_SATA_MV=y · 8 unmodified lines
251221 CONFIG_SATA_RCAR=y
252222 CONFIG_NETDEVICES=y
253223 CONFIG_VIRTIO_NET=y
254−CONFIG_HIX5HD2_GMAC=y
224+CONFIG_B53_SPI_DRIVER=m
225+CONFIG_B53_MDIO_DRIVER=m
226+CONFIG_B53_MMAP_DRIVER=m
227+CONFIG_B53_SRAB_DRIVER=m
228+CONFIG_NET_DSA_BCM_SF2=m
255229 CONFIG_SUN4I_EMAC=y
256−CONFIG_MACB=y
257230 CONFIG_BCMGENET=m
258231 CONFIG_BGMAC_BCMA=y
259232 CONFIG_SYSTEMPORT=m
233+CONFIG_MACB=y
260234 CONFIG_NET_CALXEDA_XGMAC=y
261235 CONFIG_GIANFAR=y
236+CONFIG_HIX5HD2_GMAC=y
237+CONFIG_E1000E=y
262238 CONFIG_IGB=y
263239 CONFIG_MV643XX_ETH=y
264240 CONFIG_MVNETA=y
@@ -268,19 +244,17 @@ CONFIG_R8169=y · 3 unmodified lines
268244 CONFIG_SH_ETH=y
269245 CONFIG_SMSC911X=y
270246 CONFIG_STMMAC_ETH=y
271−CONFIG_STMMAC_PLATFORM=y
272247 CONFIG_DWMAC_DWC_QOS_ETH=y
273248 CONFIG_TI_CPSW=y
274249 CONFIG_XILINX_EMACLITE=y
275250 CONFIG_AT803X_PHY=y
276−CONFIG_MARVELL_PHY=y
277−CONFIG_SMSC_PHY=y
278251 CONFIG_BROADCOM_PHY=y
279252 CONFIG_ICPLUS_PHY=y
280−CONFIG_REALTEK_PHY=y
253+CONFIG_MARVELL_PHY=y
281254 CONFIG_MICREL_PHY=y
282−CONFIG_FIXED_PHY=y
255+CONFIG_REALTEK_PHY=y
283256 CONFIG_ROCKCHIP_PHY=y
257+CONFIG_SMSC_PHY=y
284258 CONFIG_USB_PEGASUS=y
285259 CONFIG_USB_RTL8152=m
286260 CONFIG_USB_LAN78XX=m
@@ -288,29 +262,29 @@ CONFIG_USB_USBNET=y · 1 unmodified line
288262 CONFIG_USB_NET_SMSC75XX=y
289263 CONFIG_USB_NET_SMSC95XX=y
290264 CONFIG_BRCMFMAC=m
291−CONFIG_RT2X00=m
292−CONFIG_RT2800USB=m
293265 CONFIG_MWIFIEX=m
294266 CONFIG_MWIFIEX_SDIO=m
267+CONFIG_RT2X00=m
268+CONFIG_RT2800USB=m
295269 CONFIG_INPUT_JOYDEV=y
296270 CONFIG_INPUT_EVDEV=y
297271 CONFIG_KEYBOARD_QT1070=m
298272 CONFIG_KEYBOARD_GPIO=y
299273 CONFIG_KEYBOARD_TEGRA=y
300−CONFIG_KEYBOARD_SPEAR=y
274+CONFIG_KEYBOARD_SAMSUNG=m
301275 CONFIG_KEYBOARD_ST_KEYSCAN=y
276+CONFIG_KEYBOARD_SPEAR=y
302277 CONFIG_KEYBOARD_CROS_EC=m
303−CONFIG_KEYBOARD_SAMSUNG=m
304278 CONFIG_MOUSE_PS2_ELANTECH=y
305279 CONFIG_MOUSE_CYAPA=m
306280 CONFIG_MOUSE_ELAN_I2C=y
307281 CONFIG_INPUT_TOUCHSCREEN=y
308282 CONFIG_TOUCHSCREEN_ATMEL_MXT=m
309283 CONFIG_TOUCHSCREEN_MMS114=m
284+CONFIG_TOUCHSCREEN_WM97XX=m
310285 CONFIG_TOUCHSCREEN_ST1232=m
311286 CONFIG_TOUCHSCREEN_STMPE=y
312287 CONFIG_TOUCHSCREEN_SUN4I=y
313−CONFIG_TOUCHSCREEN_WM97XX=m
314288 CONFIG_INPUT_MISC=y
315289 CONFIG_INPUT_MAX77693_HAPTIC=m
316290 CONFIG_INPUT_MAX8997_HAPTIC=m
@@ -327,13 +301,12 @@ CONFIG_SERIAL_8250_DW=y · 10 unmodified lines
327301 CONFIG_SERIAL_8250_EM=y
328302 CONFIG_SERIAL_8250_MT6577=y
329303 CONFIG_SERIAL_8250_UNIPHIER=y
304+CONFIG_SERIAL_OF_PLATFORM=y
330305 CONFIG_SERIAL_AMBA_PL011=y
331306 CONFIG_SERIAL_AMBA_PL011_CONSOLE=y
332307 CONFIG_SERIAL_ATMEL=y
333308 CONFIG_SERIAL_ATMEL_CONSOLE=y
334309 CONFIG_SERIAL_ATMEL_TTYAT=y
335−CONFIG_SERIAL_BCM63XX=y
336−CONFIG_SERIAL_BCM63XX_CONSOLE=y
337310 CONFIG_SERIAL_MESON=y
338311 CONFIG_SERIAL_MESON_CONSOLE=y
339312 CONFIG_SERIAL_SAMSUNG=y
@@ -345,15 +318,14 @@ CONFIG_SERIAL_IMX=y · 5 unmodified lines
345318 CONFIG_SERIAL_IMX_CONSOLE=y
346319 CONFIG_SERIAL_SH_SCI=y
347320 CONFIG_SERIAL_SH_SCI_NR_UARTS=20
348−CONFIG_SERIAL_SH_SCI_CONSOLE=y
349−CONFIG_SERIAL_SH_SCI_DMA=y
350321 CONFIG_SERIAL_MSM=y
351322 CONFIG_SERIAL_MSM_CONSOLE=y
352323 CONFIG_SERIAL_VT8500=y
353324 CONFIG_SERIAL_VT8500_CONSOLE=y
354−CONFIG_SERIAL_OF_PLATFORM=y
355325 CONFIG_SERIAL_OMAP=y
356326 CONFIG_SERIAL_OMAP_CONSOLE=y
327+CONFIG_SERIAL_BCM63XX=y
328+CONFIG_SERIAL_BCM63XX_CONSOLE=y
357329 CONFIG_SERIAL_XILINX_PS_UART=y
358330 CONFIG_SERIAL_XILINX_PS_UART_CONSOLE=y
359331 CONFIG_SERIAL_FSL_LPUART=y
@@ -365,12 +337,10 @@ CONFIG_SERIAL_ST_ASC_CONSOLE=y · 5 unmodified lines
365337 CONFIG_SERIAL_STM32=y
366338 CONFIG_SERIAL_STM32_CONSOLE=y
367339 CONFIG_SERIAL_DEV_BUS=y
368−CONFIG_HVC_DRIVER=y
369340 CONFIG_VIRTIO_CONSOLE=y
341+CONFIG_HW_RANDOM=y
342+CONFIG_HW_RANDOM_ST=y
370343 CONFIG_I2C_CHARDEV=y
371−CONFIG_I2C_DAVINCI=y
372−CONFIG_I2C_MESON=y
373−CONFIG_I2C_MUX=y
374344 CONFIG_I2C_ARB_GPIO_CHALLENGE=m
375345 CONFIG_I2C_MUX_PCA954x=y
376346 CONFIG_I2C_MUX_PINCTRL=y
@@ -378,12 +348,13 @@ CONFIG_I2C_DEMUX_PINCTRL=y · 1 unmodified line
378348 CONFIG_I2C_AT91=m
379349 CONFIG_I2C_BCM2835=y
380350 CONFIG_I2C_CADENCE=y
351+CONFIG_I2C_DAVINCI=y
381352 CONFIG_I2C_DESIGNWARE_PLATFORM=y
382353 CONFIG_I2C_DIGICOLOR=m
383354 CONFIG_I2C_EMEV2=m
384355 CONFIG_I2C_GPIO=m
385−CONFIG_I2C_EXYNOS5=y
386356 CONFIG_I2C_IMX=y
357+CONFIG_I2C_MESON=y
387358 CONFIG_I2C_MV64XXX=y
388359 CONFIG_I2C_RIIC=y
389360 CONFIG_I2C_RK3X=y
@@ -427,7 +398,6 @@ CONFIG_SPI_SPIDEV=y · 37 unmodified lines
427398 CONFIG_SPMI=y
428399 CONFIG_PINCTRL_AS3722=y
429400 CONFIG_PINCTRL_PALMAS=y
430−CONFIG_PINCTRL_BCM2835=y
431401 CONFIG_PINCTRL_APQ8064=y
432402 CONFIG_PINCTRL_APQ8084=y
433403 CONFIG_PINCTRL_IPQ8064=y
@@ -437,25 +407,33 @@ CONFIG_PINCTRL_MSM8X74=y · 3 unmodified lines
437407 CONFIG_PINCTRL_MSM8916=y
438408 CONFIG_PINCTRL_QCOM_SPMI_PMIC=y
439409 CONFIG_PINCTRL_QCOM_SSBI_PMIC=y
440−CONFIG_GPIO_GENERIC_PLATFORM=y
441410 CONFIG_GPIO_DAVINCI=y
442411 CONFIG_GPIO_DWAPB=y
443412 CONFIG_GPIO_EM=y
444413 CONFIG_GPIO_RCAR=y
414+CONFIG_GPIO_SYSCON=y
445415 CONFIG_GPIO_UNIPHIER=y
446416 CONFIG_GPIO_XILINX=y
447417 CONFIG_GPIO_ZYNQ=y
448418 CONFIG_GPIO_PCA953X=y
449419 CONFIG_GPIO_PCA953X_IRQ=y
450420 CONFIG_GPIO_PCF857X=y
451−CONFIG_GPIO_TWL4030=y
452421 CONFIG_GPIO_PALMAS=y
453−CONFIG_GPIO_SYSCON=y
454422 CONFIG_GPIO_TPS6586X=y
455423 CONFIG_GPIO_TPS65910=y
424+CONFIG_GPIO_TWL4030=y
425+CONFIG_POWER_AVS=y
426+CONFIG_ROCKCHIP_IODOMAIN=y
427+CONFIG_POWER_RESET_AS3722=y
428+CONFIG_POWER_RESET_GPIO=y
429+CONFIG_POWER_RESET_GPIO_RESTART=y
430+CONFIG_POWER_RESET_ST=y
431+CONFIG_POWER_RESET_KEYSTONE=y
432+CONFIG_POWER_RESET_RMOBILE=y
456433 CONFIG_BATTERY_ACT8945A=y
457434 CONFIG_BATTERY_CPCAP=m
458435 CONFIG_BATTERY_SBS=y
436+CONFIG_AXP20X_POWER=m
459437 CONFIG_BATTERY_MAX17040=m
460438 CONFIG_BATTERY_MAX17042=m
461439 CONFIG_CHARGER_CPCAP=m
@@ -464,15 +442,6 @@ CONFIG_CHARGER_MAX77693=m · 2 unmodified lines
464442 CONFIG_CHARGER_MAX8997=m
465443 CONFIG_CHARGER_MAX8998=m
466444 CONFIG_CHARGER_TPS65090=y
467−CONFIG_AXP20X_POWER=m
468−CONFIG_POWER_RESET_AS3722=y
469−CONFIG_POWER_RESET_GPIO=y
470−CONFIG_POWER_RESET_GPIO_RESTART=y
471−CONFIG_POWER_RESET_KEYSTONE=y
472−CONFIG_POWER_RESET_RMOBILE=y
473−CONFIG_POWER_RESET_ST=y
474−CONFIG_POWER_AVS=y
475−CONFIG_ROCKCHIP_IODOMAIN=y
476445 CONFIG_SENSORS_IIO_HWMON=y
477446 CONFIG_SENSORS_LM90=y
478447 CONFIG_SENSORS_LM95245=y
@@ -480,14 +449,12 @@ CONFIG_SENSORS_NTC_THERMISTOR=m · 1 unmodified line
480449 CONFIG_SENSORS_PWM_FAN=m
481450 CONFIG_SENSORS_INA2XX=m
482451 CONFIG_CPU_THERMAL=y
483−CONFIG_BCM2835_THERMAL=m
484−CONFIG_BRCMSTB_THERMAL=m
485452 CONFIG_IMX_THERMAL=y
486453 CONFIG_ROCKCHIP_THERMAL=y
487454 CONFIG_RCAR_THERMAL=y
488455 CONFIG_ARMADA_THERMAL=y
489−CONFIG_DAVINCI_WATCHDOG=m
490−CONFIG_EXYNOS_THERMAL=m
456+CONFIG_BCM2835_THERMAL=m
457+CONFIG_BRCMSTB_THERMAL=m
491458 CONFIG_ST_THERMAL_MEMMAP=y
492459 CONFIG_WATCHDOG=y
493460 CONFIG_DA9063_WATCHDOG=m
@@ -495,20 +462,24 @@ CONFIG_XILINX_WATCHDOG=y · 1 unmodified line
495462 CONFIG_ARM_SP805_WATCHDOG=y
496463 CONFIG_AT91SAM9X_WATCHDOG=y
497464 CONFIG_SAMA5D4_WATCHDOG=y
465+CONFIG_DW_WATCHDOG=y
466+CONFIG_DAVINCI_WATCHDOG=m
498467 CONFIG_ORION_WATCHDOG=y
499468 CONFIG_RN5T618_WATCHDOG=y
500−CONFIG_ST_LPC_WATCHDOG=y
501469 CONFIG_SUNXI_WATCHDOG=y
502470 CONFIG_IMX2_WDT=y
471+CONFIG_ST_LPC_WATCHDOG=y
503472 CONFIG_TEGRA_WATCHDOG=m
504473 CONFIG_MESON_WATCHDOG=y
505−CONFIG_DW_WATCHDOG=y
506474 CONFIG_DIGICOLOR_WATCHDOG=y
507475 CONFIG_RENESAS_WDT=m
508−CONFIG_BCM2835_WDT=y
509476 CONFIG_BCM47XX_WDT=y
510−CONFIG_BCM7038_WDT=m
477+CONFIG_BCM2835_WDT=y
511478 CONFIG_BCM_KONA_WDT=y
479+CONFIG_BCM7038_WDT=m
480+CONFIG_BCMA_HOST_SOC=y
481+CONFIG_BCMA_DRIVER_GMAC_CMN=y
482+CONFIG_BCMA_DRIVER_GPIO=y
512483 CONFIG_MFD_ACT8945A=y
513484 CONFIG_MFD_AS3711=y
514485 CONFIG_MFD_AS3722=y
@@ -516,7 +487,6 @@ CONFIG_MFD_ATMEL_FLEXCOM=y · 1 unmodified line
516487 CONFIG_MFD_ATMEL_HLCDC=m
517488 CONFIG_MFD_BCM590XX=y
518489 CONFIG_MFD_AC100=y
519−CONFIG_MFD_AXP20X=y
520490 CONFIG_MFD_AXP20X_I2C=y
521491 CONFIG_MFD_AXP20X_RSB=y
522492 CONFIG_MFD_CROS_EC=m
@@ -529,11 +499,11 @@ CONFIG_MFD_MAX77693=m · 6 unmodified lines
529499 CONFIG_MFD_MAX8907=y
530500 CONFIG_MFD_MAX8997=y
531501 CONFIG_MFD_MAX8998=y
532−CONFIG_MFD_RK808=y
533502 CONFIG_MFD_CPCAP=y
534503 CONFIG_MFD_PM8XXX=y
535504 CONFIG_MFD_QCOM_RPM=y
536505 CONFIG_MFD_SPMI_PMIC=y
506+CONFIG_MFD_RK808=y
537507 CONFIG_MFD_RN5T618=y
538508 CONFIG_MFD_SEC_CORE=y
539509 CONFIG_MFD_STMPE=y
@@ -543,10 +513,10 @@ CONFIG_MFD_TPS65217=y · 3 unmodified lines
543513 CONFIG_MFD_TPS65218=y
544514 CONFIG_MFD_TPS6586X=y
545515 CONFIG_MFD_TPS65910=y
546−CONFIG_REGULATOR_ACT8945A=y
547−CONFIG_REGULATOR_AB8500=y
548516 CONFIG_REGULATOR_ACT8865=y
517+CONFIG_REGULATOR_ACT8945A=y
549518 CONFIG_REGULATOR_ANATOP=y
519+CONFIG_REGULATOR_AB8500=y
550520 CONFIG_REGULATOR_AS3711=y
551521 CONFIG_REGULATOR_AS3722=y
552522 CONFIG_REGULATOR_AXP20X=y
@@ -554,10 +524,7 @@ CONFIG_REGULATOR_BCM590XX=y · 1 unmodified line
554524 CONFIG_REGULATOR_CPCAP=y
555525 CONFIG_REGULATOR_DA9210=y
556526 CONFIG_REGULATOR_FAN53555=y
557−CONFIG_REGULATOR_RK808=y
558527 CONFIG_REGULATOR_GPIO=y
559−CONFIG_MFD_SYSCON=y
560−CONFIG_POWER_RESET_SYSCON=y
561528 CONFIG_REGULATOR_LP872X=y
562529 CONFIG_REGULATOR_MAX14577=m
563530 CONFIG_REGULATOR_MAX8907=y
@@ -571,7 +538,8 @@ CONFIG_REGULATOR_PALMAS=y · 7 unmodified lines
571538 CONFIG_REGULATOR_PBIAS=y
572539 CONFIG_REGULATOR_PWM=y
573540 CONFIG_REGULATOR_QCOM_RPM=y
574−CONFIG_REGULATOR_QCOM_SMD_RPM=y
541+CONFIG_REGULATOR_QCOM_SMD_RPM=m
542+CONFIG_REGULATOR_RK808=y
575543 CONFIG_REGULATOR_RN5T618=y
576544 CONFIG_REGULATOR_S2MPS11=y
577545 CONFIG_REGULATOR_S5M8767=y
@@ -592,18 +560,17 @@ CONFIG_MEDIA_CEC_SUPPORT=y · 14 unmodified lines
592560 CONFIG_MEDIA_CONTROLLER=y
593561 CONFIG_VIDEO_V4L2_SUBDEV_API=y
594562 CONFIG_MEDIA_USB_SUPPORT=y
595−CONFIG_USB_VIDEO_CLASS=y
596−CONFIG_USB_GSPCA=y
563+CONFIG_USB_VIDEO_CLASS=m
597564 CONFIG_V4L_PLATFORM_DRIVERS=y
598565 CONFIG_SOC_CAMERA=m
599566 CONFIG_SOC_CAMERA_PLATFORM=m
600−CONFIG_VIDEO_RCAR_VIN=m
601−CONFIG_VIDEO_ATMEL_ISI=m
602567 CONFIG_VIDEO_SAMSUNG_EXYNOS4_IS=m
603568 CONFIG_VIDEO_S5P_FIMC=m
604569 CONFIG_VIDEO_S5P_MIPI_CSIS=m
605570 CONFIG_VIDEO_EXYNOS_FIMC_LITE=m
606571 CONFIG_VIDEO_EXYNOS4_FIMC_IS=m
572+CONFIG_VIDEO_RCAR_VIN=m
573+CONFIG_VIDEO_ATMEL_ISI=m
607574 CONFIG_V4L_MEM2MEM_DRIVERS=y
608575 CONFIG_VIDEO_SAMSUNG_S5P_JPEG=m
609576 CONFIG_VIDEO_SAMSUNG_S5P_MFC=m
@@ -614,19 +581,15 @@ CONFIG_VIDEO_STI_DELTA=m · 4 unmodified lines
614581 CONFIG_VIDEO_RENESAS_JPU=m
615582 CONFIG_VIDEO_RENESAS_VSP1=m
616583 CONFIG_V4L_TEST_DRIVERS=y
584+CONFIG_VIDEO_VIVID=m
617585 CONFIG_CEC_PLATFORM_DRIVERS=y
618586 CONFIG_VIDEO_SAMSUNG_S5P_CEC=m
619587 # CONFIG_MEDIA_SUBDRV_AUTOSELECT is not set
620588 CONFIG_VIDEO_ADV7180=m
621589 CONFIG_VIDEO_ML86V7667=m
622590 CONFIG_DRM=y
623−CONFIG_DRM_I2C_ADV7511=m
624−CONFIG_DRM_I2C_ADV7511_AUDIO=y
625591 # CONFIG_DRM_I2C_CH7006 is not set
626592 # CONFIG_DRM_I2C_SIL164 is not set
627−CONFIG_DRM_DUMB_VGA_DAC=m
628−CONFIG_DRM_NXP_PTN3460=m
629−CONFIG_DRM_PARADE_PS8622=m
630593 CONFIG_DRM_NOUVEAU=m
631594 CONFIG_DRM_EXYNOS=m
632595 CONFIG_DRM_EXYNOS_FIMD=y
@@ -645,13 +608,18 @@ CONFIG_DRM_RCAR_LVDS=y · 12 unmodified lines
645608 CONFIG_DRM_SUN4I=m
646609 CONFIG_DRM_FSL_DCU=m
647610 CONFIG_DRM_TEGRA=y
611+CONFIG_DRM_PANEL_SIMPLE=y
648612 CONFIG_DRM_PANEL_SAMSUNG_LD9040=m
649613 CONFIG_DRM_PANEL_SAMSUNG_S6E63J0X03=m
650614 CONFIG_DRM_PANEL_SAMSUNG_S6E8AA0=m
651−CONFIG_DRM_PANEL_SIMPLE=y
615+CONFIG_DRM_DUMB_VGA_DAC=m
616+CONFIG_DRM_NXP_PTN3460=m
617+CONFIG_DRM_PARADE_PS8622=m
652618 CONFIG_DRM_SII9234=m
619+CONFIG_DRM_I2C_ADV7511=m
620+CONFIG_DRM_I2C_ADV7511_AUDIO=y
653621 CONFIG_DRM_STI=m
654−CONFIG_DRM_VC4=y
622+CONFIG_DRM_VC4=m
655623 CONFIG_DRM_ETNAVIV=m
656624 CONFIG_DRM_MXSFB=m
657625 CONFIG_FB_ARMCLCD=y
@@ -659,8 +627,6 @@ CONFIG_FB_EFI=y · 1 unmodified line
659627 CONFIG_FB_WM8505=y
660628 CONFIG_FB_SH_MOBILE_LCDC=y
661629 CONFIG_FB_SIMPLE=y
662−CONFIG_BACKLIGHT_LCD_SUPPORT=y
663−CONFIG_BACKLIGHT_CLASS_DEVICE=y
664630 CONFIG_LCD_PLATFORM=m
665631 CONFIG_BACKLIGHT_PWM=y
666632 CONFIG_BACKLIGHT_AS3711=y
@@ -668,7 +634,6 @@ CONFIG_FRAMEBUFFER_CONSOLE=y · 1 unmodified line
668634 CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y
669635 CONFIG_SOUND=m
670636 CONFIG_SND=m
671−CONFIG_SND_DYNAMIC_MINORS=y
672637 CONFIG_SND_HDA_TEGRA=m
673638 CONFIG_SND_HDA_INPUT_BEEP=y
674639 CONFIG_SND_HDA_PATCH_LOADER=y
@@ -692,7 +657,7 @@ CONFIG_SND_SOC_SNOW=m · 17 unmodified lines
692657 CONFIG_SND_SOC_ODROID=m
693658 CONFIG_SND_SOC_SH4_FSI=m
694659 CONFIG_SND_SOC_RCAR=m
695−CONFIG_SND_SIMPLE_SCU_CARD=m
660+CONFIG_SND_SOC_STI=m
696661 CONFIG_SND_SUN4I_CODEC=m
697662 CONFIG_SND_SOC_TEGRA=m
698663 CONFIG_SND_SOC_TEGRA20_I2S=m
@@ -703,31 +668,25 @@ CONFIG_SND_SOC_TEGRA_WM8903=m · 4 unmodified lines
703668 CONFIG_SND_SOC_TEGRA_WM9712=m
704669 CONFIG_SND_SOC_TEGRA_TRIMSLICE=m
705670 CONFIG_SND_SOC_TEGRA_ALC5632=m
706−CONFIG_SND_SOC_CPCAP=m
707671 CONFIG_SND_SOC_TEGRA_MAX98090=m
708672 CONFIG_SND_SOC_AK4642=m
673+CONFIG_SND_SOC_CPCAP=m
709674 CONFIG_SND_SOC_SGTL5000=m
710675 CONFIG_SND_SOC_SPDIF=m
711−CONFIG_SND_SOC_WM8978=m
712−CONFIG_SND_SOC_STI=m
713676 CONFIG_SND_SOC_STI_SAS=m
714−CONFIG_SND_SIMPLE_CARD=m
677+CONFIG_SND_SOC_WM8978=m
678+CONFIG_SND_SIMPLE_SCU_CARD=m
715679 CONFIG_USB=y
716680 CONFIG_USB_OTG=y
717681 CONFIG_USB_XHCI_HCD=y
718682 CONFIG_USB_XHCI_MVEBU=y
719−CONFIG_USB_XHCI_RCAR=m
720683 CONFIG_USB_XHCI_TEGRA=m
721684 CONFIG_USB_EHCI_HCD=y
722−CONFIG_USB_EHCI_MSM=m
723−CONFIG_USB_EHCI_EXYNOS=y
724−CONFIG_USB_EHCI_TEGRA=y
725685 CONFIG_USB_EHCI_HCD_STI=y
726−CONFIG_USB_EHCI_HCD_PLATFORM=y
727−CONFIG_USB_ISP1760=y
686+CONFIG_USB_EHCI_TEGRA=y
687+CONFIG_USB_EHCI_EXYNOS=y
728688 CONFIG_USB_OHCI_HCD=y
729689 CONFIG_USB_OHCI_HCD_STI=y
730−CONFIG_USB_OHCI_HCD_PLATFORM=y
731690 CONFIG_USB_OHCI_EXYNOS=m
732691 CONFIG_USB_R8A66597_HCD=m
733692 CONFIG_USB_RENESAS_USBHS=m
@@ -746,18 +705,18 @@ CONFIG_USB_TI_CPPI41_DMA=y · 12 unmodified lines
746705 CONFIG_USB_TUSB_OMAP_DMA=y
747706 CONFIG_USB_DWC3=y
748707 CONFIG_USB_DWC2=y
749−CONFIG_USB_HSIC_USB3503=y
750708 CONFIG_USB_CHIPIDEA=y
751709 CONFIG_USB_CHIPIDEA_UDC=y
752710 CONFIG_USB_CHIPIDEA_HOST=y
711+CONFIG_USB_ISP1760=y
712+CONFIG_USB_HSIC_USB3503=y
753713 CONFIG_AB8500_USB=y
754−CONFIG_KEYSTONE_USB_PHY=y
714+CONFIG_KEYSTONE_USB_PHY=m
755715 CONFIG_NOP_USB_XCEIV=m
756716 CONFIG_AM335X_PHY_USB=m
757717 CONFIG_TWL6030_USB=m
758718 CONFIG_USB_GPIO_VBUS=y
759719 CONFIG_USB_ISP1301=y
760−CONFIG_USB_MSM_OTG=m
761720 CONFIG_USB_MXS_PHY=y
762721 CONFIG_USB_GADGET=y
763722 CONFIG_USB_FSL_USB2=y
@@ -793,21 +752,20 @@ CONFIG_MMC_SDHCI_OF_ESDHC=y · 29 unmodified lines
793752 CONFIG_MMC_SDHCI_ESDHC_IMX=y
794753 CONFIG_MMC_SDHCI_DOVE=y
795754 CONFIG_MMC_SDHCI_TEGRA=y
755+CONFIG_MMC_SDHCI_S3C=y
796756 CONFIG_MMC_SDHCI_PXAV3=y
797757 CONFIG_MMC_SDHCI_SPEAR=y
798−CONFIG_MMC_SDHCI_S3C=y
799758 CONFIG_MMC_SDHCI_S3C_DMA=y
800759 CONFIG_MMC_SDHCI_BCM_KONA=y
760+CONFIG_MMC_MESON_MX_SDIO=y
801761 CONFIG_MMC_SDHCI_ST=y
802762 CONFIG_MMC_OMAP=y
803763 CONFIG_MMC_OMAP_HS=y
804764 CONFIG_MMC_ATMELMCI=y
805765 CONFIG_MMC_SDHCI_MSM=y
806−CONFIG_MMC_MESON_MX_SDIO=y
807766 CONFIG_MMC_MVSDIO=y
808767 CONFIG_MMC_SDHI=y
809768 CONFIG_MMC_DW=y
810−CONFIG_MMC_DW_PLTFM=y
811769 CONFIG_MMC_DW_EXYNOS=y
812770 CONFIG_MMC_DW_ROCKCHIP=y
813771 CONFIG_MMC_SH_MMCIF=y
@@ -847,94 +805,85 @@ CONFIG_RTC_DRV_MAX77686=y · 33 unmodified lines
847805 CONFIG_RTC_DRV_RK808=m
848806 CONFIG_RTC_DRV_RS5C372=m
849807 CONFIG_RTC_DRV_BQ32K=m
850−CONFIG_RTC_DRV_PALMAS=y
851−CONFIG_RTC_DRV_ST_LPC=y
852808 CONFIG_RTC_DRV_TWL4030=y
809+CONFIG_RTC_DRV_PALMAS=y
853810 CONFIG_RTC_DRV_TPS6586X=y
854811 CONFIG_RTC_DRV_TPS65910=y
855812 CONFIG_RTC_DRV_S35390A=m
856813 CONFIG_RTC_DRV_RX8581=m
857814 CONFIG_RTC_DRV_EM3027=y
815+CONFIG_RTC_DRV_S5M=m
858816 CONFIG_RTC_DRV_DA9063=m
859817 CONFIG_RTC_DRV_EFI=m
860818 CONFIG_RTC_DRV_DIGICOLOR=m
861−CONFIG_RTC_DRV_S5M=m
862819 CONFIG_RTC_DRV_S3C=m
863820 CONFIG_RTC_DRV_PL031=y
864821 CONFIG_RTC_DRV_AT91RM9200=m
865822 CONFIG_RTC_DRV_AT91SAM9=m
866823 CONFIG_RTC_DRV_VT8500=y
867−CONFIG_RTC_DRV_SUN6I=y
868824 CONFIG_RTC_DRV_SUNXI=y
869825 CONFIG_RTC_DRV_MV=y
870826 CONFIG_RTC_DRV_TEGRA=y
827+CONFIG_RTC_DRV_ST_LPC=y
871828 CONFIG_RTC_DRV_CPCAP=m
872829 CONFIG_DMADEVICES=y
873−CONFIG_DW_DMAC=y
874830 CONFIG_AT_HDMAC=y
875831 CONFIG_AT_XDMAC=y
832+CONFIG_DMA_BCM2835=y
833+CONFIG_DMA_SUN6I=y
876834 CONFIG_FSL_EDMA=y
835+CONFIG_IMX_DMA=y
836+CONFIG_IMX_SDMA=y
877837 CONFIG_MV_XOR=y
838+CONFIG_MXS_DMA=y
839+CONFIG_PL330_DMA=y
840+CONFIG_SIRF_DMA=y
841+CONFIG_STE_DMA40=y
842+CONFIG_ST_FDMA=m
878843 CONFIG_TEGRA20_APB_DMA=y
844+CONFIG_XILINX_DMA=y
845+CONFIG_QCOM_BAM_DMA=y
846+CONFIG_DW_DMAC=y
879847 CONFIG_SH_DMAE=y
880848 CONFIG_RCAR_DMAC=y
881849 CONFIG_RENESAS_USB_DMAC=m
882−CONFIG_STE_DMA40=y
883−CONFIG_SIRF_DMA=y
884−CONFIG_TI_EDMA=y
885−CONFIG_PL330_DMA=y
886−CONFIG_IMX_SDMA=y
887−CONFIG_IMX_DMA=y
888−CONFIG_MXS_DMA=y
889−CONFIG_DMA_BCM2835=y
890−CONFIG_DMA_OMAP=y
891−CONFIG_QCOM_BAM_DMA=y
892−CONFIG_XILINX_DMA=y
893−CONFIG_DMA_SUN6I=y
894−CONFIG_ST_FDMA=m
850+CONFIG_VIRTIO_PCI=y
851+CONFIG_VIRTIO_MMIO=y
895852 CONFIG_STAGING=y
896−CONFIG_SENSORS_ISL29018=y
897−CONFIG_SENSORS_ISL29028=y
898853 CONFIG_MFD_NVEC=y
899854 CONFIG_KEYBOARD_NVEC=y
900855 CONFIG_SERIO_NVEC_PS2=y
901856 CONFIG_NVEC_POWER=y
902857 CONFIG_NVEC_PAZ00=y
903−CONFIG_BCMA=y
904−CONFIG_BCMA_HOST_SOC=y
905−CONFIG_BCMA_DRIVER_GMAC_CMN=y
906−CONFIG_BCMA_DRIVER_GPIO=y
907−CONFIG_QCOM_GSBI=y
908−CONFIG_QCOM_PM=y
909−CONFIG_QCOM_SMEM=y
910−CONFIG_QCOM_SMD_RPM=y
911−CONFIG_QCOM_SMP2P=y
912−CONFIG_QCOM_SMSM=y
913−CONFIG_QCOM_WCNSS_CTRL=m
914−CONFIG_ROCKCHIP_PM_DOMAINS=y
915−CONFIG_COMMON_CLK_QCOM=y
916−CONFIG_QCOM_CLK_RPM=y
917−CONFIG_CHROME_PLATFORMS=y
918858 CONFIG_STAGING_BOARD=y
919−CONFIG_CROS_EC_CHARDEV=m
920859 CONFIG_COMMON_CLK_MAX77686=y
921860 CONFIG_COMMON_CLK_RK808=m
922861 CONFIG_COMMON_CLK_S2MPS11=m
862+CONFIG_COMMON_CLK_QCOM=y
863+CONFIG_QCOM_CLK_RPM=y
923864 CONFIG_APQ_MMCC_8084=y
924865 CONFIG_MSM_GCC_8660=y
925866 CONFIG_MSM_MMCC_8960=y
926867 CONFIG_MSM_MMCC_8974=y
927−CONFIG_HWSPINLOCK_QCOM=y
868+CONFIG_BCM2835_MBOX=y
928869 CONFIG_ROCKCHIP_IOMMU=y
929870 CONFIG_TEGRA_IOMMU_GART=y
930871 CONFIG_TEGRA_IOMMU_SMMU=y
931872 CONFIG_REMOTEPROC=m
932873 CONFIG_ST_REMOTEPROC=m
933874 CONFIG_RPMSG_VIRTIO=m
875+CONFIG_RASPBERRYPI_POWER=y
876+CONFIG_QCOM_GSBI=y
877+CONFIG_QCOM_PM=y
878+CONFIG_QCOM_SMD_RPM=m
879+CONFIG_QCOM_WCNSS_CTRL=m
880+CONFIG_ROCKCHIP_PM_DOMAINS=y
881+CONFIG_ARCH_TEGRA_2x_SOC=y
882+CONFIG_ARCH_TEGRA_3x_SOC=y
883+CONFIG_ARCH_TEGRA_114_SOC=y
884+CONFIG_ARCH_TEGRA_124_SOC=y
934885 CONFIG_PM_DEVFREQ=y
935886 CONFIG_ARM_TEGRA_DEVFREQ=m
936−CONFIG_MEMORY=y
937−CONFIG_EXTCON=y
938887 CONFIG_TI_AEMIF=y
939888 CONFIG_IIO=y
940889 CONFIG_IIO_SW_TRIGGER=y
@@ -947,56 +896,54 @@ CONFIG_VF610_ADC=m · 6 unmodified lines
947896 CONFIG_XILINX_XADC=y
948897 CONFIG_MPU3050_I2C=y
949898 CONFIG_CM36651=m
899+CONFIG_SENSORS_ISL29018=y
900+CONFIG_SENSORS_ISL29028=y
950901 CONFIG_AK8975=y
951−CONFIG_RASPBERRYPI_POWER=y
952902 CONFIG_IIO_HRTIMER_TRIGGER=y
953903 CONFIG_PWM=y
954904 CONFIG_PWM_ATMEL=m
955905 CONFIG_PWM_ATMEL_HLCDC_PWM=m
956906 CONFIG_PWM_ATMEL_TCB=m
907+CONFIG_PWM_BCM2835=y
908+CONFIG_PWM_BRCMSTB=m
957909 CONFIG_PWM_FSL_FTM=m
958910 CONFIG_PWM_MESON=m
959911 CONFIG_PWM_RCAR=m
960912 CONFIG_PWM_RENESAS_TPU=y
961913 CONFIG_PWM_ROCKCHIP=m
962914 CONFIG_PWM_SAMSUNG=m
915+CONFIG_PWM_STI=y
963916 CONFIG_PWM_SUN4I=y
964917 CONFIG_PWM_TEGRA=y
965918 CONFIG_PWM_VT8500=y
919+CONFIG_KEYSTONE_IRQ=y
920+CONFIG_PHY_SUN4I_USB=y
921+CONFIG_PHY_SUN9I_USB=y
966922 CONFIG_PHY_HIX5HD2_SATA=y
967−CONFIG_E1000E=y
968−CONFIG_PWM_STI=y
969−CONFIG_PWM_BCM2835=y
970−CONFIG_PWM_BRCMSTB=m
971−CONFIG_PHY_DM816X_USB=m
972−CONFIG_OMAP_USB2=y
973−CONFIG_TI_PIPE3=y
974−CONFIG_TWL4030_USB=m
923+CONFIG_PHY_BERLIN_SATA=y
975924 CONFIG_PHY_BERLIN_USB=y
976925 CONFIG_PHY_CPCAP_USB=m
977−CONFIG_PHY_BERLIN_SATA=y
926+CONFIG_PHY_QCOM_APQ8064_SATA=m
927+CONFIG_PHY_RCAR_GEN2=m
978928 CONFIG_PHY_ROCKCHIP_DP=m
979929 CONFIG_PHY_ROCKCHIP_USB=y
980−CONFIG_PHY_QCOM_APQ8064_SATA=m
930+CONFIG_PHY_SAMSUNG_USB2=m
981931 CONFIG_PHY_MIPHY28LP=y
982−CONFIG_PHY_RCAR_GEN2=m
983932 CONFIG_PHY_STIH407_USB=y
984933 CONFIG_PHY_STM32_USBPHYC=y
985−CONFIG_PHY_SUN4I_USB=y
986−CONFIG_PHY_SUN9I_USB=y
987−CONFIG_PHY_SAMSUNG_USB2=m
988934 CONFIG_PHY_TEGRA_XUSB=y
989−CONFIG_PHY_BRCM_SATA=y
990−CONFIG_NVMEM=y
935+CONFIG_PHY_DM816X_USB=m
936+CONFIG_OMAP_USB2=y
937+CONFIG_TI_PIPE3=y
938+CONFIG_TWL4030_USB=m
991939 CONFIG_NVMEM_IMX_OCOTP=y
992940 CONFIG_NVMEM_SUNXI_SID=y
993941 CONFIG_NVMEM_VF610_OCOTP=y
994−CONFIG_BCM2835_MBOX=y
995942 CONFIG_RASPBERRYPI_FIRMWARE=y
996−CONFIG_EFI_VARS=m
997−CONFIG_EFI_CAPSULE_LOADER=m
998943 CONFIG_BCM47XX_NVRAM=y
999944 CONFIG_BCM47XX_SPROM=y
945+CONFIG_EFI_VARS=m
946+CONFIG_EFI_CAPSULE_LOADER=m
1000947 CONFIG_EXT4_FS=y
1001948 CONFIG_AUTOFS4_FS=y
1002949 CONFIG_MSDOS_FS=y
@@ -1004,7 +951,6 @@ CONFIG_VFAT_FS=y · 1 unmodified line
1004951 CONFIG_NTFS_FS=y
1005952 CONFIG_TMPFS_POSIX_ACL=y
1006953 CONFIG_UBIFS_FS=y
1007−CONFIG_TMPFS=y
1008954 CONFIG_SQUASHFS=y
1009955 CONFIG_SQUASHFS_LZO=y
1010956 CONFIG_SQUASHFS_XZ=y
@@ -1020,13 +966,7 @@ CONFIG_NLS_CODEPAGE_437=y · 9 unmodified lines
1020966 CONFIG_NLS_ISO8859_1=y
1021967 CONFIG_NLS_UTF8=y
1022968 CONFIG_PRINTK_TIME=y
1023−CONFIG_DEBUG_FS=y
1024969 CONFIG_MAGIC_SYSRQ=y
1025−CONFIG_LOCKUP_DETECTOR=y
1026−CONFIG_CPUFREQ_DT=y
1027−CONFIG_KEYSTONE_IRQ=y
1028−CONFIG_HW_RANDOM=y
1029−CONFIG_HW_RANDOM_ST=y
1030970 CONFIG_CRYPTO_USER=m
1031971 CONFIG_CRYPTO_USER_API_HASH=m
1032972 CONFIG_CRYPTO_USER_API_SKCIPHER=m
@@ -1035,27 +975,19 @@ CONFIG_CRYPTO_USER_API_AEAD=m · 2 unmodified lines
1035975 CONFIG_CRYPTO_DEV_MARVELL_CESA=m
1036976 CONFIG_CRYPTO_DEV_EXYNOS_RNG=m
1037977 CONFIG_CRYPTO_DEV_S5P=m
978+CONFIG_CRYPTO_DEV_ATMEL_AES=m
979+CONFIG_CRYPTO_DEV_ATMEL_TDES=m
980+CONFIG_CRYPTO_DEV_ATMEL_SHA=m
1038981 CONFIG_CRYPTO_DEV_SUN4I_SS=m
1039982 CONFIG_CRYPTO_DEV_ROCKCHIP=m
1040983 CONFIG_ARM_CRYPTO=y
1041−CONFIG_CRYPTO_SHA1_ARM=m
1042984 CONFIG_CRYPTO_SHA1_ARM_NEON=m
1043985 CONFIG_CRYPTO_SHA1_ARM_CE=m
1044986 CONFIG_CRYPTO_SHA2_ARM_CE=m
1045−CONFIG_CRYPTO_SHA256_ARM=m
1046987 CONFIG_CRYPTO_SHA512_ARM=m
1047988 CONFIG_CRYPTO_AES_ARM=m
1048989 CONFIG_CRYPTO_AES_ARM_BS=m
1049990 CONFIG_CRYPTO_AES_ARM_CE=m
1050−CONFIG_CRYPTO_CHACHA20_NEON=m
1051−CONFIG_CRYPTO_CRC32_ARM_CE=m
1052−CONFIG_CRYPTO_CRCT10DIF_ARM_CE=m
1053991 CONFIG_CRYPTO_GHASH_ARM_CE=m
1054−CONFIG_CRYPTO_DEV_ATMEL_AES=m
1055−CONFIG_CRYPTO_DEV_ATMEL_TDES=m
1056−CONFIG_CRYPTO_DEV_ATMEL_SHA=m
1057−CONFIG_VIDEO_VIVID=m
1058−CONFIG_VIRTIO=y
1059−CONFIG_VIRTIO_PCI=y
1060−CONFIG_VIRTIO_PCI_LEGACY=y
1061−CONFIG_VIRTIO_MMIO=y
992+CONFIG_CRYPTO_CRC32_ARM_CE=m
993+CONFIG_CRYPTO_CHACHA20_NEON=m
arch/arm/kernel/signal.c+2−2
@@ -544,7 +544,7 @@ static void handle_signal(struct ksignal *ksig, struct pt_regs *regs) · 543 unmodified lines
544544 * Increment event counter and perform fixup for the pre-signal
545545 * frame.
546546 */
547− rseq_signal_deliver(regs);
547+ rseq_signal_deliver(ksig, regs);
548548
549549 /*
550550 * Set up the stack frame
@@ -666,7 +666,7 @@ do_work_pending(struct pt_regs *regs, unsigned int thread_flags, int syscall) · 115 unmodified lines
666666 } else {
667667 clear_thread_flag(TIF_NOTIFY_RESUME);
668668 tracehook_notify_resume(regs);
669− rseq_handle_notify_resume(regs);
669+ rseq_handle_notify_resume(NULL, regs);
670670 }
671671 }
672672 local_irq_disable();
arch/arm/mach-bcm/Kconfig+1−0
@@ -20,6 +20,7 @@ config ARCH_BCM_IPROC · 19 unmodified lines
2020 select GPIOLIB
2121 select ARM_AMBA
2222 select PINCTRL
23+ select PCI_DOMAINS if PCI
2324 help
2425 This enables support for systems based on Broadcom IPROC architected SoCs.
2526 The IPROC complex contains one or more ARM CPUs along with common
arch/arm/mach-davinci/board-da850-evm.c+1−1
@@ -774,7 +774,7 @@ static struct gpiod_lookup_table mmc_gpios_table = { · 773 unmodified lines
774774 GPIO_LOOKUP("davinci_gpio.0", DA850_MMCSD_CD_PIN, "cd",
775775 GPIO_ACTIVE_LOW),
776776 GPIO_LOOKUP("davinci_gpio.0", DA850_MMCSD_WP_PIN, "wp",
777− GPIO_ACTIVE_LOW),
777+ GPIO_ACTIVE_HIGH),
778778 },
779779 };
780780
arch/arm/mach-socfpga/Kconfig+1−0
@@ -10,6 +10,7 @@ menuconfig ARCH_SOCFPGA · 9 unmodified lines
1010 select HAVE_ARM_SCU
1111 select HAVE_ARM_TWD if SMP
1212 select MFD_SYSCON
13+ select PCI_DOMAINS if PCI
1314
1415 if ARCH_SOCFPGA
1516 config SOCFPGA_SUSPEND
arch/arm/xen/enlighten.c+4−3
@@ -59,6 +59,9 @@ struct xen_memory_region xen_extra_mem[XEN_EXTRA_MEM_MAX_REGIONS] __initdata; · 58 unmodified lines
5959
6060 static __read_mostly unsigned int xen_events_irq;
6161
62+uint32_t xen_start_flags;
63+EXPORT_SYMBOL(xen_start_flags);
64+
6265 int xen_remap_domain_gfn_array(struct vm_area_struct *vma,
6366 unsigned long addr,
6467 xen_pfn_t *gfn, int nr,
@@ -293,9 +296,7 @@ void __init xen_early_init(void) · 228 unmodified lines
293296 xen_setup_features();
294297
295298 if (xen_feature(XENFEAT_dom0))
296− xen_start_info->flags |= SIF_INITDOMAIN|SIF_PRIVILEGED;
297− else
298− xen_start_info->flags &= ~(SIF_INITDOMAIN|SIF_PRIVILEGED);
299+ xen_start_flags |= SIF_INITDOMAIN|SIF_PRIVILEGED;
299300
300301 if (!console_set_on_cmdline && !xen_initial_domain())
301302 add_preferred_console("hvc", 0, NULL);
arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi+2−4
@@ -309,8 +309,7 @@ · 308 unmodified lines
309309 interrupts = <0 99 4>;
310310 resets = <&rst SPIM0_RESET>;
311311 reg-io-width = <4>;
312− num-chipselect = <4>;
313− bus-num = <0>;
312+ num-cs = <4>;
314313 status = "disabled";
315314 };
316315
@@ -322,8 +321,7 @@ · 5 unmodified lines
322321 interrupts = <0 100 4>;
323322 resets = <&rst SPIM1_RESET>;
324323 reg-io-width = <4>;
325− num-chipselect = <4>;
326− bus-num = <0>;
324+ num-cs = <4>;
327325 status = "disabled";
328326 };
329327
arch/arm64/boot/dts/amlogic/meson-axg-s400.dts+14−1
@@ -66,9 +66,22 @@ · 65 unmodified lines
6666
6767 &ethmac {
6868 status = "okay";
69− phy-mode = "rgmii";
7069 pinctrl-0 = <&eth_rgmii_y_pins>;
7170 pinctrl-names = "default";
71+ phy-handle = <&eth_phy0>;
72+ phy-mode = "rgmii";
73+
74+ mdio {
75+ compatible = "snps,dwmac-mdio";
76+ #address-cells = <1>;
77+ #size-cells = <0>;
78+
79+ eth_phy0: ethernet-phy@0 {
80+ /* Realtek RTL8211F (0x001cc916) */
81+ reg = <0>;
82+ eee-broken-1000t;
83+ };
84+ };
7285 };
7386
7487 &uart_A {
arch/arm64/boot/dts/amlogic/meson-axg.dtsi+2−2
@@ -132,7 +132,7 @@ · 131 unmodified lines
132132
133133 sd_emmc_b: sd@5000 {
134134 compatible = "amlogic,meson-axg-mmc";
135− reg = <0x0 0x5000 0x0 0x2000>;
135+ reg = <0x0 0x5000 0x0 0x800>;
136136 interrupts = <GIC_SPI 217 IRQ_TYPE_EDGE_RISING>;
137137 status = "disabled";
138138 clocks = <&clkc CLKID_SD_EMMC_B>,
@@ -144,7 +144,7 @@ · 5 unmodified lines
144144
145145 sd_emmc_c: mmc@7000 {
146146 compatible = "amlogic,meson-axg-mmc";
147− reg = <0x0 0x7000 0x0 0x2000>;
147+ reg = <0x0 0x7000 0x0 0x800>;
148148 interrupts = <GIC_SPI 218 IRQ_TYPE_EDGE_RISING>;
149149 status = "disabled";
150150 clocks = <&clkc CLKID_SD_EMMC_C>,
arch/arm64/boot/dts/amlogic/meson-gx.dtsi+9−3
@@ -35,6 +35,12 @@ · 34 unmodified lines
3535 no-map;
3636 };
3737
38+ /* Alternate 3 MiB reserved for ARM Trusted Firmware (BL31) */
39+ secmon_reserved_alt: secmon@5000000 {
40+ reg = <0x0 0x05000000 0x0 0x300000>;
41+ no-map;
42+ };
43+
3844 linux,cma {
3945 compatible = "shared-dma-pool";
4046 reusable;
@@ -457,21 +463,21 @@ · 416 unmodified lines
457463
458464 sd_emmc_a: mmc@70000 {
459465 compatible = "amlogic,meson-gx-mmc", "amlogic,meson-gxbb-mmc";
460− reg = <0x0 0x70000 0x0 0x2000>;
466+ reg = <0x0 0x70000 0x0 0x800>;
461467 interrupts = <GIC_SPI 216 IRQ_TYPE_EDGE_RISING>;
462468 status = "disabled";
463469 };
464470
465471 sd_emmc_b: mmc@72000 {
466472 compatible = "amlogic,meson-gx-mmc", "amlogic,meson-gxbb-mmc";
467− reg = <0x0 0x72000 0x0 0x2000>;
473+ reg = <0x0 0x72000 0x0 0x800>;
468474 interrupts = <GIC_SPI 217 IRQ_TYPE_EDGE_RISING>;
469475 status = "disabled";
470476 };
471477
472478 sd_emmc_c: mmc@74000 {
473479 compatible = "amlogic,meson-gx-mmc", "amlogic,meson-gxbb-mmc";
474− reg = <0x0 0x74000 0x0 0x2000>;
480+ reg = <0x0 0x74000 0x0 0x800>;
475481 interrupts = <GIC_SPI 218 IRQ_TYPE_EDGE_RISING>;
476482 status = "disabled";
477483 };
arch/arm64/boot/dts/amlogic/meson-gxl-mali.dtsi+1−1
@@ -6,7 +6,7 @@ · 5 unmodified lines
66
77 &apb {
88 mali: gpu@c0000 {
9− compatible = "amlogic,meson-gxbb-mali", "arm,mali-450";
9+ compatible = "amlogic,meson-gxl-mali", "arm,mali-450";
1010 reg = <0x0 0xc0000 0x0 0x40000>;
1111 interrupts = <GIC_SPI 160 IRQ_TYPE_LEVEL_HIGH>,
1212 <GIC_SPI 161 IRQ_TYPE_LEVEL_HIGH>,
arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts+0−3
@@ -234,9 +234,6 @@ · 233 unmodified lines
234234
235235 bus-width = <4>;
236236 cap-sd-highspeed;
237− sd-uhs-sdr12;
238− sd-uhs-sdr25;
239− sd-uhs-sdr50;
240237 max-frequency = <100000000>;
241238 disable-wp;
242239
arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dtsi+7−0
@@ -189,3 +189,10 @@ · 188 unmodified lines
189189 &usb0 {
190190 status = "okay";
191191 };
192+
193+&usb2_phy0 {
194+ /*
195+ * HDMI_5V is also used as supply for the USB VBUS.
196+ */
197+ phy-supply = <&hdmi_5v>;
198+};
arch/arm64/boot/dts/amlogic/meson-gxl.dtsi+0−8
@@ -13,14 +13,6 @@ · 12 unmodified lines
1313 / {
1414 compatible = "amlogic,meson-gxl";
1515
16− reserved-memory {
17− /* Alternate 3 MiB reserved for ARM Trusted Firmware (BL31) */
18− secmon_reserved_alt: secmon@5000000 {
19− reg = <0x0 0x05000000 0x0 0x300000>;
20− no-map;
21− };
22− };
23−
2416 soc {
2517 usb0: usb@c9000000 {
2618 status = "disabled";
arch/arm64/boot/dts/broadcom/northstar2/ns2.dtsi+4−4
@@ -118,7 +118,7 @@ · 117 unmodified lines
118118
119119 #interrupt-cells = <1>;
120120 interrupt-map-mask = <0 0 0 0>;
121− interrupt-map = <0 0 0 0 &gic 0 GIC_SPI 281 IRQ_TYPE_NONE>;
121+ interrupt-map = <0 0 0 0 &gic 0 GIC_SPI 281 IRQ_TYPE_LEVEL_HIGH>;
122122
123123 linux,pci-domain = <0>;
124124
@@ -149,7 +149,7 @@ · 24 unmodified lines
149149
150150 #interrupt-cells = <1>;
151151 interrupt-map-mask = <0 0 0 0>;
152− interrupt-map = <0 0 0 0 &gic 0 GIC_SPI 305 IRQ_TYPE_NONE>;
152+ interrupt-map = <0 0 0 0 &gic 0 GIC_SPI 305 IRQ_TYPE_LEVEL_HIGH>;
153153
154154 linux,pci-domain = <4>;
155155
@@ -566,7 +566,7 @@ · 410 unmodified lines
566566 reg = <0x66080000 0x100>;
567567 #address-cells = <1>;
568568 #size-cells = <0>;
569− interrupts = <GIC_SPI 394 IRQ_TYPE_NONE>;
569+ interrupts = <GIC_SPI 394 IRQ_TYPE_LEVEL_HIGH>;
570570 clock-frequency = <100000>;
571571 status = "disabled";
572572 };
@@ -594,7 +594,7 @@ · 21 unmodified lines
594594 reg = <0x660b0000 0x100>;
595595 #address-cells = <1>;
596596 #size-cells = <0>;
597− interrupts = <GIC_SPI 395 IRQ_TYPE_NONE>;
597+ interrupts = <GIC_SPI 395 IRQ_TYPE_LEVEL_HIGH>;
598598 clock-frequency = <100000>;
599599 status = "disabled";
600600 };
arch/arm64/boot/dts/broadcom/stingray/bcm958742k.dts+4−0
@@ -43,6 +43,10 @@ · 42 unmodified lines
4343 enet-phy-lane-swap;
4444 };
4545
46+&sdio0 {
47+ mmc-ddr-1_8v;
48+};
49+
4650 &uart2 {
4751 status = "okay";
4852 };
arch/arm64/boot/dts/broadcom/stingray/bcm958742t.dts+4−0
@@ -42,3 +42,7 @@ · 41 unmodified lines
4242 &gphy0 {
4343 enet-phy-lane-swap;
4444 };
45+
46+&sdio0 {
47+ mmc-ddr-1_8v;
48+};
arch/arm64/boot/dts/broadcom/stingray/stingray.dtsi+2−2
@@ -409,7 +409,7 @@ · 408 unmodified lines
409409 reg = <0x000b0000 0x100>;
410410 #address-cells = <1>;
411411 #size-cells = <0>;
412− interrupts = <GIC_SPI 177 IRQ_TYPE_NONE>;
412+ interrupts = <GIC_SPI 177 IRQ_TYPE_LEVEL_HIGH>;
413413 clock-frequency = <100000>;
414414 status = "disabled";
415415 };
@@ -453,7 +453,7 @@ · 37 unmodified lines
453453 reg = <0x000e0000 0x100>;
454454 #address-cells = <1>;
455455 #size-cells = <0>;
456− interrupts = <GIC_SPI 178 IRQ_TYPE_NONE>;
456+ interrupts = <GIC_SPI 178 IRQ_TYPE_LEVEL_HIGH>;
457457 clock-frequency = <100000>;
458458 status = "disabled";
459459 };
arch/arm64/boot/dts/hisilicon/hi3660-hikey960.dts+2−0
@@ -585,6 +585,8 @@ · 584 unmodified lines
585585 vmmc-supply = <&wlan_en>;
586586 ti,non-removable;
587587 non-removable;
588+ cap-power-off-card;
589+ keep-power-in-suspend;
588590 #address-cells = <0x1>;
589591 #size-cells = <0x0>;
590592 status = "ok";
arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts+2−0
@@ -322,6 +322,8 @@ · 321 unmodified lines
322322 dwmmc_2: dwmmc2@f723f000 {
323323 bus-width = <0x4>;
324324 non-removable;
325+ cap-power-off-card;
326+ keep-power-in-suspend;
325327 vmmc-supply = <&reg_vdd_3v3>;
326328 mmc-pwrseq = <&wl1835_pwrseq>;
327329
arch/arm64/boot/dts/marvell/armada-cp110.dtsi+1−1
@@ -149,7 +149,7 @@ · 148 unmodified lines
149149
150150 CP110_LABEL(icu): interrupt-controller@1e0000 {
151151 compatible = "marvell,cp110-icu";
152− reg = <0x1e0000 0x10>;
152+ reg = <0x1e0000 0x440>;
153153 #interrupt-cells = <3>;
154154 interrupt-controller;
155155 msi-parent = <&gicp>;
arch/arm64/boot/dts/qcom/apq8096-db820c.dtsi+1−1
@@ -75,7 +75,7 @@ · 74 unmodified lines
7575
7676 serial@75b1000 {
7777 label = "LS-UART0";
78− status = "okay";
78+ status = "disabled";
7979 pinctrl-names = "default", "sleep";
8080 pinctrl-0 = <&blsp2_uart2_4pins_default>;
8181 pinctrl-1 = <&blsp2_uart2_4pins_sleep>;
arch/arm64/boot/dts/qcom/msm8916.dtsi+2−2
@@ -1191,14 +1191,14 @@ · 1190 unmodified lines
11911191
11921192 port@0 {
11931193 reg = <0>;
1194− etf_out: endpoint {
1194+ etf_in: endpoint {
11951195 slave-mode;
11961196 remote-endpoint = <&funnel0_out>;
11971197 };
11981198 };
11991199 port@1 {
12001200 reg = <0>;
1201− etf_in: endpoint {
1201+ etf_out: endpoint {
12021202 remote-endpoint = <&replicator_in>;
12031203 };
12041204 };
arch/arm64/boot/dts/socionext/uniphier-ld11-global.dts+1−1
@@ -54,7 +54,7 @@ · 53 unmodified lines
5454 sound {
5555 compatible = "audio-graph-card";
5656 label = "UniPhier LD11";
57− widgets = "Headphone", "Headphone Jack";
57+ widgets = "Headphone", "Headphones";
5858 dais = <&i2s_port2
5959 &i2s_port3
6060 &i2s_port4
arch/arm64/boot/dts/socionext/uniphier-ld20-global.dts+1−1
@@ -54,7 +54,7 @@ · 53 unmodified lines
5454 sound {
5555 compatible = "audio-graph-card";
5656 label = "UniPhier LD20";
57− widgets = "Headphone", "Headphone Jack";
57+ widgets = "Headphone", "Headphones";
5858 dais = <&i2s_port2
5959 &i2s_port3
6060 &i2s_port4
arch/arm64/configs/defconfig+39−63
@@ -47,6 +47,7 @@ CONFIG_ARCH_MVEBU=y · 46 unmodified lines
4747 CONFIG_ARCH_QCOM=y
4848 CONFIG_ARCH_ROCKCHIP=y
4949 CONFIG_ARCH_SEATTLE=y
50+CONFIG_ARCH_SYNQUACER=y
5051 CONFIG_ARCH_RENESAS=y
5152 CONFIG_ARCH_R8A7795=y
5253 CONFIG_ARCH_R8A7796=y
@@ -58,7 +59,6 @@ CONFIG_ARCH_R8A77995=y · 5 unmodified lines
5859 CONFIG_ARCH_STRATIX10=y
5960 CONFIG_ARCH_TEGRA=y
6061 CONFIG_ARCH_SPRD=y
61−CONFIG_ARCH_SYNQUACER=y
6262 CONFIG_ARCH_THUNDER=y
6363 CONFIG_ARCH_THUNDER2=y
6464 CONFIG_ARCH_UNIPHIER=y
@@ -67,25 +67,23 @@ CONFIG_ARCH_XGENE=y · 2 unmodified lines
6767 CONFIG_ARCH_ZX=y
6868 CONFIG_ARCH_ZYNQMP=y
6969 CONFIG_PCI=y
70−CONFIG_HOTPLUG_PCI_PCIE=y
7170 CONFIG_PCI_IOV=y
7271 CONFIG_HOTPLUG_PCI=y
7372 CONFIG_HOTPLUG_PCI_ACPI=y
74−CONFIG_PCI_LAYERSCAPE=y
75−CONFIG_PCI_HISI=y
76−CONFIG_PCIE_QCOM=y
77−CONFIG_PCIE_KIRIN=y
78−CONFIG_PCIE_ARMADA_8K=y
79−CONFIG_PCIE_HISI_STB=y
8073 CONFIG_PCI_AARDVARK=y
8174 CONFIG_PCI_TEGRA=y
8275 CONFIG_PCIE_RCAR=y
83−CONFIG_PCIE_ROCKCHIP=y
84−CONFIG_PCIE_ROCKCHIP_HOST=m
8576 CONFIG_PCI_HOST_GENERIC=y
8677 CONFIG_PCI_XGENE=y
8778 CONFIG_PCI_HOST_THUNDER_PEM=y
8879 CONFIG_PCI_HOST_THUNDER_ECAM=y
80+CONFIG_PCIE_ROCKCHIP_HOST=m
81+CONFIG_PCI_LAYERSCAPE=y
82+CONFIG_PCI_HISI=y
83+CONFIG_PCIE_QCOM=y
84+CONFIG_PCIE_ARMADA_8K=y
85+CONFIG_PCIE_KIRIN=y
86+CONFIG_PCIE_HISI_STB=y
8987 CONFIG_ARM64_VA_BITS_48=y
9088 CONFIG_SCHED_MC=y
9189 CONFIG_NUMA=y
@@ -104,8 +102,6 @@ CONFIG_HIBERNATION=y · 12 unmodified lines
104102 CONFIG_WQ_POWER_EFFICIENT_DEFAULT=y
105103 CONFIG_ARM_CPUIDLE=y
106104 CONFIG_CPU_FREQ=y
107−CONFIG_CPU_FREQ_GOV_ATTR_SET=y
108−CONFIG_CPU_FREQ_GOV_COMMON=y
109105 CONFIG_CPU_FREQ_STAT=y
110106 CONFIG_CPU_FREQ_GOV_POWERSAVE=m
111107 CONFIG_CPU_FREQ_GOV_USERSPACE=y
@@ -113,11 +109,11 @@ CONFIG_CPU_FREQ_GOV_ONDEMAND=y · 1 unmodified line
113109 CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m
114110 CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y
115111 CONFIG_CPUFREQ_DT=y
112+CONFIG_ACPI_CPPC_CPUFREQ=m
116113 CONFIG_ARM_ARMADA_37XX_CPUFREQ=y
117114 CONFIG_ARM_BIG_LITTLE_CPUFREQ=y
118115 CONFIG_ARM_SCPI_CPUFREQ=y
119116 CONFIG_ARM_TEGRA186_CPUFREQ=y
120−CONFIG_ACPI_CPPC_CPUFREQ=m
121117 CONFIG_NET=y
122118 CONFIG_PACKET=y
123119 CONFIG_UNIX=y
@@ -236,11 +232,6 @@ CONFIG_SMSC911X=y · 112 unmodified lines
236232 CONFIG_SNI_AVE=y
237233 CONFIG_SNI_NETSEC=y
238234 CONFIG_STMMAC_ETH=m
239−CONFIG_DWMAC_IPQ806X=m
240−CONFIG_DWMAC_MESON=m
241−CONFIG_DWMAC_ROCKCHIP=m
242−CONFIG_DWMAC_SUNXI=m
243−CONFIG_DWMAC_SUN8I=m
244235 CONFIG_MDIO_BUS_MUX_MMIOREG=y
245236 CONFIG_AT803X_PHY=m
246237 CONFIG_MARVELL_PHY=m
@@ -269,8 +260,8 @@ CONFIG_WL18XX=m · 22 unmodified lines
269260 CONFIG_WLCORE_SDIO=m
270261 CONFIG_INPUT_EVDEV=y
271262 CONFIG_KEYBOARD_ADC=m
272−CONFIG_KEYBOARD_CROS_EC=y
273263 CONFIG_KEYBOARD_GPIO=y
264+CONFIG_KEYBOARD_CROS_EC=y
274265 CONFIG_INPUT_TOUCHSCREEN=y
275266 CONFIG_TOUCHSCREEN_ATMEL_MXT=m
276267 CONFIG_INPUT_MISC=y
@@ -296,17 +287,13 @@ CONFIG_SERIAL_SAMSUNG=y · 19 unmodified lines
296287 CONFIG_SERIAL_SAMSUNG_CONSOLE=y
297288 CONFIG_SERIAL_TEGRA=y
298289 CONFIG_SERIAL_SH_SCI=y
299−CONFIG_SERIAL_SH_SCI_NR_UARTS=11
300−CONFIG_SERIAL_SH_SCI_CONSOLE=y
301290 CONFIG_SERIAL_MSM=y
302291 CONFIG_SERIAL_MSM_CONSOLE=y
303292 CONFIG_SERIAL_XILINX_PS_UART=y
304293 CONFIG_SERIAL_XILINX_PS_UART_CONSOLE=y
305294 CONFIG_SERIAL_MVEBU_UART=y
306295 CONFIG_SERIAL_DEV_BUS=y
307−CONFIG_SERIAL_DEV_CTRL_TTYPORT=y
308296 CONFIG_VIRTIO_CONSOLE=y
309−CONFIG_I2C_HID=m
310297 CONFIG_I2C_CHARDEV=y
311298 CONFIG_I2C_MUX=y
312299 CONFIG_I2C_MUX_PCA954x=y
@@ -325,26 +312,26 @@ CONFIG_I2C_RCAR=y · 12 unmodified lines
325312 CONFIG_I2C_CROS_EC_TUNNEL=y
326313 CONFIG_SPI=y
327314 CONFIG_SPI_ARMADA_3700=y
328−CONFIG_SPI_MESON_SPICC=m
329−CONFIG_SPI_MESON_SPIFC=m
330315 CONFIG_SPI_BCM2835=m
331316 CONFIG_SPI_BCM2835AUX=m
317+CONFIG_SPI_MESON_SPICC=m
318+CONFIG_SPI_MESON_SPIFC=m
332319 CONFIG_SPI_ORION=y
333320 CONFIG_SPI_PL022=y
334−CONFIG_SPI_QUP=y
335321 CONFIG_SPI_ROCKCHIP=y
322+CONFIG_SPI_QUP=y
336323 CONFIG_SPI_S3C64XX=y
337324 CONFIG_SPI_SPIDEV=m
338325 CONFIG_SPMI=y
339−CONFIG_PINCTRL_IPQ8074=y
340326 CONFIG_PINCTRL_SINGLE=y
341327 CONFIG_PINCTRL_MAX77620=y
328+CONFIG_PINCTRL_IPQ8074=y
342329 CONFIG_PINCTRL_MSM8916=y
343330 CONFIG_PINCTRL_MSM8994=y
344331 CONFIG_PINCTRL_MSM8996=y
345−CONFIG_PINCTRL_MT7622=y
346332 CONFIG_PINCTRL_QDF2XXX=y
347333 CONFIG_PINCTRL_QCOM_SPMI_PMIC=y
334+CONFIG_PINCTRL_MT7622=y
348335 CONFIG_GPIO_DWAPB=y
349336 CONFIG_GPIO_MB86S7X=y
350337 CONFIG_GPIO_PL061=y
@@ -368,13 +355,13 @@ CONFIG_SENSORS_INA2XX=m · 17 unmodified lines
368355 CONFIG_THERMAL_GOV_POWER_ALLOCATOR=y
369356 CONFIG_CPU_THERMAL=y
370357 CONFIG_THERMAL_EMULATION=y
358+CONFIG_ROCKCHIP_THERMAL=m
359+CONFIG_RCAR_GEN3_THERMAL=y
371360 CONFIG_ARMADA_THERMAL=y
372361 CONFIG_BRCMSTB_THERMAL=m
373362 CONFIG_EXYNOS_THERMAL=y
374−CONFIG_RCAR_GEN3_THERMAL=y
375−CONFIG_QCOM_TSENS=y
376−CONFIG_ROCKCHIP_THERMAL=m
377363 CONFIG_TEGRA_BPMP_THERMAL=m
364+CONFIG_QCOM_TSENS=y
378365 CONFIG_UNIPHIER_THERMAL=y
379366 CONFIG_WATCHDOG=y
380367 CONFIG_S3C2410_WATCHDOG=y
@@ -395,9 +382,9 @@ CONFIG_MFD_MAX77620=y · 14 unmodified lines
395382 CONFIG_MFD_SPMI_PMIC=y
396383 CONFIG_MFD_RK808=y
397384 CONFIG_MFD_SEC_CORE=y
385+CONFIG_REGULATOR_FIXED_VOLTAGE=y
398386 CONFIG_REGULATOR_AXP20X=y
399387 CONFIG_REGULATOR_FAN53555=y
400−CONFIG_REGULATOR_FIXED_VOLTAGE=y
401388 CONFIG_REGULATOR_GPIO=y
402389 CONFIG_REGULATOR_HI6421V530=y
403390 CONFIG_REGULATOR_HI655X=y
@@ -407,16 +394,15 @@ CONFIG_REGULATOR_QCOM_SMD_RPM=y · 3 unmodified lines
407394 CONFIG_REGULATOR_QCOM_SPMI=y
408395 CONFIG_REGULATOR_RK808=y
409396 CONFIG_REGULATOR_S2MPS11=y
397+CONFIG_RC_CORE=m
398+CONFIG_RC_DECODERS=y
399+CONFIG_RC_DEVICES=y
400+CONFIG_IR_MESON=m
410401 CONFIG_MEDIA_SUPPORT=m
411402 CONFIG_MEDIA_CAMERA_SUPPORT=y
412403 CONFIG_MEDIA_ANALOG_TV_SUPPORT=y
413404 CONFIG_MEDIA_DIGITAL_TV_SUPPORT=y
414405 CONFIG_MEDIA_CONTROLLER=y
415−CONFIG_MEDIA_RC_SUPPORT=y
416−CONFIG_RC_CORE=m
417−CONFIG_RC_DEVICES=y
418−CONFIG_RC_DECODERS=y
419−CONFIG_IR_MESON=m
420406 CONFIG_VIDEO_V4L2_SUBDEV_API=y
421407 # CONFIG_DVB_NET is not set
422408 CONFIG_V4L_MEM2MEM_DRIVERS=y
@@ -441,8 +427,7 @@ CONFIG_ROCKCHIP_DW_HDMI=y · 18 unmodified lines
441427 CONFIG_ROCKCHIP_DW_MIPI_DSI=y
442428 CONFIG_ROCKCHIP_INNO_HDMI=y
443429 CONFIG_DRM_RCAR_DU=m
444−CONFIG_DRM_RCAR_LVDS=y
445−CONFIG_DRM_RCAR_VSP=y
430+CONFIG_DRM_RCAR_LVDS=m
446431 CONFIG_DRM_TEGRA=m
447432 CONFIG_DRM_PANEL_SIMPLE=m
448433 CONFIG_DRM_I2C_ADV7511=m
@@ -455,7 +440,6 @@ CONFIG_FB_ARMCLCD=y · 6 unmodified lines
455440 CONFIG_BACKLIGHT_GENERIC=m
456441 CONFIG_BACKLIGHT_PWM=m
457442 CONFIG_BACKLIGHT_LP855X=m
458−CONFIG_FRAMEBUFFER_CONSOLE=y
459443 CONFIG_LOGO=y
460444 # CONFIG_LOGO_LINUX_MONO is not set
461445 # CONFIG_LOGO_LINUX_VGA16 is not set
@@ -468,6 +452,7 @@ CONFIG_SND_SOC_RCAR=m · 6 unmodified lines
468452 CONFIG_SND_SOC_AK4613=m
469453 CONFIG_SND_SIMPLE_CARD=m
470454 CONFIG_SND_AUDIO_GRAPH_CARD=m
455+CONFIG_I2C_HID=m
471456 CONFIG_USB=y
472457 CONFIG_USB_OTG=y
473458 CONFIG_USB_XHCI_HCD=y
@@ -501,12 +486,12 @@ CONFIG_MMC_BLOCK_MINORS=32 · 27 unmodified lines
501486 CONFIG_MMC_ARMMMCI=y
502487 CONFIG_MMC_SDHCI=y
503488 CONFIG_MMC_SDHCI_ACPI=y
504−CONFIG_MMC_SDHCI_F_SDH30=y
505489 CONFIG_MMC_SDHCI_PLTFM=y
506490 CONFIG_MMC_SDHCI_OF_ARASAN=y
507491 CONFIG_MMC_SDHCI_OF_ESDHC=y
508492 CONFIG_MMC_SDHCI_CADENCE=y
509493 CONFIG_MMC_SDHCI_TEGRA=y
494+CONFIG_MMC_SDHCI_F_SDH30=y
510495 CONFIG_MMC_MESON_GX=y
511496 CONFIG_MMC_SDHCI_MSM=y
512497 CONFIG_MMC_SPI=y
@@ -524,11 +509,11 @@ CONFIG_LEDS_CLASS=y · 11 unmodified lines
524509 CONFIG_LEDS_GPIO=y
525510 CONFIG_LEDS_PWM=y
526511 CONFIG_LEDS_SYSCON=y
512+CONFIG_LEDS_TRIGGER_DISK=y
527513 CONFIG_LEDS_TRIGGER_HEARTBEAT=y
528514 CONFIG_LEDS_TRIGGER_CPU=y
529515 CONFIG_LEDS_TRIGGER_DEFAULT_ON=y
530516 CONFIG_LEDS_TRIGGER_PANIC=y
531−CONFIG_LEDS_TRIGGER_DISK=y
532517 CONFIG_EDAC=y
533518 CONFIG_EDAC_GHES=y
534519 CONFIG_RTC_CLASS=y
@@ -537,13 +522,13 @@ CONFIG_RTC_DRV_RK808=m · 2 unmodified lines
537522 CONFIG_RTC_DRV_S5M=y
538523 CONFIG_RTC_DRV_DS3232=y
539524 CONFIG_RTC_DRV_EFI=y
525+CONFIG_RTC_DRV_CROS_EC=y
540526 CONFIG_RTC_DRV_S3C=y
541527 CONFIG_RTC_DRV_PL031=y
542528 CONFIG_RTC_DRV_SUN6I=y
543529 CONFIG_RTC_DRV_ARMADA38X=y
544530 CONFIG_RTC_DRV_TEGRA=y
545531 CONFIG_RTC_DRV_XGENE=y
546−CONFIG_RTC_DRV_CROS_EC=y
547532 CONFIG_DMADEVICES=y
548533 CONFIG_DMA_BCM2835=m
549534 CONFIG_K3_DMA=y
@@ -579,7 +564,6 @@ CONFIG_HWSPINLOCK_QCOM=y · 29 unmodified lines
579564 CONFIG_ARM_MHU=y
580565 CONFIG_PLATFORM_MHU=y
581566 CONFIG_BCM2835_MBOX=y
582−CONFIG_HI6220_MBOX=y
583567 CONFIG_QCOM_APCS_IPC=y
584568 CONFIG_ROCKCHIP_IOMMU=y
585569 CONFIG_TEGRA_IOMMU_SMMU=y
@@ -602,7 +586,6 @@ CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND=y · 16 unmodified lines
602586 CONFIG_EXTCON_USB_GPIO=y
603587 CONFIG_EXTCON_USBC_CROS_EC=y
604588 CONFIG_MEMORY=y
605−CONFIG_TEGRA_MC=y
606589 CONFIG_IIO=y
607590 CONFIG_EXYNOS_ADC=y
608591 CONFIG_ROCKCHIP_SARADC=m
@@ -618,27 +601,27 @@ CONFIG_PWM_RCAR=m · 9 unmodified lines
618601 CONFIG_PWM_ROCKCHIP=y
619602 CONFIG_PWM_SAMSUNG=y
620603 CONFIG_PWM_TEGRA=m
604+CONFIG_PHY_XGENE=y
605+CONFIG_PHY_SUN4I_USB=y
606+CONFIG_PHY_HI6220_USB=y
621607 CONFIG_PHY_HISTB_COMBPHY=y
622608 CONFIG_PHY_HISI_INNO_USB2=y
623−CONFIG_PHY_RCAR_GEN3_USB2=y
624−CONFIG_PHY_RCAR_GEN3_USB3=m
625−CONFIG_PHY_HI6220_USB=y
626−CONFIG_PHY_QCOM_USB_HS=y
627−CONFIG_PHY_SUN4I_USB=y
628609 CONFIG_PHY_MVEBU_CP110_COMPHY=y
629610 CONFIG_PHY_QCOM_QMP=m
630−CONFIG_PHY_ROCKCHIP_INNO_USB2=y
611+CONFIG_PHY_QCOM_USB_HS=y
612+CONFIG_PHY_RCAR_GEN3_USB2=y
613+CONFIG_PHY_RCAR_GEN3_USB3=m
631614 CONFIG_PHY_ROCKCHIP_EMMC=y
615+CONFIG_PHY_ROCKCHIP_INNO_USB2=y
632616 CONFIG_PHY_ROCKCHIP_PCIE=m
633617 CONFIG_PHY_ROCKCHIP_TYPEC=y
634−CONFIG_PHY_XGENE=y
635618 CONFIG_PHY_TEGRA_XUSB=y
636619 CONFIG_QCOM_L2_PMU=y
637620 CONFIG_QCOM_L3_PMU=y
638−CONFIG_MESON_EFUSE=m
639621 CONFIG_QCOM_QFPROM=y
640622 CONFIG_ROCKCHIP_EFUSE=y
641623 CONFIG_UNIPHIER_EFUSE=y
624+CONFIG_MESON_EFUSE=m
642625 CONFIG_TEE=y
643626 CONFIG_OPTEE=y
644627 CONFIG_ARM_SCPI_PROTOCOL=y
@@ -647,7 +630,6 @@ CONFIG_EFI_CAPSULE_LOADER=y · 2 unmodified lines
647630 CONFIG_ACPI=y
648631 CONFIG_ACPI_APEI=y
649632 CONFIG_ACPI_APEI_GHES=y
650−CONFIG_ACPI_APEI_PCIEAER=y
651633 CONFIG_ACPI_APEI_MEMORY_FAILURE=y
652634 CONFIG_ACPI_APEI_EINJ=y
653635 CONFIG_EXT2_FS=y
@@ -682,7 +664,6 @@ CONFIG_DEBUG_INFO=y · 28 unmodified lines
682664 CONFIG_DEBUG_FS=y
683665 CONFIG_MAGIC_SYSRQ=y
684666 CONFIG_DEBUG_KERNEL=y
685−CONFIG_LOCKUP_DETECTOR=y
686667 # CONFIG_SCHED_DEBUG is not set
687668 # CONFIG_DEBUG_PREEMPT is not set
688669 # CONFIG_FTRACE is not set
@@ -691,20 +672,15 @@ CONFIG_SECURITY=y · 2 unmodified lines
691672 CONFIG_CRYPTO_ECHAINIV=y
692673 CONFIG_CRYPTO_ANSI_CPRNG=y
693674 CONFIG_ARM64_CRYPTO=y
694−CONFIG_CRYPTO_SHA256_ARM64=m
695−CONFIG_CRYPTO_SHA512_ARM64=m
696675 CONFIG_CRYPTO_SHA1_ARM64_CE=y
697676 CONFIG_CRYPTO_SHA2_ARM64_CE=y
677+CONFIG_CRYPTO_SHA512_ARM64_CE=m
678+CONFIG_CRYPTO_SHA3_ARM64=m
679+CONFIG_CRYPTO_SM3_ARM64_CE=m
698680 CONFIG_CRYPTO_GHASH_ARM64_CE=y
699681 CONFIG_CRYPTO_CRCT10DIF_ARM64_CE=m
700682 CONFIG_CRYPTO_CRC32_ARM64_CE=m
701−CONFIG_CRYPTO_AES_ARM64=m
702−CONFIG_CRYPTO_AES_ARM64_CE=m
703683 CONFIG_CRYPTO_AES_ARM64_CE_CCM=y
704684 CONFIG_CRYPTO_AES_ARM64_CE_BLK=y
705−CONFIG_CRYPTO_AES_ARM64_NEON_BLK=m
706685 CONFIG_CRYPTO_CHACHA20_NEON=m
707686 CONFIG_CRYPTO_AES_ARM64_BS=m
708−CONFIG_CRYPTO_SHA512_ARM64_CE=m
709−CONFIG_CRYPTO_SHA3_ARM64=m
710−CONFIG_CRYPTO_SM3_ARM64_CE=m
arch/arm64/crypto/aes-glue.c+1−1
@@ -223,8 +223,8 @@ static int ctr_encrypt(struct skcipher_request *req) · 222 unmodified lines
223223 kernel_neon_begin();
224224 aes_ctr_encrypt(walk.dst.virt.addr, walk.src.virt.addr,
225225 (u8 *)ctx->key_enc, rounds, blocks, walk.iv);
226− err = skcipher_walk_done(&walk, walk.nbytes % AES_BLOCK_SIZE);
227226 kernel_neon_end();
227+ err = skcipher_walk_done(&walk, walk.nbytes % AES_BLOCK_SIZE);
228228 }
229229 if (walk.nbytes) {
230230 u8 __aligned(8) tail[AES_BLOCK_SIZE];
arch/arm64/include/asm/alternative.h+6−1
@@ -28,7 +28,12 @@ typedef void (*alternative_cb_t)(struct alt_instr *alt, · 27 unmodified lines
2828 __le32 *origptr, __le32 *updptr, int nr_inst);
2929
3030 void __init apply_alternatives_all(void);
31−void apply_alternatives(void *start, size_t length);
31+
32+#ifdef CONFIG_MODULES
33+void apply_alternatives_module(void *start, size_t length);
34+#else
35+static inline void apply_alternatives_module(void *start, size_t length) { }
36+#endif
3237
3338 #define ALTINSTR_ENTRY(feature,cb) \
3439 " .word 661b - .\n" /* label */ \
arch/arm64/include/asm/kvm_host.h+1−0
@@ -306,6 +306,7 @@ struct kvm_vcpu_arch { · 305 unmodified lines
306306 #define KVM_ARM64_FP_ENABLED (1 << 1) /* guest FP regs loaded */
307307 #define KVM_ARM64_FP_HOST (1 << 2) /* host FP regs loaded */
308308 #define KVM_ARM64_HOST_SVE_IN_USE (1 << 3) /* backup for host TIF_SVE */
309+#define KVM_ARM64_HOST_SVE_ENABLED (1 << 4) /* SVE enabled for EL0 */
309310
310311 #define vcpu_gp_regs(v) (&(v)->arch.ctxt.gp_regs)
311312
arch/arm64/include/asm/pgtable.h+1−5
@@ -224,10 +224,8 @@ static inline void set_pte(pte_t *ptep, pte_t pte) · 223 unmodified lines
224224 * Only if the new pte is valid and kernel, otherwise TLB maintenance
225225 * or update_mmu_cache() have the necessary barriers.
226226 */
227− if (pte_valid_not_user(pte)) {
227+ if (pte_valid_not_user(pte))
228228 dsb(ishst);
229− isb();
230− }
231229 }
232230
233231 extern void __sync_icache_dcache(pte_t pteval);
@@ -434,7 +432,6 @@ static inline void set_pmd(pmd_t *pmdp, pmd_t pmd) · 200 unmodified lines
434432 {
435433 WRITE_ONCE(*pmdp, pmd);
436434 dsb(ishst);
437− isb();
438435 }
439436
440437 static inline void pmd_clear(pmd_t *pmdp)
@@ -485,7 +482,6 @@ static inline void set_pud(pud_t *pudp, pud_t pud) · 44 unmodified lines
485482 {
486483 WRITE_ONCE(*pudp, pud);
487484 dsb(ishst);
488− isb();
489485 }
490486
491487 static inline void pud_clear(pud_t *pudp)
arch/arm64/include/asm/sysreg.h+11−0
@@ -728,6 +728,17 @@ asm( · 727 unmodified lines
728728 asm volatile("msr_s " __stringify(r) ", %x0" : : "rZ" (__val)); \
729729 } while (0)
730730
731+/*
732+ * Modify bits in a sysreg. Bits in the clear mask are zeroed, then bits in the
733+ * set mask are set. Other bits are left as-is.
734+ */
735+#define sysreg_clear_set(sysreg, clear, set) do { \
736+ u64 __scs_val = read_sysreg(sysreg); \
737+ u64 __scs_new = (__scs_val & ~(u64)(clear)) | (set); \
738+ if (__scs_new != __scs_val) \
739+ write_sysreg(__scs_new, sysreg); \
740+} while (0)
741+
731742 static inline void config_sctlr_el1(u32 clear, u32 set)
732743 {
733744 u32 val;
arch/arm64/kernel/alternative.c+44−7
@@ -122,7 +122,30 @@ static void patch_alternative(struct alt_instr *alt, · 121 unmodified lines
122122 }
123123 }
124124
125−static void __apply_alternatives(void *alt_region, bool use_linear_alias)
125+/*
126+ * We provide our own, private D-cache cleaning function so that we don't
127+ * accidentally call into the cache.S code, which is patched by us at
128+ * runtime.
129+ */
130+static void clean_dcache_range_nopatch(u64 start, u64 end)
131+{
132+ u64 cur, d_size, ctr_el0;
133+
134+ ctr_el0 = read_sanitised_ftr_reg(SYS_CTR_EL0);
135+ d_size = 4 << cpuid_feature_extract_unsigned_field(ctr_el0,
136+ CTR_DMINLINE_SHIFT);
137+ cur = start & ~(d_size - 1);
138+ do {
139+ /*
140+ * We must clean+invalidate to the PoC in order to avoid
141+ * Cortex-A53 errata 826319, 827319, 824069 and 819472
142+ * (this corresponds to ARM64_WORKAROUND_CLEAN_CACHE)
143+ */
144+ asm volatile("dc civac, %0" : : "r" (cur) : "memory");
145+ } while (cur += d_size, cur < end);
146+}
147+
148+static void __apply_alternatives(void *alt_region, bool is_module)
126149 {
127150 struct alt_instr *alt;
128151 struct alt_region *region = alt_region;
@@ -145,7 +168,7 @@ static void __apply_alternatives(void *alt_region, bool use_linear_alias) · 16 unmodified lines
145168 pr_info_once("patching kernel code\n");
146169
147170 origptr = ALT_ORIG_PTR(alt);
148− updptr = use_linear_alias ? lm_alias(origptr) : origptr;
171+ updptr = is_module ? origptr : lm_alias(origptr);
149172 nr_inst = alt->orig_len / AARCH64_INSN_SIZE;
150173
151174 if (alt->cpufeature < ARM64_CB_PATCH)
@@ -155,8 +178,20 @@ static void __apply_alternatives(void *alt_region, bool use_linear_alias) · 3 unmodified lines
155178
156179 alt_cb(alt, origptr, updptr, nr_inst);
157180
158− flush_icache_range((uintptr_t)origptr,
159− (uintptr_t)(origptr + nr_inst));
181+ if (!is_module) {
182+ clean_dcache_range_nopatch((u64)origptr,
183+ (u64)(origptr + nr_inst));
184+ }
185+ }
186+
187+ /*
188+ * The core module code takes care of cache maintenance in
189+ * flush_module_icache().
190+ */
191+ if (!is_module) {
192+ dsb(ish);
193+ __flush_icache_all();
194+ isb();
160195 }
161196 }
162197
@@ -178,7 +213,7 @@ static int __apply_alternatives_multi_stop(void *unused) · 15 unmodified lines
178213 isb();
179214 } else {
180215 BUG_ON(alternatives_applied);
181− __apply_alternatives(&region, true);
216+ __apply_alternatives(&region, false);
182217 /* Barriers provided by the cache flushing */
183218 WRITE_ONCE(alternatives_applied, 1);
184219 }
@@ -192,12 +227,14 @@ void __init apply_alternatives_all(void) · 7 unmodified lines
192227 stop_machine(__apply_alternatives_multi_stop, NULL, cpu_online_mask);
193228 }
194229
195−void apply_alternatives(void *start, size_t length)
230+#ifdef CONFIG_MODULES
231+void apply_alternatives_module(void *start, size_t length)
196232 {
197233 struct alt_region region = {
198234 .begin = start,
199235 .end = start + length,
200236 };
201237
202− __apply_alternatives(&region, false);
238+ __apply_alternatives(&region, true);
203239 }
240+#endif
arch/arm64/kernel/cpufeature.c+1−1
@@ -937,7 +937,7 @@ static int __init parse_kpti(char *str) · 936 unmodified lines
937937 __kpti_forced = enabled ? 1 : -1;
938938 return 0;
939939 }
940−__setup("kpti=", parse_kpti);
940+early_param("kpti", parse_kpti);
941941 #endif /* CONFIG_UNMAP_KERNEL_AT_EL0 */
942942
943943 #ifdef CONFIG_ARM64_HW_AFDBM
arch/arm64/kernel/module.c+2−3
@@ -448,9 +448,8 @@ int module_finalize(const Elf_Ehdr *hdr, · 447 unmodified lines
448448 const char *secstrs = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset;
449449
450450 for (s = sechdrs, se = sechdrs + hdr->e_shnum; s < se; s++) {
451− if (strcmp(".altinstructions", secstrs + s->sh_name) == 0) {
452− apply_alternatives((void *)s->sh_addr, s->sh_size);
453− }
451+ if (strcmp(".altinstructions", secstrs + s->sh_name) == 0)
452+ apply_alternatives_module((void *)s->sh_addr, s->sh_size);
454453 #ifdef CONFIG_ARM64_MODULE_PLTS
455454 if (IS_ENABLED(CONFIG_DYNAMIC_FTRACE) &&
456455 !strcmp(".text.ftrace_trampoline", secstrs + s->sh_name))
arch/arm64/kernel/smp.c+1−1
@@ -179,7 +179,7 @@ int __cpu_up(unsigned int cpu, struct task_struct *idle) · 178 unmodified lines
179179 * This is the secondary CPU boot entry. We're using this CPUs
180180 * idle thread stack, but a set of temporary page tables.
181181 */
182−asmlinkage void secondary_start_kernel(void)
182+asmlinkage notrace void secondary_start_kernel(void)
183183 {
184184 u64 mpidr = read_cpuid_mpidr() & MPIDR_HWID_BITMASK;
185185 struct mm_struct *mm = &init_mm;
arch/arm64/kvm/fpsimd.c+27−9
@@ -5,13 +5,14 @@ · 4 unmodified lines
55 * Copyright 2018 Arm Limited
66 * Author: Dave Martin <Dave.Martin@arm.com>
77 */
8−#include <linux/bottom_half.h>
8+#include <linux/irqflags.h>
99 #include <linux/sched.h>
1010 #include <linux/thread_info.h>
1111 #include <linux/kvm_host.h>
1212 #include <asm/kvm_asm.h>
1313 #include <asm/kvm_host.h>
1414 #include <asm/kvm_mmu.h>
15+#include <asm/sysreg.h>
1516
1617 /*
1718 * Called on entry to KVM_RUN unless this vcpu previously ran at least
@@ -61,10 +62,16 @@ void kvm_arch_vcpu_load_fp(struct kvm_vcpu *vcpu) · 43 unmodified lines
6162 {
6263 BUG_ON(!current->mm);
6364
64− vcpu->arch.flags &= ~(KVM_ARM64_FP_ENABLED | KVM_ARM64_HOST_SVE_IN_USE);
65+ vcpu->arch.flags &= ~(KVM_ARM64_FP_ENABLED |
66+ KVM_ARM64_HOST_SVE_IN_USE |
67+ KVM_ARM64_HOST_SVE_ENABLED);
6568 vcpu->arch.flags |= KVM_ARM64_FP_HOST;
69+
6670 if (test_thread_flag(TIF_SVE))
6771 vcpu->arch.flags |= KVM_ARM64_HOST_SVE_IN_USE;
72+
73+ if (read_sysreg(cpacr_el1) & CPACR_EL1_ZEN_EL0EN)
74+ vcpu->arch.flags |= KVM_ARM64_HOST_SVE_ENABLED;
6875 }
6976
7077 /*
@@ -92,19 +99,30 @@ void kvm_arch_vcpu_ctxsync_fp(struct kvm_vcpu *vcpu) · 21 unmodified lines
9299 */
93100 void kvm_arch_vcpu_put_fp(struct kvm_vcpu *vcpu)
94101 {
95− local_bh_disable();
102+ unsigned long flags;
96103
97− update_thread_flag(TIF_SVE,
98− vcpu->arch.flags & KVM_ARM64_HOST_SVE_IN_USE);
104+ local_irq_save(flags);
99105
100106 if (vcpu->arch.flags & KVM_ARM64_FP_ENABLED) {
101107 /* Clean guest FP state to memory and invalidate cpu view */
102108 fpsimd_save();
103109 fpsimd_flush_cpu_state();
104− } else if (!test_thread_flag(TIF_FOREIGN_FPSTATE)) {
105− /* Ensure user trap controls are correctly restored */
106− fpsimd_bind_task_to_cpu();
110+ } else if (system_supports_sve()) {
111+ /*
112+ * The FPSIMD/SVE state in the CPU has not been touched, and we
113+ * have SVE (and VHE): CPACR_EL1 (alias CPTR_EL2) has been
114+ * reset to CPACR_EL1_DEFAULT by the Hyp code, disabling SVE
115+ * for EL0. To avoid spurious traps, restore the trap state
116+ * seen by kvm_arch_vcpu_load_fp():
117+ */
118+ if (vcpu->arch.flags & KVM_ARM64_HOST_SVE_ENABLED)
119+ sysreg_clear_set(CPACR_EL1, 0, CPACR_EL1_ZEN_EL0EN);
120+ else
121+ sysreg_clear_set(CPACR_EL1, CPACR_EL1_ZEN_EL0EN, 0);
107122 }
108123
109− local_bh_enable();
124+ update_thread_flag(TIF_SVE,
125+ vcpu->arch.flags & KVM_ARM64_HOST_SVE_IN_USE);
126+
127+ local_irq_restore(flags);
110128 }
arch/arm64/mm/dma-mapping.c+5−4
@@ -583,13 +583,14 @@ static void *__iommu_alloc_attrs(struct device *dev, size_t size, · 582 unmodified lines
583583 size >> PAGE_SHIFT);
584584 return NULL;
585585 }
586− if (!coherent)
587− __dma_flush_area(page_to_virt(page), iosize);
588−
589586 addr = dma_common_contiguous_remap(page, size, VM_USERMAP,
590587 prot,
591588 __builtin_return_address(0));
592− if (!addr) {
589+ if (addr) {
590+ memset(addr, 0, size);
591+ if (!coherent)
592+ __dma_flush_area(page_to_virt(page), iosize);
593+ } else {
593594 iommu_dma_unmap_page(dev, *handle, iosize, 0, attrs);
594595 dma_release_from_contiguous(dev, page,
595596 size >> PAGE_SHIFT);
arch/arm64/mm/proc.S+3−2
@@ -217,8 +217,9 @@ ENDPROC(idmap_cpu_replace_ttbr1) · 216 unmodified lines
217217
218218 .macro __idmap_kpti_put_pgtable_ent_ng, type
219219 orr \type, \type, #PTE_NG // Same bit for blocks and pages
220− str \type, [cur_\()\type\()p] // Update the entry and ensure it
221− dc civac, cur_\()\type\()p // is visible to all CPUs.
220+ str \type, [cur_\()\type\()p] // Update the entry and ensure
221+ dmb sy // that it is visible to all
222+ dc civac, cur_\()\type\()p // CPUs.
222223 .endm
223224
224225 /*
arch/microblaze/Kconfig.debug+0−7
@@ -8,11 +8,4 @@ config TRACE_IRQFLAGS_SUPPORT · 7 unmodified lines
88
99 source "lib/Kconfig.debug"
1010
11−config HEART_BEAT
12− bool "Heart beat function for kernel"
13− default n
14− help
15− This option turns on/off heart beat kernel functionality.
16− First GPIO node is taken.
17−
1811 endmenu
arch/microblaze/include/asm/setup.h+0−5
@@ -19,15 +19,10 @@ extern char cmd_line[COMMAND_LINE_SIZE]; · 18 unmodified lines
1919
2020 extern char *klimit;
2121
22−void microblaze_heartbeat(void);
23−void microblaze_setup_heartbeat(void);
24−
2522 # ifdef CONFIG_MMU
2623 extern void mmu_reset(void);
2724 # endif /* CONFIG_MMU */
2825
29−extern void of_platform_reset_gpio_probe(void);
30−
3126 void time_init(void);
3227 void init_IRQ(void);
3328 void machine_early_init(const char *cmdline, unsigned int ram,
arch/microblaze/include/asm/unistd.h+1−1
@@ -38,6 +38,6 @@ · 37 unmodified lines
3838
3939 #endif /* __ASSEMBLY__ */
4040
41−#define __NR_syscalls 399
41+#define __NR_syscalls 401
4242
4343 #endif /* _ASM_MICROBLAZE_UNISTD_H */
arch/microblaze/include/uapi/asm/unistd.h+2−0
@@ -415,5 +415,7 @@ · 414 unmodified lines
415415 #define __NR_pkey_alloc 396
416416 #define __NR_pkey_free 397
417417 #define __NR_statx 398
418+#define __NR_io_pgetevents 399
419+#define __NR_rseq 400
418420
419421 #endif /* _UAPI_ASM_MICROBLAZE_UNISTD_H */
arch/microblaze/kernel/Makefile+1−3
@@ -8,7 +8,6 @@ ifdef CONFIG_FUNCTION_TRACER · 7 unmodified lines
88 CFLAGS_REMOVE_timer.o = -pg
99 CFLAGS_REMOVE_intc.o = -pg
1010 CFLAGS_REMOVE_early_printk.o = -pg
11−CFLAGS_REMOVE_heartbeat.o = -pg
1211 CFLAGS_REMOVE_ftrace.o = -pg
1312 CFLAGS_REMOVE_process.o = -pg
1413 endif
@@ -17,12 +16,11 @@ extra-y := head.o vmlinux.lds · 2 unmodified lines
1716
1817 obj-y += dma.o exceptions.o \
1918 hw_exception_handler.o irq.o \
20− platform.o process.o prom.o ptrace.o \
19+ process.o prom.o ptrace.o \
2120 reset.o setup.o signal.o sys_microblaze.o timer.o traps.o unwind.o
2221
2322 obj-y += cpu/
2423
25−obj-$(CONFIG_HEART_BEAT) += heartbeat.o
2624 obj-$(CONFIG_MODULES) += microblaze_ksyms.o module.o
2725 obj-$(CONFIG_MMU) += misc.o
2826 obj-$(CONFIG_STACKTRACE) += stacktrace.o
arch/microblaze/kernel/heartbeat.c+0−72
@@ -1,72 +0,0 @@
1−/*
2− * Copyright (C) 2007-2009 Michal Simek <monstr@monstr.eu>
3− * Copyright (C) 2007-2009 PetaLogix
4− * Copyright (C) 2006 Atmark Techno, Inc.
5− *
6− * This file is subject to the terms and conditions of the GNU General Public
7− * License. See the file "COPYING" in the main directory of this archive
8− * for more details.
9− */
10−
11−#include <linux/sched.h>
12−#include <linux/sched/loadavg.h>
13−#include <linux/io.h>
14−
15−#include <asm/setup.h>
16−#include <asm/page.h>
17−#include <asm/prom.h>
18−
19−static unsigned int base_addr;
20−
21−void microblaze_heartbeat(void)
22−{
23− static unsigned int cnt, period, dist;
24−
25− if (base_addr) {
26− if (cnt == 0 || cnt == dist)
27− out_be32(base_addr, 1);
28− else if (cnt == 7 || cnt == dist + 7)
29− out_be32(base_addr, 0);
30−
31− if (++cnt > period) {
32− cnt = 0;
33− /*
34− * The hyperbolic function below modifies the heartbeat
35− * period length in dependency of the current (5min)
36− * load. It goes through the points f(0)=126, f(1)=86,
37− * f(5)=51, f(inf)->30.
38− */
39− period = ((672 << FSHIFT) / (5 * avenrun[0] +
40− (7 << FSHIFT))) + 30;
41− dist = period / 4;
42− }
43− }
44−}
45−
46−void microblaze_setup_heartbeat(void)
47−{
48− struct device_node *gpio = NULL;
49− int *prop;
50− int j;
51− const char * const gpio_list[] = {
52− "xlnx,xps-gpio-1.00.a",
53− NULL
54− };
55−
56− for (j = 0; gpio_list[j] != NULL; j++) {
57− gpio = of_find_compatible_node(NULL, NULL, gpio_list[j]);
58− if (gpio)
59− break;
60− }
61−
62− if (gpio) {
63− base_addr = be32_to_cpup(of_get_property(gpio, "reg", NULL));
64− base_addr = (unsigned long) ioremap(base_addr, PAGE_SIZE);
65− pr_notice("Heartbeat GPIO at 0x%x\n", base_addr);
66−
67− /* GPIO is configured as output */
68− prop = (int *) of_get_property(gpio, "xlnx,is-bidir", NULL);
69− if (prop)
70− out_be32(base_addr + 4, 0);
71− }
72−}
arch/microblaze/kernel/platform.c+0−29
@@ -1,29 +0,0 @@
1−/*
2− * Copyright 2008 Michal Simek <monstr@monstr.eu>
3− *
4− * based on virtex.c file
5− *
6− * Copyright 2007 Secret Lab Technologies Ltd.
7− *
8− * This file is licensed under the terms of the GNU General Public License
9− * version 2. This program is licensed "as is" without any warranty of any
10− * kind, whether express or implied.
11− */
12−
13−#include <linux/init.h>
14−#include <linux/of_platform.h>
15−#include <asm/setup.h>
16−
17−static struct of_device_id xilinx_of_bus_ids[] __initdata = {
18− { .compatible = "simple-bus", },
19− { .compatible = "xlnx,compound", },
20− {}
21−};
22−
23−static int __init microblaze_device_probe(void)
24−{
25− of_platform_bus_probe(NULL, xilinx_of_bus_ids, NULL);
26− of_platform_reset_gpio_probe();
27− return 0;
28−}
29−device_initcall(microblaze_device_probe);
arch/microblaze/kernel/reset.c+6−5
@@ -18,7 +18,7 @@ · 17 unmodified lines
1818 static int handle; /* reset pin handle */
1919 static unsigned int reset_val;
2020
21−void of_platform_reset_gpio_probe(void)
21+static int of_platform_reset_gpio_probe(void)
2222 {
2323 int ret;
2424 handle = of_get_named_gpio(of_find_node_by_path("/"),
@@ -27,13 +27,13 @@ void of_platform_reset_gpio_probe(void) · 2 unmodified lines
2727 if (!gpio_is_valid(handle)) {
2828 pr_info("Skipping unavailable RESET gpio %d (%s)\n",
2929 handle, "reset");
30− return;
30+ return -ENODEV;
3131 }
3232
3333 ret = gpio_request(handle, "reset");
3434 if (ret < 0) {
3535 pr_info("GPIO pin is already allocated\n");
36− return;
36+ return ret;
3737 }
3838
3939 /* get current setup value */
@@ -51,11 +51,12 @@ void of_platform_reset_gpio_probe(void) · 11 unmodified lines
5151
5252 pr_info("RESET: Registered gpio device: %d, current val: %d\n",
5353 handle, reset_val);
54− return;
54+ return 0;
5555 err:
5656 gpio_free(handle);
57− return;
57+ return ret;
5858 }
59+device_initcall(of_platform_reset_gpio_probe);
5960
6061
6162 static void gpio_system_reset(void)
arch/microblaze/kernel/syscall_table.S+2−0
@@ -400,3 +400,5 @@ ENTRY(sys_call_table) · 399 unmodified lines
400400 .long sys_pkey_alloc
401401 .long sys_pkey_free
402402 .long sys_statx
403+ .long sys_io_pgetevents
404+ .long sys_rseq
arch/microblaze/kernel/timer.c+0−7
@@ -156,9 +156,6 @@ static inline void timer_ack(void) · 155 unmodified lines
156156 static irqreturn_t timer_interrupt(int irq, void *dev_id)
157157 {
158158 struct clock_event_device *evt = &clockevent_xilinx_timer;
159−#ifdef CONFIG_HEART_BEAT
160− microblaze_heartbeat();
161−#endif
162159 timer_ack();
163160 evt->event_handler(evt);
164161 return IRQ_HANDLED;
@@ -318,10 +315,6 @@ static int __init xilinx_timer_init(struct device_node *timer) · 153 unmodified lines
318315 return ret;
319316 }
320317
321−#ifdef CONFIG_HEART_BEAT
322− microblaze_setup_heartbeat();
323−#endif
324−
325318 ret = xilinx_clocksource_init();
326319 if (ret)
327320 return ret;
arch/mips/Kconfig+1−0
@@ -65,6 +65,7 @@ config MIPS · 64 unmodified lines
6565 select HAVE_OPROFILE
6666 select HAVE_PERF_EVENTS
6767 select HAVE_REGS_AND_STACK_ACCESS_API
68+ select HAVE_RSEQ
6869 select HAVE_STACKPROTECTOR
6970 select HAVE_SYSCALL_TRACEPOINTS
7071 select HAVE_VIRT_CPU_ACCOUNTING_GEN if 64BIT || !SMP
arch/mips/ath79/mach-pb44.c+1−1
@@ -34,7 +34,7 @@ · 33 unmodified lines
3434 #define PB44_KEYS_DEBOUNCE_INTERVAL (3 * PB44_KEYS_POLL_INTERVAL)
3535
3636 static struct gpiod_lookup_table pb44_i2c_gpiod_table = {
37− .dev_id = "i2c-gpio",
37+ .dev_id = "i2c-gpio.0",
3838 .table = {
3939 GPIO_LOOKUP_IDX("ath79-gpio", PB44_GPIO_I2C_SDA,
4040 NULL, 0, GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN),
arch/mips/bcm47xx/setup.c+6−0
@@ -212,6 +212,12 @@ static int __init bcm47xx_cpu_fixes(void) · 211 unmodified lines
212212 */
213213 if (bcm47xx_bus.bcma.bus.chipinfo.id == BCMA_CHIP_ID_BCM4706)
214214 cpu_wait = NULL;
215+
216+ /*
217+ * BCM47XX Erratum "R10: PCIe Transactions Periodically Fail"
218+ * Enable ExternalSync for sync instruction to take effect
219+ */
220+ set_c0_config7(MIPS_CONF7_ES);
215221 break;
216222 #endif
217223 }
arch/mips/include/asm/io.h+2−0
@@ -414,6 +414,8 @@ static inline type pfx##in##bwlq##p(unsigned long port) \ · 413 unmodified lines
414414 __val = *__addr; \
415415 slow; \
416416 \
417+ /* prevent prefetching of coherent DMA data prematurely */ \
418+ rmb(); \
417419 return pfx##ioswab##bwlq(__addr, __val); \
418420 }
419421
arch/mips/include/asm/mipsregs.h+3−0
@@ -681,6 +681,8 @@ · 680 unmodified lines
681681 #define MIPS_CONF7_WII (_ULCAST_(1) << 31)
682682
683683 #define MIPS_CONF7_RPS (_ULCAST_(1) << 2)
684+/* ExternalSync */
685+#define MIPS_CONF7_ES (_ULCAST_(1) << 8)
684686
685687 #define MIPS_CONF7_IAR (_ULCAST_(1) << 10)
686688 #define MIPS_CONF7_AR (_ULCAST_(1) << 16)
@@ -2765,6 +2767,7 @@ __BUILD_SET_C0(status) · 2078 unmodified lines
27652767 __BUILD_SET_C0(cause)
27662768 __BUILD_SET_C0(config)
27672769 __BUILD_SET_C0(config5)
2770+__BUILD_SET_C0(config7)
27682771 __BUILD_SET_C0(intcontrol)
27692772 __BUILD_SET_C0(intctl)
27702773 __BUILD_SET_C0(srsmap)
arch/mips/include/uapi/asm/unistd.h+12−6
@@ -388,17 +388,19 @@ · 387 unmodified lines
388388 #define __NR_pkey_alloc (__NR_Linux + 364)
389389 #define __NR_pkey_free (__NR_Linux + 365)
390390 #define __NR_statx (__NR_Linux + 366)
391+#define __NR_rseq (__NR_Linux + 367)
392+#define __NR_io_pgetevents (__NR_Linux + 368)
391393
392394
393395 /*
394396 * Offset of the last Linux o32 flavoured syscall
395397 */
396−#define __NR_Linux_syscalls 366
398+#define __NR_Linux_syscalls 368
397399
398400 #endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
399401
400402 #define __NR_O32_Linux 4000
401−#define __NR_O32_Linux_syscalls 366
403+#define __NR_O32_Linux_syscalls 368
402404
403405 #if _MIPS_SIM == _MIPS_SIM_ABI64
404406
@@ -733,16 +735,18 @@ · 328 unmodified lines
733735 #define __NR_pkey_alloc (__NR_Linux + 324)
734736 #define __NR_pkey_free (__NR_Linux + 325)
735737 #define __NR_statx (__NR_Linux + 326)
738+#define __NR_rseq (__NR_Linux + 327)
739+#define __NR_io_pgetevents (__NR_Linux + 328)
736740
737741 /*
738742 * Offset of the last Linux 64-bit flavoured syscall
739743 */
740−#define __NR_Linux_syscalls 326
744+#define __NR_Linux_syscalls 328
741745
742746 #endif /* _MIPS_SIM == _MIPS_SIM_ABI64 */
743747
744748 #define __NR_64_Linux 5000
745−#define __NR_64_Linux_syscalls 326
749+#define __NR_64_Linux_syscalls 328
746750
747751 #if _MIPS_SIM == _MIPS_SIM_NABI32
748752
@@ -1081,15 +1085,17 @@ · 332 unmodified lines
10811085 #define __NR_pkey_alloc (__NR_Linux + 328)
10821086 #define __NR_pkey_free (__NR_Linux + 329)
10831087 #define __NR_statx (__NR_Linux + 330)
1088+#define __NR_rseq (__NR_Linux + 331)
1089+#define __NR_io_pgetevents (__NR_Linux + 332)
10841090
10851091 /*
10861092 * Offset of the last N32 flavoured syscall
10871093 */
1088−#define __NR_Linux_syscalls 330
1094+#define __NR_Linux_syscalls 332
10891095
10901096 #endif /* _MIPS_SIM == _MIPS_SIM_NABI32 */
10911097
10921098 #define __NR_N32_Linux 6000
1093−#define __NR_N32_Linux_syscalls 330
1099+#define __NR_N32_Linux_syscalls 332
10941100
10951101 #endif /* _UAPI_ASM_UNISTD_H */
arch/mips/kernel/entry.S+8−0
@@ -79,6 +79,10 @@ FEXPORT(ret_from_fork) · 78 unmodified lines
7979 jal schedule_tail # a0 = struct task_struct *prev
8080
8181 FEXPORT(syscall_exit)
82+#ifdef CONFIG_DEBUG_RSEQ
83+ move a0, sp
84+ jal rseq_syscall
85+#endif
8286 local_irq_disable # make sure need_resched and
8387 # signals dont change between
8488 # sampling and return
@@ -141,6 +145,10 @@ work_notifysig: # deal with pending signals and · 56 unmodified lines
141145 j resume_userspace_check
142146
143147 FEXPORT(syscall_exit_partial)
148+#ifdef CONFIG_DEBUG_RSEQ
149+ move a0, sp
150+ jal rseq_syscall
151+#endif
144152 local_irq_disable # make sure need_resched doesn't
145153 # change between and return
146154 LONG_L a2, TI_FLAGS($28) # current->work
arch/mips/kernel/mcount.S+12−15
@@ -119,10 +119,20 @@ NESTED(_mcount, PT_SIZE, ra) · 118 unmodified lines
119119 EXPORT_SYMBOL(_mcount)
120120 PTR_LA t1, ftrace_stub
121121 PTR_L t2, ftrace_trace_function /* Prepare t2 for (1) */
122− bne t1, t2, static_trace
122+ beq t1, t2, fgraph_trace
123123 nop
124124
125+ MCOUNT_SAVE_REGS
126+
127+ move a0, ra /* arg1: self return address */
128+ jalr t2 /* (1) call *ftrace_trace_function */
129+ move a1, AT /* arg2: parent's return address */
130+
131+ MCOUNT_RESTORE_REGS
132+
133+fgraph_trace:
125134 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
135+ PTR_LA t1, ftrace_stub
126136 PTR_L t3, ftrace_graph_return
127137 bne t1, t3, ftrace_graph_caller
128138 nop
@@ -131,24 +141,11 @@ EXPORT_SYMBOL(_mcount) · 2 unmodified lines
131141 bne t1, t3, ftrace_graph_caller
132142 nop
133143 #endif
134− b ftrace_stub
135−#ifdef CONFIG_32BIT
136− addiu sp, sp, 8
137−#else
138− nop
139−#endif
140144
141−static_trace:
142− MCOUNT_SAVE_REGS
143−
144− move a0, ra /* arg1: self return address */
145− jalr t2 /* (1) call *ftrace_trace_function */
146− move a1, AT /* arg2: parent's return address */
147−
148− MCOUNT_RESTORE_REGS
149145 #ifdef CONFIG_32BIT
150146 addiu sp, sp, 8
151147 #endif
148+
152149 .globl ftrace_stub
153150 ftrace_stub:
154151 RETURN_BACK
arch/mips/kernel/scall32-o32.S+2−0
@@ -590,3 +590,5 @@ EXPORT(sys_call_table) · 589 unmodified lines
590590 PTR sys_pkey_alloc
591591 PTR sys_pkey_free /* 4365 */
592592 PTR sys_statx
593+ PTR sys_rseq
594+ PTR sys_io_pgetevents
arch/mips/kernel/scall64-64.S+2−0
@@ -439,4 +439,6 @@ EXPORT(sys_call_table) · 438 unmodified lines
439439 PTR sys_pkey_alloc
440440 PTR sys_pkey_free /* 5325 */
441441 PTR sys_statx
442+ PTR sys_rseq
443+ PTR sys_io_pgetevents
442444 .size sys_call_table,.-sys_call_table
arch/mips/kernel/scall64-n32.S+2−0
@@ -434,4 +434,6 @@ EXPORT(sysn32_call_table) · 433 unmodified lines
434434 PTR sys_pkey_alloc
435435 PTR sys_pkey_free
436436 PTR sys_statx /* 6330 */
437+ PTR sys_rseq
438+ PTR compat_sys_io_pgetevents
437439 .size sysn32_call_table,.-sysn32_call_table
arch/mips/kernel/scall64-o32.S+2−0
@@ -583,4 +583,6 @@ EXPORT(sys32_call_table) · 582 unmodified lines
583583 PTR sys_pkey_alloc
584584 PTR sys_pkey_free /* 4365 */
585585 PTR sys_statx
586+ PTR sys_rseq
587+ PTR compat_sys_io_pgetevents
586588 .size sys32_call_table,.-sys32_call_table
arch/mips/kernel/signal.c+3−0
@@ -801,6 +801,8 @@ static void handle_signal(struct ksignal *ksig, struct pt_regs *regs) · 800 unmodified lines
801801 regs->regs[0] = 0; /* Don't deal with this again. */
802802 }
803803
804+ rseq_signal_deliver(ksig, regs);
805+
804806 if (sig_uses_siginfo(&ksig->ka, abi))
805807 ret = abi->setup_rt_frame(vdso + abi->vdso->off_rt_sigreturn,
806808 ksig, regs, oldset);
@@ -868,6 +870,7 @@ asmlinkage void do_notify_resume(struct pt_regs *regs, void *unused, · 61 unmodified lines
868870 if (thread_info_flags & _TIF_NOTIFY_RESUME) {
869871 clear_thread_flag(TIF_NOTIFY_RESUME);
870872 tracehook_notify_resume(regs);
873+ rseq_handle_notify_resume(NULL, regs);
871874 }
872875
873876 user_enter();
arch/parisc/Kconfig+3−3
@@ -244,11 +244,11 @@ config PARISC_PAGE_SIZE_4KB · 243 unmodified lines
244244
245245 config PARISC_PAGE_SIZE_16KB
246246 bool "16KB"
247− depends on PA8X00
247+ depends on PA8X00 && BROKEN
248248
249249 config PARISC_PAGE_SIZE_64KB
250250 bool "64KB"
251− depends on PA8X00
251+ depends on PA8X00 && BROKEN
252252
253253 endchoice
254254
@@ -347,7 +347,7 @@ config NR_CPUS · 92 unmodified lines
347347 int "Maximum number of CPUs (2-32)"
348348 range 2 32
349349 depends on SMP
350− default "32"
350+ default "4"
351351
352352 endmenu
353353
arch/parisc/Makefile+0−4
@@ -65,10 +65,6 @@ endif · 64 unmodified lines
6565 # kernel.
6666 cflags-y += -mdisable-fpregs
6767
68−# Without this, "ld -r" results in .text sections that are too big
69−# (> 0x40000) for branches to reach stubs.
70−cflags-y += -ffunction-sections
71−
7268 # Use long jumps instead of long branches (needed if your linker fails to
7369 # link a too big vmlinux executable). Not enabled for building modules.
7470 ifdef CONFIG_MLONGCALLS
arch/parisc/include/asm/signal.h+0−8
@@ -21,14 +21,6 @@ typedef struct { · 20 unmodified lines
2121 unsigned long sig[_NSIG_WORDS];
2222 } sigset_t;
2323
24−#ifndef __KERNEL__
25−struct sigaction {
26− __sighandler_t sa_handler;
27− unsigned long sa_flags;
28− sigset_t sa_mask; /* mask last for extensibility */
29−};
30−#endif
31−
3224 #include <asm/sigcontext.h>
3325
3426 #endif /* !__ASSEMBLY */
arch/parisc/include/uapi/asm/unistd.h+2−1
@@ -364,8 +364,9 @@ · 363 unmodified lines
364364 #define __NR_preadv2 (__NR_Linux + 347)
365365 #define __NR_pwritev2 (__NR_Linux + 348)
366366 #define __NR_statx (__NR_Linux + 349)
367+#define __NR_io_pgetevents (__NR_Linux + 350)
367368
368−#define __NR_Linux_syscalls (__NR_statx + 1)
369+#define __NR_Linux_syscalls (__NR_io_pgetevents + 1)
369370
370371
371372 #define __IGNORE_select /* newselect */
arch/parisc/kernel/drivers.c+9−16
@@ -154,17 +154,14 @@ int register_parisc_driver(struct parisc_driver *driver) · 153 unmodified lines
154154 {
155155 /* FIXME: we need this because apparently the sti
156156 * driver can be registered twice */
157− if(driver->drv.name) {
158− printk(KERN_WARNING
159− "BUG: skipping previously registered driver %s\n",
160− driver->name);
157+ if (driver->drv.name) {
158+ pr_warn("BUG: skipping previously registered driver %s\n",
159+ driver->name);
161160 return 1;
162161 }
163162
164163 if (!driver->probe) {
165− printk(KERN_WARNING
166− "BUG: driver %s has no probe routine\n",
167− driver->name);
164+ pr_warn("BUG: driver %s has no probe routine\n", driver->name);
168165 return 1;
169166 }
170167
@@ -491,12 +488,9 @@ alloc_pa_dev(unsigned long hpa, struct hardware_path *mod_path) · 320 unmodified lines
491488
492489 dev = create_parisc_device(mod_path);
493490 if (dev->id.hw_type != HPHW_FAULTY) {
494− printk(KERN_ERR "Two devices have hardware path [%s]. "
495− "IODC data for second device: "
496− "%02x%02x%02x%02x%02x%02x\n"
497− "Rearranging GSC cards sometimes helps\n",
498− parisc_pathname(dev), iodc_data[0], iodc_data[1],
499− iodc_data[3], iodc_data[4], iodc_data[5], iodc_data[6]);
491+ pr_err("Two devices have hardware path [%s]. IODC data for second device: %7phN\n"
492+ "Rearranging GSC cards sometimes helps\n",
493+ parisc_pathname(dev), iodc_data);
500494 return NULL;
501495 }
502496
@@ -528,8 +522,7 @@ alloc_pa_dev(unsigned long hpa, struct hardware_path *mod_path) · 25 unmodified lines
528522 * the keyboard controller
529523 */
530524 if ((hpa & 0xfff) == 0 && insert_resource(&iomem_resource, &dev->hpa))
531− printk("Unable to claim HPA %lx for device %s\n",
532− hpa, name);
525+ pr_warn("Unable to claim HPA %lx for device %s\n", hpa, name);
533526
534527 return dev;
535528 }
@@ -875,7 +868,7 @@ static void print_parisc_device(struct parisc_device *dev) · 339 unmodified lines
875868 static int count;
876869
877870 print_pa_hwpath(dev, hw_path);
878− printk(KERN_INFO "%d. %s at 0x%px [%s] { %d, 0x%x, 0x%.3x, 0x%.5x }",
871+ pr_info("%d. %s at 0x%px [%s] { %d, 0x%x, 0x%.3x, 0x%.5x }",
879872 ++count, dev->name, (void*) dev->hpa.start, hw_path, dev->id.hw_type,
880873 dev->id.hversion_rev, dev->id.hversion, dev->id.sversion);
881874
arch/parisc/kernel/syscall_table.S+1−0
@@ -445,6 +445,7 @@ · 444 unmodified lines
445445 ENTRY_COMP(preadv2)
446446 ENTRY_COMP(pwritev2)
447447 ENTRY_SAME(statx)
448+ ENTRY_COMP(io_pgetevents) /* 350 */
448449
449450
450451 .ifne (. - 90b) - (__NR_Linux_syscalls * (91b - 90b))
arch/parisc/kernel/unwind.c+2−2
@@ -25,7 +25,7 @@ · 24 unmodified lines
2525
2626 /* #define DEBUG 1 */
2727 #ifdef DEBUG
28−#define dbg(x...) printk(x)
28+#define dbg(x...) pr_debug(x)
2929 #else
3030 #define dbg(x...)
3131 #endif
@@ -182,7 +182,7 @@ int __init unwind_init(void) · 150 unmodified lines
182182 start = (long)&__start___unwind[0];
183183 stop = (long)&__stop___unwind[0];
184184
185− printk("unwind_init: start = 0x%lx, end = 0x%lx, entries = %lu\n",
185+ dbg("unwind_init: start = 0x%lx, end = 0x%lx, entries = %lu\n",
186186 start, stop,
187187 (stop - start) / sizeof(struct unwind_table_entry));
188188
arch/powerpc/Makefile+1−0
@@ -244,6 +244,7 @@ cpu-as-$(CONFIG_4xx) += -Wa,-m405 · 243 unmodified lines
244244 cpu-as-$(CONFIG_ALTIVEC) += $(call as-option,-Wa$(comma)-maltivec)
245245 cpu-as-$(CONFIG_E200) += -Wa,-me200
246246 cpu-as-$(CONFIG_PPC_BOOK3S_64) += -Wa,-mpower4
247+cpu-as-$(CONFIG_PPC_E500MC) += $(call as-option,-Wa$(comma)-me500mc)
247248
248249 KBUILD_AFLAGS += $(cpu-as-y)
249250 KBUILD_CFLAGS += $(cpu-as-y)
arch/powerpc/include/asm/book3s/32/pgalloc.h+1−1
@@ -108,6 +108,7 @@ static inline void pgtable_free(void *table, unsigned index_size) · 107 unmodified lines
108108 }
109109
110110 #define check_pgt_cache() do { } while (0)
111+#define get_hugepd_cache_index(x) (x)
111112
112113 #ifdef CONFIG_SMP
113114 static inline void pgtable_free_tlb(struct mmu_gather *tlb,
@@ -137,7 +138,6 @@ static inline void pgtable_free_tlb(struct mmu_gather *tlb, · 23 unmodified lines
137138 static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t table,
138139 unsigned long address)
139140 {
140− pgtable_page_dtor(table);
141141 pgtable_free_tlb(tlb, page_address(table), 0);
142142 }
143143 #endif /* _ASM_POWERPC_BOOK3S_32_PGALLOC_H */
arch/powerpc/include/asm/book3s/64/pgtable-4k.h+21−0
@@ -49,6 +49,27 @@ static inline int hugepd_ok(hugepd_t hpd) · 48 unmodified lines
4949 }
5050 #define is_hugepd(hpd) (hugepd_ok(hpd))
5151
52+/*
53+ * 16M and 16G huge page directory tables are allocated from slab cache
54+ *
55+ */
56+#define H_16M_CACHE_INDEX (PAGE_SHIFT + H_PTE_INDEX_SIZE + H_PMD_INDEX_SIZE - 24)
57+#define H_16G_CACHE_INDEX \
58+ (PAGE_SHIFT + H_PTE_INDEX_SIZE + H_PMD_INDEX_SIZE + H_PUD_INDEX_SIZE - 34)
59+
60+static inline int get_hugepd_cache_index(int index)
61+{
62+ switch (index) {
63+ case H_16M_CACHE_INDEX:
64+ return HTLB_16M_INDEX;
65+ case H_16G_CACHE_INDEX:
66+ return HTLB_16G_INDEX;
67+ default:
68+ BUG();
69+ }
70+ /* should not reach */
71+}
72+
5273 #else /* !CONFIG_HUGETLB_PAGE */
5374 static inline int pmd_huge(pmd_t pmd) { return 0; }
5475 static inline int pud_huge(pud_t pud) { return 0; }
arch/powerpc/include/asm/book3s/64/pgtable-64k.h+9−0
@@ -45,8 +45,17 @@ static inline int hugepd_ok(hugepd_t hpd) · 44 unmodified lines
4545 {
4646 return 0;
4747 }
48+
4849 #define is_hugepd(pdep) 0
4950
51+/*
52+ * This should never get called
53+ */
54+static inline int get_hugepd_cache_index(int index)
55+{
56+ BUG();
57+}
58+
5059 #else /* !CONFIG_HUGETLB_PAGE */
5160 static inline int pmd_huge(pmd_t pmd) { return 0; }
5261 static inline int pud_huge(pud_t pud) { return 0; }
arch/powerpc/include/asm/book3s/64/pgtable.h+5−0
@@ -287,6 +287,11 @@ enum pgtable_index { · 286 unmodified lines
287287 PMD_INDEX,
288288 PUD_INDEX,
289289 PGD_INDEX,
290+ /*
291+ * Below are used with 4k page size and hugetlb
292+ */
293+ HTLB_16M_INDEX,
294+ HTLB_16G_INDEX,
290295 };
291296
292297 extern unsigned long __vmalloc_start;
arch/powerpc/include/asm/nmi.h+1−1
@@ -8,7 +8,7 @@ extern void arch_touch_nmi_watchdog(void); · 7 unmodified lines
88 static inline void arch_touch_nmi_watchdog(void) {}
99 #endif
1010
11−#if defined(CONFIG_PPC_BOOK3S_64) && defined(CONFIG_STACKTRACE)
11+#if defined(CONFIG_NMI_IPI) && defined(CONFIG_STACKTRACE)
1212 extern void arch_trigger_cpumask_backtrace(const cpumask_t *mask,
1313 bool exclude_self);
1414 #define arch_trigger_cpumask_backtrace arch_trigger_cpumask_backtrace
arch/powerpc/include/asm/nohash/32/pgalloc.h+1−1
@@ -109,6 +109,7 @@ static inline void pgtable_free(void *table, unsigned index_size) · 108 unmodified lines
109109 }
110110
111111 #define check_pgt_cache() do { } while (0)
112+#define get_hugepd_cache_index(x) (x)
112113
113114 #ifdef CONFIG_SMP
114115 static inline void pgtable_free_tlb(struct mmu_gather *tlb,
@@ -139,7 +140,6 @@ static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t table, · 24 unmodified lines
139140 unsigned long address)
140141 {
141142 tlb_flush_pgtable(tlb, address);
142− pgtable_page_dtor(table);
143143 pgtable_free_tlb(tlb, page_address(table), 0);
144144 }
145145 #endif /* _ASM_POWERPC_PGALLOC_32_H */
arch/powerpc/include/asm/nohash/64/pgalloc.h+1−0
@@ -141,6 +141,7 @@ static inline void pgtable_free(void *table, int shift) · 140 unmodified lines
141141 }
142142 }
143143
144+#define get_hugepd_cache_index(x) (x)
144145 #ifdef CONFIG_SMP
145146 static inline void pgtable_free_tlb(struct mmu_gather *tlb, void *table, int shift)
146147 {
arch/powerpc/include/asm/systbl.h+1−0
@@ -393,3 +393,4 @@ SYSCALL(pkey_alloc) · 392 unmodified lines
393393 SYSCALL(pkey_free)
394394 SYSCALL(pkey_mprotect)
395395 SYSCALL(rseq)
396+COMPAT_SYS(io_pgetevents)
arch/powerpc/include/asm/unistd.h+1−1
@@ -12,7 +12,7 @@ · 11 unmodified lines
1212 #include <uapi/asm/unistd.h>
1313
1414
15−#define NR_syscalls 388
15+#define NR_syscalls 389
1616
1717 #define __NR__exit __NR_exit
1818
arch/powerpc/include/uapi/asm/unistd.h+1−0
@@ -399,5 +399,6 @@ · 398 unmodified lines
399399 #define __NR_pkey_free 385
400400 #define __NR_pkey_mprotect 386
401401 #define __NR_rseq 387
402+#define __NR_io_pgetevents 388
402403
403404 #endif /* _UAPI_ASM_POWERPC_UNISTD_H_ */
arch/powerpc/kernel/dt_cpu_ftrs.c+2−1
@@ -711,7 +711,8 @@ static __init void cpufeatures_cpu_quirks(void) · 710 unmodified lines
711711 cur_cpu_spec->cpu_features |= CPU_FTR_P9_TM_HV_ASSIST;
712712 cur_cpu_spec->cpu_features |= CPU_FTR_P9_TM_XER_SO_BUG;
713713 cur_cpu_spec->cpu_features |= CPU_FTR_POWER9_DD2_1;
714− } else /* DD2.1 and up have DD2_1 */
714+ } else if ((version & 0xffff0000) == 0x004e0000)
715+ /* DD2.1 and up have DD2_1 */
715716 cur_cpu_spec->cpu_features |= CPU_FTR_POWER9_DD2_1;
716717
717718 if ((version & 0xffff0000) == 0x004e0000) {
arch/powerpc/kernel/pci_32.c+0−4
@@ -285,9 +285,6 @@ pci_bus_to_hose(int bus) · 284 unmodified lines
285285 * Note that the returned IO or memory base is a physical address
286286 */
287287
288−#pragma GCC diagnostic push
289−#pragma GCC diagnostic ignored "-Wpragmas"
290−#pragma GCC diagnostic ignored "-Wattribute-alias"
291288 SYSCALL_DEFINE3(pciconfig_iobase, long, which,
292289 unsigned long, bus, unsigned long, devfn)
293290 {
@@ -313,4 +310,3 @@ SYSCALL_DEFINE3(pciconfig_iobase, long, which, · 19 unmodified lines
313310
314311 return result;
315312 }
316−#pragma GCC diagnostic pop
arch/powerpc/kernel/pci_64.c+0−4
@@ -203,9 +203,6 @@ void pcibios_setup_phb_io_space(struct pci_controller *hose) · 202 unmodified lines
203203 #define IOBASE_ISA_IO 3
204204 #define IOBASE_ISA_MEM 4
205205
206−#pragma GCC diagnostic push
207−#pragma GCC diagnostic ignored "-Wpragmas"
208−#pragma GCC diagnostic ignored "-Wattribute-alias"
209206 SYSCALL_DEFINE3(pciconfig_iobase, long, which, unsigned long, in_bus,
210207 unsigned long, in_devfn)
211208 {
@@ -259,7 +256,6 @@ SYSCALL_DEFINE3(pciconfig_iobase, long, which, unsigned long, in_bus, · 47 unmodified lines
259256
260257 return -EOPNOTSUPP;
261258 }
262−#pragma GCC diagnostic pop
263259
264260 #ifdef CONFIG_NUMA
265261 int pcibus_to_node(struct pci_bus *bus)
arch/powerpc/kernel/rtas.c+0−4
@@ -1051,9 +1051,6 @@ struct pseries_errorlog *get_pseries_errorlog(struct rtas_error_log *log, · 1050 unmodified lines
10511051 }
10521052
10531053 /* We assume to be passed big endian arguments */
1054−#pragma GCC diagnostic push
1055−#pragma GCC diagnostic ignored "-Wpragmas"
1056−#pragma GCC diagnostic ignored "-Wattribute-alias"
10571054 SYSCALL_DEFINE1(rtas, struct rtas_args __user *, uargs)
10581055 {
10591056 struct rtas_args args;
@@ -1140,7 +1137,6 @@ SYSCALL_DEFINE1(rtas, struct rtas_args __user *, uargs) · 80 unmodified lines
11401137
11411138 return 0;
11421139 }
1143−#pragma GCC diagnostic pop
11441140
11451141 /*
11461142 * Call early during boot, before mem init, to retrieve the RTAS
arch/powerpc/kernel/setup-common.c+10−2
@@ -700,12 +700,19 @@ EXPORT_SYMBOL(check_legacy_ioport); · 699 unmodified lines
700700 static int ppc_panic_event(struct notifier_block *this,
701701 unsigned long event, void *ptr)
702702 {
703+ /*
704+ * panic does a local_irq_disable, but we really
705+ * want interrupts to be hard disabled.
706+ */
707+ hard_irq_disable();
708+
703709 /*
704710 * If firmware-assisted dump has been registered then trigger
705711 * firmware-assisted dump and let firmware handle everything else.
706712 */
707713 crash_fadump(NULL, ptr);
708− ppc_md.panic(ptr); /* May not return */
714+ if (ppc_md.panic)
715+ ppc_md.panic(ptr); /* May not return */
709716 return NOTIFY_DONE;
710717 }
711718
@@ -716,7 +723,8 @@ static struct notifier_block ppc_panic_block = { · 4 unmodified lines
716723
717724 void __init setup_panic(void)
718725 {
719− if (!ppc_md.panic)
726+ /* PPC64 always does a hard irq disable in its panic handler */
727+ if (!IS_ENABLED(CONFIG_PPC64) && !ppc_md.panic)
720728 return;
721729 atomic_notifier_chain_register(&panic_notifier_list, &ppc_panic_block);
722730 }
arch/powerpc/kernel/setup_64.c+8−0
@@ -387,6 +387,14 @@ void early_setup_secondary(void) · 386 unmodified lines
387387
388388 #endif /* CONFIG_SMP */
389389
390+void panic_smp_self_stop(void)
391+{
392+ hard_irq_disable();
393+ spin_begin();
394+ while (1)
395+ spin_cpu_relax();
396+}
397+
390398 #if defined(CONFIG_SMP) || defined(CONFIG_KEXEC_CORE)
391399 static bool use_spinloop(void)
392400 {
arch/powerpc/kernel/signal.c+2−2
@@ -134,7 +134,7 @@ static void do_signal(struct task_struct *tsk) · 133 unmodified lines
134134 /* Re-enable the breakpoints for the signal stack */
135135 thread_change_pc(tsk, tsk->thread.regs);
136136
137− rseq_signal_deliver(tsk->thread.regs);
137+ rseq_signal_deliver(&ksig, tsk->thread.regs);
138138
139139 if (is32) {
140140 if (ksig.ka.sa.sa_flags & SA_SIGINFO)
@@ -170,7 +170,7 @@ void do_notify_resume(struct pt_regs *regs, unsigned long thread_info_flags) · 29 unmodified lines
170170 if (thread_info_flags & _TIF_NOTIFY_RESUME) {
171171 clear_thread_flag(TIF_NOTIFY_RESUME);
172172 tracehook_notify_resume(regs);
173− rseq_handle_notify_resume(regs);
173+ rseq_handle_notify_resume(NULL, regs);
174174 }
175175
176176 user_enter();
arch/powerpc/kernel/signal_32.c+0−8
@@ -1038,9 +1038,6 @@ static int do_setcontext_tm(struct ucontext __user *ucp, · 1037 unmodified lines
10381038 }
10391039 #endif
10401040
1041−#pragma GCC diagnostic push
1042−#pragma GCC diagnostic ignored "-Wpragmas"
1043−#pragma GCC diagnostic ignored "-Wattribute-alias"
10441041 #ifdef CONFIG_PPC64
10451042 COMPAT_SYSCALL_DEFINE3(swapcontext, struct ucontext __user *, old_ctx,
10461043 struct ucontext __user *, new_ctx, int, ctx_size)
@@ -1134,7 +1131,6 @@ SYSCALL_DEFINE3(swapcontext, struct ucontext __user *, old_ctx, · 87 unmodified lines
11341131 set_thread_flag(TIF_RESTOREALL);
11351132 return 0;
11361133 }
1137−#pragma GCC diagnostic pop
11381134
11391135 #ifdef CONFIG_PPC64
11401136 COMPAT_SYSCALL_DEFINE0(rt_sigreturn)
@@ -1231,9 +1227,6 @@ SYSCALL_DEFINE0(rt_sigreturn) · 90 unmodified lines
12311227 return 0;
12321228 }
12331229
1234−#pragma GCC diagnostic push
1235−#pragma GCC diagnostic ignored "-Wpragmas"
1236−#pragma GCC diagnostic ignored "-Wattribute-alias"
12371230 #ifdef CONFIG_PPC32
12381231 SYSCALL_DEFINE3(debug_setcontext, struct ucontext __user *, ctx,
12391232 int, ndbg, struct sig_dbg_op __user *, dbg)
@@ -1337,7 +1330,6 @@ SYSCALL_DEFINE3(debug_setcontext, struct ucontext __user *, ctx, · 97 unmodified lines
13371330 return 0;
13381331 }
13391332 #endif
1340−#pragma GCC diagnostic pop
13411333
13421334 /*
13431335 * OK, we're invoking a handler
arch/powerpc/kernel/signal_64.c+0−4
@@ -625,9 +625,6 @@ static long setup_trampoline(unsigned int syscall, unsigned int __user *tramp) · 624 unmodified lines
625625 /*
626626 * Handle {get,set,swap}_context operations
627627 */
628−#pragma GCC diagnostic push
629−#pragma GCC diagnostic ignored "-Wpragmas"
630−#pragma GCC diagnostic ignored "-Wattribute-alias"
631628 SYSCALL_DEFINE3(swapcontext, struct ucontext __user *, old_ctx,
632629 struct ucontext __user *, new_ctx, long, ctx_size)
633630 {
@@ -693,7 +690,6 @@ SYSCALL_DEFINE3(swapcontext, struct ucontext __user *, old_ctx, · 59 unmodified lines
693690 set_thread_flag(TIF_RESTOREALL);
694691 return 0;
695692 }
696−#pragma GCC diagnostic pop
697693
698694
699695 /*
arch/powerpc/kernel/smp.c+0−6
@@ -600,9 +600,6 @@ static void nmi_stop_this_cpu(struct pt_regs *regs) · 599 unmodified lines
600600 nmi_ipi_busy_count--;
601601 nmi_ipi_unlock();
602602
603− /* Remove this CPU */
604− set_cpu_online(smp_processor_id(), false);
605−
606603 spin_begin();
607604 while (1)
608605 spin_cpu_relax();
@@ -617,9 +614,6 @@ void smp_send_stop(void) · 8 unmodified lines
617614
618615 static void stop_this_cpu(void *dummy)
619616 {
620− /* Remove this CPU */
621− set_cpu_online(smp_processor_id(), false);
622−
623617 hard_irq_disable();
624618 spin_begin();
625619 while (1)
arch/powerpc/kernel/stacktrace.c+2−2
@@ -196,7 +196,7 @@ save_stack_trace_tsk_reliable(struct task_struct *tsk, · 195 unmodified lines
196196 EXPORT_SYMBOL_GPL(save_stack_trace_tsk_reliable);
197197 #endif /* CONFIG_HAVE_RELIABLE_STACKTRACE */
198198
199−#ifdef CONFIG_PPC_BOOK3S_64
199+#if defined(CONFIG_PPC_BOOK3S_64) && defined(CONFIG_NMI_IPI)
200200 static void handle_backtrace_ipi(struct pt_regs *regs)
201201 {
202202 nmi_cpu_backtrace(regs);
@@ -242,4 +242,4 @@ void arch_trigger_cpumask_backtrace(const cpumask_t *mask, bool exclude_self) · 39 unmodified lines
242242 {
243243 nmi_trigger_cpumask_backtrace(mask, exclude_self, raise_backtrace_ipi);
244244 }
245−#endif /* CONFIG_PPC64 */
245+#endif /* defined(CONFIG_PPC_BOOK3S_64) && defined(CONFIG_NMI_IPI) */
arch/powerpc/kernel/syscalls.c+0−4
@@ -62,9 +62,6 @@ out: · 61 unmodified lines
6262 return ret;
6363 }
6464
65−#pragma GCC diagnostic push
66−#pragma GCC diagnostic ignored "-Wpragmas"
67−#pragma GCC diagnostic ignored "-Wattribute-alias"
6865 SYSCALL_DEFINE6(mmap2, unsigned long, addr, size_t, len,
6966 unsigned long, prot, unsigned long, flags,
7067 unsigned long, fd, unsigned long, pgoff)
@@ -78,7 +75,6 @@ SYSCALL_DEFINE6(mmap, unsigned long, addr, size_t, len, · 7 unmodified lines
7875 {
7976 return do_mmap2(addr, len, prot, flags, fd, offset, PAGE_SHIFT);
8077 }
81−#pragma GCC diagnostic pop
8278
8379 #ifdef CONFIG_PPC32
8480 /*
arch/powerpc/mm/hugetlbpage.c+2−1
@@ -337,7 +337,8 @@ static void free_hugepd_range(struct mmu_gather *tlb, hugepd_t *hpdp, int pdshif · 336 unmodified lines
337337 if (shift >= pdshift)
338338 hugepd_free(tlb, hugepte);
339339 else
340− pgtable_free_tlb(tlb, hugepte, pdshift - shift);
340+ pgtable_free_tlb(tlb, hugepte,
341+ get_hugepd_cache_index(pdshift - shift));
341342 }
342343
343344 static void hugetlb_free_pmd_range(struct mmu_gather *tlb, pud_t *pud,
arch/powerpc/mm/pgtable-book3s64.c+12−0
@@ -409,6 +409,18 @@ static inline void pgtable_free(void *table, int index) · 408 unmodified lines
409409 case PUD_INDEX:
410410 kmem_cache_free(PGT_CACHE(PUD_CACHE_INDEX), table);
411411 break;
412+#if defined(CONFIG_PPC_4K_PAGES) && defined(CONFIG_HUGETLB_PAGE)
413+ /* 16M hugepd directory at pud level */
414+ case HTLB_16M_INDEX:
415+ BUILD_BUG_ON(H_16M_CACHE_INDEX <= 0);
416+ kmem_cache_free(PGT_CACHE(H_16M_CACHE_INDEX), table);
417+ break;
418+ /* 16G hugepd directory at the pgd level */
419+ case HTLB_16G_INDEX:
420+ BUILD_BUG_ON(H_16G_CACHE_INDEX <= 0);
421+ kmem_cache_free(PGT_CACHE(H_16G_CACHE_INDEX), table);
422+ break;
423+#endif
412424 /* We don't free pgd table via RCU callback */
413425 default:
414426 BUG();
arch/powerpc/mm/subpage-prot.c+0−4
@@ -186,9 +186,6 @@ static void subpage_mark_vma_nohuge(struct mm_struct *mm, unsigned long addr, · 185 unmodified lines
186186 * in a 2-bit field won't allow writes to a page that is otherwise
187187 * write-protected.
188188 */
189−#pragma GCC diagnostic push
190−#pragma GCC diagnostic ignored "-Wpragmas"
191−#pragma GCC diagnostic ignored "-Wattribute-alias"
192189 SYSCALL_DEFINE3(subpage_prot, unsigned long, addr,
193190 unsigned long, len, u32 __user *, map)
194191 {
@@ -272,4 +269,3 @@ SYSCALL_DEFINE3(subpage_prot, unsigned long, addr, · 77 unmodified lines
272269 up_write(&mm->mmap_sem);
273270 return err;
274271 }
275−#pragma GCC diagnostic pop
arch/powerpc/mm/tlb-radix.c+77−21
@@ -689,22 +689,17 @@ EXPORT_SYMBOL(radix__flush_tlb_kernel_range); · 688 unmodified lines
689689 static unsigned long tlb_single_page_flush_ceiling __read_mostly = 33;
690690 static unsigned long tlb_local_single_page_flush_ceiling __read_mostly = POWER9_TLB_SETS_RADIX * 2;
691691
692−void radix__flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
693− unsigned long end)
692+static inline void __radix__flush_tlb_range(struct mm_struct *mm,
693+ unsigned long start, unsigned long end,
694+ bool flush_all_sizes)
694695
695696 {
696− struct mm_struct *mm = vma->vm_mm;
697697 unsigned long pid;
698698 unsigned int page_shift = mmu_psize_defs[mmu_virtual_psize].shift;
699699 unsigned long page_size = 1UL << page_shift;
700700 unsigned long nr_pages = (end - start) >> page_shift;
701701 bool local, full;
702702
703−#ifdef CONFIG_HUGETLB_PAGE
704− if (is_vm_hugetlb_page(vma))
705− return radix__flush_hugetlb_tlb_range(vma, start, end);
706−#endif
707−
708703 pid = mm->context.id;
709704 if (unlikely(pid == MMU_NO_CONTEXT))
710705 return;
@@ -738,37 +733,64 @@ is_local: · 27 unmodified lines
738733 _tlbie_pid(pid, RIC_FLUSH_TLB);
739734 }
740735 } else {
741− bool hflush = false;
736+ bool hflush = flush_all_sizes;
737+ bool gflush = flush_all_sizes;
742738 unsigned long hstart, hend;
739+ unsigned long gstart, gend;
743740
744−#ifdef CONFIG_TRANSPARENT_HUGEPAGE
745− hstart = (start + HPAGE_PMD_SIZE - 1) >> HPAGE_PMD_SHIFT;
746− hend = end >> HPAGE_PMD_SHIFT;
747− if (hstart < hend) {
748− hstart <<= HPAGE_PMD_SHIFT;
749− hend <<= HPAGE_PMD_SHIFT;
741+ if (IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE))
750742 hflush = true;
743+
744+ if (hflush) {
745+ hstart = (start + PMD_SIZE - 1) & PMD_MASK;
746+ hend = end & PMD_MASK;
747+ if (hstart == hend)
748+ hflush = false;
749+ }
750+
751+ if (gflush) {
752+ gstart = (start + PUD_SIZE - 1) & PUD_MASK;
753+ gend = end & PUD_MASK;
754+ if (gstart == gend)
755+ gflush = false;
751756 }
752−#endif
753757
754758 asm volatile("ptesync": : :"memory");
755759 if (local) {
756760 __tlbiel_va_range(start, end, pid, page_size, mmu_virtual_psize);
757761 if (hflush)
758762 __tlbiel_va_range(hstart, hend, pid,
759− HPAGE_PMD_SIZE, MMU_PAGE_2M);
763+ PMD_SIZE, MMU_PAGE_2M);
764+ if (gflush)
765+ __tlbiel_va_range(gstart, gend, pid,
766+ PUD_SIZE, MMU_PAGE_1G);
760767 asm volatile("ptesync": : :"memory");
761768 } else {
762769 __tlbie_va_range(start, end, pid, page_size, mmu_virtual_psize);
763770 if (hflush)
764771 __tlbie_va_range(hstart, hend, pid,
765− HPAGE_PMD_SIZE, MMU_PAGE_2M);
772+ PMD_SIZE, MMU_PAGE_2M);
773+ if (gflush)
774+ __tlbie_va_range(gstart, gend, pid,
775+ PUD_SIZE, MMU_PAGE_1G);
766776 fixup_tlbie();
767777 asm volatile("eieio; tlbsync; ptesync": : :"memory");
768778 }
769779 }
770780 preempt_enable();
771781 }
782+
783+void radix__flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
784+ unsigned long end)
785+
786+{
787+#ifdef CONFIG_HUGETLB_PAGE
788+ if (is_vm_hugetlb_page(vma))
789+ return radix__flush_hugetlb_tlb_range(vma, start, end);
790+#endif
791+
792+ __radix__flush_tlb_range(vma->vm_mm, start, end, false);
793+}
772794 EXPORT_SYMBOL(radix__flush_tlb_range);
773795
774796 static int radix_get_mmu_psize(int page_size)
@@ -837,6 +859,8 @@ void radix__tlb_flush(struct mmu_gather *tlb) · 62 unmodified lines
837859 int psize = 0;
838860 struct mm_struct *mm = tlb->mm;
839861 int page_size = tlb->page_size;
862+ unsigned long start = tlb->start;
863+ unsigned long end = tlb->end;
840864
841865 /*
842866 * if page size is not something we understand, do a full mm flush
@@ -847,15 +871,45 @@ void radix__tlb_flush(struct mmu_gather *tlb) · 4 unmodified lines
847871 */
848872 if (tlb->fullmm) {
849873 __flush_all_mm(mm, true);
874+#if defined(CONFIG_TRANSPARENT_HUGEPAGE) || defined(CONFIG_HUGETLB_PAGE)
875+ } else if (mm_tlb_flush_nested(mm)) {
876+ /*
877+ * If there is a concurrent invalidation that is clearing ptes,
878+ * then it's possible this invalidation will miss one of those
879+ * cleared ptes and miss flushing the TLB. If this invalidate
880+ * returns before the other one flushes TLBs, that can result
881+ * in it returning while there are still valid TLBs inside the
882+ * range to be invalidated.
883+ *
884+ * See mm/memory.c:tlb_finish_mmu() for more details.
885+ *
886+ * The solution to this is ensure the entire range is always
887+ * flushed here. The problem for powerpc is that the flushes
888+ * are page size specific, so this "forced flush" would not
889+ * do the right thing if there are a mix of page sizes in
890+ * the range to be invalidated. So use __flush_tlb_range
891+ * which invalidates all possible page sizes in the range.
892+ *
893+ * PWC flush probably is not be required because the core code
894+ * shouldn't free page tables in this path, but accounting
895+ * for the possibility makes us a bit more robust.
896+ *
897+ * need_flush_all is an uncommon case because page table
898+ * teardown should be done with exclusive locks held (but
899+ * after locks are dropped another invalidate could come
900+ * in), it could be optimized further if necessary.
901+ */
902+ if (!tlb->need_flush_all)
903+ __radix__flush_tlb_range(mm, start, end, true);
904+ else
905+ radix__flush_all_mm(mm);
906+#endif
850907 } else if ( (psize = radix_get_mmu_psize(page_size)) == -1) {
851908 if (!tlb->need_flush_all)
852909 radix__flush_tlb_mm(mm);
853910 else
854911 radix__flush_all_mm(mm);
855912 } else {
856− unsigned long start = tlb->start;
857− unsigned long end = tlb->end;
858−
859913 if (!tlb->need_flush_all)
860914 radix__flush_tlb_range_psize(mm, start, end, psize);
861915 else
@@ -1043,6 +1097,8 @@ extern void radix_kvm_prefetch_workaround(struct mm_struct *mm) · 181 unmodified lines
10431097 for (; sib <= cpu_last_thread_sibling(cpu) && !flush; sib++) {
10441098 if (sib == cpu)
10451099 continue;
1100+ if (!cpu_possible(sib))
1101+ continue;
10461102 if (paca_ptrs[sib]->kvm_hstate.kvm_vcpu)
10471103 flush = true;
10481104 }
arch/powerpc/platforms/powermac/time.c+20−9
@@ -42,7 +42,11 @@ · 41 unmodified lines
4242 #define DBG(x...)
4343 #endif
4444
45−/* Apparently the RTC stores seconds since 1 Jan 1904 */
45+/*
46+ * Offset between Unix time (1970-based) and Mac time (1904-based). Cuda and PMU
47+ * times wrap in 2040. If we need to handle later times, the read_time functions
48+ * need to be changed to interpret wrapped times as post-2040.
49+ */
4650 #define RTC_OFFSET 2082844800
4751
4852 /*
@@ -97,8 +101,11 @@ static time64_t cuda_get_time(void) · 48 unmodified lines
97101 if (req.reply_len != 7)
98102 printk(KERN_ERR "cuda_get_time: got %d byte reply\n",
99103 req.reply_len);
100− now = (req.reply[3] << 24) + (req.reply[4] << 16)
101− + (req.reply[5] << 8) + req.reply[6];
104+ now = (u32)((req.reply[3] << 24) + (req.reply[4] << 16) +
105+ (req.reply[5] << 8) + req.reply[6]);
106+ /* it's either after year 2040, or the RTC has gone backwards */
107+ WARN_ON(now < RTC_OFFSET);
108+
102109 return now - RTC_OFFSET;
103110 }
104111
@@ -106,10 +113,10 @@ static time64_t cuda_get_time(void) · 1 unmodified line
106113
107114 static int cuda_set_rtc_time(struct rtc_time *tm)
108115 {
109− time64_t nowtime;
116+ u32 nowtime;
110117 struct adb_request req;
111118
112− nowtime = rtc_tm_to_time64(tm) + RTC_OFFSET;
119+ nowtime = lower_32_bits(rtc_tm_to_time64(tm) + RTC_OFFSET);
113120 if (cuda_request(&req, NULL, 6, CUDA_PACKET, CUDA_SET_TIME,
114121 nowtime >> 24, nowtime >> 16, nowtime >> 8,
115122 nowtime) < 0)
@@ -140,8 +147,12 @@ static time64_t pmu_get_time(void) · 24 unmodified lines
140147 if (req.reply_len != 4)
141148 printk(KERN_ERR "pmu_get_time: got %d byte reply from PMU\n",
142149 req.reply_len);
143− now = (req.reply[0] << 24) + (req.reply[1] << 16)
144− + (req.reply[2] << 8) + req.reply[3];
150+ now = (u32)((req.reply[0] << 24) + (req.reply[1] << 16) +
151+ (req.reply[2] << 8) + req.reply[3]);
152+
153+ /* it's either after year 2040, or the RTC has gone backwards */
154+ WARN_ON(now < RTC_OFFSET);
155+
145156 return now - RTC_OFFSET;
146157 }
147158
@@ -149,10 +160,10 @@ static time64_t pmu_get_time(void) · 1 unmodified line
149160
150161 static int pmu_set_rtc_time(struct rtc_time *tm)
151162 {
152− time64_t nowtime;
163+ u32 nowtime;
153164 struct adb_request req;
154165
155− nowtime = rtc_tm_to_time64(tm) + RTC_OFFSET;
166+ nowtime = lower_32_bits(rtc_tm_to_time64(tm) + RTC_OFFSET);
156167 if (pmu_request(&req, NULL, 5, PMU_SET_RTC, nowtime >> 24,
157168 nowtime >> 16, nowtime >> 8, nowtime) < 0)
158169 return -ENXIO;
arch/s390/include/asm/css_chars.h+32−30
@@ -6,36 +6,38 @@ · 5 unmodified lines
66
77 struct css_general_char {
88 u64 : 12;
9− u32 dynio : 1; /* bit 12 */
10− u32 : 4;
11− u32 eadm : 1; /* bit 17 */
12− u32 : 23;
13− u32 aif : 1; /* bit 41 */
14− u32 : 3;
15− u32 mcss : 1; /* bit 45 */
16− u32 fcs : 1; /* bit 46 */
17− u32 : 1;
18− u32 ext_mb : 1; /* bit 48 */
19− u32 : 7;
20− u32 aif_tdd : 1; /* bit 56 */
21− u32 : 1;
22− u32 qebsm : 1; /* bit 58 */
23− u32 : 2;
24− u32 aiv : 1; /* bit 61 */
25− u32 : 5;
26− u32 aif_osa : 1; /* bit 67 */
27− u32 : 12;
28− u32 eadm_rf : 1; /* bit 80 */
29− u32 : 1;
30− u32 cib : 1; /* bit 82 */
31− u32 : 5;
32− u32 fcx : 1; /* bit 88 */
33− u32 : 19;
34− u32 alt_ssi : 1; /* bit 108 */
35− u32 : 1;
36− u32 narf : 1; /* bit 110 */
37− u32 : 12;
38− u32 util_str : 1;/* bit 123 */
9+ u64 dynio : 1; /* bit 12 */
10+ u64 : 4;
11+ u64 eadm : 1; /* bit 17 */
12+ u64 : 23;
13+ u64 aif : 1; /* bit 41 */
14+ u64 : 3;
15+ u64 mcss : 1; /* bit 45 */
16+ u64 fcs : 1; /* bit 46 */
17+ u64 : 1;
18+ u64 ext_mb : 1; /* bit 48 */
19+ u64 : 7;
20+ u64 aif_tdd : 1; /* bit 56 */
21+ u64 : 1;
22+ u64 qebsm : 1; /* bit 58 */
23+ u64 : 2;
24+ u64 aiv : 1; /* bit 61 */
25+ u64 : 2;
26+
27+ u64 : 3;
28+ u64 aif_osa : 1; /* bit 67 */
29+ u64 : 12;
30+ u64 eadm_rf : 1; /* bit 80 */
31+ u64 : 1;
32+ u64 cib : 1; /* bit 82 */
33+ u64 : 5;
34+ u64 fcx : 1; /* bit 88 */
35+ u64 : 19;
36+ u64 alt_ssi : 1; /* bit 108 */
37+ u64 : 1;
38+ u64 narf : 1; /* bit 110 */
39+ u64 : 12;
40+ u64 util_str : 1;/* bit 123 */
3941 } __packed;
4042
4143 extern struct css_general_char css_general_characteristics;
arch/x86/Makefile+0−6
@@ -258,11 +258,6 @@ archscripts: scripts_basic · 257 unmodified lines
258258 archheaders:
259259 $(Q)$(MAKE) $(build)=arch/x86/entry/syscalls all
260260
261−archprepare:
262−ifeq ($(CONFIG_KEXEC_FILE),y)
263− $(Q)$(MAKE) $(build)=arch/x86/purgatory arch/x86/purgatory/kexec-purgatory.c
264−endif
265−
266261 ###
267262 # Kernel objects
268263
@@ -327,7 +322,6 @@ archclean: · 58 unmodified lines
327322 $(Q)rm -rf $(objtree)/arch/x86_64
328323 $(Q)$(MAKE) $(clean)=$(boot)
329324 $(Q)$(MAKE) $(clean)=arch/x86/tools
330− $(Q)$(MAKE) $(clean)=arch/x86/purgatory
331325
332326 define archhelp
333327 echo '* bzImage - Compressed kernel image (arch/x86/boot/bzImage)'
arch/x86/boot/compressed/eboot.c+1−1
@@ -118,7 +118,7 @@ __setup_efi_pci(efi_pci_io_protocol_t *pci, struct pci_setup_rom **__rom) · 117 unmodified lines
118118 void *romimage;
119119
120120 status = efi_call_proto(efi_pci_io_protocol, attributes, pci,
121− EfiPciIoAttributeOperationGet, 0, 0,
121+ EfiPciIoAttributeOperationGet, 0ULL,
122122 &attributes);
123123 if (status != EFI_SUCCESS)
124124 return status;
arch/x86/entry/common.c+1−1
@@ -164,7 +164,7 @@ static void exit_to_usermode_loop(struct pt_regs *regs, u32 cached_flags) · 163 unmodified lines
164164 if (cached_flags & _TIF_NOTIFY_RESUME) {
165165 clear_thread_flag(TIF_NOTIFY_RESUME);
166166 tracehook_notify_resume(regs);
167− rseq_handle_notify_resume(regs);
167+ rseq_handle_notify_resume(NULL, regs);
168168 }
169169
170170 if (cached_flags & _TIF_USER_RETURN_NOTIFY)
arch/x86/entry/entry_32.S+1−1
@@ -477,7 +477,7 @@ ENTRY(entry_SYSENTER_32) · 476 unmodified lines
477477 * whereas POPF does not.)
478478 */
479479 addl $PT_EFLAGS-PT_DS, %esp /* point esp at pt_regs->flags */
480− btr $X86_EFLAGS_IF_BIT, (%esp)
480+ btrl $X86_EFLAGS_IF_BIT, (%esp)
481481 popfl
482482
483483 /*
arch/x86/entry/entry_64_compat.S+8−8
@@ -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 %r8 /* pt_regs->r8 */
87+ pushq $0 /* pt_regs->r8 = 0 */
8888 xorl %r8d, %r8d /* nospec r8 */
89− pushq %r9 /* pt_regs->r9 */
89+ pushq $0 /* pt_regs->r9 = 0 */
9090 xorl %r9d, %r9d /* nospec r9 */
91− pushq %r10 /* pt_regs->r10 */
91+ pushq $0 /* pt_regs->r10 = 0 */
9292 xorl %r10d, %r10d /* nospec r10 */
93− pushq %r11 /* pt_regs->r11 */
93+ pushq $0 /* pt_regs->r11 = 0 */
9494 xorl %r11d, %r11d /* nospec r11 */
9595 pushq %rbx /* pt_regs->rbx */
9696 xorl %ebx, %ebx /* nospec rbx */
@@ -374,13 +374,13 @@ ENTRY(entry_INT80_compat) · 277 unmodified lines
374374 pushq %rcx /* pt_regs->cx */
375375 xorl %ecx, %ecx /* nospec cx */
376376 pushq $-ENOSYS /* pt_regs->ax */
377− pushq $0 /* pt_regs->r8 = 0 */
377+ pushq %r8 /* pt_regs->r8 */
378378 xorl %r8d, %r8d /* nospec r8 */
379− pushq $0 /* pt_regs->r9 = 0 */
379+ pushq %r9 /* pt_regs->r9 */
380380 xorl %r9d, %r9d /* nospec r9 */
381− pushq $0 /* pt_regs->r10 = 0 */
381+ pushq %r10 /* pt_regs->r10*/
382382 xorl %r10d, %r10d /* nospec r10 */
383− pushq $0 /* pt_regs->r11 = 0 */
383+ pushq %r11 /* pt_regs->r11 */
384384 xorl %r11d, %r11d /* nospec r11 */
385385 pushq %rbx /* pt_regs->rbx */
386386 xorl %ebx, %ebx /* nospec rbx */
arch/x86/include/asm/barrier.h+1−1
@@ -38,7 +38,7 @@ static inline unsigned long array_index_mask_nospec(unsigned long index, · 37 unmodified lines
3838 {
3939 unsigned long mask;
4040
41− asm ("cmp %1,%2; sbb %0,%0;"
41+ asm volatile ("cmp %1,%2; sbb %0,%0;"
4242 :"=r" (mask)
4343 :"g"(size),"r" (index)
4444 :"cc");
arch/x86/include/asm/pgalloc.h+3−0
@@ -184,6 +184,9 @@ static inline p4d_t *p4d_alloc_one(struct mm_struct *mm, unsigned long addr) · 183 unmodified lines
184184
185185 static inline void p4d_free(struct mm_struct *mm, p4d_t *p4d)
186186 {
187+ if (!pgtable_l5_enabled())
188+ return;
189+
187190 BUG_ON((unsigned long)p4d & (PAGE_SIZE-1));
188191 free_page((unsigned long)p4d);
189192 }
arch/x86/include/asm/pgtable.h+1−1
@@ -898,7 +898,7 @@ static inline unsigned long pgd_page_vaddr(pgd_t pgd) · 897 unmodified lines
898898 #define pgd_page(pgd) pfn_to_page(pgd_pfn(pgd))
899899
900900 /* to find an entry in a page-table-directory. */
901−static __always_inline p4d_t *p4d_offset(pgd_t *pgd, unsigned long address)
901+static inline p4d_t *p4d_offset(pgd_t *pgd, unsigned long address)
902902 {
903903 if (!pgtable_l5_enabled())
904904 return (p4d_t *)pgd;
arch/x86/include/asm/pgtable_64.h+2−2
@@ -216,7 +216,7 @@ static inline pgd_t pti_set_user_pgd(pgd_t *pgdp, pgd_t pgd) · 215 unmodified lines
216216 }
217217 #endif
218218
219−static __always_inline void native_set_p4d(p4d_t *p4dp, p4d_t p4d)
219+static inline void native_set_p4d(p4d_t *p4dp, p4d_t p4d)
220220 {
221221 pgd_t pgd;
222222
@@ -230,7 +230,7 @@ static __always_inline void native_set_p4d(p4d_t *p4dp, p4d_t p4d) · 7 unmodified lines
230230 *p4dp = native_make_p4d(native_pgd_val(pgd));
231231 }
232232
233−static __always_inline void native_p4d_clear(p4d_t *p4d)
233+static inline void native_p4d_clear(p4d_t *p4d)
234234 {
235235 native_set_p4d(p4d, native_make_p4d(0));
236236 }
arch/x86/include/asm/vmx.h+3−0
@@ -114,6 +114,7 @@ · 113 unmodified lines
114114 #define VMX_MISC_PREEMPTION_TIMER_RATE_MASK 0x0000001f
115115 #define VMX_MISC_SAVE_EFER_LMA 0x00000020
116116 #define VMX_MISC_ACTIVITY_HLT 0x00000040
117+#define VMX_MISC_ZERO_LEN_INS 0x40000000
117118
118119 /* VMFUNC functions */
119120 #define VMX_VMFUNC_EPTP_SWITCHING 0x00000001
@@ -351,11 +352,13 @@ enum vmcs_field { · 231 unmodified lines
351352 #define VECTORING_INFO_VALID_MASK INTR_INFO_VALID_MASK
352353
353354 #define INTR_TYPE_EXT_INTR (0 << 8) /* external interrupt */
355+#define INTR_TYPE_RESERVED (1 << 8) /* reserved */
354356 #define INTR_TYPE_NMI_INTR (2 << 8) /* NMI */
355357 #define INTR_TYPE_HARD_EXCEPTION (3 << 8) /* processor exception */
356358 #define INTR_TYPE_SOFT_INTR (4 << 8) /* software interrupt */
357359 #define INTR_TYPE_PRIV_SW_EXCEPTION (5 << 8) /* ICE breakpoint - undocumented */
358360 #define INTR_TYPE_SOFT_EXCEPTION (6 << 8) /* software exception */
361+#define INTR_TYPE_OTHER_EVENT (7 << 8) /* other event */
359362
360363 /* GUEST_INTERRUPTIBILITY_INFO flags. */
361364 #define GUEST_INTR_STATE_STI 0x00000001
arch/x86/kernel/apic/x2apic_uv_x.c+57−3
@@ -26,6 +26,7 @@ · 25 unmodified lines
2626 #include <linux/delay.h>
2727 #include <linux/crash_dump.h>
2828 #include <linux/reboot.h>
29+#include <linux/memory.h>
2930
3031 #include <asm/uv/uv_mmrs.h>
3132 #include <asm/uv/uv_hub.h>
@@ -392,6 +393,51 @@ extern int uv_hub_info_version(void) · 360 unmodified lines
392393 }
393394 EXPORT_SYMBOL(uv_hub_info_version);
394395
396+/* Default UV memory block size is 2GB */
397+static unsigned long mem_block_size = (2UL << 30);
398+
399+/* Kernel parameter to specify UV mem block size */
400+static int parse_mem_block_size(char *ptr)
401+{
402+ unsigned long size = memparse(ptr, NULL);
403+
404+ /* Size will be rounded down by set_block_size() below */
405+ mem_block_size = size;
406+ return 0;
407+}
408+early_param("uv_memblksize", parse_mem_block_size);
409+
410+static __init int adj_blksize(u32 lgre)
411+{
412+ unsigned long base = (unsigned long)lgre << UV_GAM_RANGE_SHFT;
413+ unsigned long size;
414+
415+ for (size = mem_block_size; size > MIN_MEMORY_BLOCK_SIZE; size >>= 1)
416+ if (IS_ALIGNED(base, size))
417+ break;
418+
419+ if (size >= mem_block_size)
420+ return 0;
421+
422+ mem_block_size = size;
423+ return 1;
424+}
425+
426+static __init void set_block_size(void)
427+{
428+ unsigned int order = ffs(mem_block_size);
429+
430+ if (order) {
431+ /* adjust for ffs return of 1..64 */
432+ set_memory_block_size_order(order - 1);
433+ pr_info("UV: mem_block_size set to 0x%lx\n", mem_block_size);
434+ } else {
435+ /* bad or zero value, default to 1UL << 31 (2GB) */
436+ pr_err("UV: mem_block_size error with 0x%lx\n", mem_block_size);
437+ set_memory_block_size_order(31);
438+ }
439+}
440+
395441 /* Build GAM range lookup table: */
396442 static __init void build_uv_gr_table(void)
397443 {
@@ -1180,23 +1226,30 @@ static void __init decode_gam_rng_tbl(unsigned long ptr) · 782 unmodified lines
11801226 << UV_GAM_RANGE_SHFT);
11811227 int order = 0;
11821228 char suffix[] = " KMGTPE";
1229+ int flag = ' ';
11831230
11841231 while (size > 9999 && order < sizeof(suffix)) {
11851232 size /= 1024;
11861233 order++;
11871234 }
11881235
1236+ /* adjust max block size to current range start */
1237+ if (gre->type == 1 || gre->type == 2)
1238+ if (adj_blksize(lgre))
1239+ flag = '*';
1240+
11891241 if (!index) {
11901242 pr_info("UV: GAM Range Table...\n");
1191− pr_info("UV: # %20s %14s %5s %4s %5s %3s %2s\n", "Range", "", "Size", "Type", "NASID", "SID", "PN");
1243+ pr_info("UV: # %20s %14s %6s %4s %5s %3s %2s\n", "Range", "", "Size", "Type", "NASID", "SID", "PN");
11921244 }
1193− pr_info("UV: %2d: 0x%014lx-0x%014lx %5lu%c %3d %04x %02x %02x\n",
1245+ pr_info("UV: %2d: 0x%014lx-0x%014lx%c %5lu%c %3d %04x %02x %02x\n",
11941246 index++,
11951247 (unsigned long)lgre << UV_GAM_RANGE_SHFT,
11961248 (unsigned long)gre->limit << UV_GAM_RANGE_SHFT,
1197− size, suffix[order],
1249+ flag, size, suffix[order],
11981250 gre->type, gre->nasid, gre->sockid, gre->pnode);
11991251
1252+ /* update to next range start */
12001253 lgre = gre->limit;
12011254 if (sock_min > gre->sockid)
12021255 sock_min = gre->sockid;
@@ -1427,6 +1480,7 @@ static void __init uv_system_init_hub(void) · 224 unmodified lines
14271480
14281481 build_socket_tables();
14291482 build_uv_gr_table();
1483+ set_block_size();
14301484 uv_init_hub_info(&hub_info);
14311485 uv_possible_blades = num_possible_nodes();
14321486 if (!_node_to_pnode)
arch/x86/kernel/cpu/bugs.c+4−0
@@ -27,6 +27,7 @@ · 26 unmodified lines
2727 #include <asm/pgtable.h>
2828 #include <asm/set_memory.h>
2929 #include <asm/intel-family.h>
30+#include <asm/hypervisor.h>
3031
3132 static void __init spectre_v2_select_mitigation(void);
3233 static void __init ssb_select_mitigation(void);
@@ -664,6 +665,9 @@ static ssize_t cpu_show_common(struct device *dev, struct device_attribute *attr · 631 unmodified lines
664665 if (boot_cpu_has(X86_FEATURE_PTI))
665666 return sprintf(buf, "Mitigation: PTI\n");
666667
668+ if (hypervisor_is_type(X86_HYPER_XEN_PV))
669+ return sprintf(buf, "Unknown (XEN PV detected, hypervisor mitigation required)\n");
670+
667671 break;
668672
669673 case X86_BUG_SPECTRE_V1:
arch/x86/kernel/cpu/cacheinfo.c+1−1
@@ -671,7 +671,7 @@ void cacheinfo_amd_init_llc_id(struct cpuinfo_x86 *c, int cpu, u8 node_id) · 670 unmodified lines
671671 num_sharing_cache = ((eax >> 14) & 0xfff) + 1;
672672
673673 if (num_sharing_cache) {
674− int bits = get_count_order(num_sharing_cache) - 1;
674+ int bits = get_count_order(num_sharing_cache);
675675
676676 per_cpu(cpu_llc_id, cpu) = c->apicid >> bits;
677677 }
arch/x86/kernel/cpu/common.c+3−0
@@ -1,3 +1,6 @@
1+/* cpu_feature_enabled() cannot be used this early */
2+#define USE_EARLY_PGTABLE_L5
3+
14 #include <linux/bootmem.h>
25 #include <linux/linkage.h>
36 #include <linux/bitops.h>
arch/x86/kernel/cpu/mcheck/mce-severity.c+5−0
@@ -160,6 +160,11 @@ static struct severity { · 159 unmodified lines
160160 SER, MASK(MCI_STATUS_OVER|MCI_UC_SAR|MCI_ADDR|MCACOD, MCI_UC_SAR|MCI_ADDR|MCACOD_INSTR),
161161 USER
162162 ),
163+ MCESEV(
164+ PANIC, "Data load in unrecoverable area of kernel",
165+ SER, MASK(MCI_STATUS_OVER|MCI_UC_SAR|MCI_ADDR|MCACOD, MCI_UC_SAR|MCI_ADDR|MCACOD_DATA),
166+ KERNEL
167+ ),
163168 #endif
164169 MCESEV(
165170 PANIC, "Action required: unknown MCACOD",
arch/x86/kernel/cpu/mcheck/mce.c+28−16
@@ -772,23 +772,25 @@ EXPORT_SYMBOL_GPL(machine_check_poll); · 771 unmodified lines
772772 static int mce_no_way_out(struct mce *m, char **msg, unsigned long *validp,
773773 struct pt_regs *regs)
774774 {
775− int i, ret = 0;
776775 char *tmp;
776+ int i;
777777
778778 for (i = 0; i < mca_cfg.banks; i++) {
779779 m->status = mce_rdmsrl(msr_ops.status(i));
780− if (m->status & MCI_STATUS_VAL) {
781− __set_bit(i, validp);
782− if (quirk_no_way_out)
783− quirk_no_way_out(i, m, regs);
784− }
780+ if (!(m->status & MCI_STATUS_VAL))
781+ continue;
782+
783+ __set_bit(i, validp);
784+ if (quirk_no_way_out)
785+ quirk_no_way_out(i, m, regs);
785786
786787 if (mce_severity(m, mca_cfg.tolerant, &tmp, true) >= MCE_PANIC_SEVERITY) {
788+ mce_read_aux(m, i);
787789 *msg = tmp;
788− ret = 1;
790+ return 1;
789791 }
790792 }
791− return ret;
793+ return 0;
792794 }
793795
794796 /*
@@ -1205,13 +1207,18 @@ void do_machine_check(struct pt_regs *regs, long error_code) · 410 unmodified lines
12051207 lmce = m.mcgstatus & MCG_STATUS_LMCES;
12061208
12071209 /*
1210+ * Local machine check may already know that we have to panic.
1211+ * Broadcast machine check begins rendezvous in mce_start()
12081212 * Go through all banks in exclusion of the other CPUs. This way we
12091213 * don't report duplicated events on shared banks because the first one
1210− * to see it will clear it. If this is a Local MCE, then no need to
1211− * perform rendezvous.
1214+ * to see it will clear it.
12121215 */
1213− if (!lmce)
1216+ if (lmce) {
1217+ if (no_way_out)
1218+ mce_panic("Fatal local machine check", &m, msg);
1219+ } else {
12141220 order = mce_start(&no_way_out);
1221+ }
12151222
12161223 for (i = 0; i < cfg->banks; i++) {
12171224 __clear_bit(i, toclear);
@@ -1287,12 +1294,17 @@ void do_machine_check(struct pt_regs *regs, long error_code) · 69 unmodified lines
12871294 no_way_out = worst >= MCE_PANIC_SEVERITY;
12881295 } else {
12891296 /*
1290− * Local MCE skipped calling mce_reign()
1291− * If we found a fatal error, we need to panic here.
1297+ * If there was a fatal machine check we should have
1298+ * already called mce_panic earlier in this function.
1299+ * Since we re-read the banks, we might have found
1300+ * something new. Check again to see if we found a
1301+ * fatal error. We call "mce_severity()" again to
1302+ * make sure we have the right "msg".
12921303 */
1293− if (worst >= MCE_PANIC_SEVERITY && mca_cfg.tolerant < 3)
1294− mce_panic("Machine check from unknown source",
1295− NULL, NULL);
1304+ if (worst >= MCE_PANIC_SEVERITY && mca_cfg.tolerant < 3) {
1305+ mce_severity(&m, cfg->tolerant, &msg, true);
1306+ mce_panic("Local fatal machine check!", &m, msg);
1307+ }
12961308 }
12971309
12981310 /*
arch/x86/kernel/cpu/microcode/intel.c+4−1
@@ -190,8 +190,11 @@ static void save_microcode_patch(void *data, unsigned int size) · 189 unmodified lines
190190 p = memdup_patch(data, size);
191191 if (!p)
192192 pr_err("Error allocating buffer %p\n", data);
193− else
193+ else {
194194 list_replace(&iter->plist, &p->plist);
195+ kfree(iter->data);
196+ kfree(iter);
197+ }
195198 }
196199 }
197200
arch/x86/kernel/e820.c+12−3
@@ -1248,6 +1248,7 @@ void __init e820__memblock_setup(void) · 1247 unmodified lines
12481248 {
12491249 int i;
12501250 u64 end;
1251+ u64 addr = 0;
12511252
12521253 /*
12531254 * The bootstrap memblock region count maximum is 128 entries
@@ -1264,13 +1265,21 @@ void __init e820__memblock_setup(void) · 10 unmodified lines
12641265 struct e820_entry *entry = &e820_table->entries[i];
12651266
12661267 end = entry->addr + entry->size;
1268+ if (addr < entry->addr)
1269+ memblock_reserve(addr, entry->addr - addr);
1270+ addr = end;
12671271 if (end != (resource_size_t)end)
12681272 continue;
12691273
1274+ /*
1275+ * all !E820_TYPE_RAM ranges (including gap ranges) are put
1276+ * into memblock.reserved to make sure that struct pages in
1277+ * such regions are not left uninitialized after bootup.
1278+ */
12701279 if (entry->type != E820_TYPE_RAM && entry->type != E820_TYPE_RESERVED_KERN)
1271− continue;
1272−
1273− memblock_add(entry->addr, entry->size);
1280+ memblock_reserve(entry->addr, entry->size);
1281+ else
1282+ memblock_add(entry->addr, entry->size);
12741283 }
12751284
12761285 /* Throw away partial pages: */
arch/x86/kernel/head64.c+1−1
@@ -44,7 +44,7 @@ static unsigned int __initdata next_early_pgt; · 43 unmodified lines
4444 pmdval_t early_pmd_flags = __PAGE_KERNEL_LARGE & ~(_PAGE_GLOBAL | _PAGE_NX);
4545
4646 #ifdef CONFIG_X86_5LEVEL
47−unsigned int __pgtable_l5_enabled __initdata;
47+unsigned int __pgtable_l5_enabled __ro_after_init;
4848 unsigned int pgdir_shift __ro_after_init = 39;
4949 EXPORT_SYMBOL(pgdir_shift);
5050 unsigned int ptrs_per_p4d __ro_after_init = 1;
arch/x86/kernel/quirks.c+9−2
@@ -645,12 +645,19 @@ static void quirk_intel_brickland_xeon_ras_cap(struct pci_dev *pdev) · 644 unmodified lines
645645 /* Skylake */
646646 static void quirk_intel_purley_xeon_ras_cap(struct pci_dev *pdev)
647647 {
648− u32 capid0;
648+ u32 capid0, capid5;
649649
650650 pci_read_config_dword(pdev, 0x84, &capid0);
651+ pci_read_config_dword(pdev, 0x98, &capid5);
651652
652− if ((capid0 & 0xc0) == 0xc0)
653+ /*
654+ * CAPID0{7:6} indicate whether this is an advanced RAS SKU
655+ * CAPID5{8:5} indicate that various NVDIMM usage modes are
656+ * enabled, so memory machine check recovery is also enabled.
657+ */
658+ if ((capid0 & 0xc0) == 0xc0 || (capid5 & 0x1e0))
653659 static_branch_inc(&mcsafe_key);
660+
654661 }
655662 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x0ec3, quirk_intel_brickland_xeon_ras_cap);
656663 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_INTEL, 0x2fc0, quirk_intel_brickland_xeon_ras_cap);
arch/x86/kernel/signal.c+1−1
@@ -692,7 +692,7 @@ setup_rt_frame(struct ksignal *ksig, struct pt_regs *regs) · 691 unmodified lines
692692 * Increment event counter and perform fixup for the pre-signal
693693 * frame.
694694 */
695− rseq_signal_deliver(regs);
695+ rseq_signal_deliver(ksig, regs);
696696
697697 /* Set up the stack frame */
698698 if (is_ia32_frame(ksig)) {
arch/x86/kernel/traps.c+8−6
@@ -835,16 +835,18 @@ static void math_error(struct pt_regs *regs, int error_code, int trapnr) · 834 unmodified lines
835835 char *str = (trapnr == X86_TRAP_MF) ? "fpu exception" :
836836 "simd exception";
837837
838− if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, SIGFPE) == NOTIFY_STOP)
839− return;
840838 cond_local_irq_enable(regs);
841839
842840 if (!user_mode(regs)) {
843− if (!fixup_exception(regs, trapnr)) {
844− task->thread.error_code = error_code;
845− task->thread.trap_nr = trapnr;
841+ if (fixup_exception(regs, trapnr))
842+ return;
843+
844+ task->thread.error_code = error_code;
845+ task->thread.trap_nr = trapnr;
846+
847+ if (notify_die(DIE_TRAP, str, regs, error_code,
848+ trapnr, SIGFPE) != NOTIFY_STOP)
846849 die(str, regs, error_code);
847− }
848850 return;
849851 }
850852
arch/x86/kernel/uprobes.c+1−1
@@ -293,7 +293,7 @@ static int uprobe_init_insn(struct arch_uprobe *auprobe, struct insn *insn, bool · 292 unmodified lines
293293 insn_init(insn, auprobe->insn, sizeof(auprobe->insn), x86_64);
294294 /* has the side-effect of processing the entire instruction */
295295 insn_get_length(insn);
296− if (WARN_ON_ONCE(!insn_complete(insn)))
296+ if (!insn_complete(insn))
297297 return -ENOEXEC;
298298
299299 if (is_prefix_bad(insn))
arch/x86/kvm/vmx.c+67−0
@@ -1705,6 +1705,17 @@ static inline bool nested_cpu_has_vmwrite_any_field(struct kvm_vcpu *vcpu) · 1704 unmodified lines
17051705 MSR_IA32_VMX_MISC_VMWRITE_SHADOW_RO_FIELDS;
17061706 }
17071707
1708+static inline bool nested_cpu_has_zero_length_injection(struct kvm_vcpu *vcpu)
1709+{
1710+ return to_vmx(vcpu)->nested.msrs.misc_low & VMX_MISC_ZERO_LEN_INS;
1711+}
1712+
1713+static inline bool nested_cpu_supports_monitor_trap_flag(struct kvm_vcpu *vcpu)
1714+{
1715+ return to_vmx(vcpu)->nested.msrs.procbased_ctls_high &
1716+ CPU_BASED_MONITOR_TRAP_FLAG;
1717+}
1718+
17081719 static inline bool nested_cpu_has(struct vmcs12 *vmcs12, u32 bit)
17091720 {
17101721 return vmcs12->cpu_based_vm_exec_control & bit;
@@ -11620,6 +11631,62 @@ static int check_vmentry_prereqs(struct kvm_vcpu *vcpu, struct vmcs12 *vmcs12) · 9909 unmodified lines
1162011631 !nested_cr3_valid(vcpu, vmcs12->host_cr3))
1162111632 return VMXERR_ENTRY_INVALID_HOST_STATE_FIELD;
1162211633
11634+ /*
11635+ * From the Intel SDM, volume 3:
11636+ * Fields relevant to VM-entry event injection must be set properly.
11637+ * These fields are the VM-entry interruption-information field, the
11638+ * VM-entry exception error code, and the VM-entry instruction length.
11639+ */
11640+ if (vmcs12->vm_entry_intr_info_field & INTR_INFO_VALID_MASK) {
11641+ u32 intr_info = vmcs12->vm_entry_intr_info_field;
11642+ u8 vector = intr_info & INTR_INFO_VECTOR_MASK;
11643+ u32 intr_type = intr_info & INTR_INFO_INTR_TYPE_MASK;
11644+ bool has_error_code = intr_info & INTR_INFO_DELIVER_CODE_MASK;
11645+ bool should_have_error_code;
11646+ bool urg = nested_cpu_has2(vmcs12,
11647+ SECONDARY_EXEC_UNRESTRICTED_GUEST);
11648+ bool prot_mode = !urg || vmcs12->guest_cr0 & X86_CR0_PE;
11649+
11650+ /* VM-entry interruption-info field: interruption type */
11651+ if (intr_type == INTR_TYPE_RESERVED ||
11652+ (intr_type == INTR_TYPE_OTHER_EVENT &&
11653+ !nested_cpu_supports_monitor_trap_flag(vcpu)))
11654+ return VMXERR_ENTRY_INVALID_CONTROL_FIELD;
11655+
11656+ /* VM-entry interruption-info field: vector */
11657+ if ((intr_type == INTR_TYPE_NMI_INTR && vector != NMI_VECTOR) ||
11658+ (intr_type == INTR_TYPE_HARD_EXCEPTION && vector > 31) ||
11659+ (intr_type == INTR_TYPE_OTHER_EVENT && vector != 0))
11660+ return VMXERR_ENTRY_INVALID_CONTROL_FIELD;
11661+
11662+ /* VM-entry interruption-info field: deliver error code */
11663+ should_have_error_code =
11664+ intr_type == INTR_TYPE_HARD_EXCEPTION && prot_mode &&
11665+ x86_exception_has_error_code(vector);
11666+ if (has_error_code != should_have_error_code)
11667+ return VMXERR_ENTRY_INVALID_CONTROL_FIELD;
11668+
11669+ /* VM-entry exception error code */
11670+ if (has_error_code &&
11671+ vmcs12->vm_entry_exception_error_code & GENMASK(31, 15))
11672+ return VMXERR_ENTRY_INVALID_CONTROL_FIELD;
11673+
11674+ /* VM-entry interruption-info field: reserved bits */
11675+ if (intr_info & INTR_INFO_RESVD_BITS_MASK)
11676+ return VMXERR_ENTRY_INVALID_CONTROL_FIELD;
11677+
11678+ /* VM-entry instruction length */
11679+ switch (intr_type) {
11680+ case INTR_TYPE_SOFT_EXCEPTION:
11681+ case INTR_TYPE_SOFT_INTR:
11682+ case INTR_TYPE_PRIV_SW_EXCEPTION:
11683+ if ((vmcs12->vm_entry_instruction_len > 15) ||
11684+ (vmcs12->vm_entry_instruction_len == 0 &&
11685+ !nested_cpu_has_zero_length_injection(vcpu)))
11686+ return VMXERR_ENTRY_INVALID_CONTROL_FIELD;
11687+ }
11688+ }
11689+
1162311690 return 0;
1162411691 }
1162511692
arch/x86/kvm/x86.h+9−0
@@ -110,6 +110,15 @@ static inline bool is_la57_mode(struct kvm_vcpu *vcpu) · 109 unmodified lines
110110 #endif
111111 }
112112
113+static inline bool x86_exception_has_error_code(unsigned int vector)
114+{
115+ static u32 exception_has_error_code = BIT(DF_VECTOR) | BIT(TS_VECTOR) |
116+ BIT(NP_VECTOR) | BIT(SS_VECTOR) | BIT(GP_VECTOR) |
117+ BIT(PF_VECTOR) | BIT(AC_VECTOR);
118+
119+ return (1U << vector) & exception_has_error_code;
120+}
121+
113122 static inline bool mmu_is_nested(struct kvm_vcpu *vcpu)
114123 {
115124 return vcpu->arch.walk_mmu == &vcpu->arch.nested_mmu;
arch/x86/mm/fault.c+7−14
@@ -641,11 +641,6 @@ static int is_f00f_bug(struct pt_regs *regs, unsigned long address) · 640 unmodified lines
641641 return 0;
642642 }
643643
644−static const char nx_warning[] = KERN_CRIT
645−"kernel tried to execute NX-protected page - exploit attempt? (uid: %d)\n";
646−static const char smep_warning[] = KERN_CRIT
647−"unable to execute userspace code (SMEP?) (uid: %d)\n";
648−
649644 static void
650645 show_fault_oops(struct pt_regs *regs, unsigned long error_code,
651646 unsigned long address)
@@ -664,20 +659,18 @@ show_fault_oops(struct pt_regs *regs, unsigned long error_code, · 12 unmodified lines
664659 pte = lookup_address_in_pgd(pgd, address, &level);
665660
666661 if (pte && pte_present(*pte) && !pte_exec(*pte))
667− printk(nx_warning, from_kuid(&init_user_ns, current_uid()));
662+ pr_crit("kernel tried to execute NX-protected page - exploit attempt? (uid: %d)\n",
663+ from_kuid(&init_user_ns, current_uid()));
668664 if (pte && pte_present(*pte) && pte_exec(*pte) &&
669665 (pgd_flags(*pgd) & _PAGE_USER) &&
670666 (__read_cr4() & X86_CR4_SMEP))
671− printk(smep_warning, from_kuid(&init_user_ns, current_uid()));
667+ pr_crit("unable to execute userspace code (SMEP?) (uid: %d)\n",
668+ from_kuid(&init_user_ns, current_uid()));
672669 }
673670
674− printk(KERN_ALERT "BUG: unable to handle kernel ");
675− if (address < PAGE_SIZE)
676− printk(KERN_CONT "NULL pointer dereference");
677− else
678− printk(KERN_CONT "paging request");
679−
680− printk(KERN_CONT " at %px\n", (void *) address);
671+ pr_alert("BUG: unable to handle kernel %s at %px\n",
672+ address < PAGE_SIZE ? "NULL pointer dereference" : "paging request",
673+ (void *)address);
681674
682675 dump_pagetable(address);
683676 }
arch/x86/mm/init_64.c+16−4
@@ -1350,16 +1350,28 @@ int kern_addr_valid(unsigned long addr) · 1349 unmodified lines
13501350 /* Amount of ram needed to start using large blocks */
13511351 #define MEM_SIZE_FOR_LARGE_BLOCK (64UL << 30)
13521352
1353+/* Adjustable memory block size */
1354+static unsigned long set_memory_block_size;
1355+int __init set_memory_block_size_order(unsigned int order)
1356+{
1357+ unsigned long size = 1UL << order;
1358+
1359+ if (size > MEM_SIZE_FOR_LARGE_BLOCK || size < MIN_MEMORY_BLOCK_SIZE)
1360+ return -EINVAL;
1361+
1362+ set_memory_block_size = size;
1363+ return 0;
1364+}
1365+
13531366 static unsigned long probe_memory_block_size(void)
13541367 {
13551368 unsigned long boot_mem_end = max_pfn << PAGE_SHIFT;
13561369 unsigned long bz;
13571370
1358− /* If this is UV system, always set 2G block size */
1359− if (is_uv_system()) {
1360− bz = MAX_BLOCK_SIZE;
1371+ /* If memory block size has been set, then use it */
1372+ bz = set_memory_block_size;
1373+ if (bz)
13611374 goto done;
1362− }
13631375
13641376 /* Use regular block if RAM is smaller than MEM_SIZE_FOR_LARGE_BLOCK */
13651377 if (boot_mem_end < MEM_SIZE_FOR_LARGE_BLOCK) {
arch/x86/platform/efi/efi_64.c+2−2
@@ -166,14 +166,14 @@ void __init efi_call_phys_epilog(pgd_t *save_pgd) · 165 unmodified lines
166166 pgd = pgd_offset_k(pgd_idx * PGDIR_SIZE);
167167 set_pgd(pgd_offset_k(pgd_idx * PGDIR_SIZE), save_pgd[pgd_idx]);
168168
169− if (!(pgd_val(*pgd) & _PAGE_PRESENT))
169+ if (!pgd_present(*pgd))
170170 continue;
171171
172172 for (i = 0; i < PTRS_PER_P4D; i++) {
173173 p4d = p4d_offset(pgd,
174174 pgd_idx * PGDIR_SIZE + i * P4D_SIZE);
175175
176− if (!(p4d_val(*p4d) & _PAGE_PRESENT))
176+ if (!p4d_present(*p4d))
177177 continue;
178178
179179 pud = (pud_t *)p4d_page_vaddr(*p4d);
arch/x86/xen/enlighten.c+7−0
@@ -64,6 +64,13 @@ struct shared_info xen_dummy_shared_info; · 63 unmodified lines
6464 __read_mostly int xen_have_vector_callback;
6565 EXPORT_SYMBOL_GPL(xen_have_vector_callback);
6666
67+/*
68+ * NB: needs to live in .data because it's used by xen_prepare_pvh which runs
69+ * before clearing the bss.
70+ */
71+uint32_t xen_start_flags __attribute__((section(".data"))) = 0;
72+EXPORT_SYMBOL(xen_start_flags);
73+
6774 /*
6875 * Point at some empty memory to start with. We map the real shared_info
6976 * page as soon as fixmap is up and running.
arch/x86/xen/enlighten_pv.c+1−0
@@ -1203,6 +1203,7 @@ asmlinkage __visible void __init xen_start_kernel(void) · 1202 unmodified lines
12031203 return;
12041204
12051205 xen_domain_type = XEN_PV_DOMAIN;
1206+ xen_start_flags = xen_start_info->flags;
12061207
12071208 xen_setup_features();
12081209
arch/x86/xen/enlighten_pvh.c+1−0
@@ -97,6 +97,7 @@ void __init xen_prepare_pvh(void) · 96 unmodified lines
9797 }
9898
9999 xen_pvh = 1;
100+ xen_start_flags = pvh_start_info.flags;
100101
101102 msr = cpuid_ebx(xen_cpuid_base() + 2);
102103 pfn = __pa(hypercall_page);
arch/x86/xen/smp_pv.c+5−0
@@ -32,6 +32,7 @@ · 31 unmodified lines
3232 #include <xen/interface/vcpu.h>
3333 #include <xen/interface/xenpmu.h>
3434
35+#include <asm/spec-ctrl.h>
3536 #include <asm/xen/interface.h>
3637 #include <asm/xen/hypercall.h>
3738
@@ -70,6 +71,8 @@ static void cpu_bringup(void) · 32 unmodified lines
7071 cpu_data(cpu).x86_max_cores = 1;
7172 set_cpu_sibling_map(cpu);
7273
74+ speculative_store_bypass_ht_init();
75+
7376 xen_setup_cpu_clockevents();
7477
7578 notify_cpu_starting(cpu);
@@ -250,6 +253,8 @@ static void __init xen_pv_smp_prepare_cpus(unsigned int max_cpus) · 174 unmodified lines
250253 }
251254 set_cpu_sibling_map(0);
252255
256+ speculative_store_bypass_ht_init();
257+
253258 xen_pmu_init(0);
254259
255260 if (xen_smp_intr_init(0) || xen_smp_intr_init_pv(0))
block/bio.c+0−3
@@ -1807,9 +1807,6 @@ again: · 1806 unmodified lines
18071807 if (!bio_integrity_endio(bio))
18081808 return;
18091809
1810− if (WARN_ONCE(bio->bi_next, "driver left bi_next not NULL"))
1811− bio->bi_next = NULL;
1812−
18131810 /*
18141811 * Need to have a real endio function for chained bios, otherwise
18151812 * various corner cases will break (like stacking block devices that
block/blk-core.c+5−7
@@ -273,10 +273,6 @@ static void req_bio_endio(struct request *rq, struct bio *bio, · 272 unmodified lines
273273 bio_advance(bio, nbytes);
274274
275275 /* don't actually finish bio if it's part of flush sequence */
276− /*
277− * XXX this code looks suspicious - it's not consistent with advancing
278− * req->bio in caller
279− */
280276 if (bio->bi_iter.bi_size == 0 && !(rq->rq_flags & RQF_FLUSH_SEQ))
281277 bio_endio(bio);
282278 }
@@ -3081,10 +3077,8 @@ bool blk_update_request(struct request *req, blk_status_t error, · 2798 unmodified lines
30813077 struct bio *bio = req->bio;
30823078 unsigned bio_bytes = min(bio->bi_iter.bi_size, nr_bytes);
30833079
3084− if (bio_bytes == bio->bi_iter.bi_size) {
3080+ if (bio_bytes == bio->bi_iter.bi_size)
30853081 req->bio = bio->bi_next;
3086− bio->bi_next = NULL;
3087− }
30883082
30893083 /* Completion has already been traced */
30903084 bio_clear_flag(bio, BIO_TRACE_COMPLETION);
@@ -3479,6 +3473,10 @@ static void __blk_rq_prep_clone(struct request *dst, struct request *src) · 388 unmodified lines
34793473 dst->cpu = src->cpu;
34803474 dst->__sector = blk_rq_pos(src);
34813475 dst->__data_len = blk_rq_bytes(src);
3476+ if (src->rq_flags & RQF_SPECIAL_PAYLOAD) {
3477+ dst->rq_flags |= RQF_SPECIAL_PAYLOAD;
3478+ dst->special_vec = src->special_vec;
3479+ }
34823480 dst->nr_phys_segments = src->nr_phys_segments;
34833481 dst->ioprio = src->ioprio;
34843482 dst->extra_len = src->extra_len;
block/blk-mq-debugfs.c+1−1
@@ -356,7 +356,7 @@ static const char *const blk_mq_rq_state_name_array[] = { · 355 unmodified lines
356356
357357 static const char *blk_mq_rq_state_name(enum mq_rq_state rq_state)
358358 {
359− if (WARN_ON_ONCE((unsigned int)rq_state >
359+ if (WARN_ON_ONCE((unsigned int)rq_state >=
360360 ARRAY_SIZE(blk_mq_rq_state_name_array)))
361361 return "(?)";
362362 return blk_mq_rq_state_name_array[rq_state];
block/blk-mq.c+12−1
@@ -781,7 +781,6 @@ static void blk_mq_rq_timed_out(struct request *req, bool reserved) · 780 unmodified lines
781781 WARN_ON_ONCE(ret != BLK_EH_RESET_TIMER);
782782 }
783783
784− req->rq_flags &= ~RQF_TIMED_OUT;
785784 blk_add_timer(req);
786785 }
787786
@@ -1076,6 +1075,9 @@ static bool blk_mq_mark_tag_wait(struct blk_mq_hw_ctx **hctx, · 288 unmodified lines
10761075
10771076 #define BLK_MQ_RESOURCE_DELAY 3 /* ms units */
10781077
1078+/*
1079+ * Returns true if we did some work AND can potentially do more.
1080+ */
10791081 bool blk_mq_dispatch_rq_list(struct request_queue *q, struct list_head *list,
10801082 bool got_budget)
10811083 {
@@ -1206,8 +1208,17 @@ bool blk_mq_dispatch_rq_list(struct request_queue *q, struct list_head *list, · 124 unmodified lines
12061208 blk_mq_run_hw_queue(hctx, true);
12071209 else if (needs_restart && (ret == BLK_STS_RESOURCE))
12081210 blk_mq_delay_run_hw_queue(hctx, BLK_MQ_RESOURCE_DELAY);
1211+
1212+ return false;
12091213 }
12101214
1215+ /*
1216+ * If the host/device is unable to accept more work, inform the
1217+ * caller of that.
1218+ */
1219+ if (ret == BLK_STS_RESOURCE || ret == BLK_STS_DEV_RESOURCE)
1220+ return false;
1221+
12111222 return (queued + errors) != 0;
12121223 }
12131224
block/blk-softirq.c+1−0
@@ -144,6 +144,7 @@ do_local: · 143 unmodified lines
144144
145145 local_irq_restore(flags);
146146 }
147+EXPORT_SYMBOL(__blk_complete_request);
147148
148149 /**
149150 * blk_complete_request - end I/O on a request
block/blk-timeout.c+1−0
@@ -210,6 +210,7 @@ void blk_add_timer(struct request *req) · 209 unmodified lines
210210 if (!req->timeout)
211211 req->timeout = q->rq_timeout;
212212
213+ req->rq_flags &= ~RQF_TIMED_OUT;
213214 blk_rq_set_deadline(req, jiffies + req->timeout);
214215
215216 /*
block/sed-opal.c+2−2
@@ -877,7 +877,7 @@ static size_t response_get_string(const struct parsed_resp *resp, int n, · 876 unmodified lines
877877 return 0;
878878 }
879879
880− if (n > resp->num) {
880+ if (n >= resp->num) {
881881 pr_debug("Response has %d tokens. Can't access %d\n",
882882 resp->num, n);
883883 return 0;
@@ -916,7 +916,7 @@ static u64 response_get_u64(const struct parsed_resp *resp, int n) · 32 unmodified lines
916916 return 0;
917917 }
918918
919− if (n > resp->num) {
919+ if (n >= resp->num) {
920920 pr_debug("Response has %d tokens. Can't access %d\n",
921921 resp->num, n);
922922 return 0;
certs/blacklist.h+1−1
@@ -1,3 +1,3 @@
11 #include <linux/kernel.h>
22
3−extern const char __initdata *const blacklist_hashes[];
3+extern const char __initconst *const blacklist_hashes[];
crypto/af_alg.c+10−3
@@ -1060,12 +1060,19 @@ void af_alg_async_cb(struct crypto_async_request *_req, int err) · 1059 unmodified lines
10601060 }
10611061 EXPORT_SYMBOL_GPL(af_alg_async_cb);
10621062
1063−__poll_t af_alg_poll_mask(struct socket *sock, __poll_t events)
1063+/**
1064+ * af_alg_poll - poll system call handler
1065+ */
1066+__poll_t af_alg_poll(struct file *file, struct socket *sock,
1067+ poll_table *wait)
10641068 {
10651069 struct sock *sk = sock->sk;
10661070 struct alg_sock *ask = alg_sk(sk);
10671071 struct af_alg_ctx *ctx = ask->private;
1068− __poll_t mask = 0;
1072+ __poll_t mask;
1073+
1074+ sock_poll_wait(file, sk_sleep(sk), wait);
1075+ mask = 0;
10691076
10701077 if (!ctx->more || ctx->used)
10711078 mask |= EPOLLIN | EPOLLRDNORM;
@@ -1075,7 +1082,7 @@ __poll_t af_alg_poll_mask(struct socket *sock, __poll_t events) · 3 unmodified lines
10751082
10761083 return mask;
10771084 }
1078−EXPORT_SYMBOL_GPL(af_alg_poll_mask);
1085+EXPORT_SYMBOL_GPL(af_alg_poll);
10791086
10801087 /**
10811088 * af_alg_alloc_areq - allocate struct af_alg_async_req
crypto/algif_aead.c+2−2
@@ -375,7 +375,7 @@ static struct proto_ops algif_aead_ops = { · 374 unmodified lines
375375 .sendmsg = aead_sendmsg,
376376 .sendpage = af_alg_sendpage,
377377 .recvmsg = aead_recvmsg,
378− .poll_mask = af_alg_poll_mask,
378+ .poll = af_alg_poll,
379379 };
380380
381381 static int aead_check_key(struct socket *sock)
@@ -471,7 +471,7 @@ static struct proto_ops algif_aead_ops_nokey = { · 89 unmodified lines
471471 .sendmsg = aead_sendmsg_nokey,
472472 .sendpage = aead_sendpage_nokey,
473473 .recvmsg = aead_recvmsg_nokey,
474− .poll_mask = af_alg_poll_mask,
474+ .poll = af_alg_poll,
475475 };
476476
477477 static void *aead_bind(const char *name, u32 type, u32 mask)
crypto/algif_skcipher.c+2−2
@@ -206,7 +206,7 @@ static struct proto_ops algif_skcipher_ops = { · 205 unmodified lines
206206 .sendmsg = skcipher_sendmsg,
207207 .sendpage = af_alg_sendpage,
208208 .recvmsg = skcipher_recvmsg,
209− .poll_mask = af_alg_poll_mask,
209+ .poll = af_alg_poll,
210210 };
211211
212212 static int skcipher_check_key(struct socket *sock)
@@ -302,7 +302,7 @@ static struct proto_ops algif_skcipher_ops_nokey = { · 89 unmodified lines
302302 .sendmsg = skcipher_sendmsg_nokey,
303303 .sendpage = skcipher_sendpage_nokey,
304304 .recvmsg = skcipher_recvmsg_nokey,
305− .poll_mask = af_alg_poll_mask,
305+ .poll = af_alg_poll,
306306 };
307307
308308 static void *skcipher_bind(const char *name, u32 type, u32 mask)
crypto/asymmetric_keys/x509_cert_parser.c+9−0
@@ -249,6 +249,15 @@ int x509_note_signature(void *context, size_t hdrlen, · 248 unmodified lines
249249 return -EINVAL;
250250 }
251251
252+ if (strcmp(ctx->cert->sig->pkey_algo, "rsa") == 0) {
253+ /* Discard the BIT STRING metadata */
254+ if (vlen < 1 || *(const u8 *)value != 0)
255+ return -EBADMSG;
256+
257+ value++;
258+ vlen--;
259+ }
260+
252261 ctx->cert->raw_sig = value;
253262 ctx->cert->raw_sig_size = vlen;
254263 return 0;
crypto/morus640.c+2−1
@@ -274,8 +274,9 @@ static void crypto_morus640_decrypt_chunk(struct morus640_state *state, u8 *dst, · 273 unmodified lines
274274 union morus640_block_in tail;
275275
276276 memcpy(tail.bytes, src, size);
277+ memset(tail.bytes + size, 0, MORUS640_BLOCK_SIZE - size);
277278
278− crypto_morus640_load_a(&m, src);
279+ crypto_morus640_load_a(&m, tail.bytes);
279280 crypto_morus640_core(state, &m);
280281 crypto_morus640_store_a(tail.bytes, &m);
281282 memset(tail.bytes + size, 0, MORUS640_BLOCK_SIZE - size);
crypto/sha3_generic.c+1−1
@@ -152,7 +152,7 @@ static SHA3_INLINE void keccakf_round(u64 st[25]) · 151 unmodified lines
152152 st[24] ^= bc[ 4];
153153 }
154154
155−static void __optimize("O3") keccakf(u64 st[25])
155+static void keccakf(u64 st[25])
156156 {
157157 int round;
158158
drivers/acpi/acpi_lpss.c+11−7
@@ -22,6 +22,7 @@ · 21 unmodified lines
2222 #include <linux/pm_domain.h>
2323 #include <linux/pm_runtime.h>
2424 #include <linux/pwm.h>
25+#include <linux/suspend.h>
2526 #include <linux/delay.h>
2627
2728 #include "internal.h"
@@ -946,9 +947,10 @@ static void lpss_iosf_exit_d3_state(void) · 918 unmodified lines
946947 mutex_unlock(&lpss_iosf_mutex);
947948 }
948949
949−static int acpi_lpss_suspend(struct device *dev, bool wakeup)
950+static int acpi_lpss_suspend(struct device *dev, bool runtime)
950951 {
951952 struct lpss_private_data *pdata = acpi_driver_data(ACPI_COMPANION(dev));
953+ bool wakeup = runtime || device_may_wakeup(dev);
952954 int ret;
953955
954956 if (pdata->dev_desc->flags & LPSS_SAVE_CTX)
@@ -961,13 +963,14 @@ static int acpi_lpss_suspend(struct device *dev, bool wakeup) · 6 unmodified lines
961963 * wrong status for devices being about to be powered off. See
962964 * lpss_iosf_enter_d3_state() for further information.
963965 */
964− if (lpss_quirks & LPSS_QUIRK_ALWAYS_POWER_ON && iosf_mbi_available())
966+ if ((runtime || !pm_suspend_via_firmware()) &&
967+ lpss_quirks & LPSS_QUIRK_ALWAYS_POWER_ON && iosf_mbi_available())
965968 lpss_iosf_enter_d3_state();
966969
967970 return ret;
968971 }
969972
970−static int acpi_lpss_resume(struct device *dev)
973+static int acpi_lpss_resume(struct device *dev, bool runtime)
971974 {
972975 struct lpss_private_data *pdata = acpi_driver_data(ACPI_COMPANION(dev));
973976 int ret;
@@ -976,7 +979,8 @@ static int acpi_lpss_resume(struct device *dev) · 2 unmodified lines
976979 * This call is kept first to be in symmetry with
977980 * acpi_lpss_runtime_suspend() one.
978981 */
979− if (lpss_quirks & LPSS_QUIRK_ALWAYS_POWER_ON && iosf_mbi_available())
982+ if ((runtime || !pm_resume_via_firmware()) &&
983+ lpss_quirks & LPSS_QUIRK_ALWAYS_POWER_ON && iosf_mbi_available())
980984 lpss_iosf_exit_d3_state();
981985
982986 ret = acpi_dev_resume(dev);
@@ -1000,12 +1004,12 @@ static int acpi_lpss_suspend_late(struct device *dev) · 17 unmodified lines
10001004 return 0;
10011005
10021006 ret = pm_generic_suspend_late(dev);
1003− return ret ? ret : acpi_lpss_suspend(dev, device_may_wakeup(dev));
1007+ return ret ? ret : acpi_lpss_suspend(dev, false);
10041008 }
10051009
10061010 static int acpi_lpss_resume_early(struct device *dev)
10071011 {
1008− int ret = acpi_lpss_resume(dev);
1012+ int ret = acpi_lpss_resume(dev, false);
10091013
10101014 return ret ? ret : pm_generic_resume_early(dev);
10111015 }
@@ -1020,7 +1024,7 @@ static int acpi_lpss_runtime_suspend(struct device *dev) · 8 unmodified lines
10201024
10211025 static int acpi_lpss_runtime_resume(struct device *dev)
10221026 {
1023− int ret = acpi_lpss_resume(dev);
1027+ int ret = acpi_lpss_resume(dev, true);
10241028
10251029 return ret ? ret : pm_generic_runtime_resume(dev);
10261030 }
drivers/acpi/ec.c+20−0
@@ -2037,6 +2037,17 @@ static inline void acpi_ec_query_exit(void) · 2036 unmodified lines
20372037 }
20382038 }
20392039
2040+static const struct dmi_system_id acpi_ec_no_wakeup[] = {
2041+ {
2042+ .ident = "Thinkpad X1 Carbon 6th",
2043+ .matches = {
2044+ DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
2045+ DMI_MATCH(DMI_PRODUCT_NAME, "20KGS3JF01"),
2046+ },
2047+ },
2048+ { },
2049+};
2050+
20402051 int __init acpi_ec_init(void)
20412052 {
20422053 int result;
@@ -2047,6 +2058,15 @@ int __init acpi_ec_init(void) · 4 unmodified lines
20472058 if (result)
20482059 return result;
20492060
2061+ /*
2062+ * Disable EC wakeup on following systems to prevent periodic
2063+ * wakeup from EC GPE.
2064+ */
2065+ if (dmi_check_system(acpi_ec_no_wakeup)) {
2066+ ec_no_wakeup = true;
2067+ pr_debug("Disabling EC wakeup on suspend-to-idle\n");
2068+ }
2069+
20502070 /* Drivers must be started after acpi_ec_query_init() */
20512071 dsdt_fail = acpi_bus_register_driver(&acpi_ec_driver);
20522072 /*
drivers/acpi/osl.c+72−0
@@ -45,6 +45,8 @@ · 44 unmodified lines
4545 #include <linux/uaccess.h>
4646 #include <linux/io-64-nonatomic-lo-hi.h>
4747
48+#include "acpica/accommon.h"
49+#include "acpica/acnamesp.h"
4850 #include "internal.h"
4951
5052 #define _COMPONENT ACPI_OS_SERVICES
@@ -1490,6 +1492,76 @@ int acpi_check_region(resource_size_t start, resource_size_t n, · 1439 unmodified lines
14901492 }
14911493 EXPORT_SYMBOL(acpi_check_region);
14921494
1495+static acpi_status acpi_deactivate_mem_region(acpi_handle handle, u32 level,
1496+ void *_res, void **return_value)
1497+{
1498+ struct acpi_mem_space_context **mem_ctx;
1499+ union acpi_operand_object *handler_obj;
1500+ union acpi_operand_object *region_obj2;
1501+ union acpi_operand_object *region_obj;
1502+ struct resource *res = _res;
1503+ acpi_status status;
1504+
1505+ region_obj = acpi_ns_get_attached_object(handle);
1506+ if (!region_obj)
1507+ return AE_OK;
1508+
1509+ handler_obj = region_obj->region.handler;
1510+ if (!handler_obj)
1511+ return AE_OK;
1512+
1513+ if (region_obj->region.space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY)
1514+ return AE_OK;
1515+
1516+ if (!(region_obj->region.flags & AOPOBJ_SETUP_COMPLETE))
1517+ return AE_OK;
1518+
1519+ region_obj2 = acpi_ns_get_secondary_object(region_obj);
1520+ if (!region_obj2)
1521+ return AE_OK;
1522+
1523+ mem_ctx = (void *)&region_obj2->extra.region_context;
1524+
1525+ if (!(mem_ctx[0]->address >= res->start &&
1526+ mem_ctx[0]->address < res->end))
1527+ return AE_OK;
1528+
1529+ status = handler_obj->address_space.setup(region_obj,
1530+ ACPI_REGION_DEACTIVATE,
1531+ NULL, (void **)mem_ctx);
1532+ if (ACPI_SUCCESS(status))
1533+ region_obj->region.flags &= ~(AOPOBJ_SETUP_COMPLETE);
1534+
1535+ return status;
1536+}
1537+
1538+/**
1539+ * acpi_release_memory - Release any mappings done to a memory region
1540+ * @handle: Handle to namespace node
1541+ * @res: Memory resource
1542+ * @level: A level that terminates the search
1543+ *
1544+ * Walks through @handle and unmaps all SystemMemory Operation Regions that
1545+ * overlap with @res and that have already been activated (mapped).
1546+ *
1547+ * This is a helper that allows drivers to place special requirements on memory
1548+ * region that may overlap with operation regions, primarily allowing them to
1549+ * safely map the region as non-cached memory.
1550+ *
1551+ * The unmapped Operation Regions will be automatically remapped next time they
1552+ * are called, so the drivers do not need to do anything else.
1553+ */
1554+acpi_status acpi_release_memory(acpi_handle handle, struct resource *res,
1555+ u32 level)
1556+{
1557+ if (!(res->flags & IORESOURCE_MEM))
1558+ return AE_TYPE;
1559+
1560+ return acpi_walk_namespace(ACPI_TYPE_REGION, handle, level,
1561+ acpi_deactivate_mem_region, NULL, res, NULL);
1562+}
1563+EXPORT_SYMBOL_GPL(acpi_release_memory);
1564+
14931565 /*
14941566 * Let drivers know whether the resource checks are effective
14951567 */
drivers/base/Makefile+0−3
@@ -8,10 +8,7 @@ obj-y := component.o core.o bus.o dd.o syscore.o \ · 7 unmodified lines
88 topology.o container.o property.o cacheinfo.o \
99 devcon.o
1010 obj-$(CONFIG_DEVTMPFS) += devtmpfs.o
11−obj-$(CONFIG_DMA_CMA) += dma-contiguous.o
1211 obj-y += power/
13−obj-$(CONFIG_HAS_DMA) += dma-mapping.o
14−obj-$(CONFIG_HAVE_GENERIC_DMA_COHERENT) += dma-coherent.o
1512 obj-$(CONFIG_ISA_BUS_API) += isa.o
1613 obj-y += firmware_loader/
1714 obj-$(CONFIG_NUMA) += node.o
drivers/base/core.c+11−4
@@ -236,6 +236,13 @@ struct device_link *device_link_add(struct device *consumer, · 235 unmodified lines
236236 link->rpm_active = true;
237237 }
238238 pm_runtime_new_link(consumer);
239+ /*
240+ * If the link is being added by the consumer driver at probe
241+ * time, balance the decrementation of the supplier's runtime PM
242+ * usage counter after consumer probe in driver_probe_device().
243+ */
244+ if (consumer->links.status == DL_DEV_PROBING)
245+ pm_runtime_get_noresume(supplier);
239246 }
240247 get_device(supplier);
241248 link->supplier = supplier;
@@ -255,12 +262,12 @@ struct device_link *device_link_add(struct device *consumer, · 13 unmodified lines
255262 switch (consumer->links.status) {
256263 case DL_DEV_PROBING:
257264 /*
258− * Balance the decrementation of the supplier's
259− * runtime PM usage counter after consumer probe
260− * in driver_probe_device().
265+ * Some callers expect the link creation during
266+ * consumer driver probe to resume the supplier
267+ * even without DL_FLAG_RPM_ACTIVE.
261268 */
262269 if (flags & DL_FLAG_PM_RUNTIME)
263− pm_runtime_get_sync(supplier);
270+ pm_runtime_resume(supplier);
264271
265272 link->status = DL_STATE_CONSUMER_PROBE;
266273 break;
drivers/base/power/domain.c+3−4
@@ -2487,10 +2487,9 @@ EXPORT_SYMBOL_GPL(of_genpd_parse_idle_states); · 2486 unmodified lines
24872487 * power domain corresponding to a DT node's "required-opps" property.
24882488 *
24892489 * @dev: Device for which the performance-state needs to be found.
2490− * @opp_node: DT node where the "required-opps" property is present. This can be
2490+ * @np: DT node where the "required-opps" property is present. This can be
24912491 * the device node itself (if it doesn't have an OPP table) or a node
24922492 * within the OPP table of a device (if device has an OPP table).
2493− * @state: Pointer to return performance state.
24942493 *
24952494 * Returns performance state corresponding to the "required-opps" property of
24962495 * a DT node. This calls platform specific genpd->opp_to_performance_state()
@@ -2499,7 +2498,7 @@ EXPORT_SYMBOL_GPL(of_genpd_parse_idle_states); · 2 unmodified lines
24992498 * Returns performance state on success and 0 on failure.
25002499 */
25012500 unsigned int of_genpd_opp_to_performance_state(struct device *dev,
2502− struct device_node *opp_node)
2501+ struct device_node *np)
25032502 {
25042503 struct generic_pm_domain *genpd;
25052504 struct dev_pm_opp *opp;
@@ -2514,7 +2513,7 @@ unsigned int of_genpd_opp_to_performance_state(struct device *dev, · 8 unmodified lines
25142513
25152514 genpd_lock(genpd);
25162515
2517− opp = of_dev_pm_opp_find_required_opp(&genpd->dev, opp_node);
2516+ opp = of_dev_pm_opp_find_required_opp(&genpd->dev, np);
25182517 if (IS_ERR(opp)) {
25192518 dev_err(dev, "Failed to find required OPP: %ld\n",
25202519 PTR_ERR(opp));
drivers/block/drbd/drbd_req.c+2−2
@@ -1244,8 +1244,8 @@ drbd_request_prepare(struct drbd_device *device, struct bio *bio, unsigned long · 1243 unmodified lines
12441244 _drbd_start_io_acct(device, req);
12451245
12461246 /* process discards always from our submitter thread */
1247− if ((bio_op(bio) & REQ_OP_WRITE_ZEROES) ||
1248− (bio_op(bio) & REQ_OP_DISCARD))
1247+ if (bio_op(bio) == REQ_OP_WRITE_ZEROES ||
1248+ bio_op(bio) == REQ_OP_DISCARD)
12491249 goto queue_for_submitter_thread;
12501250
12511251 if (rw == WRITE && req->private_bio && req->i.size
drivers/block/nbd.c+34−8
@@ -76,6 +76,7 @@ struct link_dead_args { · 75 unmodified lines
7676 #define NBD_HAS_CONFIG_REF 4
7777 #define NBD_BOUND 5
7878 #define NBD_DESTROY_ON_DISCONNECT 6
79+#define NBD_DISCONNECT_ON_CLOSE 7
7980
8081 struct nbd_config {
8182 u32 flags;
@@ -138,6 +139,7 @@ static void nbd_config_put(struct nbd_device *nbd); · 56 unmodified lines
138139 static void nbd_connect_reply(struct genl_info *info, int index);
139140 static int nbd_genl_status(struct sk_buff *skb, struct genl_info *info);
140141 static void nbd_dead_link_work(struct work_struct *work);
142+static void nbd_disconnect_and_put(struct nbd_device *nbd);
141143
142144 static inline struct device *nbd_to_dev(struct nbd_device *nbd)
143145 {
@@ -1305,6 +1307,12 @@ out: · 1161 unmodified lines
13051307 static void nbd_release(struct gendisk *disk, fmode_t mode)
13061308 {
13071309 struct nbd_device *nbd = disk->private_data;
1310+ struct block_device *bdev = bdget_disk(disk, 0);
1311+
1312+ if (test_bit(NBD_DISCONNECT_ON_CLOSE, &nbd->config->runtime_flags) &&
1313+ bdev->bd_openers == 0)
1314+ nbd_disconnect_and_put(nbd);
1315+
13081316 nbd_config_put(nbd);
13091317 nbd_put(nbd);
13101318 }
@@ -1705,6 +1713,10 @@ again: · 394 unmodified lines
17051713 &config->runtime_flags);
17061714 put_dev = true;
17071715 }
1716+ if (flags & NBD_CFLAG_DISCONNECT_ON_CLOSE) {
1717+ set_bit(NBD_DISCONNECT_ON_CLOSE,
1718+ &config->runtime_flags);
1719+ }
17081720 }
17091721
17101722 if (info->attrs[NBD_ATTR_SOCKETS]) {
@@ -1749,6 +1761,17 @@ out: · 38 unmodified lines
17491761 return ret;
17501762 }
17511763
1764+static void nbd_disconnect_and_put(struct nbd_device *nbd)
1765+{
1766+ mutex_lock(&nbd->config_lock);
1767+ nbd_disconnect(nbd);
1768+ nbd_clear_sock(nbd);
1769+ mutex_unlock(&nbd->config_lock);
1770+ if (test_and_clear_bit(NBD_HAS_CONFIG_REF,
1771+ &nbd->config->runtime_flags))
1772+ nbd_config_put(nbd);
1773+}
1774+
17521775 static int nbd_genl_disconnect(struct sk_buff *skb, struct genl_info *info)
17531776 {
17541777 struct nbd_device *nbd;
@@ -1781,13 +1804,7 @@ static int nbd_genl_disconnect(struct sk_buff *skb, struct genl_info *info) · 26 unmodified lines
17811804 nbd_put(nbd);
17821805 return 0;
17831806 }
1784− mutex_lock(&nbd->config_lock);
1785− nbd_disconnect(nbd);
1786− nbd_clear_sock(nbd);
1787− mutex_unlock(&nbd->config_lock);
1788− if (test_and_clear_bit(NBD_HAS_CONFIG_REF,
1789− &nbd->config->runtime_flags))
1790− nbd_config_put(nbd);
1807+ nbd_disconnect_and_put(nbd);
17911808 nbd_config_put(nbd);
17921809 nbd_put(nbd);
17931810 return 0;
@@ -1798,7 +1815,7 @@ static int nbd_genl_reconfigure(struct sk_buff *skb, struct genl_info *info) · 4 unmodified lines
17981815 struct nbd_device *nbd = NULL;
17991816 struct nbd_config *config;
18001817 int index;
1801− int ret = -EINVAL;
1818+ int ret = 0;
18021819 bool put_dev = false;
18031820
18041821 if (!netlink_capable(skb, CAP_SYS_ADMIN))
@@ -1838,6 +1855,7 @@ static int nbd_genl_reconfigure(struct sk_buff *skb, struct genl_info *info) · 33 unmodified lines
18381855 !nbd->task_recv) {
18391856 dev_err(nbd_to_dev(nbd),
18401857 "not configured, cannot reconfigure\n");
1858+ ret = -EINVAL;
18411859 goto out;
18421860 }
18431861
@@ -1862,6 +1880,14 @@ static int nbd_genl_reconfigure(struct sk_buff *skb, struct genl_info *info) · 18 unmodified lines
18621880 &config->runtime_flags))
18631881 refcount_inc(&nbd->refs);
18641882 }
1883+
1884+ if (flags & NBD_CFLAG_DISCONNECT_ON_CLOSE) {
1885+ set_bit(NBD_DISCONNECT_ON_CLOSE,
1886+ &config->runtime_flags);
1887+ } else {
1888+ clear_bit(NBD_DISCONNECT_ON_CLOSE,
1889+ &config->runtime_flags);
1890+ }
18651891 }
18661892
18671893 if (info->attrs[NBD_ATTR_SOCKETS]) {
drivers/block/null_blk.c+1−1
@@ -1365,7 +1365,7 @@ static blk_qc_t null_queue_bio(struct request_queue *q, struct bio *bio) · 1364 unmodified lines
13651365 static enum blk_eh_timer_return null_rq_timed_out_fn(struct request *rq)
13661366 {
13671367 pr_info("null: rq %p timed out\n", rq);
1368− blk_mq_complete_request(rq);
1368+ __blk_complete_request(rq);
13691369 return BLK_EH_DONE;
13701370 }
13711371
drivers/bluetooth/hci_nokia.c+1−1
@@ -29,7 +29,7 @@ · 28 unmodified lines
2929 #include <linux/slab.h>
3030 #include <linux/string.h>
3131 #include <linux/types.h>
32−#include <linux/unaligned/le_struct.h>
32+#include <asm/unaligned.h>
3333 #include <net/bluetooth/bluetooth.h>
3434 #include <net/bluetooth/hci_core.h>
3535
drivers/char/hw_random/core.c+9−2
@@ -516,11 +516,18 @@ EXPORT_SYMBOL_GPL(hwrng_register); · 515 unmodified lines
516516
517517 void hwrng_unregister(struct hwrng *rng)
518518 {
519+ int err;
520+
519521 mutex_lock(&rng_mutex);
520522
521523 list_del(&rng->list);
522− if (current_rng == rng)
523− enable_best_rng();
524+ if (current_rng == rng) {
525+ err = enable_best_rng();
526+ if (err) {
527+ drop_current_rng();
528+ cur_rng_set_by_user = 0;
529+ }
530+ }
524531
525532 if (list_empty(&rng_list)) {
526533 mutex_unlock(&rng_mutex);
drivers/char/random.c+13−16
@@ -402,7 +402,8 @@ static struct poolinfo { · 401 unmodified lines
402402 /*
403403 * Static global variables
404404 */
405−static DECLARE_WAIT_QUEUE_HEAD(random_wait);
405+static DECLARE_WAIT_QUEUE_HEAD(random_read_wait);
406+static DECLARE_WAIT_QUEUE_HEAD(random_write_wait);
406407 static struct fasync_struct *fasync;
407408
408409 static DEFINE_SPINLOCK(random_ready_list_lock);
@@ -721,8 +722,8 @@ retry: · 312 unmodified lines
721722
722723 /* should we wake readers? */
723724 if (entropy_bits >= random_read_wakeup_bits &&
724− wq_has_sleeper(&random_wait)) {
725− wake_up_interruptible_poll(&random_wait, POLLIN);
725+ wq_has_sleeper(&random_read_wait)) {
726+ wake_up_interruptible(&random_read_wait);
726727 kill_fasync(&fasync, SIGIO, POLL_IN);
727728 }
728729 /* If the input pool is getting full, send some
@@ -1396,7 +1397,7 @@ retry: · 667 unmodified lines
13961397 trace_debit_entropy(r->name, 8 * ibytes);
13971398 if (ibytes &&
13981399 (r->entropy_count >> ENTROPY_SHIFT) < random_write_wakeup_bits) {
1399− wake_up_interruptible_poll(&random_wait, POLLOUT);
1400+ wake_up_interruptible(&random_write_wait);
14001401 kill_fasync(&fasync, SIGIO, POLL_OUT);
14011402 }
14021403
@@ -1838,7 +1839,7 @@ _random_read(int nonblock, char __user *buf, size_t nbytes) · 435 unmodified lines
18381839 if (nonblock)
18391840 return -EAGAIN;
18401841
1841− wait_event_interruptible(random_wait,
1842+ wait_event_interruptible(random_read_wait,
18421843 ENTROPY_BITS(&input_pool) >=
18431844 random_read_wakeup_bits);
18441845 if (signal_pending(current))
@@ -1875,17 +1876,14 @@ urandom_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos) · 30 unmodified lines
18751876 return ret;
18761877 }
18771878
1878−static struct wait_queue_head *
1879−random_get_poll_head(struct file *file, __poll_t events)
1880−{
1881− return &random_wait;
1882−}
1883−
18841879 static __poll_t
1885−random_poll_mask(struct file *file, __poll_t events)
1880+random_poll(struct file *file, poll_table * wait)
18861881 {
1887− __poll_t mask = 0;
1882+ __poll_t mask;
18881883
1884+ poll_wait(file, &random_read_wait, wait);
1885+ poll_wait(file, &random_write_wait, wait);
1886+ mask = 0;
18891887 if (ENTROPY_BITS(&input_pool) >= random_read_wakeup_bits)
18901888 mask |= EPOLLIN | EPOLLRDNORM;
18911889 if (ENTROPY_BITS(&input_pool) < random_write_wakeup_bits)
@@ -1992,8 +1990,7 @@ static int random_fasync(int fd, struct file *filp, int on) · 100 unmodified lines
19921990 const struct file_operations random_fops = {
19931991 .read = random_read,
19941992 .write = random_write,
1995− .get_poll_head = random_get_poll_head,
1996− .poll_mask = random_poll_mask,
1993+ .poll = random_poll,
19971994 .unlocked_ioctl = random_ioctl,
19981995 .fasync = random_fasync,
19991996 .llseek = noop_llseek,
@@ -2326,7 +2323,7 @@ void add_hwgenerator_randomness(const char *buffer, size_t count, · 326 unmodified lines
23262323 * We'll be woken up again once below random_write_wakeup_thresh,
23272324 * or when the calling thread is about to terminate.
23282325 */
2329− wait_event_interruptible(random_wait, kthread_should_stop() ||
2326+ wait_event_interruptible(random_write_wait, kthread_should_stop() ||
23302327 ENTROPY_BITS(&input_pool) <= random_write_wakeup_bits);
23312328 mix_pool_bytes(poolp, buffer, count);
23322329 credit_entropy_bits(poolp, entropy);
drivers/clocksource/timer-stm32.c+3−1
@@ -304,8 +304,10 @@ static int __init stm32_timer_init(struct device_node *node) · 303 unmodified lines
304304
305305 to->private_data = kzalloc(sizeof(struct stm32_timer_private),
306306 GFP_KERNEL);
307− if (!to->private_data)
307+ if (!to->private_data) {
308+ ret = -ENOMEM;
308309 goto deinit;
310+ }
309311
310312 rstc = of_reset_control_get(node, NULL);
311313 if (!IS_ERR(rstc)) {
drivers/cpufreq/intel_pstate.c+22−5
@@ -294,6 +294,7 @@ struct pstate_funcs { · 293 unmodified lines
294294 static struct pstate_funcs pstate_funcs __read_mostly;
295295
296296 static int hwp_active __read_mostly;
297+static int hwp_mode_bdw __read_mostly;
297298 static bool per_cpu_limits __read_mostly;
298299 static bool hwp_boost __read_mostly;
299300
@@ -1413,7 +1414,15 @@ static void intel_pstate_get_cpu_pstates(struct cpudata *cpu) · 1113 unmodified lines
14131414 cpu->pstate.turbo_pstate = pstate_funcs.get_turbo();
14141415 cpu->pstate.scaling = pstate_funcs.get_scaling();
14151416 cpu->pstate.max_freq = cpu->pstate.max_pstate * cpu->pstate.scaling;
1416− cpu->pstate.turbo_freq = cpu->pstate.turbo_pstate * cpu->pstate.scaling;
1417+
1418+ if (hwp_active && !hwp_mode_bdw) {
1419+ unsigned int phy_max, current_max;
1420+
1421+ intel_pstate_get_hwp_max(cpu->cpu, &phy_max, &current_max);
1422+ cpu->pstate.turbo_freq = phy_max * cpu->pstate.scaling;
1423+ } else {
1424+ cpu->pstate.turbo_freq = cpu->pstate.turbo_pstate * cpu->pstate.scaling;
1425+ }
14171426
14181427 if (pstate_funcs.get_aperf_mperf_shift)
14191428 cpu->aperf_mperf_shift = pstate_funcs.get_aperf_mperf_shift();
@@ -2467,28 +2476,36 @@ static inline bool intel_pstate_has_acpi_ppc(void) { return false; } · 1047 unmodified lines
24672476 static inline void intel_pstate_request_control_from_smm(void) {}
24682477 #endif /* CONFIG_ACPI */
24692478
2479+#define INTEL_PSTATE_HWP_BROADWELL 0x01
2480+
2481+#define ICPU_HWP(model, hwp_mode) \
2482+ { X86_VENDOR_INTEL, 6, model, X86_FEATURE_HWP, hwp_mode }
2483+
24702484 static const struct x86_cpu_id hwp_support_ids[] __initconst = {
2471− { X86_VENDOR_INTEL, 6, X86_MODEL_ANY, X86_FEATURE_HWP },
2485+ ICPU_HWP(INTEL_FAM6_BROADWELL_X, INTEL_PSTATE_HWP_BROADWELL),
2486+ ICPU_HWP(INTEL_FAM6_BROADWELL_XEON_D, INTEL_PSTATE_HWP_BROADWELL),
2487+ ICPU_HWP(X86_MODEL_ANY, 0),
24722488 {}
24732489 };
24742490
24752491 static int __init intel_pstate_init(void)
24762492 {
2493+ const struct x86_cpu_id *id;
24772494 int rc;
24782495
24792496 if (no_load)
24802497 return -ENODEV;
24812498
2482− if (x86_match_cpu(hwp_support_ids)) {
2499+ id = x86_match_cpu(hwp_support_ids);
2500+ if (id) {
24832501 copy_cpu_funcs(&core_funcs);
24842502 if (!no_hwp) {
24852503 hwp_active++;
2504+ hwp_mode_bdw = id->driver_data;
24862505 intel_pstate.attr = hwp_cpufreq_attrs;
24872506 goto hwp_cpu_matched;
24882507 }
24892508 } else {
2490− const struct x86_cpu_id *id;
2491−
24922509 id = x86_match_cpu(intel_pstate_cpu_ids);
24932510 if (!id)
24942511 return -ENODEV;
drivers/cpufreq/qcom-cpufreq-kryo.c+26−7
@@ -42,6 +42,8 @@ enum _msm8996_version { · 41 unmodified lines
4242 NUM_OF_MSM8996_VERSIONS,
4343 };
4444
45+struct platform_device *cpufreq_dt_pdev, *kryo_cpufreq_pdev;
46+
4547 static enum _msm8996_version __init qcom_cpufreq_kryo_get_msm_id(void)
4648 {
4749 size_t len;
@@ -74,7 +76,6 @@ static enum _msm8996_version __init qcom_cpufreq_kryo_get_msm_id(void) · 26 unmodified lines
7476 static int qcom_cpufreq_kryo_probe(struct platform_device *pdev)
7577 {
7678 struct opp_table *opp_tables[NR_CPUS] = {0};
77− struct platform_device *cpufreq_dt_pdev;
7879 enum _msm8996_version msm8996_version;
7980 struct nvmem_cell *speedbin_nvmem;
8081 struct device_node *np;
@@ -86,8 +87,8 @@ static int qcom_cpufreq_kryo_probe(struct platform_device *pdev) · 5 unmodified lines
8687 int ret;
8788
8889 cpu_dev = get_cpu_device(0);
89− if (NULL == cpu_dev)
90− ret = -ENODEV;
90+ if (!cpu_dev)
91+ return -ENODEV;
9192
9293 msm8996_version = qcom_cpufreq_kryo_get_msm_id();
9394 if (NUM_OF_MSM8996_VERSIONS == msm8996_version) {
@@ -96,8 +97,8 @@ static int qcom_cpufreq_kryo_probe(struct platform_device *pdev) · 2 unmodified lines
9697 }
9798
9899 np = dev_pm_opp_of_get_opp_desc_node(cpu_dev);
99− if (IS_ERR(np))
100− return PTR_ERR(np);
100+ if (!np)
101+ return -ENOENT;
101102
102103 ret = of_device_is_compatible(np, "operating-points-v2-kryo-cpu");
103104 if (!ret) {
@@ -115,6 +116,8 @@ static int qcom_cpufreq_kryo_probe(struct platform_device *pdev) · 11 unmodified lines
115116
116117 speedbin = nvmem_cell_read(speedbin_nvmem, &len);
117118 nvmem_cell_put(speedbin_nvmem);
119+ if (IS_ERR(speedbin))
120+ return PTR_ERR(speedbin);
118121
119122 switch (msm8996_version) {
120123 case MSM8996_V3:
@@ -127,6 +130,7 @@ static int qcom_cpufreq_kryo_probe(struct platform_device *pdev) · 6 unmodified lines
127130 BUG();
128131 break;
129132 }
133+ kfree(speedbin);
130134
131135 for_each_possible_cpu(cpu) {
132136 cpu_dev = get_cpu_device(cpu);
@@ -162,8 +166,15 @@ free_opp: · 29 unmodified lines
162166 return ret;
163167 }
164168
169+static int qcom_cpufreq_kryo_remove(struct platform_device *pdev)
170+{
171+ platform_device_unregister(cpufreq_dt_pdev);
172+ return 0;
173+}
174+
165175 static struct platform_driver qcom_cpufreq_kryo_driver = {
166176 .probe = qcom_cpufreq_kryo_probe,
177+ .remove = qcom_cpufreq_kryo_remove,
167178 .driver = {
168179 .name = "qcom-cpufreq-kryo",
169180 },
@@ -198,8 +209,9 @@ static int __init qcom_cpufreq_kryo_init(void) · 28 unmodified lines
198209 if (unlikely(ret < 0))
199210 return ret;
200211
201− ret = PTR_ERR_OR_ZERO(platform_device_register_simple(
202− "qcom-cpufreq-kryo", -1, NULL, 0));
212+ kryo_cpufreq_pdev = platform_device_register_simple(
213+ "qcom-cpufreq-kryo", -1, NULL, 0);
214+ ret = PTR_ERR_OR_ZERO(kryo_cpufreq_pdev);
203215 if (0 == ret)
204216 return 0;
205217
@@ -208,5 +220,12 @@ static int __init qcom_cpufreq_kryo_init(void) · 2 unmodified lines
208220 }
209221 module_init(qcom_cpufreq_kryo_init);
210222
223+static void __init qcom_cpufreq_kryo_exit(void)
224+{
225+ platform_device_unregister(kryo_cpufreq_pdev);
226+ platform_driver_unregister(&qcom_cpufreq_kryo_driver);
227+}
228+module_exit(qcom_cpufreq_kryo_exit);
229+
211230 MODULE_DESCRIPTION("Qualcomm Technologies, Inc. Kryo CPUfreq driver");
212231 MODULE_LICENSE("GPL v2");
drivers/crypto/chelsio/chtls/chtls_io.c+2−3
@@ -1548,15 +1548,14 @@ skip_copy: · 1547 unmodified lines
15481548 tp->urg_data = 0;
15491549
15501550 if ((avail + offset) >= skb->len) {
1551− if (likely(skb))
1552− chtls_free_skb(sk, skb);
1553− buffers_freed++;
15541551 if (ULP_SKB_CB(skb)->flags & ULPCB_FLAG_TLS_HDR) {
15551552 tp->copied_seq += skb->len;
15561553 hws->rcvpld = skb->hdr_len;
15571554 } else {
15581555 tp->copied_seq += hws->rcvpld;
15591556 }
1557+ chtls_free_skb(sk, skb);
1558+ buffers_freed++;
15601559 hws->copied_seq = 0;
15611560 if (copied >= target &&
15621561 !skb_peek(&sk->sk_receive_queue))
drivers/dax/super.c+8−0
@@ -86,6 +86,7 @@ bool __bdev_dax_supported(struct block_device *bdev, int blocksize) · 85 unmodified lines
8686 {
8787 struct dax_device *dax_dev;
8888 bool dax_enabled = false;
89+ struct request_queue *q;
8990 pgoff_t pgoff;
9091 int err, id;
9192 void *kaddr;
@@ -99,6 +100,13 @@ bool __bdev_dax_supported(struct block_device *bdev, int blocksize) · 7 unmodified lines
99100 return false;
100101 }
101102
103+ q = bdev_get_queue(bdev);
104+ if (!q || !blk_queue_dax(q)) {
105+ pr_debug("%s: error: request queue doesn't support dax\n",
106+ bdevname(bdev, buf));
107+ return false;
108+ }
109+
102110 err = bdev_dax_pgoff(bdev, 0, PAGE_SIZE, &pgoff);
103111 if (err) {
104112 pr_debug("%s: error: unaligned partition for dax\n",
drivers/firmware/dmi-id.c+2−0
@@ -47,6 +47,7 @@ DEFINE_DMI_ATTR_WITH_SHOW(product_name, 0444, DMI_PRODUCT_NAME); · 46 unmodified lines
4747 DEFINE_DMI_ATTR_WITH_SHOW(product_version, 0444, DMI_PRODUCT_VERSION);
4848 DEFINE_DMI_ATTR_WITH_SHOW(product_serial, 0400, DMI_PRODUCT_SERIAL);
4949 DEFINE_DMI_ATTR_WITH_SHOW(product_uuid, 0400, DMI_PRODUCT_UUID);
50+DEFINE_DMI_ATTR_WITH_SHOW(product_sku, 0444, DMI_PRODUCT_SKU);
5051 DEFINE_DMI_ATTR_WITH_SHOW(product_family, 0444, DMI_PRODUCT_FAMILY);
5152 DEFINE_DMI_ATTR_WITH_SHOW(board_vendor, 0444, DMI_BOARD_VENDOR);
5253 DEFINE_DMI_ATTR_WITH_SHOW(board_name, 0444, DMI_BOARD_NAME);
@@ -193,6 +194,7 @@ static void __init dmi_id_init_attr_table(void) · 140 unmodified lines
193194 ADD_DMI_ATTR(product_serial, DMI_PRODUCT_SERIAL);
194195 ADD_DMI_ATTR(product_uuid, DMI_PRODUCT_UUID);
195196 ADD_DMI_ATTR(product_family, DMI_PRODUCT_FAMILY);
197+ ADD_DMI_ATTR(product_sku, DMI_PRODUCT_SKU);
196198 ADD_DMI_ATTR(board_vendor, DMI_BOARD_VENDOR);
197199 ADD_DMI_ATTR(board_name, DMI_BOARD_NAME);
198200 ADD_DMI_ATTR(board_version, DMI_BOARD_VERSION);
drivers/firmware/dmi_scan.c+1−0
@@ -447,6 +447,7 @@ static void __init dmi_decode(const struct dmi_header *dm, void *dummy) · 446 unmodified lines
447447 dmi_save_ident(dm, DMI_PRODUCT_VERSION, 6);
448448 dmi_save_ident(dm, DMI_PRODUCT_SERIAL, 7);
449449 dmi_save_uuid(dm, DMI_PRODUCT_UUID, 8);
450+ dmi_save_ident(dm, DMI_PRODUCT_SKU, 25);
450451 dmi_save_ident(dm, DMI_PRODUCT_FAMILY, 26);
451452 break;
452453 case 2: /* Base Board Information */
drivers/firmware/efi/libstub/tpm.c+1−1
@@ -64,7 +64,7 @@ static void efi_retrieve_tpm2_eventlog_1_2(efi_system_table_t *sys_table_arg) · 63 unmodified lines
6464 efi_guid_t tcg2_guid = EFI_TCG2_PROTOCOL_GUID;
6565 efi_guid_t linux_eventlog_guid = LINUX_EFI_TPM_EVENT_LOG_GUID;
6666 efi_status_t status;
67− efi_physical_addr_t log_location, log_last_entry;
67+ efi_physical_addr_t log_location = 0, log_last_entry = 0;
6868 struct linux_efi_tpm_eventlog *log_tbl = NULL;
6969 unsigned long first_entry_addr, last_entry_addr;
7070 size_t log_size, last_entry_size;
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c+9−1
@@ -2157,10 +2157,18 @@ bool amdgpu_device_asic_has_dc_support(enum amd_asic_type asic_type) · 2156 unmodified lines
21572157 switch (asic_type) {
21582158 #if defined(CONFIG_DRM_AMD_DC)
21592159 case CHIP_BONAIRE:
2160− case CHIP_HAWAII:
21612160 case CHIP_KAVERI:
21622161 case CHIP_KABINI:
21632162 case CHIP_MULLINS:
2163+ /*
2164+ * We have systems in the wild with these ASICs that require
2165+ * LVDS and VGA support which is not supported with DC.
2166+ *
2167+ * Fallback to the non-DC driver here by default so as not to
2168+ * cause regressions.
2169+ */
2170+ return amdgpu_dc > 0;
2171+ case CHIP_HAWAII:
21642172 case CHIP_CARRIZO:
21652173 case CHIP_STONEY:
21662174 case CHIP_POLARIS10:
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c+1−1
@@ -376,7 +376,7 @@ int amdgpu_fence_driver_start_ring(struct amdgpu_ring *ring, · 375 unmodified lines
376376 struct amdgpu_device *adev = ring->adev;
377377 uint64_t index;
378378
379− if (ring != &adev->uvd.inst[ring->me].ring) {
379+ if (ring->funcs->type != AMDGPU_RING_TYPE_UVD) {
380380 ring->fence_drv.cpu_addr = &adev->wb.wb[ring->fence_offs];
381381 ring->fence_drv.gpu_addr = adev->wb.gpu_addr + (ring->fence_offs * 4);
382382 } else {
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c+10−14
@@ -918,8 +918,7 @@ int amdgpu_bo_pin_restricted(struct amdgpu_bo *bo, u32 domain, · 917 unmodified lines
918918 domain = amdgpu_mem_type_to_domain(bo->tbo.mem.mem_type);
919919 if (domain == AMDGPU_GEM_DOMAIN_VRAM) {
920920 adev->vram_pin_size += amdgpu_bo_size(bo);
921− if (bo->flags & AMDGPU_GEM_CREATE_NO_CPU_ACCESS)
922− adev->invisible_pin_size += amdgpu_bo_size(bo);
921+ adev->invisible_pin_size += amdgpu_vram_mgr_bo_invisible_size(bo);
923922 } else if (domain == AMDGPU_GEM_DOMAIN_GTT) {
924923 adev->gart_pin_size += amdgpu_bo_size(bo);
925924 }
@@ -969,25 +968,22 @@ int amdgpu_bo_unpin(struct amdgpu_bo *bo) · 43 unmodified lines
969968 bo->pin_count--;
970969 if (bo->pin_count)
971970 return 0;
972− for (i = 0; i < bo->placement.num_placement; i++) {
973− bo->placements[i].lpfn = 0;
974− bo->placements[i].flags &= ~TTM_PL_FLAG_NO_EVICT;
975− }
976− r = ttm_bo_validate(&bo->tbo, &bo->placement, &ctx);
977− if (unlikely(r)) {
978− dev_err(adev->dev, "%p validate failed for unpin\n", bo);
979− goto error;
980− }
981971
982972 if (bo->tbo.mem.mem_type == TTM_PL_VRAM) {
983973 adev->vram_pin_size -= amdgpu_bo_size(bo);
984− if (bo->flags & AMDGPU_GEM_CREATE_NO_CPU_ACCESS)
985− adev->invisible_pin_size -= amdgpu_bo_size(bo);
974+ adev->invisible_pin_size -= amdgpu_vram_mgr_bo_invisible_size(bo);
986975 } else if (bo->tbo.mem.mem_type == TTM_PL_TT) {
987976 adev->gart_pin_size -= amdgpu_bo_size(bo);
988977 }
989978
990−error:
979+ for (i = 0; i < bo->placement.num_placement; i++) {
980+ bo->placements[i].lpfn = 0;
981+ bo->placements[i].flags &= ~TTM_PL_FLAG_NO_EVICT;
982+ }
983+ r = ttm_bo_validate(&bo->tbo, &bo->placement, &ctx);
984+ if (unlikely(r))
985+ dev_err(adev->dev, "%p validate failed for unpin\n", bo);
986+
991987 return r;
992988 }
993989
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h+1−0
@@ -73,6 +73,7 @@ bool amdgpu_gtt_mgr_has_gart_addr(struct ttm_mem_reg *mem); · 72 unmodified lines
7373 uint64_t amdgpu_gtt_mgr_usage(struct ttm_mem_type_manager *man);
7474 int amdgpu_gtt_mgr_recover(struct ttm_mem_type_manager *man);
7575
76+u64 amdgpu_vram_mgr_bo_invisible_size(struct amdgpu_bo *bo);
7677 uint64_t amdgpu_vram_mgr_usage(struct ttm_mem_type_manager *man);
7778 uint64_t amdgpu_vram_mgr_vis_usage(struct ttm_mem_type_manager *man);
7879
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c+7−7
@@ -130,7 +130,7 @@ int amdgpu_uvd_sw_init(struct amdgpu_device *adev) · 129 unmodified lines
130130 unsigned family_id;
131131 int i, j, r;
132132
133− INIT_DELAYED_WORK(&adev->uvd.inst->idle_work, amdgpu_uvd_idle_work_handler);
133+ INIT_DELAYED_WORK(&adev->uvd.idle_work, amdgpu_uvd_idle_work_handler);
134134
135135 switch (adev->asic_type) {
136136 #ifdef CONFIG_DRM_AMDGPU_CIK
@@ -331,12 +331,12 @@ int amdgpu_uvd_suspend(struct amdgpu_device *adev) · 194 unmodified lines
331331 void *ptr;
332332 int i, j;
333333
334+ cancel_delayed_work_sync(&adev->uvd.idle_work);
335+
334336 for (j = 0; j < adev->uvd.num_uvd_inst; ++j) {
335337 if (adev->uvd.inst[j].vcpu_bo == NULL)
336338 continue;
337339
338− cancel_delayed_work_sync(&adev->uvd.inst[j].idle_work);
339−
340340 /* only valid for physical mode */
341341 if (adev->asic_type < CHIP_POLARIS10) {
342342 for (i = 0; i < adev->uvd.max_handles; ++i)
@@ -1162,7 +1162,7 @@ int amdgpu_uvd_get_destroy_msg(struct amdgpu_ring *ring, uint32_t handle, · 819 unmodified lines
11621162 static void amdgpu_uvd_idle_work_handler(struct work_struct *work)
11631163 {
11641164 struct amdgpu_device *adev =
1165− container_of(work, struct amdgpu_device, uvd.inst->idle_work.work);
1165+ container_of(work, struct amdgpu_device, uvd.idle_work.work);
11661166 unsigned fences = 0, i, j;
11671167
11681168 for (i = 0; i < adev->uvd.num_uvd_inst; ++i) {
@@ -1184,7 +1184,7 @@ static void amdgpu_uvd_idle_work_handler(struct work_struct *work) · 15 unmodified lines
11841184 AMD_CG_STATE_GATE);
11851185 }
11861186 } else {
1187− schedule_delayed_work(&adev->uvd.inst->idle_work, UVD_IDLE_TIMEOUT);
1187+ schedule_delayed_work(&adev->uvd.idle_work, UVD_IDLE_TIMEOUT);
11881188 }
11891189 }
11901190
@@ -1196,7 +1196,7 @@ void amdgpu_uvd_ring_begin_use(struct amdgpu_ring *ring) · 5 unmodified lines
11961196 if (amdgpu_sriov_vf(adev))
11971197 return;
11981198
1199− set_clocks = !cancel_delayed_work_sync(&adev->uvd.inst->idle_work);
1199+ set_clocks = !cancel_delayed_work_sync(&adev->uvd.idle_work);
12001200 if (set_clocks) {
12011201 if (adev->pm.dpm_enabled) {
12021202 amdgpu_dpm_enable_uvd(adev, true);
@@ -1213,7 +1213,7 @@ void amdgpu_uvd_ring_begin_use(struct amdgpu_ring *ring) · 10 unmodified lines
12131213 void amdgpu_uvd_ring_end_use(struct amdgpu_ring *ring)
12141214 {
12151215 if (!amdgpu_sriov_vf(ring->adev))
1216− schedule_delayed_work(&ring->adev->uvd.inst->idle_work, UVD_IDLE_TIMEOUT);
1216+ schedule_delayed_work(&ring->adev->uvd.idle_work, UVD_IDLE_TIMEOUT);
12171217 }
12181218
12191219 /**
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.h+1−1
@@ -44,7 +44,6 @@ struct amdgpu_uvd_inst { · 43 unmodified lines
4444 void *saved_bo;
4545 atomic_t handles[AMDGPU_MAX_UVD_HANDLES];
4646 struct drm_file *filp[AMDGPU_MAX_UVD_HANDLES];
47− struct delayed_work idle_work;
4847 struct amdgpu_ring ring;
4948 struct amdgpu_ring ring_enc[AMDGPU_MAX_UVD_ENC_RINGS];
5049 struct amdgpu_irq_src irq;
@@ -62,6 +61,7 @@ struct amdgpu_uvd { · 11 unmodified lines
6261 bool address_64_bit;
6362 bool use_ctx_buf;
6463 struct amdgpu_uvd_inst inst[AMDGPU_MAX_UVD_INSTANCES];
64+ struct delayed_work idle_work;
6565 };
6666
6767 int amdgpu_uvd_sw_init(struct amdgpu_device *adev);
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c+27−6
@@ -52,7 +52,7 @@ int amdgpu_vcn_sw_init(struct amdgpu_device *adev) · 51 unmodified lines
5252 unsigned long bo_size;
5353 const char *fw_name;
5454 const struct common_firmware_header *hdr;
55− unsigned version_major, version_minor, family_id;
55+ unsigned char fw_check;
5656 int r;
5757
5858 INIT_DELAYED_WORK(&adev->vcn.idle_work, amdgpu_vcn_idle_work_handler);
@@ -83,12 +83,33 @@ int amdgpu_vcn_sw_init(struct amdgpu_device *adev) · 24 unmodified lines
8383
8484 hdr = (const struct common_firmware_header *)adev->vcn.fw->data;
8585 adev->vcn.fw_version = le32_to_cpu(hdr->ucode_version);
86− family_id = le32_to_cpu(hdr->ucode_version) & 0xff;
87− version_major = (le32_to_cpu(hdr->ucode_version) >> 24) & 0xff;
88− version_minor = (le32_to_cpu(hdr->ucode_version) >> 8) & 0xff;
89− DRM_INFO("Found VCN firmware Version: %hu.%hu Family ID: %hu\n",
90− version_major, version_minor, family_id);
9186
87+ /* Bit 20-23, it is encode major and non-zero for new naming convention.
88+ * This field is part of version minor and DRM_DISABLED_FLAG in old naming
89+ * convention. Since the l:wq!atest version minor is 0x5B and DRM_DISABLED_FLAG
90+ * is zero in old naming convention, this field is always zero so far.
91+ * These four bits are used to tell which naming convention is present.
92+ */
93+ fw_check = (le32_to_cpu(hdr->ucode_version) >> 20) & 0xf;
94+ if (fw_check) {
95+ unsigned int dec_ver, enc_major, enc_minor, vep, fw_rev;
96+
97+ fw_rev = le32_to_cpu(hdr->ucode_version) & 0xfff;
98+ enc_minor = (le32_to_cpu(hdr->ucode_version) >> 12) & 0xff;
99+ enc_major = fw_check;
100+ dec_ver = (le32_to_cpu(hdr->ucode_version) >> 24) & 0xf;
101+ vep = (le32_to_cpu(hdr->ucode_version) >> 28) & 0xf;
102+ DRM_INFO("Found VCN firmware Version ENC: %hu.%hu DEC: %hu VEP: %hu Revision: %hu\n",
103+ enc_major, enc_minor, dec_ver, vep, fw_rev);
104+ } else {
105+ unsigned int version_major, version_minor, family_id;
106+
107+ family_id = le32_to_cpu(hdr->ucode_version) & 0xff;
108+ version_major = (le32_to_cpu(hdr->ucode_version) >> 24) & 0xff;
109+ version_minor = (le32_to_cpu(hdr->ucode_version) >> 8) & 0xff;
110+ DRM_INFO("Found VCN firmware Version: %hu.%hu Family ID: %hu\n",
111+ version_major, version_minor, family_id);
112+ }
92113
93114 bo_size = AMDGPU_GPU_PAGE_ALIGN(le32_to_cpu(hdr->ucode_size_bytes) + 8)
94115 + AMDGPU_VCN_STACK_SIZE + AMDGPU_VCN_HEAP_SIZE
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c+5−3
@@ -1577,7 +1577,9 @@ static int amdgpu_vm_bo_split_mapping(struct amdgpu_device *adev, · 1576 unmodified lines
15771577 uint64_t count;
15781578
15791579 max_entries = min(max_entries, 16ull * 1024ull);
1580− for (count = 1; count < max_entries; ++count) {
1580+ for (count = 1;
1581+ count < max_entries / (PAGE_SIZE / AMDGPU_GPU_PAGE_SIZE);
1582+ ++count) {
15811583 uint64_t idx = pfn + count;
15821584
15831585 if (pages_addr[idx] !=
@@ -1590,7 +1592,7 @@ static int amdgpu_vm_bo_split_mapping(struct amdgpu_device *adev, · 6 unmodified lines
15901592 dma_addr = pages_addr;
15911593 } else {
15921594 addr = pages_addr[pfn];
1593− max_entries = count;
1595+ max_entries = count * (PAGE_SIZE / AMDGPU_GPU_PAGE_SIZE);
15941596 }
15951597
15961598 } else if (flags & AMDGPU_PTE_VALID) {
@@ -1605,7 +1607,7 @@ static int amdgpu_vm_bo_split_mapping(struct amdgpu_device *adev, · 8 unmodified lines
16051607 if (r)
16061608 return r;
16071609
1608− pfn += last - start + 1;
1610+ pfn += (last - start + 1) / (PAGE_SIZE / AMDGPU_GPU_PAGE_SIZE);
16091611 if (nodes && nodes->size == pfn) {
16101612 pfn = 0;
16111613 ++nodes;
drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c+36−3
@@ -96,6 +96,38 @@ static u64 amdgpu_vram_mgr_vis_size(struct amdgpu_device *adev, · 95 unmodified lines
9696 adev->gmc.visible_vram_size : end) - start;
9797 }
9898
99+/**
100+ * amdgpu_vram_mgr_bo_invisible_size - CPU invisible BO size
101+ *
102+ * @bo: &amdgpu_bo buffer object (must be in VRAM)
103+ *
104+ * Returns:
105+ * How much of the given &amdgpu_bo buffer object lies in CPU invisible VRAM.
106+ */
107+u64 amdgpu_vram_mgr_bo_invisible_size(struct amdgpu_bo *bo)
108+{
109+ struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev);
110+ struct ttm_mem_reg *mem = &bo->tbo.mem;
111+ struct drm_mm_node *nodes = mem->mm_node;
112+ unsigned pages = mem->num_pages;
113+ u64 usage = 0;
114+
115+ if (adev->gmc.visible_vram_size == adev->gmc.real_vram_size)
116+ return 0;
117+
118+ if (mem->start >= adev->gmc.visible_vram_size >> PAGE_SHIFT)
119+ return amdgpu_bo_size(bo);
120+
121+ while (nodes && pages) {
122+ usage += nodes->size << PAGE_SHIFT;
123+ usage -= amdgpu_vram_mgr_vis_size(adev, nodes);
124+ pages -= nodes->size;
125+ ++nodes;
126+ }
127+
128+ return usage;
129+}
130+
99131 /**
100132 * amdgpu_vram_mgr_new - allocate new ranges
101133 *
@@ -135,7 +167,8 @@ static int amdgpu_vram_mgr_new(struct ttm_mem_type_manager *man, · 33 unmodified lines
135167 num_nodes = DIV_ROUND_UP(mem->num_pages, pages_per_node);
136168 }
137169
138− nodes = kcalloc(num_nodes, sizeof(*nodes), GFP_KERNEL);
170+ nodes = kvmalloc_array(num_nodes, sizeof(*nodes),
171+ GFP_KERNEL | __GFP_ZERO);
139172 if (!nodes)
140173 return -ENOMEM;
141174
@@ -190,7 +223,7 @@ error: · 48 unmodified lines
190223 drm_mm_remove_node(&nodes[i]);
191224 spin_unlock(&mgr->lock);
192225
193− kfree(nodes);
226+ kvfree(nodes);
194227 return r == -ENOSPC ? 0 : r;
195228 }
196229
@@ -229,7 +262,7 @@ static void amdgpu_vram_mgr_del(struct ttm_mem_type_manager *man, · 32 unmodified lines
229262 atomic64_sub(usage, &mgr->usage);
230263 atomic64_sub(vis_usage, &mgr->vis_usage);
231264
232− kfree(mem->mm_node);
265+ kvfree(mem->mm_node);
233266 mem->mm_node = NULL;
234267 }
235268
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c+8−8
@@ -3927,10 +3927,11 @@ static void amdgpu_dm_do_flip(struct drm_crtc *crtc, · 3926 unmodified lines
39273927 if (acrtc->base.state->event)
39283928 prepare_flip_isr(acrtc);
39293929
3930+ spin_unlock_irqrestore(&crtc->dev->event_lock, flags);
3931+
39303932 surface_updates->surface = dc_stream_get_status(acrtc_state->stream)->plane_states[0];
39313933 surface_updates->flip_addr = &addr;
39323934
3933−
39343935 dc_commit_updates_for_stream(adev->dm.dc,
39353936 surface_updates,
39363937 1,
@@ -3943,9 +3944,6 @@ static void amdgpu_dm_do_flip(struct drm_crtc *crtc, · 6 unmodified lines
39433944 __func__,
39443945 addr.address.grph.addr.high_part,
39453946 addr.address.grph.addr.low_part);
3946−
3947−
3948− spin_unlock_irqrestore(&crtc->dev->event_lock, flags);
39493947 }
39503948
39513949 /*
@@ -4205,6 +4203,7 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) · 253 unmodified lines
42054203 struct drm_connector *connector;
42064204 struct drm_connector_state *old_con_state, *new_con_state;
42074205 struct dm_crtc_state *dm_old_crtc_state, *dm_new_crtc_state;
4206+ int crtc_disable_count = 0;
42084207
42094208 drm_atomic_helper_update_legacy_modeset_state(dev, state);
42104209
@@ -4409,6 +4408,9 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) · 198 unmodified lines
44094408 struct amdgpu_crtc *acrtc = to_amdgpu_crtc(crtc);
44104409 bool modeset_needed;
44114410
4411+ if (old_crtc_state->active && !new_crtc_state->active)
4412+ crtc_disable_count++;
4413+
44124414 dm_new_crtc_state = to_dm_crtc_state(new_crtc_state);
44134415 dm_old_crtc_state = to_dm_crtc_state(old_crtc_state);
44144416 modeset_needed = modeset_required(
@@ -4462,11 +4464,9 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) · 47 unmodified lines
44624464 * so we can put the GPU into runtime suspend if we're not driving any
44634465 * displays anymore
44644466 */
4467+ for (i = 0; i < crtc_disable_count; i++)
4468+ pm_runtime_put_autosuspend(dev->dev);
44654469 pm_runtime_mark_last_busy(dev->dev);
4466− for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) {
4467− if (old_crtc_state->active && !new_crtc_state->active)
4468− pm_runtime_put_autosuspend(dev->dev);
4469− }
44704470 }
44714471
44724472
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_powertune.c+1−1
@@ -1090,7 +1090,7 @@ static int vega10_disable_se_edc_config(struct pp_hwmgr *hwmgr) · 1089 unmodified lines
10901090 static int vega10_enable_psm_gc_edc_config(struct pp_hwmgr *hwmgr)
10911091 {
10921092 struct amdgpu_device *adev = hwmgr->adev;
1093− int result;
1093+ int result = 0;
10941094 uint32_t num_se = 0;
10951095 uint32_t count, data;
10961096
drivers/gpu/drm/arm/malidp_drv.c+2−1
@@ -278,7 +278,6 @@ static int malidp_init(struct drm_device *drm) · 277 unmodified lines
278278
279279 static void malidp_fini(struct drm_device *drm)
280280 {
281− drm_atomic_helper_shutdown(drm);
282281 drm_mode_config_cleanup(drm);
283282 }
284283
@@ -646,6 +645,7 @@ vblank_fail: · 361 unmodified lines
646645 malidp_de_irq_fini(drm);
647646 drm->irq_enabled = false;
648647 irq_init_fail:
648+ drm_atomic_helper_shutdown(drm);
649649 component_unbind_all(dev, drm);
650650 bind_fail:
651651 of_node_put(malidp->crtc.port);
@@ -681,6 +681,7 @@ static void malidp_unbind(struct device *dev) · 29 unmodified lines
681681 malidp_se_irq_fini(drm);
682682 malidp_de_irq_fini(drm);
683683 drm->irq_enabled = false;
684+ drm_atomic_helper_shutdown(drm);
684685 component_unbind_all(dev, drm);
685686 of_node_put(malidp->crtc.port);
686687 malidp->crtc.port = NULL;
drivers/gpu/drm/arm/malidp_hw.c+2−1
@@ -634,7 +634,8 @@ const struct malidp_hw malidp_device[MALIDP_MAX_DEVICES] = { · 633 unmodified lines
634634 .vsync_irq = MALIDP500_DE_IRQ_VSYNC,
635635 },
636636 .se_irq_map = {
637− .irq_mask = MALIDP500_SE_IRQ_CONF_MODE,
637+ .irq_mask = MALIDP500_SE_IRQ_CONF_MODE |
638+ MALIDP500_SE_IRQ_GLOBAL,
638639 .vsync_irq = 0,
639640 },
640641 .dc_irq_map = {
drivers/gpu/drm/arm/malidp_planes.c+6−3
@@ -23,6 +23,7 @@ · 22 unmodified lines
2323
2424 /* Layer specific register offsets */
2525 #define MALIDP_LAYER_FORMAT 0x000
26+#define LAYER_FORMAT_MASK 0x3f
2627 #define MALIDP_LAYER_CONTROL 0x004
2728 #define LAYER_ENABLE (1 << 0)
2829 #define LAYER_FLOWCFG_MASK 7
@@ -235,8 +236,8 @@ static int malidp_de_plane_check(struct drm_plane *plane, · 206 unmodified lines
235236 if (state->rotation & MALIDP_ROTATED_MASK) {
236237 int val;
237238
238− val = mp->hwdev->hw->rotmem_required(mp->hwdev, state->crtc_h,
239− state->crtc_w,
239+ val = mp->hwdev->hw->rotmem_required(mp->hwdev, state->crtc_w,
240+ state->crtc_h,
240241 fb->format->format);
241242 if (val < 0)
242243 return val;
@@ -337,7 +338,9 @@ static void malidp_de_plane_update(struct drm_plane *plane, · 94 unmodified lines
337338 dest_w = plane->state->crtc_w;
338339 dest_h = plane->state->crtc_h;
339340
340− malidp_hw_write(mp->hwdev, ms->format, mp->layer->base);
341+ val = malidp_hw_read(mp->hwdev, mp->layer->base);
342+ val = (val & ~LAYER_FORMAT_MASK) | ms->format;
343+ malidp_hw_write(mp->hwdev, val, mp->layer->base);
341344
342345 for (i = 0; i < ms->n_planes; i++) {
343346 /* calculate the offset for the layer's plane registers */
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c+1−1
@@ -830,7 +830,7 @@ static int atmel_hlcdc_plane_init_properties(struct atmel_hlcdc_plane *plane) · 829 unmodified lines
830830 return ret;
831831 }
832832
833− if (desc->layout.xstride && desc->layout.pstride) {
833+ if (desc->layout.xstride[0] && desc->layout.pstride[0]) {
834834 int ret;
835835
836836 ret = drm_plane_create_rotation_property(&plane->base,
drivers/gpu/drm/bridge/sil-sii8620.c+117−192
@@ -36,8 +36,11 @@ · 35 unmodified lines
3636
3737 #define SII8620_BURST_BUF_LEN 288
3838 #define VAL_RX_HDMI_CTRL2_DEFVAL VAL_RX_HDMI_CTRL2_IDLE_CNT(3)
39−#define MHL1_MAX_LCLK 225000
40−#define MHL3_MAX_LCLK 600000
39+
40+#define MHL1_MAX_PCLK 75000
41+#define MHL1_MAX_PCLK_PP_MODE 150000
42+#define MHL3_MAX_PCLK 200000
43+#define MHL3_MAX_PCLK_PP_MODE 300000
4144
4245 enum sii8620_mode {
4346 CM_DISCONNECTED,
@@ -80,6 +83,9 @@ struct sii8620 { · 36 unmodified lines
8083 u8 devcap[MHL_DCAP_SIZE];
8184 u8 xdevcap[MHL_XDC_SIZE];
8285 u8 avif[HDMI_INFOFRAME_SIZE(AVI)];
86+ bool feature_complete;
87+ bool devcap_read;
88+ bool sink_detected;
8389 struct edid *edid;
8490 unsigned int gen2_write_burst:1;
8591 enum sii8620_mt_state mt_state;
@@ -476,7 +482,7 @@ static void sii8620_update_array(u8 *dst, u8 *src, int count) · 390 unmodified lines
476482 }
477483 }
478484
479−static void sii8620_sink_detected(struct sii8620 *ctx, int ret)
485+static void sii8620_identify_sink(struct sii8620 *ctx)
480486 {
481487 static const char * const sink_str[] = {
482488 [SINK_NONE] = "NONE",
@@ -487,7 +493,7 @@ static void sii8620_sink_detected(struct sii8620 *ctx, int ret) · 4 unmodified lines
487493 char sink_name[20];
488494 struct device *dev = ctx->dev;
489495
490− if (ret < 0)
496+ if (!ctx->sink_detected || !ctx->devcap_read)
491497 return;
492498
493499 sii8620_fetch_edid(ctx);
@@ -496,6 +502,7 @@ static void sii8620_sink_detected(struct sii8620 *ctx, int ret) · 2 unmodified lines
496502 sii8620_mhl_disconnected(ctx);
497503 return;
498504 }
505+ sii8620_set_upstream_edid(ctx);
499506
500507 if (drm_detect_hdmi_monitor(ctx->edid))
501508 ctx->sink_type = SINK_HDMI;
@@ -508,53 +515,6 @@ static void sii8620_sink_detected(struct sii8620 *ctx, int ret) · 6 unmodified lines
508515 sink_str[ctx->sink_type], sink_name);
509516 }
510517
511−static void sii8620_hsic_init(struct sii8620 *ctx)
512−{
513− if (!sii8620_is_mhl3(ctx))
514− return;
515−
516− sii8620_write(ctx, REG_FCGC,
517− BIT_FCGC_HSIC_HOSTMODE | BIT_FCGC_HSIC_ENABLE);
518− sii8620_setbits(ctx, REG_HRXCTRL3,
519− BIT_HRXCTRL3_HRX_STAY_RESET | BIT_HRXCTRL3_STATUS_EN, ~0);
520− sii8620_setbits(ctx, REG_TTXNUMB, MSK_TTXNUMB_TTX_NUMBPS, 4);
521− sii8620_setbits(ctx, REG_TRXCTRL, BIT_TRXCTRL_TRX_FROM_SE_COC, ~0);
522− sii8620_setbits(ctx, REG_HTXCTRL, BIT_HTXCTRL_HTX_DRVCONN1, 0);
523− sii8620_setbits(ctx, REG_KEEPER, MSK_KEEPER_MODE, VAL_KEEPER_MODE_HOST);
524− sii8620_write_seq_static(ctx,
525− REG_TDMLLCTL, 0,
526− REG_UTSRST, BIT_UTSRST_HRX_SRST | BIT_UTSRST_HTX_SRST |
527− BIT_UTSRST_KEEPER_SRST | BIT_UTSRST_FC_SRST,
528− REG_UTSRST, BIT_UTSRST_HRX_SRST | BIT_UTSRST_HTX_SRST,
529− REG_HRXINTL, 0xff,
530− REG_HRXINTH, 0xff,
531− REG_TTXINTL, 0xff,
532− REG_TTXINTH, 0xff,
533− REG_TRXINTL, 0xff,
534− REG_TRXINTH, 0xff,
535− REG_HTXINTL, 0xff,
536− REG_HTXINTH, 0xff,
537− REG_FCINTR0, 0xff,
538− REG_FCINTR1, 0xff,
539− REG_FCINTR2, 0xff,
540− REG_FCINTR3, 0xff,
541− REG_FCINTR4, 0xff,
542− REG_FCINTR5, 0xff,
543− REG_FCINTR6, 0xff,
544− REG_FCINTR7, 0xff
545− );
546−}
547−
548−static void sii8620_edid_read(struct sii8620 *ctx, int ret)
549−{
550− if (ret < 0)
551− return;
552−
553− sii8620_set_upstream_edid(ctx);
554− sii8620_hsic_init(ctx);
555− sii8620_enable_hpd(ctx);
556−}
557−
558518 static void sii8620_mr_devcap(struct sii8620 *ctx)
559519 {
560520 u8 dcap[MHL_DCAP_SIZE];
@@ -570,6 +530,8 @@ static void sii8620_mr_devcap(struct sii8620 *ctx) · 9 unmodified lines
570530 dcap[MHL_DCAP_ADOPTER_ID_H], dcap[MHL_DCAP_ADOPTER_ID_L],
571531 dcap[MHL_DCAP_DEVICE_ID_H], dcap[MHL_DCAP_DEVICE_ID_L]);
572532 sii8620_update_array(ctx->devcap, dcap, MHL_DCAP_SIZE);
533+ ctx->devcap_read = true;
534+ sii8620_identify_sink(ctx);
573535 }
574536
575537 static void sii8620_mr_xdevcap(struct sii8620 *ctx)
@@ -807,6 +769,7 @@ static void sii8620_burst_rx_all(struct sii8620 *ctx) · 231 unmodified lines
807769 static void sii8620_fetch_edid(struct sii8620 *ctx)
808770 {
809771 u8 lm_ddc, ddc_cmd, int3, cbus;
772+ unsigned long timeout;
810773 int fetched, i;
811774 int edid_len = EDID_LENGTH;
812775 u8 *edid;
@@ -856,23 +819,31 @@ static void sii8620_fetch_edid(struct sii8620 *ctx) · 43 unmodified lines
856819 REG_DDC_CMD, ddc_cmd | VAL_DDC_CMD_ENH_DDC_READ_NO_ACK
857820 );
858821
859− do {
860− int3 = sii8620_readb(ctx, REG_INTR3);
822+ int3 = 0;
823+ timeout = jiffies + msecs_to_jiffies(200);
824+ for (;;) {
861825 cbus = sii8620_readb(ctx, REG_CBUS_STATUS);
862−
863− if (int3 & BIT_DDC_CMD_DONE)
864− break;
865−
866− if (!(cbus & BIT_CBUS_STATUS_CBUS_CONNECTED)) {
826+ if (~cbus & BIT_CBUS_STATUS_CBUS_CONNECTED) {
827+ kfree(edid);
828+ edid = NULL;
829+ goto end;
830+ }
831+ if (int3 & BIT_DDC_CMD_DONE) {
832+ if (sii8620_readb(ctx, REG_DDC_DOUT_CNT)
833+ >= FETCH_SIZE)
834+ break;
835+ } else {
836+ int3 = sii8620_readb(ctx, REG_INTR3);
837+ }
838+ if (time_is_before_jiffies(timeout)) {
839+ ctx->error = -ETIMEDOUT;
840+ dev_err(ctx->dev, "timeout during EDID read\n");
867841 kfree(edid);
868842 edid = NULL;
869843 goto end;
870844 }
871− } while (1);
872−
873− sii8620_readb(ctx, REG_DDC_STATUS);
874− while (sii8620_readb(ctx, REG_DDC_DOUT_CNT) < FETCH_SIZE)
875845 usleep_range(10, 20);
846+ }
876847
877848 sii8620_read_buf(ctx, REG_DDC_DATA, edid + fetched, FETCH_SIZE);
878849 if (fetched + FETCH_SIZE == EDID_LENGTH) {
@@ -971,8 +942,17 @@ static int sii8620_hw_on(struct sii8620 *ctx) · 92 unmodified lines
971942 ret = regulator_bulk_enable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
972943 if (ret)
973944 return ret;
945+
974946 usleep_range(10000, 20000);
975− return clk_prepare_enable(ctx->clk_xtal);
947+ ret = clk_prepare_enable(ctx->clk_xtal);
948+ if (ret)
949+ return ret;
950+
951+ msleep(100);
952+ gpiod_set_value(ctx->gpio_reset, 0);
953+ msleep(100);
954+
955+ return 0;
976956 }
977957
978958 static int sii8620_hw_off(struct sii8620 *ctx)
@@ -982,17 +962,6 @@ static int sii8620_hw_off(struct sii8620 *ctx) · 3 unmodified lines
982962 return regulator_bulk_disable(ARRAY_SIZE(ctx->supplies), ctx->supplies);
983963 }
984964
985−static void sii8620_hw_reset(struct sii8620 *ctx)
986−{
987− usleep_range(10000, 20000);
988− gpiod_set_value(ctx->gpio_reset, 0);
989− usleep_range(5000, 20000);
990− gpiod_set_value(ctx->gpio_reset, 1);
991− usleep_range(10000, 20000);
992− gpiod_set_value(ctx->gpio_reset, 0);
993− msleep(300);
994−}
995−
996965 static void sii8620_cbus_reset(struct sii8620 *ctx)
997966 {
998967 sii8620_write(ctx, REG_PWD_SRST, BIT_PWD_SRST_CBUS_RST
@@ -1048,20 +1017,11 @@ static void sii8620_stop_video(struct sii8620 *ctx) · 49 unmodified lines
10481017
10491018 static void sii8620_set_format(struct sii8620 *ctx)
10501019 {
1051− u8 out_fmt;
1052−
10531020 if (sii8620_is_mhl3(ctx)) {
10541021 sii8620_setbits(ctx, REG_M3_P0CTRL,
10551022 BIT_M3_P0CTRL_MHL3_P0_PIXEL_MODE_PACKED,
10561023 ctx->use_packed_pixel ? ~0 : 0);
10571024 } else {
1058− if (ctx->use_packed_pixel)
1059− sii8620_write_seq_static(ctx,
1060− REG_VID_MODE, BIT_VID_MODE_M1080P,
1061− REG_MHL_TOP_CTL, BIT_MHL_TOP_CTL_MHL_PP_SEL | 1,
1062− REG_MHLTX_CTL6, 0x60
1063− );
1064− else
10651025 sii8620_write_seq_static(ctx,
10661026 REG_VID_MODE, 0,
10671027 REG_MHL_TOP_CTL, 1,
@@ -1069,15 +1029,9 @@ static void sii8620_set_format(struct sii8620 *ctx) · 1 unmodified line
10691029 );
10701030 }
10711031
1072− if (ctx->use_packed_pixel)
1073− out_fmt = VAL_TPI_FORMAT(YCBCR422, FULL) |
1074− BIT_TPI_OUTPUT_CSCMODE709;
1075− else
1076− out_fmt = VAL_TPI_FORMAT(RGB, FULL);
1077−
10781032 sii8620_write_seq(ctx,
10791033 REG_TPI_INPUT, VAL_TPI_FORMAT(RGB, FULL),
1080− REG_TPI_OUTPUT, out_fmt,
1034+ REG_TPI_OUTPUT, VAL_TPI_FORMAT(RGB, FULL),
10811035 );
10821036 }
10831037
@@ -1216,7 +1170,7 @@ static void sii8620_start_video(struct sii8620 *ctx) · 132 unmodified lines
12161170 int clk = ctx->pixel_clock * (ctx->use_packed_pixel ? 2 : 3);
12171171 int i;
12181172
1219− for (i = 0; i < ARRAY_SIZE(clk_spec); ++i)
1173+ for (i = 0; i < ARRAY_SIZE(clk_spec) - 1; ++i)
12201174 if (clk < clk_spec[i].max_clk)
12211175 break;
12221176
@@ -1534,6 +1488,16 @@ static void sii8620_set_mode(struct sii8620 *ctx, enum sii8620_mode mode) · 311 unmodified lines
15341488 );
15351489 }
15361490
1491+static void sii8620_hpd_unplugged(struct sii8620 *ctx)
1492+{
1493+ sii8620_disable_hpd(ctx);
1494+ ctx->sink_type = SINK_NONE;
1495+ ctx->sink_detected = false;
1496+ ctx->feature_complete = false;
1497+ kfree(ctx->edid);
1498+ ctx->edid = NULL;
1499+}
1500+
15371501 static void sii8620_disconnect(struct sii8620 *ctx)
15381502 {
15391503 sii8620_disable_gen2_write_burst(ctx);
@@ -1561,7 +1525,7 @@ static void sii8620_disconnect(struct sii8620 *ctx) · 21 unmodified lines
15611525 REG_MHL_DP_CTL6, 0x2A,
15621526 REG_MHL_DP_CTL7, 0x03
15631527 );
1564− sii8620_disable_hpd(ctx);
1528+ sii8620_hpd_unplugged(ctx);
15651529 sii8620_write_seq_static(ctx,
15661530 REG_M3_CTRL, VAL_M3_CTRL_MHL3_VALUE,
15671531 REG_MHL_COC_CTL1, 0x07,
@@ -1609,10 +1573,8 @@ static void sii8620_disconnect(struct sii8620 *ctx) · 41 unmodified lines
16091573 memset(ctx->xstat, 0, sizeof(ctx->xstat));
16101574 memset(ctx->devcap, 0, sizeof(ctx->devcap));
16111575 memset(ctx->xdevcap, 0, sizeof(ctx->xdevcap));
1576+ ctx->devcap_read = false;
16121577 ctx->cbus_status = 0;
1613− ctx->sink_type = SINK_NONE;
1614− kfree(ctx->edid);
1615− ctx->edid = NULL;
16161578 sii8620_mt_cleanup(ctx);
16171579 }
16181580
@@ -1703,9 +1665,6 @@ static void sii8620_status_changed_path(struct sii8620 *ctx) · 84 unmodified lines
17031665 sii8620_mt_write_stat(ctx, MHL_DST_REG(LINK_MODE),
17041666 MHL_DST_LM_CLK_MODE_NORMAL
17051667 | MHL_DST_LM_PATH_ENABLED);
1706− if (!sii8620_is_mhl3(ctx))
1707− sii8620_mt_read_devcap(ctx, false);
1708− sii8620_mt_set_cont(ctx, sii8620_sink_detected);
17091668 } else {
17101669 sii8620_mt_write_stat(ctx, MHL_DST_REG(LINK_MODE),
17111670 MHL_DST_LM_CLK_MODE_NORMAL);
@@ -1722,9 +1681,14 @@ static void sii8620_msc_mr_write_stat(struct sii8620 *ctx) · 10 unmodified lines
17221681 sii8620_update_array(ctx->stat, st, MHL_DST_SIZE);
17231682 sii8620_update_array(ctx->xstat, xst, MHL_XDS_SIZE);
17241683
1725− if (ctx->stat[MHL_DST_CONNECTED_RDY] & MHL_DST_CONN_DCAP_RDY)
1684+ if (ctx->stat[MHL_DST_CONNECTED_RDY] & st[MHL_DST_CONNECTED_RDY] &
1685+ MHL_DST_CONN_DCAP_RDY) {
17261686 sii8620_status_dcap_ready(ctx);
17271687
1688+ if (!sii8620_is_mhl3(ctx))
1689+ sii8620_mt_read_devcap(ctx, false);
1690+ }
1691+
17281692 if (st[MHL_DST_LINK_MODE] & MHL_DST_LM_PATH_ENABLED)
17291693 sii8620_status_changed_path(ctx);
17301694 }
@@ -1808,8 +1772,11 @@ static void sii8620_msc_mr_set_int(struct sii8620 *ctx) · 77 unmodified lines
18081772 }
18091773 if (ints[MHL_INT_RCHANGE] & MHL_INT_RC_FEAT_REQ)
18101774 sii8620_send_features(ctx);
1811− if (ints[MHL_INT_RCHANGE] & MHL_INT_RC_FEAT_COMPLETE)
1812− sii8620_edid_read(ctx, 0);
1775+ if (ints[MHL_INT_RCHANGE] & MHL_INT_RC_FEAT_COMPLETE) {
1776+ ctx->feature_complete = true;
1777+ if (ctx->edid)
1778+ sii8620_enable_hpd(ctx);
1779+ }
18131780 }
18141781
18151782 static struct sii8620_mt_msg *sii8620_msc_msg_first(struct sii8620 *ctx)
@@ -1884,6 +1851,15 @@ static void sii8620_irq_msc(struct sii8620 *ctx) · 68 unmodified lines
18841851 if (stat & BIT_CBUS_MSC_MR_WRITE_STAT)
18851852 sii8620_msc_mr_write_stat(ctx);
18861853
1854+ if (stat & BIT_CBUS_HPD_CHG) {
1855+ if (ctx->cbus_status & BIT_CBUS_STATUS_CBUS_HPD) {
1856+ ctx->sink_detected = true;
1857+ sii8620_identify_sink(ctx);
1858+ } else {
1859+ sii8620_hpd_unplugged(ctx);
1860+ }
1861+ }
1862+
18871863 if (stat & BIT_CBUS_MSC_MR_SET_INT)
18881864 sii8620_msc_mr_set_int(ctx);
18891865
@@ -1931,14 +1907,6 @@ static void sii8620_irq_edid(struct sii8620 *ctx) · 41 unmodified lines
19311907 ctx->mt_state = MT_STATE_DONE;
19321908 }
19331909
1934−static void sii8620_scdt_high(struct sii8620 *ctx)
1935−{
1936− sii8620_write_seq_static(ctx,
1937− REG_INTR8_MASK, BIT_CEA_NEW_AVI | BIT_CEA_NEW_VSI,
1938− REG_TPI_SC, BIT_TPI_SC_TPI_OUTPUT_MODE_0_HDMI,
1939− );
1940−}
1941−
19421910 static void sii8620_irq_scdt(struct sii8620 *ctx)
19431911 {
19441912 u8 stat = sii8620_readb(ctx, REG_INTR5);
@@ -1946,53 +1914,13 @@ static void sii8620_irq_scdt(struct sii8620 *ctx) · 1 unmodified line
19461914 if (stat & BIT_INTR_SCDT_CHANGE) {
19471915 u8 cstat = sii8620_readb(ctx, REG_TMDS_CSTAT_P3);
19481916
1949− if (cstat & BIT_TMDS_CSTAT_P3_SCDT) {
1950− if (ctx->sink_type == SINK_HDMI)
1951− /* enable infoframe interrupt */
1952− sii8620_scdt_high(ctx);
1953− else
1954− sii8620_start_video(ctx);
1955− }
1917+ if (cstat & BIT_TMDS_CSTAT_P3_SCDT)
1918+ sii8620_start_video(ctx);
19561919 }
19571920
19581921 sii8620_write(ctx, REG_INTR5, stat);
19591922 }
19601923
1961−static void sii8620_new_vsi(struct sii8620 *ctx)
1962−{
1963− u8 vsif[11];
1964−
1965− sii8620_write(ctx, REG_RX_HDMI_CTRL2,
1966− VAL_RX_HDMI_CTRL2_DEFVAL |
1967− BIT_RX_HDMI_CTRL2_VSI_MON_SEL_VSI);
1968− sii8620_read_buf(ctx, REG_RX_HDMI_MON_PKT_HEADER1, vsif,
1969− ARRAY_SIZE(vsif));
1970−}
1971−
1972−static void sii8620_new_avi(struct sii8620 *ctx)
1973−{
1974− sii8620_write(ctx, REG_RX_HDMI_CTRL2, VAL_RX_HDMI_CTRL2_DEFVAL);
1975− sii8620_read_buf(ctx, REG_RX_HDMI_MON_PKT_HEADER1, ctx->avif,
1976− ARRAY_SIZE(ctx->avif));
1977−}
1978−
1979−static void sii8620_irq_infr(struct sii8620 *ctx)
1980−{
1981− u8 stat = sii8620_readb(ctx, REG_INTR8)
1982− & (BIT_CEA_NEW_VSI | BIT_CEA_NEW_AVI);
1983−
1984− sii8620_write(ctx, REG_INTR8, stat);
1985−
1986− if (stat & BIT_CEA_NEW_VSI)
1987− sii8620_new_vsi(ctx);
1988−
1989− if (stat & BIT_CEA_NEW_AVI)
1990− sii8620_new_avi(ctx);
1991−
1992− if (stat & (BIT_CEA_NEW_VSI | BIT_CEA_NEW_AVI))
1993− sii8620_start_video(ctx);
1994−}
1995−
19961924 static void sii8620_got_xdevcap(struct sii8620 *ctx, int ret)
19971925 {
19981926 if (ret < 0)
@@ -2043,11 +1971,11 @@ static void sii8620_irq_ddc(struct sii8620 *ctx) · 44 unmodified lines
20431971
20441972 if (stat & BIT_DDC_CMD_DONE) {
20451973 sii8620_write(ctx, REG_INTR3_MASK, 0);
2046− if (sii8620_is_mhl3(ctx))
1974+ if (sii8620_is_mhl3(ctx) && !ctx->feature_complete)
20471975 sii8620_mt_set_int(ctx, MHL_INT_REG(RCHANGE),
20481976 MHL_INT_RC_FEAT_REQ);
20491977 else
2050− sii8620_edid_read(ctx, 0);
1978+ sii8620_enable_hpd(ctx);
20511979 }
20521980 sii8620_write(ctx, REG_INTR3, stat);
20531981 }
@@ -2074,7 +2002,6 @@ static irqreturn_t sii8620_irq_thread(int irq, void *data) · 20 unmodified lines
20742002 { BIT_FAST_INTR_STAT_EDID, sii8620_irq_edid },
20752003 { BIT_FAST_INTR_STAT_DDC, sii8620_irq_ddc },
20762004 { BIT_FAST_INTR_STAT_SCDT, sii8620_irq_scdt },
2077− { BIT_FAST_INTR_STAT_INFR, sii8620_irq_infr },
20782005 };
20792006 struct sii8620 *ctx = data;
20802007 u8 stats[LEN_FAST_INTR_STAT];
@@ -2112,7 +2039,6 @@ static void sii8620_cable_in(struct sii8620 *ctx) · 31 unmodified lines
21122039 dev_err(dev, "Error powering on, %d.\n", ret);
21132040 return;
21142041 }
2115− sii8620_hw_reset(ctx);
21162042
21172043 sii8620_read_buf(ctx, REG_VND_IDL, ver, ARRAY_SIZE(ver));
21182044 ret = sii8620_clear_error(ctx);
@@ -2268,17 +2194,43 @@ static void sii8620_detach(struct drm_bridge *bridge) · 149 unmodified lines
22682194 rc_unregister_device(ctx->rc_dev);
22692195 }
22702196
2197+static int sii8620_is_packing_required(struct sii8620 *ctx,
2198+ const struct drm_display_mode *mode)
2199+{
2200+ int max_pclk, max_pclk_pp_mode;
2201+
2202+ if (sii8620_is_mhl3(ctx)) {
2203+ max_pclk = MHL3_MAX_PCLK;
2204+ max_pclk_pp_mode = MHL3_MAX_PCLK_PP_MODE;
2205+ } else {
2206+ max_pclk = MHL1_MAX_PCLK;
2207+ max_pclk_pp_mode = MHL1_MAX_PCLK_PP_MODE;
2208+ }
2209+
2210+ if (mode->clock < max_pclk)
2211+ return 0;
2212+ else if (mode->clock < max_pclk_pp_mode)
2213+ return 1;
2214+ else
2215+ return -1;
2216+}
2217+
22712218 static enum drm_mode_status sii8620_mode_valid(struct drm_bridge *bridge,
22722219 const struct drm_display_mode *mode)
22732220 {
22742221 struct sii8620 *ctx = bridge_to_sii8620(bridge);
2222+ int pack_required = sii8620_is_packing_required(ctx, mode);
22752223 bool can_pack = ctx->devcap[MHL_DCAP_VID_LINK_MODE] &
22762224 MHL_DCAP_VID_LINK_PPIXEL;
2277− unsigned int max_pclk = sii8620_is_mhl3(ctx) ? MHL3_MAX_LCLK :
2278− MHL1_MAX_LCLK;
2279− max_pclk /= can_pack ? 2 : 3;
22802225
2281− return (mode->clock > max_pclk) ? MODE_CLOCK_HIGH : MODE_OK;
2226+ switch (pack_required) {
2227+ case 0:
2228+ return MODE_OK;
2229+ case 1:
2230+ return (can_pack) ? MODE_OK : MODE_CLOCK_HIGH;
2231+ default:
2232+ return MODE_CLOCK_HIGH;
2233+ }
22822234 }
22832235
22842236 static bool sii8620_mode_fixup(struct drm_bridge *bridge,
@@ -2286,43 +2238,16 @@ static bool sii8620_mode_fixup(struct drm_bridge *bridge, · 1 unmodified line
22862238 struct drm_display_mode *adjusted_mode)
22872239 {
22882240 struct sii8620 *ctx = bridge_to_sii8620(bridge);
2289− int max_lclk;
2290− bool ret = true;
22912241
22922242 mutex_lock(&ctx->lock);
22932243
2294− max_lclk = sii8620_is_mhl3(ctx) ? MHL3_MAX_LCLK : MHL1_MAX_LCLK;
2295− if (max_lclk > 3 * adjusted_mode->clock) {
2296− ctx->use_packed_pixel = 0;
2297− goto end;
2298− }
2299− if ((ctx->devcap[MHL_DCAP_VID_LINK_MODE] & MHL_DCAP_VID_LINK_PPIXEL) &&
2300− max_lclk > 2 * adjusted_mode->clock) {
2301− ctx->use_packed_pixel = 1;
2302− goto end;
2303− }
2304− ret = false;
2305−end:
2306− if (ret) {
2307− u8 vic = drm_match_cea_mode(adjusted_mode);
2308−
2309− if (!vic) {
2310− union hdmi_infoframe frm;
2311− u8 mhl_vic[] = { 0, 95, 94, 93, 98 };
2312−
2313− /* FIXME: We need the connector here */
2314− drm_hdmi_vendor_infoframe_from_display_mode(
2315− &frm.vendor.hdmi, NULL, adjusted_mode);
2316− vic = frm.vendor.hdmi.vic;
2317− if (vic >= ARRAY_SIZE(mhl_vic))
2318− vic = 0;
2319− vic = mhl_vic[vic];
2320− }
2321− ctx->video_code = vic;
2322− ctx->pixel_clock = adjusted_mode->clock;
2323− }
2244+ ctx->use_packed_pixel = sii8620_is_packing_required(ctx, adjusted_mode);
2245+ ctx->video_code = drm_match_cea_mode(adjusted_mode);
2246+ ctx->pixel_clock = adjusted_mode->clock;
2247+
23242248 mutex_unlock(&ctx->lock);
2325− return ret;
2249+
2250+ return true;
23262251 }
23272252
23282253 static const struct drm_bridge_funcs sii8620_bridge_funcs = {
drivers/gpu/drm/drm_drv.c+7−7
@@ -369,13 +369,6 @@ EXPORT_SYMBOL(drm_dev_exit); · 368 unmodified lines
369369 */
370370 void drm_dev_unplug(struct drm_device *dev)
371371 {
372− drm_dev_unregister(dev);
373−
374− mutex_lock(&drm_global_mutex);
375− if (dev->open_count == 0)
376− drm_dev_put(dev);
377− mutex_unlock(&drm_global_mutex);
378−
379372 /*
380373 * After synchronizing any critical read section is guaranteed to see
381374 * the new value of ->unplugged, and any critical section which might
@@ -384,6 +377,13 @@ void drm_dev_unplug(struct drm_device *dev) · 2 unmodified lines
384377 */
385378 dev->unplugged = true;
386379 synchronize_srcu(&drm_unplug_srcu);
380+
381+ drm_dev_unregister(dev);
382+
383+ mutex_lock(&drm_global_mutex);
384+ if (dev->open_count == 0)
385+ drm_dev_put(dev);
386+ mutex_unlock(&drm_global_mutex);
387387 }
388388 EXPORT_SYMBOL(drm_dev_unplug);
389389
drivers/gpu/drm/i915/i915_drv.h+0−3
@@ -2261,9 +2261,6 @@ static inline struct scatterlist *____sg_next(struct scatterlist *sg) · 2260 unmodified lines
22612261 **/
22622262 static inline struct scatterlist *__sg_next(struct scatterlist *sg)
22632263 {
2264−#ifdef CONFIG_DEBUG_SG
2265− BUG_ON(sg->sg_magic != SG_MAGIC);
2266−#endif
22672264 return sg_is_last(sg) ? NULL : ____sg_next(sg);
22682265 }
22692266
drivers/gpu/drm/meson/meson_drv.c+8−4
@@ -197,8 +197,10 @@ static int meson_drv_bind_master(struct device *dev, bool has_components) · 196 unmodified lines
197197 priv->io_base = regs;
198198
199199 res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "hhi");
200− if (!res)
201− return -EINVAL;
200+ if (!res) {
201+ ret = -EINVAL;
202+ goto free_drm;
203+ }
202204 /* Simply ioremap since it may be a shared register zone */
203205 regs = devm_ioremap(dev, res->start, resource_size(res));
204206 if (!regs) {
@@ -215,8 +217,10 @@ static int meson_drv_bind_master(struct device *dev, bool has_components) · 10 unmodified lines
215217 }
216218
217219 res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dmc");
218− if (!res)
219− return -EINVAL;
220+ if (!res) {
221+ ret = -EINVAL;
222+ goto free_drm;
223+ }
220224 /* Simply ioremap since it may be a shared register zone */
221225 regs = devm_ioremap(dev, res->start, resource_size(res));
222226 if (!regs) {
drivers/gpu/drm/nouveau/dispnv50/curs507a.c+1−1
@@ -132,7 +132,7 @@ curs507a_new_(const struct nv50_wimm_func *func, struct nouveau_drm *drm, · 131 unmodified lines
132132
133133 nvif_object_map(&wndw->wimm.base.user, NULL, 0);
134134 wndw->immd = func;
135− wndw->ctxdma.parent = &disp->core->chan.base.user;
135+ wndw->ctxdma.parent = NULL;
136136 return 0;
137137 }
138138
drivers/gpu/drm/nouveau/dispnv50/wndw.c+8−5
@@ -444,14 +444,17 @@ nv50_wndw_prepare_fb(struct drm_plane *plane, struct drm_plane_state *state) · 443 unmodified lines
444444 if (ret)
445445 return ret;
446446
447− ctxdma = nv50_wndw_ctxdma_new(wndw, fb);
448− if (IS_ERR(ctxdma)) {
449− nouveau_bo_unpin(fb->nvbo);
450− return PTR_ERR(ctxdma);
447+ if (wndw->ctxdma.parent) {
448+ ctxdma = nv50_wndw_ctxdma_new(wndw, fb);
449+ if (IS_ERR(ctxdma)) {
450+ nouveau_bo_unpin(fb->nvbo);
451+ return PTR_ERR(ctxdma);
452+ }
453+
454+ asyw->image.handle[0] = ctxdma->object.handle;
451455 }
452456
453457 asyw->state.fence = reservation_object_get_excl_rcu(fb->nvbo->bo.resv);
454− asyw->image.handle[0] = ctxdma->object.handle;
455458 asyw->image.offset[0] = fb->nvbo->bo.offset;
456459
457460 if (wndw->func->prepare) {
drivers/gpu/drm/qxl/qxl_display.c+5−2
@@ -623,7 +623,7 @@ static void qxl_cursor_atomic_update(struct drm_plane *plane, · 622 unmodified lines
623623 struct qxl_cursor_cmd *cmd;
624624 struct qxl_cursor *cursor;
625625 struct drm_gem_object *obj;
626− struct qxl_bo *cursor_bo = NULL, *user_bo = NULL;
626+ struct qxl_bo *cursor_bo = NULL, *user_bo = NULL, *old_cursor_bo = NULL;
627627 int ret;
628628 void *user_ptr;
629629 int size = 64*64*4;
@@ -677,7 +677,7 @@ static void qxl_cursor_atomic_update(struct drm_plane *plane, · 47 unmodified lines
677677 cursor_bo, 0);
678678 cmd->type = QXL_CURSOR_SET;
679679
680− qxl_bo_unref(&qcrtc->cursor_bo);
680+ old_cursor_bo = qcrtc->cursor_bo;
681681 qcrtc->cursor_bo = cursor_bo;
682682 cursor_bo = NULL;
683683 } else {
@@ -697,6 +697,9 @@ static void qxl_cursor_atomic_update(struct drm_plane *plane, · 13 unmodified lines
697697 qxl_push_cursor_ring_release(qdev, release, QXL_CMD_CURSOR, false);
698698 qxl_release_fence_buffer_objects(release);
699699
700+ if (old_cursor_bo)
701+ qxl_bo_unref(&old_cursor_bo);
702+
700703 qxl_bo_unref(&cursor_bo);
701704
702705 return;
drivers/gpu/drm/sun4i/sun4i_tcon.c+0−25
@@ -17,7 +17,6 @@ · 16 unmodified lines
1717 #include <drm/drm_encoder.h>
1818 #include <drm/drm_modes.h>
1919 #include <drm/drm_of.h>
20−#include <drm/drm_panel.h>
2120
2221 #include <uapi/drm/drm_mode.h>
2322
@@ -418,9 +417,6 @@ static void sun4i_tcon0_mode_set_lvds(struct sun4i_tcon *tcon, · 394 unmodified lines
418417 static void sun4i_tcon0_mode_set_rgb(struct sun4i_tcon *tcon,
419418 const struct drm_display_mode *mode)
420419 {
421− struct drm_panel *panel = tcon->panel;
422− struct drm_connector *connector = panel->connector;
423− struct drm_display_info display_info = connector->display_info;
424420 unsigned int bp, hsync, vsync;
425421 u8 clk_delay;
426422 u32 val = 0;
@@ -478,27 +474,6 @@ static void sun4i_tcon0_mode_set_rgb(struct sun4i_tcon *tcon, · 51 unmodified lines
478474 if (mode->flags & DRM_MODE_FLAG_PVSYNC)
479475 val |= SUN4I_TCON0_IO_POL_VSYNC_POSITIVE;
480476
481− /*
482− * On A20 and similar SoCs, the only way to achieve Positive Edge
483− * (Rising Edge), is setting dclk clock phase to 2/3(240°).
484− * By default TCON works in Negative Edge(Falling Edge),
485− * this is why phase is set to 0 in that case.
486− * Unfortunately there's no way to logically invert dclk through
487− * IO_POL register.
488− * The only acceptable way to work, triple checked with scope,
489− * is using clock phase set to 0° for Negative Edge and set to 240°
490− * for Positive Edge.
491− * On A33 and similar SoCs there would be a 90° phase option,
492− * but it divides also dclk by 2.
493− * Following code is a way to avoid quirks all around TCON
494− * and DOTCLOCK drivers.
495− */
496− if (display_info.bus_flags & DRM_BUS_FLAG_PIXDATA_POSEDGE)
497− clk_set_phase(tcon->dclk, 240);
498−
499− if (display_info.bus_flags & DRM_BUS_FLAG_PIXDATA_NEGEDGE)
500− clk_set_phase(tcon->dclk, 0);
501−
502477 regmap_update_bits(tcon->regs, SUN4I_TCON0_IO_POL_REG,
503478 SUN4I_TCON0_IO_POL_HSYNC_POSITIVE | SUN4I_TCON0_IO_POL_VSYNC_POSITIVE,
504479 val);
drivers/hid/hid-google-hammer.c+2−0
@@ -124,6 +124,8 @@ static const struct hid_device_id hammer_devices[] = { · 123 unmodified lines
124124 USB_VENDOR_ID_GOOGLE, USB_DEVICE_ID_GOOGLE_STAFF) },
125125 { HID_DEVICE(BUS_USB, HID_GROUP_GENERIC,
126126 USB_VENDOR_ID_GOOGLE, USB_DEVICE_ID_GOOGLE_WAND) },
127+ { HID_DEVICE(BUS_USB, HID_GROUP_GENERIC,
128+ USB_VENDOR_ID_GOOGLE, USB_DEVICE_ID_GOOGLE_WHISKERS) },
127129 { }
128130 };
129131 MODULE_DEVICE_TABLE(hid, hammer_devices);
drivers/hid/hid-ids.h+1−0
@@ -452,6 +452,7 @@ · 451 unmodified lines
452452 #define USB_DEVICE_ID_GOOGLE_TOUCH_ROSE 0x5028
453453 #define USB_DEVICE_ID_GOOGLE_STAFF 0x502b
454454 #define USB_DEVICE_ID_GOOGLE_WAND 0x502d
455+#define USB_DEVICE_ID_GOOGLE_WHISKERS 0x5030
455456
456457 #define USB_VENDOR_ID_GOTOP 0x08f2
457458 #define USB_DEVICE_ID_SUPER_Q2 0x007f
drivers/hid/hid-steam.c+5−5
@@ -573,7 +573,7 @@ static bool steam_is_valve_interface(struct hid_device *hdev) · 572 unmodified lines
573573
574574 static int steam_client_ll_parse(struct hid_device *hdev)
575575 {
576− struct steam_device *steam = hid_get_drvdata(hdev);
576+ struct steam_device *steam = hdev->driver_data;
577577
578578 return hid_parse_report(hdev, steam->hdev->dev_rdesc,
579579 steam->hdev->dev_rsize);
@@ -590,7 +590,7 @@ static void steam_client_ll_stop(struct hid_device *hdev) · 10 unmodified lines
590590
591591 static int steam_client_ll_open(struct hid_device *hdev)
592592 {
593− struct steam_device *steam = hid_get_drvdata(hdev);
593+ struct steam_device *steam = hdev->driver_data;
594594 int ret;
595595
596596 ret = hid_hw_open(steam->hdev);
@@ -605,7 +605,7 @@ static int steam_client_ll_open(struct hid_device *hdev) · 8 unmodified lines
605605
606606 static void steam_client_ll_close(struct hid_device *hdev)
607607 {
608− struct steam_device *steam = hid_get_drvdata(hdev);
608+ struct steam_device *steam = hdev->driver_data;
609609
610610 mutex_lock(&steam->mutex);
611611 steam->client_opened = false;
@@ -623,7 +623,7 @@ static int steam_client_ll_raw_request(struct hid_device *hdev, · 11 unmodified lines
623623 size_t count, unsigned char report_type,
624624 int reqtype)
625625 {
626− struct steam_device *steam = hid_get_drvdata(hdev);
626+ struct steam_device *steam = hdev->driver_data;
627627
628628 return hid_hw_raw_request(steam->hdev, reportnum, buf, count,
629629 report_type, reqtype);
@@ -710,7 +710,7 @@ static int steam_probe(struct hid_device *hdev, · 80 unmodified lines
710710 ret = PTR_ERR(steam->client_hdev);
711711 goto client_hdev_fail;
712712 }
713− hid_set_drvdata(steam->client_hdev, steam);
713+ steam->client_hdev->driver_data = steam;
714714
715715 /*
716716 * With the real steam controller interface, do not connect hidraw.
drivers/hid/intel-ish-hid/ipc/pci-ish.c+7−15
@@ -205,8 +205,7 @@ static void ish_remove(struct pci_dev *pdev) · 204 unmodified lines
205205 kfree(ishtp_dev);
206206 }
207207
208−#ifdef CONFIG_PM
209−static struct device *ish_resume_device;
208+static struct device __maybe_unused *ish_resume_device;
210209
211210 /* 50ms to get resume response */
212211 #define WAIT_FOR_RESUME_ACK_MS 50
@@ -220,7 +219,7 @@ static struct device *ish_resume_device; · 7 unmodified lines
220219 * in that case a simple resume message is enough, others we need
221220 * a reset sequence.
222221 */
223−static void ish_resume_handler(struct work_struct *work)
222+static void __maybe_unused ish_resume_handler(struct work_struct *work)
224223 {
225224 struct pci_dev *pdev = to_pci_dev(ish_resume_device);
226225 struct ishtp_device *dev = pci_get_drvdata(pdev);
@@ -262,7 +261,7 @@ static void ish_resume_handler(struct work_struct *work) · 35 unmodified lines
262261 *
263262 * Return: 0 to the pm core
264263 */
265−static int ish_suspend(struct device *device)
264+static int __maybe_unused ish_suspend(struct device *device)
266265 {
267266 struct pci_dev *pdev = to_pci_dev(device);
268267 struct ishtp_device *dev = pci_get_drvdata(pdev);
@@ -288,7 +287,7 @@ static int ish_suspend(struct device *device) · 19 unmodified lines
288287 return 0;
289288 }
290289
291−static DECLARE_WORK(resume_work, ish_resume_handler);
290+static __maybe_unused DECLARE_WORK(resume_work, ish_resume_handler);
292291 /**
293292 * ish_resume() - ISH resume callback
294293 * @device: device pointer
@@ -297,7 +296,7 @@ static DECLARE_WORK(resume_work, ish_resume_handler); · 2 unmodified lines
297296 *
298297 * Return: 0 to the pm core
299298 */
300−static int ish_resume(struct device *device)
299+static int __maybe_unused ish_resume(struct device *device)
301300 {
302301 struct pci_dev *pdev = to_pci_dev(device);
303302 struct ishtp_device *dev = pci_get_drvdata(pdev);
@@ -311,21 +310,14 @@ static int ish_resume(struct device *device) · 7 unmodified lines
311310 return 0;
312311 }
313312
314−static const struct dev_pm_ops ish_pm_ops = {
315− .suspend = ish_suspend,
316− .resume = ish_resume,
317−};
318−#define ISHTP_ISH_PM_OPS (&ish_pm_ops)
319−#else
320−#define ISHTP_ISH_PM_OPS NULL
321−#endif /* CONFIG_PM */
313+static SIMPLE_DEV_PM_OPS(ish_pm_ops, ish_suspend, ish_resume);
322314
323315 static struct pci_driver ish_driver = {
324316 .name = KBUILD_MODNAME,
325317 .id_table = ish_pci_tbl,
326318 .probe = ish_probe,
327319 .remove = ish_remove,
328− .driver.pm = ISHTP_ISH_PM_OPS,
320+ .driver.pm = &ish_pm_ops,
329321 };
330322
331323 module_pci_driver(ish_driver);
drivers/hid/wacom_sys.c+8−0
@@ -395,6 +395,14 @@ static void wacom_usage_mapping(struct hid_device *hdev, · 394 unmodified lines
395395 }
396396 }
397397
398+ /* 2nd-generation Intuos Pro Large has incorrect Y maximum */
399+ if (hdev->vendor == USB_VENDOR_ID_WACOM &&
400+ hdev->product == 0x0358 &&
401+ WACOM_PEN_FIELD(field) &&
402+ wacom_equivalent_usage(usage->hid) == HID_GD_Y) {
403+ field->logical_maximum = 43200;
404+ }
405+
398406 switch (usage->hid) {
399407 case HID_GD_X:
400408 features->x_max = field->logical_maximum;
drivers/hwmon/dell-smm-hwmon.c+7−0
@@ -1074,6 +1074,13 @@ static struct dmi_system_id i8k_blacklist_fan_support_dmi_table[] __initdata = { · 1073 unmodified lines
10741074 DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Vostro 3360"),
10751075 },
10761076 },
1077+ {
1078+ .ident = "Dell XPS13 9333",
1079+ .matches = {
1080+ DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
1081+ DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "XPS13 9333"),
1082+ },
1083+ },
10771084 { }
10781085 };
10791086
drivers/hwmon/nct6775.c+1−1
@@ -4175,7 +4175,7 @@ static int nct6775_probe(struct platform_device *pdev) · 4174 unmodified lines
41754175 * The temperature is already monitored if the respective bit in <mask>
41764176 * is set.
41774177 */
4178− for (i = 0; i < 32; i++) {
4178+ for (i = 0; i < 31; i++) {
41794179 if (!(data->temp_mask & BIT(i + 1)))
41804180 continue;
41814181 if (!reg_temp_alternate[i])
drivers/i2c/algos/i2c-algo-bit.c+4−4
@@ -647,10 +647,10 @@ static int __i2c_bit_add_bus(struct i2c_adapter *adap, · 646 unmodified lines
647647 if (bit_adap->getscl == NULL)
648648 adap->quirks = &i2c_bit_quirk_no_clk_stretch;
649649
650− /* Bring bus to a known state. Looks like STOP if bus is not free yet */
651− setscl(bit_adap, 1);
652− udelay(bit_adap->udelay);
653− setsda(bit_adap, 1);
650+ /*
651+ * We tried forcing SCL/SDA to an initial state here. But that caused a
652+ * regression, sadly. Check Bugzilla #200045 for details.
653+ */
654654
655655 ret = add_adapter(adap);
656656 if (ret < 0)
drivers/i2c/busses/i2c-gpio.c+2−2
@@ -279,9 +279,9 @@ static int i2c_gpio_probe(struct platform_device *pdev) · 278 unmodified lines
279279 * required for an I2C bus.
280280 */
281281 if (pdata->scl_is_open_drain)
282− gflags = GPIOD_OUT_LOW;
282+ gflags = GPIOD_OUT_HIGH;
283283 else
284− gflags = GPIOD_OUT_LOW_OPEN_DRAIN;
284+ gflags = GPIOD_OUT_HIGH_OPEN_DRAIN;
285285 priv->scl = i2c_gpio_get_desc(dev, "scl", 1, gflags);
286286 if (IS_ERR(priv->scl))
287287 return PTR_ERR(priv->scl);
drivers/i2c/i2c-core-smbus.c+9−5
@@ -465,15 +465,18 @@ static s32 i2c_smbus_xfer_emulated(struct i2c_adapter *adapter, u16 addr, · 464 unmodified lines
465465
466466 status = i2c_transfer(adapter, msg, num);
467467 if (status < 0)
468− return status;
469− if (status != num)
470− return -EIO;
468+ goto cleanup;
469+ if (status != num) {
470+ status = -EIO;
471+ goto cleanup;
472+ }
473+ status = 0;
471474
472475 /* Check PEC if last message is a read */
473476 if (i && (msg[num-1].flags & I2C_M_RD)) {
474477 status = i2c_smbus_check_pec(partial_pec, &msg[num-1]);
475478 if (status < 0)
476− return status;
479+ goto cleanup;
477480 }
478481
479482 if (read_write == I2C_SMBUS_READ)
@@ -499,12 +502,13 @@ static s32 i2c_smbus_xfer_emulated(struct i2c_adapter *adapter, u16 addr, · 19 unmodified lines
499502 break;
500503 }
501504
505+cleanup:
502506 if (msg[0].flags & I2C_M_DMA_SAFE)
503507 kfree(msg[0].buf);
504508 if (msg[1].flags & I2C_M_DMA_SAFE)
505509 kfree(msg[1].buf);
506510
507− return 0;
511+ return status;
508512 }
509513
510514 /**
drivers/iio/accel/mma8452.c+1−1
@@ -1053,7 +1053,7 @@ static irqreturn_t mma8452_interrupt(int irq, void *p) · 1052 unmodified lines
10531053 if (src < 0)
10541054 return IRQ_NONE;
10551055
1056− if (!(src & data->chip_info->enabled_events))
1056+ if (!(src & (data->chip_info->enabled_events | MMA8452_INT_DRDY)))
10571057 return IRQ_NONE;
10581058
10591059 if (src & MMA8452_INT_DRDY) {
drivers/iio/imu/inv_mpu6050/inv_mpu_core.c+2−0
@@ -959,6 +959,8 @@ int inv_mpu_core_probe(struct regmap *regmap, int irq, const char *name, · 958 unmodified lines
959959 }
960960
961961 irq_type = irqd_get_trigger_type(desc);
962+ if (!irq_type)
963+ irq_type = IRQF_TRIGGER_RISING;
962964 if (irq_type == IRQF_TRIGGER_RISING)
963965 st->irq_mask = INV_MPU6050_ACTIVE_HIGH;
964966 else if (irq_type == IRQF_TRIGGER_FALLING)
drivers/iio/light/tsl2772.c+2−0
@@ -582,6 +582,8 @@ static int tsl2772_als_calibrate(struct iio_dev *indio_dev) · 581 unmodified lines
582582 "%s: failed to get lux\n", __func__);
583583 return lux_val;
584584 }
585+ if (lux_val == 0)
586+ return -ERANGE;
585587
586588 ret = (chip->settings.als_cal_target * chip->settings.als_gain_trim) /
587589 lux_val;
drivers/iio/pressure/bmp280-core.c+2−3
@@ -415,10 +415,9 @@ static int bmp280_read_humid(struct bmp280_data *data, int *val, int *val2) · 414 unmodified lines
415415 }
416416 comp_humidity = bmp280_compensate_humidity(data, adc_humidity);
417417
418− *val = comp_humidity;
419− *val2 = 1024;
418+ *val = comp_humidity * 1000 / 1024;
420419
421− return IIO_VAL_FRACTIONAL;
420+ return IIO_VAL_INT;
422421 }
423422
424423 static int bmp280_read_raw(struct iio_dev *indio_dev,
drivers/infiniband/core/uverbs_main.c+10−4
@@ -736,10 +736,6 @@ static ssize_t ib_uverbs_write(struct file *filp, const char __user *buf, · 735 unmodified lines
736736 if (ret)
737737 return ret;
738738
739− if (!file->ucontext &&
740− (command != IB_USER_VERBS_CMD_GET_CONTEXT || extended))
741− return -EINVAL;
742−
743739 if (extended) {
744740 if (count < (sizeof(hdr) + sizeof(ex_hdr)))
745741 return -EINVAL;
@@ -759,6 +755,16 @@ static ssize_t ib_uverbs_write(struct file *filp, const char __user *buf, · 13 unmodified lines
759755 goto out;
760756 }
761757
758+ /*
759+ * Must be after the ib_dev check, as once the RCU clears ib_dev ==
760+ * NULL means ucontext == NULL
761+ */
762+ if (!file->ucontext &&
763+ (command != IB_USER_VERBS_CMD_GET_CONTEXT || extended)) {
764+ ret = -EINVAL;
765+ goto out;
766+ }
767+
762768 if (!verify_command_mask(ib_dev, command, extended)) {
763769 ret = -EOPNOTSUPP;
764770 goto out;
drivers/infiniband/core/verbs.c+8−6
@@ -1562,11 +1562,12 @@ EXPORT_SYMBOL(ib_destroy_qp); · 1561 unmodified lines
15621562
15631563 /* Completion queues */
15641564
1565−struct ib_cq *ib_create_cq(struct ib_device *device,
1566− ib_comp_handler comp_handler,
1567− void (*event_handler)(struct ib_event *, void *),
1568− void *cq_context,
1569− const struct ib_cq_init_attr *cq_attr)
1565+struct ib_cq *__ib_create_cq(struct ib_device *device,
1566+ ib_comp_handler comp_handler,
1567+ void (*event_handler)(struct ib_event *, void *),
1568+ void *cq_context,
1569+ const struct ib_cq_init_attr *cq_attr,
1570+ const char *caller)
15701571 {
15711572 struct ib_cq *cq;
15721573
@@ -1580,12 +1581,13 @@ struct ib_cq *ib_create_cq(struct ib_device *device, · 7 unmodified lines
15801581 cq->cq_context = cq_context;
15811582 atomic_set(&cq->usecnt, 0);
15821583 cq->res.type = RDMA_RESTRACK_CQ;
1584+ cq->res.kern_name = caller;
15831585 rdma_restrack_add(&cq->res);
15841586 }
15851587
15861588 return cq;
15871589 }
1588−EXPORT_SYMBOL(ib_create_cq);
1590+EXPORT_SYMBOL(__ib_create_cq);
15891591
15901592 int rdma_set_cq_moderation(struct ib_cq *cq, u16 cq_count, u16 cq_period)
15911593 {
drivers/infiniband/hw/mlx4/mr.c+5−2
@@ -486,8 +486,11 @@ int mlx4_ib_rereg_user_mr(struct ib_mr *mr, int flags, · 485 unmodified lines
486486 }
487487
488488 if (flags & IB_MR_REREG_ACCESS) {
489− if (ib_access_writable(mr_access_flags) && !mmr->umem->writable)
490− return -EPERM;
489+ if (ib_access_writable(mr_access_flags) &&
490+ !mmr->umem->writable) {
491+ err = -EPERM;
492+ goto release_mpt_entry;
493+ }
491494
492495 err = mlx4_mr_hw_change_access(dev->dev, *pmpt_entry,
493496 convert_access(mr_access_flags));
drivers/infiniband/hw/mlx5/main.c+21−15
@@ -3199,8 +3199,8 @@ static int flow_counters_set_data(struct ib_counters *ibcounters, · 3198 unmodified lines
31993199 if (!mcounters->hw_cntrs_hndl) {
32003200 mcounters->hw_cntrs_hndl = mlx5_fc_create(
32013201 to_mdev(ibcounters->device)->mdev, false);
3202− if (!mcounters->hw_cntrs_hndl) {
3203− ret = -ENOMEM;
3202+ if (IS_ERR(mcounters->hw_cntrs_hndl)) {
3203+ ret = PTR_ERR(mcounters->hw_cntrs_hndl);
32043204 goto free;
32053205 }
32063206 hw_hndl = true;
@@ -3546,29 +3546,35 @@ static struct ib_flow *mlx5_ib_create_flow(struct ib_qp *qp, · 339 unmodified lines
35463546 return ERR_PTR(-ENOMEM);
35473547
35483548 err = ib_copy_from_udata(ucmd, udata, required_ucmd_sz);
3549− if (err) {
3550− kfree(ucmd);
3551− return ERR_PTR(err);
3552− }
3549+ if (err)
3550+ goto free_ucmd;
35533551 }
35543552
3555− if (flow_attr->priority > MLX5_IB_FLOW_LAST_PRIO)
3556− return ERR_PTR(-ENOMEM);
3553+ if (flow_attr->priority > MLX5_IB_FLOW_LAST_PRIO) {
3554+ err = -ENOMEM;
3555+ goto free_ucmd;
3556+ }
35573557
35583558 if (domain != IB_FLOW_DOMAIN_USER ||
35593559 flow_attr->port > dev->num_ports ||
35603560 (flow_attr->flags & ~(IB_FLOW_ATTR_FLAGS_DONT_TRAP |
3561− IB_FLOW_ATTR_FLAGS_EGRESS)))
3562− return ERR_PTR(-EINVAL);
3561+ IB_FLOW_ATTR_FLAGS_EGRESS))) {
3562+ err = -EINVAL;
3563+ goto free_ucmd;
3564+ }
35633565
35643566 if (is_egress &&
35653567 (flow_attr->type == IB_FLOW_ATTR_ALL_DEFAULT ||
3566− flow_attr->type == IB_FLOW_ATTR_MC_DEFAULT))
3567− return ERR_PTR(-EINVAL);
3568+ flow_attr->type == IB_FLOW_ATTR_MC_DEFAULT)) {
3569+ err = -EINVAL;
3570+ goto free_ucmd;
3571+ }
35683572
35693573 dst = kzalloc(sizeof(*dst), GFP_KERNEL);
3570− if (!dst)
3571− return ERR_PTR(-ENOMEM);
3574+ if (!dst) {
3575+ err = -ENOMEM;
3576+ goto free_ucmd;
3577+ }
35723578
35733579 mutex_lock(&dev->flow_db->lock);
35743580
@@ -3637,8 +3643,8 @@ destroy_ft: · 62 unmodified lines
36373643 unlock:
36383644 mutex_unlock(&dev->flow_db->lock);
36393645 kfree(dst);
3646+free_ucmd:
36403647 kfree(ucmd);
3641− kfree(handler);
36423648 return ERR_PTR(err);
36433649 }
36443650
drivers/infiniband/hw/qedr/verbs.c+3−0
@@ -1957,6 +1957,9 @@ int qedr_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, · 1956 unmodified lines
19571957 }
19581958
19591959 if (attr_mask & (IB_QP_AV | IB_QP_PATH_MTU)) {
1960+ if (rdma_protocol_iwarp(&dev->ibdev, 1))
1961+ return -EINVAL;
1962+
19601963 if (attr_mask & IB_QP_PATH_MTU) {
19611964 if (attr->path_mtu < IB_MTU_256 ||
19621965 attr->path_mtu > IB_MTU_4096) {
drivers/infiniband/sw/rxe/rxe_req.c+4−1
@@ -645,6 +645,9 @@ next_wqe: · 644 unmodified lines
645645 } else {
646646 goto exit;
647647 }
648+ if ((wqe->wr.send_flags & IB_SEND_SIGNALED) ||
649+ qp->sq_sig_type == IB_SIGNAL_ALL_WR)
650+ rxe_run_task(&qp->comp.task, 1);
648651 qp->req.wqe_index = next_index(qp->sq.queue,
649652 qp->req.wqe_index);
650653 goto next_wqe;
@@ -709,6 +712,7 @@ next_wqe: · 58 unmodified lines
709712
710713 if (fill_packet(qp, wqe, &pkt, skb, payload)) {
711714 pr_debug("qp#%d Error during fill packet\n", qp_num(qp));
715+ kfree_skb(skb);
712716 goto err;
713717 }
714718
@@ -740,7 +744,6 @@ next_wqe: · 25 unmodified lines
740744 goto next_wqe;
741745
742746 err:
743− kfree_skb(skb);
744747 wqe->status = IB_WC_LOC_PROT_ERR;
745748 wqe->state = wqe_state_error;
746749 __rxe_do_task(&qp->comp.task);
drivers/input/input-mt.c+8−4
@@ -131,8 +131,10 @@ EXPORT_SYMBOL(input_mt_destroy_slots); · 130 unmodified lines
131131 * inactive, or if the tool type is changed, a new tracking id is
132132 * assigned to the slot. The tool type is only reported if the
133133 * corresponding absbit field is set.
134+ *
135+ * Returns true if contact is active.
134136 */
135−void input_mt_report_slot_state(struct input_dev *dev,
137+bool input_mt_report_slot_state(struct input_dev *dev,
136138 unsigned int tool_type, bool active)
137139 {
138140 struct input_mt *mt = dev->mt;
@@ -140,22 +142,24 @@ void input_mt_report_slot_state(struct input_dev *dev, · 1 unmodified line
140142 int id;
141143
142144 if (!mt)
143− return;
145+ return false;
144146
145147 slot = &mt->slots[mt->slot];
146148 slot->frame = mt->frame;
147149
148150 if (!active) {
149151 input_event(dev, EV_ABS, ABS_MT_TRACKING_ID, -1);
150− return;
152+ return false;
151153 }
152154
153155 id = input_mt_get_value(slot, ABS_MT_TRACKING_ID);
154− if (id < 0 || input_mt_get_value(slot, ABS_MT_TOOL_TYPE) != tool_type)
156+ if (id < 0)
155157 id = input_mt_new_trkid(mt);
156158
157159 input_event(dev, EV_ABS, ABS_MT_TRACKING_ID, id);
158160 input_event(dev, EV_ABS, ABS_MT_TOOL_TYPE, tool_type);
161+
162+ return true;
159163 }
160164 EXPORT_SYMBOL(input_mt_report_slot_state);
161165
drivers/input/joystick/xpad.c+1−1
@@ -125,7 +125,7 @@ static const struct xpad_device { · 124 unmodified lines
125125 u8 mapping;
126126 u8 xtype;
127127 } xpad_device[] = {
128− { 0x0079, 0x18d4, "GPD Win 2 Controller", 0, XTYPE_XBOX360 },
128+ { 0x0079, 0x18d4, "GPD Win 2 X-Box Controller", 0, XTYPE_XBOX360 },
129129 { 0x044f, 0x0f00, "Thrustmaster Wheel", 0, XTYPE_XBOX },
130130 { 0x044f, 0x0f03, "Thrustmaster Wheel", 0, XTYPE_XBOX },
131131 { 0x044f, 0x0f07, "Thrustmaster, Inc. Controller", 0, XTYPE_XBOX },
drivers/input/keyboard/goldfish_events.c+5−4
@@ -45,7 +45,7 @@ struct event_dev { · 44 unmodified lines
4545 static irqreturn_t events_interrupt(int irq, void *dev_id)
4646 {
4747 struct event_dev *edev = dev_id;
48− unsigned type, code, value;
48+ unsigned int type, code, value;
4949
5050 type = __raw_readl(edev->addr + REG_READ);
5151 code = __raw_readl(edev->addr + REG_READ);
@@ -57,7 +57,7 @@ static irqreturn_t events_interrupt(int irq, void *dev_id) · 5 unmodified lines
5757 }
5858
5959 static void events_import_bits(struct event_dev *edev,
60− unsigned long bits[], unsigned type, size_t count)
60+ unsigned long bits[], unsigned int type, size_t count)
6161 {
6262 void __iomem *addr = edev->addr;
6363 int i, j;
@@ -99,6 +99,7 @@ static void events_import_abs_params(struct event_dev *edev) · 35 unmodified lines
9999
100100 for (j = 0; j < ARRAY_SIZE(val); j++) {
101101 int offset = (i * ARRAY_SIZE(val) + j) * sizeof(u32);
102+
102103 val[j] = __raw_readl(edev->addr + REG_DATA + offset);
103104 }
104105
@@ -112,7 +113,7 @@ static int events_probe(struct platform_device *pdev) · 7 unmodified lines
112113 struct input_dev *input_dev;
113114 struct event_dev *edev;
114115 struct resource *res;
115− unsigned keymapnamelen;
116+ unsigned int keymapnamelen;
116117 void __iomem *addr;
117118 int irq;
118119 int i;
@@ -150,7 +151,7 @@ static int events_probe(struct platform_device *pdev) · 31 unmodified lines
150151 for (i = 0; i < keymapnamelen; i++)
151152 edev->name[i] = __raw_readb(edev->addr + REG_DATA + i);
152153
153− pr_debug("events_probe() keymap=%s\n", edev->name);
154+ pr_debug("%s: keymap=%s\n", __func__, edev->name);
154155
155156 input_dev->name = edev->name;
156157 input_dev->id.bustype = BUS_HOST;
drivers/input/misc/Kconfig+10−0
@@ -841,4 +841,14 @@ config INPUT_RAVE_SP_PWRBUTTON · 840 unmodified lines
841841 To compile this driver as a module, choose M here: the
842842 module will be called rave-sp-pwrbutton.
843843
844+config INPUT_SC27XX_VIBRA
845+ tristate "Spreadtrum sc27xx vibrator support"
846+ depends on MFD_SC27XX_PMIC || COMPILE_TEST
847+ select INPUT_FF_MEMLESS
848+ help
849+ This option enables support for Spreadtrum sc27xx vibrator driver.
850+
851+ To compile this driver as a module, choose M here. The module will
852+ be called sc27xx_vibra.
853+
844854 endif
drivers/input/misc/Makefile+1−0
@@ -66,6 +66,7 @@ obj-$(CONFIG_INPUT_RETU_PWRBUTTON) += retu-pwrbutton.o · 65 unmodified lines
6666 obj-$(CONFIG_INPUT_AXP20X_PEK) += axp20x-pek.o
6767 obj-$(CONFIG_INPUT_GPIO_ROTARY_ENCODER) += rotary_encoder.o
6868 obj-$(CONFIG_INPUT_RK805_PWRKEY) += rk805-pwrkey.o
69+obj-$(CONFIG_INPUT_SC27XX_VIBRA) += sc27xx-vibra.o
6970 obj-$(CONFIG_INPUT_SGI_BTNS) += sgi_btns.o
7071 obj-$(CONFIG_INPUT_SIRFSOC_ONKEY) += sirfsoc-onkey.o
7172 obj-$(CONFIG_INPUT_SOC_BUTTON_ARRAY) += soc_button_array.o
drivers/input/misc/sc27xx-vibra.c+154−0
@@ -0,0 +1,154 @@
1+// SPDX-License-Identifier: GPL-2.0
2+/*
3+ * Copyright (C) 2018 Spreadtrum Communications Inc.
4+ */
5+
6+#include <linux/module.h>
7+#include <linux/of_address.h>
8+#include <linux/platform_device.h>
9+#include <linux/regmap.h>
10+#include <linux/input.h>
11+#include <linux/workqueue.h>
12+
13+#define CUR_DRV_CAL_SEL GENMASK(13, 12)
14+#define SLP_LDOVIBR_PD_EN BIT(9)
15+#define LDO_VIBR_PD BIT(8)
16+
17+struct vibra_info {
18+ struct input_dev *input_dev;
19+ struct work_struct play_work;
20+ struct regmap *regmap;
21+ u32 base;
22+ u32 strength;
23+ bool enabled;
24+};
25+
26+static void sc27xx_vibra_set(struct vibra_info *info, bool on)
27+{
28+ if (on) {
29+ regmap_update_bits(info->regmap, info->base, LDO_VIBR_PD, 0);
30+ regmap_update_bits(info->regmap, info->base,
31+ SLP_LDOVIBR_PD_EN, 0);
32+ info->enabled = true;
33+ } else {
34+ regmap_update_bits(info->regmap, info->base, LDO_VIBR_PD,
35+ LDO_VIBR_PD);
36+ regmap_update_bits(info->regmap, info->base,
37+ SLP_LDOVIBR_PD_EN, SLP_LDOVIBR_PD_EN);
38+ info->enabled = false;
39+ }
40+}
41+
42+static int sc27xx_vibra_hw_init(struct vibra_info *info)
43+{
44+ return regmap_update_bits(info->regmap, info->base, CUR_DRV_CAL_SEL, 0);
45+}
46+
47+static void sc27xx_vibra_play_work(struct work_struct *work)
48+{
49+ struct vibra_info *info = container_of(work, struct vibra_info,
50+ play_work);
51+
52+ if (info->strength && !info->enabled)
53+ sc27xx_vibra_set(info, true);
54+ else if (info->strength == 0 && info->enabled)
55+ sc27xx_vibra_set(info, false);
56+}
57+
58+static int sc27xx_vibra_play(struct input_dev *input, void *data,
59+ struct ff_effect *effect)
60+{
61+ struct vibra_info *info = input_get_drvdata(input);
62+
63+ info->strength = effect->u.rumble.weak_magnitude;
64+ schedule_work(&info->play_work);
65+
66+ return 0;
67+}
68+
69+static void sc27xx_vibra_close(struct input_dev *input)
70+{
71+ struct vibra_info *info = input_get_drvdata(input);
72+
73+ cancel_work_sync(&info->play_work);
74+ if (info->enabled)
75+ sc27xx_vibra_set(info, false);
76+}
77+
78+static int sc27xx_vibra_probe(struct platform_device *pdev)
79+{
80+ struct vibra_info *info;
81+ int error;
82+
83+ info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL);
84+ if (!info)
85+ return -ENOMEM;
86+
87+ info->regmap = dev_get_regmap(pdev->dev.parent, NULL);
88+ if (!info->regmap) {
89+ dev_err(&pdev->dev, "failed to get vibrator regmap.\n");
90+ return -ENODEV;
91+ }
92+
93+ error = device_property_read_u32(&pdev->dev, "reg", &info->base);
94+ if (error) {
95+ dev_err(&pdev->dev, "failed to get vibrator base address.\n");
96+ return error;
97+ }
98+
99+ info->input_dev = devm_input_allocate_device(&pdev->dev);
100+ if (!info->input_dev) {
101+ dev_err(&pdev->dev, "failed to allocate input device.\n");
102+ return -ENOMEM;
103+ }
104+
105+ info->input_dev->name = "sc27xx:vibrator";
106+ info->input_dev->id.version = 0;
107+ info->input_dev->close = sc27xx_vibra_close;
108+
109+ input_set_drvdata(info->input_dev, info);
110+ input_set_capability(info->input_dev, EV_FF, FF_RUMBLE);
111+ INIT_WORK(&info->play_work, sc27xx_vibra_play_work);
112+ info->enabled = false;
113+
114+ error = sc27xx_vibra_hw_init(info);
115+ if (error) {
116+ dev_err(&pdev->dev, "failed to initialize the vibrator.\n");
117+ return error;
118+ }
119+
120+ error = input_ff_create_memless(info->input_dev, NULL,
121+ sc27xx_vibra_play);
122+ if (error) {
123+ dev_err(&pdev->dev, "failed to register vibrator to FF.\n");
124+ return error;
125+ }
126+
127+ error = input_register_device(info->input_dev);
128+ if (error) {
129+ dev_err(&pdev->dev, "failed to register input device.\n");
130+ return error;
131+ }
132+
133+ return 0;
134+}
135+
136+static const struct of_device_id sc27xx_vibra_of_match[] = {
137+ { .compatible = "sprd,sc2731-vibrator", },
138+ {}
139+};
140+MODULE_DEVICE_TABLE(of, sc27xx_vibra_of_match);
141+
142+static struct platform_driver sc27xx_vibra_driver = {
143+ .driver = {
144+ .name = "sc27xx-vibrator",
145+ .of_match_table = sc27xx_vibra_of_match,
146+ },
147+ .probe = sc27xx_vibra_probe,
148+};
149+
150+module_platform_driver(sc27xx_vibra_driver);
151+
152+MODULE_DESCRIPTION("Spreadtrum SC27xx Vibrator Driver");
153+MODULE_LICENSE("GPL v2");
154+MODULE_AUTHOR("Xiaotong Lu <xiaotong.lu@spreadtrum.com>");
drivers/input/mouse/elan_i2c.h+2−0
@@ -27,6 +27,8 @@ · 26 unmodified lines
2727 #define ETP_DISABLE_POWER 0x0001
2828 #define ETP_PRESSURE_OFFSET 25
2929
30+#define ETP_CALIBRATE_MAX_LEN 3
31+
3032 /* IAP Firmware handling */
3133 #define ETP_PRODUCT_ID_FORMAT_STRING "%d.0"
3234 #define ETP_FW_NAME "elan_i2c_" ETP_PRODUCT_ID_FORMAT_STRING ".bin"
drivers/input/mouse/elan_i2c_core.c+2−1
@@ -613,7 +613,7 @@ static ssize_t calibrate_store(struct device *dev, · 612 unmodified lines
613613 int tries = 20;
614614 int retval;
615615 int error;
616− u8 val[3];
616+ u8 val[ETP_CALIBRATE_MAX_LEN];
617617
618618 retval = mutex_lock_interruptible(&data->sysfs_mutex);
619619 if (retval)
@@ -1345,6 +1345,7 @@ static const struct acpi_device_id elan_acpi_id[] = { · 725 unmodified lines
13451345 { "ELAN060C", 0 },
13461346 { "ELAN0611", 0 },
13471347 { "ELAN0612", 0 },
1348+ { "ELAN0618", 0 },
13481349 { "ELAN1000", 0 },
13491350 { }
13501351 };
drivers/input/mouse/elan_i2c_smbus.c+8−2
@@ -56,7 +56,7 @@ · 55 unmodified lines
5656 static int elan_smbus_initialize(struct i2c_client *client)
5757 {
5858 u8 check[ETP_SMBUS_HELLOPACKET_LEN] = { 0x55, 0x55, 0x55, 0x55, 0x55 };
59− u8 values[ETP_SMBUS_HELLOPACKET_LEN] = { 0, 0, 0, 0, 0 };
59+ u8 values[I2C_SMBUS_BLOCK_MAX] = {0};
6060 int len, error;
6161
6262 /* Get hello packet */
@@ -117,12 +117,16 @@ static int elan_smbus_calibrate(struct i2c_client *client) · 54 unmodified lines
117117 static int elan_smbus_calibrate_result(struct i2c_client *client, u8 *val)
118118 {
119119 int error;
120+ u8 buf[I2C_SMBUS_BLOCK_MAX] = {0};
121+
122+ BUILD_BUG_ON(ETP_CALIBRATE_MAX_LEN > sizeof(buf));
120123
121124 error = i2c_smbus_read_block_data(client,
122− ETP_SMBUS_CALIBRATE_QUERY, val);
125+ ETP_SMBUS_CALIBRATE_QUERY, buf);
123126 if (error < 0)
124127 return error;
125128
129+ memcpy(val, buf, ETP_CALIBRATE_MAX_LEN);
126130 return 0;
127131 }
128132
@@ -472,6 +476,8 @@ static int elan_smbus_get_report(struct i2c_client *client, u8 *report) · 343 unmodified lines
472476 {
473477 int len;
474478
479+ BUILD_BUG_ON(I2C_SMBUS_BLOCK_MAX > ETP_SMBUS_REPORT_LEN);
480+
475481 len = i2c_smbus_read_block_data(client,
476482 ETP_SMBUS_PACKET_QUERY,
477483 &report[ETP_SMBUS_REPORT_OFFSET]);
drivers/input/mouse/elantech.c+9−2
@@ -799,7 +799,7 @@ static int elantech_packet_check_v4(struct psmouse *psmouse) · 798 unmodified lines
799799 else if (ic_version == 7 && etd->info.samples[1] == 0x2A)
800800 sanity_check = ((packet[3] & 0x1c) == 0x10);
801801 else
802− sanity_check = ((packet[0] & 0x0c) == 0x04 &&
802+ sanity_check = ((packet[0] & 0x08) == 0x00 &&
803803 (packet[3] & 0x1c) == 0x10);
804804
805805 if (!sanity_check)
@@ -1175,6 +1175,12 @@ static const struct dmi_system_id elantech_dmi_has_middle_button[] = { · 369 unmodified lines
11751175 { }
11761176 };
11771177
1178+static const char * const middle_button_pnp_ids[] = {
1179+ "LEN2131", /* ThinkPad P52 w/ NFC */
1180+ "LEN2132", /* ThinkPad P52 */
1181+ NULL
1182+};
1183+
11781184 /*
11791185 * Set the appropriate event bits for the input subsystem
11801186 */
@@ -1194,7 +1200,8 @@ static int elantech_set_input_params(struct psmouse *psmouse) · 13 unmodified lines
11941200 __clear_bit(EV_REL, dev->evbit);
11951201
11961202 __set_bit(BTN_LEFT, dev->keybit);
1197− if (dmi_check_system(elantech_dmi_has_middle_button))
1203+ if (dmi_check_system(elantech_dmi_has_middle_button) ||
1204+ psmouse_matches_pnp_id(psmouse, middle_button_pnp_ids))
11981205 __set_bit(BTN_MIDDLE, dev->keybit);
11991206 __set_bit(BTN_RIGHT, dev->keybit);
12001207
drivers/input/mouse/psmouse-base.c+6−6
@@ -192,8 +192,8 @@ psmouse_ret_t psmouse_process_byte(struct psmouse *psmouse) · 191 unmodified lines
192192 else
193193 input_report_rel(dev, REL_WHEEL, -wheel);
194194
195− input_report_key(dev, BTN_SIDE, BIT(4));
196− input_report_key(dev, BTN_EXTRA, BIT(5));
195+ input_report_key(dev, BTN_SIDE, packet[3] & BIT(4));
196+ input_report_key(dev, BTN_EXTRA, packet[3] & BIT(5));
197197 break;
198198 }
199199 break;
@@ -203,13 +203,13 @@ psmouse_ret_t psmouse_process_byte(struct psmouse *psmouse) · 3 unmodified lines
203203 input_report_rel(dev, REL_WHEEL, -(s8) packet[3]);
204204
205205 /* Extra buttons on Genius NewNet 3D */
206− input_report_key(dev, BTN_SIDE, BIT(6));
207− input_report_key(dev, BTN_EXTRA, BIT(7));
206+ input_report_key(dev, BTN_SIDE, packet[0] & BIT(6));
207+ input_report_key(dev, BTN_EXTRA, packet[0] & BIT(7));
208208 break;
209209
210210 case PSMOUSE_THINKPS:
211211 /* Extra button on ThinkingMouse */
212− input_report_key(dev, BTN_EXTRA, BIT(3));
212+ input_report_key(dev, BTN_EXTRA, packet[0] & BIT(3));
213213
214214 /*
215215 * Without this bit of weirdness moving up gives wildly
@@ -223,7 +223,7 @@ psmouse_ret_t psmouse_process_byte(struct psmouse *psmouse) · 7 unmodified lines
223223 * Cortron PS2 Trackball reports SIDE button in the
224224 * 4th bit of the first byte.
225225 */
226− input_report_key(dev, BTN_SIDE, BIT(3));
226+ input_report_key(dev, BTN_SIDE, packet[0] & BIT(3));
227227 packet[0] |= BIT(3);
228228 break;
229229
drivers/input/rmi4/Kconfig+1−0
@@ -3,6 +3,7 @@ · 2 unmodified lines
33 #
44 config RMI4_CORE
55 tristate "Synaptics RMI4 bus support"
6+ select IRQ_DOMAIN
67 help
78 Say Y here if you want to support the Synaptics RMI4 bus. This is
89 required for all RMI4 device support.
drivers/input/rmi4/rmi_2d_sensor.c+16−18
@@ -32,15 +32,15 @@ void rmi_2d_sensor_abs_process(struct rmi_2d_sensor *sensor, · 31 unmodified lines
3232 if (obj->type == RMI_2D_OBJECT_NONE)
3333 return;
3434
35− if (axis_align->swap_axes)
36− swap(obj->x, obj->y);
37−
3835 if (axis_align->flip_x)
3936 obj->x = sensor->max_x - obj->x;
4037
4138 if (axis_align->flip_y)
4239 obj->y = sensor->max_y - obj->y;
4340
41+ if (axis_align->swap_axes)
42+ swap(obj->x, obj->y);
43+
4444 /*
4545 * Here checking if X offset or y offset are specified is
4646 * redundant. We just add the offsets or clip the values.
@@ -120,15 +120,15 @@ void rmi_2d_sensor_rel_report(struct rmi_2d_sensor *sensor, int x, int y) · 73 unmodified lines
120120 x = min(RMI_2D_REL_POS_MAX, max(RMI_2D_REL_POS_MIN, (int)x));
121121 y = min(RMI_2D_REL_POS_MAX, max(RMI_2D_REL_POS_MIN, (int)y));
122122
123− if (axis_align->swap_axes)
124− swap(x, y);
125−
126123 if (axis_align->flip_x)
127124 x = min(RMI_2D_REL_POS_MAX, -x);
128125
129126 if (axis_align->flip_y)
130127 y = min(RMI_2D_REL_POS_MAX, -y);
131128
129+ if (axis_align->swap_axes)
130+ swap(x, y);
131+
132132 if (x || y) {
133133 input_report_rel(sensor->input, REL_X, x);
134134 input_report_rel(sensor->input, REL_Y, y);
@@ -141,17 +141,10 @@ static void rmi_2d_sensor_set_input_params(struct rmi_2d_sensor *sensor) · 6 unmodified lines
141141 struct input_dev *input = sensor->input;
142142 int res_x;
143143 int res_y;
144+ int max_x, max_y;
144145 int input_flags = 0;
145146
146147 if (sensor->report_abs) {
147− if (sensor->axis_align.swap_axes) {
148− swap(sensor->max_x, sensor->max_y);
149− swap(sensor->axis_align.clip_x_low,
150− sensor->axis_align.clip_y_low);
151− swap(sensor->axis_align.clip_x_high,
152− sensor->axis_align.clip_y_high);
153− }
154−
155148 sensor->min_x = sensor->axis_align.clip_x_low;
156149 if (sensor->axis_align.clip_x_high)
157150 sensor->max_x = min(sensor->max_x,
@@ -163,14 +156,19 @@ static void rmi_2d_sensor_set_input_params(struct rmi_2d_sensor *sensor) · 5 unmodified lines
163156 sensor->axis_align.clip_y_high);
164157
165158 set_bit(EV_ABS, input->evbit);
166− input_set_abs_params(input, ABS_MT_POSITION_X, 0, sensor->max_x,
167− 0, 0);
168− input_set_abs_params(input, ABS_MT_POSITION_Y, 0, sensor->max_y,
169− 0, 0);
159+
160+ max_x = sensor->max_x;
161+ max_y = sensor->max_y;
162+ if (sensor->axis_align.swap_axes)
163+ swap(max_x, max_y);
164+ input_set_abs_params(input, ABS_MT_POSITION_X, 0, max_x, 0, 0);
165+ input_set_abs_params(input, ABS_MT_POSITION_Y, 0, max_y, 0, 0);
170166
171167 if (sensor->x_mm && sensor->y_mm) {
172168 res_x = (sensor->max_x - sensor->min_x) / sensor->x_mm;
173169 res_y = (sensor->max_y - sensor->min_y) / sensor->y_mm;
170+ if (sensor->axis_align.swap_axes)
171+ swap(res_x, res_y);
174172
175173 input_abs_set_res(input, ABS_X, res_x);
176174 input_abs_set_res(input, ABS_Y, res_y);
drivers/input/rmi4/rmi_bus.c+49−1
@@ -9,6 +9,8 @@ · 8 unmodified lines
99
1010 #include <linux/kernel.h>
1111 #include <linux/device.h>
12+#include <linux/irq.h>
13+#include <linux/irqdomain.h>
1214 #include <linux/list.h>
1315 #include <linux/pm.h>
1416 #include <linux/rmi.h>
@@ -167,6 +169,39 @@ static inline void rmi_function_of_probe(struct rmi_function *fn) · 152 unmodified lines
167169 {}
168170 #endif
169171
172+static struct irq_chip rmi_irq_chip = {
173+ .name = "rmi4",
174+};
175+
176+static int rmi_create_function_irq(struct rmi_function *fn,
177+ struct rmi_function_handler *handler)
178+{
179+ struct rmi_driver_data *drvdata = dev_get_drvdata(&fn->rmi_dev->dev);
180+ int i, error;
181+
182+ for (i = 0; i < fn->num_of_irqs; i++) {
183+ set_bit(fn->irq_pos + i, fn->irq_mask);
184+
185+ fn->irq[i] = irq_create_mapping(drvdata->irqdomain,
186+ fn->irq_pos + i);
187+
188+ irq_set_chip_data(fn->irq[i], fn);
189+ irq_set_chip_and_handler(fn->irq[i], &rmi_irq_chip,
190+ handle_simple_irq);
191+ irq_set_nested_thread(fn->irq[i], 1);
192+
193+ error = devm_request_threaded_irq(&fn->dev, fn->irq[i], NULL,
194+ handler->attention, IRQF_ONESHOT,
195+ dev_name(&fn->dev), fn);
196+ if (error) {
197+ dev_err(&fn->dev, "Error %d registering IRQ\n", error);
198+ return error;
199+ }
200+ }
201+
202+ return 0;
203+}
204+
170205 static int rmi_function_probe(struct device *dev)
171206 {
172207 struct rmi_function *fn = to_rmi_function(dev);
@@ -178,7 +213,14 @@ static int rmi_function_probe(struct device *dev) · 5 unmodified lines
178213
179214 if (handler->probe) {
180215 error = handler->probe(fn);
181− return error;
216+ if (error)
217+ return error;
218+ }
219+
220+ if (fn->num_of_irqs && handler->attention) {
221+ error = rmi_create_function_irq(fn, handler);
222+ if (error)
223+ return error;
182224 }
183225
184226 return 0;
@@ -230,12 +272,18 @@ err_put_device: · 45 unmodified lines
230272
231273 void rmi_unregister_function(struct rmi_function *fn)
232274 {
275+ int i;
276+
233277 rmi_dbg(RMI_DEBUG_CORE, &fn->dev, "Unregistering F%02X.\n",
234278 fn->fd.function_number);
235279
236280 device_del(&fn->dev);
237281 of_node_put(fn->dev.of_node);
238282 put_device(&fn->dev);
283+
284+ for (i = 0; i < fn->num_of_irqs; i++)
285+ irq_dispose_mapping(fn->irq[i]);
286+
239287 }
240288
241289 /**
drivers/input/rmi4/rmi_bus.h+9−1
@@ -14,6 +14,12 @@ · 13 unmodified lines
1414
1515 struct rmi_device;
1616
17+/*
18+ * The interrupt source count in the function descriptor can represent up to
19+ * 6 interrupt sources in the normal manner.
20+ */
21+#define RMI_FN_MAX_IRQS 6
22+
1723 /**
1824 * struct rmi_function - represents the implementation of an RMI4
1925 * function for a particular device (basically, a driver for that RMI4 function)
@@ -26,6 +32,7 @@ struct rmi_device; · 6 unmodified lines
2632 * @irq_pos: The position in the irq bitfield this function holds
2733 * @irq_mask: For convenience, can be used to mask IRQ bits off during ATTN
2834 * interrupt handling.
35+ * @irqs: assigned virq numbers (up to num_of_irqs)
2936 *
3037 * @node: entry in device's list of functions
3138 */
@@ -36,6 +43,7 @@ struct rmi_function { · 4 unmodified lines
3643 struct list_head node;
3744
3845 unsigned int num_of_irqs;
46+ int irq[RMI_FN_MAX_IRQS];
3947 unsigned int irq_pos;
4048 unsigned long irq_mask[];
4149 };
@@ -76,7 +84,7 @@ struct rmi_function_handler { · 34 unmodified lines
7684 void (*remove)(struct rmi_function *fn);
7785 int (*config)(struct rmi_function *fn);
7886 int (*reset)(struct rmi_function *fn);
79− int (*attention)(struct rmi_function *fn, unsigned long *irq_bits);
87+ irqreturn_t (*attention)(int irq, void *ctx);
8088 int (*suspend)(struct rmi_function *fn);
8189 int (*resume)(struct rmi_function *fn);
8290 };
drivers/input/rmi4/rmi_driver.c+20−32
@@ -21,6 +21,7 @@ · 20 unmodified lines
2121 #include <linux/pm.h>
2222 #include <linux/slab.h>
2323 #include <linux/of.h>
24+#include <linux/irqdomain.h>
2425 #include <uapi/linux/input.h>
2526 #include <linux/rmi.h>
2627 #include "rmi_bus.h"
@@ -127,28 +128,11 @@ static int rmi_driver_process_config_requests(struct rmi_device *rmi_dev) · 100 unmodified lines
127128 return 0;
128129 }
129130
130−static void process_one_interrupt(struct rmi_driver_data *data,
131− struct rmi_function *fn)
132−{
133− struct rmi_function_handler *fh;
134−
135− if (!fn || !fn->dev.driver)
136− return;
137−
138− fh = to_rmi_function_handler(fn->dev.driver);
139− if (fh->attention) {
140− bitmap_and(data->fn_irq_bits, data->irq_status, fn->irq_mask,
141− data->irq_count);
142− if (!bitmap_empty(data->fn_irq_bits, data->irq_count))
143− fh->attention(fn, data->fn_irq_bits);
144− }
145−}
146−
147131 static int rmi_process_interrupt_requests(struct rmi_device *rmi_dev)
148132 {
149133 struct rmi_driver_data *data = dev_get_drvdata(&rmi_dev->dev);
150134 struct device *dev = &rmi_dev->dev;
151− struct rmi_function *entry;
135+ int i;
152136 int error;
153137
154138 if (!data)
@@ -173,16 +157,8 @@ static int rmi_process_interrupt_requests(struct rmi_device *rmi_dev) · 18 unmodified lines
173157 */
174158 mutex_unlock(&data->irq_mutex);
175159
176− /*
177− * It would be nice to be able to use irq_chip to handle these
178− * nested IRQs. Unfortunately, most of the current customers for
179− * this driver are using older kernels (3.0.x) that don't support
180− * the features required for that. Once they've shifted to more
181− * recent kernels (say, 3.3 and higher), this should be switched to
182− * use irq_chip.
183− */
184− list_for_each_entry(entry, &data->function_list, node)
185− process_one_interrupt(data, entry);
160+ for_each_set_bit(i, data->irq_status, data->irq_count)
161+ handle_nested_irq(irq_find_mapping(data->irqdomain, i));
186162
187163 if (data->input)
188164 input_sync(data->input);
@@ -1001,9 +977,13 @@ EXPORT_SYMBOL_GPL(rmi_driver_resume); · 812 unmodified lines
1001977 static int rmi_driver_remove(struct device *dev)
1002978 {
1003979 struct rmi_device *rmi_dev = to_rmi_device(dev);
980+ struct rmi_driver_data *data = dev_get_drvdata(&rmi_dev->dev);
1004981
1005982 rmi_disable_irq(rmi_dev, false);
1006983
984+ irq_domain_remove(data->irqdomain);
985+ data->irqdomain = NULL;
986+
1007987 rmi_f34_remove_sysfs(rmi_dev);
1008988 rmi_free_function_list(rmi_dev);
1009989
@@ -1035,7 +1015,8 @@ int rmi_probe_interrupts(struct rmi_driver_data *data) · 25 unmodified lines
10351015 {
10361016 struct rmi_device *rmi_dev = data->rmi_dev;
10371017 struct device *dev = &rmi_dev->dev;
1038− int irq_count;
1018+ struct fwnode_handle *fwnode = rmi_dev->xport->dev->fwnode;
1019+ int irq_count = 0;
10391020 size_t size;
10401021 int retval;
10411022
@@ -1046,7 +1027,6 @@ int rmi_probe_interrupts(struct rmi_driver_data *data) · 4 unmodified lines
10461027 * being accessed.
10471028 */
10481029 rmi_dbg(RMI_DEBUG_CORE, dev, "%s: Counting IRQs.\n", __func__);
1049− irq_count = 0;
10501030 data->bootloader_mode = false;
10511031
10521032 retval = rmi_scan_pdt(rmi_dev, &irq_count, rmi_count_irqs);
@@ -1058,6 +1038,15 @@ int rmi_probe_interrupts(struct rmi_driver_data *data) · 5 unmodified lines
10581038 if (data->bootloader_mode)
10591039 dev_warn(dev, "Device in bootloader mode.\n");
10601040
1041+ /* Allocate and register a linear revmap irq_domain */
1042+ data->irqdomain = irq_domain_create_linear(fwnode, irq_count,
1043+ &irq_domain_simple_ops,
1044+ data);
1045+ if (!data->irqdomain) {
1046+ dev_err(&rmi_dev->dev, "Failed to create IRQ domain\n");
1047+ return -ENOMEM;
1048+ }
1049+
10611050 data->irq_count = irq_count;
10621051 data->num_of_irq_regs = (data->irq_count + 7) / 8;
10631052
@@ -1080,10 +1069,9 @@ int rmi_init_functions(struct rmi_driver_data *data) · 16 unmodified lines
10801069 {
10811070 struct rmi_device *rmi_dev = data->rmi_dev;
10821071 struct device *dev = &rmi_dev->dev;
1083− int irq_count;
1072+ int irq_count = 0;
10841073 int retval;
10851074
1086− irq_count = 0;
10871075 rmi_dbg(RMI_DEBUG_CORE, dev, "%s: Creating functions.\n", __func__);
10881076 retval = rmi_scan_pdt(rmi_dev, &irq_count, rmi_create_function);
10891077 if (retval < 0) {
drivers/input/rmi4/rmi_f01.c+5−5
@@ -681,9 +681,9 @@ static int rmi_f01_resume(struct rmi_function *fn) · 680 unmodified lines
681681 return 0;
682682 }
683683
684−static int rmi_f01_attention(struct rmi_function *fn,
685− unsigned long *irq_bits)
684+static irqreturn_t rmi_f01_attention(int irq, void *ctx)
686685 {
686+ struct rmi_function *fn = ctx;
687687 struct rmi_device *rmi_dev = fn->rmi_dev;
688688 int error;
689689 u8 device_status;
@@ -692,7 +692,7 @@ static int rmi_f01_attention(struct rmi_function *fn, · 2 unmodified lines
692692 if (error) {
693693 dev_err(&fn->dev,
694694 "Failed to read device status: %d.\n", error);
695− return error;
695+ return IRQ_RETVAL(error);
696696 }
697697
698698 if (RMI_F01_STATUS_BOOTLOADER(device_status))
@@ -704,11 +704,11 @@ static int rmi_f01_attention(struct rmi_function *fn, · 5 unmodified lines
704704 error = rmi_dev->driver->reset_handler(rmi_dev);
705705 if (error) {
706706 dev_err(&fn->dev, "Device reset failed: %d\n", error);
707− return error;
707+ return IRQ_RETVAL(error);
708708 }
709709 }
710710
711− return 0;
711+ return IRQ_HANDLED;
712712 }
713713
714714 struct rmi_function_handler rmi_f01_handler = {
drivers/input/rmi4/rmi_f03.c+5−4
@@ -244,8 +244,9 @@ static int rmi_f03_config(struct rmi_function *fn) · 243 unmodified lines
244244 return 0;
245245 }
246246
247−static int rmi_f03_attention(struct rmi_function *fn, unsigned long *irq_bits)
247+static irqreturn_t rmi_f03_attention(int irq, void *ctx)
248248 {
249+ struct rmi_function *fn = ctx;
249250 struct rmi_device *rmi_dev = fn->rmi_dev;
250251 struct rmi_driver_data *drvdata = dev_get_drvdata(&rmi_dev->dev);
251252 struct f03_data *f03 = dev_get_drvdata(&fn->dev);
@@ -262,7 +263,7 @@ static int rmi_f03_attention(struct rmi_function *fn, unsigned long *irq_bits) · 10 unmodified lines
262263 /* First grab the data passed by the transport device */
263264 if (drvdata->attn_data.size < ob_len) {
264265 dev_warn(&fn->dev, "F03 interrupted, but data is missing!\n");
265− return 0;
266+ return IRQ_HANDLED;
266267 }
267268
268269 memcpy(obs, drvdata->attn_data.data, ob_len);
@@ -277,7 +278,7 @@ static int rmi_f03_attention(struct rmi_function *fn, unsigned long *irq_bits) · 8 unmodified lines
277278 "%s: Failed to read F03 output buffers: %d\n",
278279 __func__, error);
279280 serio_interrupt(f03->serio, 0, SERIO_TIMEOUT);
280− return error;
281+ return IRQ_RETVAL(error);
281282 }
282283 }
283284
@@ -303,7 +304,7 @@ static int rmi_f03_attention(struct rmi_function *fn, unsigned long *irq_bits) · 19 unmodified lines
303304 serio_interrupt(f03->serio, ob_data, serio_flags);
304305 }
305306
306− return 0;
307+ return IRQ_HANDLED;
307308 }
308309
309310 static void rmi_f03_remove(struct rmi_function *fn)
drivers/input/rmi4/rmi_f11.c+16−26
@@ -570,9 +570,7 @@ static inline u8 rmi_f11_parse_finger_state(const u8 *f_state, u8 n_finger) · 569 unmodified lines
570570 }
571571
572572 static void rmi_f11_finger_handler(struct f11_data *f11,
573− struct rmi_2d_sensor *sensor,
574− unsigned long *irq_bits, int num_irq_regs,
575− int size)
573+ struct rmi_2d_sensor *sensor, int size)
576574 {
577575 const u8 *f_state = f11->data.f_state;
578576 u8 finger_state;
@@ -581,12 +579,7 @@ static void rmi_f11_finger_handler(struct f11_data *f11, · 2 unmodified lines
581579 int rel_fingers;
582580 int abs_size = sensor->nbr_fingers * RMI_F11_ABS_BYTES;
583581
584− int abs_bits = bitmap_and(f11->result_bits, irq_bits, f11->abs_mask,
585− num_irq_regs * 8);
586− int rel_bits = bitmap_and(f11->result_bits, irq_bits, f11->rel_mask,
587− num_irq_regs * 8);
588−
589− if (abs_bits) {
582+ if (sensor->report_abs) {
590583 if (abs_size > size)
591584 abs_fingers = size / RMI_F11_ABS_BYTES;
592585 else
@@ -604,19 +597,7 @@ static void rmi_f11_finger_handler(struct f11_data *f11, · 11 unmodified lines
604597 rmi_f11_abs_pos_process(f11, sensor, &sensor->objs[i],
605598 finger_state, i);
606599 }
607− }
608600
609− if (rel_bits) {
610− if ((abs_size + sensor->nbr_fingers * RMI_F11_REL_BYTES) > size)
611− rel_fingers = (size - abs_size) / RMI_F11_REL_BYTES;
612− else
613− rel_fingers = sensor->nbr_fingers;
614−
615− for (i = 0; i < rel_fingers; i++)
616− rmi_f11_rel_pos_report(f11, i);
617− }
618−
619− if (abs_bits) {
620601 /*
621602 * the absolute part is made in 2 parts to allow the kernel
622603 * tracking to take place.
@@ -638,7 +619,16 @@ static void rmi_f11_finger_handler(struct f11_data *f11, · 15 unmodified lines
638619 }
639620
640621 input_mt_sync_frame(sensor->input);
622+ } else if (sensor->report_rel) {
623+ if ((abs_size + sensor->nbr_fingers * RMI_F11_REL_BYTES) > size)
624+ rel_fingers = (size - abs_size) / RMI_F11_REL_BYTES;
625+ else
626+ rel_fingers = sensor->nbr_fingers;
627+
628+ for (i = 0; i < rel_fingers; i++)
629+ rmi_f11_rel_pos_report(f11, i);
641630 }
631+
642632 }
643633
644634 static int f11_2d_construct_data(struct f11_data *f11)
@@ -1276,8 +1266,9 @@ static int rmi_f11_config(struct rmi_function *fn) · 631 unmodified lines
12761266 return 0;
12771267 }
12781268
1279−static int rmi_f11_attention(struct rmi_function *fn, unsigned long *irq_bits)
1269+static irqreturn_t rmi_f11_attention(int irq, void *ctx)
12801270 {
1271+ struct rmi_function *fn = ctx;
12811272 struct rmi_device *rmi_dev = fn->rmi_dev;
12821273 struct rmi_driver_data *drvdata = dev_get_drvdata(&rmi_dev->dev);
12831274 struct f11_data *f11 = dev_get_drvdata(&fn->dev);
@@ -1303,13 +1294,12 @@ static int rmi_f11_attention(struct rmi_function *fn, unsigned long *irq_bits) · 19 unmodified lines
13031294 data_base_addr, f11->sensor.data_pkt,
13041295 f11->sensor.pkt_size);
13051296 if (error < 0)
1306− return error;
1297+ return IRQ_RETVAL(error);
13071298 }
13081299
1309− rmi_f11_finger_handler(f11, &f11->sensor, irq_bits,
1310− drvdata->num_of_irq_regs, valid_bytes);
1300+ rmi_f11_finger_handler(f11, &f11->sensor, valid_bytes);
13111301
1312− return 0;
1302+ return IRQ_HANDLED;
13131303 }
13141304
13151305 static int rmi_f11_resume(struct rmi_function *fn)
drivers/input/rmi4/rmi_f12.c+4−4
@@ -197,10 +197,10 @@ static void rmi_f12_process_objects(struct f12_data *f12, u8 *data1, int size) · 196 unmodified lines
197197 rmi_2d_sensor_abs_report(sensor, &sensor->objs[i], i);
198198 }
199199
200−static int rmi_f12_attention(struct rmi_function *fn,
201− unsigned long *irq_nr_regs)
200+static irqreturn_t rmi_f12_attention(int irq, void *ctx)
202201 {
203202 int retval;
203+ struct rmi_function *fn = ctx;
204204 struct rmi_device *rmi_dev = fn->rmi_dev;
205205 struct rmi_driver_data *drvdata = dev_get_drvdata(&rmi_dev->dev);
206206 struct f12_data *f12 = dev_get_drvdata(&fn->dev);
@@ -222,7 +222,7 @@ static int rmi_f12_attention(struct rmi_function *fn, · 15 unmodified lines
222222 if (retval < 0) {
223223 dev_err(&fn->dev, "Failed to read object data. Code: %d.\n",
224224 retval);
225− return retval;
225+ return IRQ_RETVAL(retval);
226226 }
227227 }
228228
@@ -232,7 +232,7 @@ static int rmi_f12_attention(struct rmi_function *fn, · 3 unmodified lines
232232
233233 input_mt_sync_frame(sensor->input);
234234
235− return 0;
235+ return IRQ_HANDLED;
236236 }
237237
238238 static int rmi_f12_write_control_regs(struct rmi_function *fn)
drivers/input/rmi4/rmi_f30.c+5−4
@@ -122,8 +122,9 @@ static void rmi_f30_report_button(struct rmi_function *fn, · 121 unmodified lines
122122 }
123123 }
124124
125−static int rmi_f30_attention(struct rmi_function *fn, unsigned long *irq_bits)
125+static irqreturn_t rmi_f30_attention(int irq, void *ctx)
126126 {
127+ struct rmi_function *fn = ctx;
127128 struct f30_data *f30 = dev_get_drvdata(&fn->dev);
128129 struct rmi_driver_data *drvdata = dev_get_drvdata(&fn->rmi_dev->dev);
129130 int error;
@@ -134,7 +135,7 @@ static int rmi_f30_attention(struct rmi_function *fn, unsigned long *irq_bits) · 4 unmodified lines
134135 if (drvdata->attn_data.size < f30->register_count) {
135136 dev_warn(&fn->dev,
136137 "F30 interrupted, but data is missing\n");
137− return 0;
138+ return IRQ_HANDLED;
138139 }
139140 memcpy(f30->data_regs, drvdata->attn_data.data,
140141 f30->register_count);
@@ -147,7 +148,7 @@ static int rmi_f30_attention(struct rmi_function *fn, unsigned long *irq_bits) · 6 unmodified lines
147148 dev_err(&fn->dev,
148149 "%s: Failed to read F30 data registers: %d\n",
149150 __func__, error);
150− return error;
151+ return IRQ_RETVAL(error);
151152 }
152153 }
153154
@@ -159,7 +160,7 @@ static int rmi_f30_attention(struct rmi_function *fn, unsigned long *irq_bits) · 5 unmodified lines
159160 rmi_f03_commit_buttons(f30->f03);
160161 }
161162
162− return 0;
163+ return IRQ_HANDLED;
163164 }
164165
165166 static int rmi_f30_config(struct rmi_function *fn)
drivers/input/rmi4/rmi_f34.c+3−2
@@ -100,8 +100,9 @@ static int rmi_f34_command(struct f34_data *f34, u8 command, · 99 unmodified lines
100100 return 0;
101101 }
102102
103−static int rmi_f34_attention(struct rmi_function *fn, unsigned long *irq_bits)
103+static irqreturn_t rmi_f34_attention(int irq, void *ctx)
104104 {
105+ struct rmi_function *fn = ctx;
105106 struct f34_data *f34 = dev_get_drvdata(&fn->dev);
106107 int ret;
107108 u8 status;
@@ -126,7 +127,7 @@ static int rmi_f34_attention(struct rmi_function *fn, unsigned long *irq_bits) · 18 unmodified lines
126127 complete(&f34->v7.cmd_done);
127128 }
128129
129− return 0;
130+ return IRQ_HANDLED;
130131 }
131132
132133 static int rmi_f34_write_blocks(struct f34_data *f34, const void *data,
drivers/input/rmi4/rmi_f54.c+0−6
@@ -610,11 +610,6 @@ error: · 609 unmodified lines
610610 mutex_unlock(&f54->data_mutex);
611611 }
612612
613−static int rmi_f54_attention(struct rmi_function *fn, unsigned long *irqbits)
614−{
615− return 0;
616−}
617−
618613 static int rmi_f54_config(struct rmi_function *fn)
619614 {
620615 struct rmi_driver *drv = fn->rmi_dev->driver;
@@ -756,6 +751,5 @@ struct rmi_function_handler rmi_f54_handler = { · 135 unmodified lines
756751 .func = 0x54,
757752 .probe = rmi_f54_probe,
758753 .config = rmi_f54_config,
759− .attention = rmi_f54_attention,
760754 .remove = rmi_f54_remove,
761755 };
drivers/input/touchscreen/silead.c+1−0
@@ -603,6 +603,7 @@ static const struct acpi_device_id silead_ts_acpi_match[] = { · 602 unmodified lines
603603 { "GSL3692", 0 },
604604 { "MSSL1680", 0 },
605605 { "MSSL0001", 0 },
606+ { "MSSL0002", 0 },
606607 { }
607608 };
608609 MODULE_DEVICE_TABLE(acpi, silead_ts_acpi_match);
drivers/irqchip/irq-gic-v2m.c+1−1
@@ -199,7 +199,7 @@ static int gicv2m_irq_domain_alloc(struct irq_domain *domain, unsigned int virq, · 198 unmodified lines
199199
200200 fail:
201201 irq_domain_free_irqs_parent(domain, virq, nr_irqs);
202− gicv2m_unalloc_msi(v2m, hwirq, get_count_order(nr_irqs));
202+ gicv2m_unalloc_msi(v2m, hwirq, nr_irqs);
203203 return err;
204204 }
205205
drivers/irqchip/irq-gic-v3-its.c+50−12
@@ -182,6 +182,22 @@ static struct its_collection *dev_event_to_col(struct its_device *its_dev, · 181 unmodified lines
182182 return its->collections + its_dev->event_map.col_map[event];
183183 }
184184
185+static struct its_collection *valid_col(struct its_collection *col)
186+{
187+ if (WARN_ON_ONCE(col->target_address & GENMASK_ULL(0, 15)))
188+ return NULL;
189+
190+ return col;
191+}
192+
193+static struct its_vpe *valid_vpe(struct its_node *its, struct its_vpe *vpe)
194+{
195+ if (valid_col(its->collections + vpe->col_idx))
196+ return vpe;
197+
198+ return NULL;
199+}
200+
185201 /*
186202 * ITS command descriptors - parameters to be encoded in a command
187203 * block.
@@ -439,7 +455,7 @@ static struct its_collection *its_build_mapti_cmd(struct its_node *its, · 251 unmodified lines
439455
440456 its_fixup_cmd(cmd);
441457
442− return col;
458+ return valid_col(col);
443459 }
444460
445461 static struct its_collection *its_build_movi_cmd(struct its_node *its,
@@ -458,7 +474,7 @@ static struct its_collection *its_build_movi_cmd(struct its_node *its, · 12 unmodified lines
458474
459475 its_fixup_cmd(cmd);
460476
461− return col;
477+ return valid_col(col);
462478 }
463479
464480 static struct its_collection *its_build_discard_cmd(struct its_node *its,
@@ -476,7 +492,7 @@ static struct its_collection *its_build_discard_cmd(struct its_node *its, · 11 unmodified lines
476492
477493 its_fixup_cmd(cmd);
478494
479− return col;
495+ return valid_col(col);
480496 }
481497
482498 static struct its_collection *its_build_inv_cmd(struct its_node *its,
@@ -494,7 +510,7 @@ static struct its_collection *its_build_inv_cmd(struct its_node *its, · 11 unmodified lines
494510
495511 its_fixup_cmd(cmd);
496512
497− return col;
513+ return valid_col(col);
498514 }
499515
500516 static struct its_collection *its_build_int_cmd(struct its_node *its,
@@ -512,7 +528,7 @@ static struct its_collection *its_build_int_cmd(struct its_node *its, · 11 unmodified lines
512528
513529 its_fixup_cmd(cmd);
514530
515− return col;
531+ return valid_col(col);
516532 }
517533
518534 static struct its_collection *its_build_clear_cmd(struct its_node *its,
@@ -530,7 +546,7 @@ static struct its_collection *its_build_clear_cmd(struct its_node *its, · 11 unmodified lines
530546
531547 its_fixup_cmd(cmd);
532548
533− return col;
549+ return valid_col(col);
534550 }
535551
536552 static struct its_collection *its_build_invall_cmd(struct its_node *its,
@@ -554,7 +570,7 @@ static struct its_vpe *its_build_vinvall_cmd(struct its_node *its, · 17 unmodified lines
554570
555571 its_fixup_cmd(cmd);
556572
557− return desc->its_vinvall_cmd.vpe;
573+ return valid_vpe(its, desc->its_vinvall_cmd.vpe);
558574 }
559575
560576 static struct its_vpe *its_build_vmapp_cmd(struct its_node *its,
@@ -576,7 +592,7 @@ static struct its_vpe *its_build_vmapp_cmd(struct its_node *its, · 15 unmodified lines
576592
577593 its_fixup_cmd(cmd);
578594
579− return desc->its_vmapp_cmd.vpe;
595+ return valid_vpe(its, desc->its_vmapp_cmd.vpe);
580596 }
581597
582598 static struct its_vpe *its_build_vmapti_cmd(struct its_node *its,
@@ -599,7 +615,7 @@ static struct its_vpe *its_build_vmapti_cmd(struct its_node *its, · 16 unmodified lines
599615
600616 its_fixup_cmd(cmd);
601617
602− return desc->its_vmapti_cmd.vpe;
618+ return valid_vpe(its, desc->its_vmapti_cmd.vpe);
603619 }
604620
605621 static struct its_vpe *its_build_vmovi_cmd(struct its_node *its,
@@ -622,7 +638,7 @@ static struct its_vpe *its_build_vmovi_cmd(struct its_node *its, · 16 unmodified lines
622638
623639 its_fixup_cmd(cmd);
624640
625− return desc->its_vmovi_cmd.vpe;
641+ return valid_vpe(its, desc->its_vmovi_cmd.vpe);
626642 }
627643
628644 static struct its_vpe *its_build_vmovp_cmd(struct its_node *its,
@@ -640,7 +656,7 @@ static struct its_vpe *its_build_vmovp_cmd(struct its_node *its, · 11 unmodified lines
640656
641657 its_fixup_cmd(cmd);
642658
643− return desc->its_vmovp_cmd.vpe;
659+ return valid_vpe(its, desc->its_vmovp_cmd.vpe);
644660 }
645661
646662 static u64 its_cmd_ptr_to_offset(struct its_node *its,
@@ -1824,11 +1840,16 @@ static int its_alloc_tables(struct its_node *its) · 1177 unmodified lines
18241840
18251841 static int its_alloc_collections(struct its_node *its)
18261842 {
1843+ int i;
1844+
18271845 its->collections = kcalloc(nr_cpu_ids, sizeof(*its->collections),
18281846 GFP_KERNEL);
18291847 if (!its->collections)
18301848 return -ENOMEM;
18311849
1850+ for (i = 0; i < nr_cpu_ids; i++)
1851+ its->collections[i].target_address = ~0ULL;
1852+
18321853 return 0;
18331854 }
18341855
@@ -2310,7 +2331,14 @@ static int its_irq_domain_activate(struct irq_domain *domain, · 475 unmodified lines
23102331 cpu_mask = cpumask_of_node(its_dev->its->numa_node);
23112332
23122333 /* Bind the LPI to the first possible CPU */
2313− cpu = cpumask_first(cpu_mask);
2334+ cpu = cpumask_first_and(cpu_mask, cpu_online_mask);
2335+ if (cpu >= nr_cpu_ids) {
2336+ if (its_dev->its->flags & ITS_FLAGS_WORKAROUND_CAVIUM_23144)
2337+ return -EINVAL;
2338+
2339+ cpu = cpumask_first(cpu_online_mask);
2340+ }
2341+
23142342 its_dev->event_map.col_map[event] = cpu;
23152343 irq_data_update_effective_affinity(d, cpumask_of(cpu));
23162344
@@ -3399,6 +3427,16 @@ static int redist_disable_lpis(void) · 1082 unmodified lines
33993427 u64 timeout = USEC_PER_SEC;
34003428 u64 val;
34013429
3430+ /*
3431+ * If coming via a CPU hotplug event, we don't need to disable
3432+ * LPIs before trying to re-enable them. They are already
3433+ * configured and all is well in the world. Detect this case
3434+ * by checking the allocation of the pending table for the
3435+ * current CPU.
3436+ */
3437+ if (gic_data_rdist()->pend_page)
3438+ return 0;
3439+
34023440 if (!gic_rdists_supports_plpis()) {
34033441 pr_info("CPU%d: LPIs not supported\n", smp_processor_id());
34043442 return -ENXIO;
drivers/irqchip/irq-ls-scfg-msi.c+7−3
@@ -93,8 +93,12 @@ static void ls_scfg_msi_compose_msg(struct irq_data *data, struct msi_msg *msg) · 92 unmodified lines
9393 msg->address_lo = lower_32_bits(msi_data->msiir_addr);
9494 msg->data = data->hwirq;
9595
96− if (msi_affinity_flag)
97− msg->data |= cpumask_first(data->common->affinity);
96+ if (msi_affinity_flag) {
97+ const struct cpumask *mask;
98+
99+ mask = irq_data_get_effective_affinity_mask(data);
100+ msg->data |= cpumask_first(mask);
101+ }
98102
99103 iommu_dma_map_msi_msg(data->irq, msg);
100104 }
@@ -121,7 +125,7 @@ static int ls_scfg_msi_set_affinity(struct irq_data *irq_data, · 20 unmodified lines
121125 return -EINVAL;
122126 }
123127
124− cpumask_copy(irq_data->common->affinity, mask);
128+ irq_data_update_effective_affinity(irq_data, cpumask_of(cpu));
125129
126130 return IRQ_SET_MASK_OK;
127131 }
drivers/isdn/mISDN/socket.c+1−1
@@ -588,7 +588,7 @@ static const struct proto_ops data_sock_ops = { · 587 unmodified lines
588588 .getname = data_sock_getname,
589589 .sendmsg = mISDN_sock_sendmsg,
590590 .recvmsg = mISDN_sock_recvmsg,
591− .poll_mask = datagram_poll_mask,
591+ .poll = datagram_poll,
592592 .listen = sock_no_listen,
593593 .shutdown = sock_no_shutdown,
594594 .setsockopt = data_sock_setsockopt,
drivers/lightnvm/Kconfig+1−1
@@ -4,7 +4,7 @@ · 3 unmodified lines
44
55 menuconfig NVM
66 bool "Open-Channel SSD target support"
7− depends on BLOCK && HAS_DMA && PCI
7+ depends on BLOCK && PCI
88 select BLK_DEV_NVME
99 help
1010 Say Y here to get to enable Open-channel SSDs.
drivers/md/dm-raid.c+1−1
@@ -588,7 +588,7 @@ static const char *raid10_md_layout_to_format(int layout) · 587 unmodified lines
588588 }
589589
590590 /* Return md raid10 algorithm for @name */
591−static const int raid10_name_to_format(const char *name)
591+static int raid10_name_to_format(const char *name)
592592 {
593593 if (!strcasecmp(name, "near"))
594594 return ALGORITHM_RAID10_NEAR;
drivers/md/dm-table.c+4−3
@@ -885,9 +885,7 @@ EXPORT_SYMBOL_GPL(dm_table_set_type); · 884 unmodified lines
885885 static int device_supports_dax(struct dm_target *ti, struct dm_dev *dev,
886886 sector_t start, sector_t len, void *data)
887887 {
888− struct request_queue *q = bdev_get_queue(dev->bdev);
889−
890− return q && blk_queue_dax(q);
888+ return bdev_dax_supported(dev->bdev, PAGE_SIZE);
891889 }
892890
893891 static bool dm_table_supports_dax(struct dm_table *t)
@@ -1907,6 +1905,9 @@ void dm_table_set_restrictions(struct dm_table *t, struct request_queue *q, · 1013 unmodified lines
19071905
19081906 if (dm_table_supports_dax(t))
19091907 blk_queue_flag_set(QUEUE_FLAG_DAX, q);
1908+ else
1909+ blk_queue_flag_clear(QUEUE_FLAG_DAX, q);
1910+
19101911 if (dm_table_supports_dax_write_cache(t))
19111912 dax_write_cache(t->md->dax_dev, true);
19121913
drivers/md/dm-thin-metadata.c+0−9
@@ -776,7 +776,6 @@ static int __write_changed_details(struct dm_pool_metadata *pmd) · 775 unmodified lines
776776 static int __commit_transaction(struct dm_pool_metadata *pmd)
777777 {
778778 int r;
779− size_t metadata_len, data_len;
780779 struct thin_disk_superblock *disk_super;
781780 struct dm_block *sblock;
782781
@@ -797,14 +796,6 @@ static int __commit_transaction(struct dm_pool_metadata *pmd) · 14 unmodified lines
797796 if (r < 0)
798797 return r;
799798
800− r = dm_sm_root_size(pmd->metadata_sm, &metadata_len);
801− if (r < 0)
802− return r;
803−
804− r = dm_sm_root_size(pmd->data_sm, &data_len);
805− if (r < 0)
806− return r;
807−
808799 r = save_sm_roots(pmd);
809800 if (r < 0)
810801 return r;
drivers/md/dm-thin.c+9−2
@@ -1386,6 +1386,8 @@ static void schedule_external_copy(struct thin_c *tc, dm_block_t virt_block, · 1385 unmodified lines
13861386
13871387 static void set_pool_mode(struct pool *pool, enum pool_mode new_mode);
13881388
1389+static void requeue_bios(struct pool *pool);
1390+
13891391 static void check_for_space(struct pool *pool)
13901392 {
13911393 int r;
@@ -1398,8 +1400,10 @@ static void check_for_space(struct pool *pool) · 6 unmodified lines
13981400 if (r)
13991401 return;
14001402
1401− if (nr_free)
1403+ if (nr_free) {
14021404 set_pool_mode(pool, PM_WRITE);
1405+ requeue_bios(pool);
1406+ }
14031407 }
14041408
14051409 /*
@@ -1476,7 +1480,10 @@ static int alloc_data_block(struct thin_c *tc, dm_block_t *result) · 70 unmodified lines
14761480
14771481 r = dm_pool_alloc_data_block(pool->pmd, result);
14781482 if (r) {
1479− metadata_operation_failed(pool, "dm_pool_alloc_data_block", r);
1483+ if (r == -ENOSPC)
1484+ set_pool_mode(pool, PM_OUT_OF_DATA_SPACE);
1485+ else
1486+ metadata_operation_failed(pool, "dm_pool_alloc_data_block", r);
14801487 return r;
14811488 }
14821489
drivers/md/dm-writecache.c+5−5
@@ -259,7 +259,7 @@ static int persistent_memory_claim(struct dm_writecache *wc) · 258 unmodified lines
259259 if (da != p) {
260260 long i;
261261 wc->memory_map = NULL;
262− pages = kvmalloc(p * sizeof(struct page *), GFP_KERNEL);
262+ pages = kvmalloc_array(p, sizeof(struct page *), GFP_KERNEL);
263263 if (!pages) {
264264 r = -ENOMEM;
265265 goto err2;
@@ -859,7 +859,7 @@ static int writecache_alloc_entries(struct dm_writecache *wc) · 593 unmodified lines
859859
860860 if (wc->entries)
861861 return 0;
862− wc->entries = vmalloc(sizeof(struct wc_entry) * wc->n_blocks);
862+ wc->entries = vmalloc(array_size(sizeof(struct wc_entry), wc->n_blocks));
863863 if (!wc->entries)
864864 return -ENOMEM;
865865 for (b = 0; b < wc->n_blocks; b++) {
@@ -1481,9 +1481,9 @@ static void __writecache_writeback_pmem(struct dm_writecache *wc, struct writeba · 615 unmodified lines
14811481 wb->bio.bi_iter.bi_sector = read_original_sector(wc, e);
14821482 wb->page_offset = PAGE_SIZE;
14831483 if (max_pages <= WB_LIST_INLINE ||
1484− unlikely(!(wb->wc_list = kmalloc(max_pages * sizeof(struct wc_entry *),
1485− GFP_NOIO | __GFP_NORETRY |
1486− __GFP_NOMEMALLOC | __GFP_NOWARN)))) {
1484+ unlikely(!(wb->wc_list = kmalloc_array(max_pages, sizeof(struct wc_entry *),
1485+ GFP_NOIO | __GFP_NORETRY |
1486+ __GFP_NOMEMALLOC | __GFP_NOWARN)))) {
14871487 wb->wc_list = wb->wc_list_inline;
14881488 max_pages = WB_LIST_INLINE;
14891489 }
drivers/md/dm-zoned-target.c+1−1
@@ -787,7 +787,7 @@ static int dmz_ctr(struct dm_target *ti, unsigned int argc, char **argv) · 786 unmodified lines
787787
788788 /* Chunk BIO work */
789789 mutex_init(&dmz->chunk_lock);
790− INIT_RADIX_TREE(&dmz->chunk_rxtree, GFP_KERNEL);
790+ INIT_RADIX_TREE(&dmz->chunk_rxtree, GFP_NOIO);
791791 dmz->chunk_wq = alloc_workqueue("dmz_cwq_%s", WQ_MEM_RECLAIM | WQ_UNBOUND,
792792 0, dev->name);
793793 if (!dmz->chunk_wq) {
drivers/md/dm.c+3−5
@@ -1056,8 +1056,7 @@ static long dm_dax_direct_access(struct dax_device *dax_dev, pgoff_t pgoff, · 1055 unmodified lines
10561056 if (len < 1)
10571057 goto out;
10581058 nr_pages = min(len, nr_pages);
1059− if (ti->type->direct_access)
1060− ret = ti->type->direct_access(ti, pgoff, nr_pages, kaddr, pfn);
1059+ ret = ti->type->direct_access(ti, pgoff, nr_pages, kaddr, pfn);
10611060
10621061 out:
10631062 dm_put_live_table(md, srcu_idx);
@@ -1606,10 +1605,9 @@ static blk_qc_t __split_and_process_bio(struct mapped_device *md, · 542 unmodified lines
16061605 * the usage of io->orig_bio in dm_remap_zone_report()
16071606 * won't be affected by this reassignment.
16081607 */
1609− struct bio *b = bio_clone_bioset(bio, GFP_NOIO,
1610− &md->queue->bio_split);
1608+ struct bio *b = bio_split(bio, bio_sectors(bio) - ci.sector_count,
1609+ GFP_NOIO, &md->queue->bio_split);
16111610 ci.io->orig_bio = b;
1612− bio_advance(bio, (bio_sectors(bio) - ci.sector_count) << 9);
16131611 bio_chain(b, bio);
16141612 ret = generic_make_request(bio);
16151613 break;
drivers/mtd/chips/cfi_cmdset_0002.c+11−8
@@ -2526,7 +2526,7 @@ static int cfi_atmel_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len) · 2525 unmodified lines
25262526
25272527 struct ppb_lock {
25282528 struct flchip *chip;
2529− loff_t offset;
2529+ unsigned long adr;
25302530 int locked;
25312531 };
25322532
@@ -2544,8 +2544,9 @@ static int __maybe_unused do_ppb_xxlock(struct map_info *map, · 11 unmodified lines
25442544 unsigned long timeo;
25452545 int ret;
25462546
2547+ adr += chip->start;
25472548 mutex_lock(&chip->mutex);
2548− ret = get_chip(map, chip, adr + chip->start, FL_LOCKING);
2549+ ret = get_chip(map, chip, adr, FL_LOCKING);
25492550 if (ret) {
25502551 mutex_unlock(&chip->mutex);
25512552 return ret;
@@ -2563,8 +2564,8 @@ static int __maybe_unused do_ppb_xxlock(struct map_info *map, · 11 unmodified lines
25632564
25642565 if (thunk == DO_XXLOCK_ONEBLOCK_LOCK) {
25652566 chip->state = FL_LOCKING;
2566− map_write(map, CMD(0xA0), chip->start + adr);
2567− map_write(map, CMD(0x00), chip->start + adr);
2567+ map_write(map, CMD(0xA0), adr);
2568+ map_write(map, CMD(0x00), adr);
25682569 } else if (thunk == DO_XXLOCK_ONEBLOCK_UNLOCK) {
25692570 /*
25702571 * Unlocking of one specific sector is not supported, so we
@@ -2602,7 +2603,7 @@ static int __maybe_unused do_ppb_xxlock(struct map_info *map, · 31 unmodified lines
26022603 map_write(map, CMD(0x00), chip->start);
26032604
26042605 chip->state = FL_READY;
2605− put_chip(map, chip, adr + chip->start);
2606+ put_chip(map, chip, adr);
26062607 mutex_unlock(&chip->mutex);
26072608
26082609 return ret;
@@ -2659,9 +2660,9 @@ static int __maybe_unused cfi_ppb_unlock(struct mtd_info *mtd, loff_t ofs, · 50 unmodified lines
26592660 * sectors shall be unlocked, so lets keep their locking
26602661 * status at "unlocked" (locked=0) for the final re-locking.
26612662 */
2662− if ((adr < ofs) || (adr >= (ofs + len))) {
2663+ if ((offset < ofs) || (offset >= (ofs + len))) {
26632664 sect[sectors].chip = &cfi->chips[chipnum];
2664− sect[sectors].offset = offset;
2665+ sect[sectors].adr = adr;
26652666 sect[sectors].locked = do_ppb_xxlock(
26662667 map, &cfi->chips[chipnum], adr, 0,
26672668 DO_XXLOCK_ONEBLOCK_GETLOCK);
@@ -2675,6 +2676,8 @@ static int __maybe_unused cfi_ppb_unlock(struct mtd_info *mtd, loff_t ofs, · 7 unmodified lines
26752676 i++;
26762677
26772678 if (adr >> cfi->chipshift) {
2679+ if (offset >= (ofs + len))
2680+ break;
26782681 adr = 0;
26792682 chipnum++;
26802683
@@ -2705,7 +2708,7 @@ static int __maybe_unused cfi_ppb_unlock(struct mtd_info *mtd, loff_t ofs, · 24 unmodified lines
27052708 */
27062709 for (i = 0; i < sectors; i++) {
27072710 if (sect[i].locked)
2708− do_ppb_xxlock(map, sect[i].chip, sect[i].offset, 0,
2711+ do_ppb_xxlock(map, sect[i].chip, sect[i].adr, 0,
27092712 DO_XXLOCK_ONEBLOCK_LOCK);
27102713 }
27112714
drivers/mtd/devices/mtd_dataflash.c+2−2
@@ -733,8 +733,8 @@ static struct flash_info dataflash_data[] = { · 732 unmodified lines
733733 { "AT45DB642x", 0x1f2800, 8192, 1056, 11, SUP_POW2PS},
734734 { "at45db642d", 0x1f2800, 8192, 1024, 10, SUP_POW2PS | IS_POW2PS},
735735
736− { "AT45DB641E", 0x1f28000100, 32768, 264, 9, SUP_EXTID | SUP_POW2PS},
737− { "at45db641e", 0x1f28000100, 32768, 256, 8, SUP_EXTID | SUP_POW2PS | IS_POW2PS},
736+ { "AT45DB641E", 0x1f28000100ULL, 32768, 264, 9, SUP_EXTID | SUP_POW2PS},
737+ { "at45db641e", 0x1f28000100ULL, 32768, 256, 8, SUP_EXTID | SUP_POW2PS | IS_POW2PS},
738738 };
739739
740740 static struct flash_info *jedec_lookup(struct spi_device *spi,
drivers/mtd/nand/raw/denali_dt.c+5−1
@@ -123,7 +123,11 @@ static int denali_dt_probe(struct platform_device *pdev) · 122 unmodified lines
123123 if (ret)
124124 return ret;
125125
126− denali->clk_x_rate = clk_get_rate(dt->clk);
126+ /*
127+ * Hardcode the clock rate for the backward compatibility.
128+ * This works for both SOCFPGA and UniPhier.
129+ */
130+ denali->clk_x_rate = 200000000;
127131
128132 ret = denali_init(denali);
129133 if (ret)
drivers/mtd/nand/raw/mxc_nand.c+4−1
@@ -48,7 +48,7 @@ · 47 unmodified lines
4848 #define NFC_V1_V2_CONFIG (host->regs + 0x0a)
4949 #define NFC_V1_V2_ECC_STATUS_RESULT (host->regs + 0x0c)
5050 #define NFC_V1_V2_RSLTMAIN_AREA (host->regs + 0x0e)
51−#define NFC_V1_V2_RSLTSPARE_AREA (host->regs + 0x10)
51+#define NFC_V21_RSLTSPARE_AREA (host->regs + 0x10)
5252 #define NFC_V1_V2_WRPROT (host->regs + 0x12)
5353 #define NFC_V1_UNLOCKSTART_BLKADDR (host->regs + 0x14)
5454 #define NFC_V1_UNLOCKEND_BLKADDR (host->regs + 0x16)
@@ -1274,6 +1274,9 @@ static void preset_v2(struct mtd_info *mtd) · 1219 unmodified lines
12741274 writew(config1, NFC_V1_V2_CONFIG1);
12751275 /* preset operation */
12761276
1277+ /* spare area size in 16-bit half-words */
1278+ writew(mtd->oobsize / 2, NFC_V21_RSLTSPARE_AREA);
1279+
12771280 /* Unlock the internal RAM Buffer */
12781281 writew(0x2, NFC_V1_V2_CONFIG);
12791282
drivers/mtd/nand/raw/nand_base.c+1−1
@@ -440,7 +440,7 @@ static int nand_block_bad(struct mtd_info *mtd, loff_t ofs) · 439 unmodified lines
440440
441441 for (; page < page_end; page++) {
442442 res = chip->ecc.read_oob(mtd, chip, page);
443− if (res)
443+ if (res < 0)
444444 return res;
445445
446446 bad = chip->oob_poi[chip->badblockpos];
drivers/mtd/nand/raw/nand_macronix.c+36−12
@@ -17,23 +17,47 @@ · 16 unmodified lines
1717
1818 #include <linux/mtd/rawnand.h>
1919
20+/*
21+ * Macronix AC series does not support using SET/GET_FEATURES to change
22+ * the timings unlike what is declared in the parameter page. Unflag
23+ * this feature to avoid unnecessary downturns.
24+ */
25+static void macronix_nand_fix_broken_get_timings(struct nand_chip *chip)
26+{
27+ unsigned int i;
28+ static const char * const broken_get_timings[] = {
29+ "MX30LF1G18AC",
30+ "MX30LF1G28AC",
31+ "MX30LF2G18AC",
32+ "MX30LF2G28AC",
33+ "MX30LF4G18AC",
34+ "MX30LF4G28AC",
35+ "MX60LF8G18AC",
36+ };
37+
38+ if (!chip->parameters.supports_set_get_features)
39+ return;
40+
41+ for (i = 0; i < ARRAY_SIZE(broken_get_timings); i++) {
42+ if (!strcmp(broken_get_timings[i], chip->parameters.model))
43+ break;
44+ }
45+
46+ if (i == ARRAY_SIZE(broken_get_timings))
47+ return;
48+
49+ bitmap_clear(chip->parameters.get_feature_list,
50+ ONFI_FEATURE_ADDR_TIMING_MODE, 1);
51+ bitmap_clear(chip->parameters.set_feature_list,
52+ ONFI_FEATURE_ADDR_TIMING_MODE, 1);
53+}
54+
2055 static int macronix_nand_init(struct nand_chip *chip)
2156 {
2257 if (nand_is_slc(chip))
2358 chip->bbt_options |= NAND_BBT_SCAN2NDPAGE;
2459
25− /*
26− * MX30LF2G18AC chip does not support using SET/GET_FEATURES to change
27− * the timings unlike what is declared in the parameter page. Unflag
28− * this feature to avoid unnecessary downturns.
29− */
30− if (chip->parameters.supports_set_get_features &&
31− !strcmp("MX30LF2G18AC", chip->parameters.model)) {
32− bitmap_clear(chip->parameters.get_feature_list,
33− ONFI_FEATURE_ADDR_TIMING_MODE, 1);
34− bitmap_clear(chip->parameters.set_feature_list,
35− ONFI_FEATURE_ADDR_TIMING_MODE, 1);
36− }
60+ macronix_nand_fix_broken_get_timings(chip);
3761
3862 return 0;
3963 }
drivers/mtd/nand/raw/nand_micron.c+2−0
@@ -66,7 +66,9 @@ static int micron_nand_onfi_init(struct nand_chip *chip) · 65 unmodified lines
6666
6767 if (p->supports_set_get_features) {
6868 set_bit(ONFI_FEATURE_ADDR_READ_RETRY, p->set_feature_list);
69+ set_bit(ONFI_FEATURE_ON_DIE_ECC, p->set_feature_list);
6970 set_bit(ONFI_FEATURE_ADDR_READ_RETRY, p->get_feature_list);
71+ set_bit(ONFI_FEATURE_ON_DIE_ECC, p->get_feature_list);
7072 }
7173
7274 return 0;
drivers/net/ethernet/amd/Kconfig+1−1
@@ -173,7 +173,7 @@ config SUNLANCE · 172 unmodified lines
173173
174174 config AMD_XGBE
175175 tristate "AMD 10GbE Ethernet driver"
176− depends on ((OF_NET && OF_ADDRESS) || ACPI || PCI) && HAS_IOMEM && HAS_DMA
176+ depends on ((OF_NET && OF_ADDRESS) || ACPI || PCI) && HAS_IOMEM
177177 depends on X86 || ARM64 || COMPILE_TEST
178178 select BITREVERSE
179179 select CRC32
drivers/net/ethernet/apm/xgene-v2/Kconfig+0−1
@@ -1,6 +1,5 @@
11 config NET_XGENE_V2
22 tristate "APM X-Gene SoC Ethernet-v2 Driver"
3− depends on HAS_DMA
43 depends on ARCH_XGENE || COMPILE_TEST
54 help
65 This is the Ethernet driver for the on-chip ethernet interface
drivers/net/ethernet/apm/xgene/Kconfig+0−1
@@ -1,6 +1,5 @@
11 config NET_XGENE
22 tristate "APM X-Gene SoC Ethernet Driver"
3− depends on HAS_DMA
43 depends on ARCH_XGENE || COMPILE_TEST
54 select PHYLIB
65 select MDIO_XGENE
drivers/net/ethernet/arc/Kconfig+4−2
@@ -24,7 +24,8 @@ config ARC_EMAC_CORE · 23 unmodified lines
2424 config ARC_EMAC
2525 tristate "ARC EMAC support"
2626 select ARC_EMAC_CORE
27− depends on OF_IRQ && OF_NET && HAS_DMA && (ARC || COMPILE_TEST)
27+ depends on OF_IRQ && OF_NET
28+ depends on ARC || COMPILE_TEST
2829 ---help---
2930 On some legacy ARC (Synopsys) FPGA boards such as ARCAngel4/ML50x
3031 non-standard on-chip ethernet device ARC EMAC 10/100 is used.
@@ -33,7 +34,8 @@ config ARC_EMAC · 2 unmodified lines
3334 config EMAC_ROCKCHIP
3435 tristate "Rockchip EMAC support"
3536 select ARC_EMAC_CORE
36− depends on OF_IRQ && OF_NET && REGULATOR && HAS_DMA && (ARCH_ROCKCHIP || COMPILE_TEST)
37+ depends on OF_IRQ && OF_NET && REGULATOR
38+ depends on ARCH_ROCKCHIP || COMPILE_TEST
3739 ---help---
3840 Support for Rockchip RK3036/RK3066/RK3188 EMAC ethernet controllers.
3941 This selects Rockchip SoC glue layer support for the
drivers/net/ethernet/broadcom/Kconfig+0−2
@@ -157,7 +157,6 @@ config BGMAC · 156 unmodified lines
157157 config BGMAC_BCMA
158158 tristate "Broadcom iProc GBit BCMA support"
159159 depends on BCMA && BCMA_HOST_SOC
160− depends on HAS_DMA
161160 depends on BCM47XX || ARCH_BCM_5301X || COMPILE_TEST
162161 select BGMAC
163162 select PHYLIB
@@ -170,7 +169,6 @@ config BGMAC_BCMA · 6 unmodified lines
170169
171170 config BGMAC_PLATFORM
172171 tristate "Broadcom iProc GBit platform support"
173− depends on HAS_DMA
174172 depends on ARCH_BCM_IPROC || COMPILE_TEST
175173 depends on OF
176174 select BGMAC
drivers/net/ethernet/cadence/macb_ptp.c+1−4
@@ -170,10 +170,7 @@ static int gem_ptp_adjtime(struct ptp_clock_info *ptp, s64 delta) · 169 unmodified lines
170170
171171 if (delta > TSU_NSEC_MAX_VAL) {
172172 gem_tsu_get_time(&bp->ptp_clock_info, &now);
173− if (sign)
174− now = timespec64_sub(now, then);
175− else
176− now = timespec64_add(now, then);
173+ now = timespec64_add(now, then);
177174
178175 gem_tsu_set_time(&bp->ptp_clock_info,
179176 (const struct timespec64 *)&now);
drivers/net/ethernet/calxeda/Kconfig+1−1
@@ -1,6 +1,6 @@
11 config NET_CALXEDA_XGMAC
22 tristate "Calxeda 1G/10G XGMAC Ethernet driver"
3− depends on HAS_IOMEM && HAS_DMA
3+ depends on HAS_IOMEM
44 depends on ARCH_HIGHBANK || COMPILE_TEST
55 select CRC32
66 help
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c+1−1
@@ -263,7 +263,7 @@ static void dcb_tx_queue_prio_enable(struct net_device *dev, int enable) · 262 unmodified lines
263263 "Can't %s DCB Priority on port %d, TX Queue %d: err=%d\n",
264264 enable ? "set" : "unset", pi->port_id, i, -err);
265265 else
266− txq->dcb_prio = value;
266+ txq->dcb_prio = enable ? value : 0;
267267 }
268268 }
269269
drivers/net/ethernet/cisco/enic/enic_clsf.c+1−2
@@ -79,7 +79,6 @@ void enic_rfs_flw_tbl_init(struct enic *enic) · 78 unmodified lines
7979 enic->rfs_h.max = enic->config.num_arfs;
8080 enic->rfs_h.free = enic->rfs_h.max;
8181 enic->rfs_h.toclean = 0;
82− enic_rfs_timer_start(enic);
8382 }
8483
8584 void enic_rfs_flw_tbl_free(struct enic *enic)
@@ -88,7 +87,6 @@ void enic_rfs_flw_tbl_free(struct enic *enic) · 2 unmodified lines
8887
8988 enic_rfs_timer_stop(enic);
9089 spin_lock_bh(&enic->rfs_h.lock);
91− enic->rfs_h.free = 0;
9290 for (i = 0; i < (1 << ENIC_RFS_FLW_BITSHIFT); i++) {
9391 struct hlist_head *hhead;
9492 struct hlist_node *tmp;
@@ -99,6 +97,7 @@ void enic_rfs_flw_tbl_free(struct enic *enic) · 4 unmodified lines
9997 enic_delfltr(enic, n->fltr_id);
10098 hlist_del(&n->node);
10199 kfree(n);
100+ enic->rfs_h.free++;
102101 }
103102 }
104103 spin_unlock_bh(&enic->rfs_h.lock);
drivers/net/ethernet/cisco/enic/enic_main.c+6−6
@@ -1920,7 +1920,7 @@ static int enic_open(struct net_device *netdev) · 1919 unmodified lines
19201920 {
19211921 struct enic *enic = netdev_priv(netdev);
19221922 unsigned int i;
1923− int err;
1923+ int err, ret;
19241924
19251925 err = enic_request_intr(enic);
19261926 if (err) {
@@ -1971,16 +1971,15 @@ static int enic_open(struct net_device *netdev) · 44 unmodified lines
19711971 vnic_intr_unmask(&enic->intr[i]);
19721972
19731973 enic_notify_timer_start(enic);
1974− enic_rfs_flw_tbl_init(enic);
1974+ enic_rfs_timer_start(enic);
19751975
19761976 return 0;
19771977
19781978 err_out_free_rq:
19791979 for (i = 0; i < enic->rq_count; i++) {
1980− err = vnic_rq_disable(&enic->rq[i]);
1981− if (err)
1982− return err;
1983− vnic_rq_clean(&enic->rq[i], enic_free_rq_buf);
1980+ ret = vnic_rq_disable(&enic->rq[i]);
1981+ if (!ret)
1982+ vnic_rq_clean(&enic->rq[i], enic_free_rq_buf);
19841983 }
19851984 enic_dev_notify_unset(enic);
19861985 err_out_free_intr:
@@ -2904,6 +2903,7 @@ static int enic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) · 917 unmodified lines
29042903
29052904 timer_setup(&enic->notify_timer, enic_notify_timer, 0);
29062905
2906+ enic_rfs_flw_tbl_init(enic);
29072907 enic_set_rx_coal_setting(enic);
29082908 INIT_WORK(&enic->reset, enic_reset);
29092909 INIT_WORK(&enic->tx_hang_reset, enic_tx_hang_reset);
drivers/net/ethernet/faraday/ftgmac100.c+2−2
@@ -1735,8 +1735,8 @@ static void ftgmac100_ncsi_handler(struct ncsi_dev *nd) · 1734 unmodified lines
17351735 if (unlikely(nd->state != ncsi_dev_state_functional))
17361736 return;
17371737
1738− netdev_info(nd->dev, "NCSI interface %s\n",
1739− nd->link_up ? "up" : "down");
1738+ netdev_dbg(nd->dev, "NCSI interface %s\n",
1739+ nd->link_up ? "up" : "down");
17401740 }
17411741
17421742 static void ftgmac100_setup_clk(struct ftgmac100 *priv)
drivers/net/ethernet/hisilicon/Kconfig+1−1
@@ -5,7 +5,7 @@ · 4 unmodified lines
55 config NET_VENDOR_HISILICON
66 bool "Hisilicon devices"
77 default y
8− depends on (OF || ACPI) && HAS_DMA
8+ depends on OF || ACPI
99 depends on ARM || ARM64 || COMPILE_TEST
1010 ---help---
1111 If you have a network (Ethernet) card belonging to this class, say Y.
drivers/net/ethernet/intel/i40e/i40e_txrx.c+3−4
@@ -2103,9 +2103,8 @@ static struct sk_buff *i40e_build_skb(struct i40e_ring *rx_ring, · 2102 unmodified lines
21032103 unsigned int truesize = i40e_rx_pg_size(rx_ring) / 2;
21042104 #else
21052105 unsigned int truesize = SKB_DATA_ALIGN(sizeof(struct skb_shared_info)) +
2106− SKB_DATA_ALIGN(I40E_SKB_PAD +
2107− (xdp->data_end -
2108− xdp->data_hard_start));
2106+ SKB_DATA_ALIGN(xdp->data_end -
2107+ xdp->data_hard_start);
21092108 #endif
21102109 struct sk_buff *skb;
21112110
@@ -2124,7 +2123,7 @@ static struct sk_buff *i40e_build_skb(struct i40e_ring *rx_ring, · 12 unmodified lines
21242123 return NULL;
21252124
21262125 /* update pointers within the skb to store the data */
2127− skb_reserve(skb, I40E_SKB_PAD + (xdp->data - xdp->data_hard_start));
2126+ skb_reserve(skb, xdp->data - xdp->data_hard_start);
21282127 __skb_put(skb, xdp->data_end - xdp->data);
21292128 if (metasize)
21302129 skb_metadata_set(skb, metasize);
drivers/net/ethernet/marvell/Kconfig+3−5
@@ -18,8 +18,8 @@ if NET_VENDOR_MARVELL · 17 unmodified lines
1818
1919 config MV643XX_ETH
2020 tristate "Marvell Discovery (643XX) and Orion ethernet support"
21− depends on (MV64X60 || PPC32 || PLAT_ORION || COMPILE_TEST) && INET
22− depends on HAS_DMA
21+ depends on MV64X60 || PPC32 || PLAT_ORION || COMPILE_TEST
22+ depends on INET
2323 select PHYLIB
2424 select MVMDIO
2525 ---help---
@@ -58,7 +58,6 @@ config MVNETA_BM_ENABLE · 32 unmodified lines
5858 config MVNETA
5959 tristate "Marvell Armada 370/38x/XP/37xx network interface support"
6060 depends on ARCH_MVEBU || COMPILE_TEST
61− depends on HAS_DMA
6261 select MVMDIO
6362 select PHYLINK
6463 ---help---
@@ -84,7 +83,6 @@ config MVNETA_BM · 19 unmodified lines
8483 config MVPP2
8584 tristate "Marvell Armada 375/7K/8K network interface support"
8685 depends on ARCH_MVEBU || COMPILE_TEST
87− depends on HAS_DMA
8886 select MVMDIO
8987 select PHYLINK
9088 ---help---
@@ -93,7 +91,7 @@ config MVPP2 · 2 unmodified lines
9391
9492 config PXA168_ETH
9593 tristate "Marvell pxa168 ethernet support"
96− depends on HAS_IOMEM && HAS_DMA
94+ depends on HAS_IOMEM
9795 depends on CPU_PXA168 || ARCH_BERLIN || COMPILE_TEST
9896 select PHYLIB
9997 ---help---
drivers/net/ethernet/marvell/mvneta.c+1−1
@@ -1932,7 +1932,7 @@ static int mvneta_rx_swbm(struct mvneta_port *pp, int rx_todo, · 1931 unmodified lines
19321932 rx_bytes = rx_desc->data_size - (ETH_FCS_LEN + MVNETA_MH_SIZE);
19331933 index = rx_desc - rxq->descs;
19341934 data = rxq->buf_virt_addr[index];
1935− phys_addr = rx_desc->buf_phys_addr;
1935+ phys_addr = rx_desc->buf_phys_addr - pp->rx_offset_correction;
19361936
19371937 if (!mvneta_rxq_desc_is_first_last(rx_status) ||
19381938 (rx_status & MVNETA_RXD_ERR_SUMMARY)) {
drivers/net/ethernet/mellanox/mlxsw/Kconfig+1−1
@@ -30,7 +30,7 @@ config MLXSW_CORE_THERMAL · 29 unmodified lines
3030
3131 config MLXSW_PCI
3232 tristate "PCI bus implementation for Mellanox Technologies Switch ASICs"
33− depends on PCI && HAS_DMA && HAS_IOMEM && MLXSW_CORE
33+ depends on PCI && HAS_IOMEM && MLXSW_CORE
3434 default m
3535 ---help---
3636 This is PCI bus implementation for Mellanox Technologies Switch ASICs.
drivers/net/ethernet/mscc/ocelot.c+6−5
@@ -344,10 +344,9 @@ static int ocelot_port_stop(struct net_device *dev) · 343 unmodified lines
344344 static int ocelot_gen_ifh(u32 *ifh, struct frame_info *info)
345345 {
346346 ifh[0] = IFH_INJ_BYPASS;
347− ifh[1] = (0xff00 & info->port) >> 8;
347+ ifh[1] = (0xf00 & info->port) >> 8;
348348 ifh[2] = (0xff & info->port) << 24;
349− ifh[3] = IFH_INJ_POP_CNT_DISABLE | (info->cpuq << 20) |
350− (info->tag_type << 16) | info->vid;
349+ ifh[3] = (info->tag_type << 16) | info->vid;
351350
352351 return 0;
353352 }
@@ -370,11 +369,13 @@ static int ocelot_port_xmit(struct sk_buff *skb, struct net_device *dev) · 16 unmodified lines
370369 QS_INJ_CTRL_SOF, QS_INJ_CTRL, grp);
371370
372371 info.port = BIT(port->chip_port);
373− info.cpuq = 0xff;
372+ info.tag_type = IFH_TAG_TYPE_C;
373+ info.vid = skb_vlan_tag_get(skb);
374374 ocelot_gen_ifh(ifh, &info);
375375
376376 for (i = 0; i < IFH_LEN; i++)
377− ocelot_write_rix(ocelot, ifh[i], QS_INJ_WR, grp);
377+ ocelot_write_rix(ocelot, (__force u32)cpu_to_be32(ifh[i]),
378+ QS_INJ_WR, grp);
378379
379380 count = (skb->len + 3) / 4;
380381 last = skb->len % 4;
drivers/net/ethernet/qlogic/qed/qed_dcbx.c+4−7
@@ -255,9 +255,8 @@ qed_dcbx_get_app_protocol_type(struct qed_hwfn *p_hwfn, · 254 unmodified lines
255255 *type = DCBX_PROTOCOL_ROCE_V2;
256256 } else {
257257 *type = DCBX_MAX_PROTOCOL_TYPE;
258− DP_ERR(p_hwfn,
259− "No action required, App TLV id = 0x%x app_prio_bitmap = 0x%x\n",
260− id, app_prio_bitmap);
258+ DP_ERR(p_hwfn, "No action required, App TLV entry = 0x%x\n",
259+ app_prio_bitmap);
261260 return false;
262261 }
263262
@@ -1479,8 +1478,8 @@ static u8 qed_dcbnl_getcap(struct qed_dev *cdev, int capid, u8 *cap) · 1215 unmodified lines
14791478 *cap = 0x80;
14801479 break;
14811480 case DCB_CAP_ATTR_DCBX:
1482− *cap = (DCB_CAP_DCBX_LLD_MANAGED | DCB_CAP_DCBX_VER_CEE |
1483− DCB_CAP_DCBX_VER_IEEE | DCB_CAP_DCBX_STATIC);
1481+ *cap = (DCB_CAP_DCBX_VER_CEE | DCB_CAP_DCBX_VER_IEEE |
1482+ DCB_CAP_DCBX_STATIC);
14841483 break;
14851484 default:
14861485 *cap = false;
@@ -1548,8 +1547,6 @@ static u8 qed_dcbnl_getdcbx(struct qed_dev *cdev) · 61 unmodified lines
15481547 if (!dcbx_info)
15491548 return 0;
15501549
1551− if (dcbx_info->operational.enabled)
1552− mode |= DCB_CAP_DCBX_LLD_MANAGED;
15531550 if (dcbx_info->operational.ieee)
15541551 mode |= DCB_CAP_DCBX_VER_IEEE;
15551552 if (dcbx_info->operational.cee)
drivers/net/ethernet/qlogic/qed/qed_ll2.c+9−2
@@ -201,8 +201,9 @@ void qed_ll2b_complete_rx_packet(void *cxt, struct qed_ll2_comp_rx_data *data) · 200 unmodified lines
201201
202202 skb = build_skb(buffer->data, 0);
203203 if (!skb) {
204− rc = -ENOMEM;
205− goto out_post;
204+ DP_INFO(cdev, "Failed to build SKB\n");
205+ kfree(buffer->data);
206+ goto out_post1;
206207 }
207208
208209 data->u.placement_offset += NET_SKB_PAD;
@@ -224,8 +225,14 @@ void qed_ll2b_complete_rx_packet(void *cxt, struct qed_ll2_comp_rx_data *data) · 15 unmodified lines
224225 cdev->ll2->cbs->rx_cb(cdev->ll2->cb_cookie, skb,
225226 data->opaque_data_0,
226227 data->opaque_data_1);
228+ } else {
229+ DP_VERBOSE(p_hwfn, (NETIF_MSG_RX_STATUS | NETIF_MSG_PKTDATA |
230+ QED_MSG_LL2 | QED_MSG_STORAGE),
231+ "Dropping the packet\n");
232+ kfree(buffer->data);
227233 }
228234
235+out_post1:
229236 /* Update Buffer information and update FW producer */
230237 buffer->data = new_data;
231238 buffer->phys_addr = new_phys_addr;
drivers/net/ethernet/qlogic/qed/qed_main.c+10−2
@@ -567,8 +567,16 @@ static irqreturn_t qed_single_int(int irq, void *dev_instance) · 566 unmodified lines
567567 /* Fastpath interrupts */
568568 for (j = 0; j < 64; j++) {
569569 if ((0x2ULL << j) & status) {
570− hwfn->simd_proto_handler[j].func(
571− hwfn->simd_proto_handler[j].token);
570+ struct qed_simd_fp_handler *p_handler =
571+ &hwfn->simd_proto_handler[j];
572+
573+ if (p_handler->func)
574+ p_handler->func(p_handler->token);
575+ else
576+ DP_NOTICE(hwfn,
577+ "Not calling fastpath handler as it is NULL [handler #%d, status 0x%llx]\n",
578+ j, status);
579+
572580 status &= ~(0x2ULL << j);
573581 rc = IRQ_HANDLED;
574582 }
drivers/net/ethernet/realtek/r8169.c+1−1
@@ -7148,7 +7148,7 @@ static void rtl8169_netpoll(struct net_device *dev) · 7147 unmodified lines
71487148 {
71497149 struct rtl8169_private *tp = netdev_priv(dev);
71507150
7151− rtl8169_interrupt(pci_irq_vector(tp->pci_dev, 0), dev);
7151+ rtl8169_interrupt(pci_irq_vector(tp->pci_dev, 0), tp);
71527152 }
71537153 #endif
71547154
drivers/net/ethernet/renesas/Kconfig+0−2
@@ -17,7 +17,6 @@ if NET_VENDOR_RENESAS · 16 unmodified lines
1717
1818 config SH_ETH
1919 tristate "Renesas SuperH Ethernet support"
20− depends on HAS_DMA
2120 depends on ARCH_RENESAS || SUPERH || COMPILE_TEST
2221 select CRC32
2322 select MII
@@ -31,7 +30,6 @@ config SH_ETH · 7 unmodified lines
3130
3231 config RAVB
3332 tristate "Renesas Ethernet AVB support"
34− depends on HAS_DMA
3533 depends on ARCH_RENESAS || COMPILE_TEST
3634 select CRC32
3735 select MII
drivers/net/ethernet/sfc/efx.c+1−0
@@ -3180,6 +3180,7 @@ bool efx_rps_check_rule(struct efx_arfs_rule *rule, unsigned int filter_idx, · 3179 unmodified lines
31803180 return true;
31813181 }
31823182
3183+static
31833184 struct hlist_head *efx_rps_hash_bucket(struct efx_nic *efx,
31843185 const struct efx_filter_spec *spec)
31853186 {
drivers/net/ethernet/stmicro/stmmac/Kconfig+1−1
@@ -111,7 +111,7 @@ config DWMAC_ROCKCHIP · 110 unmodified lines
111111 config DWMAC_SOCFPGA
112112 tristate "SOCFPGA dwmac support"
113113 default ARCH_SOCFPGA
114− depends on OF && (ARCH_SOCFPGA || COMPILE_TEST)
114+ depends on OF && (ARCH_SOCFPGA || ARCH_STRATIX10 || COMPILE_TEST)
115115 select MFD_SYSCON
116116 help
117117 Support for ethernet controller on Altera SOCFPGA
drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c+14−4
@@ -55,6 +55,7 @@ struct socfpga_dwmac { · 54 unmodified lines
5555 struct device *dev;
5656 struct regmap *sys_mgr_base_addr;
5757 struct reset_control *stmmac_rst;
58+ struct reset_control *stmmac_ocp_rst;
5859 void __iomem *splitter_base;
5960 bool f2h_ptp_ref_clk;
6061 struct tse_pcs pcs;
@@ -262,8 +263,8 @@ static int socfpga_dwmac_set_phy_mode(struct socfpga_dwmac *dwmac) · 201 unmodified lines
262263 val = SYSMGR_EMACGRP_CTRL_PHYSEL_ENUM_GMII_MII;
263264
264265 /* Assert reset to the enet controller before changing the phy mode */
265− if (dwmac->stmmac_rst)
266− reset_control_assert(dwmac->stmmac_rst);
266+ reset_control_assert(dwmac->stmmac_ocp_rst);
267+ reset_control_assert(dwmac->stmmac_rst);
267268
268269 regmap_read(sys_mgr_base_addr, reg_offset, &ctrl);
269270 ctrl &= ~(SYSMGR_EMACGRP_CTRL_PHYSEL_MASK << reg_shift);
@@ -288,8 +289,8 @@ static int socfpga_dwmac_set_phy_mode(struct socfpga_dwmac *dwmac) · 18 unmodified lines
288289 /* Deassert reset for the phy configuration to be sampled by
289290 * the enet controller, and operation to start in requested mode
290291 */
291− if (dwmac->stmmac_rst)
292− reset_control_deassert(dwmac->stmmac_rst);
292+ reset_control_deassert(dwmac->stmmac_ocp_rst);
293+ reset_control_deassert(dwmac->stmmac_rst);
293294 if (phymode == PHY_INTERFACE_MODE_SGMII) {
294295 if (tse_pcs_init(dwmac->pcs.tse_pcs_base, &dwmac->pcs) != 0) {
295296 dev_err(dwmac->dev, "Unable to initialize TSE PCS");
@@ -324,6 +325,15 @@ static int socfpga_dwmac_probe(struct platform_device *pdev) · 28 unmodified lines
324325 goto err_remove_config_dt;
325326 }
326327
328+ dwmac->stmmac_ocp_rst = devm_reset_control_get_optional(dev, "stmmaceth-ocp");
329+ if (IS_ERR(dwmac->stmmac_ocp_rst)) {
330+ ret = PTR_ERR(dwmac->stmmac_ocp_rst);
331+ dev_err(dev, "error getting reset control of ocp %d\n", ret);
332+ goto err_remove_config_dt;
333+ }
334+
335+ reset_control_deassert(dwmac->stmmac_ocp_rst);
336+
327337 ret = socfpga_dwmac_parse_data(dwmac, dev);
328338 if (ret) {
329339 dev_err(dev, "Unable to parse OF data\n");
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c+10−0
@@ -928,6 +928,7 @@ static void stmmac_check_pcs_mode(struct stmmac_priv *priv) · 927 unmodified lines
928928 static int stmmac_init_phy(struct net_device *dev)
929929 {
930930 struct stmmac_priv *priv = netdev_priv(dev);
931+ u32 tx_cnt = priv->plat->tx_queues_to_use;
931932 struct phy_device *phydev;
932933 char phy_id_fmt[MII_BUS_ID_SIZE + 3];
933934 char bus_id[MII_BUS_ID_SIZE];
@@ -968,6 +969,15 @@ static int stmmac_init_phy(struct net_device *dev) · 34 unmodified lines
968969 phydev->advertising &= ~(SUPPORTED_1000baseT_Half |
969970 SUPPORTED_1000baseT_Full);
970971
972+ /*
973+ * Half-duplex mode not supported with multiqueue
974+ * half-duplex can only works with single queue
975+ */
976+ if (tx_cnt > 1)
977+ phydev->supported &= ~(SUPPORTED_1000baseT_Half |
978+ SUPPORTED_100baseT_Half |
979+ SUPPORTED_10baseT_Half);
980+
971981 /*
972982 * Broken HW is sometimes missing the pull-up resistor on the
973983 * MDIO line, which results in reads to non-existent devices returning
drivers/net/ethernet/sun/sungem.c+12−10
@@ -60,8 +60,7 @@ · 59 unmodified lines
6060 #include <linux/sungem_phy.h>
6161 #include "sungem.h"
6262
63−/* Stripping FCS is causing problems, disabled for now */
64−#undef STRIP_FCS
63+#define STRIP_FCS
6564
6665 #define DEFAULT_MSG (NETIF_MSG_DRV | \
6766 NETIF_MSG_PROBE | \
@@ -435,7 +434,7 @@ static int gem_rxmac_reset(struct gem *gp) · 367 unmodified lines
435434 writel(desc_dma & 0xffffffff, gp->regs + RXDMA_DBLOW);
436435 writel(RX_RING_SIZE - 4, gp->regs + RXDMA_KICK);
437436 val = (RXDMA_CFG_BASE | (RX_OFFSET << 10) |
438− ((14 / 2) << 13) | RXDMA_CFG_FTHRESH_128);
437+ (ETH_HLEN << 13) | RXDMA_CFG_FTHRESH_128);
439438 writel(val, gp->regs + RXDMA_CFG);
440439 if (readl(gp->regs + GREG_BIFCFG) & GREG_BIFCFG_M66EN)
441440 writel(((5 & RXDMA_BLANK_IPKTS) |
@@ -760,7 +759,6 @@ static int gem_rx(struct gem *gp, int work_to_do) · 318 unmodified lines
760759 struct net_device *dev = gp->dev;
761760 int entry, drops, work_done = 0;
762761 u32 done;
763− __sum16 csum;
764762
765763 if (netif_msg_rx_status(gp))
766764 printk(KERN_DEBUG "%s: rx interrupt, done: %d, rx_new: %d\n",
@@ -855,9 +853,13 @@ static int gem_rx(struct gem *gp, int work_to_do) · 88 unmodified lines
855853 skb = copy_skb;
856854 }
857855
858− csum = (__force __sum16)htons((status & RXDCTRL_TCPCSUM) ^ 0xffff);
859− skb->csum = csum_unfold(csum);
860− skb->ip_summed = CHECKSUM_COMPLETE;
856+ if (likely(dev->features & NETIF_F_RXCSUM)) {
857+ __sum16 csum;
858+
859+ csum = (__force __sum16)htons((status & RXDCTRL_TCPCSUM) ^ 0xffff);
860+ skb->csum = csum_unfold(csum);
861+ skb->ip_summed = CHECKSUM_COMPLETE;
862+ }
861863 skb->protocol = eth_type_trans(skb, gp->dev);
862864
863865 napi_gro_receive(&gp->napi, skb);
@@ -1761,7 +1763,7 @@ static void gem_init_dma(struct gem *gp) · 897 unmodified lines
17611763 writel(0, gp->regs + TXDMA_KICK);
17621764
17631765 val = (RXDMA_CFG_BASE | (RX_OFFSET << 10) |
1764− ((14 / 2) << 13) | RXDMA_CFG_FTHRESH_128);
1766+ (ETH_HLEN << 13) | RXDMA_CFG_FTHRESH_128);
17651767 writel(val, gp->regs + RXDMA_CFG);
17661768
17671769 writel(desc_dma >> 32, gp->regs + RXDMA_DBHI);
@@ -2985,8 +2987,8 @@ static int gem_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) · 1217 unmodified lines
29852987 pci_set_drvdata(pdev, dev);
29862988
29872989 /* We can do scatter/gather and HW checksum */
2988− dev->hw_features = NETIF_F_SG | NETIF_F_HW_CSUM;
2989− dev->features |= dev->hw_features | NETIF_F_RXCSUM;
2990+ dev->hw_features = NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_RXCSUM;
2991+ dev->features = dev->hw_features;
29902992 if (pci_using_dac)
29912993 dev->features |= NETIF_F_HIGHDMA;
29922994
drivers/net/ethernet/ti/davinci_cpdma.c+1−1
@@ -205,7 +205,7 @@ static void cpdma_desc_pool_destroy(struct cpdma_ctlr *ctlr) · 204 unmodified lines
205205 * devices (e.g. cpsw switches) use plain old memory. Descriptor pools
206206 * abstract out these details
207207 */
208−int cpdma_desc_pool_create(struct cpdma_ctlr *ctlr)
208+static int cpdma_desc_pool_create(struct cpdma_ctlr *ctlr)
209209 {
210210 struct cpdma_params *cpdma_params = &ctlr->params;
211211 struct cpdma_desc_pool *pool;
drivers/net/ethernet/ti/davinci_emac.c+17−2
@@ -1385,6 +1385,15 @@ static int emac_devioctl(struct net_device *ndev, struct ifreq *ifrq, int cmd) · 1384 unmodified lines
13851385 return -EOPNOTSUPP;
13861386 }
13871387
1388+static int match_first_device(struct device *dev, void *data)
1389+{
1390+ if (dev->parent && dev->parent->of_node)
1391+ return of_device_is_compatible(dev->parent->of_node,
1392+ "ti,davinci_mdio");
1393+
1394+ return !strncmp(dev_name(dev), "davinci_mdio", 12);
1395+}
1396+
13881397 /**
13891398 * emac_dev_open - EMAC device open
13901399 * @ndev: The DaVinci EMAC network adapter
@@ -1484,8 +1493,14 @@ static int emac_dev_open(struct net_device *ndev) · 93 unmodified lines
14841493
14851494 /* use the first phy on the bus if pdata did not give us a phy id */
14861495 if (!phydev && !priv->phy_id) {
1487− phy = bus_find_device_by_name(&mdio_bus_type, NULL,
1488− "davinci_mdio");
1496+ /* NOTE: we can't use bus_find_device_by_name() here because
1497+ * the device name is not guaranteed to be 'davinci_mdio'. On
1498+ * some systems it can be 'davinci_mdio.0' so we need to use
1499+ * strncmp() against the first part of the string to correctly
1500+ * match it.
1501+ */
1502+ phy = bus_find_device(&mdio_bus_type, NULL, NULL,
1503+ match_first_device);
14891504 if (phy) {
14901505 priv->phy_id = dev_name(phy);
14911506 if (!priv->phy_id || !*priv->phy_id)
drivers/net/hamradio/bpqether.c+2−6
@@ -89,10 +89,6 @@ · 88 unmodified lines
8989 static const char banner[] __initconst = KERN_INFO \
9090 "AX.25: bpqether driver version 004\n";
9191
92−static char bcast_addr[6]={0xFF,0xFF,0xFF,0xFF,0xFF,0xFF};
93−
94−static char bpq_eth_addr[6];
95−
9692 static int bpq_rcv(struct sk_buff *, struct net_device *, struct packet_type *, struct net_device *);
9793 static int bpq_device_event(struct notifier_block *, unsigned long, void *);
9894
@@ -501,8 +497,8 @@ static int bpq_new_device(struct net_device *edev) · 402 unmodified lines
501497 bpq->ethdev = edev;
502498 bpq->axdev = ndev;
503499
504− memcpy(bpq->dest_addr, bcast_addr, sizeof(bpq_eth_addr));
505− memcpy(bpq->acpt_addr, bcast_addr, sizeof(bpq_eth_addr));
500+ eth_broadcast_addr(bpq->dest_addr);
501+ eth_broadcast_addr(bpq->acpt_addr);
506502
507503 err = register_netdevice(ndev);
508504 if (err)
drivers/net/ipvlan/ipvlan_main.c+3−1
@@ -594,7 +594,8 @@ int ipvlan_link_new(struct net *src_net, struct net_device *dev, · 593 unmodified lines
594594 ipvlan->phy_dev = phy_dev;
595595 ipvlan->dev = dev;
596596 ipvlan->sfeatures = IPVLAN_FEATURES;
597− ipvlan_adjust_mtu(ipvlan, phy_dev);
597+ if (!tb[IFLA_MTU])
598+ ipvlan_adjust_mtu(ipvlan, phy_dev);
598599 INIT_LIST_HEAD(&ipvlan->addrs);
599600 spin_lock_init(&ipvlan->addrs_lock);
600601
@@ -693,6 +694,7 @@ void ipvlan_link_setup(struct net_device *dev) · 92 unmodified lines
693694 {
694695 ether_setup(dev);
695696
697+ dev->max_mtu = ETH_MAX_MTU;
696698 dev->priv_flags &= ~(IFF_XMIT_DST_RELEASE | IFF_TX_SKB_SHARING);
697699 dev->priv_flags |= IFF_UNICAST_FLT | IFF_NO_QUEUE;
698700 dev->netdev_ops = &ipvlan_netdev_ops;
drivers/net/net_failover.c+1−1
@@ -527,7 +527,7 @@ static int net_failover_slave_register(struct net_device *slave_dev, · 526 unmodified lines
527527
528528 netif_addr_lock_bh(failover_dev);
529529 dev_uc_sync_multiple(slave_dev, failover_dev);
530− dev_uc_sync_multiple(slave_dev, failover_dev);
530+ dev_mc_sync_multiple(slave_dev, failover_dev);
531531 netif_addr_unlock_bh(failover_dev);
532532
533533 err = vlan_vids_add_by_dev(slave_dev, failover_dev);
drivers/net/ppp/pppoe.c+1−1
@@ -1107,7 +1107,7 @@ static const struct proto_ops pppoe_ops = { · 1106 unmodified lines
11071107 .socketpair = sock_no_socketpair,
11081108 .accept = sock_no_accept,
11091109 .getname = pppoe_getname,
1110− .poll_mask = datagram_poll_mask,
1110+ .poll = datagram_poll,
11111111 .listen = sock_no_listen,
11121112 .shutdown = sock_no_shutdown,
11131113 .setsockopt = sock_no_setsockopt,
drivers/net/usb/cdc_ncm.c+1−2
@@ -967,8 +967,7 @@ void cdc_ncm_unbind(struct usbnet *dev, struct usb_interface *intf) · 966 unmodified lines
967967
968968 atomic_set(&ctx->stop, 1);
969969
970− if (hrtimer_active(&ctx->tx_timer))
971− hrtimer_cancel(&ctx->tx_timer);
970+ hrtimer_cancel(&ctx->tx_timer);
972971
973972 tasklet_kill(&ctx->bh);
974973
drivers/net/usb/qmi_wwan.c+1−0
@@ -1246,6 +1246,7 @@ static const struct usb_device_id products[] = { · 1245 unmodified lines
12461246 {QMI_FIXED_INTF(0x413c, 0x81b3, 8)}, /* Dell Wireless 5809e Gobi(TM) 4G LTE Mobile Broadband Card (rev3) */
12471247 {QMI_FIXED_INTF(0x413c, 0x81b6, 8)}, /* Dell Wireless 5811e */
12481248 {QMI_FIXED_INTF(0x413c, 0x81b6, 10)}, /* Dell Wireless 5811e */
1249+ {QMI_FIXED_INTF(0x413c, 0x81d7, 1)}, /* Dell Wireless 5821e */
12491250 {QMI_FIXED_INTF(0x03f0, 0x4e1d, 8)}, /* HP lt4111 LTE/EV-DO/HSPA+ Gobi 4G Module */
12501251 {QMI_FIXED_INTF(0x03f0, 0x9d1d, 1)}, /* HP lt4120 Snapdragon X5 LTE */
12511252 {QMI_FIXED_INTF(0x22de, 0x9061, 3)}, /* WeTelecom WPD-600N */
drivers/net/wireless/broadcom/brcm80211/Kconfig+0−1
@@ -60,7 +60,6 @@ config BRCMFMAC_PCIE · 59 unmodified lines
6060 bool "PCIE bus interface support for FullMAC driver"
6161 depends on BRCMFMAC
6262 depends on PCI
63− depends on HAS_DMA
6463 select BRCMFMAC_PROTO_MSGBUF
6564 select FW_LOADER
6665 ---help---
drivers/net/wireless/quantenna/qtnfmac/Kconfig+1−1
@@ -7,7 +7,7 @@ config QTNFMAC · 6 unmodified lines
77 config QTNFMAC_PEARL_PCIE
88 tristate "Quantenna QSR10g PCIe support"
99 default n
10− depends on HAS_DMA && PCI && CFG80211
10+ depends on PCI && CFG80211
1111 select QTNFMAC
1212 select FW_LOADER
1313 select CRC32
drivers/net/xen-netfront.c+6−5
@@ -1810,7 +1810,7 @@ static int talk_to_netback(struct xenbus_device *dev, · 1809 unmodified lines
18101810 err = xen_net_read_mac(dev, info->netdev->dev_addr);
18111811 if (err) {
18121812 xenbus_dev_fatal(dev, err, "parsing %s/mac", dev->nodename);
1813− goto out;
1813+ goto out_unlocked;
18141814 }
18151815
18161816 rtnl_lock();
@@ -1925,6 +1925,7 @@ abort_transaction_no_dev_fatal: · 108 unmodified lines
19251925 xennet_destroy_queues(info);
19261926 out:
19271927 rtnl_unlock();
1928+out_unlocked:
19281929 device_unregister(&dev->dev);
19291930 return err;
19301931 }
@@ -1950,10 +1951,6 @@ static int xennet_connect(struct net_device *dev) · 19 unmodified lines
19501951 /* talk_to_netback() sets the correct number of queues */
19511952 num_queues = dev->real_num_tx_queues;
19521953
1953− rtnl_lock();
1954− netdev_update_features(dev);
1955− rtnl_unlock();
1956−
19571954 if (dev->reg_state == NETREG_UNINITIALIZED) {
19581955 err = register_netdev(dev);
19591956 if (err) {
@@ -1963,6 +1960,10 @@ static int xennet_connect(struct net_device *dev) · 3 unmodified lines
19631960 }
19641961 }
19651962
1963+ rtnl_lock();
1964+ netdev_update_features(dev);
1965+ rtnl_unlock();
1966+
19661967 /*
19671968 * All public and private state should now be sane. Get
19681969 * ready to start sending and receiving packets and give the driver
drivers/nfc/pn533/usb.c+2−2
@@ -74,7 +74,7 @@ static void pn533_recv_response(struct urb *urb) · 73 unmodified lines
7474 struct sk_buff *skb = NULL;
7575
7676 if (!urb->status) {
77− skb = alloc_skb(urb->actual_length, GFP_KERNEL);
77+ skb = alloc_skb(urb->actual_length, GFP_ATOMIC);
7878 if (!skb) {
7979 nfc_err(&phy->udev->dev, "failed to alloc memory\n");
8080 } else {
@@ -186,7 +186,7 @@ static int pn533_usb_send_frame(struct pn533 *dev, · 105 unmodified lines
186186
187187 if (dev->protocol_type == PN533_PROTO_REQ_RESP) {
188188 /* request for response for sent packet directly */
189− rc = pn533_submit_urb_for_response(phy, GFP_ATOMIC);
189+ rc = pn533_submit_urb_for_response(phy, GFP_KERNEL);
190190 if (rc)
191191 goto error;
192192 } else if (dev->protocol_type == PN533_PROTO_REQ_ACK_RESP) {
drivers/nvdimm/pmem.c+2−1
@@ -414,7 +414,8 @@ static int pmem_attach_disk(struct device *dev, · 413 unmodified lines
414414 blk_queue_logical_block_size(q, pmem_sector_size(ndns));
415415 blk_queue_max_hw_sectors(q, UINT_MAX);
416416 blk_queue_flag_set(QUEUE_FLAG_NONROT, q);
417− blk_queue_flag_set(QUEUE_FLAG_DAX, q);
417+ if (pmem->pfn_flags & PFN_MAP)
418+ blk_queue_flag_set(QUEUE_FLAG_DAX, q);
418419 q->queuedata = pmem;
419420
420421 disk = alloc_disk_node(0, nid);
drivers/nvme/host/core.c+1−0
@@ -1808,6 +1808,7 @@ static void nvme_set_queue_limits(struct nvme_ctrl *ctrl, · 1807 unmodified lines
18081808 u32 max_segments =
18091809 (ctrl->max_hw_sectors / (ctrl->page_size >> 9)) + 1;
18101810
1811+ max_segments = min_not_zero(max_segments, ctrl->max_segments);
18111812 blk_queue_max_hw_sectors(q, ctrl->max_hw_sectors);
18121813 blk_queue_max_segments(q, min_t(u32, max_segments, USHRT_MAX));
18131814 }
drivers/nvme/host/fc.c+3−3
@@ -2790,6 +2790,9 @@ nvme_fc_delete_association(struct nvme_fc_ctrl *ctrl) · 2789 unmodified lines
27902790 /* re-enable the admin_q so anything new can fast fail */
27912791 blk_mq_unquiesce_queue(ctrl->ctrl.admin_q);
27922792
2793+ /* resume the io queues so that things will fast fail */
2794+ nvme_start_queues(&ctrl->ctrl);
2795+
27932796 nvme_fc_ctlr_inactive_on_rport(ctrl);
27942797 }
27952798
@@ -2804,9 +2807,6 @@ nvme_fc_delete_ctrl(struct nvme_ctrl *nctrl) · 8 unmodified lines
28042807 * waiting for io to terminate
28052808 */
28062809 nvme_fc_delete_association(ctrl);
2807−
2808− /* resume the io queues so that things will fast fail */
2809− nvme_start_queues(nctrl);
28102810 }
28112811
28122812 static void
drivers/nvme/host/nvme.h+1−0
@@ -170,6 +170,7 @@ struct nvme_ctrl { · 169 unmodified lines
170170 u64 cap;
171171 u32 page_size;
172172 u32 max_hw_sectors;
173+ u32 max_segments;
173174 u16 oncs;
174175 u16 oacs;
175176 u16 nssa;
drivers/nvme/host/pci.c+38−6
@@ -38,6 +38,13 @@ · 37 unmodified lines
3838
3939 #define SGES_PER_PAGE (PAGE_SIZE / sizeof(struct nvme_sgl_desc))
4040
41+/*
42+ * These can be higher, but we need to ensure that any command doesn't
43+ * require an sg allocation that needs more than a page of data.
44+ */
45+#define NVME_MAX_KB_SZ 4096
46+#define NVME_MAX_SEGS 127
47+
4148 static int use_threaded_interrupts;
4249 module_param(use_threaded_interrupts, int, 0);
4350
@@ -100,6 +107,8 @@ struct nvme_dev { · 56 unmodified lines
100107 struct nvme_ctrl ctrl;
101108 struct completion ioq_wait;
102109
110+ mempool_t *iod_mempool;
111+
103112 /* shadow doorbell buffer support: */
104113 u32 *dbbuf_dbs;
105114 dma_addr_t dbbuf_dbs_dma_addr;
@@ -477,10 +486,7 @@ static blk_status_t nvme_init_iod(struct request *rq, struct nvme_dev *dev) · 371 unmodified lines
477486 iod->use_sgl = nvme_pci_use_sgls(dev, rq);
478487
479488 if (nseg > NVME_INT_PAGES || size > NVME_INT_BYTES(dev)) {
480− size_t alloc_size = nvme_pci_iod_alloc_size(dev, size, nseg,
481− iod->use_sgl);
482−
483− iod->sg = kmalloc(alloc_size, GFP_ATOMIC);
489+ iod->sg = mempool_alloc(dev->iod_mempool, GFP_ATOMIC);
484490 if (!iod->sg)
485491 return BLK_STS_RESOURCE;
486492 } else {
@@ -526,7 +532,7 @@ static void nvme_free_iod(struct nvme_dev *dev, struct request *req) · 39 unmodified lines
526532 }
527533
528534 if (iod->sg != iod->inline_sg)
529− kfree(iod->sg);
535+ mempool_free(iod->sg, dev->iod_mempool);
530536 }
531537
532538 #ifdef CONFIG_BLK_DEV_INTEGRITY
@@ -2280,6 +2286,7 @@ static void nvme_pci_free_ctrl(struct nvme_ctrl *ctrl) · 1747 unmodified lines
22802286 blk_put_queue(dev->ctrl.admin_q);
22812287 kfree(dev->queues);
22822288 free_opal_dev(dev->ctrl.opal_dev);
2289+ mempool_destroy(dev->iod_mempool);
22832290 kfree(dev);
22842291 }
22852292
@@ -2289,6 +2296,7 @@ static void nvme_remove_dead_ctrl(struct nvme_dev *dev, int status) · 3 unmodified lines
22892296
22902297 nvme_get_ctrl(&dev->ctrl);
22912298 nvme_dev_disable(dev, false);
2299+ nvme_kill_queues(&dev->ctrl);
22922300 if (!queue_work(nvme_wq, &dev->remove_work))
22932301 nvme_put_ctrl(&dev->ctrl);
22942302 }
@@ -2333,6 +2341,13 @@ static void nvme_reset_work(struct work_struct *work) · 38 unmodified lines
23332341 if (result)
23342342 goto out;
23352343
2344+ /*
2345+ * Limit the max command size to prevent iod->sg allocations going
2346+ * over a single page.
2347+ */
2348+ dev->ctrl.max_hw_sectors = NVME_MAX_KB_SZ << 1;
2349+ dev->ctrl.max_segments = NVME_MAX_SEGS;
2350+
23362351 result = nvme_init_identify(&dev->ctrl);
23372352 if (result)
23382353 goto out;
@@ -2405,7 +2420,6 @@ static void nvme_remove_dead_ctrl_work(struct work_struct *work) · 66 unmodified lines
24052420 struct nvme_dev *dev = container_of(work, struct nvme_dev, remove_work);
24062421 struct pci_dev *pdev = to_pci_dev(dev->dev);
24072422
2408− nvme_kill_queues(&dev->ctrl);
24092423 if (pci_get_drvdata(pdev))
24102424 device_release_driver(&pdev->dev);
24112425 nvme_put_ctrl(&dev->ctrl);
@@ -2509,6 +2523,7 @@ static int nvme_probe(struct pci_dev *pdev, const struct pci_device_id *id) · 97 unmodified lines
25092523 int node, result = -ENOMEM;
25102524 struct nvme_dev *dev;
25112525 unsigned long quirks = id->driver_data;
2526+ size_t alloc_size;
25122527
25132528 node = dev_to_node(&pdev->dev);
25142529 if (node == NUMA_NO_NODE)
@@ -2546,6 +2561,23 @@ static int nvme_probe(struct pci_dev *pdev, const struct pci_device_id *id) · 31 unmodified lines
25462561 if (result)
25472562 goto release_pools;
25482563
2564+ /*
2565+ * Double check that our mempool alloc size will cover the biggest
2566+ * command we support.
2567+ */
2568+ alloc_size = nvme_pci_iod_alloc_size(dev, NVME_MAX_KB_SZ,
2569+ NVME_MAX_SEGS, true);
2570+ WARN_ON_ONCE(alloc_size > PAGE_SIZE);
2571+
2572+ dev->iod_mempool = mempool_create_node(1, mempool_kmalloc,
2573+ mempool_kfree,
2574+ (void *) alloc_size,
2575+ GFP_KERNEL, node);
2576+ if (!dev->iod_mempool) {
2577+ result = -ENOMEM;
2578+ goto release_pools;
2579+ }
2580+
25492581 dev_info(dev->ctrl.device, "pci function %s\n", dev_name(&pdev->dev));
25502582
25512583 nvme_get_ctrl(&dev->ctrl);
drivers/nvme/host/rdma.c+40−36
@@ -560,12 +560,6 @@ static void nvme_rdma_free_queue(struct nvme_rdma_queue *queue) · 559 unmodified lines
560560 if (!test_and_clear_bit(NVME_RDMA_Q_ALLOCATED, &queue->flags))
561561 return;
562562
563− if (nvme_rdma_queue_idx(queue) == 0) {
564− nvme_rdma_free_qe(queue->device->dev,
565− &queue->ctrl->async_event_sqe,
566− sizeof(struct nvme_command), DMA_TO_DEVICE);
567− }
568−
569563 nvme_rdma_destroy_queue_ib(queue);
570564 rdma_destroy_id(queue->cm_id);
571565 }
@@ -698,7 +692,7 @@ static struct blk_mq_tag_set *nvme_rdma_alloc_tagset(struct nvme_ctrl *nctrl, · 126 unmodified lines
698692 set = &ctrl->tag_set;
699693 memset(set, 0, sizeof(*set));
700694 set->ops = &nvme_rdma_mq_ops;
701− set->queue_depth = nctrl->opts->queue_size;
695+ set->queue_depth = nctrl->sqsize + 1;
702696 set->reserved_tags = 1; /* fabric connect */
703697 set->numa_node = NUMA_NO_NODE;
704698 set->flags = BLK_MQ_F_SHOULD_MERGE;
@@ -734,11 +728,15 @@ out: · 29 unmodified lines
734728 static void nvme_rdma_destroy_admin_queue(struct nvme_rdma_ctrl *ctrl,
735729 bool remove)
736730 {
737− nvme_rdma_stop_queue(&ctrl->queues[0]);
738731 if (remove) {
739732 blk_cleanup_queue(ctrl->ctrl.admin_q);
740733 nvme_rdma_free_tagset(&ctrl->ctrl, ctrl->ctrl.admin_tagset);
741734 }
735+ if (ctrl->async_event_sqe.data) {
736+ nvme_rdma_free_qe(ctrl->device->dev, &ctrl->async_event_sqe,
737+ sizeof(struct nvme_command), DMA_TO_DEVICE);
738+ ctrl->async_event_sqe.data = NULL;
739+ }
742740 nvme_rdma_free_queue(&ctrl->queues[0]);
743741 }
744742
@@ -755,11 +753,16 @@ static int nvme_rdma_configure_admin_queue(struct nvme_rdma_ctrl *ctrl, · 10 unmodified lines
755753
756754 ctrl->max_fr_pages = nvme_rdma_get_max_fr_pages(ctrl->device->dev);
757755
756+ error = nvme_rdma_alloc_qe(ctrl->device->dev, &ctrl->async_event_sqe,
757+ sizeof(struct nvme_command), DMA_TO_DEVICE);
758+ if (error)
759+ goto out_free_queue;
760+
758761 if (new) {
759762 ctrl->ctrl.admin_tagset = nvme_rdma_alloc_tagset(&ctrl->ctrl, true);
760763 if (IS_ERR(ctrl->ctrl.admin_tagset)) {
761764 error = PTR_ERR(ctrl->ctrl.admin_tagset);
762− goto out_free_queue;
765+ goto out_free_async_qe;
763766 }
764767
765768 ctrl->ctrl.admin_q = blk_mq_init_queue(&ctrl->admin_tag_set);
@@ -795,12 +798,6 @@ static int nvme_rdma_configure_admin_queue(struct nvme_rdma_ctrl *ctrl, · 29 unmodified lines
795798 if (error)
796799 goto out_stop_queue;
797800
798− error = nvme_rdma_alloc_qe(ctrl->queues[0].device->dev,
799− &ctrl->async_event_sqe, sizeof(struct nvme_command),
800− DMA_TO_DEVICE);
801− if (error)
802− goto out_stop_queue;
803−
804801 return 0;
805802
806803 out_stop_queue:
@@ -811,6 +808,9 @@ out_cleanup_queue: · 4 unmodified lines
811808 out_free_tagset:
812809 if (new)
813810 nvme_rdma_free_tagset(&ctrl->ctrl, ctrl->ctrl.admin_tagset);
811+out_free_async_qe:
812+ nvme_rdma_free_qe(ctrl->device->dev, &ctrl->async_event_sqe,
813+ sizeof(struct nvme_command), DMA_TO_DEVICE);
814814 out_free_queue:
815815 nvme_rdma_free_queue(&ctrl->queues[0]);
816816 return error;
@@ -819,7 +819,6 @@ out_free_queue: · 2 unmodified lines
819819 static void nvme_rdma_destroy_io_queues(struct nvme_rdma_ctrl *ctrl,
820820 bool remove)
821821 {
822− nvme_rdma_stop_io_queues(ctrl);
823822 if (remove) {
824823 blk_cleanup_queue(ctrl->ctrl.connect_q);
825824 nvme_rdma_free_tagset(&ctrl->ctrl, ctrl->ctrl.tagset);
@@ -888,9 +887,9 @@ static void nvme_rdma_free_ctrl(struct nvme_ctrl *nctrl) · 62 unmodified lines
888887 list_del(&ctrl->list);
889888 mutex_unlock(&nvme_rdma_ctrl_mutex);
890889
891− kfree(ctrl->queues);
892890 nvmf_free_options(nctrl->opts);
893891 free_ctrl:
892+ kfree(ctrl->queues);
894893 kfree(ctrl);
895894 }
896895
@@ -949,6 +948,7 @@ static void nvme_rdma_reconnect_ctrl_work(struct work_struct *work) · 52 unmodified lines
949948 return;
950949
951950 destroy_admin:
951+ nvme_rdma_stop_queue(&ctrl->queues[0]);
952952 nvme_rdma_destroy_admin_queue(ctrl, false);
953953 requeue:
954954 dev_info(ctrl->ctrl.device, "Failed reconnect attempt %d\n",
@@ -965,12 +965,14 @@ static void nvme_rdma_error_recovery_work(struct work_struct *work) · 10 unmodified lines
965965
966966 if (ctrl->ctrl.queue_count > 1) {
967967 nvme_stop_queues(&ctrl->ctrl);
968+ nvme_rdma_stop_io_queues(ctrl);
968969 blk_mq_tagset_busy_iter(&ctrl->tag_set,
969970 nvme_cancel_request, &ctrl->ctrl);
970971 nvme_rdma_destroy_io_queues(ctrl, false);
971972 }
972973
973974 blk_mq_quiesce_queue(ctrl->ctrl.admin_q);
975+ nvme_rdma_stop_queue(&ctrl->queues[0]);
974976 blk_mq_tagset_busy_iter(&ctrl->admin_tag_set,
975977 nvme_cancel_request, &ctrl->ctrl);
976978 nvme_rdma_destroy_admin_queue(ctrl, false);
@@ -1736,6 +1738,7 @@ static void nvme_rdma_shutdown_ctrl(struct nvme_rdma_ctrl *ctrl, bool shutdown) · 759 unmodified lines
17361738 {
17371739 if (ctrl->ctrl.queue_count > 1) {
17381740 nvme_stop_queues(&ctrl->ctrl);
1741+ nvme_rdma_stop_io_queues(ctrl);
17391742 blk_mq_tagset_busy_iter(&ctrl->tag_set,
17401743 nvme_cancel_request, &ctrl->ctrl);
17411744 nvme_rdma_destroy_io_queues(ctrl, shutdown);
@@ -1747,6 +1750,7 @@ static void nvme_rdma_shutdown_ctrl(struct nvme_rdma_ctrl *ctrl, bool shutdown) · 5 unmodified lines
17471750 nvme_disable_ctrl(&ctrl->ctrl, ctrl->ctrl.cap);
17481751
17491752 blk_mq_quiesce_queue(ctrl->ctrl.admin_q);
1753+ nvme_rdma_stop_queue(&ctrl->queues[0]);
17501754 blk_mq_tagset_busy_iter(&ctrl->admin_tag_set,
17511755 nvme_cancel_request, &ctrl->ctrl);
17521756 blk_mq_unquiesce_queue(ctrl->ctrl.admin_q);
@@ -1932,11 +1936,6 @@ static struct nvme_ctrl *nvme_rdma_create_ctrl(struct device *dev, · 179 unmodified lines
19321936 goto out_free_ctrl;
19331937 }
19341938
1935− ret = nvme_init_ctrl(&ctrl->ctrl, dev, &nvme_rdma_ctrl_ops,
1936− 0 /* no quirks, we're perfect! */);
1937− if (ret)
1938− goto out_free_ctrl;
1939−
19401939 INIT_DELAYED_WORK(&ctrl->reconnect_work,
19411940 nvme_rdma_reconnect_ctrl_work);
19421941 INIT_WORK(&ctrl->err_work, nvme_rdma_error_recovery_work);
@@ -1950,14 +1949,19 @@ static struct nvme_ctrl *nvme_rdma_create_ctrl(struct device *dev, · 7 unmodified lines
19501949 ctrl->queues = kcalloc(ctrl->ctrl.queue_count, sizeof(*ctrl->queues),
19511950 GFP_KERNEL);
19521951 if (!ctrl->queues)
1953− goto out_uninit_ctrl;
1952+ goto out_free_ctrl;
1953+
1954+ ret = nvme_init_ctrl(&ctrl->ctrl, dev, &nvme_rdma_ctrl_ops,
1955+ 0 /* no quirks, we're perfect! */);
1956+ if (ret)
1957+ goto out_kfree_queues;
19541958
19551959 changed = nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_CONNECTING);
19561960 WARN_ON_ONCE(!changed);
19571961
19581962 ret = nvme_rdma_configure_admin_queue(ctrl, true);
19591963 if (ret)
1960− goto out_kfree_queues;
1964+ goto out_uninit_ctrl;
19611965
19621966 /* sanity check icdoff */
19631967 if (ctrl->ctrl.icdoff) {
@@ -1974,20 +1978,19 @@ static struct nvme_ctrl *nvme_rdma_create_ctrl(struct device *dev, · 10 unmodified lines
19741978 goto out_remove_admin_queue;
19751979 }
19761980
1977− if (opts->queue_size > ctrl->ctrl.maxcmd) {
1978− /* warn if maxcmd is lower than queue_size */
1979− dev_warn(ctrl->ctrl.device,
1980− "queue_size %zu > ctrl maxcmd %u, clamping down\n",
1981− opts->queue_size, ctrl->ctrl.maxcmd);
1982− opts->queue_size = ctrl->ctrl.maxcmd;
1983− }
1984−
1981+ /* only warn if argument is too large here, will clamp later */
19851982 if (opts->queue_size > ctrl->ctrl.sqsize + 1) {
1986− /* warn if sqsize is lower than queue_size */
19871983 dev_warn(ctrl->ctrl.device,
19881984 "queue_size %zu > ctrl sqsize %u, clamping down\n",
19891985 opts->queue_size, ctrl->ctrl.sqsize + 1);
1990− opts->queue_size = ctrl->ctrl.sqsize + 1;
1986+ }
1987+
1988+ /* warn if maxcmd is lower than sqsize+1 */
1989+ if (ctrl->ctrl.sqsize + 1 > ctrl->ctrl.maxcmd) {
1990+ dev_warn(ctrl->ctrl.device,
1991+ "sqsize %u > ctrl maxcmd %u, clamping down\n",
1992+ ctrl->ctrl.sqsize + 1, ctrl->ctrl.maxcmd);
1993+ ctrl->ctrl.sqsize = ctrl->ctrl.maxcmd - 1;
19911994 }
19921995
19931996 if (opts->nr_io_queues) {
@@ -2013,15 +2016,16 @@ static struct nvme_ctrl *nvme_rdma_create_ctrl(struct device *dev, · 19 unmodified lines
20132016 return &ctrl->ctrl;
20142017
20152018 out_remove_admin_queue:
2019+ nvme_rdma_stop_queue(&ctrl->queues[0]);
20162020 nvme_rdma_destroy_admin_queue(ctrl, true);
2017−out_kfree_queues:
2018− kfree(ctrl->queues);
20192021 out_uninit_ctrl:
20202022 nvme_uninit_ctrl(&ctrl->ctrl);
20212023 nvme_put_ctrl(&ctrl->ctrl);
20222024 if (ret > 0)
20232025 ret = -EIO;
20242026 return ERR_PTR(ret);
2027+out_kfree_queues:
2028+ kfree(ctrl->queues);
20252029 out_free_ctrl:
20262030 kfree(ctrl);
20272031 return ERR_PTR(ret);
drivers/nvme/target/core.c+8−0
@@ -686,6 +686,14 @@ static void nvmet_start_ctrl(struct nvmet_ctrl *ctrl) · 685 unmodified lines
686686 }
687687
688688 ctrl->csts = NVME_CSTS_RDY;
689+
690+ /*
691+ * Controllers that are not yet enabled should not really enforce the
692+ * keep alive timeout, but we still want to track a timeout and cleanup
693+ * in case a host died before it enabled the controller. Hence, simply
694+ * reset the keep alive timer when the controller is enabled.
695+ */
696+ mod_delayed_work(system_wq, &ctrl->ka_work, ctrl->kato * HZ);
689697 }
690698
691699 static void nvmet_clear_ctrl(struct nvmet_ctrl *ctrl)
drivers/opp/core.c+1−1
@@ -598,7 +598,7 @@ static int _generic_set_opp_regulator(const struct opp_table *opp_table, · 597 unmodified lines
598598 }
599599
600600 /* Scaling up? Scale voltage before frequency */
601− if (freq > old_freq) {
601+ if (freq >= old_freq) {
602602 ret = _set_opp_voltage(dev, reg, new_supply);
603603 if (ret)
604604 goto restore_voltage;
drivers/pci/Makefile+3−3
@@ -28,10 +28,10 @@ obj-$(CONFIG_PCI_PF_STUB) += pci-pf-stub.o · 27 unmodified lines
2828 obj-$(CONFIG_PCI_ECAM) += ecam.o
2929 obj-$(CONFIG_XEN_PCIDEV_FRONTEND) += xen-pcifront.o
3030
31−obj-y += controller/
32−obj-y += switch/
33−
3431 # Endpoint library must be initialized before its users
3532 obj-$(CONFIG_PCI_ENDPOINT) += endpoint/
3633
34+obj-y += controller/
35+obj-y += switch/
36+
3737 ccflags-$(CONFIG_PCI_DEBUG) := -DDEBUG
drivers/pci/controller/Kconfig+0−3
@@ -96,7 +96,6 @@ config PCI_HOST_GENERIC · 95 unmodified lines
9696 depends on OF
9797 select PCI_HOST_COMMON
9898 select IRQ_DOMAIN
99− select PCI_DOMAINS
10099 help
101100 Say Y here if you want to support a simple generic PCI host
102101 controller, such as the one emulated by kvmtool.
@@ -138,7 +137,6 @@ config PCI_VERSATILE · 35 unmodified lines
138137
139138 config PCIE_IPROC
140139 tristate
141− select PCI_DOMAINS
142140 help
143141 This enables the iProc PCIe core controller support for Broadcom's
144142 iProc family of SoCs. An appropriate bus interface driver needs
@@ -176,7 +174,6 @@ config PCIE_IPROC_MSI · 31 unmodified lines
176174 config PCIE_ALTERA
177175 bool "Altera PCIe controller"
178176 depends on ARM || NIOS2 || COMPILE_TEST
179− select PCI_DOMAINS
180177 help
181178 Say Y here if you want to enable PCIe controller support on Altera
182179 FPGA.
drivers/pci/hotplug/acpi_pcihp.c+9−1
@@ -7,7 +7,6 @@ · 6 unmodified lines
77 * All rights reserved.
88 *
99 * Send feedback to <kristen.c.accardi@intel.com>
10− *
1110 */
1211
1312 #include <linux/module.h>
@@ -87,8 +86,17 @@ int acpi_get_hp_hw_control_from_firmware(struct pci_dev *pdev) · 73 unmodified lines
8786 return 0;
8887
8988 /* If _OSC exists, we should not evaluate OSHP */
89+
90+ /*
91+ * If there's no ACPI host bridge (i.e., ACPI support is compiled
92+ * into the kernel but the hardware platform doesn't support ACPI),
93+ * there's nothing to do here.
94+ */
9095 host = pci_find_host_bridge(pdev->bus);
9196 root = acpi_pci_find_root(ACPI_HANDLE(&host->dev));
97+ if (!root)
98+ return 0;
99+
92100 if (root->osc_support_set)
93101 goto no_control;
94102
drivers/perf/xgene_pmu.c+1−1
@@ -1463,7 +1463,7 @@ static char *xgene_pmu_dev_name(struct device *dev, u32 type, int id) · 1462 unmodified lines
14631463 case PMU_TYPE_IOB:
14641464 return devm_kasprintf(dev, GFP_KERNEL, "iob%d", id);
14651465 case PMU_TYPE_IOB_SLOW:
1466− return devm_kasprintf(dev, GFP_KERNEL, "iob-slow%d", id);
1466+ return devm_kasprintf(dev, GFP_KERNEL, "iob_slow%d", id);
14671467 case PMU_TYPE_MCB:
14681468 return devm_kasprintf(dev, GFP_KERNEL, "mcb%d", id);
14691469 case PMU_TYPE_MC:
drivers/pinctrl/actions/pinctrl-owl.c+1−1
@@ -333,7 +333,7 @@ static int owl_pin_config_set(struct pinctrl_dev *pctrldev, · 332 unmodified lines
333333 unsigned long flags;
334334 unsigned int param;
335335 u32 reg, bit, width, arg;
336− int ret, i;
336+ int ret = 0, i;
337337
338338 info = &pctrl->soc->padinfo[pin];
339339
drivers/pinctrl/devicetree.c+5−2
@@ -101,10 +101,11 @@ struct pinctrl_dev *of_pinctrl_get(struct device_node *np) · 100 unmodified lines
101101 }
102102
103103 static int dt_to_map_one_config(struct pinctrl *p,
104− struct pinctrl_dev *pctldev,
104+ struct pinctrl_dev *hog_pctldev,
105105 const char *statename,
106106 struct device_node *np_config)
107107 {
108+ struct pinctrl_dev *pctldev = NULL;
108109 struct device_node *np_pctldev;
109110 const struct pinctrl_ops *ops;
110111 int ret;
@@ -123,8 +124,10 @@ static int dt_to_map_one_config(struct pinctrl *p, · 12 unmodified lines
123124 return -EPROBE_DEFER;
124125 }
125126 /* If we're creating a hog we can use the passed pctldev */
126− if (pctldev && (np_pctldev == p->dev->of_node))
127+ if (hog_pctldev && (np_pctldev == p->dev->of_node)) {
128+ pctldev = hog_pctldev;
127129 break;
130+ }
128131 pctldev = get_pinctrl_dev_from_of_node(np_pctldev);
129132 if (pctldev)
130133 break;
drivers/pinctrl/mediatek/pinctrl-mt7622.c+5−1
@@ -1459,6 +1459,9 @@ static int mtk_gpio_to_irq(struct gpio_chip *chip, unsigned int offset) · 1458 unmodified lines
14591459 struct mtk_pinctrl *hw = gpiochip_get_data(chip);
14601460 unsigned long eint_n;
14611461
1462+ if (!hw->eint)
1463+ return -ENOTSUPP;
1464+
14621465 eint_n = offset;
14631466
14641467 return mtk_eint_find_irq(hw->eint, eint_n);
@@ -1471,7 +1474,8 @@ static int mtk_gpio_set_config(struct gpio_chip *chip, unsigned int offset, · 6 unmodified lines
14711474 unsigned long eint_n;
14721475 u32 debounce;
14731476
1474− if (pinconf_to_config_param(config) != PIN_CONFIG_INPUT_DEBOUNCE)
1477+ if (!hw->eint ||
1478+ pinconf_to_config_param(config) != PIN_CONFIG_INPUT_DEBOUNCE)
14751479 return -ENOTSUPP;
14761480
14771481 debounce = pinconf_to_config_argument(config);
drivers/pinctrl/mediatek/pinctrl-mtk-common.c+0−5
@@ -1000,11 +1000,6 @@ static int mtk_eint_init(struct mtk_pinctrl *pctl, struct platform_device *pdev) · 999 unmodified lines
10001000 return -ENOMEM;
10011001
10021002 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1003− if (!res) {
1004− dev_err(&pdev->dev, "Unable to get eint resource\n");
1005− return -ENODEV;
1006− }
1007−
10081003 pctl->eint->base = devm_ioremap_resource(&pdev->dev, res);
10091004 if (IS_ERR(pctl->eint->base))
10101005 return PTR_ERR(pctl->eint->base);
drivers/pinctrl/pinctrl-single.c+11−3
@@ -1590,8 +1590,11 @@ static int pcs_save_context(struct pcs_device *pcs) · 1589 unmodified lines
15901590
15911591 mux_bytes = pcs->width / BITS_PER_BYTE;
15921592
1593− if (!pcs->saved_vals)
1593+ if (!pcs->saved_vals) {
15941594 pcs->saved_vals = devm_kzalloc(pcs->dev, pcs->size, GFP_ATOMIC);
1595+ if (!pcs->saved_vals)
1596+ return -ENOMEM;
1597+ }
15951598
15961599 switch (pcs->width) {
15971600 case 64:
@@ -1651,8 +1654,13 @@ static int pinctrl_single_suspend(struct platform_device *pdev, · 53 unmodified lines
16511654 if (!pcs)
16521655 return -EINVAL;
16531656
1654− if (pcs->flags & PCS_CONTEXT_LOSS_OFF)
1655− pcs_save_context(pcs);
1657+ if (pcs->flags & PCS_CONTEXT_LOSS_OFF) {
1658+ int ret;
1659+
1660+ ret = pcs_save_context(pcs);
1661+ if (ret < 0)
1662+ return ret;
1663+ }
16561664
16571665 return pinctrl_force_sleep(pcs->pctl);
16581666 }
drivers/ptp/ptp_chardev.c+2−2
@@ -221,7 +221,7 @@ long ptp_ioctl(struct posix_clock *pc, unsigned int cmd, unsigned long arg) · 220 unmodified lines
221221 }
222222 pct = &sysoff->ts[0];
223223 for (i = 0; i < sysoff->n_samples; i++) {
224− getnstimeofday64(&ts);
224+ ktime_get_real_ts64(&ts);
225225 pct->sec = ts.tv_sec;
226226 pct->nsec = ts.tv_nsec;
227227 pct++;
@@ -230,7 +230,7 @@ long ptp_ioctl(struct posix_clock *pc, unsigned int cmd, unsigned long arg) · 2 unmodified lines
230230 pct->nsec = ts.tv_nsec;
231231 pct++;
232232 }
233− getnstimeofday64(&ts);
233+ ktime_get_real_ts64(&ts);
234234 pct->sec = ts.tv_sec;
235235 pct->nsec = ts.tv_nsec;
236236 if (copy_to_user((void __user *)arg, sysoff, sizeof(*sysoff)))
drivers/ptp/ptp_qoriq.c+1−1
@@ -374,7 +374,7 @@ static int qoriq_ptp_probe(struct platform_device *dev) · 373 unmodified lines
374374 pr_err("ioremap ptp registers failed\n");
375375 goto no_ioremap;
376376 }
377− getnstimeofday64(&now);
377+ ktime_get_real_ts64(&now);
378378 ptp_qoriq_settime(&qoriq_ptp->caps, &now);
379379
380380 tmr_ctrl =
drivers/s390/block/dasd.c+56−115
@@ -1222,80 +1222,37 @@ static void dasd_hosts_init(struct dentry *base_dentry, · 1221 unmodified lines
12221222 device->hosts_dentry = pde;
12231223 }
12241224
1225−/*
1226− * Allocate memory for a channel program with 'cplength' channel
1227− * command words and 'datasize' additional space. There are two
1228− * variantes: 1) dasd_kmalloc_request uses kmalloc to get the needed
1229− * memory and 2) dasd_smalloc_request uses the static ccw memory
1230− * that gets allocated for each device.
1231− */
1232−struct dasd_ccw_req *dasd_kmalloc_request(int magic, int cplength,
1233− int datasize,
1234− struct dasd_device *device)
1235−{
1236− struct dasd_ccw_req *cqr;
1237−
1238− /* Sanity checks */
1239− BUG_ON(datasize > PAGE_SIZE ||
1240− (cplength*sizeof(struct ccw1)) > PAGE_SIZE);
1241−
1242− cqr = kzalloc(sizeof(struct dasd_ccw_req), GFP_ATOMIC);
1243− if (cqr == NULL)
1244− return ERR_PTR(-ENOMEM);
1245− cqr->cpaddr = NULL;
1246− if (cplength > 0) {
1247− cqr->cpaddr = kcalloc(cplength, sizeof(struct ccw1),
1248− GFP_ATOMIC | GFP_DMA);
1249− if (cqr->cpaddr == NULL) {
1250− kfree(cqr);
1251− return ERR_PTR(-ENOMEM);
1252− }
1253− }
1254− cqr->data = NULL;
1255− if (datasize > 0) {
1256− cqr->data = kzalloc(datasize, GFP_ATOMIC | GFP_DMA);
1257− if (cqr->data == NULL) {
1258− kfree(cqr->cpaddr);
1259− kfree(cqr);
1260− return ERR_PTR(-ENOMEM);
1261− }
1262− }
1263− cqr->magic = magic;
1264− set_bit(DASD_CQR_FLAGS_USE_ERP, &cqr->flags);
1265− dasd_get_device(device);
1266− return cqr;
1267−}
1268−EXPORT_SYMBOL(dasd_kmalloc_request);
1269−
1270−struct dasd_ccw_req *dasd_smalloc_request(int magic, int cplength,
1271− int datasize,
1272− struct dasd_device *device)
1225+struct dasd_ccw_req *dasd_smalloc_request(int magic, int cplength, int datasize,
1226+ struct dasd_device *device,
1227+ struct dasd_ccw_req *cqr)
12731228 {
12741229 unsigned long flags;
1275− struct dasd_ccw_req *cqr;
1276− char *data;
1277− int size;
1230+ char *data, *chunk;
1231+ int size = 0;
12781232
1279− size = (sizeof(struct dasd_ccw_req) + 7L) & -8L;
12801233 if (cplength > 0)
12811234 size += cplength * sizeof(struct ccw1);
12821235 if (datasize > 0)
12831236 size += datasize;
1237+ if (!cqr)
1238+ size += (sizeof(*cqr) + 7L) & -8L;
1239+
12841240 spin_lock_irqsave(&device->mem_lock, flags);
1285− cqr = (struct dasd_ccw_req *)
1286− dasd_alloc_chunk(&device->ccw_chunks, size);
1241+ data = chunk = dasd_alloc_chunk(&device->ccw_chunks, size);
12871242 spin_unlock_irqrestore(&device->mem_lock, flags);
1288− if (cqr == NULL)
1243+ if (!chunk)
12891244 return ERR_PTR(-ENOMEM);
1290− memset(cqr, 0, sizeof(struct dasd_ccw_req));
1291− data = (char *) cqr + ((sizeof(struct dasd_ccw_req) + 7L) & -8L);
1292− cqr->cpaddr = NULL;
1245+ if (!cqr) {
1246+ cqr = (void *) data;
1247+ data += (sizeof(*cqr) + 7L) & -8L;
1248+ }
1249+ memset(cqr, 0, sizeof(*cqr));
1250+ cqr->mem_chunk = chunk;
12931251 if (cplength > 0) {
1294− cqr->cpaddr = (struct ccw1 *) data;
1295− data += cplength*sizeof(struct ccw1);
1296− memset(cqr->cpaddr, 0, cplength*sizeof(struct ccw1));
1252+ cqr->cpaddr = data;
1253+ data += cplength * sizeof(struct ccw1);
1254+ memset(cqr->cpaddr, 0, cplength * sizeof(struct ccw1));
12971255 }
1298− cqr->data = NULL;
12991256 if (datasize > 0) {
13001257 cqr->data = data;
13011258 memset(cqr->data, 0, datasize);
@@ -1307,33 +1264,12 @@ struct dasd_ccw_req *dasd_smalloc_request(int magic, int cplength, · 5 unmodified lines
13071264 }
13081265 EXPORT_SYMBOL(dasd_smalloc_request);
13091266
1310−/*
1311− * Free memory of a channel program. This function needs to free all the
1312− * idal lists that might have been created by dasd_set_cda and the
1313− * struct dasd_ccw_req itself.
1314− */
1315−void dasd_kfree_request(struct dasd_ccw_req *cqr, struct dasd_device *device)
1316−{
1317− struct ccw1 *ccw;
1318−
1319− /* Clear any idals used for the request. */
1320− ccw = cqr->cpaddr;
1321− do {
1322− clear_normalized_cda(ccw);
1323− } while (ccw++->flags & (CCW_FLAG_CC | CCW_FLAG_DC));
1324− kfree(cqr->cpaddr);
1325− kfree(cqr->data);
1326− kfree(cqr);
1327− dasd_put_device(device);
1328−}
1329−EXPORT_SYMBOL(dasd_kfree_request);
1330−
13311267 void dasd_sfree_request(struct dasd_ccw_req *cqr, struct dasd_device *device)
13321268 {
13331269 unsigned long flags;
13341270
13351271 spin_lock_irqsave(&device->mem_lock, flags);
1336− dasd_free_chunk(&device->ccw_chunks, cqr);
1272+ dasd_free_chunk(&device->ccw_chunks, cqr->mem_chunk);
13371273 spin_unlock_irqrestore(&device->mem_lock, flags);
13381274 dasd_put_device(device);
13391275 }
@@ -1885,6 +1821,33 @@ static void __dasd_device_process_ccw_queue(struct dasd_device *device, · 545 unmodified lines
18851821 }
18861822 }
18871823
1824+static void __dasd_process_cqr(struct dasd_device *device,
1825+ struct dasd_ccw_req *cqr)
1826+{
1827+ char errorstring[ERRORLENGTH];
1828+
1829+ switch (cqr->status) {
1830+ case DASD_CQR_SUCCESS:
1831+ cqr->status = DASD_CQR_DONE;
1832+ break;
1833+ case DASD_CQR_ERROR:
1834+ cqr->status = DASD_CQR_NEED_ERP;
1835+ break;
1836+ case DASD_CQR_CLEARED:
1837+ cqr->status = DASD_CQR_TERMINATED;
1838+ break;
1839+ default:
1840+ /* internal error 12 - wrong cqr status*/
1841+ snprintf(errorstring, ERRORLENGTH, "12 %p %x02", cqr, cqr->status);
1842+ dev_err(&device->cdev->dev,
1843+ "An error occurred in the DASD device driver, "
1844+ "reason=%s\n", errorstring);
1845+ BUG();
1846+ }
1847+ if (cqr->callback)
1848+ cqr->callback(cqr, cqr->callback_data);
1849+}
1850+
18881851 /*
18891852 * the cqrs from the final queue are returned to the upper layer
18901853 * by setting a dasd_block state and calling the callback function
@@ -1895,40 +1858,18 @@ static void __dasd_device_process_final_queue(struct dasd_device *device, · 4 unmodified lines
18951858 struct list_head *l, *n;
18961859 struct dasd_ccw_req *cqr;
18971860 struct dasd_block *block;
1898− void (*callback)(struct dasd_ccw_req *, void *data);
1899− void *callback_data;
1900− char errorstring[ERRORLENGTH];
19011861
19021862 list_for_each_safe(l, n, final_queue) {
19031863 cqr = list_entry(l, struct dasd_ccw_req, devlist);
19041864 list_del_init(&cqr->devlist);
19051865 block = cqr->block;
1906− callback = cqr->callback;
1907− callback_data = cqr->callback_data;
1908− if (block)
1866+ if (!block) {
1867+ __dasd_process_cqr(device, cqr);
1868+ } else {
19091869 spin_lock_bh(&block->queue_lock);
1910− switch (cqr->status) {
1911− case DASD_CQR_SUCCESS:
1912− cqr->status = DASD_CQR_DONE;
1913− break;
1914− case DASD_CQR_ERROR:
1915− cqr->status = DASD_CQR_NEED_ERP;
1916− break;
1917− case DASD_CQR_CLEARED:
1918− cqr->status = DASD_CQR_TERMINATED;
1919− break;
1920− default:
1921− /* internal error 12 - wrong cqr status*/
1922− snprintf(errorstring, ERRORLENGTH, "12 %p %x02", cqr, cqr->status);
1923− dev_err(&device->cdev->dev,
1924− "An error occurred in the DASD device driver, "
1925− "reason=%s\n", errorstring);
1926− BUG();
1927− }
1928− if (cqr->callback != NULL)
1929− (callback)(cqr, callback_data);
1930− if (block)
1870+ __dasd_process_cqr(device, cqr);
19311871 spin_unlock_bh(&block->queue_lock);
1872+ }
19321873 }
19331874 }
19341875
@@ -3041,7 +2982,6 @@ static blk_status_t do_dasd_request(struct blk_mq_hw_ctx *hctx, · 1106 unmodified lines
30412982 cqr->callback_data = req;
30422983 cqr->status = DASD_CQR_FILLED;
30432984 cqr->dq = dq;
3044− *((struct dasd_ccw_req **) blk_mq_rq_to_pdu(req)) = cqr;
30452985
30462986 blk_mq_start_request(req);
30472987 spin_lock(&block->queue_lock);
@@ -3072,7 +3012,7 @@ enum blk_eh_timer_return dasd_times_out(struct request *req, bool reserved) · 24 unmodified lines
30723012 unsigned long flags;
30733013 int rc = 0;
30743014
3075− cqr = *((struct dasd_ccw_req **) blk_mq_rq_to_pdu(req));
3015+ cqr = blk_mq_rq_to_pdu(req);
30763016 if (!cqr)
30773017 return BLK_EH_DONE;
30783018
@@ -3174,7 +3114,7 @@ static int dasd_alloc_queue(struct dasd_block *block) · 95 unmodified lines
31743114 int rc;
31753115
31763116 block->tag_set.ops = &dasd_mq_ops;
3177− block->tag_set.cmd_size = sizeof(struct dasd_ccw_req *);
3117+ block->tag_set.cmd_size = sizeof(struct dasd_ccw_req);
31783118 block->tag_set.nr_hw_queues = DASD_NR_HW_QUEUES;
31793119 block->tag_set.queue_depth = DASD_MAX_LCU_DEV * DASD_REQ_PER_DEV;
31803120 block->tag_set.flags = BLK_MQ_F_SHOULD_MERGE;
@@ -4038,7 +3978,8 @@ static struct dasd_ccw_req *dasd_generic_build_rdc(struct dasd_device *device, · 857 unmodified lines
40383978 struct ccw1 *ccw;
40393979 unsigned long *idaw;
40403980
4041− cqr = dasd_smalloc_request(magic, 1 /* RDC */, rdc_buffer_size, device);
3981+ cqr = dasd_smalloc_request(magic, 1 /* RDC */, rdc_buffer_size, device,
3982+ NULL);
40423983
40433984 if (IS_ERR(cqr)) {
40443985 /* internal error 13 - Allocating the RDC request failed*/
drivers/s390/block/dasd_alias.c+3−3
@@ -407,9 +407,9 @@ static int read_unit_address_configuration(struct dasd_device *device, · 406 unmodified lines
407407 int rc;
408408 unsigned long flags;
409409
410− cqr = dasd_kmalloc_request(DASD_ECKD_MAGIC, 1 /* PSF */ + 1 /* RSSD */,
410+ cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 1 /* PSF */ + 1 /* RSSD */,
411411 (sizeof(struct dasd_psf_prssd_data)),
412− device);
412+ device, NULL);
413413 if (IS_ERR(cqr))
414414 return PTR_ERR(cqr);
415415 cqr->startdev = device;
@@ -457,7 +457,7 @@ static int read_unit_address_configuration(struct dasd_device *device, · 41 unmodified lines
457457 lcu->flags |= NEED_UAC_UPDATE;
458458 spin_unlock_irqrestore(&lcu->lock, flags);
459459 }
460− dasd_kfree_request(cqr, cqr->memdev);
460+ dasd_sfree_request(cqr, cqr->memdev);
461461 return rc;
462462 }
463463
drivers/s390/block/dasd_diag.c+2−1
@@ -536,7 +536,8 @@ static struct dasd_ccw_req *dasd_diag_build_cp(struct dasd_device *memdev, · 535 unmodified lines
536536 /* Build the request */
537537 datasize = sizeof(struct dasd_diag_req) +
538538 count*sizeof(struct dasd_diag_bio);
539− cqr = dasd_smalloc_request(DASD_DIAG_MAGIC, 0, datasize, memdev);
539+ cqr = dasd_smalloc_request(DASD_DIAG_MAGIC, 0, datasize, memdev,
540+ blk_mq_rq_to_pdu(req));
540541 if (IS_ERR(cqr))
541542 return cqr;
542543
drivers/s390/block/dasd_eckd.c+25−21
@@ -886,7 +886,7 @@ static int dasd_eckd_read_conf_lpm(struct dasd_device *device, · 885 unmodified lines
886886 }
887887 cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 1 /* RCD */,
888888 0, /* use rcd_buf as data ara */
889− device);
889+ device, NULL);
890890 if (IS_ERR(cqr)) {
891891 DBF_DEV_EVENT(DBF_WARNING, device, "%s",
892892 "Could not allocate RCD request");
@@ -1442,7 +1442,7 @@ static int dasd_eckd_read_features(struct dasd_device *device) · 549 unmodified lines
14421442 cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 1 /* PSF */ + 1 /* RSSD */,
14431443 (sizeof(struct dasd_psf_prssd_data) +
14441444 sizeof(struct dasd_rssd_features)),
1445− device);
1445+ device, NULL);
14461446 if (IS_ERR(cqr)) {
14471447 DBF_EVENT_DEVID(DBF_WARNING, device->cdev, "%s", "Could not "
14481448 "allocate initialization request");
@@ -1504,7 +1504,7 @@ static struct dasd_ccw_req *dasd_eckd_build_psf_ssc(struct dasd_device *device, · 55 unmodified lines
15041504
15051505 cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 1 /* PSF */ ,
15061506 sizeof(struct dasd_psf_ssc_data),
1507− device);
1507+ device, NULL);
15081508
15091509 if (IS_ERR(cqr)) {
15101510 DBF_DEV_EVENT(DBF_WARNING, device, "%s",
@@ -1815,7 +1815,8 @@ dasd_eckd_analysis_ccw(struct dasd_device *device) · 304 unmodified lines
18151815
18161816 cplength = 8;
18171817 datasize = sizeof(struct DE_eckd_data) + 2*sizeof(struct LO_eckd_data);
1818− cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, cplength, datasize, device);
1818+ cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, cplength, datasize, device,
1819+ NULL);
18191820 if (IS_ERR(cqr))
18201821 return cqr;
18211822 ccw = cqr->cpaddr;
@@ -2092,7 +2093,8 @@ dasd_eckd_build_check_tcw(struct dasd_device *base, struct format_data_t *fdata, · 270 unmodified lines
20922093 */
20932094 itcw_size = itcw_calc_size(0, count, 0);
20942095
2095− cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 0, itcw_size, startdev);
2096+ cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 0, itcw_size, startdev,
2097+ NULL);
20962098 if (IS_ERR(cqr))
20972099 return cqr;
20982100
@@ -2186,7 +2188,7 @@ dasd_eckd_build_check(struct dasd_device *base, struct format_data_t *fdata, · 87 unmodified lines
21862188 cplength += count;
21872189
21882190 cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, cplength, datasize,
2189− startdev);
2191+ startdev, NULL);
21902192 if (IS_ERR(cqr))
21912193 return cqr;
21922194
@@ -2332,7 +2334,7 @@ dasd_eckd_build_format(struct dasd_device *base, · 139 unmodified lines
23322334 }
23332335 /* Allocate the format ccw request. */
23342336 fcp = dasd_smalloc_request(DASD_ECKD_MAGIC, cplength,
2335− datasize, startdev);
2337+ datasize, startdev, NULL);
23362338 if (IS_ERR(fcp))
23372339 return fcp;
23382340
@@ -3103,7 +3105,7 @@ static struct dasd_ccw_req *dasd_eckd_build_cp_cmd_single( · 764 unmodified lines
31033105 }
31043106 /* Allocate the ccw request. */
31053107 cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, cplength, datasize,
3106− startdev);
3108+ startdev, blk_mq_rq_to_pdu(req));
31073109 if (IS_ERR(cqr))
31083110 return cqr;
31093111 ccw = cqr->cpaddr;
@@ -3262,7 +3264,7 @@ static struct dasd_ccw_req *dasd_eckd_build_cp_cmd_track( · 152 unmodified lines
32623264
32633265 /* Allocate the ccw request. */
32643266 cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, cplength, datasize,
3265− startdev);
3267+ startdev, blk_mq_rq_to_pdu(req));
32663268 if (IS_ERR(cqr))
32673269 return cqr;
32683270 ccw = cqr->cpaddr;
@@ -3595,7 +3597,8 @@ static struct dasd_ccw_req *dasd_eckd_build_cp_tpm_track( · 326 unmodified lines
35953597
35963598 /* Allocate the ccw request. */
35973599 itcw_size = itcw_calc_size(0, ctidaw, 0);
3598− cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 0, itcw_size, startdev);
3600+ cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 0, itcw_size, startdev,
3601+ blk_mq_rq_to_pdu(req));
35993602 if (IS_ERR(cqr))
36003603 return cqr;
36013604
@@ -3862,7 +3865,7 @@ static struct dasd_ccw_req *dasd_eckd_build_cp_raw(struct dasd_device *startdev, · 260 unmodified lines
38623865
38633866 /* Allocate the ccw request. */
38643867 cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, cplength,
3865− datasize, startdev);
3868+ datasize, startdev, blk_mq_rq_to_pdu(req));
38663869 if (IS_ERR(cqr))
38673870 return cqr;
38683871
@@ -4102,7 +4105,7 @@ dasd_eckd_release(struct dasd_device *device) · 233 unmodified lines
41024105 return -EACCES;
41034106
41044107 useglobal = 0;
4105− cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 1, 32, device);
4108+ cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 1, 32, device, NULL);
41064109 if (IS_ERR(cqr)) {
41074110 mutex_lock(&dasd_reserve_mutex);
41084111 useglobal = 1;
@@ -4157,7 +4160,7 @@ dasd_eckd_reserve(struct dasd_device *device) · 48 unmodified lines
41574160 return -EACCES;
41584161
41594162 useglobal = 0;
4160− cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 1, 32, device);
4163+ cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 1, 32, device, NULL);
41614164 if (IS_ERR(cqr)) {
41624165 mutex_lock(&dasd_reserve_mutex);
41634166 useglobal = 1;
@@ -4211,7 +4214,7 @@ dasd_eckd_steal_lock(struct dasd_device *device) · 47 unmodified lines
42114214 return -EACCES;
42124215
42134216 useglobal = 0;
4214− cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 1, 32, device);
4217+ cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 1, 32, device, NULL);
42154218 if (IS_ERR(cqr)) {
42164219 mutex_lock(&dasd_reserve_mutex);
42174220 useglobal = 1;
@@ -4271,7 +4274,8 @@ static int dasd_eckd_snid(struct dasd_device *device, · 53 unmodified lines
42714274
42724275 useglobal = 0;
42734276 cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 1,
4274− sizeof(struct dasd_snid_data), device);
4277+ sizeof(struct dasd_snid_data), device,
4278+ NULL);
42754279 if (IS_ERR(cqr)) {
42764280 mutex_lock(&dasd_reserve_mutex);
42774281 useglobal = 1;
@@ -4331,7 +4335,7 @@ dasd_eckd_performance(struct dasd_device *device, void __user *argp) · 53 unmodified lines
43314335 cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 1 /* PSF */ + 1 /* RSSD */,
43324336 (sizeof(struct dasd_psf_prssd_data) +
43334337 sizeof(struct dasd_rssd_perf_stats_t)),
4334− device);
4338+ device, NULL);
43354339 if (IS_ERR(cqr)) {
43364340 DBF_DEV_EVENT(DBF_WARNING, device, "%s",
43374341 "Could not allocate initialization request");
@@ -4477,7 +4481,7 @@ static int dasd_symm_io(struct dasd_device *device, void __user *argp) · 139 unmodified lines
44774481 psf1 = psf_data[1];
44784482
44794483 /* setup CCWs for PSF + RSSD */
4480− cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 2 , 0, device);
4484+ cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 2, 0, device, NULL);
44814485 if (IS_ERR(cqr)) {
44824486 DBF_DEV_EVENT(DBF_WARNING, device, "%s",
44834487 "Could not allocate initialization request");
@@ -5037,7 +5041,7 @@ static int dasd_eckd_read_message_buffer(struct dasd_device *device, · 553 unmodified lines
50375041 cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 1 /* PSF */ + 1 /* RSSD */,
50385042 (sizeof(struct dasd_psf_prssd_data) +
50395043 sizeof(struct dasd_rssd_messages)),
5040− device);
5044+ device, NULL);
50415045 if (IS_ERR(cqr)) {
50425046 DBF_EVENT_DEVID(DBF_WARNING, device->cdev, "%s",
50435047 "Could not allocate read message buffer request");
@@ -5126,7 +5130,7 @@ static int dasd_eckd_query_host_access(struct dasd_device *device, · 82 unmodified lines
51265130
51275131 cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 1 /* PSF */ + 1 /* RSSD */,
51285132 sizeof(struct dasd_psf_prssd_data) + 1,
5129− device);
5133+ device, NULL);
51305134 if (IS_ERR(cqr)) {
51315135 DBF_EVENT_DEVID(DBF_WARNING, device->cdev, "%s",
51325136 "Could not allocate read message buffer request");
@@ -5284,8 +5288,8 @@ dasd_eckd_psf_cuir_response(struct dasd_device *device, int response, · 151 unmodified lines
52845288 int rc;
52855289
52865290 cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 1 /* PSF */ ,
5287− sizeof(struct dasd_psf_cuir_response),
5288− device);
5291+ sizeof(struct dasd_psf_cuir_response),
5292+ device, NULL);
52895293
52905294 if (IS_ERR(cqr)) {
52915295 DBF_DEV_EVENT(DBF_WARNING, device, "%s",
drivers/s390/block/dasd_eer.c+5−5
@@ -447,7 +447,7 @@ static void dasd_eer_snss_cb(struct dasd_ccw_req *cqr, void *data) · 446 unmodified lines
447447 * is a new ccw in device->eer_cqr. Free the "old"
448448 * snss request now.
449449 */
450− dasd_kfree_request(cqr, device);
450+ dasd_sfree_request(cqr, device);
451451 }
452452
453453 /*
@@ -472,8 +472,8 @@ int dasd_eer_enable(struct dasd_device *device) · 18 unmodified lines
472472 if (rc)
473473 goto out;
474474
475− cqr = dasd_kmalloc_request(DASD_ECKD_MAGIC, 1 /* SNSS */,
476− SNSS_DATA_SIZE, device);
475+ cqr = dasd_smalloc_request(DASD_ECKD_MAGIC, 1 /* SNSS */,
476+ SNSS_DATA_SIZE, device, NULL);
477477 if (IS_ERR(cqr)) {
478478 rc = -ENOMEM;
479479 cqr = NULL;
@@ -505,7 +505,7 @@ out: · 25 unmodified lines
505505 spin_unlock_irqrestore(get_ccwdev_lock(device->cdev), flags);
506506
507507 if (cqr)
508− dasd_kfree_request(cqr, device);
508+ dasd_sfree_request(cqr, device);
509509
510510 return rc;
511511 }
@@ -528,7 +528,7 @@ void dasd_eer_disable(struct dasd_device *device) · 16 unmodified lines
528528 in_use = test_and_clear_bit(DASD_FLAG_EER_IN_USE, &device->flags);
529529 spin_unlock_irqrestore(get_ccwdev_lock(device->cdev), flags);
530530 if (cqr && !in_use)
531− dasd_kfree_request(cqr, device);
531+ dasd_sfree_request(cqr, device);
532532 }
533533
534534 /*
drivers/s390/block/dasd_fba.c+4−2
@@ -356,7 +356,8 @@ static struct dasd_ccw_req *dasd_fba_build_cp_discard( · 355 unmodified lines
356356 datasize = sizeof(struct DE_fba_data) +
357357 nr_ccws * (sizeof(struct LO_fba_data) + sizeof(struct ccw1));
358358
359− cqr = dasd_smalloc_request(DASD_FBA_MAGIC, cplength, datasize, memdev);
359+ cqr = dasd_smalloc_request(DASD_FBA_MAGIC, cplength, datasize, memdev,
360+ blk_mq_rq_to_pdu(req));
360361 if (IS_ERR(cqr))
361362 return cqr;
362363
@@ -490,7 +491,8 @@ static struct dasd_ccw_req *dasd_fba_build_cp_regular( · 127 unmodified lines
490491 datasize += (count - 1)*sizeof(struct LO_fba_data);
491492 }
492493 /* Allocate the ccw request. */
493− cqr = dasd_smalloc_request(DASD_FBA_MAGIC, cplength, datasize, memdev);
494+ cqr = dasd_smalloc_request(DASD_FBA_MAGIC, cplength, datasize, memdev,
495+ blk_mq_rq_to_pdu(req));
494496 if (IS_ERR(cqr))
495497 return cqr;
496498 ccw = cqr->cpaddr;
drivers/s390/block/dasd_int.h+5−21
@@ -158,40 +158,33 @@ do { \ · 157 unmodified lines
158158
159159 struct dasd_ccw_req {
160160 unsigned int magic; /* Eye catcher */
161+ int intrc; /* internal error, e.g. from start_IO */
161162 struct list_head devlist; /* for dasd_device request queue */
162163 struct list_head blocklist; /* for dasd_block request queue */
163−
164− /* Where to execute what... */
165164 struct dasd_block *block; /* the originating block device */
166165 struct dasd_device *memdev; /* the device used to allocate this */
167166 struct dasd_device *startdev; /* device the request is started on */
168167 struct dasd_device *basedev; /* base device if no block->base */
169168 void *cpaddr; /* address of ccw or tcw */
169+ short retries; /* A retry counter */
170170 unsigned char cpmode; /* 0 = cmd mode, 1 = itcw */
171171 char status; /* status of this request */
172− short retries; /* A retry counter */
172+ char lpm; /* logical path mask */
173173 unsigned long flags; /* flags of this request */
174174 struct dasd_queue *dq;
175−
176− /* ... and how */
177175 unsigned long starttime; /* jiffies time of request start */
178176 unsigned long expires; /* expiration period in jiffies */
179− char lpm; /* logical path mask */
180177 void *data; /* pointer to data area */
181−
182− /* these are important for recovering erroneous requests */
183− int intrc; /* internal error, e.g. from start_IO */
184178 struct irb irb; /* device status in case of an error */
185179 struct dasd_ccw_req *refers; /* ERP-chain queueing. */
186180 void *function; /* originating ERP action */
181+ void *mem_chunk;
187182
188− /* these are for statistics only */
189183 unsigned long buildclk; /* TOD-clock of request generation */
190184 unsigned long startclk; /* TOD-clock of request start */
191185 unsigned long stopclk; /* TOD-clock of request interrupt */
192186 unsigned long endclk; /* TOD-clock of request termination */
193187
194− /* Callback that is called after reaching final status. */
195188 void (*callback)(struct dasd_ccw_req *, void *data);
196189 void *callback_data;
197190 };
@@ -714,19 +707,10 @@ extern const struct block_device_operations dasd_device_operations; · 516 unmodified lines
714707 extern struct kmem_cache *dasd_page_cache;
715708
716709 struct dasd_ccw_req *
717−dasd_kmalloc_request(int , int, int, struct dasd_device *);
718−struct dasd_ccw_req *
719−dasd_smalloc_request(int , int, int, struct dasd_device *);
720−void dasd_kfree_request(struct dasd_ccw_req *, struct dasd_device *);
710+dasd_smalloc_request(int, int, int, struct dasd_device *, struct dasd_ccw_req *);
721711 void dasd_sfree_request(struct dasd_ccw_req *, struct dasd_device *);
722712 void dasd_wakeup_cb(struct dasd_ccw_req *, void *);
723713
724−static inline int
725−dasd_kmalloc_set_cda(struct ccw1 *ccw, void *cda, struct dasd_device *device)
726−{
727− return set_normalized_cda(ccw, cda);
728−}
729−
730714 struct dasd_device *dasd_alloc_device(void);
731715 void dasd_free_device(struct dasd_device *);
732716
drivers/s390/cio/Makefile+1−0
@@ -5,6 +5,7 @@ · 4 unmodified lines
55
66 # The following is required for define_trace.h to find ./trace.h
77 CFLAGS_trace.o := -I$(src)
8+CFLAGS_vfio_ccw_fsm.o := -I$(src)
89
910 obj-y += airq.o blacklist.o chsc.o cio.o css.o chp.o idset.o isc.o \
1011 fcx.o itcw.o crw.o ccwreq.o trace.o ioasm.o
drivers/s390/cio/vfio_ccw_cp.c+75−65
@@ -23,9 +23,13 @@ · 22 unmodified lines
2323 #define CCWCHAIN_LEN_MAX 256
2424
2525 struct pfn_array {
26+ /* Starting guest physical I/O address. */
2627 unsigned long pa_iova;
28+ /* Array that stores PFNs of the pages need to pin. */
2729 unsigned long *pa_iova_pfn;
30+ /* Array that receives PFNs of the pages pinned. */
2831 unsigned long *pa_pfn;
32+ /* Number of pages pinned from @pa_iova. */
2933 int pa_nr;
3034 };
3135
@@ -46,70 +50,33 @@ struct ccwchain { · 14 unmodified lines
4650 };
4751
4852 /*
49− * pfn_array_pin() - pin user pages in memory
53+ * pfn_array_alloc_pin() - alloc memory for PFNs, then pin user pages in memory
5054 * @pa: pfn_array on which to perform the operation
5155 * @mdev: the mediated device to perform pin/unpin operations
56+ * @iova: target guest physical address
57+ * @len: number of bytes that should be pinned from @iova
5258 *
53− * Attempt to pin user pages in memory.
59+ * Attempt to allocate memory for PFNs, and pin user pages in memory.
5460 *
5561 * Usage of pfn_array:
56− * @pa->pa_iova starting guest physical I/O address. Assigned by caller.
57− * @pa->pa_iova_pfn array that stores PFNs of the pages need to pin. Allocated
58− * by caller.
59− * @pa->pa_pfn array that receives PFNs of the pages pinned. Allocated by
60− * caller.
61− * @pa->pa_nr number of pages from @pa->pa_iova to pin. Assigned by
62− * caller.
63− * number of pages pinned. Assigned by callee.
62+ * We expect (pa_nr == 0) and (pa_iova_pfn == NULL), any field in
63+ * this structure will be filled in by this function.
6464 *
6565 * Returns:
6666 * Number of pages pinned on success.
67− * If @pa->pa_nr is 0 or negative, returns 0.
67+ * If @pa->pa_nr is not 0, or @pa->pa_iova_pfn is not NULL initially,
68+ * returns -EINVAL.
6869 * If no pages were pinned, returns -errno.
6970 */
70−static int pfn_array_pin(struct pfn_array *pa, struct device *mdev)
71−{
72− int i, ret;
73−
74− if (pa->pa_nr <= 0) {
75− pa->pa_nr = 0;
76− return 0;
77− }
78−
79− pa->pa_iova_pfn[0] = pa->pa_iova >> PAGE_SHIFT;
80− for (i = 1; i < pa->pa_nr; i++)
81− pa->pa_iova_pfn[i] = pa->pa_iova_pfn[i - 1] + 1;
82−
83− ret = vfio_pin_pages(mdev, pa->pa_iova_pfn, pa->pa_nr,
84− IOMMU_READ | IOMMU_WRITE, pa->pa_pfn);
85−
86− if (ret > 0 && ret != pa->pa_nr) {
87− vfio_unpin_pages(mdev, pa->pa_iova_pfn, ret);
88− pa->pa_nr = 0;
89− return 0;
90− }
91−
92− return ret;
93−}
94−
95−/* Unpin the pages before releasing the memory. */
96−static void pfn_array_unpin_free(struct pfn_array *pa, struct device *mdev)
97−{
98− vfio_unpin_pages(mdev, pa->pa_iova_pfn, pa->pa_nr);
99− pa->pa_nr = 0;
100− kfree(pa->pa_iova_pfn);
101−}
102−
103−/* Alloc memory for PFNs, then pin pages with them. */
10471 static int pfn_array_alloc_pin(struct pfn_array *pa, struct device *mdev,
10572 u64 iova, unsigned int len)
10673 {
107− int ret = 0;
74+ int i, ret = 0;
10875
10976 if (!len)
11077 return 0;
11178
112− if (pa->pa_nr)
79+ if (pa->pa_nr || pa->pa_iova_pfn)
11380 return -EINVAL;
11481
11582 pa->pa_iova = iova;
@@ -126,18 +93,39 @@ static int pfn_array_alloc_pin(struct pfn_array *pa, struct device *mdev, · 10 unmodified lines
12693 return -ENOMEM;
12794 pa->pa_pfn = pa->pa_iova_pfn + pa->pa_nr;
12895
129− ret = pfn_array_pin(pa, mdev);
96+ pa->pa_iova_pfn[0] = pa->pa_iova >> PAGE_SHIFT;
97+ for (i = 1; i < pa->pa_nr; i++)
98+ pa->pa_iova_pfn[i] = pa->pa_iova_pfn[i - 1] + 1;
13099
131− if (ret > 0)
132− return ret;
133− else if (!ret)
100+ ret = vfio_pin_pages(mdev, pa->pa_iova_pfn, pa->pa_nr,
101+ IOMMU_READ | IOMMU_WRITE, pa->pa_pfn);
102+
103+ if (ret < 0) {
104+ goto err_out;
105+ } else if (ret > 0 && ret != pa->pa_nr) {
106+ vfio_unpin_pages(mdev, pa->pa_iova_pfn, ret);
134107 ret = -EINVAL;
108+ goto err_out;
109+ }
135110
111+ return ret;
112+
113+err_out:
114+ pa->pa_nr = 0;
136115 kfree(pa->pa_iova_pfn);
116+ pa->pa_iova_pfn = NULL;
137117
138118 return ret;
139119 }
140120
121+/* Unpin the pages before releasing the memory. */
122+static void pfn_array_unpin_free(struct pfn_array *pa, struct device *mdev)
123+{
124+ vfio_unpin_pages(mdev, pa->pa_iova_pfn, pa->pa_nr);
125+ pa->pa_nr = 0;
126+ kfree(pa->pa_iova_pfn);
127+}
128+
141129 static int pfn_array_table_init(struct pfn_array_table *pat, int nr)
142130 {
143131 pat->pat_pa = kcalloc(nr, sizeof(*pat->pat_pa), GFP_KERNEL);
@@ -365,6 +353,9 @@ static void cp_unpin_free(struct channel_program *cp) · 221 unmodified lines
365353 * This is the chain length not considering any TICs.
366354 * You need to do a new round for each TIC target.
367355 *
356+ * The program is also validated for absence of not yet supported
357+ * indirect data addressing scenarios.
358+ *
368359 * Returns: the length of the ccw chain or -errno.
369360 */
370361 static int ccwchain_calc_length(u64 iova, struct channel_program *cp)
@@ -391,6 +382,14 @@ static int ccwchain_calc_length(u64 iova, struct channel_program *cp) · 20 unmodified lines
391382 do {
392383 cnt++;
393384
385+ /*
386+ * As we don't want to fail direct addressing even if the
387+ * orb specified one of the unsupported formats, we defer
388+ * checking for IDAWs in unsupported formats to here.
389+ */
390+ if ((!cp->orb.cmd.c64 || cp->orb.cmd.i2k) && ccw_is_idal(ccw))
391+ return -EOPNOTSUPP;
392+
394393 if ((!ccw_is_chain(ccw)) && (!ccw_is_tic(ccw)))
395394 break;
396395
@@ -503,7 +502,7 @@ static int ccwchain_fetch_direct(struct ccwchain *chain, · 106 unmodified lines
503502 struct ccw1 *ccw;
504503 struct pfn_array_table *pat;
505504 unsigned long *idaws;
506− int idaw_nr;
505+ int ret;
507506
508507 ccw = chain->ch_ccw + idx;
509508
@@ -523,18 +522,19 @@ static int ccwchain_fetch_direct(struct ccwchain *chain, · 13 unmodified lines
523522 * needed when translating a direct ccw to a idal ccw.
524523 */
525524 pat = chain->ch_pat + idx;
526− if (pfn_array_table_init(pat, 1))
527− return -ENOMEM;
528− idaw_nr = pfn_array_alloc_pin(pat->pat_pa, cp->mdev,
529− ccw->cda, ccw->count);
530− if (idaw_nr < 0)
531− return idaw_nr;
525+ ret = pfn_array_table_init(pat, 1);
526+ if (ret)
527+ goto out_init;
528+
529+ ret = pfn_array_alloc_pin(pat->pat_pa, cp->mdev, ccw->cda, ccw->count);
530+ if (ret < 0)
531+ goto out_init;
532532
533533 /* Translate this direct ccw to a idal ccw. */
534− idaws = kcalloc(idaw_nr, sizeof(*idaws), GFP_DMA | GFP_KERNEL);
534+ idaws = kcalloc(ret, sizeof(*idaws), GFP_DMA | GFP_KERNEL);
535535 if (!idaws) {
536− pfn_array_table_unpin_free(pat, cp->mdev);
537− return -ENOMEM;
536+ ret = -ENOMEM;
537+ goto out_unpin;
538538 }
539539 ccw->cda = (__u32) virt_to_phys(idaws);
540540 ccw->flags |= CCW_FLAG_IDA;
@@ -542,6 +542,12 @@ static int ccwchain_fetch_direct(struct ccwchain *chain, · 1 unmodified line
542542 pfn_array_table_idal_create_words(pat, idaws);
543543
544544 return 0;
545+
546+out_unpin:
547+ pfn_array_table_unpin_free(pat, cp->mdev);
548+out_init:
549+ ccw->cda = 0;
550+ return ret;
545551 }
546552
547553 static int ccwchain_fetch_idal(struct ccwchain *chain,
@@ -571,7 +577,7 @@ static int ccwchain_fetch_idal(struct ccwchain *chain, · 23 unmodified lines
571577 pat = chain->ch_pat + idx;
572578 ret = pfn_array_table_init(pat, idaw_nr);
573579 if (ret)
574− return ret;
580+ goto out_init;
575581
576582 /* Translate idal ccw to use new allocated idaws. */
577583 idaws = kzalloc(idaw_len, GFP_DMA | GFP_KERNEL);
@@ -603,6 +609,8 @@ out_free_idaws: · 25 unmodified lines
603609 kfree(idaws);
604610 out_unpin:
605611 pfn_array_table_unpin_free(pat, cp->mdev);
612+out_init:
613+ ccw->cda = 0;
606614 return ret;
607615 }
608616
@@ -656,10 +664,8 @@ int cp_init(struct channel_program *cp, struct device *mdev, union orb *orb) · 47 unmodified lines
656664 /*
657665 * XXX:
658666 * Only support prefetch enable mode now.
659− * Only support 64bit addressing idal.
660− * Only support 4k IDAW.
661667 */
662− if (!orb->cmd.pfch || !orb->cmd.c64 || orb->cmd.i2k)
668+ if (!orb->cmd.pfch)
663669 return -EOPNOTSUPP;
664670
665671 INIT_LIST_HEAD(&cp->ccwchain_list);
@@ -688,6 +694,10 @@ int cp_init(struct channel_program *cp, struct device *mdev, union orb *orb) · 22 unmodified lines
688694 ret = ccwchain_loop_tic(chain, cp);
689695 if (ret)
690696 cp_unpin_free(cp);
697+ /* It is safe to force: if not set but idals used
698+ * ccwchain_calc_length returns an error.
699+ */
700+ cp->orb.cmd.c64 = 1;
691701
692702 return ret;
693703 }
drivers/s390/cio/vfio_ccw_drv.c+4−1
@@ -177,6 +177,7 @@ static int vfio_ccw_sch_event(struct subchannel *sch, int process) · 176 unmodified lines
177177 {
178178 struct vfio_ccw_private *private = dev_get_drvdata(&sch->dev);
179179 unsigned long flags;
180+ int rc = -EAGAIN;
180181
181182 spin_lock_irqsave(sch->lock, flags);
182183 if (!device_is_registered(&sch->dev))
@@ -187,6 +188,7 @@ static int vfio_ccw_sch_event(struct subchannel *sch, int process) · 4 unmodified lines
187188
188189 if (cio_update_schib(sch)) {
189190 vfio_ccw_fsm_event(private, VFIO_CCW_EVENT_NOT_OPER);
191+ rc = 0;
190192 goto out_unlock;
191193 }
192194
@@ -195,11 +197,12 @@ static int vfio_ccw_sch_event(struct subchannel *sch, int process) · 2 unmodified lines
195197 private->state = private->mdev ? VFIO_CCW_STATE_IDLE :
196198 VFIO_CCW_STATE_STANDBY;
197199 }
200+ rc = 0;
198201
199202 out_unlock:
200203 spin_unlock_irqrestore(sch->lock, flags);
201204
202− return 0;
205+ return rc;
203206 }
204207
205208 static struct css_device_id vfio_ccw_sch_ids[] = {
drivers/s390/cio/vfio_ccw_fsm.c+16−1
@@ -13,6 +13,9 @@ · 12 unmodified lines
1313 #include "ioasm.h"
1414 #include "vfio_ccw_private.h"
1515
16+#define CREATE_TRACE_POINTS
17+#include "vfio_ccw_trace.h"
18+
1619 static int fsm_io_helper(struct vfio_ccw_private *private)
1720 {
1821 struct subchannel *sch;
@@ -110,6 +113,10 @@ static void fsm_disabled_irq(struct vfio_ccw_private *private, · 91 unmodified lines
110113 */
111114 cio_disable_subchannel(sch);
112115 }
116+inline struct subchannel_id get_schid(struct vfio_ccw_private *p)
117+{
118+ return p->sch->schid;
119+}
113120
114121 /*
115122 * Deal with the ccw command request from the userspace.
@@ -121,6 +128,7 @@ static void fsm_io_request(struct vfio_ccw_private *private, · 5 unmodified lines
121128 union scsw *scsw = &private->scsw;
122129 struct ccw_io_region *io_region = &private->io_region;
123130 struct mdev_device *mdev = private->mdev;
131+ char *errstr = "request";
124132
125133 private->state = VFIO_CCW_STATE_BOXED;
126134
@@ -132,15 +140,19 @@ static void fsm_io_request(struct vfio_ccw_private *private, · 5 unmodified lines
132140 /* Don't try to build a cp if transport mode is specified. */
133141 if (orb->tm.b) {
134142 io_region->ret_code = -EOPNOTSUPP;
143+ errstr = "transport mode";
135144 goto err_out;
136145 }
137146 io_region->ret_code = cp_init(&private->cp, mdev_dev(mdev),
138147 orb);
139− if (io_region->ret_code)
148+ if (io_region->ret_code) {
149+ errstr = "cp init";
140150 goto err_out;
151+ }
141152
142153 io_region->ret_code = cp_prefetch(&private->cp);
143154 if (io_region->ret_code) {
155+ errstr = "cp prefetch";
144156 cp_free(&private->cp);
145157 goto err_out;
146158 }
@@ -148,6 +160,7 @@ static void fsm_io_request(struct vfio_ccw_private *private, · 1 unmodified line
148160 /* Start channel program and wait for I/O interrupt. */
149161 io_region->ret_code = fsm_io_helper(private);
150162 if (io_region->ret_code) {
163+ errstr = "cp fsm_io_helper";
151164 cp_free(&private->cp);
152165 goto err_out;
153166 }
@@ -164,6 +177,8 @@ static void fsm_io_request(struct vfio_ccw_private *private, · 10 unmodified lines
164177
165178 err_out:
166179 private->state = VFIO_CCW_STATE_IDLE;
180+ trace_vfio_ccw_io_fctl(scsw->cmd.fctl, get_schid(private),
181+ io_region->ret_code, errstr);
167182 }
168183
169184 /*
drivers/s390/cio/vfio_ccw_trace.h+54−0
@@ -0,0 +1,54 @@
1+/* SPDX-License-Identifier: GPL-2.0
2+ * Tracepoints for vfio_ccw driver
3+ *
4+ * Copyright IBM Corp. 2018
5+ *
6+ * Author(s): Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com>
7+ * Halil Pasic <pasic@linux.vnet.ibm.com>
8+ */
9+
10+#undef TRACE_SYSTEM
11+#define TRACE_SYSTEM vfio_ccw
12+
13+#if !defined(_VFIO_CCW_TRACE_) || defined(TRACE_HEADER_MULTI_READ)
14+#define _VFIO_CCW_TRACE_
15+
16+#include <linux/tracepoint.h>
17+
18+TRACE_EVENT(vfio_ccw_io_fctl,
19+ TP_PROTO(int fctl, struct subchannel_id schid, int errno, char *errstr),
20+ TP_ARGS(fctl, schid, errno, errstr),
21+
22+ TP_STRUCT__entry(
23+ __field(int, fctl)
24+ __field_struct(struct subchannel_id, schid)
25+ __field(int, errno)
26+ __field(char*, errstr)
27+ ),
28+
29+ TP_fast_assign(
30+ __entry->fctl = fctl;
31+ __entry->schid = schid;
32+ __entry->errno = errno;
33+ __entry->errstr = errstr;
34+ ),
35+
36+ TP_printk("schid=%x.%x.%04x fctl=%x errno=%d info=%s",
37+ __entry->schid.cssid,
38+ __entry->schid.ssid,
39+ __entry->schid.sch_no,
40+ __entry->fctl,
41+ __entry->errno,
42+ __entry->errstr)
43+);
44+
45+#endif /* _VFIO_CCW_TRACE_ */
46+
47+/* This part must be outside protection */
48+
49+#undef TRACE_INCLUDE_PATH
50+#define TRACE_INCLUDE_PATH .
51+#undef TRACE_INCLUDE_FILE
52+#define TRACE_INCLUDE_FILE vfio_ccw_trace
53+
54+#include <trace/define_trace.h>
drivers/scsi/ipr.c+0−2
@@ -760,7 +760,6 @@ static void ipr_mask_and_clear_interrupts(struct ipr_ioa_cfg *ioa_cfg, · 759 unmodified lines
760760 ioa_cfg->hrrq[i].allow_interrupts = 0;
761761 spin_unlock(&ioa_cfg->hrrq[i]._lock);
762762 }
763− wmb();
764763
765764 /* Set interrupt mask to stop all new interrupts */
766765 if (ioa_cfg->sis64)
@@ -8403,7 +8402,6 @@ static int ipr_reset_enable_ioa(struct ipr_cmnd *ipr_cmd) · 7636 unmodified lines
84038402 ioa_cfg->hrrq[i].allow_interrupts = 1;
84048403 spin_unlock(&ioa_cfg->hrrq[i]._lock);
84058404 }
8406− wmb();
84078405 if (ioa_cfg->sis64) {
84088406 /* Set the adapter to the correct endian mode. */
84098407 writel(IPR_ENDIAN_SWAP_KEY, ioa_cfg->regs.endian_swap_reg);
drivers/scsi/qla2xxx/qla_target.c+3−4
@@ -1224,7 +1224,6 @@ static void qla24xx_chk_fcp_state(struct fc_port *sess) · 1223 unmodified lines
12241224 void qlt_schedule_sess_for_deletion(struct fc_port *sess)
12251225 {
12261226 struct qla_tgt *tgt = sess->tgt;
1227− struct qla_hw_data *ha = sess->vha->hw;
12281227 unsigned long flags;
12291228
12301229 if (sess->disc_state == DSC_DELETE_PEND)
@@ -1241,16 +1240,16 @@ void qlt_schedule_sess_for_deletion(struct fc_port *sess) · 10 unmodified lines
12411240 return;
12421241 }
12431242
1244− spin_lock_irqsave(&ha->tgt.sess_lock, flags);
12451243 if (sess->deleted == QLA_SESS_DELETED)
12461244 sess->logout_on_delete = 0;
12471245
1246+ spin_lock_irqsave(&sess->vha->work_lock, flags);
12481247 if (sess->deleted == QLA_SESS_DELETION_IN_PROGRESS) {
1249− spin_unlock_irqrestore(&ha->tgt.sess_lock, flags);
1248+ spin_unlock_irqrestore(&sess->vha->work_lock, flags);
12501249 return;
12511250 }
12521251 sess->deleted = QLA_SESS_DELETION_IN_PROGRESS;
1253− spin_unlock_irqrestore(&ha->tgt.sess_lock, flags);
1252+ spin_unlock_irqrestore(&sess->vha->work_lock, flags);
12541253
12551254 sess->disc_state = DSC_DELETE_PEND;
12561255
drivers/scsi/scsi_debug.c+1−1
@@ -5507,9 +5507,9 @@ static void __exit scsi_debug_exit(void) · 5506 unmodified lines
55075507 int k = sdebug_add_host;
55085508
55095509 stop_all_queued();
5510− free_all_queued();
55115510 for (; k; k--)
55125511 sdebug_remove_adapter();
5512+ free_all_queued();
55135513 driver_unregister(&sdebug_driverfs_driver);
55145514 bus_unregister(&pseudo_lld_bus);
55155515 root_device_unregister(pseudo_primary);
drivers/scsi/scsi_transport_fc.c+1−1
@@ -3592,7 +3592,7 @@ fc_bsg_job_timeout(struct request *req) · 3591 unmodified lines
35923592
35933593 /* the blk_end_sync_io() doesn't check the error */
35943594 if (inflight)
3595− blk_mq_complete_request(req);
3595+ __blk_complete_request(req);
35963596 return BLK_EH_DONE;
35973597 }
35983598
drivers/scsi/xen-scsifront.c+26−7
@@ -654,10 +654,17 @@ static int scsifront_dev_reset_handler(struct scsi_cmnd *sc) · 653 unmodified lines
654654 static int scsifront_sdev_configure(struct scsi_device *sdev)
655655 {
656656 struct vscsifrnt_info *info = shost_priv(sdev->host);
657+ int err;
657658
658− if (info && current == info->curr)
659− xenbus_printf(XBT_NIL, info->dev->nodename,
659+ if (info && current == info->curr) {
660+ err = xenbus_printf(XBT_NIL, info->dev->nodename,
660661 info->dev_state_path, "%d", XenbusStateConnected);
662+ if (err) {
663+ xenbus_dev_error(info->dev, err,
664+ "%s: writing dev_state_path", __func__);
665+ return err;
666+ }
667+ }
661668
662669 return 0;
663670 }
@@ -665,10 +672,15 @@ static int scsifront_sdev_configure(struct scsi_device *sdev) · 1 unmodified line
665672 static void scsifront_sdev_destroy(struct scsi_device *sdev)
666673 {
667674 struct vscsifrnt_info *info = shost_priv(sdev->host);
675+ int err;
668676
669− if (info && current == info->curr)
670− xenbus_printf(XBT_NIL, info->dev->nodename,
677+ if (info && current == info->curr) {
678+ err = xenbus_printf(XBT_NIL, info->dev->nodename,
671679 info->dev_state_path, "%d", XenbusStateClosed);
680+ if (err)
681+ xenbus_dev_error(info->dev, err,
682+ "%s: writing dev_state_path", __func__);
683+ }
672684 }
673685
674686 static struct scsi_host_template scsifront_sht = {
@@ -1003,9 +1015,12 @@ static void scsifront_do_lun_hotplug(struct vscsifrnt_info *info, int op) · 328 unmodified lines
10031015
10041016 if (scsi_add_device(info->host, chn, tgt, lun)) {
10051017 dev_err(&dev->dev, "scsi_add_device\n");
1006− xenbus_printf(XBT_NIL, dev->nodename,
1018+ err = xenbus_printf(XBT_NIL, dev->nodename,
10071019 info->dev_state_path,
10081020 "%d", XenbusStateClosed);
1021+ if (err)
1022+ xenbus_dev_error(dev, err,
1023+ "%s: writing dev_state_path", __func__);
10091024 }
10101025 break;
10111026 case VSCSIFRONT_OP_DEL_LUN:
@@ -1019,10 +1034,14 @@ static void scsifront_do_lun_hotplug(struct vscsifrnt_info *info, int op) · 7 unmodified lines
10191034 }
10201035 break;
10211036 case VSCSIFRONT_OP_READD_LUN:
1022− if (device_state == XenbusStateConnected)
1023− xenbus_printf(XBT_NIL, dev->nodename,
1037+ if (device_state == XenbusStateConnected) {
1038+ err = xenbus_printf(XBT_NIL, dev->nodename,
10241039 info->dev_state_path,
10251040 "%d", XenbusStateConnected);
1041+ if (err)
1042+ xenbus_dev_error(dev, err,
1043+ "%s: writing dev_state_path", __func__);
1044+ }
10261045 break;
10271046 default:
10281047 break;
drivers/soc/imx/gpcv2.c+9−4
@@ -39,10 +39,15 @@ · 38 unmodified lines
3939
4040 #define GPC_M4_PU_PDN_FLG 0x1bc
4141
42−
43−#define PGC_MIPI 4
44−#define PGC_PCIE 5
45−#define PGC_USB_HSIC 8
42+/*
43+ * The PGC offset values in Reference Manual
44+ * (Rev. 1, 01/2018 and the older ones) GPC chapter's
45+ * GPC_PGC memory map are incorrect, below offset
46+ * values are from design RTL.
47+ */
48+#define PGC_MIPI 16
49+#define PGC_PCIE 17
50+#define PGC_USB_HSIC 20
4651 #define GPC_PGC_CTRL(n) (0x800 + (n) * 0x40)
4752 #define GPC_PGC_SR(n) (GPC_PGC_CTRL(n) + 0xc)
4853
drivers/soc/qcom/Kconfig+2−1
@@ -5,7 +5,8 @@ menu "Qualcomm SoC drivers" · 4 unmodified lines
55
66 config QCOM_COMMAND_DB
77 bool "Qualcomm Command DB"
8− depends on (ARCH_QCOM && OF) || COMPILE_TEST
8+ depends on ARCH_QCOM || COMPILE_TEST
9+ depends on OF_RESERVED_MEM
910 help
1011 Command DB queries shared memory by key string for shared system
1112 resources. Platform drivers that require to set state of a shared
drivers/soc/renesas/rcar-sysc.c+29−6
@@ -194,11 +194,12 @@ static int rcar_sysc_pd_power_on(struct generic_pm_domain *genpd) · 193 unmodified lines
194194
195195 static bool has_cpg_mstp;
196196
197−static void __init rcar_sysc_pd_setup(struct rcar_sysc_pd *pd)
197+static int __init rcar_sysc_pd_setup(struct rcar_sysc_pd *pd)
198198 {
199199 struct generic_pm_domain *genpd = &pd->genpd;
200200 const char *name = pd->genpd.name;
201201 struct dev_power_governor *gov = &simple_qos_governor;
202+ int error;
202203
203204 if (pd->flags & PD_CPU) {
204205 /*
@@ -251,7 +252,11 @@ static void __init rcar_sysc_pd_setup(struct rcar_sysc_pd *pd) · 46 unmodified lines
251252 rcar_sysc_power_up(&pd->ch);
252253
253254 finalize:
254− pm_genpd_init(genpd, gov, false);
255+ error = pm_genpd_init(genpd, gov, false);
256+ if (error)
257+ pr_err("Failed to init PM domain %s: %d\n", name, error);
258+
259+ return error;
255260 }
256261
257262 static const struct of_device_id rcar_sysc_matches[] __initconst = {
@@ -375,6 +380,9 @@ static int __init rcar_sysc_pd_init(void) · 117 unmodified lines
375380 pr_debug("%pOF: syscier = 0x%08x\n", np, syscier);
376381 iowrite32(syscier, base + SYSCIER);
377382
383+ /*
384+ * First, create all PM domains
385+ */
378386 for (i = 0; i < info->num_areas; i++) {
379387 const struct rcar_sysc_area *area = &info->areas[i];
380388 struct rcar_sysc_pd *pd;
@@ -397,14 +405,29 @@ static int __init rcar_sysc_pd_init(void) · 16 unmodified lines
397405 pd->ch.isr_bit = area->isr_bit;
398406 pd->flags = area->flags;
399407
400− rcar_sysc_pd_setup(pd);
401− if (area->parent >= 0)
402− pm_genpd_add_subdomain(domains->domains[area->parent],
403− &pd->genpd);
408+ error = rcar_sysc_pd_setup(pd);
409+ if (error)
410+ goto out_put;
404411
405412 domains->domains[area->isr_bit] = &pd->genpd;
406413 }
407414
415+ /*
416+ * Second, link all PM domains to their parents
417+ */
418+ for (i = 0; i < info->num_areas; i++) {
419+ const struct rcar_sysc_area *area = &info->areas[i];
420+
421+ if (!area->name || area->parent < 0)
422+ continue;
423+
424+ error = pm_genpd_add_subdomain(domains->domains[area->parent],
425+ domains->domains[area->isr_bit]);
426+ if (error)
427+ pr_warn("Failed to add PM subdomain %s to parent %u\n",
428+ area->name, area->parent);
429+ }
430+
408431 error = of_genpd_add_provider_onecell(np, &domains->onecell_data);
409432
410433 out_put:
drivers/staging/android/ion/ion_heap.c+1−1
@@ -30,7 +30,7 @@ void *ion_heap_map_kernel(struct ion_heap *heap, · 29 unmodified lines
3030 struct page **tmp = pages;
3131
3232 if (!pages)
33− return NULL;
33+ return ERR_PTR(-ENOMEM);
3434
3535 if (buffer->flags & ION_FLAG_CACHED)
3636 pgprot = PAGE_KERNEL;
drivers/staging/comedi/drivers/quatech_daqp_cs.c+1−1
@@ -642,7 +642,7 @@ static int daqp_ao_insn_write(struct comedi_device *dev, · 641 unmodified lines
642642 /* Make sure D/A update mode is direct update */
643643 outb(0, dev->iobase + DAQP_AUX_REG);
644644
645− for (i = 0; i > insn->n; i++) {
645+ for (i = 0; i < insn->n; i++) {
646646 unsigned int val = data[i];
647647 int ret;
648648
drivers/staging/typec/Kconfig+1−0
@@ -11,6 +11,7 @@ config TYPEC_TCPCI · 10 unmodified lines
1111
1212 config TYPEC_RT1711H
1313 tristate "Richtek RT1711H Type-C chip driver"
14+ depends on I2C
1415 select TYPEC_TCPCI
1516 help
1617 Richtek RT1711H Type-C chip driver that works with
drivers/target/target_core_user.c+36−8
@@ -656,7 +656,7 @@ static void scatter_data_area(struct tcmu_dev *udev, · 655 unmodified lines
656656 }
657657
658658 static void gather_data_area(struct tcmu_dev *udev, struct tcmu_cmd *cmd,
659− bool bidi)
659+ bool bidi, uint32_t read_len)
660660 {
661661 struct se_cmd *se_cmd = cmd->se_cmd;
662662 int i, dbi;
@@ -689,7 +689,7 @@ static void gather_data_area(struct tcmu_dev *udev, struct tcmu_cmd *cmd, · 26 unmodified lines
689689 for_each_sg(data_sg, sg, data_nents, i) {
690690 int sg_remaining = sg->length;
691691 to = kmap_atomic(sg_page(sg)) + sg->offset;
692− while (sg_remaining > 0) {
692+ while (sg_remaining > 0 && read_len > 0) {
693693 if (block_remaining == 0) {
694694 if (from)
695695 kunmap_atomic(from);
@@ -701,6 +701,8 @@ static void gather_data_area(struct tcmu_dev *udev, struct tcmu_cmd *cmd, · 5 unmodified lines
701701 }
702702 copy_bytes = min_t(size_t, sg_remaining,
703703 block_remaining);
704+ if (read_len < copy_bytes)
705+ copy_bytes = read_len;
704706 offset = DATA_BLOCK_SIZE - block_remaining;
705707 tcmu_flush_dcache_range(from, copy_bytes);
706708 memcpy(to + sg->length - sg_remaining, from + offset,
@@ -708,8 +710,11 @@ static void gather_data_area(struct tcmu_dev *udev, struct tcmu_cmd *cmd, · 1 unmodified line
708710
709711 sg_remaining -= copy_bytes;
710712 block_remaining -= copy_bytes;
713+ read_len -= copy_bytes;
711714 }
712715 kunmap_atomic(to - sg->offset);
716+ if (read_len == 0)
717+ break;
713718 }
714719 if (from)
715720 kunmap_atomic(from);
@@ -1042,6 +1047,8 @@ static void tcmu_handle_completion(struct tcmu_cmd *cmd, struct tcmu_cmd_entry * · 326 unmodified lines
10421047 {
10431048 struct se_cmd *se_cmd = cmd->se_cmd;
10441049 struct tcmu_dev *udev = cmd->tcmu_dev;
1050+ bool read_len_valid = false;
1051+ uint32_t read_len = se_cmd->data_length;
10451052
10461053 /*
10471054 * cmd has been completed already from timeout, just reclaim
@@ -1056,13 +1063,28 @@ static void tcmu_handle_completion(struct tcmu_cmd *cmd, struct tcmu_cmd_entry * · 8 unmodified lines
10561063 pr_warn("TCMU: Userspace set UNKNOWN_OP flag on se_cmd %p\n",
10571064 cmd->se_cmd);
10581065 entry->rsp.scsi_status = SAM_STAT_CHECK_CONDITION;
1059− } else if (entry->rsp.scsi_status == SAM_STAT_CHECK_CONDITION) {
1066+ goto done;
1067+ }
1068+
1069+ if (se_cmd->data_direction == DMA_FROM_DEVICE &&
1070+ (entry->hdr.uflags & TCMU_UFLAG_READ_LEN) && entry->rsp.read_len) {
1071+ read_len_valid = true;
1072+ if (entry->rsp.read_len < read_len)
1073+ read_len = entry->rsp.read_len;
1074+ }
1075+
1076+ if (entry->rsp.scsi_status == SAM_STAT_CHECK_CONDITION) {
10601077 transport_copy_sense_to_cmd(se_cmd, entry->rsp.sense_buffer);
1061− } else if (se_cmd->se_cmd_flags & SCF_BIDI) {
1078+ if (!read_len_valid )
1079+ goto done;
1080+ else
1081+ se_cmd->se_cmd_flags |= SCF_TREAT_READ_AS_NORMAL;
1082+ }
1083+ if (se_cmd->se_cmd_flags & SCF_BIDI) {
10621084 /* Get Data-In buffer before clean up */
1063− gather_data_area(udev, cmd, true);
1085+ gather_data_area(udev, cmd, true, read_len);
10641086 } else if (se_cmd->data_direction == DMA_FROM_DEVICE) {
1065− gather_data_area(udev, cmd, false);
1087+ gather_data_area(udev, cmd, false, read_len);
10661088 } else if (se_cmd->data_direction == DMA_TO_DEVICE) {
10671089 /* TODO: */
10681090 } else if (se_cmd->data_direction != DMA_NONE) {
@@ -1070,7 +1092,13 @@ static void tcmu_handle_completion(struct tcmu_cmd *cmd, struct tcmu_cmd_entry * · 1 unmodified line
10701092 se_cmd->data_direction);
10711093 }
10721094
1073− target_complete_cmd(cmd->se_cmd, entry->rsp.scsi_status);
1095+done:
1096+ if (read_len_valid) {
1097+ pr_debug("read_len = %d\n", read_len);
1098+ target_complete_cmd_with_length(cmd->se_cmd,
1099+ entry->rsp.scsi_status, read_len);
1100+ } else
1101+ target_complete_cmd(cmd->se_cmd, entry->rsp.scsi_status);
10741102
10751103 out:
10761104 cmd->se_cmd = NULL;
@@ -1740,7 +1768,7 @@ static int tcmu_configure_device(struct se_device *dev) · 663 unmodified lines
17401768 /* Initialise the mailbox of the ring buffer */
17411769 mb = udev->mb_addr;
17421770 mb->version = TCMU_MAILBOX_VERSION;
1743− mb->flags = TCMU_MAILBOX_FLAG_CAP_OOOC;
1771+ mb->flags = TCMU_MAILBOX_FLAG_CAP_OOOC | TCMU_MAILBOX_FLAG_CAP_READ_LEN;
17441772 mb->cmdr_off = CMDR_OFF;
17451773 mb->cmdr_size = udev->cmdr_size;
17461774
drivers/tty/n_tty.c+32−23
@@ -124,6 +124,8 @@ struct n_tty_data { · 123 unmodified lines
124124 struct mutex output_lock;
125125 };
126126
127+#define MASK(x) ((x) & (N_TTY_BUF_SIZE - 1))
128+
127129 static inline size_t read_cnt(struct n_tty_data *ldata)
128130 {
129131 return ldata->read_head - ldata->read_tail;
@@ -141,6 +143,7 @@ static inline unsigned char *read_buf_addr(struct n_tty_data *ldata, size_t i) · 11 unmodified lines
141143
142144 static inline unsigned char echo_buf(struct n_tty_data *ldata, size_t i)
143145 {
146+ smp_rmb(); /* Matches smp_wmb() in add_echo_byte(). */
144147 return ldata->echo_buf[i & (N_TTY_BUF_SIZE - 1)];
145148 }
146149
@@ -316,9 +319,7 @@ static inline void put_tty_queue(unsigned char c, struct n_tty_data *ldata) · 169 unmodified lines
316319 static void reset_buffer_flags(struct n_tty_data *ldata)
317320 {
318321 ldata->read_head = ldata->canon_head = ldata->read_tail = 0;
319− ldata->echo_head = ldata->echo_tail = ldata->echo_commit = 0;
320322 ldata->commit_head = 0;
321− ldata->echo_mark = 0;
322323 ldata->line_start = 0;
323324
324325 ldata->erasing = 0;
@@ -617,12 +618,19 @@ static size_t __process_echoes(struct tty_struct *tty) · 292 unmodified lines
617618 old_space = space = tty_write_room(tty);
618619
619620 tail = ldata->echo_tail;
620− while (ldata->echo_commit != tail) {
621+ while (MASK(ldata->echo_commit) != MASK(tail)) {
621622 c = echo_buf(ldata, tail);
622623 if (c == ECHO_OP_START) {
623624 unsigned char op;
624625 int no_space_left = 0;
625626
627+ /*
628+ * Since add_echo_byte() is called without holding
629+ * output_lock, we might see only portion of multi-byte
630+ * operation.
631+ */
632+ if (MASK(ldata->echo_commit) == MASK(tail + 1))
633+ goto not_yet_stored;
626634 /*
627635 * If the buffer byte is the start of a multi-byte
628636 * operation, get the next byte, which is either the
@@ -634,6 +642,8 @@ static size_t __process_echoes(struct tty_struct *tty) · 5 unmodified lines
634642 unsigned int num_chars, num_bs;
635643
636644 case ECHO_OP_ERASE_TAB:
645+ if (MASK(ldata->echo_commit) == MASK(tail + 2))
646+ goto not_yet_stored;
637647 num_chars = echo_buf(ldata, tail + 2);
638648
639649 /*
@@ -728,7 +738,8 @@ static size_t __process_echoes(struct tty_struct *tty) · 88 unmodified lines
728738 /* If the echo buffer is nearly full (so that the possibility exists
729739 * of echo overrun before the next commit), then discard enough
730740 * data at the tail to prevent a subsequent overrun */
731− while (ldata->echo_commit - tail >= ECHO_DISCARD_WATERMARK) {
741+ while (ldata->echo_commit > tail &&
742+ ldata->echo_commit - tail >= ECHO_DISCARD_WATERMARK) {
732743 if (echo_buf(ldata, tail) == ECHO_OP_START) {
733744 if (echo_buf(ldata, tail + 1) == ECHO_OP_ERASE_TAB)
734745 tail += 3;
@@ -738,6 +749,7 @@ static size_t __process_echoes(struct tty_struct *tty) · 3 unmodified lines
738749 tail++;
739750 }
740751
752+ not_yet_stored:
741753 ldata->echo_tail = tail;
742754 return old_space - space;
743755 }
@@ -748,6 +760,7 @@ static void commit_echoes(struct tty_struct *tty) · 4 unmodified lines
748760 size_t nr, old, echoed;
749761 size_t head;
750762
763+ mutex_lock(&ldata->output_lock);
751764 head = ldata->echo_head;
752765 ldata->echo_mark = head;
753766 old = ldata->echo_commit - ldata->echo_tail;
@@ -756,10 +769,12 @@ static void commit_echoes(struct tty_struct *tty) · 2 unmodified lines
756769 * is over the threshold (and try again each time another
757770 * block is accumulated) */
758771 nr = head - ldata->echo_tail;
759− if (nr < ECHO_COMMIT_WATERMARK || (nr % ECHO_BLOCK > old % ECHO_BLOCK))
772+ if (nr < ECHO_COMMIT_WATERMARK ||
773+ (nr % ECHO_BLOCK > old % ECHO_BLOCK)) {
774+ mutex_unlock(&ldata->output_lock);
760775 return;
776+ }
761777
762− mutex_lock(&ldata->output_lock);
763778 ldata->echo_commit = head;
764779 echoed = __process_echoes(tty);
765780 mutex_unlock(&ldata->output_lock);
@@ -810,7 +825,9 @@ static void flush_echoes(struct tty_struct *tty) · 44 unmodified lines
810825
811826 static inline void add_echo_byte(unsigned char c, struct n_tty_data *ldata)
812827 {
813− *echo_buf_addr(ldata, ldata->echo_head++) = c;
828+ *echo_buf_addr(ldata, ldata->echo_head) = c;
829+ smp_wmb(); /* Matches smp_rmb() in echo_buf(). */
830+ ldata->echo_head++;
814831 }
815832
816833 /**
@@ -978,14 +995,15 @@ static void eraser(unsigned char c, struct tty_struct *tty) · 161 unmodified lines
978995 }
979996
980997 seen_alnums = 0;
981− while (ldata->read_head != ldata->canon_head) {
998+ while (MASK(ldata->read_head) != MASK(ldata->canon_head)) {
982999 head = ldata->read_head;
9831000
9841001 /* erase a single possibly multibyte character */
9851002 do {
9861003 head--;
9871004 c = read_buf(ldata, head);
988− } while (is_continuation(c, tty) && head != ldata->canon_head);
1005+ } while (is_continuation(c, tty) &&
1006+ MASK(head) != MASK(ldata->canon_head));
9891007
9901008 /* do not partially erase */
9911009 if (is_continuation(c, tty))
@@ -1027,7 +1045,7 @@ static void eraser(unsigned char c, struct tty_struct *tty) · 35 unmodified lines
10271045 * This info is used to go back the correct
10281046 * number of columns.
10291047 */
1030− while (tail != ldata->canon_head) {
1048+ while (MASK(tail) != MASK(ldata->canon_head)) {
10311049 tail--;
10321050 c = read_buf(ldata, tail);
10331051 if (c == '\t') {
@@ -1302,7 +1320,7 @@ n_tty_receive_char_special(struct tty_struct *tty, unsigned char c) · 268 unmodified lines
13021320 finish_erasing(ldata);
13031321 echo_char(c, tty);
13041322 echo_char_raw('\n', ldata);
1305− while (tail != ldata->read_head) {
1323+ while (MASK(tail) != MASK(ldata->read_head)) {
13061324 echo_char(read_buf(ldata, tail), tty);
13071325 tail++;
13081326 }
@@ -1878,30 +1896,21 @@ static int n_tty_open(struct tty_struct *tty) · 569 unmodified lines
18781896 struct n_tty_data *ldata;
18791897
18801898 /* Currently a malloc failure here can panic */
1881− ldata = vmalloc(sizeof(*ldata));
1899+ ldata = vzalloc(sizeof(*ldata));
18821900 if (!ldata)
1883− goto err;
1901+ return -ENOMEM;
18841902
18851903 ldata->overrun_time = jiffies;
18861904 mutex_init(&ldata->atomic_read_lock);
18871905 mutex_init(&ldata->output_lock);
18881906
18891907 tty->disc_data = ldata;
1890− reset_buffer_flags(tty->disc_data);
1891− ldata->column = 0;
1892− ldata->canon_column = 0;
1893− ldata->num_overrun = 0;
1894− ldata->no_room = 0;
1895− ldata->lnext = 0;
18961908 tty->closing = 0;
18971909 /* indicate buffer work may resume */
18981910 clear_bit(TTY_LDISC_HALTED, &tty->flags);
18991911 n_tty_set_termios(tty, NULL);
19001912 tty_unthrottle(tty);
1901−
19021913 return 0;
1903−err:
1904− return -ENOMEM;
19051914 }
19061915
19071916 static inline int input_available_p(struct tty_struct *tty, int poll)
@@ -2411,7 +2420,7 @@ static unsigned long inq_canon(struct n_tty_data *ldata) · 503 unmodified lines
24112420 tail = ldata->read_tail;
24122421 nr = head - tail;
24132422 /* Skip EOF-chars.. */
2414− while (head != tail) {
2423+ while (MASK(head) != MASK(tail)) {
24152424 if (test_bit(tail & (N_TTY_BUF_SIZE - 1), ldata->read_flags) &&
24162425 read_buf(ldata, tail) == __DISABLED_CHAR)
24172426 nr--;
drivers/tty/serdev/core.c+1−0
@@ -617,6 +617,7 @@ EXPORT_SYMBOL_GPL(__serdev_device_driver_register); · 616 unmodified lines
617617 static void __exit serdev_exit(void)
618618 {
619619 bus_unregister(&serdev_bus_type);
620+ ida_destroy(&ctrl_ida);
620621 }
621622 module_exit(serdev_exit);
622623
drivers/tty/serial/8250/8250_pci.c+0−2
@@ -3339,9 +3339,7 @@ static const struct pci_device_id blacklist[] = { · 3338 unmodified lines
33393339 /* multi-io cards handled by parport_serial */
33403340 { PCI_DEVICE(0x4348, 0x7053), }, /* WCH CH353 2S1P */
33413341 { PCI_DEVICE(0x4348, 0x5053), }, /* WCH CH353 1S1P */
3342− { PCI_DEVICE(0x4348, 0x7173), }, /* WCH CH355 4S */
33433342 { PCI_DEVICE(0x1c00, 0x3250), }, /* WCH CH382 2S1P */
3344− { PCI_DEVICE(0x1c00, 0x3470), }, /* WCH CH384 4S */
33453343
33463344 /* Moxa Smartio MUE boards handled by 8250_moxa */
33473345 { PCI_VDEVICE(MOXA, 0x1024), },
drivers/tty/vt/vt.c+2−2
@@ -784,7 +784,7 @@ int vc_allocate(unsigned int currcons) /* return 0 on success */ · 783 unmodified lines
784784 if (!*vc->vc_uni_pagedir_loc)
785785 con_set_default_unimap(vc);
786786
787− vc->vc_screenbuf = kmalloc(vc->vc_screenbuf_size, GFP_KERNEL);
787+ vc->vc_screenbuf = kzalloc(vc->vc_screenbuf_size, GFP_KERNEL);
788788 if (!vc->vc_screenbuf)
789789 goto err_free;
790790
@@ -871,7 +871,7 @@ static int vc_do_resize(struct tty_struct *tty, struct vc_data *vc, · 80 unmodified lines
871871
872872 if (new_screen_size > (4 << 20))
873873 return -EINVAL;
874− newscreen = kmalloc(new_screen_size, GFP_USER);
874+ newscreen = kzalloc(new_screen_size, GFP_USER);
875875 if (!newscreen)
876876 return -ENOMEM;
877877
drivers/usb/chipidea/host.c+4−1
@@ -124,8 +124,11 @@ static int host_start(struct ci_hdrc *ci) · 123 unmodified lines
124124
125125 hcd->power_budget = ci->platdata->power_budget;
126126 hcd->tpl_support = ci->platdata->tpl_support;
127− if (ci->phy || ci->usb_phy)
127+ if (ci->phy || ci->usb_phy) {
128128 hcd->skip_phy_initialization = 1;
129+ if (ci->usb_phy)
130+ hcd->usb_phy = ci->usb_phy;
131+ }
129132
130133 ehci = hcd_to_ehci(hcd);
131134 ehci->caps = ci->hw_bank.cap;
drivers/usb/class/cdc-acm.c+3−0
@@ -1758,6 +1758,9 @@ static const struct usb_device_id acm_ids[] = { · 1757 unmodified lines
17581758 { USB_DEVICE(0x11ca, 0x0201), /* VeriFone Mx870 Gadget Serial */
17591759 .driver_info = SINGLE_RX_URB,
17601760 },
1761+ { USB_DEVICE(0x1965, 0x0018), /* Uniden UBC125XLT */
1762+ .driver_info = NO_UNION_NORMAL, /* has no union descriptor */
1763+ },
17611764 { USB_DEVICE(0x22b8, 0x7000), /* Motorola Q Phone */
17621765 .driver_info = NO_UNION_NORMAL, /* has no union descriptor */
17631766 },
drivers/usb/dwc2/core.h+3−0
@@ -1004,6 +1004,7 @@ struct dwc2_hregs_backup { · 1003 unmodified lines
10041004 * @frame_list_sz: Frame list size
10051005 * @desc_gen_cache: Kmem cache for generic descriptors
10061006 * @desc_hsisoc_cache: Kmem cache for hs isochronous descriptors
1007+ * @unaligned_cache: Kmem cache for DMA mode to handle non-aligned buf
10071008 *
10081009 * These are for peripheral mode:
10091010 *
@@ -1177,6 +1178,8 @@ struct dwc2_hsotg { · 167 unmodified lines
11771178 u32 frame_list_sz;
11781179 struct kmem_cache *desc_gen_cache;
11791180 struct kmem_cache *desc_hsisoc_cache;
1181+ struct kmem_cache *unaligned_cache;
1182+#define DWC2_KMEM_UNALIGNED_BUF_SIZE 1024
11801183
11811184 #endif /* CONFIG_USB_DWC2_HOST || CONFIG_USB_DWC2_DUAL_ROLE */
11821185
drivers/usb/dwc2/gadget.c+12−8
@@ -812,6 +812,7 @@ static int dwc2_gadget_fill_isoc_desc(struct dwc2_hsotg_ep *hs_ep, · 811 unmodified lines
812812 u32 index;
813813 u32 maxsize = 0;
814814 u32 mask = 0;
815+ u8 pid = 0;
815816
816817 maxsize = dwc2_gadget_get_desc_params(hs_ep, &mask);
817818
@@ -840,7 +841,11 @@ static int dwc2_gadget_fill_isoc_desc(struct dwc2_hsotg_ep *hs_ep, · 22 unmodified lines
840841 ((len << DEV_DMA_NBYTES_SHIFT) & mask));
841842
842843 if (hs_ep->dir_in) {
843− desc->status |= ((hs_ep->mc << DEV_DMA_ISOC_PID_SHIFT) &
844+ if (len)
845+ pid = DIV_ROUND_UP(len, hs_ep->ep.maxpacket);
846+ else
847+ pid = 1;
848+ desc->status |= ((pid << DEV_DMA_ISOC_PID_SHIFT) &
844849 DEV_DMA_ISOC_PID_MASK) |
845850 ((len % hs_ep->ep.maxpacket) ?
846851 DEV_DMA_SHORT : 0) |
@@ -884,6 +889,7 @@ static void dwc2_gadget_start_isoc_ddma(struct dwc2_hsotg_ep *hs_ep) · 37 unmodified lines
884889 struct dwc2_dma_desc *desc;
885890
886891 if (list_empty(&hs_ep->queue)) {
892+ hs_ep->target_frame = TARGET_FRAME_INITIAL;
887893 dev_dbg(hsotg->dev, "%s: No requests in queue\n", __func__);
888894 return;
889895 }
@@ -2755,8 +2761,6 @@ static void dwc2_gadget_handle_out_token_ep_disabled(struct dwc2_hsotg_ep *ep) · 1865 unmodified lines
27552761 */
27562762 tmp = dwc2_hsotg_read_frameno(hsotg);
27572763
2758− dwc2_hsotg_complete_request(hsotg, ep, get_ep_head(ep), 0);
2759−
27602764 if (using_desc_dma(hsotg)) {
27612765 if (ep->target_frame == TARGET_FRAME_INITIAL) {
27622766 /* Start first ISO Out */
@@ -2817,9 +2821,6 @@ static void dwc2_gadget_handle_nak(struct dwc2_hsotg_ep *hs_ep) · 54 unmodified lines
28172821
28182822 tmp = dwc2_hsotg_read_frameno(hsotg);
28192823 if (using_desc_dma(hsotg)) {
2820− dwc2_hsotg_complete_request(hsotg, hs_ep,
2821− get_ep_head(hs_ep), 0);
2822−
28232824 hs_ep->target_frame = tmp;
28242825 dwc2_gadget_incr_frame_num(hs_ep);
28252826 dwc2_gadget_start_isoc_ddma(hs_ep);
@@ -4739,9 +4740,11 @@ int dwc2_gadget_init(struct dwc2_hsotg *hsotg) · 1913 unmodified lines
47394740 }
47404741
47414742 ret = usb_add_gadget_udc(dev, &hsotg->gadget);
4742− if (ret)
4743+ if (ret) {
4744+ dwc2_hsotg_ep_free_request(&hsotg->eps_out[0]->ep,
4745+ hsotg->ctrl_req);
47434746 return ret;
4744−
4747+ }
47454748 dwc2_hsotg_dump(hsotg);
47464749
47474750 return 0;
@@ -4755,6 +4758,7 @@ int dwc2_gadget_init(struct dwc2_hsotg *hsotg) · 7 unmodified lines
47554758 int dwc2_hsotg_remove(struct dwc2_hsotg *hsotg)
47564759 {
47574760 usb_del_gadget_udc(&hsotg->gadget);
4761+ dwc2_hsotg_ep_free_request(&hsotg->eps_out[0]->ep, hsotg->ctrl_req);
47584762
47594763 return 0;
47604764 }
drivers/usb/dwc2/hcd.c+87−6
@@ -1567,11 +1567,20 @@ static void dwc2_hc_start_transfer(struct dwc2_hsotg *hsotg, · 1566 unmodified lines
15671567 }
15681568
15691569 if (hsotg->params.host_dma) {
1570− dwc2_writel((u32)chan->xfer_dma,
1571− hsotg->regs + HCDMA(chan->hc_num));
1570+ dma_addr_t dma_addr;
1571+
1572+ if (chan->align_buf) {
1573+ if (dbg_hc(chan))
1574+ dev_vdbg(hsotg->dev, "align_buf\n");
1575+ dma_addr = chan->align_buf;
1576+ } else {
1577+ dma_addr = chan->xfer_dma;
1578+ }
1579+ dwc2_writel((u32)dma_addr, hsotg->regs + HCDMA(chan->hc_num));
1580+
15721581 if (dbg_hc(chan))
15731582 dev_vdbg(hsotg->dev, "Wrote %08lx to HCDMA(%d)\n",
1574− (unsigned long)chan->xfer_dma, chan->hc_num);
1583+ (unsigned long)dma_addr, chan->hc_num);
15751584 }
15761585
15771586 /* Start the split */
@@ -2625,6 +2634,35 @@ static void dwc2_hc_init_xfer(struct dwc2_hsotg *hsotg, · 1047 unmodified lines
26252634 }
26262635 }
26272636
2637+static int dwc2_alloc_split_dma_aligned_buf(struct dwc2_hsotg *hsotg,
2638+ struct dwc2_qh *qh,
2639+ struct dwc2_host_chan *chan)
2640+{
2641+ if (!hsotg->unaligned_cache ||
2642+ chan->max_packet > DWC2_KMEM_UNALIGNED_BUF_SIZE)
2643+ return -ENOMEM;
2644+
2645+ if (!qh->dw_align_buf) {
2646+ qh->dw_align_buf = kmem_cache_alloc(hsotg->unaligned_cache,
2647+ GFP_ATOMIC | GFP_DMA);
2648+ if (!qh->dw_align_buf)
2649+ return -ENOMEM;
2650+ }
2651+
2652+ qh->dw_align_buf_dma = dma_map_single(hsotg->dev, qh->dw_align_buf,
2653+ DWC2_KMEM_UNALIGNED_BUF_SIZE,
2654+ DMA_FROM_DEVICE);
2655+
2656+ if (dma_mapping_error(hsotg->dev, qh->dw_align_buf_dma)) {
2657+ dev_err(hsotg->dev, "can't map align_buf\n");
2658+ chan->align_buf = 0;
2659+ return -EINVAL;
2660+ }
2661+
2662+ chan->align_buf = qh->dw_align_buf_dma;
2663+ return 0;
2664+}
2665+
26282666 #define DWC2_USB_DMA_ALIGN 4
26292667
26302668 struct dma_aligned_buffer {
@@ -2802,6 +2840,32 @@ static int dwc2_assign_and_init_hc(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh) · 171 unmodified lines
28022840 /* Set the transfer attributes */
28032841 dwc2_hc_init_xfer(hsotg, chan, qtd);
28042842
2843+ /* For non-dword aligned buffers */
2844+ if (hsotg->params.host_dma && qh->do_split &&
2845+ chan->ep_is_in && (chan->xfer_dma & 0x3)) {
2846+ dev_vdbg(hsotg->dev, "Non-aligned buffer\n");
2847+ if (dwc2_alloc_split_dma_aligned_buf(hsotg, qh, chan)) {
2848+ dev_err(hsotg->dev,
2849+ "Failed to allocate memory to handle non-aligned buffer\n");
2850+ /* Add channel back to free list */
2851+ chan->align_buf = 0;
2852+ chan->multi_count = 0;
2853+ list_add_tail(&chan->hc_list_entry,
2854+ &hsotg->free_hc_list);
2855+ qtd->in_process = 0;
2856+ qh->channel = NULL;
2857+ return -ENOMEM;
2858+ }
2859+ } else {
2860+ /*
2861+ * We assume that DMA is always aligned in non-split
2862+ * case or split out case. Warn if not.
2863+ */
2864+ WARN_ON_ONCE(hsotg->params.host_dma &&
2865+ (chan->xfer_dma & 0x3));
2866+ chan->align_buf = 0;
2867+ }
2868+
28052869 if (chan->ep_type == USB_ENDPOINT_XFER_INT ||
28062870 chan->ep_type == USB_ENDPOINT_XFER_ISOC)
28072871 /*
@@ -5246,6 +5310,19 @@ int dwc2_hcd_init(struct dwc2_hsotg *hsotg) · 2438 unmodified lines
52465310 }
52475311 }
52485312
5313+ if (hsotg->params.host_dma) {
5314+ /*
5315+ * Create kmem caches to handle non-aligned buffer
5316+ * in Buffer DMA mode.
5317+ */
5318+ hsotg->unaligned_cache = kmem_cache_create("dwc2-unaligned-dma",
5319+ DWC2_KMEM_UNALIGNED_BUF_SIZE, 4,
5320+ SLAB_CACHE_DMA, NULL);
5321+ if (!hsotg->unaligned_cache)
5322+ dev_err(hsotg->dev,
5323+ "unable to create dwc2 unaligned cache\n");
5324+ }
5325+
52495326 hsotg->otg_port = 1;
52505327 hsotg->frame_list = NULL;
52515328 hsotg->frame_list_dma = 0;
@@ -5280,8 +5357,9 @@ int dwc2_hcd_init(struct dwc2_hsotg *hsotg) · 28 unmodified lines
52805357 return 0;
52815358
52825359 error4:
5283− kmem_cache_destroy(hsotg->desc_gen_cache);
5360+ kmem_cache_destroy(hsotg->unaligned_cache);
52845361 kmem_cache_destroy(hsotg->desc_hsisoc_cache);
5362+ kmem_cache_destroy(hsotg->desc_gen_cache);
52855363 error3:
52865364 dwc2_hcd_release(hsotg);
52875365 error2:
@@ -5322,8 +5400,9 @@ void dwc2_hcd_remove(struct dwc2_hsotg *hsotg) · 34 unmodified lines
53225400 usb_remove_hcd(hcd);
53235401 hsotg->priv = NULL;
53245402
5325− kmem_cache_destroy(hsotg->desc_gen_cache);
5403+ kmem_cache_destroy(hsotg->unaligned_cache);
53265404 kmem_cache_destroy(hsotg->desc_hsisoc_cache);
5405+ kmem_cache_destroy(hsotg->desc_gen_cache);
53275406
53285407 dwc2_hcd_release(hsotg);
53295408 usb_put_hcd(hcd);
@@ -5435,7 +5514,7 @@ int dwc2_host_enter_hibernation(struct dwc2_hsotg *hsotg) · 105 unmodified lines
54355514 dwc2_writel(hprt0, hsotg->regs + HPRT0);
54365515
54375516 /* Wait for the HPRT0.PrtSusp register field to be set */
5438− if (dwc2_hsotg_wait_bit_set(hsotg, HPRT0, HPRT0_SUSP, 300))
5517+ if (dwc2_hsotg_wait_bit_set(hsotg, HPRT0, HPRT0_SUSP, 3000))
54395518 dev_warn(hsotg->dev, "Suspend wasn't generated\n");
54405519
54415520 /*
@@ -5616,6 +5695,8 @@ int dwc2_host_exit_hibernation(struct dwc2_hsotg *hsotg, int rem_wakeup, · 174 unmodified lines
56165695 return ret;
56175696 }
56185697
5698+ dwc2_hcd_rem_wakeup(hsotg);
5699+
56195700 hsotg->hibernated = 0;
56205701 hsotg->bus_suspended = 0;
56215702 hsotg->lx_state = DWC2_L0;
drivers/usb/dwc2/hcd.h+8−0
@@ -76,6 +76,8 @@ struct dwc2_qh; · 75 unmodified lines
7676 * (micro)frame
7777 * @xfer_buf: Pointer to current transfer buffer position
7878 * @xfer_dma: DMA address of xfer_buf
79+ * @align_buf: In Buffer DMA mode this will be used if xfer_buf is not
80+ * DWORD aligned
7981 * @xfer_len: Total number of bytes to transfer
8082 * @xfer_count: Number of bytes transferred so far
8183 * @start_pkt_count: Packet count at start of transfer
@@ -133,6 +135,7 @@ struct dwc2_host_chan { · 51 unmodified lines
133135
134136 u8 *xfer_buf;
135137 dma_addr_t xfer_dma;
138+ dma_addr_t align_buf;
136139 u32 xfer_len;
137140 u32 xfer_count;
138141 u16 start_pkt_count;
@@ -302,6 +305,9 @@ struct dwc2_hs_transfer_time { · 163 unmodified lines
302305 * speed. Note that this is in "schedule slice" which
303306 * is tightly packed.
304307 * @ntd: Actual number of transfer descriptors in a list
308+ * @dw_align_buf: Used instead of original buffer if its physical address
309+ * is not dword-aligned
310+ * @dw_align_buf_dma: DMA address for dw_align_buf
305311 * @qtd_list: List of QTDs for this QH
306312 * @channel: Host channel currently processing transfers for this QH
307313 * @qh_list_entry: Entry for QH in either the periodic or non-periodic
@@ -350,6 +356,8 @@ struct dwc2_qh { · 42 unmodified lines
350356 struct dwc2_hs_transfer_time hs_transfers[DWC2_HS_SCHEDULE_UFRAMES];
351357 u32 ls_start_schedule_slice;
352358 u16 ntd;
359+ u8 *dw_align_buf;
360+ dma_addr_t dw_align_buf_dma;
353361 struct list_head qtd_list;
354362 struct dwc2_host_chan *channel;
355363 struct list_head qh_list_entry;
drivers/usb/dwc2/hcd_intr.c+9−2
@@ -942,14 +942,21 @@ static int dwc2_xfercomp_isoc_split_in(struct dwc2_hsotg *hsotg, · 941 unmodified lines
942942 frame_desc = &qtd->urb->iso_descs[qtd->isoc_frame_index];
943943 len = dwc2_get_actual_xfer_length(hsotg, chan, chnum, qtd,
944944 DWC2_HC_XFER_COMPLETE, NULL);
945− if (!len) {
945+ if (!len && !qtd->isoc_split_offset) {
946946 qtd->complete_split = 0;
947− qtd->isoc_split_offset = 0;
948947 return 0;
949948 }
950949
951950 frame_desc->actual_length += len;
952951
952+ if (chan->align_buf) {
953+ dev_vdbg(hsotg->dev, "non-aligned buffer\n");
954+ dma_unmap_single(hsotg->dev, chan->qh->dw_align_buf_dma,
955+ DWC2_KMEM_UNALIGNED_BUF_SIZE, DMA_FROM_DEVICE);
956+ memcpy(qtd->urb->buf + (chan->xfer_dma - qtd->urb->dma),
957+ chan->qh->dw_align_buf, len);
958+ }
959+
953960 qtd->isoc_split_offset += len;
954961
955962 hctsiz = dwc2_readl(hsotg->regs + HCTSIZ(chnum));
drivers/usb/dwc2/hcd_queue.c+4−1
@@ -383,7 +383,7 @@ static unsigned long *dwc2_get_ls_map(struct dwc2_hsotg *hsotg, · 382 unmodified lines
383383 /* Get the map and adjust if this is a multi_tt hub */
384384 map = qh->dwc_tt->periodic_bitmaps;
385385 if (qh->dwc_tt->usb_tt->multi)
386− map += DWC2_ELEMENTS_PER_LS_BITMAP * qh->ttport;
386+ map += DWC2_ELEMENTS_PER_LS_BITMAP * (qh->ttport - 1);
387387
388388 return map;
389389 }
@@ -1696,6 +1696,9 @@ void dwc2_hcd_qh_free(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh) · 1306 unmodified lines
16961696
16971697 if (qh->desc_list)
16981698 dwc2_hcd_qh_free_ddma(hsotg, qh);
1699+ else if (hsotg->unaligned_cache && qh->dw_align_buf)
1700+ kmem_cache_free(hsotg->unaligned_cache, qh->dw_align_buf);
1701+
16991702 kfree(qh);
17001703 }
17011704
drivers/usb/dwc3/core.c+13−10
@@ -1272,7 +1272,6 @@ static int dwc3_probe(struct platform_device *pdev) · 1271 unmodified lines
12721272 if (!dwc->clks)
12731273 return -ENOMEM;
12741274
1275− dwc->num_clks = ARRAY_SIZE(dwc3_core_clks);
12761275 dwc->dev = dev;
12771276
12781277 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -1307,15 +1306,19 @@ static int dwc3_probe(struct platform_device *pdev) · 28 unmodified lines
13071306 if (IS_ERR(dwc->reset))
13081307 return PTR_ERR(dwc->reset);
13091308
1310− ret = clk_bulk_get(dev, dwc->num_clks, dwc->clks);
1311− if (ret == -EPROBE_DEFER)
1312− return ret;
1313− /*
1314− * Clocks are optional, but new DT platforms should support all clocks
1315− * as required by the DT-binding.
1316− */
1317− if (ret)
1318− dwc->num_clks = 0;
1309+ if (dev->of_node) {
1310+ dwc->num_clks = ARRAY_SIZE(dwc3_core_clks);
1311+
1312+ ret = clk_bulk_get(dev, dwc->num_clks, dwc->clks);
1313+ if (ret == -EPROBE_DEFER)
1314+ return ret;
1315+ /*
1316+ * Clocks are optional, but new DT platforms should support all
1317+ * clocks as required by the DT-binding.
1318+ */
1319+ if (ret)
1320+ dwc->num_clks = 0;
1321+ }
13191322
13201323 ret = reset_control_deassert(dwc->reset);
13211324 if (ret)
drivers/usb/dwc3/dwc3-of-simple.c+2−1
@@ -165,8 +165,9 @@ static int dwc3_of_simple_remove(struct platform_device *pdev) · 164 unmodified lines
165165
166166 reset_control_put(simple->resets);
167167
168− pm_runtime_put_sync(dev);
169168 pm_runtime_disable(dev);
169+ pm_runtime_put_noidle(dev);
170+ pm_runtime_set_suspended(dev);
170171
171172 return 0;
172173 }
drivers/usb/dwc3/dwc3-pci.c+2−0
@@ -34,6 +34,7 @@ · 33 unmodified lines
3434 #define PCI_DEVICE_ID_INTEL_GLK 0x31aa
3535 #define PCI_DEVICE_ID_INTEL_CNPLP 0x9dee
3636 #define PCI_DEVICE_ID_INTEL_CNPH 0xa36e
37+#define PCI_DEVICE_ID_INTEL_ICLLP 0x34ee
3738
3839 #define PCI_INTEL_BXT_DSM_GUID "732b85d5-b7a7-4a1b-9ba0-4bbd00ffd511"
3940 #define PCI_INTEL_BXT_FUNC_PMU_PWR 4
@@ -289,6 +290,7 @@ static const struct pci_device_id dwc3_pci_id_table[] = { · 249 unmodified lines
289290 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_GLK), },
290291 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CNPLP), },
291292 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_CNPH), },
293+ { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICLLP), },
292294 { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_NL_USB), },
293295 { } /* Terminating Entry */
294296 };
drivers/usb/dwc3/dwc3-qcom.c+5−8
@@ -490,6 +490,7 @@ static int dwc3_qcom_probe(struct platform_device *pdev) · 489 unmodified lines
490490 qcom->dwc3 = of_find_device_by_node(dwc3_np);
491491 if (!qcom->dwc3) {
492492 dev_err(&pdev->dev, "failed to get dwc3 platform device\n");
493+ ret = -ENODEV;
493494 goto depopulate;
494495 }
495496
@@ -547,8 +548,7 @@ static int dwc3_qcom_remove(struct platform_device *pdev) · 51 unmodified lines
547548 return 0;
548549 }
549550
550−#ifdef CONFIG_PM_SLEEP
551−static int dwc3_qcom_pm_suspend(struct device *dev)
551+static int __maybe_unused dwc3_qcom_pm_suspend(struct device *dev)
552552 {
553553 struct dwc3_qcom *qcom = dev_get_drvdata(dev);
554554 int ret = 0;
@@ -560,7 +560,7 @@ static int dwc3_qcom_pm_suspend(struct device *dev) · 5 unmodified lines
560560 return ret;
561561 }
562562
563−static int dwc3_qcom_pm_resume(struct device *dev)
563+static int __maybe_unused dwc3_qcom_pm_resume(struct device *dev)
564564 {
565565 struct dwc3_qcom *qcom = dev_get_drvdata(dev);
566566 int ret;
@@ -571,23 +571,20 @@ static int dwc3_qcom_pm_resume(struct device *dev) · 4 unmodified lines
571571
572572 return ret;
573573 }
574−#endif
575574
576−#ifdef CONFIG_PM
577−static int dwc3_qcom_runtime_suspend(struct device *dev)
575+static int __maybe_unused dwc3_qcom_runtime_suspend(struct device *dev)
578576 {
579577 struct dwc3_qcom *qcom = dev_get_drvdata(dev);
580578
581579 return dwc3_qcom_suspend(qcom);
582580 }
583581
584−static int dwc3_qcom_runtime_resume(struct device *dev)
582+static int __maybe_unused dwc3_qcom_runtime_resume(struct device *dev)
585583 {
586584 struct dwc3_qcom *qcom = dev_get_drvdata(dev);
587585
588586 return dwc3_qcom_resume(qcom);
589587 }
590−#endif
591588
592589 static const struct dev_pm_ops dwc3_qcom_dev_pm_ops = {
593590 SET_SYSTEM_SLEEP_PM_OPS(dwc3_qcom_pm_suspend, dwc3_qcom_pm_resume)
drivers/usb/gadget/composite.c+3−0
@@ -1719,6 +1719,8 @@ composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl) · 1718 unmodified lines
17191719 */
17201720 if (w_value && !f->get_alt)
17211721 break;
1722+
1723+ spin_lock(&cdev->lock);
17221724 value = f->set_alt(f, w_index, w_value);
17231725 if (value == USB_GADGET_DELAYED_STATUS) {
17241726 DBG(cdev,
@@ -1728,6 +1730,7 @@ composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl) · 3 unmodified lines
17281730 DBG(cdev, "delayed_status count %d\n",
17291731 cdev->delayed_status);
17301732 }
1733+ spin_unlock(&cdev->lock);
17311734 break;
17321735 case USB_REQ_GET_INTERFACE:
17331736 if (ctrl->bRequestType != (USB_DIR_IN|USB_RECIP_INTERFACE))
drivers/usb/gadget/function/f_fs.c+18−8
@@ -215,6 +215,7 @@ struct ffs_io_data { · 214 unmodified lines
215215
216216 struct mm_struct *mm;
217217 struct work_struct work;
218+ struct work_struct cancellation_work;
218219
219220 struct usb_ep *ep;
220221 struct usb_request *req;
@@ -1072,22 +1073,31 @@ ffs_epfile_open(struct inode *inode, struct file *file) · 851 unmodified lines
10721073 return 0;
10731074 }
10741075
1076+static void ffs_aio_cancel_worker(struct work_struct *work)
1077+{
1078+ struct ffs_io_data *io_data = container_of(work, struct ffs_io_data,
1079+ cancellation_work);
1080+
1081+ ENTER();
1082+
1083+ usb_ep_dequeue(io_data->ep, io_data->req);
1084+}
1085+
10751086 static int ffs_aio_cancel(struct kiocb *kiocb)
10761087 {
10771088 struct ffs_io_data *io_data = kiocb->private;
1078− struct ffs_epfile *epfile = kiocb->ki_filp->private_data;
1089+ struct ffs_data *ffs = io_data->ffs;
10791090 int value;
10801091
10811092 ENTER();
10821093
1083− spin_lock_irq(&epfile->ffs->eps_lock);
1084−
1085− if (likely(io_data && io_data->ep && io_data->req))
1086− value = usb_ep_dequeue(io_data->ep, io_data->req);
1087− else
1094+ if (likely(io_data && io_data->ep && io_data->req)) {
1095+ INIT_WORK(&io_data->cancellation_work, ffs_aio_cancel_worker);
1096+ queue_work(ffs->io_completion_wq, &io_data->cancellation_work);
1097+ value = -EINPROGRESS;
1098+ } else {
10881099 value = -EINVAL;
1089−
1090− spin_unlock_irq(&epfile->ffs->eps_lock);
1100+ }
10911101
10921102 return value;
10931103 }
drivers/usb/host/xhci-mem.c+2−2
@@ -886,12 +886,12 @@ void xhci_free_virt_device(struct xhci_hcd *xhci, int slot_id) · 885 unmodified lines
886886
887887 dev = xhci->devs[slot_id];
888888
889− trace_xhci_free_virt_device(dev);
890−
891889 xhci->dcbaa->dev_context_ptrs[slot_id] = 0;
892890 if (!dev)
893891 return;
894892
893+ trace_xhci_free_virt_device(dev);
894+
895895 if (dev->tt_info)
896896 old_active_eps = dev->tt_info->active_eps;
897897
drivers/usb/host/xhci-tegra.c+3−3
@@ -481,7 +481,7 @@ static void tegra_xusb_mbox_handle(struct tegra_xusb *tegra, · 480 unmodified lines
481481 unsigned long mask;
482482 unsigned int port;
483483 bool idle, enable;
484− int err;
484+ int err = 0;
485485
486486 memset(&rsp, 0, sizeof(rsp));
487487
@@ -1223,10 +1223,10 @@ disable_rpm: · 735 unmodified lines
12231223 pm_runtime_disable(&pdev->dev);
12241224 usb_put_hcd(tegra->hcd);
12251225 disable_xusbc:
1226− if (!&pdev->dev.pm_domain)
1226+ if (!pdev->dev.pm_domain)
12271227 tegra_powergate_power_off(TEGRA_POWERGATE_XUSBC);
12281228 disable_xusba:
1229− if (!&pdev->dev.pm_domain)
1229+ if (!pdev->dev.pm_domain)
12301230 tegra_powergate_power_off(TEGRA_POWERGATE_XUSBA);
12311231 put_padctl:
12321232 tegra_xusb_padctl_put(tegra->padctl);
drivers/usb/host/xhci-trace.h+31−5
@@ -171,6 +171,37 @@ DEFINE_EVENT(xhci_log_trb, xhci_dbc_gadget_ep_queue, · 170 unmodified lines
171171 TP_ARGS(ring, trb)
172172 );
173173
174+DECLARE_EVENT_CLASS(xhci_log_free_virt_dev,
175+ TP_PROTO(struct xhci_virt_device *vdev),
176+ TP_ARGS(vdev),
177+ TP_STRUCT__entry(
178+ __field(void *, vdev)
179+ __field(unsigned long long, out_ctx)
180+ __field(unsigned long long, in_ctx)
181+ __field(u8, fake_port)
182+ __field(u8, real_port)
183+ __field(u16, current_mel)
184+
185+ ),
186+ TP_fast_assign(
187+ __entry->vdev = vdev;
188+ __entry->in_ctx = (unsigned long long) vdev->in_ctx->dma;
189+ __entry->out_ctx = (unsigned long long) vdev->out_ctx->dma;
190+ __entry->fake_port = (u8) vdev->fake_port;
191+ __entry->real_port = (u8) vdev->real_port;
192+ __entry->current_mel = (u16) vdev->current_mel;
193+ ),
194+ TP_printk("vdev %p ctx %llx | %llx fake_port %d real_port %d current_mel %d",
195+ __entry->vdev, __entry->in_ctx, __entry->out_ctx,
196+ __entry->fake_port, __entry->real_port, __entry->current_mel
197+ )
198+);
199+
200+DEFINE_EVENT(xhci_log_free_virt_dev, xhci_free_virt_device,
201+ TP_PROTO(struct xhci_virt_device *vdev),
202+ TP_ARGS(vdev)
203+);
204+
174205 DECLARE_EVENT_CLASS(xhci_log_virt_dev,
175206 TP_PROTO(struct xhci_virt_device *vdev),
176207 TP_ARGS(vdev),
@@ -208,11 +239,6 @@ DEFINE_EVENT(xhci_log_virt_dev, xhci_alloc_virt_device, · 31 unmodified lines
208239 TP_ARGS(vdev)
209240 );
210241
211−DEFINE_EVENT(xhci_log_virt_dev, xhci_free_virt_device,
212− TP_PROTO(struct xhci_virt_device *vdev),
213− TP_ARGS(vdev)
214−);
215−
216242 DEFINE_EVENT(xhci_log_virt_dev, xhci_setup_device,
217243 TP_PROTO(struct xhci_virt_device *vdev),
218244 TP_ARGS(vdev)
drivers/usb/host/xhci.c+43−4
@@ -908,6 +908,41 @@ static void xhci_disable_port_wake_on_bits(struct xhci_hcd *xhci) · 907 unmodified lines
908908 spin_unlock_irqrestore(&xhci->lock, flags);
909909 }
910910
911+static bool xhci_pending_portevent(struct xhci_hcd *xhci)
912+{
913+ struct xhci_port **ports;
914+ int port_index;
915+ u32 status;
916+ u32 portsc;
917+
918+ status = readl(&xhci->op_regs->status);
919+ if (status & STS_EINT)
920+ return true;
921+ /*
922+ * Checking STS_EINT is not enough as there is a lag between a change
923+ * bit being set and the Port Status Change Event that it generated
924+ * being written to the Event Ring. See note in xhci 1.1 section 4.19.2.
925+ */
926+
927+ port_index = xhci->usb2_rhub.num_ports;
928+ ports = xhci->usb2_rhub.ports;
929+ while (port_index--) {
930+ portsc = readl(ports[port_index]->addr);
931+ if (portsc & PORT_CHANGE_MASK ||
932+ (portsc & PORT_PLS_MASK) == XDEV_RESUME)
933+ return true;
934+ }
935+ port_index = xhci->usb3_rhub.num_ports;
936+ ports = xhci->usb3_rhub.ports;
937+ while (port_index--) {
938+ portsc = readl(ports[port_index]->addr);
939+ if (portsc & PORT_CHANGE_MASK ||
940+ (portsc & PORT_PLS_MASK) == XDEV_RESUME)
941+ return true;
942+ }
943+ return false;
944+}
945+
911946 /*
912947 * Stop HC (not bus-specific)
913948 *
@@ -1009,7 +1044,7 @@ EXPORT_SYMBOL_GPL(xhci_suspend); · 95 unmodified lines
10091044 */
10101045 int xhci_resume(struct xhci_hcd *xhci, bool hibernated)
10111046 {
1012− u32 command, temp = 0, status;
1047+ u32 command, temp = 0;
10131048 struct usb_hcd *hcd = xhci_to_hcd(xhci);
10141049 struct usb_hcd *secondary_hcd;
10151050 int retval = 0;
@@ -1043,8 +1078,13 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated) · 27 unmodified lines
10431078 command = readl(&xhci->op_regs->command);
10441079 command |= CMD_CRS;
10451080 writel(command, &xhci->op_regs->command);
1081+ /*
1082+ * Some controllers take up to 55+ ms to complete the controller
1083+ * restore so setting the timeout to 100ms. Xhci specification
1084+ * doesn't mention any timeout value.
1085+ */
10461086 if (xhci_handshake(&xhci->op_regs->status,
1047− STS_RESTORE, 0, 10 * 1000)) {
1087+ STS_RESTORE, 0, 100 * 1000)) {
10481088 xhci_warn(xhci, "WARN: xHC restore state timeout\n");
10491089 spin_unlock_irq(&xhci->lock);
10501090 return -ETIMEDOUT;
@@ -1134,8 +1174,7 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated) · 83 unmodified lines
11341174 done:
11351175 if (retval == 0) {
11361176 /* Resume root hubs only when have pending events. */
1137− status = readl(&xhci->op_regs->status);
1138− if (status & STS_EINT) {
1177+ if (xhci_pending_portevent(xhci)) {
11391178 usb_hcd_resume_root_hub(xhci->shared_hcd);
11401179 usb_hcd_resume_root_hub(hcd);
11411180 }
drivers/usb/host/xhci.h+4−0
@@ -382,6 +382,10 @@ struct xhci_op_regs { · 381 unmodified lines
382382 #define PORT_PLC (1 << 22)
383383 /* port configure error change - port failed to configure its link partner */
384384 #define PORT_CEC (1 << 23)
385+#define PORT_CHANGE_MASK (PORT_CSC | PORT_PEC | PORT_WRC | PORT_OCC | \
386+ PORT_RC | PORT_PLC | PORT_CEC)
387+
388+
385389 /* Cold Attach Status - xHC can set this bit to report device attached during
386390 * Sx state. Warm port reset should be perfomed to clear this bit and move port
387391 * to connected state.
drivers/usb/serial/cp210x.c+14−0
@@ -95,6 +95,9 @@ static const struct usb_device_id id_table[] = { · 94 unmodified lines
9595 { USB_DEVICE(0x10C4, 0x8156) }, /* B&G H3000 link cable */
9696 { USB_DEVICE(0x10C4, 0x815E) }, /* Helicomm IP-Link 1220-DVM */
9797 { USB_DEVICE(0x10C4, 0x815F) }, /* Timewave HamLinkUSB */
98+ { USB_DEVICE(0x10C4, 0x817C) }, /* CESINEL MEDCAL N Power Quality Monitor */
99+ { USB_DEVICE(0x10C4, 0x817D) }, /* CESINEL MEDCAL NT Power Quality Monitor */
100+ { USB_DEVICE(0x10C4, 0x817E) }, /* CESINEL MEDCAL S Power Quality Monitor */
98101 { USB_DEVICE(0x10C4, 0x818B) }, /* AVIT Research USB to TTL */
99102 { USB_DEVICE(0x10C4, 0x819F) }, /* MJS USB Toslink Switcher */
100103 { USB_DEVICE(0x10C4, 0x81A6) }, /* ThinkOptics WavIt */
@@ -112,6 +115,9 @@ static const struct usb_device_id id_table[] = { · 11 unmodified lines
112115 { USB_DEVICE(0x10C4, 0x826B) }, /* Cygnal Integrated Products, Inc., Fasttrax GPS demonstration module */
113116 { USB_DEVICE(0x10C4, 0x8281) }, /* Nanotec Plug & Drive */
114117 { USB_DEVICE(0x10C4, 0x8293) }, /* Telegesis ETRX2USB */
118+ { USB_DEVICE(0x10C4, 0x82EF) }, /* CESINEL FALCO 6105 AC Power Supply */
119+ { USB_DEVICE(0x10C4, 0x82F1) }, /* CESINEL MEDCAL EFD Earth Fault Detector */
120+ { USB_DEVICE(0x10C4, 0x82F2) }, /* CESINEL MEDCAL ST Network Analyzer */
115121 { USB_DEVICE(0x10C4, 0x82F4) }, /* Starizona MicroTouch */
116122 { USB_DEVICE(0x10C4, 0x82F9) }, /* Procyon AVS */
117123 { USB_DEVICE(0x10C4, 0x8341) }, /* Siemens MC35PU GPRS Modem */
@@ -124,7 +130,9 @@ static const struct usb_device_id id_table[] = { · 6 unmodified lines
124130 { USB_DEVICE(0x10C4, 0x8470) }, /* Juniper Networks BX Series System Console */
125131 { USB_DEVICE(0x10C4, 0x8477) }, /* Balluff RFID */
126132 { USB_DEVICE(0x10C4, 0x84B6) }, /* Starizona Hyperion */
133+ { USB_DEVICE(0x10C4, 0x851E) }, /* CESINEL MEDCAL PT Network Analyzer */
127134 { USB_DEVICE(0x10C4, 0x85A7) }, /* LifeScan OneTouch Verio IQ */
135+ { USB_DEVICE(0x10C4, 0x85B8) }, /* CESINEL ReCon T Energy Logger */
128136 { USB_DEVICE(0x10C4, 0x85EA) }, /* AC-Services IBUS-IF */
129137 { USB_DEVICE(0x10C4, 0x85EB) }, /* AC-Services CIS-IBUS */
130138 { USB_DEVICE(0x10C4, 0x85F8) }, /* Virtenio Preon32 */
@@ -134,17 +142,23 @@ static const struct usb_device_id id_table[] = { · 3 unmodified lines
134142 { USB_DEVICE(0x10C4, 0x8857) }, /* CEL EM357 ZigBee USB Stick */
135143 { USB_DEVICE(0x10C4, 0x88A4) }, /* MMB Networks ZigBee USB Device */
136144 { USB_DEVICE(0x10C4, 0x88A5) }, /* Planet Innovation Ingeni ZigBee USB Device */
145+ { USB_DEVICE(0x10C4, 0x88FB) }, /* CESINEL MEDCAL STII Network Analyzer */
146+ { USB_DEVICE(0x10C4, 0x8938) }, /* CESINEL MEDCAL S II Network Analyzer */
137147 { USB_DEVICE(0x10C4, 0x8946) }, /* Ketra N1 Wireless Interface */
138148 { USB_DEVICE(0x10C4, 0x8962) }, /* Brim Brothers charging dock */
139149 { USB_DEVICE(0x10C4, 0x8977) }, /* CEL MeshWorks DevKit Device */
140150 { USB_DEVICE(0x10C4, 0x8998) }, /* KCF Technologies PRN */
151+ { USB_DEVICE(0x10C4, 0x89A4) }, /* CESINEL FTBC Flexible Thyristor Bridge Controller */
141152 { USB_DEVICE(0x10C4, 0x8A2A) }, /* HubZ dual ZigBee and Z-Wave dongle */
142153 { USB_DEVICE(0x10C4, 0x8A5E) }, /* CEL EM3588 ZigBee USB Stick Long Range */
143154 { USB_DEVICE(0x10C4, 0x8B34) }, /* Qivicon ZigBee USB Radio Stick */
144155 { USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */
145156 { USB_DEVICE(0x10C4, 0xEA61) }, /* Silicon Labs factory default */
157+ { USB_DEVICE(0x10C4, 0xEA63) }, /* Silicon Labs Windows Update (CP2101-4/CP2102N) */
146158 { USB_DEVICE(0x10C4, 0xEA70) }, /* Silicon Labs factory default */
147159 { USB_DEVICE(0x10C4, 0xEA71) }, /* Infinity GPS-MIC-1 Radio Monophone */
160+ { USB_DEVICE(0x10C4, 0xEA7A) }, /* Silicon Labs Windows Update (CP2105) */
161+ { USB_DEVICE(0x10C4, 0xEA7B) }, /* Silicon Labs Windows Update (CP2108) */
148162 { USB_DEVICE(0x10C4, 0xF001) }, /* Elan Digital Systems USBscope50 */
149163 { USB_DEVICE(0x10C4, 0xF002) }, /* Elan Digital Systems USBwave12 */
150164 { USB_DEVICE(0x10C4, 0xF003) }, /* Elan Digital Systems USBpulse100 */
drivers/usb/typec/tcpm.c+6−4
@@ -418,17 +418,18 @@ static void _tcpm_log(struct tcpm_port *port, const char *fmt, va_list args) · 417 unmodified lines
418418 u64 ts_nsec = local_clock();
419419 unsigned long rem_nsec;
420420
421+ mutex_lock(&port->logbuffer_lock);
421422 if (!port->logbuffer[port->logbuffer_head]) {
422423 port->logbuffer[port->logbuffer_head] =
423424 kzalloc(LOG_BUFFER_ENTRY_SIZE, GFP_KERNEL);
424− if (!port->logbuffer[port->logbuffer_head])
425+ if (!port->logbuffer[port->logbuffer_head]) {
426+ mutex_unlock(&port->logbuffer_lock);
425427 return;
428+ }
426429 }
427430
428431 vsnprintf(tmpbuffer, sizeof(tmpbuffer), fmt, args);
429432
430− mutex_lock(&port->logbuffer_lock);
431−
432433 if (tcpm_log_full(port)) {
433434 port->logbuffer_head = max(port->logbuffer_head - 1, 0);
434435 strcpy(tmpbuffer, "overflow");
@@ -3043,7 +3044,8 @@ static void run_state_machine(struct tcpm_port *port) · 2608 unmodified lines
30433044 tcpm_port_is_sink(port) &&
30443045 time_is_after_jiffies(port->delayed_runtime)) {
30453046 tcpm_set_state(port, SNK_DISCOVERY,
3046− port->delayed_runtime - jiffies);
3047+ jiffies_to_msecs(port->delayed_runtime -
3048+ jiffies));
30473049 break;
30483050 }
30493051 tcpm_set_state(port, unattached_state(port), 0);
drivers/usb/typec/ucsi/ucsi.c+13−0
@@ -350,6 +350,19 @@ static void ucsi_connector_change(struct work_struct *work) · 349 unmodified lines
350350 }
351351
352352 if (con->status.change & UCSI_CONSTAT_CONNECT_CHANGE) {
353+ typec_set_pwr_role(con->port, con->status.pwr_dir);
354+
355+ switch (con->status.partner_type) {
356+ case UCSI_CONSTAT_PARTNER_TYPE_UFP:
357+ typec_set_data_role(con->port, TYPEC_HOST);
358+ break;
359+ case UCSI_CONSTAT_PARTNER_TYPE_DFP:
360+ typec_set_data_role(con->port, TYPEC_DEVICE);
361+ break;
362+ default:
363+ break;
364+ }
365+
353366 if (con->status.connected)
354367 ucsi_register_partner(con);
355368 else
drivers/usb/typec/ucsi/ucsi_acpi.c+5−0
@@ -79,6 +79,11 @@ static int ucsi_acpi_probe(struct platform_device *pdev) · 78 unmodified lines
7979 return -ENODEV;
8080 }
8181
82+ /* This will make sure we can use ioremap_nocache() */
83+ status = acpi_release_memory(ACPI_HANDLE(&pdev->dev), res, 1);
84+ if (ACPI_FAILURE(status))
85+ return -ENOMEM;
86+
8287 /*
8388 * NOTE: The memory region for the data structures is used also in an
8489 * operation region, which means ACPI has already reserved it. Therefore
drivers/vhost/net.c+2−1
@@ -1226,7 +1226,8 @@ err_used: · 1225 unmodified lines
12261226 if (ubufs)
12271227 vhost_net_ubuf_put_wait_and_free(ubufs);
12281228 err_ubufs:
1229− sockfd_put(sock);
1229+ if (sock)
1230+ sockfd_put(sock);
12301231 err_vq:
12311232 mutex_unlock(&vq->mutex);
12321233 err:
drivers/xen/Makefile+1−1
@@ -41,4 +41,4 @@ obj-$(CONFIG_XEN_PVCALLS_FRONTEND) += pvcalls-front.o · 40 unmodified lines
4141 xen-evtchn-y := evtchn.o
4242 xen-gntdev-y := gntdev.o
4343 xen-gntalloc-y := gntalloc.o
44−xen-privcmd-y := privcmd.o
44+xen-privcmd-y := privcmd.o privcmd-buf.o
drivers/xen/events/events_base.c+0−2
@@ -628,8 +628,6 @@ static void __unbind_from_irq(unsigned int irq) · 627 unmodified lines
628628 xen_irq_info_cleanup(info);
629629 }
630630
631− BUG_ON(info_for_irq(irq)->type == IRQT_UNBOUND);
632−
633631 xen_free_irq(irq);
634632 }
635633
drivers/xen/grant-table.c+2−2
@@ -799,7 +799,7 @@ int gnttab_alloc_pages(int nr_pages, struct page **pages) · 798 unmodified lines
799799
800800 return 0;
801801 }
802−EXPORT_SYMBOL(gnttab_alloc_pages);
802+EXPORT_SYMBOL_GPL(gnttab_alloc_pages);
803803
804804 /**
805805 * gnttab_free_pages - free pages allocated by gnttab_alloc_pages()
@@ -820,7 +820,7 @@ void gnttab_free_pages(int nr_pages, struct page **pages) · 14 unmodified lines
820820 }
821821 free_xenballooned_pages(nr_pages, pages);
822822 }
823−EXPORT_SYMBOL(gnttab_free_pages);
823+EXPORT_SYMBOL_GPL(gnttab_free_pages);
824824
825825 /* Handling of paged out grant targets (GNTST_eagain) */
826826 #define MAX_DELAY 256
drivers/xen/manage.c+15−3
@@ -289,8 +289,15 @@ static void sysrq_handler(struct xenbus_watch *watch, const char *path, · 288 unmodified lines
289289 return;
290290 }
291291
292− if (sysrq_key != '\0')
293− xenbus_printf(xbt, "control", "sysrq", "%c", '\0');
292+ if (sysrq_key != '\0') {
293+ err = xenbus_printf(xbt, "control", "sysrq", "%c", '\0');
294+ if (err) {
295+ pr_err("%s: Error %d writing sysrq in control/sysrq\n",
296+ __func__, err);
297+ xenbus_transaction_end(xbt, 1);
298+ return;
299+ }
300+ }
294301
295302 err = xenbus_transaction_end(xbt, 0);
296303 if (err == -EAGAIN)
@@ -342,7 +349,12 @@ static int setup_shutdown_watcher(void) · 45 unmodified lines
342349 continue;
343350 snprintf(node, FEATURE_PATH_SIZE, "feature-%s",
344351 shutdown_handlers[idx].command);
345− xenbus_printf(XBT_NIL, "control", node, "%u", 1);
352+ err = xenbus_printf(XBT_NIL, "control", node, "%u", 1);
353+ if (err) {
354+ pr_err("%s: Error %d writing %s\n", __func__,
355+ err, node);
356+ return err;
357+ }
346358 }
347359
348360 return 0;
drivers/xen/privcmd-buf.c+210−0
@@ -0,0 +1,210 @@
1+// SPDX-License-Identifier: GPL-2.0 OR MIT
2+
3+/******************************************************************************
4+ * privcmd-buf.c
5+ *
6+ * Mmap of hypercall buffers.
7+ *
8+ * Copyright (c) 2018 Juergen Gross
9+ */
10+
11+#define pr_fmt(fmt) "xen:" KBUILD_MODNAME ": " fmt
12+
13+#include <linux/kernel.h>
14+#include <linux/module.h>
15+#include <linux/list.h>
16+#include <linux/miscdevice.h>
17+#include <linux/mm.h>
18+#include <linux/slab.h>
19+
20+#include "privcmd.h"
21+
22+MODULE_LICENSE("GPL");
23+
24+static unsigned int limit = 64;
25+module_param(limit, uint, 0644);
26+MODULE_PARM_DESC(limit, "Maximum number of pages that may be allocated by "
27+ "the privcmd-buf device per open file");
28+
29+struct privcmd_buf_private {
30+ struct mutex lock;
31+ struct list_head list;
32+ unsigned int allocated;
33+};
34+
35+struct privcmd_buf_vma_private {
36+ struct privcmd_buf_private *file_priv;
37+ struct list_head list;
38+ unsigned int users;
39+ unsigned int n_pages;
40+ struct page *pages[];
41+};
42+
43+static int privcmd_buf_open(struct inode *ino, struct file *file)
44+{
45+ struct privcmd_buf_private *file_priv;
46+
47+ file_priv = kzalloc(sizeof(*file_priv), GFP_KERNEL);
48+ if (!file_priv)
49+ return -ENOMEM;
50+
51+ mutex_init(&file_priv->lock);
52+ INIT_LIST_HEAD(&file_priv->list);
53+
54+ file->private_data = file_priv;
55+
56+ return 0;
57+}
58+
59+static void privcmd_buf_vmapriv_free(struct privcmd_buf_vma_private *vma_priv)
60+{
61+ unsigned int i;
62+
63+ vma_priv->file_priv->allocated -= vma_priv->n_pages;
64+
65+ list_del(&vma_priv->list);
66+
67+ for (i = 0; i < vma_priv->n_pages; i++)
68+ if (vma_priv->pages[i])
69+ __free_page(vma_priv->pages[i]);
70+
71+ kfree(vma_priv);
72+}
73+
74+static int privcmd_buf_release(struct inode *ino, struct file *file)
75+{
76+ struct privcmd_buf_private *file_priv = file->private_data;
77+ struct privcmd_buf_vma_private *vma_priv;
78+
79+ mutex_lock(&file_priv->lock);
80+
81+ while (!list_empty(&file_priv->list)) {
82+ vma_priv = list_first_entry(&file_priv->list,
83+ struct privcmd_buf_vma_private,
84+ list);
85+ privcmd_buf_vmapriv_free(vma_priv);
86+ }
87+
88+ mutex_unlock(&file_priv->lock);
89+
90+ kfree(file_priv);
91+
92+ return 0;
93+}
94+
95+static void privcmd_buf_vma_open(struct vm_area_struct *vma)
96+{
97+ struct privcmd_buf_vma_private *vma_priv = vma->vm_private_data;
98+
99+ if (!vma_priv)
100+ return;
101+
102+ mutex_lock(&vma_priv->file_priv->lock);
103+ vma_priv->users++;
104+ mutex_unlock(&vma_priv->file_priv->lock);
105+}
106+
107+static void privcmd_buf_vma_close(struct vm_area_struct *vma)
108+{
109+ struct privcmd_buf_vma_private *vma_priv = vma->vm_private_data;
110+ struct privcmd_buf_private *file_priv;
111+
112+ if (!vma_priv)
113+ return;
114+
115+ file_priv = vma_priv->file_priv;
116+
117+ mutex_lock(&file_priv->lock);
118+
119+ vma_priv->users--;
120+ if (!vma_priv->users)
121+ privcmd_buf_vmapriv_free(vma_priv);
122+
123+ mutex_unlock(&file_priv->lock);
124+}
125+
126+static vm_fault_t privcmd_buf_vma_fault(struct vm_fault *vmf)
127+{
128+ pr_debug("fault: vma=%p %lx-%lx, pgoff=%lx, uv=%p\n",
129+ vmf->vma, vmf->vma->vm_start, vmf->vma->vm_end,
130+ vmf->pgoff, (void *)vmf->address);
131+
132+ return VM_FAULT_SIGBUS;
133+}
134+
135+static const struct vm_operations_struct privcmd_buf_vm_ops = {
136+ .open = privcmd_buf_vma_open,
137+ .close = privcmd_buf_vma_close,
138+ .fault = privcmd_buf_vma_fault,
139+};
140+
141+static int privcmd_buf_mmap(struct file *file, struct vm_area_struct *vma)
142+{
143+ struct privcmd_buf_private *file_priv = file->private_data;
144+ struct privcmd_buf_vma_private *vma_priv;
145+ unsigned long count = vma_pages(vma);
146+ unsigned int i;
147+ int ret = 0;
148+
149+ if (!(vma->vm_flags & VM_SHARED) || count > limit ||
150+ file_priv->allocated + count > limit)
151+ return -EINVAL;
152+
153+ vma_priv = kzalloc(sizeof(*vma_priv) + count * sizeof(void *),
154+ GFP_KERNEL);
155+ if (!vma_priv)
156+ return -ENOMEM;
157+
158+ vma_priv->n_pages = count;
159+ count = 0;
160+ for (i = 0; i < vma_priv->n_pages; i++) {
161+ vma_priv->pages[i] = alloc_page(GFP_KERNEL | __GFP_ZERO);
162+ if (!vma_priv->pages[i])
163+ break;
164+ count++;
165+ }
166+
167+ mutex_lock(&file_priv->lock);
168+
169+ file_priv->allocated += count;
170+
171+ vma_priv->file_priv = file_priv;
172+ vma_priv->users = 1;
173+
174+ vma->vm_flags |= VM_IO | VM_DONTEXPAND;
175+ vma->vm_ops = &privcmd_buf_vm_ops;
176+ vma->vm_private_data = vma_priv;
177+
178+ list_add(&vma_priv->list, &file_priv->list);
179+
180+ if (vma_priv->n_pages != count)
181+ ret = -ENOMEM;
182+ else
183+ for (i = 0; i < vma_priv->n_pages; i++) {
184+ ret = vm_insert_page(vma, vma->vm_start + i * PAGE_SIZE,
185+ vma_priv->pages[i]);
186+ if (ret)
187+ break;
188+ }
189+
190+ if (ret)
191+ privcmd_buf_vmapriv_free(vma_priv);
192+
193+ mutex_unlock(&file_priv->lock);
194+
195+ return ret;
196+}
197+
198+const struct file_operations xen_privcmdbuf_fops = {
199+ .owner = THIS_MODULE,
200+ .open = privcmd_buf_open,
201+ .release = privcmd_buf_release,
202+ .mmap = privcmd_buf_mmap,
203+};
204+EXPORT_SYMBOL_GPL(xen_privcmdbuf_fops);
205+
206+struct miscdevice xen_privcmdbuf_dev = {
207+ .minor = MISC_DYNAMIC_MINOR,
208+ .name = "xen/hypercall",
209+ .fops = &xen_privcmdbuf_fops,
210+};
drivers/xen/privcmd.c+9−0
@@ -1007,12 +1007,21 @@ static int __init privcmd_init(void) · 1006 unmodified lines
10071007 pr_err("Could not register Xen privcmd device\n");
10081008 return err;
10091009 }
1010+
1011+ err = misc_register(&xen_privcmdbuf_dev);
1012+ if (err != 0) {
1013+ pr_err("Could not register Xen hypercall-buf device\n");
1014+ misc_deregister(&privcmd_dev);
1015+ return err;
1016+ }
1017+
10101018 return 0;
10111019 }
10121020
10131021 static void __exit privcmd_exit(void)
10141022 {
10151023 misc_deregister(&privcmd_dev);
1024+ misc_deregister(&xen_privcmdbuf_dev);
10161025 }
10171026
10181027 module_init(privcmd_init);
drivers/xen/privcmd.h+3−0
@@ -1,3 +1,6 @@
11 #include <linux/fs.h>
22
33 extern const struct file_operations xen_privcmd_fops;
4+extern const struct file_operations xen_privcmdbuf_fops;
5+
6+extern struct miscdevice xen_privcmdbuf_dev;
drivers/xen/xen-scsiback.c+13−3
@@ -1012,6 +1012,7 @@ static void scsiback_do_add_lun(struct vscsibk_info *info, const char *state, · 1011 unmodified lines
10121012 {
10131013 struct v2p_entry *entry;
10141014 unsigned long flags;
1015+ int err;
10151016
10161017 if (try) {
10171018 spin_lock_irqsave(&info->v2p_lock, flags);
@@ -1027,8 +1028,11 @@ static void scsiback_do_add_lun(struct vscsibk_info *info, const char *state, · 9 unmodified lines
10271028 scsiback_del_translation_entry(info, vir);
10281029 }
10291030 } else if (!try) {
1030− xenbus_printf(XBT_NIL, info->dev->nodename, state,
1031+ err = xenbus_printf(XBT_NIL, info->dev->nodename, state,
10311032 "%d", XenbusStateClosed);
1033+ if (err)
1034+ xenbus_dev_error(info->dev, err,
1035+ "%s: writing %s", __func__, state);
10321036 }
10331037 }
10341038
@@ -1067,8 +1071,11 @@ static void scsiback_do_1lun_hotplug(struct vscsibk_info *info, int op, · 32 unmodified lines
10671071 snprintf(str, sizeof(str), "vscsi-devs/%s/p-dev", ent);
10681072 val = xenbus_read(XBT_NIL, dev->nodename, str, NULL);
10691073 if (IS_ERR(val)) {
1070− xenbus_printf(XBT_NIL, dev->nodename, state,
1074+ err = xenbus_printf(XBT_NIL, dev->nodename, state,
10711075 "%d", XenbusStateClosed);
1076+ if (err)
1077+ xenbus_dev_error(info->dev, err,
1078+ "%s: writing %s", __func__, state);
10721079 return;
10731080 }
10741081 strlcpy(phy, val, VSCSI_NAMELEN);
@@ -1079,8 +1086,11 @@ static void scsiback_do_1lun_hotplug(struct vscsibk_info *info, int op, · 4 unmodified lines
10791086 err = xenbus_scanf(XBT_NIL, dev->nodename, str, "%u:%u:%u:%u",
10801087 &vir.hst, &vir.chn, &vir.tgt, &vir.lun);
10811088 if (XENBUS_EXIST_ERR(err)) {
1082− xenbus_printf(XBT_NIL, dev->nodename, state,
1089+ err = xenbus_printf(XBT_NIL, dev->nodename, state,
10831090 "%d", XenbusStateClosed);
1091+ if (err)
1092+ xenbus_dev_error(info->dev, err,
1093+ "%s: writing %s", __func__, state);
10841094 return;
10851095 }
10861096
fs/aio.c+1−147
@@ -5,7 +5,6 @@ · 4 unmodified lines
55 * Implements an efficient asynchronous io interface.
66 *
77 * Copyright 2000, 2001, 2002 Red Hat, Inc. All Rights Reserved.
8− * Copyright 2018 Christoph Hellwig.
98 *
109 * See ../COPYING for licensing terms.
1110 */
@@ -165,22 +164,10 @@ struct fsync_iocb { · 153 unmodified lines
165164 bool datasync;
166165 };
167166
168−struct poll_iocb {
169− struct file *file;
170− __poll_t events;
171− struct wait_queue_head *head;
172−
173− union {
174− struct wait_queue_entry wait;
175− struct work_struct work;
176− };
177−};
178−
179167 struct aio_kiocb {
180168 union {
181169 struct kiocb rw;
182170 struct fsync_iocb fsync;
183− struct poll_iocb poll;
184171 };
185172
186173 struct kioctx *ki_ctx;
@@ -1590,6 +1577,7 @@ static int aio_fsync(struct fsync_iocb *req, struct iocb *iocb, bool datasync) · 1403 unmodified lines
15901577 if (unlikely(iocb->aio_buf || iocb->aio_offset || iocb->aio_nbytes ||
15911578 iocb->aio_rw_flags))
15921579 return -EINVAL;
1580+
15931581 req->file = fget(iocb->aio_fildes);
15941582 if (unlikely(!req->file))
15951583 return -EBADF;
@@ -1604,137 +1592,6 @@ static int aio_fsync(struct fsync_iocb *req, struct iocb *iocb, bool datasync) · 8 unmodified lines
16041592 return 0;
16051593 }
16061594
1607−/* need to use list_del_init so we can check if item was present */
1608−static inline bool __aio_poll_remove(struct poll_iocb *req)
1609−{
1610− if (list_empty(&req->wait.entry))
1611− return false;
1612− list_del_init(&req->wait.entry);
1613− return true;
1614−}
1615−
1616−static inline void __aio_poll_complete(struct aio_kiocb *iocb, __poll_t mask)
1617−{
1618− fput(iocb->poll.file);
1619− aio_complete(iocb, mangle_poll(mask), 0);
1620−}
1621−
1622−static void aio_poll_work(struct work_struct *work)
1623−{
1624− struct aio_kiocb *iocb = container_of(work, struct aio_kiocb, poll.work);
1625−
1626− if (!list_empty_careful(&iocb->ki_list))
1627− aio_remove_iocb(iocb);
1628− __aio_poll_complete(iocb, iocb->poll.events);
1629−}
1630−
1631−static int aio_poll_cancel(struct kiocb *iocb)
1632−{
1633− struct aio_kiocb *aiocb = container_of(iocb, struct aio_kiocb, rw);
1634− struct poll_iocb *req = &aiocb->poll;
1635− struct wait_queue_head *head = req->head;
1636− bool found = false;
1637−
1638− spin_lock(&head->lock);
1639− found = __aio_poll_remove(req);
1640− spin_unlock(&head->lock);
1641−
1642− if (found) {
1643− req->events = 0;
1644− INIT_WORK(&req->work, aio_poll_work);
1645− schedule_work(&req->work);
1646− }
1647− return 0;
1648−}
1649−
1650−static int aio_poll_wake(struct wait_queue_entry *wait, unsigned mode, int sync,
1651− void *key)
1652−{
1653− struct poll_iocb *req = container_of(wait, struct poll_iocb, wait);
1654− struct aio_kiocb *iocb = container_of(req, struct aio_kiocb, poll);
1655− struct file *file = req->file;
1656− __poll_t mask = key_to_poll(key);
1657−
1658− assert_spin_locked(&req->head->lock);
1659−
1660− /* for instances that support it check for an event match first: */
1661− if (mask && !(mask & req->events))
1662− return 0;
1663−
1664− mask = file->f_op->poll_mask(file, req->events) & req->events;
1665− if (!mask)
1666− return 0;
1667−
1668− __aio_poll_remove(req);
1669−
1670− /*
1671− * Try completing without a context switch if we can acquire ctx_lock
1672− * without spinning. Otherwise we need to defer to a workqueue to
1673− * avoid a deadlock due to the lock order.
1674− */
1675− if (spin_trylock(&iocb->ki_ctx->ctx_lock)) {
1676− list_del_init(&iocb->ki_list);
1677− spin_unlock(&iocb->ki_ctx->ctx_lock);
1678−
1679− __aio_poll_complete(iocb, mask);
1680− } else {
1681− req->events = mask;
1682− INIT_WORK(&req->work, aio_poll_work);
1683− schedule_work(&req->work);
1684− }
1685−
1686− return 1;
1687−}
1688−
1689−static ssize_t aio_poll(struct aio_kiocb *aiocb, struct iocb *iocb)
1690−{
1691− struct kioctx *ctx = aiocb->ki_ctx;
1692− struct poll_iocb *req = &aiocb->poll;
1693− __poll_t mask;
1694−
1695− /* reject any unknown events outside the normal event mask. */
1696− if ((u16)iocb->aio_buf != iocb->aio_buf)
1697− return -EINVAL;
1698− /* reject fields that are not defined for poll */
1699− if (iocb->aio_offset || iocb->aio_nbytes || iocb->aio_rw_flags)
1700− return -EINVAL;
1701−
1702− req->events = demangle_poll(iocb->aio_buf) | EPOLLERR | EPOLLHUP;
1703− req->file = fget(iocb->aio_fildes);
1704− if (unlikely(!req->file))
1705− return -EBADF;
1706− if (!file_has_poll_mask(req->file))
1707− goto out_fail;
1708−
1709− req->head = req->file->f_op->get_poll_head(req->file, req->events);
1710− if (!req->head)
1711− goto out_fail;
1712− if (IS_ERR(req->head)) {
1713− mask = EPOLLERR;
1714− goto done;
1715− }
1716−
1717− init_waitqueue_func_entry(&req->wait, aio_poll_wake);
1718− aiocb->ki_cancel = aio_poll_cancel;
1719−
1720− spin_lock_irq(&ctx->ctx_lock);
1721− spin_lock(&req->head->lock);
1722− mask = req->file->f_op->poll_mask(req->file, req->events) & req->events;
1723− if (!mask) {
1724− __add_wait_queue(req->head, &req->wait);
1725− list_add_tail(&aiocb->ki_list, &ctx->active_reqs);
1726− }
1727− spin_unlock(&req->head->lock);
1728− spin_unlock_irq(&ctx->ctx_lock);
1729−done:
1730− if (mask)
1731− __aio_poll_complete(aiocb, mask);
1732− return 0;
1733−out_fail:
1734− fput(req->file);
1735− return -EINVAL; /* same as no support for IOCB_CMD_POLL */
1736−}
1737−
17381595 static int io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb,
17391596 bool compat)
17401597 {
@@ -1808,9 +1665,6 @@ static int io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb, · 67 unmodified lines
18081665 case IOCB_CMD_FDSYNC:
18091666 ret = aio_fsync(&req->fsync, &iocb, true);
18101667 break;
1811− case IOCB_CMD_POLL:
1812− ret = aio_poll(req, &iocb);
1813− break;
18141668 default:
18151669 pr_debug("invalid aio operation %d\n", iocb.aio_lio_opcode);
18161670 ret = -EINVAL;
fs/btrfs/extent_io.c+4−1
@@ -4542,8 +4542,11 @@ int extent_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, · 4541 unmodified lines
45424542 offset_in_extent = em_start - em->start;
45434543 em_end = extent_map_end(em);
45444544 em_len = em_end - em_start;
4545− disko = em->block_start + offset_in_extent;
45464545 flags = 0;
4546+ if (em->block_start < EXTENT_MAP_LAST_BYTE)
4547+ disko = em->block_start + offset_in_extent;
4548+ else
4549+ disko = 0;
45474550
45484551 /*
45494552 * bump off for our next call to get_extent
fs/btrfs/inode.c+5−2
@@ -9005,13 +9005,14 @@ again: · 9004 unmodified lines
90059005
90069006 unlock_extent_cached(io_tree, page_start, page_end, &cached_state);
90079007
9008−out_unlock:
90099008 if (!ret2) {
90109009 btrfs_delalloc_release_extents(BTRFS_I(inode), PAGE_SIZE, true);
90119010 sb_end_pagefault(inode->i_sb);
90129011 extent_changeset_free(data_reserved);
90139012 return VM_FAULT_LOCKED;
90149013 }
9014+
9015+out_unlock:
90159016 unlock_page(page);
90169017 out:
90179018 btrfs_delalloc_release_extents(BTRFS_I(inode), PAGE_SIZE, (ret != 0));
@@ -9443,6 +9444,7 @@ static int btrfs_rename_exchange(struct inode *old_dir, · 425 unmodified lines
94439444 u64 new_idx = 0;
94449445 u64 root_objectid;
94459446 int ret;
9447+ int ret2;
94469448 bool root_log_pinned = false;
94479449 bool dest_log_pinned = false;
94489450
@@ -9639,7 +9641,8 @@ out_fail: · 190 unmodified lines
96399641 dest_log_pinned = false;
96409642 }
96419643 }
9642− ret = btrfs_end_transaction(trans);
9644+ ret2 = btrfs_end_transaction(trans);
9645+ ret = ret ? ret : ret2;
96439646 out_notrans:
96449647 if (new_ino == BTRFS_FIRST_FREE_OBJECTID)
96459648 up_read(&fs_info->subvol_sem);
fs/btrfs/ioctl.c+5−5
@@ -3577,7 +3577,7 @@ static int btrfs_extent_same(struct inode *src, u64 loff, u64 olen, · 3576 unmodified lines
35773577 ret = btrfs_extent_same_range(src, loff, BTRFS_MAX_DEDUPE_LEN,
35783578 dst, dst_loff, &cmp);
35793579 if (ret)
3580− goto out_unlock;
3580+ goto out_free;
35813581
35823582 loff += BTRFS_MAX_DEDUPE_LEN;
35833583 dst_loff += BTRFS_MAX_DEDUPE_LEN;
@@ -3587,16 +3587,16 @@ static int btrfs_extent_same(struct inode *src, u64 loff, u64 olen, · 3 unmodified lines
35873587 ret = btrfs_extent_same_range(src, loff, tail_len, dst,
35883588 dst_loff, &cmp);
35893589
3590+out_free:
3591+ kvfree(cmp.src_pages);
3592+ kvfree(cmp.dst_pages);
3593+
35903594 out_unlock:
35913595 if (same_inode)
35923596 inode_unlock(src);
35933597 else
35943598 btrfs_double_inode_unlock(src, dst);
35953599
3596−out_free:
3597− kvfree(cmp.src_pages);
3598− kvfree(cmp.dst_pages);
3599−
36003600 return ret;
36013601 }
36023602
fs/btrfs/qgroup.c+13−4
@@ -2680,8 +2680,10 @@ out: · 2679 unmodified lines
26802680 free_extent_buffer(scratch_leaf);
26812681 }
26822682
2683− if (done && !ret)
2683+ if (done && !ret) {
26842684 ret = 1;
2685+ fs_info->qgroup_rescan_progress.objectid = (u64)-1;
2686+ }
26852687 return ret;
26862688 }
26872689
@@ -2784,13 +2786,20 @@ qgroup_rescan_init(struct btrfs_fs_info *fs_info, u64 progress_objectid, · 96 unmodified lines
27842786
27852787 if (!init_flags) {
27862788 /* we're resuming qgroup rescan at mount time */
2787− if (!(fs_info->qgroup_flags & BTRFS_QGROUP_STATUS_FLAG_RESCAN))
2789+ if (!(fs_info->qgroup_flags &
2790+ BTRFS_QGROUP_STATUS_FLAG_RESCAN)) {
27882791 btrfs_warn(fs_info,
27892792 "qgroup rescan init failed, qgroup is not enabled");
2790− else if (!(fs_info->qgroup_flags & BTRFS_QGROUP_STATUS_FLAG_ON))
2793+ ret = -EINVAL;
2794+ } else if (!(fs_info->qgroup_flags &
2795+ BTRFS_QGROUP_STATUS_FLAG_ON)) {
27912796 btrfs_warn(fs_info,
27922797 "qgroup rescan init failed, qgroup rescan is not queued");
2793− return -EINVAL;
2798+ ret = -EINVAL;
2799+ }
2800+
2801+ if (ret)
2802+ return ret;
27942803 }
27952804
27962805 mutex_lock(&fs_info->qgroup_rescan_lock);
fs/ceph/inode.c+1−0
@@ -1135,6 +1135,7 @@ static struct dentry *splice_dentry(struct dentry *dn, struct inode *in) · 1134 unmodified lines
11351135 if (IS_ERR(realdn)) {
11361136 pr_err("splice_dentry error %ld %p inode %p ino %llx.%llx\n",
11371137 PTR_ERR(realdn), dn, in, ceph_vinop(in));
1138+ dput(dn);
11381139 dn = realdn; /* note realdn contains the error */
11391140 goto out;
11401141 } else if (realdn) {
fs/cifs/cifs_debug.c+29−0
@@ -126,6 +126,25 @@ static void cifs_debug_tcon(struct seq_file *m, struct cifs_tcon *tcon) · 125 unmodified lines
126126 seq_putc(m, '\n');
127127 }
128128
129+static void
130+cifs_dump_iface(struct seq_file *m, struct cifs_server_iface *iface)
131+{
132+ struct sockaddr_in *ipv4 = (struct sockaddr_in *)&iface->sockaddr;
133+ struct sockaddr_in6 *ipv6 = (struct sockaddr_in6 *)&iface->sockaddr;
134+
135+ seq_printf(m, "\t\tSpeed: %zu bps\n", iface->speed);
136+ seq_puts(m, "\t\tCapabilities: ");
137+ if (iface->rdma_capable)
138+ seq_puts(m, "rdma ");
139+ if (iface->rss_capable)
140+ seq_puts(m, "rss ");
141+ seq_putc(m, '\n');
142+ if (iface->sockaddr.ss_family == AF_INET)
143+ seq_printf(m, "\t\tIPv4: %pI4\n", &ipv4->sin_addr);
144+ else if (iface->sockaddr.ss_family == AF_INET6)
145+ seq_printf(m, "\t\tIPv6: %pI6\n", &ipv6->sin6_addr);
146+}
147+
129148 static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
130149 {
131150 struct list_head *tmp1, *tmp2, *tmp3;
@@ -312,6 +331,16 @@ skip_rdma: · 180 unmodified lines
312331 mid_entry->mid);
313332 }
314333 spin_unlock(&GlobalMid_Lock);
334+
335+ spin_lock(&ses->iface_lock);
336+ if (ses->iface_count)
337+ seq_printf(m, "\n\tServer interfaces: %zu\n",
338+ ses->iface_count);
339+ for (j = 0; j < ses->iface_count; j++) {
340+ seq_printf(m, "\t%d)\n", j);
341+ cifs_dump_iface(m, &ses->iface_list[j]);
342+ }
343+ spin_unlock(&ses->iface_lock);
315344 }
316345 }
317346 spin_unlock(&cifs_tcp_ses_lock);
fs/cifs/cifsencrypt.c+15−5
@@ -37,7 +37,6 @@ · 36 unmodified lines
3737 #include <crypto/aead.h>
3838
3939 int __cifs_calc_signature(struct smb_rqst *rqst,
40− int start,
4140 struct TCP_Server_Info *server, char *signature,
4241 struct shash_desc *shash)
4342 {
@@ -45,16 +44,27 @@ int __cifs_calc_signature(struct smb_rqst *rqst, · 1 unmodified line
4544 int rc;
4645 struct kvec *iov = rqst->rq_iov;
4746 int n_vec = rqst->rq_nvec;
47+ int is_smb2 = server->vals->header_preamble_size == 0;
4848
49− for (i = start; i < n_vec; i++) {
49+ /* iov[0] is actual data and not the rfc1002 length for SMB2+ */
50+ if (is_smb2) {
51+ if (iov[0].iov_len <= 4)
52+ return -EIO;
53+ i = 0;
54+ } else {
55+ if (n_vec < 2 || iov[0].iov_len != 4)
56+ return -EIO;
57+ i = 1; /* skip rfc1002 length */
58+ }
59+
60+ for (; i < n_vec; i++) {
5061 if (iov[i].iov_len == 0)
5162 continue;
5263 if (iov[i].iov_base == NULL) {
5364 cifs_dbg(VFS, "null iovec entry\n");
5465 return -EIO;
5566 }
56− if (i == 1 && iov[1].iov_len <= 4)
57− break; /* nothing to sign or corrupt header */
67+
5868 rc = crypto_shash_update(shash,
5969 iov[i].iov_base, iov[i].iov_len);
6070 if (rc) {
@@ -118,7 +128,7 @@ static int cifs_calc_signature(struct smb_rqst *rqst, · 57 unmodified lines
118128 return rc;
119129 }
120130
121− return __cifs_calc_signature(rqst, 1, server, signature,
131+ return __cifs_calc_signature(rqst, server, signature,
122132 &server->secmech.sdescmd5->shash);
123133 }
124134
fs/cifs/cifsglob.h+37−3
@@ -33,6 +33,9 @@ · 32 unmodified lines
3333
3434 #define CIFS_MAGIC_NUMBER 0xFF534D42 /* the first four bytes of SMB PDUs */
3535
36+#define CIFS_PORT 445
37+#define RFC1001_PORT 139
38+
3639 /*
3740 * The sizes of various internal tables and strings
3841 */
@@ -312,6 +315,10 @@ struct smb_version_operations { · 273 unmodified lines
312315 /* send echo request */
313316 int (*echo)(struct TCP_Server_Info *);
314317 /* create directory */
318+ int (*posix_mkdir)(const unsigned int xid, struct inode *inode,
319+ umode_t mode, struct cifs_tcon *tcon,
320+ const char *full_path,
321+ struct cifs_sb_info *cifs_sb);
315322 int (*mkdir)(const unsigned int, struct cifs_tcon *, const char *,
316323 struct cifs_sb_info *);
317324 /* set info on created directory */
@@ -838,6 +845,13 @@ static inline void cifs_set_net_ns(struct TCP_Server_Info *srv, struct net *net) · 520 unmodified lines
838845
839846 #endif
840847
848+struct cifs_server_iface {
849+ size_t speed;
850+ unsigned int rdma_capable : 1;
851+ unsigned int rss_capable : 1;
852+ struct sockaddr_storage sockaddr;
853+};
854+
841855 /*
842856 * Session structure. One of these for each uid session with a particular host
843857 */
@@ -875,6 +889,20 @@ struct cifs_ses { · 31 unmodified lines
875889 #ifdef CONFIG_CIFS_SMB311
876890 __u8 preauth_sha_hash[SMB2_PREAUTH_HASH_SIZE];
877891 #endif /* 3.1.1 */
892+
893+ /*
894+ * Network interfaces available on the server this session is
895+ * connected to.
896+ *
897+ * Other channels can be opened by connecting and binding this
898+ * session to interfaces from this list.
899+ *
900+ * iface_lock should be taken when accessing any of these fields
901+ */
902+ spinlock_t iface_lock;
903+ struct cifs_server_iface *iface_list;
904+ size_t iface_count;
905+ unsigned long iface_last_update; /* jiffies */
878906 };
879907
880908 static inline bool
@@ -883,6 +911,14 @@ cap_unix(struct cifs_ses *ses) · 2 unmodified lines
883911 return ses->server->vals->cap_unix & ses->capabilities;
884912 }
885913
914+struct cached_fid {
915+ bool is_valid:1; /* Do we have a useable root fid */
916+ struct cifs_fid *fid;
917+ struct mutex fid_mutex;
918+ struct cifs_tcon *tcon;
919+ struct work_struct lease_break;
920+};
921+
886922 /*
887923 * there is one of these for each connection to a resource on a particular
888924 * session
@@ -987,9 +1023,7 @@ struct cifs_tcon { · 98 unmodified lines
9871023 struct fscache_cookie *fscache; /* cookie for share */
9881024 #endif
9891025 struct list_head pending_opens; /* list of incomplete opens */
990− bool valid_root_fid:1; /* Do we have a useable root fid */
991− struct mutex prfid_mutex; /* prevents reopen race after dead ses*/
992− struct cifs_fid *prfid; /* handle to the directory at top of share */
1026+ struct cached_fid crfid; /* Cached root fid */
9931027 /* BB add field for back pointer to sb struct(s)? */
9941028 };
9951029
fs/cifs/cifsproto.h+2−5
@@ -112,10 +112,6 @@ extern int SendReceive2(const unsigned int /* xid */ , struct cifs_ses *, · 111 unmodified lines
112112 struct kvec *, int /* nvec to send */,
113113 int * /* type of buf returned */, const int flags,
114114 struct kvec * /* resp vec */);
115−extern int smb2_send_recv(const unsigned int xid, struct cifs_ses *pses,
116− struct kvec *pkvec, int nvec_to_send,
117− int *pbuftype, const int flags,
118− struct kvec *presp);
119115 extern int SendReceiveBlockingLock(const unsigned int xid,
120116 struct cifs_tcon *ptcon,
121117 struct smb_hdr *in_buf ,
@@ -544,7 +540,7 @@ int cifs_create_mf_symlink(unsigned int xid, struct cifs_tcon *tcon, · 422 unmodified lines
544540 struct cifs_sb_info *cifs_sb,
545541 const unsigned char *path, char *pbuf,
546542 unsigned int *pbytes_written);
547−int __cifs_calc_signature(struct smb_rqst *rqst, int start,
543+int __cifs_calc_signature(struct smb_rqst *rqst,
548544 struct TCP_Server_Info *server, char *signature,
549545 struct shash_desc *shash);
550546 enum securityEnum cifs_select_sectype(struct TCP_Server_Info *,
@@ -552,6 +548,7 @@ enum securityEnum cifs_select_sectype(struct TCP_Server_Info *, · 1 unmodified line
552548 struct cifs_aio_ctx *cifs_aio_ctx_alloc(void);
553549 void cifs_aio_ctx_release(struct kref *refcount);
554550 int setup_aio_ctx_iter(struct cifs_aio_ctx *ctx, struct iov_iter *iter, int rw);
551+void smb2_cached_lease_break(struct work_struct *work);
555552
556553 int cifs_alloc_hash(const char *name, struct crypto_shash **shash,
557554 struct sdesc **sdesc);
fs/cifs/cifssmb.c+4−4
@@ -107,10 +107,10 @@ cifs_mark_open_files_invalid(struct cifs_tcon *tcon) · 106 unmodified lines
107107 }
108108 spin_unlock(&tcon->open_file_lock);
109109
110− mutex_lock(&tcon->prfid_mutex);
111− tcon->valid_root_fid = false;
112− memset(tcon->prfid, 0, sizeof(struct cifs_fid));
113− mutex_unlock(&tcon->prfid_mutex);
110+ mutex_lock(&tcon->crfid.fid_mutex);
111+ tcon->crfid.is_valid = false;
112+ memset(tcon->crfid.fid, 0, sizeof(struct cifs_fid));
113+ mutex_unlock(&tcon->crfid.fid_mutex);
114114
115115 /*
116116 * BB Add call to invalidate_inodes(sb) for all superblocks mounted
fs/cifs/connect.c+4−4
@@ -57,9 +57,6 @@ · 56 unmodified lines
5757 #include "smb2proto.h"
5858 #include "smbdirect.h"
5959
60−#define CIFS_PORT 445
61−#define RFC1001_PORT 139
62−
6360 extern mempool_t *cifs_req_poolp;
6461 extern bool disable_legacy_dialects;
6562
@@ -3029,8 +3026,11 @@ cifs_get_tcon(struct cifs_ses *ses, struct smb_vol *volume_info) · 2963 unmodified lines
30293026
30303027 #ifdef CONFIG_CIFS_SMB311
30313028 if ((volume_info->linux_ext) && (ses->server->posix_ext_supported)) {
3032− if (ses->server->vals->protocol_id == SMB311_PROT_ID)
3029+ if (ses->server->vals->protocol_id == SMB311_PROT_ID) {
30333030 tcon->posix_extensions = true;
3031+ printk_once(KERN_WARNING
3032+ "SMB3.11 POSIX Extensions are experimental\n");
3033+ }
30343034 }
30353035 #endif /* 311 */
30363036
fs/cifs/inode.c+11−2
@@ -1575,6 +1575,17 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, umode_t mode) · 1574 unmodified lines
15751575 goto mkdir_out;
15761576 }
15771577
1578+ server = tcon->ses->server;
1579+
1580+#ifdef CONFIG_CIFS_SMB311
1581+ if ((server->ops->posix_mkdir) && (tcon->posix_extensions)) {
1582+ rc = server->ops->posix_mkdir(xid, inode, mode, tcon, full_path,
1583+ cifs_sb);
1584+ d_drop(direntry); /* for time being always refresh inode info */
1585+ goto mkdir_out;
1586+ }
1587+#endif /* SMB311 */
1588+
15781589 if (cap_unix(tcon->ses) && (CIFS_UNIX_POSIX_PATH_OPS_CAP &
15791590 le64_to_cpu(tcon->fsUnixInfo.Capability))) {
15801591 rc = cifs_posix_mkdir(inode, direntry, mode, full_path, cifs_sb,
@@ -1583,8 +1594,6 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, umode_t mode) · 2 unmodified lines
15831594 goto mkdir_out;
15841595 }
15851596
1586− server = tcon->ses->server;
1587−
15881597 if (!server->ops->mkdir) {
15891598 rc = -ENOSYS;
15901599 goto mkdir_out;
fs/cifs/misc.c+6−3
@@ -82,6 +82,7 @@ sesInfoAlloc(void) · 81 unmodified lines
8282 INIT_LIST_HEAD(&ret_buf->smb_ses_list);
8383 INIT_LIST_HEAD(&ret_buf->tcon_list);
8484 mutex_init(&ret_buf->session_mutex);
85+ spin_lock_init(&ret_buf->iface_lock);
8586 }
8687 return ret_buf;
8788 }
@@ -102,6 +103,7 @@ sesInfoFree(struct cifs_ses *buf_to_free) · 14 unmodified lines
102103 kfree(buf_to_free->user_name);
103104 kfree(buf_to_free->domainName);
104105 kzfree(buf_to_free->auth_key.response);
106+ kfree(buf_to_free->iface_list);
105107 kzfree(buf_to_free);
106108 }
107109
@@ -117,8 +119,9 @@ tconInfoAlloc(void) · 9 unmodified lines
117119 INIT_LIST_HEAD(&ret_buf->openFileList);
118120 INIT_LIST_HEAD(&ret_buf->tcon_list);
119121 spin_lock_init(&ret_buf->open_file_lock);
120− mutex_init(&ret_buf->prfid_mutex);
121− ret_buf->prfid = kzalloc(sizeof(struct cifs_fid), GFP_KERNEL);
122+ mutex_init(&ret_buf->crfid.fid_mutex);
123+ ret_buf->crfid.fid = kzalloc(sizeof(struct cifs_fid),
124+ GFP_KERNEL);
122125 #ifdef CONFIG_CIFS_STATS
123126 spin_lock_init(&ret_buf->stat_lock);
124127 #endif
@@ -136,7 +139,7 @@ tconInfoFree(struct cifs_tcon *buf_to_free) · 11 unmodified lines
136139 atomic_dec(&tconInfoAllocCount);
137140 kfree(buf_to_free->nativeFileSystem);
138141 kzfree(buf_to_free->password);
139− kfree(buf_to_free->prfid);
142+ kfree(buf_to_free->crfid.fid);
140143 kfree(buf_to_free);
141144 }
142145
fs/cifs/smb2misc.c+17−2
@@ -454,7 +454,8 @@ cifs_convert_path_to_utf16(const char *from, struct cifs_sb_info *cifs_sb) · 453 unmodified lines
454454 #ifdef CONFIG_CIFS_SMB311
455455 /* SMB311 POSIX extensions paths do not include leading slash */
456456 else if (cifs_sb_master_tlink(cifs_sb) &&
457− cifs_sb_master_tcon(cifs_sb)->posix_extensions) {
457+ cifs_sb_master_tcon(cifs_sb)->posix_extensions &&
458+ (from[0] == '/')) {
458459 start_of_path = from + 1;
459460 }
460461 #endif /* 311 */
@@ -492,10 +493,11 @@ cifs_ses_oplock_break(struct work_struct *work) · 31 unmodified lines
492493 {
493494 struct smb2_lease_break_work *lw = container_of(work,
494495 struct smb2_lease_break_work, lease_break);
495− int rc;
496+ int rc = 0;
496497
497498 rc = SMB2_lease_break(0, tlink_tcon(lw->tlink), lw->lease_key,
498499 lw->lease_state);
500+
499501 cifs_dbg(FYI, "Lease release rc %d\n", rc);
500502 cifs_put_tlink(lw->tlink);
501503 kfree(lw);
@@ -561,6 +563,7 @@ smb2_tcon_has_lease(struct cifs_tcon *tcon, struct smb2_lease_break *rsp, · 59 unmodified lines
561563
562564 open->oplock = lease_state;
563565 }
566+
564567 return found;
565568 }
566569
@@ -603,6 +606,18 @@ smb2_is_valid_lease_break(char *buffer) · 36 unmodified lines
603606 return true;
604607 }
605608 spin_unlock(&tcon->open_file_lock);
609+
610+ if (tcon->crfid.is_valid &&
611+ !memcmp(rsp->LeaseKey,
612+ tcon->crfid.fid->lease_key,
613+ SMB2_LEASE_KEY_SIZE)) {
614+ INIT_WORK(&tcon->crfid.lease_break,
615+ smb2_cached_lease_break);
616+ queue_work(cifsiod_wq,
617+ &tcon->crfid.lease_break);
618+ spin_unlock(&cifs_tcp_ses_lock);
619+ return true;
620+ }
606621 }
607622 }
608623 }
fs/cifs/smb2ops.c+210−67
@@ -294,34 +294,191 @@ smb2_negotiate_rsize(struct cifs_tcon *tcon, struct smb_vol *volume_info) · 293 unmodified lines
294294 return rsize;
295295 }
296296
297−#ifdef CONFIG_CIFS_STATS2
297+
298+static int
299+parse_server_interfaces(struct network_interface_info_ioctl_rsp *buf,
300+ size_t buf_len,
301+ struct cifs_server_iface **iface_list,
302+ size_t *iface_count)
303+{
304+ struct network_interface_info_ioctl_rsp *p;
305+ struct sockaddr_in *addr4;
306+ struct sockaddr_in6 *addr6;
307+ struct iface_info_ipv4 *p4;
308+ struct iface_info_ipv6 *p6;
309+ struct cifs_server_iface *info;
310+ ssize_t bytes_left;
311+ size_t next = 0;
312+ int nb_iface = 0;
313+ int rc = 0;
314+
315+ *iface_list = NULL;
316+ *iface_count = 0;
317+
318+ /*
319+ * Fist pass: count and sanity check
320+ */
321+
322+ bytes_left = buf_len;
323+ p = buf;
324+ while (bytes_left >= sizeof(*p)) {
325+ nb_iface++;
326+ next = le32_to_cpu(p->Next);
327+ if (!next) {
328+ bytes_left -= sizeof(*p);
329+ break;
330+ }
331+ p = (struct network_interface_info_ioctl_rsp *)((u8 *)p+next);
332+ bytes_left -= next;
333+ }
334+
335+ if (!nb_iface) {
336+ cifs_dbg(VFS, "%s: malformed interface info\n", __func__);
337+ rc = -EINVAL;
338+ goto out;
339+ }
340+
341+ if (bytes_left || p->Next)
342+ cifs_dbg(VFS, "%s: incomplete interface info\n", __func__);
343+
344+
345+ /*
346+ * Second pass: extract info to internal structure
347+ */
348+
349+ *iface_list = kcalloc(nb_iface, sizeof(**iface_list), GFP_KERNEL);
350+ if (!*iface_list) {
351+ rc = -ENOMEM;
352+ goto out;
353+ }
354+
355+ info = *iface_list;
356+ bytes_left = buf_len;
357+ p = buf;
358+ while (bytes_left >= sizeof(*p)) {
359+ info->speed = le64_to_cpu(p->LinkSpeed);
360+ info->rdma_capable = le32_to_cpu(p->Capability & RDMA_CAPABLE);
361+ info->rss_capable = le32_to_cpu(p->Capability & RSS_CAPABLE);
362+
363+ cifs_dbg(FYI, "%s: adding iface %zu\n", __func__, *iface_count);
364+ cifs_dbg(FYI, "%s: speed %zu bps\n", __func__, info->speed);
365+ cifs_dbg(FYI, "%s: capabilities 0x%08x\n", __func__,
366+ le32_to_cpu(p->Capability));
367+
368+ switch (p->Family) {
369+ /*
370+ * The kernel and wire socket structures have the same
371+ * layout and use network byte order but make the
372+ * conversion explicit in case either one changes.
373+ */
374+ case INTERNETWORK:
375+ addr4 = (struct sockaddr_in *)&info->sockaddr;
376+ p4 = (struct iface_info_ipv4 *)p->Buffer;
377+ addr4->sin_family = AF_INET;
378+ memcpy(&addr4->sin_addr, &p4->IPv4Address, 4);
379+
380+ /* [MS-SMB2] 2.2.32.5.1.1 Clients MUST ignore these */
381+ addr4->sin_port = cpu_to_be16(CIFS_PORT);
382+
383+ cifs_dbg(FYI, "%s: ipv4 %pI4\n", __func__,
384+ &addr4->sin_addr);
385+ break;
386+ case INTERNETWORKV6:
387+ addr6 = (struct sockaddr_in6 *)&info->sockaddr;
388+ p6 = (struct iface_info_ipv6 *)p->Buffer;
389+ addr6->sin6_family = AF_INET6;
390+ memcpy(&addr6->sin6_addr, &p6->IPv6Address, 16);
391+
392+ /* [MS-SMB2] 2.2.32.5.1.2 Clients MUST ignore these */
393+ addr6->sin6_flowinfo = 0;
394+ addr6->sin6_scope_id = 0;
395+ addr6->sin6_port = cpu_to_be16(CIFS_PORT);
396+
397+ cifs_dbg(FYI, "%s: ipv6 %pI6\n", __func__,
398+ &addr6->sin6_addr);
399+ break;
400+ default:
401+ cifs_dbg(VFS,
402+ "%s: skipping unsupported socket family\n",
403+ __func__);
404+ goto next_iface;
405+ }
406+
407+ (*iface_count)++;
408+ info++;
409+next_iface:
410+ next = le32_to_cpu(p->Next);
411+ if (!next)
412+ break;
413+ p = (struct network_interface_info_ioctl_rsp *)((u8 *)p+next);
414+ bytes_left -= next;
415+ }
416+
417+ if (!*iface_count) {
418+ rc = -EINVAL;
419+ goto out;
420+ }
421+
422+out:
423+ if (rc) {
424+ kfree(*iface_list);
425+ *iface_count = 0;
426+ *iface_list = NULL;
427+ }
428+ return rc;
429+}
430+
431+
298432 static int
299433 SMB3_request_interfaces(const unsigned int xid, struct cifs_tcon *tcon)
300434 {
301435 int rc;
302436 unsigned int ret_data_len = 0;
303− struct network_interface_info_ioctl_rsp *out_buf;
437+ struct network_interface_info_ioctl_rsp *out_buf = NULL;
438+ struct cifs_server_iface *iface_list;
439+ size_t iface_count;
440+ struct cifs_ses *ses = tcon->ses;
304441
305442 rc = SMB2_ioctl(xid, tcon, NO_FILE_ID, NO_FILE_ID,
306443 FSCTL_QUERY_NETWORK_INTERFACE_INFO, true /* is_fsctl */,
307444 NULL /* no data input */, 0 /* no data input */,
308445 (char **)&out_buf, &ret_data_len);
309− if (rc != 0)
446+ if (rc != 0) {
310447 cifs_dbg(VFS, "error %d on ioctl to get interface list\n", rc);
311− else if (ret_data_len < sizeof(struct network_interface_info_ioctl_rsp)) {
312− cifs_dbg(VFS, "server returned bad net interface info buf\n");
313− rc = -EINVAL;
314− } else {
315− /* Dump info on first interface */
316− cifs_dbg(FYI, "Adapter Capability 0x%x\t",
317− le32_to_cpu(out_buf->Capability));
318− cifs_dbg(FYI, "Link Speed %lld\n",
319− le64_to_cpu(out_buf->LinkSpeed));
448+ goto out;
320449 }
450+
451+ rc = parse_server_interfaces(out_buf, ret_data_len,
452+ &iface_list, &iface_count);
453+ if (rc)
454+ goto out;
455+
456+ spin_lock(&ses->iface_lock);
457+ kfree(ses->iface_list);
458+ ses->iface_list = iface_list;
459+ ses->iface_count = iface_count;
460+ ses->iface_last_update = jiffies;
461+ spin_unlock(&ses->iface_lock);
462+
463+out:
321464 kfree(out_buf);
322465 return rc;
323466 }
324−#endif /* STATS2 */
467+
468+void
469+smb2_cached_lease_break(struct work_struct *work)
470+{
471+ struct cached_fid *cfid = container_of(work,
472+ struct cached_fid, lease_break);
473+ mutex_lock(&cfid->fid_mutex);
474+ if (cfid->is_valid) {
475+ cifs_dbg(FYI, "clear cached root file handle\n");
476+ SMB2_close(0, cfid->tcon, cfid->fid->persistent_fid,
477+ cfid->fid->volatile_fid);
478+ cfid->is_valid = false;
479+ }
480+ mutex_unlock(&cfid->fid_mutex);
481+}
325482
326483 /*
327484 * Open the directory at the root of a share
@@ -331,13 +488,13 @@ int open_shroot(unsigned int xid, struct cifs_tcon *tcon, struct cifs_fid *pfid) · 3 unmodified lines
331488 struct cifs_open_parms oparams;
332489 int rc;
333490 __le16 srch_path = 0; /* Null - since an open of top of share */
334− u8 oplock = SMB2_OPLOCK_LEVEL_NONE;
491+ u8 oplock = SMB2_OPLOCK_LEVEL_II;
335492
336− mutex_lock(&tcon->prfid_mutex);
337− if (tcon->valid_root_fid) {
493+ mutex_lock(&tcon->crfid.fid_mutex);
494+ if (tcon->crfid.is_valid) {
338495 cifs_dbg(FYI, "found a cached root file handle\n");
339− memcpy(pfid, tcon->prfid, sizeof(struct cifs_fid));
340− mutex_unlock(&tcon->prfid_mutex);
496+ memcpy(pfid, tcon->crfid.fid, sizeof(struct cifs_fid));
497+ mutex_unlock(&tcon->crfid.fid_mutex);
341498 return 0;
342499 }
343500
@@ -350,10 +507,11 @@ int open_shroot(unsigned int xid, struct cifs_tcon *tcon, struct cifs_fid *pfid) · 6 unmodified lines
350507
351508 rc = SMB2_open(xid, &oparams, &srch_path, &oplock, NULL, NULL, NULL);
352509 if (rc == 0) {
353− memcpy(tcon->prfid, pfid, sizeof(struct cifs_fid));
354− tcon->valid_root_fid = true;
510+ memcpy(tcon->crfid.fid, pfid, sizeof(struct cifs_fid));
511+ tcon->crfid.tcon = tcon;
512+ tcon->crfid.is_valid = true;
355513 }
356− mutex_unlock(&tcon->prfid_mutex);
514+ mutex_unlock(&tcon->crfid.fid_mutex);
357515 return rc;
358516 }
359517
@@ -383,9 +541,7 @@ smb3_qfs_tcon(const unsigned int xid, struct cifs_tcon *tcon) · 23 unmodified lines
383541 if (rc)
384542 return;
385543
386−#ifdef CONFIG_CIFS_STATS2
387544 SMB3_request_interfaces(xid, tcon);
388−#endif /* STATS2 */
389545
390546 SMB2_QFS_attr(xid, tcon, fid.persistent_fid, fid.volatile_fid,
391547 FS_ATTRIBUTE_INFORMATION);
@@ -436,7 +592,7 @@ smb2_is_path_accessible(const unsigned int xid, struct cifs_tcon *tcon, · 44 unmodified lines
436592 struct cifs_open_parms oparms;
437593 struct cifs_fid fid;
438594
439− if ((*full_path == 0) && tcon->valid_root_fid)
595+ if ((*full_path == 0) && tcon->crfid.is_valid)
440596 return 0;
441597
442598 utf16_path = cifs_convert_path_to_utf16(full_path, cifs_sb);
@@ -2151,7 +2307,7 @@ fill_transform_hdr(struct smb2_transform_hdr *tr_hdr, unsigned int orig_len, · 1708 unmodified lines
21512307 struct smb_rqst *old_rq)
21522308 {
21532309 struct smb2_sync_hdr *shdr =
2154− (struct smb2_sync_hdr *)old_rq->rq_iov[1].iov_base;
2310+ (struct smb2_sync_hdr *)old_rq->rq_iov[0].iov_base;
21552311
21562312 memset(tr_hdr, 0, sizeof(struct smb2_transform_hdr));
21572313 tr_hdr->ProtocolId = SMB2_TRANSFORM_PROTO_NUM;
@@ -2171,14 +2327,13 @@ static inline void smb2_sg_set_buf(struct scatterlist *sg, const void *buf, · 13 unmodified lines
21712327 }
21722328
21732329 /* Assumes:
2174− * rqst->rq_iov[0] is rfc1002 length
2175− * rqst->rq_iov[1] is tranform header
2176− * rqst->rq_iov[2+] data to be encrypted/decrypted
2330+ * rqst->rq_iov[0] is transform header
2331+ * rqst->rq_iov[1+] data to be encrypted/decrypted
21772332 */
21782333 static struct scatterlist *
21792334 init_sg(struct smb_rqst *rqst, u8 *sign)
21802335 {
2181− unsigned int sg_len = rqst->rq_nvec + rqst->rq_npages;
2336+ unsigned int sg_len = rqst->rq_nvec + rqst->rq_npages + 1;
21822337 unsigned int assoc_data_len = sizeof(struct smb2_transform_hdr) - 20;
21832338 struct scatterlist *sg;
21842339 unsigned int i;
@@ -2189,10 +2344,10 @@ init_sg(struct smb_rqst *rqst, u8 *sign) · 4 unmodified lines
21892344 return NULL;
21902345
21912346 sg_init_table(sg, sg_len);
2192− smb2_sg_set_buf(&sg[0], rqst->rq_iov[1].iov_base + 20, assoc_data_len);
2193− for (i = 1; i < rqst->rq_nvec - 1; i++)
2194− smb2_sg_set_buf(&sg[i], rqst->rq_iov[i+1].iov_base,
2195− rqst->rq_iov[i+1].iov_len);
2347+ smb2_sg_set_buf(&sg[0], rqst->rq_iov[0].iov_base + 20, assoc_data_len);
2348+ for (i = 1; i < rqst->rq_nvec; i++)
2349+ smb2_sg_set_buf(&sg[i], rqst->rq_iov[i].iov_base,
2350+ rqst->rq_iov[i].iov_len);
21962351 for (j = 0; i < sg_len - 1; i++, j++) {
21972352 unsigned int len, offset;
21982353
@@ -2224,18 +2379,17 @@ smb2_get_enc_key(struct TCP_Server_Info *server, __u64 ses_id, int enc, u8 *key) · 25 unmodified lines
22242379 return 1;
22252380 }
22262381 /*
2227− * Encrypt or decrypt @rqst message. @rqst has the following format:
2228− * iov[0] - rfc1002 length
2229− * iov[1] - transform header (associate data),
2230− * iov[2-N] and pages - data to encrypt.
2231− * On success return encrypted data in iov[2-N] and pages, leave iov[0-1]
2382+ * Encrypt or decrypt @rqst message. @rqst[0] has the following format:
2383+ * iov[0] - transform header (associate data),
2384+ * iov[1-N] - SMB2 header and pages - data to encrypt.
2385+ * On success return encrypted data in iov[1-N] and pages, leave iov[0]
22322386 * untouched.
22332387 */
22342388 static int
22352389 crypt_message(struct TCP_Server_Info *server, struct smb_rqst *rqst, int enc)
22362390 {
22372391 struct smb2_transform_hdr *tr_hdr =
2238− (struct smb2_transform_hdr *)rqst->rq_iov[1].iov_base;
2392+ (struct smb2_transform_hdr *)rqst->rq_iov[0].iov_base;
22392393 unsigned int assoc_data_len = sizeof(struct smb2_transform_hdr) - 20;
22402394 int rc = 0;
22412395 struct scatterlist *sg;
@@ -2323,10 +2477,6 @@ free_req: · 81 unmodified lines
23232477 return rc;
23242478 }
23252479
2326−/*
2327− * This is called from smb_send_rqst. At this point we have the rfc1002
2328− * header as the first element in the vector.
2329− */
23302480 static int
23312481 smb3_init_transform_rq(struct TCP_Server_Info *server, struct smb_rqst *new_rq,
23322482 struct smb_rqst *old_rq)
@@ -2335,7 +2485,7 @@ smb3_init_transform_rq(struct TCP_Server_Info *server, struct smb_rqst *new_rq, · 2 unmodified lines
23352485 struct page **pages;
23362486 struct smb2_transform_hdr *tr_hdr;
23372487 unsigned int npages = old_rq->rq_npages;
2338− unsigned int orig_len = get_rfc1002_length(old_rq->rq_iov[0].iov_base);
2488+ unsigned int orig_len;
23392489 int i;
23402490 int rc = -ENOMEM;
23412491
@@ -2355,18 +2505,14 @@ smb3_init_transform_rq(struct TCP_Server_Info *server, struct smb_rqst *new_rq, · 13 unmodified lines
23552505 goto err_free_pages;
23562506 }
23572507
2358− /* Make space for one extra iov to hold the transform header */
23592508 iov = kmalloc_array(old_rq->rq_nvec + 1, sizeof(struct kvec),
23602509 GFP_KERNEL);
23612510 if (!iov)
23622511 goto err_free_pages;
23632512
2364− /* copy all iovs from the old except the 1st one (rfc1002 length) */
2365− memcpy(&iov[2], &old_rq->rq_iov[1],
2366− sizeof(struct kvec) * (old_rq->rq_nvec - 1));
2367− /* copy the rfc1002 iov */
2368− iov[0].iov_base = old_rq->rq_iov[0].iov_base;
2369− iov[0].iov_len = old_rq->rq_iov[0].iov_len;
2513+ /* copy all iovs from the old */
2514+ memcpy(&iov[1], &old_rq->rq_iov[0],
2515+ sizeof(struct kvec) * old_rq->rq_nvec);
23702516
23712517 new_rq->rq_iov = iov;
23722518 new_rq->rq_nvec = old_rq->rq_nvec + 1;
@@ -2375,14 +2521,12 @@ smb3_init_transform_rq(struct TCP_Server_Info *server, struct smb_rqst *new_rq, · 2 unmodified lines
23752521 if (!tr_hdr)
23762522 goto err_free_iov;
23772523
2524+ orig_len = smb2_rqst_len(old_rq, false);
2525+
23782526 /* fill the 2nd iov with a transform header */
23792527 fill_transform_hdr(tr_hdr, orig_len, old_rq);
2380− new_rq->rq_iov[1].iov_base = tr_hdr;
2381− new_rq->rq_iov[1].iov_len = sizeof(struct smb2_transform_hdr);
2382−
2383− /* Update rfc1002 header */
2384− inc_rfc1001_len(new_rq->rq_iov[0].iov_base,
2385− sizeof(struct smb2_transform_hdr));
2528+ new_rq->rq_iov[0].iov_base = tr_hdr;
2529+ new_rq->rq_iov[0].iov_len = sizeof(struct smb2_transform_hdr);
23862530
23872531 /* copy pages form the old */
23882532 for (i = 0; i < npages; i++) {
@@ -2426,7 +2570,7 @@ smb3_free_transform_rq(struct smb_rqst *rqst) · 37 unmodified lines
24262570 put_page(rqst->rq_pages[i]);
24272571 kfree(rqst->rq_pages);
24282572 /* free transform header */
2429− kfree(rqst->rq_iov[1].iov_base);
2573+ kfree(rqst->rq_iov[0].iov_base);
24302574 kfree(rqst->rq_iov);
24312575 }
24322576
@@ -2443,19 +2587,17 @@ decrypt_raw_data(struct TCP_Server_Info *server, char *buf, · 10 unmodified lines
24432587 unsigned int buf_data_size, struct page **pages,
24442588 unsigned int npages, unsigned int page_data_size)
24452589 {
2446− struct kvec iov[3];
2590+ struct kvec iov[2];
24472591 struct smb_rqst rqst = {NULL};
24482592 int rc;
24492593
2450− iov[0].iov_base = NULL;
2451− iov[0].iov_len = 0;
2452− iov[1].iov_base = buf;
2453− iov[1].iov_len = sizeof(struct smb2_transform_hdr);
2454− iov[2].iov_base = buf + sizeof(struct smb2_transform_hdr);
2455− iov[2].iov_len = buf_data_size;
2594+ iov[0].iov_base = buf;
2595+ iov[0].iov_len = sizeof(struct smb2_transform_hdr);
2596+ iov[1].iov_base = buf + sizeof(struct smb2_transform_hdr);
2597+ iov[1].iov_len = buf_data_size;
24562598
24572599 rqst.rq_iov = iov;
2458− rqst.rq_nvec = 3;
2600+ rqst.rq_nvec = 2;
24592601 rqst.rq_pages = pages;
24602602 rqst.rq_npages = npages;
24612603 rqst.rq_pagesz = PAGE_SIZE;
@@ -2467,7 +2609,7 @@ decrypt_raw_data(struct TCP_Server_Info *server, char *buf, · 5 unmodified lines
24672609 if (rc)
24682610 return rc;
24692611
2470− memmove(buf, iov[2].iov_base, buf_data_size);
2612+ memmove(buf, iov[1].iov_base, buf_data_size);
24712613
24722614 server->total_read = buf_data_size + page_data_size;
24732615
@@ -3170,6 +3312,7 @@ struct smb_version_operations smb311_operations = { · 696 unmodified lines
31703312 .set_compression = smb2_set_compression,
31713313 .mkdir = smb2_mkdir,
31723314 .mkdir_setinfo = smb2_mkdir_setinfo,
3315+ .posix_mkdir = smb311_posix_mkdir,
31733316 .rmdir = smb2_rmdir,
31743317 .unlink = smb2_unlink,
31753318 .rename = smb2_rename_path,
fs/cifs/smb2pdu.c+284−49
@@ -602,6 +602,7 @@ static void assemble_neg_contexts(struct smb2_negotiate_req *req, · 601 unmodified lines
602602 int
603603 SMB2_negotiate(const unsigned int xid, struct cifs_ses *ses)
604604 {
605+ struct smb_rqst rqst;
605606 struct smb2_negotiate_req *req;
606607 struct smb2_negotiate_rsp *rsp;
607608 struct kvec iov[1];
@@ -673,7 +674,11 @@ SMB2_negotiate(const unsigned int xid, struct cifs_ses *ses) · 65 unmodified lines
673674 iov[0].iov_base = (char *)req;
674675 iov[0].iov_len = total_len;
675676
676− rc = smb2_send_recv(xid, ses, iov, 1, &resp_buftype, flags, &rsp_iov);
677+ memset(&rqst, 0, sizeof(struct smb_rqst));
678+ rqst.rq_iov = iov;
679+ rqst.rq_nvec = 1;
680+
681+ rc = cifs_send_recv(xid, ses, &rqst, &resp_buftype, flags, &rsp_iov);
677682 cifs_small_buf_release(req);
678683 rsp = (struct smb2_negotiate_rsp *)rsp_iov.iov_base;
679684 /*
@@ -990,8 +995,9 @@ SMB2_sess_alloc_buffer(struct SMB2_sess_data *sess_data) · 310 unmodified lines
990995 req->PreviousSessionId = sess_data->previous_session;
991996
992997 req->Flags = 0; /* MBZ */
993− /* to enable echos and oplocks */
994− req->sync_hdr.CreditRequest = cpu_to_le16(3);
998+
999+ /* enough to enable echos and oplocks and one max size write */
1000+ req->sync_hdr.CreditRequest = cpu_to_le16(130);
9951001
9961002 /* only one of SMB2 signing flags may be set in SMB2 request */
9971003 if (server->sign)
@@ -1027,6 +1033,7 @@ static int · 29 unmodified lines
10271033 SMB2_sess_sendreceive(struct SMB2_sess_data *sess_data)
10281034 {
10291035 int rc;
1036+ struct smb_rqst rqst;
10301037 struct smb2_sess_setup_req *req = sess_data->iov[0].iov_base;
10311038 struct kvec rsp_iov = { NULL, 0 };
10321039
@@ -1035,10 +1042,13 @@ SMB2_sess_sendreceive(struct SMB2_sess_data *sess_data) · 2 unmodified lines
10351042 cpu_to_le16(sizeof(struct smb2_sess_setup_req) - 1 /* pad */);
10361043 req->SecurityBufferLength = cpu_to_le16(sess_data->iov[1].iov_len);
10371044
1038− /* BB add code to build os and lm fields */
1045+ memset(&rqst, 0, sizeof(struct smb_rqst));
1046+ rqst.rq_iov = sess_data->iov;
1047+ rqst.rq_nvec = 2;
10391048
1040− rc = smb2_send_recv(sess_data->xid, sess_data->ses,
1041− sess_data->iov, 2,
1049+ /* BB add code to build os and lm fields */
1050+ rc = cifs_send_recv(sess_data->xid, sess_data->ses,
1051+ &rqst,
10421052 &sess_data->buf0_type,
10431053 CIFS_LOG_ERROR | CIFS_NEG_OP, &rsp_iov);
10441054 cifs_small_buf_release(sess_data->iov[0].iov_base);
@@ -1376,6 +1386,7 @@ out: · 331 unmodified lines
13761386 int
13771387 SMB2_logoff(const unsigned int xid, struct cifs_ses *ses)
13781388 {
1389+ struct smb_rqst rqst;
13791390 struct smb2_logoff_req *req; /* response is also trivial struct */
13801391 int rc = 0;
13811392 struct TCP_Server_Info *server;
@@ -1413,7 +1424,11 @@ SMB2_logoff(const unsigned int xid, struct cifs_ses *ses) · 31 unmodified lines
14131424 iov[0].iov_base = (char *)req;
14141425 iov[0].iov_len = total_len;
14151426
1416− rc = smb2_send_recv(xid, ses, iov, 1, &resp_buf_type, flags, &rsp_iov);
1427+ memset(&rqst, 0, sizeof(struct smb_rqst));
1428+ rqst.rq_iov = iov;
1429+ rqst.rq_nvec = 1;
1430+
1431+ rc = cifs_send_recv(xid, ses, &rqst, &resp_buf_type, flags, &rsp_iov);
14171432 cifs_small_buf_release(req);
14181433 /*
14191434 * No tcon so can't do
@@ -1443,6 +1458,7 @@ int · 23 unmodified lines
14431458 SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree,
14441459 struct cifs_tcon *tcon, const struct nls_table *cp)
14451460 {
1461+ struct smb_rqst rqst;
14461462 struct smb2_tree_connect_req *req;
14471463 struct smb2_tree_connect_rsp *rsp = NULL;
14481464 struct kvec iov[2];
@@ -1499,7 +1515,11 @@ SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree, · 50 unmodified lines
14991515 !smb3_encryption_required(tcon))
15001516 req->sync_hdr.Flags |= SMB2_FLAGS_SIGNED;
15011517
1502− rc = smb2_send_recv(xid, ses, iov, 2, &resp_buftype, flags, &rsp_iov);
1518+ memset(&rqst, 0, sizeof(struct smb_rqst));
1519+ rqst.rq_iov = iov;
1520+ rqst.rq_nvec = 2;
1521+
1522+ rc = cifs_send_recv(xid, ses, &rqst, &resp_buftype, flags, &rsp_iov);
15031523 cifs_small_buf_release(req);
15041524 rsp = (struct smb2_tree_connect_rsp *)rsp_iov.iov_base;
15051525
@@ -1563,6 +1583,7 @@ tcon_error_exit: · 57 unmodified lines
15631583 int
15641584 SMB2_tdis(const unsigned int xid, struct cifs_tcon *tcon)
15651585 {
1586+ struct smb_rqst rqst;
15661587 struct smb2_tree_disconnect_req *req; /* response is trivial */
15671588 int rc = 0;
15681589 struct cifs_ses *ses = tcon->ses;
@@ -1593,7 +1614,11 @@ SMB2_tdis(const unsigned int xid, struct cifs_tcon *tcon) · 24 unmodified lines
15931614 iov[0].iov_base = (char *)req;
15941615 iov[0].iov_len = total_len;
15951616
1596− rc = smb2_send_recv(xid, ses, iov, 1, &resp_buf_type, flags, &rsp_iov);
1617+ memset(&rqst, 0, sizeof(struct smb_rqst));
1618+ rqst.rq_iov = iov;
1619+ rqst.rq_nvec = 1;
1620+
1621+ rc = cifs_send_recv(xid, ses, &rqst, &resp_buf_type, flags, &rsp_iov);
15971622 cifs_small_buf_release(req);
15981623 if (rc)
15991624 cifs_stats_fail_inc(tcon, SMB2_TREE_DISCONNECT_HE);
@@ -1886,11 +1911,165 @@ alloc_path_with_tree_prefix(__le16 **out_path, int *out_size, int *out_len, · 286 unmodified lines
18861911 return 0;
18871912 }
18881913
1914+#ifdef CONFIG_CIFS_SMB311
1915+int smb311_posix_mkdir(const unsigned int xid, struct inode *inode,
1916+ umode_t mode, struct cifs_tcon *tcon,
1917+ const char *full_path,
1918+ struct cifs_sb_info *cifs_sb)
1919+{
1920+ struct smb_rqst rqst;
1921+ struct smb2_create_req *req;
1922+ struct smb2_create_rsp *rsp;
1923+ struct TCP_Server_Info *server;
1924+ struct cifs_ses *ses = tcon->ses;
1925+ struct kvec iov[3]; /* make sure at least one for each open context */
1926+ struct kvec rsp_iov = {NULL, 0};
1927+ int resp_buftype;
1928+ int uni_path_len;
1929+ __le16 *copy_path = NULL;
1930+ int copy_size;
1931+ int rc = 0;
1932+ unsigned int n_iov = 2;
1933+ __u32 file_attributes = 0;
1934+ char *pc_buf = NULL;
1935+ int flags = 0;
1936+ unsigned int total_len;
1937+ __le16 *path = cifs_convert_path_to_utf16(full_path, cifs_sb);
1938+
1939+ if (!path)
1940+ return -ENOMEM;
1941+
1942+ cifs_dbg(FYI, "mkdir\n");
1943+
1944+ if (ses && (ses->server))
1945+ server = ses->server;
1946+ else
1947+ return -EIO;
1948+
1949+ rc = smb2_plain_req_init(SMB2_CREATE, tcon, (void **) &req, &total_len);
1950+
1951+ if (rc)
1952+ return rc;
1953+
1954+ if (smb3_encryption_required(tcon))
1955+ flags |= CIFS_TRANSFORM_REQ;
1956+
1957+
1958+ req->ImpersonationLevel = IL_IMPERSONATION;
1959+ req->DesiredAccess = cpu_to_le32(FILE_WRITE_ATTRIBUTES);
1960+ /* File attributes ignored on open (used in create though) */
1961+ req->FileAttributes = cpu_to_le32(file_attributes);
1962+ req->ShareAccess = FILE_SHARE_ALL_LE;
1963+ req->CreateDisposition = cpu_to_le32(FILE_CREATE);
1964+ req->CreateOptions = cpu_to_le32(CREATE_NOT_FILE);
1965+
1966+ iov[0].iov_base = (char *)req;
1967+ /* -1 since last byte is buf[0] which is sent below (path) */
1968+ iov[0].iov_len = total_len - 1;
1969+
1970+ req->NameOffset = cpu_to_le16(sizeof(struct smb2_create_req));
1971+
1972+ /* [MS-SMB2] 2.2.13 NameOffset:
1973+ * If SMB2_FLAGS_DFS_OPERATIONS is set in the Flags field of
1974+ * the SMB2 header, the file name includes a prefix that will
1975+ * be processed during DFS name normalization as specified in
1976+ * section 3.3.5.9. Otherwise, the file name is relative to
1977+ * the share that is identified by the TreeId in the SMB2
1978+ * header.
1979+ */
1980+ if (tcon->share_flags & SHI1005_FLAGS_DFS) {
1981+ int name_len;
1982+
1983+ req->sync_hdr.Flags |= SMB2_FLAGS_DFS_OPERATIONS;
1984+ rc = alloc_path_with_tree_prefix(&copy_path, &copy_size,
1985+ &name_len,
1986+ tcon->treeName, path);
1987+ if (rc) {
1988+ cifs_small_buf_release(req);
1989+ return rc;
1990+ }
1991+ req->NameLength = cpu_to_le16(name_len * 2);
1992+ uni_path_len = copy_size;
1993+ path = copy_path;
1994+ } else {
1995+ uni_path_len = (2 * UniStrnlen((wchar_t *)path, PATH_MAX)) + 2;
1996+ /* MUST set path len (NameLength) to 0 opening root of share */
1997+ req->NameLength = cpu_to_le16(uni_path_len - 2);
1998+ if (uni_path_len % 8 != 0) {
1999+ copy_size = roundup(uni_path_len, 8);
2000+ copy_path = kzalloc(copy_size, GFP_KERNEL);
2001+ if (!copy_path) {
2002+ cifs_small_buf_release(req);
2003+ return -ENOMEM;
2004+ }
2005+ memcpy((char *)copy_path, (const char *)path,
2006+ uni_path_len);
2007+ uni_path_len = copy_size;
2008+ path = copy_path;
2009+ }
2010+ }
2011+
2012+ iov[1].iov_len = uni_path_len;
2013+ iov[1].iov_base = path;
2014+ req->RequestedOplockLevel = SMB2_OPLOCK_LEVEL_NONE;
2015+
2016+ if (tcon->posix_extensions) {
2017+ if (n_iov > 2) {
2018+ struct create_context *ccontext =
2019+ (struct create_context *)iov[n_iov-1].iov_base;
2020+ ccontext->Next =
2021+ cpu_to_le32(iov[n_iov-1].iov_len);
2022+ }
2023+
2024+ rc = add_posix_context(iov, &n_iov, mode);
2025+ if (rc) {
2026+ cifs_small_buf_release(req);
2027+ kfree(copy_path);
2028+ return rc;
2029+ }
2030+ pc_buf = iov[n_iov-1].iov_base;
2031+ }
2032+
2033+
2034+ memset(&rqst, 0, sizeof(struct smb_rqst));
2035+ rqst.rq_iov = iov;
2036+ rqst.rq_nvec = n_iov;
2037+
2038+ rc = cifs_send_recv(xid, ses, &rqst, &resp_buftype, flags,
2039+ &rsp_iov);
2040+
2041+ cifs_small_buf_release(req);
2042+ rsp = (struct smb2_create_rsp *)rsp_iov.iov_base;
2043+
2044+ if (rc != 0) {
2045+ cifs_stats_fail_inc(tcon, SMB2_CREATE_HE);
2046+ trace_smb3_posix_mkdir_err(xid, tcon->tid, ses->Suid,
2047+ CREATE_NOT_FILE, FILE_WRITE_ATTRIBUTES, rc);
2048+ goto smb311_mkdir_exit;
2049+ } else
2050+ trace_smb3_posix_mkdir_done(xid, rsp->PersistentFileId, tcon->tid,
2051+ ses->Suid, CREATE_NOT_FILE,
2052+ FILE_WRITE_ATTRIBUTES);
2053+
2054+ SMB2_close(xid, tcon, rsp->PersistentFileId, rsp->VolatileFileId);
2055+
2056+ /* Eventually save off posix specific response info and timestaps */
2057+
2058+smb311_mkdir_exit:
2059+ kfree(copy_path);
2060+ kfree(pc_buf);
2061+ free_rsp_buf(resp_buftype, rsp);
2062+ return rc;
2063+
2064+}
2065+#endif /* SMB311 */
2066+
18892067 int
18902068 SMB2_open(const unsigned int xid, struct cifs_open_parms *oparms, __le16 *path,
18912069 __u8 *oplock, struct smb2_file_all_info *buf,
18922070 struct kvec *err_iov, int *buftype)
18932071 {
2072+ struct smb_rqst rqst;
18942073 struct smb2_create_req *req;
18952074 struct smb2_create_rsp *rsp;
18962075 struct TCP_Server_Info *server;
@@ -2043,7 +2222,11 @@ SMB2_open(const unsigned int xid, struct cifs_open_parms *oparms, __le16 *path, · 146 unmodified lines
20432222 }
20442223 #endif /* SMB311 */
20452224
2046− rc = smb2_send_recv(xid, ses, iov, n_iov, &resp_buftype, flags,
2225+ memset(&rqst, 0, sizeof(struct smb_rqst));
2226+ rqst.rq_iov = iov;
2227+ rqst.rq_nvec = n_iov;
2228+
2229+ rc = cifs_send_recv(xid, ses, &rqst, &resp_buftype, flags,
20472230 &rsp_iov);
20482231 cifs_small_buf_release(req);
20492232 rsp = (struct smb2_create_rsp *)rsp_iov.iov_base;
@@ -2099,6 +2282,7 @@ SMB2_ioctl(const unsigned int xid, struct cifs_tcon *tcon, u64 persistent_fid, · 49 unmodified lines
20992282 char *in_data, u32 indatalen,
21002283 char **out_data, u32 *plen /* returned data len */)
21012284 {
2285+ struct smb_rqst rqst;
21022286 struct smb2_ioctl_req *req;
21032287 struct smb2_ioctl_rsp *rsp;
21042288 struct cifs_ses *ses;
@@ -2189,7 +2373,11 @@ SMB2_ioctl(const unsigned int xid, struct cifs_tcon *tcon, u64 persistent_fid, · 84 unmodified lines
21892373 if (opcode == FSCTL_VALIDATE_NEGOTIATE_INFO)
21902374 req->sync_hdr.Flags |= SMB2_FLAGS_SIGNED;
21912375
2192− rc = smb2_send_recv(xid, ses, iov, n_iov, &resp_buftype, flags,
2376+ memset(&rqst, 0, sizeof(struct smb_rqst));
2377+ rqst.rq_iov = iov;
2378+ rqst.rq_nvec = n_iov;
2379+
2380+ rc = cifs_send_recv(xid, ses, &rqst, &resp_buftype, flags,
21932381 &rsp_iov);
21942382 cifs_small_buf_release(req);
21952383 rsp = (struct smb2_ioctl_rsp *)rsp_iov.iov_base;
@@ -2274,6 +2462,7 @@ int · 78 unmodified lines
22742462 SMB2_close_flags(const unsigned int xid, struct cifs_tcon *tcon,
22752463 u64 persistent_fid, u64 volatile_fid, int flags)
22762464 {
2465+ struct smb_rqst rqst;
22772466 struct smb2_close_req *req;
22782467 struct smb2_close_rsp *rsp;
22792468 struct cifs_ses *ses = tcon->ses;
@@ -2301,7 +2490,11 @@ SMB2_close_flags(const unsigned int xid, struct cifs_tcon *tcon, · 21 unmodified lines
23012490 iov[0].iov_base = (char *)req;
23022491 iov[0].iov_len = total_len;
23032492
2304− rc = smb2_send_recv(xid, ses, iov, 1, &resp_buftype, flags, &rsp_iov);
2493+ memset(&rqst, 0, sizeof(struct smb_rqst));
2494+ rqst.rq_iov = iov;
2495+ rqst.rq_nvec = 1;
2496+
2497+ rc = cifs_send_recv(xid, ses, &rqst, &resp_buftype, flags, &rsp_iov);
23052498 cifs_small_buf_release(req);
23062499 rsp = (struct smb2_close_rsp *)rsp_iov.iov_base;
23072500
@@ -2387,6 +2580,7 @@ query_info(const unsigned int xid, struct cifs_tcon *tcon, · 79 unmodified lines
23872580 u32 additional_info, size_t output_len, size_t min_len, void **data,
23882581 u32 *dlen)
23892582 {
2583+ struct smb_rqst rqst;
23902584 struct smb2_query_info_req *req;
23912585 struct smb2_query_info_rsp *rsp = NULL;
23922586 struct kvec iov[2];
@@ -2427,7 +2621,11 @@ query_info(const unsigned int xid, struct cifs_tcon *tcon, · 34 unmodified lines
24272621 /* 1 for Buffer */
24282622 iov[0].iov_len = total_len - 1;
24292623
2430− rc = smb2_send_recv(xid, ses, iov, 1, &resp_buftype, flags, &rsp_iov);
2624+ memset(&rqst, 0, sizeof(struct smb_rqst));
2625+ rqst.rq_iov = iov;
2626+ rqst.rq_nvec = 1;
2627+
2628+ rc = cifs_send_recv(xid, ses, &rqst, &resp_buftype, flags, &rsp_iov);
24312629 cifs_small_buf_release(req);
24322630 rsp = (struct smb2_query_info_rsp *)rsp_iov.iov_base;
24332631
@@ -2594,11 +2792,10 @@ SMB2_echo(struct TCP_Server_Info *server) · 160 unmodified lines
25942792 {
25952793 struct smb2_echo_req *req;
25962794 int rc = 0;
2597− struct kvec iov[2];
2795+ struct kvec iov[1];
25982796 struct smb_rqst rqst = { .rq_iov = iov,
2599− .rq_nvec = 2 };
2797+ .rq_nvec = 1 };
26002798 unsigned int total_len;
2601− __be32 rfc1002_marker;
26022799
26032800 cifs_dbg(FYI, "In echo request\n");
26042801
@@ -2614,11 +2811,8 @@ SMB2_echo(struct TCP_Server_Info *server) · 9 unmodified lines
26142811
26152812 req->sync_hdr.CreditRequest = cpu_to_le16(1);
26162813
2617− iov[0].iov_len = 4;
2618− rfc1002_marker = cpu_to_be32(total_len);
2619− iov[0].iov_base = &rfc1002_marker;
2620− iov[1].iov_len = total_len;
2621− iov[1].iov_base = (char *)req;
2814+ iov[0].iov_len = total_len;
2815+ iov[0].iov_base = (char *)req;
26222816
26232817 rc = cifs_call_async(server, &rqst, NULL, smb2_echo_callback, NULL,
26242818 server, CIFS_ECHO_OP);
@@ -2633,6 +2827,7 @@ int · 8 unmodified lines
26332827 SMB2_flush(const unsigned int xid, struct cifs_tcon *tcon, u64 persistent_fid,
26342828 u64 volatile_fid)
26352829 {
2830+ struct smb_rqst rqst;
26362831 struct smb2_flush_req *req;
26372832 struct cifs_ses *ses = tcon->ses;
26382833 struct kvec iov[1];
@@ -2660,7 +2855,11 @@ SMB2_flush(const unsigned int xid, struct cifs_tcon *tcon, u64 persistent_fid, · 21 unmodified lines
26602855 iov[0].iov_base = (char *)req;
26612856 iov[0].iov_len = total_len;
26622857
2663− rc = smb2_send_recv(xid, ses, iov, 1, &resp_buftype, flags, &rsp_iov);
2858+ memset(&rqst, 0, sizeof(struct smb_rqst));
2859+ rqst.rq_iov = iov;
2860+ rqst.rq_nvec = 1;
2861+
2862+ rc = cifs_send_recv(xid, ses, &rqst, &resp_buftype, flags, &rsp_iov);
26642863 cifs_small_buf_release(req);
26652864
26662865 if (rc != 0) {
@@ -2848,10 +3047,9 @@ smb2_async_readv(struct cifs_readdata *rdata) · 181 unmodified lines
28483047 struct smb2_sync_hdr *shdr;
28493048 struct cifs_io_parms io_parms;
28503049 struct smb_rqst rqst = { .rq_iov = rdata->iov,
2851− .rq_nvec = 2 };
3050+ .rq_nvec = 1 };
28523051 struct TCP_Server_Info *server;
28533052 unsigned int total_len;
2854− __be32 req_len;
28553053
28563054 cifs_dbg(FYI, "%s: offset=%llu bytes=%u\n",
28573055 __func__, rdata->offset, rdata->bytes);
@@ -2882,12 +3080,8 @@ smb2_async_readv(struct cifs_readdata *rdata) · 24 unmodified lines
28823080 if (smb3_encryption_required(io_parms.tcon))
28833081 flags |= CIFS_TRANSFORM_REQ;
28843082
2885− req_len = cpu_to_be32(total_len);
2886−
2887− rdata->iov[0].iov_base = &req_len;
2888− rdata->iov[0].iov_len = sizeof(__be32);
2889− rdata->iov[1].iov_base = buf;
2890− rdata->iov[1].iov_len = total_len;
3083+ rdata->iov[0].iov_base = buf;
3084+ rdata->iov[0].iov_len = total_len;
28913085
28923086 shdr = (struct smb2_sync_hdr *)buf;
28933087
@@ -2926,6 +3120,7 @@ int · 32 unmodified lines
29263120 SMB2_read(const unsigned int xid, struct cifs_io_parms *io_parms,
29273121 unsigned int *nbytes, char **buf, int *buf_type)
29283122 {
3123+ struct smb_rqst rqst;
29293124 int resp_buftype, rc = -EACCES;
29303125 struct smb2_read_plain_req *req = NULL;
29313126 struct smb2_read_rsp *rsp = NULL;
@@ -2946,7 +3141,11 @@ SMB2_read(const unsigned int xid, struct cifs_io_parms *io_parms, · 14 unmodified lines
29463141 iov[0].iov_base = (char *)req;
29473142 iov[0].iov_len = total_len;
29483143
2949− rc = smb2_send_recv(xid, ses, iov, 1, &resp_buftype, flags, &rsp_iov);
3144+ memset(&rqst, 0, sizeof(struct smb_rqst));
3145+ rqst.rq_iov = iov;
3146+ rqst.rq_nvec = 1;
3147+
3148+ rc = cifs_send_recv(xid, ses, &rqst, &resp_buftype, flags, &rsp_iov);
29503149 cifs_small_buf_release(req);
29513150
29523151 rsp = (struct smb2_read_rsp *)rsp_iov.iov_base;
@@ -3062,10 +3261,9 @@ smb2_async_writev(struct cifs_writedata *wdata, · 109 unmodified lines
30623261 struct smb2_sync_hdr *shdr;
30633262 struct cifs_tcon *tcon = tlink_tcon(wdata->cfile->tlink);
30643263 struct TCP_Server_Info *server = tcon->ses->server;
3065− struct kvec iov[2];
3264+ struct kvec iov[1];
30663265 struct smb_rqst rqst = { };
30673266 unsigned int total_len;
3068− __be32 rfc1002_marker;
30693267
30703268 rc = smb2_plain_req_init(SMB2_WRITE, tcon, (void **) &req, &total_len);
30713269 if (rc) {
@@ -3137,15 +3335,11 @@ smb2_async_writev(struct cifs_writedata *wdata, · 65 unmodified lines
31373335 v1->length = cpu_to_le32(wdata->mr->mr->length);
31383336 }
31393337 #endif
3140− /* 4 for rfc1002 length field and 1 for Buffer */
3141− iov[0].iov_len = 4;
3142− rfc1002_marker = cpu_to_be32(total_len - 1 + wdata->bytes);
3143− iov[0].iov_base = &rfc1002_marker;
3144− iov[1].iov_len = total_len - 1;
3145− iov[1].iov_base = (char *)req;
3338+ iov[0].iov_len = total_len - 1;
3339+ iov[0].iov_base = (char *)req;
31463340
31473341 rqst.rq_iov = iov;
3148− rqst.rq_nvec = 2;
3342+ rqst.rq_nvec = 1;
31493343 rqst.rq_pages = wdata->pages;
31503344 rqst.rq_offset = wdata->page_offset;
31513345 rqst.rq_npages = wdata->nr_pages;
@@ -3153,7 +3347,7 @@ smb2_async_writev(struct cifs_writedata *wdata, · 1 unmodified line
31533347 rqst.rq_tailsz = wdata->tailsz;
31543348 #ifdef CONFIG_CIFS_SMB_DIRECT
31553349 if (wdata->mr) {
3156− iov[1].iov_len += sizeof(struct smbd_buffer_descriptor_v1);
3350+ iov[0].iov_len += sizeof(struct smbd_buffer_descriptor_v1);
31573351 rqst.rq_npages = 0;
31583352 }
31593353 #endif
@@ -3210,6 +3404,7 @@ int · 50 unmodified lines
32103404 SMB2_write(const unsigned int xid, struct cifs_io_parms *io_parms,
32113405 unsigned int *nbytes, struct kvec *iov, int n_vec)
32123406 {
3407+ struct smb_rqst rqst;
32133408 int rc = 0;
32143409 struct smb2_write_req *req = NULL;
32153410 struct smb2_write_rsp *rsp = NULL;
@@ -3251,7 +3446,11 @@ SMB2_write(const unsigned int xid, struct cifs_io_parms *io_parms, · 35 unmodified lines
32513446 /* 1 for Buffer */
32523447 iov[0].iov_len = total_len - 1;
32533448
3254− rc = smb2_send_recv(xid, io_parms->tcon->ses, iov, n_vec + 1,
3449+ memset(&rqst, 0, sizeof(struct smb_rqst));
3450+ rqst.rq_iov = iov;
3451+ rqst.rq_nvec = n_vec + 1;
3452+
3453+ rc = cifs_send_recv(xid, io_parms->tcon->ses, &rqst,
32553454 &resp_buftype, flags, &rsp_iov);
32563455 cifs_small_buf_release(req);
32573456 rsp = (struct smb2_write_rsp *)rsp_iov.iov_base;
@@ -3323,6 +3522,7 @@ SMB2_query_directory(const unsigned int xid, struct cifs_tcon *tcon, · 65 unmodified lines
33233522 u64 persistent_fid, u64 volatile_fid, int index,
33243523 struct cifs_search_info *srch_inf)
33253524 {
3525+ struct smb_rqst rqst;
33263526 struct smb2_query_directory_req *req;
33273527 struct smb2_query_directory_rsp *rsp = NULL;
33283528 struct kvec iov[2];
@@ -3395,7 +3595,11 @@ SMB2_query_directory(const unsigned int xid, struct cifs_tcon *tcon, · 66 unmodified lines
33953595 iov[1].iov_base = (char *)(req->Buffer);
33963596 iov[1].iov_len = len;
33973597
3398− rc = smb2_send_recv(xid, ses, iov, 2, &resp_buftype, flags, &rsp_iov);
3598+ memset(&rqst, 0, sizeof(struct smb_rqst));
3599+ rqst.rq_iov = iov;
3600+ rqst.rq_nvec = 2;
3601+
3602+ rc = cifs_send_recv(xid, ses, &rqst, &resp_buftype, flags, &rsp_iov);
33993603 cifs_small_buf_release(req);
34003604 rsp = (struct smb2_query_directory_rsp *)rsp_iov.iov_base;
34013605
@@ -3454,6 +3658,7 @@ send_set_info(const unsigned int xid, struct cifs_tcon *tcon, · 52 unmodified lines
34543658 u8 info_type, u32 additional_info, unsigned int num,
34553659 void **data, unsigned int *size)
34563660 {
3661+ struct smb_rqst rqst;
34573662 struct smb2_set_info_req *req;
34583663 struct smb2_set_info_rsp *rsp = NULL;
34593664 struct kvec *iov;
@@ -3509,7 +3714,11 @@ send_set_info(const unsigned int xid, struct cifs_tcon *tcon, · 49 unmodified lines
35093714 iov[i].iov_len = size[i];
35103715 }
35113716
3512− rc = smb2_send_recv(xid, ses, iov, num, &resp_buftype, flags,
3717+ memset(&rqst, 0, sizeof(struct smb_rqst));
3718+ rqst.rq_iov = iov;
3719+ rqst.rq_nvec = num;
3720+
3721+ rc = cifs_send_recv(xid, ses, &rqst, &resp_buftype, flags,
35133722 &rsp_iov);
35143723 cifs_small_buf_release(req);
35153724 rsp = (struct smb2_set_info_rsp *)rsp_iov.iov_base;
@@ -3664,6 +3873,7 @@ SMB2_oplock_break(const unsigned int xid, struct cifs_tcon *tcon, · 148 unmodified lines
36643873 const u64 persistent_fid, const u64 volatile_fid,
36653874 __u8 oplock_level)
36663875 {
3876+ struct smb_rqst rqst;
36673877 int rc;
36683878 struct smb2_oplock_break *req = NULL;
36693879 struct cifs_ses *ses = tcon->ses;
@@ -3692,7 +3902,11 @@ SMB2_oplock_break(const unsigned int xid, struct cifs_tcon *tcon, · 22 unmodified lines
36923902 iov[0].iov_base = (char *)req;
36933903 iov[0].iov_len = total_len;
36943904
3695− rc = smb2_send_recv(xid, ses, iov, 1, &resp_buf_type, flags, &rsp_iov);
3905+ memset(&rqst, 0, sizeof(struct smb_rqst));
3906+ rqst.rq_iov = iov;
3907+ rqst.rq_nvec = 1;
3908+
3909+ rc = cifs_send_recv(xid, ses, &rqst, &resp_buf_type, flags, &rsp_iov);
36963910 cifs_small_buf_release(req);
36973911
36983912 if (rc) {
@@ -3755,6 +3969,7 @@ int · 56 unmodified lines
37553969 SMB2_QFS_info(const unsigned int xid, struct cifs_tcon *tcon,
37563970 u64 persistent_fid, u64 volatile_fid, struct kstatfs *fsdata)
37573971 {
3972+ struct smb_rqst rqst;
37583973 struct smb2_query_info_rsp *rsp = NULL;
37593974 struct kvec iov;
37603975 struct kvec rsp_iov;
@@ -3773,7 +3988,11 @@ SMB2_QFS_info(const unsigned int xid, struct cifs_tcon *tcon, · 12 unmodified lines
37733988 if (smb3_encryption_required(tcon))
37743989 flags |= CIFS_TRANSFORM_REQ;
37753990
3776− rc = smb2_send_recv(xid, ses, &iov, 1, &resp_buftype, flags, &rsp_iov);
3991+ memset(&rqst, 0, sizeof(struct smb_rqst));
3992+ rqst.rq_iov = &iov;
3993+ rqst.rq_nvec = 1;
3994+
3995+ rc = cifs_send_recv(xid, ses, &rqst, &resp_buftype, flags, &rsp_iov);
37773996 cifs_small_buf_release(iov.iov_base);
37783997 if (rc) {
37793998 cifs_stats_fail_inc(tcon, SMB2_QUERY_INFO_HE);
@@ -3798,6 +4017,7 @@ int · 18 unmodified lines
37984017 SMB2_QFS_attr(const unsigned int xid, struct cifs_tcon *tcon,
37994018 u64 persistent_fid, u64 volatile_fid, int level)
38004019 {
4020+ struct smb_rqst rqst;
38014021 struct smb2_query_info_rsp *rsp = NULL;
38024022 struct kvec iov;
38034023 struct kvec rsp_iov;
@@ -3829,7 +4049,11 @@ SMB2_QFS_attr(const unsigned int xid, struct cifs_tcon *tcon, · 25 unmodified lines
38294049 if (smb3_encryption_required(tcon))
38304050 flags |= CIFS_TRANSFORM_REQ;
38314051
3832− rc = smb2_send_recv(xid, ses, &iov, 1, &resp_buftype, flags, &rsp_iov);
4052+ memset(&rqst, 0, sizeof(struct smb_rqst));
4053+ rqst.rq_iov = &iov;
4054+ rqst.rq_nvec = 1;
4055+
4056+ rc = cifs_send_recv(xid, ses, &rqst, &resp_buftype, flags, &rsp_iov);
38334057 cifs_small_buf_release(iov.iov_base);
38344058 if (rc) {
38354059 cifs_stats_fail_inc(tcon, SMB2_QUERY_INFO_HE);
@@ -3868,6 +4092,7 @@ smb2_lockv(const unsigned int xid, struct cifs_tcon *tcon, · 32 unmodified lines
38684092 const __u64 persist_fid, const __u64 volatile_fid, const __u32 pid,
38694093 const __u32 num_lock, struct smb2_lock_element *buf)
38704094 {
4095+ struct smb_rqst rqst;
38714096 int rc = 0;
38724097 struct smb2_lock_req *req = NULL;
38734098 struct kvec iov[2];
@@ -3900,7 +4125,12 @@ smb2_lockv(const unsigned int xid, struct cifs_tcon *tcon, · 26 unmodified lines
39004125 iov[1].iov_len = count;
39014126
39024127 cifs_stats_inc(&tcon->stats.cifs_stats.num_locks);
3903− rc = smb2_send_recv(xid, tcon->ses, iov, 2, &resp_buf_type, flags,
4128+
4129+ memset(&rqst, 0, sizeof(struct smb_rqst));
4130+ rqst.rq_iov = iov;
4131+ rqst.rq_nvec = 2;
4132+
4133+ rc = cifs_send_recv(xid, tcon->ses, &rqst, &resp_buf_type, flags,
39044134 &rsp_iov);
39054135 cifs_small_buf_release(req);
39064136 if (rc) {
@@ -3934,6 +4164,7 @@ int · 27 unmodified lines
39344164 SMB2_lease_break(const unsigned int xid, struct cifs_tcon *tcon,
39354165 __u8 *lease_key, const __le32 lease_state)
39364166 {
4167+ struct smb_rqst rqst;
39374168 int rc;
39384169 struct smb2_lease_ack *req = NULL;
39394170 struct cifs_ses *ses = tcon->ses;
@@ -3964,7 +4195,11 @@ SMB2_lease_break(const unsigned int xid, struct cifs_tcon *tcon, · 24 unmodified lines
39644195 iov[0].iov_base = (char *)req;
39654196 iov[0].iov_len = total_len;
39664197
3967− rc = smb2_send_recv(xid, ses, iov, 1, &resp_buf_type, flags, &rsp_iov);
4198+ memset(&rqst, 0, sizeof(struct smb_rqst));
4199+ rqst.rq_iov = iov;
4200+ rqst.rq_nvec = 1;
4201+
4202+ rc = cifs_send_recv(xid, ses, &rqst, &resp_buf_type, flags, &rsp_iov);
39684203 cifs_small_buf_release(req);
39694204
39704205 if (rc) {
fs/cifs/smb2pdu.h+20−3
@@ -851,8 +851,11 @@ struct validate_negotiate_info_rsp { · 850 unmodified lines
851851 __le16 Dialect; /* Dialect in use for the connection */
852852 } __packed;
853853
854−#define RSS_CAPABLE 0x00000001
855−#define RDMA_CAPABLE 0x00000002
854+#define RSS_CAPABLE cpu_to_le32(0x00000001)
855+#define RDMA_CAPABLE cpu_to_le32(0x00000002)
856+
857+#define INTERNETWORK cpu_to_le16(0x0002)
858+#define INTERNETWORKV6 cpu_to_le16(0x0017)
856859
857860 struct network_interface_info_ioctl_rsp {
858861 __le32 Next; /* next interface. zero if this is last one */
@@ -860,7 +863,21 @@ struct network_interface_info_ioctl_rsp { · 1 unmodified line
860863 __le32 Capability; /* RSS or RDMA Capable */
861864 __le32 Reserved;
862865 __le64 LinkSpeed;
863− char SockAddr_Storage[128];
866+ __le16 Family;
867+ __u8 Buffer[126];
868+} __packed;
869+
870+struct iface_info_ipv4 {
871+ __be16 Port;
872+ __be32 IPv4Address;
873+ __be64 Reserved;
874+} __packed;
875+
876+struct iface_info_ipv6 {
877+ __be16 Port;
878+ __be32 FlowInfo;
879+ __u8 IPv6Address[16];
880+ __be32 ScopeId;
864881 } __packed;
865882
866883 #define NO_FILE_ID 0xFFFFFFFFFFFFFFFFULL /* general ioctls to srv not to file */
fs/cifs/smb2proto.h+6−0
@@ -79,6 +79,10 @@ extern int smb2_set_path_size(const unsigned int xid, struct cifs_tcon *tcon, · 78 unmodified lines
7979 struct cifs_sb_info *cifs_sb, bool set_alloc);
8080 extern int smb2_set_file_info(struct inode *inode, const char *full_path,
8181 FILE_BASIC_INFO *buf, const unsigned int xid);
82+extern int smb311_posix_mkdir(const unsigned int xid, struct inode *inode,
83+ umode_t mode, struct cifs_tcon *tcon,
84+ const char *full_path,
85+ struct cifs_sb_info *cifs_sb);
8286 extern int smb2_mkdir(const unsigned int xid, struct cifs_tcon *tcon,
8387 const char *name, struct cifs_sb_info *cifs_sb);
8488 extern void smb2_mkdir_setinfo(struct inode *inode, const char *full_path,
@@ -109,6 +113,8 @@ extern int smb2_unlock_range(struct cifsFileInfo *cfile, · 24 unmodified lines
109113 extern int smb2_push_mandatory_locks(struct cifsFileInfo *cfile);
110114 extern void smb2_reconnect_server(struct work_struct *work);
111115 extern int smb3_crypto_aead_allocate(struct TCP_Server_Info *server);
116+extern unsigned long
117+smb2_rqst_len(struct smb_rqst *rqst, bool skip_rfc1002_marker);
112118
113119 /*
114120 * SMB2 Worker functions - most of protocol specific implementation details
fs/cifs/smb2transport.c+7−11
@@ -171,9 +171,7 @@ smb2_calc_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server) · 170 unmodified lines
171171 unsigned char smb2_signature[SMB2_HMACSHA256_SIZE];
172172 unsigned char *sigptr = smb2_signature;
173173 struct kvec *iov = rqst->rq_iov;
174− int iov_hdr_index = rqst->rq_nvec > 1 ? 1 : 0;
175− struct smb2_sync_hdr *shdr =
176− (struct smb2_sync_hdr *)iov[iov_hdr_index].iov_base;
174+ struct smb2_sync_hdr *shdr = (struct smb2_sync_hdr *)iov[0].iov_base;
177175 struct cifs_ses *ses;
178176
179177 ses = smb2_find_smb_ses(server, shdr->SessionId);
@@ -204,7 +202,7 @@ smb2_calc_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server) · 24 unmodified lines
204202 return rc;
205203 }
206204
207− rc = __cifs_calc_signature(rqst, iov_hdr_index, server, sigptr,
205+ rc = __cifs_calc_signature(rqst, server, sigptr,
208206 &server->secmech.sdeschmacsha256->shash);
209207
210208 if (!rc)
@@ -414,9 +412,7 @@ smb3_calc_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server) · 203 unmodified lines
414412 unsigned char smb3_signature[SMB2_CMACAES_SIZE];
415413 unsigned char *sigptr = smb3_signature;
416414 struct kvec *iov = rqst->rq_iov;
417− int iov_hdr_index = rqst->rq_nvec > 1 ? 1 : 0;
418− struct smb2_sync_hdr *shdr =
419− (struct smb2_sync_hdr *)iov[iov_hdr_index].iov_base;
415+ struct smb2_sync_hdr *shdr = (struct smb2_sync_hdr *)iov[0].iov_base;
420416 struct cifs_ses *ses;
421417
422418 ses = smb2_find_smb_ses(server, shdr->SessionId);
@@ -447,7 +443,7 @@ smb3_calc_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server) · 24 unmodified lines
447443 return rc;
448444 }
449445
450− rc = __cifs_calc_signature(rqst, iov_hdr_index, server, sigptr,
446+ rc = __cifs_calc_signature(rqst, server, sigptr,
451447 &server->secmech.sdesccmacaes->shash);
452448
453449 if (!rc)
@@ -462,7 +458,7 @@ smb2_sign_rqst(struct smb_rqst *rqst, struct TCP_Server_Info *server) · 8 unmodified lines
462458 {
463459 int rc = 0;
464460 struct smb2_sync_hdr *shdr =
465− (struct smb2_sync_hdr *)rqst->rq_iov[1].iov_base;
461+ (struct smb2_sync_hdr *)rqst->rq_iov[0].iov_base;
466462
467463 if (!(shdr->Flags & SMB2_FLAGS_SIGNED) ||
468464 server->tcpStatus == CifsNeedNegotiate)
@@ -635,7 +631,7 @@ smb2_setup_request(struct cifs_ses *ses, struct smb_rqst *rqst) · 166 unmodified lines
635631 {
636632 int rc;
637633 struct smb2_sync_hdr *shdr =
638− (struct smb2_sync_hdr *)rqst->rq_iov[1].iov_base;
634+ (struct smb2_sync_hdr *)rqst->rq_iov[0].iov_base;
639635 struct mid_q_entry *mid;
640636
641637 smb2_seq_num_into_buf(ses->server, shdr);
@@ -656,7 +652,7 @@ smb2_setup_async_request(struct TCP_Server_Info *server, struct smb_rqst *rqst) · 14 unmodified lines
656652 {
657653 int rc;
658654 struct smb2_sync_hdr *shdr =
659− (struct smb2_sync_hdr *)rqst->rq_iov[1].iov_base;
655+ (struct smb2_sync_hdr *)rqst->rq_iov[0].iov_base;
660656 struct mid_q_entry *mid;
661657
662658 smb2_seq_num_into_buf(server, shdr);
fs/cifs/smbdirect.c+5−14
@@ -18,6 +18,7 @@ · 17 unmodified lines
1818 #include "smbdirect.h"
1919 #include "cifs_debug.h"
2020 #include "cifsproto.h"
21+#include "smb2proto.h"
2122
2223 static struct smbd_response *get_empty_queue_buffer(
2324 struct smbd_connection *info);
@@ -2087,7 +2088,7 @@ int smbd_send(struct smbd_connection *info, struct smb_rqst *rqst) · 2063 unmodified lines
20872088 struct kvec vec;
20882089 int nvecs;
20892090 int size;
2090− unsigned int buflen = 0, remaining_data_length;
2091+ unsigned int buflen, remaining_data_length;
20912092 int start, i, j;
20922093 int max_iov_size =
20932094 info->max_send_size - sizeof(struct smbd_data_transfer);
@@ -2111,25 +2112,13 @@ int smbd_send(struct smbd_connection *info, struct smb_rqst *rqst) · 17 unmodified lines
21112112 log_write(ERR, "expected the pdu length in 1st iov, but got %zu\n", rqst->rq_iov[0].iov_len);
21122113 return -EINVAL;
21132114 }
2114− iov = &rqst->rq_iov[1];
2115−
2116− /* total up iov array first */
2117− for (i = 0; i < rqst->rq_nvec-1; i++) {
2118− buflen += iov[i].iov_len;
2119− }
21202115
21212116 /*
21222117 * Add in the page array if there is one. The caller needs to set
21232118 * rq_tailsz to PAGE_SIZE when the buffer has multiple pages and
21242119 * ends at page boundary
21252120 */
2126− if (rqst->rq_npages) {
2127− if (rqst->rq_npages == 1)
2128− buflen += rqst->rq_tailsz;
2129− else
2130− buflen += rqst->rq_pagesz * (rqst->rq_npages - 1) -
2131− rqst->rq_offset + rqst->rq_tailsz;
2132− }
2121+ buflen = smb2_rqst_len(rqst, true);
21332122
21342123 if (buflen + sizeof(struct smbd_data_transfer) >
21352124 info->max_fragmented_send_size) {
@@ -2139,6 +2128,8 @@ int smbd_send(struct smbd_connection *info, struct smb_rqst *rqst) · 3 unmodified lines
21392128 goto done;
21402129 }
21412130
2131+ iov = &rqst->rq_iov[1];
2132+
21422133 cifs_dbg(FYI, "Sending smb (RDMA): smb_len=%u\n", buflen);
21432134 for (i = 0; i < rqst->rq_nvec-1; i++)
21442135 dump_smb(iov[i].iov_base, iov[i].iov_len);
fs/cifs/trace.h+2−1
@@ -378,7 +378,7 @@ DEFINE_EVENT(smb3_open_err_class, smb3_##name, \ · 377 unmodified lines
378378 TP_ARGS(xid, tid, sesid, create_options, desired_access, rc))
379379
380380 DEFINE_SMB3_OPEN_ERR_EVENT(open_err);
381−
381+DEFINE_SMB3_OPEN_ERR_EVENT(posix_mkdir_err);
382382
383383 DECLARE_EVENT_CLASS(smb3_open_done_class,
384384 TP_PROTO(unsigned int xid,
@@ -420,6 +420,7 @@ DEFINE_EVENT(smb3_open_done_class, smb3_##name, \ · 35 unmodified lines
420420 TP_ARGS(xid, fid, tid, sesid, create_options, desired_access))
421421
422422 DEFINE_SMB3_OPEN_DONE_EVENT(open_done);
423+DEFINE_SMB3_OPEN_DONE_EVENT(posix_mkdir_done);
423424
424425 #endif /* _CIFS_TRACE_H */
425426
fs/cifs/transport.c+78−95
@@ -201,15 +201,24 @@ smb_send_kvec(struct TCP_Server_Info *server, struct msghdr *smb_msg, · 200 unmodified lines
201201 return 0;
202202 }
203203
204−static unsigned long
205−rqst_len(struct smb_rqst *rqst)
204+unsigned long
205+smb2_rqst_len(struct smb_rqst *rqst, bool skip_rfc1002_marker)
206206 {
207207 unsigned int i;
208− struct kvec *iov = rqst->rq_iov;
208+ struct kvec *iov;
209+ int nvec;
209210 unsigned long buflen = 0;
210211
212+ if (skip_rfc1002_marker && rqst->rq_iov[0].iov_len == 4) {
213+ iov = &rqst->rq_iov[1];
214+ nvec = rqst->rq_nvec - 1;
215+ } else {
216+ iov = rqst->rq_iov;
217+ nvec = rqst->rq_nvec;
218+ }
219+
211220 /* total up iov array first */
212− for (i = 0; i < rqst->rq_nvec; i++)
221+ for (i = 0; i < nvec; i++)
213222 buflen += iov[i].iov_len;
214223
215224 /*
@@ -236,18 +245,20 @@ rqst_len(struct smb_rqst *rqst) · 20 unmodified lines
236245 }
237246
238247 static int
239−__smb_send_rqst(struct TCP_Server_Info *server, struct smb_rqst *rqst)
248+__smb_send_rqst(struct TCP_Server_Info *server, int num_rqst,
249+ struct smb_rqst *rqst)
240250 {
241− int rc;
242− struct kvec *iov = rqst->rq_iov;
243− int n_vec = rqst->rq_nvec;
244− unsigned int smb_buf_length = get_rfc1002_length(iov[0].iov_base);
245− unsigned long send_length;
246− unsigned int i;
251+ int rc = 0;
252+ struct kvec *iov;
253+ int n_vec;
254+ unsigned int send_length = 0;
255+ unsigned int i, j;
247256 size_t total_len = 0, sent, size;
248257 struct socket *ssocket = server->ssocket;
249258 struct msghdr smb_msg;
250259 int val = 1;
260+ __be32 rfc1002_marker;
261+
251262 if (cifs_rdma_enabled(server) && server->smbd_conn) {
252263 rc = smbd_send(server->smbd_conn, rqst);
253264 goto smbd_done;
@@ -255,51 +266,67 @@ __smb_send_rqst(struct TCP_Server_Info *server, struct smb_rqst *rqst) · 1 unmodified line
255266 if (ssocket == NULL)
256267 return -ENOTSOCK;
257268
258− /* sanity check send length */
259− send_length = rqst_len(rqst);
260− if (send_length != smb_buf_length + 4) {
261− WARN(1, "Send length mismatch(send_length=%lu smb_buf_length=%u)\n",
262− send_length, smb_buf_length);
263− return -EIO;
264− }
265−
266− if (n_vec < 2)
267− return -EIO;
268−
269− cifs_dbg(FYI, "Sending smb: smb_len=%u\n", smb_buf_length);
270− dump_smb(iov[0].iov_base, iov[0].iov_len);
271− dump_smb(iov[1].iov_base, iov[1].iov_len);
272−
273269 /* cork the socket */
274270 kernel_setsockopt(ssocket, SOL_TCP, TCP_CORK,
275271 (char *)&val, sizeof(val));
276272
277− size = 0;
278− for (i = 0; i < n_vec; i++)
279− size += iov[i].iov_len;
273+ for (j = 0; j < num_rqst; j++)
274+ send_length += smb2_rqst_len(&rqst[j], true);
275+ rfc1002_marker = cpu_to_be32(send_length);
280276
281− iov_iter_kvec(&smb_msg.msg_iter, WRITE | ITER_KVEC, iov, n_vec, size);
277+ /* Generate a rfc1002 marker for SMB2+ */
278+ if (server->vals->header_preamble_size == 0) {
279+ struct kvec hiov = {
280+ .iov_base = &rfc1002_marker,
281+ .iov_len = 4
282+ };
283+ iov_iter_kvec(&smb_msg.msg_iter, WRITE | ITER_KVEC, &hiov,
284+ 1, 4);
285+ rc = smb_send_kvec(server, &smb_msg, &sent);
286+ if (rc < 0)
287+ goto uncork;
282288
283− rc = smb_send_kvec(server, &smb_msg, &sent);
284− if (rc < 0)
285− goto uncork;
289+ total_len += sent;
290+ send_length += 4;
291+ }
286292
287− total_len += sent;
293+ cifs_dbg(FYI, "Sending smb: smb_len=%u\n", send_length);
288294
289− /* now walk the page array and send each page in it */
290− for (i = 0; i < rqst->rq_npages; i++) {
291− struct bio_vec bvec;
295+ for (j = 0; j < num_rqst; j++) {
296+ iov = rqst[j].rq_iov;
297+ n_vec = rqst[j].rq_nvec;
292298
293− bvec.bv_page = rqst->rq_pages[i];
294− rqst_page_get_length(rqst, i, &bvec.bv_len, &bvec.bv_offset);
299+ size = 0;
300+ for (i = 0; i < n_vec; i++) {
301+ dump_smb(iov[i].iov_base, iov[i].iov_len);
302+ size += iov[i].iov_len;
303+ }
304+
305+ iov_iter_kvec(&smb_msg.msg_iter, WRITE | ITER_KVEC,
306+ iov, n_vec, size);
295307
296− iov_iter_bvec(&smb_msg.msg_iter, WRITE | ITER_BVEC,
297− &bvec, 1, bvec.bv_len);
298308 rc = smb_send_kvec(server, &smb_msg, &sent);
299309 if (rc < 0)
300− break;
310+ goto uncork;
301311
302312 total_len += sent;
313+
314+ /* now walk the page array and send each page in it */
315+ for (i = 0; i < rqst[j].rq_npages; i++) {
316+ struct bio_vec bvec;
317+
318+ bvec.bv_page = rqst[j].rq_pages[i];
319+ rqst_page_get_length(&rqst[j], i, &bvec.bv_len,
320+ &bvec.bv_offset);
321+
322+ iov_iter_bvec(&smb_msg.msg_iter, WRITE | ITER_BVEC,
323+ &bvec, 1, bvec.bv_len);
324+ rc = smb_send_kvec(server, &smb_msg, &sent);
325+ if (rc < 0)
326+ break;
327+
328+ total_len += sent;
329+ }
303330 }
304331
305332 uncork:
@@ -308,9 +335,9 @@ uncork: · 2 unmodified lines
308335 kernel_setsockopt(ssocket, SOL_TCP, TCP_CORK,
309336 (char *)&val, sizeof(val));
310337
311− if ((total_len > 0) && (total_len != smb_buf_length + 4)) {
338+ if ((total_len > 0) && (total_len != send_length)) {
312339 cifs_dbg(FYI, "partial send (wanted=%u sent=%zu): terminating session\n",
313− smb_buf_length + 4, total_len);
340+ send_length, total_len);
314341 /*
315342 * If we have only sent part of an SMB then the next SMB could
316343 * be taken as the remainder of this one. We need to kill the
@@ -335,7 +362,7 @@ smb_send_rqst(struct TCP_Server_Info *server, struct smb_rqst *rqst, int flags) · 18 unmodified lines
335362 int rc;
336363
337364 if (!(flags & CIFS_TRANSFORM_REQ))
338− return __smb_send_rqst(server, rqst);
365+ return __smb_send_rqst(server, 1, rqst);
339366
340367 if (!server->ops->init_transform_rq ||
341368 !server->ops->free_transform_rq) {
@@ -347,7 +374,7 @@ smb_send_rqst(struct TCP_Server_Info *server, struct smb_rqst *rqst, int flags) · 5 unmodified lines
347374 if (rc)
348375 return rc;
349376
350− rc = __smb_send_rqst(server, &cur_rqst);
377+ rc = __smb_send_rqst(server, 1, &cur_rqst);
351378 server->ops->free_transform_rq(&cur_rqst);
352379 return rc;
353380 }
@@ -365,7 +392,7 @@ smb_send(struct TCP_Server_Info *server, struct smb_hdr *smb_buffer, · 11 unmodified lines
365392 iov[1].iov_base = (char *)smb_buffer + 4;
366393 iov[1].iov_len = smb_buf_length;
367394
368− return __smb_send_rqst(server, &rqst);
395+ return __smb_send_rqst(server, 1, &rqst);
369396 }
370397
371398 static int
@@ -730,7 +757,6 @@ cifs_send_recv(const unsigned int xid, struct cifs_ses *ses, · 358 unmodified lines
730757 * to the same server. We may make this configurable later or
731758 * use ses->maxReq.
732759 */
733−
734760 rc = wait_for_free_request(ses->server, timeout, optype);
735761 if (rc)
736762 return rc;
@@ -766,8 +792,8 @@ cifs_send_recv(const unsigned int xid, struct cifs_ses *ses, · 29 unmodified lines
766792
767793 #ifdef CONFIG_CIFS_SMB311
768794 if ((ses->status == CifsNew) || (optype & CIFS_NEG_OP))
769− smb311_update_preauth_hash(ses, rqst->rq_iov+1,
770− rqst->rq_nvec-1);
795+ smb311_update_preauth_hash(ses, rqst->rq_iov,
796+ rqst->rq_nvec);
771797 #endif
772798
773799 if (timeout == CIFS_ASYNC_OP)
@@ -812,8 +838,8 @@ cifs_send_recv(const unsigned int xid, struct cifs_ses *ses, · 38 unmodified lines
812838 #ifdef CONFIG_CIFS_SMB311
813839 if ((ses->status == CifsNew) || (optype & CIFS_NEG_OP)) {
814840 struct kvec iov = {
815− .iov_base = buf,
816− .iov_len = midQ->resp_buf_size
841+ .iov_base = resp_iov->iov_base,
842+ .iov_len = resp_iov->iov_len
817843 };
818844 smb311_update_preauth_hash(ses, &iov, 1);
819845 }
@@ -872,49 +898,6 @@ SendReceive2(const unsigned int xid, struct cifs_ses *ses, · 52 unmodified lines
872898 return rc;
873899 }
874900
875−/* Like SendReceive2 but iov[0] does not contain an rfc1002 header */
876−int
877−smb2_send_recv(const unsigned int xid, struct cifs_ses *ses,
878− struct kvec *iov, int n_vec, int *resp_buf_type /* ret */,
879− const int flags, struct kvec *resp_iov)
880−{
881− struct smb_rqst rqst;
882− struct kvec s_iov[CIFS_MAX_IOV_SIZE], *new_iov;
883− int rc;
884− int i;
885− __u32 count;
886− __be32 rfc1002_marker;
887−
888− if (n_vec + 1 > CIFS_MAX_IOV_SIZE) {
889− new_iov = kmalloc_array(n_vec + 1, sizeof(struct kvec),
890− GFP_KERNEL);
891− if (!new_iov)
892− return -ENOMEM;
893− } else
894− new_iov = s_iov;
895−
896− /* 1st iov is an RFC1002 Session Message length */
897− memcpy(new_iov + 1, iov, (sizeof(struct kvec) * n_vec));
898−
899− count = 0;
900− for (i = 1; i < n_vec + 1; i++)
901− count += new_iov[i].iov_len;
902−
903− rfc1002_marker = cpu_to_be32(count);
904−
905− new_iov[0].iov_base = &rfc1002_marker;
906− new_iov[0].iov_len = 4;
907−
908− memset(&rqst, 0, sizeof(struct smb_rqst));
909− rqst.rq_iov = new_iov;
910− rqst.rq_nvec = n_vec + 1;
911−
912− rc = cifs_send_recv(xid, ses, &rqst, resp_buf_type, flags, resp_iov);
913− if (n_vec + 1 > CIFS_MAX_IOV_SIZE)
914− kfree(new_iov);
915− return rc;
916−}
917−
918901 int
919902 SendReceive(const unsigned int xid, struct cifs_ses *ses,
920903 struct smb_hdr *in_buf, struct smb_hdr *out_buf,
fs/eventfd.c+6−13
@@ -101,20 +101,14 @@ static int eventfd_release(struct inode *inode, struct file *file) · 100 unmodified lines
101101 return 0;
102102 }
103103
104−static struct wait_queue_head *
105−eventfd_get_poll_head(struct file *file, __poll_t events)
106−{
107− struct eventfd_ctx *ctx = file->private_data;
108−
109− return &ctx->wqh;
110−}
111−
112−static __poll_t eventfd_poll_mask(struct file *file, __poll_t eventmask)
104+static __poll_t eventfd_poll(struct file *file, poll_table *wait)
113105 {
114106 struct eventfd_ctx *ctx = file->private_data;
115107 __poll_t events = 0;
116108 u64 count;
117109
110+ poll_wait(file, &ctx->wqh, wait);
111+
118112 /*
119113 * All writes to ctx->count occur within ctx->wqh.lock. This read
120114 * can be done outside ctx->wqh.lock because we know that poll_wait
@@ -156,11 +150,11 @@ static __poll_t eventfd_poll_mask(struct file *file, __poll_t eventmask) · 35 unmodified lines
156150 count = READ_ONCE(ctx->count);
157151
158152 if (count > 0)
159− events |= (EPOLLIN & eventmask);
153+ events |= EPOLLIN;
160154 if (count == ULLONG_MAX)
161155 events |= EPOLLERR;
162156 if (ULLONG_MAX - 1 > count)
163− events |= (EPOLLOUT & eventmask);
157+ events |= EPOLLOUT;
164158
165159 return events;
166160 }
@@ -311,8 +305,7 @@ static const struct file_operations eventfd_fops = { · 144 unmodified lines
311305 .show_fdinfo = eventfd_show_fdinfo,
312306 #endif
313307 .release = eventfd_release,
314− .get_poll_head = eventfd_get_poll_head,
315− .poll_mask = eventfd_poll_mask,
308+ .poll = eventfd_poll,
316309 .read = eventfd_read,
317310 .write = eventfd_write,
318311 .llseek = noop_llseek,
fs/eventpoll.c+5−10
@@ -922,18 +922,14 @@ static __poll_t ep_read_events_proc(struct eventpoll *ep, struct list_head *head · 921 unmodified lines
922922 return 0;
923923 }
924924
925−static struct wait_queue_head *ep_eventpoll_get_poll_head(struct file *file,
926− __poll_t eventmask)
927−{
928− struct eventpoll *ep = file->private_data;
929− return &ep->poll_wait;
930−}
931−
932−static __poll_t ep_eventpoll_poll_mask(struct file *file, __poll_t eventmask)
925+static __poll_t ep_eventpoll_poll(struct file *file, poll_table *wait)
933926 {
934927 struct eventpoll *ep = file->private_data;
935928 int depth = 0;
936929
930+ /* Insert inside our poll wait queue */
931+ poll_wait(file, &ep->poll_wait, wait);
932+
937933 /*
938934 * Proceed to find out if wanted events are really available inside
939935 * the ready list.
@@ -972,8 +968,7 @@ static const struct file_operations eventpoll_fops = { · 32 unmodified lines
972968 .show_fdinfo = ep_show_fdinfo,
973969 #endif
974970 .release = ep_eventpoll_release,
975− .get_poll_head = ep_eventpoll_get_poll_head,
976− .poll_mask = ep_eventpoll_poll_mask,
971+ .poll = ep_eventpoll_poll,
977972 .llseek = noop_llseek,
978973 };
979974
fs/ext2/ext2.h+0−2
@@ -748,7 +748,6 @@ extern void ext2_free_blocks (struct inode *, unsigned long, · 747 unmodified lines
748748 unsigned long);
749749 extern unsigned long ext2_count_free_blocks (struct super_block *);
750750 extern unsigned long ext2_count_dirs (struct super_block *);
751−extern void ext2_check_blocks_bitmap (struct super_block *);
752751 extern struct ext2_group_desc * ext2_get_group_desc(struct super_block * sb,
753752 unsigned int block_group,
754753 struct buffer_head ** bh);
@@ -771,7 +770,6 @@ extern void ext2_set_link(struct inode *, struct ext2_dir_entry_2 *, struct page · 16 unmodified lines
771770 extern struct inode * ext2_new_inode (struct inode *, umode_t, const struct qstr *);
772771 extern void ext2_free_inode (struct inode *);
773772 extern unsigned long ext2_count_free_inodes (struct super_block *);
774−extern void ext2_check_inodes_bitmap (struct super_block *);
775773 extern unsigned long ext2_count_free (struct buffer_head *, unsigned);
776774
777775 /* inode.c */
fs/ext2/super.c+3−3
@@ -557,6 +557,9 @@ static int parse_options(char *options, struct super_block *sb, · 556 unmodified lines
557557 set_opt (opts->s_mount_opt, NO_UID32);
558558 break;
559559 case Opt_nocheck:
560+ ext2_msg(sb, KERN_WARNING,
561+ "Option nocheck/check=none is deprecated and"
562+ " will be removed in June 2020.");
560563 clear_opt (opts->s_mount_opt, CHECK);
561564 break;
562565 case Opt_debug:
@@ -1335,9 +1338,6 @@ static int ext2_remount (struct super_block * sb, int * flags, char * data) · 772 unmodified lines
13351338 new_opts.s_resgid = sbi->s_resgid;
13361339 spin_unlock(&sbi->s_lock);
13371340
1338− /*
1339− * Allow the "check" option to be passed as a remount option.
1340− */
13411341 if (!parse_options(data, sb, &new_opts))
13421342 return -EINVAL;
13431343
fs/jfs/xattr.c+6−4
@@ -491,15 +491,17 @@ static int ea_get(struct inode *inode, struct ea_buffer *ea_buf, int min_size) · 490 unmodified lines
491491 if (size > PSIZE) {
492492 /*
493493 * To keep the rest of the code simple. Allocate a
494− * contiguous buffer to work with
494+ * contiguous buffer to work with. Make the buffer large
495+ * enough to make use of the whole extent.
495496 */
496− ea_buf->xattr = kmalloc(size, GFP_KERNEL);
497+ ea_buf->max_size = (size + sb->s_blocksize - 1) &
498+ ~(sb->s_blocksize - 1);
499+
500+ ea_buf->xattr = kmalloc(ea_buf->max_size, GFP_KERNEL);
497501 if (ea_buf->xattr == NULL)
498502 return -ENOMEM;
499503
500504 ea_buf->flag = EA_MALLOC;
501− ea_buf->max_size = (size + sb->s_blocksize - 1) &
502− ~(sb->s_blocksize - 1);
503505
504506 if (ea_size == 0)
505507 return 0;
fs/nfs/delegation.c+3−1
@@ -883,8 +883,10 @@ struct inode *nfs_delegation_find_inode(struct nfs_client *clp, · 882 unmodified lines
883883 rcu_read_lock();
884884 list_for_each_entry_rcu(server, &clp->cl_superblocks, client_link) {
885885 res = nfs_delegation_find_inode_server(server, fhandle);
886− if (res != ERR_PTR(-ENOENT))
886+ if (res != ERR_PTR(-ENOENT)) {
887+ rcu_read_unlock();
887888 return res;
889+ }
888890 }
889891 rcu_read_unlock();
890892 return ERR_PTR(-ENOENT);
fs/nfs/flexfilelayout/flexfilelayout.c+16−5
@@ -1243,17 +1243,18 @@ static int ff_layout_read_done_cb(struct rpc_task *task, · 1242 unmodified lines
12431243 hdr->ds_clp, hdr->lseg,
12441244 hdr->pgio_mirror_idx);
12451245
1246+ clear_bit(NFS_IOHDR_RESEND_PNFS, &hdr->flags);
1247+ clear_bit(NFS_IOHDR_RESEND_MDS, &hdr->flags);
12461248 switch (err) {
12471249 case -NFS4ERR_RESET_TO_PNFS:
12481250 if (ff_layout_choose_best_ds_for_read(hdr->lseg,
12491251 hdr->pgio_mirror_idx + 1,
12501252 &hdr->pgio_mirror_idx))
12511253 goto out_eagain;
1252− ff_layout_read_record_layoutstats_done(task, hdr);
1253− pnfs_read_resend_pnfs(hdr);
1254+ set_bit(NFS_IOHDR_RESEND_PNFS, &hdr->flags);
12541255 return task->tk_status;
12551256 case -NFS4ERR_RESET_TO_MDS:
1256− ff_layout_reset_read(hdr);
1257+ set_bit(NFS_IOHDR_RESEND_MDS, &hdr->flags);
12571258 return task->tk_status;
12581259 case -EAGAIN:
12591260 goto out_eagain;
@@ -1403,6 +1404,10 @@ static void ff_layout_read_release(void *data) · 143 unmodified lines
14031404 struct nfs_pgio_header *hdr = data;
14041405
14051406 ff_layout_read_record_layoutstats_done(&hdr->task, hdr);
1407+ if (test_bit(NFS_IOHDR_RESEND_PNFS, &hdr->flags))
1408+ pnfs_read_resend_pnfs(hdr);
1409+ else if (test_bit(NFS_IOHDR_RESEND_MDS, &hdr->flags))
1410+ ff_layout_reset_read(hdr);
14061411 pnfs_generic_rw_release(data);
14071412 }
14081413
@@ -1423,12 +1428,14 @@ static int ff_layout_write_done_cb(struct rpc_task *task, · 14 unmodified lines
14231428 hdr->ds_clp, hdr->lseg,
14241429 hdr->pgio_mirror_idx);
14251430
1431+ clear_bit(NFS_IOHDR_RESEND_PNFS, &hdr->flags);
1432+ clear_bit(NFS_IOHDR_RESEND_MDS, &hdr->flags);
14261433 switch (err) {
14271434 case -NFS4ERR_RESET_TO_PNFS:
1428− ff_layout_reset_write(hdr, true);
1435+ set_bit(NFS_IOHDR_RESEND_PNFS, &hdr->flags);
14291436 return task->tk_status;
14301437 case -NFS4ERR_RESET_TO_MDS:
1431− ff_layout_reset_write(hdr, false);
1438+ set_bit(NFS_IOHDR_RESEND_MDS, &hdr->flags);
14321439 return task->tk_status;
14331440 case -EAGAIN:
14341441 return -EAGAIN;
@@ -1575,6 +1582,10 @@ static void ff_layout_write_release(void *data) · 140 unmodified lines
15751582 struct nfs_pgio_header *hdr = data;
15761583
15771584 ff_layout_write_record_layoutstats_done(&hdr->task, hdr);
1585+ if (test_bit(NFS_IOHDR_RESEND_PNFS, &hdr->flags))
1586+ ff_layout_reset_write(hdr, true);
1587+ else if (test_bit(NFS_IOHDR_RESEND_MDS, &hdr->flags))
1588+ ff_layout_reset_write(hdr, false);
15781589 pnfs_generic_rw_release(data);
15791590 }
15801591
fs/nfs/nfs4proc.c+26−7
@@ -3294,6 +3294,7 @@ static void nfs4_close_prepare(struct rpc_task *task, void *data) · 3293 unmodified lines
32943294 struct nfs4_closedata *calldata = data;
32953295 struct nfs4_state *state = calldata->state;
32963296 struct inode *inode = calldata->inode;
3297+ struct pnfs_layout_hdr *lo;
32973298 bool is_rdonly, is_wronly, is_rdwr;
32983299 int call_close = 0;
32993300
@@ -3337,6 +3338,12 @@ static void nfs4_close_prepare(struct rpc_task *task, void *data) · 37 unmodified lines
33373338 goto out_wait;
33383339 }
33393340
3341+ lo = calldata->arg.lr_args ? calldata->arg.lr_args->layout : NULL;
3342+ if (lo && !pnfs_layout_is_valid(lo)) {
3343+ calldata->arg.lr_args = NULL;
3344+ calldata->res.lr_res = NULL;
3345+ }
3346+
33403347 if (calldata->arg.fmode == 0)
33413348 task->tk_msg.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_CLOSE];
33423349
@@ -5972,12 +5979,19 @@ static void nfs4_delegreturn_release(void *calldata) · 2629 unmodified lines
59725979 static void nfs4_delegreturn_prepare(struct rpc_task *task, void *data)
59735980 {
59745981 struct nfs4_delegreturndata *d_data;
5982+ struct pnfs_layout_hdr *lo;
59755983
59765984 d_data = (struct nfs4_delegreturndata *)data;
59775985
59785986 if (!d_data->lr.roc && nfs4_wait_on_layoutreturn(d_data->inode, task))
59795987 return;
59805988
5989+ lo = d_data->args.lr_args ? d_data->args.lr_args->layout : NULL;
5990+ if (lo && !pnfs_layout_is_valid(lo)) {
5991+ d_data->args.lr_args = NULL;
5992+ d_data->res.lr_res = NULL;
5993+ }
5994+
59815995 nfs4_setup_sequence(d_data->res.server->nfs_client,
59825996 &d_data->args.seq_args,
59835997 &d_data->res.seq_res,
@@ -8650,6 +8664,8 @@ nfs4_layoutget_handle_exception(struct rpc_task *task, · 2666 unmodified lines
86508664
86518665 dprintk("--> %s tk_status => %d\n", __func__, -task->tk_status);
86528666
8667+ nfs4_sequence_free_slot(&lgp->res.seq_res);
8668+
86538669 switch (nfs4err) {
86548670 case 0:
86558671 goto out;
@@ -8714,7 +8730,6 @@ nfs4_layoutget_handle_exception(struct rpc_task *task, · 58 unmodified lines
87148730 goto out;
87158731 }
87168732
8717− nfs4_sequence_free_slot(&lgp->res.seq_res);
87188733 err = nfs4_handle_exception(server, nfs4err, exception);
87198734 if (!status) {
87208735 if (exception->retry)
@@ -8786,20 +8801,22 @@ nfs4_proc_layoutget(struct nfs4_layoutget *lgp, long *timeout) · 65 unmodified lines
87868801 if (IS_ERR(task))
87878802 return ERR_CAST(task);
87888803 status = rpc_wait_for_completion_task(task);
8789− if (status == 0) {
8804+ if (status != 0)
8805+ goto out;
8806+
8807+ /* if layoutp->len is 0, nfs4_layoutget_prepare called rpc_exit */
8808+ if (task->tk_status < 0 || lgp->res.layoutp->len == 0) {
87908809 status = nfs4_layoutget_handle_exception(task, lgp, &exception);
87918810 *timeout = exception.timeout;
8792− }
8793−
8811+ } else
8812+ lseg = pnfs_layout_process(lgp);
8813+out:
87948814 trace_nfs4_layoutget(lgp->args.ctx,
87958815 &lgp->args.range,
87968816 &lgp->res.range,
87978817 &lgp->res.stateid,
87988818 status);
87998819
8800− /* if layoutp->len is 0, nfs4_layoutget_prepare called rpc_exit */
8801− if (status == 0 && lgp->res.layoutp->len)
8802− lseg = pnfs_layout_process(lgp);
88038820 rpc_put_task(task);
88048821 dprintk("<-- %s status=%d\n", __func__, status);
88058822 if (status)
@@ -8817,6 +8834,8 @@ nfs4_layoutreturn_prepare(struct rpc_task *task, void *calldata) · 11 unmodified lines
88178834 &lrp->args.seq_args,
88188835 &lrp->res.seq_res,
88198836 task);
8837+ if (!pnfs_layout_is_valid(lrp->args.layout))
8838+ rpc_exit(task, 0);
88208839 }
88218840
88228841 static void nfs4_layoutreturn_done(struct rpc_task *task, void *calldata)
fs/nfs/pnfs.h+5−0
@@ -801,6 +801,11 @@ static inline void nfs4_lgopen_release(struct nfs4_layoutget *lgp) · 800 unmodified lines
801801 {
802802 }
803803
804+static inline bool pnfs_layout_is_valid(const struct pnfs_layout_hdr *lo)
805+{
806+ return false;
807+}
808+
804809 #endif /* CONFIG_NFS_V4_1 */
805810
806811 #if IS_ENABLED(CONFIG_NFS_V4_2)
fs/pipe.c+9−13
@@ -509,22 +509,19 @@ static long pipe_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) · 508 unmodified lines
509509 }
510510 }
511511
512−static struct wait_queue_head *
513−pipe_get_poll_head(struct file *filp, __poll_t events)
514−{
515− struct pipe_inode_info *pipe = filp->private_data;
516−
517− return &pipe->wait;
518−}
519−
520512 /* No kernel lock held - fine */
521−static __poll_t pipe_poll_mask(struct file *filp, __poll_t events)
513+static __poll_t
514+pipe_poll(struct file *filp, poll_table *wait)
522515 {
516+ __poll_t mask;
523517 struct pipe_inode_info *pipe = filp->private_data;
524− int nrbufs = pipe->nrbufs;
525− __poll_t mask = 0;
518+ int nrbufs;
519+
520+ poll_wait(filp, &pipe->wait, wait);
526521
527522 /* Reading only -- no need for acquiring the semaphore. */
523+ nrbufs = pipe->nrbufs;
524+ mask = 0;
528525 if (filp->f_mode & FMODE_READ) {
529526 mask = (nrbufs > 0) ? EPOLLIN | EPOLLRDNORM : 0;
530527 if (!pipe->writers && filp->f_version != pipe->w_counter)
@@ -1023,8 +1020,7 @@ const struct file_operations pipefifo_fops = { · 492 unmodified lines
10231020 .llseek = no_llseek,
10241021 .read_iter = pipe_read,
10251022 .write_iter = pipe_write,
1026− .get_poll_head = pipe_get_poll_head,
1027− .poll_mask = pipe_poll_mask,
1023+ .poll = pipe_poll,
10281024 .unlocked_ioctl = pipe_ioctl,
10291025 .release = pipe_release,
10301026 .fasync = pipe_fasync,
fs/proc/base.c+23−5
@@ -235,6 +235,10 @@ static ssize_t get_mm_cmdline(struct mm_struct *mm, char __user *buf, · 234 unmodified lines
235235 if (env_start != arg_end || env_start >= env_end)
236236 env_start = env_end = arg_end;
237237
238+ /* .. and limit it to a maximum of one page of slop */
239+ if (env_end >= arg_end + PAGE_SIZE)
240+ env_end = arg_end + PAGE_SIZE - 1;
241+
238242 /* We're not going to care if "*ppos" has high bits set */
239243 pos = arg_start + *ppos;
240244
@@ -254,10 +258,19 @@ static ssize_t get_mm_cmdline(struct mm_struct *mm, char __user *buf, · 13 unmodified lines
254258 while (count) {
255259 int got;
256260 size_t size = min_t(size_t, PAGE_SIZE, count);
261+ long offset;
257262
258− got = access_remote_vm(mm, pos, page, size, FOLL_ANON);
259− if (got <= 0)
263+ /*
264+ * Are we already starting past the official end?
265+ * We always include the last byte that is *supposed*
266+ * to be NUL
267+ */
268+ offset = (pos >= arg_end) ? pos - arg_end + 1 : 0;
269+
270+ got = access_remote_vm(mm, pos - offset, page, size + offset, FOLL_ANON);
271+ if (got <= offset)
260272 break;
273+ got -= offset;
261274
262275 /* Don't walk past a NUL character once you hit arg_end */
263276 if (pos + got >= arg_end) {
@@ -276,12 +289,17 @@ static ssize_t get_mm_cmdline(struct mm_struct *mm, char __user *buf, · 12 unmodified lines
276289 n = arg_end - pos - 1;
277290
278291 /* Cut off at first NUL after 'n' */
279− got = n + strnlen(page+n, got-n);
280− if (!got)
292+ got = n + strnlen(page+n, offset+got-n);
293+ if (got < offset)
281294 break;
295+ got -= offset;
296+
297+ /* Include the NUL if it existed */
298+ if (got < size)
299+ got++;
282300 }
283301
284− got -= copy_to_user(buf, page, got);
302+ got -= copy_to_user(buf, page+offset, got);
285303 if (unlikely(!got)) {
286304 if (!len)
287305 len = -EFAULT;
fs/proc/generic.c+10−1
@@ -564,11 +564,20 @@ static int proc_seq_open(struct inode *inode, struct file *file) · 563 unmodified lines
564564 return seq_open(file, de->seq_ops);
565565 }
566566
567+static int proc_seq_release(struct inode *inode, struct file *file)
568+{
569+ struct proc_dir_entry *de = PDE(inode);
570+
571+ if (de->state_size)
572+ return seq_release_private(inode, file);
573+ return seq_release(inode, file);
574+}
575+
567576 static const struct file_operations proc_seq_fops = {
568577 .open = proc_seq_open,
569578 .read = seq_read,
570579 .llseek = seq_lseek,
571− .release = seq_release,
580+ .release = proc_seq_release,
572581 };
573582
574583 struct proc_dir_entry *proc_create_seq_private(const char *name, umode_t mode,
fs/quota/dquot.c+2−5
@@ -711,21 +711,18 @@ EXPORT_SYMBOL(dquot_quota_sync); · 710 unmodified lines
711711 static unsigned long
712712 dqcache_shrink_scan(struct shrinker *shrink, struct shrink_control *sc)
713713 {
714− struct list_head *head;
715714 struct dquot *dquot;
716715 unsigned long freed = 0;
717716
718717 spin_lock(&dq_list_lock);
719− head = free_dquots.prev;
720− while (head != &free_dquots && sc->nr_to_scan) {
721− dquot = list_entry(head, struct dquot, dq_free);
718+ while (!list_empty(&free_dquots) && sc->nr_to_scan) {
719+ dquot = list_first_entry(&free_dquots, struct dquot, dq_free);
722720 remove_dquot_hash(dquot);
723721 remove_free_dquot(dquot);
724722 remove_inuse(dquot);
725723 do_destroy_dquot(dquot);
726724 sc->nr_to_scan--;
727725 freed++;
728− head = free_dquots.prev;
729726 }
730727 spin_unlock(&dq_list_lock);
731728 return freed;
fs/select.c+0−23
@@ -34,29 +34,6 @@ · 33 unmodified lines
3434
3535 #include <linux/uaccess.h>
3636
37−__poll_t vfs_poll(struct file *file, struct poll_table_struct *pt)
38−{
39− if (file->f_op->poll) {
40− return file->f_op->poll(file, pt);
41− } else if (file_has_poll_mask(file)) {
42− unsigned int events = poll_requested_events(pt);
43− struct wait_queue_head *head;
44−
45− if (pt && pt->_qproc) {
46− head = file->f_op->get_poll_head(file, events);
47− if (!head)
48− return DEFAULT_POLLMASK;
49− if (IS_ERR(head))
50− return EPOLLERR;
51− pt->_qproc(file, head, pt);
52− }
53−
54− return file->f_op->poll_mask(file, events);
55− } else {
56− return DEFAULT_POLLMASK;
57− }
58−}
59−EXPORT_SYMBOL_GPL(vfs_poll);
6037
6138 /*
6239 * Estimate expected accuracy in ns from a timeval.
fs/timerfd.c+11−11
@@ -226,20 +226,21 @@ static int timerfd_release(struct inode *inode, struct file *file) · 225 unmodified lines
226226 kfree_rcu(ctx, rcu);
227227 return 0;
228228 }
229−
230−static struct wait_queue_head *timerfd_get_poll_head(struct file *file,
231− __poll_t eventmask)
229+
230+static __poll_t timerfd_poll(struct file *file, poll_table *wait)
232231 {
233232 struct timerfd_ctx *ctx = file->private_data;
233+ __poll_t events = 0;
234+ unsigned long flags;
234235
235− return &ctx->wqh;
236−}
236+ poll_wait(file, &ctx->wqh, wait);
237237
238−static __poll_t timerfd_poll_mask(struct file *file, __poll_t eventmask)
239−{
240− struct timerfd_ctx *ctx = file->private_data;
238+ spin_lock_irqsave(&ctx->wqh.lock, flags);
239+ if (ctx->ticks)
240+ events |= EPOLLIN;
241+ spin_unlock_irqrestore(&ctx->wqh.lock, flags);
241242
242− return ctx->ticks ? EPOLLIN : 0;
243+ return events;
243244 }
244245
245246 static ssize_t timerfd_read(struct file *file, char __user *buf, size_t count,
@@ -363,8 +364,7 @@ static long timerfd_ioctl(struct file *file, unsigned int cmd, unsigned long arg · 117 unmodified lines
363364
364365 static const struct file_operations timerfd_fops = {
365366 .release = timerfd_release,
366− .get_poll_head = timerfd_get_poll_head,
367− .poll_mask = timerfd_poll_mask,
367+ .poll = timerfd_poll,
368368 .read = timerfd_read,
369369 .llseek = noop_llseek,
370370 .show_fdinfo = timerfd_show,
fs/udf/balloc.c+2−3
@@ -533,8 +533,7 @@ static int udf_table_prealloc_blocks(struct super_block *sb, · 532 unmodified lines
533533 udf_write_aext(table, &epos, &eloc,
534534 (etype << 30) | elen, 1);
535535 } else
536− udf_delete_aext(table, epos, eloc,
537− (etype << 30) | elen);
536+ udf_delete_aext(table, epos);
538537 } else {
539538 alloc_count = 0;
540539 }
@@ -630,7 +629,7 @@ static udf_pblk_t udf_table_new_block(struct super_block *sb, · 89 unmodified lines
630629 if (goal_elen)
631630 udf_write_aext(table, &goal_epos, &goal_eloc, goal_elen, 1);
632631 else
633− udf_delete_aext(table, goal_epos, goal_eloc, goal_elen);
632+ udf_delete_aext(table, goal_epos);
634633 brelse(goal_epos.bh);
635634
636635 udf_add_free_space(sb, partition, -1);
fs/udf/directory.c+4−4
@@ -141,10 +141,7 @@ struct fileIdentDesc *udf_fileident_read(struct inode *dir, loff_t *nf_pos, · 140 unmodified lines
141141 fibh->ebh->b_data,
142142 sizeof(struct fileIdentDesc) + fibh->soffset);
143143
144− fi_len = (sizeof(struct fileIdentDesc) +
145− cfi->lengthFileIdent +
146− le16_to_cpu(cfi->lengthOfImpUse) + 3) & ~3;
147−
144+ fi_len = udf_dir_entry_len(cfi);
148145 *nf_pos += fi_len - (fibh->eoffset - fibh->soffset);
149146 fibh->eoffset = fibh->soffset + fi_len;
150147 } else {
@@ -152,6 +149,9 @@ struct fileIdentDesc *udf_fileident_read(struct inode *dir, loff_t *nf_pos, · 1 unmodified line
152149 sizeof(struct fileIdentDesc));
153150 }
154151 }
152+ /* Got last entry outside of dir size - fs is corrupted! */
153+ if (*nf_pos > dir->i_size)
154+ return NULL;
155155 return fi;
156156 }
157157
fs/udf/inode.c+4−4
@@ -1147,8 +1147,7 @@ static void udf_update_extents(struct inode *inode, struct kernel_long_ad *laarr · 1146 unmodified lines
11471147
11481148 if (startnum > endnum) {
11491149 for (i = 0; i < (startnum - endnum); i++)
1150− udf_delete_aext(inode, *epos, laarr[i].extLocation,
1151− laarr[i].extLength);
1150+ udf_delete_aext(inode, *epos);
11521151 } else if (startnum < endnum) {
11531152 for (i = 0; i < (endnum - startnum); i++) {
11541153 udf_insert_aext(inode, *epos, laarr[i].extLocation,
@@ -2176,14 +2175,15 @@ static int8_t udf_insert_aext(struct inode *inode, struct extent_position epos, · 1021 unmodified lines
21762175 return (nelen >> 30);
21772176 }
21782177
2179−int8_t udf_delete_aext(struct inode *inode, struct extent_position epos,
2180− struct kernel_lb_addr eloc, uint32_t elen)
2178+int8_t udf_delete_aext(struct inode *inode, struct extent_position epos)
21812179 {
21822180 struct extent_position oepos;
21832181 int adsize;
21842182 int8_t etype;
21852183 struct allocExtDesc *aed;
21862184 struct udf_inode_info *iinfo;
2185+ struct kernel_lb_addr eloc;
2186+ uint32_t elen;
21872187
21882188 if (epos.bh) {
21892189 get_bh(epos.bh);
fs/udf/namei.c+3−11
@@ -351,8 +351,6 @@ static struct fileIdentDesc *udf_add_entry(struct inode *dir, · 350 unmodified lines
351351 loff_t f_pos;
352352 loff_t size = udf_ext0_offset(dir) + dir->i_size;
353353 int nfidlen;
354− uint8_t lfi;
355− uint16_t liu;
356354 udf_pblk_t block;
357355 struct kernel_lb_addr eloc;
358356 uint32_t elen = 0;
@@ -383,7 +381,7 @@ static struct fileIdentDesc *udf_add_entry(struct inode *dir, · 24 unmodified lines
383381 namelen = 0;
384382 }
385383
386− nfidlen = (sizeof(struct fileIdentDesc) + namelen + 3) & ~3;
384+ nfidlen = ALIGN(sizeof(struct fileIdentDesc) + namelen, UDF_NAME_PAD);
387385
388386 f_pos = udf_ext0_offset(dir);
389387
@@ -424,12 +422,8 @@ static struct fileIdentDesc *udf_add_entry(struct inode *dir, · 34 unmodified lines
424422 goto out_err;
425423 }
426424
427− liu = le16_to_cpu(cfi->lengthOfImpUse);
428− lfi = cfi->lengthFileIdent;
429−
430425 if ((cfi->fileCharacteristics & FID_FILE_CHAR_DELETED) != 0) {
431− if (((sizeof(struct fileIdentDesc) +
432− liu + lfi + 3) & ~3) == nfidlen) {
426+ if (udf_dir_entry_len(cfi) == nfidlen) {
433427 cfi->descTag.tagSerialNum = cpu_to_le16(1);
434428 cfi->fileVersionNum = cpu_to_le16(1);
435429 cfi->fileCharacteristics = 0;
@@ -1201,9 +1195,7 @@ static int udf_rename(struct inode *old_dir, struct dentry *old_dentry, · 765 unmodified lines
12011195
12021196 if (dir_fi) {
12031197 dir_fi->icb.extLocation = cpu_to_lelb(UDF_I(new_dir)->i_location);
1204− udf_update_tag((char *)dir_fi,
1205− (sizeof(struct fileIdentDesc) +
1206− le16_to_cpu(dir_fi->lengthOfImpUse) + 3) & ~3);
1198+ udf_update_tag((char *)dir_fi, udf_dir_entry_len(dir_fi));
12071199 if (old_iinfo->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB)
12081200 mark_inode_dirty(old_inode);
12091201 else
fs/udf/udfdecl.h+7−2
@@ -132,6 +132,12 @@ struct inode *udf_find_metadata_inode_efe(struct super_block *sb, · 131 unmodified lines
132132 extern int udf_write_fi(struct inode *inode, struct fileIdentDesc *,
133133 struct fileIdentDesc *, struct udf_fileident_bh *,
134134 uint8_t *, uint8_t *);
135+static inline unsigned int udf_dir_entry_len(struct fileIdentDesc *cfi)
136+{
137+ return ALIGN(sizeof(struct fileIdentDesc) +
138+ le16_to_cpu(cfi->lengthOfImpUse) + cfi->lengthFileIdent,
139+ UDF_NAME_PAD);
140+}
135141
136142 /* file.c */
137143 extern long udf_ioctl(struct file *, unsigned int, unsigned long);
@@ -167,8 +173,7 @@ extern int udf_add_aext(struct inode *, struct extent_position *, · 29 unmodified lines
167173 struct kernel_lb_addr *, uint32_t, int);
168174 extern void udf_write_aext(struct inode *, struct extent_position *,
169175 struct kernel_lb_addr *, uint32_t, int);
170−extern int8_t udf_delete_aext(struct inode *, struct extent_position,
171− struct kernel_lb_addr, uint32_t);
176+extern int8_t udf_delete_aext(struct inode *, struct extent_position);
172177 extern int8_t udf_next_aext(struct inode *, struct extent_position *,
173178 struct kernel_lb_addr *, uint32_t *, int);
174179 extern int8_t udf_current_aext(struct inode *, struct extent_position *,
fs/xfs/libxfs/xfs_ag_resv.c+27−4
@@ -157,6 +157,7 @@ __xfs_ag_resv_free( · 156 unmodified lines
157157 error = xfs_mod_fdblocks(pag->pag_mount, oldresv, true);
158158 resv->ar_reserved = 0;
159159 resv->ar_asked = 0;
160+ resv->ar_orig_reserved = 0;
160161
161162 if (error)
162163 trace_xfs_ag_resv_free_error(pag->pag_mount, pag->pag_agno,
@@ -189,13 +190,34 @@ __xfs_ag_resv_init( · 26 unmodified lines
189190 struct xfs_mount *mp = pag->pag_mount;
190191 struct xfs_ag_resv *resv;
191192 int error;
192− xfs_extlen_t reserved;
193+ xfs_extlen_t hidden_space;
193194
194195 if (used > ask)
195196 ask = used;
196− reserved = ask - used;
197197
198− error = xfs_mod_fdblocks(mp, -(int64_t)reserved, true);
198+ switch (type) {
199+ case XFS_AG_RESV_RMAPBT:
200+ /*
201+ * Space taken by the rmapbt is not subtracted from fdblocks
202+ * because the rmapbt lives in the free space. Here we must
203+ * subtract the entire reservation from fdblocks so that we
204+ * always have blocks available for rmapbt expansion.
205+ */
206+ hidden_space = ask;
207+ break;
208+ case XFS_AG_RESV_METADATA:
209+ /*
210+ * Space taken by all other metadata btrees are accounted
211+ * on-disk as used space. We therefore only hide the space
212+ * that is reserved but not used by the trees.
213+ */
214+ hidden_space = ask - used;
215+ break;
216+ default:
217+ ASSERT(0);
218+ return -EINVAL;
219+ }
220+ error = xfs_mod_fdblocks(mp, -(int64_t)hidden_space, true);
199221 if (error) {
200222 trace_xfs_ag_resv_init_error(pag->pag_mount, pag->pag_agno,
201223 error, _RET_IP_);
@@ -216,7 +238,8 @@ __xfs_ag_resv_init( · 14 unmodified lines
216238
217239 resv = xfs_perag_resv(pag, type);
218240 resv->ar_asked = ask;
219− resv->ar_reserved = resv->ar_orig_reserved = reserved;
241+ resv->ar_orig_reserved = hidden_space;
242+ resv->ar_reserved = ask - used;
220243
221244 trace_xfs_ag_resv_init(pag, type, ask);
222245 return 0;
fs/xfs/libxfs/xfs_bmap.c+26−0
@@ -5780,6 +5780,32 @@ del_cursor: · 5779 unmodified lines
57805780 return error;
57815781 }
57825782
5783+/* Make sure we won't be right-shifting an extent past the maximum bound. */
5784+int
5785+xfs_bmap_can_insert_extents(
5786+ struct xfs_inode *ip,
5787+ xfs_fileoff_t off,
5788+ xfs_fileoff_t shift)
5789+{
5790+ struct xfs_bmbt_irec got;
5791+ int is_empty;
5792+ int error = 0;
5793+
5794+ ASSERT(xfs_isilocked(ip, XFS_IOLOCK_EXCL));
5795+
5796+ if (XFS_FORCED_SHUTDOWN(ip->i_mount))
5797+ return -EIO;
5798+
5799+ xfs_ilock(ip, XFS_ILOCK_EXCL);
5800+ error = xfs_bmap_last_extent(NULL, ip, XFS_DATA_FORK, &got, &is_empty);
5801+ if (!error && !is_empty && got.br_startoff >= off &&
5802+ ((got.br_startoff + shift) & BMBT_STARTOFF_MASK) < got.br_startoff)
5803+ error = -EINVAL;
5804+ xfs_iunlock(ip, XFS_ILOCK_EXCL);
5805+
5806+ return error;
5807+}
5808+
57835809 int
57845810 xfs_bmap_insert_extents(
57855811 struct xfs_trans *tp,
fs/xfs/libxfs/xfs_bmap.h+2−0
@@ -227,6 +227,8 @@ int xfs_bmap_collapse_extents(struct xfs_trans *tp, struct xfs_inode *ip, · 226 unmodified lines
227227 xfs_fileoff_t *next_fsb, xfs_fileoff_t offset_shift_fsb,
228228 bool *done, xfs_fsblock_t *firstblock,
229229 struct xfs_defer_ops *dfops);
230+int xfs_bmap_can_insert_extents(struct xfs_inode *ip, xfs_fileoff_t off,
231+ xfs_fileoff_t shift);
230232 int xfs_bmap_insert_extents(struct xfs_trans *tp, struct xfs_inode *ip,
231233 xfs_fileoff_t *next_fsb, xfs_fileoff_t offset_shift_fsb,
232234 bool *done, xfs_fileoff_t stop_fsb, xfs_fsblock_t *firstblock,
fs/xfs/libxfs/xfs_format.h+5−0
@@ -962,6 +962,9 @@ typedef enum xfs_dinode_fmt { · 961 unmodified lines
962962 XFS_DFORK_DSIZE(dip, mp) : \
963963 XFS_DFORK_ASIZE(dip, mp))
964964
965+#define XFS_DFORK_MAXEXT(dip, mp, w) \
966+ (XFS_DFORK_SIZE(dip, mp, w) / sizeof(struct xfs_bmbt_rec))
967+
965968 /*
966969 * Return pointers to the data or attribute forks.
967970 */
@@ -1526,6 +1529,8 @@ typedef struct xfs_bmdr_block { · 558 unmodified lines
15261529 #define BMBT_STARTBLOCK_BITLEN 52
15271530 #define BMBT_BLOCKCOUNT_BITLEN 21
15281531
1532+#define BMBT_STARTOFF_MASK ((1ULL << BMBT_STARTOFF_BITLEN) - 1)
1533+
15291534 typedef struct xfs_bmbt_rec {
15301535 __be64 l0, l1;
15311536 } xfs_bmbt_rec_t;
fs/xfs/libxfs/xfs_inode_buf.c+47−29
@@ -374,6 +374,47 @@ xfs_log_dinode_to_disk( · 373 unmodified lines
374374 }
375375 }
376376
377+static xfs_failaddr_t
378+xfs_dinode_verify_fork(
379+ struct xfs_dinode *dip,
380+ struct xfs_mount *mp,
381+ int whichfork)
382+{
383+ uint32_t di_nextents = XFS_DFORK_NEXTENTS(dip, whichfork);
384+
385+ switch (XFS_DFORK_FORMAT(dip, whichfork)) {
386+ case XFS_DINODE_FMT_LOCAL:
387+ /*
388+ * no local regular files yet
389+ */
390+ if (whichfork == XFS_DATA_FORK) {
391+ if (S_ISREG(be16_to_cpu(dip->di_mode)))
392+ return __this_address;
393+ if (be64_to_cpu(dip->di_size) >
394+ XFS_DFORK_SIZE(dip, mp, whichfork))
395+ return __this_address;
396+ }
397+ if (di_nextents)
398+ return __this_address;
399+ break;
400+ case XFS_DINODE_FMT_EXTENTS:
401+ if (di_nextents > XFS_DFORK_MAXEXT(dip, mp, whichfork))
402+ return __this_address;
403+ break;
404+ case XFS_DINODE_FMT_BTREE:
405+ if (whichfork == XFS_ATTR_FORK) {
406+ if (di_nextents > MAXAEXTNUM)
407+ return __this_address;
408+ } else if (di_nextents > MAXEXTNUM) {
409+ return __this_address;
410+ }
411+ break;
412+ default:
413+ return __this_address;
414+ }
415+ return NULL;
416+}
417+
377418 xfs_failaddr_t
378419 xfs_dinode_verify(
379420 struct xfs_mount *mp,
@@ -441,24 +482,9 @@ xfs_dinode_verify( · 61 unmodified lines
441482 case S_IFREG:
442483 case S_IFLNK:
443484 case S_IFDIR:
444− switch (dip->di_format) {
445− case XFS_DINODE_FMT_LOCAL:
446− /*
447− * no local regular files yet
448− */
449− if (S_ISREG(mode))
450− return __this_address;
451− if (di_size > XFS_DFORK_DSIZE(dip, mp))
452− return __this_address;
453− if (dip->di_nextents)
454− return __this_address;
455− /* fall through */
456− case XFS_DINODE_FMT_EXTENTS:
457− case XFS_DINODE_FMT_BTREE:
458− break;
459− default:
460− return __this_address;
461− }
485+ fa = xfs_dinode_verify_fork(dip, mp, XFS_DATA_FORK);
486+ if (fa)
487+ return fa;
462488 break;
463489 case 0:
464490 /* Uninitialized inode ok. */
@@ -468,17 +494,9 @@ xfs_dinode_verify( · 3 unmodified lines
468494 }
469495
470496 if (XFS_DFORK_Q(dip)) {
471− switch (dip->di_aformat) {
472− case XFS_DINODE_FMT_LOCAL:
473− if (dip->di_anextents)
474− return __this_address;
475− /* fall through */
476− case XFS_DINODE_FMT_EXTENTS:
477− case XFS_DINODE_FMT_BTREE:
478− break;
479− default:
480− return __this_address;
481− }
497+ fa = xfs_dinode_verify_fork(dip, mp, XFS_ATTR_FORK);
498+ if (fa)
499+ return fa;
482500 } else {
483501 /*
484502 * If there is no fork offset, this may be a freshly-made inode
fs/xfs/libxfs/xfs_rtbitmap.c+2−2
@@ -1029,8 +1029,8 @@ xfs_rtalloc_query_range( · 1028 unmodified lines
10291029 if (low_rec->ar_startext >= mp->m_sb.sb_rextents ||
10301030 low_rec->ar_startext == high_rec->ar_startext)
10311031 return 0;
1032− if (high_rec->ar_startext >= mp->m_sb.sb_rextents)
1033− high_rec->ar_startext = mp->m_sb.sb_rextents - 1;
1032+ if (high_rec->ar_startext > mp->m_sb.sb_rextents)
1033+ high_rec->ar_startext = mp->m_sb.sb_rextents;
10341034
10351035 /* Iterate the bitmap, looking for discrepancies. */
10361036 rtstart = low_rec->ar_startext;
fs/xfs/xfs_bmap_util.c+52−54
@@ -685,12 +685,10 @@ out_unlock_iolock: · 684 unmodified lines
685685 }
686686
687687 /*
688− * dead simple method of punching delalyed allocation blocks from a range in
689− * the inode. Walks a block at a time so will be slow, but is only executed in
690− * rare error cases so the overhead is not critical. This will always punch out
691− * both the start and end blocks, even if the ranges only partially overlap
692− * them, so it is up to the caller to ensure that partial blocks are not
693− * passed in.
688+ * Dead simple method of punching delalyed allocation blocks from a range in
689+ * the inode. This will always punch out both the start and end blocks, even
690+ * if the ranges only partially overlap them, so it is up to the caller to
691+ * ensure that partial blocks are not passed in.
694692 */
695693 int
696694 xfs_bmap_punch_delalloc_range(
@@ -698,63 +696,44 @@ xfs_bmap_punch_delalloc_range( · 1 unmodified line
698696 xfs_fileoff_t start_fsb,
699697 xfs_fileoff_t length)
700698 {
701− xfs_fileoff_t remaining = length;
699+ struct xfs_ifork *ifp = &ip->i_df;
700+ xfs_fileoff_t end_fsb = start_fsb + length;
701+ struct xfs_bmbt_irec got, del;
702+ struct xfs_iext_cursor icur;
702703 int error = 0;
703704
704705 ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL));
705706
706− do {
707− int done;
708− xfs_bmbt_irec_t imap;
709− int nimaps = 1;
710− xfs_fsblock_t firstblock;
711− struct xfs_defer_ops dfops;
707+ if (!(ifp->if_flags & XFS_IFEXTENTS)) {
708+ error = xfs_iread_extents(NULL, ip, XFS_DATA_FORK);
709+ if (error)
710+ return error;
711+ }
712712
713− /*
714− * Map the range first and check that it is a delalloc extent
715− * before trying to unmap the range. Otherwise we will be
716− * trying to remove a real extent (which requires a
717− * transaction) or a hole, which is probably a bad idea...
718− */
719− error = xfs_bmapi_read(ip, start_fsb, 1, &imap, &nimaps,
720− XFS_BMAPI_ENTIRE);
713+ if (!xfs_iext_lookup_extent_before(ip, ifp, &end_fsb, &icur, &got))
714+ return 0;
721715
722− if (error) {
723− /* something screwed, just bail */
724− if (!XFS_FORCED_SHUTDOWN(ip->i_mount)) {
725− xfs_alert(ip->i_mount,
726− "Failed delalloc mapping lookup ino %lld fsb %lld.",
727− ip->i_ino, start_fsb);
728− }
729− break;
730− }
731− if (!nimaps) {
732− /* nothing there */
733− goto next_block;
734− }
735− if (imap.br_startblock != DELAYSTARTBLOCK) {
736− /* been converted, ignore */
737− goto next_block;
738− }
739− WARN_ON(imap.br_blockcount == 0);
716+ while (got.br_startoff + got.br_blockcount > start_fsb) {
717+ del = got;
718+ xfs_trim_extent(&del, start_fsb, length);
740719
741720 /*
742− * Note: while we initialise the firstblock/dfops pair, they
743− * should never be used because blocks should never be
744− * allocated or freed for a delalloc extent and hence we need
745− * don't cancel or finish them after the xfs_bunmapi() call.
721+ * A delete can push the cursor forward. Step back to the
722+ * previous extent on non-delalloc or extents outside the
723+ * target range.
746724 */
747− xfs_defer_init(&dfops, &firstblock);
748− error = xfs_bunmapi(NULL, ip, start_fsb, 1, 0, 1, &firstblock,
749− &dfops, &done);
750− if (error)
751− break;
725+ if (!del.br_blockcount ||
726+ !isnullstartblock(del.br_startblock)) {
727+ if (!xfs_iext_prev_extent(ifp, &icur, &got))
728+ break;
729+ continue;
730+ }
752731
753− ASSERT(!xfs_defer_has_unfinished_work(&dfops));
754−next_block:
755− start_fsb++;
756− remaining--;
757− } while(remaining > 0);
732+ error = xfs_bmap_del_extent_delay(ip, XFS_DATA_FORK, &icur,
733+ &got, &del);
734+ if (error || !xfs_iext_get_extent(ifp, &icur, &got))
735+ break;
736+ }
758737
759738 return error;
760739 }
@@ -1208,7 +1187,22 @@ xfs_free_file_space( · 447 unmodified lines
12081187 return 0;
12091188 if (offset + len > XFS_ISIZE(ip))
12101189 len = XFS_ISIZE(ip) - offset;
1211− return iomap_zero_range(VFS_I(ip), offset, len, NULL, &xfs_iomap_ops);
1190+ error = iomap_zero_range(VFS_I(ip), offset, len, NULL, &xfs_iomap_ops);
1191+ if (error)
1192+ return error;
1193+
1194+ /*
1195+ * If we zeroed right up to EOF and EOF straddles a page boundary we
1196+ * must make sure that the post-EOF area is also zeroed because the
1197+ * page could be mmap'd and iomap_zero_range doesn't do that for us.
1198+ * Writeback of the eof page will do this, albeit clumsily.
1199+ */
1200+ if (offset + len >= XFS_ISIZE(ip) && ((offset + len) & PAGE_MASK)) {
1201+ error = filemap_write_and_wait_range(VFS_I(ip)->i_mapping,
1202+ (offset + len) & ~PAGE_MASK, LLONG_MAX);
1203+ }
1204+
1205+ return error;
12121206 }
12131207
12141208 /*
@@ -1404,6 +1398,10 @@ xfs_insert_file_space( · 189 unmodified lines
14041398
14051399 trace_xfs_insert_file_space(ip);
14061400
1401+ error = xfs_bmap_can_insert_extents(ip, stop_fsb, shift_fsb);
1402+ if (error)
1403+ return error;
1404+
14071405 error = xfs_prepare_shift(ip, offset);
14081406 if (error)
14091407 return error;
fs/xfs/xfs_fsmap.c+2−2
@@ -513,8 +513,8 @@ xfs_getfsmap_rtdev_rtbitmap_query( · 512 unmodified lines
513513 struct xfs_trans *tp,
514514 struct xfs_getfsmap_info *info)
515515 {
516− struct xfs_rtalloc_rec alow;
517− struct xfs_rtalloc_rec ahigh;
516+ struct xfs_rtalloc_rec alow = { 0 };
517+ struct xfs_rtalloc_rec ahigh = { 0 };
518518 int error;
519519
520520 xfs_ilock(tp->t_mountp->m_rbmip, XFS_ILOCK_SHARED);
fs/xfs/xfs_fsops.c+1−1
@@ -387,7 +387,7 @@ xfs_reserve_blocks( · 386 unmodified lines
387387 do {
388388 free = percpu_counter_sum(&mp->m_fdblocks) -
389389 mp->m_alloc_set_aside;
390− if (!free)
390+ if (free <= 0)
391391 break;
392392
393393 delta = request - mp->m_resblks;
fs/xfs/xfs_inode.c+21−36
@@ -3236,7 +3236,6 @@ xfs_iflush_cluster( · 3235 unmodified lines
32363236 struct xfs_inode *cip;
32373237 int nr_found;
32383238 int clcount = 0;
3239− int bufwasdelwri;
32403239 int i;
32413240
32423241 pag = xfs_perag_get(mp, XFS_INO_TO_AGNO(mp, ip->i_ino));
@@ -3360,37 +3359,22 @@ cluster_corrupt_out: · 117 unmodified lines
33603359 * inode buffer and shut down the filesystem.
33613360 */
33623361 rcu_read_unlock();
3363− /*
3364− * Clean up the buffer. If it was delwri, just release it --
3365− * brelse can handle it with no problems. If not, shut down the
3366− * filesystem before releasing the buffer.
3367− */
3368− bufwasdelwri = (bp->b_flags & _XBF_DELWRI_Q);
3369− if (bufwasdelwri)
3370− xfs_buf_relse(bp);
3371−
33723362 xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE);
33733363
3374− if (!bufwasdelwri) {
3375− /*
3376− * Just like incore_relse: if we have b_iodone functions,
3377− * mark the buffer as an error and call them. Otherwise
3378− * mark it as stale and brelse.
3379− */
3380− if (bp->b_iodone) {
3381− bp->b_flags &= ~XBF_DONE;
3382− xfs_buf_stale(bp);
3383− xfs_buf_ioerror(bp, -EIO);
3384− xfs_buf_ioend(bp);
3385− } else {
3386− xfs_buf_stale(bp);
3387− xfs_buf_relse(bp);
3388− }
3389− }
3390−
33913364 /*
3392− * Unlocks the flush lock
3365+ * We'll always have an inode attached to the buffer for completion
3366+ * process by the time we are called from xfs_iflush(). Hence we have
3367+ * always need to do IO completion processing to abort the inodes
3368+ * attached to the buffer. handle them just like the shutdown case in
3369+ * xfs_buf_submit().
33933370 */
3371+ ASSERT(bp->b_iodone);
3372+ bp->b_flags &= ~XBF_DONE;
3373+ xfs_buf_stale(bp);
3374+ xfs_buf_ioerror(bp, -EIO);
3375+ xfs_buf_ioend(bp);
3376+
3377+ /* abort the corrupt inode, as it was not attached to the buffer */
33943378 xfs_iflush_abort(cip, false);
33953379 kmem_free(cilist);
33963380 xfs_perag_put(pag);
@@ -3486,12 +3470,17 @@ xfs_iflush( · 89 unmodified lines
34863470 xfs_log_force(mp, 0);
34873471
34883472 /*
3489− * inode clustering:
3490− * see if other inodes can be gathered into this write
3473+ * inode clustering: try to gather other inodes into this write
3474+ *
3475+ * Note: Any error during clustering will result in the filesystem
3476+ * being shut down and completion callbacks run on the cluster buffer.
3477+ * As we have already flushed and attached this inode to the buffer,
3478+ * it has already been aborted and released by xfs_iflush_cluster() and
3479+ * so we have no further error handling to do here.
34913480 */
34923481 error = xfs_iflush_cluster(ip, bp);
34933482 if (error)
3494− goto cluster_corrupt_out;
3483+ return error;
34953484
34963485 *bpp = bp;
34973486 return 0;
@@ -3500,12 +3489,8 @@ corrupt_out: · 2 unmodified lines
35003489 if (bp)
35013490 xfs_buf_relse(bp);
35023491 xfs_force_shutdown(mp, SHUTDOWN_CORRUPT_INCORE);
3503−cluster_corrupt_out:
3504− error = -EFSCORRUPTED;
35053492 abort_out:
3506− /*
3507− * Unlocks the flush lock
3508− */
3493+ /* abort the corrupt inode, as it was not attached to the buffer */
35093494 xfs_iflush_abort(ip, false);
35103495 return error;
35113496 }
fs/xfs/xfs_iomap.c+14−1
@@ -963,12 +963,13 @@ xfs_ilock_for_iomap( · 962 unmodified lines
963963 unsigned *lockmode)
964964 {
965965 unsigned mode = XFS_ILOCK_SHARED;
966+ bool is_write = flags & (IOMAP_WRITE | IOMAP_ZERO);
966967
967968 /*
968969 * COW writes may allocate delalloc space or convert unwritten COW
969970 * extents, so we need to make sure to take the lock exclusively here.
970971 */
971− if (xfs_is_reflink_inode(ip) && (flags & (IOMAP_WRITE | IOMAP_ZERO))) {
972+ if (xfs_is_reflink_inode(ip) && is_write) {
972973 /*
973974 * FIXME: It could still overwrite on unshared extents and not
974975 * need allocation.
@@ -989,6 +990,7 @@ xfs_ilock_for_iomap( · 14 unmodified lines
989990 mode = XFS_ILOCK_EXCL;
990991 }
991992
993+relock:
992994 if (flags & IOMAP_NOWAIT) {
993995 if (!xfs_ilock_nowait(ip, mode))
994996 return -EAGAIN;
@@ -996,6 +998,17 @@ xfs_ilock_for_iomap( · 1 unmodified line
996998 xfs_ilock(ip, mode);
997999 }
9981000
1001+ /*
1002+ * The reflink iflag could have changed since the earlier unlocked
1003+ * check, so if we got ILOCK_SHARED for a write and but we're now a
1004+ * reflink inode we have to switch to ILOCK_EXCL and relock.
1005+ */
1006+ if (mode == XFS_ILOCK_SHARED && is_write && xfs_is_reflink_inode(ip)) {
1007+ xfs_iunlock(ip, mode);
1008+ mode = XFS_ILOCK_EXCL;
1009+ goto relock;
1010+ }
1011+
9991012 *lockmode = mode;
10001013 return 0;
10011014 }
fs/xfs/xfs_trans.c+6−1
@@ -258,7 +258,12 @@ xfs_trans_alloc( · 257 unmodified lines
258258 if (!(flags & XFS_TRANS_NO_WRITECOUNT))
259259 sb_start_intwrite(mp->m_super);
260260
261− WARN_ON(mp->m_super->s_writers.frozen == SB_FREEZE_COMPLETE);
261+ /*
262+ * Zero-reservation ("empty") transactions can't modify anything, so
263+ * they're allowed to run while we're frozen.
264+ */
265+ WARN_ON(resp->tr_logres > 0 &&
266+ mp->m_super->s_writers.frozen == SB_FREEZE_COMPLETE);
262267 atomic_inc(&mp->m_active_trans);
263268
264269 tp = kmem_zone_zalloc(xfs_trans_zone,
include/acpi/processor.h+1−2
@@ -309,7 +309,7 @@ static inline void acpi_processor_ppc_exit(void) · 308 unmodified lines
309309 {
310310 return;
311311 }
312−static inline int acpi_processor_ppc_has_changed(struct acpi_processor *pr,
312+static inline void acpi_processor_ppc_has_changed(struct acpi_processor *pr,
313313 int event_flag)
314314 {
315315 static unsigned int printout = 1;
@@ -320,7 +320,6 @@ static inline int acpi_processor_ppc_has_changed(struct acpi_processor *pr, · 4 unmodified lines
320320 "Consider compiling CPUfreq support into your kernel.\n");
321321 printout = 0;
322322 }
323− return 0;
324323 }
325324 static inline int acpi_processor_get_bios_limit(int cpu, unsigned int *limit)
326325 {
include/asm-generic/qspinlock_types.h+1−1
@@ -63,7 +63,7 @@ typedef struct qspinlock { · 62 unmodified lines
6363 /*
6464 * Initializier
6565 */
66−#define __ARCH_SPIN_LOCK_UNLOCKED { .val = ATOMIC_INIT(0) }
66+#define __ARCH_SPIN_LOCK_UNLOCKED { { .val = ATOMIC_INIT(0) } }
6767
6868 /*
6969 * Bitfields in the atomic value:
include/crypto/if_alg.h+2−1
@@ -245,7 +245,8 @@ ssize_t af_alg_sendpage(struct socket *sock, struct page *page, · 244 unmodified lines
245245 int offset, size_t size, int flags);
246246 void af_alg_free_resources(struct af_alg_async_req *areq);
247247 void af_alg_async_cb(struct crypto_async_request *_req, int err);
248−__poll_t af_alg_poll_mask(struct socket *sock, __poll_t events);
248+__poll_t af_alg_poll(struct file *file, struct socket *sock,
249+ poll_table *wait);
249250 struct af_alg_async_req *af_alg_alloc_areq(struct sock *sk,
250251 unsigned int areqlen);
251252 int af_alg_get_rsgl(struct sock *sk, struct msghdr *msg, int flags,
include/linux/acpi.h+3−0
@@ -443,6 +443,9 @@ int acpi_check_resource_conflict(const struct resource *res); · 442 unmodified lines
443443 int acpi_check_region(resource_size_t start, resource_size_t n,
444444 const char *name);
445445
446+acpi_status acpi_release_memory(acpi_handle handle, struct resource *res,
447+ u32 level);
448+
446449 int acpi_resources_are_enforced(void);
447450
448451 #ifdef CONFIG_HIBERNATION
include/linux/atmdev.h+15−0
@@ -214,6 +214,7 @@ struct atmphy_ops { · 213 unmodified lines
214214 struct atm_skb_data {
215215 struct atm_vcc *vcc; /* ATM VCC */
216216 unsigned long atm_options; /* ATM layer options */
217+ unsigned int acct_truesize; /* truesize accounted to vcc */
217218 };
218219
219220 #define VCC_HTABLE_SIZE 32
@@ -241,6 +242,20 @@ void vcc_insert_socket(struct sock *sk); · 21 unmodified lines
241242
242243 void atm_dev_release_vccs(struct atm_dev *dev);
243244
245+static inline void atm_account_tx(struct atm_vcc *vcc, struct sk_buff *skb)
246+{
247+ /*
248+ * Because ATM skbs may not belong to a sock (and we don't
249+ * necessarily want to), skb->truesize may be adjusted,
250+ * escaping the hack in pskb_expand_head() which avoids
251+ * doing so for some cases. So stash the value of truesize
252+ * at the time we accounted it, and atm_pop_raw() can use
253+ * that value later, in case it changes.
254+ */
255+ refcount_add(skb->truesize, &sk_atm(vcc)->sk_wmem_alloc);
256+ ATM_SKB(skb)->acct_truesize = skb->truesize;
257+ ATM_SKB(skb)->atm_options = vcc->atm_options;
258+}
244259
245260 static inline void atm_force_charge(struct atm_vcc *vcc,int truesize)
246261 {
include/linux/backing-dev-defs.h+1−1
@@ -22,7 +22,6 @@ struct dentry; · 21 unmodified lines
2222 */
2323 enum wb_state {
2424 WB_registered, /* bdi_register() was done */
25− WB_shutting_down, /* wb_shutdown() in progress */
2625 WB_writeback_running, /* Writeback is in progress */
2726 WB_has_dirty_io, /* Dirty inodes on ->b_{dirty|io|more_io} */
2827 WB_start_all, /* nr_pages == 0 (all) work pending */
@@ -189,6 +188,7 @@ struct backing_dev_info { · 160 unmodified lines
189188 #ifdef CONFIG_CGROUP_WRITEBACK
190189 struct radix_tree_root cgwb_tree; /* radix tree of active cgroup wbs */
191190 struct rb_root cgwb_congested_tree; /* their congested states */
191+ struct mutex cgwb_release_mutex; /* protect shutdown of wb structs */
192192 #else
193193 struct bdi_writeback_congested *wb_congested;
194194 #endif
include/linux/blkdev.h+2−2
@@ -1119,8 +1119,8 @@ static inline unsigned int blk_max_size_offset(struct request_queue *q, · 1118 unmodified lines
11191119 if (!q->limits.chunk_sectors)
11201120 return q->limits.max_sectors;
11211121
1122− return q->limits.chunk_sectors -
1123− (offset & (q->limits.chunk_sectors - 1));
1122+ return min(q->limits.max_sectors, (unsigned int)(q->limits.chunk_sectors -
1123+ (offset & (q->limits.chunk_sectors - 1))));
11241124 }
11251125
11261126 static inline unsigned int blk_rq_get_max_sectors(struct request *rq,
include/linux/bpf.h+12−0
@@ -488,12 +488,15 @@ void bpf_patch_call_args(struct bpf_insn *insn, u32 stack_depth); · 487 unmodified lines
488488
489489 /* Map specifics */
490490 struct xdp_buff;
491+struct sk_buff;
491492
492493 struct bpf_dtab_netdev *__dev_map_lookup_elem(struct bpf_map *map, u32 key);
493494 void __dev_map_insert_ctx(struct bpf_map *map, u32 index);
494495 void __dev_map_flush(struct bpf_map *map);
495496 int dev_map_enqueue(struct bpf_dtab_netdev *dst, struct xdp_buff *xdp,
496497 struct net_device *dev_rx);
498+int dev_map_generic_redirect(struct bpf_dtab_netdev *dst, struct sk_buff *skb,
499+ struct bpf_prog *xdp_prog);
497500
498501 struct bpf_cpu_map_entry *__cpu_map_lookup_elem(struct bpf_map *map, u32 key);
499502 void __cpu_map_insert_ctx(struct bpf_map *map, u32 index);
@@ -586,6 +589,15 @@ int dev_map_enqueue(struct bpf_dtab_netdev *dst, struct xdp_buff *xdp, · 86 unmodified lines
586589 return 0;
587590 }
588591
592+struct sk_buff;
593+
594+static inline int dev_map_generic_redirect(struct bpf_dtab_netdev *dst,
595+ struct sk_buff *skb,
596+ struct bpf_prog *xdp_prog)
597+{
598+ return 0;
599+}
600+
589601 static inline
590602 struct bpf_cpu_map_entry *__cpu_map_lookup_elem(struct bpf_map *map, u32 key)
591603 {
include/linux/compat.h+7−1
@@ -72,6 +72,9 @@ · 71 unmodified lines
7272 */
7373 #ifndef COMPAT_SYSCALL_DEFINEx
7474 #define COMPAT_SYSCALL_DEFINEx(x, name, ...) \
75+ __diag_push(); \
76+ __diag_ignore(GCC, 8, "-Wattribute-alias", \
77+ "Type aliasing is used to sanitize syscall arguments");\
7578 asmlinkage long compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)); \
7679 asmlinkage long compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)) \
7780 __attribute__((alias(__stringify(__se_compat_sys##name)))); \
@@ -80,8 +83,11 @@ · 2 unmodified lines
8083 asmlinkage long __se_compat_sys##name(__MAP(x,__SC_LONG,__VA_ARGS__)); \
8184 asmlinkage long __se_compat_sys##name(__MAP(x,__SC_LONG,__VA_ARGS__)) \
8285 { \
83− return __do_compat_sys##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__));\
86+ long ret = __do_compat_sys##name(__MAP(x,__SC_DELOUSE,__VA_ARGS__));\
87+ __MAP(x,__SC_TEST,__VA_ARGS__); \
88+ return ret; \
8489 } \
90+ __diag_pop(); \
8591 static inline long __do_compat_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__))
8692 #endif /* COMPAT_SYSCALL_DEFINEx */
8793
include/linux/compiler-gcc.h+25−0
@@ -347,3 +347,28 @@ · 346 unmodified lines
347347 #if GCC_VERSION >= 50100
348348 #define COMPILER_HAS_GENERIC_BUILTIN_OVERFLOW 1
349349 #endif
350+
351+/*
352+ * Turn individual warnings and errors on and off locally, depending
353+ * on version.
354+ */
355+#define __diag_GCC(version, severity, s) \
356+ __diag_GCC_ ## version(__diag_GCC_ ## severity s)
357+
358+/* Severity used in pragma directives */
359+#define __diag_GCC_ignore ignored
360+#define __diag_GCC_warn warning
361+#define __diag_GCC_error error
362+
363+/* Compilers before gcc-4.6 do not understand "#pragma GCC diagnostic push" */
364+#if GCC_VERSION >= 40600
365+#define __diag_str1(s) #s
366+#define __diag_str(s) __diag_str1(s)
367+#define __diag(s) _Pragma(__diag_str(GCC diagnostic s))
368+#endif
369+
370+#if GCC_VERSION >= 80000
371+#define __diag_GCC_8(s) __diag(s)
372+#else
373+#define __diag_GCC_8(s)
374+#endif
include/linux/compiler_types.h+18−0
@@ -271,4 +271,22 @@ struct ftrace_likely_data { · 270 unmodified lines
271271 # define __native_word(t) (sizeof(t) == sizeof(char) || sizeof(t) == sizeof(short) || sizeof(t) == sizeof(int) || sizeof(t) == sizeof(long))
272272 #endif
273273
274+#ifndef __diag
275+#define __diag(string)
276+#endif
277+
278+#ifndef __diag_GCC
279+#define __diag_GCC(version, severity, string)
280+#endif
281+
282+#define __diag_push() __diag(push)
283+#define __diag_pop() __diag(pop)
284+
285+#define __diag_ignore(compiler, version, option, comment) \
286+ __diag_ ## compiler(version, ignore, option)
287+#define __diag_warn(compiler, version, option, comment) \
288+ __diag_ ## compiler(version, warn, option)
289+#define __diag_error(compiler, version, option, comment) \
290+ __diag_ ## compiler(version, error, option)
291+
274292 #endif /* __LINUX_COMPILER_TYPES_H */
include/linux/dax.h+1−1
@@ -135,7 +135,7 @@ void dax_flush(struct dax_device *dax_dev, void *addr, size_t size); · 134 unmodified lines
135135
136136 ssize_t dax_iomap_rw(struct kiocb *iocb, struct iov_iter *iter,
137137 const struct iomap_ops *ops);
138−int dax_iomap_fault(struct vm_fault *vmf, enum page_entry_size pe_size,
138+vm_fault_t dax_iomap_fault(struct vm_fault *vmf, enum page_entry_size pe_size,
139139 pfn_t *pfnp, int *errp, const struct iomap_ops *ops);
140140 vm_fault_t dax_finish_sync_fault(struct vm_fault *vmf,
141141 enum page_entry_size pe_size, pfn_t pfn);
include/linux/dma-contiguous.h+1−1
@@ -48,7 +48,7 @@ · 47 unmodified lines
4848 * CMA should not be used by the device drivers directly. It is
4949 * only a helper framework for dma-mapping subsystem.
5050 *
51− * For more information, see kernel-docs in drivers/base/dma-contiguous.c
51+ * For more information, see kernel-docs in kernel/dma/contiguous.c
5252 */
5353
5454 #ifdef __KERNEL__
include/linux/filter.h+60−23
@@ -19,6 +19,7 @@ · 18 unmodified lines
1919 #include <linux/cryptohash.h>
2020 #include <linux/set_memory.h>
2121 #include <linux/kallsyms.h>
22+#include <linux/if_vlan.h>
2223
2324 #include <net/sch_generic.h>
2425
@@ -469,8 +470,11 @@ struct sock_fprog_kern { · 444 unmodified lines
469470 };
470471
471472 struct bpf_binary_header {
472− unsigned int pages;
473− u8 image[];
473+ u16 pages;
474+ u16 locked:1;
475+
476+ /* Some arches need word alignment for their instructions */
477+ u8 image[] __aligned(4);
474478 };
475479
476480 struct bpf_prog {
@@ -671,15 +675,18 @@ bpf_ctx_narrow_access_ok(u32 off, u32 size, u32 size_default) · 194 unmodified lines
671675
672676 #define bpf_classic_proglen(fprog) (fprog->len * sizeof(fprog->filter[0]))
673677
674−#ifdef CONFIG_ARCH_HAS_SET_MEMORY
675678 static inline void bpf_prog_lock_ro(struct bpf_prog *fp)
676679 {
680+#ifdef CONFIG_ARCH_HAS_SET_MEMORY
677681 fp->locked = 1;
678− WARN_ON_ONCE(set_memory_ro((unsigned long)fp, fp->pages));
682+ if (set_memory_ro((unsigned long)fp, fp->pages))
683+ fp->locked = 0;
684+#endif
679685 }
680686
681687 static inline void bpf_prog_unlock_ro(struct bpf_prog *fp)
682688 {
689+#ifdef CONFIG_ARCH_HAS_SET_MEMORY
683690 if (fp->locked) {
684691 WARN_ON_ONCE(set_memory_rw((unsigned long)fp, fp->pages));
685692 /* In case set_memory_rw() fails, we want to be the first
@@ -687,34 +694,30 @@ static inline void bpf_prog_unlock_ro(struct bpf_prog *fp) · 1 unmodified line
687694 */
688695 fp->locked = 0;
689696 }
697+#endif
690698 }
691699
692700 static inline void bpf_jit_binary_lock_ro(struct bpf_binary_header *hdr)
693701 {
694− WARN_ON_ONCE(set_memory_ro((unsigned long)hdr, hdr->pages));
695−}
696−
697−static inline void bpf_jit_binary_unlock_ro(struct bpf_binary_header *hdr)
698−{
699− WARN_ON_ONCE(set_memory_rw((unsigned long)hdr, hdr->pages));
700−}
701−#else
702−static inline void bpf_prog_lock_ro(struct bpf_prog *fp)
703−{
704−}
705−
706−static inline void bpf_prog_unlock_ro(struct bpf_prog *fp)
707−{
708−}
709−
710−static inline void bpf_jit_binary_lock_ro(struct bpf_binary_header *hdr)
711−{
702+#ifdef CONFIG_ARCH_HAS_SET_MEMORY
703+ hdr->locked = 1;
704+ if (set_memory_ro((unsigned long)hdr, hdr->pages))
705+ hdr->locked = 0;
706+#endif
712707 }
713708
714709 static inline void bpf_jit_binary_unlock_ro(struct bpf_binary_header *hdr)
715710 {
711+#ifdef CONFIG_ARCH_HAS_SET_MEMORY
712+ if (hdr->locked) {
713+ WARN_ON_ONCE(set_memory_rw((unsigned long)hdr, hdr->pages));
714+ /* In case set_memory_rw() fails, we want to be the first
715+ * to crash here instead of some random place later on.
716+ */
717+ hdr->locked = 0;
718+ }
719+#endif
716720 }
717−#endif /* CONFIG_ARCH_HAS_SET_MEMORY */
718721
719722 static inline struct bpf_binary_header *
720723 bpf_jit_binary_hdr(const struct bpf_prog *fp)
@@ -725,6 +728,22 @@ bpf_jit_binary_hdr(const struct bpf_prog *fp) · 4 unmodified lines
725728 return (void *)addr;
726729 }
727730
731+#ifdef CONFIG_ARCH_HAS_SET_MEMORY
732+static inline int bpf_prog_check_pages_ro_single(const struct bpf_prog *fp)
733+{
734+ if (!fp->locked)
735+ return -ENOLCK;
736+ if (fp->jited) {
737+ const struct bpf_binary_header *hdr = bpf_jit_binary_hdr(fp);
738+
739+ if (!hdr->locked)
740+ return -ENOLCK;
741+ }
742+
743+ return 0;
744+}
745+#endif
746+
728747 int sk_filter_trim_cap(struct sock *sk, struct sk_buff *skb, unsigned int cap);
729748 static inline int sk_filter(struct sock *sk, struct sk_buff *skb)
730749 {
@@ -786,6 +805,21 @@ static inline bool bpf_dump_raw_ok(void) · 55 unmodified lines
786805 struct bpf_prog *bpf_patch_insn_single(struct bpf_prog *prog, u32 off,
787806 const struct bpf_insn *patch, u32 len);
788807
808+static inline int __xdp_generic_ok_fwd_dev(struct sk_buff *skb,
809+ struct net_device *fwd)
810+{
811+ unsigned int len;
812+
813+ if (unlikely(!(fwd->flags & IFF_UP)))
814+ return -ENETDOWN;
815+
816+ len = fwd->mtu + fwd->hard_header_len + VLAN_HLEN;
817+ if (skb->len > len)
818+ return -EMSGSIZE;
819+
820+ return 0;
821+}
822+
789823 /* The pair of xdp_do_redirect and xdp_do_flush_map MUST be called in the
790824 * same cpu context. Further for best results no more than a single map
791825 * for the do_redirect/do_flush pair should be used. This limitation is
@@ -961,6 +995,9 @@ static inline void bpf_prog_kallsyms_del(struct bpf_prog *fp) · 169 unmodified lines
961995 }
962996 #endif /* CONFIG_BPF_JIT */
963997
998+void bpf_prog_kallsyms_del_subprogs(struct bpf_prog *fp);
999+void bpf_prog_kallsyms_del_all(struct bpf_prog *fp);
1000+
9641001 #define BPF_ANC BIT(15)
9651002
9661003 static inline bool bpf_needs_clear_a(const struct sock_filter *first)
include/linux/fs.h+0−2
@@ -1720,8 +1720,6 @@ struct file_operations { · 1719 unmodified lines
17201720 int (*iterate) (struct file *, struct dir_context *);
17211721 int (*iterate_shared) (struct file *, struct dir_context *);
17221722 __poll_t (*poll) (struct file *, struct poll_table_struct *);
1723− struct wait_queue_head * (*get_poll_head)(struct file *, __poll_t);
1724− __poll_t (*poll_mask) (struct file *, __poll_t);
17251723 long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long);
17261724 long (*compat_ioctl) (struct file *, unsigned int, unsigned long);
17271725 int (*mmap) (struct file *, struct vm_area_struct *);
include/linux/iio/buffer-dma.h+1−1
@@ -141,7 +141,7 @@ int iio_dma_buffer_read(struct iio_buffer *buffer, size_t n, · 140 unmodified lines
141141 char __user *user_buffer);
142142 size_t iio_dma_buffer_data_available(struct iio_buffer *buffer);
143143 int iio_dma_buffer_set_bytes_per_datum(struct iio_buffer *buffer, size_t bpd);
144−int iio_dma_buffer_set_length(struct iio_buffer *buffer, int length);
144+int iio_dma_buffer_set_length(struct iio_buffer *buffer, unsigned int length);
145145 int iio_dma_buffer_request_update(struct iio_buffer *buffer);
146146
147147 int iio_dma_buffer_init(struct iio_dma_buffer_queue *queue,
include/linux/input/mt.h+1−1
@@ -100,7 +100,7 @@ static inline bool input_is_mt_axis(int axis) · 99 unmodified lines
100100 return axis == ABS_MT_SLOT || input_is_mt_value(axis);
101101 }
102102
103−void input_mt_report_slot_state(struct input_dev *dev,
103+bool input_mt_report_slot_state(struct input_dev *dev,
104104 unsigned int tool_type, bool active);
105105
106106 void input_mt_report_finger_count(struct input_dev *dev, int count);
include/linux/irq.h+1−0
@@ -503,6 +503,7 @@ struct irq_chip { · 502 unmodified lines
503503 * IRQCHIP_SKIP_SET_WAKE: Skip chip.irq_set_wake(), for this irq chip
504504 * IRQCHIP_ONESHOT_SAFE: One shot does not require mask/unmask
505505 * IRQCHIP_EOI_THREADED: Chip requires eoi() on unmask in threaded mode
506+ * IRQCHIP_SUPPORTS_LEVEL_MSI Chip can provide two doorbells for Level MSIs
506507 */
507508 enum {
508509 IRQCHIP_SET_TYPE_MASKED = (1 << 0),
include/linux/irqdesc.h+0−5
@@ -145,11 +145,6 @@ static inline void *irq_desc_get_handler_data(struct irq_desc *desc) · 144 unmodified lines
145145 return desc->irq_common_data.handler_data;
146146 }
147147
148−static inline struct msi_desc *irq_desc_get_msi_desc(struct irq_desc *desc)
149−{
150− return desc->irq_common_data.msi_desc;
151−}
152−
153148 /*
154149 * Architectures call this to let the generic IRQ layer
155150 * handle an interrupt.
include/linux/kernel.h+1−1
@@ -666,7 +666,7 @@ do { \ · 665 unmodified lines
666666 * your code. (Extra memory is used for special buffers that are
667667 * allocated when trace_printk() is used.)
668668 *
669− * A little optization trick is done here. If there's only one
669+ * A little optimization trick is done here. If there's only one
670670 * argument, there's no need to scan the string for printf formats.
671671 * The trace_puts() will suffice. But how can we take advantage of
672672 * using trace_puts() when trace_printk() has only one argument?
include/linux/memory.h+1−0
@@ -38,6 +38,7 @@ struct memory_block { · 37 unmodified lines
3838
3939 int arch_get_memory_phys_device(unsigned long start_pfn);
4040 unsigned long memory_block_size_bytes(void);
41+int set_memory_block_size_order(unsigned int order);
4142
4243 /* These states are exposed to userspace as text strings in sysfs */
4344 #define MEM_ONLINE (1<<0) /* exposed to userspace */
include/linux/mod_devicetable.h+1−0
@@ -501,6 +501,7 @@ enum dmi_field { · 500 unmodified lines
501501 DMI_PRODUCT_VERSION,
502502 DMI_PRODUCT_SERIAL,
503503 DMI_PRODUCT_UUID,
504+ DMI_PRODUCT_SKU,
504505 DMI_PRODUCT_FAMILY,
505506 DMI_BOARD_VENDOR,
506507 DMI_BOARD_NAME,
include/linux/net.h+0−1
@@ -147,7 +147,6 @@ struct proto_ops { · 146 unmodified lines
147147 int (*getname) (struct socket *sock,
148148 struct sockaddr *addr,
149149 int peer);
150− __poll_t (*poll_mask) (struct socket *sock, __poll_t events);
151150 __poll_t (*poll) (struct file *file, struct socket *sock,
152151 struct poll_table_struct *wait);
153152 int (*ioctl) (struct socket *sock, unsigned int cmd,
include/linux/nfs_xdr.h+2−0
@@ -1438,6 +1438,8 @@ enum { · 1437 unmodified lines
14381438 NFS_IOHDR_EOF,
14391439 NFS_IOHDR_REDO,
14401440 NFS_IOHDR_STAT,
1441+ NFS_IOHDR_RESEND_PNFS,
1442+ NFS_IOHDR_RESEND_MDS,
14411443 };
14421444
14431445 struct nfs_io_completion;
include/linux/pm_domain.h+3−3
@@ -234,7 +234,7 @@ struct generic_pm_domain *of_genpd_remove_last(struct device_node *np); · 233 unmodified lines
234234 int of_genpd_parse_idle_states(struct device_node *dn,
235235 struct genpd_power_state **states, int *n);
236236 unsigned int of_genpd_opp_to_performance_state(struct device *dev,
237− struct device_node *opp_node);
237+ struct device_node *np);
238238
239239 int genpd_dev_pm_attach(struct device *dev);
240240 struct device *genpd_dev_pm_attach_by_id(struct device *dev,
@@ -274,9 +274,9 @@ static inline int of_genpd_parse_idle_states(struct device_node *dn, · 33 unmodified lines
274274
275275 static inline unsigned int
276276 of_genpd_opp_to_performance_state(struct device *dev,
277− struct device_node *opp_node)
277+ struct device_node *np)
278278 {
279− return -ENODEV;
279+ return 0;
280280 }
281281
282282 static inline int genpd_dev_pm_attach(struct device *dev)
include/linux/poll.h+6−6
@@ -74,18 +74,18 @@ static inline void init_poll_funcptr(poll_table *pt, poll_queue_proc qproc) · 73 unmodified lines
7474 pt->_key = ~(__poll_t)0; /* all events enabled */
7575 }
7676
77−static inline bool file_has_poll_mask(struct file *file)
77+static inline bool file_can_poll(struct file *file)
7878 {
79− return file->f_op->get_poll_head && file->f_op->poll_mask;
79+ return file->f_op->poll;
8080 }
8181
82−static inline bool file_can_poll(struct file *file)
82+static inline __poll_t vfs_poll(struct file *file, struct poll_table_struct *pt)
8383 {
84− return file->f_op->poll || file_has_poll_mask(file);
84+ if (unlikely(!file->f_op->poll))
85+ return DEFAULT_POLLMASK;
86+ return file->f_op->poll(file, pt);
8587 }
8688
87−__poll_t vfs_poll(struct file *file, struct poll_table_struct *pt);
88−
8989 struct poll_table_entry {
9090 struct file *filp;
9191 __poll_t key;
include/linux/refcount.h+3−1
@@ -98,5 +98,7 @@ extern __must_check bool refcount_dec_if_one(refcount_t *r); · 97 unmodified lines
9898 extern __must_check bool refcount_dec_not_one(refcount_t *r);
9999 extern __must_check bool refcount_dec_and_mutex_lock(refcount_t *r, struct mutex *lock);
100100 extern __must_check bool refcount_dec_and_lock(refcount_t *r, spinlock_t *lock);
101−
101+extern __must_check bool refcount_dec_and_lock_irqsave(refcount_t *r,
102+ spinlock_t *lock,
103+ unsigned long *flags);
102104 #endif /* _LINUX_REFCOUNT_H */
include/linux/rmi.h+2−0
@@ -354,6 +354,8 @@ struct rmi_driver_data { · 353 unmodified lines
354354 struct mutex irq_mutex;
355355 struct input_dev *input;
356356
357+ struct irq_domain *irqdomain;
358+
357359 u8 pdt_props;
358360
359361 u8 num_rx_electrodes;
include/linux/scatterlist.h+0−18
@@ -9,9 +9,6 @@ · 8 unmodified lines
99 #include <asm/io.h>
1010
1111 struct scatterlist {
12−#ifdef CONFIG_DEBUG_SG
13− unsigned long sg_magic;
14−#endif
1512 unsigned long page_link;
1613 unsigned int offset;
1714 unsigned int length;
@@ -64,7 +61,6 @@ struct sg_table { · 46 unmodified lines
6461 *
6562 */
6663
67−#define SG_MAGIC 0x87654321
6864 #define SG_CHAIN 0x01UL
6965 #define SG_END 0x02UL
7066
@@ -98,7 +94,6 @@ static inline void sg_assign_page(struct scatterlist *sg, struct page *page) · 27 unmodified lines
9894 */
9995 BUG_ON((unsigned long) page & (SG_CHAIN | SG_END));
10096 #ifdef CONFIG_DEBUG_SG
101− BUG_ON(sg->sg_magic != SG_MAGIC);
10297 BUG_ON(sg_is_chain(sg));
10398 #endif
10499 sg->page_link = page_link | (unsigned long) page;
@@ -129,7 +124,6 @@ static inline void sg_set_page(struct scatterlist *sg, struct page *page, · 24 unmodified lines
129124 static inline struct page *sg_page(struct scatterlist *sg)
130125 {
131126 #ifdef CONFIG_DEBUG_SG
132− BUG_ON(sg->sg_magic != SG_MAGIC);
133127 BUG_ON(sg_is_chain(sg));
134128 #endif
135129 return (struct page *)((sg)->page_link & ~(SG_CHAIN | SG_END));
@@ -195,9 +189,6 @@ static inline void sg_chain(struct scatterlist *prv, unsigned int prv_nents, · 59 unmodified lines
195189 **/
196190 static inline void sg_mark_end(struct scatterlist *sg)
197191 {
198−#ifdef CONFIG_DEBUG_SG
199− BUG_ON(sg->sg_magic != SG_MAGIC);
200−#endif
201192 /*
202193 * Set termination bit, clear potential chain bit
203194 */
@@ -215,9 +206,6 @@ static inline void sg_mark_end(struct scatterlist *sg) · 11 unmodified lines
215206 **/
216207 static inline void sg_unmark_end(struct scatterlist *sg)
217208 {
218−#ifdef CONFIG_DEBUG_SG
219− BUG_ON(sg->sg_magic != SG_MAGIC);
220−#endif
221209 sg->page_link &= ~SG_END;
222210 }
223211
@@ -260,12 +248,6 @@ static inline void *sg_virt(struct scatterlist *sg) · 36 unmodified lines
260248 static inline void sg_init_marker(struct scatterlist *sgl,
261249 unsigned int nents)
262250 {
263−#ifdef CONFIG_DEBUG_SG
264− unsigned int i;
265−
266− for (i = 0; i < nents; i++)
267− sgl[i].sg_magic = SG_MAGIC;
268−#endif
269251 sg_mark_end(&sgl[nents - 1]);
270252 }
271253
include/linux/sched.h+12−11
@@ -1799,20 +1799,22 @@ static inline void rseq_set_notify_resume(struct task_struct *t) · 1798 unmodified lines
17991799 set_tsk_thread_flag(t, TIF_NOTIFY_RESUME);
18001800 }
18011801
1802−void __rseq_handle_notify_resume(struct pt_regs *regs);
1802+void __rseq_handle_notify_resume(struct ksignal *sig, struct pt_regs *regs);
18031803
1804−static inline void rseq_handle_notify_resume(struct pt_regs *regs)
1804+static inline void rseq_handle_notify_resume(struct ksignal *ksig,
1805+ struct pt_regs *regs)
18051806 {
18061807 if (current->rseq)
1807− __rseq_handle_notify_resume(regs);
1808+ __rseq_handle_notify_resume(ksig, regs);
18081809 }
18091810
1810−static inline void rseq_signal_deliver(struct pt_regs *regs)
1811+static inline void rseq_signal_deliver(struct ksignal *ksig,
1812+ struct pt_regs *regs)
18111813 {
18121814 preempt_disable();
18131815 __set_bit(RSEQ_EVENT_SIGNAL_BIT, &current->rseq_event_mask);
18141816 preempt_enable();
1815− rseq_handle_notify_resume(regs);
1817+ rseq_handle_notify_resume(ksig, regs);
18161818 }
18171819
18181820 /* rseq_preempt() requires preemption to be disabled. */
@@ -1831,9 +1833,7 @@ static inline void rseq_migrate(struct task_struct *t) · 12 unmodified lines
18311833
18321834 /*
18331835 * If parent process has a registered restartable sequences area, the
1834− * child inherits. Only applies when forking a process, not a thread. In
1835− * case a parent fork() in the middle of a restartable sequence, set the
1836− * resume notifier to force the child to retry.
1836+ * child inherits. Only applies when forking a process, not a thread.
18371837 */
18381838 static inline void rseq_fork(struct task_struct *t, unsigned long clone_flags)
18391839 {
@@ -1847,7 +1847,6 @@ static inline void rseq_fork(struct task_struct *t, unsigned long clone_flags) · 7 unmodified lines
18471847 t->rseq_len = current->rseq_len;
18481848 t->rseq_sig = current->rseq_sig;
18491849 t->rseq_event_mask = current->rseq_event_mask;
1850− rseq_preempt(t);
18511850 }
18521851 }
18531852
@@ -1864,10 +1863,12 @@ static inline void rseq_execve(struct task_struct *t) · 10 unmodified lines
18641863 static inline void rseq_set_notify_resume(struct task_struct *t)
18651864 {
18661865 }
1867−static inline void rseq_handle_notify_resume(struct pt_regs *regs)
1866+static inline void rseq_handle_notify_resume(struct ksignal *ksig,
1867+ struct pt_regs *regs)
18681868 {
18691869 }
1870−static inline void rseq_signal_deliver(struct pt_regs *regs)
1870+static inline void rseq_signal_deliver(struct ksignal *ksig,
1871+ struct pt_regs *regs)
18711872 {
18721873 }
18731874 static inline void rseq_preempt(struct task_struct *t)
include/linux/skbuff.h+2−1
@@ -3252,7 +3252,8 @@ struct sk_buff *__skb_recv_datagram(struct sock *sk, unsigned flags, · 3251 unmodified lines
32523252 int *peeked, int *off, int *err);
32533253 struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned flags, int noblock,
32543254 int *err);
3255−__poll_t datagram_poll_mask(struct socket *sock, __poll_t events);
3255+__poll_t datagram_poll(struct file *file, struct socket *sock,
3256+ struct poll_table_struct *wait);
32563257 int skb_copy_datagram_iter(const struct sk_buff *from, int offset,
32573258 struct iov_iter *to, int size);
32583259 static inline int skb_copy_datagram_msg(const struct sk_buff *from, int offset,
include/linux/slub_def.h+4−0
@@ -155,8 +155,12 @@ struct kmem_cache { · 154 unmodified lines
155155
156156 #ifdef CONFIG_SYSFS
157157 #define SLAB_SUPPORTS_SYSFS
158+void sysfs_slab_unlink(struct kmem_cache *);
158159 void sysfs_slab_release(struct kmem_cache *);
159160 #else
161+static inline void sysfs_slab_unlink(struct kmem_cache *s)
162+{
163+}
160164 static inline void sysfs_slab_release(struct kmem_cache *s)
161165 {
162166 }
include/linux/spinlock.h+5−0
@@ -427,6 +427,11 @@ extern int _atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock); · 426 unmodified lines
427427 #define atomic_dec_and_lock(atomic, lock) \
428428 __cond_lock(lock, _atomic_dec_and_lock(atomic, lock))
429429
430+extern int _atomic_dec_and_lock_irqsave(atomic_t *atomic, spinlock_t *lock,
431+ unsigned long *flags);
432+#define atomic_dec_and_lock_irqsave(atomic, lock, flags) \
433+ __cond_lock(lock, _atomic_dec_and_lock_irqsave(atomic, lock, &(flags)))
434+
430435 int alloc_bucket_spinlocks(spinlock_t **locks, unsigned int *lock_mask,
431436 size_t max_size, unsigned int cpu_mult,
432437 gfp_t gfp);
include/linux/syscalls.h+4−0
@@ -231,6 +231,9 @@ static inline int is_syscall_trace_event(struct trace_event_call *tp_event) · 230 unmodified lines
231231 */
232232 #ifndef __SYSCALL_DEFINEx
233233 #define __SYSCALL_DEFINEx(x, name, ...) \
234+ __diag_push(); \
235+ __diag_ignore(GCC, 8, "-Wattribute-alias", \
236+ "Type aliasing is used to sanitize syscall arguments");\
234237 asmlinkage long sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)) \
235238 __attribute__((alias(__stringify(__se_sys##name)))); \
236239 ALLOW_ERROR_INJECTION(sys##name, ERRNO); \
@@ -243,6 +246,7 @@ static inline int is_syscall_trace_event(struct trace_event_call *tp_event) · 6 unmodified lines
243246 __PROTECT(x, ret,__MAP(x,__SC_ARGS,__VA_ARGS__)); \
244247 return ret; \
245248 } \
249+ __diag_pop(); \
246250 static inline long __do_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__))
247251 #endif /* __SYSCALL_DEFINEx */
248252
include/net/bluetooth/bluetooth.h+1−1
@@ -271,7 +271,7 @@ int bt_sock_recvmsg(struct socket *sock, struct msghdr *msg, size_t len, · 270 unmodified lines
271271 int flags);
272272 int bt_sock_stream_recvmsg(struct socket *sock, struct msghdr *msg,
273273 size_t len, int flags);
274−__poll_t bt_sock_poll_mask(struct socket *sock, __poll_t events);
274+__poll_t bt_sock_poll(struct file *file, struct socket *sock, poll_table *wait);
275275 int bt_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);
276276 int bt_sock_wait_state(struct sock *sk, int state, unsigned long timeo);
277277 int bt_sock_wait_ready(struct sock *sk, unsigned long flags);
include/net/ip6_fib.h+3−2
@@ -170,6 +170,7 @@ struct fib6_info { · 169 unmodified lines
170170 unused:3;
171171
172172 struct fib6_nh fib6_nh;
173+ struct rcu_head rcu;
173174 };
174175
175176 struct rt6_info {
@@ -273,7 +274,7 @@ static inline void ip6_rt_put(struct rt6_info *rt) · 97 unmodified lines
273274 }
274275
275276 struct fib6_info *fib6_info_alloc(gfp_t gfp_flags);
276−void fib6_info_destroy(struct fib6_info *f6i);
277+void fib6_info_destroy_rcu(struct rcu_head *head);
277278
278279 static inline void fib6_info_hold(struct fib6_info *f6i)
279280 {
@@ -283,7 +284,7 @@ static inline void fib6_info_hold(struct fib6_info *f6i) · 3 unmodified lines
283284 static inline void fib6_info_release(struct fib6_info *f6i)
284285 {
285286 if (f6i && atomic_dec_and_test(&f6i->fib6_ref))
286− fib6_info_destroy(f6i);
287+ call_rcu(&f6i->rcu, fib6_info_destroy_rcu);
287288 }
288289
289290 enum fib6_walk_state {
include/net/iucv/af_iucv.h+2−0
@@ -153,6 +153,8 @@ struct iucv_sock_list { · 152 unmodified lines
153153 atomic_t autobind_name;
154154 };
155155
156+__poll_t iucv_sock_poll(struct file *file, struct socket *sock,
157+ poll_table *wait);
156158 void iucv_sock_link(struct iucv_sock_list *l, struct sock *s);
157159 void iucv_sock_unlink(struct iucv_sock_list *l, struct sock *s);
158160 void iucv_accept_enqueue(struct sock *parent, struct sock *sk);
include/net/sctp/sctp.h+2−1
@@ -109,7 +109,8 @@ int sctp_backlog_rcv(struct sock *sk, struct sk_buff *skb); · 108 unmodified lines
109109 int sctp_inet_listen(struct socket *sock, int backlog);
110110 void sctp_write_space(struct sock *sk);
111111 void sctp_data_ready(struct sock *sk);
112−__poll_t sctp_poll_mask(struct socket *sock, __poll_t events);
112+__poll_t sctp_poll(struct file *file, struct socket *sock,
113+ poll_table *wait);
113114 void sctp_sock_rfree(struct sk_buff *skb);
114115 void sctp_copy_sock(struct sock *newsk, struct sock *sk,
115116 struct sctp_association *asoc);
include/net/tcp.h+2−1
@@ -388,7 +388,8 @@ bool tcp_peer_is_proven(struct request_sock *req, struct dst_entry *dst); · 387 unmodified lines
388388 void tcp_close(struct sock *sk, long timeout);
389389 void tcp_init_sock(struct sock *sk);
390390 void tcp_init_transfer(struct sock *sk, int bpf_op);
391−__poll_t tcp_poll_mask(struct socket *sock, __poll_t events);
391+__poll_t tcp_poll(struct file *file, struct socket *sock,
392+ struct poll_table_struct *wait);
392393 int tcp_getsockopt(struct sock *sk, int level, int optname,
393394 char __user *optval, int __user *optlen);
394395 int tcp_setsockopt(struct sock *sk, int level, int optname,
include/net/tls.h+4−2
@@ -109,7 +109,8 @@ struct tls_sw_context_rx { · 108 unmodified lines
109109
110110 struct strparser strp;
111111 void (*saved_data_ready)(struct sock *sk);
112− __poll_t (*sk_poll_mask)(struct socket *sock, __poll_t events);
112+ unsigned int (*sk_poll)(struct file *file, struct socket *sock,
113+ struct poll_table_struct *wait);
113114 struct sk_buff *recv_pkt;
114115 u8 control;
115116 bool decrypted;
@@ -224,7 +225,8 @@ void tls_sw_free_resources_tx(struct sock *sk); · 108 unmodified lines
224225 void tls_sw_free_resources_rx(struct sock *sk);
225226 int tls_sw_recvmsg(struct sock *sk, struct msghdr *msg, size_t len,
226227 int nonblock, int flags, int *addr_len);
227−__poll_t tls_sw_poll_mask(struct socket *sock, __poll_t events);
228+unsigned int tls_sw_poll(struct file *file, struct socket *sock,
229+ struct poll_table_struct *wait);
228230 ssize_t tls_sw_splice_read(struct socket *sock, loff_t *ppos,
229231 struct pipe_inode_info *pipe,
230232 size_t len, unsigned int flags);
include/net/udp.h+1−1
@@ -285,7 +285,7 @@ int udp_init_sock(struct sock *sk); · 284 unmodified lines
285285 int udp_pre_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len);
286286 int __udp_disconnect(struct sock *sk, int flags);
287287 int udp_disconnect(struct sock *sk, int flags);
288−__poll_t udp_poll_mask(struct socket *sock, __poll_t events);
288+__poll_t udp_poll(struct file *file, struct socket *sock, poll_table *wait);
289289 struct sk_buff *skb_udp_tunnel_segment(struct sk_buff *skb,
290290 netdev_features_t features,
291291 bool is_ipv6);
include/rdma/ib_verbs.h+8−5
@@ -3391,11 +3391,14 @@ int ib_process_cq_direct(struct ib_cq *cq, int budget); · 3390 unmodified lines
33913391 *
33923392 * Users can examine the cq structure to determine the actual CQ size.
33933393 */
3394−struct ib_cq *ib_create_cq(struct ib_device *device,
3395− ib_comp_handler comp_handler,
3396− void (*event_handler)(struct ib_event *, void *),
3397− void *cq_context,
3398− const struct ib_cq_init_attr *cq_attr);
3394+struct ib_cq *__ib_create_cq(struct ib_device *device,
3395+ ib_comp_handler comp_handler,
3396+ void (*event_handler)(struct ib_event *, void *),
3397+ void *cq_context,
3398+ const struct ib_cq_init_attr *cq_attr,
3399+ const char *caller);
3400+#define ib_create_cq(device, cmp_hndlr, evt_hndlr, cq_ctxt, cq_attr) \
3401+ __ib_create_cq((device), (cmp_hndlr), (evt_hndlr), (cq_ctxt), (cq_attr), KBUILD_MODNAME)
33993402
34003403 /**
34013404 * ib_resize_cq - Modifies the capacity of the CQ.
include/uapi/linux/aio_abi.h+4−2
@@ -39,8 +39,10 @@ enum { · 38 unmodified lines
3939 IOCB_CMD_PWRITE = 1,
4040 IOCB_CMD_FSYNC = 2,
4141 IOCB_CMD_FDSYNC = 3,
42− /* 4 was the experimental IOCB_CMD_PREADX */
43− IOCB_CMD_POLL = 5,
42+ /* These two are experimental.
43+ * IOCB_CMD_PREADX = 4,
44+ * IOCB_CMD_POLL = 5,
45+ */
4446 IOCB_CMD_NOOP = 6,
4547 IOCB_CMD_PREADV = 7,
4648 IOCB_CMD_PWRITEV = 8,
include/uapi/linux/nbd.h+3−0
@@ -53,6 +53,9 @@ enum { · 52 unmodified lines
5353 /* These are client behavior specific flags. */
5454 #define NBD_CFLAG_DESTROY_ON_DISCONNECT (1 << 0) /* delete the nbd device on
5555 disconnect. */
56+#define NBD_CFLAG_DISCONNECT_ON_CLOSE (1 << 1) /* disconnect the nbd device on
57+ * close by last opener.
58+ */
5659
5760 /* userspace doesn't need the nbd_device structure */
5861
include/uapi/linux/target_core_user.h+3−1
@@ -44,6 +44,7 @@ · 43 unmodified lines
4444 #define TCMU_MAILBOX_VERSION 2
4545 #define ALIGN_SIZE 64 /* Should be enough for most CPUs */
4646 #define TCMU_MAILBOX_FLAG_CAP_OOOC (1 << 0) /* Out-of-order completions */
47+#define TCMU_MAILBOX_FLAG_CAP_READ_LEN (1 << 1) /* Read data length */
4748
4849 struct tcmu_mailbox {
4950 __u16 version;
@@ -71,6 +72,7 @@ struct tcmu_cmd_entry_hdr { · 21 unmodified lines
7172 __u16 cmd_id;
7273 __u8 kflags;
7374 #define TCMU_UFLAG_UNKNOWN_OP 0x1
75+#define TCMU_UFLAG_READ_LEN 0x2
7476 __u8 uflags;
7577
7678 } __packed;
@@ -119,7 +121,7 @@ struct tcmu_cmd_entry { · 42 unmodified lines
119121 __u8 scsi_status;
120122 __u8 __pad1;
121123 __u16 __pad2;
122− __u32 __pad3;
124+ __u32 read_len;
123125 char sense_buffer[TCMU_SENSE_BUFFERSIZE];
124126 } rsp;
125127 };
include/xen/xen.h+5−1
@@ -25,12 +25,16 @@ extern bool xen_pvh; · 24 unmodified lines
2525 #define xen_hvm_domain() (xen_domain_type == XEN_HVM_DOMAIN)
2626 #define xen_pvh_domain() (xen_pvh)
2727
28+#include <linux/types.h>
29+
30+extern uint32_t xen_start_flags;
31+
2832 #ifdef CONFIG_XEN_DOM0
2933 #include <xen/interface/xen.h>
3034 #include <asm/xen/hypervisor.h>
3135
3236 #define xen_initial_domain() (xen_domain() && \
33− xen_start_info && xen_start_info->flags & SIF_INITDOMAIN)
37+ (xen_start_flags & SIF_INITDOMAIN))
3438 #else /* !CONFIG_XEN_DOM0 */
3539 #define xen_initial_domain() (0)
3640 #endif /* CONFIG_XEN_DOM0 */
init/Kconfig+3−8
@@ -1051,10 +1051,9 @@ config LD_DEAD_CODE_DATA_ELIMINATION · 1050 unmodified lines
10511051 depends on HAVE_LD_DEAD_CODE_DATA_ELIMINATION
10521052 depends on EXPERT
10531053 help
1054− Select this if the architecture wants to do dead code and
1055− data elimination with the linker by compiling with
1056− -ffunction-sections -fdata-sections, and linking with
1057− --gc-sections.
1054+ Enable this if you want to do dead code and data elimination with
1055+ the linker by compiling with -ffunction-sections -fdata-sections,
1056+ and linking with --gc-sections.
10581057
10591058 This can reduce on disk and in-memory size of the kernel
10601059 code and static data, particularly for small configs and
@@ -1719,10 +1718,6 @@ source "arch/Kconfig" · 658 unmodified lines
17191718
17201719 endmenu # General setup
17211720
1722−config HAVE_GENERIC_DMA_COHERENT
1723− bool
1724− default n
1725−
17261721 config RT_MUTEXES
17271722 bool
17281723
kernel/Makefile+1−0
@@ -41,6 +41,7 @@ obj-y += printk/ · 40 unmodified lines
4141 obj-y += irq/
4242 obj-y += rcu/
4343 obj-y += livepatch/
44+obj-y += dma/
4445
4546 obj-$(CONFIG_CHECKPOINT_RESTORE) += kcmp.o
4647 obj-$(CONFIG_FREEZER) += freezer.o
kernel/bpf/core.c+62−7
@@ -350,6 +350,20 @@ struct bpf_prog *bpf_patch_insn_single(struct bpf_prog *prog, u32 off, · 349 unmodified lines
350350 return prog_adj;
351351 }
352352
353+void bpf_prog_kallsyms_del_subprogs(struct bpf_prog *fp)
354+{
355+ int i;
356+
357+ for (i = 0; i < fp->aux->func_cnt; i++)
358+ bpf_prog_kallsyms_del(fp->aux->func[i]);
359+}
360+
361+void bpf_prog_kallsyms_del_all(struct bpf_prog *fp)
362+{
363+ bpf_prog_kallsyms_del_subprogs(fp);
364+ bpf_prog_kallsyms_del(fp);
365+}
366+
353367 #ifdef CONFIG_BPF_JIT
354368 /* All BPF JIT sysctl knobs here. */
355369 int bpf_jit_enable __read_mostly = IS_BUILTIN(CONFIG_BPF_JIT_ALWAYS_ON);
@@ -584,6 +598,8 @@ bpf_jit_binary_alloc(unsigned int proglen, u8 **image_ptr, · 228 unmodified lines
584598 bpf_fill_ill_insns(hdr, size);
585599
586600 hdr->pages = size / PAGE_SIZE;
601+ hdr->locked = 0;
602+
587603 hole = min_t(unsigned int, size - (proglen + sizeof(*hdr)),
588604 PAGE_SIZE - sizeof(*hdr));
589605 start = (get_random_int() % hole) & ~(alignment - 1);
@@ -1434,6 +1450,33 @@ static int bpf_check_tail_call(const struct bpf_prog *fp) · 844 unmodified lines
14341450 return 0;
14351451 }
14361452
1453+static int bpf_prog_check_pages_ro_locked(const struct bpf_prog *fp)
1454+{
1455+#ifdef CONFIG_ARCH_HAS_SET_MEMORY
1456+ int i, err;
1457+
1458+ for (i = 0; i < fp->aux->func_cnt; i++) {
1459+ err = bpf_prog_check_pages_ro_single(fp->aux->func[i]);
1460+ if (err)
1461+ return err;
1462+ }
1463+
1464+ return bpf_prog_check_pages_ro_single(fp);
1465+#endif
1466+ return 0;
1467+}
1468+
1469+static void bpf_prog_select_func(struct bpf_prog *fp)
1470+{
1471+#ifndef CONFIG_BPF_JIT_ALWAYS_ON
1472+ u32 stack_depth = max_t(u32, fp->aux->stack_depth, 1);
1473+
1474+ fp->bpf_func = interpreters[(round_up(stack_depth, 32) / 32) - 1];
1475+#else
1476+ fp->bpf_func = __bpf_prog_ret0_warn;
1477+#endif
1478+}
1479+
14371480 /**
14381481 * bpf_prog_select_runtime - select exec runtime for BPF program
14391482 * @fp: bpf_prog populated with internal BPF program
@@ -1444,13 +1487,13 @@ static int bpf_check_tail_call(const struct bpf_prog *fp) · 4 unmodified lines
14441487 */
14451488 struct bpf_prog *bpf_prog_select_runtime(struct bpf_prog *fp, int *err)
14461489 {
1447−#ifndef CONFIG_BPF_JIT_ALWAYS_ON
1448− u32 stack_depth = max_t(u32, fp->aux->stack_depth, 1);
1490+ /* In case of BPF to BPF calls, verifier did all the prep
1491+ * work with regards to JITing, etc.
1492+ */
1493+ if (fp->bpf_func)
1494+ goto finalize;
14491495
1450− fp->bpf_func = interpreters[(round_up(stack_depth, 32) / 32) - 1];
1451−#else
1452− fp->bpf_func = __bpf_prog_ret0_warn;
1453−#endif
1496+ bpf_prog_select_func(fp);
14541497
14551498 /* eBPF JITs can rewrite the program in case constant
14561499 * blinding is active. However, in case of error during
@@ -1471,6 +1514,8 @@ struct bpf_prog *bpf_prog_select_runtime(struct bpf_prog *fp, int *err) · 14 unmodified lines
14711514 if (*err)
14721515 return fp;
14731516 }
1517+
1518+finalize:
14741519 bpf_prog_lock_ro(fp);
14751520
14761521 /* The tail call compatibility check can only be done at
@@ -1479,7 +1524,17 @@ struct bpf_prog *bpf_prog_select_runtime(struct bpf_prog *fp, int *err) · 2 unmodified lines
14791524 * all eBPF JITs might immediately support all features.
14801525 */
14811526 *err = bpf_check_tail_call(fp);
1482−
1527+ if (*err)
1528+ return fp;
1529+
1530+ /* Checkpoint: at this point onwards any cBPF -> eBPF or
1531+ * native eBPF program is read-only. If we failed to change
1532+ * the page attributes (e.g. allocation failure from
1533+ * splitting large pages), then reject the whole program
1534+ * in order to guarantee not ending up with any W+X pages
1535+ * from BPF side in kernel.
1536+ */
1537+ *err = bpf_prog_check_pages_ro_locked(fp);
14831538 return fp;
14841539 }
14851540 EXPORT_SYMBOL_GPL(bpf_prog_select_runtime);
kernel/bpf/devmap.c+14−0
@@ -345,6 +345,20 @@ int dev_map_enqueue(struct bpf_dtab_netdev *dst, struct xdp_buff *xdp, · 344 unmodified lines
345345 return bq_enqueue(dst, xdpf, dev_rx);
346346 }
347347
348+int dev_map_generic_redirect(struct bpf_dtab_netdev *dst, struct sk_buff *skb,
349+ struct bpf_prog *xdp_prog)
350+{
351+ int err;
352+
353+ err = __xdp_generic_ok_fwd_dev(skb, dst->dev);
354+ if (unlikely(err))
355+ return err;
356+ skb->dev = dst->dev;
357+ generic_xdp_tx(skb, xdp_prog);
358+
359+ return 0;
360+}
361+
348362 static void *dev_map_lookup_elem(struct bpf_map *map, void *key)
349363 {
350364 struct bpf_dtab_netdev *obj = __dev_map_lookup_elem(map, *(u32 *)key);
kernel/bpf/syscall.c+3−9
@@ -1034,14 +1034,9 @@ static void __bpf_prog_put_rcu(struct rcu_head *rcu) · 1033 unmodified lines
10341034 static void __bpf_prog_put(struct bpf_prog *prog, bool do_idr_lock)
10351035 {
10361036 if (atomic_dec_and_test(&prog->aux->refcnt)) {
1037− int i;
1038−
10391037 /* bpf_prog_free_id() must be called first */
10401038 bpf_prog_free_id(prog, do_idr_lock);
1041−
1042− for (i = 0; i < prog->aux->func_cnt; i++)
1043− bpf_prog_kallsyms_del(prog->aux->func[i]);
1044− bpf_prog_kallsyms_del(prog);
1039+ bpf_prog_kallsyms_del_all(prog);
10451040
10461041 call_rcu(&prog->aux->rcu, __bpf_prog_put_rcu);
10471042 }
@@ -1358,9 +1353,7 @@ static int bpf_prog_load(union bpf_attr *attr) · 310 unmodified lines
13581353 if (err < 0)
13591354 goto free_used_maps;
13601355
1361− /* eBPF program is ready to be JITed */
1362− if (!prog->bpf_func)
1363− prog = bpf_prog_select_runtime(prog, &err);
1356+ prog = bpf_prog_select_runtime(prog, &err);
13641357 if (err < 0)
13651358 goto free_used_maps;
13661359
@@ -1384,6 +1377,7 @@ static int bpf_prog_load(union bpf_attr *attr) · 17 unmodified lines
13841377 return err;
13851378
13861379 free_used_maps:
1380+ bpf_prog_kallsyms_del_subprogs(prog);
13871381 free_used_maps(prog->aux);
13881382 free_prog:
13891383 bpf_prog_uncharge_memlock(prog);
kernel/dma/Kconfig+50−0
@@ -0,0 +1,50 @@
1+
2+config HAS_DMA
3+ bool
4+ depends on !NO_DMA
5+ default y
6+
7+config NEED_SG_DMA_LENGTH
8+ bool
9+
10+config NEED_DMA_MAP_STATE
11+ bool
12+
13+config ARCH_DMA_ADDR_T_64BIT
14+ def_bool 64BIT || PHYS_ADDR_T_64BIT
15+
16+config HAVE_GENERIC_DMA_COHERENT
17+ bool
18+
19+config ARCH_HAS_SYNC_DMA_FOR_DEVICE
20+ bool
21+
22+config ARCH_HAS_SYNC_DMA_FOR_CPU
23+ bool
24+ select NEED_DMA_MAP_STATE
25+
26+config DMA_DIRECT_OPS
27+ bool
28+ depends on HAS_DMA
29+
30+config DMA_NONCOHERENT_OPS
31+ bool
32+ depends on HAS_DMA
33+ select DMA_DIRECT_OPS
34+
35+config DMA_NONCOHERENT_MMAP
36+ bool
37+ depends on DMA_NONCOHERENT_OPS
38+
39+config DMA_NONCOHERENT_CACHE_SYNC
40+ bool
41+ depends on DMA_NONCOHERENT_OPS
42+
43+config DMA_VIRT_OPS
44+ bool
45+ depends on HAS_DMA
46+
47+config SWIOTLB
48+ bool
49+ select DMA_DIRECT_OPS
50+ select NEED_DMA_MAP_STATE
kernel/dma/Makefile+11−0
@@ -0,0 +1,11 @@
1+# SPDX-License-Identifier: GPL-2.0
2+
3+obj-$(CONFIG_HAS_DMA) += mapping.o
4+obj-$(CONFIG_DMA_CMA) += contiguous.o
5+obj-$(CONFIG_HAVE_GENERIC_DMA_COHERENT) += coherent.o
6+obj-$(CONFIG_DMA_DIRECT_OPS) += direct.o
7+obj-$(CONFIG_DMA_NONCOHERENT_OPS) += noncoherent.o
8+obj-$(CONFIG_DMA_VIRT_OPS) += virt.o
9+obj-$(CONFIG_DMA_API_DEBUG) += debug.o
10+obj-$(CONFIG_SWIOTLB) += swiotlb.o
11+
kernel/dma/coherent.crenamed from drivers/base/dma-coherent.c+0−0

File renamed without changes.

kernel/dma/contiguous.crenamed from drivers/base/dma-contiguous.c+0−0

File renamed without changes.

kernel/dma/debug.crenamed from lib/dma-debug.c+0−0

File renamed without changes.

kernel/dma/direct.crenamed from lib/dma-direct.c+0−0

File renamed without changes.

kernel/dma/mapping.crenamed from drivers/base/dma-mapping.c+1−1
@@ -1,6 +1,6 @@
11 // SPDX-License-Identifier: GPL-2.0
22 /*
3− * drivers/base/dma-mapping.c - arch-independent dma-mapping routines
3+ * arch-independent dma-mapping routines
44 *
55 * Copyright (c) 2006 SUSE Linux Products GmbH
66 * Copyright (c) 2006 Tejun Heo <teheo@suse.de>
kernel/dma/noncoherent.crenamed from lib/dma-noncoherent.c+0−0

File renamed without changes.

kernel/dma/swiotlb.crenamed from lib/swiotlb.c+1−0
@@ -1085,3 +1085,4 @@ const struct dma_map_ops swiotlb_dma_ops = { · 1084 unmodified lines
10851085 .unmap_page = swiotlb_unmap_page,
10861086 .dma_supported = dma_direct_supported,
10871087 };
1088+EXPORT_SYMBOL(swiotlb_dma_ops);
kernel/dma/virt.crenamed from lib/dma-virt.c+0−2
@@ -1,7 +1,5 @@
11 // SPDX-License-Identifier: GPL-2.0
22 /*
3− * lib/dma-virt.c
4− *
53 * DMA operations that map to virtual addresses without flushing memory.
64 */
75 #include <linux/export.h>
kernel/events/core.c+1−1
@@ -6482,7 +6482,7 @@ void perf_prepare_sample(struct perf_event_header *header, · 6481 unmodified lines
64826482 data->phys_addr = perf_virt_to_phys(data->addr);
64836483 }
64846484
6485−static void __always_inline
6485+static __always_inline void
64866486 __perf_event_output(struct perf_event *event,
64876487 struct perf_sample_data *data,
64886488 struct pt_regs *regs,
kernel/events/ring_buffer.c+3−3
@@ -103,7 +103,7 @@ out: · 102 unmodified lines
103103 preempt_enable();
104104 }
105105
106−static bool __always_inline
106+static __always_inline bool
107107 ring_buffer_has_space(unsigned long head, unsigned long tail,
108108 unsigned long data_size, unsigned int size,
109109 bool backward)
@@ -114,7 +114,7 @@ ring_buffer_has_space(unsigned long head, unsigned long tail, · 4 unmodified lines
114114 return CIRC_SPACE(tail, head, data_size) >= size;
115115 }
116116
117−static int __always_inline
117+static __always_inline int
118118 __perf_output_begin(struct perf_output_handle *handle,
119119 struct perf_event *event, unsigned int size,
120120 bool backward)
@@ -414,7 +414,7 @@ err: · 293 unmodified lines
414414 }
415415 EXPORT_SYMBOL_GPL(perf_aux_output_begin);
416416
417−static bool __always_inline rb_need_aux_wakeup(struct ring_buffer *rb)
417+static __always_inline bool rb_need_aux_wakeup(struct ring_buffer *rb)
418418 {
419419 if (rb->aux_overwrite)
420420 return false;
kernel/irq/debugfs.c+1−0
@@ -55,6 +55,7 @@ static const struct irq_bit_descr irqchip_flags[] = { · 54 unmodified lines
5555 BIT_MASK_DESCR(IRQCHIP_SKIP_SET_WAKE),
5656 BIT_MASK_DESCR(IRQCHIP_ONESHOT_SAFE),
5757 BIT_MASK_DESCR(IRQCHIP_EOI_THREADED),
58+ BIT_MASK_DESCR(IRQCHIP_SUPPORTS_LEVEL_MSI),
5859 };
5960
6061 static void
kernel/locking/lockdep.c+6−6
@@ -1265,11 +1265,11 @@ unsigned long lockdep_count_forward_deps(struct lock_class *class) · 1264 unmodified lines
12651265 this.parent = NULL;
12661266 this.class = class;
12671267
1268− local_irq_save(flags);
1268+ raw_local_irq_save(flags);
12691269 arch_spin_lock(&lockdep_lock);
12701270 ret = __lockdep_count_forward_deps(&this);
12711271 arch_spin_unlock(&lockdep_lock);
1272− local_irq_restore(flags);
1272+ raw_local_irq_restore(flags);
12731273
12741274 return ret;
12751275 }
@@ -1292,11 +1292,11 @@ unsigned long lockdep_count_backward_deps(struct lock_class *class) · 16 unmodified lines
12921292 this.parent = NULL;
12931293 this.class = class;
12941294
1295− local_irq_save(flags);
1295+ raw_local_irq_save(flags);
12961296 arch_spin_lock(&lockdep_lock);
12971297 ret = __lockdep_count_backward_deps(&this);
12981298 arch_spin_unlock(&lockdep_lock);
1299− local_irq_restore(flags);
1299+ raw_local_irq_restore(flags);
13001300
13011301 return ret;
13021302 }
@@ -4411,7 +4411,7 @@ void debug_check_no_locks_freed(const void *mem_from, unsigned long mem_len) · 3108 unmodified lines
44114411 if (unlikely(!debug_locks))
44124412 return;
44134413
4414− local_irq_save(flags);
4414+ raw_local_irq_save(flags);
44154415 for (i = 0; i < curr->lockdep_depth; i++) {
44164416 hlock = curr->held_locks + i;
44174417
@@ -4422,7 +4422,7 @@ void debug_check_no_locks_freed(const void *mem_from, unsigned long mem_len) · 4 unmodified lines
44224422 print_freed_lock_bug(curr, mem_from, mem_from + mem_len, hlock);
44234423 break;
44244424 }
4425− local_irq_restore(flags);
4425+ raw_local_irq_restore(flags);
44264426 }
44274427 EXPORT_SYMBOL_GPL(debug_check_no_locks_freed);
44284428
kernel/locking/rwsem.c+1−0
@@ -181,6 +181,7 @@ void down_read_non_owner(struct rw_semaphore *sem) · 180 unmodified lines
181181 might_sleep();
182182
183183 __down_read(sem);
184+ rwsem_set_reader_owned(sem);
184185 }
185186
186187 EXPORT_SYMBOL(down_read_non_owner);
kernel/rseq.c+4−3
@@ -251,10 +251,10 @@ static int rseq_ip_fixup(struct pt_regs *regs) · 250 unmodified lines
251251 * respect to other threads scheduled on the same CPU, and with respect
252252 * to signal handlers.
253253 */
254−void __rseq_handle_notify_resume(struct pt_regs *regs)
254+void __rseq_handle_notify_resume(struct ksignal *ksig, struct pt_regs *regs)
255255 {
256256 struct task_struct *t = current;
257− int ret;
257+ int ret, sig;
258258
259259 if (unlikely(t->flags & PF_EXITING))
260260 return;
@@ -268,7 +268,8 @@ void __rseq_handle_notify_resume(struct pt_regs *regs) · 7 unmodified lines
268268 return;
269269
270270 error:
271− force_sig(SIGSEGV, t);
271+ sig = ksig ? ksig->sig : 0;
272+ force_sigsegv(sig, t);
272273 }
273274
274275 #ifdef CONFIG_DEBUG_RSEQ
kernel/softirq.c+5−1
@@ -139,9 +139,13 @@ static void __local_bh_enable(unsigned int cnt) · 138 unmodified lines
139139 {
140140 lockdep_assert_irqs_disabled();
141141
142+ if (preempt_count() == cnt)
143+ trace_preempt_on(CALLER_ADDR0, get_lock_parent_ip());
144+
142145 if (softirq_count() == (cnt & SOFTIRQ_MASK))
143146 trace_softirqs_on(_RET_IP_);
144− preempt_count_sub(cnt);
147+
148+ __preempt_count_sub(cnt);
145149 }
146150
147151 /*
kernel/time/hrtimer.c+1−1
@@ -1659,7 +1659,7 @@ EXPORT_SYMBOL_GPL(hrtimer_init_sleeper); · 1658 unmodified lines
16591659 int nanosleep_copyout(struct restart_block *restart, struct timespec64 *ts)
16601660 {
16611661 switch(restart->nanosleep.type) {
1662−#ifdef CONFIG_COMPAT
1662+#ifdef CONFIG_COMPAT_32BIT_TIME
16631663 case TT_COMPAT:
16641664 if (compat_put_timespec64(ts, restart->nanosleep.compat_rmtp))
16651665 return -EFAULT;
kernel/time/posix-cpu-timers.c+0−2
@@ -604,7 +604,6 @@ static int posix_cpu_timer_set(struct k_itimer *timer, int timer_flags, · 603 unmodified lines
604604 /*
605605 * Disarm any old timer after extracting its expiry time.
606606 */
607− lockdep_assert_irqs_disabled();
608607
609608 ret = 0;
610609 old_incr = timer->it.cpu.incr;
@@ -1049,7 +1048,6 @@ static void posix_cpu_timer_rearm(struct k_itimer *timer) · 438 unmodified lines
10491048 /*
10501049 * Now re-arm for the new expiry time.
10511050 */
1052− lockdep_assert_irqs_disabled();
10531051 arm_timer(timer);
10541052 unlock:
10551053 unlock_task_sighand(p, &flags);
kernel/time/time.c+4−2
@@ -28,6 +28,7 @@ · 27 unmodified lines
2828 */
2929
3030 #include <linux/export.h>
31+#include <linux/kernel.h>
3132 #include <linux/timex.h>
3233 #include <linux/capability.h>
3334 #include <linux/timekeeper_internal.h>
@@ -314,9 +315,10 @@ unsigned int jiffies_to_msecs(const unsigned long j) · 280 unmodified lines
314315 return (j + (HZ / MSEC_PER_SEC) - 1)/(HZ / MSEC_PER_SEC);
315316 #else
316317 # if BITS_PER_LONG == 32
317− return (HZ_TO_MSEC_MUL32 * j) >> HZ_TO_MSEC_SHR32;
318+ return (HZ_TO_MSEC_MUL32 * j + (1ULL << HZ_TO_MSEC_SHR32) - 1) >>
319+ HZ_TO_MSEC_SHR32;
318320 # else
319− return (j * HZ_TO_MSEC_NUM) / HZ_TO_MSEC_DEN;
321+ return DIV_ROUND_UP(j * HZ_TO_MSEC_NUM, HZ_TO_MSEC_DEN);
320322 # endif
321323 #endif
322324 }
kernel/trace/trace.c+1−5
@@ -1360,8 +1360,6 @@ __update_max_tr(struct trace_array *tr, struct task_struct *tsk, int cpu) · 1359 unmodified lines
13601360 void
13611361 update_max_tr(struct trace_array *tr, struct task_struct *tsk, int cpu)
13621362 {
1363− struct ring_buffer *buf;
1364−
13651363 if (tr->stop_count)
13661364 return;
13671365
@@ -1375,9 +1373,7 @@ update_max_tr(struct trace_array *tr, struct task_struct *tsk, int cpu) · 7 unmodified lines
13751373
13761374 arch_spin_lock(&tr->max_lock);
13771375
1378− buf = tr->trace_buffer.buffer;
1379− tr->trace_buffer.buffer = tr->max_buffer.buffer;
1380− tr->max_buffer.buffer = buf;
1376+ swap(tr->trace_buffer.buffer, tr->max_buffer.buffer);
13811377
13821378 __update_max_tr(tr, tsk, cpu);
13831379 arch_spin_unlock(&tr->max_lock);
kernel/trace/trace_events_filter.c+9−1
@@ -78,7 +78,8 @@ static const char * ops[] = { OPS }; · 77 unmodified lines
7878 C(TOO_MANY_PREDS, "Too many terms in predicate expression"), \
7979 C(INVALID_FILTER, "Meaningless filter expression"), \
8080 C(IP_FIELD_ONLY, "Only 'ip' field is supported for function trace"), \
81− C(INVALID_VALUE, "Invalid value (did you forget quotes)?"),
81+ C(INVALID_VALUE, "Invalid value (did you forget quotes)?"), \
82+ C(NO_FILTER, "No filter found"),
8283
8384 #undef C
8485 #define C(a, b) FILT_ERR_##a
@@ -550,6 +551,13 @@ predicate_parse(const char *str, int nr_parens, int nr_preds, · 465 unmodified lines
550551 goto out_free;
551552 }
552553
554+ if (!N) {
555+ /* No program? */
556+ ret = -EINVAL;
557+ parse_error(pe, FILT_ERR_NO_FILTER, ptr - str);
558+ goto out_free;
559+ }
560+
553561 prog[N].pred = NULL; /* #13 */
554562 prog[N].target = 1; /* TRUE */
555563 prog[N+1].pred = NULL;
lib/Kconfig+1−46
@@ -420,60 +420,15 @@ config HAS_IOPORT_MAP · 419 unmodified lines
420420 depends on HAS_IOMEM && !NO_IOPORT_MAP
421421 default y
422422
423−config HAS_DMA
424− bool
425− depends on !NO_DMA
426− default y
423+source "kernel/dma/Kconfig"
427424
428425 config SGL_ALLOC
429426 bool
430427 default n
431428
432−config NEED_SG_DMA_LENGTH
433− bool
434−
435−config NEED_DMA_MAP_STATE
436− bool
437−
438−config ARCH_DMA_ADDR_T_64BIT
439− def_bool 64BIT || PHYS_ADDR_T_64BIT
440−
441429 config IOMMU_HELPER
442430 bool
443431
444−config ARCH_HAS_SYNC_DMA_FOR_DEVICE
445− bool
446−
447−config ARCH_HAS_SYNC_DMA_FOR_CPU
448− bool
449− select NEED_DMA_MAP_STATE
450−
451−config DMA_DIRECT_OPS
452− bool
453− depends on HAS_DMA
454−
455−config DMA_NONCOHERENT_OPS
456− bool
457− depends on HAS_DMA
458− select DMA_DIRECT_OPS
459−
460−config DMA_NONCOHERENT_MMAP
461− bool
462− depends on DMA_NONCOHERENT_OPS
463−
464−config DMA_NONCOHERENT_CACHE_SYNC
465− bool
466− depends on DMA_NONCOHERENT_OPS
467−
468−config DMA_VIRT_OPS
469− bool
470− depends on HAS_DMA
471−
472−config SWIOTLB
473− bool
474− select DMA_DIRECT_OPS
475− select NEED_DMA_MAP_STATE
476−
477432 config CHECK_SIGNATURE
478433 bool
479434
lib/Kconfig.kasan+1−0
@@ -6,6 +6,7 @@ if HAVE_ARCH_KASAN · 5 unmodified lines
66 config KASAN
77 bool "KASan: runtime memory debugger"
88 depends on SLUB || (SLAB && !DEBUG_SLAB)
9+ select SLUB_DEBUG if SLUB
910 select CONSTRUCTORS
1011 select STACKDEPOT
1112 help
lib/Makefile+1−11
@@ -23,15 +23,12 @@ lib-y := ctype.o string.o vsprintf.o cmdline.o \ · 22 unmodified lines
2323 sha1.o chacha20.o irq_regs.o argv_split.o \
2424 flex_proportions.o ratelimit.o show_mem.o \
2525 is_single_threaded.o plist.o decompress.o kobject_uevent.o \
26− earlycpio.o seq_buf.o siphash.o \
26+ earlycpio.o seq_buf.o siphash.o dec_and_lock.o \
2727 nmi_backtrace.o nodemask.o win_minmax.o
2828
2929 lib-$(CONFIG_PRINTK) += dump_stack.o
3030 lib-$(CONFIG_MMU) += ioremap.o
3131 lib-$(CONFIG_SMP) += cpumask.o
32−lib-$(CONFIG_DMA_DIRECT_OPS) += dma-direct.o
33−lib-$(CONFIG_DMA_NONCOHERENT_OPS) += dma-noncoherent.o
34−lib-$(CONFIG_DMA_VIRT_OPS) += dma-virt.o
3532
3633 lib-y += kobject.o klist.o
3734 obj-y += lockref.o
@@ -98,10 +95,6 @@ obj-$(CONFIG_DEBUG_PREEMPT) += smp_processor_id.o · 60 unmodified lines
9895 obj-$(CONFIG_DEBUG_LIST) += list_debug.o
9996 obj-$(CONFIG_DEBUG_OBJECTS) += debugobjects.o
10097
101−ifneq ($(CONFIG_HAVE_DEC_LOCK),y)
102− lib-y += dec_and_lock.o
103−endif
104−
10598 obj-$(CONFIG_BITREVERSE) += bitrev.o
10699 obj-$(CONFIG_RATIONAL) += rational.o
107100 obj-$(CONFIG_CRC_CCITT) += crc-ccitt.o
@@ -148,7 +141,6 @@ obj-$(CONFIG_SMP) += percpu_counter.o · 40 unmodified lines
148141 obj-$(CONFIG_AUDIT_GENERIC) += audit.o
149142 obj-$(CONFIG_AUDIT_COMPAT_GENERIC) += compat_audit.o
150143
151−obj-$(CONFIG_SWIOTLB) += swiotlb.o
152144 obj-$(CONFIG_IOMMU_HELPER) += iommu-helper.o
153145 obj-$(CONFIG_FAULT_INJECTION) += fault-inject.o
154146 obj-$(CONFIG_NOTIFIER_ERROR_INJECTION) += notifier-error-inject.o
@@ -169,8 +161,6 @@ obj-$(CONFIG_NLATTR) += nlattr.o · 14 unmodified lines
169161
170162 obj-$(CONFIG_LRU_CACHE) += lru_cache.o
171163
172−obj-$(CONFIG_DMA_API_DEBUG) += dma-debug.o
173−
174164 obj-$(CONFIG_GENERIC_CSUM) += checksum.o
175165
176166 obj-$(CONFIG_GENERIC_ATOMIC64) += atomic64.o
lib/dec_and_lock.c+16−0
@@ -33,3 +33,19 @@ int _atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock) · 32 unmodified lines
3333 }
3434
3535 EXPORT_SYMBOL(_atomic_dec_and_lock);
36+
37+int _atomic_dec_and_lock_irqsave(atomic_t *atomic, spinlock_t *lock,
38+ unsigned long *flags)
39+{
40+ /* Subtract 1 from counter unless that drops it to 0 (ie. it was 1) */
41+ if (atomic_add_unless(atomic, -1, 1))
42+ return 0;
43+
44+ /* Otherwise do it the slow way */
45+ spin_lock_irqsave(lock, *flags);
46+ if (atomic_dec_and_test(atomic))
47+ return 1;
48+ spin_unlock_irqrestore(lock, *flags);
49+ return 0;
50+}
51+EXPORT_SYMBOL(_atomic_dec_and_lock_irqsave);
lib/percpu_ida.c+1−1
@@ -141,7 +141,7 @@ int percpu_ida_alloc(struct percpu_ida *pool, int state) · 140 unmodified lines
141141 spin_lock_irqsave(&tags->lock, flags);
142142
143143 /* Fastpath */
144− if (likely(tags->nr_free >= 0)) {
144+ if (likely(tags->nr_free)) {
145145 tag = tags->freelist[--tags->nr_free];
146146 spin_unlock_irqrestore(&tags->lock, flags);
147147 return tag;
lib/refcount.c+28−0
@@ -350,3 +350,31 @@ bool refcount_dec_and_lock(refcount_t *r, spinlock_t *lock) · 349 unmodified lines
350350 }
351351 EXPORT_SYMBOL(refcount_dec_and_lock);
352352
353+/**
354+ * refcount_dec_and_lock_irqsave - return holding spinlock with disabled
355+ * interrupts if able to decrement refcount to 0
356+ * @r: the refcount
357+ * @lock: the spinlock to be locked
358+ * @flags: saved IRQ-flags if the is acquired
359+ *
360+ * Same as refcount_dec_and_lock() above except that the spinlock is acquired
361+ * with disabled interupts.
362+ *
363+ * Return: true and hold spinlock if able to decrement refcount to 0, false
364+ * otherwise
365+ */
366+bool refcount_dec_and_lock_irqsave(refcount_t *r, spinlock_t *lock,
367+ unsigned long *flags)
368+{
369+ if (refcount_dec_not_one(r))
370+ return false;
371+
372+ spin_lock_irqsave(lock, *flags);
373+ if (!refcount_dec_and_test(r)) {
374+ spin_unlock_irqrestore(lock, *flags);
375+ return false;
376+ }
377+
378+ return true;
379+}
380+EXPORT_SYMBOL(refcount_dec_and_lock_irqsave);
lib/scatterlist.c+0−6
@@ -24,9 +24,6 @@ · 23 unmodified lines
2424 **/
2525 struct scatterlist *sg_next(struct scatterlist *sg)
2626 {
27−#ifdef CONFIG_DEBUG_SG
28− BUG_ON(sg->sg_magic != SG_MAGIC);
29−#endif
3027 if (sg_is_last(sg))
3128 return NULL;
3229
@@ -111,10 +108,7 @@ struct scatterlist *sg_last(struct scatterlist *sgl, unsigned int nents) · 78 unmodified lines
111108 for_each_sg(sgl, sg, nents, i)
112109 ret = sg;
113110
114−#ifdef CONFIG_DEBUG_SG
115− BUG_ON(sgl[0].sg_magic != SG_MAGIC);
116111 BUG_ON(!sg_is_last(ret));
117−#endif
118112 return ret;
119113 }
120114 EXPORT_SYMBOL(sg_last);
lib/test_printf.c+0−7
@@ -260,13 +260,6 @@ plain(void) · 259 unmodified lines
260260 {
261261 int err;
262262
263− /*
264− * Make sure crng is ready. Otherwise we get "(ptrval)" instead
265− * of a hashed address when printing '%p' in plain_hash() and
266− * plain_format().
267− */
268− wait_for_random_bytes();
269−
270263 err = plain_hash();
271264 if (err) {
272265 pr_warn("plain 'p' does not appear to be hashed\n");
mm/backing-dev.c+7−13
@@ -359,15 +359,8 @@ static void wb_shutdown(struct bdi_writeback *wb) · 358 unmodified lines
359359 spin_lock_bh(&wb->work_lock);
360360 if (!test_and_clear_bit(WB_registered, &wb->state)) {
361361 spin_unlock_bh(&wb->work_lock);
362− /*
363− * Wait for wb shutdown to finish if someone else is just
364− * running wb_shutdown(). Otherwise we could proceed to wb /
365− * bdi destruction before wb_shutdown() is finished.
366− */
367− wait_on_bit(&wb->state, WB_shutting_down, TASK_UNINTERRUPTIBLE);
368362 return;
369363 }
370− set_bit(WB_shutting_down, &wb->state);
371364 spin_unlock_bh(&wb->work_lock);
372365
373366 cgwb_remove_from_bdi_list(wb);
@@ -379,12 +372,6 @@ static void wb_shutdown(struct bdi_writeback *wb) · 5 unmodified lines
379372 mod_delayed_work(bdi_wq, &wb->dwork, 0);
380373 flush_delayed_work(&wb->dwork);
381374 WARN_ON(!list_empty(&wb->work_list));
382− /*
383− * Make sure bit gets cleared after shutdown is finished. Matches with
384− * the barrier provided by test_and_clear_bit() above.
385− */
386− smp_wmb();
387− clear_and_wake_up_bit(WB_shutting_down, &wb->state);
388375 }
389376
390377 static void wb_exit(struct bdi_writeback *wb)
@@ -508,10 +495,12 @@ static void cgwb_release_workfn(struct work_struct *work) · 117 unmodified lines
508495 struct bdi_writeback *wb = container_of(work, struct bdi_writeback,
509496 release_work);
510497
498+ mutex_lock(&wb->bdi->cgwb_release_mutex);
511499 wb_shutdown(wb);
512500
513501 css_put(wb->memcg_css);
514502 css_put(wb->blkcg_css);
503+ mutex_unlock(&wb->bdi->cgwb_release_mutex);
515504
516505 fprop_local_destroy_percpu(&wb->memcg_completions);
517506 percpu_ref_exit(&wb->refcnt);
@@ -697,6 +686,7 @@ static int cgwb_bdi_init(struct backing_dev_info *bdi) · 179 unmodified lines
697686
698687 INIT_RADIX_TREE(&bdi->cgwb_tree, GFP_ATOMIC);
699688 bdi->cgwb_congested_tree = RB_ROOT;
689+ mutex_init(&bdi->cgwb_release_mutex);
700690
701691 ret = wb_init(&bdi->wb, bdi, 1, GFP_KERNEL);
702692 if (!ret) {
@@ -717,7 +707,10 @@ static void cgwb_bdi_unregister(struct backing_dev_info *bdi) · 14 unmodified lines
717707 spin_lock_irq(&cgwb_lock);
718708 radix_tree_for_each_slot(slot, &bdi->cgwb_tree, &iter, 0)
719709 cgwb_kill(*slot);
710+ spin_unlock_irq(&cgwb_lock);
720711
712+ mutex_lock(&bdi->cgwb_release_mutex);
713+ spin_lock_irq(&cgwb_lock);
721714 while (!list_empty(&bdi->wb_list)) {
722715 wb = list_first_entry(&bdi->wb_list, struct bdi_writeback,
723716 bdi_node);
@@ -726,6 +719,7 @@ static void cgwb_bdi_unregister(struct backing_dev_info *bdi) · 2 unmodified lines
726719 spin_lock_irq(&cgwb_lock);
727720 }
728721 spin_unlock_irq(&cgwb_lock);
722+ mutex_unlock(&bdi->cgwb_release_mutex);
729723 }
730724
731725 /**
mm/memblock.c+0−1
@@ -20,7 +20,6 @@ · 19 unmodified lines
2020 #include <linux/kmemleak.h>
2121 #include <linux/seq_file.h>
2222 #include <linux/memblock.h>
23−#include <linux/bootmem.h>
2423
2524 #include <asm/sections.h>
2625 #include <linux/io.h>
mm/slab_common.c+4−0
@@ -567,10 +567,14 @@ static int shutdown_cache(struct kmem_cache *s) · 566 unmodified lines
567567 list_del(&s->list);
568568
569569 if (s->flags & SLAB_TYPESAFE_BY_RCU) {
570+#ifdef SLAB_SUPPORTS_SYSFS
571+ sysfs_slab_unlink(s);
572+#endif
570573 list_add_tail(&s->list, &slab_caches_to_rcu_destroy);
571574 schedule_work(&slab_caches_to_rcu_destroy_work);
572575 } else {
573576 #ifdef SLAB_SUPPORTS_SYSFS
577+ sysfs_slab_unlink(s);
574578 sysfs_slab_release(s);
575579 #else
576580 slab_kmem_cache_release(s);
mm/slub.c+6−1
@@ -5667,7 +5667,6 @@ static void sysfs_slab_remove_workfn(struct work_struct *work) · 5666 unmodified lines
56675667 kset_unregister(s->memcg_kset);
56685668 #endif
56695669 kobject_uevent(&s->kobj, KOBJ_REMOVE);
5670− kobject_del(&s->kobj);
56715670 out:
56725671 kobject_put(&s->kobj);
56735672 }
@@ -5752,6 +5751,12 @@ static void sysfs_slab_remove(struct kmem_cache *s) · 78 unmodified lines
57525751 schedule_work(&s->kobj_remove_work);
57535752 }
57545753
5754+void sysfs_slab_unlink(struct kmem_cache *s)
5755+{
5756+ if (slab_state >= FULL)
5757+ kobject_del(&s->kobj);
5758+}
5759+
57555760 void sysfs_slab_release(struct kmem_cache *s)
57565761 {
57575762 if (slab_state >= FULL)
mm/vmstat.c+0−2
@@ -1796,11 +1796,9 @@ static void vmstat_update(struct work_struct *w) · 1795 unmodified lines
17961796 * to occur in the future. Keep on running the
17971797 * update worker thread.
17981798 */
1799− preempt_disable();
18001799 queue_delayed_work_on(smp_processor_id(), mm_percpu_wq,
18011800 this_cpu_ptr(&vmstat_work),
18021801 round_jiffies_relative(sysctl_stat_interval));
1803− preempt_enable();
18041802 }
18051803 }
18061804
net/appletalk/ddp.c+1−1
@@ -1869,7 +1869,7 @@ static const struct proto_ops atalk_dgram_ops = { · 1868 unmodified lines
18691869 .socketpair = sock_no_socketpair,
18701870 .accept = sock_no_accept,
18711871 .getname = atalk_getname,
1872− .poll_mask = datagram_poll_mask,
1872+ .poll = datagram_poll,
18731873 .ioctl = atalk_ioctl,
18741874 #ifdef CONFIG_COMPAT
18751875 .compat_ioctl = atalk_compat_ioctl,
net/atm/br2684.c+1−2
@@ -252,8 +252,7 @@ static int br2684_xmit_vcc(struct sk_buff *skb, struct net_device *dev, · 251 unmodified lines
252252
253253 ATM_SKB(skb)->vcc = atmvcc = brvcc->atmvcc;
254254 pr_debug("atm_skb(%p)->vcc(%p)->dev(%p)\n", skb, atmvcc, atmvcc->dev);
255− refcount_add(skb->truesize, &sk_atm(atmvcc)->sk_wmem_alloc);
256− ATM_SKB(skb)->atm_options = atmvcc->atm_options;
255+ atm_account_tx(atmvcc, skb);
257256 dev->stats.tx_packets++;
258257 dev->stats.tx_bytes += skb->len;
259258
net/atm/clip.c+1−2
@@ -381,8 +381,7 @@ static netdev_tx_t clip_start_xmit(struct sk_buff *skb, · 380 unmodified lines
381381 memcpy(here, llc_oui, sizeof(llc_oui));
382382 ((__be16 *) here)[3] = skb->protocol;
383383 }
384− refcount_add(skb->truesize, &sk_atm(vcc)->sk_wmem_alloc);
385− ATM_SKB(skb)->atm_options = vcc->atm_options;
384+ atm_account_tx(vcc, skb);
386385 entry->vccs->last_use = jiffies;
387386 pr_debug("atm_skb(%p)->vcc(%p)->dev(%p)\n", skb, vcc, vcc->dev);
388387 old = xchg(&entry->vccs->xoff, 1); /* assume XOFF ... */
net/atm/common.c+9−5
@@ -630,10 +630,9 @@ int vcc_sendmsg(struct socket *sock, struct msghdr *m, size_t size) · 629 unmodified lines
630630 goto out;
631631 }
632632 pr_debug("%d += %d\n", sk_wmem_alloc_get(sk), skb->truesize);
633− refcount_add(skb->truesize, &sk->sk_wmem_alloc);
633+ atm_account_tx(vcc, skb);
634634
635635 skb->dev = NULL; /* for paths shared with net_device interfaces */
636− ATM_SKB(skb)->atm_options = vcc->atm_options;
637636 if (!copy_from_iter_full(skb_put(skb, size), size, &m->msg_iter)) {
638637 kfree_skb(skb);
639638 error = -EFAULT;
@@ -648,11 +647,16 @@ out: · 8 unmodified lines
648647 return error;
649648 }
650649
651−__poll_t vcc_poll_mask(struct socket *sock, __poll_t events)
650+__poll_t vcc_poll(struct file *file, struct socket *sock, poll_table *wait)
652651 {
653652 struct sock *sk = sock->sk;
654− struct atm_vcc *vcc = ATM_SD(sock);
655− __poll_t mask = 0;
653+ struct atm_vcc *vcc;
654+ __poll_t mask;
655+
656+ sock_poll_wait(file, sk_sleep(sk), wait);
657+ mask = 0;
658+
659+ vcc = ATM_SD(sock);
656660
657661 /* exceptional events */
658662 if (sk->sk_err)
net/atm/common.h+1−1
@@ -17,7 +17,7 @@ int vcc_connect(struct socket *sock, int itf, short vpi, int vci); · 16 unmodified lines
1717 int vcc_recvmsg(struct socket *sock, struct msghdr *msg, size_t size,
1818 int flags);
1919 int vcc_sendmsg(struct socket *sock, struct msghdr *m, size_t total_len);
20−__poll_t vcc_poll_mask(struct socket *sock, __poll_t events);
20+__poll_t vcc_poll(struct file *file, struct socket *sock, poll_table *wait);
2121 int vcc_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);
2222 int vcc_compat_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);
2323 int vcc_setsockopt(struct socket *sock, int level, int optname,
net/atm/lec.c+1−2
@@ -182,9 +182,8 @@ lec_send(struct atm_vcc *vcc, struct sk_buff *skb) · 181 unmodified lines
182182 struct net_device *dev = skb->dev;
183183
184184 ATM_SKB(skb)->vcc = vcc;
185− ATM_SKB(skb)->atm_options = vcc->atm_options;
185+ atm_account_tx(vcc, skb);
186186
187− refcount_add(skb->truesize, &sk_atm(vcc)->sk_wmem_alloc);
188187 if (vcc->send(vcc, skb) < 0) {
189188 dev->stats.tx_dropped++;
190189 return;
net/atm/mpc.c+1−2
@@ -555,8 +555,7 @@ static int send_via_shortcut(struct sk_buff *skb, struct mpoa_client *mpc) · 554 unmodified lines
555555 sizeof(struct llc_snap_hdr));
556556 }
557557
558− refcount_add(skb->truesize, &sk_atm(entry->shortcut)->sk_wmem_alloc);
559− ATM_SKB(skb)->atm_options = entry->shortcut->atm_options;
558+ atm_account_tx(entry->shortcut, skb);
560559 entry->shortcut->send(entry->shortcut, skb);
561560 entry->packets_fwded++;
562561 mpc->in_ops->put(entry);
net/atm/pppoatm.c+1−2
@@ -350,8 +350,7 @@ static int pppoatm_send(struct ppp_channel *chan, struct sk_buff *skb) · 349 unmodified lines
350350 return 1;
351351 }
352352
353− refcount_add(skb->truesize, &sk_atm(ATM_SKB(skb)->vcc)->sk_wmem_alloc);
354− ATM_SKB(skb)->atm_options = ATM_SKB(skb)->vcc->atm_options;
353+ atm_account_tx(vcc, skb);
355354 pr_debug("atm_skb(%p)->vcc(%p)->dev(%p)\n",
356355 skb, ATM_SKB(skb)->vcc, ATM_SKB(skb)->vcc->dev);
357356 ret = ATM_SKB(skb)->vcc->send(ATM_SKB(skb)->vcc, skb)
net/atm/pvc.c+1−1
@@ -113,7 +113,7 @@ static const struct proto_ops pvc_proto_ops = { · 112 unmodified lines
113113 .socketpair = sock_no_socketpair,
114114 .accept = sock_no_accept,
115115 .getname = pvc_getname,
116− .poll_mask = vcc_poll_mask,
116+ .poll = vcc_poll,
117117 .ioctl = vcc_ioctl,
118118 #ifdef CONFIG_COMPAT
119119 .compat_ioctl = vcc_compat_ioctl,
net/atm/raw.c+2−2
@@ -35,8 +35,8 @@ static void atm_pop_raw(struct atm_vcc *vcc, struct sk_buff *skb) · 34 unmodified lines
3535 struct sock *sk = sk_atm(vcc);
3636
3737 pr_debug("(%d) %d -= %d\n",
38− vcc->vci, sk_wmem_alloc_get(sk), skb->truesize);
39− WARN_ON(refcount_sub_and_test(skb->truesize, &sk->sk_wmem_alloc));
38+ vcc->vci, sk_wmem_alloc_get(sk), ATM_SKB(skb)->acct_truesize);
39+ WARN_ON(refcount_sub_and_test(ATM_SKB(skb)->acct_truesize, &sk->sk_wmem_alloc));
4040 dev_kfree_skb_any(skb);
4141 sk->sk_write_space(sk);
4242 }
net/atm/svc.c+1−1
@@ -636,7 +636,7 @@ static const struct proto_ops svc_proto_ops = { · 635 unmodified lines
636636 .socketpair = sock_no_socketpair,
637637 .accept = svc_accept,
638638 .getname = svc_getname,
639− .poll_mask = vcc_poll_mask,
639+ .poll = vcc_poll,
640640 .ioctl = svc_ioctl,
641641 #ifdef CONFIG_COMPAT
642642 .compat_ioctl = svc_compat_ioctl,
net/ax25/af_ax25.c+1−1
@@ -1941,7 +1941,7 @@ static const struct proto_ops ax25_proto_ops = { · 1940 unmodified lines
19411941 .socketpair = sock_no_socketpair,
19421942 .accept = ax25_accept,
19431943 .getname = ax25_getname,
1944− .poll_mask = datagram_poll_mask,
1944+ .poll = datagram_poll,
19451945 .ioctl = ax25_ioctl,
19461946 .listen = ax25_listen,
19471947 .shutdown = ax25_shutdown,
net/bluetooth/af_bluetooth.c+5−2
@@ -437,13 +437,16 @@ static inline __poll_t bt_accept_poll(struct sock *parent) · 436 unmodified lines
437437 return 0;
438438 }
439439
440−__poll_t bt_sock_poll_mask(struct socket *sock, __poll_t events)
440+__poll_t bt_sock_poll(struct file *file, struct socket *sock,
441+ poll_table *wait)
441442 {
442443 struct sock *sk = sock->sk;
443444 __poll_t mask = 0;
444445
445446 BT_DBG("sock %p, sk %p", sock, sk);
446447
448+ poll_wait(file, sk_sleep(sk), wait);
449+
447450 if (sk->sk_state == BT_LISTEN)
448451 return bt_accept_poll(sk);
449452
@@ -475,7 +478,7 @@ __poll_t bt_sock_poll_mask(struct socket *sock, __poll_t events) · 25 unmodified lines
475478
476479 return mask;
477480 }
478−EXPORT_SYMBOL(bt_sock_poll_mask);
481+EXPORT_SYMBOL(bt_sock_poll);
479482
480483 int bt_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
481484 {
net/bluetooth/hci_sock.c+1−1
@@ -1975,7 +1975,7 @@ static const struct proto_ops hci_sock_ops = { · 1974 unmodified lines
19751975 .sendmsg = hci_sock_sendmsg,
19761976 .recvmsg = hci_sock_recvmsg,
19771977 .ioctl = hci_sock_ioctl,
1978− .poll_mask = datagram_poll_mask,
1978+ .poll = datagram_poll,
19791979 .listen = sock_no_listen,
19801980 .shutdown = sock_no_shutdown,
19811981 .setsockopt = hci_sock_setsockopt,
net/bluetooth/l2cap_sock.c+1−1
@@ -1653,7 +1653,7 @@ static const struct proto_ops l2cap_sock_ops = { · 1652 unmodified lines
16531653 .getname = l2cap_sock_getname,
16541654 .sendmsg = l2cap_sock_sendmsg,
16551655 .recvmsg = l2cap_sock_recvmsg,
1656− .poll_mask = bt_sock_poll_mask,
1656+ .poll = bt_sock_poll,
16571657 .ioctl = bt_sock_ioctl,
16581658 .mmap = sock_no_mmap,
16591659 .socketpair = sock_no_socketpair,
net/bluetooth/rfcomm/sock.c+1−1
@@ -1049,7 +1049,7 @@ static const struct proto_ops rfcomm_sock_ops = { · 1048 unmodified lines
10491049 .setsockopt = rfcomm_sock_setsockopt,
10501050 .getsockopt = rfcomm_sock_getsockopt,
10511051 .ioctl = rfcomm_sock_ioctl,
1052− .poll_mask = bt_sock_poll_mask,
1052+ .poll = bt_sock_poll,
10531053 .socketpair = sock_no_socketpair,
10541054 .mmap = sock_no_mmap
10551055 };
net/bluetooth/sco.c+1−1
@@ -1197,7 +1197,7 @@ static const struct proto_ops sco_sock_ops = { · 1196 unmodified lines
11971197 .getname = sco_sock_getname,
11981198 .sendmsg = sco_sock_sendmsg,
11991199 .recvmsg = sco_sock_recvmsg,
1200− .poll_mask = bt_sock_poll_mask,
1200+ .poll = bt_sock_poll,
12011201 .ioctl = bt_sock_ioctl,
12021202 .mmap = sock_no_mmap,
12031203 .socketpair = sock_no_socketpair,
net/bpfilter/.gitignore+1−0
@@ -0,0 +1 @@
1+bpfilter_umh
net/bpfilter/Makefile+4−2
@@ -21,8 +21,10 @@ endif · 20 unmodified lines
2121 # which bpfilter_kern.c passes further into umh blob loader at run-time
2222 quiet_cmd_copy_umh = GEN $@
2323 cmd_copy_umh = echo ':' > $(obj)/.bpfilter_umh.o.cmd; \
24− $(OBJCOPY) -I binary -O `$(OBJDUMP) -f $<|grep format|cut -d' ' -f8` \
25− -B `$(OBJDUMP) -f $<|grep architecture|cut -d, -f1|cut -d' ' -f2` \
24+ $(OBJCOPY) -I binary \
25+ `LC_ALL=C $(OBJDUMP) -f net/bpfilter/bpfilter_umh \
26+ |awk -F' |,' '/file format/{print "-O",$$NF} \
27+ /^architecture:/{print "-B",$$2}'` \
2628 --rename-section .data=.init.rodata $< $@
2729
2830 $(obj)/bpfilter_umh.o: $(obj)/bpfilter_umh
net/caif/caif_socket.c+8−4
@@ -934,11 +934,15 @@ static int caif_release(struct socket *sock) · 933 unmodified lines
934934 }
935935
936936 /* Copied from af_unix.c:unix_poll(), added CAIF tx_flow handling */
937−static __poll_t caif_poll_mask(struct socket *sock, __poll_t events)
937+static __poll_t caif_poll(struct file *file,
938+ struct socket *sock, poll_table *wait)
938939 {
939940 struct sock *sk = sock->sk;
941+ __poll_t mask;
940942 struct caifsock *cf_sk = container_of(sk, struct caifsock, sk);
941− __poll_t mask = 0;
943+
944+ sock_poll_wait(file, sk_sleep(sk), wait);
945+ mask = 0;
942946
943947 /* exceptional events? */
944948 if (sk->sk_err)
@@ -972,7 +976,7 @@ static const struct proto_ops caif_seqpacket_ops = { · 27 unmodified lines
972976 .socketpair = sock_no_socketpair,
973977 .accept = sock_no_accept,
974978 .getname = sock_no_getname,
975− .poll_mask = caif_poll_mask,
979+ .poll = caif_poll,
976980 .ioctl = sock_no_ioctl,
977981 .listen = sock_no_listen,
978982 .shutdown = sock_no_shutdown,
@@ -993,7 +997,7 @@ static const struct proto_ops caif_stream_ops = { · 14 unmodified lines
993997 .socketpair = sock_no_socketpair,
994998 .accept = sock_no_accept,
995999 .getname = sock_no_getname,
996− .poll_mask = caif_poll_mask,
1000+ .poll = caif_poll,
9971001 .ioctl = sock_no_ioctl,
9981002 .listen = sock_no_listen,
9991003 .shutdown = sock_no_shutdown,
net/can/bcm.c+1−1
@@ -1660,7 +1660,7 @@ static const struct proto_ops bcm_ops = { · 1659 unmodified lines
16601660 .socketpair = sock_no_socketpair,
16611661 .accept = sock_no_accept,
16621662 .getname = sock_no_getname,
1663− .poll_mask = datagram_poll_mask,
1663+ .poll = datagram_poll,
16641664 .ioctl = can_ioctl, /* use can_ioctl() from af_can.c */
16651665 .listen = sock_no_listen,
16661666 .shutdown = sock_no_shutdown,
net/can/raw.c+1−1
@@ -843,7 +843,7 @@ static const struct proto_ops raw_ops = { · 842 unmodified lines
843843 .socketpair = sock_no_socketpair,
844844 .accept = sock_no_accept,
845845 .getname = raw_getname,
846− .poll_mask = datagram_poll_mask,
846+ .poll = datagram_poll,
847847 .ioctl = can_ioctl, /* use can_ioctl() from af_can.c */
848848 .listen = sock_no_listen,
849849 .shutdown = sock_no_shutdown,
net/core/datagram.c+9−4
@@ -819,8 +819,9 @@ EXPORT_SYMBOL(skb_copy_and_csum_datagram_msg); · 818 unmodified lines
819819
820820 /**
821821 * datagram_poll - generic datagram poll
822+ * @file: file struct
822823 * @sock: socket
823− * @events to wait for
824+ * @wait: poll table
824825 *
825826 * Datagram poll: Again totally generic. This also handles
826827 * sequenced packet sockets providing the socket receive queue
@@ -830,10 +831,14 @@ EXPORT_SYMBOL(skb_copy_and_csum_datagram_msg); · 3 unmodified lines
830831 * and you use a different write policy from sock_writeable()
831832 * then please supply your own write_space callback.
832833 */
833−__poll_t datagram_poll_mask(struct socket *sock, __poll_t events)
834+__poll_t datagram_poll(struct file *file, struct socket *sock,
835+ poll_table *wait)
834836 {
835837 struct sock *sk = sock->sk;
836− __poll_t mask = 0;
838+ __poll_t mask;
839+
840+ sock_poll_wait(file, sk_sleep(sk), wait);
841+ mask = 0;
837842
838843 /* exceptional events? */
839844 if (sk->sk_err || !skb_queue_empty(&sk->sk_error_queue))
@@ -866,4 +871,4 @@ __poll_t datagram_poll_mask(struct socket *sock, __poll_t events) · 26 unmodified lines
866871
867872 return mask;
868873 }
869−EXPORT_SYMBOL(datagram_poll_mask);
874+EXPORT_SYMBOL(datagram_poll);
net/core/dev.c+2−2
@@ -8643,7 +8643,8 @@ int dev_change_net_namespace(struct net_device *dev, struct net *net, const char · 8642 unmodified lines
86438643 /* We get here if we can't use the current device name */
86448644 if (!pat)
86458645 goto out;
8646− if (dev_get_valid_name(net, dev, pat) < 0)
8646+ err = dev_get_valid_name(net, dev, pat);
8647+ if (err < 0)
86478648 goto out;
86488649 }
86498650
@@ -8655,7 +8656,6 @@ int dev_change_net_namespace(struct net_device *dev, struct net *net, const char · 5 unmodified lines
86558656 dev_close(dev);
86568657
86578658 /* And unlink it from device chain */
8658− err = -ENODEV;
86598659 unlist_netdevice(dev);
86608660
86618661 synchronize_net();
net/core/filter.c+4−17
@@ -3214,20 +3214,6 @@ err: · 3213 unmodified lines
32143214 }
32153215 EXPORT_SYMBOL_GPL(xdp_do_redirect);
32163216
3217−static int __xdp_generic_ok_fwd_dev(struct sk_buff *skb, struct net_device *fwd)
3218−{
3219− unsigned int len;
3220−
3221− if (unlikely(!(fwd->flags & IFF_UP)))
3222− return -ENETDOWN;
3223−
3224− len = fwd->mtu + fwd->hard_header_len + VLAN_HLEN;
3225− if (skb->len > len)
3226− return -EMSGSIZE;
3227−
3228− return 0;
3229−}
3230−
32313217 static int xdp_do_generic_redirect_map(struct net_device *dev,
32323218 struct sk_buff *skb,
32333219 struct xdp_buff *xdp,
@@ -3256,10 +3242,11 @@ static int xdp_do_generic_redirect_map(struct net_device *dev, · 22 unmodified lines
32563242 }
32573243
32583244 if (map->map_type == BPF_MAP_TYPE_DEVMAP) {
3259− if (unlikely((err = __xdp_generic_ok_fwd_dev(skb, fwd))))
3245+ struct bpf_dtab_netdev *dst = fwd;
3246+
3247+ err = dev_map_generic_redirect(dst, skb, xdp_prog);
3248+ if (unlikely(err))
32603249 goto err;
3261− skb->dev = fwd;
3262− generic_xdp_tx(skb, xdp_prog);
32633250 } else if (map->map_type == BPF_MAP_TYPE_XSKMAP) {
32643251 struct xdp_sock *xs = fwd;
32653252
net/dccp/ccids/ccid3.c+9−7
@@ -600,7 +600,7 @@ static void ccid3_hc_rx_send_feedback(struct sock *sk, · 599 unmodified lines
600600 {
601601 struct ccid3_hc_rx_sock *hc = ccid3_hc_rx_sk(sk);
602602 struct dccp_sock *dp = dccp_sk(sk);
603− ktime_t now = ktime_get_real();
603+ ktime_t now = ktime_get();
604604 s64 delta = 0;
605605
606606 switch (fbtype) {
@@ -625,15 +625,14 @@ static void ccid3_hc_rx_send_feedback(struct sock *sk, · 18 unmodified lines
625625 case CCID3_FBACK_PERIODIC:
626626 delta = ktime_us_delta(now, hc->rx_tstamp_last_feedback);
627627 if (delta <= 0)
628− DCCP_BUG("delta (%ld) <= 0", (long)delta);
629− else
630− hc->rx_x_recv = scaled_div32(hc->rx_bytes_recv, delta);
628+ delta = 1;
629+ hc->rx_x_recv = scaled_div32(hc->rx_bytes_recv, delta);
631630 break;
632631 default:
633632 return;
634633 }
635634
636− ccid3_pr_debug("Interval %ldusec, X_recv=%u, 1/p=%u\n", (long)delta,
635+ ccid3_pr_debug("Interval %lldusec, X_recv=%u, 1/p=%u\n", delta,
637636 hc->rx_x_recv, hc->rx_pinv);
638637
639638 hc->rx_tstamp_last_feedback = now;
@@ -680,7 +679,8 @@ static int ccid3_hc_rx_insert_options(struct sock *sk, struct sk_buff *skb) · 40 unmodified lines
680679 static u32 ccid3_first_li(struct sock *sk)
681680 {
682681 struct ccid3_hc_rx_sock *hc = ccid3_hc_rx_sk(sk);
683− u32 x_recv, p, delta;
682+ u32 x_recv, p;
683+ s64 delta;
684684 u64 fval;
685685
686686 if (hc->rx_rtt == 0) {
@@ -688,7 +688,9 @@ static u32 ccid3_first_li(struct sock *sk) · 1 unmodified line
688688 hc->rx_rtt = DCCP_FALLBACK_RTT;
689689 }
690690
691− delta = ktime_to_us(net_timedelta(hc->rx_tstamp_last_feedback));
691+ delta = ktime_us_delta(ktime_get(), hc->rx_tstamp_last_feedback);
692+ if (delta <= 0)
693+ delta = 1;
692694 x_recv = scaled_div32(hc->rx_bytes_recv, delta);
693695 if (x_recv == 0) { /* would also trigger divide-by-zero */
694696 DCCP_WARN("X_recv==0\n");
net/dccp/dccp.h+2−1
@@ -316,7 +316,8 @@ int dccp_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, int nonblock, · 315 unmodified lines
316316 int flags, int *addr_len);
317317 void dccp_shutdown(struct sock *sk, int how);
318318 int inet_dccp_listen(struct socket *sock, int backlog);
319−__poll_t dccp_poll_mask(struct socket *sock, __poll_t events);
319+__poll_t dccp_poll(struct file *file, struct socket *sock,
320+ poll_table *wait);
320321 int dccp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len);
321322 void dccp_req_err(struct sock *sk, u64 seq);
322323
net/dccp/ipv4.c+1−1
@@ -984,7 +984,7 @@ static const struct proto_ops inet_dccp_ops = { · 983 unmodified lines
984984 .accept = inet_accept,
985985 .getname = inet_getname,
986986 /* FIXME: work on tcp_poll to rename it to inet_csk_poll */
987− .poll_mask = dccp_poll_mask,
987+ .poll = dccp_poll,
988988 .ioctl = inet_ioctl,
989989 /* FIXME: work on inet_listen to rename it to sock_common_listen */
990990 .listen = inet_dccp_listen,
net/dccp/ipv6.c+1−1
@@ -1070,7 +1070,7 @@ static const struct proto_ops inet6_dccp_ops = { · 1069 unmodified lines
10701070 .socketpair = sock_no_socketpair,
10711071 .accept = inet_accept,
10721072 .getname = inet6_getname,
1073− .poll_mask = dccp_poll_mask,
1073+ .poll = dccp_poll,
10741074 .ioctl = inet6_ioctl,
10751075 .listen = inet_dccp_listen,
10761076 .shutdown = inet_shutdown,
net/dccp/proto.c+11−2
@@ -312,11 +312,20 @@ int dccp_disconnect(struct sock *sk, int flags) · 311 unmodified lines
312312
313313 EXPORT_SYMBOL_GPL(dccp_disconnect);
314314
315−__poll_t dccp_poll_mask(struct socket *sock, __poll_t events)
315+/*
316+ * Wait for a DCCP event.
317+ *
318+ * Note that we don't need to lock the socket, as the upper poll layers
319+ * take care of normal races (between the test and the event) and we don't
320+ * go look at any of the socket buffers directly.
321+ */
322+__poll_t dccp_poll(struct file *file, struct socket *sock,
323+ poll_table *wait)
316324 {
317325 __poll_t mask;
318326 struct sock *sk = sock->sk;
319327
328+ sock_poll_wait(file, sk_sleep(sk), wait);
320329 if (sk->sk_state == DCCP_LISTEN)
321330 return inet_csk_listen_poll(sk);
322331
@@ -358,7 +367,7 @@ __poll_t dccp_poll_mask(struct socket *sock, __poll_t events) · 35 unmodified lines
358367 return mask;
359368 }
360369
361−EXPORT_SYMBOL_GPL(dccp_poll_mask);
370+EXPORT_SYMBOL_GPL(dccp_poll);
362371
363372 int dccp_ioctl(struct sock *sk, int cmd, unsigned long arg)
364373 {
net/decnet/af_decnet.c+3−3
@@ -1207,11 +1207,11 @@ static int dn_getname(struct socket *sock, struct sockaddr *uaddr,int peer) · 1206 unmodified lines
12071207 }
12081208
12091209
1210−static __poll_t dn_poll_mask(struct socket *sock, __poll_t events)
1210+static __poll_t dn_poll(struct file *file, struct socket *sock, poll_table *wait)
12111211 {
12121212 struct sock *sk = sock->sk;
12131213 struct dn_scp *scp = DN_SK(sk);
1214− __poll_t mask = datagram_poll_mask(sock, events);
1214+ __poll_t mask = datagram_poll(file, sock, wait);
12151215
12161216 if (!skb_queue_empty(&scp->other_receive_queue))
12171217 mask |= EPOLLRDBAND;
@@ -2331,7 +2331,7 @@ static const struct proto_ops dn_proto_ops = { · 1113 unmodified lines
23312331 .socketpair = sock_no_socketpair,
23322332 .accept = dn_accept,
23332333 .getname = dn_getname,
2334− .poll_mask = dn_poll_mask,
2334+ .poll = dn_poll,
23352335 .ioctl = dn_ioctl,
23362336 .listen = dn_listen,
23372337 .shutdown = dn_shutdown,
net/ieee802154/socket.c+2−2
@@ -423,7 +423,7 @@ static const struct proto_ops ieee802154_raw_ops = { · 422 unmodified lines
423423 .socketpair = sock_no_socketpair,
424424 .accept = sock_no_accept,
425425 .getname = sock_no_getname,
426− .poll_mask = datagram_poll_mask,
426+ .poll = datagram_poll,
427427 .ioctl = ieee802154_sock_ioctl,
428428 .listen = sock_no_listen,
429429 .shutdown = sock_no_shutdown,
@@ -969,7 +969,7 @@ static const struct proto_ops ieee802154_dgram_ops = { · 539 unmodified lines
969969 .socketpair = sock_no_socketpair,
970970 .accept = sock_no_accept,
971971 .getname = sock_no_getname,
972− .poll_mask = datagram_poll_mask,
972+ .poll = datagram_poll,
973973 .ioctl = ieee802154_sock_ioctl,
974974 .listen = sock_no_listen,
975975 .shutdown = sock_no_shutdown,
net/ipv4/af_inet.c+4−4
@@ -986,7 +986,7 @@ const struct proto_ops inet_stream_ops = { · 985 unmodified lines
986986 .socketpair = sock_no_socketpair,
987987 .accept = inet_accept,
988988 .getname = inet_getname,
989− .poll_mask = tcp_poll_mask,
989+ .poll = tcp_poll,
990990 .ioctl = inet_ioctl,
991991 .listen = inet_listen,
992992 .shutdown = inet_shutdown,
@@ -1021,7 +1021,7 @@ const struct proto_ops inet_dgram_ops = { · 28 unmodified lines
10211021 .socketpair = sock_no_socketpair,
10221022 .accept = sock_no_accept,
10231023 .getname = inet_getname,
1024− .poll_mask = udp_poll_mask,
1024+ .poll = udp_poll,
10251025 .ioctl = inet_ioctl,
10261026 .listen = sock_no_listen,
10271027 .shutdown = inet_shutdown,
@@ -1042,7 +1042,7 @@ EXPORT_SYMBOL(inet_dgram_ops); · 14 unmodified lines
10421042
10431043 /*
10441044 * For SOCK_RAW sockets; should be the same as inet_dgram_ops but without
1045− * udp_poll_mask
1045+ * udp_poll
10461046 */
10471047 static const struct proto_ops inet_sockraw_ops = {
10481048 .family = PF_INET,
@@ -1053,7 +1053,7 @@ static const struct proto_ops inet_sockraw_ops = { · 4 unmodified lines
10531053 .socketpair = sock_no_socketpair,
10541054 .accept = sock_no_accept,
10551055 .getname = inet_getname,
1056− .poll_mask = datagram_poll_mask,
1056+ .poll = datagram_poll,
10571057 .ioctl = inet_ioctl,
10581058 .listen = sock_no_listen,
10591059 .shutdown = inet_shutdown,
net/ipv4/inet_hashtables.c+2−2
@@ -243,9 +243,9 @@ static inline int compute_score(struct sock *sk, struct net *net, · 242 unmodified lines
243243 bool dev_match = (sk->sk_bound_dev_if == dif ||
244244 sk->sk_bound_dev_if == sdif);
245245
246− if (exact_dif && !dev_match)
246+ if (!dev_match)
247247 return -1;
248− if (sk->sk_bound_dev_if && dev_match)
248+ if (sk->sk_bound_dev_if)
249249 score += 4;
250250 }
251251 if (sk->sk_incoming_cpu == raw_smp_processor_id())
net/ipv4/ip_output.c+2−1
@@ -1145,7 +1145,8 @@ static int ip_setup_cork(struct sock *sk, struct inet_cork *cork, · 1144 unmodified lines
11451145 cork->fragsize = ip_sk_use_pmtu(sk) ?
11461146 dst_mtu(&rt->dst) : rt->dst.dev->mtu;
11471147
1148− cork->gso_size = sk->sk_type == SOCK_DGRAM ? ipc->gso_size : 0;
1148+ cork->gso_size = sk->sk_type == SOCK_DGRAM &&
1149+ sk->sk_protocol == IPPROTO_UDP ? ipc->gso_size : 0;
11491150 cork->dst = &rt->dst;
11501151 cork->length = 0;
11511152 cork->ttl = ipc->ttl;
net/ipv4/tcp.c+17−6
@@ -494,21 +494,32 @@ static inline bool tcp_stream_is_readable(const struct tcp_sock *tp, · 493 unmodified lines
494494 }
495495
496496 /*
497− * Socket is not locked. We are protected from async events by poll logic and
498− * correct handling of state changes made by other threads is impossible in
499− * any case.
497+ * Wait for a TCP event.
498+ *
499+ * Note that we don't need to lock the socket, as the upper poll layers
500+ * take care of normal races (between the test and the event) and we don't
501+ * go look at any of the socket buffers directly.
500502 */
501−__poll_t tcp_poll_mask(struct socket *sock, __poll_t events)
503+__poll_t tcp_poll(struct file *file, struct socket *sock, poll_table *wait)
502504 {
505+ __poll_t mask;
503506 struct sock *sk = sock->sk;
504507 const struct tcp_sock *tp = tcp_sk(sk);
505− __poll_t mask = 0;
506508 int state;
507509
510+ sock_poll_wait(file, sk_sleep(sk), wait);
511+
508512 state = inet_sk_state_load(sk);
509513 if (state == TCP_LISTEN)
510514 return inet_csk_listen_poll(sk);
511515
516+ /* Socket is not locked. We are protected from async events
517+ * by poll logic and correct handling of state changes
518+ * made by other threads is impossible in any case.
519+ */
520+
521+ mask = 0;
522+
512523 /*
513524 * EPOLLHUP is certainly not done right. But poll() doesn't
514525 * have a notion of HUP in just one direction, and for a
@@ -589,7 +600,7 @@ __poll_t tcp_poll_mask(struct socket *sock, __poll_t events) · 74 unmodified lines
589600
590601 return mask;
591602 }
592−EXPORT_SYMBOL(tcp_poll_mask);
603+EXPORT_SYMBOL(tcp_poll);
593604
594605 int tcp_ioctl(struct sock *sk, int cmd, unsigned long arg)
595606 {
net/ipv4/udp.c+5−5
@@ -2591,7 +2591,7 @@ int compat_udp_getsockopt(struct sock *sk, int level, int optname, · 2590 unmodified lines
25912591 * udp_poll - wait for a UDP event.
25922592 * @file - file struct
25932593 * @sock - socket
2594− * @events - events to wait for
2594+ * @wait - poll table
25952595 *
25962596 * This is same as datagram poll, except for the special case of
25972597 * blocking sockets. If application is using a blocking fd
@@ -2600,23 +2600,23 @@ int compat_udp_getsockopt(struct sock *sk, int level, int optname, · 2 unmodified lines
26002600 * but then block when reading it. Add special case code
26012601 * to work around these arguably broken applications.
26022602 */
2603−__poll_t udp_poll_mask(struct socket *sock, __poll_t events)
2603+__poll_t udp_poll(struct file *file, struct socket *sock, poll_table *wait)
26042604 {
2605− __poll_t mask = datagram_poll_mask(sock, events);
2605+ __poll_t mask = datagram_poll(file, sock, wait);
26062606 struct sock *sk = sock->sk;
26072607
26082608 if (!skb_queue_empty(&udp_sk(sk)->reader_queue))
26092609 mask |= EPOLLIN | EPOLLRDNORM;
26102610
26112611 /* Check for false positives due to checksum errors */
2612− if ((mask & EPOLLRDNORM) && !(sock->file->f_flags & O_NONBLOCK) &&
2612+ if ((mask & EPOLLRDNORM) && !(file->f_flags & O_NONBLOCK) &&
26132613 !(sk->sk_shutdown & RCV_SHUTDOWN) && first_packet_length(sk) == -1)
26142614 mask &= ~(EPOLLIN | EPOLLRDNORM);
26152615
26162616 return mask;
26172617
26182618 }
2619−EXPORT_SYMBOL(udp_poll_mask);
2619+EXPORT_SYMBOL(udp_poll);
26202620
26212621 int udp_abort(struct sock *sk, int err)
26222622 {
net/ipv6/af_inet6.c+2−2
@@ -570,7 +570,7 @@ const struct proto_ops inet6_stream_ops = { · 569 unmodified lines
570570 .socketpair = sock_no_socketpair, /* a do nothing */
571571 .accept = inet_accept, /* ok */
572572 .getname = inet6_getname,
573− .poll_mask = tcp_poll_mask, /* ok */
573+ .poll = tcp_poll, /* ok */
574574 .ioctl = inet6_ioctl, /* must change */
575575 .listen = inet_listen, /* ok */
576576 .shutdown = inet_shutdown, /* ok */
@@ -603,7 +603,7 @@ const struct proto_ops inet6_dgram_ops = { · 26 unmodified lines
603603 .socketpair = sock_no_socketpair, /* a do nothing */
604604 .accept = sock_no_accept, /* a do nothing */
605605 .getname = inet6_getname,
606− .poll_mask = udp_poll_mask, /* ok */
606+ .poll = udp_poll, /* ok */
607607 .ioctl = inet6_ioctl, /* must change */
608608 .listen = sock_no_listen, /* ok */
609609 .shutdown = inet_shutdown, /* ok */
net/ipv6/inet6_hashtables.c+2−2
@@ -113,9 +113,9 @@ static inline int compute_score(struct sock *sk, struct net *net, · 112 unmodified lines
113113 bool dev_match = (sk->sk_bound_dev_if == dif ||
114114 sk->sk_bound_dev_if == sdif);
115115
116− if (exact_dif && !dev_match)
116+ if (!dev_match)
117117 return -1;
118− if (sk->sk_bound_dev_if && dev_match)
118+ if (sk->sk_bound_dev_if)
119119 score++;
120120 }
121121 if (sk->sk_incoming_cpu == raw_smp_processor_id())
net/ipv6/ip6_fib.c+3−2
@@ -167,8 +167,9 @@ struct fib6_info *fib6_info_alloc(gfp_t gfp_flags) · 166 unmodified lines
167167 return f6i;
168168 }
169169
170−void fib6_info_destroy(struct fib6_info *f6i)
170+void fib6_info_destroy_rcu(struct rcu_head *head)
171171 {
172+ struct fib6_info *f6i = container_of(head, struct fib6_info, rcu);
172173 struct rt6_exception_bucket *bucket;
173174 struct dst_metrics *m;
174175
@@ -206,7 +207,7 @@ void fib6_info_destroy(struct fib6_info *f6i) · 31 unmodified lines
206207
207208 kfree(f6i);
208209 }
209−EXPORT_SYMBOL_GPL(fib6_info_destroy);
210+EXPORT_SYMBOL_GPL(fib6_info_destroy_rcu);
210211
211212 static struct fib6_node *node_alloc(struct net *net)
212213 {
net/ipv6/ip6_output.c+2−1
@@ -1219,7 +1219,8 @@ static int ip6_setup_cork(struct sock *sk, struct inet_cork_full *cork, · 1218 unmodified lines
12191219 if (mtu < IPV6_MIN_MTU)
12201220 return -EINVAL;
12211221 cork->base.fragsize = mtu;
1222− cork->base.gso_size = sk->sk_type == SOCK_DGRAM ? ipc6->gso_size : 0;
1222+ cork->base.gso_size = sk->sk_type == SOCK_DGRAM &&
1223+ sk->sk_protocol == IPPROTO_UDP ? ipc6->gso_size : 0;
12231224
12241225 if (dst_allfrag(xfrm_dst_path(&rt->dst)))
12251226 cork->base.flags |= IPCORK_ALLFRAG;
net/ipv6/mcast.c+6−3
@@ -2082,7 +2082,8 @@ void ipv6_mc_dad_complete(struct inet6_dev *idev) · 2081 unmodified lines
20822082 mld_send_initial_cr(idev);
20832083 idev->mc_dad_count--;
20842084 if (idev->mc_dad_count)
2085− mld_dad_start_timer(idev, idev->mc_maxdelay);
2085+ mld_dad_start_timer(idev,
2086+ unsolicited_report_interval(idev));
20862087 }
20872088 }
20882089
@@ -2094,7 +2095,8 @@ static void mld_dad_timer_expire(struct timer_list *t) · 5 unmodified lines
20942095 if (idev->mc_dad_count) {
20952096 idev->mc_dad_count--;
20962097 if (idev->mc_dad_count)
2097− mld_dad_start_timer(idev, idev->mc_maxdelay);
2098+ mld_dad_start_timer(idev,
2099+ unsolicited_report_interval(idev));
20982100 }
20992101 in6_dev_put(idev);
21002102 }
@@ -2452,7 +2454,8 @@ static void mld_ifc_timer_expire(struct timer_list *t) · 351 unmodified lines
24522454 if (idev->mc_ifc_count) {
24532455 idev->mc_ifc_count--;
24542456 if (idev->mc_ifc_count)
2455− mld_ifc_start_timer(idev, idev->mc_maxdelay);
2457+ mld_ifc_start_timer(idev,
2458+ unsolicited_report_interval(idev));
24562459 }
24572460 in6_dev_put(idev);
24582461 }
net/ipv6/raw.c+2−2
@@ -1334,7 +1334,7 @@ void raw6_proc_exit(void) · 1333 unmodified lines
13341334 }
13351335 #endif /* CONFIG_PROC_FS */
13361336
1337−/* Same as inet6_dgram_ops, sans udp_poll_mask. */
1337+/* Same as inet6_dgram_ops, sans udp_poll. */
13381338 const struct proto_ops inet6_sockraw_ops = {
13391339 .family = PF_INET6,
13401340 .owner = THIS_MODULE,
@@ -1344,7 +1344,7 @@ const struct proto_ops inet6_sockraw_ops = { · 3 unmodified lines
13441344 .socketpair = sock_no_socketpair, /* a do nothing */
13451345 .accept = sock_no_accept, /* a do nothing */
13461346 .getname = inet6_getname,
1347− .poll_mask = datagram_poll_mask, /* ok */
1347+ .poll = datagram_poll, /* ok */
13481348 .ioctl = inet6_ioctl, /* must change */
13491349 .listen = sock_no_listen, /* ok */
13501350 .shutdown = inet_shutdown, /* ok */
net/iucv/af_iucv.c+5−2
@@ -1488,11 +1488,14 @@ static inline __poll_t iucv_accept_poll(struct sock *parent) · 1487 unmodified lines
14881488 return 0;
14891489 }
14901490
1491−static __poll_t iucv_sock_poll_mask(struct socket *sock, __poll_t events)
1491+__poll_t iucv_sock_poll(struct file *file, struct socket *sock,
1492+ poll_table *wait)
14921493 {
14931494 struct sock *sk = sock->sk;
14941495 __poll_t mask = 0;
14951496
1497+ sock_poll_wait(file, sk_sleep(sk), wait);
1498+
14961499 if (sk->sk_state == IUCV_LISTEN)
14971500 return iucv_accept_poll(sk);
14981501
@@ -2385,7 +2388,7 @@ static const struct proto_ops iucv_sock_ops = { · 886 unmodified lines
23852388 .getname = iucv_sock_getname,
23862389 .sendmsg = iucv_sock_sendmsg,
23872390 .recvmsg = iucv_sock_recvmsg,
2388− .poll_mask = iucv_sock_poll_mask,
2391+ .poll = iucv_sock_poll,
23892392 .ioctl = sock_no_ioctl,
23902393 .mmap = sock_no_mmap,
23912394 .socketpair = sock_no_socketpair,
net/kcm/kcmsock.c+5−5
@@ -1336,9 +1336,9 @@ static void init_kcm_sock(struct kcm_sock *kcm, struct kcm_mux *mux) · 1335 unmodified lines
13361336 struct list_head *head;
13371337 int index = 0;
13381338
1339− /* For SOCK_SEQPACKET sock type, datagram_poll_mask checks the sk_state,
1340− * so we set sk_state, otherwise epoll_wait always returns right away
1341− * with EPOLLHUP
1339+ /* For SOCK_SEQPACKET sock type, datagram_poll checks the sk_state, so
1340+ * we set sk_state, otherwise epoll_wait always returns right away with
1341+ * EPOLLHUP
13421342 */
13431343 kcm->sk.sk_state = TCP_ESTABLISHED;
13441344
@@ -1903,7 +1903,7 @@ static const struct proto_ops kcm_dgram_ops = { · 558 unmodified lines
19031903 .socketpair = sock_no_socketpair,
19041904 .accept = sock_no_accept,
19051905 .getname = sock_no_getname,
1906− .poll_mask = datagram_poll_mask,
1906+ .poll = datagram_poll,
19071907 .ioctl = kcm_ioctl,
19081908 .listen = sock_no_listen,
19091909 .shutdown = sock_no_shutdown,
@@ -1924,7 +1924,7 @@ static const struct proto_ops kcm_seqpacket_ops = { · 14 unmodified lines
19241924 .socketpair = sock_no_socketpair,
19251925 .accept = sock_no_accept,
19261926 .getname = sock_no_getname,
1927− .poll_mask = datagram_poll_mask,
1927+ .poll = datagram_poll,
19281928 .ioctl = kcm_ioctl,
19291929 .listen = sock_no_listen,
19301930 .shutdown = sock_no_shutdown,
net/key/af_key.c+1−1
@@ -3751,7 +3751,7 @@ static const struct proto_ops pfkey_ops = { · 3750 unmodified lines
37513751
37523752 /* Now the operations that really occur. */
37533753 .release = pfkey_release,
3754− .poll_mask = datagram_poll_mask,
3754+ .poll = datagram_poll,
37553755 .sendmsg = pfkey_sendmsg,
37563756 .recvmsg = pfkey_recvmsg,
37573757 };
net/l2tp/l2tp_ip.c+1−1
@@ -613,7 +613,7 @@ static const struct proto_ops l2tp_ip_ops = { · 612 unmodified lines
613613 .socketpair = sock_no_socketpair,
614614 .accept = sock_no_accept,
615615 .getname = l2tp_ip_getname,
616− .poll_mask = datagram_poll_mask,
616+ .poll = datagram_poll,
617617 .ioctl = inet_ioctl,
618618 .listen = sock_no_listen,
619619 .shutdown = inet_shutdown,
net/l2tp/l2tp_ip6.c+1−1
@@ -754,7 +754,7 @@ static const struct proto_ops l2tp_ip6_ops = { · 753 unmodified lines
754754 .socketpair = sock_no_socketpair,
755755 .accept = sock_no_accept,
756756 .getname = l2tp_ip6_getname,
757− .poll_mask = datagram_poll_mask,
757+ .poll = datagram_poll,
758758 .ioctl = inet6_ioctl,
759759 .listen = sock_no_listen,
760760 .shutdown = inet_shutdown,
net/l2tp/l2tp_ppp.c+1−1
@@ -1818,7 +1818,7 @@ static const struct proto_ops pppol2tp_ops = { · 1817 unmodified lines
18181818 .socketpair = sock_no_socketpair,
18191819 .accept = sock_no_accept,
18201820 .getname = pppol2tp_getname,
1821− .poll_mask = datagram_poll_mask,
1821+ .poll = datagram_poll,
18221822 .listen = sock_no_listen,
18231823 .shutdown = sock_no_shutdown,
18241824 .setsockopt = pppol2tp_setsockopt,
net/llc/af_llc.c+1−1
@@ -1192,7 +1192,7 @@ static const struct proto_ops llc_ui_ops = { · 1191 unmodified lines
11921192 .socketpair = sock_no_socketpair,
11931193 .accept = llc_ui_accept,
11941194 .getname = llc_ui_getname,
1195− .poll_mask = datagram_poll_mask,
1195+ .poll = datagram_poll,
11961196 .ioctl = llc_ui_ioctl,
11971197 .listen = llc_ui_listen,
11981198 .shutdown = llc_ui_shutdown,
net/ncsi/ncsi-aen.c+5−5
@@ -73,8 +73,8 @@ static int ncsi_aen_handler_lsc(struct ncsi_dev_priv *ndp, · 72 unmodified lines
7373 ncm->data[2] = data;
7474 ncm->data[4] = ntohl(lsc->oem_status);
7575
76− netdev_info(ndp->ndev.dev, "NCSI: LSC AEN - channel %u state %s\n",
77− nc->id, data & 0x1 ? "up" : "down");
76+ netdev_dbg(ndp->ndev.dev, "NCSI: LSC AEN - channel %u state %s\n",
77+ nc->id, data & 0x1 ? "up" : "down");
7878
7979 chained = !list_empty(&nc->link);
8080 state = nc->state;
@@ -148,9 +148,9 @@ static int ncsi_aen_handler_hncdsc(struct ncsi_dev_priv *ndp, · 67 unmodified lines
148148 hncdsc = (struct ncsi_aen_hncdsc_pkt *)h;
149149 ncm->data[3] = ntohl(hncdsc->status);
150150 spin_unlock_irqrestore(&nc->lock, flags);
151− netdev_printk(KERN_DEBUG, ndp->ndev.dev,
152− "NCSI: host driver %srunning on channel %u\n",
153− ncm->data[3] & 0x1 ? "" : "not ", nc->id);
151+ netdev_dbg(ndp->ndev.dev,
152+ "NCSI: host driver %srunning on channel %u\n",
153+ ncm->data[3] & 0x1 ? "" : "not ", nc->id);
154154
155155 return 0;
156156 }
net/ncsi/ncsi-manage.c+22−27
@@ -788,8 +788,8 @@ static void ncsi_configure_channel(struct ncsi_dev_priv *ndp) · 787 unmodified lines
788788 }
789789 break;
790790 case ncsi_dev_state_config_done:
791− netdev_printk(KERN_DEBUG, ndp->ndev.dev,
792− "NCSI: channel %u config done\n", nc->id);
791+ netdev_dbg(ndp->ndev.dev, "NCSI: channel %u config done\n",
792+ nc->id);
793793 spin_lock_irqsave(&nc->lock, flags);
794794 if (nc->reconfigure_needed) {
795795 /* This channel's configuration has been updated
@@ -804,8 +804,7 @@ static void ncsi_configure_channel(struct ncsi_dev_priv *ndp) · 8 unmodified lines
804804 list_add_tail_rcu(&nc->link, &ndp->channel_queue);
805805 spin_unlock_irqrestore(&ndp->lock, flags);
806806
807− netdev_printk(KERN_DEBUG, dev,
808− "Dirty NCSI channel state reset\n");
807+ netdev_dbg(dev, "Dirty NCSI channel state reset\n");
809808 ncsi_process_next_channel(ndp);
810809 break;
811810 }
@@ -816,9 +815,9 @@ static void ncsi_configure_channel(struct ncsi_dev_priv *ndp) · 4 unmodified lines
816815 } else {
817816 hot_nc = NULL;
818817 nc->state = NCSI_CHANNEL_INACTIVE;
819− netdev_warn(ndp->ndev.dev,
820− "NCSI: channel %u link down after config\n",
821− nc->id);
818+ netdev_dbg(ndp->ndev.dev,
819+ "NCSI: channel %u link down after config\n",
820+ nc->id);
822821 }
823822 spin_unlock_irqrestore(&nc->lock, flags);
824823
@@ -908,9 +907,9 @@ static int ncsi_choose_active_channel(struct ncsi_dev_priv *ndp) · 83 unmodified lines
908907 }
909908
910909 ncm = &found->modes[NCSI_MODE_LINK];
911− netdev_printk(KERN_DEBUG, ndp->ndev.dev,
912− "NCSI: Channel %u added to queue (link %s)\n",
913− found->id, ncm->data[2] & 0x1 ? "up" : "down");
910+ netdev_dbg(ndp->ndev.dev,
911+ "NCSI: Channel %u added to queue (link %s)\n",
912+ found->id, ncm->data[2] & 0x1 ? "up" : "down");
914913
915914 out:
916915 spin_lock_irqsave(&ndp->lock, flags);
@@ -1199,14 +1198,14 @@ int ncsi_process_next_channel(struct ncsi_dev_priv *ndp) · 282 unmodified lines
11991198 switch (old_state) {
12001199 case NCSI_CHANNEL_INACTIVE:
12011200 ndp->ndev.state = ncsi_dev_state_config;
1202− netdev_info(ndp->ndev.dev, "NCSI: configuring channel %u\n",
1203− nc->id);
1201+ netdev_dbg(ndp->ndev.dev, "NCSI: configuring channel %u\n",
1202+ nc->id);
12041203 ncsi_configure_channel(ndp);
12051204 break;
12061205 case NCSI_CHANNEL_ACTIVE:
12071206 ndp->ndev.state = ncsi_dev_state_suspend;
1208− netdev_info(ndp->ndev.dev, "NCSI: suspending channel %u\n",
1209− nc->id);
1207+ netdev_dbg(ndp->ndev.dev, "NCSI: suspending channel %u\n",
1208+ nc->id);
12101209 ncsi_suspend_channel(ndp);
12111210 break;
12121211 default:
@@ -1226,8 +1225,6 @@ out: · 13 unmodified lines
12261225 return ncsi_choose_active_channel(ndp);
12271226 }
12281227
1229− netdev_printk(KERN_DEBUG, ndp->ndev.dev,
1230− "NCSI: No more channels to process\n");
12311228 ncsi_report_link(ndp, false);
12321229 return -ENODEV;
12331230 }
@@ -1318,9 +1315,9 @@ static int ncsi_kick_channels(struct ncsi_dev_priv *ndp) · 84 unmodified lines
13181315 if ((ndp->ndev.state & 0xff00) ==
13191316 ncsi_dev_state_config ||
13201317 !list_empty(&nc->link)) {
1321− netdev_printk(KERN_DEBUG, nd->dev,
1322− "NCSI: channel %p marked dirty\n",
1323− nc);
1318+ netdev_dbg(nd->dev,
1319+ "NCSI: channel %p marked dirty\n",
1320+ nc);
13241321 nc->reconfigure_needed = true;
13251322 }
13261323 spin_unlock_irqrestore(&nc->lock, flags);
@@ -1338,8 +1335,7 @@ static int ncsi_kick_channels(struct ncsi_dev_priv *ndp) · 11 unmodified lines
13381335 list_add_tail_rcu(&nc->link, &ndp->channel_queue);
13391336 spin_unlock_irqrestore(&ndp->lock, flags);
13401337
1341− netdev_printk(KERN_DEBUG, nd->dev,
1342− "NCSI: kicked channel %p\n", nc);
1338+ netdev_dbg(nd->dev, "NCSI: kicked channel %p\n", nc);
13431339 n++;
13441340 }
13451341 }
@@ -1370,8 +1366,8 @@ int ncsi_vlan_rx_add_vid(struct net_device *dev, __be16 proto, u16 vid) · 24 unmodified lines
13701366 list_for_each_entry_rcu(vlan, &ndp->vlan_vids, list) {
13711367 n_vids++;
13721368 if (vlan->vid == vid) {
1373− netdev_printk(KERN_DEBUG, dev,
1374− "NCSI: vid %u already registered\n", vid);
1369+ netdev_dbg(dev, "NCSI: vid %u already registered\n",
1370+ vid);
13751371 return 0;
13761372 }
13771373 }
@@ -1390,7 +1386,7 @@ int ncsi_vlan_rx_add_vid(struct net_device *dev, __be16 proto, u16 vid) · 12 unmodified lines
13901386 vlan->vid = vid;
13911387 list_add_rcu(&vlan->list, &ndp->vlan_vids);
13921388
1393− netdev_printk(KERN_DEBUG, dev, "NCSI: Added new vid %u\n", vid);
1389+ netdev_dbg(dev, "NCSI: Added new vid %u\n", vid);
13941390
13951391 found = ncsi_kick_channels(ndp) != 0;
13961392
@@ -1419,8 +1415,7 @@ int ncsi_vlan_rx_kill_vid(struct net_device *dev, __be16 proto, u16 vid) · 22 unmodified lines
14191415 /* Remove the VLAN id from our internal list */
14201416 list_for_each_entry_safe(vlan, tmp, &ndp->vlan_vids, list)
14211417 if (vlan->vid == vid) {
1422− netdev_printk(KERN_DEBUG, dev,
1423− "NCSI: vid %u found, removing\n", vid);
1418+ netdev_dbg(dev, "NCSI: vid %u found, removing\n", vid);
14241419 list_del_rcu(&vlan->list);
14251420 found = true;
14261421 kfree(vlan);
@@ -1547,7 +1542,7 @@ void ncsi_stop_dev(struct ncsi_dev *nd) · 120 unmodified lines
15471542 }
15481543 }
15491544
1550− netdev_printk(KERN_DEBUG, ndp->ndev.dev, "NCSI: Stopping device\n");
1545+ netdev_dbg(ndp->ndev.dev, "NCSI: Stopping device\n");
15511546 ncsi_report_link(ndp, true);
15521547 }
15531548 EXPORT_SYMBOL_GPL(ncsi_stop_dev);
net/netlink/af_netlink.c+1−1
@@ -2658,7 +2658,7 @@ static const struct proto_ops netlink_ops = { · 2657 unmodified lines
26582658 .socketpair = sock_no_socketpair,
26592659 .accept = sock_no_accept,
26602660 .getname = netlink_getname,
2661− .poll_mask = datagram_poll_mask,
2661+ .poll = datagram_poll,
26622662 .ioctl = netlink_ioctl,
26632663 .listen = sock_no_listen,
26642664 .shutdown = sock_no_shutdown,
net/netrom/af_netrom.c+1−1
@@ -1355,7 +1355,7 @@ static const struct proto_ops nr_proto_ops = { · 1354 unmodified lines
13551355 .socketpair = sock_no_socketpair,
13561356 .accept = nr_accept,
13571357 .getname = nr_getname,
1358− .poll_mask = datagram_poll_mask,
1358+ .poll = datagram_poll,
13591359 .ioctl = nr_ioctl,
13601360 .listen = nr_listen,
13611361 .shutdown = sock_no_shutdown,
net/nfc/llcp_sock.c+6−3
@@ -548,13 +548,16 @@ static inline __poll_t llcp_accept_poll(struct sock *parent) · 547 unmodified lines
548548 return 0;
549549 }
550550
551−static __poll_t llcp_sock_poll_mask(struct socket *sock, __poll_t events)
551+static __poll_t llcp_sock_poll(struct file *file, struct socket *sock,
552+ poll_table *wait)
552553 {
553554 struct sock *sk = sock->sk;
554555 __poll_t mask = 0;
555556
556557 pr_debug("%p\n", sk);
557558
559+ sock_poll_wait(file, sk_sleep(sk), wait);
560+
558561 if (sk->sk_state == LLCP_LISTEN)
559562 return llcp_accept_poll(sk);
560563
@@ -896,7 +899,7 @@ static const struct proto_ops llcp_sock_ops = { · 335 unmodified lines
896899 .socketpair = sock_no_socketpair,
897900 .accept = llcp_sock_accept,
898901 .getname = llcp_sock_getname,
899− .poll_mask = llcp_sock_poll_mask,
902+ .poll = llcp_sock_poll,
900903 .ioctl = sock_no_ioctl,
901904 .listen = llcp_sock_listen,
902905 .shutdown = sock_no_shutdown,
@@ -916,7 +919,7 @@ static const struct proto_ops llcp_rawsock_ops = { · 13 unmodified lines
916919 .socketpair = sock_no_socketpair,
917920 .accept = sock_no_accept,
918921 .getname = llcp_sock_getname,
919− .poll_mask = llcp_sock_poll_mask,
922+ .poll = llcp_sock_poll,
920923 .ioctl = sock_no_ioctl,
921924 .listen = sock_no_listen,
922925 .shutdown = sock_no_shutdown,
net/nfc/rawsock.c+2−2
@@ -284,7 +284,7 @@ static const struct proto_ops rawsock_ops = { · 283 unmodified lines
284284 .socketpair = sock_no_socketpair,
285285 .accept = sock_no_accept,
286286 .getname = sock_no_getname,
287− .poll_mask = datagram_poll_mask,
287+ .poll = datagram_poll,
288288 .ioctl = sock_no_ioctl,
289289 .listen = sock_no_listen,
290290 .shutdown = sock_no_shutdown,
@@ -304,7 +304,7 @@ static const struct proto_ops rawsock_raw_ops = { · 13 unmodified lines
304304 .socketpair = sock_no_socketpair,
305305 .accept = sock_no_accept,
306306 .getname = sock_no_getname,
307− .poll_mask = datagram_poll_mask,
307+ .poll = datagram_poll,
308308 .ioctl = sock_no_ioctl,
309309 .listen = sock_no_listen,
310310 .shutdown = sock_no_shutdown,
net/packet/af_packet.c+12−13
@@ -2262,6 +2262,13 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev, · 2261 unmodified lines
22622262 if (po->stats.stats1.tp_drops)
22632263 status |= TP_STATUS_LOSING;
22642264 }
2265+
2266+ if (do_vnet &&
2267+ virtio_net_hdr_from_skb(skb, h.raw + macoff -
2268+ sizeof(struct virtio_net_hdr),
2269+ vio_le(), true, 0))
2270+ goto drop_n_account;
2271+
22652272 po->stats.stats1.tp_packets++;
22662273 if (copy_skb) {
22672274 status |= TP_STATUS_COPY;
@@ -2269,15 +2276,6 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev, · 1 unmodified line
22692276 }
22702277 spin_unlock(&sk->sk_receive_queue.lock);
22712278
2272− if (do_vnet) {
2273− if (virtio_net_hdr_from_skb(skb, h.raw + macoff -
2274− sizeof(struct virtio_net_hdr),
2275− vio_le(), true, 0)) {
2276− spin_lock(&sk->sk_receive_queue.lock);
2277− goto drop_n_account;
2278− }
2279− }
2280−
22812279 skb_copy_bits(skb, 0, h.raw + macoff, snaplen);
22822280
22832281 if (!(ts_status = tpacket_get_timestamp(skb, &ts, po->tp_tstamp)))
@@ -4078,11 +4076,12 @@ static int packet_ioctl(struct socket *sock, unsigned int cmd, · 1794 unmodified lines
40784076 return 0;
40794077 }
40804078
4081−static __poll_t packet_poll_mask(struct socket *sock, __poll_t events)
4079+static __poll_t packet_poll(struct file *file, struct socket *sock,
4080+ poll_table *wait)
40824081 {
40834082 struct sock *sk = sock->sk;
40844083 struct packet_sock *po = pkt_sk(sk);
4085− __poll_t mask = datagram_poll_mask(sock, events);
4084+ __poll_t mask = datagram_poll(file, sock, wait);
40864085
40874086 spin_lock_bh(&sk->sk_receive_queue.lock);
40884087 if (po->rx_ring.pg_vec) {
@@ -4424,7 +4423,7 @@ static const struct proto_ops packet_ops_spkt = { · 335 unmodified lines
44244423 .socketpair = sock_no_socketpair,
44254424 .accept = sock_no_accept,
44264425 .getname = packet_getname_spkt,
4427− .poll_mask = datagram_poll_mask,
4426+ .poll = datagram_poll,
44284427 .ioctl = packet_ioctl,
44294428 .listen = sock_no_listen,
44304429 .shutdown = sock_no_shutdown,
@@ -4445,7 +4444,7 @@ static const struct proto_ops packet_ops = { · 14 unmodified lines
44454444 .socketpair = sock_no_socketpair,
44464445 .accept = sock_no_accept,
44474446 .getname = packet_getname,
4448− .poll_mask = packet_poll_mask,
4447+ .poll = packet_poll,
44494448 .ioctl = packet_ioctl,
44504449 .listen = sock_no_listen,
44514450 .shutdown = sock_no_shutdown,
net/phonet/socket.c+6−3
@@ -340,12 +340,15 @@ static int pn_socket_getname(struct socket *sock, struct sockaddr *addr, · 339 unmodified lines
340340 return sizeof(struct sockaddr_pn);
341341 }
342342
343−static __poll_t pn_socket_poll_mask(struct socket *sock, __poll_t events)
343+static __poll_t pn_socket_poll(struct file *file, struct socket *sock,
344+ poll_table *wait)
344345 {
345346 struct sock *sk = sock->sk;
346347 struct pep_sock *pn = pep_sk(sk);
347348 __poll_t mask = 0;
348349
350+ poll_wait(file, sk_sleep(sk), wait);
351+
349352 if (sk->sk_state == TCP_CLOSE)
350353 return EPOLLERR;
351354 if (!skb_queue_empty(&sk->sk_receive_queue))
@@ -445,7 +448,7 @@ const struct proto_ops phonet_dgram_ops = { · 93 unmodified lines
445448 .socketpair = sock_no_socketpair,
446449 .accept = sock_no_accept,
447450 .getname = pn_socket_getname,
448− .poll_mask = datagram_poll_mask,
451+ .poll = datagram_poll,
449452 .ioctl = pn_socket_ioctl,
450453 .listen = sock_no_listen,
451454 .shutdown = sock_no_shutdown,
@@ -470,7 +473,7 @@ const struct proto_ops phonet_stream_ops = { · 18 unmodified lines
470473 .socketpair = sock_no_socketpair,
471474 .accept = pn_socket_accept,
472475 .getname = pn_socket_getname,
473− .poll_mask = pn_socket_poll_mask,
476+ .poll = pn_socket_poll,
474477 .ioctl = pn_socket_ioctl,
475478 .listen = pn_socket_listen,
476479 .shutdown = sock_no_shutdown,
net/qrtr/qrtr.c+1−1
@@ -1023,7 +1023,7 @@ static const struct proto_ops qrtr_proto_ops = { · 1022 unmodified lines
10231023 .recvmsg = qrtr_recvmsg,
10241024 .getname = qrtr_getname,
10251025 .ioctl = qrtr_ioctl,
1026− .poll_mask = datagram_poll_mask,
1026+ .poll = datagram_poll,
10271027 .shutdown = sock_no_shutdown,
10281028 .setsockopt = sock_no_setsockopt,
10291029 .getsockopt = sock_no_getsockopt,
net/rose/af_rose.c+1−1
@@ -1470,7 +1470,7 @@ static const struct proto_ops rose_proto_ops = { · 1469 unmodified lines
14701470 .socketpair = sock_no_socketpair,
14711471 .accept = rose_accept,
14721472 .getname = rose_getname,
1473− .poll_mask = datagram_poll_mask,
1473+ .poll = datagram_poll,
14741474 .ioctl = rose_ioctl,
14751475 .listen = rose_listen,
14761476 .shutdown = sock_no_shutdown,
net/rxrpc/af_rxrpc.c+7−3
@@ -734,11 +734,15 @@ static int rxrpc_getsockopt(struct socket *sock, int level, int optname, · 733 unmodified lines
734734 /*
735735 * permit an RxRPC socket to be polled
736736 */
737−static __poll_t rxrpc_poll_mask(struct socket *sock, __poll_t events)
737+static __poll_t rxrpc_poll(struct file *file, struct socket *sock,
738+ poll_table *wait)
738739 {
739740 struct sock *sk = sock->sk;
740741 struct rxrpc_sock *rx = rxrpc_sk(sk);
741− __poll_t mask = 0;
742+ __poll_t mask;
743+
744+ sock_poll_wait(file, sk_sleep(sk), wait);
745+ mask = 0;
742746
743747 /* the socket is readable if there are any messages waiting on the Rx
744748 * queue */
@@ -945,7 +949,7 @@ static const struct proto_ops rxrpc_rpc_ops = { · 200 unmodified lines
945949 .socketpair = sock_no_socketpair,
946950 .accept = sock_no_accept,
947951 .getname = sock_no_getname,
948− .poll_mask = rxrpc_poll_mask,
952+ .poll = rxrpc_poll,
949953 .ioctl = sock_no_ioctl,
950954 .listen = rxrpc_listen,
951955 .shutdown = rxrpc_shutdown,
net/sched/act_ife.c+5−7
@@ -415,7 +415,8 @@ static void tcf_ife_cleanup(struct tc_action *a) · 414 unmodified lines
415415 spin_unlock_bh(&ife->tcf_lock);
416416
417417 p = rcu_dereference_protected(ife->params, 1);
418− kfree_rcu(p, rcu);
418+ if (p)
419+ kfree_rcu(p, rcu);
419420 }
420421
421422 /* under ife->tcf_lock for existing action */
@@ -516,8 +517,6 @@ static int tcf_ife_init(struct net *net, struct nlattr *nla, · 94 unmodified lines
516517 saddr = nla_data(tb[TCA_IFE_SMAC]);
517518 }
518519
519− ife->tcf_action = parm->action;
520−
521520 if (parm->flags & IFE_ENCODE) {
522521 if (daddr)
523522 ether_addr_copy(p->eth_dst, daddr);
@@ -543,10 +542,8 @@ static int tcf_ife_init(struct net *net, struct nlattr *nla, · 19 unmodified lines
543542 NULL, NULL);
544543 if (err) {
545544 metadata_parse_err:
546− if (exists)
547− tcf_idr_release(*a, bind);
548545 if (ret == ACT_P_CREATED)
549− _tcf_ife_cleanup(*a);
546+ tcf_idr_release(*a, bind);
550547
551548 if (exists)
552549 spin_unlock_bh(&ife->tcf_lock);
@@ -567,7 +564,7 @@ metadata_parse_err: · 14 unmodified lines
567564 err = use_all_metadata(ife);
568565 if (err) {
569566 if (ret == ACT_P_CREATED)
570− _tcf_ife_cleanup(*a);
567+ tcf_idr_release(*a, bind);
571568
572569 if (exists)
573570 spin_unlock_bh(&ife->tcf_lock);
@@ -576,6 +573,7 @@ metadata_parse_err: · 2 unmodified lines
576573 }
577574 }
578575
576+ ife->tcf_action = parm->action;
579577 if (exists)
580578 spin_unlock_bh(&ife->tcf_lock);
581579
net/sched/cls_flower.c+17−4
@@ -66,7 +66,7 @@ struct fl_flow_mask { · 65 unmodified lines
6666 struct rhashtable_params filter_ht_params;
6767 struct flow_dissector dissector;
6868 struct list_head filters;
69− struct rcu_head rcu;
69+ struct rcu_work rwork;
7070 struct list_head list;
7171 };
7272
@@ -203,6 +203,20 @@ static int fl_init(struct tcf_proto *tp) · 130 unmodified lines
203203 return rhashtable_init(&head->ht, &mask_ht_params);
204204 }
205205
206+static void fl_mask_free(struct fl_flow_mask *mask)
207+{
208+ rhashtable_destroy(&mask->ht);
209+ kfree(mask);
210+}
211+
212+static void fl_mask_free_work(struct work_struct *work)
213+{
214+ struct fl_flow_mask *mask = container_of(to_rcu_work(work),
215+ struct fl_flow_mask, rwork);
216+
217+ fl_mask_free(mask);
218+}
219+
206220 static bool fl_mask_put(struct cls_fl_head *head, struct fl_flow_mask *mask,
207221 bool async)
208222 {
@@ -210,12 +224,11 @@ static bool fl_mask_put(struct cls_fl_head *head, struct fl_flow_mask *mask, · 1 unmodified line
210224 return false;
211225
212226 rhashtable_remove_fast(&head->ht, &mask->ht_node, mask_ht_params);
213− rhashtable_destroy(&mask->ht);
214227 list_del_rcu(&mask->list);
215228 if (async)
216− kfree_rcu(mask, rcu);
229+ tcf_queue_work(&mask->rwork, fl_mask_free_work);
217230 else
218− kfree(mask);
231+ fl_mask_free(mask);
219232
220233 return true;
221234 }
net/sched/sch_blackhole.c+1−1
@@ -21,7 +21,7 @@ static int blackhole_enqueue(struct sk_buff *skb, struct Qdisc *sch, · 20 unmodified lines
2121 struct sk_buff **to_free)
2222 {
2323 qdisc_drop(skb, sch, to_free);
24− return NET_XMIT_SUCCESS;
24+ return NET_XMIT_SUCCESS | __NET_XMIT_BYPASS;
2525 }
2626
2727 static struct sk_buff *blackhole_dequeue(struct Qdisc *sch)
net/sched/sch_hfsc.c+2−2
@@ -1385,8 +1385,8 @@ hfsc_schedule_watchdog(struct Qdisc *sch) · 1384 unmodified lines
13851385 if (next_time == 0 || next_time > q->root.cl_cfmin)
13861386 next_time = q->root.cl_cfmin;
13871387 }
1388− WARN_ON(next_time == 0);
1389− qdisc_watchdog_schedule(&q->watchdog, next_time);
1388+ if (next_time)
1389+ qdisc_watchdog_schedule(&q->watchdog, next_time);
13901390 }
13911391
13921392 static int
net/sctp/chunk.c+3−1
@@ -237,7 +237,9 @@ struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *asoc, · 236 unmodified lines
237237 /* Account for a different sized first fragment */
238238 if (msg_len >= first_len) {
239239 msg->can_delay = 0;
240− SCTP_INC_STATS(sock_net(asoc->base.sk), SCTP_MIB_FRAGUSRMSGS);
240+ if (msg_len > first_len)
241+ SCTP_INC_STATS(sock_net(asoc->base.sk),
242+ SCTP_MIB_FRAGUSRMSGS);
241243 } else {
242244 /* Which may be the only one... */
243245 first_len = msg_len;
net/sctp/ipv6.c+1−1
@@ -1010,7 +1010,7 @@ static const struct proto_ops inet6_seqpacket_ops = { · 1009 unmodified lines
10101010 .socketpair = sock_no_socketpair,
10111011 .accept = inet_accept,
10121012 .getname = sctp_getname,
1013− .poll_mask = sctp_poll_mask,
1013+ .poll = sctp_poll,
10141014 .ioctl = inet6_ioctl,
10151015 .listen = sctp_inet_listen,
10161016 .shutdown = inet_shutdown,
net/sctp/protocol.c+1−1
@@ -1016,7 +1016,7 @@ static const struct proto_ops inet_seqpacket_ops = { · 1015 unmodified lines
10161016 .socketpair = sock_no_socketpair,
10171017 .accept = inet_accept,
10181018 .getname = inet_getname, /* Semantics are different. */
1019− .poll_mask = sctp_poll_mask,
1019+ .poll = sctp_poll,
10201020 .ioctl = inet_ioctl,
10211021 .listen = sctp_inet_listen,
10221022 .shutdown = inet_shutdown, /* Looks harmless. */
net/sctp/socket.c+3−1
@@ -7717,12 +7717,14 @@ out: · 7716 unmodified lines
77177717 * here, again, by modeling the current TCP/UDP code. We don't have
77187718 * a good way to test with it yet.
77197719 */
7720−__poll_t sctp_poll_mask(struct socket *sock, __poll_t events)
7720+__poll_t sctp_poll(struct file *file, struct socket *sock, poll_table *wait)
77217721 {
77227722 struct sock *sk = sock->sk;
77237723 struct sctp_sock *sp = sctp_sk(sk);
77247724 __poll_t mask;
77257725
7726+ poll_wait(file, sk_sleep(sk), wait);
7727+
77267728 sock_rps_record_flow(sk);
77277729
77287730 /* A TCP-style listening socket becomes readable when the accept queue
net/smc/af_smc.c+9−3
@@ -1273,7 +1273,8 @@ static __poll_t smc_accept_poll(struct sock *parent) · 1272 unmodified lines
12731273 return mask;
12741274 }
12751275
1276−static __poll_t smc_poll_mask(struct socket *sock, __poll_t events)
1276+static __poll_t smc_poll(struct file *file, struct socket *sock,
1277+ poll_table *wait)
12771278 {
12781279 struct sock *sk = sock->sk;
12791280 __poll_t mask = 0;
@@ -1289,7 +1290,7 @@ static __poll_t smc_poll_mask(struct socket *sock, __poll_t events) · 9 unmodified lines
12891290 if ((sk->sk_state == SMC_INIT) || smc->use_fallback) {
12901291 /* delegate to CLC child sock */
12911292 release_sock(sk);
1292− mask = smc->clcsock->ops->poll_mask(smc->clcsock, events);
1293+ mask = smc->clcsock->ops->poll(file, smc->clcsock, wait);
12931294 lock_sock(sk);
12941295 sk->sk_err = smc->clcsock->sk->sk_err;
12951296 if (sk->sk_err) {
@@ -1307,6 +1308,11 @@ static __poll_t smc_poll_mask(struct socket *sock, __poll_t events) · 11 unmodified lines
13071308 }
13081309 }
13091310 } else {
1311+ if (sk->sk_state != SMC_CLOSED) {
1312+ release_sock(sk);
1313+ sock_poll_wait(file, sk_sleep(sk), wait);
1314+ lock_sock(sk);
1315+ }
13101316 if (sk->sk_err)
13111317 mask |= EPOLLERR;
13121318 if ((sk->sk_shutdown == SHUTDOWN_MASK) ||
@@ -1619,7 +1625,7 @@ static const struct proto_ops smc_sock_ops = { · 306 unmodified lines
16191625 .socketpair = sock_no_socketpair,
16201626 .accept = smc_accept,
16211627 .getname = smc_getname,
1622− .poll_mask = smc_poll_mask,
1628+ .poll = smc_poll,
16231629 .ioctl = smc_ioctl,
16241630 .listen = smc_listen,
16251631 .shutdown = smc_shutdown,
net/socket.c+7−43
@@ -117,10 +117,8 @@ static ssize_t sock_write_iter(struct kiocb *iocb, struct iov_iter *from); · 116 unmodified lines
117117 static int sock_mmap(struct file *file, struct vm_area_struct *vma);
118118
119119 static int sock_close(struct inode *inode, struct file *file);
120−static struct wait_queue_head *sock_get_poll_head(struct file *file,

71 more lines aren’t shown here.

net/strparser/strparser.c+1−4

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

net/sunrpc/xprt.c+7−3

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

net/tipc/socket.c+9−5

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

net/tls/tls_main.c+1−1

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

net/tls/tls_sw.c+10−9

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

net/unix/af_unix.c+19−11

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

net/vmw_vsock/af_vsock.c+13−6

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

net/vmw_vsock/virtio_transport.c+1−1

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

net/x25/af_x25.c+1−1

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

net/xdp/xsk.c+7−3

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

scripts/Makefile.build+1−1

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

scripts/checkpatch.pl+0−6

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

scripts/gcc-x86_64-has-stack-protector.sh+1−1

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

scripts/kconfig/expr.h+3−0

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

scripts/kconfig/preprocess.c+1−1

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

scripts/kconfig/zconf.y+6−2

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

security/keys/dh.c+4−2

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

security/selinux/selinuxfs.c+33−45

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

security/smack/smack_lsm.c+1−0

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

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

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

sound/core/timer.c+1−1

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

sound/pci/hda/hda_codec.c+3−2

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

sound/pci/hda/hda_codec.h+1−0

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

sound/pci/hda/patch_ca0132.c+23−41

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

sound/pci/hda/patch_hdmi.c+5−0

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

sound/pci/hda/patch_realtek.c+17−3

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

sound/pci/lx6464es/lx6464es.c+1−0

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

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

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

tools/arch/arm64/include/uapi/asm/kvm.h+1−0

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

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

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

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

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

tools/arch/x86/include/asm/cpufeatures.h+2−0

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

tools/bpf/bpftool/perf.c+3−2

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

tools/bpf/bpftool/prog.c+3−1

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

tools/include/uapi/drm/drm.h+7−0

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

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

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

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

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

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

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

tools/objtool/check.c+1−0

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

tools/perf/Documentation/perf-stat.txt+3−0

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

tools/perf/arch/powerpc/util/skip-callchain-idx.c+1−1

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

tools/perf/arch/x86/entry/syscalls/syscall_64.tbl+2−0

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

tools/perf/bench/numa.c+3−2

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

tools/perf/builtin-annotate.c+10−1

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

tools/perf/builtin-c2c.c+5−5

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

tools/perf/builtin-report.c+2−1

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

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

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

tools/perf/builtin-stat.c+28−20

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

tools/perf/tests/parse-events.c+20−5

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

tools/perf/tests/topology.c+1−0

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

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

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

tools/perf/util/c++/clang.cpp+9−2

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

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

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

tools/perf/util/hist.c+8−4

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

tools/perf/util/hist.h+2−2

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

tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c+1−1

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

tools/perf/util/parse-events.y+5−0

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

tools/perf/util/pmu.c+97−2

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

tools/perf/util/sort.h+3−1

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

tools/power/x86/turbostat/turbostat.8+1−1

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

tools/power/x86/turbostat/turbostat.c+166−74

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

tools/testing/selftests/bpf/config+10−0

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

tools/testing/selftests/bpf/test_offload.py+10−2

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

tools/testing/selftests/bpf/test_tunnel.sh+14−12

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

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

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

tools/testing/selftests/net/config+2−0

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

tools/testing/selftests/pstore/pstore_post_reboot_tests+4−1

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

tools/testing/selftests/rseq/param_test.c+24−0

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

tools/testing/selftests/rseq/rseq-arm.h+1−0

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

tools/testing/selftests/rseq/rseq-mips.h+725−0

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

tools/testing/selftests/rseq/rseq.h+2−0

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

tools/testing/selftests/rseq/run_param_test.sh+0−0

File mode changed from 100644 to 100755.

tools/testing/selftests/sparc64/Makefile+12−8

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

tools/testing/selftests/sparc64/drivers/Makefile+1−1

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

tools/testing/selftests/static_keys/test_static_keys.sh+13−0

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

tools/testing/selftests/sync/config+4−0

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

tools/testing/selftests/sysctl/sysctl.sh+13−7

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

tools/testing/selftests/user/test_user_copy.sh+7−0

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

tools/testing/selftests/vm/compaction_test.c+3−1

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

tools/testing/selftests/vm/mlock2-tests.c+7−5

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

tools/testing/selftests/vm/run_vmtests+4−1

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

tools/testing/selftests/vm/userfaultfd.c+3−1

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

tools/testing/selftests/x86/sigreturn.c+36−23

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

tools/testing/selftests/zram/zram.sh+4−1

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

tools/testing/selftests/zram/zram_lib.sh+4−1

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

tools/virtio/linux/scatterlist.h+0−18

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

virt/kvm/Kconfig+1−1

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

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

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

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

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

virt/kvm/kvm_main.c+9−10

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

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

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

Repository code

Go to file
t