History

Merge ra.kernel.org:/pub/scm/linux/kernel/git/davem/net

Simple overlapping changes in stmmac driver. Adjust skb_gro_flush_final_remcsum function signature to make GRO list changes in net-next, as per Stephen Rothwell's example merge resolution.

David S. Miller committed 8 years ago

Commit 5cd3da42 parents f6779e4 d0fbad0471 files · +3815 −2447Browse files

Unified · Split

471 files
  1. Documentation/admin-guide/pm/intel_pstate.rst +12 −2
  2. Documentation/devicetree/bindings/input/sprd,sc27xx-vibra.txt +23 −0
  3. Documentation/filesystems/Locking +1 −6
  4. Documentation/filesystems/vfs.txt +0 −13
  5. Documentation/kbuild/kconfig-language.txt +6 −0
  6. Documentation/usb/gadget_configfs.txt +1 −1
  7. MAINTAINERS +19 −6
  8. Makefile +1 −6
  9. arch/arm/Kconfig +7 −1
  10. arch/arm/boot/dts/armada-385-synology-ds116.dts +1 −1
  11. arch/arm/boot/dts/bcm-cygnus.dtsi +12 −12
  12. arch/arm/boot/dts/bcm-hr2.dtsi +12 −12
  13. arch/arm/boot/dts/bcm-nsp.dtsi +16 −16
  14. arch/arm/boot/dts/bcm5301x.dtsi +1 −1
  15. arch/arm/boot/dts/da850.dtsi +1 −5
  16. arch/arm/boot/dts/imx6q.dtsi +1 −1
  17. arch/arm/boot/dts/imx6sx.dtsi +1 −1
  18. arch/arm/boot/dts/socfpga.dtsi +2 −2
  19. arch/arm/boot/dts/socfpga_arria10.dtsi +2 −3
  20. arch/arm/common/Makefile +1 −1
  21. arch/arm/configs/multi_v7_defconfig +155 −223
  22. arch/arm/mach-bcm/Kconfig +1 −0
  23. arch/arm/mach-davinci/board-da850-evm.c +1 −1
  24. arch/arm/mach-socfpga/Kconfig +1 −0
  25. arch/arm/net/bpf_jit_32.c +1 −1
  26. arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi +2 −4
  27. arch/arm64/boot/dts/amlogic/meson-axg-s400.dts +14 −1
  28. arch/arm64/boot/dts/amlogic/meson-axg.dtsi +2 −2
  29. arch/arm64/boot/dts/amlogic/meson-gx.dtsi +9 −3
  30. arch/arm64/boot/dts/amlogic/meson-gxl-mali.dtsi +1 −1
  31. arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts +0 −3
  32. arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dtsi +7 −0
  33. arch/arm64/boot/dts/amlogic/meson-gxl.dtsi +0 −8
  34. arch/arm64/boot/dts/broadcom/northstar2/ns2.dtsi +4 −4
  35. arch/arm64/boot/dts/broadcom/stingray/bcm958742k.dts +4 −0
  36. arch/arm64/boot/dts/broadcom/stingray/bcm958742t.dts +4 −0
  37. arch/arm64/boot/dts/broadcom/stingray/stingray.dtsi +2 −2
  38. arch/arm64/boot/dts/hisilicon/hi3660-hikey960.dts +2 −0
  39. arch/arm64/boot/dts/hisilicon/hi6220-hikey.dts +2 −0
  40. arch/arm64/boot/dts/marvell/armada-cp110.dtsi +1 −1
  41. arch/arm64/boot/dts/qcom/apq8096-db820c.dtsi +1 −1
  42. arch/arm64/boot/dts/qcom/msm8916.dtsi +2 −2
  43. arch/arm64/boot/dts/socionext/uniphier-ld11-global.dts +1 −1
  44. arch/arm64/boot/dts/socionext/uniphier-ld20-global.dts +1 −1
  45. arch/arm64/configs/defconfig +39 −63
  46. arch/arm64/include/asm/alternative.h +6 −1
  47. arch/arm64/include/asm/pgtable.h +1 −5
  48. arch/arm64/kernel/alternative.c +44 −7
  49. arch/arm64/kernel/module.c +2 −3
  50. arch/microblaze/Kconfig.debug +0 −7
  51. arch/microblaze/include/asm/setup.h +0 −5
  52. arch/microblaze/include/asm/unistd.h +1 −1
  53. arch/microblaze/include/uapi/asm/unistd.h +2 −0
  54. arch/microblaze/kernel/Makefile +1 −3
  55. arch/microblaze/kernel/heartbeat.c +0 −72
  56. arch/microblaze/kernel/platform.c +0 −29
  57. arch/microblaze/kernel/reset.c +6 −5
  58. arch/microblaze/kernel/syscall_table.S +2 −0
  59. arch/microblaze/kernel/timer.c +0 −7
  60. arch/mips/kernel/signal.c +2 −2
  61. arch/openrisc/include/asm/pgalloc.h +5 −1
  62. arch/openrisc/kernel/entry.S +1 −7
  63. arch/openrisc/kernel/head.S +6 −3
  64. arch/openrisc/kernel/traps.c +1 −1
  65. arch/parisc/Kconfig +3 −3
  66. arch/parisc/Makefile +0 −4
  67. arch/parisc/include/asm/signal.h +0 −8
  68. arch/parisc/include/uapi/asm/unistd.h +2 −1
  69. arch/parisc/kernel/drivers.c +9 −16
  70. arch/parisc/kernel/syscall_table.S +1 −0
  71. arch/parisc/kernel/unwind.c +2 −2
  72. arch/powerpc/include/asm/book3s/32/pgalloc.h +0 −1
  73. arch/powerpc/include/asm/nohash/32/pgalloc.h +0 −1
  74. arch/powerpc/include/asm/systbl.h +1 −0
  75. arch/powerpc/include/asm/unistd.h +1 −1
  76. arch/powerpc/include/uapi/asm/unistd.h +1 −0
  77. arch/powerpc/kernel/pci_32.c +0 −4
  78. arch/powerpc/kernel/pci_64.c +0 −4
  79. arch/powerpc/kernel/rtas.c +0 −4
  80. arch/powerpc/kernel/signal_32.c +0 −8
  81. arch/powerpc/kernel/signal_64.c +0 −4
  82. arch/powerpc/kernel/syscalls.c +0 −4
  83. arch/powerpc/mm/subpage-prot.c +0 −4
  84. arch/powerpc/platforms/powermac/time.c +20 −9
  85. arch/s390/net/bpf_jit_comp.c +1 −0
  86. arch/x86/entry/entry_32.S +1 −1
  87. arch/x86/entry/entry_64_compat.S +8 −8
  88. arch/x86/include/asm/pgalloc.h +3 −0
  89. arch/x86/include/asm/pgtable.h +1 −1
  90. arch/x86/include/asm/pgtable_64.h +2 −2
  91. arch/x86/kernel/e820.c +12 −3
  92. arch/x86/mm/fault.c +7 −14
  93. arch/x86/platform/efi/efi_64.c +2 −2
  94. block/blk-core.c +4 −0
  95. block/blk-mq.c +12 −0
  96. certs/blacklist.h +1 −1
  97. crypto/af_alg.c +10 −3
  98. crypto/algif_aead.c +2 −2
  99. crypto/algif_skcipher.c +2 −2
  100. crypto/asymmetric_keys/x509_cert_parser.c +9 −0
  101. drivers/acpi/osl.c +72 −0
  102. drivers/atm/iphase.c +1 −1
  103. drivers/atm/zatm.c +2 −0
  104. drivers/base/power/domain.c +3 −4
  105. drivers/block/drbd/drbd_req.c +2 −2
  106. drivers/char/random.c +13 −16
  107. drivers/cpufreq/qcom-cpufreq-kryo.c +4 −4
  108. drivers/dax/super.c +8 −0
  109. drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c +1 −1
  110. drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +27 −6
  111. drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +5 −3
  112. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +8 −8
  113. drivers/gpu/drm/arm/malidp_drv.c +2 −1
  114. drivers/gpu/drm/arm/malidp_hw.c +2 −1
  115. drivers/gpu/drm/arm/malidp_planes.c +6 −3
  116. drivers/gpu/drm/i915/i915_drv.h +0 −3
  117. drivers/gpu/drm/meson/meson_drv.c +8 −4
  118. drivers/i2c/algos/i2c-algo-bit.c +4 −4
  119. drivers/i2c/busses/i2c-gpio.c +2 −2
  120. drivers/i2c/i2c-core-smbus.c +9 −5
  121. drivers/iio/accel/mma8452.c +1 −1
  122. drivers/iio/imu/inv_mpu6050/inv_mpu_core.c +2 −0
  123. drivers/iio/light/tsl2772.c +2 −0
  124. drivers/iio/pressure/bmp280-core.c +2 −3
  125. drivers/infiniband/hw/mlx5/main.c +1 −1
  126. drivers/input/input-mt.c +8 −4
  127. drivers/input/joystick/xpad.c +1 −1
  128. drivers/input/keyboard/goldfish_events.c +5 −4
  129. drivers/input/misc/Kconfig +10 −0
  130. drivers/input/misc/Makefile +1 −0
  131. drivers/input/misc/sc27xx-vibra.c +154 −0
  132. drivers/input/mouse/elan_i2c.h +2 −0
  133. drivers/input/mouse/elan_i2c_core.c +2 −1
  134. drivers/input/mouse/elan_i2c_smbus.c +8 −2
  135. drivers/input/mouse/elantech.c +9 −2
  136. drivers/input/mouse/psmouse-base.c +6 −6
  137. drivers/input/rmi4/Kconfig +1 −0
  138. drivers/input/rmi4/rmi_2d_sensor.c +16 −18
  139. drivers/input/rmi4/rmi_bus.c +49 −1
  140. drivers/input/rmi4/rmi_bus.h +9 −1
  141. drivers/input/rmi4/rmi_driver.c +20 −32
  142. drivers/input/rmi4/rmi_f01.c +5 −5
  143. drivers/input/rmi4/rmi_f03.c +5 −4
  144. drivers/input/rmi4/rmi_f11.c +16 −26
  145. drivers/input/rmi4/rmi_f12.c +4 −4
  146. drivers/input/rmi4/rmi_f30.c +5 −4
  147. drivers/input/rmi4/rmi_f34.c +3 −2
  148. drivers/input/rmi4/rmi_f54.c +0 −6
  149. drivers/input/touchscreen/silead.c +1 −0
  150. drivers/isdn/mISDN/socket.c +1 −1
  151. drivers/md/dm-raid.c +1 −1
  152. drivers/md/dm-table.c +4 −3
  153. drivers/md/dm-thin-metadata.c +0 −9
  154. drivers/md/dm-thin.c +9 −2
  155. drivers/md/dm-writecache.c +5 −5
  156. drivers/md/dm-zoned-target.c +1 −1
  157. drivers/md/dm.c +3 −5
  158. drivers/md/md.c +5 −3
  159. drivers/md/raid10.c +7 −0
  160. drivers/media/rc/bpf-lirc.c +2 −12
  161. drivers/mtd/chips/cfi_cmdset_0002.c +11 −8
  162. drivers/mtd/devices/mtd_dataflash.c +2 −2
  163. drivers/mtd/nand/raw/denali_dt.c +5 −1
  164. drivers/mtd/nand/raw/mxc_nand.c +4 −1
  165. drivers/mtd/nand/raw/nand_base.c +1 −1
  166. drivers/mtd/nand/raw/nand_macronix.c +36 −12
  167. drivers/mtd/nand/raw/nand_micron.c +2 −0
  168. drivers/net/ethernet/atheros/alx/main.c +7 −1
  169. drivers/net/ethernet/broadcom/bnx2x/bnx2x.h +1 −0
  170. drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +6 −0
  171. drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +6 −0
  172. drivers/net/ethernet/broadcom/cnic.c +1 −1
  173. drivers/net/ethernet/cadence/macb_main.c +2 −0
  174. drivers/net/ethernet/freescale/dpaa/dpaa_eth.c +8 −7
  175. drivers/net/ethernet/freescale/fman/fman_port.c +8 −0
  176. drivers/net/ethernet/huawei/hinic/hinic_rx.c +1 −0
  177. drivers/net/ethernet/intel/i40e/i40e_txrx.c +15 −9
  178. drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +14 −10
  179. drivers/net/ethernet/mellanox/mlx5/core/cmd.c +4 −4
  180. drivers/net/ethernet/mellanox/mlx5/core/en_main.c +6 −6
  181. drivers/net/ethernet/mellanox/mlx5/core/en_rep.c +6 −2
  182. drivers/net/ethernet/mellanox/mlx5/core/eswitch.c +5 −7
  183. drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c +2 −2
  184. drivers/net/ethernet/mellanox/mlx5/core/fs_core.c +2 −1
  185. drivers/net/ethernet/mellanox/mlx5/core/fw.c +3 −2
  186. drivers/net/ethernet/mellanox/mlx5/core/lib/mpfs.c +5 −4
  187. drivers/net/ethernet/mellanox/mlx5/core/port.c +2 −2
  188. drivers/net/ethernet/mellanox/mlx5/core/sriov.c +6 −1
  189. drivers/net/ethernet/mellanox/mlx5/core/vport.c +0 −2
  190. drivers/net/ethernet/netronome/nfp/bpf/main.c +6 −3
  191. drivers/net/ethernet/netronome/nfp/flower/match.c +14 −0
  192. drivers/net/ethernet/netronome/nfp/flower/offload.c +11 −0
  193. drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nffw.c +1 −1
  194. drivers/net/ethernet/qlogic/qed/qed_dcbx.c +4 −4
  195. drivers/net/ethernet/qlogic/qed/qed_dev.c +1 −1
  196. drivers/net/ethernet/qlogic/qed/qed_main.c +8 −0
  197. drivers/net/ethernet/qlogic/qed/qed_sriov.c +17 −2
  198. drivers/net/ethernet/qlogic/qede/qede_ptp.c +8 −2
  199. drivers/net/ethernet/sfc/farch.c +1 −0
  200. drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c +12 −0
  201. drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.h +2 −0
  202. drivers/net/ethernet/stmicro/stmmac/hwif.h +3 −0
  203. drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +2 −0
  204. drivers/net/geneve.c +1 −1
  205. drivers/net/hyperv/hyperv_net.h +1 −1
  206. drivers/net/hyperv/netvsc.c +36 −1
  207. drivers/net/hyperv/netvsc_drv.c +16 −1
  208. drivers/net/hyperv/rndis_filter.c +12 −49
  209. drivers/net/ipvlan/ipvlan_main.c +28 −8
  210. drivers/net/phy/dp83tc811.c +1 −1
  211. drivers/net/ppp/pppoe.c +1 −1
  212. drivers/net/usb/lan78xx.c +34 −3
  213. drivers/net/usb/r8152.c +2 −1
  214. drivers/net/virtio_net.c +19 −11
  215. drivers/net/vxlan.c +1 −3
  216. drivers/nfc/pn533/usb.c +2 −2
  217. drivers/nvdimm/pmem.c +2 −1
  218. drivers/nvme/host/rdma.c +5 −2
  219. drivers/pci/Makefile +3 −3
  220. drivers/pci/controller/Kconfig +0 −3
  221. drivers/pci/hotplug/acpi_pcihp.c +9 −1
  222. drivers/perf/xgene_pmu.c +1 −1
  223. drivers/s390/net/qeth_core.h +12 −1
  224. drivers/s390/net/qeth_core_main.c +28 −19
  225. drivers/s390/net/qeth_l2_main.c +15 −9
  226. drivers/s390/net/qeth_l3_main.c +2 −1
  227. drivers/scsi/ipr.c +0 −2
  228. drivers/scsi/qla2xxx/qla_target.c +3 −4
  229. drivers/scsi/scsi_debug.c +1 −1
  230. drivers/soc/imx/gpcv2.c +9 −4
  231. drivers/soc/qcom/Kconfig +2 −1
  232. drivers/soc/renesas/rcar-sysc.c +29 −6
  233. drivers/staging/android/ion/ion_heap.c +1 −1
  234. drivers/staging/comedi/drivers/quatech_daqp_cs.c +1 −1
  235. drivers/staging/typec/Kconfig +1 −0
  236. drivers/target/target_core_user.c +36 −8
  237. drivers/tty/n_tty.c +32 −23
  238. drivers/tty/serdev/core.c +1 −0
  239. drivers/tty/serial/8250/8250_pci.c +0 −2
  240. drivers/tty/vt/vt.c +2 −2
  241. drivers/usb/chipidea/host.c +4 −1
  242. drivers/usb/class/cdc-acm.c +3 −0
  243. drivers/usb/dwc2/core.h +3 −0
  244. drivers/usb/dwc2/gadget.c +12 −8
  245. drivers/usb/dwc2/hcd.c +87 −6
  246. drivers/usb/dwc2/hcd.h +8 −0
  247. drivers/usb/dwc2/hcd_intr.c +9 −2
  248. drivers/usb/dwc2/hcd_queue.c +4 −1
  249. drivers/usb/dwc3/core.c +13 −10
  250. drivers/usb/dwc3/dwc3-of-simple.c +2 −1
  251. drivers/usb/dwc3/dwc3-pci.c +2 −0
  252. drivers/usb/dwc3/dwc3-qcom.c +5 −8
  253. drivers/usb/gadget/composite.c +3 −0
  254. drivers/usb/gadget/function/f_fs.c +18 −8
  255. drivers/usb/host/xhci-mem.c +2 −2
  256. drivers/usb/host/xhci-tegra.c +3 −3
  257. drivers/usb/host/xhci-trace.h +31 −5
  258. drivers/usb/host/xhci.c +43 −4
  259. drivers/usb/host/xhci.h +4 −0
  260. drivers/usb/serial/cp210x.c +14 −0
  261. drivers/usb/typec/tcpm.c +6 −4
  262. drivers/usb/typec/ucsi/ucsi.c +13 −0
  263. drivers/usb/typec/ucsi/ucsi_acpi.c +5 −0
  264. fs/aio.c +1 −147
  265. fs/btrfs/extent_io.c +4 −1
  266. fs/btrfs/inode.c +5 −2
  267. fs/btrfs/ioctl.c +5 −5
  268. fs/btrfs/qgroup.c +13 −4
  269. fs/ceph/inode.c +1 −0
  270. fs/eventfd.c +6 −13
  271. fs/eventpoll.c +5 −10
  272. fs/pipe.c +9 −13
  273. fs/proc/generic.c +10 −1
  274. fs/select.c +0 −23
  275. fs/timerfd.c +11 −11
  276. fs/xfs/libxfs/xfs_ag_resv.c +27 −4
  277. fs/xfs/libxfs/xfs_bmap.c +26 −0
  278. fs/xfs/libxfs/xfs_bmap.h +2 −0
  279. fs/xfs/libxfs/xfs_format.h +5 −0
  280. fs/xfs/libxfs/xfs_inode_buf.c +47 −29
  281. fs/xfs/libxfs/xfs_rtbitmap.c +2 −2
  282. fs/xfs/xfs_bmap_util.c +52 −54
  283. fs/xfs/xfs_fsmap.c +2 −2
  284. fs/xfs/xfs_fsops.c +1 −1
  285. fs/xfs/xfs_inode.c +21 −36
  286. fs/xfs/xfs_iomap.c +14 −1
  287. fs/xfs/xfs_trans.c +6 −1
  288. include/crypto/if_alg.h +2 −1
  289. include/linux/acpi.h +3 −0
  290. include/linux/blkdev.h +2 −2
  291. include/linux/bpf-cgroup.h +26 −0
  292. include/linux/bpf.h +8 −0
  293. include/linux/bpf_lirc.h +3 −2
  294. include/linux/compat.h +7 −1
  295. include/linux/compiler-gcc.h +25 −0
  296. include/linux/compiler_types.h +18 −0
  297. include/linux/dax.h +1 −1
  298. include/linux/filter.h +8 −48
  299. include/linux/fs.h +0 −2
  300. include/linux/iio/buffer-dma.h +1 −1
  301. include/linux/input/mt.h +1 −1
  302. include/linux/mlx5/eswitch.h +2 −0
  303. include/linux/mlx5/mlx5_ifc.h +1 −1
  304. include/linux/net.h +0 −1
  305. include/linux/netdevice.h +20 −0
  306. include/linux/pm_domain.h +3 −3
  307. include/linux/poll.h +6 −6
  308. include/linux/rmi.h +2 −0
  309. include/linux/scatterlist.h +0 −18
  310. include/linux/skbuff.h +2 −1
  311. include/linux/slub_def.h +4 −0
  312. include/linux/syscalls.h +4 −0
  313. include/net/bluetooth/bluetooth.h +1 −1
  314. include/net/iucv/af_iucv.h +2 −0
  315. include/net/net_namespace.h +1 −0
  316. include/net/netns/ipv6.h +0 −1
  317. include/net/pkt_cls.h +5 −0
  318. include/net/sctp/sctp.h +2 −1
  319. include/net/tcp.h +2 −1
  320. include/net/tls.h +4 −2
  321. include/net/udp.h +1 −1
  322. include/uapi/linux/aio_abi.h +4 −2
  323. include/uapi/linux/bpf.h +23 −5
  324. include/uapi/linux/target_core_user.h +3 −1
  325. init/Kconfig +3 −4
  326. kernel/bpf/cgroup.c +54 −0
  327. kernel/bpf/core.c +1 −29
  328. kernel/bpf/sockmap.c +184 −70
  329. kernel/bpf/syscall.c +21 −78
  330. kernel/dma/swiotlb.c +1 −0
  331. kernel/events/core.c +1 −1
  332. lib/Kconfig.kasan +1 −0
  333. lib/percpu_ida.c +1 −1
  334. lib/scatterlist.c +0 −6
  335. lib/test_bpf.c +20 −0
  336. lib/test_printf.c +0 −7
  337. mm/slab_common.c +4 −0
  338. mm/slub.c +6 −1
  339. mm/vmstat.c +0 −2
  340. net/8021q/vlan.c +1 −1
  341. net/Makefile +0 −4
  342. net/appletalk/ddp.c +1 −1
  343. net/atm/common.c +8 −3
  344. net/atm/common.h +1 −1
  345. net/atm/pvc.c +1 −1
  346. net/atm/svc.c +1 −1
  347. net/ax25/af_ax25.c +1 −1
  348. net/bluetooth/af_bluetooth.c +5 −2
  349. net/bluetooth/hci_sock.c +1 −1
  350. net/bluetooth/l2cap_sock.c +1 −1
  351. net/bluetooth/rfcomm/sock.c +1 −1
  352. net/bluetooth/sco.c +1 −1
  353. net/bpfilter/Kconfig +1 −1
  354. net/bpfilter/Makefile +2 −15
  355. net/bpfilter/bpfilter_kern.c +5 −6
  356. net/bpfilter/bpfilter_umh_blob.S +7 −0
  357. net/caif/caif_socket.c +8 −4
  358. net/can/bcm.c +1 −1
  359. net/can/raw.c +1 −1
  360. net/core/datagram.c +9 −4
  361. net/core/dev_ioctl.c +2 −9
  362. net/core/fib_rules.c +79 −1
  363. net/core/filter.c +54 −32
  364. net/core/skbuff.c +1 −2
  365. net/core/sock.c +5 −2
  366. net/dccp/dccp.h +2 −1
  367. net/dccp/ipv4.c +1 −1
  368. net/dccp/ipv6.c +1 −1
  369. net/dccp/proto.c +11 −2
  370. net/decnet/af_decnet.c +3 −3
  371. net/ieee802154/socket.c +2 −2
  372. net/ipv4/af_inet.c +4 −4
  373. net/ipv4/fou.c +1 −3
  374. net/ipv4/gre_offload.c +1 −1
  375. net/ipv4/sysctl_net_ipv4.c +13 −5
  376. net/ipv4/tcp.c +17 −6
  377. net/ipv4/tcp_input.c +11 −2
  378. net/ipv4/udp.c +5 −5
  379. net/ipv4/udp_offload.c +1 −1
  380. net/ipv6/addrconf.c +6 −3
  381. net/ipv6/af_inet6.c +2 −2
  382. net/ipv6/netfilter/nf_conntrack_reasm.c +3 −3
  383. net/ipv6/raw.c +2 −2
  384. net/ipv6/seg6_hmac.c +1 −1
  385. net/iucv/af_iucv.c +5 −2
  386. net/kcm/kcmsock.c +5 −5
  387. net/key/af_key.c +1 −1
  388. net/l2tp/l2tp_ip.c +1 −1
  389. net/l2tp/l2tp_ip6.c +1 −1
  390. net/l2tp/l2tp_ppp.c +1 −1
  391. net/llc/af_llc.c +1 −1
  392. net/mac80211/tx.c +2 −0
  393. net/netfilter/nf_conncount.c +47 −5
  394. net/netfilter/nf_conntrack_helper.c +5 −0
  395. net/netfilter/nf_log.c +10 −3
  396. net/netfilter/nfnetlink_queue.c +3 −0
  397. net/netlink/af_netlink.c +1 −1
  398. net/netrom/af_netrom.c +1 −1
  399. net/nfc/llcp_sock.c +6 −3
  400. net/nfc/rawsock.c +2 −2
  401. net/packet/af_packet.c +5 −4
  402. net/phonet/socket.c +6 −3
  403. net/qrtr/qrtr.c +1 −1
  404. net/rds/connection.c +10 −1
  405. net/rds/loop.c +56 −0
  406. net/rds/loop.h +2 −0
  407. net/rose/af_rose.c +1 −1
  408. net/rxrpc/af_rxrpc.c +7 −3
  409. net/sctp/ipv6.c +1 −1
  410. net/sctp/protocol.c +1 −1
  411. net/sctp/socket.c +3 −1
  412. net/smc/af_smc.c +67 −31
  413. net/smc/smc.h +8 −0
  414. net/socket.c +7 −43
  415. net/strparser/strparser.c +1 −16
  416. net/tipc/socket.c +9 −5
  417. net/tls/tls_main.c +1 −1
  418. net/tls/tls_sw.c +10 −9
  419. net/unix/af_unix.c +19 −11
  420. net/vmw_vsock/af_vsock.c +13 −6
  421. net/wireless/nl80211.c +14 −21
  422. net/x25/af_x25.c +1 −1
  423. net/xdp/xsk.c +4 −3
  424. samples/bpf/xdp_fwd_kern.c +4 −4
  425. scripts/cc-can-link.sh +1 −1
  426. scripts/checkpatch.pl +0 −6
  427. scripts/gcc-x86_64-has-stack-protector.sh +1 −1
  428. scripts/kconfig/expr.h +3 −0
  429. scripts/kconfig/preprocess.c +1 −1
  430. scripts/kconfig/zconf.y +6 −2
  431. security/keys/dh.c +4 −2
  432. security/selinux/selinuxfs.c +33 −45
  433. security/smack/smack_lsm.c +1 −0
  434. sound/core/seq/seq_clientmgr.c +2 −1
  435. sound/core/timer.c +1 −1
  436. sound/pci/hda/hda_codec.c +3 −2
  437. sound/pci/hda/hda_codec.h +1 −0
  438. sound/pci/hda/patch_ca0132.c +23 −41
  439. sound/pci/hda/patch_hdmi.c +5 −0
  440. sound/pci/hda/patch_realtek.c +17 −3
  441. sound/pci/lx6464es/lx6464es.c +1 −0
  442. tools/arch/arm/include/uapi/asm/kvm.h +1 −0
  443. tools/arch/arm64/include/uapi/asm/kvm.h +1 −0
  444. tools/arch/powerpc/include/uapi/asm/kvm.h +1 −0
  445. tools/arch/powerpc/include/uapi/asm/unistd.h +1 −0
  446. tools/arch/x86/include/asm/cpufeatures.h +2 −0
  447. tools/bpf/bpftool/prog.c +8 −4
  448. tools/include/uapi/drm/drm.h +7 −0
  449. tools/include/uapi/linux/bpf.h +1 −1
  450. tools/include/uapi/linux/if_link.h +2 −0
  451. tools/include/uapi/linux/kvm.h +1 −0
  452. tools/perf/arch/powerpc/util/skip-callchain-idx.c +1 −1
  453. tools/perf/arch/x86/entry/syscalls/syscall_64.tbl +2 −0
  454. tools/perf/bench/numa.c +3 −2
  455. tools/perf/builtin-annotate.c +10 −1
  456. tools/perf/builtin-report.c +2 −1
  457. tools/perf/builtin-script.c +27 −3
  458. tools/perf/tests/parse-events.c +20 −5
  459. tools/perf/tests/topology.c +1 −0
  460. tools/perf/util/c++/clang.cpp +9 −2
  461. tools/perf/util/header.c +10 −2
  462. tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c +1 −1
  463. tools/perf/util/pmu.c +97 −2
  464. tools/testing/selftests/bpf/config +1 −0
  465. tools/testing/selftests/bpf/test_kmod.sh +9 −0
  466. tools/testing/selftests/bpf/test_lirc_mode2.sh +9 −0
  467. tools/testing/selftests/bpf/test_lwt_seg6local.sh +9 −0
  468. tools/testing/selftests/bpf/test_sockmap.c +0 −6
  469. tools/testing/selftests/net/fib_tests.sh +0 −0
  470. tools/testing/selftests/x86/sigreturn.c +36 −23
  471. tools/virtio/linux/scatterlist.h +0 −18
Documentation/admin-guide/pm/intel_pstate.rst+12−2
@@ -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``
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/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/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/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 ...
MAINTAINERS+19−6
@@ -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>
@@ -5669,7 +5673,7 @@ F: drivers/crypto/caam/ · 2689 unmodified lines
56695673 F: Documentation/devicetree/bindings/crypto/fsl-sec4.txt
56705674
56715675 FREESCALE DIU FRAMEBUFFER DRIVER
5672−M: Timur Tabi <timur@tabi.org>
5676+M: Timur Tabi <timur@kernel.org>
56735677 L: linux-fbdev@vger.kernel.org
56745678 S: Maintained
56755679 F: drivers/video/fbdev/fsl-diu-fb.*
@@ -5769,7 +5773,7 @@ S: Maintained · 93 unmodified lines
57695773 F: drivers/net/wan/fsl_ucc_hdlc*
57705774
57715775 FREESCALE QUICC ENGINE UCC UART DRIVER
5772−M: Timur Tabi <timur@tabi.org>
5776+M: Timur Tabi <timur@kernel.org>
57735777 L: linuxppc-dev@lists.ozlabs.org
57745778 S: Maintained
57755779 F: drivers/tty/serial/ucc_uart.c
@@ -5793,7 +5797,7 @@ F: drivers/net/ethernet/freescale/fs_enet/ · 17 unmodified lines
57935797 F: include/linux/fs_enet_pd.h
57945798
57955799 FREESCALE SOC SOUND DRIVERS
5796−M: Timur Tabi <timur@tabi.org>
5800+M: Timur Tabi <timur@kernel.org>
57975801 M: Nicolin Chen <nicoleotsuka@gmail.com>
57985802 M: Xiubo Li <Xiubo.Lee@gmail.com>
57995803 R: Fabio Estevam <fabio.estevam@nxp.com>
@@ -11478,6 +11482,15 @@ W: http://wireless.kernel.org/en/users/Drivers/p54 · 5678 unmodified lines
1147811482 S: Obsolete
1147911483 F: drivers/net/wireless/intersil/prism54/
1148011484
11485+PROC FILESYSTEM
11486+R: Alexey Dobriyan <adobriyan@gmail.com>
11487+L: linux-kernel@vger.kernel.org
11488+L: linux-fsdevel@vger.kernel.org
11489+S: Maintained
11490+F: fs/proc/
11491+F: include/linux/proc_fs.h
11492+F: tools/testing/selftests/proc/
11493+
1148111494 PROC SYSCTL
1148211495 M: "Luis R. Rodriguez" <mcgrof@kernel.org>
1148311496 M: Kees Cook <keescook@chromium.org>
@@ -11810,9 +11823,9 @@ F: Documentation/devicetree/bindings/opp/kryo-cpufreq.txt · 326 unmodified lines
1181011823 F: drivers/cpufreq/qcom-cpufreq-kryo.c
1181111824
1181211825 QUALCOMM EMAC GIGABIT ETHERNET DRIVER
11813−M: Timur Tabi <timur@codeaurora.org>
11826+M: Timur Tabi <timur@kernel.org>
1181411827 L: netdev@vger.kernel.org
11815−S: Supported
11828+S: Maintained
1181611829 F: drivers/net/ethernet/qualcomm/emac/
1181711830
1181811831 QUALCOMM HEXAGON ARCHITECTURE
Makefile+1−6
@@ -2,7 +2,7 @@ · 1 unmodified line
22 VERSION = 4
33 PATCHLEVEL = 18
44 SUBLEVEL = 0
5−EXTRAVERSION = -rc2
5+EXTRAVERSION = -rc3
66 NAME = Merciless Moray
77
88 # *DOCUMENTATION*
@@ -507,11 +507,6 @@ ifeq ($(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-goto.sh $(CC) $(KBUILD_CFLA · 498 unmodified lines
507507 KBUILD_AFLAGS += -DCC_HAVE_ASM_GOTO
508508 endif
509509
510−ifeq ($(shell $(CONFIG_SHELL) $(srctree)/scripts/cc-can-link.sh $(CC)), y)
511− CC_CAN_LINK := y
512− export CC_CAN_LINK
513−endif
514−
515510 # The expansion should be delayed until arch/$(SRCARCH)/Makefile is included.
516511 # Some architectures define CROSS_COMPILE in arch/$(SRCARCH)/Makefile.
517512 # CC_VERSION_TEXT is referenced from Kconfig (so it needs export),
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/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/net/bpf_jit_32.c+1−1
@@ -1844,7 +1844,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog) · 1843 unmodified lines
18441844 /* there are 2 passes here */
18451845 bpf_jit_dump(prog->len, image_size, 2, ctx.target);
18461846
1847− set_memory_ro((unsigned long)header, header->pages);
1847+ bpf_jit_binary_lock_ro(header);
18481848 prog->bpf_func = (void *)ctx.target;
18491849 prog->jited = 1;
18501850 prog->jited_len = image_size;
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/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/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/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/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/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/kernel/signal.c+2−2
@@ -801,7 +801,7 @@ 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(regs);
804+ rseq_signal_deliver(ksig, regs);
805805
806806 if (sig_uses_siginfo(&ksig->ka, abi))
807807 ret = abi->setup_rt_frame(vdso + abi->vdso->off_rt_sigreturn,
@@ -870,7 +870,7 @@ asmlinkage void do_notify_resume(struct pt_regs *regs, void *unused, · 62 unmodified lines
870870 if (thread_info_flags & _TIF_NOTIFY_RESUME) {
871871 clear_thread_flag(TIF_NOTIFY_RESUME);
872872 tracehook_notify_resume(regs);
873− rseq_handle_notify_resume(regs);
873+ rseq_handle_notify_resume(NULL, regs);
874874 }
875875
876876 user_enter();
arch/openrisc/include/asm/pgalloc.h+5−1
@@ -98,8 +98,12 @@ static inline void pte_free(struct mm_struct *mm, struct page *pte) · 97 unmodified lines
9898 __free_page(pte);
9999 }
100100
101+#define __pte_free_tlb(tlb, pte, addr) \
102+do { \
103+ pgtable_page_dtor(pte); \
104+ tlb_remove_page((tlb), (pte)); \
105+} while (0)
101106
102−#define __pte_free_tlb(tlb, pte, addr) tlb_remove_page((tlb), (pte))
103107 #define pmd_pgtable(pmd) pmd_page(pmd)
104108
105109 #define check_pgt_cache() do { } while (0)
arch/openrisc/kernel/entry.S+1−7
@@ -277,12 +277,6 @@ EXCEPTION_ENTRY(_data_page_fault_handler) · 276 unmodified lines
277277 l.addi r3,r1,0 // pt_regs
278278 /* r4 set be EXCEPTION_HANDLE */ // effective address of fault
279279
280− /*
281− * __PHX__: TODO
282− *
283− * all this can be written much simpler. look at
284− * DTLB miss handler in the CONFIG_GUARD_PROTECTED_CORE part
285− */
286280 #ifdef CONFIG_OPENRISC_NO_SPR_SR_DSX
287281 l.lwz r6,PT_PC(r3) // address of an offending insn
288282 l.lwz r6,0(r6) // instruction that caused pf
@@ -314,7 +308,7 @@ EXCEPTION_ENTRY(_data_page_fault_handler) · 25 unmodified lines
314308
315309 #else
316310
317− l.lwz r6,PT_SR(r3) // SR
311+ l.mfspr r6,r0,SPR_SR // SR
318312 l.andi r6,r6,SPR_SR_DSX // check for delay slot exception
319313 l.sfne r6,r0 // exception happened in delay slot
320314 l.bnf 7f
arch/openrisc/kernel/head.S+6−3
@@ -210,8 +210,7 @@ · 209 unmodified lines
210210 * r4 - EEAR exception EA
211211 * r10 - current pointing to current_thread_info struct
212212 * r12 - syscall 0, since we didn't come from syscall
213− * r13 - temp it actually contains new SR, not needed anymore
214− * r31 - handler address of the handler we'll jump to
213+ * r30 - handler address of the handler we'll jump to
215214 *
216215 * handler has to save remaining registers to the exception
217216 * ksp frame *before* tainting them!
@@ -244,6 +243,7 @@ · 26 unmodified lines
244243 /* r1 is KSP, r30 is __pa(KSP) */ ;\
245244 tophys (r30,r1) ;\
246245 l.sw PT_GPR12(r30),r12 ;\
246+ /* r4 use for tmp before EA */ ;\
247247 l.mfspr r12,r0,SPR_EPCR_BASE ;\
248248 l.sw PT_PC(r30),r12 ;\
249249 l.mfspr r12,r0,SPR_ESR_BASE ;\
@@ -263,7 +263,10 @@ · 13 unmodified lines
263263 /* r12 == 1 if we come from syscall */ ;\
264264 CLEAR_GPR(r12) ;\
265265 /* ----- turn on MMU ----- */ ;\
266− l.ori r30,r0,(EXCEPTION_SR) ;\
266+ /* Carry DSX into exception SR */ ;\
267+ l.mfspr r30,r0,SPR_SR ;\
268+ l.andi r30,r30,SPR_SR_DSX ;\
269+ l.ori r30,r30,(EXCEPTION_SR) ;\
267270 l.mtspr r0,r30,SPR_ESR_BASE ;\
268271 /* r30: EA address of handler */ ;\
269272 LOAD_SYMBOL_2_GPR(r30,handler) ;\
arch/openrisc/kernel/traps.c+1−1
@@ -300,7 +300,7 @@ static inline int in_delay_slot(struct pt_regs *regs) · 299 unmodified lines
300300 return 0;
301301 }
302302 #else
303− return regs->sr & SPR_SR_DSX;
303+ return mfspr(SPR_SR) & SPR_SR_DSX;
304304 #endif
305305 }
306306
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/include/asm/book3s/32/pgalloc.h+0−1
@@ -138,7 +138,6 @@ static inline void pgtable_free_tlb(struct mmu_gather *tlb, · 137 unmodified lines
138138 static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t table,
139139 unsigned long address)
140140 {
141− pgtable_page_dtor(table);
142141 pgtable_free_tlb(tlb, page_address(table), 0);
143142 }
144143 #endif /* _ASM_POWERPC_BOOK3S_32_PGALLOC_H */
arch/powerpc/include/asm/nohash/32/pgalloc.h+0−1
@@ -140,7 +140,6 @@ static inline void __pte_free_tlb(struct mmu_gather *tlb, pgtable_t table, · 139 unmodified lines
140140 unsigned long address)
141141 {
142142 tlb_flush_pgtable(tlb, address);
143− pgtable_page_dtor(table);
144143 pgtable_free_tlb(tlb, page_address(table), 0);
145144 }
146145 #endif /* _ASM_POWERPC_PGALLOC_32_H */
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/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/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/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/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/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/net/bpf_jit_comp.c+1−0
@@ -1286,6 +1286,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *fp) · 1285 unmodified lines
12861286 goto free_addrs;
12871287 }
12881288 if (bpf_jit_prog(&jit, fp)) {
1289+ bpf_jit_binary_free(header);
12891290 fp = orig_fp;
12901291 goto free_addrs;
12911292 }
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/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/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/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/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);
block/blk-core.c+4−0
@@ -3473,6 +3473,10 @@ static void __blk_rq_prep_clone(struct request *dst, struct request *src) · 3472 unmodified lines
34733473 dst->cpu = src->cpu;
34743474 dst->__sector = blk_rq_pos(src);
34753475 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+ }
34763480 dst->nr_phys_segments = src->nr_phys_segments;
34773481 dst->ioprio = src->ioprio;
34783482 dst->extra_len = src->extra_len;
block/blk-mq.c+12−0
@@ -1075,6 +1075,9 @@ static bool blk_mq_mark_tag_wait(struct blk_mq_hw_ctx **hctx, · 1074 unmodified lines
10751075
10761076 #define BLK_MQ_RESOURCE_DELAY 3 /* ms units */
10771077
1078+/*
1079+ * Returns true if we did some work AND can potentially do more.
1080+ */
10781081 bool blk_mq_dispatch_rq_list(struct request_queue *q, struct list_head *list,
10791082 bool got_budget)
10801083 {
@@ -1205,8 +1208,17 @@ bool blk_mq_dispatch_rq_list(struct request_queue *q, struct list_head *list, · 124 unmodified lines
12051208 blk_mq_run_hw_queue(hctx, true);
12061209 else if (needs_restart && (ret == BLK_STS_RESOURCE))
12071210 blk_mq_delay_run_hw_queue(hctx, BLK_MQ_RESOURCE_DELAY);
1211+
1212+ return false;
12081213 }
12091214
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+
12101222 return (queued + errors) != 0;
12111223 }
12121224
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;
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/atm/iphase.c+1−1
@@ -1618,7 +1618,7 @@ static int rx_init(struct atm_dev *dev) · 1617 unmodified lines
16181618 skb_queue_head_init(&iadev->rx_dma_q);
16191619 iadev->rx_free_desc_qhead = NULL;
16201620
1621− iadev->rx_open = kcalloc(4, iadev->num_vc, GFP_KERNEL);
1621+ iadev->rx_open = kcalloc(iadev->num_vc, sizeof(void *), GFP_KERNEL);
16221622 if (!iadev->rx_open) {
16231623 printk(KERN_ERR DEV_LABEL "itf %d couldn't get free page\n",
16241624 dev->number);
drivers/atm/zatm.c+2−0
@@ -1481,6 +1481,8 @@ static int zatm_ioctl(struct atm_dev *dev,unsigned int cmd,void __user *arg) · 1480 unmodified lines
14811481 return -EFAULT;
14821482 if (pool < 0 || pool > ZATM_LAST_POOL)
14831483 return -EINVAL;
1484+ pool = array_index_nospec(pool,
1485+ ZATM_LAST_POOL + 1);
14841486 if (copy_from_user(&info,
14851487 &((struct zatm_pool_req __user *) arg)->info,
14861488 sizeof(info))) return -EFAULT;
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/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/cpufreq/qcom-cpufreq-kryo.c+4−4
@@ -87,8 +87,8 @@ static int qcom_cpufreq_kryo_probe(struct platform_device *pdev) · 86 unmodified lines
8787 int ret;
8888
8989 cpu_dev = get_cpu_device(0);
90− if (NULL == cpu_dev)
91− ret = -ENODEV;
90+ if (!cpu_dev)
91+ return -ENODEV;
9292
9393 msm8996_version = qcom_cpufreq_kryo_get_msm_id();
9494 if (NUM_OF_MSM8996_VERSIONS == msm8996_version) {
@@ -97,8 +97,8 @@ static int qcom_cpufreq_kryo_probe(struct platform_device *pdev) · 2 unmodified lines
9797 }
9898
9999 np = dev_pm_opp_of_get_opp_desc_node(cpu_dev);
100− if (IS_ERR(np))
101− return PTR_ERR(np);
100+ if (!np)
101+ return -ENOENT;
102102
103103 ret = of_device_is_compatible(np, "operating-points-v2-kryo-cpu");
104104 if (!ret) {
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/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_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
@@ -1463,7 +1463,9 @@ static int amdgpu_vm_bo_split_mapping(struct amdgpu_device *adev, · 1462 unmodified lines
14631463 uint64_t count;
14641464
14651465 max_entries = min(max_entries, 16ull * 1024ull);
1466− for (count = 1; count < max_entries; ++count) {
1466+ for (count = 1;
1467+ count < max_entries / (PAGE_SIZE / AMDGPU_GPU_PAGE_SIZE);
1468+ ++count) {
14671469 uint64_t idx = pfn + count;
14681470
14691471 if (pages_addr[idx] !=
@@ -1476,7 +1478,7 @@ static int amdgpu_vm_bo_split_mapping(struct amdgpu_device *adev, · 6 unmodified lines
14761478 dma_addr = pages_addr;
14771479 } else {
14781480 addr = pages_addr[pfn];
1479− max_entries = count;
1481+ max_entries = count * (PAGE_SIZE / AMDGPU_GPU_PAGE_SIZE);
14801482 }
14811483
14821484 } else if (flags & AMDGPU_PTE_VALID) {
@@ -1491,7 +1493,7 @@ static int amdgpu_vm_bo_split_mapping(struct amdgpu_device *adev, · 8 unmodified lines
14911493 if (r)
14921494 return r;
14931495
1494− pfn += last - start + 1;
1496+ pfn += (last - start + 1) / (PAGE_SIZE / AMDGPU_GPU_PAGE_SIZE);
14951497 if (nodes && nodes->size == pfn) {
14961498 pfn = 0;
14971499 ++nodes;
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c+8−8
@@ -3928,10 +3928,11 @@ static void amdgpu_dm_do_flip(struct drm_crtc *crtc, · 3927 unmodified lines
39283928 if (acrtc->base.state->event)
39293929 prepare_flip_isr(acrtc);
39303930
3931+ spin_unlock_irqrestore(&crtc->dev->event_lock, flags);
3932+
39313933 surface_updates->surface = dc_stream_get_status(acrtc_state->stream)->plane_states[0];
39323934 surface_updates->flip_addr = &addr;
39333935
3934−
39353936 dc_commit_updates_for_stream(adev->dm.dc,
39363937 surface_updates,
39373938 1,
@@ -3944,9 +3945,6 @@ static void amdgpu_dm_do_flip(struct drm_crtc *crtc, · 6 unmodified lines
39443945 __func__,
39453946 addr.address.grph.addr.high_part,
39463947 addr.address.grph.addr.low_part);
3947−
3948−
3949− spin_unlock_irqrestore(&crtc->dev->event_lock, flags);
39503948 }
39513949
39523950 /*
@@ -4206,6 +4204,7 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) · 253 unmodified lines
42064204 struct drm_connector *connector;
42074205 struct drm_connector_state *old_con_state, *new_con_state;
42084206 struct dm_crtc_state *dm_old_crtc_state, *dm_new_crtc_state;
4207+ int crtc_disable_count = 0;
42094208
42104209 drm_atomic_helper_update_legacy_modeset_state(dev, state);
42114210
@@ -4410,6 +4409,9 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) · 198 unmodified lines
44104409 struct amdgpu_crtc *acrtc = to_amdgpu_crtc(crtc);
44114410 bool modeset_needed;
44124411
4412+ if (old_crtc_state->active && !new_crtc_state->active)
4413+ crtc_disable_count++;
4414+
44134415 dm_new_crtc_state = to_dm_crtc_state(new_crtc_state);
44144416 dm_old_crtc_state = to_dm_crtc_state(old_crtc_state);
44154417 modeset_needed = modeset_required(
@@ -4463,11 +4465,9 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) · 47 unmodified lines
44634465 * so we can put the GPU into runtime suspend if we're not driving any
44644466 * displays anymore
44654467 */
4468+ for (i = 0; i < crtc_disable_count; i++)
4469+ pm_runtime_put_autosuspend(dev->dev);
44664470 pm_runtime_mark_last_busy(dev->dev);
4467− for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) {
4468− if (old_crtc_state->active && !new_crtc_state->active)
4469− pm_runtime_put_autosuspend(dev->dev);
4470− }
44714471 }
44724472
44734473
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/i915/i915_drv.h+0−3
@@ -2245,9 +2245,6 @@ static inline struct scatterlist *____sg_next(struct scatterlist *sg) · 2244 unmodified lines
22452245 **/
22462246 static inline struct scatterlist *__sg_next(struct scatterlist *sg)
22472247 {
2248−#ifdef CONFIG_DEBUG_SG
2249− BUG_ON(sg->sg_magic != SG_MAGIC);
2250−#endif
22512248 return sg_is_last(sg) ? NULL : ____sg_next(sg);
22522249 }
22532250
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/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/hw/mlx5/main.c+1−1
@@ -6113,7 +6113,7 @@ static void *mlx5_ib_add(struct mlx5_core_dev *mdev) · 6112 unmodified lines
61136113 dev->num_ports = max(MLX5_CAP_GEN(mdev, num_ports),
61146114 MLX5_CAP_GEN(mdev, num_vhca_ports));
61156115
6116− if (MLX5_VPORT_MANAGER(mdev) &&
6116+ if (MLX5_ESWITCH_MANAGER(mdev) &&
61176117 mlx5_ib_eswitch_mode(mdev->priv.eswitch) == SRIOV_OFFLOADS) {
61186118 dev->rep = mlx5_ib_vport_rep(mdev->priv.eswitch, 0);
61196119
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/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/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/md/md.c+5−3
@@ -5547,7 +5547,8 @@ int md_run(struct mddev *mddev) · 5546 unmodified lines
55475547 else
55485548 pr_warn("md: personality for level %s is not loaded!\n",
55495549 mddev->clevel);
5550− return -EINVAL;
5550+ err = -EINVAL;
5551+ goto abort;
55515552 }
55525553 spin_unlock(&pers_lock);
55535554 if (mddev->level != pers->level) {
@@ -5560,7 +5561,8 @@ int md_run(struct mddev *mddev) · 6 unmodified lines
55605561 pers->start_reshape == NULL) {
55615562 /* This personality cannot handle reshaping... */
55625563 module_put(pers->owner);
5563− return -EINVAL;
5564+ err = -EINVAL;
5565+ goto abort;
55645566 }
55655567
55665568 if (pers->sync_request) {
@@ -5629,7 +5631,7 @@ int md_run(struct mddev *mddev) · 62 unmodified lines
56295631 mddev->private = NULL;
56305632 module_put(pers->owner);
56315633 bitmap_destroy(mddev);
5632− return err;
5634+ goto abort;
56335635 }
56345636 if (mddev->queue) {
56355637 bool nonrot = true;
drivers/md/raid10.c+7−0
@@ -3893,6 +3893,13 @@ static int raid10_run(struct mddev *mddev) · 3892 unmodified lines
38933893 disk->rdev->saved_raid_disk < 0)
38943894 conf->fullsync = 1;
38953895 }
3896+
3897+ if (disk->replacement &&
3898+ !test_bit(In_sync, &disk->replacement->flags) &&
3899+ disk->replacement->saved_raid_disk < 0) {
3900+ conf->fullsync = 1;
3901+ }
3902+
38963903 disk->recovery_disabled = mddev->recovery_disabled - 1;
38973904 }
38983905
drivers/media/rc/bpf-lirc.c+2−12
@@ -207,29 +207,19 @@ void lirc_bpf_free(struct rc_dev *rcdev) · 206 unmodified lines
207207 bpf_prog_array_free(rcdev->raw->progs);
208208 }
209209
210−int lirc_prog_attach(const union bpf_attr *attr)
210+int lirc_prog_attach(const union bpf_attr *attr, struct bpf_prog *prog)
211211 {
212− struct bpf_prog *prog;
213212 struct rc_dev *rcdev;
214213 int ret;
215214
216215 if (attr->attach_flags)
217216 return -EINVAL;
218217
219− prog = bpf_prog_get_type(attr->attach_bpf_fd,
220− BPF_PROG_TYPE_LIRC_MODE2);
221− if (IS_ERR(prog))
222− return PTR_ERR(prog);
223−
224218 rcdev = rc_dev_get_from_fd(attr->target_fd);
225− if (IS_ERR(rcdev)) {
226− bpf_prog_put(prog);
219+ if (IS_ERR(rcdev))
227220 return PTR_ERR(rcdev);
228− }
229221
230222 ret = lirc_bpf_attach(rcdev, prog);
231− if (ret)
232− bpf_prog_put(prog);
233223
234224 put_device(&rcdev->dev);
235225
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/atheros/alx/main.c+7−1
@@ -1897,13 +1897,19 @@ static int alx_resume(struct device *dev) · 1896 unmodified lines
18971897 struct pci_dev *pdev = to_pci_dev(dev);
18981898 struct alx_priv *alx = pci_get_drvdata(pdev);
18991899 struct alx_hw *hw = &alx->hw;
1900+ int err;
19001901
19011902 alx_reset_phy(hw);
19021903
19031904 if (!netif_running(alx->dev))
19041905 return 0;
19051906 netif_device_attach(alx->dev);
1906− return __alx_open(alx, true);
1907+
1908+ rtnl_lock();
1909+ err = __alx_open(alx, true);
1910+ rtnl_unlock();
1911+
1912+ return err;
19071913 }
19081914
19091915 static SIMPLE_DEV_PM_OPS(alx_pm_ops, alx_suspend, alx_resume);
drivers/net/ethernet/broadcom/bnx2x/bnx2x.h+1−0
@@ -1533,6 +1533,7 @@ struct bnx2x { · 1532 unmodified lines
15331533 struct link_vars link_vars;
15341534 u32 link_cnt;
15351535 struct bnx2x_link_report_data last_reported_link;
1536+ bool force_link_down;
15361537
15371538 struct mdio_if_info mdio;
15381539
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c+6−0
@@ -1261,6 +1261,11 @@ void __bnx2x_link_report(struct bnx2x *bp) · 1260 unmodified lines
12611261 {
12621262 struct bnx2x_link_report_data cur_data;
12631263
1264+ if (bp->force_link_down) {
1265+ bp->link_vars.link_up = 0;
1266+ return;
1267+ }
1268+
12641269 /* reread mf_cfg */
12651270 if (IS_PF(bp) && !CHIP_IS_E1(bp))
12661271 bnx2x_read_mf_cfg(bp);
@@ -2817,6 +2822,7 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode) · 1550 unmodified lines
28172822 bp->pending_max = 0;
28182823 }
28192824
2825+ bp->force_link_down = false;
28202826 if (bp->port.pmf) {
28212827 rc = bnx2x_initial_phy_init(bp, load_mode);
28222828 if (rc)
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c+6−0
@@ -10279,6 +10279,12 @@ static void bnx2x_sp_rtnl_task(struct work_struct *work) · 10278 unmodified lines
1027910279 bp->sp_rtnl_state = 0;
1028010280 smp_mb();
1028110281
10282+ /* Immediately indicate link as down */
10283+ bp->link_vars.link_up = 0;
10284+ bp->force_link_down = true;
10285+ netif_carrier_off(bp->dev);
10286+ BNX2X_ERR("Indicating link is down due to Tx-timeout\n");
10287+
1028210288 bnx2x_nic_unload(bp, UNLOAD_NORMAL, true);
1028310289 /* When ret value shows failure of allocation failure,
1028410290 * the nic is rebooted again. If open still fails, a error
drivers/net/ethernet/broadcom/cnic.c+1−1
@@ -660,7 +660,7 @@ static int cnic_init_id_tbl(struct cnic_id_tbl *id_tbl, u32 size, u32 start_id, · 659 unmodified lines
660660 id_tbl->max = size;
661661 id_tbl->next = next;
662662 spin_lock_init(&id_tbl->lock);
663− id_tbl->table = kcalloc(DIV_ROUND_UP(size, 32), 4, GFP_KERNEL);
663+ id_tbl->table = kcalloc(BITS_TO_LONGS(size), sizeof(long), GFP_KERNEL);
664664 if (!id_tbl->table)
665665 return -ENOMEM;
666666
drivers/net/ethernet/cadence/macb_main.c+2−0
@@ -3726,6 +3726,8 @@ static int at91ether_init(struct platform_device *pdev) · 3725 unmodified lines
37263726 int err;
37273727 u32 reg;
37283728
3729+ bp->queues[0].bp = bp;
3730+
37293731 dev->netdev_ops = &at91ether_netdev_ops;
37303732 dev->ethtool_ops = &macb_ethtool_ops;
37313733
drivers/net/ethernet/freescale/dpaa/dpaa_eth.c+8−7
@@ -125,6 +125,9 @@ MODULE_PARM_DESC(tx_timeout, "The Tx timeout in ms"); · 124 unmodified lines
125125 /* Default alignment for start of data in an Rx FD */
126126 #define DPAA_FD_DATA_ALIGNMENT 16
127127
128+/* The DPAA requires 256 bytes reserved and mapped for the SGT */
129+#define DPAA_SGT_SIZE 256
130+
128131 /* Values for the L3R field of the FM Parse Results
129132 */
130133 /* L3 Type field: First IP Present IPv4 */
@@ -1631,8 +1634,8 @@ static struct sk_buff *dpaa_cleanup_tx_fd(const struct dpaa_priv *priv, · 1500 unmodified lines
16311634
16321635 if (unlikely(qm_fd_get_format(fd) == qm_fd_sg)) {
16331636 nr_frags = skb_shinfo(skb)->nr_frags;
1634− dma_unmap_single(dev, addr, qm_fd_get_offset(fd) +
1635− sizeof(struct qm_sg_entry) * (1 + nr_frags),
1637+ dma_unmap_single(dev, addr,
1638+ qm_fd_get_offset(fd) + DPAA_SGT_SIZE,
16361639 dma_dir);
16371640
16381641 /* The sgt buffer has been allocated with netdev_alloc_frag(),
@@ -1917,8 +1920,7 @@ static int skb_to_sg_fd(struct dpaa_priv *priv, · 278 unmodified lines
19171920 void *sgt_buf;
19181921
19191922 /* get a page frag to store the SGTable */
1920− sz = SKB_DATA_ALIGN(priv->tx_headroom +
1921− sizeof(struct qm_sg_entry) * (1 + nr_frags));
1923+ sz = SKB_DATA_ALIGN(priv->tx_headroom + DPAA_SGT_SIZE);
19221924 sgt_buf = netdev_alloc_frag(sz);
19231925 if (unlikely(!sgt_buf)) {
19241926 netdev_err(net_dev, "netdev_alloc_frag() failed for size %d\n",
@@ -1986,9 +1988,8 @@ static int skb_to_sg_fd(struct dpaa_priv *priv, · 61 unmodified lines
19861988 skbh = (struct sk_buff **)buffer_start;
19871989 *skbh = skb;
19881990
1989− addr = dma_map_single(dev, buffer_start, priv->tx_headroom +
1990− sizeof(struct qm_sg_entry) * (1 + nr_frags),
1991− dma_dir);
1991+ addr = dma_map_single(dev, buffer_start,
1992+ priv->tx_headroom + DPAA_SGT_SIZE, dma_dir);
19921993 if (unlikely(dma_mapping_error(dev, addr))) {
19931994 dev_err(dev, "DMA mapping failed");
19941995 err = -EINVAL;
drivers/net/ethernet/freescale/fman/fman_port.c+8−0
@@ -324,6 +324,10 @@ struct fman_port_qmi_regs { · 323 unmodified lines
324324 #define HWP_HXS_PHE_REPORT 0x00000800
325325 #define HWP_HXS_PCAC_PSTAT 0x00000100
326326 #define HWP_HXS_PCAC_PSTOP 0x00000001
327+#define HWP_HXS_TCP_OFFSET 0xA
328+#define HWP_HXS_UDP_OFFSET 0xB
329+#define HWP_HXS_SH_PAD_REM 0x80000000
330+
327331 struct fman_port_hwp_regs {
328332 struct {
329333 u32 ssa; /* Soft Sequence Attachment */
@@ -728,6 +732,10 @@ static void init_hwp(struct fman_port *port) · 398 unmodified lines
728732 iowrite32be(0xffffffff, &regs->pmda[i].lcv);
729733 }
730734
735+ /* Short packet padding removal from checksum calculation */
736+ iowrite32be(HWP_HXS_SH_PAD_REM, &regs->pmda[HWP_HXS_TCP_OFFSET].ssa);
737+ iowrite32be(HWP_HXS_SH_PAD_REM, &regs->pmda[HWP_HXS_UDP_OFFSET].ssa);
738+
731739 start_port_hwp(port);
732740 }
733741
drivers/net/ethernet/huawei/hinic/hinic_rx.c+1−0
@@ -439,6 +439,7 @@ static void rx_free_irq(struct hinic_rxq *rxq) · 438 unmodified lines
439439 {
440440 struct hinic_rq *rq = rxq->rq;
441441
442+ irq_set_affinity_hint(rq->irq, NULL);
442443 free_irq(rq->irq, rxq);
443444 rx_del_napi(rxq);
444445 }
drivers/net/ethernet/intel/i40e/i40e_txrx.c+15−9
@@ -2199,9 +2199,10 @@ static bool i40e_is_non_eop(struct i40e_ring *rx_ring, · 2198 unmodified lines
21992199 return true;
22002200 }
22012201
2202−#define I40E_XDP_PASS 0
2203−#define I40E_XDP_CONSUMED 1
2204−#define I40E_XDP_TX 2
2202+#define I40E_XDP_PASS 0
2203+#define I40E_XDP_CONSUMED BIT(0)
2204+#define I40E_XDP_TX BIT(1)
2205+#define I40E_XDP_REDIR BIT(2)
22052206
22062207 static int i40e_xmit_xdp_ring(struct xdp_frame *xdpf,
22072208 struct i40e_ring *xdp_ring);
@@ -2248,7 +2249,7 @@ static struct sk_buff *i40e_run_xdp(struct i40e_ring *rx_ring, · 40 unmodified lines
22482249 break;
22492250 case XDP_REDIRECT:
22502251 err = xdp_do_redirect(rx_ring->netdev, xdp, xdp_prog);
2251− result = !err ? I40E_XDP_TX : I40E_XDP_CONSUMED;
2252+ result = !err ? I40E_XDP_REDIR : I40E_XDP_CONSUMED;
22522253 break;
22532254 default:
22542255 bpf_warn_invalid_xdp_action(act);
@@ -2311,7 +2312,8 @@ static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget) · 56 unmodified lines
23112312 unsigned int total_rx_bytes = 0, total_rx_packets = 0;
23122313 struct sk_buff *skb = rx_ring->skb;
23132314 u16 cleaned_count = I40E_DESC_UNUSED(rx_ring);
2314− bool failure = false, xdp_xmit = false;
2315+ unsigned int xdp_xmit = 0;
2316+ bool failure = false;
23152317 struct xdp_buff xdp;
23162318
23172319 xdp.rxq = &rx_ring->xdp_rxq;
@@ -2372,8 +2374,10 @@ static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget) · 54 unmodified lines
23722374 }
23732375
23742376 if (IS_ERR(skb)) {
2375− if (PTR_ERR(skb) == -I40E_XDP_TX) {
2376− xdp_xmit = true;
2377+ unsigned int xdp_res = -PTR_ERR(skb);
2378+
2379+ if (xdp_res & (I40E_XDP_TX | I40E_XDP_REDIR)) {
2380+ xdp_xmit |= xdp_res;
23772381 i40e_rx_buffer_flip(rx_ring, rx_buffer, size);
23782382 } else {
23792383 rx_buffer->pagecnt_bias++;
@@ -2427,12 +2431,14 @@ static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget) · 47 unmodified lines
24272431 total_rx_packets++;
24282432 }
24292433
2430− if (xdp_xmit) {
2434+ if (xdp_xmit & I40E_XDP_REDIR)
2435+ xdp_do_flush_map();
2436+
2437+ if (xdp_xmit & I40E_XDP_TX) {
24312438 struct i40e_ring *xdp_ring =
24322439 rx_ring->vsi->xdp_rings[rx_ring->queue_index];
24332440
24342441 i40e_xdp_ring_update_tail(xdp_ring);
2435− xdp_do_flush_map();
24362442 }
24372443
24382444 rx_ring->skb = skb;
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c+14−10
@@ -2186,9 +2186,10 @@ static struct sk_buff *ixgbe_build_skb(struct ixgbe_ring *rx_ring, · 2185 unmodified lines
21862186 return skb;
21872187 }
21882188
2189−#define IXGBE_XDP_PASS 0
2190−#define IXGBE_XDP_CONSUMED 1
2191−#define IXGBE_XDP_TX 2
2189+#define IXGBE_XDP_PASS 0
2190+#define IXGBE_XDP_CONSUMED BIT(0)
2191+#define IXGBE_XDP_TX BIT(1)
2192+#define IXGBE_XDP_REDIR BIT(2)
21922193
21932194 static int ixgbe_xmit_xdp_ring(struct ixgbe_adapter *adapter,
21942195 struct xdp_frame *xdpf);
@@ -2225,7 +2226,7 @@ static struct sk_buff *ixgbe_run_xdp(struct ixgbe_adapter *adapter, · 30 unmodified lines
22252226 case XDP_REDIRECT:
22262227 err = xdp_do_redirect(adapter->netdev, xdp, xdp_prog);
22272228 if (!err)
2228− result = IXGBE_XDP_TX;
2229+ result = IXGBE_XDP_REDIR;
22292230 else
22302231 result = IXGBE_XDP_CONSUMED;
22312232 break;
@@ -2285,7 +2286,7 @@ static int ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector, · 53 unmodified lines
22852286 unsigned int mss = 0;
22862287 #endif /* IXGBE_FCOE */
22872288 u16 cleaned_count = ixgbe_desc_unused(rx_ring);
2288− bool xdp_xmit = false;
2289+ unsigned int xdp_xmit = 0;
22892290 struct xdp_buff xdp;
22902291
22912292 xdp.rxq = &rx_ring->xdp_rxq;
@@ -2328,8 +2329,10 @@ static int ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector, · 36 unmodified lines
23282329 }
23292330
23302331 if (IS_ERR(skb)) {
2331− if (PTR_ERR(skb) == -IXGBE_XDP_TX) {
2332− xdp_xmit = true;
2332+ unsigned int xdp_res = -PTR_ERR(skb);
2333+
2334+ if (xdp_res & (IXGBE_XDP_TX | IXGBE_XDP_REDIR)) {
2335+ xdp_xmit |= xdp_res;
23332336 ixgbe_rx_buffer_flip(rx_ring, rx_buffer, size);
23342337 } else {
23352338 rx_buffer->pagecnt_bias++;
@@ -2401,7 +2404,10 @@ static int ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector, · 65 unmodified lines
24012404 total_rx_packets++;
24022405 }
24032406
2404− if (xdp_xmit) {
2407+ if (xdp_xmit & IXGBE_XDP_REDIR)
2408+ xdp_do_flush_map();
2409+
2410+ if (xdp_xmit & IXGBE_XDP_TX) {
24052411 struct ixgbe_ring *ring = adapter->xdp_ring[smp_processor_id()];
24062412
24072413 /* Force memory writes to complete before letting h/w
@@ -2409,8 +2415,6 @@ static int ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector, · 1 unmodified line
24092415 */
24102416 wmb();
24112417 writel(ring->next_to_use, ring->tail);
2412−
2413− xdp_do_flush_map();
24142418 }
24152419
24162420 u64_stats_update_begin(&rx_ring->syncp);
drivers/net/ethernet/mellanox/mlx5/core/cmd.c+4−4
@@ -807,6 +807,7 @@ static void cmd_work_handler(struct work_struct *work) · 806 unmodified lines
807807 unsigned long flags;
808808 bool poll_cmd = ent->polling;
809809 int alloc_ret;
810+ int cmd_mode;
810811
811812 sem = ent->page_queue ? &cmd->pages_sem : &cmd->sem;
812813 down(sem);
@@ -853,6 +854,7 @@ static void cmd_work_handler(struct work_struct *work) · 40 unmodified lines
853854 set_signature(ent, !cmd->checksum_disabled);
854855 dump_command(dev, ent, 1);
855856 ent->ts1 = ktime_get_ns();
857+ cmd_mode = cmd->mode;
856858
857859 if (ent->callback)
858860 schedule_delayed_work(&ent->cb_timeout_work, cb_timeout);
@@ -877,7 +879,7 @@ static void cmd_work_handler(struct work_struct *work) · 18 unmodified lines
877879 iowrite32be(1 << ent->idx, &dev->iseg->cmd_dbell);
878880 mmiowb();
879881 /* if not in polling don't use ent after this point */
880− if (cmd->mode == CMD_MODE_POLLING || poll_cmd) {
882+ if (cmd_mode == CMD_MODE_POLLING || poll_cmd) {
881883 poll_timeout(ent);
882884 /* make sure we read the descriptor after ownership is SW */
883885 rmb();
@@ -1276,7 +1278,7 @@ static ssize_t outlen_write(struct file *filp, const char __user *buf, · 392 unmodified lines
12761278 {
12771279 struct mlx5_core_dev *dev = filp->private_data;
12781280 struct mlx5_cmd_debug *dbg = &dev->cmd.dbg;
1279− char outlen_str[8];
1281+ char outlen_str[8] = {0};
12801282 int outlen;
12811283 void *ptr;
12821284 int err;
@@ -1291,8 +1293,6 @@ static ssize_t outlen_write(struct file *filp, const char __user *buf, · 8 unmodified lines
12911293 if (copy_from_user(outlen_str, buf, count))
12921294 return -EFAULT;
12931295
1294− outlen_str[7] = 0;
1295−
12961296 err = sscanf(outlen_str, "%d", &outlen);
12971297 if (err < 0)
12981298 return err;
drivers/net/ethernet/mellanox/mlx5/core/en_main.c+6−6
@@ -2843,7 +2843,7 @@ void mlx5e_activate_priv_channels(struct mlx5e_priv *priv) · 2842 unmodified lines
28432843 mlx5e_activate_channels(&priv->channels);
28442844 netif_tx_start_all_queues(priv->netdev);
28452845
2846− if (MLX5_VPORT_MANAGER(priv->mdev))
2846+ if (MLX5_ESWITCH_MANAGER(priv->mdev))
28472847 mlx5e_add_sqs_fwd_rules(priv);
28482848
28492849 mlx5e_wait_channels_min_rx_wqes(&priv->channels);
@@ -2854,7 +2854,7 @@ void mlx5e_deactivate_priv_channels(struct mlx5e_priv *priv) · 4 unmodified lines
28542854 {
28552855 mlx5e_redirect_rqts_to_drop(priv);
28562856
2857− if (MLX5_VPORT_MANAGER(priv->mdev))
2857+ if (MLX5_ESWITCH_MANAGER(priv->mdev))
28582858 mlx5e_remove_sqs_fwd_rules(priv);
28592859
28602860 /* FIXME: This is a W/A only for tx timeout watch dog false alarm when
@@ -4600,7 +4600,7 @@ static void mlx5e_build_nic_netdev(struct net_device *netdev) · 1739 unmodified lines
46004600 mlx5e_set_netdev_dev_addr(netdev);
46014601
46024602 #if IS_ENABLED(CONFIG_MLX5_ESWITCH)
4603− if (MLX5_VPORT_MANAGER(mdev))
4603+ if (MLX5_ESWITCH_MANAGER(mdev))
46044604 netdev->switchdev_ops = &mlx5e_switchdev_ops;
46054605 #endif
46064606
@@ -4756,7 +4756,7 @@ static void mlx5e_nic_enable(struct mlx5e_priv *priv) · 149 unmodified lines
47564756
47574757 mlx5e_enable_async_events(priv);
47584758
4759− if (MLX5_VPORT_MANAGER(priv->mdev))
4759+ if (MLX5_ESWITCH_MANAGER(priv->mdev))
47604760 mlx5e_register_vport_reps(priv);
47614761
47624762 if (netdev->reg_state != NETREG_REGISTERED)
@@ -4791,7 +4791,7 @@ static void mlx5e_nic_disable(struct mlx5e_priv *priv) · 28 unmodified lines
47914791
47924792 queue_work(priv->wq, &priv->set_rx_mode_work);
47934793
4794− if (MLX5_VPORT_MANAGER(priv->mdev))
4794+ if (MLX5_ESWITCH_MANAGER(priv->mdev))
47954795 mlx5e_unregister_vport_reps(priv);
47964796
47974797 mlx5e_disable_async_events(priv);
@@ -4975,7 +4975,7 @@ static void *mlx5e_add(struct mlx5_core_dev *mdev) · 177 unmodified lines
49754975 return NULL;
49764976
49774977 #ifdef CONFIG_MLX5_ESWITCH
4978− if (MLX5_VPORT_MANAGER(mdev)) {
4978+ if (MLX5_ESWITCH_MANAGER(mdev)) {
49794979 rpriv = mlx5e_alloc_nic_rep_priv(mdev);
49804980 if (!rpriv) {
49814981 mlx5_core_warn(mdev, "Failed to alloc NIC rep priv data\n");
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c+6−2
@@ -823,7 +823,7 @@ bool mlx5e_is_uplink_rep(struct mlx5e_priv *priv) · 822 unmodified lines
823823 struct mlx5e_rep_priv *rpriv = priv->ppriv;
824824 struct mlx5_eswitch_rep *rep;
825825
826− if (!MLX5_CAP_GEN(priv->mdev, vport_group_manager))
826+ if (!MLX5_ESWITCH_MANAGER(priv->mdev))
827827 return false;
828828
829829 rep = rpriv->rep;
@@ -837,8 +837,12 @@ bool mlx5e_is_uplink_rep(struct mlx5e_priv *priv) · 7 unmodified lines
837837 static bool mlx5e_is_vf_vport_rep(struct mlx5e_priv *priv)
838838 {
839839 struct mlx5e_rep_priv *rpriv = priv->ppriv;
840− struct mlx5_eswitch_rep *rep = rpriv->rep;
840+ struct mlx5_eswitch_rep *rep;
841841
842+ if (!MLX5_ESWITCH_MANAGER(priv->mdev))
843+ return false;
844+
845+ rep = rpriv->rep;
842846 if (rep && rep->vport != FDB_UPLINK_VPORT)
843847 return true;
844848
drivers/net/ethernet/mellanox/mlx5/core/eswitch.c+5−7
@@ -1594,17 +1594,15 @@ static void esw_disable_vport(struct mlx5_eswitch *esw, int vport_num) · 1593 unmodified lines
15941594 }
15951595
15961596 /* Public E-Switch API */
1597−#define ESW_ALLOWED(esw) ((esw) && MLX5_VPORT_MANAGER((esw)->dev))
1597+#define ESW_ALLOWED(esw) ((esw) && MLX5_ESWITCH_MANAGER((esw)->dev))
1598+
15981599
15991600 int mlx5_eswitch_enable_sriov(struct mlx5_eswitch *esw, int nvfs, int mode)
16001601 {
16011602 int err;
16021603 int i, enabled_events;
16031604
1604− if (!ESW_ALLOWED(esw))
1605− return 0;
1606−
1607− if (!MLX5_CAP_GEN(esw->dev, eswitch_flow_table) ||
1605+ if (!ESW_ALLOWED(esw) ||
16081606 !MLX5_CAP_ESW_FLOWTABLE_FDB(esw->dev, ft_support)) {
16091607 esw_warn(esw->dev, "E-Switch FDB is not supported, aborting ...\n");
16101608 return -EOPNOTSUPP;
@@ -1806,7 +1804,7 @@ int mlx5_eswitch_set_vport_mac(struct mlx5_eswitch *esw, · 195 unmodified lines
18061804 u64 node_guid;
18071805 int err = 0;
18081806
1809− if (!ESW_ALLOWED(esw))
1807+ if (!MLX5_CAP_GEN(esw->dev, vport_group_manager))
18101808 return -EPERM;
18111809 if (!LEGAL_VPORT(esw, vport) || is_multicast_ether_addr(mac))
18121810 return -EINVAL;
@@ -1883,7 +1881,7 @@ int mlx5_eswitch_get_vport_config(struct mlx5_eswitch *esw, · 70 unmodified lines
18831881 {
18841882 struct mlx5_vport *evport;
18851883
1886− if (!ESW_ALLOWED(esw))
1884+ if (!MLX5_CAP_GEN(esw->dev, vport_group_manager))
18871885 return -EPERM;
18881886 if (!LEGAL_VPORT(esw, vport))
18891887 return -EINVAL;
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c+2−2
@@ -1079,8 +1079,8 @@ static int mlx5_devlink_eswitch_check(struct devlink *devlink) · 1078 unmodified lines
10791079 if (MLX5_CAP_GEN(dev, port_type) != MLX5_CAP_PORT_TYPE_ETH)
10801080 return -EOPNOTSUPP;
10811081
1082− if (!MLX5_CAP_GEN(dev, vport_group_manager))
1083− return -EOPNOTSUPP;
1082+ if(!MLX5_ESWITCH_MANAGER(dev))
1083+ return -EPERM;
10841084
10851085 if (dev->priv.eswitch->mode == SRIOV_NONE)
10861086 return -EOPNOTSUPP;
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c+2−1
@@ -32,6 +32,7 @@ · 31 unmodified lines
3232
3333 #include <linux/mutex.h>
3434 #include <linux/mlx5/driver.h>
35+#include <linux/mlx5/eswitch.h>
3536
3637 #include "mlx5_core.h"
3738 #include "fs_core.h"
@@ -2652,7 +2653,7 @@ int mlx5_init_fs(struct mlx5_core_dev *dev) · 2614 unmodified lines
26522653 goto err;
26532654 }
26542655
2655− if (MLX5_CAP_GEN(dev, eswitch_flow_table)) {
2656+ if (MLX5_ESWITCH_MANAGER(dev)) {
26562657 if (MLX5_CAP_ESW_FLOWTABLE_FDB(dev, ft_support)) {
26572658 err = init_fdb_root_ns(steering);
26582659 if (err)
drivers/net/ethernet/mellanox/mlx5/core/fw.c+3−2
@@ -32,6 +32,7 @@ · 31 unmodified lines
3232
3333 #include <linux/mlx5/driver.h>
3434 #include <linux/mlx5/cmd.h>
35+#include <linux/mlx5/eswitch.h>
3536 #include <linux/module.h>
3637 #include "mlx5_core.h"
3738 #include "../../mlxfw/mlxfw.h"
@@ -159,13 +160,13 @@ int mlx5_query_hca_caps(struct mlx5_core_dev *dev) · 121 unmodified lines
159160 }
160161
161162 if (MLX5_CAP_GEN(dev, vport_group_manager) &&
162− MLX5_CAP_GEN(dev, eswitch_flow_table)) {
163+ MLX5_ESWITCH_MANAGER(dev)) {
163164 err = mlx5_core_get_caps(dev, MLX5_CAP_ESWITCH_FLOW_TABLE);
164165 if (err)
165166 return err;
166167 }
167168
168− if (MLX5_CAP_GEN(dev, eswitch_flow_table)) {
169+ if (MLX5_ESWITCH_MANAGER(dev)) {
169170 err = mlx5_core_get_caps(dev, MLX5_CAP_ESWITCH);
170171 if (err)
171172 return err;
drivers/net/ethernet/mellanox/mlx5/core/lib/mpfs.c+5−4
@@ -33,6 +33,7 @@ · 32 unmodified lines
3333 #include <linux/etherdevice.h>
3434 #include <linux/mlx5/driver.h>
3535 #include <linux/mlx5/mlx5_ifc.h>
36+#include <linux/mlx5/eswitch.h>
3637 #include "mlx5_core.h"
3738 #include "lib/mpfs.h"
3839
@@ -98,7 +99,7 @@ int mlx5_mpfs_init(struct mlx5_core_dev *dev) · 59 unmodified lines
9899 int l2table_size = 1 << MLX5_CAP_GEN(dev, log_max_l2_table);
99100 struct mlx5_mpfs *mpfs;
100101
101− if (!MLX5_VPORT_MANAGER(dev))
102+ if (!MLX5_ESWITCH_MANAGER(dev))
102103 return 0;
103104
104105 mpfs = kzalloc(sizeof(*mpfs), GFP_KERNEL);
@@ -122,7 +123,7 @@ void mlx5_mpfs_cleanup(struct mlx5_core_dev *dev) · 17 unmodified lines
122123 {
123124 struct mlx5_mpfs *mpfs = dev->priv.mpfs;
124125
125− if (!MLX5_VPORT_MANAGER(dev))
126+ if (!MLX5_ESWITCH_MANAGER(dev))
126127 return;
127128
128129 WARN_ON(!hlist_empty(mpfs->hash));
@@ -137,7 +138,7 @@ int mlx5_mpfs_add_mac(struct mlx5_core_dev *dev, u8 *mac) · 8 unmodified lines
137138 u32 index;
138139 int err;
139140
140− if (!MLX5_VPORT_MANAGER(dev))
141+ if (!MLX5_ESWITCH_MANAGER(dev))
141142 return 0;
142143
143144 mutex_lock(&mpfs->lock);
@@ -179,7 +180,7 @@ int mlx5_mpfs_del_mac(struct mlx5_core_dev *dev, u8 *mac) · 35 unmodified lines
179180 int err = 0;
180181 u32 index;
181182
182− if (!MLX5_VPORT_MANAGER(dev))
183+ if (!MLX5_ESWITCH_MANAGER(dev))
183184 return 0;
184185
185186 mutex_lock(&mpfs->lock);
drivers/net/ethernet/mellanox/mlx5/core/port.c+2−2
@@ -701,7 +701,7 @@ EXPORT_SYMBOL_GPL(mlx5_query_port_prio_tc); · 700 unmodified lines
701701 static int mlx5_set_port_qetcr_reg(struct mlx5_core_dev *mdev, u32 *in,
702702 int inlen)
703703 {
704− u32 out[MLX5_ST_SZ_DW(qtct_reg)];
704+ u32 out[MLX5_ST_SZ_DW(qetc_reg)];
705705
706706 if (!MLX5_CAP_GEN(mdev, ets))
707707 return -EOPNOTSUPP;
@@ -713,7 +713,7 @@ static int mlx5_set_port_qetcr_reg(struct mlx5_core_dev *mdev, u32 *in, · 5 unmodified lines
713713 static int mlx5_query_port_qetcr_reg(struct mlx5_core_dev *mdev, u32 *out,
714714 int outlen)
715715 {
716− u32 in[MLX5_ST_SZ_DW(qtct_reg)];
716+ u32 in[MLX5_ST_SZ_DW(qetc_reg)];
717717
718718 if (!MLX5_CAP_GEN(mdev, ets))
719719 return -EOPNOTSUPP;
drivers/net/ethernet/mellanox/mlx5/core/sriov.c+6−1
@@ -88,6 +88,9 @@ static int mlx5_device_enable_sriov(struct mlx5_core_dev *dev, int num_vfs) · 87 unmodified lines
8888 return -EBUSY;
8989 }
9090
91+ if (!MLX5_ESWITCH_MANAGER(dev))
92+ goto enable_vfs_hca;
93+
9194 err = mlx5_eswitch_enable_sriov(dev->priv.eswitch, num_vfs, SRIOV_LEGACY);
9295 if (err) {
9396 mlx5_core_warn(dev,
@@ -95,6 +98,7 @@ static int mlx5_device_enable_sriov(struct mlx5_core_dev *dev, int num_vfs) · 1 unmodified line
9598 return err;
9699 }
97100
101+enable_vfs_hca:
98102 for (vf = 0; vf < num_vfs; vf++) {
99103 err = mlx5_core_enable_hca(dev, vf + 1);
100104 if (err) {
@@ -140,7 +144,8 @@ static void mlx5_device_disable_sriov(struct mlx5_core_dev *dev) · 39 unmodified lines
140144 }
141145
142146 out:
143− mlx5_eswitch_disable_sriov(dev->priv.eswitch);
147+ if (MLX5_ESWITCH_MANAGER(dev))
148+ mlx5_eswitch_disable_sriov(dev->priv.eswitch);
144149
145150 if (mlx5_wait_for_vf_pages(dev))
146151 mlx5_core_warn(dev, "timeout reclaiming VFs pages\n");
drivers/net/ethernet/mellanox/mlx5/core/vport.c+0−2
@@ -549,8 +549,6 @@ int mlx5_modify_nic_vport_node_guid(struct mlx5_core_dev *mdev, · 548 unmodified lines
549549 return -EINVAL;
550550 if (!MLX5_CAP_GEN(mdev, vport_group_manager))
551551 return -EACCES;
552− if (!MLX5_CAP_ESW(mdev, nic_vport_node_guid_modify))
553− return -EOPNOTSUPP;
554552
555553 in = kvzalloc(inlen, GFP_KERNEL);
556554 if (!in)
drivers/net/ethernet/netronome/nfp/bpf/main.c+6−3
@@ -81,10 +81,10 @@ nfp_bpf_xdp_offload(struct nfp_app *app, struct nfp_net *nn, · 80 unmodified lines
8181
8282 ret = nfp_net_bpf_offload(nn, prog, running, extack);
8383 /* Stop offload if replace not possible */
84− if (ret && prog)
85− nfp_bpf_xdp_offload(app, nn, NULL, extack);
84+ if (ret)
85+ return ret;
8686
87− nn->dp.bpf_offload_xdp = prog && !ret;
87+ nn->dp.bpf_offload_xdp = !!prog;
8888 return ret;
8989 }
9090
@@ -202,6 +202,9 @@ static int nfp_bpf_setup_tc_block(struct net_device *netdev, · 111 unmodified lines
202202 if (f->binder_type != TCF_BLOCK_BINDER_TYPE_CLSACT_INGRESS)
203203 return -EOPNOTSUPP;
204204
205+ if (tcf_block_shared(f->block))
206+ return -EOPNOTSUPP;
207+
205208 switch (f->command) {
206209 case TC_BLOCK_BIND:
207210 return tcf_block_cb_register(f->block,
drivers/net/ethernet/netronome/nfp/flower/match.c+14−0
@@ -123,6 +123,20 @@ nfp_flower_compile_mac(struct nfp_flower_mac_mpls *frame, · 122 unmodified lines
123123 NFP_FLOWER_MASK_MPLS_Q;
124124
125125 frame->mpls_lse = cpu_to_be32(t_mpls);
126+ } else if (dissector_uses_key(flow->dissector,
127+ FLOW_DISSECTOR_KEY_BASIC)) {
128+ /* Check for mpls ether type and set NFP_FLOWER_MASK_MPLS_Q
129+ * bit, which indicates an mpls ether type but without any
130+ * mpls fields.
131+ */
132+ struct flow_dissector_key_basic *key_basic;
133+
134+ key_basic = skb_flow_dissector_target(flow->dissector,
135+ FLOW_DISSECTOR_KEY_BASIC,
136+ flow->key);
137+ if (key_basic->n_proto == cpu_to_be16(ETH_P_MPLS_UC) ||
138+ key_basic->n_proto == cpu_to_be16(ETH_P_MPLS_MC))
139+ frame->mpls_lse = cpu_to_be32(NFP_FLOWER_MASK_MPLS_Q);
126140 }
127141 }
128142
drivers/net/ethernet/netronome/nfp/flower/offload.c+11−0
@@ -264,6 +264,14 @@ nfp_flower_calculate_key_layers(struct nfp_app *app, · 263 unmodified lines
264264 case cpu_to_be16(ETH_P_ARP):
265265 return -EOPNOTSUPP;
266266
267+ case cpu_to_be16(ETH_P_MPLS_UC):
268+ case cpu_to_be16(ETH_P_MPLS_MC):
269+ if (!(key_layer & NFP_FLOWER_LAYER_MAC)) {
270+ key_layer |= NFP_FLOWER_LAYER_MAC;
271+ key_size += sizeof(struct nfp_flower_mac_mpls);
272+ }
273+ break;
274+
267275 /* Will be included in layer 2. */
268276 case cpu_to_be16(ETH_P_8021Q):
269277 break;
@@ -623,6 +631,9 @@ static int nfp_flower_setup_tc_block(struct net_device *netdev, · 353 unmodified lines
623631 if (f->binder_type != TCF_BLOCK_BINDER_TYPE_CLSACT_INGRESS)
624632 return -EOPNOTSUPP;
625633
634+ if (tcf_block_shared(f->block))
635+ return -EOPNOTSUPP;
636+
626637 switch (f->command) {
627638 case TC_BLOCK_BIND:
628639 return tcf_block_cb_register(f->block,
drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nffw.c+1−1
@@ -232,7 +232,7 @@ struct nfp_nffw_info *nfp_nffw_info_open(struct nfp_cpp *cpp) · 231 unmodified lines
232232 err = nfp_cpp_read(cpp, nfp_resource_cpp_id(state->res),
233233 nfp_resource_address(state->res),
234234 fwinf, sizeof(*fwinf));
235− if (err < sizeof(*fwinf))
235+ if (err < (int)sizeof(*fwinf))
236236 goto err_release;
237237
238238 if (!nffw_res_flg_init_get(fwinf))
drivers/net/ethernet/qlogic/qed/qed_dcbx.c+4−4
@@ -709,9 +709,9 @@ qed_dcbx_get_local_lldp_params(struct qed_hwfn *p_hwfn, · 708 unmodified lines
709709 p_local = &p_hwfn->p_dcbx_info->lldp_local[LLDP_NEAREST_BRIDGE];
710710
711711 memcpy(params->lldp_local.local_chassis_id, p_local->local_chassis_id,
712− ARRAY_SIZE(p_local->local_chassis_id));
712+ sizeof(p_local->local_chassis_id));
713713 memcpy(params->lldp_local.local_port_id, p_local->local_port_id,
714− ARRAY_SIZE(p_local->local_port_id));
714+ sizeof(p_local->local_port_id));
715715 }
716716
717717 static void
@@ -723,9 +723,9 @@ qed_dcbx_get_remote_lldp_params(struct qed_hwfn *p_hwfn, · 5 unmodified lines
723723 p_remote = &p_hwfn->p_dcbx_info->lldp_remote[LLDP_NEAREST_BRIDGE];
724724
725725 memcpy(params->lldp_remote.peer_chassis_id, p_remote->peer_chassis_id,
726− ARRAY_SIZE(p_remote->peer_chassis_id));
726+ sizeof(p_remote->peer_chassis_id));
727727 memcpy(params->lldp_remote.peer_port_id, p_remote->peer_port_id,
728− ARRAY_SIZE(p_remote->peer_port_id));
728+ sizeof(p_remote->peer_port_id));
729729 }
730730
731731 static int
drivers/net/ethernet/qlogic/qed/qed_dev.c+1−1
@@ -1804,7 +1804,7 @@ int qed_hw_init(struct qed_dev *cdev, struct qed_hw_init_params *p_params) · 1803 unmodified lines
18041804 DP_INFO(p_hwfn, "Failed to update driver state\n");
18051805
18061806 rc = qed_mcp_ov_update_eswitch(p_hwfn, p_hwfn->p_main_ptt,
1807− QED_OV_ESWITCH_VEB);
1807+ QED_OV_ESWITCH_NONE);
18081808 if (rc)
18091809 DP_INFO(p_hwfn, "Failed to update eswitch mode\n");
18101810 }
drivers/net/ethernet/qlogic/qed/qed_main.c+8−0
@@ -789,6 +789,14 @@ static int qed_slowpath_setup_int(struct qed_dev *cdev, · 788 unmodified lines
789789 /* We want a minimum of one slowpath and one fastpath vector per hwfn */
790790 cdev->int_params.in.min_msix_cnt = cdev->num_hwfns * 2;
791791
792+ if (is_kdump_kernel()) {
793+ DP_INFO(cdev,
794+ "Kdump kernel: Limit the max number of requested MSI-X vectors to %hd\n",
795+ cdev->int_params.in.min_msix_cnt);
796+ cdev->int_params.in.num_vectors =
797+ cdev->int_params.in.min_msix_cnt;
798+ }
799+
792800 rc = qed_set_int_mode(cdev, false);
793801 if (rc) {
794802 DP_ERR(cdev, "qed_slowpath_setup_int ERR\n");
drivers/net/ethernet/qlogic/qed/qed_sriov.c+17−2
@@ -4513,6 +4513,8 @@ static void qed_sriov_enable_qid_config(struct qed_hwfn *hwfn, · 4512 unmodified lines
45134513 static int qed_sriov_enable(struct qed_dev *cdev, int num)
45144514 {
45154515 struct qed_iov_vf_init_params params;
4516+ struct qed_hwfn *hwfn;
4517+ struct qed_ptt *ptt;
45164518 int i, j, rc;
45174519
45184520 if (num >= RESC_NUM(&cdev->hwfns[0], QED_VPORT)) {
@@ -4525,8 +4527,8 @@ static int qed_sriov_enable(struct qed_dev *cdev, int num) · 6 unmodified lines
45254527
45264528 /* Initialize HW for VF access */
45274529 for_each_hwfn(cdev, j) {
4528− struct qed_hwfn *hwfn = &cdev->hwfns[j];
4529− struct qed_ptt *ptt = qed_ptt_acquire(hwfn);
4530+ hwfn = &cdev->hwfns[j];
4531+ ptt = qed_ptt_acquire(hwfn);
45304532
45314533 /* Make sure not to use more than 16 queues per VF */
45324534 params.num_queues = min_t(int,
@@ -4562,6 +4564,19 @@ static int qed_sriov_enable(struct qed_dev *cdev, int num) · 29 unmodified lines
45624564 goto err;
45634565 }
45644566
4567+ hwfn = QED_LEADING_HWFN(cdev);
4568+ ptt = qed_ptt_acquire(hwfn);
4569+ if (!ptt) {
4570+ DP_ERR(hwfn, "Failed to acquire ptt\n");
4571+ rc = -EBUSY;
4572+ goto err;
4573+ }
4574+
4575+ rc = qed_mcp_ov_update_eswitch(hwfn, ptt, QED_OV_ESWITCH_VEB);
4576+ if (rc)
4577+ DP_INFO(cdev, "Failed to update eswitch mode\n");
4578+ qed_ptt_release(hwfn, ptt);
4579+
45654580 return num;
45664581
45674582 err:
drivers/net/ethernet/qlogic/qede/qede_ptp.c+8−2
@@ -337,8 +337,14 @@ int qede_ptp_get_ts_info(struct qede_dev *edev, struct ethtool_ts_info *info) · 336 unmodified lines
337337 {
338338 struct qede_ptp *ptp = edev->ptp;
339339
340− if (!ptp)
341− return -EIO;
340+ if (!ptp) {
341+ info->so_timestamping = SOF_TIMESTAMPING_TX_SOFTWARE |
342+ SOF_TIMESTAMPING_RX_SOFTWARE |
343+ SOF_TIMESTAMPING_SOFTWARE;
344+ info->phc_index = -1;
345+
346+ return 0;
347+ }
342348
343349 info->so_timestamping = SOF_TIMESTAMPING_TX_SOFTWARE |
344350 SOF_TIMESTAMPING_RX_SOFTWARE |
drivers/net/ethernet/sfc/farch.c+1−0
@@ -2794,6 +2794,7 @@ int efx_farch_filter_table_probe(struct efx_nic *efx) · 2793 unmodified lines
27942794 if (!state)
27952795 return -ENOMEM;
27962796 efx->filter_state = state;
2797+ init_rwsem(&state->lock);
27972798
27982799 table = &state->table[EFX_FARCH_FILTER_TABLE_RX_IP];
27992800 table->id = EFX_FARCH_FILTER_TABLE_RX_IP;
drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.c+12−0
@@ -420,6 +420,16 @@ static void dwmac4_qmode(void __iomem *ioaddr, u32 channel, u8 qmode) · 419 unmodified lines
420420 writel(mtl_tx_op, ioaddr + MTL_CHAN_TX_OP_MODE(channel));
421421 }
422422
423+static void dwmac4_set_bfsize(void __iomem *ioaddr, int bfsize, u32 chan)
424+{
425+ u32 value = readl(ioaddr + DMA_CHAN_RX_CONTROL(chan));
426+
427+ value &= ~DMA_RBSZ_MASK;
428+ value |= (bfsize << DMA_RBSZ_SHIFT) & DMA_RBSZ_MASK;
429+
430+ writel(value, ioaddr + DMA_CHAN_RX_CONTROL(chan));
431+}
432+
423433 const struct stmmac_dma_ops dwmac4_dma_ops = {
424434 .reset = dwmac4_dma_reset,
425435 .init = dwmac4_dma_init,
@@ -445,6 +455,7 @@ const struct stmmac_dma_ops dwmac4_dma_ops = { · 19 unmodified lines
445455 .set_tx_tail_ptr = dwmac4_set_tx_tail_ptr,
446456 .enable_tso = dwmac4_enable_tso,
447457 .qmode = dwmac4_qmode,
458+ .set_bfsize = dwmac4_set_bfsize,
448459 };
449460
450461 const struct stmmac_dma_ops dwmac410_dma_ops = {
@@ -472,4 +483,5 @@ const struct stmmac_dma_ops dwmac410_dma_ops = { · 21 unmodified lines
472483 .set_tx_tail_ptr = dwmac4_set_tx_tail_ptr,
473484 .enable_tso = dwmac4_enable_tso,
474485 .qmode = dwmac4_qmode,
486+ .set_bfsize = dwmac4_set_bfsize,
475487 };
drivers/net/ethernet/stmicro/stmmac/dwmac4_dma.h+2−0
@@ -120,6 +120,8 @@ · 119 unmodified lines
120120
121121 /* DMA Rx Channel X Control register defines */
122122 #define DMA_CONTROL_SR BIT(0)
123+#define DMA_RBSZ_MASK GENMASK(14, 1)
124+#define DMA_RBSZ_SHIFT 1
123125
124126 /* Interrupt status per channel */
125127 #define DMA_CHAN_STATUS_REB GENMASK(21, 19)
drivers/net/ethernet/stmicro/stmmac/hwif.h+3−0
@@ -184,6 +184,7 @@ struct stmmac_dma_ops { · 183 unmodified lines
184184 void (*set_tx_tail_ptr)(void __iomem *ioaddr, u32 tail_ptr, u32 chan);
185185 void (*enable_tso)(void __iomem *ioaddr, bool en, u32 chan);
186186 void (*qmode)(void __iomem *ioaddr, u32 channel, u8 qmode);
187+ void (*set_bfsize)(void __iomem *ioaddr, int bfsize, u32 chan);
187188 };
188189
189190 #define stmmac_reset(__priv, __args...) \
@@ -238,6 +239,8 @@ struct stmmac_dma_ops { · 48 unmodified lines
238239 stmmac_do_void_callback(__priv, dma, enable_tso, __args)
239240 #define stmmac_dma_qmode(__priv, __args...) \
240241 stmmac_do_void_callback(__priv, dma, qmode, __args)
242+#define stmmac_set_dma_bfsize(__priv, __args...) \
243+ stmmac_do_void_callback(__priv, dma, set_bfsize, __args)
241244
242245 struct mac_device_info;
243246 struct net_device;
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c+2−0
@@ -1804,6 +1804,8 @@ static void stmmac_dma_operation_mode(struct stmmac_priv *priv) · 1803 unmodified lines
18041804
18051805 stmmac_dma_rx_mode(priv, priv->ioaddr, rxmode, chan,
18061806 rxfifosz, qmode);
1807+ stmmac_set_dma_bfsize(priv, priv->ioaddr, priv->dma_buf_sz,
1808+ chan);
18071809 }
18081810
18091811 for (chan = 0; chan < tx_channels_count; chan++) {
drivers/net/geneve.c+1−1
@@ -478,7 +478,7 @@ static struct sk_buff *geneve_gro_receive(struct sock *sk, · 477 unmodified lines
478478 out_unlock:
479479 rcu_read_unlock();
480480 out:
481− NAPI_GRO_CB(skb)->flush |= flush;
481+ skb_gro_flush_final(skb, pp, flush);
482482
483483 return pp;
484484 }
drivers/net/hyperv/hyperv_net.h+1−1
@@ -210,7 +210,7 @@ int netvsc_recv_callback(struct net_device *net, · 209 unmodified lines
210210 void netvsc_channel_cb(void *context);
211211 int netvsc_poll(struct napi_struct *napi, int budget);
212212
213−void rndis_set_subchannel(struct work_struct *w);
213+int rndis_set_subchannel(struct net_device *ndev, struct netvsc_device *nvdev);
214214 int rndis_filter_open(struct netvsc_device *nvdev);
215215 int rndis_filter_close(struct netvsc_device *nvdev);
216216 struct netvsc_device *rndis_filter_device_add(struct hv_device *dev,
drivers/net/hyperv/netvsc.c+36−1
@@ -65,6 +65,41 @@ void netvsc_switch_datapath(struct net_device *ndev, bool vf) · 64 unmodified lines
6565 VM_PKT_DATA_INBAND, 0);
6666 }
6767
68+/* Worker to setup sub channels on initial setup
69+ * Initial hotplug event occurs in softirq context
70+ * and can't wait for channels.
71+ */
72+static void netvsc_subchan_work(struct work_struct *w)
73+{
74+ struct netvsc_device *nvdev =
75+ container_of(w, struct netvsc_device, subchan_work);
76+ struct rndis_device *rdev;
77+ int i, ret;
78+
79+ /* Avoid deadlock with device removal already under RTNL */
80+ if (!rtnl_trylock()) {
81+ schedule_work(w);
82+ return;
83+ }
84+
85+ rdev = nvdev->extension;
86+ if (rdev) {
87+ ret = rndis_set_subchannel(rdev->ndev, nvdev);
88+ if (ret == 0) {
89+ netif_device_attach(rdev->ndev);
90+ } else {
91+ /* fallback to only primary channel */
92+ for (i = 1; i < nvdev->num_chn; i++)
93+ netif_napi_del(&nvdev->chan_table[i].napi);
94+
95+ nvdev->max_chn = 1;
96+ nvdev->num_chn = 1;
97+ }
98+ }
99+
100+ rtnl_unlock();
101+}
102+
68103 static struct netvsc_device *alloc_net_device(void)
69104 {
70105 struct netvsc_device *net_device;
@@ -81,7 +116,7 @@ static struct netvsc_device *alloc_net_device(void) · 10 unmodified lines
81116
82117 init_completion(&net_device->channel_init_wait);
83118 init_waitqueue_head(&net_device->subchan_open);
84− INIT_WORK(&net_device->subchan_work, rndis_set_subchannel);
119+ INIT_WORK(&net_device->subchan_work, netvsc_subchan_work);
85120
86121 return net_device;
87122 }
drivers/net/hyperv/netvsc_drv.c+16−1
@@ -905,8 +905,20 @@ static int netvsc_attach(struct net_device *ndev, · 904 unmodified lines
905905 if (IS_ERR(nvdev))
906906 return PTR_ERR(nvdev);
907907
908− /* Note: enable and attach happen when sub-channels setup */
908+ if (nvdev->num_chn > 1) {
909+ ret = rndis_set_subchannel(ndev, nvdev);
910+
911+ /* if unavailable, just proceed with one queue */
912+ if (ret) {
913+ nvdev->max_chn = 1;
914+ nvdev->num_chn = 1;
915+ }
916+ }
917+
918+ /* In any case device is now ready */
919+ netif_device_attach(ndev);
909920
921+ /* Note: enable and attach happen when sub-channels setup */
910922 netif_carrier_off(ndev);
911923
912924 if (netif_running(ndev)) {
@@ -2089,6 +2101,9 @@ static int netvsc_probe(struct hv_device *dev, · 1176 unmodified lines
20892101
20902102 memcpy(net->dev_addr, device_info.mac_adr, ETH_ALEN);
20912103
2104+ if (nvdev->num_chn > 1)
2105+ schedule_work(&nvdev->subchan_work);
2106+
20922107 /* hw_features computed in rndis_netdev_set_hwcaps() */
20932108 net->features = net->hw_features |
20942109 NETIF_F_HIGHDMA | NETIF_F_SG |
drivers/net/hyperv/rndis_filter.c+12−49
@@ -1062,29 +1062,15 @@ static void netvsc_sc_open(struct vmbus_channel *new_sc) · 1061 unmodified lines
10621062 * This breaks overlap of processing the host message for the
10631063 * new primary channel with the initialization of sub-channels.
10641064 */
1065−void rndis_set_subchannel(struct work_struct *w)
1065+int rndis_set_subchannel(struct net_device *ndev, struct netvsc_device *nvdev)
10661066 {
1067− struct netvsc_device *nvdev
1068− = container_of(w, struct netvsc_device, subchan_work);
10691067 struct nvsp_message *init_packet = &nvdev->channel_init_pkt;
1070− struct net_device_context *ndev_ctx;
1071− struct rndis_device *rdev;
1072− struct net_device *ndev;
1073− struct hv_device *hv_dev;
1068+ struct net_device_context *ndev_ctx = netdev_priv(ndev);
1069+ struct hv_device *hv_dev = ndev_ctx->device_ctx;
1070+ struct rndis_device *rdev = nvdev->extension;
10741071 int i, ret;
10751072
1076− if (!rtnl_trylock()) {
1077− schedule_work(w);
1078− return;
1079− }
1080−
1081− rdev = nvdev->extension;
1082− if (!rdev)
1083− goto unlock; /* device was removed */
1084−
1085− ndev = rdev->ndev;
1086− ndev_ctx = netdev_priv(ndev);
1087− hv_dev = ndev_ctx->device_ctx;
1073+ ASSERT_RTNL();
10881074
10891075 memset(init_packet, 0, sizeof(struct nvsp_message));
10901076 init_packet->hdr.msg_type = NVSP_MSG5_TYPE_SUBCHANNEL;
@@ -1100,13 +1086,13 @@ void rndis_set_subchannel(struct work_struct *w) · 9 unmodified lines
11001086 VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED);
11011087 if (ret) {
11021088 netdev_err(ndev, "sub channel allocate send failed: %d\n", ret);
1103− goto failed;
1089+ return ret;
11041090 }
11051091
11061092 wait_for_completion(&nvdev->channel_init_wait);
11071093 if (init_packet->msg.v5_msg.subchn_comp.status != NVSP_STAT_SUCCESS) {
11081094 netdev_err(ndev, "sub channel request failed\n");
1109− goto failed;
1095+ return -EIO;
11101096 }
11111097
11121098 nvdev->num_chn = 1 +
@@ -1125,21 +1111,7 @@ void rndis_set_subchannel(struct work_struct *w) · 12 unmodified lines
11251111 for (i = 0; i < VRSS_SEND_TAB_SIZE; i++)
11261112 ndev_ctx->tx_table[i] = i % nvdev->num_chn;
11271113
1128− netif_device_attach(ndev);
1129− rtnl_unlock();
1130− return;
1131−
1132−failed:
1133− /* fallback to only primary channel */
1134− for (i = 1; i < nvdev->num_chn; i++)
1135− netif_napi_del(&nvdev->chan_table[i].napi);
1136−
1137− nvdev->max_chn = 1;
1138− nvdev->num_chn = 1;
1139−
1140− netif_device_attach(ndev);
1141−unlock:
1142− rtnl_unlock();
1114+ return 0;
11431115 }
11441116
11451117 static int rndis_netdev_set_hwcaps(struct rndis_device *rndis_device,
@@ -1360,21 +1332,12 @@ struct netvsc_device *rndis_filter_device_add(struct hv_device *dev, · 214 unmodified lines
13601332 netif_napi_add(net, &net_device->chan_table[i].napi,
13611333 netvsc_poll, NAPI_POLL_WEIGHT);
13621334
1363− if (net_device->num_chn > 1)
1364− schedule_work(&net_device->subchan_work);
1335+ return net_device;
13651336
13661337 out:
1367− /* if unavailable, just proceed with one queue */
1368− if (ret) {
1369− net_device->max_chn = 1;
1370− net_device->num_chn = 1;
1371− }
1372−
1373− /* No sub channels, device is ready */
1374− if (net_device->num_chn == 1)
1375− netif_device_attach(net);
1376−
1377− return net_device;
1338+ /* setting up multiple channels failed */
1339+ net_device->max_chn = 1;
1340+ net_device->num_chn = 1;
13781341
13791342 err_dev_remv:
13801343 rndis_filter_device_remove(dev, net_device);
drivers/net/ipvlan/ipvlan_main.c+28−8
@@ -75,10 +75,23 @@ static int ipvlan_set_port_mode(struct ipvl_port *port, u16 nval) · 74 unmodified lines
7575 {
7676 struct ipvl_dev *ipvlan;
7777 struct net_device *mdev = port->dev;
78− int err = 0;
78+ unsigned int flags;
79+ int err;
7980
8081 ASSERT_RTNL();
8182 if (port->mode != nval) {
83+ list_for_each_entry(ipvlan, &port->ipvlans, pnode) {
84+ flags = ipvlan->dev->flags;
85+ if (nval == IPVLAN_MODE_L3 || nval == IPVLAN_MODE_L3S) {
86+ err = dev_change_flags(ipvlan->dev,
87+ flags | IFF_NOARP);
88+ } else {
89+ err = dev_change_flags(ipvlan->dev,
90+ flags & ~IFF_NOARP);
91+ }
92+ if (unlikely(err))
93+ goto fail;
94+ }
8295 if (nval == IPVLAN_MODE_L3S) {
8396 /* New mode is L3S */
8497 err = ipvlan_register_nf_hook(read_pnet(&port->pnet));
@@ -86,21 +99,28 @@ static int ipvlan_set_port_mode(struct ipvl_port *port, u16 nval) · 1 unmodified line
8699 mdev->l3mdev_ops = &ipvl_l3mdev_ops;
87100 mdev->priv_flags |= IFF_L3MDEV_MASTER;
88101 } else
89− return err;
102+ goto fail;
90103 } else if (port->mode == IPVLAN_MODE_L3S) {
91104 /* Old mode was L3S */
92105 mdev->priv_flags &= ~IFF_L3MDEV_MASTER;
93106 ipvlan_unregister_nf_hook(read_pnet(&port->pnet));
94107 mdev->l3mdev_ops = NULL;
95108 }
96− list_for_each_entry(ipvlan, &port->ipvlans, pnode) {
97− if (nval == IPVLAN_MODE_L3 || nval == IPVLAN_MODE_L3S)
98− ipvlan->dev->flags |= IFF_NOARP;
99− else
100− ipvlan->dev->flags &= ~IFF_NOARP;
101− }
102109 port->mode = nval;
103110 }
111+ return 0;
112+
113+fail:
114+ /* Undo the flags changes that have been done so far. */
115+ list_for_each_entry_continue_reverse(ipvlan, &port->ipvlans, pnode) {
116+ flags = ipvlan->dev->flags;
117+ if (port->mode == IPVLAN_MODE_L3 ||
118+ port->mode == IPVLAN_MODE_L3S)
119+ dev_change_flags(ipvlan->dev, flags | IFF_NOARP);
120+ else
121+ dev_change_flags(ipvlan->dev, flags & ~IFF_NOARP);
122+ }
123+
104124 return err;
105125 }
106126
drivers/net/phy/dp83tc811.c+1−1
@@ -222,7 +222,7 @@ static int dp83811_config_intr(struct phy_device *phydev) · 221 unmodified lines
222222 if (err < 0)
223223 return err;
224224
225− err = phy_write(phydev, MII_DP83811_INT_STAT1, 0);
225+ err = phy_write(phydev, MII_DP83811_INT_STAT2, 0);
226226 }
227227
228228 return err;
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/lan78xx.c+34−3
@@ -64,6 +64,7 @@ · 63 unmodified lines
6464 #define DEFAULT_RX_CSUM_ENABLE (true)
6565 #define DEFAULT_TSO_CSUM_ENABLE (true)
6666 #define DEFAULT_VLAN_FILTER_ENABLE (true)
67+#define DEFAULT_VLAN_RX_OFFLOAD (true)
6768 #define TX_OVERHEAD (8)
6869 #define RXW_PADDING 2
6970
@@ -2298,7 +2299,7 @@ static int lan78xx_change_mtu(struct net_device *netdev, int new_mtu) · 2228 unmodified lines
22982299 if ((ll_mtu % dev->maxpacket) == 0)
22992300 return -EDOM;
23002301
2301− ret = lan78xx_set_rx_max_frame_length(dev, new_mtu + ETH_HLEN);
2302+ ret = lan78xx_set_rx_max_frame_length(dev, new_mtu + VLAN_ETH_HLEN);
23022303
23032304 netdev->mtu = new_mtu;
23042305
@@ -2364,6 +2365,11 @@ static int lan78xx_set_features(struct net_device *netdev, · 59 unmodified lines
23642365 }
23652366
23662367 if (features & NETIF_F_HW_VLAN_CTAG_RX)
2368+ pdata->rfe_ctl |= RFE_CTL_VLAN_STRIP_;
2369+ else
2370+ pdata->rfe_ctl &= ~RFE_CTL_VLAN_STRIP_;
2371+
2372+ if (features & NETIF_F_HW_VLAN_CTAG_FILTER)
23672373 pdata->rfe_ctl |= RFE_CTL_VLAN_FILTER_;
23682374 else
23692375 pdata->rfe_ctl &= ~RFE_CTL_VLAN_FILTER_;
@@ -2587,7 +2593,8 @@ static int lan78xx_reset(struct lan78xx_net *dev) · 217 unmodified lines
25872593 buf |= FCT_TX_CTL_EN_;
25882594 ret = lan78xx_write_reg(dev, FCT_TX_CTL, buf);
25892595
2590− ret = lan78xx_set_rx_max_frame_length(dev, dev->net->mtu + ETH_HLEN);
2596+ ret = lan78xx_set_rx_max_frame_length(dev,
2597+ dev->net->mtu + VLAN_ETH_HLEN);
25912598
25922599 ret = lan78xx_read_reg(dev, MAC_RX, &buf);
25932600 buf |= MAC_RX_RXEN_;
@@ -2975,6 +2982,12 @@ static int lan78xx_bind(struct lan78xx_net *dev, struct usb_interface *intf) · 381 unmodified lines
29752982 if (DEFAULT_TSO_CSUM_ENABLE)
29762983 dev->net->features |= NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_SG;
29772984
2985+ if (DEFAULT_VLAN_RX_OFFLOAD)
2986+ dev->net->features |= NETIF_F_HW_VLAN_CTAG_RX;
2987+
2988+ if (DEFAULT_VLAN_FILTER_ENABLE)
2989+ dev->net->features |= NETIF_F_HW_VLAN_CTAG_FILTER;
2990+
29782991 dev->net->hw_features = dev->net->features;
29792992
29802993 ret = lan78xx_setup_irq_domain(dev);
@@ -3039,8 +3052,13 @@ static void lan78xx_rx_csum_offload(struct lan78xx_net *dev, · 58 unmodified lines
30393052 struct sk_buff *skb,
30403053 u32 rx_cmd_a, u32 rx_cmd_b)
30413054 {
3055+ /* HW Checksum offload appears to be flawed if used when not stripping
3056+ * VLAN headers. Drop back to S/W checksums under these conditions.
3057+ */
30423058 if (!(dev->net->features & NETIF_F_RXCSUM) ||
3043− unlikely(rx_cmd_a & RX_CMD_A_ICSM_)) {
3059+ unlikely(rx_cmd_a & RX_CMD_A_ICSM_) ||
3060+ ((rx_cmd_a & RX_CMD_A_FVTG_) &&
3061+ !(dev->net->features & NETIF_F_HW_VLAN_CTAG_RX))) {
30443062 skb->ip_summed = CHECKSUM_NONE;
30453063 } else {
30463064 skb->csum = ntohs((u16)(rx_cmd_b >> RX_CMD_B_CSUM_SHIFT_));
@@ -3048,6 +3066,16 @@ static void lan78xx_rx_csum_offload(struct lan78xx_net *dev, · 1 unmodified line
30483066 }
30493067 }
30503068
3069+static void lan78xx_rx_vlan_offload(struct lan78xx_net *dev,
3070+ struct sk_buff *skb,
3071+ u32 rx_cmd_a, u32 rx_cmd_b)
3072+{
3073+ if ((dev->net->features & NETIF_F_HW_VLAN_CTAG_RX) &&
3074+ (rx_cmd_a & RX_CMD_A_FVTG_))
3075+ __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q),
3076+ (rx_cmd_b & 0xffff));
3077+}
3078+
30513079 static void lan78xx_skb_return(struct lan78xx_net *dev, struct sk_buff *skb)
30523080 {
30533081 int status;
@@ -3112,6 +3140,8 @@ static int lan78xx_rx(struct lan78xx_net *dev, struct sk_buff *skb) · 58 unmodified lines
31123140 if (skb->len == size) {
31133141 lan78xx_rx_csum_offload(dev, skb,
31143142 rx_cmd_a, rx_cmd_b);
3143+ lan78xx_rx_vlan_offload(dev, skb,
3144+ rx_cmd_a, rx_cmd_b);
31153145
31163146 skb_trim(skb, skb->len - 4); /* remove fcs */
31173147 skb->truesize = size + sizeof(struct sk_buff);
@@ -3130,6 +3160,7 @@ static int lan78xx_rx(struct lan78xx_net *dev, struct sk_buff *skb) · 12 unmodified lines
31303160 skb_set_tail_pointer(skb2, size);
31313161
31323162 lan78xx_rx_csum_offload(dev, skb2, rx_cmd_a, rx_cmd_b);
3163+ lan78xx_rx_vlan_offload(dev, skb2, rx_cmd_a, rx_cmd_b);
31333164
31343165 skb_trim(skb2, skb2->len - 4); /* remove fcs */
31353166 skb2->truesize = size + sizeof(struct sk_buff);
drivers/net/usb/r8152.c+2−1
@@ -3966,7 +3966,8 @@ static int rtl8152_close(struct net_device *netdev) · 3965 unmodified lines
39663966 #ifdef CONFIG_PM_SLEEP
39673967 unregister_pm_notifier(&tp->pm_notifier);
39683968 #endif
3969− napi_disable(&tp->napi);
3969+ if (!test_bit(RTL8152_UNPLUG, &tp->flags))
3970+ napi_disable(&tp->napi);
39703971 clear_bit(WORK_ENABLE, &tp->flags);
39713972 usb_kill_urb(tp->intr_urb);
39723973 cancel_delayed_work_sync(&tp->schedule);
drivers/net/virtio_net.c+19−11
@@ -53,6 +53,10 @@ module_param(napi_tx, bool, 0644); · 52 unmodified lines
5353 /* Amount of XDP headroom to prepend to packets for use by xdp_adjust_head */
5454 #define VIRTIO_XDP_HEADROOM 256
5555
56+/* Separating two types of XDP xmit */
57+#define VIRTIO_XDP_TX BIT(0)
58+#define VIRTIO_XDP_REDIR BIT(1)
59+
5660 /* RX packet size EWMA. The average packet size is used to determine the packet
5761 * buffer size when refilling RX rings. As the entire RX ring may be refilled
5862 * at once, the weight is chosen so that the EWMA will be insensitive to short-
@@ -582,7 +586,7 @@ static struct sk_buff *receive_small(struct net_device *dev, · 523 unmodified lines
582586 struct receive_queue *rq,
583587 void *buf, void *ctx,
584588 unsigned int len,
585− bool *xdp_xmit)
589+ unsigned int *xdp_xmit)
586590 {
587591 struct sk_buff *skb;
588592 struct bpf_prog *xdp_prog;
@@ -654,14 +658,14 @@ static struct sk_buff *receive_small(struct net_device *dev, · 65 unmodified lines
654658 trace_xdp_exception(vi->dev, xdp_prog, act);
655659 goto err_xdp;
656660 }
657− *xdp_xmit = true;
661+ *xdp_xmit |= VIRTIO_XDP_TX;
658662 rcu_read_unlock();
659663 goto xdp_xmit;
660664 case XDP_REDIRECT:
661665 err = xdp_do_redirect(dev, &xdp, xdp_prog);
662666 if (err)
663667 goto err_xdp;
664− *xdp_xmit = true;
668+ *xdp_xmit |= VIRTIO_XDP_REDIR;
665669 rcu_read_unlock();
666670 goto xdp_xmit;
667671 default:
@@ -723,7 +727,7 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, · 55 unmodified lines
723727 void *buf,
724728 void *ctx,
725729 unsigned int len,
726− bool *xdp_xmit)
730+ unsigned int *xdp_xmit)
727731 {
728732 struct virtio_net_hdr_mrg_rxbuf *hdr = buf;
729733 u16 num_buf = virtio16_to_cpu(vi->vdev, hdr->num_buffers);
@@ -818,7 +822,7 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, · 88 unmodified lines
818822 put_page(xdp_page);
819823 goto err_xdp;
820824 }
821− *xdp_xmit = true;
825+ *xdp_xmit |= VIRTIO_XDP_TX;
822826 if (unlikely(xdp_page != page))
823827 put_page(page);
824828 rcu_read_unlock();
@@ -830,7 +834,7 @@ static struct sk_buff *receive_mergeable(struct net_device *dev, · 5 unmodified lines
830834 put_page(xdp_page);
831835 goto err_xdp;
832836 }
833− *xdp_xmit = true;
837+ *xdp_xmit |= VIRTIO_XDP_REDIR;
834838 if (unlikely(xdp_page != page))
835839 put_page(page);
836840 rcu_read_unlock();
@@ -939,7 +943,8 @@ xdp_xmit: · 102 unmodified lines
939943 }
940944
941945 static int receive_buf(struct virtnet_info *vi, struct receive_queue *rq,
942− void *buf, unsigned int len, void **ctx, bool *xdp_xmit)
946+ void *buf, unsigned int len, void **ctx,
947+ unsigned int *xdp_xmit)
943948 {
944949 struct net_device *dev = vi->dev;
945950 struct sk_buff *skb;
@@ -1232,7 +1237,8 @@ static void refill_work(struct work_struct *work) · 286 unmodified lines
12321237 }
12331238 }
12341239
1235−static int virtnet_receive(struct receive_queue *rq, int budget, bool *xdp_xmit)
1240+static int virtnet_receive(struct receive_queue *rq, int budget,
1241+ unsigned int *xdp_xmit)
12361242 {
12371243 struct virtnet_info *vi = rq->vq->vdev->priv;
12381244 unsigned int len, received = 0, bytes = 0;
@@ -1321,7 +1327,7 @@ static int virtnet_poll(struct napi_struct *napi, int budget) · 82 unmodified lines
13211327 struct virtnet_info *vi = rq->vq->vdev->priv;
13221328 struct send_queue *sq;
13231329 unsigned int received, qp;
1324− bool xdp_xmit = false;
1330+ unsigned int xdp_xmit = 0;
13251331
13261332 virtnet_poll_cleantx(rq);
13271333
@@ -1331,12 +1337,14 @@ static int virtnet_poll(struct napi_struct *napi, int budget) · 3 unmodified lines
13311337 if (received < budget)
13321338 virtqueue_napi_complete(napi, rq->vq, received);
13331339
1334− if (xdp_xmit) {
1340+ if (xdp_xmit & VIRTIO_XDP_REDIR)
1341+ xdp_do_flush_map();
1342+
1343+ if (xdp_xmit & VIRTIO_XDP_TX) {
13351344 qp = vi->curr_queue_pairs - vi->xdp_queue_pairs +
13361345 smp_processor_id();
13371346 sq = &vi->sq[qp];
13381347 virtqueue_kick(sq->vq);
1339− xdp_do_flush_map();
13401348 }
13411349
13421350 return received;
drivers/net/vxlan.c+1−3
@@ -624,9 +624,7 @@ static struct sk_buff *vxlan_gro_receive(struct sock *sk, · 623 unmodified lines
624624 flush = 0;
625625
626626 out:
627− skb_gro_remcsum_cleanup(skb, &grc);
628− skb->remcsum_offload = 0;
629− NAPI_GRO_CB(skb)->flush |= flush;
627+ skb_gro_flush_final_remcsum(skb, pp, flush, &grc);
630628
631629 return pp;
632630 }
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/rdma.c+5−2
@@ -732,8 +732,11 @@ static void nvme_rdma_destroy_admin_queue(struct nvme_rdma_ctrl *ctrl, · 731 unmodified lines
732732 blk_cleanup_queue(ctrl->ctrl.admin_q);
733733 nvme_rdma_free_tagset(&ctrl->ctrl, ctrl->ctrl.admin_tagset);
734734 }
735− nvme_rdma_free_qe(ctrl->device->dev, &ctrl->async_event_sqe,
736− sizeof(struct nvme_command), DMA_TO_DEVICE);
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+ }
737740 nvme_rdma_free_queue(&ctrl->queues[0]);
738741 }
739742
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/s390/net/qeth_core.h+12−1
@@ -829,6 +829,17 @@ struct qeth_trap_id { · 828 unmodified lines
829829 /*some helper functions*/
830830 #define QETH_CARD_IFNAME(card) (((card)->dev)? (card)->dev->name : "")
831831
832+static inline void qeth_scrub_qdio_buffer(struct qdio_buffer *buf,
833+ unsigned int elements)
834+{
835+ unsigned int i;
836+
837+ for (i = 0; i < elements; i++)
838+ memset(&buf->element[i], 0, sizeof(struct qdio_buffer_element));
839+ buf->element[14].sflags = 0;
840+ buf->element[15].sflags = 0;
841+}
842+
832843 /**
833844 * qeth_get_elements_for_range() - find number of SBALEs to cover range.
834845 * @start: Start of the address range.
@@ -1029,7 +1040,7 @@ struct qeth_cmd_buffer *qeth_get_setassparms_cmd(struct qeth_card *, · 194 unmodified lines
10291040 __u16, __u16,
10301041 enum qeth_prot_versions);
10311042 int qeth_set_features(struct net_device *, netdev_features_t);
1032−void qeth_recover_features(struct net_device *dev);
1043+void qeth_enable_hw_features(struct net_device *dev);
10331044 netdev_features_t qeth_fix_features(struct net_device *, netdev_features_t);
10341045 netdev_features_t qeth_features_check(struct sk_buff *skb,
10351046 struct net_device *dev,
drivers/s390/net/qeth_core_main.c+28−19
@@ -73,9 +73,6 @@ static void qeth_notify_skbs(struct qeth_qdio_out_q *queue, · 72 unmodified lines
7373 struct qeth_qdio_out_buffer *buf,
7474 enum iucv_tx_notify notification);
7575 static void qeth_release_skbs(struct qeth_qdio_out_buffer *buf);
76−static void qeth_clear_output_buffer(struct qeth_qdio_out_q *queue,
77− struct qeth_qdio_out_buffer *buf,
78− enum qeth_qdio_buffer_states newbufstate);
7976 static int qeth_init_qdio_out_buf(struct qeth_qdio_out_q *, int);
8077
8178 struct workqueue_struct *qeth_wq;
@@ -489,6 +486,7 @@ static void qeth_qdio_handle_aob(struct qeth_card *card, · 407 unmodified lines
489486 struct qaob *aob;
490487 struct qeth_qdio_out_buffer *buffer;
491488 enum iucv_tx_notify notification;
489+ unsigned int i;
492490
493491 aob = (struct qaob *) phys_to_virt(phys_aob_addr);
494492 QETH_CARD_TEXT(card, 5, "haob");
@@ -513,10 +511,18 @@ static void qeth_qdio_handle_aob(struct qeth_card *card, · 18 unmodified lines
513511 qeth_notify_skbs(buffer->q, buffer, notification);
514512
515513 buffer->aob = NULL;
516− qeth_clear_output_buffer(buffer->q, buffer,
517− QETH_QDIO_BUF_HANDLED_DELAYED);
514+ /* Free dangling allocations. The attached skbs are handled by
515+ * qeth_cleanup_handled_pending().
516+ */
517+ for (i = 0;
518+ i < aob->sb_count && i < QETH_MAX_BUFFER_ELEMENTS(card);
519+ i++) {
520+ if (aob->sba[i] && buffer->is_header[i])
521+ kmem_cache_free(qeth_core_header_cache,
522+ (void *) aob->sba[i]);
523+ }
524+ atomic_set(&buffer->state, QETH_QDIO_BUF_HANDLED_DELAYED);
518525
519− /* from here on: do not touch buffer anymore */
520526 qdio_release_aob(aob);
521527 }
522528
@@ -3759,6 +3765,10 @@ static void qeth_qdio_output_handler(struct ccw_device *ccwdev, · 3236 unmodified lines
37593765 QETH_CARD_TEXT(queue->card, 5, "aob");
37603766 QETH_CARD_TEXT_(queue->card, 5, "%lx",
37613767 virt_to_phys(buffer->aob));
3768+
3769+ /* prepare the queue slot for re-use: */
3770+ qeth_scrub_qdio_buffer(buffer->buffer,
3771+ QETH_MAX_BUFFER_ELEMENTS(card));
37623772 if (qeth_init_qdio_out_buf(queue, bidx)) {
37633773 QETH_CARD_TEXT(card, 2, "outofbuf");
37643774 qeth_schedule_recovery(card);
@@ -4834,7 +4844,7 @@ int qeth_vm_request_mac(struct qeth_card *card) · 1069 unmodified lines
48344844 goto out;
48354845 }
48364846
4837− ccw_device_get_id(CARD_RDEV(card), &id);
4847+ ccw_device_get_id(CARD_DDEV(card), &id);
48384848 request->resp_buf_len = sizeof(*response);
48394849 request->resp_version = DIAG26C_VERSION2;
48404850 request->op_code = DIAG26C_GET_MAC;
@@ -6459,28 +6469,27 @@ static int qeth_set_ipa_rx_csum(struct qeth_card *card, bool on) · 1618 unmodified lines
64596469 #define QETH_HW_FEATURES (NETIF_F_RXCSUM | NETIF_F_IP_CSUM | NETIF_F_TSO | \
64606470 NETIF_F_IPV6_CSUM)
64616471 /**
6462− * qeth_recover_features() - Restore device features after recovery
6463− * @dev: the recovering net_device
6464− *
6465− * Caller must hold rtnl lock.
6472+ * qeth_enable_hw_features() - (Re-)Enable HW functions for device features
6473+ * @dev: a net_device
64666474 */
6467−void qeth_recover_features(struct net_device *dev)
6475+void qeth_enable_hw_features(struct net_device *dev)
64686476 {
6469− netdev_features_t features = dev->features;
64706477 struct qeth_card *card = dev->ml_priv;
6478+ netdev_features_t features;
64716479
6480+ rtnl_lock();
6481+ features = dev->features;
64726482 /* force-off any feature that needs an IPA sequence.
64736483 * netdev_update_features() will restart them.
64746484 */
64756485 dev->features &= ~QETH_HW_FEATURES;
64766486 netdev_update_features(dev);
6477−
6478− if (features == dev->features)
6479− return;
6480− dev_warn(&card->gdev->dev,
6481− "Device recovery failed to restore all offload features\n");
6487+ if (features != dev->features)
6488+ dev_warn(&card->gdev->dev,
6489+ "Device recovery failed to restore all offload features\n");
6490+ rtnl_unlock();
64826491 }
6483−EXPORT_SYMBOL_GPL(qeth_recover_features);
6492+EXPORT_SYMBOL_GPL(qeth_enable_hw_features);
64846493
64856494 int qeth_set_features(struct net_device *dev, netdev_features_t features)
64866495 {
drivers/s390/net/qeth_l2_main.c+15−9
@@ -140,7 +140,7 @@ static int qeth_l2_send_setmac(struct qeth_card *card, __u8 *mac) · 139 unmodified lines
140140
141141 static int qeth_l2_write_mac(struct qeth_card *card, u8 *mac)
142142 {
143− enum qeth_ipa_cmds cmd = is_multicast_ether_addr_64bits(mac) ?
143+ enum qeth_ipa_cmds cmd = is_multicast_ether_addr(mac) ?
144144 IPA_CMD_SETGMAC : IPA_CMD_SETVMAC;
145145 int rc;
146146
@@ -157,7 +157,7 @@ static int qeth_l2_write_mac(struct qeth_card *card, u8 *mac) · 10 unmodified lines
157157
158158 static int qeth_l2_remove_mac(struct qeth_card *card, u8 *mac)
159159 {
160− enum qeth_ipa_cmds cmd = is_multicast_ether_addr_64bits(mac) ?
160+ enum qeth_ipa_cmds cmd = is_multicast_ether_addr(mac) ?
161161 IPA_CMD_DELGMAC : IPA_CMD_DELVMAC;
162162 int rc;
163163
@@ -501,27 +501,34 @@ static int qeth_l2_set_mac_address(struct net_device *dev, void *p) · 337 unmodified lines
501501 return -ERESTARTSYS;
502502 }
503503
504+ /* avoid racing against concurrent state change: */
505+ if (!mutex_trylock(&card->conf_mutex))
506+ return -EAGAIN;
507+
504508 if (!qeth_card_hw_is_reachable(card)) {
505509 ether_addr_copy(dev->dev_addr, addr->sa_data);
506− return 0;
510+ goto out_unlock;
507511 }
508512
509513 /* don't register the same address twice */
510514 if (ether_addr_equal_64bits(dev->dev_addr, addr->sa_data) &&
511515 (card->info.mac_bits & QETH_LAYER2_MAC_REGISTERED))
512− return 0;
516+ goto out_unlock;
513517
514518 /* add the new address, switch over, drop the old */
515519 rc = qeth_l2_send_setmac(card, addr->sa_data);
516520 if (rc)
517− return rc;
521+ goto out_unlock;
518522 ether_addr_copy(old_addr, dev->dev_addr);
519523 ether_addr_copy(dev->dev_addr, addr->sa_data);
520524
521525 if (card->info.mac_bits & QETH_LAYER2_MAC_REGISTERED)
522526 qeth_l2_remove_mac(card, old_addr);
523527 card->info.mac_bits |= QETH_LAYER2_MAC_REGISTERED;
524− return 0;
528+
529+out_unlock:
530+ mutex_unlock(&card->conf_mutex);
531+ return rc;
525532 }
526533
527534 static void qeth_promisc_to_bridge(struct qeth_card *card)
@@ -1112,6 +1119,8 @@ static int __qeth_l2_set_online(struct ccwgroup_device *gdev, int recovery_mode) · 584 unmodified lines
11121119 netif_carrier_off(card->dev);
11131120
11141121 qeth_set_allowed_threads(card, 0xffffffff, 0);
1122+
1123+ qeth_enable_hw_features(card->dev);
11151124 if (recover_flag == CARD_STATE_RECOVER) {
11161125 if (recovery_mode &&
11171126 card->info.type != QETH_CARD_TYPE_OSN) {
@@ -1123,9 +1132,6 @@ static int __qeth_l2_set_online(struct ccwgroup_device *gdev, int recovery_mode) · 5 unmodified lines
11231132 }
11241133 /* this also sets saved unicast addresses */
11251134 qeth_l2_set_rx_mode(card->dev);
1126− rtnl_lock();
1127− qeth_recover_features(card->dev);
1128− rtnl_unlock();
11291135 }
11301136 /* let user_space know that device is online */
11311137 kobject_uevent(&gdev->dev.kobj, KOBJ_CHANGE);
drivers/s390/net/qeth_l3_main.c+2−1
@@ -2662,6 +2662,8 @@ static int __qeth_l3_set_online(struct ccwgroup_device *gdev, int recovery_mode) · 2661 unmodified lines
26622662 netif_carrier_on(card->dev);
26632663 else
26642664 netif_carrier_off(card->dev);
2665+
2666+ qeth_enable_hw_features(card->dev);
26652667 if (recover_flag == CARD_STATE_RECOVER) {
26662668 rtnl_lock();
26672669 if (recovery_mode)
@@ -2669,7 +2671,6 @@ static int __qeth_l3_set_online(struct ccwgroup_device *gdev, int recovery_mode) · 1 unmodified line
26692671 else
26702672 dev_open(card->dev);
26712673 qeth_l3_set_rx_mode(card->dev);
2672− qeth_recover_features(card->dev);
26732674 rtnl_unlock();
26742675 }
26752676 qeth_trace_features(card);
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/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
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/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/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/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/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/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/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/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-cgroup.h+26−0
@@ -188,12 +188,38 @@ int __cgroup_bpf_check_dev_permission(short dev_type, u32 major, u32 minor, · 187 unmodified lines
188188 \
189189 __ret; \
190190 })
191+int cgroup_bpf_prog_attach(const union bpf_attr *attr,
192+ enum bpf_prog_type ptype, struct bpf_prog *prog);
193+int cgroup_bpf_prog_detach(const union bpf_attr *attr,
194+ enum bpf_prog_type ptype);
195+int cgroup_bpf_prog_query(const union bpf_attr *attr,
196+ union bpf_attr __user *uattr);
191197 #else
192198
199+struct bpf_prog;
193200 struct cgroup_bpf {};
194201 static inline void cgroup_bpf_put(struct cgroup *cgrp) {}
195202 static inline int cgroup_bpf_inherit(struct cgroup *cgrp) { return 0; }
196203
204+static inline int cgroup_bpf_prog_attach(const union bpf_attr *attr,
205+ enum bpf_prog_type ptype,
206+ struct bpf_prog *prog)
207+{
208+ return -EINVAL;
209+}
210+
211+static inline int cgroup_bpf_prog_detach(const union bpf_attr *attr,
212+ enum bpf_prog_type ptype)
213+{
214+ return -EINVAL;
215+}
216+
217+static inline int cgroup_bpf_prog_query(const union bpf_attr *attr,
218+ union bpf_attr __user *uattr)
219+{
220+ return -EINVAL;
221+}
222+
197223 #define cgroup_bpf_enabled (0)
198224 #define BPF_CGROUP_PRE_CONNECT_ENABLED(sk) (0)
199225 #define BPF_CGROUP_RUN_PROG_INET_INGRESS(sk,skb) ({ 0; })
include/linux/bpf.h+8−0
@@ -696,6 +696,8 @@ static inline void bpf_map_offload_map_free(struct bpf_map *map) · 695 unmodified lines
696696 struct sock *__sock_map_lookup_elem(struct bpf_map *map, u32 key);
697697 struct sock *__sock_hash_lookup_elem(struct bpf_map *map, void *key);
698698 int sock_map_prog(struct bpf_map *map, struct bpf_prog *prog, u32 type);
699+int sockmap_get_from_fd(const union bpf_attr *attr, int type,
700+ struct bpf_prog *prog);
699701 #else
700702 static inline struct sock *__sock_map_lookup_elem(struct bpf_map *map, u32 key)
701703 {
@@ -714,6 +716,12 @@ static inline int sock_map_prog(struct bpf_map *map, · 12 unmodified lines
714716 {
715717 return -EOPNOTSUPP;
716718 }
719+
720+static inline int sockmap_get_from_fd(const union bpf_attr *attr, int type,
721+ struct bpf_prog *prog)
722+{
723+ return -EINVAL;
724+}
717725 #endif
718726
719727 #if defined(CONFIG_XDP_SOCKETS)
include/linux/bpf_lirc.h+3−2
@@ -5,11 +5,12 @@ · 4 unmodified lines
55 #include <uapi/linux/bpf.h>
66
77 #ifdef CONFIG_BPF_LIRC_MODE2
8−int lirc_prog_attach(const union bpf_attr *attr);
8+int lirc_prog_attach(const union bpf_attr *attr, struct bpf_prog *prog);
99 int lirc_prog_detach(const union bpf_attr *attr);
1010 int lirc_prog_query(const union bpf_attr *attr, union bpf_attr __user *uattr);
1111 #else
12−static inline int lirc_prog_attach(const union bpf_attr *attr)
12+static inline int lirc_prog_attach(const union bpf_attr *attr,
13+ struct bpf_prog *prog)
1314 {
1415 return -EINVAL;
1516 }
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/filter.h+8−48
@@ -470,9 +470,7 @@ struct sock_fprog_kern { · 469 unmodified lines
470470 };
471471
472472 struct bpf_binary_header {
473− u16 pages;
474− u16 locked:1;
475−
473+ u32 pages;
476474 /* Some arches need word alignment for their instructions */
477475 u8 image[] __aligned(4);
478476 };
@@ -481,7 +479,7 @@ struct bpf_prog { · 2 unmodified lines
481479 u16 pages; /* Number of allocated pages */
482480 u16 jited:1, /* Is our filter JIT'ed? */
483481 jit_requested:1,/* archs need to JIT the prog */
484− locked:1, /* Program image locked? */
482+ undo_set_mem:1, /* Passed set_memory_ro() checkpoint */
485483 gpl_compatible:1, /* Is filter GPL compatible? */
486484 cb_access:1, /* Is control block accessed? */
487485 dst_needed:1, /* Do we need dst entry? */
@@ -677,46 +675,24 @@ bpf_ctx_narrow_access_ok(u32 off, u32 size, u32 size_default) · 189 unmodified lines
677675
678676 static inline void bpf_prog_lock_ro(struct bpf_prog *fp)
679677 {
680−#ifdef CONFIG_ARCH_HAS_SET_MEMORY
681− fp->locked = 1;
682− if (set_memory_ro((unsigned long)fp, fp->pages))
683− fp->locked = 0;
684−#endif
678+ fp->undo_set_mem = 1;
679+ set_memory_ro((unsigned long)fp, fp->pages);
685680 }
686681
687682 static inline void bpf_prog_unlock_ro(struct bpf_prog *fp)
688683 {
689−#ifdef CONFIG_ARCH_HAS_SET_MEMORY
690− if (fp->locked) {
691− WARN_ON_ONCE(set_memory_rw((unsigned long)fp, fp->pages));
692− /* In case set_memory_rw() fails, we want to be the first
693− * to crash here instead of some random place later on.
694− */
695− fp->locked = 0;
696− }
697−#endif
684+ if (fp->undo_set_mem)
685+ set_memory_rw((unsigned long)fp, fp->pages);
698686 }
699687
700688 static inline void bpf_jit_binary_lock_ro(struct bpf_binary_header *hdr)
701689 {
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
690+ set_memory_ro((unsigned long)hdr, hdr->pages);
707691 }
708692
709693 static inline void bpf_jit_binary_unlock_ro(struct bpf_binary_header *hdr)
710694 {
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
695+ set_memory_rw((unsigned long)hdr, hdr->pages);
720696 }
721697
722698 static inline struct bpf_binary_header *
@@ -728,22 +704,6 @@ bpf_jit_binary_hdr(const struct bpf_prog *fp) · 5 unmodified lines
728704 return (void *)addr;
729705 }
730706
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−
747707 int sk_filter_trim_cap(struct sock *sk, struct sk_buff *skb, unsigned int cap);
748708 static inline int sk_filter(struct sock *sk, struct sk_buff *skb)
749709 {
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/mlx5/eswitch.h+2−0
@@ -8,6 +8,8 @@ · 7 unmodified lines
88
99 #include <linux/mlx5/driver.h>
1010
11+#define MLX5_ESWITCH_MANAGER(mdev) MLX5_CAP_GEN(mdev, eswitch_manager)
12+
1113 enum {
1214 SRIOV_NONE,
1315 SRIOV_LEGACY,
include/linux/mlx5/mlx5_ifc.h+1−1
@@ -922,7 +922,7 @@ struct mlx5_ifc_cmd_hca_cap_bits { · 921 unmodified lines
922922 u8 vnic_env_queue_counters[0x1];
923923 u8 ets[0x1];
924924 u8 nic_flow_table[0x1];
925− u8 eswitch_flow_table[0x1];
925+ u8 eswitch_manager[0x1];
926926 u8 device_memory[0x1];
927927 u8 mcam_reg[0x1];
928928 u8 pcam_reg[0x1];
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/netdevice.h+20−0
@@ -2796,11 +2796,31 @@ static inline void skb_gro_flush_final(struct sk_buff *skb, struct sk_buff *pp, · 2795 unmodified lines
27962796 if (PTR_ERR(pp) != -EINPROGRESS)
27972797 NAPI_GRO_CB(skb)->flush |= flush;
27982798 }
2799+static inline void skb_gro_flush_final_remcsum(struct sk_buff *skb,
2800+ struct sk_buff *pp,
2801+ int flush,
2802+ struct gro_remcsum *grc)
2803+{
2804+ if (PTR_ERR(pp) != -EINPROGRESS) {
2805+ NAPI_GRO_CB(skb)->flush |= flush;
2806+ skb_gro_remcsum_cleanup(skb, grc);
2807+ skb->remcsum_offload = 0;
2808+ }
2809+}
27992810 #else
28002811 static inline void skb_gro_flush_final(struct sk_buff *skb, struct sk_buff *pp, int flush)
28012812 {
28022813 NAPI_GRO_CB(skb)->flush |= flush;
28032814 }
2815+static inline void skb_gro_flush_final_remcsum(struct sk_buff *skb,
2816+ struct sk_buff *pp,
2817+ int flush,
2818+ struct gro_remcsum *grc)
2819+{
2820+ NAPI_GRO_CB(skb)->flush |= flush;
2821+ skb_gro_remcsum_cleanup(skb, grc);
2822+ skb->remcsum_offload = 0;
2823+}
28042824 #endif
28052825
28062826 static inline int dev_hard_header(struct sk_buff *skb, struct net_device *dev,
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/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/skbuff.h+2−1
@@ -3253,7 +3253,8 @@ struct sk_buff *__skb_recv_datagram(struct sock *sk, unsigned flags, · 3252 unmodified lines
32533253 int *peeked, int *off, int *err);
32543254 struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned flags, int noblock,
32553255 int *err);
3256−__poll_t datagram_poll_mask(struct socket *sock, __poll_t events);
3256+__poll_t datagram_poll(struct file *file, struct socket *sock,
3257+ struct poll_table_struct *wait);
32573258 int skb_copy_datagram_iter(const struct sk_buff *from, int offset,
32583259 struct iov_iter *to, int size);
32593260 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/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/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/net_namespace.h+1−0
@@ -128,6 +128,7 @@ struct net { · 127 unmodified lines
128128 #endif
129129 #if IS_ENABLED(CONFIG_NF_DEFRAG_IPV6)
130130 struct netns_nf_frag nf_frag;
131+ struct ctl_table_header *nf_frag_frags_hdr;
131132 #endif
132133 struct sock *nfnl;
133134 struct sock *nfnl_stash;
include/net/netns/ipv6.h+0−1
@@ -109,7 +109,6 @@ struct netns_ipv6 { · 108 unmodified lines
109109
110110 #if IS_ENABLED(CONFIG_NF_DEFRAG_IPV6)
111111 struct netns_nf_frag {
112− struct netns_sysctl_ipv6 sysctl;
113112 struct netns_frags frags;
114113 };
115114 #endif
include/net/pkt_cls.h+5−0
@@ -113,6 +113,11 @@ void tcf_block_put_ext(struct tcf_block *block, struct Qdisc *q, · 112 unmodified lines
113113 {
114114 }
115115
116+static inline bool tcf_block_shared(struct tcf_block *block)
117+{
118+ return false;
119+}
120+
116121 static inline struct Qdisc *tcf_block_q(struct tcf_block *block)
117122 {
118123 return NULL;
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/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/bpf.h+23−5
@@ -1857,7 +1857,8 @@ union bpf_attr { · 1856 unmodified lines
18571857 * is resolved), the nexthop address is returned in ipv4_dst
18581858 * or ipv6_dst based on family, smac is set to mac address of
18591859 * egress device, dmac is set to nexthop mac address, rt_metric
1860− * is set to metric from route (IPv4/IPv6 only).
1860+ * is set to metric from route (IPv4/IPv6 only), and ifindex
1861+ * is set to the device index of the nexthop from the FIB lookup.
18611862 *
18621863 * *plen* argument is the size of the passed in struct.
18631864 * *flags* argument can be a combination of one or more of the
@@ -1873,9 +1874,10 @@ union bpf_attr { · 9 unmodified lines
18731874 * *ctx* is either **struct xdp_md** for XDP programs or
18741875 * **struct sk_buff** tc cls_act programs.
18751876 * Return
1876− * Egress device index on success, 0 if packet needs to continue
1877− * up the stack for further processing or a negative error in case
1878− * of failure.
1877+ * * < 0 if any input argument is invalid
1878+ * * 0 on success (packet is forwarded, nexthop neighbor exists)
1879+ * * > 0 one of **BPF_FIB_LKUP_RET_** codes explaining why the
1880+ * * packet is not forwarded or needs assist from full stack
18791881 *
18801882 * int bpf_sock_hash_update(struct bpf_sock_ops_kern *skops, struct bpf_map *map, void *key, u64 flags)
18811883 * Description
@@ -2612,6 +2614,18 @@ struct bpf_raw_tracepoint_args { · 730 unmodified lines
26122614 #define BPF_FIB_LOOKUP_DIRECT BIT(0)
26132615 #define BPF_FIB_LOOKUP_OUTPUT BIT(1)
26142616
2617+enum {
2618+ BPF_FIB_LKUP_RET_SUCCESS, /* lookup successful */
2619+ BPF_FIB_LKUP_RET_BLACKHOLE, /* dest is blackholed; can be dropped */
2620+ BPF_FIB_LKUP_RET_UNREACHABLE, /* dest is unreachable; can be dropped */
2621+ BPF_FIB_LKUP_RET_PROHIBIT, /* dest not allowed; can be dropped */
2622+ BPF_FIB_LKUP_RET_NOT_FWDED, /* packet is not forwarded */
2623+ BPF_FIB_LKUP_RET_FWD_DISABLED, /* fwding is not enabled on ingress */
2624+ BPF_FIB_LKUP_RET_UNSUPP_LWT, /* fwd requires encapsulation */
2625+ BPF_FIB_LKUP_RET_NO_NEIGH, /* no neighbor entry for nh */
2626+ BPF_FIB_LKUP_RET_FRAG_NEEDED, /* fragmentation required to fwd */
2627+};
2628+
26152629 struct bpf_fib_lookup {
26162630 /* input: network family for lookup (AF_INET, AF_INET6)
26172631 * output: network family of egress nexthop
@@ -2625,7 +2639,11 @@ struct bpf_fib_lookup { · 7 unmodified lines
26252639
26262640 /* total length of packet from network header - used for MTU check */
26272641 __u16 tot_len;
2628− __u32 ifindex; /* L3 device index for lookup */
2642+
2643+ /* input: L3 device index for lookup
2644+ * output: device index from FIB lookup
2645+ */
2646+ __u32 ifindex;
26292647
26302648 union {
26312649 /* inputs to lookup */
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 };
init/Kconfig+3−4
@@ -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
kernel/bpf/cgroup.c+54−0
@@ -428,6 +428,60 @@ int __cgroup_bpf_query(struct cgroup *cgrp, const union bpf_attr *attr, · 427 unmodified lines
428428 return ret;
429429 }
430430
431+int cgroup_bpf_prog_attach(const union bpf_attr *attr,
432+ enum bpf_prog_type ptype, struct bpf_prog *prog)
433+{
434+ struct cgroup *cgrp;
435+ int ret;
436+
437+ cgrp = cgroup_get_from_fd(attr->target_fd);
438+ if (IS_ERR(cgrp))
439+ return PTR_ERR(cgrp);
440+
441+ ret = cgroup_bpf_attach(cgrp, prog, attr->attach_type,
442+ attr->attach_flags);
443+ cgroup_put(cgrp);
444+ return ret;
445+}
446+
447+int cgroup_bpf_prog_detach(const union bpf_attr *attr, enum bpf_prog_type ptype)
448+{
449+ struct bpf_prog *prog;
450+ struct cgroup *cgrp;
451+ int ret;
452+
453+ cgrp = cgroup_get_from_fd(attr->target_fd);
454+ if (IS_ERR(cgrp))
455+ return PTR_ERR(cgrp);
456+
457+ prog = bpf_prog_get_type(attr->attach_bpf_fd, ptype);
458+ if (IS_ERR(prog))
459+ prog = NULL;
460+
461+ ret = cgroup_bpf_detach(cgrp, prog, attr->attach_type, 0);
462+ if (prog)
463+ bpf_prog_put(prog);
464+
465+ cgroup_put(cgrp);
466+ return ret;
467+}
468+
469+int cgroup_bpf_prog_query(const union bpf_attr *attr,
470+ union bpf_attr __user *uattr)
471+{
472+ struct cgroup *cgrp;
473+ int ret;
474+
475+ cgrp = cgroup_get_from_fd(attr->query.target_fd);
476+ if (IS_ERR(cgrp))
477+ return PTR_ERR(cgrp);
478+
479+ ret = cgroup_bpf_query(cgrp, attr, uattr);
480+
481+ cgroup_put(cgrp);
482+ return ret;
483+}
484+
431485 /**
432486 * __cgroup_bpf_run_filter_skb() - Run a program for packet filtering
433487 * @sk: The socket sending or receiving traffic
kernel/bpf/core.c+1−29
@@ -598,8 +598,6 @@ bpf_jit_binary_alloc(unsigned int proglen, u8 **image_ptr, · 597 unmodified lines
598598 bpf_fill_ill_insns(hdr, size);
599599
600600 hdr->pages = size / PAGE_SIZE;
601− hdr->locked = 0;
602−
603601 hole = min_t(unsigned int, size - (proglen + sizeof(*hdr)),
604602 PAGE_SIZE - sizeof(*hdr));
605603 start = (get_random_int() % hole) & ~(alignment - 1);
@@ -1450,22 +1448,6 @@ static int bpf_check_tail_call(const struct bpf_prog *fp) · 844 unmodified lines
14501448 return 0;
14511449 }
14521450
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−
14691451 static void bpf_prog_select_func(struct bpf_prog *fp)
14701452 {
14711453 #ifndef CONFIG_BPF_JIT_ALWAYS_ON
@@ -1524,17 +1506,7 @@ finalize: · 52 unmodified lines
15241506 * all eBPF JITs might immediately support all features.
15251507 */
15261508 *err = bpf_check_tail_call(fp);
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);
1509+
15381510 return fp;
15391511 }
15401512 EXPORT_SYMBOL_GPL(bpf_prog_select_runtime);
kernel/bpf/sockmap.c+184−70
@@ -72,6 +72,7 @@ struct bpf_htab { · 71 unmodified lines
7272 u32 n_buckets;
7373 u32 elem_size;
7474 struct bpf_sock_progs progs;
75+ struct rcu_head rcu;
7576 };
7677
7778 struct htab_elem {
@@ -89,8 +90,8 @@ enum smap_psock_state { · 11 unmodified lines
8990 struct smap_psock_map_entry {
9091 struct list_head list;
9192 struct sock **entry;
92− struct htab_elem *hash_link;
93− struct bpf_htab *htab;
93+ struct htab_elem __rcu *hash_link;
94+ struct bpf_htab __rcu *htab;
9495 };
9596
9697 struct smap_psock {
@@ -120,6 +121,7 @@ struct smap_psock { · 23 unmodified lines
120121 struct bpf_prog *bpf_parse;
121122 struct bpf_prog *bpf_verdict;
122123 struct list_head maps;
124+ spinlock_t maps_lock;
123125
124126 /* Back reference used when sock callback trigger sockmap operations */
125127 struct sock *sock;
@@ -140,6 +142,7 @@ static int bpf_tcp_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, · 14 unmodified lines
140142 static int bpf_tcp_sendmsg(struct sock *sk, struct msghdr *msg, size_t size);
141143 static int bpf_tcp_sendpage(struct sock *sk, struct page *page,
142144 int offset, size_t size, int flags);
145+static void bpf_tcp_close(struct sock *sk, long timeout);
143146
144147 static inline struct smap_psock *smap_psock_sk(const struct sock *sk)
145148 {
@@ -161,7 +164,42 @@ out: · 15 unmodified lines
161164 return !empty;
162165 }
163166
164−static struct proto tcp_bpf_proto;
167+enum {
168+ SOCKMAP_IPV4,
169+ SOCKMAP_IPV6,
170+ SOCKMAP_NUM_PROTS,
171+};
172+
173+enum {
174+ SOCKMAP_BASE,
175+ SOCKMAP_TX,
176+ SOCKMAP_NUM_CONFIGS,
177+};
178+
179+static struct proto *saved_tcpv6_prot __read_mostly;
180+static DEFINE_SPINLOCK(tcpv6_prot_lock);
181+static struct proto bpf_tcp_prots[SOCKMAP_NUM_PROTS][SOCKMAP_NUM_CONFIGS];
182+static void build_protos(struct proto prot[SOCKMAP_NUM_CONFIGS],
183+ struct proto *base)
184+{
185+ prot[SOCKMAP_BASE] = *base;
186+ prot[SOCKMAP_BASE].close = bpf_tcp_close;
187+ prot[SOCKMAP_BASE].recvmsg = bpf_tcp_recvmsg;
188+ prot[SOCKMAP_BASE].stream_memory_read = bpf_tcp_stream_read;
189+
190+ prot[SOCKMAP_TX] = prot[SOCKMAP_BASE];
191+ prot[SOCKMAP_TX].sendmsg = bpf_tcp_sendmsg;
192+ prot[SOCKMAP_TX].sendpage = bpf_tcp_sendpage;
193+}
194+
195+static void update_sk_prot(struct sock *sk, struct smap_psock *psock)
196+{
197+ int family = sk->sk_family == AF_INET6 ? SOCKMAP_IPV6 : SOCKMAP_IPV4;
198+ int conf = psock->bpf_tx_msg ? SOCKMAP_TX : SOCKMAP_BASE;
199+
200+ sk->sk_prot = &bpf_tcp_prots[family][conf];
201+}
202+
165203 static int bpf_tcp_init(struct sock *sk)
166204 {
167205 struct smap_psock *psock;
@@ -181,14 +219,17 @@ static int bpf_tcp_init(struct sock *sk) · 13 unmodified lines
181219 psock->save_close = sk->sk_prot->close;
182220 psock->sk_proto = sk->sk_prot;
183221
184− if (psock->bpf_tx_msg) {
185− tcp_bpf_proto.sendmsg = bpf_tcp_sendmsg;
186− tcp_bpf_proto.sendpage = bpf_tcp_sendpage;
187− tcp_bpf_proto.recvmsg = bpf_tcp_recvmsg;
188− tcp_bpf_proto.stream_memory_read = bpf_tcp_stream_read;
222+ /* Build IPv6 sockmap whenever the address of tcpv6_prot changes */
223+ if (sk->sk_family == AF_INET6 &&
224+ unlikely(sk->sk_prot != smp_load_acquire(&saved_tcpv6_prot))) {
225+ spin_lock_bh(&tcpv6_prot_lock);
226+ if (likely(sk->sk_prot != saved_tcpv6_prot)) {
227+ build_protos(bpf_tcp_prots[SOCKMAP_IPV6], sk->sk_prot);
228+ smp_store_release(&saved_tcpv6_prot, sk->sk_prot);
229+ }
230+ spin_unlock_bh(&tcpv6_prot_lock);
189231 }
190−
191− sk->sk_prot = &tcp_bpf_proto;
232+ update_sk_prot(sk, psock);
192233 rcu_read_unlock();
193234 return 0;
194235 }
@@ -219,16 +260,54 @@ out: · 24 unmodified lines
219260 rcu_read_unlock();
220261 }
221262
263+static struct htab_elem *lookup_elem_raw(struct hlist_head *head,
264+ u32 hash, void *key, u32 key_size)
265+{
266+ struct htab_elem *l;
267+
268+ hlist_for_each_entry_rcu(l, head, hash_node) {
269+ if (l->hash == hash && !memcmp(&l->key, key, key_size))
270+ return l;
271+ }
272+
273+ return NULL;
274+}
275+
276+static inline struct bucket *__select_bucket(struct bpf_htab *htab, u32 hash)
277+{
278+ return &htab->buckets[hash & (htab->n_buckets - 1)];
279+}
280+
281+static inline struct hlist_head *select_bucket(struct bpf_htab *htab, u32 hash)
282+{
283+ return &__select_bucket(htab, hash)->head;
284+}
285+
222286 static void free_htab_elem(struct bpf_htab *htab, struct htab_elem *l)
223287 {
224288 atomic_dec(&htab->count);
225289 kfree_rcu(l, rcu);
226290 }
227291
292+static struct smap_psock_map_entry *psock_map_pop(struct sock *sk,
293+ struct smap_psock *psock)
294+{
295+ struct smap_psock_map_entry *e;
296+
297+ spin_lock_bh(&psock->maps_lock);
298+ e = list_first_entry_or_null(&psock->maps,
299+ struct smap_psock_map_entry,
300+ list);
301+ if (e)
302+ list_del(&e->list);
303+ spin_unlock_bh(&psock->maps_lock);
304+ return e;
305+}
306+
228307 static void bpf_tcp_close(struct sock *sk, long timeout)
229308 {
230309 void (*close_fun)(struct sock *sk, long timeout);
231− struct smap_psock_map_entry *e, *tmp;
310+ struct smap_psock_map_entry *e;
232311 struct sk_msg_buff *md, *mtmp;
233312 struct smap_psock *psock;
234313 struct sock *osk;
@@ -247,7 +326,6 @@ static void bpf_tcp_close(struct sock *sk, long timeout) · 12 unmodified lines
247326 */
248327 close_fun = psock->save_close;
249328
250− write_lock_bh(&sk->sk_callback_lock);
251329 if (psock->cork) {
252330 free_start_sg(psock->sock, psock->cork);
253331 kfree(psock->cork);
@@ -260,20 +338,38 @@ static void bpf_tcp_close(struct sock *sk, long timeout) · 6 unmodified lines
260338 kfree(md);
261339 }
262340
263− list_for_each_entry_safe(e, tmp, &psock->maps, list) {
341+ e = psock_map_pop(sk, psock);
342+ while (e) {
264343 if (e->entry) {
265344 osk = cmpxchg(e->entry, sk, NULL);
266345 if (osk == sk) {
267− list_del(&e->list);
268346 smap_release_sock(psock, sk);
269347 }
270348 } else {
271− hlist_del_rcu(&e->hash_link->hash_node);
272− smap_release_sock(psock, e->hash_link->sk);
273− free_htab_elem(e->htab, e->hash_link);
349+ struct htab_elem *link = rcu_dereference(e->hash_link);
350+ struct bpf_htab *htab = rcu_dereference(e->htab);
351+ struct hlist_head *head;
352+ struct htab_elem *l;
353+ struct bucket *b;
354+
355+ b = __select_bucket(htab, link->hash);
356+ head = &b->head;
357+ raw_spin_lock_bh(&b->lock);
358+ l = lookup_elem_raw(head,
359+ link->hash, link->key,
360+ htab->map.key_size);
361+ /* If another thread deleted this object skip deletion.
362+ * The refcnt on psock may or may not be zero.
363+ */
364+ if (l) {
365+ hlist_del_rcu(&link->hash_node);
366+ smap_release_sock(psock, link->sk);
367+ free_htab_elem(htab, link);
368+ }
369+ raw_spin_unlock_bh(&b->lock);
274370 }
371+ e = psock_map_pop(sk, psock);
275372 }
276− write_unlock_bh(&sk->sk_callback_lock);
277373 rcu_read_unlock();
278374 close_fun(sk, timeout);
279375 }
@@ -1111,8 +1207,7 @@ static void bpf_tcp_msg_add(struct smap_psock *psock, · 831 unmodified lines
11111207
11121208 static int bpf_tcp_ulp_register(void)
11131209 {
1114− tcp_bpf_proto = tcp_prot;
1115− tcp_bpf_proto.close = bpf_tcp_close;
1210+ build_protos(bpf_tcp_prots[SOCKMAP_IPV4], &tcp_prot);
11161211 /* Once BPF TX ULP is registered it is never unregistered. It
11171212 * will be in the ULP list for the lifetime of the system. Doing
11181213 * duplicate registers is not a problem.
@@ -1357,7 +1452,9 @@ static void smap_release_sock(struct smap_psock *psock, struct sock *sock) · 238 unmodified lines
13571452 {
13581453 if (refcount_dec_and_test(&psock->refcnt)) {
13591454 tcp_cleanup_ulp(sock);
1455+ write_lock_bh(&sock->sk_callback_lock);
13601456 smap_stop_sock(psock, sock);
1457+ write_unlock_bh(&sock->sk_callback_lock);
13611458 clear_bit(SMAP_TX_RUNNING, &psock->state);
13621459 rcu_assign_sk_user_data(sock, NULL);
13631460 call_rcu_sched(&psock->rcu, smap_destroy_psock);
@@ -1508,6 +1605,7 @@ static struct smap_psock *smap_init_psock(struct sock *sock, int node) · 144 unmodified lines
15081605 INIT_LIST_HEAD(&psock->maps);
15091606 INIT_LIST_HEAD(&psock->ingress);
15101607 refcount_set(&psock->refcnt, 1);
1608+ spin_lock_init(&psock->maps_lock);
15111609
15121610 rcu_assign_sk_user_data(sock, psock);
15131611 sock_hold(sock);
@@ -1564,18 +1662,32 @@ free_stab: · 50 unmodified lines
15641662 return ERR_PTR(err);
15651663 }
15661664
1567−static void smap_list_remove(struct smap_psock *psock,
1568− struct sock **entry,
1569− struct htab_elem *hash_link)
1665+static void smap_list_map_remove(struct smap_psock *psock,
1666+ struct sock **entry)
15701667 {
15711668 struct smap_psock_map_entry *e, *tmp;
15721669
1670+ spin_lock_bh(&psock->maps_lock);
15731671 list_for_each_entry_safe(e, tmp, &psock->maps, list) {
1574− if (e->entry == entry || e->hash_link == hash_link) {
1672+ if (e->entry == entry)
15751673 list_del(&e->list);
1576− break;
1577− }
15781674 }
1675+ spin_unlock_bh(&psock->maps_lock);
1676+}
1677+
1678+static void smap_list_hash_remove(struct smap_psock *psock,
1679+ struct htab_elem *hash_link)
1680+{
1681+ struct smap_psock_map_entry *e, *tmp;
1682+
1683+ spin_lock_bh(&psock->maps_lock);
1684+ list_for_each_entry_safe(e, tmp, &psock->maps, list) {
1685+ struct htab_elem *c = rcu_dereference(e->hash_link);
1686+
1687+ if (c == hash_link)
1688+ list_del(&e->list);
1689+ }
1690+ spin_unlock_bh(&psock->maps_lock);
15791691 }
15801692
15811693 static void sock_map_free(struct bpf_map *map)
@@ -1601,7 +1713,6 @@ static void sock_map_free(struct bpf_map *map) · 19 unmodified lines
16011713 if (!sock)
16021714 continue;
16031715
1604− write_lock_bh(&sock->sk_callback_lock);
16051716 psock = smap_psock_sk(sock);
16061717 /* This check handles a racing sock event that can get the
16071718 * sk_callback_lock before this case but after xchg happens
@@ -1609,10 +1720,9 @@ static void sock_map_free(struct bpf_map *map) · 1 unmodified line
16091720 * to be null and queued for garbage collection.
16101721 */
16111722 if (likely(psock)) {
1612− smap_list_remove(psock, &stab->sock_map[i], NULL);
1723+ smap_list_map_remove(psock, &stab->sock_map[i]);
16131724 smap_release_sock(psock, sock);
16141725 }
1615− write_unlock_bh(&sock->sk_callback_lock);
16161726 }
16171727 rcu_read_unlock();
16181728
@@ -1661,17 +1771,15 @@ static int sock_map_delete_elem(struct bpf_map *map, void *key) · 42 unmodified lines
16611771 if (!sock)
16621772 return -EINVAL;
16631773
1664− write_lock_bh(&sock->sk_callback_lock);
16651774 psock = smap_psock_sk(sock);
16661775 if (!psock)
16671776 goto out;
16681777
16691778 if (psock->bpf_parse)
16701779 smap_stop_sock(psock, sock);
1671− smap_list_remove(psock, &stab->sock_map[k], NULL);
1780+ smap_list_map_remove(psock, &stab->sock_map[k]);
16721781 smap_release_sock(psock, sock);
16731782 out:
1674− write_unlock_bh(&sock->sk_callback_lock);
16751783 return 0;
16761784 }
16771785
@@ -1752,7 +1860,6 @@ static int __sock_map_ctx_update_elem(struct bpf_map *map, · 74 unmodified lines
17521860 }
17531861 }
17541862
1755− write_lock_bh(&sock->sk_callback_lock);
17561863 psock = smap_psock_sk(sock);
17571864
17581865 /* 2. Do not allow inheriting programs if psock exists and has
@@ -1809,7 +1916,9 @@ static int __sock_map_ctx_update_elem(struct bpf_map *map, · 50 unmodified lines
18091916 if (err)
18101917 goto out_free;
18111918 smap_init_progs(psock, verdict, parse);
1919+ write_lock_bh(&sock->sk_callback_lock);
18121920 smap_start_sock(psock, sock);
1921+ write_unlock_bh(&sock->sk_callback_lock);
18131922 }
18141923
18151924 /* 4. Place psock in sockmap for use and stop any programs on
@@ -1819,9 +1928,10 @@ static int __sock_map_ctx_update_elem(struct bpf_map *map, · 3 unmodified lines
18191928 */
18201929 if (map_link) {
18211930 e->entry = map_link;
1931+ spin_lock_bh(&psock->maps_lock);
18221932 list_add_tail(&e->list, &psock->maps);
1933+ spin_unlock_bh(&psock->maps_lock);
18231934 }
1824− write_unlock_bh(&sock->sk_callback_lock);
18251935 return err;
18261936 out_free:
18271937 smap_release_sock(psock, sock);
@@ -1832,7 +1942,6 @@ out_progs: · 4 unmodified lines
18321942 }
18331943 if (tx_msg)
18341944 bpf_prog_put(tx_msg);
1835− write_unlock_bh(&sock->sk_callback_lock);
18361945 kfree(e);
18371946 return err;
18381947 }
@@ -1869,10 +1978,8 @@ static int sock_map_ctx_update_elem(struct bpf_sock_ops_kern *skops, · 30 unmodified lines
18691978 if (osock) {
18701979 struct smap_psock *opsock = smap_psock_sk(osock);
18711980
1872− write_lock_bh(&osock->sk_callback_lock);
1873− smap_list_remove(opsock, &stab->sock_map[i], NULL);
1981+ smap_list_map_remove(opsock, &stab->sock_map[i]);
18741982 smap_release_sock(opsock, osock);
1875− write_unlock_bh(&osock->sk_callback_lock);
18761983 }
18771984 out:
18781985 return err;
@@ -1915,6 +2022,24 @@ int sock_map_prog(struct bpf_map *map, struct bpf_prog *prog, u32 type) · 36 unmodified lines
19152022 return 0;
19162023 }
19172024
2025+int sockmap_get_from_fd(const union bpf_attr *attr, int type,
2026+ struct bpf_prog *prog)
2027+{
2028+ int ufd = attr->target_fd;
2029+ struct bpf_map *map;
2030+ struct fd f;
2031+ int err;
2032+
2033+ f = fdget(ufd);
2034+ map = __bpf_map_get(f);
2035+ if (IS_ERR(map))
2036+ return PTR_ERR(map);
2037+
2038+ err = sock_map_prog(map, prog, attr->attach_type);
2039+ fdput(f);
2040+ return err;
2041+}
2042+
19182043 static void *sock_map_lookup(struct bpf_map *map, void *key)
19192044 {
19202045 return NULL;
@@ -2043,14 +2168,13 @@ free_htab: · 122 unmodified lines
20432168 return ERR_PTR(err);
20442169 }
20452170
2046−static inline struct bucket *__select_bucket(struct bpf_htab *htab, u32 hash)
2171+static void __bpf_htab_free(struct rcu_head *rcu)
20472172 {
2048− return &htab->buckets[hash & (htab->n_buckets - 1)];
2049−}
2173+ struct bpf_htab *htab;
20502174
2051−static inline struct hlist_head *select_bucket(struct bpf_htab *htab, u32 hash)
2052−{
2053− return &__select_bucket(htab, hash)->head;
2175+ htab = container_of(rcu, struct bpf_htab, rcu);
2176+ bpf_map_area_free(htab->buckets);
2177+ kfree(htab);
20542178 }
20552179
20562180 static void sock_hash_free(struct bpf_map *map)
@@ -2069,16 +2193,18 @@ static void sock_hash_free(struct bpf_map *map) · 12 unmodified lines
20692193 */
20702194 rcu_read_lock();
20712195 for (i = 0; i < htab->n_buckets; i++) {
2072− struct hlist_head *head = select_bucket(htab, i);
2196+ struct bucket *b = __select_bucket(htab, i);
2197+ struct hlist_head *head;
20732198 struct hlist_node *n;
20742199 struct htab_elem *l;
20752200
2201+ raw_spin_lock_bh(&b->lock);
2202+ head = &b->head;
20762203 hlist_for_each_entry_safe(l, n, head, hash_node) {
20772204 struct sock *sock = l->sk;
20782205 struct smap_psock *psock;
20792206
20802207 hlist_del_rcu(&l->hash_node);
2081− write_lock_bh(&sock->sk_callback_lock);
20822208 psock = smap_psock_sk(sock);
20832209 /* This check handles a racing sock event that can get
20842210 * the sk_callback_lock before this case but after xchg
@@ -2086,16 +2212,15 @@ static void sock_hash_free(struct bpf_map *map) · 1 unmodified line
20862212 * (psock) to be null and queued for garbage collection.
20872213 */
20882214 if (likely(psock)) {
2089− smap_list_remove(psock, NULL, l);
2215+ smap_list_hash_remove(psock, l);
20902216 smap_release_sock(psock, sock);
20912217 }
2092− write_unlock_bh(&sock->sk_callback_lock);
2093− kfree(l);
2218+ free_htab_elem(htab, l);
20942219 }
2220+ raw_spin_unlock_bh(&b->lock);
20952221 }
20962222 rcu_read_unlock();
2097− bpf_map_area_free(htab->buckets);
2098− kfree(htab);
2223+ call_rcu(&htab->rcu, __bpf_htab_free);
20992224 }
21002225
21012226 static struct htab_elem *alloc_sock_hash_elem(struct bpf_htab *htab,
@@ -2122,19 +2247,6 @@ static struct htab_elem *alloc_sock_hash_elem(struct bpf_htab *htab, · 20 unmodified lines
21222247 return l_new;
21232248 }
21242249
2125−static struct htab_elem *lookup_elem_raw(struct hlist_head *head,
2126− u32 hash, void *key, u32 key_size)
2127−{
2128− struct htab_elem *l;
2129−
2130− hlist_for_each_entry_rcu(l, head, hash_node) {
2131− if (l->hash == hash && !memcmp(&l->key, key, key_size))
2132− return l;
2133− }
2134−
2135− return NULL;
2136−}
2137−
21382250 static inline u32 htab_map_hash(const void *key, u32 key_len)
21392251 {
21402252 return jhash(key, key_len, 0);
@@ -2254,9 +2366,12 @@ static int sock_hash_ctx_update_elem(struct bpf_sock_ops_kern *skops, · 113 unmodified lines
22542366 goto bucket_err;
22552367 }
22562368
2257− e->hash_link = l_new;
2258− e->htab = container_of(map, struct bpf_htab, map);
2369+ rcu_assign_pointer(e->hash_link, l_new);
2370+ rcu_assign_pointer(e->htab,
2371+ container_of(map, struct bpf_htab, map));
2372+ spin_lock_bh(&psock->maps_lock);
22592373 list_add_tail(&e->list, &psock->maps);
2374+ spin_unlock_bh(&psock->maps_lock);
22602375
22612376 /* add new element to the head of the list, so that
22622377 * concurrent search will find it before old elem
@@ -2266,7 +2381,7 @@ static int sock_hash_ctx_update_elem(struct bpf_sock_ops_kern *skops, · 3 unmodified lines
22662381 psock = smap_psock_sk(l_old->sk);
22672382
22682383 hlist_del_rcu(&l_old->hash_node);
2269− smap_list_remove(psock, NULL, l_old);
2384+ smap_list_hash_remove(psock, l_old);
22702385 smap_release_sock(psock, l_old->sk);
22712386 free_htab_elem(htab, l_old);
22722387 }
@@ -2326,7 +2441,6 @@ static int sock_hash_delete_elem(struct bpf_map *map, void *key) · 53 unmodified lines
23262441 struct smap_psock *psock;
23272442
23282443 hlist_del_rcu(&l->hash_node);
2329− write_lock_bh(&sock->sk_callback_lock);
23302444 psock = smap_psock_sk(sock);
23312445 /* This check handles a racing sock event that can get the
23322446 * sk_callback_lock before this case but after xchg happens
@@ -2334,10 +2448,9 @@ static int sock_hash_delete_elem(struct bpf_map *map, void *key) · 1 unmodified line
23342448 * to be null and queued for garbage collection.
23352449 */
23362450 if (likely(psock)) {
2337− smap_list_remove(psock, NULL, l);
2451+ smap_list_hash_remove(psock, l);
23382452 smap_release_sock(psock, sock);
23392453 }
2340− write_unlock_bh(&sock->sk_callback_lock);
23412454 free_htab_elem(htab, l);
23422455 ret = 0;
23432456 }
@@ -2383,6 +2496,7 @@ const struct bpf_map_ops sock_hash_ops = { · 39 unmodified lines
23832496 .map_get_next_key = sock_hash_get_next_key,
23842497 .map_update_elem = sock_hash_update_elem,
23852498 .map_delete_elem = sock_hash_delete_elem,
2499+ .map_release_uref = sock_map_release,
23862500 };
23872501
23882502 BPF_CALL_4(bpf_sock_map_update, struct bpf_sock_ops_kern *, bpf_sock,
kernel/bpf/syscall.c+21−78
@@ -1483,8 +1483,6 @@ out_free_tp: · 1482 unmodified lines
14831483 return err;
14841484 }
14851485
1486−#ifdef CONFIG_CGROUP_BPF
1487−
14881486 static int bpf_prog_attach_check_attach_type(const struct bpf_prog *prog,
14891487 enum bpf_attach_type attach_type)
14901488 {
@@ -1499,40 +1497,6 @@ static int bpf_prog_attach_check_attach_type(const struct bpf_prog *prog, · 8 unmodified lines
14991497
15001498 #define BPF_PROG_ATTACH_LAST_FIELD attach_flags
15011499
1502−static int sockmap_get_from_fd(const union bpf_attr *attr,
1503− int type, bool attach)
1504−{
1505− struct bpf_prog *prog = NULL;
1506− int ufd = attr->target_fd;
1507− struct bpf_map *map;
1508− struct fd f;
1509− int err;
1510−
1511− f = fdget(ufd);
1512− map = __bpf_map_get(f);
1513− if (IS_ERR(map))
1514− return PTR_ERR(map);
1515−
1516− if (attach) {
1517− prog = bpf_prog_get_type(attr->attach_bpf_fd, type);
1518− if (IS_ERR(prog)) {
1519− fdput(f);
1520− return PTR_ERR(prog);
1521− }
1522− }
1523−
1524− err = sock_map_prog(map, prog, attr->attach_type);
1525− if (err) {
1526− fdput(f);
1527− if (prog)
1528− bpf_prog_put(prog);
1529− return err;
1530− }
1531−
1532− fdput(f);
1533− return 0;
1534−}
1535−
15361500 #define BPF_F_ATTACH_MASK \
15371501 (BPF_F_ALLOW_OVERRIDE | BPF_F_ALLOW_MULTI)
15381502
@@ -1540,7 +1504,6 @@ static int bpf_prog_attach(const union bpf_attr *attr) · 1 unmodified line
15401504 {
15411505 enum bpf_prog_type ptype;
15421506 struct bpf_prog *prog;
1543− struct cgroup *cgrp;
15441507 int ret;
15451508
15461509 if (!capable(CAP_NET_ADMIN))
@@ -1577,12 +1540,15 @@ static int bpf_prog_attach(const union bpf_attr *attr) · 30 unmodified lines
15771540 ptype = BPF_PROG_TYPE_CGROUP_DEVICE;
15781541 break;
15791542 case BPF_SK_MSG_VERDICT:
1580− return sockmap_get_from_fd(attr, BPF_PROG_TYPE_SK_MSG, true);
1543+ ptype = BPF_PROG_TYPE_SK_MSG;
1544+ break;
15811545 case BPF_SK_SKB_STREAM_PARSER:
15821546 case BPF_SK_SKB_STREAM_VERDICT:
1583− return sockmap_get_from_fd(attr, BPF_PROG_TYPE_SK_SKB, true);
1547+ ptype = BPF_PROG_TYPE_SK_SKB;
1548+ break;
15841549 case BPF_LIRC_MODE2:
1585− return lirc_prog_attach(attr);
1550+ ptype = BPF_PROG_TYPE_LIRC_MODE2;
1551+ break;
15861552 default:
15871553 return -EINVAL;
15881554 }
@@ -1596,18 +1562,20 @@ static int bpf_prog_attach(const union bpf_attr *attr) · 7 unmodified lines
15961562 return -EINVAL;
15971563 }
15981564
1599− cgrp = cgroup_get_from_fd(attr->target_fd);
1600− if (IS_ERR(cgrp)) {
1601− bpf_prog_put(prog);
1602− return PTR_ERR(cgrp);
1565+ switch (ptype) {
1566+ case BPF_PROG_TYPE_SK_SKB:
1567+ case BPF_PROG_TYPE_SK_MSG:
1568+ ret = sockmap_get_from_fd(attr, ptype, prog);
1569+ break;
1570+ case BPF_PROG_TYPE_LIRC_MODE2:
1571+ ret = lirc_prog_attach(attr, prog);
1572+ break;
1573+ default:
1574+ ret = cgroup_bpf_prog_attach(attr, ptype, prog);
16031575 }
16041576
1605− ret = cgroup_bpf_attach(cgrp, prog, attr->attach_type,
1606− attr->attach_flags);
16071577 if (ret)
16081578 bpf_prog_put(prog);
1609− cgroup_put(cgrp);
1610−
16111579 return ret;
16121580 }
16131581
@@ -1616,9 +1584,6 @@ static int bpf_prog_attach(const union bpf_attr *attr) · 2 unmodified lines
16161584 static int bpf_prog_detach(const union bpf_attr *attr)
16171585 {
16181586 enum bpf_prog_type ptype;
1619− struct bpf_prog *prog;
1620− struct cgroup *cgrp;
1621− int ret;
16221587
16231588 if (!capable(CAP_NET_ADMIN))
16241589 return -EPERM;
@@ -1651,29 +1616,17 @@ static int bpf_prog_detach(const union bpf_attr *attr) · 26 unmodified lines
16511616 ptype = BPF_PROG_TYPE_CGROUP_DEVICE;
16521617 break;
16531618 case BPF_SK_MSG_VERDICT:
1654− return sockmap_get_from_fd(attr, BPF_PROG_TYPE_SK_MSG, false);
1619+ return sockmap_get_from_fd(attr, BPF_PROG_TYPE_SK_MSG, NULL);
16551620 case BPF_SK_SKB_STREAM_PARSER:
16561621 case BPF_SK_SKB_STREAM_VERDICT:
1657− return sockmap_get_from_fd(attr, BPF_PROG_TYPE_SK_SKB, false);
1622+ return sockmap_get_from_fd(attr, BPF_PROG_TYPE_SK_SKB, NULL);
16581623 case BPF_LIRC_MODE2:
16591624 return lirc_prog_detach(attr);
16601625 default:
16611626 return -EINVAL;
16621627 }
16631628
1664− cgrp = cgroup_get_from_fd(attr->target_fd);
1665− if (IS_ERR(cgrp))
1666− return PTR_ERR(cgrp);
1667−
1668− prog = bpf_prog_get_type(attr->attach_bpf_fd, ptype);
1669− if (IS_ERR(prog))
1670− prog = NULL;
1671−
1672− ret = cgroup_bpf_detach(cgrp, prog, attr->attach_type, 0);
1673− if (prog)
1674− bpf_prog_put(prog);
1675− cgroup_put(cgrp);
1676− return ret;
1629+ return cgroup_bpf_prog_detach(attr, ptype);
16771630 }
16781631
16791632 #define BPF_PROG_QUERY_LAST_FIELD query.prog_cnt
@@ -1681,9 +1634,6 @@ static int bpf_prog_detach(const union bpf_attr *attr) · 1 unmodified line
16811634 static int bpf_prog_query(const union bpf_attr *attr,
16821635 union bpf_attr __user *uattr)
16831636 {
1684− struct cgroup *cgrp;
1685− int ret;
1686−
16871637 if (!capable(CAP_NET_ADMIN))
16881638 return -EPERM;
16891639 if (CHECK_ATTR(BPF_PROG_QUERY))
@@ -1711,14 +1661,9 @@ static int bpf_prog_query(const union bpf_attr *attr, · 21 unmodified lines
17111661 default:
17121662 return -EINVAL;
17131663 }
1714− cgrp = cgroup_get_from_fd(attr->query.target_fd);
1715− if (IS_ERR(cgrp))
1716− return PTR_ERR(cgrp);
1717− ret = cgroup_bpf_query(cgrp, attr, uattr);
1718− cgroup_put(cgrp);
1719− return ret;
1664+
1665+ return cgroup_bpf_prog_query(attr, uattr);
17201666 }
1721−#endif /* CONFIG_CGROUP_BPF */
17221667
17231668 #define BPF_PROG_TEST_RUN_LAST_FIELD test.duration
17241669
@@ -2365,7 +2310,6 @@ SYSCALL_DEFINE3(bpf, int, cmd, union bpf_attr __user *, uattr, unsigned int, siz · 640 unmodified lines
23652310 case BPF_OBJ_GET:
23662311 err = bpf_obj_get(&attr);
23672312 break;
2368−#ifdef CONFIG_CGROUP_BPF
23692313 case BPF_PROG_ATTACH:
23702314 err = bpf_prog_attach(&attr);
23712315 break;
@@ -2375,7 +2319,6 @@ SYSCALL_DEFINE3(bpf, int, cmd, union bpf_attr __user *, uattr, unsigned int, siz · 3 unmodified lines
23752319 case BPF_PROG_QUERY:
23762320 err = bpf_prog_query(&attr, uattr);
23772321 break;
2378−#endif
23792322 case BPF_PROG_TEST_RUN:
23802323 err = bpf_prog_test_run(&attr, uattr);
23812324 break;
kernel/dma/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/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,
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/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/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_bpf.c+20−0
@@ -5282,21 +5282,31 @@ static struct bpf_test tests[] = { · 5281 unmodified lines
52825282 { /* Mainly checking JIT here. */
52835283 "BPF_MAXINSNS: Ctx heavy transformations",
52845284 { },
5285+#if defined(CONFIG_BPF_JIT_ALWAYS_ON) && defined(CONFIG_S390)
5286+ CLASSIC | FLAG_EXPECTED_FAIL,
5287+#else
52855288 CLASSIC,
5289+#endif
52865290 { },
52875291 {
52885292 { 1, !!(SKB_VLAN_TCI & VLAN_TAG_PRESENT) },
52895293 { 10, !!(SKB_VLAN_TCI & VLAN_TAG_PRESENT) }
52905294 },
52915295 .fill_helper = bpf_fill_maxinsns6,
5296+ .expected_errcode = -ENOTSUPP,
52925297 },
52935298 { /* Mainly checking JIT here. */
52945299 "BPF_MAXINSNS: Call heavy transformations",
52955300 { },
5301+#if defined(CONFIG_BPF_JIT_ALWAYS_ON) && defined(CONFIG_S390)
5302+ CLASSIC | FLAG_NO_DATA | FLAG_EXPECTED_FAIL,
5303+#else
52965304 CLASSIC | FLAG_NO_DATA,
5305+#endif
52975306 { },
52985307 { { 1, 0 }, { 10, 0 } },
52995308 .fill_helper = bpf_fill_maxinsns7,
5309+ .expected_errcode = -ENOTSUPP,
53005310 },
53015311 { /* Mainly checking JIT here. */
53025312 "BPF_MAXINSNS: Jump heavy test",
@@ -5347,18 +5357,28 @@ static struct bpf_test tests[] = { · 44 unmodified lines
53475357 {
53485358 "BPF_MAXINSNS: exec all MSH",
53495359 { },
5360+#if defined(CONFIG_BPF_JIT_ALWAYS_ON) && defined(CONFIG_S390)
5361+ CLASSIC | FLAG_EXPECTED_FAIL,
5362+#else
53505363 CLASSIC,
5364+#endif
53515365 { 0xfa, 0xfb, 0xfc, 0xfd, },
53525366 { { 4, 0xababab83 } },
53535367 .fill_helper = bpf_fill_maxinsns13,
5368+ .expected_errcode = -ENOTSUPP,
53545369 },
53555370 {
53565371 "BPF_MAXINSNS: ld_abs+get_processor_id",
53575372 { },
5373+#if defined(CONFIG_BPF_JIT_ALWAYS_ON) && defined(CONFIG_S390)
5374+ CLASSIC | FLAG_EXPECTED_FAIL,
5375+#else
53585376 CLASSIC,
5377+#endif
53595378 { },
53605379 { { 1, 0xbee } },
53615380 .fill_helper = bpf_fill_ld_abs_get_processor_id,
5381+ .expected_errcode = -ENOTSUPP,
53625382 },
53635383 /*
53645384 * LD_IND / LD_ABS on fragmented SKBs
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/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/8021q/vlan.c+1−1
@@ -694,7 +694,7 @@ static struct sk_buff *vlan_gro_receive(struct list_head *head, · 693 unmodified lines
694694 out_unlock:
695695 rcu_read_unlock();
696696 out:
697− NAPI_GRO_CB(skb)->flush |= flush;
697+ skb_gro_flush_final(skb, pp, flush);
698698
699699 return pp;
700700 }
net/Makefile+0−4
@@ -20,11 +20,7 @@ obj-$(CONFIG_TLS) += tls/ · 19 unmodified lines
2020 obj-$(CONFIG_XFRM) += xfrm/
2121 obj-$(CONFIG_UNIX) += unix/
2222 obj-$(CONFIG_NET) += ipv6/
23−ifneq ($(CC_CAN_LINK),y)
24−$(warning CC cannot link executables. Skipping bpfilter.)
25−else
2623 obj-$(CONFIG_BPFILTER) += bpfilter/
27−endif
2824 obj-$(CONFIG_PACKET) += packet/
2925 obj-$(CONFIG_NET_KEY) += key/
3026 obj-$(CONFIG_BRIDGE) += bridge/
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/common.c+8−3
@@ -647,11 +647,16 @@ out: · 646 unmodified lines
647647 return error;
648648 }
649649
650−__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)
651651 {
652652 struct sock *sk = sock->sk;
653− struct atm_vcc *vcc = ATM_SD(sock);
654− __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);
655660
656661 /* exceptional events */
657662 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/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/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/Kconfig+1−1
@@ -1,6 +1,5 @@
11 menuconfig BPFILTER
22 bool "BPF based packet filtering framework (BPFILTER)"
3− default n
43 depends on NET && BPF && INET
54 help
65 This builds experimental bpfilter framework that is aiming to
@@ -9,6 +8,7 @@ menuconfig BPFILTER · 2 unmodified lines
98 if BPFILTER
109 config BPFILTER_UMH
1110 tristate "bpfilter kernel module with user mode helper"
11+ depends on $(success,$(srctree)/scripts/cc-can-link.sh $(CC))
1212 default m
1313 help
1414 This builds bpfilter kernel module with embedded user mode helper
net/bpfilter/Makefile+2−15
@@ -15,20 +15,7 @@ ifeq ($(CONFIG_BPFILTER_UMH), y) · 14 unmodified lines
1515 HOSTLDFLAGS += -static
1616 endif
1717
18−# a bit of elf magic to convert bpfilter_umh binary into a binary blob
19−# inside bpfilter_umh.o elf file referenced by
20−# _binary_net_bpfilter_bpfilter_umh_start symbol
21−# which bpfilter_kern.c passes further into umh blob loader at run-time
22−quiet_cmd_copy_umh = GEN $@
23− cmd_copy_umh = echo ':' > $(obj)/.bpfilter_umh.o.cmd; \
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}'` \
28− --rename-section .data=.init.rodata $< $@
29−
30−$(obj)/bpfilter_umh.o: $(obj)/bpfilter_umh
31− $(call cmd,copy_umh)
18+$(obj)/bpfilter_umh_blob.o: $(obj)/bpfilter_umh
3219
3320 obj-$(CONFIG_BPFILTER_UMH) += bpfilter.o
34−bpfilter-objs += bpfilter_kern.o bpfilter_umh.o
21+bpfilter-objs += bpfilter_kern.o bpfilter_umh_blob.o
net/bpfilter/bpfilter_kern.c+5−6
@@ -10,11 +10,8 @@ · 9 unmodified lines
1010 #include <linux/file.h>
1111 #include "msgfmt.h"
1212
13−#define UMH_start _binary_net_bpfilter_bpfilter_umh_start
14−#define UMH_end _binary_net_bpfilter_bpfilter_umh_end
15−
16−extern char UMH_start;
17−extern char UMH_end;
13+extern char bpfilter_umh_start;
14+extern char bpfilter_umh_end;
1815
1916 static struct umh_info info;
2017 /* since ip_getsockopt() can run in parallel, serialize access to umh */
@@ -93,7 +90,9 @@ static int __init load_umh(void) · 72 unmodified lines
9390 int err;
9491
9592 /* fork usermode process */
96− err = fork_usermode_blob(&UMH_start, &UMH_end - &UMH_start, &info);
93+ err = fork_usermode_blob(&bpfilter_umh_start,
94+ &bpfilter_umh_end - &bpfilter_umh_start,
95+ &info);
9796 if (err)
9897 return err;
9998 pr_info("Loaded bpfilter_umh pid %d\n", info.pid);
net/bpfilter/bpfilter_umh_blob.S+7−0
@@ -0,0 +1,7 @@
1+/* SPDX-License-Identifier: GPL-2.0 */
2+ .section .init.rodata, "a"
3+ .global bpfilter_umh_start
4+bpfilter_umh_start:
5+ .incbin "net/bpfilter/bpfilter_umh"
6+ .global bpfilter_umh_end
7+bpfilter_umh_end:
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_ioctl.c+2−9
@@ -285,16 +285,9 @@ static int dev_ifsioc(struct net *net, struct ifreq *ifr, unsigned int cmd) · 284 unmodified lines
285285 if (ifr->ifr_qlen < 0)
286286 return -EINVAL;
287287 if (dev->tx_queue_len ^ ifr->ifr_qlen) {
288− unsigned int orig_len = dev->tx_queue_len;
289−
290− dev->tx_queue_len = ifr->ifr_qlen;
291− err = call_netdevice_notifiers(
292− NETDEV_CHANGE_TX_QUEUE_LEN, dev);
293− err = notifier_to_errno(err);
294− if (err) {
295− dev->tx_queue_len = orig_len;
288+ err = dev_change_tx_queue_len(dev, ifr->ifr_qlen);
289+ if (err)
296290 return err;
297− }
298291 }
299292 return 0;
300293
net/core/fib_rules.c+79−1
@@ -416,6 +416,14 @@ static struct fib_rule *rule_find(struct fib_rules_ops *ops, · 415 unmodified lines
416416 if (rule->mark && r->mark != rule->mark)
417417 continue;
418418
419+ if (rule->suppress_ifgroup != -1 &&
420+ r->suppress_ifgroup != rule->suppress_ifgroup)
421+ continue;
422+
423+ if (rule->suppress_prefixlen != -1 &&
424+ r->suppress_prefixlen != rule->suppress_prefixlen)
425+ continue;
426+
419427 if (rule->mark_mask && r->mark_mask != rule->mark_mask)
420428 continue;
421429
@@ -436,6 +444,9 @@ static struct fib_rule *rule_find(struct fib_rules_ops *ops, · 14 unmodified lines
436444 if (rule->ip_proto && r->ip_proto != rule->ip_proto)
437445 continue;
438446
447+ if (rule->proto && r->proto != rule->proto)
448+ continue;
449+
439450 if (fib_rule_port_range_set(&rule->sport_range) &&
440451 !fib_rule_port_range_compare(&r->sport_range,
441452 &rule->sport_range))
@@ -645,6 +656,73 @@ errout: · 203 unmodified lines
645656 return err;
646657 }
647658
659+static int rule_exists(struct fib_rules_ops *ops, struct fib_rule_hdr *frh,
660+ struct nlattr **tb, struct fib_rule *rule)
661+{
662+ struct fib_rule *r;
663+
664+ list_for_each_entry(r, &ops->rules_list, list) {
665+ if (r->action != rule->action)
666+ continue;
667+
668+ if (r->table != rule->table)
669+ continue;
670+
671+ if (r->pref != rule->pref)
672+ continue;
673+
674+ if (memcmp(r->iifname, rule->iifname, IFNAMSIZ))
675+ continue;
676+
677+ if (memcmp(r->oifname, rule->oifname, IFNAMSIZ))
678+ continue;
679+
680+ if (r->mark != rule->mark)
681+ continue;
682+
683+ if (r->suppress_ifgroup != rule->suppress_ifgroup)
684+ continue;
685+
686+ if (r->suppress_prefixlen != rule->suppress_prefixlen)
687+ continue;
688+
689+ if (r->mark_mask != rule->mark_mask)
690+ continue;
691+
692+ if (r->tun_id != rule->tun_id)
693+ continue;
694+
695+ if (r->fr_net != rule->fr_net)
696+ continue;
697+
698+ if (r->l3mdev != rule->l3mdev)
699+ continue;
700+
701+ if (!uid_eq(r->uid_range.start, rule->uid_range.start) ||
702+ !uid_eq(r->uid_range.end, rule->uid_range.end))
703+ continue;
704+
705+ if (r->ip_proto != rule->ip_proto)
706+ continue;
707+
708+ if (r->proto != rule->proto)
709+ continue;
710+
711+ if (!fib_rule_port_range_compare(&r->sport_range,
712+ &rule->sport_range))
713+ continue;
714+
715+ if (!fib_rule_port_range_compare(&r->dport_range,
716+ &rule->dport_range))
717+ continue;
718+
719+ if (!ops->compare(r, frh, tb))
720+ continue;
721+ return 1;
722+ }
723+ return 0;
724+}
725+
648726 int fib_nl_newrule(struct sk_buff *skb, struct nlmsghdr *nlh,
649727 struct netlink_ext_ack *extack)
650728 {
@@ -679,7 +757,7 @@ int fib_nl_newrule(struct sk_buff *skb, struct nlmsghdr *nlh, · 28 unmodified lines
679757 goto errout;
680758
681759 if ((nlh->nlmsg_flags & NLM_F_EXCL) &&
682− rule_find(ops, frh, tb, rule, user_priority)) {
760+ rule_exists(ops, frh, tb, rule)) {
683761 err = -EEXIST;
684762 goto errout_free;
685763 }
net/core/filter.c+54−32
@@ -4073,8 +4073,9 @@ static int bpf_fib_set_fwd_params(struct bpf_fib_lookup *params, · 4072 unmodified lines
40734073 memcpy(params->smac, dev->dev_addr, ETH_ALEN);
40744074 params->h_vlan_TCI = 0;
40754075 params->h_vlan_proto = 0;
4076+ params->ifindex = dev->ifindex;
40764077
4077− return dev->ifindex;
4078+ return 0;
40784079 }
40794080 #endif
40804081
@@ -4098,7 +4099,7 @@ static int bpf_ipv4_fib_lookup(struct net *net, struct bpf_fib_lookup *params, · 17 unmodified lines
40984099 /* verify forwarding is enabled on this interface */
40994100 in_dev = __in_dev_get_rcu(dev);
41004101 if (unlikely(!in_dev || !IN_DEV_FORWARD(in_dev)))
4101− return 0;
4102+ return BPF_FIB_LKUP_RET_FWD_DISABLED;
41024103
41034104 if (flags & BPF_FIB_LOOKUP_OUTPUT) {
41044105 fl4.flowi4_iif = 1;
@@ -4123,7 +4124,7 @@ static int bpf_ipv4_fib_lookup(struct net *net, struct bpf_fib_lookup *params, · 18 unmodified lines
41234124
41244125 tb = fib_get_table(net, tbid);
41254126 if (unlikely(!tb))
4126− return 0;
4127+ return BPF_FIB_LKUP_RET_NOT_FWDED;
41274128
41284129 err = fib_table_lookup(tb, &fl4, &res, FIB_LOOKUP_NOREF);
41294130 } else {
@@ -4135,8 +4136,20 @@ static int bpf_ipv4_fib_lookup(struct net *net, struct bpf_fib_lookup *params, · 5 unmodified lines
41354136 err = fib_lookup(net, &fl4, &res, FIB_LOOKUP_NOREF);
41364137 }
41374138
4138− if (err || res.type != RTN_UNICAST)
4139− return 0;
4139+ if (err) {
4140+ /* map fib lookup errors to RTN_ type */
4141+ if (err == -EINVAL)
4142+ return BPF_FIB_LKUP_RET_BLACKHOLE;
4143+ if (err == -EHOSTUNREACH)
4144+ return BPF_FIB_LKUP_RET_UNREACHABLE;
4145+ if (err == -EACCES)
4146+ return BPF_FIB_LKUP_RET_PROHIBIT;
4147+
4148+ return BPF_FIB_LKUP_RET_NOT_FWDED;
4149+ }
4150+
4151+ if (res.type != RTN_UNICAST)
4152+ return BPF_FIB_LKUP_RET_NOT_FWDED;
41404153
41414154 if (res.fi->fib_nhs > 1)
41424155 fib_select_path(net, &res, &fl4, NULL);
@@ -4144,19 +4157,16 @@ static int bpf_ipv4_fib_lookup(struct net *net, struct bpf_fib_lookup *params, · 1 unmodified line
41444157 if (check_mtu) {
41454158 mtu = ip_mtu_from_fib_result(&res, params->ipv4_dst);
41464159 if (params->tot_len > mtu)
4147− return 0;
4160+ return BPF_FIB_LKUP_RET_FRAG_NEEDED;
41484161 }
41494162
41504163 nh = &res.fi->fib_nh[res.nh_sel];
41514164
41524165 /* do not handle lwt encaps right now */
41534166 if (nh->nh_lwtstate)
4154− return 0;
4167+ return BPF_FIB_LKUP_RET_UNSUPP_LWT;
41554168
41564169 dev = nh->nh_dev;
4157− if (unlikely(!dev))
4158− return 0;
4159−
41604170 if (nh->nh_gw)
41614171 params->ipv4_dst = nh->nh_gw;
41624172
@@ -4166,10 +4176,10 @@ static int bpf_ipv4_fib_lookup(struct net *net, struct bpf_fib_lookup *params, · 3 unmodified lines
41664176 * rcu_read_lock_bh is not needed here
41674177 */
41684178 neigh = __ipv4_neigh_lookup_noref(dev, (__force u32)params->ipv4_dst);
4169− if (neigh)
4170− return bpf_fib_set_fwd_params(params, neigh, dev);
4179+ if (!neigh)
4180+ return BPF_FIB_LKUP_RET_NO_NEIGH;
41714181
4172− return 0;
4182+ return bpf_fib_set_fwd_params(params, neigh, dev);
41734183 }
41744184 #endif
41754185
@@ -4190,7 +4200,7 @@ static int bpf_ipv6_fib_lookup(struct net *net, struct bpf_fib_lookup *params, · 14 unmodified lines
41904200
41914201 /* link local addresses are never forwarded */
41924202 if (rt6_need_strict(dst) || rt6_need_strict(src))
4193− return 0;
4203+ return BPF_FIB_LKUP_RET_NOT_FWDED;
41944204
41954205 dev = dev_get_by_index_rcu(net, params->ifindex);
41964206 if (unlikely(!dev))
@@ -4198,7 +4208,7 @@ static int bpf_ipv6_fib_lookup(struct net *net, struct bpf_fib_lookup *params, · 1 unmodified line
41984208
41994209 idev = __in6_dev_get_safely(dev);
42004210 if (unlikely(!idev || !net->ipv6.devconf_all->forwarding))
4201− return 0;
4211+ return BPF_FIB_LKUP_RET_FWD_DISABLED;
42024212
42034213 if (flags & BPF_FIB_LOOKUP_OUTPUT) {
42044214 fl6.flowi6_iif = 1;
@@ -4225,7 +4235,7 @@ static int bpf_ipv6_fib_lookup(struct net *net, struct bpf_fib_lookup *params, · 20 unmodified lines
42254235
42264236 tb = ipv6_stub->fib6_get_table(net, tbid);
42274237 if (unlikely(!tb))
4228− return 0;
4238+ return BPF_FIB_LKUP_RET_NOT_FWDED;
42294239
42304240 f6i = ipv6_stub->fib6_table_lookup(net, tb, oif, &fl6, strict);
42314241 } else {
@@ -4238,11 +4248,23 @@ static int bpf_ipv6_fib_lookup(struct net *net, struct bpf_fib_lookup *params, · 6 unmodified lines
42384248 }
42394249
42404250 if (unlikely(IS_ERR_OR_NULL(f6i) || f6i == net->ipv6.fib6_null_entry))
4241− return 0;
4251+ return BPF_FIB_LKUP_RET_NOT_FWDED;
4252+
4253+ if (unlikely(f6i->fib6_flags & RTF_REJECT)) {
4254+ switch (f6i->fib6_type) {
4255+ case RTN_BLACKHOLE:
4256+ return BPF_FIB_LKUP_RET_BLACKHOLE;
4257+ case RTN_UNREACHABLE:
4258+ return BPF_FIB_LKUP_RET_UNREACHABLE;
4259+ case RTN_PROHIBIT:
4260+ return BPF_FIB_LKUP_RET_PROHIBIT;
4261+ default:
4262+ return BPF_FIB_LKUP_RET_NOT_FWDED;
4263+ }
4264+ }
42424265
4243− if (unlikely(f6i->fib6_flags & RTF_REJECT ||
4244− f6i->fib6_type != RTN_UNICAST))
4245− return 0;
4266+ if (f6i->fib6_type != RTN_UNICAST)
4267+ return BPF_FIB_LKUP_RET_NOT_FWDED;
42464268
42474269 if (f6i->fib6_nsiblings && fl6.flowi6_oif == 0)
42484270 f6i = ipv6_stub->fib6_multipath_select(net, f6i, &fl6,
@@ -4252,11 +4274,11 @@ static int bpf_ipv6_fib_lookup(struct net *net, struct bpf_fib_lookup *params, · 3 unmodified lines
42524274 if (check_mtu) {
42534275 mtu = ipv6_stub->ip6_mtu_from_fib6(f6i, dst, src);
42544276 if (params->tot_len > mtu)
4255− return 0;
4277+ return BPF_FIB_LKUP_RET_FRAG_NEEDED;
42564278 }
42574279
42584280 if (f6i->fib6_nh.nh_lwtstate)
4259− return 0;
4281+ return BPF_FIB_LKUP_RET_UNSUPP_LWT;
42604282
42614283 if (f6i->fib6_flags & RTF_GATEWAY)
42624284 *dst = f6i->fib6_nh.nh_gw;
@@ -4270,10 +4292,10 @@ static int bpf_ipv6_fib_lookup(struct net *net, struct bpf_fib_lookup *params, · 7 unmodified lines
42704292 */
42714293 neigh = ___neigh_lookup_noref(ipv6_stub->nd_tbl, neigh_key_eq128,
42724294 ndisc_hashfn, dst, dev);
4273− if (neigh)
4274− return bpf_fib_set_fwd_params(params, neigh, dev);
4295+ if (!neigh)
4296+ return BPF_FIB_LKUP_RET_NO_NEIGH;
42754297
4276− return 0;
4298+ return bpf_fib_set_fwd_params(params, neigh, dev);
42774299 }
42784300 #endif
42794301
@@ -4315,7 +4337,7 @@ BPF_CALL_4(bpf_skb_fib_lookup, struct sk_buff *, skb, · 35 unmodified lines
43154337 struct bpf_fib_lookup *, params, int, plen, u32, flags)
43164338 {
43174339 struct net *net = dev_net(skb->dev);
4318− int index = -EAFNOSUPPORT;
4340+ int rc = -EAFNOSUPPORT;
43194341
43204342 if (plen < sizeof(*params))
43214343 return -EINVAL;
@@ -4326,25 +4348,25 @@ BPF_CALL_4(bpf_skb_fib_lookup, struct sk_buff *, skb, · 4 unmodified lines
43264348 switch (params->family) {
43274349 #if IS_ENABLED(CONFIG_INET)
43284350 case AF_INET:
4329− index = bpf_ipv4_fib_lookup(net, params, flags, false);
4351+ rc = bpf_ipv4_fib_lookup(net, params, flags, false);
43304352 break;
43314353 #endif
43324354 #if IS_ENABLED(CONFIG_IPV6)
43334355 case AF_INET6:
4334− index = bpf_ipv6_fib_lookup(net, params, flags, false);
4356+ rc = bpf_ipv6_fib_lookup(net, params, flags, false);
43354357 break;
43364358 #endif
43374359 }
43384360
4339− if (index > 0) {
4361+ if (!rc) {
43404362 struct net_device *dev;
43414363
4342− dev = dev_get_by_index_rcu(net, index);
4364+ dev = dev_get_by_index_rcu(net, params->ifindex);
43434365 if (!is_skb_forwardable(dev, skb))
4344− index = 0;
4366+ rc = BPF_FIB_LKUP_RET_FRAG_NEEDED;
43454367 }
43464368
4347− return index;
4369+ return rc;
43484370 }
43494371
43504372 static const struct bpf_func_proto bpf_skb_fib_lookup_proto = {
net/core/skbuff.c+1−2
@@ -5275,8 +5275,7 @@ struct sk_buff *alloc_skb_with_frags(unsigned long header_len, · 5274 unmodified lines
52755275 if (npages >= 1 << order) {
52765276 page = alloc_pages((gfp_mask & ~__GFP_DIRECT_RECLAIM) |
52775277 __GFP_COMP |
5278− __GFP_NOWARN |
5279− __GFP_NORETRY,
5278+ __GFP_NOWARN,
52805279 order);
52815280 if (page)
52825281 goto fill_page;
net/core/sock.c+5−2
@@ -3247,7 +3247,8 @@ static int req_prot_init(const struct proto *prot) · 3246 unmodified lines
32473247
32483248 rsk_prot->slab = kmem_cache_create(rsk_prot->slab_name,
32493249 rsk_prot->obj_size, 0,
3250− prot->slab_flags, NULL);
3250+ SLAB_ACCOUNT | prot->slab_flags,
3251+ NULL);
32513252
32523253 if (!rsk_prot->slab) {
32533254 pr_crit("%s: Can't create request sock SLAB cache!\n",
@@ -3262,7 +3263,8 @@ int proto_register(struct proto *prot, int alloc_slab) · 8 unmodified lines
32623263 if (alloc_slab) {
32633264 prot->slab = kmem_cache_create_usercopy(prot->name,
32643265 prot->obj_size, 0,
3265− SLAB_HWCACHE_ALIGN | prot->slab_flags,
3266+ SLAB_HWCACHE_ALIGN | SLAB_ACCOUNT |
3267+ prot->slab_flags,
32663268 prot->useroffset, prot->usersize,
32673269 NULL);
32683270
@@ -3285,6 +3287,7 @@ int proto_register(struct proto *prot, int alloc_slab) · 16 unmodified lines
32853287 kmem_cache_create(prot->twsk_prot->twsk_slab_name,
32863288 prot->twsk_prot->twsk_obj_size,
32873289 0,
3290+ SLAB_ACCOUNT |
32883291 prot->slab_flags,
32893292 NULL);
32903293 if (prot->twsk_prot->twsk_slab == NULL)
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/fou.c+1−3
@@ -448,9 +448,7 @@ next_proto: · 447 unmodified lines
448448 out_unlock:
449449 rcu_read_unlock();
450450 out:
451− NAPI_GRO_CB(skb)->flush |= flush;
452− skb_gro_remcsum_cleanup(skb, &grc);
453− skb->remcsum_offload = 0;
451+ skb_gro_flush_final_remcsum(skb, pp, flush, &grc);
454452
455453 return pp;
456454 }
net/ipv4/gre_offload.c+1−1
@@ -223,7 +223,7 @@ static struct sk_buff *gre_gro_receive(struct list_head *head, · 222 unmodified lines
223223 out_unlock:
224224 rcu_read_unlock();
225225 out:
226− NAPI_GRO_CB(skb)->flush |= flush;
226+ skb_gro_flush_final(skb, pp, flush);
227227
228228 return pp;
229229 }
net/ipv4/sysctl_net_ipv4.c+13−5
@@ -265,8 +265,9 @@ static int proc_tcp_fastopen_key(struct ctl_table *table, int write, · 264 unmodified lines
265265 ipv4.sysctl_tcp_fastopen);
266266 struct ctl_table tbl = { .maxlen = (TCP_FASTOPEN_KEY_LENGTH * 2 + 10) };
267267 struct tcp_fastopen_context *ctxt;
268− int ret;
269268 u32 user_key[4]; /* 16 bytes, matching TCP_FASTOPEN_KEY_LENGTH */
269+ __le32 key[4];
270+ int ret, i;
270271
271272 tbl.data = kmalloc(tbl.maxlen, GFP_KERNEL);
272273 if (!tbl.data)
@@ -275,11 +276,14 @@ static int proc_tcp_fastopen_key(struct ctl_table *table, int write, · 2 unmodified lines
275276 rcu_read_lock();
276277 ctxt = rcu_dereference(net->ipv4.tcp_fastopen_ctx);
277278 if (ctxt)
278− memcpy(user_key, ctxt->key, TCP_FASTOPEN_KEY_LENGTH);
279+ memcpy(key, ctxt->key, TCP_FASTOPEN_KEY_LENGTH);
279280 else
280− memset(user_key, 0, sizeof(user_key));
281+ memset(key, 0, sizeof(key));
281282 rcu_read_unlock();
282283
284+ for (i = 0; i < ARRAY_SIZE(key); i++)
285+ user_key[i] = le32_to_cpu(key[i]);
286+
283287 snprintf(tbl.data, tbl.maxlen, "%08x-%08x-%08x-%08x",
284288 user_key[0], user_key[1], user_key[2], user_key[3]);
285289 ret = proc_dostring(&tbl, write, buffer, lenp, ppos);
@@ -290,13 +294,17 @@ static int proc_tcp_fastopen_key(struct ctl_table *table, int write, · 4 unmodified lines
290294 ret = -EINVAL;
291295 goto bad_key;
292296 }
293− tcp_fastopen_reset_cipher(net, NULL, user_key,
297+
298+ for (i = 0; i < ARRAY_SIZE(user_key); i++)
299+ key[i] = cpu_to_le32(user_key[i]);
300+
301+ tcp_fastopen_reset_cipher(net, NULL, key,
294302 TCP_FASTOPEN_KEY_LENGTH);
295303 }
296304
297305 bad_key:
298306 pr_debug("proc FO key set 0x%x-%x-%x-%x <- 0x%s: %u\n",
299− user_key[0], user_key[1], user_key[2], user_key[3],
307+ user_key[0], user_key[1], user_key[2], user_key[3],
300308 (char *)tbl.data, ret);
301309 kfree(tbl.data);
302310 return ret;
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/tcp_input.c+11−2
@@ -266,7 +266,7 @@ static void __tcp_ecn_check_ce(struct sock *sk, const struct sk_buff *skb) · 265 unmodified lines
266266 * it is probably a retransmit.
267267 */
268268 if (tp->ecn_flags & TCP_ECN_SEEN)
269− tcp_enter_quickack_mode(sk, 1);
269+ tcp_enter_quickack_mode(sk, 2);
270270 break;
271271 case INET_ECN_CE:
272272 if (tcp_ca_needs_ecn(sk))
@@ -274,7 +274,7 @@ static void __tcp_ecn_check_ce(struct sock *sk, const struct sk_buff *skb) · 1 unmodified line
274274
275275 if (!(tp->ecn_flags & TCP_ECN_DEMAND_CWR)) {
276276 /* Better not delay acks, sender can have a very low cwnd */
277− tcp_enter_quickack_mode(sk, 1);
277+ tcp_enter_quickack_mode(sk, 2);
278278 tp->ecn_flags |= TCP_ECN_DEMAND_CWR;
279279 }
280280 tp->ecn_flags |= TCP_ECN_SEEN;
@@ -3185,6 +3185,15 @@ static int tcp_clean_rtx_queue(struct sock *sk, u32 prior_fack, · 2904 unmodified lines
31853185
31863186 if (tcp_is_reno(tp)) {
31873187 tcp_remove_reno_sacks(sk, pkts_acked);
3188+
3189+ /* If any of the cumulatively ACKed segments was
3190+ * retransmitted, non-SACK case cannot confirm that
3191+ * progress was due to original transmission due to
3192+ * lack of TCPCB_SACKED_ACKED bits even if some of
3193+ * the packets may have been never retransmitted.
3194+ */
3195+ if (flag & FLAG_RETRANS_DATA_ACKED)
3196+ flag &= ~FLAG_ORIG_SACK_ACKED;
31883197 } else {
31893198 int delta;
31903199
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/ipv4/udp_offload.c+1−1
@@ -395,7 +395,7 @@ unflush: · 394 unmodified lines
395395 out_unlock:
396396 rcu_read_unlock();
397397 out:
398− NAPI_GRO_CB(skb)->flush |= flush;
398+ skb_gro_flush_final(skb, pp, flush);
399399 return pp;
400400 }
401401 EXPORT_SYMBOL(udp_gro_receive);
net/ipv6/addrconf.c+6−3
@@ -4528,6 +4528,7 @@ static int modify_prefix_route(struct inet6_ifaddr *ifp, · 4527 unmodified lines
45284528 unsigned long expires, u32 flags)
45294529 {
45304530 struct fib6_info *f6i;
4531+ u32 prio;
45314532
45324533 f6i = addrconf_get_prefix_route(&ifp->addr,
45334534 ifp->prefix_len,
@@ -4536,13 +4537,15 @@ static int modify_prefix_route(struct inet6_ifaddr *ifp, · 2 unmodified lines
45364537 if (!f6i)
45374538 return -ENOENT;
45384539
4539− if (f6i->fib6_metric != ifp->rt_priority) {
4540+ prio = ifp->rt_priority ? : IP6_RT_PRIO_ADDRCONF;
4541+ if (f6i->fib6_metric != prio) {
4542+ /* delete old one */
4543+ ip6_del_rt(dev_net(ifp->idev->dev), f6i);
4544+
45404545 /* add new one */
45414546 addrconf_prefix_route(&ifp->addr, ifp->prefix_len,
45424547 ifp->rt_priority, ifp->idev->dev,
45434548 expires, flags, GFP_KERNEL);
4544− /* delete old one */
4545− ip6_del_rt(dev_net(ifp->idev->dev), f6i);
45464549 } else {
45474550 if (!expires)
45484551 fib6_clean_expires(f6i);
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/netfilter/nf_conntrack_reasm.c+3−3
@@ -107,7 +107,7 @@ static int nf_ct_frag6_sysctl_register(struct net *net) · 106 unmodified lines
107107 if (hdr == NULL)
108108 goto err_reg;
109109
110− net->nf_frag.sysctl.frags_hdr = hdr;
110+ net->nf_frag_frags_hdr = hdr;
111111 return 0;
112112
113113 err_reg:
@@ -121,8 +121,8 @@ static void __net_exit nf_ct_frags6_sysctl_unregister(struct net *net) · 7 unmodified lines
121121 {
122122 struct ctl_table *table;
123123
124− table = net->nf_frag.sysctl.frags_hdr->ctl_table_arg;
125− unregister_net_sysctl_table(net->nf_frag.sysctl.frags_hdr);
124+ table = net->nf_frag_frags_hdr->ctl_table_arg;
125+ unregister_net_sysctl_table(net->nf_frag_frags_hdr);
126126 if (!net_eq(net, &init_net))
127127 kfree(table);
128128 }
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/ipv6/seg6_hmac.c+1−1
@@ -374,7 +374,7 @@ static int seg6_hmac_init_algo(void) · 373 unmodified lines
374374 return -ENOMEM;
375375
376376 for_each_possible_cpu(cpu) {
377− tfm = crypto_alloc_shash(algo->name, 0, GFP_KERNEL);
377+ tfm = crypto_alloc_shash(algo->name, 0, 0);
378378 if (IS_ERR(tfm))
379379 return PTR_ERR(tfm);
380380 p_tfm = per_cpu_ptr(algo->tfms, cpu);
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
@@ -1844,7 +1844,7 @@ static const struct proto_ops pppol2tp_ops = { · 1843 unmodified lines
18441844 .socketpair = sock_no_socketpair,
18451845 .accept = sock_no_accept,
18461846 .getname = pppol2tp_getname,
1847− .poll_mask = datagram_poll_mask,
1847+ .poll = datagram_poll,
18481848 .listen = sock_no_listen,
18491849 .shutdown = sock_no_shutdown,
18501850 .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/mac80211/tx.c+2−0
@@ -4850,7 +4850,9 @@ int ieee80211_tx_control_port(struct wiphy *wiphy, struct net_device *dev, · 4849 unmodified lines
48504850 skb_reset_network_header(skb);
48514851 skb_reset_mac_header(skb);
48524852
4853+ local_bh_disable();
48534854 __ieee80211_subif_start_xmit(skb, skb->dev, flags);
4855+ local_bh_enable();
48544856
48554857 return 0;
48564858 }
net/netfilter/nf_conncount.c+47−5
@@ -47,6 +47,8 @@ struct nf_conncount_tuple { · 46 unmodified lines
4747 struct hlist_node node;
4848 struct nf_conntrack_tuple tuple;
4949 struct nf_conntrack_zone zone;
50+ int cpu;
51+ u32 jiffies32;
5052 };
5153
5254 struct nf_conncount_rb {
@@ -91,11 +93,42 @@ bool nf_conncount_add(struct hlist_head *head, · 38 unmodified lines
9193 return false;
9294 conn->tuple = *tuple;
9395 conn->zone = *zone;
96+ conn->cpu = raw_smp_processor_id();
97+ conn->jiffies32 = (u32)jiffies;
9498 hlist_add_head(&conn->node, head);
9599 return true;
96100 }
97101 EXPORT_SYMBOL_GPL(nf_conncount_add);
98102
103+static const struct nf_conntrack_tuple_hash *
104+find_or_evict(struct net *net, struct nf_conncount_tuple *conn)
105+{
106+ const struct nf_conntrack_tuple_hash *found;
107+ unsigned long a, b;
108+ int cpu = raw_smp_processor_id();
109+ __s32 age;
110+
111+ found = nf_conntrack_find_get(net, &conn->zone, &conn->tuple);
112+ if (found)
113+ return found;
114+ b = conn->jiffies32;
115+ a = (u32)jiffies;
116+
117+ /* conn might have been added just before by another cpu and
118+ * might still be unconfirmed. In this case, nf_conntrack_find()
119+ * returns no result. Thus only evict if this cpu added the
120+ * stale entry or if the entry is older than two jiffies.
121+ */
122+ age = a - b;
123+ if (conn->cpu == cpu || age >= 2) {
124+ hlist_del(&conn->node);
125+ kmem_cache_free(conncount_conn_cachep, conn);
126+ return ERR_PTR(-ENOENT);
127+ }
128+
129+ return ERR_PTR(-EAGAIN);
130+}
131+
99132 unsigned int nf_conncount_lookup(struct net *net, struct hlist_head *head,
100133 const struct nf_conntrack_tuple *tuple,
101134 const struct nf_conntrack_zone *zone,
@@ -103,18 +136,27 @@ unsigned int nf_conncount_lookup(struct net *net, struct hlist_head *head, · 1 unmodified line
103136 {
104137 const struct nf_conntrack_tuple_hash *found;
105138 struct nf_conncount_tuple *conn;
106− struct hlist_node *n;
107139 struct nf_conn *found_ct;
140+ struct hlist_node *n;
108141 unsigned int length = 0;
109142
110143 *addit = tuple ? true : false;
111144
112145 /* check the saved connections */
113146 hlist_for_each_entry_safe(conn, n, head, node) {
114− found = nf_conntrack_find_get(net, &conn->zone, &conn->tuple);
115− if (found == NULL) {
116− hlist_del(&conn->node);
117− kmem_cache_free(conncount_conn_cachep, conn);
147+ found = find_or_evict(net, conn);
148+ if (IS_ERR(found)) {
149+ /* Not found, but might be about to be confirmed */
150+ if (PTR_ERR(found) == -EAGAIN) {
151+ length++;
152+ if (!tuple)
153+ continue;
154+
155+ if (nf_ct_tuple_equal(&conn->tuple, tuple) &&
156+ nf_ct_zone_id(&conn->zone, conn->zone.dir) ==
157+ nf_ct_zone_id(zone, zone->dir))
158+ *addit = false;
159+ }
118160 continue;
119161 }
120162
net/netfilter/nf_conntrack_helper.c+5−0
@@ -465,6 +465,11 @@ void nf_conntrack_helper_unregister(struct nf_conntrack_helper *me) · 464 unmodified lines
465465
466466 nf_ct_expect_iterate_destroy(expect_iter_me, NULL);
467467 nf_ct_iterate_destroy(unhelp, me);
468+
469+ /* Maybe someone has gotten the helper already when unhelp above.
470+ * So need to wait it.
471+ */
472+ synchronize_rcu();
468473 }
469474 EXPORT_SYMBOL_GPL(nf_conntrack_helper_unregister);
470475
net/netfilter/nf_log.c+10−3
@@ -424,6 +424,10 @@ static int nf_log_proc_dostring(struct ctl_table *table, int write, · 423 unmodified lines
424424 if (write) {
425425 struct ctl_table tmp = *table;
426426
427+ /* proc_dostring() can append to existing strings, so we need to
428+ * initialize it as an empty string.
429+ */
430+ buf[0] = '\0';
427431 tmp.data = buf;
428432 r = proc_dostring(&tmp, write, buffer, lenp, ppos);
429433 if (r)
@@ -442,14 +446,17 @@ static int nf_log_proc_dostring(struct ctl_table *table, int write, · 12 unmodified lines
442446 rcu_assign_pointer(net->nf.nf_loggers[tindex], logger);
443447 mutex_unlock(&nf_log_mutex);
444448 } else {
449+ struct ctl_table tmp = *table;
450+
451+ tmp.data = buf;
445452 mutex_lock(&nf_log_mutex);
446453 logger = nft_log_dereference(net->nf.nf_loggers[tindex]);
447454 if (!logger)
448− table->data = "NONE";
455+ strlcpy(buf, "NONE", sizeof(buf));
449456 else
450− table->data = logger->name;
451− r = proc_dostring(table, write, buffer, lenp, ppos);
457+ strlcpy(buf, logger->name, sizeof(buf));
452458 mutex_unlock(&nf_log_mutex);
459+ r = proc_dostring(&tmp, write, buffer, lenp, ppos);
453460 }
454461
455462 return r;
net/netfilter/nfnetlink_queue.c+3−0
@@ -1243,6 +1243,9 @@ static int nfqnl_recv_unsupp(struct net *net, struct sock *ctnl, · 1242 unmodified lines
12431243 static const struct nla_policy nfqa_cfg_policy[NFQA_CFG_MAX+1] = {
12441244 [NFQA_CFG_CMD] = { .len = sizeof(struct nfqnl_msg_config_cmd) },
12451245 [NFQA_CFG_PARAMS] = { .len = sizeof(struct nfqnl_msg_config_params) },
1246+ [NFQA_CFG_QUEUE_MAXLEN] = { .type = NLA_U32 },
1247+ [NFQA_CFG_MASK] = { .type = NLA_U32 },
1248+ [NFQA_CFG_FLAGS] = { .type = NLA_U32 },
12461249 };
12471250
12481251 static const struct nf_queue_handler nfqh = {
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+5−4
@@ -4076,11 +4076,12 @@ static int packet_ioctl(struct socket *sock, unsigned int cmd, · 4075 unmodified lines
40764076 return 0;
40774077 }
40784078
4079−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)
40804081 {
40814082 struct sock *sk = sock->sk;
40824083 struct packet_sock *po = pkt_sk(sk);
4083− __poll_t mask = datagram_poll_mask(sock, events);
4084+ __poll_t mask = datagram_poll(file, sock, wait);
40844085
40854086 spin_lock_bh(&sk->sk_receive_queue.lock);
40864087 if (po->rx_ring.pg_vec) {
@@ -4422,7 +4423,7 @@ static const struct proto_ops packet_ops_spkt = { · 335 unmodified lines
44224423 .socketpair = sock_no_socketpair,
44234424 .accept = sock_no_accept,
44244425 .getname = packet_getname_spkt,
4425− .poll_mask = datagram_poll_mask,
4426+ .poll = datagram_poll,
44264427 .ioctl = packet_ioctl,
44274428 .listen = sock_no_listen,
44284429 .shutdown = sock_no_shutdown,
@@ -4443,7 +4444,7 @@ static const struct proto_ops packet_ops = { · 14 unmodified lines
44434444 .socketpair = sock_no_socketpair,
44444445 .accept = sock_no_accept,
44454446 .getname = packet_getname,
4446− .poll_mask = packet_poll_mask,
4447+ .poll = packet_poll,
44474448 .ioctl = packet_ioctl,
44484449 .listen = sock_no_listen,
44494450 .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/rds/connection.c+10−1
@@ -659,11 +659,19 @@ static void rds_conn_info(struct socket *sock, unsigned int len, · 658 unmodified lines
659659
660660 int rds_conn_init(void)
661661 {
662+ int ret;
663+
664+ ret = rds_loop_net_init(); /* register pernet callback */
665+ if (ret)
666+ return ret;
667+
662668 rds_conn_slab = kmem_cache_create("rds_connection",
663669 sizeof(struct rds_connection),
664670 0, 0, NULL);
665− if (!rds_conn_slab)
671+ if (!rds_conn_slab) {
672+ rds_loop_net_exit();
666673 return -ENOMEM;
674+ }
667675
668676 rds_info_register_func(RDS_INFO_CONNECTIONS, rds_conn_info);
669677 rds_info_register_func(RDS_INFO_SEND_MESSAGES,
@@ -676,6 +684,7 @@ int rds_conn_init(void) · 6 unmodified lines
676684
677685 void rds_conn_exit(void)
678686 {
687+ rds_loop_net_exit(); /* unregister pernet callback */
679688 rds_loop_exit();
680689
681690 WARN_ON(!hlist_empty(rds_conn_hash));
net/rds/loop.c+56−0
@@ -33,6 +33,8 @@ · 32 unmodified lines
3333 #include <linux/kernel.h>
3434 #include <linux/slab.h>
3535 #include <linux/in.h>
36+#include <net/net_namespace.h>
37+#include <net/netns/generic.h>
3638
3739 #include "rds_single_path.h"
3840 #include "rds.h"
@@ -40,6 +42,17 @@ · 1 unmodified line
4042
4143 static DEFINE_SPINLOCK(loop_conns_lock);
4244 static LIST_HEAD(loop_conns);
45+static atomic_t rds_loop_unloading = ATOMIC_INIT(0);
46+
47+static void rds_loop_set_unloading(void)
48+{
49+ atomic_set(&rds_loop_unloading, 1);
50+}
51+
52+static bool rds_loop_is_unloading(struct rds_connection *conn)
53+{
54+ return atomic_read(&rds_loop_unloading) != 0;
55+}
4356
4457 /*
4558 * This 'loopback' transport is a special case for flows that originate
@@ -165,6 +178,8 @@ void rds_loop_exit(void) · 119 unmodified lines
165178 struct rds_loop_connection *lc, *_lc;
166179 LIST_HEAD(tmp_list);
167180
181+ rds_loop_set_unloading();
182+ synchronize_rcu();
168183 /* avoid calling conn_destroy with irqs off */
169184 spin_lock_irq(&loop_conns_lock);
170185 list_splice(&loop_conns, &tmp_list);
@@ -177,6 +192,46 @@ void rds_loop_exit(void) · 6 unmodified lines
177192 }
178193 }
179194
195+static void rds_loop_kill_conns(struct net *net)
196+{
197+ struct rds_loop_connection *lc, *_lc;
198+ LIST_HEAD(tmp_list);
199+
200+ spin_lock_irq(&loop_conns_lock);
201+ list_for_each_entry_safe(lc, _lc, &loop_conns, loop_node) {
202+ struct net *c_net = read_pnet(&lc->conn->c_net);
203+
204+ if (net != c_net)
205+ continue;
206+ list_move_tail(&lc->loop_node, &tmp_list);
207+ }
208+ spin_unlock_irq(&loop_conns_lock);
209+
210+ list_for_each_entry_safe(lc, _lc, &tmp_list, loop_node) {
211+ WARN_ON(lc->conn->c_passive);
212+ rds_conn_destroy(lc->conn);
213+ }
214+}
215+
216+static void __net_exit rds_loop_exit_net(struct net *net)
217+{
218+ rds_loop_kill_conns(net);
219+}
220+
221+static struct pernet_operations rds_loop_net_ops = {
222+ .exit = rds_loop_exit_net,
223+};
224+
225+int rds_loop_net_init(void)
226+{
227+ return register_pernet_device(&rds_loop_net_ops);
228+}
229+
230+void rds_loop_net_exit(void)
231+{
232+ unregister_pernet_device(&rds_loop_net_ops);
233+}
234+
180235 /*
181236 * This is missing .xmit_* because loop doesn't go through generic
182237 * rds_send_xmit() and doesn't call rds_recv_incoming(). .listen_stop and
@@ -194,4 +249,5 @@ struct rds_transport rds_loop_transport = { · 11 unmodified lines
194249 .inc_free = rds_loop_inc_free,
195250 .t_name = "loopback",
196251 .t_type = RDS_TRANS_LOOP,
252+ .t_unloading = rds_loop_is_unloading,
197253 };
net/rds/loop.h+2−0
@@ -5,6 +5,8 @@ · 4 unmodified lines
55 /* loop.c */
66 extern struct rds_transport rds_loop_transport;
77
8+int rds_loop_net_init(void);
9+void rds_loop_net_exit(void);
810 void rds_loop_exit(void);
911
1012 #endif
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/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
@@ -7765,12 +7765,14 @@ out: · 7764 unmodified lines
77657765 * here, again, by modeling the current TCP/UDP code. We don't have
77667766 * a good way to test with it yet.
77677767 */
7768−__poll_t sctp_poll_mask(struct socket *sock, __poll_t events)
7768+__poll_t sctp_poll(struct file *file, struct socket *sock, poll_table *wait)
77697769 {
77707770 struct sock *sk = sock->sk;
77717771 struct sctp_sock *sp = sctp_sk(sk);
77727772 __poll_t mask;
77737773
7774+ poll_wait(file, sk_sleep(sk), wait);
7775+
77747776 sock_rps_record_flow(sk);
77757777
77767778 /* A TCP-style listening socket becomes readable when the accept queue
net/smc/af_smc.c+67−31
@@ -47,6 +47,7 @@ static DEFINE_MUTEX(smc_create_lgr_pending); /* serialize link group · 46 unmodified lines
4747 */
4848
4949 static void smc_tcp_listen_work(struct work_struct *);
50+static void smc_connect_work(struct work_struct *);
5051
5152 static void smc_set_keepalive(struct sock *sk, int val)
5253 {
@@ -124,6 +125,12 @@ static int smc_release(struct socket *sock) · 71 unmodified lines
124125 goto out;
125126
126127 smc = smc_sk(sk);
128+
129+ /* cleanup for a dangling non-blocking connect */
130+ flush_work(&smc->connect_work);
131+ kfree(smc->connect_info);
132+ smc->connect_info = NULL;
133+
127134 if (sk->sk_state == SMC_LISTEN)
128135 /* smc_close_non_accepted() is called and acquires
129136 * sock lock for child sockets again
@@ -188,6 +195,7 @@ static struct sock *smc_sock_alloc(struct net *net, struct socket *sock, · 58 unmodified lines
188195 sk->sk_protocol = protocol;
189196 smc = smc_sk(sk);
190197 INIT_WORK(&smc->tcp_listen_work, smc_tcp_listen_work);
198+ INIT_WORK(&smc->connect_work, smc_connect_work);
191199 INIT_DELAYED_WORK(&smc->conn.tx_work, smc_tx_work);
192200 INIT_LIST_HEAD(&smc->accept_q);
193201 spin_lock_init(&smc->accept_q_lock);
@@ -707,6 +715,35 @@ static int __smc_connect(struct smc_sock *smc) · 513 unmodified lines
707715 return 0;
708716 }
709717
718+static void smc_connect_work(struct work_struct *work)
719+{
720+ struct smc_sock *smc = container_of(work, struct smc_sock,
721+ connect_work);
722+ int rc;
723+
724+ lock_sock(&smc->sk);
725+ rc = kernel_connect(smc->clcsock, &smc->connect_info->addr,
726+ smc->connect_info->alen, smc->connect_info->flags);
727+ if (smc->clcsock->sk->sk_err) {
728+ smc->sk.sk_err = smc->clcsock->sk->sk_err;
729+ goto out;
730+ }
731+ if (rc < 0) {
732+ smc->sk.sk_err = -rc;
733+ goto out;
734+ }
735+
736+ rc = __smc_connect(smc);
737+ if (rc < 0)
738+ smc->sk.sk_err = -rc;
739+
740+out:
741+ smc->sk.sk_state_change(&smc->sk);
742+ kfree(smc->connect_info);
743+ smc->connect_info = NULL;
744+ release_sock(&smc->sk);
745+}
746+
710747 static int smc_connect(struct socket *sock, struct sockaddr *addr,
711748 int alen, int flags)
712749 {
@@ -736,15 +773,32 @@ static int smc_connect(struct socket *sock, struct sockaddr *addr, · 23 unmodified lines
736773
737774 smc_copy_sock_settings_to_clc(smc);
738775 tcp_sk(smc->clcsock->sk)->syn_smc = 1;
739− rc = kernel_connect(smc->clcsock, addr, alen, flags);
740− if (rc)
741− goto out;
776+ if (flags & O_NONBLOCK) {
777+ if (smc->connect_info) {
778+ rc = -EALREADY;
779+ goto out;
780+ }
781+ smc->connect_info = kzalloc(alen + 2 * sizeof(int), GFP_KERNEL);
782+ if (!smc->connect_info) {
783+ rc = -ENOMEM;
784+ goto out;
785+ }
786+ smc->connect_info->alen = alen;
787+ smc->connect_info->flags = flags ^ O_NONBLOCK;
788+ memcpy(&smc->connect_info->addr, addr, alen);
789+ schedule_work(&smc->connect_work);
790+ rc = -EINPROGRESS;
791+ } else {
792+ rc = kernel_connect(smc->clcsock, addr, alen, flags);
793+ if (rc)
794+ goto out;
742795
743− rc = __smc_connect(smc);
744− if (rc < 0)
745− goto out;
746− else
747− rc = 0; /* success cases including fallback */
796+ rc = __smc_connect(smc);
797+ if (rc < 0)
798+ goto out;
799+ else
800+ rc = 0; /* success cases including fallback */
801+ }
748802
749803 out:
750804 release_sock(sk);
@@ -1455,39 +1509,23 @@ static __poll_t smc_accept_poll(struct sock *parent) · 704 unmodified lines
14551509 return mask;
14561510 }
14571511
1458−static __poll_t smc_poll_mask(struct socket *sock, __poll_t events)
1512+static __poll_t smc_poll(struct file *file, struct socket *sock,
1513+ poll_table *wait)
14591514 {
14601515 struct sock *sk = sock->sk;
14611516 __poll_t mask = 0;
14621517 struct smc_sock *smc;
1463− int rc;
14641518
14651519 if (!sk)
14661520 return EPOLLNVAL;
14671521
14681522 smc = smc_sk(sock->sk);
1469− sock_hold(sk);
1470− lock_sock(sk);
14711523 if ((sk->sk_state == SMC_INIT) || smc->use_fallback) {
14721524 /* delegate to CLC child sock */
1473− release_sock(sk);
1474− mask = smc->clcsock->ops->poll_mask(smc->clcsock, events);
1475− lock_sock(sk);
1525+ mask = smc->clcsock->ops->poll(file, smc->clcsock, wait);
14761526 sk->sk_err = smc->clcsock->sk->sk_err;
1477− if (sk->sk_err) {
1527+ if (sk->sk_err)
14781528 mask |= EPOLLERR;
1479− } else {
1480− /* if non-blocking connect finished ... */
1481− if (sk->sk_state == SMC_INIT &&
1482− mask & EPOLLOUT &&
1483− smc->clcsock->sk->sk_state != TCP_CLOSE) {
1484− rc = __smc_connect(smc);
1485− if (rc < 0)
1486− mask |= EPOLLERR;
1487− /* success cases including fallback */
1488− mask |= EPOLLOUT | EPOLLWRNORM;
1489− }
1490− }
14911529 } else {
14921530 if (sk->sk_err)
14931531 mask |= EPOLLERR;
@@ -1516,8 +1554,6 @@ static __poll_t smc_poll_mask(struct socket *sock, __poll_t events) · 22 unmodified lines
15161554 mask |= EPOLLPRI;
15171555
15181556 }
1519− release_sock(sk);
1520− sock_put(sk);
15211557
15221558 return mask;
15231559 }
@@ -1801,7 +1837,7 @@ static const struct proto_ops smc_sock_ops = { · 277 unmodified lines
18011837 .socketpair = sock_no_socketpair,
18021838 .accept = smc_accept,
18031839 .getname = smc_getname,
1804− .poll_mask = smc_poll_mask,
1840+ .poll = smc_poll,
18051841 .ioctl = smc_ioctl,
18061842 .listen = smc_listen,
18071843 .shutdown = smc_shutdown,
net/smc/smc.h+8−0
@@ -190,11 +190,19 @@ struct smc_connection { · 189 unmodified lines
190190 u64 peer_token; /* SMC-D token of peer */
191191 };
192192
193+struct smc_connect_info {
194+ int flags;
195+ int alen;
196+ struct sockaddr addr;
197+};
198+
193199 struct smc_sock { /* smc sock container */
194200 struct sock sk;
195201 struct socket *clcsock; /* internal tcp socket */
196202 struct smc_connection conn; /* smc connection */
197203 struct smc_sock *listen_smc; /* listen parent */
204+ struct smc_connect_info *connect_info; /* connect address & flags */
205+ struct work_struct connect_work; /* handle non-blocking connect*/
198206 struct work_struct tcp_listen_work;/* handle tcp socket accepts */
199207 struct work_struct smc_listen_work;/* prepare new accept socket */
200208 struct list_head accept_q; /* sockets to be accepted */
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,
121− __poll_t events);
122−static __poll_t sock_poll_mask(struct file *file, __poll_t);
123−static __poll_t sock_poll(struct file *file, struct poll_table_struct *wait);
120+static __poll_t sock_poll(struct file *file,
121+ struct poll_table_struct *wait);
124122 static long sock_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
125123 #ifdef CONFIG_COMPAT
126124 static long compat_sock_ioctl(struct file *file,
@@ -143,8 +141,6 @@ static const struct file_operations socket_file_ops = { · 16 unmodified lines
143141 .llseek = no_llseek,
144142 .read_iter = sock_read_iter,
145143 .write_iter = sock_write_iter,
146− .get_poll_head = sock_get_poll_head,
147− .poll_mask = sock_poll_mask,
148144 .poll = sock_poll,
149145 .unlocked_ioctl = sock_ioctl,
150146 #ifdef CONFIG_COMPAT
@@ -1130,48 +1126,16 @@ out_release: · 979 unmodified lines
11301126 }
11311127 EXPORT_SYMBOL(sock_create_lite);
11321128
1133−static struct wait_queue_head *sock_get_poll_head(struct file *file,
1134− __poll_t events)
1135−{
1136− struct socket *sock = file->private_data;
1137−
1138− if (!sock->ops->poll_mask)
1139− return NULL;
1140− sock_poll_busy_loop(sock, events);
1141− return sk_sleep(sock->sk);
1142−}
1143−
1144−static __poll_t sock_poll_mask(struct file *file, __poll_t events)
1145−{
1146− struct socket *sock = file->private_data;
1147−
1148− /*
1149− * We need to be sure we are in sync with the socket flags modification.
1150− *
1151− * This memory barrier is paired in the wq_has_sleeper.
1152− */
1153− smp_mb();
1154−
1155− /* this socket can poll_ll so tell the system call */
1156− return sock->ops->poll_mask(sock, events) |
1157− (sk_can_busy_loop(sock->sk) ? POLL_BUSY_LOOP : 0);
1158−}
1159−
11601129 /* No kernel lock held - perfect */
11611130 static __poll_t sock_poll(struct file *file, poll_table *wait)
11621131 {
11631132 struct socket *sock = file->private_data;
1164− __poll_t events = poll_requested_events(wait), mask = 0;
1165−
1166− if (sock->ops->poll) {
1167− sock_poll_busy_loop(sock, events);
1168− mask = sock->ops->poll(file, sock, wait);
1169− } else if (sock->ops->poll_mask) {
1170− sock_poll_wait(file, sock_get_poll_head(file, events), wait);
1171− mask = sock->ops->poll_mask(sock, events);
1172− }
1133+ __poll_t events = poll_requested_events(wait);
11731134
1174− return mask | sock_poll_busy_flag(sock);
1135+ sock_poll_busy_loop(sock, events);
1136+ if (!sock->ops->poll)
1137+ return 0;
1138+ return sock->ops->poll(file, sock, wait) | sock_poll_busy_flag(sock);
11751139 }
11761140
11771141 static int sock_mmap(struct file *file, struct vm_area_struct *vma)
net/strparser/strparser.c+1−16
@@ -35,7 +35,6 @@ struct _strp_msg { · 34 unmodified lines
3535 */
3636 struct strp_msg strp;
3737 int accum_len;
38− int early_eaten;
3938 };
4039
4140 static inline struct _strp_msg *_strp_msg(struct sk_buff *skb)
@@ -115,20 +114,6 @@ static int __strp_recv(read_descriptor_t *desc, struct sk_buff *orig_skb, · 73 unmodified lines
115114 head = strp->skb_head;
116115 if (head) {
117116 /* Message already in progress */
118−
119− stm = _strp_msg(head);
120− if (unlikely(stm->early_eaten)) {
121− /* Already some number of bytes on the receive sock
122− * data saved in skb_head, just indicate they
123− * are consumed.
124− */
125− eaten = orig_len <= stm->early_eaten ?
126− orig_len : stm->early_eaten;
127− stm->early_eaten -= eaten;
128−
129− return eaten;
130− }
131−
132117 if (unlikely(orig_offset)) {
133118 /* Getting data with a non-zero offset when a message is
134119 * in progress is not expected. If it does happen, we
@@ -301,9 +286,9 @@ static int __strp_recv(read_descriptor_t *desc, struct sk_buff *orig_skb, · 166 unmodified lines
301286 }
302287
303288 stm->accum_len += cand_len;
289+ eaten += cand_len;
304290 strp->need_bytes = stm->strp.full_len -
305291 stm->accum_len;
306− stm->early_eaten = cand_len;
307292 STRP_STATS_ADD(strp->stats.bytes, cand_len);
308293 desc->count = 0; /* Stop reading socket */
309294 break;
net/tipc/socket.c+9−5
@@ -692,9 +692,10 @@ static int tipc_getname(struct socket *sock, struct sockaddr *uaddr, · 691 unmodified lines
692692 }
693693
694694 /**
695− * tipc_poll - read pollmask
695+ * tipc_poll - read and possibly block on pollmask
696696 * @file: file structure associated with the socket
697697 * @sock: socket for which to calculate the poll bits
698+ * @wait: ???
698699 *
699700 * Returns pollmask value
700701 *
@@ -708,12 +709,15 @@ static int tipc_getname(struct socket *sock, struct sockaddr *uaddr, · 7 unmodified lines
708709 * imply that the operation will succeed, merely that it should be performed
709710 * and will not block.
710711 */
711−static __poll_t tipc_poll_mask(struct socket *sock, __poll_t events)
712+static __poll_t tipc_poll(struct file *file, struct socket *sock,
713+ poll_table *wait)
712714 {
713715 struct sock *sk = sock->sk;
714716 struct tipc_sock *tsk = tipc_sk(sk);
715717 __poll_t revents = 0;
716718
719+ sock_poll_wait(file, sk_sleep(sk), wait);
720+
717721 if (sk->sk_shutdown & RCV_SHUTDOWN)
718722 revents |= EPOLLRDHUP | EPOLLIN | EPOLLRDNORM;
719723 if (sk->sk_shutdown == SHUTDOWN_MASK)
@@ -3033,7 +3037,7 @@ static const struct proto_ops msg_ops = { · 2313 unmodified lines
30333037 .socketpair = tipc_socketpair,
30343038 .accept = sock_no_accept,
30353039 .getname = tipc_getname,
3036− .poll_mask = tipc_poll_mask,
3040+ .poll = tipc_poll,
30373041 .ioctl = tipc_ioctl,
30383042 .listen = sock_no_listen,
30393043 .shutdown = tipc_shutdown,
@@ -3054,7 +3058,7 @@ static const struct proto_ops packet_ops = { · 14 unmodified lines
30543058 .socketpair = tipc_socketpair,
30553059 .accept = tipc_accept,
30563060 .getname = tipc_getname,
3057− .poll_mask = tipc_poll_mask,
3061+ .poll = tipc_poll,
30583062 .ioctl = tipc_ioctl,
30593063 .listen = tipc_listen,
30603064 .shutdown = tipc_shutdown,
@@ -3075,7 +3079,7 @@ static const struct proto_ops stream_ops = { · 14 unmodified lines
30753079 .socketpair = tipc_socketpair,
30763080 .accept = tipc_accept,
30773081 .getname = tipc_getname,
3078− .poll_mask = tipc_poll_mask,
3082+ .poll = tipc_poll,
30793083 .ioctl = tipc_ioctl,
30803084 .listen = tipc_listen,
30813085 .shutdown = tipc_shutdown,
net/tls/tls_main.c+1−1
@@ -712,7 +712,7 @@ static int __init tls_register(void) · 711 unmodified lines
712712 build_protos(tls_prots[TLSV4], &tcp_prot);
713713
714714 tls_sw_proto_ops = inet_stream_ops;
715− tls_sw_proto_ops.poll_mask = tls_sw_poll_mask;
715+ tls_sw_proto_ops.poll = tls_sw_poll;
716716 tls_sw_proto_ops.splice_read = tls_sw_splice_read;
717717
718718 #ifdef CONFIG_TLS_DEVICE
net/tls/tls_sw.c+10−9
@@ -919,22 +919,23 @@ splice_read_end: · 918 unmodified lines
919919 return copied ? : err;
920920 }
921921
922−__poll_t tls_sw_poll_mask(struct socket *sock, __poll_t events)
922+unsigned int tls_sw_poll(struct file *file, struct socket *sock,
923+ struct poll_table_struct *wait)
923924 {
925+ unsigned int ret;
924926 struct sock *sk = sock->sk;
925927 struct tls_context *tls_ctx = tls_get_ctx(sk);
926928 struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx);
927− __poll_t mask;
928929
929− /* Grab EPOLLOUT and EPOLLHUP from the underlying socket */
930− mask = ctx->sk_poll_mask(sock, events);
930+ /* Grab POLLOUT and POLLHUP from the underlying socket */
931+ ret = ctx->sk_poll(file, sock, wait);
931932
932− /* Clear EPOLLIN bits, and set based on recv_pkt */
933− mask &= ~(EPOLLIN | EPOLLRDNORM);
933+ /* Clear POLLIN bits, and set based on recv_pkt */
934+ ret &= ~(POLLIN | POLLRDNORM);
934935 if (ctx->recv_pkt)
935− mask |= EPOLLIN | EPOLLRDNORM;
936+ ret |= POLLIN | POLLRDNORM;
936937
937− return mask;
938+ return ret;
938939 }
939940
940941 static int tls_read_size(struct strparser *strp, struct sk_buff *skb)
@@ -1194,7 +1195,7 @@ int tls_set_sw_offload(struct sock *sk, struct tls_context *ctx, int tx) · 253 unmodified lines
11941195 sk->sk_data_ready = tls_data_ready;
11951196 write_unlock_bh(&sk->sk_callback_lock);
11961197
1197− sw_ctx_rx->sk_poll_mask = sk->sk_socket->ops->poll_mask;
1198+ sw_ctx_rx->sk_poll = sk->sk_socket->ops->poll;
11981199
11991200 strp_check_rcv(&sw_ctx_rx->strp);
12001201 }
net/unix/af_unix.c+19−11
@@ -638,8 +638,9 @@ static int unix_stream_connect(struct socket *, struct sockaddr *, · 637 unmodified lines
638638 static int unix_socketpair(struct socket *, struct socket *);
639639 static int unix_accept(struct socket *, struct socket *, int, bool);
640640 static int unix_getname(struct socket *, struct sockaddr *, int);
641−static __poll_t unix_poll_mask(struct socket *, __poll_t);
642−static __poll_t unix_dgram_poll_mask(struct socket *, __poll_t);
641+static __poll_t unix_poll(struct file *, struct socket *, poll_table *);
642+static __poll_t unix_dgram_poll(struct file *, struct socket *,
643+ poll_table *);
643644 static int unix_ioctl(struct socket *, unsigned int, unsigned long);
644645 static int unix_shutdown(struct socket *, int);
645646 static int unix_stream_sendmsg(struct socket *, struct msghdr *, size_t);
@@ -680,7 +681,7 @@ static const struct proto_ops unix_stream_ops = { · 34 unmodified lines
680681 .socketpair = unix_socketpair,
681682 .accept = unix_accept,
682683 .getname = unix_getname,
683− .poll_mask = unix_poll_mask,
684+ .poll = unix_poll,
684685 .ioctl = unix_ioctl,
685686 .listen = unix_listen,
686687 .shutdown = unix_shutdown,
@@ -703,7 +704,7 @@ static const struct proto_ops unix_dgram_ops = { · 16 unmodified lines
703704 .socketpair = unix_socketpair,
704705 .accept = sock_no_accept,
705706 .getname = unix_getname,
706− .poll_mask = unix_dgram_poll_mask,
707+ .poll = unix_dgram_poll,
707708 .ioctl = unix_ioctl,
708709 .listen = sock_no_listen,
709710 .shutdown = unix_shutdown,
@@ -725,7 +726,7 @@ static const struct proto_ops unix_seqpacket_ops = { · 15 unmodified lines
725726 .socketpair = unix_socketpair,
726727 .accept = unix_accept,
727728 .getname = unix_getname,
728− .poll_mask = unix_dgram_poll_mask,
729+ .poll = unix_dgram_poll,
729730 .ioctl = unix_ioctl,
730731 .listen = unix_listen,
731732 .shutdown = unix_shutdown,
@@ -2629,10 +2630,13 @@ static int unix_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) · 1897 unmodified lines
26292630 return err;
26302631 }
26312632
2632−static __poll_t unix_poll_mask(struct socket *sock, __poll_t events)
2633+static __poll_t unix_poll(struct file *file, struct socket *sock, poll_table *wait)
26332634 {
26342635 struct sock *sk = sock->sk;
2635− __poll_t mask = 0;
2636+ __poll_t mask;
2637+
2638+ sock_poll_wait(file, sk_sleep(sk), wait);
2639+ mask = 0;
26362640
26372641 /* exceptional events? */
26382642 if (sk->sk_err)
@@ -2661,11 +2665,15 @@ static __poll_t unix_poll_mask(struct socket *sock, __poll_t events) · 22 unmodified lines
26612665 return mask;
26622666 }
26632667
2664−static __poll_t unix_dgram_poll_mask(struct socket *sock, __poll_t events)
2668+static __poll_t unix_dgram_poll(struct file *file, struct socket *sock,
2669+ poll_table *wait)
26652670 {
26662671 struct sock *sk = sock->sk, *other;
2667− int writable;
2668− __poll_t mask = 0;
2672+ unsigned int writable;
2673+ __poll_t mask;
2674+
2675+ sock_poll_wait(file, sk_sleep(sk), wait);
2676+ mask = 0;
26692677
26702678 /* exceptional events? */
26712679 if (sk->sk_err || !skb_queue_empty(&sk->sk_error_queue))
@@ -2691,7 +2699,7 @@ static __poll_t unix_dgram_poll_mask(struct socket *sock, __poll_t events) · 19 unmodified lines
26912699 }
26922700
26932701 /* No write status requested, avoid expensive OUT tests. */
2694− if (!(events & (EPOLLWRBAND|EPOLLWRNORM|EPOLLOUT)))
2702+ if (!(poll_requested_events(wait) & (EPOLLWRBAND|EPOLLWRNORM|EPOLLOUT)))
26952703 return mask;
26962704
26972705 writable = unix_writable(sk);
net/vmw_vsock/af_vsock.c+13−6
@@ -850,11 +850,18 @@ static int vsock_shutdown(struct socket *sock, int mode) · 849 unmodified lines
850850 return err;
851851 }
852852
853−static __poll_t vsock_poll_mask(struct socket *sock, __poll_t events)
853+static __poll_t vsock_poll(struct file *file, struct socket *sock,
854+ poll_table *wait)
854855 {
855− struct sock *sk = sock->sk;
856− struct vsock_sock *vsk = vsock_sk(sk);
857− __poll_t mask = 0;
856+ struct sock *sk;
857+ __poll_t mask;
858+ struct vsock_sock *vsk;
859+
860+ sk = sock->sk;
861+ vsk = vsock_sk(sk);
862+
863+ poll_wait(file, sk_sleep(sk), wait);
864+ mask = 0;
858865
859866 if (sk->sk_err)
860867 /* Signify that there has been an error on this socket. */
@@ -1084,7 +1091,7 @@ static const struct proto_ops vsock_dgram_ops = { · 223 unmodified lines
10841091 .socketpair = sock_no_socketpair,
10851092 .accept = sock_no_accept,
10861093 .getname = vsock_getname,
1087− .poll_mask = vsock_poll_mask,
1094+ .poll = vsock_poll,
10881095 .ioctl = sock_no_ioctl,
10891096 .listen = sock_no_listen,
10901097 .shutdown = vsock_shutdown,
@@ -1842,7 +1849,7 @@ static const struct proto_ops vsock_stream_ops = { · 751 unmodified lines
18421849 .socketpair = sock_no_socketpair,
18431850 .accept = vsock_accept,
18441851 .getname = vsock_getname,
1845− .poll_mask = vsock_poll_mask,
1852+ .poll = vsock_poll,
18461853 .ioctl = sock_no_ioctl,
18471854 .listen = vsock_listen,
18481855 .shutdown = vsock_shutdown,
net/wireless/nl80211.c+14−21
@@ -6329,7 +6329,7 @@ do { \ · 6328 unmodified lines
63296329 nl80211_check_s32);
63306330 /*
63316331 * Check HT operation mode based on
6332− * IEEE 802.11 2012 8.4.2.59 HT Operation element.
6332+ * IEEE 802.11-2016 9.4.2.57 HT Operation element.
63336333 */
63346334 if (tb[NL80211_MESHCONF_HT_OPMODE]) {
63356335 ht_opmode = nla_get_u16(tb[NL80211_MESHCONF_HT_OPMODE]);
@@ -6339,22 +6339,9 @@ do { \ · 3 unmodified lines
63396339 IEEE80211_HT_OP_MODE_NON_HT_STA_PRSNT))
63406340 return -EINVAL;
63416341
6342− if ((ht_opmode & IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT) &&
6343− (ht_opmode & IEEE80211_HT_OP_MODE_NON_HT_STA_PRSNT))
6344− return -EINVAL;
6342+ /* NON_HT_STA bit is reserved, but some programs set it */
6343+ ht_opmode &= ~IEEE80211_HT_OP_MODE_NON_HT_STA_PRSNT;
63456344
6346− switch (ht_opmode & IEEE80211_HT_OP_MODE_PROTECTION) {
6347− case IEEE80211_HT_OP_MODE_PROTECTION_NONE:
6348− case IEEE80211_HT_OP_MODE_PROTECTION_20MHZ:
6349− if (ht_opmode & IEEE80211_HT_OP_MODE_NON_HT_STA_PRSNT)
6350− return -EINVAL;
6351− break;
6352− case IEEE80211_HT_OP_MODE_PROTECTION_NONMEMBER:
6353− case IEEE80211_HT_OP_MODE_PROTECTION_NONHT_MIXED:
6354− if (!(ht_opmode & IEEE80211_HT_OP_MODE_NON_HT_STA_PRSNT))
6355− return -EINVAL;
6356− break;
6357− }
63586345 cfg->ht_opmode = ht_opmode;
63596346 mask |= (1 << (NL80211_MESHCONF_HT_OPMODE - 1));
63606347 }
@@ -11068,9 +11055,12 @@ static int nl80211_set_wowlan(struct sk_buff *skb, struct genl_info *info) · 4707 unmodified lines
1106811055 rem) {
1106911056 u8 *mask_pat;
1107011057
11071− nla_parse_nested(pat_tb, MAX_NL80211_PKTPAT, pat,
11072− nl80211_packet_pattern_policy,
11073− info->extack);
11058+ err = nla_parse_nested(pat_tb, MAX_NL80211_PKTPAT, pat,
11059+ nl80211_packet_pattern_policy,
11060+ info->extack);
11061+ if (err)
11062+ goto error;
11063+
1107411064 err = -EINVAL;
1107511065 if (!pat_tb[NL80211_PKTPAT_MASK] ||
1107611066 !pat_tb[NL80211_PKTPAT_PATTERN])
@@ -11319,8 +11309,11 @@ static int nl80211_parse_coalesce_rule(struct cfg80211_registered_device *rdev, · 242 unmodified lines
1131911309 rem) {
1132011310 u8 *mask_pat;
1132111311
11322− nla_parse_nested(pat_tb, MAX_NL80211_PKTPAT, pat,
11323− nl80211_packet_pattern_policy, NULL);
11312+ err = nla_parse_nested(pat_tb, MAX_NL80211_PKTPAT, pat,
11313+ nl80211_packet_pattern_policy, NULL);
11314+ if (err)
11315+ return err;
11316+
1132411317 if (!pat_tb[NL80211_PKTPAT_MASK] ||
1132511318 !pat_tb[NL80211_PKTPAT_PATTERN])
1132611319 return -EINVAL;
net/x25/af_x25.c+1−1
@@ -1750,7 +1750,7 @@ static const struct proto_ops x25_proto_ops = { · 1749 unmodified lines
17501750 .socketpair = sock_no_socketpair,
17511751 .accept = x25_accept,
17521752 .getname = x25_getname,
1753− .poll_mask = datagram_poll_mask,
1753+ .poll = datagram_poll,
17541754 .ioctl = x25_ioctl,
17551755 #ifdef CONFIG_COMPAT
17561756 .compat_ioctl = compat_x25_ioctl,
net/xdp/xsk.c+4−3
@@ -303,9 +303,10 @@ static int xsk_sendmsg(struct socket *sock, struct msghdr *m, size_t total_len) · 302 unmodified lines
303303 return (xs->zc) ? xsk_zc_xmit(sk) : xsk_generic_xmit(sk, m, total_len);
304304 }
305305
306−static __poll_t xsk_poll_mask(struct socket *sock, __poll_t events)
306+static unsigned int xsk_poll(struct file *file, struct socket *sock,
307+ struct poll_table_struct *wait)
307308 {
308− __poll_t mask = datagram_poll_mask(sock, events);
309+ unsigned int mask = datagram_poll(file, sock, wait);
309310 struct sock *sk = sock->sk;
310311 struct xdp_sock *xs = xdp_sk(sk);
311312
@@ -696,7 +697,7 @@ static const struct proto_ops xsk_proto_ops = { · 384 unmodified lines
696697 .socketpair = sock_no_socketpair,
697698 .accept = sock_no_accept,
698699 .getname = sock_no_getname,
699− .poll_mask = xsk_poll_mask,
700+ .poll = xsk_poll,
700701 .ioctl = sock_no_ioctl,
701702 .listen = sock_no_listen,
702703 .shutdown = sock_no_shutdown,
samples/bpf/xdp_fwd_kern.c+4−4
@@ -48,9 +48,9 @@ static __always_inline int xdp_fwd_flags(struct xdp_md *ctx, u32 flags) · 47 unmodified lines
4848 struct ethhdr *eth = data;
4949 struct ipv6hdr *ip6h;
5050 struct iphdr *iph;
51− int out_index;
5251 u16 h_proto;
5352 u64 nh_off;
53+ int rc;
5454
5555 nh_off = sizeof(*eth);
5656 if (data + nh_off > data_end)
@@ -101,7 +101,7 @@ static __always_inline int xdp_fwd_flags(struct xdp_md *ctx, u32 flags) · 44 unmodified lines
101101
102102 fib_params.ifindex = ctx->ingress_ifindex;
103103
104− out_index = bpf_fib_lookup(ctx, &fib_params, sizeof(fib_params), flags);
104+ rc = bpf_fib_lookup(ctx, &fib_params, sizeof(fib_params), flags);
105105
106106 /* verify egress index has xdp support
107107 * TO-DO bpf_map_lookup_elem(&tx_port, &key) fails with
@@ -109,7 +109,7 @@ static __always_inline int xdp_fwd_flags(struct xdp_md *ctx, u32 flags) · 1 unmodified line
109109 * NOTE: without verification that egress index supports XDP
110110 * forwarding packets are dropped.
111111 */
112− if (out_index > 0) {
112+ if (rc == 0) {
113113 if (h_proto == htons(ETH_P_IP))
114114 ip_decrease_ttl(iph);
115115 else if (h_proto == htons(ETH_P_IPV6))
@@ -117,7 +117,7 @@ static __always_inline int xdp_fwd_flags(struct xdp_md *ctx, u32 flags) · 1 unmodified line
117117
118118 memcpy(eth->h_dest, fib_params.dmac, ETH_ALEN);
119119 memcpy(eth->h_source, fib_params.smac, ETH_ALEN);
120− return bpf_redirect_map(&tx_port, out_index, 0);
120+ return bpf_redirect_map(&tx_port, fib_params.ifindex, 0);
121121 }
122122
123123 return XDP_PASS;
scripts/cc-can-link.sh+1−1
@@ -1,7 +1,7 @@
11 #!/bin/sh
22 # SPDX-License-Identifier: GPL-2.0
33
4−cat << "END" | $@ -x c - -o /dev/null >/dev/null 2>&1 && echo "y"
4+cat << "END" | $@ -x c - -o /dev/null >/dev/null 2>&1
55 #include <stdio.h>
66 int main(void)
77 {
scripts/checkpatch.pl+0−6
@@ -2606,12 +2606,6 @@ sub process { · 2605 unmodified lines
26062606 "A patch subject line should describe the change not the tool that found it\n" . $herecurr);
26072607 }
26082608
2609−# Check for old stable address
2610− if ($line =~ /^\s*cc:\s*.*<?\bstable\@kernel\.org\b>?.*$/i) {
2611− ERROR("STABLE_ADDRESS",
2612− "The 'stable' address should be 'stable\@vger.kernel.org'\n" . $herecurr);
2613− }
2614−
26152609 # Check for unwanted Gerrit info
26162610 if ($in_commit_log && $line =~ /^\s*change-id:/i) {
26172611 ERROR("GERRIT_CHANGE_ID",
scripts/gcc-x86_64-has-stack-protector.sh+1−1
@@ -1,4 +1,4 @@
11 #!/bin/sh
22 # SPDX-License-Identifier: GPL-2.0
33
4−echo "int foo(void) { char X[200]; return 3; }" | $* -S -x c -c -O0 -mcmodel=kernel -fno-PIE -fstack-protector - -o - 2> /dev/null | grep -q "%gs"
4+echo "int foo(void) { char X[200]; return 3; }" | $* -S -x c -c -m64 -O0 -mcmodel=kernel -fno-PIE -fstack-protector - -o - 2> /dev/null | grep -q "%gs"
scripts/kconfig/expr.h+3−0
@@ -171,6 +171,9 @@ struct symbol { · 170 unmodified lines
171171 * config BAZ
172172 * int "BAZ Value"
173173 * range 1..255
174+ *
175+ * Please, also check zconf.y:print_symbol() when modifying the
176+ * list of property types!
174177 */
175178 enum prop_type {
176179 P_UNKNOWN,
scripts/kconfig/preprocess.c+1−1
@@ -156,7 +156,7 @@ static char *do_shell(int argc, char *argv[]) · 155 unmodified lines
156156 nread--;
157157
158158 /* remove trailing new lines */
159− while (buf[nread - 1] == '\n')
159+ while (nread > 0 && buf[nread - 1] == '\n')
160160 nread--;
161161
162162 buf[nread] = 0;
scripts/kconfig/zconf.y+6−2
@@ -31,7 +31,7 @@ struct symbol *symbol_hash[SYMBOL_HASHSIZE]; · 30 unmodified lines
3131 static struct menu *current_menu, *current_entry;
3232
3333 %}
34−%expect 32
34+%expect 31
3535
3636 %union
3737 {
@@ -337,7 +337,7 @@ choice_block: · 299 unmodified lines
337337
338338 /* if entry */
339339
340−if_entry: T_IF expr nl
340+if_entry: T_IF expr T_EOL
341341 {
342342 printd(DEBUG_PARSE, "%s:%d:if\n", zconf_curname(), zconf_lineno());
343343 menu_add_entry(NULL);
@@ -717,6 +717,10 @@ static void print_symbol(FILE *out, struct menu *menu) · 373 unmodified lines
717717 print_quoted_string(out, prop->text);
718718 fputc('\n', out);
719719 break;
720+ case P_SYMBOL:
721+ fputs( " symbol ", out);
722+ fprintf(out, "%s\n", prop->sym->name);
723+ break;
720724 default:
721725 fprintf(out, " unknown prop %d!\n", prop->type);
722726 break;
security/keys/dh.c+4−2
@@ -142,6 +142,8 @@ static void kdf_dealloc(struct kdf_sdesc *sdesc) · 141 unmodified lines
142142 * The src pointer is defined as Z || other info where Z is the shared secret
143143 * from DH and other info is an arbitrary string (see SP800-56A section
144144 * 5.8.1.2).
145+ *
146+ * 'dlen' must be a multiple of the digest size.
145147 */
146148 static int kdf_ctr(struct kdf_sdesc *sdesc, const u8 *src, unsigned int slen,
147149 u8 *dst, unsigned int dlen, unsigned int zlen)
@@ -205,8 +207,8 @@ static int keyctl_dh_compute_kdf(struct kdf_sdesc *sdesc, · 57 unmodified lines
205207 {
206208 uint8_t *outbuf = NULL;
207209 int ret;
208− size_t outbuf_len = round_up(buflen,
209− crypto_shash_digestsize(sdesc->shash.tfm));
210+ size_t outbuf_len = roundup(buflen,
211+ crypto_shash_digestsize(sdesc->shash.tfm));
210212
211213 outbuf = kmalloc(outbuf_len, GFP_KERNEL);
212214 if (!outbuf) {
security/selinux/selinuxfs.c+33−45
@@ -441,22 +441,16 @@ static int sel_release_policy(struct inode *inode, struct file *filp) · 440 unmodified lines
441441 static ssize_t sel_read_policy(struct file *filp, char __user *buf,
442442 size_t count, loff_t *ppos)
443443 {
444− struct selinux_fs_info *fsi = file_inode(filp)->i_sb->s_fs_info;
445444 struct policy_load_memory *plm = filp->private_data;
446445 int ret;
447446
448− mutex_lock(&fsi->mutex);
449−
450447 ret = avc_has_perm(&selinux_state,
451448 current_sid(), SECINITSID_SECURITY,
452449 SECCLASS_SECURITY, SECURITY__READ_POLICY, NULL);
453450 if (ret)
454− goto out;
451+ return ret;
455452
456− ret = simple_read_from_buffer(buf, count, ppos, plm->data, plm->len);
457−out:
458− mutex_unlock(&fsi->mutex);
459− return ret;
453+ return simple_read_from_buffer(buf, count, ppos, plm->data, plm->len);
460454 }
461455
462456 static vm_fault_t sel_mmap_policy_fault(struct vm_fault *vmf)
@@ -1188,25 +1182,29 @@ static ssize_t sel_read_bool(struct file *filep, char __user *buf, · 725 unmodified lines
11881182 ret = -EINVAL;
11891183 if (index >= fsi->bool_num || strcmp(name,
11901184 fsi->bool_pending_names[index]))
1191− goto out;
1185+ goto out_unlock;
11921186
11931187 ret = -ENOMEM;
11941188 page = (char *)get_zeroed_page(GFP_KERNEL);
11951189 if (!page)
1196− goto out;
1190+ goto out_unlock;
11971191
11981192 cur_enforcing = security_get_bool_value(fsi->state, index);
11991193 if (cur_enforcing < 0) {
12001194 ret = cur_enforcing;
1201− goto out;
1195+ goto out_unlock;
12021196 }
12031197 length = scnprintf(page, PAGE_SIZE, "%d %d", cur_enforcing,
12041198 fsi->bool_pending_values[index]);
1205− ret = simple_read_from_buffer(buf, count, ppos, page, length);
1206−out:
12071199 mutex_unlock(&fsi->mutex);
1200+ ret = simple_read_from_buffer(buf, count, ppos, page, length);
1201+out_free:
12081202 free_page((unsigned long)page);
12091203 return ret;
1204+
1205+out_unlock:
1206+ mutex_unlock(&fsi->mutex);
1207+ goto out_free;
12101208 }
12111209
12121210 static ssize_t sel_write_bool(struct file *filep, const char __user *buf,
@@ -1219,6 +1217,17 @@ static ssize_t sel_write_bool(struct file *filep, const char __user *buf, · 6 unmodified lines
12191217 unsigned index = file_inode(filep)->i_ino & SEL_INO_MASK;
12201218 const char *name = filep->f_path.dentry->d_name.name;
12211219
1220+ if (count >= PAGE_SIZE)
1221+ return -ENOMEM;
1222+
1223+ /* No partial writes. */
1224+ if (*ppos != 0)
1225+ return -EINVAL;
1226+
1227+ page = memdup_user_nul(buf, count);
1228+ if (IS_ERR(page))
1229+ return PTR_ERR(page);
1230+
12221231 mutex_lock(&fsi->mutex);
12231232
12241233 length = avc_has_perm(&selinux_state,
@@ -1233,22 +1242,6 @@ static ssize_t sel_write_bool(struct file *filep, const char __user *buf, · 8 unmodified lines
12331242 fsi->bool_pending_names[index]))
12341243 goto out;
12351244
1236− length = -ENOMEM;
1237− if (count >= PAGE_SIZE)
1238− goto out;
1239−
1240− /* No partial writes. */
1241− length = -EINVAL;
1242− if (*ppos != 0)
1243− goto out;
1244−
1245− page = memdup_user_nul(buf, count);
1246− if (IS_ERR(page)) {
1247− length = PTR_ERR(page);
1248− page = NULL;
1249− goto out;
1250− }
1251−
12521245 length = -EINVAL;
12531246 if (sscanf(page, "%d", &new_value) != 1)
12541247 goto out;
@@ -1280,6 +1273,17 @@ static ssize_t sel_commit_bools_write(struct file *filep, · 25 unmodified lines
12801273 ssize_t length;
12811274 int new_value;
12821275
1276+ if (count >= PAGE_SIZE)
1277+ return -ENOMEM;
1278+
1279+ /* No partial writes. */
1280+ if (*ppos != 0)
1281+ return -EINVAL;
1282+
1283+ page = memdup_user_nul(buf, count);
1284+ if (IS_ERR(page))
1285+ return PTR_ERR(page);
1286+
12831287 mutex_lock(&fsi->mutex);
12841288
12851289 length = avc_has_perm(&selinux_state,
@@ -1289,22 +1293,6 @@ static ssize_t sel_commit_bools_write(struct file *filep, · 3 unmodified lines
12891293 if (length)
12901294 goto out;
12911295
1292− length = -ENOMEM;
1293− if (count >= PAGE_SIZE)
1294− goto out;
1295−
1296− /* No partial writes. */
1297− length = -EINVAL;
1298− if (*ppos != 0)
1299− goto out;
1300−
1301− page = memdup_user_nul(buf, count);
1302− if (IS_ERR(page)) {
1303− length = PTR_ERR(page);
1304− page = NULL;
1305− goto out;
1306− }
1307−
13081296 length = -EINVAL;
13091297 if (sscanf(page, "%d", &new_value) != 1)
13101298 goto out;
security/smack/smack_lsm.c+1−0
@@ -2296,6 +2296,7 @@ static void smack_task_to_inode(struct task_struct *p, struct inode *inode) · 2295 unmodified lines
22962296 struct smack_known *skp = smk_of_task_struct(p);
22972297
22982298 isp->smk_inode = skp;
2299+ isp->smk_flags |= SMK_INODE_INSTANT;
22992300 }
23002301
23012302 /*
sound/core/seq/seq_clientmgr.c+2−1
@@ -2004,7 +2004,8 @@ static int snd_seq_ioctl_query_next_client(struct snd_seq_client *client, · 2003 unmodified lines
20042004 struct snd_seq_client *cptr = NULL;
20052005
20062006 /* search for next client */
2007− info->client++;
2007+ if (info->client < INT_MAX)
2008+ info->client++;
20082009 if (info->client < 0)
20092010 info->client = 0;
20102011 for (; info->client < SNDRV_SEQ_MAX_CLIENTS; info->client++) {
sound/core/timer.c+1−1
@@ -1520,7 +1520,7 @@ static int snd_timer_user_next_device(struct snd_timer_id __user *_tid) · 1519 unmodified lines
15201520 } else {
15211521 if (id.subdevice < 0)
15221522 id.subdevice = 0;
1523− else
1523+ else if (id.subdevice < INT_MAX)
15241524 id.subdevice++;
15251525 }
15261526 }
sound/pci/hda/hda_codec.c+3−2
@@ -2899,8 +2899,9 @@ static int hda_codec_runtime_suspend(struct device *dev) · 2898 unmodified lines
28992899 list_for_each_entry(pcm, &codec->pcm_list_head, list)
29002900 snd_pcm_suspend_all(pcm->pcm);
29012901 state = hda_call_codec_suspend(codec);
2902− if (codec_has_clkstop(codec) && codec_has_epss(codec) &&
2903− (state & AC_PWRST_CLK_STOP_OK))
2902+ if (codec->link_down_at_suspend ||
2903+ (codec_has_clkstop(codec) && codec_has_epss(codec) &&
2904+ (state & AC_PWRST_CLK_STOP_OK)))
29042905 snd_hdac_codec_link_down(&codec->core);
29052906 snd_hdac_link_power(&codec->core, false);
29062907 return 0;
sound/pci/hda/hda_codec.h+1−0
@@ -258,6 +258,7 @@ struct hda_codec { · 257 unmodified lines
258258 unsigned int power_save_node:1; /* advanced PM for each widget */
259259 unsigned int auto_runtime_pm:1; /* enable automatic codec runtime pm */
260260 unsigned int force_pin_prefix:1; /* Add location prefix */
261+ unsigned int link_down_at_suspend:1; /* link down at runtime suspend */
261262 #ifdef CONFIG_PM
262263 unsigned long power_on_acct;
263264 unsigned long power_off_acct;
sound/pci/hda/patch_ca0132.c+23−41
@@ -991,6 +991,7 @@ struct ca0132_spec { · 990 unmodified lines
991991 enum {
992992 QUIRK_NONE,
993993 QUIRK_ALIENWARE,
994+ QUIRK_ALIENWARE_M17XR4,
994995 QUIRK_SBZ,
995996 QUIRK_R3DI,
996997 };
@@ -1040,6 +1041,7 @@ static const struct hda_pintbl r3di_pincfgs[] = { · 43 unmodified lines
10401041 };
10411042
10421043 static const struct snd_pci_quirk ca0132_quirks[] = {
1044+ SND_PCI_QUIRK(0x1028, 0x057b, "Alienware M17x R4", QUIRK_ALIENWARE_M17XR4),
10431045 SND_PCI_QUIRK(0x1028, 0x0685, "Alienware 15 2015", QUIRK_ALIENWARE),
10441046 SND_PCI_QUIRK(0x1028, 0x0688, "Alienware 17 2015", QUIRK_ALIENWARE),
10451047 SND_PCI_QUIRK(0x1028, 0x0708, "Alienware 15 R2 2016", QUIRK_ALIENWARE),
@@ -5663,7 +5665,7 @@ static const char * const ca0132_alt_slave_pfxs[] = { · 4617 unmodified lines
56635665 * I think this has to do with the pin for rear surround being 0x11,
56645666 * and the center/lfe being 0x10. Usually the pin order is the opposite.
56655667 */
5666−const struct snd_pcm_chmap_elem ca0132_alt_chmaps[] = {
5668+static const struct snd_pcm_chmap_elem ca0132_alt_chmaps[] = {
56675669 { .channels = 2,
56685670 .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } },
56695671 { .channels = 4,
@@ -5966,7 +5968,7 @@ static int ca0132_build_pcms(struct hda_codec *codec) · 296 unmodified lines
59665968 info->stream[SNDRV_PCM_STREAM_CAPTURE].nid = spec->adcs[0];
59675969
59685970 /* With the DSP enabled, desktops don't use this ADC. */
5969− if (spec->use_alt_functions) {
5971+ if (!spec->use_alt_functions) {
59705972 info = snd_hda_codec_pcm_new(codec, "CA0132 Analog Mic-In2");
59715973 if (!info)
59725974 return -ENOMEM;
@@ -6130,7 +6132,10 @@ static void ca0132_init_dmic(struct hda_codec *codec) · 157 unmodified lines
61306132 * Bit 6: set to select Data2, clear for Data1
61316133 * Bit 7: set to enable DMic, clear for AMic
61326134 */
6133− val = 0x23;
6135+ if (spec->quirk == QUIRK_ALIENWARE_M17XR4)
6136+ val = 0x33;
6137+ else
6138+ val = 0x23;
61346139 /* keep a copy of dmic ctl val for enable/disable dmic purpuse */
61356140 spec->dmic_ctl = val;
61366141 snd_hda_codec_write(codec, spec->input_pins[0], 0,
@@ -7223,7 +7228,7 @@ static int ca0132_init(struct hda_codec *codec) · 1086 unmodified lines
72237228
72247229 snd_hda_sequence_write(codec, spec->base_init_verbs);
72257230
7226− if (spec->quirk != QUIRK_NONE)
7231+ if (spec->use_alt_functions)
72277232 ca0132_alt_init(codec);
72287233
72297234 ca0132_download_dsp(codec);
@@ -7237,8 +7242,9 @@ static int ca0132_init(struct hda_codec *codec) · 7 unmodified lines
72377242 case QUIRK_R3DI:
72387243 r3di_setup_defaults(codec);
72397244 break;
7240− case QUIRK_NONE:
7241− case QUIRK_ALIENWARE:
7245+ case QUIRK_SBZ:
7246+ break;
7247+ default:
72427248 ca0132_setup_defaults(codec);
72437249 ca0132_init_analog_mic2(codec);
72447250 ca0132_init_dmic(codec);
@@ -7343,7 +7349,6 @@ static const struct hda_codec_ops ca0132_patch_ops = { · 98 unmodified lines
73437349 static void ca0132_config(struct hda_codec *codec)
73447350 {
73457351 struct ca0132_spec *spec = codec->spec;
7346− struct auto_pin_cfg *cfg = &spec->autocfg;
73477352
73487353 spec->dacs[0] = 0x2;
73497354 spec->dacs[1] = 0x3;
@@ -7405,12 +7410,7 @@ static void ca0132_config(struct hda_codec *codec) · 55 unmodified lines
74057410 /* SPDIF I/O */
74067411 spec->dig_out = 0x05;
74077412 spec->multiout.dig_out_nid = spec->dig_out;
7408− cfg->dig_out_pins[0] = 0x0c;
7409− cfg->dig_outs = 1;
7410− cfg->dig_out_type[0] = HDA_PCM_TYPE_SPDIF;
74117413 spec->dig_in = 0x09;
7412− cfg->dig_in_pin = 0x0e;
7413− cfg->dig_in_type = HDA_PCM_TYPE_SPDIF;
74147414 break;
74157415 case QUIRK_R3DI:
74167416 codec_dbg(codec, "%s: QUIRK_R3DI applied.\n", __func__);
@@ -7438,9 +7438,6 @@ static void ca0132_config(struct hda_codec *codec) · 21 unmodified lines
74387438 /* SPDIF I/O */
74397439 spec->dig_out = 0x05;
74407440 spec->multiout.dig_out_nid = spec->dig_out;
7441− cfg->dig_out_pins[0] = 0x0c;
7442− cfg->dig_outs = 1;
7443− cfg->dig_out_type[0] = HDA_PCM_TYPE_SPDIF;
74447441 break;
74457442 default:
74467443 spec->num_outputs = 2;
@@ -7463,12 +7460,7 @@ static void ca0132_config(struct hda_codec *codec) · 16 unmodified lines
74637460 /* SPDIF I/O */
74647461 spec->dig_out = 0x05;
74657462 spec->multiout.dig_out_nid = spec->dig_out;
7466− cfg->dig_out_pins[0] = 0x0c;
7467− cfg->dig_outs = 1;
7468− cfg->dig_out_type[0] = HDA_PCM_TYPE_SPDIF;
74697463 spec->dig_in = 0x09;
7470− cfg->dig_in_pin = 0x0e;
7471− cfg->dig_in_type = HDA_PCM_TYPE_SPDIF;
74727464 break;
74737465 }
74747466 }
@@ -7476,7 +7468,7 @@ static void ca0132_config(struct hda_codec *codec) · 1 unmodified line
74767468 static int ca0132_prepare_verbs(struct hda_codec *codec)
74777469 {
74787470 /* Verbs + terminator (an empty element) */
7479−#define NUM_SPEC_VERBS 4
7471+#define NUM_SPEC_VERBS 2
74807472 struct ca0132_spec *spec = codec->spec;
74817473
74827474 spec->chip_init_verbs = ca0132_init_verbs0;
@@ -7488,34 +7480,24 @@ static int ca0132_prepare_verbs(struct hda_codec *codec) · 5 unmodified lines
74887480 if (!spec->spec_init_verbs)
74897481 return -ENOMEM;
74907482
7491− /* HP jack autodetection */
7492− spec->spec_init_verbs[0].nid = spec->unsol_tag_hp;
7493− spec->spec_init_verbs[0].param = AC_VERB_SET_UNSOLICITED_ENABLE;
7494− spec->spec_init_verbs[0].verb = AC_USRSP_EN | spec->unsol_tag_hp;
7495−
7496− /* MIC1 jack autodetection */
7497− spec->spec_init_verbs[1].nid = spec->unsol_tag_amic1;
7498− spec->spec_init_verbs[1].param = AC_VERB_SET_UNSOLICITED_ENABLE;
7499− spec->spec_init_verbs[1].verb = AC_USRSP_EN | spec->unsol_tag_amic1;
7500−
75017483 /* config EAPD */
7502− spec->spec_init_verbs[2].nid = 0x0b;
7503− spec->spec_init_verbs[2].param = 0x78D;
7504− spec->spec_init_verbs[2].verb = 0x00;
7484+ spec->spec_init_verbs[0].nid = 0x0b;
7485+ spec->spec_init_verbs[0].param = 0x78D;
7486+ spec->spec_init_verbs[0].verb = 0x00;
75057487
75067488 /* Previously commented configuration */
75077489 /*
7508− spec->spec_init_verbs[3].nid = 0x0b;
7509− spec->spec_init_verbs[3].param = AC_VERB_SET_EAPD_BTLENABLE;
7490+ spec->spec_init_verbs[2].nid = 0x0b;
7491+ spec->spec_init_verbs[2].param = AC_VERB_SET_EAPD_BTLENABLE;
7492+ spec->spec_init_verbs[2].verb = 0x02;
7493+
7494+ spec->spec_init_verbs[3].nid = 0x10;
7495+ spec->spec_init_verbs[3].param = 0x78D;
75107496 spec->spec_init_verbs[3].verb = 0x02;
75117497
75127498 spec->spec_init_verbs[4].nid = 0x10;
7513− spec->spec_init_verbs[4].param = 0x78D;
7499+ spec->spec_init_verbs[4].param = AC_VERB_SET_EAPD_BTLENABLE;
75147500 spec->spec_init_verbs[4].verb = 0x02;
7515−
7516− spec->spec_init_verbs[5].nid = 0x10;
7517− spec->spec_init_verbs[5].param = AC_VERB_SET_EAPD_BTLENABLE;
7518− spec->spec_init_verbs[5].verb = 0x02;
75197501 */
75207502
75217503 /* Terminator: spec->spec_init_verbs[NUM_SPEC_VERBS-1] */
sound/pci/hda/patch_hdmi.c+5−0
@@ -3741,6 +3741,11 @@ static int patch_atihdmi(struct hda_codec *codec) · 3740 unmodified lines
37413741
37423742 spec->chmap.channels_max = max(spec->chmap.channels_max, 8u);
37433743
3744+ /* AMD GPUs have neither EPSS nor CLKSTOP bits, hence preventing
3745+ * the link-down as is. Tell the core to allow it.
3746+ */
3747+ codec->link_down_at_suspend = 1;
3748+
37443749 return 0;
37453750 }
37463751
sound/pci/hda/patch_realtek.c+17−3
@@ -2545,6 +2545,7 @@ static const struct snd_pci_quirk alc262_fixup_tbl[] = { · 2544 unmodified lines
25452545 SND_PCI_QUIRK(0x10cf, 0x1397, "Fujitsu Lifebook S7110", ALC262_FIXUP_FSC_S7110),
25462546 SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FIXUP_BENQ),
25472547 SND_PCI_QUIRK(0x10f1, 0x2915, "Tyan Thunder n6650W", ALC262_FIXUP_TYAN),
2548+ SND_PCI_QUIRK(0x1734, 0x1141, "FSC ESPRIMO U9210", ALC262_FIXUP_FSC_H270),
25482549 SND_PCI_QUIRK(0x1734, 0x1147, "FSC Celsius H270", ALC262_FIXUP_FSC_H270),
25492550 SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000", ALC262_FIXUP_LENOVO_3000),
25502551 SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_FIXUP_BENQ),
@@ -4995,7 +4996,6 @@ static void alc_fixup_tpt440_dock(struct hda_codec *codec, · 2444 unmodified lines
49954996 struct alc_spec *spec = codec->spec;
49964997
49974998 if (action == HDA_FIXUP_ACT_PRE_PROBE) {
4998− spec->shutup = alc_no_shutup; /* reduce click noise */
49994999 spec->reboot_notify = alc_d3_at_reboot; /* reduce noise */
50005000 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
50015001 codec->power_save_node = 0; /* avoid click noises */
@@ -5394,6 +5394,13 @@ static void alc274_fixup_bind_dacs(struct hda_codec *codec, · 392 unmodified lines
53945394 /* for hda_fixup_thinkpad_acpi() */
53955395 #include "thinkpad_helper.c"
53965396
5397+static void alc_fixup_thinkpad_acpi(struct hda_codec *codec,
5398+ const struct hda_fixup *fix, int action)
5399+{
5400+ alc_fixup_no_shutup(codec, fix, action); /* reduce click noise */
5401+ hda_fixup_thinkpad_acpi(codec, fix, action);
5402+}
5403+
53975404 /* for dell wmi mic mute led */
53985405 #include "dell_wmi_helper.c"
53995406
@@ -5946,7 +5953,7 @@ static const struct hda_fixup alc269_fixups[] = { · 546 unmodified lines
59465953 },
59475954 [ALC269_FIXUP_THINKPAD_ACPI] = {
59485955 .type = HDA_FIXUP_FUNC,
5949− .v.func = hda_fixup_thinkpad_acpi,
5956+ .v.func = alc_fixup_thinkpad_acpi,
59505957 .chained = true,
59515958 .chain_id = ALC269_FIXUP_SKU_IGNORE,
59525959 },
@@ -6603,8 +6610,9 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { · 650 unmodified lines
66036610 SND_PCI_QUIRK(0x17aa, 0x30bb, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
66046611 SND_PCI_QUIRK(0x17aa, 0x30e2, "ThinkCentre AIO", ALC233_FIXUP_LENOVO_LINE2_MIC_HOTKEY),
66056612 SND_PCI_QUIRK(0x17aa, 0x310c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
6613+ SND_PCI_QUIRK(0x17aa, 0x312a, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
66066614 SND_PCI_QUIRK(0x17aa, 0x312f, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
6607− SND_PCI_QUIRK(0x17aa, 0x3138, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
6615+ SND_PCI_QUIRK(0x17aa, 0x3136, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
66086616 SND_PCI_QUIRK(0x17aa, 0x313c, "ThinkCentre Station", ALC294_FIXUP_LENOVO_MIC_LOCATION),
66096617 SND_PCI_QUIRK(0x17aa, 0x3902, "Lenovo E50-80", ALC269_FIXUP_DMIC_THINKPAD_ACPI),
66106618 SND_PCI_QUIRK(0x17aa, 0x3977, "IdeaPad S210", ALC283_FIXUP_INT_MIC),
@@ -6782,6 +6790,12 @@ static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = { · 171 unmodified lines
67826790 {0x14, 0x90170110},
67836791 {0x19, 0x02a11030},
67846792 {0x21, 0x02211020}),
6793+ SND_HDA_PIN_QUIRK(0x10ec0235, 0x17aa, "Lenovo", ALC294_FIXUP_LENOVO_MIC_LOCATION,
6794+ {0x14, 0x90170110},
6795+ {0x19, 0x02a11030},
6796+ {0x1a, 0x02a11040},
6797+ {0x1b, 0x01014020},
6798+ {0x21, 0x0221101f}),
67856799 SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
67866800 {0x12, 0x90a60140},
67876801 {0x14, 0x90170110},
sound/pci/lx6464es/lx6464es.c+1−0
@@ -1018,6 +1018,7 @@ static int snd_lx6464es_create(struct snd_card *card, · 1017 unmodified lines
10181018 chip->port_dsp_bar = pci_ioremap_bar(pci, 2);
10191019 if (!chip->port_dsp_bar) {
10201020 dev_err(card->dev, "cannot remap PCI memory region\n");
1021+ err = -ENOMEM;
10211022 goto remap_pci_failed;
10221023 }
10231024
tools/arch/arm/include/uapi/asm/kvm.h+1−0
@@ -91,6 +91,7 @@ struct kvm_regs { · 90 unmodified lines
9191 #define KVM_VGIC_V3_ADDR_TYPE_DIST 2
9292 #define KVM_VGIC_V3_ADDR_TYPE_REDIST 3
9393 #define KVM_VGIC_ITS_ADDR_TYPE 4
94+#define KVM_VGIC_V3_ADDR_TYPE_REDIST_REGION 5
9495
9596 #define KVM_VGIC_V3_DIST_SIZE SZ_64K
9697 #define KVM_VGIC_V3_REDIST_SIZE (2 * SZ_64K)
tools/arch/arm64/include/uapi/asm/kvm.h+1−0
@@ -91,6 +91,7 @@ struct kvm_regs { · 90 unmodified lines
9191 #define KVM_VGIC_V3_ADDR_TYPE_DIST 2
9292 #define KVM_VGIC_V3_ADDR_TYPE_REDIST 3
9393 #define KVM_VGIC_ITS_ADDR_TYPE 4
94+#define KVM_VGIC_V3_ADDR_TYPE_REDIST_REGION 5
9495
9596 #define KVM_VGIC_V3_DIST_SIZE SZ_64K
9697 #define KVM_VGIC_V3_REDIST_SIZE (2 * SZ_64K)
tools/arch/powerpc/include/uapi/asm/kvm.h+1−0
@@ -633,6 +633,7 @@ struct kvm_ppc_cpu_char { · 632 unmodified lines
633633 #define KVM_REG_PPC_PSSCR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xbd)
634634
635635 #define KVM_REG_PPC_DEC_EXPIRY (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xbe)
636+#define KVM_REG_PPC_ONLINE (KVM_REG_PPC | KVM_REG_SIZE_U32 | 0xbf)
636637
637638 /* Transactional Memory checkpointed state:
638639 * This is all GPRs, all VSX regs and a subset of SPRs
tools/arch/powerpc/include/uapi/asm/unistd.h+1−0
@@ -398,5 +398,6 @@ · 397 unmodified lines
398398 #define __NR_pkey_alloc 384
399399 #define __NR_pkey_free 385
400400 #define __NR_pkey_mprotect 386
401+#define __NR_rseq 387
401402
402403 #endif /* _UAPI_ASM_POWERPC_UNISTD_H_ */
tools/arch/x86/include/asm/cpufeatures.h+2−0
@@ -282,7 +282,9 @@ · 281 unmodified lines
282282 #define X86_FEATURE_AMD_IBPB (13*32+12) /* "" Indirect Branch Prediction Barrier */
283283 #define X86_FEATURE_AMD_IBRS (13*32+14) /* "" Indirect Branch Restricted Speculation */
284284 #define X86_FEATURE_AMD_STIBP (13*32+15) /* "" Single Thread Indirect Branch Predictors */
285+#define X86_FEATURE_AMD_SSBD (13*32+24) /* "" Speculative Store Bypass Disable */
285286 #define X86_FEATURE_VIRT_SSBD (13*32+25) /* Virtualized Speculative Store Bypass Disable */
287+#define X86_FEATURE_AMD_SSB_NO (13*32+26) /* "" Speculative Store Bypass is fixed in hardware. */
286288
287289 /* Thermal and Power Management Leaf, CPUID level 0x00000006 (EAX), word 14 */
288290 #define X86_FEATURE_DTHERM (14*32+ 0) /* Digital Thermal Sensor */
tools/bpf/bpftool/prog.c+8−4
@@ -694,15 +694,19 @@ static int do_load(int argc, char **argv) · 693 unmodified lines
694694 return -1;
695695 }
696696
697− if (do_pin_fd(prog_fd, argv[1])) {
698− p_err("failed to pin program");
699− return -1;
700− }
697+ if (do_pin_fd(prog_fd, argv[1]))
698+ goto err_close_obj;
701699
702700 if (json_output)
703701 jsonw_null(json_wtr);
704702
703+ bpf_object__close(obj);
704+
705705 return 0;
706+
707+err_close_obj:
708+ bpf_object__close(obj);
709+ return -1;
706710 }
707711
708712 static int do_help(int argc, char **argv)
tools/include/uapi/drm/drm.h+7−0
@@ -680,6 +680,13 @@ struct drm_get_cap { · 679 unmodified lines
680680 */
681681 #define DRM_CLIENT_CAP_ATOMIC 3
682682
683+/**
684+ * DRM_CLIENT_CAP_ASPECT_RATIO
685+ *
686+ * If set to 1, the DRM core will provide aspect ratio information in modes.
687+ */
688+#define DRM_CLIENT_CAP_ASPECT_RATIO 4
689+
683690 /** DRM_IOCTL_SET_CLIENT_CAP ioctl argument type */
684691 struct drm_set_client_cap {
685692 __u64 capability;
tools/include/uapi/linux/bpf.h+1−1
@@ -2630,7 +2630,7 @@ struct bpf_fib_lookup { · 2629 unmodified lines
26302630 union {
26312631 /* inputs to lookup */
26322632 __u8 tos; /* AF_INET */
2633− __be32 flowlabel; /* AF_INET6 */
2633+ __be32 flowinfo; /* AF_INET6, flow_label + priority */
26342634
26352635 /* output: metric of fib result (IPv4/IPv6 only) */
26362636 __u32 rt_metric;
tools/include/uapi/linux/if_link.h+2−0
@@ -333,6 +333,7 @@ enum { · 332 unmodified lines
333333 IFLA_BRPORT_BCAST_FLOOD,
334334 IFLA_BRPORT_GROUP_FWD_MASK,
335335 IFLA_BRPORT_NEIGH_SUPPRESS,
336+ IFLA_BRPORT_ISOLATED,
336337 __IFLA_BRPORT_MAX
337338 };
338339 #define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1)
@@ -516,6 +517,7 @@ enum { · 177 unmodified lines
516517 IFLA_VXLAN_COLLECT_METADATA,
517518 IFLA_VXLAN_LABEL,
518519 IFLA_VXLAN_GPE,
520+ IFLA_VXLAN_TTL_INHERIT,
519521 __IFLA_VXLAN_MAX
520522 };
521523 #define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1)
tools/include/uapi/linux/kvm.h+1−0
@@ -948,6 +948,7 @@ struct kvm_ppc_resize_hpt { · 947 unmodified lines
948948 #define KVM_CAP_S390_BPB 152
949949 #define KVM_CAP_GET_MSR_FEATURES 153
950950 #define KVM_CAP_HYPERV_EVENTFD 154
951+#define KVM_CAP_HYPERV_TLBFLUSH 155
951952
952953 #ifdef KVM_CAP_IRQ_ROUTING
953954
tools/perf/arch/powerpc/util/skip-callchain-idx.c+1−1
@@ -243,7 +243,7 @@ int arch_skip_callchain_idx(struct thread *thread, struct ip_callchain *chain) · 242 unmodified lines
243243 u64 ip;
244244 u64 skip_slot = -1;
245245
246− if (chain->nr < 3)
246+ if (!chain || chain->nr < 3)
247247 return skip_slot;
248248
249249 ip = chain->ips[2];
tools/perf/arch/x86/entry/syscalls/syscall_64.tbl+2−0
@@ -341,6 +341,8 @@ · 340 unmodified lines
341341 330 common pkey_alloc __x64_sys_pkey_alloc
342342 331 common pkey_free __x64_sys_pkey_free
343343 332 common statx __x64_sys_statx
344+333 common io_pgetevents __x64_sys_io_pgetevents
345+334 common rseq __x64_sys_rseq
344346
345347 #
346348 # x32-specific system call numbers start at 512 to avoid cache impact
tools/perf/bench/numa.c+3−2
@@ -1098,7 +1098,7 @@ static void *worker_thread(void *__tdata) · 1097 unmodified lines
10981098 u8 *global_data;
10991099 u8 *process_data;
11001100 u8 *thread_data;
1101− u64 bytes_done;
1101+ u64 bytes_done, secs;
11021102 long work_done;
11031103 u32 l;
11041104 struct rusage rusage;
@@ -1254,7 +1254,8 @@ static void *worker_thread(void *__tdata) · 149 unmodified lines
12541254 timersub(&stop, &start0, &diff);
12551255 td->runtime_ns = diff.tv_sec * NSEC_PER_SEC;
12561256 td->runtime_ns += diff.tv_usec * NSEC_PER_USEC;
1257− td->speed_gbs = bytes_done / (td->runtime_ns / NSEC_PER_SEC) / 1e9;
1257+ secs = td->runtime_ns / NSEC_PER_SEC;
1258+ td->speed_gbs = secs ? bytes_done / secs / 1e9 : 0;
12581259
12591260 getrusage(RUSAGE_THREAD, &rusage);
12601261 td->system_time_ns = rusage.ru_stime.tv_sec * NSEC_PER_SEC;
tools/perf/builtin-annotate.c+10−1
@@ -283,6 +283,15 @@ out_put: · 282 unmodified lines
283283 return ret;
284284 }
285285
286+static int process_feature_event(struct perf_tool *tool,
287+ union perf_event *event,
288+ struct perf_session *session)
289+{
290+ if (event->feat.feat_id < HEADER_LAST_FEATURE)
291+ return perf_event__process_feature(tool, event, session);
292+ return 0;
293+}
294+
286295 static int hist_entry__tty_annotate(struct hist_entry *he,
287296 struct perf_evsel *evsel,
288297 struct perf_annotate *ann)
@@ -471,7 +480,7 @@ int cmd_annotate(int argc, const char **argv) · 182 unmodified lines
471480 .attr = perf_event__process_attr,
472481 .build_id = perf_event__process_build_id,
473482 .tracing_data = perf_event__process_tracing_data,
474− .feature = perf_event__process_feature,
483+ .feature = process_feature_event,
475484 .ordered_events = true,
476485 .ordering_requires_timestamps = true,
477486 },
tools/perf/builtin-report.c+2−1
@@ -217,7 +217,8 @@ static int process_feature_event(struct perf_tool *tool, · 216 unmodified lines
217217 }
218218
219219 /*
220− * All features are received, we can force the
220+ * (feat_id = HEADER_LAST_FEATURE) is the end marker which
221+ * means all features are received, now we can force the
221222 * group if needed.
222223 */
223224 setup_forced_leader(rep, session->evlist);
tools/perf/builtin-script.c+27−3
@@ -1834,6 +1834,7 @@ static int process_attr(struct perf_tool *tool, union perf_event *event, · 1833 unmodified lines
18341834 struct perf_evlist *evlist;
18351835 struct perf_evsel *evsel, *pos;
18361836 int err;
1837+ static struct perf_evsel_script *es;
18371838
18381839 err = perf_event__process_attr(tool, event, pevlist);
18391840 if (err)
@@ -1842,6 +1843,19 @@ static int process_attr(struct perf_tool *tool, union perf_event *event, · 2 unmodified lines
18421843 evlist = *pevlist;
18431844 evsel = perf_evlist__last(*pevlist);
18441845
1846+ if (!evsel->priv) {
1847+ if (scr->per_event_dump) {
1848+ evsel->priv = perf_evsel_script__new(evsel,
1849+ scr->session->data);
1850+ } else {
1851+ es = zalloc(sizeof(*es));
1852+ if (!es)
1853+ return -ENOMEM;
1854+ es->fp = stdout;
1855+ evsel->priv = es;
1856+ }
1857+ }
1858+
18451859 if (evsel->attr.type >= PERF_TYPE_MAX &&
18461860 evsel->attr.type != PERF_TYPE_SYNTH)
18471861 return 0;
@@ -3030,6 +3044,15 @@ int process_cpu_map_event(struct perf_tool *tool __maybe_unused, · 1182 unmodified lines
30303044 return set_maps(script);
30313045 }
30323046
3047+static int process_feature_event(struct perf_tool *tool,
3048+ union perf_event *event,
3049+ struct perf_session *session)
3050+{
3051+ if (event->feat.feat_id < HEADER_LAST_FEATURE)
3052+ return perf_event__process_feature(tool, event, session);
3053+ return 0;
3054+}
3055+
30333056 #ifdef HAVE_AUXTRACE_SUPPORT
30343057 static int perf_script__process_auxtrace_info(struct perf_tool *tool,
30353058 union perf_event *event,
@@ -3074,7 +3097,7 @@ int cmd_script(int argc, const char **argv) · 38 unmodified lines
30743097 .attr = process_attr,
30753098 .event_update = perf_event__process_event_update,
30763099 .tracing_data = perf_event__process_tracing_data,
3077− .feature = perf_event__process_feature,
3100+ .feature = process_feature_event,
30783101 .build_id = perf_event__process_build_id,
30793102 .id_index = perf_event__process_id_index,
30803103 .auxtrace_info = perf_script__process_auxtrace_info,
@@ -3125,8 +3148,9 @@ int cmd_script(int argc, const char **argv) · 44 unmodified lines
31253148 "+field to add and -field to remove."
31263149 "Valid types: hw,sw,trace,raw,synth. "
31273150 "Fields: comm,tid,pid,time,cpu,event,trace,ip,sym,dso,"
3128− "addr,symoff,period,iregs,uregs,brstack,brstacksym,flags,"
3129− "bpf-output,callindent,insn,insnlen,brstackinsn,synth,phys_addr",
3151+ "addr,symoff,srcline,period,iregs,uregs,brstack,"
3152+ "brstacksym,flags,bpf-output,brstackinsn,brstackoff,"
3153+ "callindent,insn,insnlen,synth,phys_addr,metric,misc",
31303154 parse_output_fields),
31313155 OPT_BOOLEAN('a', "all-cpus", &system_wide,
31323156 "system-wide collection from all CPUs"),
tools/perf/tests/parse-events.c+20−5
@@ -1309,6 +1309,11 @@ static int test__checkevent_config_cache(struct perf_evlist *evlist) · 1308 unmodified lines
13091309 return 0;
13101310 }
13111311
1312+static bool test__intel_pt_valid(void)
1313+{
1314+ return !!perf_pmu__find("intel_pt");
1315+}
1316+
13121317 static int test__intel_pt(struct perf_evlist *evlist)
13131318 {
13141319 struct perf_evsel *evsel = perf_evlist__first(evlist);
@@ -1375,6 +1380,7 @@ struct evlist_test { · 60 unmodified lines
13751380 const char *name;
13761381 __u32 type;
13771382 const int id;
1383+ bool (*valid)(void);
13781384 int (*check)(struct perf_evlist *evlist);
13791385 };
13801386
@@ -1648,6 +1654,7 @@ static struct evlist_test test__events[] = { · 267 unmodified lines
16481654 },
16491655 {
16501656 .name = "intel_pt//u",
1657+ .valid = test__intel_pt_valid,
16511658 .check = test__intel_pt,
16521659 .id = 52,
16531660 },
@@ -1686,17 +1693,24 @@ static struct terms_test test__terms[] = { · 32 unmodified lines
16861693
16871694 static int test_event(struct evlist_test *e)
16881695 {
1696+ struct parse_events_error err = { .idx = 0, };
16891697 struct perf_evlist *evlist;
16901698 int ret;
16911699
1700+ if (e->valid && !e->valid()) {
1701+ pr_debug("... SKIP");
1702+ return 0;
1703+ }
1704+
16921705 evlist = perf_evlist__new();
16931706 if (evlist == NULL)
16941707 return -ENOMEM;
16951708
1696− ret = parse_events(evlist, e->name, NULL);
1709+ ret = parse_events(evlist, e->name, &err);
16971710 if (ret) {
1698− pr_debug("failed to parse event '%s', err %d\n",
1699− e->name, ret);
1711+ pr_debug("failed to parse event '%s', err %d, str '%s'\n",
1712+ e->name, ret, err.str);
1713+ parse_events_print_error(&err, e->name);
17001714 } else {
17011715 ret = e->check(evlist);
17021716 }
@@ -1714,10 +1728,11 @@ static int test_events(struct evlist_test *events, unsigned cnt) · 11 unmodified lines
17141728 for (i = 0; i < cnt; i++) {
17151729 struct evlist_test *e = &events[i];
17161730
1717− pr_debug("running test %d '%s'\n", e->id, e->name);
1731+ pr_debug("running test %d '%s'", e->id, e->name);
17181732 ret1 = test_event(e);
17191733 if (ret1)
17201734 ret2 = ret1;
1735+ pr_debug("\n");
17211736 }
17221737
17231738 return ret2;
@@ -1799,7 +1814,7 @@ static int test_pmu_events(void) · 75 unmodified lines
17991814 }
18001815
18011816 while (!ret && (ent = readdir(dir))) {
1802− struct evlist_test e;
1817+ struct evlist_test e = { .id = 0, };
18031818 char name[2 * NAME_MAX + 1 + 12 + 3];
18041819
18051820 /* Names containing . are special and cannot be used directly */
tools/perf/tests/topology.c+1−0
@@ -45,6 +45,7 @@ static int session_write_header(char *path) · 44 unmodified lines
4545
4646 perf_header__set_feat(&session->header, HEADER_CPU_TOPOLOGY);
4747 perf_header__set_feat(&session->header, HEADER_NRCPUS);
48+ perf_header__set_feat(&session->header, HEADER_ARCH);
4849
4950 session->header.data_size += DATA_SIZE;
5051
tools/perf/util/c++/clang.cpp+9−2
@@ -146,8 +146,15 @@ getBPFObjectFromModule(llvm::Module *Module) · 145 unmodified lines
146146 raw_svector_ostream ostream(*Buffer);
147147
148148 legacy::PassManager PM;
149− if (TargetMachine->addPassesToEmitFile(PM, ostream,
150− TargetMachine::CGFT_ObjectFile)) {
149+ bool NotAdded;
150+#if CLANG_VERSION_MAJOR < 7
151+ NotAdded = TargetMachine->addPassesToEmitFile(PM, ostream,
152+ TargetMachine::CGFT_ObjectFile);
153+#else
154+ NotAdded = TargetMachine->addPassesToEmitFile(PM, ostream, nullptr,
155+ TargetMachine::CGFT_ObjectFile);
156+#endif
157+ if (NotAdded) {
151158 llvm::errs() << "TargetMachine can't emit a file of this type\n";
152159 return std::unique_ptr<llvm::SmallVectorImpl<char>>(nullptr);;
153160 }
tools/perf/util/header.c+10−2
@@ -2129,6 +2129,7 @@ static int process_cpu_topology(struct feat_fd *ff, void *data __maybe_unused) · 2128 unmodified lines
21292129 int cpu_nr = ff->ph->env.nr_cpus_avail;
21302130 u64 size = 0;
21312131 struct perf_header *ph = ff->ph;
2132+ bool do_core_id_test = true;
21322133
21332134 ph->env.cpu = calloc(cpu_nr, sizeof(*ph->env.cpu));
21342135 if (!ph->env.cpu)
@@ -2183,6 +2184,13 @@ static int process_cpu_topology(struct feat_fd *ff, void *data __maybe_unused) · 48 unmodified lines
21832184 return 0;
21842185 }
21852186
2187+ /* On s390 the socket_id number is not related to the numbers of cpus.
2188+ * The socket_id number might be higher than the numbers of cpus.
2189+ * This depends on the configuration.
2190+ */
2191+ if (ph->env.arch && !strncmp(ph->env.arch, "s390", 4))
2192+ do_core_id_test = false;
2193+
21862194 for (i = 0; i < (u32)cpu_nr; i++) {
21872195 if (do_read_u32(ff, &nr))
21882196 goto free_cpu;
@@ -2192,7 +2200,7 @@ static int process_cpu_topology(struct feat_fd *ff, void *data __maybe_unused) · 3 unmodified lines
21922200 if (do_read_u32(ff, &nr))
21932201 goto free_cpu;
21942202
2195− if (nr != (u32)-1 && nr > (u32)cpu_nr) {
2203+ if (do_core_id_test && nr != (u32)-1 && nr > (u32)cpu_nr) {
21962204 pr_debug("socket_id number is too big."
21972205 "You may need to upgrade the perf tool.\n");
21982206 goto free_cpu;
@@ -3456,7 +3464,7 @@ int perf_event__process_feature(struct perf_tool *tool, · 1257 unmodified lines
34563464 pr_warning("invalid record type %d in pipe-mode\n", type);
34573465 return 0;
34583466 }
3459− if (feat == HEADER_RESERVED || feat > HEADER_LAST_FEATURE) {
3467+ if (feat == HEADER_RESERVED || feat >= HEADER_LAST_FEATURE) {
34603468 pr_warning("invalid record type %d in pipe-mode\n", type);
34613469 return -1;
34623470 }
tools/perf/util/intel-pt-decoder/intel-pt-pkt-decoder.c+1−1
@@ -366,7 +366,7 @@ static int intel_pt_get_cyc(unsigned int byte, const unsigned char *buf, · 365 unmodified lines
366366 if (len < offs)
367367 return INTEL_PT_NEED_MORE_BYTES;
368368 byte = buf[offs++];
369− payload |= (byte >> 1) << shift;
369+ payload |= ((uint64_t)byte >> 1) << shift;
370370 }
371371
372372 packet->type = INTEL_PT_CYC;
tools/perf/util/pmu.c+97−2
@@ -234,6 +234,74 @@ static int perf_pmu__parse_snapshot(struct perf_pmu_alias *alias, · 233 unmodified lines
234234 return 0;
235235 }
236236
237+static void perf_pmu_assign_str(char *name, const char *field, char **old_str,
238+ char **new_str)
239+{
240+ if (!*old_str)
241+ goto set_new;
242+
243+ if (*new_str) { /* Have new string, check with old */
244+ if (strcasecmp(*old_str, *new_str))
245+ pr_debug("alias %s differs in field '%s'\n",
246+ name, field);
247+ zfree(old_str);
248+ } else /* Nothing new --> keep old string */
249+ return;
250+set_new:
251+ *old_str = *new_str;
252+ *new_str = NULL;
253+}
254+
255+static void perf_pmu_update_alias(struct perf_pmu_alias *old,
256+ struct perf_pmu_alias *newalias)
257+{
258+ perf_pmu_assign_str(old->name, "desc", &old->desc, &newalias->desc);
259+ perf_pmu_assign_str(old->name, "long_desc", &old->long_desc,
260+ &newalias->long_desc);
261+ perf_pmu_assign_str(old->name, "topic", &old->topic, &newalias->topic);
262+ perf_pmu_assign_str(old->name, "metric_expr", &old->metric_expr,
263+ &newalias->metric_expr);
264+ perf_pmu_assign_str(old->name, "metric_name", &old->metric_name,
265+ &newalias->metric_name);
266+ perf_pmu_assign_str(old->name, "value", &old->str, &newalias->str);
267+ old->scale = newalias->scale;
268+ old->per_pkg = newalias->per_pkg;
269+ old->snapshot = newalias->snapshot;
270+ memcpy(old->unit, newalias->unit, sizeof(old->unit));
271+}
272+
273+/* Delete an alias entry. */
274+static void perf_pmu_free_alias(struct perf_pmu_alias *newalias)
275+{
276+ zfree(&newalias->name);
277+ zfree(&newalias->desc);
278+ zfree(&newalias->long_desc);
279+ zfree(&newalias->topic);
280+ zfree(&newalias->str);
281+ zfree(&newalias->metric_expr);
282+ zfree(&newalias->metric_name);
283+ parse_events_terms__purge(&newalias->terms);
284+ free(newalias);
285+}
286+
287+/* Merge an alias, search in alias list. If this name is already
288+ * present merge both of them to combine all information.
289+ */
290+static bool perf_pmu_merge_alias(struct perf_pmu_alias *newalias,
291+ struct list_head *alist)
292+{
293+ struct perf_pmu_alias *a;
294+
295+ list_for_each_entry(a, alist, list) {
296+ if (!strcasecmp(newalias->name, a->name)) {
297+ perf_pmu_update_alias(a, newalias);
298+ perf_pmu_free_alias(newalias);
299+ return true;
300+ }
301+ }
302+ return false;
303+}
304+
237305 static int __perf_pmu__new_alias(struct list_head *list, char *dir, char *name,
238306 char *desc, char *val,
239307 char *long_desc, char *topic,
@@ -241,9 +309,11 @@ static int __perf_pmu__new_alias(struct list_head *list, char *dir, char *name, · 1 unmodified line
241309 char *metric_expr,
242310 char *metric_name)
243311 {
312+ struct parse_events_term *term;
244313 struct perf_pmu_alias *alias;
245314 int ret;
246315 int num;
316+ char newval[256];
247317
248318 alias = malloc(sizeof(*alias));
249319 if (!alias)
@@ -262,6 +332,27 @@ static int __perf_pmu__new_alias(struct list_head *list, char *dir, char *name, · 12 unmodified lines
262332 return ret;
263333 }
264334
335+ /* Scan event and remove leading zeroes, spaces, newlines, some
336+ * platforms have terms specified as
337+ * event=0x0091 (read from files ../<PMU>/events/<FILE>
338+ * and terms specified as event=0x91 (read from JSON files).
339+ *
340+ * Rebuild string to make alias->str member comparable.
341+ */
342+ memset(newval, 0, sizeof(newval));
343+ ret = 0;
344+ list_for_each_entry(term, &alias->terms, list) {
345+ if (ret)
346+ ret += scnprintf(newval + ret, sizeof(newval) - ret,
347+ ",");
348+ if (term->type_val == PARSE_EVENTS__TERM_TYPE_NUM)
349+ ret += scnprintf(newval + ret, sizeof(newval) - ret,
350+ "%s=%#x", term->config, term->val.num);
351+ else if (term->type_val == PARSE_EVENTS__TERM_TYPE_STR)
352+ ret += scnprintf(newval + ret, sizeof(newval) - ret,
353+ "%s=%s", term->config, term->val.str);
354+ }
355+
265356 alias->name = strdup(name);
266357 if (dir) {
267358 /*
@@ -285,9 +376,10 @@ static int __perf_pmu__new_alias(struct list_head *list, char *dir, char *name, · 17 unmodified lines
285376 snprintf(alias->unit, sizeof(alias->unit), "%s", unit);
286377 }
287378 alias->per_pkg = perpkg && sscanf(perpkg, "%d", &num) == 1 && num == 1;
288− alias->str = strdup(val);
379+ alias->str = strdup(newval);
289380
290− list_add_tail(&alias->list, list);
381+ if (!perf_pmu_merge_alias(alias, list))
382+ list_add_tail(&alias->list, list);
291383
292384 return 0;
293385 }
@@ -303,6 +395,9 @@ static int perf_pmu__new_alias(struct list_head *list, char *dir, char *name, FI · 9 unmodified lines
303395
304396 buf[ret] = 0;
305397
398+ /* Remove trailing newline from sysfs file */
399+ rtrim(buf);
400+
306401 return __perf_pmu__new_alias(list, dir, name, NULL, buf, NULL, NULL, NULL,
307402 NULL, NULL, NULL);
308403 }
tools/testing/selftests/bpf/config+1−0
@@ -6,6 +6,7 @@ CONFIG_TEST_BPF=m · 5 unmodified lines
66 CONFIG_CGROUP_BPF=y
77 CONFIG_NETDEVSIM=m
88 CONFIG_NET_CLS_ACT=y
9+CONFIG_NET_SCHED=y
910 CONFIG_NET_SCH_INGRESS=y
1011 CONFIG_NET_IPIP=y
1112 CONFIG_IPV6=y
tools/testing/selftests/bpf/test_kmod.sh+9−0
@@ -1,6 +1,15 @@
11 #!/bin/sh
22 # SPDX-License-Identifier: GPL-2.0
33
4+# Kselftest framework requirement - SKIP code is 4.
5+ksft_skip=4
6+
7+msg="skip all tests:"
8+if [ "$(id -u)" != "0" ]; then
9+ echo $msg please run this as root >&2
10+ exit $ksft_skip
11+fi
12+
413 SRC_TREE=../../../../
514
615 test_run()
tools/testing/selftests/bpf/test_lirc_mode2.sh+9−0
@@ -1,6 +1,15 @@
11 #!/bin/bash
22 # SPDX-License-Identifier: GPL-2.0
33
4+# Kselftest framework requirement - SKIP code is 4.
5+ksft_skip=4
6+
7+msg="skip all tests:"
8+if [ $UID != 0 ]; then
9+ echo $msg please run this as root >&2
10+ exit $ksft_skip
11+fi
12+
413 GREEN='\033[0;92m'
514 RED='\033[0;31m'
615 NC='\033[0m' # No Color
tools/testing/selftests/bpf/test_lwt_seg6local.sh+9−0
@@ -21,6 +21,15 @@ · 20 unmodified lines
2121 # An UDP datagram is sent from fb00::1 to fb00::6. The test succeeds if this
2222 # datagram can be read on NS6 when binding to fb00::6.
2323
24+# Kselftest framework requirement - SKIP code is 4.
25+ksft_skip=4
26+
27+msg="skip all tests:"
28+if [ $UID != 0 ]; then
29+ echo $msg please run this as root >&2
30+ exit $ksft_skip
31+fi
32+
2433 TMP_FILE="/tmp/selftest_lwt_seg6local.txt"
2534
2635 cleanup()
tools/testing/selftests/bpf/test_sockmap.c+0−6
@@ -1413,18 +1413,12 @@ out: · 1412 unmodified lines
14131413
14141414 int main(int argc, char **argv)
14151415 {
1416− struct rlimit r = {10 * 1024 * 1024, RLIM_INFINITY};
14171416 int iov_count = 1, length = 1024, rate = 1;
14181417 struct sockmap_options options = {0};
14191418 int opt, longindex, err, cg_fd = 0;
14201419 char *bpf_file = BPF_SOCKMAP_FILENAME;
14211420 int test = PING_PONG;
14221421
1423− if (setrlimit(RLIMIT_MEMLOCK, &r)) {
1424− perror("setrlimit(RLIMIT_MEMLOCK)");
1425− return 1;
1426− }
1427−
14281422 if (argc < 2)
14291423 return test_suite();
14301424
tools/testing/selftests/net/fib_tests.sh+0−0

File mode changed from 100644 to 100755.

tools/testing/selftests/x86/sigreturn.c+36−23
@@ -610,21 +610,41 @@ static int test_valid_sigreturn(int cs_bits, bool use_16bit_ss, int force_ss) · 609 unmodified lines
610610 */
611611 for (int i = 0; i < NGREG; i++) {
612612 greg_t req = requested_regs[i], res = resulting_regs[i];
613+
613614 if (i == REG_TRAPNO || i == REG_IP)
614615 continue; /* don't care */
615− if (i == REG_SP) {
616− printf("\tSP: %llx -> %llx\n", (unsigned long long)req,
617− (unsigned long long)res);
618616
617+ if (i == REG_SP) {
619618 /*
620− * In many circumstances, the high 32 bits of rsp
621− * are zeroed. For example, we could be a real
622− * 32-bit program, or we could hit any of a number
623− * of poorly-documented IRET or segmented ESP
624− * oddities. If this happens, it's okay.
619+ * If we were using a 16-bit stack segment, then
620+ * the kernel is a bit stuck: IRET only restores
621+ * the low 16 bits of ESP/RSP if SS is 16-bit.
622+ * The kernel uses a hack to restore bits 31:16,
623+ * but that hack doesn't help with bits 63:32.
624+ * On Intel CPUs, bits 63:32 end up zeroed, and, on
625+ * AMD CPUs, they leak the high bits of the kernel
626+ * espfix64 stack pointer. There's very little that
627+ * the kernel can do about it.
628+ *
629+ * Similarly, if we are returning to a 32-bit context,
630+ * the CPU will often lose the high 32 bits of RSP.
625631 */
626− if (res == (req & 0xFFFFFFFF))
627− continue; /* OK; not expected to work */
632+
633+ if (res == req)
634+ continue;
635+
636+ if (cs_bits != 64 && ((res ^ req) & 0xFFFFFFFF) == 0) {
637+ printf("[NOTE]\tSP: %llx -> %llx\n",
638+ (unsigned long long)req,
639+ (unsigned long long)res);
640+ continue;
641+ }
642+
643+ printf("[FAIL]\tSP mismatch: requested 0x%llx; got 0x%llx\n",
644+ (unsigned long long)requested_regs[i],
645+ (unsigned long long)resulting_regs[i]);
646+ nerrs++;
647+ continue;
628648 }
629649
630650 bool ignore_reg = false;
@@ -654,25 +674,18 @@ static int test_valid_sigreturn(int cs_bits, bool use_16bit_ss, int force_ss) · 23 unmodified lines
654674 #endif
655675
656676 /* Sanity check on the kernel */
657− if (i == REG_CX && requested_regs[i] != resulting_regs[i]) {
677+ if (i == REG_CX && req != res) {
658678 printf("[FAIL]\tCX (saved SP) mismatch: requested 0x%llx; got 0x%llx\n",
659− (unsigned long long)requested_regs[i],
660− (unsigned long long)resulting_regs[i]);
679+ (unsigned long long)req,
680+ (unsigned long long)res);
661681 nerrs++;
662682 continue;
663683 }
664684
665− if (requested_regs[i] != resulting_regs[i] && !ignore_reg) {
666− /*
667− * SP is particularly interesting here. The
668− * usual cause of failures is that we hit the
669− * nasty IRET case of returning to a 16-bit SS,
670− * in which case bits 16:31 of the *kernel*
671− * stack pointer persist in ESP.
672− */
685+ if (req != res && !ignore_reg) {
673686 printf("[FAIL]\tReg %d mismatch: requested 0x%llx; got 0x%llx\n",
674− i, (unsigned long long)requested_regs[i],
675− (unsigned long long)resulting_regs[i]);
687+ i, (unsigned long long)req,
688+ (unsigned long long)res);
676689 nerrs++;
677690 }
678691 }
tools/virtio/linux/scatterlist.h+0−18
@@ -36,7 +36,6 @@ static inline void sg_assign_page(struct scatterlist *sg, struct page *page) · 35 unmodified lines
3636 */
3737 BUG_ON((unsigned long) page & 0x03);
3838 #ifdef CONFIG_DEBUG_SG
39− BUG_ON(sg->sg_magic != SG_MAGIC);
4039 BUG_ON(sg_is_chain(sg));
4140 #endif
4241 sg->page_link = page_link | (unsigned long) page;
@@ -67,7 +66,6 @@ static inline void sg_set_page(struct scatterlist *sg, struct page *page, · 24 unmodified lines
6766 static inline struct page *sg_page(struct scatterlist *sg)
6867 {
6968 #ifdef CONFIG_DEBUG_SG
70− BUG_ON(sg->sg_magic != SG_MAGIC);
7169 BUG_ON(sg_is_chain(sg));
7270 #endif
7371 return (struct page *)((sg)->page_link & ~0x3);
@@ -116,9 +114,6 @@ static inline void sg_chain(struct scatterlist *prv, unsigned int prv_nents, · 42 unmodified lines
116114 **/
117115 static inline void sg_mark_end(struct scatterlist *sg)
118116 {
119−#ifdef CONFIG_DEBUG_SG
120− BUG_ON(sg->sg_magic != SG_MAGIC);
121−#endif
122117 /*
123118 * Set termination bit, clear potential chain bit
124119 */
@@ -136,17 +131,11 @@ static inline void sg_mark_end(struct scatterlist *sg) · 11 unmodified lines
136131 **/
137132 static inline void sg_unmark_end(struct scatterlist *sg)
138133 {
139−#ifdef CONFIG_DEBUG_SG
140− BUG_ON(sg->sg_magic != SG_MAGIC);
141−#endif
142134 sg->page_link &= ~0x02;
143135 }
144136
145137 static inline struct scatterlist *sg_next(struct scatterlist *sg)
146138 {
147−#ifdef CONFIG_DEBUG_SG
148− BUG_ON(sg->sg_magic != SG_MAGIC);
149−#endif
150139 if (sg_is_last(sg))
151140 return NULL;
152141
@@ -160,13 +149,6 @@ static inline struct scatterlist *sg_next(struct scatterlist *sg) · 7 unmodified lines
160149 static inline void sg_init_table(struct scatterlist *sgl, unsigned int nents)
161150 {
162151 memset(sgl, 0, sizeof(*sgl) * nents);
163−#ifdef CONFIG_DEBUG_SG
164− {
165− unsigned int i;
166− for (i = 0; i < nents; i++)
167− sgl[i].sg_magic = SG_MAGIC;
168− }
169−#endif
170152 sg_mark_end(&sgl[nents - 1]);
171153 }
172154

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