History

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

Two easy cases of overlapping changes.

David S. Miller committed 7 years ago

Commit 8b448362 parents c049d56 cd8dead247 files · +1881 −715Browse files

Unified · Split

247 files
  1. Documentation/devicetree/bindings/net/davinci_emac.txt +2 −0
  2. Documentation/devicetree/bindings/net/ethernet.txt +2 −3
  3. Documentation/devicetree/bindings/net/macb.txt +4 −0
  4. Documentation/media/uapi/rc/rc-tables.rst +2 −2
  5. Documentation/networking/decnet.txt +0 −2
  6. Documentation/networking/ip-sysctl.txt +1 −0
  7. MAINTAINERS +2 −1
  8. Makefile +1 −1
  9. arch/alpha/kernel/syscalls/syscall.tbl +4 −0
  10. arch/arm/tools/syscall.tbl +4 −0
  11. arch/arm64/include/asm/futex.h +1 −1
  12. arch/arm64/include/asm/unistd.h +1 −1
  13. arch/arm64/include/asm/unistd32.h +8 −0
  14. arch/ia64/kernel/syscalls/syscall.tbl +4 −0
  15. arch/m68k/kernel/syscalls/syscall.tbl +4 −0
  16. arch/microblaze/kernel/syscalls/syscall.tbl +4 −0
  17. arch/mips/ath79/setup.c +0 −6
  18. arch/mips/kernel/scall64-o32.S +1 −1
  19. arch/mips/kernel/syscalls/syscall_n32.tbl +4 −0
  20. arch/mips/kernel/syscalls/syscall_n64.tbl +4 −0
  21. arch/mips/kernel/syscalls/syscall_o32.tbl +4 −0
  22. arch/parisc/kernel/syscalls/syscall.tbl +4 −0
  23. arch/powerpc/kernel/syscalls/syscall.tbl +4 −0
  24. arch/s390/boot/mem_detect.c +1 −1
  25. arch/s390/kernel/fpu.c +1 −1
  26. arch/s390/kernel/syscalls/syscall.tbl +4 −0
  27. arch/s390/kernel/vtime.c +4 −4
  28. arch/sh/kernel/syscalls/syscall.tbl +4 −0
  29. arch/sparc/kernel/syscalls/syscall.tbl +4 −0
  30. arch/x86/Kconfig +1 −1
  31. arch/x86/crypto/poly1305-avx2-x86_64.S +10 −4
  32. arch/x86/crypto/poly1305-sse2-x86_64.S +14 −8
  33. arch/x86/events/amd/core.c +26 −9
  34. arch/x86/events/intel/core.c +1 −1
  35. arch/x86/events/perf_event.h +19 −19
  36. arch/x86/kernel/cpu/bugs.c +3 −3
  37. arch/x86/kernel/cpu/intel.c +2 −2
  38. arch/x86/kernel/cpu/resctrl/rdtgroup.c +2 −1
  39. arch/x86/kernel/kprobes/core.c +46 −2
  40. arch/x86/kernel/process.c +6 −2
  41. arch/x86/kernel/reboot.c +21 −0
  42. arch/x86/kernel/vmlinux.lds.S +1 −1
  43. arch/x86/mm/dump_pagetables.c +2 −1
  44. arch/x86/mm/ioremap.c +1 −1
  45. arch/x86/mm/kaslr.c +1 −1
  46. arch/x86/mm/tlb.c +1 −1
  47. arch/xtensa/kernel/syscalls/syscall.tbl +4 −0
  48. block/bfq-iosched.c +7 −1
  49. block/blk-mq.c +2 −0
  50. crypto/testmgr.h +43 −1
  51. drivers/atm/firestream.c +1 −1
  52. drivers/base/memory.c +1 −1
  53. drivers/clocksource/Kconfig +1 −0
  54. drivers/clocksource/arm_arch_timer.c +1 −4
  55. drivers/clocksource/timer-oxnas-rps.c +1 −1
  56. drivers/clocksource/timer-ti-dm.c +0 −28
  57. drivers/extcon/Kconfig +1 −1
  58. drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +1 −0
  59. drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c +1 −0
  60. drivers/gpu/drm/amd/display/dc/core/dc.c +19 −0
  61. drivers/gpu/drm/amd/display/dc/dc.h +3 −0
  62. drivers/gpu/drm/amd/display/dc/dce/dce_aux.c +6 −3
  63. drivers/gpu/drm/amd/display/dc/dce/dce_aux.h +3 −3
  64. drivers/gpu/drm/i915/intel_fbdev.c +5 −7
  65. drivers/gpu/drm/tegra/hdmi.c +9 −3
  66. drivers/gpu/drm/ttm/ttm_bo.c +3 −1
  67. drivers/gpu/drm/ttm/ttm_page_alloc.c +7 −6
  68. drivers/gpu/drm/virtio/virtgpu_drv.c +4 −0
  69. drivers/gpu/drm/virtio/virtgpu_drv.h +4 −0
  70. drivers/gpu/drm/virtio/virtgpu_prime.c +12 −0
  71. drivers/gpu/host1x/hw/channel_hw.c +6 −2
  72. drivers/hid/hid-input.c +16 −1
  73. drivers/i3c/master.c +2 −3
  74. drivers/i3c/master/dw-i3c-master.c +1 −1
  75. drivers/iio/accel/kxcjk-1013.c +2 −0
  76. drivers/iio/adc/ad_sigma_delta.c +1 −0
  77. drivers/iio/adc/at91_adc.c +17 −11
  78. drivers/iio/adc/xilinx-xadc-core.c +2 −1
  79. drivers/iio/chemical/Kconfig +14 −0
  80. drivers/iio/chemical/bme680.h +2 −4
  81. drivers/iio/chemical/bme680_core.c +45 −9
  82. drivers/iio/chemical/bme680_i2c.c +0 −21
  83. drivers/iio/chemical/bme680_spi.c +78 −37
  84. drivers/iio/common/cros_ec_sensors/cros_ec_sensors.c +4 −3
  85. drivers/iio/dac/mcp4725.c +1 −0
  86. drivers/iio/gyro/bmg160_core.c +3 −3
  87. drivers/iio/gyro/mpu3050-core.c +5 −3
  88. drivers/iio/industrialio-buffer.c +2 −3
  89. drivers/iio/industrialio-core.c +2 −2
  90. drivers/infiniband/core/uverbs_main.c +3 −0
  91. drivers/input/keyboard/snvs_pwrkey.c +3 −3
  92. drivers/input/mouse/elan_i2c_core.c +25 −0
  93. drivers/irqchip/irq-ath79-misc.c +11 −0
  94. drivers/misc/fastrpc.c +6 −1
  95. drivers/misc/habanalabs/goya/goya.c +4 −5
  96. drivers/net/ethernet/atheros/atlx/atl1.c +2 −2
  97. drivers/net/ethernet/atheros/atlx/atl1.h +1 −1
  98. drivers/net/ethernet/atheros/atlx/atl2.c +1 −1
  99. drivers/net/ethernet/atheros/atlx/atl2.h +1 −1
  100. drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c +22 −2
  101. drivers/net/ethernet/mellanox/mlx5/core/en/xdp.h +1 −2
  102. drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c +1 −1
  103. drivers/net/ethernet/mellanox/mlx5/core/en_main.c +3 −2
  104. drivers/net/ethernet/mellanox/mlx5/core/port.c +0 −4
  105. drivers/net/ethernet/mellanox/mlxsw/pci_hw.h +1 −1
  106. drivers/net/ethernet/mellanox/mlxsw/spectrum.c +3 −3
  107. drivers/net/ethernet/netronome/nfp/abm/cls.c +2 −2
  108. drivers/net/ethernet/socionext/netsec.c +7 −4
  109. drivers/net/ethernet/stmicro/stmmac/norm_desc.c +1 −1
  110. drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +2 −2
  111. drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c +6 −2
  112. drivers/net/phy/spi_ks8995.c +9 −0
  113. drivers/net/team/team.c +7 −0
  114. drivers/net/vrf.c +2 −0
  115. drivers/nfc/st95hf/core.c +7 −0
  116. drivers/of/of_net.c +0 −1
  117. drivers/power/supply/goldfish_battery.c +1 −1
  118. drivers/s390/block/dasd_eckd.c +3 −3
  119. drivers/s390/char/con3270.c +1 −1
  120. drivers/s390/char/fs3270.c +2 −1
  121. drivers/s390/char/raw3270.c +2 −1
  122. drivers/s390/char/raw3270.h +3 −1
  123. drivers/s390/char/tty3270.c +2 −1
  124. drivers/s390/crypto/ap_queue.c +1 −1
  125. drivers/s390/crypto/pkey_api.c +2 −1
  126. drivers/s390/net/ctcm_main.c +1 −0
  127. drivers/scsi/aic7xxx/aic7770_osm.c +1 −0
  128. drivers/scsi/aic7xxx/aic7xxx.h +1 −0
  129. drivers/scsi/aic7xxx/aic7xxx_osm.c +4 −6
  130. drivers/scsi/aic7xxx/aic7xxx_osm_pci.c +1 −0
  131. drivers/scsi/libfc/fc_rport.c +0 −1
  132. drivers/scsi/scsi_lib.c +5 −1
  133. drivers/staging/comedi/drivers/ni_usb6501.c +4 −6
  134. drivers/staging/comedi/drivers/vmk80xx.c +3 −5
  135. drivers/staging/erofs/data.c +1 −1
  136. drivers/staging/iio/adc/ad7192.c +4 −4
  137. drivers/staging/iio/meter/ade7854.c +1 −1
  138. drivers/staging/most/core.c +1 −1
  139. drivers/tty/serial/sc16is7xx.c +3 −1
  140. drivers/tty/serial/sh-sci.c +4 −2
  141. drivers/tty/vt/vt.c +2 −1
  142. fs/afs/callback.c +1 −2
  143. fs/afs/cmservice.c +1 −1
  144. fs/afs/inode.c +1 −3
  145. fs/afs/internal.h +1 −3
  146. fs/afs/rxrpc.c +5 −1
  147. fs/afs/server.c +0 −1
  148. fs/afs/write.c +1 −0
  149. fs/cifs/cifsglob.h +2 −0
  150. fs/cifs/file.c +25 −5
  151. fs/cifs/misc.c +23 −2
  152. fs/cifs/smb2misc.c +3 −3
  153. fs/cifs/smb2ops.c +2 −0
  154. fs/cifs/smb2pdu.c +7 −4
  155. fs/io_uring.c +30 −11
  156. fs/nfsd/nfs3proc.c +15 −2
  157. fs/nfsd/nfs3xdr.c +9 −2
  158. fs/nfsd/nfs4callback.c +7 −1
  159. fs/nfsd/nfs4state.c +10 −2
  160. fs/nfsd/state.h +1 −0
  161. fs/proc/task_mmu.c +18 −0
  162. fs/userfaultfd.c +9 −0
  163. include/linux/blkdev.h +0 −1
  164. include/linux/bvec.h +3 −2
  165. include/linux/efi.h +6 −1
  166. include/linux/elevator.h +1 −0
  167. include/linux/etherdevice.h +12 −0
  168. include/linux/kprobes.h +1 −0
  169. include/linux/sched/mm.h +21 −0
  170. include/linux/shmem_fs.h +1 −0
  171. include/net/netfilter/nf_conntrack.h +2 −0
  172. include/net/netfilter/nf_conntrack_l4proto.h +6 −0
  173. include/uapi/linux/input-event-codes.h +4 −2
  174. init/main.c +2 −2
  175. kernel/events/core.c +21 −16
  176. kernel/events/ring_buffer.c +15 −18
  177. kernel/kprobes.c +2 −4
  178. kernel/locking/lockdep.c +5 −4
  179. kernel/sched/deadline.c +1 −2
  180. kernel/sched/fair.c +25 −0
  181. kernel/signal.c +1 −1
  182. kernel/time/sched_clock.c +2 −2
  183. kernel/time/tick-common.c +2 −0
  184. kernel/time/timekeeping.h +7 −0
  185. kernel/trace/ftrace.c +5 −1
  186. kernel/watchdog_hld.c +2 −1
  187. lib/Kconfig.debug +3 −3
  188. mm/kmemleak.c +2 −0
  189. mm/mmap.c +6 −1
  190. mm/page_alloc.c +18 −12
  191. mm/percpu.c +4 −4
  192. mm/shmem.c +27 −31
  193. mm/slab.c +0 −1
  194. mm/swapfile.c +17 −15
  195. mm/vmscan.c +9 −20
  196. mm/vmstat.c +0 −5
  197. net/bridge/netfilter/ebtables.c +2 −1
  198. net/ipv4/route.c +23 −9
  199. net/ipv4/sysctl_net_ipv4.c +4 −1
  200. net/ipv6/addrlabel.c +1 −1
  201. net/ncsi/ncsi-rsp.c +5 −1
  202. net/netfilter/ipvs/ip_vs_core.c +1 −1
  203. net/netfilter/nf_conntrack_core.c +38 −5
  204. net/netfilter/nf_conntrack_netlink.c +29 −5
  205. net/netfilter/nf_conntrack_proto.c +1 −1
  206. net/netfilter/nf_conntrack_proto_icmp.c +72 −21
  207. net/netfilter/nf_conntrack_proto_icmpv6.c +6 −46
  208. net/netfilter/nf_nat_core.c +8 −3
  209. net/netfilter/nf_tables_api.c +1 −1
  210. net/netfilter/nfnetlink_log.c +1 −1
  211. net/netfilter/nfnetlink_queue.c +1 −1
  212. net/netfilter/xt_time.c +14 −9
  213. net/rds/ib_fmr.c +11 −0
  214. net/rds/ib_rdma.c +0 −3
  215. net/rose/rose_loopback.c +16 −11
  216. net/rxrpc/input.c +8 −4
  217. net/rxrpc/local_object.c +2 −1
  218. net/sunrpc/cache.c +3 −0
  219. net/sunrpc/clnt.c +5 −2
  220. net/tls/tls_device.c +2 −2
  221. net/tls/tls_device_fallback.c +10 −3
  222. net/tls/tls_main.c +1 −4
  223. net/tls/tls_sw.c +3 −0
  224. scripts/atomic/gen-atomics.sh +1 −1
  225. security/device_cgroup.c +1 −1
  226. sound/core/info.c +10 −2
  227. sound/core/init.c +9 −9
  228. sound/pci/hda/hda_codec.c +1 −0
  229. sound/pci/hda/patch_realtek.c +6 −0
  230. tools/include/uapi/sound/asound.h +1 −0
  231. tools/lib/traceevent/event-parse.c +1 −1
  232. tools/perf/builtin-stat.c +1 −0
  233. tools/perf/builtin-top.c +1 −0
  234. tools/perf/scripts/python/export-to-sqlite.py +1 −1
  235. tools/perf/util/env.c +6 −2
  236. tools/perf/util/evlist.c +9 −5
  237. tools/perf/util/evsel.c +6 −6
  238. tools/perf/util/header.c +13 −9
  239. tools/perf/util/map.c +17 −3
  240. tools/perf/util/map.h +3 −1
  241. tools/testing/selftests/net/run_afpackettests +5 −0
  242. tools/testing/selftests/net/run_netsocktests +1 −1
  243. tools/testing/selftests/netfilter/Makefile +2 −1
  244. tools/testing/selftests/netfilter/conntrack_icmp_related.sh +283 −0
  245. tools/testing/selftests/netfilter/nft_nat.sh +53 −3
  246. tools/testing/selftests/proc/proc-pid-vm.c +2 −2
  247. tools/testing/selftests/proc/proc-self-map-files-002.c +10 −10
Documentation/devicetree/bindings/net/davinci_emac.txt+2−0
@@ -20,6 +20,8 @@ Required properties: · 19 unmodified lines
2020 Optional properties:
2121 - phy-handle: See ethernet.txt file in the same directory.
2222 If absent, davinci_emac driver defaults to 100/FULL.
23+- nvmem-cells: phandle, reference to an nvmem node for the MAC address
24+- nvmem-cell-names: string, should be "mac-address" if nvmem is to be used
2325 - ti,davinci-rmii-en: 1 byte, 1 means use RMII
2426 - ti,davinci-no-bd-ram: boolean, does EMAC have BD RAM?
2527
Documentation/devicetree/bindings/net/ethernet.txt+2−3
@@ -10,15 +10,14 @@ Documentation/devicetree/bindings/phy/phy-bindings.txt. · 9 unmodified lines
1010 the boot program; should be used in cases where the MAC address assigned to
1111 the device by the boot program is different from the "local-mac-address"
1212 property;
13−- nvmem-cells: phandle, reference to an nvmem node for the MAC address;
14−- nvmem-cell-names: string, should be "mac-address" if nvmem is to be used;
1513 - max-speed: number, specifies maximum speed in Mbit/s supported by the device;
1614 - max-frame-size: number, maximum transfer unit (IEEE defined MTU), rather than
1715 the maximum frame size (there's contradiction in the Devicetree
1816 Specification).
1917 - phy-mode: string, operation mode of the PHY interface. This is now a de-facto
2018 standard property; supported values are:
21− * "internal"
19+ * "internal" (Internal means there is not a standard bus between the MAC and
20+ the PHY, something proprietary is being used to embed the PHY in the MAC.)
2221 * "mii"
2322 * "gmii"
2423 * "sgmii"
Documentation/devicetree/bindings/net/macb.txt+4−0
@@ -26,6 +26,10 @@ Required properties: · 25 unmodified lines
2626 Optional elements: 'tsu_clk'
2727 - clocks: Phandles to input clocks.
2828
29+Optional properties:
30+- nvmem-cells: phandle, reference to an nvmem node for the MAC address
31+- nvmem-cell-names: string, should be "mac-address" if nvmem is to be used
32+
2933 Optional properties for PHY child node:
3034 - reset-gpios : Should specify the gpio for phy reset
3135 - magic-packet : If present, indicates that the hardware supports waking
Documentation/media/uapi/rc/rc-tables.rst+2−2
@@ -623,7 +623,7 @@ the remote via /dev/input/event devices. · 622 unmodified lines
623623
624624 - .. row 78
625625
626− - ``KEY_SCREEN``
626+ - ``KEY_ASPECT_RATIO``
627627
628628 - Select screen aspect ratio
629629
@@ -631,7 +631,7 @@ the remote via /dev/input/event devices. · 1 unmodified line
631631
632632 - .. row 79
633633
634− - ``KEY_ZOOM``
634+ - ``KEY_FULL_SCREEN``
635635
636636 - Put device into zoom/full screen mode
637637
Documentation/networking/decnet.txt+0−2
@@ -22,8 +22,6 @@ you'll need the following options as well... · 21 unmodified lines
2222 CONFIG_DECNET_ROUTER (to be able to add/delete routes)
2323 CONFIG_NETFILTER (will be required for the DECnet routing daemon)
2424
25− CONFIG_DECNET_ROUTE_FWMARK is optional
26−
2725 Don't turn on SIOCGIFCONF support for DECnet unless you are really sure
2826 that you need it, in general you won't and it can cause ifconfig to
2927 malfunction.
Documentation/networking/ip-sysctl.txt+1−0
@@ -427,6 +427,7 @@ tcp_min_rtt_wlen - INTEGER · 426 unmodified lines
427427 minimum RTT when it is moved to a longer path (e.g., due to traffic
428428 engineering). A longer window makes the filter more resistant to RTT
429429 inflations such as transient congestion. The unit is seconds.
430+ Possible values: 0 - 86400 (1 day)
430431 Default: 300
431432
432433 tcp_moderate_rcvbuf - BOOLEAN
MAINTAINERS+2−1
@@ -3124,6 +3124,7 @@ F: drivers/cpufreq/bmips-cpufreq.c · 3123 unmodified lines
31243124 BROADCOM BMIPS MIPS ARCHITECTURE
31253125 M: Kevin Cernekee <cernekee@gmail.com>
31263126 M: Florian Fainelli <f.fainelli@gmail.com>
3127+L: bcm-kernel-feedback-list@broadcom.com
31273128 L: linux-mips@vger.kernel.org
31283129 T: git git://github.com/broadcom/stblinux.git
31293130 S: Maintained
@@ -7336,7 +7337,6 @@ F: Documentation/devicetree/bindings/i3c/ · 4206 unmodified lines
73367337 F: Documentation/driver-api/i3c
73377338 F: drivers/i3c/
73387339 F: include/linux/i3c/
7339−F: include/dt-bindings/i3c/
73407340
73417341 I3C DRIVER FOR SYNOPSYS DESIGNWARE
73427342 M: Vitor Soares <vitor.soares@synopsys.com>
@@ -8711,6 +8711,7 @@ F: scripts/leaking_addresses.pl · 1368 unmodified lines
87118711 LED SUBSYSTEM
87128712 M: Jacek Anaszewski <jacek.anaszewski@gmail.com>
87138713 M: Pavel Machek <pavel@ucw.cz>
8714+R: Dan Murphy <dmurphy@ti.com>
87148715 L: linux-leds@vger.kernel.org
87158716 T: git git://git.kernel.org/pub/scm/linux/kernel/git/j.anaszewski/linux-leds.git
87168717 S: Maintained
Makefile+1−1
@@ -2,7 +2,7 @@ · 1 unmodified line
22 VERSION = 5
33 PATCHLEVEL = 1
44 SUBLEVEL = 0
5−EXTRAVERSION = -rc5
5+EXTRAVERSION = -rc6
66 NAME = Shy Crocodile
77
88 # *DOCUMENTATION*
arch/alpha/kernel/syscalls/syscall.tbl+4−0
@@ -463,3 +463,7 @@ · 462 unmodified lines
463463 532 common getppid sys_getppid
464464 # all other architectures have common numbers for new syscall, alpha
465465 # is the exception.
466+534 common pidfd_send_signal sys_pidfd_send_signal
467+535 common io_uring_setup sys_io_uring_setup
468+536 common io_uring_enter sys_io_uring_enter
469+537 common io_uring_register sys_io_uring_register
arch/arm/tools/syscall.tbl+4−0
@@ -437,3 +437,7 @@ · 436 unmodified lines
437437 421 common rt_sigtimedwait_time64 sys_rt_sigtimedwait
438438 422 common futex_time64 sys_futex
439439 423 common sched_rr_get_interval_time64 sys_sched_rr_get_interval
440+424 common pidfd_send_signal sys_pidfd_send_signal
441+425 common io_uring_setup sys_io_uring_setup
442+426 common io_uring_enter sys_io_uring_enter
443+427 common io_uring_register sys_io_uring_register
arch/arm64/include/asm/futex.h+1−1
@@ -50,7 +50,7 @@ do { \ · 49 unmodified lines
5050 static inline int
5151 arch_futex_atomic_op_inuser(int op, int oparg, int *oval, u32 __user *_uaddr)
5252 {
53− int oldval, ret, tmp;
53+ int oldval = 0, ret, tmp;
5454 u32 __user *uaddr = __uaccess_mask_ptr(_uaddr);
5555
5656 pagefault_disable();
arch/arm64/include/asm/unistd.h+1−1
@@ -44,7 +44,7 @@ · 43 unmodified lines
4444 #define __ARM_NR_compat_set_tls (__ARM_NR_COMPAT_BASE + 5)
4545 #define __ARM_NR_COMPAT_END (__ARM_NR_COMPAT_BASE + 0x800)
4646
47−#define __NR_compat_syscalls 424
47+#define __NR_compat_syscalls 428
4848 #endif
4949
5050 #define __ARCH_WANT_SYS_CLONE
arch/arm64/include/asm/unistd32.h+8−0
@@ -866,6 +866,14 @@ __SYSCALL(__NR_rt_sigtimedwait_time64, compat_sys_rt_sigtimedwait_time64) · 865 unmodified lines
866866 __SYSCALL(__NR_futex_time64, sys_futex)
867867 #define __NR_sched_rr_get_interval_time64 423
868868 __SYSCALL(__NR_sched_rr_get_interval_time64, sys_sched_rr_get_interval)
869+#define __NR_pidfd_send_signal 424
870+__SYSCALL(__NR_pidfd_send_signal, sys_pidfd_send_signal)
871+#define __NR_io_uring_setup 425
872+__SYSCALL(__NR_io_uring_setup, sys_io_uring_setup)
873+#define __NR_io_uring_enter 426
874+__SYSCALL(__NR_io_uring_enter, sys_io_uring_enter)
875+#define __NR_io_uring_register 427
876+__SYSCALL(__NR_io_uring_register, sys_io_uring_register)
869877
870878 /*
871879 * Please add new compat syscalls above this comment and update
arch/ia64/kernel/syscalls/syscall.tbl+4−0
@@ -344,3 +344,7 @@ · 343 unmodified lines
344344 332 common pkey_free sys_pkey_free
345345 333 common rseq sys_rseq
346346 # 334 through 423 are reserved to sync up with other architectures
347+424 common pidfd_send_signal sys_pidfd_send_signal
348+425 common io_uring_setup sys_io_uring_setup
349+426 common io_uring_enter sys_io_uring_enter
350+427 common io_uring_register sys_io_uring_register
arch/m68k/kernel/syscalls/syscall.tbl+4−0
@@ -423,3 +423,7 @@ · 422 unmodified lines
423423 421 common rt_sigtimedwait_time64 sys_rt_sigtimedwait
424424 422 common futex_time64 sys_futex
425425 423 common sched_rr_get_interval_time64 sys_sched_rr_get_interval
426+424 common pidfd_send_signal sys_pidfd_send_signal
427+425 common io_uring_setup sys_io_uring_setup
428+426 common io_uring_enter sys_io_uring_enter
429+427 common io_uring_register sys_io_uring_register
arch/microblaze/kernel/syscalls/syscall.tbl+4−0
@@ -429,3 +429,7 @@ · 428 unmodified lines
429429 421 common rt_sigtimedwait_time64 sys_rt_sigtimedwait
430430 422 common futex_time64 sys_futex
431431 423 common sched_rr_get_interval_time64 sys_sched_rr_get_interval
432+424 common pidfd_send_signal sys_pidfd_send_signal
433+425 common io_uring_setup sys_io_uring_setup
434+426 common io_uring_enter sys_io_uring_enter
435+427 common io_uring_register sys_io_uring_register
arch/mips/ath79/setup.c+0−6
@@ -210,12 +210,6 @@ const char *get_system_type(void) · 209 unmodified lines
210210 return ath79_sys_type;
211211 }
212212
213−int get_c0_perfcount_int(void)
214−{
215− return ATH79_MISC_IRQ(5);
216−}
217−EXPORT_SYMBOL_GPL(get_c0_perfcount_int);
218−
219213 unsigned int get_c0_compare_int(void)
220214 {
221215 return CP0_LEGACY_COMPARE_IRQ;
arch/mips/kernel/scall64-o32.S+1−1
@@ -125,7 +125,7 @@ trace_a_syscall: · 124 unmodified lines
125125 subu t1, v0, __NR_O32_Linux
126126 move a1, v0
127127 bnez t1, 1f /* __NR_syscall at offset 0 */
128− lw a1, PT_R4(sp) /* Arg1 for __NR_syscall case */
128+ ld a1, PT_R4(sp) /* Arg1 for __NR_syscall case */
129129 .set pop
130130
131131 1: jal syscall_trace_enter
arch/mips/kernel/syscalls/syscall_n32.tbl+4−0
@@ -362,3 +362,7 @@ · 361 unmodified lines
362362 421 n32 rt_sigtimedwait_time64 compat_sys_rt_sigtimedwait_time64
363363 422 n32 futex_time64 sys_futex
364364 423 n32 sched_rr_get_interval_time64 sys_sched_rr_get_interval
365+424 n32 pidfd_send_signal sys_pidfd_send_signal
366+425 n32 io_uring_setup sys_io_uring_setup
367+426 n32 io_uring_enter sys_io_uring_enter
368+427 n32 io_uring_register sys_io_uring_register
arch/mips/kernel/syscalls/syscall_n64.tbl+4−0
@@ -338,3 +338,7 @@ · 337 unmodified lines
338338 327 n64 rseq sys_rseq
339339 328 n64 io_pgetevents sys_io_pgetevents
340340 # 329 through 423 are reserved to sync up with other architectures
341+424 n64 pidfd_send_signal sys_pidfd_send_signal
342+425 n64 io_uring_setup sys_io_uring_setup
343+426 n64 io_uring_enter sys_io_uring_enter
344+427 n64 io_uring_register sys_io_uring_register
arch/mips/kernel/syscalls/syscall_o32.tbl+4−0
@@ -411,3 +411,7 @@ · 410 unmodified lines
411411 421 o32 rt_sigtimedwait_time64 sys_rt_sigtimedwait compat_sys_rt_sigtimedwait_time64
412412 422 o32 futex_time64 sys_futex sys_futex
413413 423 o32 sched_rr_get_interval_time64 sys_sched_rr_get_interval sys_sched_rr_get_interval
414+424 o32 pidfd_send_signal sys_pidfd_send_signal
415+425 o32 io_uring_setup sys_io_uring_setup
416+426 o32 io_uring_enter sys_io_uring_enter
417+427 o32 io_uring_register sys_io_uring_register
arch/parisc/kernel/syscalls/syscall.tbl+4−0
@@ -420,3 +420,7 @@ · 419 unmodified lines
420420 421 32 rt_sigtimedwait_time64 sys_rt_sigtimedwait compat_sys_rt_sigtimedwait_time64
421421 422 32 futex_time64 sys_futex sys_futex
422422 423 32 sched_rr_get_interval_time64 sys_sched_rr_get_interval sys_sched_rr_get_interval
423+424 common pidfd_send_signal sys_pidfd_send_signal
424+425 common io_uring_setup sys_io_uring_setup
425+426 common io_uring_enter sys_io_uring_enter
426+427 common io_uring_register sys_io_uring_register
arch/powerpc/kernel/syscalls/syscall.tbl+4−0
@@ -505,3 +505,7 @@ · 504 unmodified lines
505505 421 32 rt_sigtimedwait_time64 sys_rt_sigtimedwait compat_sys_rt_sigtimedwait_time64
506506 422 32 futex_time64 sys_futex sys_futex
507507 423 32 sched_rr_get_interval_time64 sys_sched_rr_get_interval sys_sched_rr_get_interval
508+424 common pidfd_send_signal sys_pidfd_send_signal
509+425 common io_uring_setup sys_io_uring_setup
510+426 common io_uring_enter sys_io_uring_enter
511+427 common io_uring_register sys_io_uring_register
arch/s390/boot/mem_detect.c+1−1
@@ -25,7 +25,7 @@ static void *mem_detect_alloc_extended(void) · 24 unmodified lines
2525 {
2626 unsigned long offset = ALIGN(mem_safe_offset(), sizeof(u64));
2727
28− if (IS_ENABLED(BLK_DEV_INITRD) && INITRD_START && INITRD_SIZE &&
28+ if (IS_ENABLED(CONFIG_BLK_DEV_INITRD) && INITRD_START && INITRD_SIZE &&
2929 INITRD_START < offset + ENTRIES_EXTENDED_MAX)
3030 offset = ALIGN(INITRD_START + INITRD_SIZE, sizeof(u64));
3131
arch/s390/kernel/fpu.c+1−1
@@ -23,7 +23,7 @@ void __kernel_fpu_begin(struct kernel_fpu *state, u32 flags) · 22 unmodified lines
2323
2424 if (flags & KERNEL_FPC)
2525 /* Save floating point control */
26− asm volatile("stfpc %0" : "=m" (state->fpc));
26+ asm volatile("stfpc %0" : "=Q" (state->fpc));
2727
2828 if (!MACHINE_HAS_VX) {
2929 if (flags & KERNEL_VXR_V0V7) {
arch/s390/kernel/syscalls/syscall.tbl+4−0
@@ -426,3 +426,7 @@ · 425 unmodified lines
426426 421 32 rt_sigtimedwait_time64 - compat_sys_rt_sigtimedwait_time64
427427 422 32 futex_time64 - sys_futex
428428 423 32 sched_rr_get_interval_time64 - sys_sched_rr_get_interval
429+424 common pidfd_send_signal sys_pidfd_send_signal sys_pidfd_send_signal
430+425 common io_uring_setup sys_io_uring_setup sys_io_uring_setup
431+426 common io_uring_enter sys_io_uring_enter sys_io_uring_enter
432+427 common io_uring_register sys_io_uring_register sys_io_uring_register
arch/s390/kernel/vtime.c+4−4
@@ -37,7 +37,7 @@ static inline u64 get_vtimer(void) · 36 unmodified lines
3737 {
3838 u64 timer;
3939
40− asm volatile("stpt %0" : "=m" (timer));
40+ asm volatile("stpt %0" : "=Q" (timer));
4141 return timer;
4242 }
4343
@@ -48,7 +48,7 @@ static inline void set_vtimer(u64 expires) · 4 unmodified lines
4848 asm volatile(
4949 " stpt %0\n" /* Store current cpu timer value */
5050 " spt %1" /* Set new value imm. afterwards */
51− : "=m" (timer) : "m" (expires));
51+ : "=Q" (timer) : "Q" (expires));
5252 S390_lowcore.system_timer += S390_lowcore.last_update_timer - timer;
5353 S390_lowcore.last_update_timer = expires;
5454 }
@@ -135,8 +135,8 @@ static int do_account_vtime(struct task_struct *tsk) · 80 unmodified lines
135135 #else
136136 " stck %1" /* Store current tod clock value */
137137 #endif
138− : "=m" (S390_lowcore.last_update_timer),
139− "=m" (S390_lowcore.last_update_clock));
138+ : "=Q" (S390_lowcore.last_update_timer),
139+ "=Q" (S390_lowcore.last_update_clock));
140140 clock = S390_lowcore.last_update_clock - clock;
141141 timer -= S390_lowcore.last_update_timer;
142142
arch/sh/kernel/syscalls/syscall.tbl+4−0
@@ -426,3 +426,7 @@ · 425 unmodified lines
426426 421 common rt_sigtimedwait_time64 sys_rt_sigtimedwait
427427 422 common futex_time64 sys_futex
428428 423 common sched_rr_get_interval_time64 sys_sched_rr_get_interval
429+424 common pidfd_send_signal sys_pidfd_send_signal
430+425 common io_uring_setup sys_io_uring_setup
431+426 common io_uring_enter sys_io_uring_enter
432+427 common io_uring_register sys_io_uring_register
arch/sparc/kernel/syscalls/syscall.tbl+4−0
@@ -469,3 +469,7 @@ · 468 unmodified lines
469469 421 32 rt_sigtimedwait_time64 sys_rt_sigtimedwait compat_sys_rt_sigtimedwait_time64
470470 422 32 futex_time64 sys_futex sys_futex
471471 423 32 sched_rr_get_interval_time64 sys_sched_rr_get_interval sys_sched_rr_get_interval
472+424 common pidfd_send_signal sys_pidfd_send_signal
473+425 common io_uring_setup sys_io_uring_setup
474+426 common io_uring_enter sys_io_uring_enter
475+427 common io_uring_register sys_io_uring_register
arch/x86/Kconfig+1−1
@@ -1499,7 +1499,7 @@ config X86_CPA_STATISTICS · 1498 unmodified lines
14991499 depends on DEBUG_FS
15001500 ---help---
15011501 Expose statistics about the Change Page Attribute mechanims, which
1502− helps to determine the effectivness of preserving large and huge
1502+ helps to determine the effectiveness of preserving large and huge
15031503 page mappings when mapping protections are changed.
15041504
15051505 config ARCH_HAS_MEM_ENCRYPT
arch/x86/crypto/poly1305-avx2-x86_64.S+10−4
@@ -323,6 +323,12 @@ ENTRY(poly1305_4block_avx2) · 322 unmodified lines
323323 vpaddq t2,t1,t1
324324 vmovq t1x,d4
325325
326+ # Now do a partial reduction mod (2^130)-5, carrying h0 -> h1 -> h2 ->
327+ # h3 -> h4 -> h0 -> h1 to get h0,h2,h3,h4 < 2^26 and h1 < 2^26 + a small
328+ # amount. Careful: we must not assume the carry bits 'd0 >> 26',
329+ # 'd1 >> 26', 'd2 >> 26', 'd3 >> 26', and '(d4 >> 26) * 5' fit in 32-bit
330+ # integers. It's true in a single-block implementation, but not here.
331+
326332 # d1 += d0 >> 26
327333 mov d0,%rax
328334 shr $26,%rax
@@ -361,16 +367,16 @@ ENTRY(poly1305_4block_avx2) · 32 unmodified lines
361367 # h0 += (d4 >> 26) * 5
362368 mov d4,%rax
363369 shr $26,%rax
364− lea (%eax,%eax,4),%eax
365− add %eax,%ebx
370+ lea (%rax,%rax,4),%rax
371+ add %rax,%rbx
366372 # h4 = d4 & 0x3ffffff
367373 mov d4,%rax
368374 and $0x3ffffff,%eax
369375 mov %eax,h4
370376
371377 # h1 += h0 >> 26
372− mov %ebx,%eax
373− shr $26,%eax
378+ mov %rbx,%rax
379+ shr $26,%rax
374380 add %eax,h1
375381 # h0 = h0 & 0x3ffffff
376382 andl $0x3ffffff,%ebx
arch/x86/crypto/poly1305-sse2-x86_64.S+14−8
@@ -253,16 +253,16 @@ ENTRY(poly1305_block_sse2) · 252 unmodified lines
253253 # h0 += (d4 >> 26) * 5
254254 mov d4,%rax
255255 shr $26,%rax
256− lea (%eax,%eax,4),%eax
257− add %eax,%ebx
256+ lea (%rax,%rax,4),%rax
257+ add %rax,%rbx
258258 # h4 = d4 & 0x3ffffff
259259 mov d4,%rax
260260 and $0x3ffffff,%eax
261261 mov %eax,h4
262262
263263 # h1 += h0 >> 26
264− mov %ebx,%eax
265− shr $26,%eax
264+ mov %rbx,%rax
265+ shr $26,%rax
266266 add %eax,h1
267267 # h0 = h0 & 0x3ffffff
268268 andl $0x3ffffff,%ebx
@@ -524,6 +524,12 @@ ENTRY(poly1305_2block_sse2) · 255 unmodified lines
524524 paddq t2,t1
525525 movq t1,d4
526526
527+ # Now do a partial reduction mod (2^130)-5, carrying h0 -> h1 -> h2 ->
528+ # h3 -> h4 -> h0 -> h1 to get h0,h2,h3,h4 < 2^26 and h1 < 2^26 + a small
529+ # amount. Careful: we must not assume the carry bits 'd0 >> 26',
530+ # 'd1 >> 26', 'd2 >> 26', 'd3 >> 26', and '(d4 >> 26) * 5' fit in 32-bit
531+ # integers. It's true in a single-block implementation, but not here.
532+
527533 # d1 += d0 >> 26
528534 mov d0,%rax
529535 shr $26,%rax
@@ -562,16 +568,16 @@ ENTRY(poly1305_2block_sse2) · 32 unmodified lines
562568 # h0 += (d4 >> 26) * 5
563569 mov d4,%rax
564570 shr $26,%rax
565− lea (%eax,%eax,4),%eax
566− add %eax,%ebx
571+ lea (%rax,%rax,4),%rax
572+ add %rax,%rbx
567573 # h4 = d4 & 0x3ffffff
568574 mov d4,%rax
569575 and $0x3ffffff,%eax
570576 mov %eax,h4
571577
572578 # h1 += h0 >> 26
573− mov %ebx,%eax
574− shr $26,%eax
579+ mov %rbx,%rax
580+ shr $26,%rax
575581 add %eax,h1
576582 # h0 = h0 & 0x3ffffff
577583 andl $0x3ffffff,%ebx
arch/x86/events/amd/core.c+26−9
@@ -117,22 +117,39 @@ static __initconst const u64 amd_hw_cache_event_ids · 116 unmodified lines
117117 };
118118
119119 /*
120− * AMD Performance Monitor K7 and later.
120+ * AMD Performance Monitor K7 and later, up to and including Family 16h:
121121 */
122122 static const u64 amd_perfmon_event_map[PERF_COUNT_HW_MAX] =
123123 {
124− [PERF_COUNT_HW_CPU_CYCLES] = 0x0076,
125− [PERF_COUNT_HW_INSTRUCTIONS] = 0x00c0,
126− [PERF_COUNT_HW_CACHE_REFERENCES] = 0x077d,
127− [PERF_COUNT_HW_CACHE_MISSES] = 0x077e,
128− [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = 0x00c2,
129− [PERF_COUNT_HW_BRANCH_MISSES] = 0x00c3,
130− [PERF_COUNT_HW_STALLED_CYCLES_FRONTEND] = 0x00d0, /* "Decoder empty" event */
131− [PERF_COUNT_HW_STALLED_CYCLES_BACKEND] = 0x00d1, /* "Dispatch stalls" event */
124+ [PERF_COUNT_HW_CPU_CYCLES] = 0x0076,
125+ [PERF_COUNT_HW_INSTRUCTIONS] = 0x00c0,
126+ [PERF_COUNT_HW_CACHE_REFERENCES] = 0x077d,
127+ [PERF_COUNT_HW_CACHE_MISSES] = 0x077e,
128+ [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = 0x00c2,
129+ [PERF_COUNT_HW_BRANCH_MISSES] = 0x00c3,
130+ [PERF_COUNT_HW_STALLED_CYCLES_FRONTEND] = 0x00d0, /* "Decoder empty" event */
131+ [PERF_COUNT_HW_STALLED_CYCLES_BACKEND] = 0x00d1, /* "Dispatch stalls" event */
132+};
133+
134+/*
135+ * AMD Performance Monitor Family 17h and later:
136+ */
137+static const u64 amd_f17h_perfmon_event_map[PERF_COUNT_HW_MAX] =
138+{
139+ [PERF_COUNT_HW_CPU_CYCLES] = 0x0076,
140+ [PERF_COUNT_HW_INSTRUCTIONS] = 0x00c0,
141+ [PERF_COUNT_HW_CACHE_REFERENCES] = 0xff60,
142+ [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = 0x00c2,
143+ [PERF_COUNT_HW_BRANCH_MISSES] = 0x00c3,
144+ [PERF_COUNT_HW_STALLED_CYCLES_FRONTEND] = 0x0287,
145+ [PERF_COUNT_HW_STALLED_CYCLES_BACKEND] = 0x0187,
132146 };
133147
134148 static u64 amd_pmu_event_map(int hw_event)
135149 {
150+ if (boot_cpu_data.x86 >= 0x17)
151+ return amd_f17h_perfmon_event_map[hw_event];
152+
136153 return amd_perfmon_event_map[hw_event];
137154 }
138155
arch/x86/events/intel/core.c+1−1
@@ -3131,7 +3131,7 @@ static unsigned long intel_pmu_large_pebs_flags(struct perf_event *event) · 3130 unmodified lines
31313131 flags &= ~PERF_SAMPLE_TIME;
31323132 if (!event->attr.exclude_kernel)
31333133 flags &= ~PERF_SAMPLE_REGS_USER;
3134− if (event->attr.sample_regs_user & ~PEBS_REGS)
3134+ if (event->attr.sample_regs_user & ~PEBS_GP_REGS)
31353135 flags &= ~(PERF_SAMPLE_REGS_USER | PERF_SAMPLE_REGS_INTR);
31363136 return flags;
31373137 }
arch/x86/events/perf_event.h+19−19
@@ -96,25 +96,25 @@ struct amd_nb { · 95 unmodified lines
9696 PERF_SAMPLE_REGS_INTR | PERF_SAMPLE_REGS_USER | \
9797 PERF_SAMPLE_PERIOD)
9898
99−#define PEBS_REGS \
100− (PERF_REG_X86_AX | \
101− PERF_REG_X86_BX | \
102− PERF_REG_X86_CX | \
103− PERF_REG_X86_DX | \
104− PERF_REG_X86_DI | \
105− PERF_REG_X86_SI | \
106− PERF_REG_X86_SP | \
107− PERF_REG_X86_BP | \
108− PERF_REG_X86_IP | \
109− PERF_REG_X86_FLAGS | \
110− PERF_REG_X86_R8 | \
111− PERF_REG_X86_R9 | \
112− PERF_REG_X86_R10 | \
113− PERF_REG_X86_R11 | \
114− PERF_REG_X86_R12 | \
115− PERF_REG_X86_R13 | \
116− PERF_REG_X86_R14 | \
117− PERF_REG_X86_R15)
99+#define PEBS_GP_REGS \
100+ ((1ULL << PERF_REG_X86_AX) | \
101+ (1ULL << PERF_REG_X86_BX) | \
102+ (1ULL << PERF_REG_X86_CX) | \
103+ (1ULL << PERF_REG_X86_DX) | \
104+ (1ULL << PERF_REG_X86_DI) | \
105+ (1ULL << PERF_REG_X86_SI) | \
106+ (1ULL << PERF_REG_X86_SP) | \
107+ (1ULL << PERF_REG_X86_BP) | \
108+ (1ULL << PERF_REG_X86_IP) | \
109+ (1ULL << PERF_REG_X86_FLAGS) | \
110+ (1ULL << PERF_REG_X86_R8) | \
111+ (1ULL << PERF_REG_X86_R9) | \
112+ (1ULL << PERF_REG_X86_R10) | \
113+ (1ULL << PERF_REG_X86_R11) | \
114+ (1ULL << PERF_REG_X86_R12) | \
115+ (1ULL << PERF_REG_X86_R13) | \
116+ (1ULL << PERF_REG_X86_R14) | \
117+ (1ULL << PERF_REG_X86_R15))
118118
119119 /*
120120 * Per register state.
arch/x86/kernel/cpu/bugs.c+3−3
@@ -275,7 +275,7 @@ static const struct { · 274 unmodified lines
275275 const char *option;
276276 enum spectre_v2_user_cmd cmd;
277277 bool secure;
278−} v2_user_options[] __initdata = {
278+} v2_user_options[] __initconst = {
279279 { "auto", SPECTRE_V2_USER_CMD_AUTO, false },
280280 { "off", SPECTRE_V2_USER_CMD_NONE, false },
281281 { "on", SPECTRE_V2_USER_CMD_FORCE, true },
@@ -419,7 +419,7 @@ static const struct { · 137 unmodified lines
419419 const char *option;
420420 enum spectre_v2_mitigation_cmd cmd;
421421 bool secure;
422−} mitigation_options[] __initdata = {
422+} mitigation_options[] __initconst = {
423423 { "off", SPECTRE_V2_CMD_NONE, false },
424424 { "on", SPECTRE_V2_CMD_FORCE, true },
425425 { "retpoline", SPECTRE_V2_CMD_RETPOLINE, false },
@@ -658,7 +658,7 @@ static const char * const ssb_strings[] = { · 232 unmodified lines
658658 static const struct {
659659 const char *option;
660660 enum ssb_mitigation_cmd cmd;
661−} ssb_mitigation_options[] __initdata = {
661+} ssb_mitigation_options[] __initconst = {
662662 { "auto", SPEC_STORE_BYPASS_CMD_AUTO }, /* Platform decides */
663663 { "on", SPEC_STORE_BYPASS_CMD_ON }, /* Disable Speculative Store Bypass */
664664 { "off", SPEC_STORE_BYPASS_CMD_NONE }, /* Don't touch Speculative Store Bypass */
arch/x86/kernel/cpu/intel.c+2−2
@@ -611,8 +611,8 @@ static void init_intel_energy_perf(struct cpuinfo_x86 *c) · 610 unmodified lines
611611 if ((epb & 0xF) != ENERGY_PERF_BIAS_PERFORMANCE)
612612 return;
613613
614− pr_warn_once("ENERGY_PERF_BIAS: Set to 'normal', was 'performance'\n");
615− pr_warn_once("ENERGY_PERF_BIAS: View and update with x86_energy_perf_policy(8)\n");
614+ pr_info_once("ENERGY_PERF_BIAS: Set to 'normal', was 'performance'\n");
615+ pr_info_once("ENERGY_PERF_BIAS: View and update with x86_energy_perf_policy(8)\n");
616616 epb = (epb & ~0xF) | ENERGY_PERF_BIAS_NORMAL;
617617 wrmsrl(MSR_IA32_ENERGY_PERF_BIAS, epb);
618618 }
arch/x86/kernel/cpu/resctrl/rdtgroup.c+2−1
@@ -2610,9 +2610,10 @@ static int rdtgroup_init_alloc(struct rdtgroup *rdtgrp) · 2609 unmodified lines
26102610 rdt_last_cmd_puts("Failed to initialize allocations\n");
26112611 return ret;
26122612 }
2613− rdtgrp->mode = RDT_MODE_SHAREABLE;
26142613 }
26152614
2615+ rdtgrp->mode = RDT_MODE_SHAREABLE;
2616+
26162617 return 0;
26172618 }
26182619
arch/x86/kernel/kprobes/core.c+46−2
@@ -569,6 +569,7 @@ void arch_prepare_kretprobe(struct kretprobe_instance *ri, struct pt_regs *regs) · 568 unmodified lines
569569 unsigned long *sara = stack_addr(regs);
570570
571571 ri->ret_addr = (kprobe_opcode_t *) *sara;
572+ ri->fp = sara;
572573
573574 /* Replace the return addr with trampoline addr */
574575 *sara = (unsigned long) &kretprobe_trampoline;
@@ -748,26 +749,48 @@ asm( · 173 unmodified lines
748749 NOKPROBE_SYMBOL(kretprobe_trampoline);
749750 STACK_FRAME_NON_STANDARD(kretprobe_trampoline);
750751
752+static struct kprobe kretprobe_kprobe = {
753+ .addr = (void *)kretprobe_trampoline,
754+};
755+
751756 /*
752757 * Called from kretprobe_trampoline
753758 */
754759 static __used void *trampoline_handler(struct pt_regs *regs)
755760 {
761+ struct kprobe_ctlblk *kcb;
756762 struct kretprobe_instance *ri = NULL;
757763 struct hlist_head *head, empty_rp;
758764 struct hlist_node *tmp;
759765 unsigned long flags, orig_ret_address = 0;
760766 unsigned long trampoline_address = (unsigned long)&kretprobe_trampoline;
761767 kprobe_opcode_t *correct_ret_addr = NULL;
768+ void *frame_pointer;
769+ bool skipped = false;
770+
771+ preempt_disable();
772+
773+ /*
774+ * Set a dummy kprobe for avoiding kretprobe recursion.
775+ * Since kretprobe never run in kprobe handler, kprobe must not
776+ * be running at this point.
777+ */
778+ kcb = get_kprobe_ctlblk();
779+ __this_cpu_write(current_kprobe, &kretprobe_kprobe);
780+ kcb->kprobe_status = KPROBE_HIT_ACTIVE;
762781
763782 INIT_HLIST_HEAD(&empty_rp);
764783 kretprobe_hash_lock(current, &head, &flags);
765784 /* fixup registers */
766785 #ifdef CONFIG_X86_64
767786 regs->cs = __KERNEL_CS;
787+ /* On x86-64, we use pt_regs->sp for return address holder. */
788+ frame_pointer = &regs->sp;
768789 #else
769790 regs->cs = __KERNEL_CS | get_kernel_rpl();
770791 regs->gs = 0;
792+ /* On x86-32, we use pt_regs->flags for return address holder. */
793+ frame_pointer = &regs->flags;
771794 #endif
772795 regs->ip = trampoline_address;
773796 regs->orig_ax = ~0UL;
@@ -789,8 +812,25 @@ static __used void *trampoline_handler(struct pt_regs *regs) · 15 unmodified lines
789812 if (ri->task != current)
790813 /* another task is sharing our hash bucket */
791814 continue;
815+ /*
816+ * Return probes must be pushed on this hash list correct
817+ * order (same as return order) so that it can be poped
818+ * correctly. However, if we find it is pushed it incorrect
819+ * order, this means we find a function which should not be
820+ * probed, because the wrong order entry is pushed on the
821+ * path of processing other kretprobe itself.
822+ */
823+ if (ri->fp != frame_pointer) {
824+ if (!skipped)
825+ pr_warn("kretprobe is stacked incorrectly. Trying to fixup.\n");
826+ skipped = true;
827+ continue;
828+ }
792829
793830 orig_ret_address = (unsigned long)ri->ret_addr;
831+ if (skipped)
832+ pr_warn("%ps must be blacklisted because of incorrect kretprobe order\n",
833+ ri->rp->kp.addr);
794834
795835 if (orig_ret_address != trampoline_address)
796836 /*
@@ -808,14 +848,15 @@ static __used void *trampoline_handler(struct pt_regs *regs) · 11 unmodified lines
808848 if (ri->task != current)
809849 /* another task is sharing our hash bucket */
810850 continue;
851+ if (ri->fp != frame_pointer)
852+ continue;
811853
812854 orig_ret_address = (unsigned long)ri->ret_addr;
813855 if (ri->rp && ri->rp->handler) {
814856 __this_cpu_write(current_kprobe, &ri->rp->kp);
815− get_kprobe_ctlblk()->kprobe_status = KPROBE_HIT_ACTIVE;
816857 ri->ret_addr = correct_ret_addr;
817858 ri->rp->handler(ri, regs);
818− __this_cpu_write(current_kprobe, NULL);
859+ __this_cpu_write(current_kprobe, &kretprobe_kprobe);
819860 }
820861
821862 recycle_rp_inst(ri, &empty_rp);
@@ -831,6 +872,9 @@ static __used void *trampoline_handler(struct pt_regs *regs) · 9 unmodified lines
831872
832873 kretprobe_hash_unlock(current, &flags);
833874
875+ __this_cpu_write(current_kprobe, NULL);
876+ preempt_enable();
877+
834878 hlist_for_each_entry_safe(ri, tmp, &empty_rp, hlist) {
835879 hlist_del(&ri->hlist);
836880 kfree(ri);
arch/x86/kernel/process.c+6−2
@@ -426,6 +426,8 @@ static __always_inline void __speculation_ctrl_update(unsigned long tifp, · 425 unmodified lines
426426 u64 msr = x86_spec_ctrl_base;
427427 bool updmsr = false;
428428
429+ lockdep_assert_irqs_disabled();
430+
429431 /*
430432 * If TIF_SSBD is different, select the proper mitigation
431433 * method. Note that if SSBD mitigation is disabled or permanentely
@@ -477,10 +479,12 @@ static unsigned long speculation_ctrl_update_tif(struct task_struct *tsk) · 45 unmodified lines
477479
478480 void speculation_ctrl_update(unsigned long tif)
479481 {
482+ unsigned long flags;
483+
480484 /* Forced update. Make sure all relevant TIF flags are different */
481− preempt_disable();
485+ local_irq_save(flags);
482486 __speculation_ctrl_update(~tif, tif);
483− preempt_enable();
487+ local_irq_restore(flags);
484488 }
485489
486490 /* Called from seccomp/prctl update */
arch/x86/kernel/reboot.c+21−0
@@ -81,6 +81,19 @@ static int __init set_bios_reboot(const struct dmi_system_id *d) · 80 unmodified lines
8181 return 0;
8282 }
8383
84+/*
85+ * Some machines don't handle the default ACPI reboot method and
86+ * require the EFI reboot method:
87+ */
88+static int __init set_efi_reboot(const struct dmi_system_id *d)
89+{
90+ if (reboot_type != BOOT_EFI && !efi_runtime_disabled()) {
91+ reboot_type = BOOT_EFI;
92+ pr_info("%s series board detected. Selecting EFI-method for reboot.\n", d->ident);
93+ }
94+ return 0;
95+}
96+
8497 void __noreturn machine_real_restart(unsigned int type)
8598 {
8699 local_irq_disable();
@@ -166,6 +179,14 @@ static const struct dmi_system_id reboot_dmi_table[] __initconst = { · 79 unmodified lines
166179 DMI_MATCH(DMI_PRODUCT_NAME, "AOA110"),
167180 },
168181 },
182+ { /* Handle reboot issue on Acer TravelMate X514-51T */
183+ .callback = set_efi_reboot,
184+ .ident = "Acer TravelMate X514-51T",
185+ .matches = {
186+ DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
187+ DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate X514-51T"),
188+ },
189+ },
169190
170191 /* Apple */
171192 { /* Handle problems with rebooting on Apple MacBook5 */
arch/x86/kernel/vmlinux.lds.S+1−1
@@ -362,7 +362,7 @@ SECTIONS · 361 unmodified lines
362362 .bss : AT(ADDR(.bss) - LOAD_OFFSET) {
363363 __bss_start = .;
364364 *(.bss..page_aligned)
365− *(.bss)
365+ *(BSS_MAIN)
366366 BSS_DECRYPTED
367367 . = ALIGN(PAGE_SIZE);
368368 __bss_stop = .;
arch/x86/mm/dump_pagetables.c+2−1
@@ -259,7 +259,8 @@ static void note_wx(struct pg_state *st) · 258 unmodified lines
259259 #endif
260260 /* Account the WX pages */
261261 st->wx_pages += npages;
262− WARN_ONCE(1, "x86/mm: Found insecure W+X mapping at address %pS\n",
262+ WARN_ONCE(__supported_pte_mask & _PAGE_NX,
263+ "x86/mm: Found insecure W+X mapping at address %pS\n",
263264 (void *)st->start_address);
264265 }
265266
arch/x86/mm/ioremap.c+1−1
@@ -825,7 +825,7 @@ void __init __early_set_fixmap(enum fixed_addresses idx, · 824 unmodified lines
825825 pte = early_ioremap_pte(addr);
826826
827827 /* Sanitize 'prot' against any unsupported bits: */
828− pgprot_val(flags) &= __default_kernel_pte_mask;
828+ pgprot_val(flags) &= __supported_pte_mask;
829829
830830 if (pgprot_val(flags))
831831 set_pte(pte, pfn_pte(phys >> PAGE_SHIFT, flags));
arch/x86/mm/kaslr.c+1−1
@@ -94,7 +94,7 @@ void __init kernel_randomize_memory(void) · 93 unmodified lines
9494 if (!kaslr_memory_enabled())
9595 return;
9696
97− kaslr_regions[0].size_tb = 1 << (__PHYSICAL_MASK_SHIFT - TB_SHIFT);
97+ kaslr_regions[0].size_tb = 1 << (MAX_PHYSMEM_BITS - TB_SHIFT);
9898 kaslr_regions[1].size_tb = VMALLOC_SIZE_TB;
9999
100100 /*
arch/x86/mm/tlb.c+1−1
@@ -728,7 +728,7 @@ void flush_tlb_mm_range(struct mm_struct *mm, unsigned long start, · 727 unmodified lines
728728 {
729729 int cpu;
730730
731− struct flush_tlb_info info __aligned(SMP_CACHE_BYTES) = {
731+ struct flush_tlb_info info = {
732732 .mm = mm,
733733 .stride_shift = stride_shift,
734734 .freed_tables = freed_tables,
arch/xtensa/kernel/syscalls/syscall.tbl+4−0
@@ -394,3 +394,7 @@ · 393 unmodified lines
394394 421 common rt_sigtimedwait_time64 sys_rt_sigtimedwait
395395 422 common futex_time64 sys_futex
396396 423 common sched_rr_get_interval_time64 sys_sched_rr_get_interval
397+424 common pidfd_send_signal sys_pidfd_send_signal
398+425 common io_uring_setup sys_io_uring_setup
399+426 common io_uring_enter sys_io_uring_enter
400+427 common io_uring_register sys_io_uring_register
block/bfq-iosched.c+7−1
@@ -5396,7 +5396,7 @@ static unsigned int bfq_update_depths(struct bfq_data *bfqd, · 5395 unmodified lines
53965396 return min_shallow;
53975397 }
53985398
5399−static int bfq_init_hctx(struct blk_mq_hw_ctx *hctx, unsigned int index)
5399+static void bfq_depth_updated(struct blk_mq_hw_ctx *hctx)
54005400 {
54015401 struct bfq_data *bfqd = hctx->queue->elevator->elevator_data;
54025402 struct blk_mq_tags *tags = hctx->sched_tags;
@@ -5404,6 +5404,11 @@ static int bfq_init_hctx(struct blk_mq_hw_ctx *hctx, unsigned int index) · 1 unmodified line
54045404
54055405 min_shallow = bfq_update_depths(bfqd, &tags->bitmap_tags);
54065406 sbitmap_queue_min_shallow_depth(&tags->bitmap_tags, min_shallow);
5407+}
5408+
5409+static int bfq_init_hctx(struct blk_mq_hw_ctx *hctx, unsigned int index)
5410+{
5411+ bfq_depth_updated(hctx);
54075412 return 0;
54085413 }
54095414
@@ -5826,6 +5831,7 @@ static struct elevator_type iosched_bfq_mq = { · 416 unmodified lines
58265831 .requests_merged = bfq_requests_merged,
58275832 .request_merged = bfq_request_merged,
58285833 .has_work = bfq_has_work,
5834+ .depth_updated = bfq_depth_updated,
58295835 .init_hctx = bfq_init_hctx,
58305836 .init_sched = bfq_init_queue,
58315837 .exit_sched = bfq_exit_queue,
block/blk-mq.c+2−0
@@ -3135,6 +3135,8 @@ int blk_mq_update_nr_requests(struct request_queue *q, unsigned int nr) · 3134 unmodified lines
31353135 }
31363136 if (ret)
31373137 break;
3138+ if (q->elevator && q->elevator->type->ops.depth_updated)
3139+ q->elevator->type->ops.depth_updated(hctx);
31383140 }
31393141
31403142 if (!ret)
crypto/testmgr.h+43−1
@@ -5634,7 +5634,49 @@ static const struct hash_testvec poly1305_tv_template[] = { · 5633 unmodified lines
56345634 .psize = 80,
56355635 .digest = "\x13\x00\x00\x00\x00\x00\x00\x00"
56365636 "\x00\x00\x00\x00\x00\x00\x00\x00",
5637− },
5637+ }, { /* Regression test for overflow in AVX2 implementation */
5638+ .plaintext = "\xff\xff\xff\xff\xff\xff\xff\xff"
5639+ "\xff\xff\xff\xff\xff\xff\xff\xff"
5640+ "\xff\xff\xff\xff\xff\xff\xff\xff"
5641+ "\xff\xff\xff\xff\xff\xff\xff\xff"
5642+ "\xff\xff\xff\xff\xff\xff\xff\xff"
5643+ "\xff\xff\xff\xff\xff\xff\xff\xff"
5644+ "\xff\xff\xff\xff\xff\xff\xff\xff"
5645+ "\xff\xff\xff\xff\xff\xff\xff\xff"
5646+ "\xff\xff\xff\xff\xff\xff\xff\xff"
5647+ "\xff\xff\xff\xff\xff\xff\xff\xff"
5648+ "\xff\xff\xff\xff\xff\xff\xff\xff"
5649+ "\xff\xff\xff\xff\xff\xff\xff\xff"
5650+ "\xff\xff\xff\xff\xff\xff\xff\xff"
5651+ "\xff\xff\xff\xff\xff\xff\xff\xff"
5652+ "\xff\xff\xff\xff\xff\xff\xff\xff"
5653+ "\xff\xff\xff\xff\xff\xff\xff\xff"
5654+ "\xff\xff\xff\xff\xff\xff\xff\xff"
5655+ "\xff\xff\xff\xff\xff\xff\xff\xff"
5656+ "\xff\xff\xff\xff\xff\xff\xff\xff"
5657+ "\xff\xff\xff\xff\xff\xff\xff\xff"
5658+ "\xff\xff\xff\xff\xff\xff\xff\xff"
5659+ "\xff\xff\xff\xff\xff\xff\xff\xff"
5660+ "\xff\xff\xff\xff\xff\xff\xff\xff"
5661+ "\xff\xff\xff\xff\xff\xff\xff\xff"
5662+ "\xff\xff\xff\xff\xff\xff\xff\xff"
5663+ "\xff\xff\xff\xff\xff\xff\xff\xff"
5664+ "\xff\xff\xff\xff\xff\xff\xff\xff"
5665+ "\xff\xff\xff\xff\xff\xff\xff\xff"
5666+ "\xff\xff\xff\xff\xff\xff\xff\xff"
5667+ "\xff\xff\xff\xff\xff\xff\xff\xff"
5668+ "\xff\xff\xff\xff\xff\xff\xff\xff"
5669+ "\xff\xff\xff\xff\xff\xff\xff\xff"
5670+ "\xff\xff\xff\xff\xff\xff\xff\xff"
5671+ "\xff\xff\xff\xff\xff\xff\xff\xff"
5672+ "\xff\xff\xff\xff\xff\xff\xff\xff"
5673+ "\xff\xff\xff\xff\xff\xff\xff\xff"
5674+ "\xff\xff\xff\xff\xff\xff\xff\xff"
5675+ "\xff\xff\xff\xff",
5676+ .psize = 300,
5677+ .digest = "\xfb\x5e\x96\xd8\x61\xd5\xc7\xc8"
5678+ "\x78\xe5\x87\xcc\x2d\x5a\x22\xe1",
5679+ }
56385680 };
56395681
56405682 /* NHPoly1305 test vectors from https://github.com/google/adiantum */
drivers/atm/firestream.c+1−1
@@ -1646,7 +1646,7 @@ static irqreturn_t fs_irq (int irq, void *dev_id) · 1645 unmodified lines
16461646 }
16471647
16481648 if (status & ISR_TBRQ_W) {
1649− fs_dprintk (FS_DEBUG_IRQ, "Data tramsitted!\n");
1649+ fs_dprintk (FS_DEBUG_IRQ, "Data transmitted!\n");
16501650 process_txdone_queue (dev, &dev->tx_relq);
16511651 }
16521652
drivers/base/memory.c+1−1
@@ -506,7 +506,7 @@ static ssize_t probe_store(struct device *dev, struct device_attribute *attr, · 505 unmodified lines
506506
507507 ret = lock_device_hotplug_sysfs();
508508 if (ret)
509− goto out;
509+ return ret;
510510
511511 nid = memory_add_physaddr_to_nid(phys_addr);
512512 ret = __add_memory(nid, phys_addr,
drivers/clocksource/Kconfig+1−0
@@ -145,6 +145,7 @@ config VT8500_TIMER · 144 unmodified lines
145145 config NPCM7XX_TIMER
146146 bool "NPCM7xx timer driver" if COMPILE_TEST
147147 depends on HAS_IOMEM
148+ select TIMER_OF
148149 select CLKSRC_MMIO
149150 help
150151 Enable 24-bit TIMER0 and TIMER1 counters in the NPCM7xx architecture,
drivers/clocksource/arm_arch_timer.c+1−4
@@ -9,7 +9,7 @@ · 8 unmodified lines
99 * published by the Free Software Foundation.
1010 */
1111
12−#define pr_fmt(fmt) "arm_arch_timer: " fmt
12+#define pr_fmt(fmt) "arch_timer: " fmt
1313
1414 #include <linux/init.h>
1515 #include <linux/kernel.h>
@@ -33,9 +33,6 @@ · 17 unmodified lines
3333
3434 #include <clocksource/arm_arch_timer.h>
3535
36−#undef pr_fmt
37−#define pr_fmt(fmt) "arch_timer: " fmt
38−
3936 #define CNTTIDR 0x08
4037 #define CNTTIDR_VIRT(n) (BIT(1) << ((n) * 4))
4138
drivers/clocksource/timer-oxnas-rps.c+1−1
@@ -296,4 +296,4 @@ err_alloc: · 295 unmodified lines
296296 TIMER_OF_DECLARE(ox810se_rps,
297297 "oxsemi,ox810se-rps-timer", oxnas_rps_timer_init);
298298 TIMER_OF_DECLARE(ox820_rps,
299− "oxsemi,ox820se-rps-timer", oxnas_rps_timer_init);
299+ "oxsemi,ox820-rps-timer", oxnas_rps_timer_init);
drivers/clocksource/timer-ti-dm.c+0−28
@@ -585,34 +585,6 @@ static int omap_dm_timer_set_load(struct omap_dm_timer *timer, int autoreload, · 584 unmodified lines
585585 return 0;
586586 }
587587
588−/* Optimized set_load which removes costly spin wait in timer_start */
589−static int omap_dm_timer_set_load_start(struct omap_dm_timer *timer,
590− int autoreload, unsigned int load)
591−{
592− u32 l;
593−
594− if (unlikely(!timer))
595− return -EINVAL;
596−
597− omap_dm_timer_enable(timer);
598−
599− l = omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG);
600− if (autoreload) {
601− l |= OMAP_TIMER_CTRL_AR;
602− omap_dm_timer_write_reg(timer, OMAP_TIMER_LOAD_REG, load);
603− } else {
604− l &= ~OMAP_TIMER_CTRL_AR;
605− }
606− l |= OMAP_TIMER_CTRL_ST;
607−
608− __omap_dm_timer_load_start(timer, l, load, timer->posted);
609−
610− /* Save the context */
611− timer->context.tclr = l;
612− timer->context.tldr = load;
613− timer->context.tcrr = load;
614− return 0;
615−}
616588 static int omap_dm_timer_set_match(struct omap_dm_timer *timer, int enable,
617589 unsigned int match)
618590 {
drivers/extcon/Kconfig+1−1
@@ -116,7 +116,7 @@ config EXTCON_PALMAS · 115 unmodified lines
116116
117117 config EXTCON_PTN5150
118118 tristate "NXP PTN5150 CC LOGIC USB EXTCON support"
119− depends on I2C && GPIOLIB || COMPILE_TEST
119+ depends on I2C && (GPIOLIB || COMPILE_TEST)
120120 select REGMAP_I2C
121121 help
122122 Say Y here to enable support for USB peripheral and USB host
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c+1−0
@@ -3165,6 +3165,7 @@ static int amdgpu_device_recover_vram(struct amdgpu_device *adev) · 3164 unmodified lines
31653165
31663166 /* No need to recover an evicted BO */
31673167 if (shadow->tbo.mem.mem_type != TTM_PL_TT ||
3168+ shadow->tbo.mem.start == AMDGPU_BO_INVALID_OFFSET ||
31683169 shadow->parent->tbo.mem.mem_type != TTM_PL_VRAM)
31693170 continue;
31703171
drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c+1−0
@@ -182,6 +182,7 @@ static void mmhub_v1_0_init_cache_regs(struct amdgpu_device *adev) · 181 unmodified lines
182182 tmp = REG_SET_FIELD(tmp, VM_L2_CNTL3,
183183 L2_CACHE_BIGK_FRAGMENT_SIZE, 6);
184184 }
185+ WREG32_SOC15(MMHUB, 0, mmVM_L2_CNTL3, tmp);
185186
186187 tmp = mmVM_L2_CNTL4_DEFAULT;
187188 tmp = REG_SET_FIELD(tmp, VM_L2_CNTL4, VMC_TAP_PDE_REQUEST_PHYSICAL, 0);
drivers/gpu/drm/amd/display/dc/core/dc.c+19−0
@@ -1377,6 +1377,11 @@ static enum surface_update_type det_surface_update(const struct dc *dc, · 1376 unmodified lines
13771377 return UPDATE_TYPE_FULL;
13781378 }
13791379
1380+ if (u->surface->force_full_update) {
1381+ update_flags->bits.full_update = 1;
1382+ return UPDATE_TYPE_FULL;
1383+ }
1384+
13801385 type = get_plane_info_update_type(u);
13811386 elevate_update_type(&overall_type, type);
13821387
@@ -1802,6 +1807,14 @@ void dc_commit_updates_for_stream(struct dc *dc, · 419 unmodified lines
18021807 }
18031808
18041809 dc_resource_state_copy_construct(state, context);
1810+
1811+ for (i = 0; i < dc->res_pool->pipe_count; i++) {
1812+ struct pipe_ctx *new_pipe = &context->res_ctx.pipe_ctx[i];
1813+ struct pipe_ctx *old_pipe = &dc->current_state->res_ctx.pipe_ctx[i];
1814+
1815+ if (new_pipe->plane_state && new_pipe->plane_state != old_pipe->plane_state)
1816+ new_pipe->plane_state->force_full_update = true;
1817+ }
18051818 }
18061819
18071820
@@ -1838,6 +1851,12 @@ void dc_commit_updates_for_stream(struct dc *dc, · 30 unmodified lines
18381851 dc->current_state = context;
18391852 dc_release_state(old);
18401853
1854+ for (i = 0; i < dc->res_pool->pipe_count; i++) {
1855+ struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[i];
1856+
1857+ if (pipe_ctx->plane_state && pipe_ctx->stream == stream)
1858+ pipe_ctx->plane_state->force_full_update = false;
1859+ }
18411860 }
18421861 /*let's use current_state to update watermark etc*/
18431862 if (update_type >= UPDATE_TYPE_FULL)
drivers/gpu/drm/amd/display/dc/dc.h+3−0
@@ -503,6 +503,9 @@ struct dc_plane_state { · 502 unmodified lines
503503 struct dc_plane_status status;
504504 struct dc_context *ctx;
505505
506+ /* HACK: Workaround for forcing full reprogramming under some conditions */
507+ bool force_full_update;
508+
506509 /* private to dc_surface.c */
507510 enum dc_irq_source irq_source;
508511 struct kref refcount;
drivers/gpu/drm/amd/display/dc/dce/dce_aux.c+6−3
@@ -190,6 +190,12 @@ static void submit_channel_request( · 189 unmodified lines
190190 1,
191191 0);
192192 }
193+
194+ REG_UPDATE(AUX_INTERRUPT_CONTROL, AUX_SW_DONE_ACK, 1);
195+
196+ REG_WAIT(AUX_SW_STATUS, AUX_SW_DONE, 0,
197+ 10, aux110->timeout_period/10);
198+
193199 /* set the delay and the number of bytes to write */
194200
195201 /* The length include
@@ -242,9 +248,6 @@ static void submit_channel_request( · 46 unmodified lines
242248 }
243249 }
244250
245− REG_UPDATE(AUX_INTERRUPT_CONTROL, AUX_SW_DONE_ACK, 1);
246− REG_WAIT(AUX_SW_STATUS, AUX_SW_DONE, 0,
247− 10, aux110->timeout_period/10);
248251 REG_UPDATE(AUX_SW_CONTROL, AUX_SW_GO, 1);
249252 }
250253
drivers/gpu/drm/amd/display/dc/dce/dce_aux.h+3−3
@@ -71,11 +71,11 @@ enum { /* This is the timeout as defined in DP 1.2a, · 70 unmodified lines
7171 * at most within ~240usec. That means,
7272 * increasing this timeout will not affect normal operation,
7373 * and we'll timeout after
74− * SW_AUX_TIMEOUT_PERIOD_MULTIPLIER * AUX_TIMEOUT_PERIOD = 1600usec.
74+ * SW_AUX_TIMEOUT_PERIOD_MULTIPLIER * AUX_TIMEOUT_PERIOD = 2400usec.
7575 * This timeout is especially important for
76− * resume from S3 and CTS.
76+ * converters, resume from S3, and CTS.
7777 */
78− SW_AUX_TIMEOUT_PERIOD_MULTIPLIER = 4
78+ SW_AUX_TIMEOUT_PERIOD_MULTIPLIER = 6
7979 };
8080
8181 struct dce_aux {
drivers/gpu/drm/i915/intel_fbdev.c+5−7
@@ -338,8 +338,8 @@ static bool intel_fb_initial_config(struct drm_fb_helper *fb_helper, · 337 unmodified lines
338338 bool *enabled, int width, int height)
339339 {
340340 struct drm_i915_private *dev_priv = to_i915(fb_helper->dev);
341+ unsigned long conn_configured, conn_seq, mask;
341342 unsigned int count = min(fb_helper->connector_count, BITS_PER_LONG);
342− unsigned long conn_configured, conn_seq;
343343 int i, j;
344344 bool *save_enabled;
345345 bool fallback = true, ret = true;
@@ -357,9 +357,10 @@ static bool intel_fb_initial_config(struct drm_fb_helper *fb_helper, · 11 unmodified lines
357357 drm_modeset_backoff(&ctx);
358358
359359 memcpy(save_enabled, enabled, count);
360− conn_seq = GENMASK(count - 1, 0);
360+ mask = GENMASK(count - 1, 0);
361361 conn_configured = 0;
362362 retry:
363+ conn_seq = conn_configured;
363364 for (i = 0; i < count; i++) {
364365 struct drm_fb_helper_connector *fb_conn;
365366 struct drm_connector *connector;
@@ -372,8 +373,7 @@ retry: · 6 unmodified lines
372373 if (conn_configured & BIT(i))
373374 continue;
374375
375− /* First pass, only consider tiled connectors */
376− if (conn_seq == GENMASK(count - 1, 0) && !connector->has_tile)
376+ if (conn_seq == 0 && !connector->has_tile)
377377 continue;
378378
379379 if (connector->status == connector_status_connected)
@@ -477,10 +477,8 @@ retry: · 97 unmodified lines
477477 conn_configured |= BIT(i);
478478 }
479479
480− if (conn_configured != conn_seq) { /* repeat until no more are found */
481− conn_seq = conn_configured;
480+ if ((conn_configured & mask) != mask && conn_configured != conn_seq)
482481 goto retry;
483− }
484482
485483 /*
486484 * If the BIOS didn't enable everything it could, fall back to have the
drivers/gpu/drm/tegra/hdmi.c+9−3
@@ -1260,9 +1260,15 @@ static void tegra_hdmi_encoder_enable(struct drm_encoder *encoder) · 1259 unmodified lines
12601260
12611261 hdmi->dvi = !tegra_output_is_hdmi(output);
12621262 if (!hdmi->dvi) {
1263− err = tegra_hdmi_setup_audio(hdmi);
1264− if (err < 0)
1265− hdmi->dvi = true;
1263+ /*
1264+ * Make sure that the audio format has been configured before
1265+ * enabling audio, otherwise we may try to divide by zero.
1266+ */
1267+ if (hdmi->format.sample_rate > 0) {
1268+ err = tegra_hdmi_setup_audio(hdmi);
1269+ if (err < 0)
1270+ hdmi->dvi = true;
1271+ }
12661272 }
12671273
12681274 if (hdmi->config->has_hda)
drivers/gpu/drm/ttm/ttm_bo.c+3−1
@@ -876,8 +876,10 @@ static int ttm_bo_add_move_fence(struct ttm_buffer_object *bo, · 875 unmodified lines
876876 reservation_object_add_shared_fence(bo->resv, fence);
877877
878878 ret = reservation_object_reserve_shared(bo->resv, 1);
879− if (unlikely(ret))
879+ if (unlikely(ret)) {
880+ dma_fence_put(fence);
880881 return ret;
882+ }
881883
882884 dma_fence_put(bo->moving);
883885 bo->moving = fence;
drivers/gpu/drm/ttm/ttm_page_alloc.c+7−6
@@ -730,9 +730,10 @@ static void ttm_put_pages(struct page **pages, unsigned npages, int flags, · 729 unmodified lines
730730 }
731731
732732 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
733− if (!(flags & TTM_PAGE_FLAG_DMA32)) {
734− for (j = 0; j < HPAGE_PMD_NR; ++j)
735− if (p++ != pages[i + j])
733+ if (!(flags & TTM_PAGE_FLAG_DMA32) &&
734+ (npages - i) >= HPAGE_PMD_NR) {
735+ for (j = 1; j < HPAGE_PMD_NR; ++j)
736+ if (++p != pages[i + j])
736737 break;
737738
738739 if (j == HPAGE_PMD_NR)
@@ -759,15 +760,15 @@ static void ttm_put_pages(struct page **pages, unsigned npages, int flags, · 20 unmodified lines
759760 unsigned max_size, n2free;
760761
761762 spin_lock_irqsave(&huge->lock, irq_flags);
762− while (i < npages) {
763+ while ((npages - i) >= HPAGE_PMD_NR) {
763764 struct page *p = pages[i];
764765 unsigned j;
765766
766767 if (!p)
767768 break;
768769
769− for (j = 0; j < HPAGE_PMD_NR; ++j)
770− if (p++ != pages[i + j])
770+ for (j = 1; j < HPAGE_PMD_NR; ++j)
771+ if (++p != pages[i + j])
771772 break;
772773
773774 if (j != HPAGE_PMD_NR)
drivers/gpu/drm/virtio/virtgpu_drv.c+4−0
@@ -205,10 +205,14 @@ static struct drm_driver driver = { · 204 unmodified lines
205205 #if defined(CONFIG_DEBUG_FS)
206206 .debugfs_init = virtio_gpu_debugfs_init,
207207 #endif
208+ .prime_handle_to_fd = drm_gem_prime_handle_to_fd,
209+ .prime_fd_to_handle = drm_gem_prime_fd_to_handle,
208210 .gem_prime_export = drm_gem_prime_export,
209211 .gem_prime_import = drm_gem_prime_import,
210212 .gem_prime_pin = virtgpu_gem_prime_pin,
211213 .gem_prime_unpin = virtgpu_gem_prime_unpin,
214+ .gem_prime_get_sg_table = virtgpu_gem_prime_get_sg_table,
215+ .gem_prime_import_sg_table = virtgpu_gem_prime_import_sg_table,
212216 .gem_prime_vmap = virtgpu_gem_prime_vmap,
213217 .gem_prime_vunmap = virtgpu_gem_prime_vunmap,
214218 .gem_prime_mmap = virtgpu_gem_prime_mmap,
drivers/gpu/drm/virtio/virtgpu_drv.h+4−0
@@ -354,6 +354,10 @@ int virtio_gpu_object_wait(struct virtio_gpu_object *bo, bool no_wait); · 353 unmodified lines
354354 /* virtgpu_prime.c */
355355 int virtgpu_gem_prime_pin(struct drm_gem_object *obj);
356356 void virtgpu_gem_prime_unpin(struct drm_gem_object *obj);
357+struct sg_table *virtgpu_gem_prime_get_sg_table(struct drm_gem_object *obj);
358+struct drm_gem_object *virtgpu_gem_prime_import_sg_table(
359+ struct drm_device *dev, struct dma_buf_attachment *attach,
360+ struct sg_table *sgt);
357361 void *virtgpu_gem_prime_vmap(struct drm_gem_object *obj);
358362 void virtgpu_gem_prime_vunmap(struct drm_gem_object *obj, void *vaddr);
359363 int virtgpu_gem_prime_mmap(struct drm_gem_object *obj,
drivers/gpu/drm/virtio/virtgpu_prime.c+12−0
@@ -39,6 +39,18 @@ void virtgpu_gem_prime_unpin(struct drm_gem_object *obj) · 38 unmodified lines
3939 WARN_ONCE(1, "not implemented");
4040 }
4141
42+struct sg_table *virtgpu_gem_prime_get_sg_table(struct drm_gem_object *obj)
43+{
44+ return ERR_PTR(-ENODEV);
45+}
46+
47+struct drm_gem_object *virtgpu_gem_prime_import_sg_table(
48+ struct drm_device *dev, struct dma_buf_attachment *attach,
49+ struct sg_table *table)
50+{
51+ return ERR_PTR(-ENODEV);
52+}
53+
4254 void *virtgpu_gem_prime_vmap(struct drm_gem_object *obj)
4355 {
4456 struct virtio_gpu_object *bo = gem_to_virtio_gpu_obj(obj);
drivers/gpu/host1x/hw/channel_hw.c+6−2
@@ -114,9 +114,13 @@ static inline void synchronize_syncpt_base(struct host1x_job *job) · 113 unmodified lines
114114
115115 static void host1x_channel_set_streamid(struct host1x_channel *channel)
116116 {
117−#if IS_ENABLED(CONFIG_IOMMU_API) && HOST1X_HW >= 6
117+#if HOST1X_HW >= 6
118+ u32 sid = 0x7f;
119+#ifdef CONFIG_IOMMU_API
118120 struct iommu_fwspec *spec = dev_iommu_fwspec_get(channel->dev->parent);
119− u32 sid = spec ? spec->ids[0] & 0xffff : 0x7f;
121+ if (spec)
122+ sid = spec->ids[0] & 0xffff;
123+#endif
120124
121125 host1x_ch_writel(channel, sid, HOST1X_CHANNEL_SMMU_STREAMID);
122126 #endif
drivers/hid/hid-input.c+16−1
@@ -680,6 +680,14 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel · 679 unmodified lines
680680 break;
681681 }
682682
683+ if ((usage->hid & 0xf0) == 0xb0) { /* SC - Display */
684+ switch (usage->hid & 0xf) {
685+ case 0x05: map_key_clear(KEY_SWITCHVIDEOMODE); break;
686+ default: goto ignore;
687+ }
688+ break;
689+ }
690+
683691 /*
684692 * Some lazy vendors declare 255 usages for System Control,
685693 * leading to the creation of ABS_X|Y axis and too many others.
@@ -902,7 +910,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel · 216 unmodified lines
902910 case 0x06a: map_key_clear(KEY_GREEN); break;
903911 case 0x06b: map_key_clear(KEY_BLUE); break;
904912 case 0x06c: map_key_clear(KEY_YELLOW); break;
905− case 0x06d: map_key_clear(KEY_ZOOM); break;
913+ case 0x06d: map_key_clear(KEY_ASPECT_RATIO); break;
906914
907915 case 0x06f: map_key_clear(KEY_BRIGHTNESSUP); break;
908916 case 0x070: map_key_clear(KEY_BRIGHTNESSDOWN); break;
@@ -911,6 +919,10 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel · 2 unmodified lines
911919 case 0x074: map_key_clear(KEY_BRIGHTNESS_MAX); break;
912920 case 0x075: map_key_clear(KEY_BRIGHTNESS_AUTO); break;
913921
922+ case 0x079: map_key_clear(KEY_KBDILLUMUP); break;
923+ case 0x07a: map_key_clear(KEY_KBDILLUMDOWN); break;
924+ case 0x07c: map_key_clear(KEY_KBDILLUMTOGGLE); break;
925+
914926 case 0x082: map_key_clear(KEY_VIDEO_NEXT); break;
915927 case 0x083: map_key_clear(KEY_LAST); break;
916928 case 0x084: map_key_clear(KEY_ENTER); break;
@@ -1022,6 +1034,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel · 105 unmodified lines
10221034 case 0x22d: map_key_clear(KEY_ZOOMIN); break;
10231035 case 0x22e: map_key_clear(KEY_ZOOMOUT); break;
10241036 case 0x22f: map_key_clear(KEY_ZOOMRESET); break;
1037+ case 0x232: map_key_clear(KEY_FULL_SCREEN); break;
10251038 case 0x233: map_key_clear(KEY_SCROLLUP); break;
10261039 case 0x234: map_key_clear(KEY_SCROLLDOWN); break;
10271040 case 0x238: /* AC Pan */
@@ -1045,6 +1058,8 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel · 17 unmodified lines
10451058 case 0x2cb: map_key_clear(KEY_KBDINPUTASSIST_ACCEPT); break;
10461059 case 0x2cc: map_key_clear(KEY_KBDINPUTASSIST_CANCEL); break;
10471060
1061+ case 0x29f: map_key_clear(KEY_SCALE); break;
1062+
10481063 default: map_key_clear(KEY_UNKNOWN);
10491064 }
10501065 break;
drivers/i3c/master.c+2−3
@@ -1980,7 +1980,6 @@ of_i3c_master_add_i3c_boardinfo(struct i3c_master_controller *master, · 1979 unmodified lines
19801980 {
19811981 struct i3c_dev_boardinfo *boardinfo;
19821982 struct device *dev = &master->dev;
1983− struct i3c_device_info info = { };
19841983 enum i3c_addr_slot_status addrstatus;
19851984 u32 init_dyn_addr = 0;
19861985
@@ -2012,8 +2011,8 @@ of_i3c_master_add_i3c_boardinfo(struct i3c_master_controller *master, · 25 unmodified lines
20122011
20132012 boardinfo->pid = ((u64)reg[1] << 32) | reg[2];
20142013
2015− if ((info.pid & GENMASK_ULL(63, 48)) ||
2016− I3C_PID_RND_LOWER_32BITS(info.pid))
2014+ if ((boardinfo->pid & GENMASK_ULL(63, 48)) ||
2015+ I3C_PID_RND_LOWER_32BITS(boardinfo->pid))
20172016 return -EINVAL;
20182017
20192018 boardinfo->init_dyn_addr = init_dyn_addr;
drivers/i3c/master/dw-i3c-master.c+1−1
@@ -300,7 +300,7 @@ to_dw_i3c_master(struct i3c_master_controller *master) · 299 unmodified lines
300300
301301 static void dw_i3c_master_disable(struct dw_i3c_master *master)
302302 {
303− writel(readl(master->regs + DEVICE_CTRL) & DEV_CTRL_ENABLE,
303+ writel(readl(master->regs + DEVICE_CTRL) & ~DEV_CTRL_ENABLE,
304304 master->regs + DEVICE_CTRL);
305305 }
306306
drivers/iio/accel/kxcjk-1013.c+2−0
@@ -1437,6 +1437,8 @@ static int kxcjk1013_resume(struct device *dev) · 1436 unmodified lines
14371437
14381438 mutex_lock(&data->mutex);
14391439 ret = kxcjk1013_set_mode(data, OPERATION);
1440+ if (ret == 0)
1441+ ret = kxcjk1013_set_range(data, data->range);
14401442 mutex_unlock(&data->mutex);
14411443
14421444 return ret;
drivers/iio/adc/ad_sigma_delta.c+1−0
@@ -121,6 +121,7 @@ static int ad_sd_read_reg_raw(struct ad_sigma_delta *sigma_delta, · 120 unmodified lines
121121 if (sigma_delta->info->has_registers) {
122122 data[0] = reg << sigma_delta->info->addr_shift;
123123 data[0] |= sigma_delta->info->read_mask;
124+ data[0] |= sigma_delta->comm;
124125 spi_message_add_tail(&t[0], &m);
125126 }
126127 spi_message_add_tail(&t[1], &m);
drivers/iio/adc/at91_adc.c+17−11
@@ -704,23 +704,29 @@ static int at91_adc_read_raw(struct iio_dev *idev, · 703 unmodified lines
704704 ret = wait_event_interruptible_timeout(st->wq_data_avail,
705705 st->done,
706706 msecs_to_jiffies(1000));
707− if (ret == 0)
708− ret = -ETIMEDOUT;
709− if (ret < 0) {
710− mutex_unlock(&st->lock);
711− return ret;
712− }
713−
714− *val = st->last_value;
715707
708+ /* Disable interrupts, regardless if adc conversion was
709+ * successful or not
710+ */
716711 at91_adc_writel(st, AT91_ADC_CHDR,
717712 AT91_ADC_CH(chan->channel));
718713 at91_adc_writel(st, AT91_ADC_IDR, BIT(chan->channel));
719714
720− st->last_value = 0;
721− st->done = false;
715+ if (ret > 0) {
716+ /* a valid conversion took place */
717+ *val = st->last_value;
718+ st->last_value = 0;
719+ st->done = false;
720+ ret = IIO_VAL_INT;
721+ } else if (ret == 0) {
722+ /* conversion timeout */
723+ dev_err(&idev->dev, "ADC Channel %d timeout.\n",
724+ chan->channel);
725+ ret = -ETIMEDOUT;
726+ }
727+
722728 mutex_unlock(&st->lock);
723− return IIO_VAL_INT;
729+ return ret;
724730
725731 case IIO_CHAN_INFO_SCALE:
726732 *val = st->vref_mv;
drivers/iio/adc/xilinx-xadc-core.c+2−1
@@ -1292,6 +1292,7 @@ static int xadc_probe(struct platform_device *pdev) · 1291 unmodified lines
12921292
12931293 err_free_irq:
12941294 free_irq(xadc->irq, indio_dev);
1295+ cancel_delayed_work_sync(&xadc->zynq_unmask_work);
12951296 err_clk_disable_unprepare:
12961297 clk_disable_unprepare(xadc->clk);
12971298 err_free_samplerate_trigger:
@@ -1321,8 +1322,8 @@ static int xadc_remove(struct platform_device *pdev) · 23 unmodified lines
13211322 iio_triggered_buffer_cleanup(indio_dev);
13221323 }
13231324 free_irq(xadc->irq, indio_dev);
1325+ cancel_delayed_work_sync(&xadc->zynq_unmask_work);
13241326 clk_disable_unprepare(xadc->clk);
1325− cancel_delayed_work(&xadc->zynq_unmask_work);
13261327 kfree(xadc->data);
13271328 kfree(indio_dev->channels);
13281329
drivers/iio/chemical/Kconfig+14−0
@@ -64,6 +64,7 @@ config IAQCORE · 63 unmodified lines
6464 config PMS7003
6565 tristate "Plantower PMS7003 particulate matter sensor"
6666 depends on SERIAL_DEV_BUS
67+ select IIO_TRIGGERED_BUFFER
6768 help
6869 Say Y here to build support for the Plantower PMS7003 particulate
6970 matter sensor.
@@ -71,6 +72,19 @@ config PMS7003 · 1 unmodified line
7172 To compile this driver as a module, choose M here: the module will
7273 be called pms7003.
7374
75+config SENSIRION_SGP30
76+ tristate "Sensirion SGPxx gas sensors"
77+ depends on I2C
78+ select CRC8
79+ help
80+ Say Y here to build I2C interface support for the following
81+ Sensirion SGP gas sensors:
82+ * SGP30 gas sensor
83+ * SGPC3 low power gas sensor
84+
85+ To compile this driver as module, choose M here: the
86+ module will be called sgp30.
87+
7488 config SPS30
7589 tristate "SPS30 particulate matter sensor"
7690 depends on I2C
drivers/iio/chemical/bme680.h+2−4
@@ -2,11 +2,9 @@ · 1 unmodified line
22 #ifndef BME680_H_
33 #define BME680_H_
44
5−#define BME680_REG_CHIP_I2C_ID 0xD0
6−#define BME680_REG_CHIP_SPI_ID 0x50
5+#define BME680_REG_CHIP_ID 0xD0
76 #define BME680_CHIP_ID_VAL 0x61
8−#define BME680_REG_SOFT_RESET_I2C 0xE0
9−#define BME680_REG_SOFT_RESET_SPI 0x60
7+#define BME680_REG_SOFT_RESET 0xE0
108 #define BME680_CMD_SOFTRESET 0xB6
119 #define BME680_REG_STATUS 0x73
1210 #define BME680_SPI_MEM_PAGE_BIT BIT(4)
drivers/iio/chemical/bme680_core.c+45−9
@@ -63,9 +63,23 @@ struct bme680_data { · 62 unmodified lines
6363 s32 t_fine;
6464 };
6565
66+static const struct regmap_range bme680_volatile_ranges[] = {
67+ regmap_reg_range(BME680_REG_MEAS_STAT_0, BME680_REG_GAS_R_LSB),
68+ regmap_reg_range(BME680_REG_STATUS, BME680_REG_STATUS),
69+ regmap_reg_range(BME680_T2_LSB_REG, BME680_GH3_REG),
70+};
71+
72+static const struct regmap_access_table bme680_volatile_table = {
73+ .yes_ranges = bme680_volatile_ranges,
74+ .n_yes_ranges = ARRAY_SIZE(bme680_volatile_ranges),
75+};
76+
6677 const struct regmap_config bme680_regmap_config = {
6778 .reg_bits = 8,
6879 .val_bits = 8,
80+ .max_register = 0xef,
81+ .volatile_table = &bme680_volatile_table,
82+ .cache_type = REGCACHE_RBTREE,
6983 };
7084 EXPORT_SYMBOL(bme680_regmap_config);
7185
@@ -316,6 +330,10 @@ static s16 bme680_compensate_temp(struct bme680_data *data, · 244 unmodified lines
316330 s64 var1, var2, var3;
317331 s16 calc_temp;
318332
333+ /* If the calibration is invalid, attempt to reload it */
334+ if (!calib->par_t2)
335+ bme680_read_calib(data, calib);
336+
319337 var1 = (adc_temp >> 3) - (calib->par_t1 << 1);
320338 var2 = (var1 * calib->par_t2) >> 11;
321339 var3 = ((var1 >> 1) * (var1 >> 1)) >> 12;
@@ -583,8 +601,7 @@ static int bme680_gas_config(struct bme680_data *data) · 261 unmodified lines
583601 return ret;
584602 }
585603
586−static int bme680_read_temp(struct bme680_data *data,
587− int *val, int *val2)
604+static int bme680_read_temp(struct bme680_data *data, int *val)
588605 {
589606 struct device *dev = regmap_get_device(data->regmap);
590607 int ret;
@@ -617,10 +634,9 @@ static int bme680_read_temp(struct bme680_data *data, · 26 unmodified lines
617634 * compensate_press/compensate_humid to get compensated
618635 * pressure/humidity readings.
619636 */
620− if (val && val2) {
621− *val = comp_temp;
622− *val2 = 100;
623− return IIO_VAL_FRACTIONAL;
637+ if (val) {
638+ *val = comp_temp * 10; /* Centidegrees to millidegrees */
639+ return IIO_VAL_INT;
624640 }
625641
626642 return ret;
@@ -635,7 +651,7 @@ static int bme680_read_press(struct bme680_data *data, · 8 unmodified lines
635651 s32 adc_press;
636652
637653 /* Read and compensate temperature to get a reading of t_fine */
638− ret = bme680_read_temp(data, NULL, NULL);
654+ ret = bme680_read_temp(data, NULL);
639655 if (ret < 0)
640656 return ret;
641657
@@ -668,7 +684,7 @@ static int bme680_read_humid(struct bme680_data *data, · 26 unmodified lines
668684 u32 comp_humidity;
669685
670686 /* Read and compensate temperature to get a reading of t_fine */
671− ret = bme680_read_temp(data, NULL, NULL);
687+ ret = bme680_read_temp(data, NULL);
672688 if (ret < 0)
673689 return ret;
674690
@@ -761,7 +777,7 @@ static int bme680_read_raw(struct iio_dev *indio_dev, · 86 unmodified lines
761777 case IIO_CHAN_INFO_PROCESSED:
762778 switch (chan->type) {
763779 case IIO_TEMP:
764− return bme680_read_temp(data, val, val2);
780+ return bme680_read_temp(data, val);
765781 case IIO_PRESSURE:
766782 return bme680_read_press(data, val, val2);
767783 case IIO_HUMIDITYRELATIVE:
@@ -867,8 +883,28 @@ int bme680_core_probe(struct device *dev, struct regmap *regmap, · 99 unmodified lines
867883 {
868884 struct iio_dev *indio_dev;
869885 struct bme680_data *data;
886+ unsigned int val;
870887 int ret;
871888
889+ ret = regmap_write(regmap, BME680_REG_SOFT_RESET,
890+ BME680_CMD_SOFTRESET);
891+ if (ret < 0) {
892+ dev_err(dev, "Failed to reset chip\n");
893+ return ret;
894+ }
895+
896+ ret = regmap_read(regmap, BME680_REG_CHIP_ID, &val);
897+ if (ret < 0) {
898+ dev_err(dev, "Error reading chip ID\n");
899+ return ret;
900+ }
901+
902+ if (val != BME680_CHIP_ID_VAL) {
903+ dev_err(dev, "Wrong chip ID, got %x expected %x\n",
904+ val, BME680_CHIP_ID_VAL);
905+ return -ENODEV;
906+ }
907+
872908 indio_dev = devm_iio_device_alloc(dev, sizeof(*data));
873909 if (!indio_dev)
874910 return -ENOMEM;
drivers/iio/chemical/bme680_i2c.c+0−21
@@ -23,8 +23,6 @@ static int bme680_i2c_probe(struct i2c_client *client, · 22 unmodified lines
2323 {
2424 struct regmap *regmap;
2525 const char *name = NULL;
26− unsigned int val;
27− int ret;
2826
2927 regmap = devm_regmap_init_i2c(client, &bme680_regmap_config);
3028 if (IS_ERR(regmap)) {
@@ -33,25 +31,6 @@ static int bme680_i2c_probe(struct i2c_client *client, · 2 unmodified lines
3331 return PTR_ERR(regmap);
3432 }
3533
36− ret = regmap_write(regmap, BME680_REG_SOFT_RESET_I2C,
37− BME680_CMD_SOFTRESET);
38− if (ret < 0) {
39− dev_err(&client->dev, "Failed to reset chip\n");
40− return ret;
41− }
42−
43− ret = regmap_read(regmap, BME680_REG_CHIP_I2C_ID, &val);
44− if (ret < 0) {
45− dev_err(&client->dev, "Error reading I2C chip ID\n");
46− return ret;
47− }
48−
49− if (val != BME680_CHIP_ID_VAL) {
50− dev_err(&client->dev, "Wrong chip ID, got %x expected %x\n",
51− val, BME680_CHIP_ID_VAL);
52− return -ENODEV;
53− }
54−
5534 if (id)
5635 name = id->name;
5736
drivers/iio/chemical/bme680_spi.c+78−37
@@ -12,28 +12,93 @@ · 11 unmodified lines
1212
1313 #include "bme680.h"
1414
15+struct bme680_spi_bus_context {
16+ struct spi_device *spi;
17+ u8 current_page;
18+};
19+
20+/*
21+ * In SPI mode there are only 7 address bits, a "page" register determines
22+ * which part of the 8-bit range is active. This function looks at the address
23+ * and writes the page selection bit if needed
24+ */
25+static int bme680_regmap_spi_select_page(
26+ struct bme680_spi_bus_context *ctx, u8 reg)
27+{
28+ struct spi_device *spi = ctx->spi;
29+ int ret;
30+ u8 buf[2];
31+ u8 page = (reg & 0x80) ? 0 : 1; /* Page "1" is low range */
32+
33+ if (page == ctx->current_page)
34+ return 0;
35+
36+ /*
37+ * Data sheet claims we're only allowed to change bit 4, so we must do
38+ * a read-modify-write on each and every page select
39+ */
40+ buf[0] = BME680_REG_STATUS;
41+ ret = spi_write_then_read(spi, buf, 1, buf + 1, 1);
42+ if (ret < 0) {
43+ dev_err(&spi->dev, "failed to set page %u\n", page);
44+ return ret;
45+ }
46+
47+ buf[0] = BME680_REG_STATUS;
48+ if (page)
49+ buf[1] |= BME680_SPI_MEM_PAGE_BIT;
50+ else
51+ buf[1] &= ~BME680_SPI_MEM_PAGE_BIT;
52+
53+ ret = spi_write(spi, buf, 2);
54+ if (ret < 0) {
55+ dev_err(&spi->dev, "failed to set page %u\n", page);
56+ return ret;
57+ }
58+
59+ ctx->current_page = page;
60+
61+ return 0;
62+}
63+
1564 static int bme680_regmap_spi_write(void *context, const void *data,
1665 size_t count)
1766 {
18− struct spi_device *spi = context;
67+ struct bme680_spi_bus_context *ctx = context;
68+ struct spi_device *spi = ctx->spi;
69+ int ret;
1970 u8 buf[2];
2071
2172 memcpy(buf, data, 2);
73+
74+ ret = bme680_regmap_spi_select_page(ctx, buf[0]);
75+ if (ret)
76+ return ret;
77+
2278 /*
2379 * The SPI register address (= full register address without bit 7)
2480 * and the write command (bit7 = RW = '0')
2581 */
2682 buf[0] &= ~0x80;
2783
28− return spi_write_then_read(spi, buf, 2, NULL, 0);
84+ return spi_write(spi, buf, 2);
2985 }
3086
3187 static int bme680_regmap_spi_read(void *context, const void *reg,
3288 size_t reg_size, void *val, size_t val_size)
3389 {
34− struct spi_device *spi = context;
90+ struct bme680_spi_bus_context *ctx = context;
91+ struct spi_device *spi = ctx->spi;
92+ int ret;
93+ u8 addr = *(const u8 *)reg;
94+
95+ ret = bme680_regmap_spi_select_page(ctx, addr);
96+ if (ret)
97+ return ret;
3598
36− return spi_write_then_read(spi, reg, reg_size, val, val_size);
99+ addr |= 0x80; /* bit7 = RW = '1' */
100+
101+ return spi_write_then_read(spi, &addr, 1, val, val_size);
37102 }
38103
39104 static struct regmap_bus bme680_regmap_bus = {
@@ -46,8 +111,8 @@ static struct regmap_bus bme680_regmap_bus = { · 6 unmodified lines
46111 static int bme680_spi_probe(struct spi_device *spi)
47112 {
48113 const struct spi_device_id *id = spi_get_device_id(spi);
114+ struct bme680_spi_bus_context *bus_context;
49115 struct regmap *regmap;
50− unsigned int val;
51116 int ret;
52117
53118 spi->bits_per_word = 8;
@@ -57,45 +122,21 @@ static int bme680_spi_probe(struct spi_device *spi) · 3 unmodified lines
57122 return ret;
58123 }
59124
125+ bus_context = devm_kzalloc(&spi->dev, sizeof(*bus_context), GFP_KERNEL);
126+ if (!bus_context)
127+ return -ENOMEM;
128+
129+ bus_context->spi = spi;
130+ bus_context->current_page = 0xff; /* Undefined on warm boot */
131+
60132 regmap = devm_regmap_init(&spi->dev, &bme680_regmap_bus,
61− &spi->dev, &bme680_regmap_config);
133+ bus_context, &bme680_regmap_config);
62134 if (IS_ERR(regmap)) {
63135 dev_err(&spi->dev, "Failed to register spi regmap %d\n",
64136 (int)PTR_ERR(regmap));
65137 return PTR_ERR(regmap);
66138 }
67139
68− ret = regmap_write(regmap, BME680_REG_SOFT_RESET_SPI,
69− BME680_CMD_SOFTRESET);
70− if (ret < 0) {
71− dev_err(&spi->dev, "Failed to reset chip\n");
72− return ret;
73− }
74−
75− /* after power-on reset, Page 0(0x80-0xFF) of spi_mem_page is active */
76− ret = regmap_read(regmap, BME680_REG_CHIP_SPI_ID, &val);
77− if (ret < 0) {
78− dev_err(&spi->dev, "Error reading SPI chip ID\n");
79− return ret;
80− }
81−
82− if (val != BME680_CHIP_ID_VAL) {
83− dev_err(&spi->dev, "Wrong chip ID, got %x expected %x\n",
84− val, BME680_CHIP_ID_VAL);
85− return -ENODEV;
86− }
87− /*
88− * select Page 1 of spi_mem_page to enable access to
89− * to registers from address 0x00 to 0x7F.
90− */
91− ret = regmap_write_bits(regmap, BME680_REG_STATUS,
92− BME680_SPI_MEM_PAGE_BIT,
93− BME680_SPI_MEM_PAGE_1_VAL);
94− if (ret < 0) {
95− dev_err(&spi->dev, "failed to set page 1 of spi_mem_page\n");
96− return ret;
97− }
98−
99140 return bme680_core_probe(&spi->dev, regmap, id->name);
100141 }
101142
drivers/iio/common/cros_ec_sensors/cros_ec_sensors.c+4−3
@@ -103,9 +103,10 @@ static int cros_ec_sensors_read(struct iio_dev *indio_dev, · 102 unmodified lines
103103 * Do not use IIO_DEGREE_TO_RAD to avoid precision
104104 * loss. Round to the nearest integer.
105105 */
106− *val = div_s64(val64 * 314159 + 9000000ULL, 1000);
107− *val2 = 18000 << (CROS_EC_SENSOR_BITS - 1);
108− ret = IIO_VAL_FRACTIONAL;
106+ *val = 0;
107+ *val2 = div_s64(val64 * 3141592653ULL,
108+ 180 << (CROS_EC_SENSOR_BITS - 1));
109+ ret = IIO_VAL_INT_PLUS_NANO;
109110 break;
110111 case MOTIONSENSE_TYPE_MAG:
111112 /*
drivers/iio/dac/mcp4725.c+1−0
@@ -92,6 +92,7 @@ static ssize_t mcp4725_store_eeprom(struct device *dev, · 91 unmodified lines
9292
9393 inoutbuf[0] = 0x60; /* write EEPROM */
9494 inoutbuf[0] |= data->ref_mode << 3;
95+ inoutbuf[0] |= data->powerdown ? ((data->powerdown_mode + 1) << 1) : 0;
9596 inoutbuf[1] = data->dac_value >> 4;
9697 inoutbuf[2] = (data->dac_value & 0xf) << 4;
9798
drivers/iio/gyro/bmg160_core.c+3−3
@@ -582,11 +582,10 @@ static int bmg160_read_raw(struct iio_dev *indio_dev, · 581 unmodified lines
582582 case IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY:
583583 return bmg160_get_filter(data, val);
584584 case IIO_CHAN_INFO_SCALE:
585− *val = 0;
586585 switch (chan->type) {
587586 case IIO_TEMP:
588− *val2 = 500000;
589− return IIO_VAL_INT_PLUS_MICRO;
587+ *val = 500;
588+ return IIO_VAL_INT;
590589 case IIO_ANGL_VEL:
591590 {
592591 int i;
@@ -594,6 +593,7 @@ static int bmg160_read_raw(struct iio_dev *indio_dev, · 1 unmodified line
594593 for (i = 0; i < ARRAY_SIZE(bmg160_scale_table); ++i) {
595594 if (bmg160_scale_table[i].dps_range ==
596595 data->dps_range) {
596+ *val = 0;
597597 *val2 = bmg160_scale_table[i].scale;
598598 return IIO_VAL_INT_PLUS_MICRO;
599599 }
drivers/iio/gyro/mpu3050-core.c+5−3
@@ -29,7 +29,8 @@ · 28 unmodified lines
2929
3030 #include "mpu3050.h"
3131
32−#define MPU3050_CHIP_ID 0x69
32+#define MPU3050_CHIP_ID 0x68
33+#define MPU3050_CHIP_ID_MASK 0x7E
3334
3435 /*
3536 * Register map: anything suffixed *_H is a big-endian high byte and always
@@ -1176,8 +1177,9 @@ int mpu3050_common_probe(struct device *dev, · 1140 unmodified lines
11761177 goto err_power_down;
11771178 }
11781179
1179− if (val != MPU3050_CHIP_ID) {
1180− dev_err(dev, "unsupported chip id %02x\n", (u8)val);
1180+ if ((val & MPU3050_CHIP_ID_MASK) != MPU3050_CHIP_ID) {
1181+ dev_err(dev, "unsupported chip id %02x\n",
1182+ (u8)(val & MPU3050_CHIP_ID_MASK));
11811183 ret = -ENODEV;
11821184 goto err_power_down;
11831185 }
drivers/iio/industrialio-buffer.c+2−3
@@ -320,9 +320,8 @@ static int iio_scan_mask_set(struct iio_dev *indio_dev, · 319 unmodified lines
320320 const unsigned long *mask;
321321 unsigned long *trialmask;
322322
323− trialmask = kmalloc_array(BITS_TO_LONGS(indio_dev->masklength),
324− sizeof(*trialmask),
325− GFP_KERNEL);
323+ trialmask = kcalloc(BITS_TO_LONGS(indio_dev->masklength),
324+ sizeof(*trialmask), GFP_KERNEL);
326325 if (trialmask == NULL)
327326 return -ENOMEM;
328327 if (!indio_dev->masklength) {
drivers/iio/industrialio-core.c+2−2
@@ -1743,10 +1743,10 @@ EXPORT_SYMBOL(__iio_device_register); · 1742 unmodified lines
17431743 **/
17441744 void iio_device_unregister(struct iio_dev *indio_dev)
17451745 {
1746− mutex_lock(&indio_dev->info_exist_lock);
1747−
17481746 cdev_device_del(&indio_dev->chrdev, &indio_dev->dev);
17491747
1748+ mutex_lock(&indio_dev->info_exist_lock);
1749+
17501750 iio_device_unregister_debugfs(indio_dev);
17511751
17521752 iio_disable_all_buffers(indio_dev);
drivers/infiniband/core/uverbs_main.c+3−0
@@ -993,6 +993,8 @@ void uverbs_user_mmap_disassociate(struct ib_uverbs_file *ufile) · 992 unmodified lines
993993 * will only be one mm, so no big deal.
994994 */
995995 down_write(&mm->mmap_sem);
996+ if (!mmget_still_valid(mm))
997+ goto skip_mm;
996998 mutex_lock(&ufile->umap_lock);
997999 list_for_each_entry_safe (priv, next_priv, &ufile->umaps,
9981000 list) {
@@ -1007,6 +1009,7 @@ void uverbs_user_mmap_disassociate(struct ib_uverbs_file *ufile) · 8 unmodified lines
10071009 vma->vm_flags &= ~(VM_SHARED | VM_MAYSHARE);
10081010 }
10091011 mutex_unlock(&ufile->umap_lock);
1012+ skip_mm:
10101013 up_write(&mm->mmap_sem);
10111014 mmput(mm);
10121015 }
drivers/input/keyboard/snvs_pwrkey.c+3−3
@@ -148,6 +148,9 @@ static int imx_snvs_pwrkey_probe(struct platform_device *pdev) · 147 unmodified lines
148148 return error;
149149 }
150150
151+ pdata->input = input;
152+ platform_set_drvdata(pdev, pdata);
153+
151154 error = devm_request_irq(&pdev->dev, pdata->irq,
152155 imx_snvs_pwrkey_interrupt,
153156 0, pdev->name, pdev);
@@ -163,9 +166,6 @@ static int imx_snvs_pwrkey_probe(struct platform_device *pdev) · 9 unmodified lines
163166 return error;
164167 }
165168
166− pdata->input = input;
167− platform_set_drvdata(pdev, pdata);
168−
169169 device_init_wakeup(&pdev->dev, pdata->wakeup);
170170
171171 return 0;
drivers/input/mouse/elan_i2c_core.c+25−0
@@ -1339,21 +1339,46 @@ static const struct acpi_device_id elan_acpi_id[] = { · 1338 unmodified lines
13391339 { "ELAN0600", 0 },
13401340 { "ELAN0601", 0 },
13411341 { "ELAN0602", 0 },
1342+ { "ELAN0603", 0 },
1343+ { "ELAN0604", 0 },
13421344 { "ELAN0605", 0 },
1345+ { "ELAN0606", 0 },
1346+ { "ELAN0607", 0 },
13431347 { "ELAN0608", 0 },
13441348 { "ELAN0609", 0 },
13451349 { "ELAN060B", 0 },
13461350 { "ELAN060C", 0 },
1351+ { "ELAN060F", 0 },
1352+ { "ELAN0610", 0 },
13471353 { "ELAN0611", 0 },
13481354 { "ELAN0612", 0 },
1355+ { "ELAN0615", 0 },
1356+ { "ELAN0616", 0 },
13491357 { "ELAN0617", 0 },
13501358 { "ELAN0618", 0 },
1359+ { "ELAN0619", 0 },
1360+ { "ELAN061A", 0 },
1361+ { "ELAN061B", 0 },
13511362 { "ELAN061C", 0 },
13521363 { "ELAN061D", 0 },
13531364 { "ELAN061E", 0 },
1365+ { "ELAN061F", 0 },
13541366 { "ELAN0620", 0 },
13551367 { "ELAN0621", 0 },
13561368 { "ELAN0622", 0 },
1369+ { "ELAN0623", 0 },
1370+ { "ELAN0624", 0 },
1371+ { "ELAN0625", 0 },
1372+ { "ELAN0626", 0 },
1373+ { "ELAN0627", 0 },
1374+ { "ELAN0628", 0 },
1375+ { "ELAN0629", 0 },
1376+ { "ELAN062A", 0 },
1377+ { "ELAN062B", 0 },
1378+ { "ELAN062C", 0 },
1379+ { "ELAN062D", 0 },
1380+ { "ELAN0631", 0 },
1381+ { "ELAN0632", 0 },
13571382 { "ELAN1000", 0 },
13581383 { }
13591384 };
drivers/irqchip/irq-ath79-misc.c+11−0
@@ -22,6 +22,15 @@ · 21 unmodified lines
2222 #define AR71XX_RESET_REG_MISC_INT_ENABLE 4
2323
2424 #define ATH79_MISC_IRQ_COUNT 32
25+#define ATH79_MISC_PERF_IRQ 5
26+
27+static int ath79_perfcount_irq;
28+
29+int get_c0_perfcount_int(void)
30+{
31+ return ath79_perfcount_irq;
32+}
33+EXPORT_SYMBOL_GPL(get_c0_perfcount_int);
2534
2635 static void ath79_misc_irq_handler(struct irq_desc *desc)
2736 {
@@ -113,6 +122,8 @@ static void __init ath79_misc_intc_domain_init( · 85 unmodified lines
113122 {
114123 void __iomem *base = domain->host_data;
115124
125+ ath79_perfcount_irq = irq_create_mapping(domain, ATH79_MISC_PERF_IRQ);
126+
116127 /* Disable and clear all interrupts */
117128 __raw_writel(0, base + AR71XX_RESET_REG_MISC_INT_ENABLE);
118129 __raw_writel(0, base + AR71XX_RESET_REG_MISC_INT_STATUS);
drivers/misc/fastrpc.c+6−1
@@ -1184,6 +1184,7 @@ static int fastrpc_cb_probe(struct platform_device *pdev) · 1183 unmodified lines
11841184 struct fastrpc_session_ctx *sess;
11851185 struct device *dev = &pdev->dev;
11861186 int i, sessions = 0;
1187+ int rc;
11871188
11881189 cctx = dev_get_drvdata(dev->parent);
11891190 if (!cctx)
@@ -1213,7 +1214,11 @@ static int fastrpc_cb_probe(struct platform_device *pdev) · 23 unmodified lines
12131214 }
12141215 cctx->sesscount++;
12151216 spin_unlock(&cctx->lock);
1216− dma_set_mask(dev, DMA_BIT_MASK(32));
1217+ rc = dma_set_mask(dev, DMA_BIT_MASK(32));
1218+ if (rc) {
1219+ dev_err(dev, "32-bit DMA enable failed\n");
1220+ return rc;
1221+ }
12171222
12181223 return 0;
12191224 }
drivers/misc/habanalabs/goya/goya.c+4−5
@@ -1688,12 +1688,11 @@ static void goya_init_golden_registers(struct hl_device *hdev) · 1687 unmodified lines
16881688
16891689 /*
16901690 * Workaround for H2 #HW-23 bug
1691− * Set DMA max outstanding read requests to 240 on DMA CH 1. Set it
1692− * to 16 on KMD DMA
1693− * We need to limit only these DMAs because the user can only read
1691+ * Set DMA max outstanding read requests to 240 on DMA CH 1.
1692+ * This limitation is still large enough to not affect Gen4 bandwidth.
1693+ * We need to only limit that DMA channel because the user can only read
16941694 * from Host using DMA CH 1
16951695 */
1696− WREG32(mmDMA_CH_0_CFG0, 0x0fff0010);
16971696 WREG32(mmDMA_CH_1_CFG0, 0x0fff00F0);
16981697
16991698 goya->hw_cap_initialized |= HW_CAP_GOLDEN;
@@ -3693,7 +3692,7 @@ static int goya_validate_dma_pkt_mmu(struct hl_device *hdev, · 1993 unmodified lines
36933692 * WA for HW-23.
36943693 * We can't allow user to read from Host using QMANs other than 1.
36953694 */
3696− if (parser->hw_queue_id > GOYA_QUEUE_ID_DMA_1 &&
3695+ if (parser->hw_queue_id != GOYA_QUEUE_ID_DMA_1 &&
36973696 hl_mem_area_inside_range(le64_to_cpu(user_dma_pkt->src_addr),
36983697 le32_to_cpu(user_dma_pkt->tsize),
36993698 hdev->asic_prop.va_space_host_start_address,
drivers/net/ethernet/atheros/atlx/atl1.c+2−2
@@ -1721,7 +1721,7 @@ static void atl1_inc_smb(struct atl1_adapter *adapter) · 1720 unmodified lines
17211721 adapter->soft_stats.scc += smb->tx_1_col;
17221722 adapter->soft_stats.mcc += smb->tx_2_col;
17231723 adapter->soft_stats.latecol += smb->tx_late_col;
1724− adapter->soft_stats.tx_underun += smb->tx_underrun;
1724+ adapter->soft_stats.tx_underrun += smb->tx_underrun;
17251725 adapter->soft_stats.tx_trunc += smb->tx_trunc;
17261726 adapter->soft_stats.tx_pause += smb->tx_pause;
17271727
@@ -3179,7 +3179,7 @@ static struct atl1_stats atl1_gstrings_stats[] = { · 1451 unmodified lines
31793179 {"tx_deferred_ok", ATL1_STAT(soft_stats.deffer)},
31803180 {"tx_single_coll_ok", ATL1_STAT(soft_stats.scc)},
31813181 {"tx_multi_coll_ok", ATL1_STAT(soft_stats.mcc)},
3182− {"tx_underun", ATL1_STAT(soft_stats.tx_underun)},
3182+ {"tx_underrun", ATL1_STAT(soft_stats.tx_underrun)},
31833183 {"tx_trunc", ATL1_STAT(soft_stats.tx_trunc)},
31843184 {"tx_pause", ATL1_STAT(soft_stats.tx_pause)},
31853185 {"rx_pause", ATL1_STAT(soft_stats.rx_pause)},
drivers/net/ethernet/atheros/atlx/atl1.h+1−1
@@ -681,7 +681,7 @@ struct atl1_sft_stats { · 680 unmodified lines
681681 u64 scc; /* packets TX after a single collision */
682682 u64 mcc; /* packets TX after multiple collisions */
683683 u64 latecol; /* TX packets w/ late collisions */
684− u64 tx_underun; /* TX packets aborted due to TX FIFO underrun
684+ u64 tx_underrun; /* TX packets aborted due to TX FIFO underrun
685685 * or TRD FIFO underrun */
686686 u64 tx_trunc; /* TX packets truncated due to size > MTU */
687687 u64 rx_pause; /* num Pause packets received. */
drivers/net/ethernet/atheros/atlx/atl2.c+1−1
@@ -553,7 +553,7 @@ static void atl2_intr_tx(struct atl2_adapter *adapter) · 552 unmodified lines
553553 netdev->stats.tx_aborted_errors++;
554554 if (txs->late_col)
555555 netdev->stats.tx_window_errors++;
556− if (txs->underun)
556+ if (txs->underrun)
557557 netdev->stats.tx_fifo_errors++;
558558 } while (1);
559559
drivers/net/ethernet/atheros/atlx/atl2.h+1−1
@@ -260,7 +260,7 @@ struct tx_pkt_status { · 259 unmodified lines
260260 unsigned multi_col:1;
261261 unsigned late_col:1;
262262 unsigned abort_col:1;
263− unsigned underun:1; /* current packet is aborted
263+ unsigned underrun:1; /* current packet is aborted
264264 * due to txram underrun */
265265 unsigned:3; /* reserved */
266266 unsigned update:1; /* always 1'b1 in tx_status_buf */
drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c+22−2
@@ -33,6 +33,26 @@ · 32 unmodified lines
3333 #include <linux/bpf_trace.h>
3434 #include "en/xdp.h"
3535
36+int mlx5e_xdp_max_mtu(struct mlx5e_params *params)
37+{
38+ int hr = NET_IP_ALIGN + XDP_PACKET_HEADROOM;
39+
40+ /* Let S := SKB_DATA_ALIGN(sizeof(struct skb_shared_info)).
41+ * The condition checked in mlx5e_rx_is_linear_skb is:
42+ * SKB_DATA_ALIGN(sw_mtu + hard_mtu + hr) + S <= PAGE_SIZE (1)
43+ * (Note that hw_mtu == sw_mtu + hard_mtu.)
44+ * What is returned from this function is:
45+ * max_mtu = PAGE_SIZE - S - hr - hard_mtu (2)
46+ * After assigning sw_mtu := max_mtu, the left side of (1) turns to
47+ * SKB_DATA_ALIGN(PAGE_SIZE - S) + S, which is equal to PAGE_SIZE,
48+ * because both PAGE_SIZE and S are already aligned. Any number greater
49+ * than max_mtu would make the left side of (1) greater than PAGE_SIZE,
50+ * so max_mtu is the maximum MTU allowed.
51+ */
52+
53+ return MLX5E_HW2SW_MTU(params, SKB_MAX_HEAD(hr));
54+}
55+
3656 static inline bool
3757 mlx5e_xmit_xdp_buff(struct mlx5e_xdpsq *sq, struct mlx5e_dma_info *di,
3858 struct xdp_buff *xdp)
@@ -310,9 +330,9 @@ bool mlx5e_poll_xdpsq_cq(struct mlx5e_cq *cq, struct mlx5e_rq *rq) · 271 unmodified lines
310330 mlx5e_xdpi_fifo_pop(xdpi_fifo);
311331
312332 if (is_redirect) {
313− xdp_return_frame(xdpi.xdpf);
314333 dma_unmap_single(sq->pdev, xdpi.dma_addr,
315334 xdpi.xdpf->len, DMA_TO_DEVICE);
335+ xdp_return_frame(xdpi.xdpf);
316336 } else {
317337 /* Recycle RX page */
318338 mlx5e_page_release(rq, &xdpi.di, true);
@@ -351,9 +371,9 @@ void mlx5e_free_xdpsq_descs(struct mlx5e_xdpsq *sq, struct mlx5e_rq *rq) · 32 unmodified lines
351371 mlx5e_xdpi_fifo_pop(xdpi_fifo);
352372
353373 if (is_redirect) {
354− xdp_return_frame(xdpi.xdpf);
355374 dma_unmap_single(sq->pdev, xdpi.dma_addr,
356375 xdpi.xdpf->len, DMA_TO_DEVICE);
376+ xdp_return_frame(xdpi.xdpf);
357377 } else {
358378 /* Recycle RX page */
359379 mlx5e_page_release(rq, &xdpi.di, false);
drivers/net/ethernet/mellanox/mlx5/core/en/xdp.h+1−2
@@ -34,13 +34,12 @@ · 33 unmodified lines
3434
3535 #include "en.h"
3636
37−#define MLX5E_XDP_MAX_MTU ((int)(PAGE_SIZE - \
38− MLX5_SKB_FRAG_SZ(XDP_PACKET_HEADROOM)))
3937 #define MLX5E_XDP_MIN_INLINE (ETH_HLEN + VLAN_HLEN)
4038 #define MLX5E_XDP_TX_EMPTY_DS_COUNT \
4139 (sizeof(struct mlx5e_tx_wqe) / MLX5_SEND_WQE_DS)
4240 #define MLX5E_XDP_TX_DS_COUNT (MLX5E_XDP_TX_EMPTY_DS_COUNT + 1 /* SG DS */)
4341
42+int mlx5e_xdp_max_mtu(struct mlx5e_params *params);
4443 bool mlx5e_xdp_handle(struct mlx5e_rq *rq, struct mlx5e_dma_info *di,
4544 void *va, u16 *rx_headroom, u32 *len);
4645 bool mlx5e_poll_xdpsq_cq(struct mlx5e_cq *cq, struct mlx5e_rq *rq);
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c+1−1
@@ -1586,7 +1586,7 @@ static int mlx5e_get_module_info(struct net_device *netdev, · 1585 unmodified lines
15861586 break;
15871587 case MLX5_MODULE_ID_SFP:
15881588 modinfo->type = ETH_MODULE_SFF_8472;
1589− modinfo->eeprom_len = ETH_MODULE_SFF_8472_LEN;
1589+ modinfo->eeprom_len = MLX5_EEPROM_PAGE_LENGTH;
15901590 break;
15911591 default:
15921592 netdev_err(priv->netdev, "%s: cable type not recognized:0x%x\n",
drivers/net/ethernet/mellanox/mlx5/core/en_main.c+3−2
@@ -3720,7 +3720,7 @@ int mlx5e_change_mtu(struct net_device *netdev, int new_mtu, · 3719 unmodified lines
37203720 if (params->xdp_prog &&
37213721 !mlx5e_rx_is_linear_skb(&new_channels.params)) {
37223722 netdev_err(netdev, "MTU(%d) > %d is not allowed while XDP enabled\n",
3723− new_mtu, MLX5E_XDP_MAX_MTU);
3723+ new_mtu, mlx5e_xdp_max_mtu(params));
37243724 err = -EINVAL;
37253725 goto out;
37263726 }
@@ -4161,7 +4161,8 @@ static int mlx5e_xdp_allowed(struct mlx5e_priv *priv, struct bpf_prog *prog) · 434 unmodified lines
41614161
41624162 if (!mlx5e_rx_is_linear_skb(&new_channels.params)) {
41634163 netdev_warn(netdev, "XDP is not allowed with MTU(%d) > %d\n",
4164− new_channels.params.sw_mtu, MLX5E_XDP_MAX_MTU);
4164+ new_channels.params.sw_mtu,
4165+ mlx5e_xdp_max_mtu(&new_channels.params));
41654166 return -EINVAL;
41664167 }
41674168
drivers/net/ethernet/mellanox/mlx5/core/port.c+0−4
@@ -317,10 +317,6 @@ int mlx5_query_module_eeprom(struct mlx5_core_dev *dev, · 316 unmodified lines
317317 size -= offset + size - MLX5_EEPROM_PAGE_LENGTH;
318318
319319 i2c_addr = MLX5_I2C_ADDR_LOW;
320− if (offset >= MLX5_EEPROM_PAGE_LENGTH) {
321− i2c_addr = MLX5_I2C_ADDR_HIGH;
322− offset -= MLX5_EEPROM_PAGE_LENGTH;
323− }
324320
325321 MLX5_SET(mcia_reg, in, l, 0);
326322 MLX5_SET(mcia_reg, in, module, module_num);
drivers/net/ethernet/mellanox/mlxsw/pci_hw.h+1−1
@@ -27,7 +27,7 @@ · 26 unmodified lines
2727
2828 #define MLXSW_PCI_SW_RESET 0xF0010
2929 #define MLXSW_PCI_SW_RESET_RST_BIT BIT(0)
30−#define MLXSW_PCI_SW_RESET_TIMEOUT_MSECS 13000
30+#define MLXSW_PCI_SW_RESET_TIMEOUT_MSECS 20000
3131 #define MLXSW_PCI_SW_RESET_WAIT_MSECS 100
3232 #define MLXSW_PCI_FW_READY 0xA1844
3333 #define MLXSW_PCI_FW_READY_MASK 0xFFFF
drivers/net/ethernet/mellanox/mlxsw/spectrum.c+3−3
@@ -3113,11 +3113,11 @@ mlxsw_sp_port_set_link_ksettings(struct net_device *dev, · 3112 unmodified lines
31133113 if (err)
31143114 return err;
31153115
3116+ mlxsw_sp_port->link.autoneg = autoneg;
3117+
31163118 if (!netif_running(dev))
31173119 return 0;
31183120
3119− mlxsw_sp_port->link.autoneg = autoneg;
3120−
31213121 mlxsw_sp_port_admin_status_set(mlxsw_sp_port, false);
31223122 mlxsw_sp_port_admin_status_set(mlxsw_sp_port, true);
31233123
@@ -3303,7 +3303,7 @@ static int mlxsw_sp_port_ets_init(struct mlxsw_sp_port *mlxsw_sp_port) · 179 unmodified lines
33033303 err = mlxsw_sp_port_ets_set(mlxsw_sp_port,
33043304 MLXSW_REG_QEEC_HIERARCY_TC,
33053305 i + 8, i,
3306− false, 0);
3306+ true, 100);
33073307 if (err)
33083308 return err;
33093309 }
drivers/net/ethernet/netronome/nfp/abm/cls.c+2−2
@@ -39,7 +39,7 @@ nfp_abm_u32_check_knode(struct nfp_abm *abm, struct tc_cls_u32_knode *knode, · 38 unmodified lines
3939 }
4040 if (knode->sel->off || knode->sel->offshift || knode->sel->offmask ||
4141 knode->sel->offoff || knode->fshift) {
42− NL_SET_ERR_MSG_MOD(extack, "variable offseting not supported");
42+ NL_SET_ERR_MSG_MOD(extack, "variable offsetting not supported");
4343 return false;
4444 }
4545 if (knode->sel->hoff || knode->sel->hmask) {
@@ -78,7 +78,7 @@ nfp_abm_u32_check_knode(struct nfp_abm *abm, struct tc_cls_u32_knode *knode, · 32 unmodified lines
7878
7979 k = &knode->sel->keys[0];
8080 if (k->offmask) {
81− NL_SET_ERR_MSG_MOD(extack, "offset mask - variable offseting not supported");
81+ NL_SET_ERR_MSG_MOD(extack, "offset mask - variable offsetting not supported");
8282 return false;
8383 }
8484 if (k->off) {
drivers/net/ethernet/socionext/netsec.c+7−4
@@ -673,7 +673,8 @@ static void netsec_process_tx(struct netsec_priv *priv) · 672 unmodified lines
673673 }
674674
675675 static void *netsec_alloc_rx_data(struct netsec_priv *priv,
676− dma_addr_t *dma_handle, u16 *desc_len)
676+ dma_addr_t *dma_handle, u16 *desc_len,
677+ bool napi)
677678 {
678679 size_t total_len = SKB_DATA_ALIGN(sizeof(struct skb_shared_info));
679680 size_t payload_len = NETSEC_RX_BUF_SZ;
@@ -682,7 +683,7 @@ static void *netsec_alloc_rx_data(struct netsec_priv *priv, · 2 unmodified lines
682683
683684 total_len += SKB_DATA_ALIGN(payload_len + NETSEC_SKB_PAD);
684685
685− buf = napi_alloc_frag(total_len);
686+ buf = napi ? napi_alloc_frag(total_len) : netdev_alloc_frag(total_len);
686687 if (!buf)
687688 return NULL;
688689
@@ -765,7 +766,8 @@ static int netsec_process_rx(struct netsec_priv *priv, int budget) · 76 unmodified lines
765766 /* allocate a fresh buffer and map it to the hardware.
766767 * This will eventually replace the old buffer in the hardware
767768 */
768− buf_addr = netsec_alloc_rx_data(priv, &dma_handle, &desc_len);
769+ buf_addr = netsec_alloc_rx_data(priv, &dma_handle, &desc_len,
770+ true);
769771 if (unlikely(!buf_addr))
770772 break;
771773
@@ -1069,7 +1071,8 @@ static int netsec_setup_rx_dring(struct netsec_priv *priv) · 297 unmodified lines
10691071 void *buf;
10701072 u16 len;
10711073
1072− buf = netsec_alloc_rx_data(priv, &dma_handle, &len);
1074+ buf = netsec_alloc_rx_data(priv, &dma_handle, &len,
1075+ false);
10731076 if (!buf) {
10741077 netsec_uninit_pkt_dring(priv, NETSEC_RING_RX);
10751078 goto err_out;
drivers/net/ethernet/stmicro/stmmac/norm_desc.c+1−1
@@ -140,7 +140,7 @@ static void ndesc_init_rx_desc(struct dma_desc *p, int disable_rx_ic, int mode, · 139 unmodified lines
140140 p->des0 |= cpu_to_le32(RDES0_OWN);
141141
142142 bfsize1 = min(bfsize, BUF_SIZE_2KiB - 1);
143− p->des1 |= cpu_to_le32(bfsize & RDES1_BUFFER1_SIZE_MASK);
143+ p->des1 |= cpu_to_le32(bfsize1 & RDES1_BUFFER1_SIZE_MASK);
144144
145145 if (mode == STMMAC_CHAIN_MODE)
146146 ndesc_rx_set_on_chain(p, end);
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c+2−2
@@ -2616,8 +2616,6 @@ static int stmmac_open(struct net_device *dev) · 2615 unmodified lines
26162616 u32 chan;
26172617 int ret;
26182618
2619− stmmac_check_ether_addr(priv);
2620−
26212619 if (priv->hw->pcs != STMMAC_PCS_RGMII &&
26222620 priv->hw->pcs != STMMAC_PCS_TBI &&
26232621 priv->hw->pcs != STMMAC_PCS_RTBI) {
@@ -4303,6 +4301,8 @@ int stmmac_dvr_probe(struct device *device, · 1679 unmodified lines
43034301 if (ret)
43044302 goto error_hw_init;
43054303
4304+ stmmac_check_ether_addr(priv);
4305+
43064306 /* Configure real RX and TX queues */
43074307 netif_set_real_num_rx_queues(ndev, priv->plat->rx_queues_to_use);
43084308 netif_set_real_num_tx_queues(ndev, priv->plat->tx_queues_to_use);
drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c+6−2
@@ -159,6 +159,12 @@ static const struct dmi_system_id quark_pci_dmi[] = { · 158 unmodified lines
159159 },
160160 .driver_data = (void *)&galileo_stmmac_dmi_data,
161161 },
162+ /*
163+ * There are 2 types of SIMATIC IOT2000: IOT20202 and IOT2040.
164+ * The asset tag "6ES7647-0AA00-0YA2" is only for IOT2020 which
165+ * has only one pci network device while other asset tags are
166+ * for IOT2040 which has two.
167+ */
162168 {
163169 .matches = {
164170 DMI_EXACT_MATCH(DMI_BOARD_NAME, "SIMATIC IOT2000"),
@@ -170,8 +176,6 @@ static const struct dmi_system_id quark_pci_dmi[] = { · 5 unmodified lines
170176 {
171177 .matches = {
172178 DMI_EXACT_MATCH(DMI_BOARD_NAME, "SIMATIC IOT2000"),
173− DMI_EXACT_MATCH(DMI_BOARD_ASSET_TAG,
174− "6ES7647-0AA00-1YA2"),
175179 },
176180 .driver_data = (void *)&iot2040_stmmac_dmi_data,
177181 },
drivers/net/phy/spi_ks8995.c+9−0
@@ -159,6 +159,14 @@ static const struct spi_device_id ks8995_id[] = { · 158 unmodified lines
159159 };
160160 MODULE_DEVICE_TABLE(spi, ks8995_id);
161161
162+static const struct of_device_id ks8895_spi_of_match[] = {
163+ { .compatible = "micrel,ks8995" },
164+ { .compatible = "micrel,ksz8864" },
165+ { .compatible = "micrel,ksz8795" },
166+ { },
167+ };
168+MODULE_DEVICE_TABLE(of, ks8895_spi_of_match);
169+
162170 static inline u8 get_chip_id(u8 val)
163171 {
164172 return (val >> ID1_CHIPID_S) & ID1_CHIPID_M;
@@ -526,6 +534,7 @@ static int ks8995_remove(struct spi_device *spi) · 361 unmodified lines
526534 static struct spi_driver ks8995_driver = {
527535 .driver = {
528536 .name = "spi-ks8995",
537+ .of_match_table = of_match_ptr(ks8895_spi_of_match),
529538 },
530539 .probe = ks8995_probe,
531540 .remove = ks8995_remove,
drivers/net/team/team.c+7−0
@@ -1154,6 +1154,13 @@ static int team_port_add(struct team *team, struct net_device *port_dev, · 1153 unmodified lines
11541154 return -EINVAL;
11551155 }
11561156
1157+ if (netdev_has_upper_dev(dev, port_dev)) {
1158+ NL_SET_ERR_MSG(extack, "Device is already an upper device of the team interface");
1159+ netdev_err(dev, "Device %s is already an upper device of the team interface\n",
1160+ portname);
1161+ return -EBUSY;
1162+ }
1163+
11571164 if (port_dev->features & NETIF_F_VLAN_CHALLENGED &&
11581165 vlan_uses_dev(dev)) {
11591166 NL_SET_ERR_MSG(extack, "Device is VLAN challenged and team device has VLAN set up");
drivers/net/vrf.c+2−0
@@ -873,6 +873,7 @@ static const struct net_device_ops vrf_netdev_ops = { · 872 unmodified lines
873873 .ndo_init = vrf_dev_init,
874874 .ndo_uninit = vrf_dev_uninit,
875875 .ndo_start_xmit = vrf_xmit,
876+ .ndo_set_mac_address = eth_mac_addr,
876877 .ndo_get_stats64 = vrf_get_stats64,
877878 .ndo_add_slave = vrf_add_slave,
878879 .ndo_del_slave = vrf_del_slave,
@@ -1272,6 +1273,7 @@ static void vrf_setup(struct net_device *dev) · 393 unmodified lines
12721273 /* default to no qdisc; user can add if desired */
12731274 dev->priv_flags |= IFF_NO_QUEUE;
12741275 dev->priv_flags |= IFF_NO_RX_HANDLER;
1276+ dev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
12751277
12761278 /* VRF devices do not care about MTU, but if the MTU is set
12771279 * too low then the ipv4 and ipv6 protocols are disabled
drivers/nfc/st95hf/core.c+7−0
@@ -1074,6 +1074,12 @@ static const struct spi_device_id st95hf_id[] = { · 1073 unmodified lines
10741074 };
10751075 MODULE_DEVICE_TABLE(spi, st95hf_id);
10761076
1077+static const struct of_device_id st95hf_spi_of_match[] = {
1078+ { .compatible = "st,st95hf" },
1079+ { },
1080+};
1081+MODULE_DEVICE_TABLE(of, st95hf_spi_of_match);
1082+
10771083 static int st95hf_probe(struct spi_device *nfc_spi_dev)
10781084 {
10791085 int ret;
@@ -1260,6 +1266,7 @@ static struct spi_driver st95hf_driver = { · 180 unmodified lines
12601266 .driver = {
12611267 .name = "st95hf",
12621268 .owner = THIS_MODULE,
1269+ .of_match_table = of_match_ptr(st95hf_spi_of_match),
12631270 },
12641271 .id_table = st95hf_id,
12651272 .probe = st95hf_probe,
drivers/of/of_net.c+0−1
@@ -7,7 +7,6 @@ · 6 unmodified lines
77 */
88 #include <linux/etherdevice.h>
99 #include <linux/kernel.h>
10−#include <linux/nvmem-consumer.h>
1110 #include <linux/of_net.h>
1211 #include <linux/phy.h>
1312 #include <linux/export.h>
drivers/power/supply/goldfish_battery.c+1−1
@@ -1,4 +1,4 @@
1−// SPDX-License-Identifier: GPL
1+// SPDX-License-Identifier: GPL-2.0
22 /*
33 * Power supply driver for the goldfish emulator
44 *
drivers/s390/block/dasd_eckd.c+3−3
@@ -2004,14 +2004,14 @@ static int dasd_eckd_end_analysis(struct dasd_block *block) · 2003 unmodified lines
20042004 blk_per_trk = recs_per_track(&private->rdc_data, 0, block->bp_block);
20052005
20062006 raw:
2007− block->blocks = (private->real_cyl *
2007+ block->blocks = ((unsigned long) private->real_cyl *
20082008 private->rdc_data.trk_per_cyl *
20092009 blk_per_trk);
20102010
20112011 dev_info(&device->cdev->dev,
2012− "DASD with %d KB/block, %d KB total size, %d KB/track, "
2012+ "DASD with %u KB/block, %lu KB total size, %u KB/track, "
20132013 "%s\n", (block->bp_block >> 10),
2014− ((private->real_cyl *
2014+ (((unsigned long) private->real_cyl *
20152015 private->rdc_data.trk_per_cyl *
20162016 blk_per_trk * (block->bp_block >> 9)) >> 1),
20172017 ((blk_per_trk * block->bp_block) >> 10),
drivers/s390/char/con3270.c+1−1
@@ -629,7 +629,7 @@ con3270_init(void) · 628 unmodified lines
629629 (void (*)(unsigned long)) con3270_read_tasklet,
630630 (unsigned long) condev->read);
631631
632− raw3270_add_view(&condev->view, &con3270_fn, 1);
632+ raw3270_add_view(&condev->view, &con3270_fn, 1, RAW3270_VIEW_LOCK_IRQ);
633633
634634 INIT_LIST_HEAD(&condev->freemem);
635635 for (i = 0; i < CON3270_STRING_PAGES; i++) {
drivers/s390/char/fs3270.c+2−1
@@ -463,7 +463,8 @@ fs3270_open(struct inode *inode, struct file *filp) · 462 unmodified lines
463463
464464 init_waitqueue_head(&fp->wait);
465465 fp->fs_pid = get_pid(task_pid(current));
466− rc = raw3270_add_view(&fp->view, &fs3270_fn, minor);
466+ rc = raw3270_add_view(&fp->view, &fs3270_fn, minor,
467+ RAW3270_VIEW_LOCK_BH);
467468 if (rc) {
468469 fs3270_free_view(&fp->view);
469470 goto out;
drivers/s390/char/raw3270.c+2−1
@@ -920,7 +920,7 @@ raw3270_deactivate_view(struct raw3270_view *view) · 919 unmodified lines
920920 * Add view to device with minor "minor".
921921 */
922922 int
923−raw3270_add_view(struct raw3270_view *view, struct raw3270_fn *fn, int minor)
923+raw3270_add_view(struct raw3270_view *view, struct raw3270_fn *fn, int minor, int subclass)
924924 {
925925 unsigned long flags;
926926 struct raw3270 *rp;
@@ -942,6 +942,7 @@ raw3270_add_view(struct raw3270_view *view, struct raw3270_fn *fn, int minor) · 15 unmodified lines
942942 view->cols = rp->cols;
943943 view->ascebc = rp->ascebc;
944944 spin_lock_init(&view->lock);
945+ lockdep_set_subclass(&view->lock, subclass);
945946 list_add(&view->list, &rp->view_list);
946947 rc = 0;
947948 spin_unlock_irqrestore(get_ccwdev_lock(rp->cdev), flags);
drivers/s390/char/raw3270.h+3−1
@@ -150,6 +150,8 @@ struct raw3270_fn { · 149 unmodified lines
150150 struct raw3270_view {
151151 struct list_head list;
152152 spinlock_t lock;
153+#define RAW3270_VIEW_LOCK_IRQ 0
154+#define RAW3270_VIEW_LOCK_BH 1
153155 atomic_t ref_count;
154156 struct raw3270 *dev;
155157 struct raw3270_fn *fn;
@@ -158,7 +160,7 @@ struct raw3270_view { · 2 unmodified lines
158160 unsigned char *ascebc; /* ascii -> ebcdic table */
159161 };
160162
161−int raw3270_add_view(struct raw3270_view *, struct raw3270_fn *, int);
163+int raw3270_add_view(struct raw3270_view *, struct raw3270_fn *, int, int);
162164 int raw3270_activate_view(struct raw3270_view *);
163165 void raw3270_del_view(struct raw3270_view *);
164166 void raw3270_deactivate_view(struct raw3270_view *);
drivers/s390/char/tty3270.c+2−1
@@ -980,7 +980,8 @@ static int tty3270_install(struct tty_driver *driver, struct tty_struct *tty) · 979 unmodified lines
980980 return PTR_ERR(tp);
981981
982982 rc = raw3270_add_view(&tp->view, &tty3270_fn,
983− tty->index + RAW3270_FIRSTMINOR);
983+ tty->index + RAW3270_FIRSTMINOR,
984+ RAW3270_VIEW_LOCK_BH);
984985 if (rc) {
985986 tty3270_free_view(tp);
986987 return rc;
drivers/s390/crypto/ap_queue.c+1−1
@@ -751,8 +751,8 @@ void ap_queue_prepare_remove(struct ap_queue *aq) · 750 unmodified lines
751751 __ap_flush_queue(aq);
752752 /* set REMOVE state to prevent new messages are queued in */
753753 aq->state = AP_STATE_REMOVE;
754− del_timer_sync(&aq->timeout);
755754 spin_unlock_bh(&aq->lock);
755+ del_timer_sync(&aq->timeout);
756756 }
757757
758758 void ap_queue_remove(struct ap_queue *aq)
drivers/s390/crypto/pkey_api.c+2−1
@@ -51,7 +51,8 @@ static debug_info_t *debug_info; · 50 unmodified lines
5151
5252 static void __init pkey_debug_init(void)
5353 {
54− debug_info = debug_register("pkey", 1, 1, 4 * sizeof(long));
54+ /* 5 arguments per dbf entry (including the format string ptr) */
55+ debug_info = debug_register("pkey", 1, 1, 5 * sizeof(long));
5556 debug_register_view(debug_info, &debug_sprintf_view);
5657 debug_set_level(debug_info, 3);
5758 }
drivers/s390/net/ctcm_main.c+1−0
@@ -1595,6 +1595,7 @@ static int ctcm_new_device(struct ccwgroup_device *cgdev) · 1594 unmodified lines
15951595 if (priv->channel[direction] == NULL) {
15961596 if (direction == CTCM_WRITE)
15971597 channel_free(priv->channel[CTCM_READ]);
1598+ result = -ENODEV;
15981599 goto out_dev;
15991600 }
16001601 priv->channel[direction]->netdev = dev;
drivers/scsi/aic7xxx/aic7770_osm.c+1−0
@@ -91,6 +91,7 @@ aic7770_probe(struct device *dev) · 90 unmodified lines
9191 ahc = ahc_alloc(&aic7xxx_driver_template, name);
9292 if (ahc == NULL)
9393 return (ENOMEM);
94+ ahc->dev = dev;
9495 error = aic7770_config(ahc, aic7770_ident_table + edev->id.driver_data,
9596 eisaBase);
9697 if (error != 0) {
drivers/scsi/aic7xxx/aic7xxx.h+1−0
@@ -943,6 +943,7 @@ struct ahc_softc { · 942 unmodified lines
943943 * Platform specific device information.
944944 */
945945 ahc_dev_softc_t dev_softc;
946+ struct device *dev;
946947
947948 /*
948949 * Bus specific device information.
drivers/scsi/aic7xxx/aic7xxx_osm.c+4−6
@@ -860,8 +860,8 @@ int · 859 unmodified lines
860860 ahc_dmamem_alloc(struct ahc_softc *ahc, bus_dma_tag_t dmat, void** vaddr,
861861 int flags, bus_dmamap_t *mapp)
862862 {
863− *vaddr = pci_alloc_consistent(ahc->dev_softc,
864− dmat->maxsize, mapp);
863+ /* XXX: check if we really need the GFP_ATOMIC and unwind this mess! */
864+ *vaddr = dma_alloc_coherent(ahc->dev, dmat->maxsize, mapp, GFP_ATOMIC);
865865 if (*vaddr == NULL)
866866 return ENOMEM;
867867 return 0;
@@ -871,8 +871,7 @@ void · 3 unmodified lines
871871 ahc_dmamem_free(struct ahc_softc *ahc, bus_dma_tag_t dmat,
872872 void* vaddr, bus_dmamap_t map)
873873 {
874− pci_free_consistent(ahc->dev_softc, dmat->maxsize,
875− vaddr, map);
874+ dma_free_coherent(ahc->dev, dmat->maxsize, vaddr, map);
876875 }
877876
878877 int
@@ -1123,8 +1122,7 @@ ahc_linux_register_host(struct ahc_softc *ahc, struct scsi_host_template *templa · 244 unmodified lines
11231122
11241123 host->transportt = ahc_linux_transport_template;
11251124
1126− retval = scsi_add_host(host,
1127− (ahc->dev_softc ? &ahc->dev_softc->dev : NULL));
1125+ retval = scsi_add_host(host, ahc->dev);
11281126 if (retval) {
11291127 printk(KERN_WARNING "aic7xxx: scsi_add_host failed\n");
11301128 scsi_host_put(host);
drivers/scsi/aic7xxx/aic7xxx_osm_pci.c+1−0
@@ -250,6 +250,7 @@ ahc_linux_pci_dev_probe(struct pci_dev *pdev, const struct pci_device_id *ent) · 249 unmodified lines
250250 }
251251 }
252252 ahc->dev_softc = pci;
253+ ahc->dev = &pci->dev;
253254 error = ahc_pci_config(ahc, entry);
254255 if (error != 0) {
255256 ahc_free(ahc);
drivers/scsi/libfc/fc_rport.c+0−1
@@ -2162,7 +2162,6 @@ static void fc_rport_recv_logo_req(struct fc_lport *lport, struct fc_frame *fp) · 2161 unmodified lines
21622162 FC_RPORT_DBG(rdata, "Received LOGO request while in state %s\n",
21632163 fc_rport_state(rdata));
21642164
2165− rdata->flags &= ~FC_RP_STARTED;
21662165 fc_rport_enter_delete(rdata, RPORT_EV_STOP);
21672166 mutex_unlock(&rdata->rp_mutex);
21682167 kref_put(&rdata->kref, fc_rport_destroy);
drivers/scsi/scsi_lib.c+5−1
@@ -1706,8 +1706,12 @@ out_put_budget: · 1705 unmodified lines
17061706 ret = BLK_STS_DEV_RESOURCE;
17071707 break;
17081708 default:
1709+ if (unlikely(!scsi_device_online(sdev)))
1710+ scsi_req(req)->result = DID_NO_CONNECT << 16;
1711+ else
1712+ scsi_req(req)->result = DID_ERROR << 16;
17091713 /*
1710− * Make sure to release all allocated ressources when
1714+ * Make sure to release all allocated resources when
17111715 * we hit an error, as we will never see this command
17121716 * again.
17131717 */
drivers/staging/comedi/drivers/ni_usb6501.c+4−6
@@ -463,10 +463,8 @@ static int ni6501_alloc_usb_buffers(struct comedi_device *dev) · 462 unmodified lines
463463
464464 size = usb_endpoint_maxp(devpriv->ep_tx);
465465 devpriv->usb_tx_buf = kzalloc(size, GFP_KERNEL);
466− if (!devpriv->usb_tx_buf) {
467− kfree(devpriv->usb_rx_buf);
466+ if (!devpriv->usb_tx_buf)
468467 return -ENOMEM;
469− }
470468
471469 return 0;
472470 }
@@ -518,6 +516,9 @@ static int ni6501_auto_attach(struct comedi_device *dev, · 45 unmodified lines
518516 if (!devpriv)
519517 return -ENOMEM;
520518
519+ mutex_init(&devpriv->mut);
520+ usb_set_intfdata(intf, devpriv);
521+
521522 ret = ni6501_find_endpoints(dev);
522523 if (ret)
523524 return ret;
@@ -526,9 +527,6 @@ static int ni6501_auto_attach(struct comedi_device *dev, · 2 unmodified lines
526527 if (ret)
527528 return ret;
528529
529− mutex_init(&devpriv->mut);
530− usb_set_intfdata(intf, devpriv);
531−
532530 ret = comedi_alloc_subdevices(dev, 2);
533531 if (ret)
534532 return ret;
drivers/staging/comedi/drivers/vmk80xx.c+3−5
@@ -682,10 +682,8 @@ static int vmk80xx_alloc_usb_buffers(struct comedi_device *dev) · 681 unmodified lines
682682
683683 size = usb_endpoint_maxp(devpriv->ep_tx);
684684 devpriv->usb_tx_buf = kzalloc(size, GFP_KERNEL);
685− if (!devpriv->usb_tx_buf) {
686− kfree(devpriv->usb_rx_buf);
685+ if (!devpriv->usb_tx_buf)
687686 return -ENOMEM;
688− }
689687
690688 return 0;
691689 }
@@ -800,6 +798,8 @@ static int vmk80xx_auto_attach(struct comedi_device *dev, · 108 unmodified lines
800798
801799 devpriv->model = board->model;
802800
801+ sema_init(&devpriv->limit_sem, 8);
802+
803803 ret = vmk80xx_find_usb_endpoints(dev);
804804 if (ret)
805805 return ret;
@@ -808,8 +808,6 @@ static int vmk80xx_auto_attach(struct comedi_device *dev, · 2 unmodified lines
808808 if (ret)
809809 return ret;
810810
811− sema_init(&devpriv->limit_sem, 8);
812−
813811 usb_set_intfdata(intf, devpriv);
814812
815813 if (devpriv->model == VMK8055_MODEL)
drivers/staging/erofs/data.c+1−1
@@ -298,7 +298,7 @@ submit_bio_retry: · 297 unmodified lines
298298 *last_block = current_block;
299299
300300 /* shift in advance in case of it followed by too many gaps */
301− if (unlikely(bio->bi_vcnt >= bio->bi_max_vecs)) {
301+ if (bio->bi_iter.bi_size >= bio->bi_max_vecs * PAGE_SIZE) {
302302 /* err should reassign to 0 after submitting */
303303 err = 0;
304304 goto submit_bio_out;
drivers/staging/iio/adc/ad7192.c+4−4
@@ -109,10 +109,10 @@ · 108 unmodified lines
109109 #define AD7192_CH_AIN3 BIT(6) /* AIN3 - AINCOM */
110110 #define AD7192_CH_AIN4 BIT(7) /* AIN4 - AINCOM */
111111
112−#define AD7193_CH_AIN1P_AIN2M 0x000 /* AIN1(+) - AIN2(-) */
113−#define AD7193_CH_AIN3P_AIN4M 0x001 /* AIN3(+) - AIN4(-) */
114−#define AD7193_CH_AIN5P_AIN6M 0x002 /* AIN5(+) - AIN6(-) */
115−#define AD7193_CH_AIN7P_AIN8M 0x004 /* AIN7(+) - AIN8(-) */
112+#define AD7193_CH_AIN1P_AIN2M 0x001 /* AIN1(+) - AIN2(-) */
113+#define AD7193_CH_AIN3P_AIN4M 0x002 /* AIN3(+) - AIN4(-) */
114+#define AD7193_CH_AIN5P_AIN6M 0x004 /* AIN5(+) - AIN6(-) */
115+#define AD7193_CH_AIN7P_AIN8M 0x008 /* AIN7(+) - AIN8(-) */
116116 #define AD7193_CH_TEMP 0x100 /* Temp senseor */
117117 #define AD7193_CH_AIN2P_AIN2M 0x200 /* AIN2(+) - AIN2(-) */
118118 #define AD7193_CH_AIN1 0x401 /* AIN1 - AINCOM */
drivers/staging/iio/meter/ade7854.c+1−1
@@ -269,7 +269,7 @@ static IIO_DEV_ATTR_VPEAK(0644, · 268 unmodified lines
269269 static IIO_DEV_ATTR_IPEAK(0644,
270270 ade7854_read_32bit,
271271 ade7854_write_32bit,
272− ADE7854_VPEAK);
272+ ADE7854_IPEAK);
273273 static IIO_DEV_ATTR_APHCAL(0644,
274274 ade7854_read_16bit,
275275 ade7854_write_16bit,
drivers/staging/most/core.c+1−1
@@ -1431,7 +1431,7 @@ int most_register_interface(struct most_interface *iface) · 1430 unmodified lines
14311431
14321432 INIT_LIST_HEAD(&iface->p->channel_list);
14331433 iface->p->dev_id = id;
1434− snprintf(iface->p->name, STRING_SIZE, "mdev%d", id);
1434+ strcpy(iface->p->name, iface->description);
14351435 iface->dev.init_name = iface->p->name;
14361436 iface->dev.bus = &mc.bus;
14371437 iface->dev.parent = &mc.dev;
drivers/tty/serial/sc16is7xx.c+3−1
@@ -1520,11 +1520,13 @@ static int __init sc16is7xx_init(void) · 1519 unmodified lines
15201520 #endif
15211521 return ret;
15221522
1523+#ifdef CONFIG_SERIAL_SC16IS7XX_SPI
15231524 err_spi:
1525+#endif
15241526 #ifdef CONFIG_SERIAL_SC16IS7XX_I2C
15251527 i2c_del_driver(&sc16is7xx_i2c_uart_driver);
1526−#endif
15271528 err_i2c:
1529+#endif
15281530 uart_unregister_driver(&sc16is7xx_uart);
15291531 return ret;
15301532 }
drivers/tty/serial/sh-sci.c+4−2
@@ -2512,14 +2512,16 @@ done: · 2511 unmodified lines
25122512 * center of the last stop bit in sampling clocks.
25132513 */
25142514 int last_stop = bits * 2 - 1;
2515− int deviation = min_err * srr * last_stop / 2 / baud;
2515+ int deviation = DIV_ROUND_CLOSEST(min_err * last_stop *
2516+ (int)(srr + 1),
2517+ 2 * (int)baud);
25162518
25172519 if (abs(deviation) >= 2) {
25182520 /* At least two sampling clocks off at the
25192521 * last stop bit; we can increase the error
25202522 * margin by shifting the sampling point.
25212523 */
2522− int shift = min(-8, max(7, deviation / 2));
2524+ int shift = clamp(deviation / 2, -8, 7);
25232525
25242526 hssrr |= (shift << HSCIF_SRHP_SHIFT) &
25252527 HSCIF_SRHP_MASK;
drivers/tty/vt/vt.c+2−1
@@ -1520,7 +1520,8 @@ static void csi_J(struct vc_data *vc, int vpar) · 1519 unmodified lines
15201520 return;
15211521 }
15221522 scr_memsetw(start, vc->vc_video_erase_char, 2 * count);
1523− update_region(vc, (unsigned long) start, count);
1523+ if (con_should_update(vc))
1524+ do_update_region(vc, (unsigned long) start, count);
15241525 vc->vc_need_wrap = 0;
15251526 }
15261527
fs/afs/callback.c+1−2
@@ -203,8 +203,7 @@ void afs_put_cb_interest(struct afs_net *net, struct afs_cb_interest *cbi) · 202 unmodified lines
203203 */
204204 void afs_init_callback_state(struct afs_server *server)
205205 {
206− if (!test_and_clear_bit(AFS_SERVER_FL_NEW, &server->flags))
207− server->cb_s_break++;
206+ server->cb_s_break++;
208207 }
209208
210209 /*
fs/afs/cmservice.c+1−1
@@ -34,7 +34,7 @@ static void SRXAFSCB_TellMeAboutYourself(struct work_struct *); · 33 unmodified lines
3434 static int afs_deliver_yfs_cb_callback(struct afs_call *);
3535
3636 #define CM_NAME(name) \
37− const char afs_SRXCB##name##_name[] __tracepoint_string = \
37+ char afs_SRXCB##name##_name[] __tracepoint_string = \
3838 "CB." #name
3939
4040 /*
fs/afs/inode.c+1−3
@@ -216,9 +216,7 @@ struct inode *afs_iget_pseudo_dir(struct super_block *sb, bool root) · 215 unmodified lines
216216 set_nlink(inode, 2);
217217 inode->i_uid = GLOBAL_ROOT_UID;
218218 inode->i_gid = GLOBAL_ROOT_GID;
219− inode->i_ctime.tv_sec = get_seconds();
220− inode->i_ctime.tv_nsec = 0;
221− inode->i_atime = inode->i_mtime = inode->i_ctime;
219+ inode->i_ctime = inode->i_atime = inode->i_mtime = current_time(inode);
222220 inode->i_blocks = 0;
223221 inode_set_iversion_raw(inode, 0);
224222 inode->i_generation = 0;
fs/afs/internal.h+1−3
@@ -474,7 +474,6 @@ struct afs_server { · 473 unmodified lines
474474 time64_t put_time; /* Time at which last put */
475475 time64_t update_at; /* Time at which to next update the record */
476476 unsigned long flags;
477−#define AFS_SERVER_FL_NEW 0 /* New server, don't inc cb_s_break */
478477 #define AFS_SERVER_FL_NOT_READY 1 /* The record is not ready for use */
479478 #define AFS_SERVER_FL_NOT_FOUND 2 /* VL server says no such server */
480479 #define AFS_SERVER_FL_VL_FAIL 3 /* Failed to access VL server */
@@ -827,7 +826,7 @@ static inline struct afs_cb_interest *afs_get_cb_interest(struct afs_cb_interest · 346 unmodified lines
827826
828827 static inline unsigned int afs_calc_vnode_cb_break(struct afs_vnode *vnode)
829828 {
830− return vnode->cb_break + vnode->cb_s_break + vnode->cb_v_break;
829+ return vnode->cb_break + vnode->cb_v_break;
831830 }
832831
833832 static inline bool afs_cb_is_broken(unsigned int cb_break,
@@ -835,7 +834,6 @@ static inline bool afs_cb_is_broken(unsigned int cb_break, · 1 unmodified line
835834 const struct afs_cb_interest *cbi)
836835 {
837836 return !cbi || cb_break != (vnode->cb_break +
838− cbi->server->cb_s_break +
839837 vnode->volume->cb_v_break);
840838 }
841839
fs/afs/rxrpc.c+5−1
@@ -572,13 +572,17 @@ static void afs_deliver_to_call(struct afs_call *call) · 571 unmodified lines
572572 case -ENODATA:
573573 case -EBADMSG:
574574 case -EMSGSIZE:
575− default:
576575 abort_code = RXGEN_CC_UNMARSHAL;
577576 if (state != AFS_CALL_CL_AWAIT_REPLY)
578577 abort_code = RXGEN_SS_UNMARSHAL;
579578 rxrpc_kernel_abort_call(call->net->socket, call->rxcall,
580579 abort_code, ret, "KUM");
581580 goto local_abort;
581+ default:
582+ abort_code = RX_USER_ABORT;
583+ rxrpc_kernel_abort_call(call->net->socket, call->rxcall,
584+ abort_code, ret, "KER");
585+ goto local_abort;
582586 }
583587 }
584588
fs/afs/server.c+0−1
@@ -226,7 +226,6 @@ static struct afs_server *afs_alloc_server(struct afs_net *net, · 225 unmodified lines
226226 RCU_INIT_POINTER(server->addresses, alist);
227227 server->addr_version = alist->version;
228228 server->uuid = *uuid;
229− server->flags = (1UL << AFS_SERVER_FL_NEW);
230229 server->update_at = ktime_get_real_seconds() + afs_server_update_delay;
231230 rwlock_init(&server->fs_lock);
232231 INIT_HLIST_HEAD(&server->cb_volumes);
fs/afs/write.c+1−0
@@ -264,6 +264,7 @@ static void afs_kill_pages(struct address_space *mapping, · 263 unmodified lines
264264 first = page->index + 1;
265265 lock_page(page);
266266 generic_error_remove_page(mapping, page);
267+ unlock_page(page);
267268 }
268269
269270 __pagevec_release(&pv);
fs/cifs/cifsglob.h+2−0
@@ -1333,6 +1333,7 @@ cifsFileInfo_get_locked(struct cifsFileInfo *cifs_file) · 1332 unmodified lines
13331333 }
13341334
13351335 struct cifsFileInfo *cifsFileInfo_get(struct cifsFileInfo *cifs_file);
1336+void _cifsFileInfo_put(struct cifsFileInfo *cifs_file, bool wait_oplock_hdlr);
13361337 void cifsFileInfo_put(struct cifsFileInfo *cifs_file);
13371338
13381339 #define CIFS_CACHE_READ_FLG 1
@@ -1855,6 +1856,7 @@ GLOBAL_EXTERN spinlock_t gidsidlock; · 516 unmodified lines
18551856 #endif /* CONFIG_CIFS_ACL */
18561857
18571858 void cifs_oplock_break(struct work_struct *work);
1859+void cifs_queue_oplock_break(struct cifsFileInfo *cfile);
18581860
18591861 extern const struct slow_work_ops cifs_oplock_break_ops;
18601862 extern struct workqueue_struct *cifsiod_wq;
fs/cifs/file.c+25−5
@@ -360,12 +360,30 @@ cifsFileInfo_get(struct cifsFileInfo *cifs_file) · 359 unmodified lines
360360 return cifs_file;
361361 }
362362
363−/*
364− * Release a reference on the file private data. This may involve closing
365− * the filehandle out on the server. Must be called without holding
366− * tcon->open_file_lock and cifs_file->file_info_lock.
363+/**
364+ * cifsFileInfo_put - release a reference of file priv data
365+ *
366+ * Always potentially wait for oplock handler. See _cifsFileInfo_put().
367367 */
368368 void cifsFileInfo_put(struct cifsFileInfo *cifs_file)
369+{
370+ _cifsFileInfo_put(cifs_file, true);
371+}
372+
373+/**
374+ * _cifsFileInfo_put - release a reference of file priv data
375+ *
376+ * This may involve closing the filehandle @cifs_file out on the
377+ * server. Must be called without holding tcon->open_file_lock and
378+ * cifs_file->file_info_lock.
379+ *
380+ * If @wait_for_oplock_handler is true and we are releasing the last
381+ * reference, wait for any running oplock break handler of the file
382+ * and cancel any pending one. If calling this function from the
383+ * oplock break handler, you need to pass false.
384+ *
385+ */
386+void _cifsFileInfo_put(struct cifsFileInfo *cifs_file, bool wait_oplock_handler)
369387 {
370388 struct inode *inode = d_inode(cifs_file->dentry);
371389 struct cifs_tcon *tcon = tlink_tcon(cifs_file->tlink);
@@ -414,7 +432,8 @@ void cifsFileInfo_put(struct cifsFileInfo *cifs_file) · 42 unmodified lines
414432
415433 spin_unlock(&tcon->open_file_lock);
416434
417− oplock_break_cancelled = cancel_work_sync(&cifs_file->oplock_break);
435+ oplock_break_cancelled = wait_oplock_handler ?
436+ cancel_work_sync(&cifs_file->oplock_break) : false;
418437
419438 if (!tcon->need_reconnect && !cifs_file->invalidHandle) {
420439 struct TCP_Server_Info *server = tcon->ses->server;
@@ -4603,6 +4622,7 @@ void cifs_oplock_break(struct work_struct *work) · 4182 unmodified lines
46034622 cinode);
46044623 cifs_dbg(FYI, "Oplock release rc = %d\n", rc);
46054624 }
4625+ _cifsFileInfo_put(cfile, false /* do not wait for ourself */);
46064626 cifs_done_oplock_break(cinode);
46074627 }
46084628
fs/cifs/misc.c+23−2
@@ -501,8 +501,7 @@ is_valid_oplock_break(char *buffer, struct TCP_Server_Info *srv) · 500 unmodified lines
501501 CIFS_INODE_DOWNGRADE_OPLOCK_TO_L2,
502502 &pCifsInode->flags);
503503
504− queue_work(cifsoplockd_wq,
505− &netfile->oplock_break);
504+ cifs_queue_oplock_break(netfile);
506505 netfile->oplock_break_cancelled = false;
507506
508507 spin_unlock(&tcon->open_file_lock);
@@ -607,6 +606,28 @@ void cifs_put_writer(struct cifsInodeInfo *cinode) · 98 unmodified lines
607606 spin_unlock(&cinode->writers_lock);
608607 }
609608
609+/**
610+ * cifs_queue_oplock_break - queue the oplock break handler for cfile
611+ *
612+ * This function is called from the demultiplex thread when it
613+ * receives an oplock break for @cfile.
614+ *
615+ * Assumes the tcon->open_file_lock is held.
616+ * Assumes cfile->file_info_lock is NOT held.
617+ */
618+void cifs_queue_oplock_break(struct cifsFileInfo *cfile)
619+{
620+ /*
621+ * Bump the handle refcount now while we hold the
622+ * open_file_lock to enforce the validity of it for the oplock
623+ * break handler. The matching put is done at the end of the
624+ * handler.
625+ */
626+ cifsFileInfo_get(cfile);
627+
628+ queue_work(cifsoplockd_wq, &cfile->oplock_break);
629+}
630+
610631 void cifs_done_oplock_break(struct cifsInodeInfo *cinode)
611632 {
612633 clear_bit(CIFS_INODE_PENDING_OPLOCK_BREAK, &cinode->flags);
fs/cifs/smb2misc.c+3−3
@@ -555,7 +555,7 @@ smb2_tcon_has_lease(struct cifs_tcon *tcon, struct smb2_lease_break *rsp, · 554 unmodified lines
555555 clear_bit(CIFS_INODE_DOWNGRADE_OPLOCK_TO_L2,
556556 &cinode->flags);
557557
558− queue_work(cifsoplockd_wq, &cfile->oplock_break);
558+ cifs_queue_oplock_break(cfile);
559559 kfree(lw);
560560 return true;
561561 }
@@ -712,8 +712,8 @@ smb2_is_valid_oplock_break(char *buffer, struct TCP_Server_Info *server) · 150 unmodified lines
712712 CIFS_INODE_DOWNGRADE_OPLOCK_TO_L2,
713713 &cinode->flags);
714714 spin_unlock(&cfile->file_info_lock);
715− queue_work(cifsoplockd_wq,
716− &cfile->oplock_break);
715+
716+ cifs_queue_oplock_break(cfile);
717717
718718 spin_unlock(&tcon->open_file_lock);
719719 spin_unlock(&cifs_tcp_ses_lock);
fs/cifs/smb2ops.c+2−0
@@ -2389,6 +2389,8 @@ smb2_query_symlink(const unsigned int xid, struct cifs_tcon *tcon, · 2388 unmodified lines
23892389
23902390 rc = SMB2_open(xid, &oparms, utf16_path, &oplock, NULL, &err_iov,
23912391 &resp_buftype);
2392+ if (!rc)
2393+ SMB2_close(xid, tcon, fid.persistent_fid, fid.volatile_fid);
23922394 if (!rc || !err_iov.iov_base) {
23932395 rc = -ENOENT;
23942396 goto free_path;
fs/cifs/smb2pdu.c+7−4
@@ -832,8 +832,11 @@ SMB2_negotiate(const unsigned int xid, struct cifs_ses *ses) · 831 unmodified lines
832832 } else if (rsp->DialectRevision == cpu_to_le16(SMB21_PROT_ID)) {
833833 /* ops set to 3.0 by default for default so update */
834834 ses->server->ops = &smb21_operations;
835− } else if (rsp->DialectRevision == cpu_to_le16(SMB311_PROT_ID))
835+ ses->server->vals = &smb21_values;
836+ } else if (rsp->DialectRevision == cpu_to_le16(SMB311_PROT_ID)) {
836837 ses->server->ops = &smb311_operations;
838+ ses->server->vals = &smb311_values;
839+ }
837840 } else if (le16_to_cpu(rsp->DialectRevision) !=
838841 ses->server->vals->protocol_id) {
839842 /* if requested single dialect ensure returned dialect matched */
@@ -3448,8 +3451,6 @@ SMB2_read(const unsigned int xid, struct cifs_io_parms *io_parms, · 2608 unmodified lines
34483451 rqst.rq_nvec = 1;
34493452
34503453 rc = cifs_send_recv(xid, ses, &rqst, &resp_buftype, flags, &rsp_iov);
3451− cifs_small_buf_release(req);
3452−
34533454 rsp = (struct smb2_read_rsp *)rsp_iov.iov_base;
34543455
34553456 if (rc) {
@@ -3471,6 +3472,8 @@ SMB2_read(const unsigned int xid, struct cifs_io_parms *io_parms, · 15 unmodified lines
34713472 io_parms->tcon->tid, ses->Suid,
34723473 io_parms->offset, io_parms->length);
34733474
3475+ cifs_small_buf_release(req);
3476+
34743477 *nbytes = le32_to_cpu(rsp->DataLength);
34753478 if ((*nbytes > CIFS_MAX_MSGSIZE) ||
34763479 (*nbytes > io_parms->length)) {
@@ -3769,7 +3772,6 @@ SMB2_write(const unsigned int xid, struct cifs_io_parms *io_parms, · 292 unmodified lines
37693772
37703773 rc = cifs_send_recv(xid, io_parms->tcon->ses, &rqst,
37713774 &resp_buftype, flags, &rsp_iov);
3772− cifs_small_buf_release(req);
37733775 rsp = (struct smb2_write_rsp *)rsp_iov.iov_base;
37743776
37753777 if (rc) {
@@ -3787,6 +3789,7 @@ SMB2_write(const unsigned int xid, struct cifs_io_parms *io_parms, · 11 unmodified lines
37873789 io_parms->offset, *nbytes);
37883790 }
37893791
3792+ cifs_small_buf_release(req);
37903793 free_rsp_buf(resp_buftype, rsp);
37913794 return rc;
37923795 }
fs/io_uring.c+30−11
@@ -338,7 +338,7 @@ static struct io_uring_cqe *io_get_cqring(struct io_ring_ctx *ctx) · 337 unmodified lines
338338 tail = ctx->cached_cq_tail;
339339 /* See comment at the top of the file */
340340 smp_rmb();
341− if (tail + 1 == READ_ONCE(ring->r.head))
341+ if (tail - READ_ONCE(ring->r.head) == ring->ring_entries)
342342 return NULL;
343343
344344 ctx->cached_cq_tail++;
@@ -682,11 +682,9 @@ static void io_iopoll_req_issued(struct io_kiocb *req) · 337 unmodified lines
682682 list_add_tail(&req->list, &ctx->poll_list);
683683 }
684684
685−static void io_file_put(struct io_submit_state *state, struct file *file)
685+static void io_file_put(struct io_submit_state *state)
686686 {
687− if (!state) {
688− fput(file);
689− } else if (state->file) {
687+ if (state->file) {
690688 int diff = state->has_refs - state->used_refs;
691689
692690 if (diff)
@@ -711,7 +709,7 @@ static struct file *io_file_get(struct io_submit_state *state, int fd) · 18 unmodified lines
711709 state->ios_left--;
712710 return state->file;
713711 }
714− io_file_put(state, NULL);
712+ io_file_put(state);
715713 }
716714 state->file = fget_many(fd, state->ios_left);
717715 if (!state->file)
@@ -1671,7 +1669,7 @@ out: · 953 unmodified lines
16711669 static void io_submit_state_end(struct io_submit_state *state)
16721670 {
16731671 blk_finish_plug(&state->plug);
1674− io_file_put(state, NULL);
1672+ io_file_put(state);
16751673 if (state->free_reqs)
16761674 kmem_cache_free_bulk(req_cachep, state->free_reqs,
16771675 &state->reqs[state->cur_req]);
@@ -1920,6 +1918,10 @@ static int io_sq_thread(void *data) · 242 unmodified lines
19201918 unuse_mm(cur_mm);
19211919 mmput(cur_mm);
19221920 }
1921+
1922+ if (kthread_should_park())
1923+ kthread_parkme();
1924+
19231925 return 0;
19241926 }
19251927
@@ -2054,6 +2056,7 @@ static void io_sq_thread_stop(struct io_ring_ctx *ctx) · 128 unmodified lines
20542056 if (ctx->sqo_thread) {
20552057 ctx->sqo_stop = 1;
20562058 mb();
2059+ kthread_park(ctx->sqo_thread);
20572060 kthread_stop(ctx->sqo_thread);
20582061 ctx->sqo_thread = NULL;
20592062 }
@@ -2236,10 +2239,6 @@ static int io_sq_offload_start(struct io_ring_ctx *ctx, · 176 unmodified lines
22362239 mmgrab(current->mm);
22372240 ctx->sqo_mm = current->mm;
22382241
2239− ctx->sq_thread_idle = msecs_to_jiffies(p->sq_thread_idle);
2240− if (!ctx->sq_thread_idle)
2241− ctx->sq_thread_idle = HZ;
2242−
22432242 ret = -EINVAL;
22442243 if (!cpu_possible(p->sq_thread_cpu))
22452244 goto err;
@@ -2249,10 +2248,18 @@ static int io_sq_offload_start(struct io_ring_ctx *ctx, · 3 unmodified lines
22492248 if (!capable(CAP_SYS_ADMIN))
22502249 goto err;
22512250
2251+ ctx->sq_thread_idle = msecs_to_jiffies(p->sq_thread_idle);
2252+ if (!ctx->sq_thread_idle)
2253+ ctx->sq_thread_idle = HZ;
2254+
22522255 if (p->flags & IORING_SETUP_SQ_AFF) {
22532256 int cpu;
22542257
22552258 cpu = array_index_nospec(p->sq_thread_cpu, NR_CPUS);
2259+ ret = -EINVAL;
2260+ if (!cpu_possible(p->sq_thread_cpu))
2261+ goto err;
2262+
22562263 ctx->sqo_thread = kthread_create_on_cpu(io_sq_thread,
22572264 ctx, cpu,
22582265 "io_uring-sq");
@@ -2922,11 +2929,23 @@ SYSCALL_DEFINE2(io_uring_setup, u32, entries, · 663 unmodified lines
29222929
29232930 static int __io_uring_register(struct io_ring_ctx *ctx, unsigned opcode,
29242931 void __user *arg, unsigned nr_args)
2932+ __releases(ctx->uring_lock)
2933+ __acquires(ctx->uring_lock)
29252934 {
29262935 int ret;
29272936
29282937 percpu_ref_kill(&ctx->refs);
2938+
2939+ /*
2940+ * Drop uring mutex before waiting for references to exit. If another
2941+ * thread is currently inside io_uring_enter() it might need to grab
2942+ * the uring_lock to make progress. If we hold it here across the drain
2943+ * wait, then we can deadlock. It's safe to drop the mutex here, since
2944+ * no new references will come in after we've killed the percpu ref.
2945+ */
2946+ mutex_unlock(&ctx->uring_lock);
29292947 wait_for_completion(&ctx->ctx_done);
2948+ mutex_lock(&ctx->uring_lock);
29302949
29312950 switch (opcode) {
29322951 case IORING_REGISTER_BUFFERS:
fs/nfsd/nfs3proc.c+15−2
@@ -442,7 +442,9 @@ nfsd3_proc_readdir(struct svc_rqst *rqstp) · 441 unmodified lines
442442 struct nfsd3_readdirargs *argp = rqstp->rq_argp;
443443 struct nfsd3_readdirres *resp = rqstp->rq_resp;
444444 __be32 nfserr;
445− int count;
445+ int count = 0;
446+ struct page **p;
447+ caddr_t page_addr = NULL;
446448
447449 dprintk("nfsd: READDIR(3) %s %d bytes at %d\n",
448450 SVCFH_fmt(&argp->fh),
@@ -462,7 +464,18 @@ nfsd3_proc_readdir(struct svc_rqst *rqstp) · 13 unmodified lines
462464 nfserr = nfsd_readdir(rqstp, &resp->fh, (loff_t*) &argp->cookie,
463465 &resp->common, nfs3svc_encode_entry);
464466 memcpy(resp->verf, argp->verf, 8);
465− resp->count = resp->buffer - argp->buffer;
467+ count = 0;
468+ for (p = rqstp->rq_respages + 1; p < rqstp->rq_next_page; p++) {
469+ page_addr = page_address(*p);
470+
471+ if (((caddr_t)resp->buffer >= page_addr) &&
472+ ((caddr_t)resp->buffer < page_addr + PAGE_SIZE)) {
473+ count += (caddr_t)resp->buffer - page_addr;
474+ break;
475+ }
476+ count += PAGE_SIZE;
477+ }
478+ resp->count = count >> 2;
466479 if (resp->offset) {
467480 loff_t offset = argp->cookie;
468481
fs/nfsd/nfs3xdr.c+9−2
@@ -573,6 +573,7 @@ int · 572 unmodified lines
573573 nfs3svc_decode_readdirargs(struct svc_rqst *rqstp, __be32 *p)
574574 {
575575 struct nfsd3_readdirargs *args = rqstp->rq_argp;
576+ int len;
576577 u32 max_blocksize = svc_max_payload(rqstp);
577578
578579 p = decode_fh(p, &args->fh);
@@ -582,8 +583,14 @@ nfs3svc_decode_readdirargs(struct svc_rqst *rqstp, __be32 *p) · 3 unmodified lines
582583 args->verf = p; p += 2;
583584 args->dircount = ~0;
584585 args->count = ntohl(*p++);
585− args->count = min_t(u32, args->count, max_blocksize);
586− args->buffer = page_address(*(rqstp->rq_next_page++));
586+ len = args->count = min_t(u32, args->count, max_blocksize);
587+
588+ while (len > 0) {
589+ struct page *p = *(rqstp->rq_next_page++);
590+ if (!args->buffer)
591+ args->buffer = page_address(p);
592+ len -= PAGE_SIZE;
593+ }
587594
588595 return xdr_argsize_check(rqstp, p);
589596 }
fs/nfsd/nfs4callback.c+7−1
@@ -1010,8 +1010,9 @@ static void nfsd4_cb_prepare(struct rpc_task *task, void *calldata) · 1009 unmodified lines
10101010 cb->cb_seq_status = 1;
10111011 cb->cb_status = 0;
10121012 if (minorversion) {
1013− if (!nfsd41_cb_get_slot(clp, task))
1013+ if (!cb->cb_holds_slot && !nfsd41_cb_get_slot(clp, task))
10141014 return;
1015+ cb->cb_holds_slot = true;
10151016 }
10161017 rpc_call_start(task);
10171018 }
@@ -1038,6 +1039,9 @@ static bool nfsd4_cb_sequence_done(struct rpc_task *task, struct nfsd4_callback · 20 unmodified lines
10381039 return true;
10391040 }
10401041
1042+ if (!cb->cb_holds_slot)
1043+ goto need_restart;
1044+
10411045 switch (cb->cb_seq_status) {
10421046 case 0:
10431047 /*
@@ -1076,6 +1080,7 @@ static bool nfsd4_cb_sequence_done(struct rpc_task *task, struct nfsd4_callback · 32 unmodified lines
10761080 cb->cb_seq_status);
10771081 }
10781082
1083+ cb->cb_holds_slot = false;
10791084 clear_bit(0, &clp->cl_cb_slot_busy);
10801085 rpc_wake_up_next(&clp->cl_cb_waitq);
10811086 dprintk("%s: freed slot, new seqid=%d\n", __func__,
@@ -1283,6 +1288,7 @@ void nfsd4_init_cb(struct nfsd4_callback *cb, struct nfs4_client *clp, · 201 unmodified lines
12831288 cb->cb_seq_status = 1;
12841289 cb->cb_status = 0;
12851290 cb->cb_need_restart = false;
1291+ cb->cb_holds_slot = false;
12861292 }
12871293
12881294 void nfsd4_run_cb(struct nfsd4_callback *cb)
fs/nfsd/nfs4state.c+10−2
@@ -265,6 +265,7 @@ find_or_allocate_block(struct nfs4_lockowner *lo, struct knfsd_fh *fh, · 264 unmodified lines
265265 static void
266266 free_blocked_lock(struct nfsd4_blocked_lock *nbl)
267267 {
268+ locks_delete_block(&nbl->nbl_lock);
268269 locks_release_private(&nbl->nbl_lock);
269270 kfree(nbl);
270271 }
@@ -293,11 +294,18 @@ remove_blocked_locks(struct nfs4_lockowner *lo) · 22 unmodified lines
293294 nbl = list_first_entry(&reaplist, struct nfsd4_blocked_lock,
294295 nbl_lru);
295296 list_del_init(&nbl->nbl_lru);
296− locks_delete_block(&nbl->nbl_lock);
297297 free_blocked_lock(nbl);
298298 }
299299 }
300300
301+static void
302+nfsd4_cb_notify_lock_prepare(struct nfsd4_callback *cb)
303+{
304+ struct nfsd4_blocked_lock *nbl = container_of(cb,
305+ struct nfsd4_blocked_lock, nbl_cb);
306+ locks_delete_block(&nbl->nbl_lock);
307+}
308+
301309 static int
302310 nfsd4_cb_notify_lock_done(struct nfsd4_callback *cb, struct rpc_task *task)
303311 {
@@ -325,6 +333,7 @@ nfsd4_cb_notify_lock_release(struct nfsd4_callback *cb) · 21 unmodified lines
325333 }
326334
327335 static const struct nfsd4_callback_ops nfsd4_cb_notify_lock_ops = {
336+ .prepare = nfsd4_cb_notify_lock_prepare,
328337 .done = nfsd4_cb_notify_lock_done,
329338 .release = nfsd4_cb_notify_lock_release,
330339 };
@@ -4863,7 +4872,6 @@ nfs4_laundromat(struct nfsd_net *nn) · 4532 unmodified lines
48634872 nbl = list_first_entry(&reaplist,
48644873 struct nfsd4_blocked_lock, nbl_lru);
48654874 list_del_init(&nbl->nbl_lru);
4866− locks_delete_block(&nbl->nbl_lock);
48674875 free_blocked_lock(nbl);
48684876 }
48694877 out:
fs/nfsd/state.h+1−0
@@ -70,6 +70,7 @@ struct nfsd4_callback { · 69 unmodified lines
7070 int cb_seq_status;
7171 int cb_status;
7272 bool cb_need_restart;
73+ bool cb_holds_slot;
7374 };
7475
7576 struct nfsd4_callback_ops {
fs/proc/task_mmu.c+18−0
@@ -1143,6 +1143,24 @@ static ssize_t clear_refs_write(struct file *file, const char __user *buf, · 1142 unmodified lines
11431143 count = -EINTR;
11441144 goto out_mm;
11451145 }
1146+ /*
1147+ * Avoid to modify vma->vm_flags
1148+ * without locked ops while the
1149+ * coredump reads the vm_flags.
1150+ */
1151+ if (!mmget_still_valid(mm)) {
1152+ /*
1153+ * Silently return "count"
1154+ * like if get_task_mm()
1155+ * failed. FIXME: should this
1156+ * function have returned
1157+ * -ESRCH if get_task_mm()
1158+ * failed like if
1159+ * get_proc_task() fails?
1160+ */
1161+ up_write(&mm->mmap_sem);
1162+ goto out_mm;
1163+ }
11461164 for (vma = mm->mmap; vma; vma = vma->vm_next) {
11471165 vma->vm_flags &= ~VM_SOFTDIRTY;
11481166 vma_set_page_prot(vma);
fs/userfaultfd.c+9−0
@@ -629,6 +629,8 @@ static void userfaultfd_event_wait_completion(struct userfaultfd_ctx *ctx, · 628 unmodified lines
629629
630630 /* the various vma->vm_userfaultfd_ctx still points to it */
631631 down_write(&mm->mmap_sem);
632+ /* no task can run (and in turn coredump) yet */
633+ VM_WARN_ON(!mmget_still_valid(mm));
632634 for (vma = mm->mmap; vma; vma = vma->vm_next)
633635 if (vma->vm_userfaultfd_ctx.ctx == release_new_ctx) {
634636 vma->vm_userfaultfd_ctx = NULL_VM_UFFD_CTX;
@@ -883,6 +885,8 @@ static int userfaultfd_release(struct inode *inode, struct file *file) · 248 unmodified lines
883885 * taking the mmap_sem for writing.
884886 */
885887 down_write(&mm->mmap_sem);
888+ if (!mmget_still_valid(mm))
889+ goto skip_mm;
886890 prev = NULL;
887891 for (vma = mm->mmap; vma; vma = vma->vm_next) {
888892 cond_resched();
@@ -905,6 +909,7 @@ static int userfaultfd_release(struct inode *inode, struct file *file) · 16 unmodified lines
905909 vma->vm_flags = new_flags;
906910 vma->vm_userfaultfd_ctx = NULL_VM_UFFD_CTX;
907911 }
912+skip_mm:
908913 up_write(&mm->mmap_sem);
909914 mmput(mm);
910915 wakeup:
@@ -1333,6 +1338,8 @@ static int userfaultfd_register(struct userfaultfd_ctx *ctx, · 422 unmodified lines
13331338 goto out;
13341339
13351340 down_write(&mm->mmap_sem);
1341+ if (!mmget_still_valid(mm))
1342+ goto out_unlock;
13361343 vma = find_vma_prev(mm, start, &prev);
13371344 if (!vma)
13381345 goto out_unlock;
@@ -1520,6 +1527,8 @@ static int userfaultfd_unregister(struct userfaultfd_ctx *ctx, · 181 unmodified lines
15201527 goto out;
15211528
15221529 down_write(&mm->mmap_sem);
1530+ if (!mmget_still_valid(mm))
1531+ goto out_unlock;
15231532 vma = find_vma_prev(mm, start, &prev);
15241533 if (!vma)
15251534 goto out_unlock;
include/linux/blkdev.h+0−1
@@ -548,7 +548,6 @@ struct request_queue { · 547 unmodified lines
548548 struct rcu_head rcu_head;
549549 wait_queue_head_t mq_freeze_wq;
550550 struct percpu_ref q_usage_counter;
551− struct list_head all_q_node;
552551
553552 struct blk_mq_tag_set *tag_set;
554553 struct list_head tag_set_list;
include/linux/bvec.h+3−2
@@ -160,8 +160,9 @@ static inline void bvec_advance(const struct bio_vec *bvec, · 159 unmodified lines
160160 bv->bv_page = nth_page(bv->bv_page, 1);
161161 bv->bv_offset = 0;
162162 } else {
163− bv->bv_page = bvec->bv_page;
164− bv->bv_offset = bvec->bv_offset;
163+ bv->bv_page = bvec_nth_page(bvec->bv_page, bvec->bv_offset /
164+ PAGE_SIZE);
165+ bv->bv_offset = bvec->bv_offset & ~PAGE_MASK;
165166 }
166167 bv->bv_len = min_t(unsigned int, PAGE_SIZE - bv->bv_offset,
167168 bvec->bv_len - iter_all->done);
include/linux/efi.h+6−1
@@ -1611,7 +1611,12 @@ efi_status_t efi_setup_gop(efi_system_table_t *sys_table_arg, · 1610 unmodified lines
16111611 struct screen_info *si, efi_guid_t *proto,
16121612 unsigned long size);
16131613
1614−bool efi_runtime_disabled(void);
1614+#ifdef CONFIG_EFI
1615+extern bool efi_runtime_disabled(void);
1616+#else
1617+static inline bool efi_runtime_disabled(void) { return true; }
1618+#endif
1619+
16151620 extern void efi_call_virt_check_flags(unsigned long flags, const char *call);
16161621 extern unsigned long efi_call_virt_save_flags(void);
16171622
include/linux/elevator.h+1−0
@@ -31,6 +31,7 @@ struct elevator_mq_ops { · 30 unmodified lines
3131 void (*exit_sched)(struct elevator_queue *);
3232 int (*init_hctx)(struct blk_mq_hw_ctx *, unsigned int);
3333 void (*exit_hctx)(struct blk_mq_hw_ctx *, unsigned int);
34+ void (*depth_updated)(struct blk_mq_hw_ctx *);
3435
3536 bool (*allow_merge)(struct request_queue *, struct request *, struct bio *);
3637 bool (*bio_merge)(struct blk_mq_hw_ctx *, struct bio *);
include/linux/etherdevice.h+12−0
@@ -448,6 +448,18 @@ static inline void eth_addr_dec(u8 *addr) · 447 unmodified lines
448448 u64_to_ether_addr(u, addr);
449449 }
450450
451+/**
452+ * eth_addr_inc() - Increment the given MAC address.
453+ * @addr: Pointer to a six-byte array containing Ethernet address to increment.
454+ */
455+static inline void eth_addr_inc(u8 *addr)
456+{
457+ u64 u = ether_addr_to_u64(addr);
458+
459+ u++;
460+ u64_to_ether_addr(u, addr);
461+}
462+
451463 /**
452464 * is_etherdev_addr - Tell if given Ethernet address belongs to the device.
453465 * @dev: Pointer to a device structure
include/linux/kprobes.h+1−0
@@ -173,6 +173,7 @@ struct kretprobe_instance { · 172 unmodified lines
173173 struct kretprobe *rp;
174174 kprobe_opcode_t *ret_addr;
175175 struct task_struct *task;
176+ void *fp;
176177 char data[0];
177178 };
178179
include/linux/sched/mm.h+21−0
@@ -49,6 +49,27 @@ static inline void mmdrop(struct mm_struct *mm) · 48 unmodified lines
4949 __mmdrop(mm);
5050 }
5151
52+/*
53+ * This has to be called after a get_task_mm()/mmget_not_zero()
54+ * followed by taking the mmap_sem for writing before modifying the
55+ * vmas or anything the coredump pretends not to change from under it.
56+ *
57+ * NOTE: find_extend_vma() called from GUP context is the only place
58+ * that can modify the "mm" (notably the vm_start/end) under mmap_sem
59+ * for reading and outside the context of the process, so it is also
60+ * the only case that holds the mmap_sem for reading that must call
61+ * this function. Generally if the mmap_sem is hold for reading
62+ * there's no need of this check after get_task_mm()/mmget_not_zero().
63+ *
64+ * This function can be obsoleted and the check can be removed, after
65+ * the coredump code will hold the mmap_sem for writing before
66+ * invoking the ->core_dump methods.
67+ */
68+static inline bool mmget_still_valid(struct mm_struct *mm)
69+{
70+ return likely(!mm->core_state);
71+}
72+
5273 /**
5374 * mmget() - Pin the address space associated with a &struct mm_struct.
5475 * @mm: The address space to pin.
include/linux/shmem_fs.h+1−0
@@ -21,6 +21,7 @@ struct shmem_inode_info { · 20 unmodified lines
2121 struct list_head swaplist; /* chain of maybes on swap */
2222 struct shared_policy policy; /* NUMA memory alloc policy */
2323 struct simple_xattrs xattrs; /* list of xattrs */
24+ atomic_t stop_eviction; /* hold when working on inode */
2425 struct inode vfs_inode;
2526 };
2627
include/net/netfilter/nf_conntrack.h+2−0
@@ -316,6 +316,8 @@ struct nf_conn *nf_ct_tmpl_alloc(struct net *net, · 315 unmodified lines
316316 gfp_t flags);
317317 void nf_ct_tmpl_free(struct nf_conn *tmpl);
318318
319+u32 nf_ct_get_id(const struct nf_conn *ct);
320+
319321 static inline void
320322 nf_ct_set(struct sk_buff *skb, struct nf_conn *ct, enum ip_conntrack_info info)
321323 {
include/net/netfilter/nf_conntrack_l4proto.h+6−0
@@ -75,6 +75,12 @@ bool nf_conntrack_invert_icmp_tuple(struct nf_conntrack_tuple *tuple, · 74 unmodified lines
7575 bool nf_conntrack_invert_icmpv6_tuple(struct nf_conntrack_tuple *tuple,
7676 const struct nf_conntrack_tuple *orig);
7777
78+int nf_conntrack_inet_error(struct nf_conn *tmpl, struct sk_buff *skb,
79+ unsigned int dataoff,
80+ const struct nf_hook_state *state,
81+ u8 l4proto,
82+ union nf_inet_addr *outer_daddr);
83+
7884 int nf_conntrack_icmpv4_error(struct nf_conn *tmpl,
7985 struct sk_buff *skb,
8086 unsigned int dataoff,
include/uapi/linux/input-event-codes.h+4−2
@@ -439,10 +439,12 @@ · 438 unmodified lines
439439 #define KEY_TITLE 0x171
440440 #define KEY_SUBTITLE 0x172
441441 #define KEY_ANGLE 0x173
442−#define KEY_ZOOM 0x174
442+#define KEY_FULL_SCREEN 0x174 /* AC View Toggle */
443+#define KEY_ZOOM KEY_FULL_SCREEN
443444 #define KEY_MODE 0x175
444445 #define KEY_KEYBOARD 0x176
445−#define KEY_SCREEN 0x177
446+#define KEY_ASPECT_RATIO 0x177 /* HUTRR37: Aspect */
447+#define KEY_SCREEN KEY_ASPECT_RATIO
446448 #define KEY_PC 0x178 /* Media Select Computer */
447449 #define KEY_TV 0x179 /* Media Select TV */
448450 #define KEY_TV2 0x17a /* Media Select Cable */
init/main.c+2−2
@@ -582,6 +582,8 @@ asmlinkage __visible void __init start_kernel(void) · 581 unmodified lines
582582 page_alloc_init();
583583
584584 pr_notice("Kernel command line: %s\n", boot_command_line);
585+ /* parameters may set static keys */
586+ jump_label_init();
585587 parse_early_param();
586588 after_dashes = parse_args("Booting kernel",
587589 static_command_line, __start___param,
@@ -591,8 +593,6 @@ asmlinkage __visible void __init start_kernel(void) · 3 unmodified lines
591593 parse_args("Setting init args", after_dashes, NULL, 0, -1, -1,
592594 NULL, set_init_arg);
593595
594− jump_label_init();
595−
596596 /*
597597 * These use large bootmem allocations and must precede
598598 * kmem_cache_init()
kernel/events/core.c+21−16
@@ -9077,26 +9077,29 @@ static void perf_event_addr_filters_apply(struct perf_event *event) · 9076 unmodified lines
90779077 if (task == TASK_TOMBSTONE)
90789078 return;
90799079
9080− if (!ifh->nr_file_filters)
9081− return;
9082−
9083− mm = get_task_mm(event->ctx->task);
9084− if (!mm)
9085− goto restart;
9080+ if (ifh->nr_file_filters) {
9081+ mm = get_task_mm(event->ctx->task);
9082+ if (!mm)
9083+ goto restart;
90869084
9087− down_read(&mm->mmap_sem);
9085+ down_read(&mm->mmap_sem);
9086+ }
90889087
90899088 raw_spin_lock_irqsave(&ifh->lock, flags);
90909089 list_for_each_entry(filter, &ifh->list, entry) {
9091− event->addr_filter_ranges[count].start = 0;
9092− event->addr_filter_ranges[count].size = 0;
9090+ if (filter->path.dentry) {
9091+ /*
9092+ * Adjust base offset if the filter is associated to a
9093+ * binary that needs to be mapped:
9094+ */
9095+ event->addr_filter_ranges[count].start = 0;
9096+ event->addr_filter_ranges[count].size = 0;
90939097
9094− /*
9095− * Adjust base offset if the filter is associated to a binary
9096− * that needs to be mapped:
9097− */
9098− if (filter->path.dentry)
90999098 perf_addr_filter_apply(filter, mm, &event->addr_filter_ranges[count]);
9099+ } else {
9100+ event->addr_filter_ranges[count].start = filter->offset;
9101+ event->addr_filter_ranges[count].size = filter->size;
9102+ }
91009103
91019104 count++;
91029105 }
@@ -9104,9 +9107,11 @@ static void perf_event_addr_filters_apply(struct perf_event *event) · 1 unmodified line
91049107 event->addr_filters_gen++;
91059108 raw_spin_unlock_irqrestore(&ifh->lock, flags);
91069109
9107− up_read(&mm->mmap_sem);
9110+ if (ifh->nr_file_filters) {
9111+ up_read(&mm->mmap_sem);
91089112
9109− mmput(mm);
9113+ mmput(mm);
9114+ }
91109115
91119116 restart:
91129117 perf_event_stop(event, 1);
kernel/events/ring_buffer.c+15−18
@@ -455,24 +455,21 @@ void perf_aux_output_end(struct perf_output_handle *handle, unsigned long size) · 454 unmodified lines
455455 rb->aux_head += size;
456456 }
457457
458− if (size || handle->aux_flags) {
459− /*
460− * Only send RECORD_AUX if we have something useful to communicate
461− *
462− * Note: the OVERWRITE records by themselves are not considered
463− * useful, as they don't communicate any *new* information,
464− * aside from the short-lived offset, that becomes history at
465− * the next event sched-in and therefore isn't useful.
466− * The userspace that needs to copy out AUX data in overwrite
467− * mode should know to use user_page::aux_head for the actual
468− * offset. So, from now on we don't output AUX records that
469− * have *only* OVERWRITE flag set.
470− */
471−
472− if (handle->aux_flags & ~(u64)PERF_AUX_FLAG_OVERWRITE)
473− perf_event_aux_event(handle->event, aux_head, size,
474− handle->aux_flags);
475− }
458+ /*
459+ * Only send RECORD_AUX if we have something useful to communicate
460+ *
461+ * Note: the OVERWRITE records by themselves are not considered
462+ * useful, as they don't communicate any *new* information,
463+ * aside from the short-lived offset, that becomes history at
464+ * the next event sched-in and therefore isn't useful.
465+ * The userspace that needs to copy out AUX data in overwrite
466+ * mode should know to use user_page::aux_head for the actual
467+ * offset. So, from now on we don't output AUX records that
468+ * have *only* OVERWRITE flag set.
469+ */
470+ if (size || (handle->aux_flags & ~(u64)PERF_AUX_FLAG_OVERWRITE))
471+ perf_event_aux_event(handle->event, aux_head, size,
472+ handle->aux_flags);
476473
477474 rb->user_page->aux_head = rb->aux_head;
478475 if (rb_need_aux_wakeup(rb))
kernel/kprobes.c+2−4
@@ -709,7 +709,6 @@ static void unoptimize_kprobe(struct kprobe *p, bool force) · 708 unmodified lines
709709 static int reuse_unused_kprobe(struct kprobe *ap)
710710 {
711711 struct optimized_kprobe *op;
712− int ret;
713712
714713 /*
715714 * Unused kprobe MUST be on the way of delayed unoptimizing (means
@@ -720,9 +719,8 @@ static int reuse_unused_kprobe(struct kprobe *ap) · 4 unmodified lines
720719 /* Enable the probe again */
721720 ap->flags &= ~KPROBE_FLAG_DISABLED;
722721 /* Optimize it again (remove from op->list) */
723− ret = kprobe_optready(ap);
724− if (ret)
725− return ret;
722+ if (!kprobe_optready(ap))
723+ return -EINVAL;
726724
727725 optimize_kprobe(ap);
728726 return 0;
kernel/locking/lockdep.c+5−4
@@ -4907,8 +4907,9 @@ void lockdep_unregister_key(struct lock_class_key *key) · 4906 unmodified lines
49074907 return;
49084908
49094909 raw_local_irq_save(flags);
4910− arch_spin_lock(&lockdep_lock);
4911− current->lockdep_recursion = 1;
4910+ if (!graph_lock())
4911+ goto out_irq;
4912+
49124913 pf = get_pending_free();
49134914 hlist_for_each_entry_rcu(k, hash_head, hash_entry) {
49144915 if (k == key) {
@@ -4920,8 +4921,8 @@ void lockdep_unregister_key(struct lock_class_key *key) · 5 unmodified lines
49204921 WARN_ON_ONCE(!found);
49214922 __lockdep_free_key_range(pf, key, 1);
49224923 call_rcu_zapped(pf);
4923− current->lockdep_recursion = 0;
4924− arch_spin_unlock(&lockdep_lock);
4924+ graph_unlock();
4925+out_irq:
49254926 raw_local_irq_restore(flags);
49264927
49274928 /* Wait until is_dynamic_key() has finished accessing k->hash_entry. */
kernel/sched/deadline.c+1−2
@@ -252,7 +252,6 @@ static void task_non_contending(struct task_struct *p) · 251 unmodified lines
252252 if (dl_entity_is_special(dl_se))
253253 return;
254254
255− WARN_ON(hrtimer_active(&dl_se->inactive_timer));
256255 WARN_ON(dl_se->dl_non_contending);
257256
258257 zerolag_time = dl_se->deadline -
@@ -269,7 +268,7 @@ static void task_non_contending(struct task_struct *p) · 10 unmodified lines
269268 * If the "0-lag time" already passed, decrease the active
270269 * utilization now, instead of starting a timer
271270 */
272− if (zerolag_time < 0) {
271+ if ((zerolag_time < 0) || hrtimer_active(&dl_se->inactive_timer)) {
273272 if (dl_task(p))
274273 sub_running_bw(dl_se, dl_rq);
275274 if (!dl_task(p) || p->state == TASK_DEAD) {
kernel/sched/fair.c+25−0
@@ -4885,6 +4885,8 @@ static enum hrtimer_restart sched_cfs_slack_timer(struct hrtimer *timer) · 4884 unmodified lines
48854885 return HRTIMER_NORESTART;
48864886 }
48874887
4888+extern const u64 max_cfs_quota_period;
4889+
48884890 static enum hrtimer_restart sched_cfs_period_timer(struct hrtimer *timer)
48894891 {
48904892 struct cfs_bandwidth *cfs_b =
@@ -4892,6 +4894,7 @@ static enum hrtimer_restart sched_cfs_period_timer(struct hrtimer *timer) · 1 unmodified line
48924894 unsigned long flags;
48934895 int overrun;
48944896 int idle = 0;
4897+ int count = 0;
48954898
48964899 raw_spin_lock_irqsave(&cfs_b->lock, flags);
48974900 for (;;) {
@@ -4899,6 +4902,28 @@ static enum hrtimer_restart sched_cfs_period_timer(struct hrtimer *timer) · 1 unmodified line
48994902 if (!overrun)
49004903 break;
49014904
4905+ if (++count > 3) {
4906+ u64 new, old = ktime_to_ns(cfs_b->period);
4907+
4908+ new = (old * 147) / 128; /* ~115% */
4909+ new = min(new, max_cfs_quota_period);
4910+
4911+ cfs_b->period = ns_to_ktime(new);
4912+
4913+ /* since max is 1s, this is limited to 1e9^2, which fits in u64 */
4914+ cfs_b->quota *= new;
4915+ cfs_b->quota = div64_u64(cfs_b->quota, old);
4916+
4917+ pr_warn_ratelimited(
4918+ "cfs_period_timer[cpu%d]: period too short, scaling up (new cfs_period_us %lld, cfs_quota_us = %lld)\n",
4919+ smp_processor_id(),
4920+ div_u64(new, NSEC_PER_USEC),
4921+ div_u64(cfs_b->quota, NSEC_PER_USEC));
4922+
4923+ /* reset count so we don't come right back in here */
4924+ count = 0;
4925+ }
4926+
49024927 idle = do_sched_cfs_period_timer(cfs_b, overrun, flags);
49034928 }
49044929 if (idle)
kernel/signal.c+1−1
@@ -3581,7 +3581,7 @@ SYSCALL_DEFINE4(pidfd_send_signal, int, pidfd, int, sig, · 3580 unmodified lines
35813581 if (flags)
35823582 return -EINVAL;
35833583
3584− f = fdget_raw(pidfd);
3584+ f = fdget(pidfd);
35853585 if (!f.file)
35863586 return -EBADF;
35873587
kernel/time/sched_clock.c+2−2
@@ -272,7 +272,7 @@ static u64 notrace suspended_sched_clock_read(void) · 271 unmodified lines
272272 return cd.read_data[seq & 1].epoch_cyc;
273273 }
274274
275−static int sched_clock_suspend(void)
275+int sched_clock_suspend(void)
276276 {
277277 struct clock_read_data *rd = &cd.read_data[0];
278278
@@ -283,7 +283,7 @@ static int sched_clock_suspend(void) · 4 unmodified lines
283283 return 0;
284284 }
285285
286−static void sched_clock_resume(void)
286+void sched_clock_resume(void)
287287 {
288288 struct clock_read_data *rd = &cd.read_data[0];
289289
kernel/time/tick-common.c+2−0
@@ -487,6 +487,7 @@ void tick_freeze(void) · 486 unmodified lines
487487 trace_suspend_resume(TPS("timekeeping_freeze"),
488488 smp_processor_id(), true);
489489 system_state = SYSTEM_SUSPEND;
490+ sched_clock_suspend();
490491 timekeeping_suspend();
491492 } else {
492493 tick_suspend_local();
@@ -510,6 +511,7 @@ void tick_unfreeze(void) · 17 unmodified lines
510511
511512 if (tick_freeze_depth == num_online_cpus()) {
512513 timekeeping_resume();
514+ sched_clock_resume();
513515 system_state = SYSTEM_RUNNING;
514516 trace_suspend_resume(TPS("timekeeping_freeze"),
515517 smp_processor_id(), false);
kernel/time/timekeeping.h+7−0
@@ -14,6 +14,13 @@ extern u64 timekeeping_max_deferment(void); · 13 unmodified lines
1414 extern void timekeeping_warp_clock(void);
1515 extern int timekeeping_suspend(void);
1616 extern void timekeeping_resume(void);
17+#ifdef CONFIG_GENERIC_SCHED_CLOCK
18+extern int sched_clock_suspend(void);
19+extern void sched_clock_resume(void);
20+#else
21+static inline int sched_clock_suspend(void) { return 0; }
22+static inline void sched_clock_resume(void) { }
23+#endif
1724
1825 extern void do_timer(unsigned long ticks);
1926 extern void update_wall_time(void);
kernel/trace/ftrace.c+5−1
@@ -33,6 +33,7 @@ · 32 unmodified lines
3333 #include <linux/list.h>
3434 #include <linux/hash.h>
3535 #include <linux/rcupdate.h>
36+#include <linux/kprobes.h>
3637
3738 #include <trace/events/sched.h>
3839
@@ -6246,7 +6247,7 @@ void ftrace_reset_array_ops(struct trace_array *tr) · 6207 unmodified lines
62466247 tr->ops->func = ftrace_stub;
62476248 }
62486249
6249−static inline void
6250+static nokprobe_inline void
62506251 __ftrace_ops_list_func(unsigned long ip, unsigned long parent_ip,
62516252 struct ftrace_ops *ignored, struct pt_regs *regs)
62526253 {
@@ -6306,11 +6307,13 @@ static void ftrace_ops_list_func(unsigned long ip, unsigned long parent_ip, · 53 unmodified lines
63066307 {
63076308 __ftrace_ops_list_func(ip, parent_ip, NULL, regs);
63086309 }
6310+NOKPROBE_SYMBOL(ftrace_ops_list_func);
63096311 #else
63106312 static void ftrace_ops_no_ops(unsigned long ip, unsigned long parent_ip)
63116313 {
63126314 __ftrace_ops_list_func(ip, parent_ip, NULL, NULL);
63136315 }
6316+NOKPROBE_SYMBOL(ftrace_ops_no_ops);
63146317 #endif
63156318
63166319 /*
@@ -6337,6 +6340,7 @@ static void ftrace_ops_assist_func(unsigned long ip, unsigned long parent_ip, · 20 unmodified lines
63376340 preempt_enable_notrace();
63386341 trace_clear_recursion(bit);
63396342 }
6343+NOKPROBE_SYMBOL(ftrace_ops_assist_func);
63406344
63416345 /**
63426346 * ftrace_ops_get_func - get the function a trampoline should call
kernel/watchdog_hld.c+2−1
@@ -135,7 +135,8 @@ static void watchdog_overflow_callback(struct perf_event *event, · 134 unmodified lines
135135 if (__this_cpu_read(hard_watchdog_warn) == true)
136136 return;
137137
138− pr_emerg("Watchdog detected hard LOCKUP on cpu %d", this_cpu);
138+ pr_emerg("Watchdog detected hard LOCKUP on cpu %d\n",
139+ this_cpu);
139140 print_modules();
140141 print_irqtrace_events(current);
141142 if (regs)
lib/Kconfig.debug+3−3
@@ -761,9 +761,9 @@ endmenu # "Memory Debugging" · 760 unmodified lines
761761 config ARCH_HAS_KCOV
762762 bool
763763 help
764− KCOV does not have any arch-specific code, but currently it is enabled
765− only for x86_64. KCOV requires testing on other archs, and most likely
766− disabling of instrumentation for some early boot code.
764+ An architecture should select this when it can successfully
765+ build and run with CONFIG_KCOV. This typically requires
766+ disabling instrumentation for some early boot code.
767767
768768 config CC_HAS_SANCOV_TRACE_PC
769769 def_bool $(cc-option,-fsanitize-coverage=trace-pc)
mm/kmemleak.c+2−0
@@ -1401,6 +1401,7 @@ static void scan_block(void *_start, void *_end, · 1400 unmodified lines
14011401 /*
14021402 * Scan a large memory block in MAX_SCAN_SIZE chunks to reduce the latency.
14031403 */
1404+#ifdef CONFIG_SMP
14041405 static void scan_large_block(void *start, void *end)
14051406 {
14061407 void *next;
@@ -1412,6 +1413,7 @@ static void scan_large_block(void *start, void *end) · 5 unmodified lines
14121413 cond_resched();
14131414 }
14141415 }
1416+#endif
14151417
14161418 /*
14171419 * Scan a memory block corresponding to a kmemleak_object. A condition is
mm/mmap.c+6−1
@@ -45,6 +45,7 @@ · 44 unmodified lines
4545 #include <linux/moduleparam.h>
4646 #include <linux/pkeys.h>
4747 #include <linux/oom.h>
48+#include <linux/sched/mm.h>
4849
4950 #include <linux/uaccess.h>
5051 #include <asm/cacheflush.h>
@@ -2525,7 +2526,8 @@ find_extend_vma(struct mm_struct *mm, unsigned long addr) · 2474 unmodified lines
25252526 vma = find_vma_prev(mm, addr, &prev);
25262527 if (vma && (vma->vm_start <= addr))
25272528 return vma;
2528− if (!prev || expand_stack(prev, addr))
2529+ /* don't alter vm_end if the coredump is running */
2530+ if (!prev || !mmget_still_valid(mm) || expand_stack(prev, addr))
25292531 return NULL;
25302532 if (prev->vm_flags & VM_LOCKED)
25312533 populate_vma_page_range(prev, addr, prev->vm_end, NULL);
@@ -2551,6 +2553,9 @@ find_extend_vma(struct mm_struct *mm, unsigned long addr) · 19 unmodified lines
25512553 return vma;
25522554 if (!(vma->vm_flags & VM_GROWSDOWN))
25532555 return NULL;
2556+ /* don't alter vm_start if the coredump is running */
2557+ if (!mmget_still_valid(mm))
2558+ return NULL;
25542559 start = vma->vm_start;
25552560 if (expand_stack(vma, addr))
25562561 return NULL;
mm/page_alloc.c+18−12
@@ -8005,7 +8005,10 @@ void *__init alloc_large_system_hash(const char *tablename, · 8004 unmodified lines
80058005 bool has_unmovable_pages(struct zone *zone, struct page *page, int count,
80068006 int migratetype, int flags)
80078007 {
8008− unsigned long pfn, iter, found;
8008+ unsigned long found;
8009+ unsigned long iter = 0;
8010+ unsigned long pfn = page_to_pfn(page);
8011+ const char *reason = "unmovable page";
80098012
80108013 /*
80118014 * TODO we could make this much more efficient by not checking every
@@ -8015,17 +8018,20 @@ bool has_unmovable_pages(struct zone *zone, struct page *page, int count, · 3 unmodified lines
80158018 * can still lead to having bootmem allocations in zone_movable.
80168019 */
80178020
8018− /*
8019− * CMA allocations (alloc_contig_range) really need to mark isolate
8020− * CMA pageblocks even when they are not movable in fact so consider
8021− * them movable here.
8022− */
8023− if (is_migrate_cma(migratetype) &&
8024− is_migrate_cma(get_pageblock_migratetype(page)))
8025− return false;
8021+ if (is_migrate_cma_page(page)) {
8022+ /*
8023+ * CMA allocations (alloc_contig_range) really need to mark
8024+ * isolate CMA pageblocks even when they are not movable in fact
8025+ * so consider them movable here.
8026+ */
8027+ if (is_migrate_cma(migratetype))
8028+ return false;
8029+
8030+ reason = "CMA page";
8031+ goto unmovable;
8032+ }
80268033
8027− pfn = page_to_pfn(page);
8028− for (found = 0, iter = 0; iter < pageblock_nr_pages; iter++) {
8034+ for (found = 0; iter < pageblock_nr_pages; iter++) {
80298035 unsigned long check = pfn + iter;
80308036
80318037 if (!pfn_valid_within(check))
@@ -8105,7 +8111,7 @@ bool has_unmovable_pages(struct zone *zone, struct page *page, int count, · 73 unmodified lines
81058111 unmovable:
81068112 WARN_ON_ONCE(zone_idx(zone) == ZONE_MOVABLE);
81078113 if (flags & REPORT_FAILURE)
8108− dump_page(pfn_to_page(pfn+iter), "unmovable page");
8114+ dump_page(pfn_to_page(pfn + iter), reason);
81098115 return true;
81108116 }
81118117
mm/percpu.c+4−4
@@ -2567,8 +2567,8 @@ int __init pcpu_embed_first_chunk(size_t reserved_size, size_t dyn_size, · 2566 unmodified lines
25672567 ai->groups[group].base_offset = areas[group] - base;
25682568 }
25692569
2570− pr_info("Embedded %zu pages/cpu @%p s%zu r%zu d%zu u%zu\n",
2571− PFN_DOWN(size_sum), base, ai->static_size, ai->reserved_size,
2570+ pr_info("Embedded %zu pages/cpu s%zu r%zu d%zu u%zu\n",
2571+ PFN_DOWN(size_sum), ai->static_size, ai->reserved_size,
25722572 ai->dyn_size, ai->unit_size);
25732573
25742574 rc = pcpu_setup_first_chunk(ai, base);
@@ -2692,8 +2692,8 @@ int __init pcpu_page_first_chunk(size_t reserved_size, · 117 unmodified lines
26922692 }
26932693
26942694 /* we're ready, commit */
2695− pr_info("%d %s pages/cpu @%p s%zu r%zu d%zu\n",
2696− unit_pages, psize_str, vm.addr, ai->static_size,
2695+ pr_info("%d %s pages/cpu s%zu r%zu d%zu\n",
2696+ unit_pages, psize_str, ai->static_size,
26972697 ai->reserved_size, ai->dyn_size);
26982698
26992699 rc = pcpu_setup_first_chunk(ai, vm.addr);
mm/shmem.c+27−31
@@ -1081,9 +1081,14 @@ static void shmem_evict_inode(struct inode *inode) · 1080 unmodified lines
10811081 }
10821082 spin_unlock(&sbinfo->shrinklist_lock);
10831083 }
1084− if (!list_empty(&info->swaplist)) {
1084+ while (!list_empty(&info->swaplist)) {
1085+ /* Wait while shmem_unuse() is scanning this inode... */
1086+ wait_var_event(&info->stop_eviction,
1087+ !atomic_read(&info->stop_eviction));
10851088 mutex_lock(&shmem_swaplist_mutex);
1086− list_del_init(&info->swaplist);
1089+ /* ...but beware of the race if we peeked too early */
1090+ if (!atomic_read(&info->stop_eviction))
1091+ list_del_init(&info->swaplist);
10871092 mutex_unlock(&shmem_swaplist_mutex);
10881093 }
10891094 }
@@ -1099,10 +1104,11 @@ extern struct swap_info_struct *swap_info[]; · 9 unmodified lines
10991104 static int shmem_find_swap_entries(struct address_space *mapping,
11001105 pgoff_t start, unsigned int nr_entries,
11011106 struct page **entries, pgoff_t *indices,
1102− bool frontswap)
1107+ unsigned int type, bool frontswap)
11031108 {
11041109 XA_STATE(xas, &mapping->i_pages, start);
11051110 struct page *page;
1111+ swp_entry_t entry;
11061112 unsigned int ret = 0;
11071113
11081114 if (!nr_entries)
@@ -1116,13 +1122,12 @@ static int shmem_find_swap_entries(struct address_space *mapping, · 7 unmodified lines
11161122 if (!xa_is_value(page))
11171123 continue;
11181124
1119− if (frontswap) {
1120− swp_entry_t entry = radix_to_swp_entry(page);
1121−
1122− if (!frontswap_test(swap_info[swp_type(entry)],
1123− swp_offset(entry)))
1124− continue;
1125− }
1125+ entry = radix_to_swp_entry(page);
1126+ if (swp_type(entry) != type)
1127+ continue;
1128+ if (frontswap &&
1129+ !frontswap_test(swap_info[type], swp_offset(entry)))
1130+ continue;
11261131
11271132 indices[ret] = xas.xa_index;
11281133 entries[ret] = page;
@@ -1194,7 +1199,7 @@ static int shmem_unuse_inode(struct inode *inode, unsigned int type, · 65 unmodified lines
11941199
11951200 pvec.nr = shmem_find_swap_entries(mapping, start, nr_entries,
11961201 pvec.pages, indices,
1197− frontswap);
1202+ type, frontswap);
11981203 if (pvec.nr == 0) {
11991204 ret = 0;
12001205 break;
@@ -1227,36 +1232,27 @@ int shmem_unuse(unsigned int type, bool frontswap, · 26 unmodified lines
12271232 unsigned long *fs_pages_to_unuse)
12281233 {
12291234 struct shmem_inode_info *info, *next;
1230− struct inode *inode;
1231− struct inode *prev_inode = NULL;
12321235 int error = 0;
12331236
12341237 if (list_empty(&shmem_swaplist))
12351238 return 0;
12361239
12371240 mutex_lock(&shmem_swaplist_mutex);
1238−
1239− /*
1240− * The extra refcount on the inode is necessary to safely dereference
1241− * p->next after re-acquiring the lock. New shmem inodes with swap
1242− * get added to the end of the list and we will scan them all.
1243− */
12441241 list_for_each_entry_safe(info, next, &shmem_swaplist, swaplist) {
12451242 if (!info->swapped) {
12461243 list_del_init(&info->swaplist);
12471244 continue;
12481245 }
1249−
1250− inode = igrab(&info->vfs_inode);
1251− if (!inode)
1252− continue;
1253−
1246+ /*
1247+ * Drop the swaplist mutex while searching the inode for swap;
1248+ * but before doing so, make sure shmem_evict_inode() will not
1249+ * remove placeholder inode from swaplist, nor let it be freed
1250+ * (igrab() would protect from unlink, but not from unmount).
1251+ */
1252+ atomic_inc(&info->stop_eviction);
12541253 mutex_unlock(&shmem_swaplist_mutex);
1255− if (prev_inode)
1256− iput(prev_inode);
1257− prev_inode = inode;
12581254
1259− error = shmem_unuse_inode(inode, type, frontswap,
1255+ error = shmem_unuse_inode(&info->vfs_inode, type, frontswap,
12601256 fs_pages_to_unuse);
12611257 cond_resched();
12621258
@@ -1264,14 +1260,13 @@ int shmem_unuse(unsigned int type, bool frontswap, · 1 unmodified line
12641260 next = list_next_entry(info, swaplist);
12651261 if (!info->swapped)
12661262 list_del_init(&info->swaplist);
1263+ if (atomic_dec_and_test(&info->stop_eviction))
1264+ wake_up_var(&info->stop_eviction);
12671265 if (error)
12681266 break;
12691267 }
12701268 mutex_unlock(&shmem_swaplist_mutex);
12711269
1272− if (prev_inode)
1273− iput(prev_inode);
1274−
12751270 return error;
12761271 }
12771272
@@ -2238,6 +2233,7 @@ static struct inode *shmem_get_inode(struct super_block *sb, const struct inode · 960 unmodified lines
22382233 info = SHMEM_I(inode);
22392234 memset(info, 0, (char *)inode - (char *)info);
22402235 spin_lock_init(&info->lock);
2236+ atomic_set(&info->stop_eviction, 0);
22412237 info->seals = F_SEAL_SEAL;
22422238 info->flags = flags & VM_NORESERVE;
22432239 INIT_LIST_HEAD(&info->shrinklist);
mm/slab.c+0−1
@@ -2374,7 +2374,6 @@ static void *alloc_slabmgmt(struct kmem_cache *cachep, · 2373 unmodified lines
23742374 /* Slab management obj is off-slab. */
23752375 freelist = kmem_cache_alloc_node(cachep->freelist_cache,
23762376 local_flags, nodeid);
2377− freelist = kasan_reset_tag(freelist);
23782377 if (!freelist)
23792378 return NULL;
23802379 } else {
mm/swapfile.c+17−15
@@ -2023,7 +2023,6 @@ static unsigned int find_next_to_unuse(struct swap_info_struct *si, · 2022 unmodified lines
20232023 * If the boolean frontswap is true, only unuse pages_to_unuse pages;
20242024 * pages_to_unuse==0 means all pages; ignored if frontswap is false
20252025 */
2026−#define SWAP_UNUSE_MAX_TRIES 3
20272026 int try_to_unuse(unsigned int type, bool frontswap,
20282027 unsigned long pages_to_unuse)
20292028 {
@@ -2035,7 +2034,6 @@ int try_to_unuse(unsigned int type, bool frontswap, · 5 unmodified lines
20352034 struct page *page;
20362035 swp_entry_t entry;
20372036 unsigned int i;
2038− int retries = 0;
20392037
20402038 if (!si->inuse_pages)
20412039 return 0;
@@ -2053,11 +2051,9 @@ retry: · 11 unmodified lines
20532051
20542052 spin_lock(&mmlist_lock);
20552053 p = &init_mm.mmlist;
2056− while ((p = p->next) != &init_mm.mmlist) {
2057− if (signal_pending(current)) {
2058− retval = -EINTR;
2059− break;
2060− }
2054+ while (si->inuse_pages &&
2055+ !signal_pending(current) &&
2056+ (p = p->next) != &init_mm.mmlist) {
20612057
20622058 mm = list_entry(p, struct mm_struct, mmlist);
20632059 if (!mmget_not_zero(mm))
@@ -2084,7 +2080,9 @@ retry: · 20 unmodified lines
20842080 mmput(prev_mm);
20852081
20862082 i = 0;
2087− while ((i = find_next_to_unuse(si, i, frontswap)) != 0) {
2083+ while (si->inuse_pages &&
2084+ !signal_pending(current) &&
2085+ (i = find_next_to_unuse(si, i, frontswap)) != 0) {
20882086
20892087 entry = swp_entry(type, i);
20902088 page = find_get_page(swap_address_space(entry), i);
@@ -2117,14 +2115,18 @@ retry: · 26 unmodified lines
21172115 * If yes, we would need to do retry the unuse logic again.
21182116 * Under global memory pressure, swap entries can be reinserted back
21192117 * into process space after the mmlist loop above passes over them.
2120− * Its not worth continuosuly retrying to unuse the swap in this case.
2121− * So we try SWAP_UNUSE_MAX_TRIES times.
2118+ *
2119+ * Limit the number of retries? No: when mmget_not_zero() above fails,
2120+ * that mm is likely to be freeing swap from exit_mmap(), which proceeds
2121+ * at its own independent pace; and even shmem_writepage() could have
2122+ * been preempted after get_swap_page(), temporarily hiding that swap.
2123+ * It's easy and robust (though cpu-intensive) just to keep retrying.
21222124 */
2123− if (++retries >= SWAP_UNUSE_MAX_TRIES)
2124− retval = -EBUSY;
2125− else if (si->inuse_pages)
2126− goto retry;
2127−
2125+ if (si->inuse_pages) {
2126+ if (!signal_pending(current))
2127+ goto retry;
2128+ retval = -EINTR;
2129+ }
21282130 out:
21292131 return (retval == FRONTSWAP_PAGES_UNUSED) ? 0 : retval;
21302132 }
mm/vmscan.c+9−20
@@ -2176,7 +2176,6 @@ static void shrink_active_list(unsigned long nr_to_scan, · 2175 unmodified lines
21762176 * 10TB 320 32GB
21772177 */
21782178 static bool inactive_list_is_low(struct lruvec *lruvec, bool file,
2179− struct mem_cgroup *memcg,
21802179 struct scan_control *sc, bool actual_reclaim)
21812180 {
21822181 enum lru_list active_lru = file * LRU_FILE + LRU_ACTIVE;
@@ -2197,16 +2196,12 @@ static bool inactive_list_is_low(struct lruvec *lruvec, bool file, · 14 unmodified lines
21972196 inactive = lruvec_lru_size(lruvec, inactive_lru, sc->reclaim_idx);
21982197 active = lruvec_lru_size(lruvec, active_lru, sc->reclaim_idx);
21992198
2200− if (memcg)
2201− refaults = memcg_page_state(memcg, WORKINGSET_ACTIVATE);
2202− else
2203− refaults = node_page_state(pgdat, WORKINGSET_ACTIVATE);
2204−
22052199 /*
22062200 * When refaults are being observed, it means a new workingset
22072201 * is being established. Disable active list protection to get
22082202 * rid of the stale workingset quickly.
22092203 */
2204+ refaults = lruvec_page_state(lruvec, WORKINGSET_ACTIVATE);
22102205 if (file && actual_reclaim && lruvec->refaults != refaults) {
22112206 inactive_ratio = 0;
22122207 } else {
@@ -2227,12 +2222,10 @@ static bool inactive_list_is_low(struct lruvec *lruvec, bool file, · 14 unmodified lines
22272222 }
22282223
22292224 static unsigned long shrink_list(enum lru_list lru, unsigned long nr_to_scan,
2230− struct lruvec *lruvec, struct mem_cgroup *memcg,
2231− struct scan_control *sc)
2225+ struct lruvec *lruvec, struct scan_control *sc)
22322226 {
22332227 if (is_active_lru(lru)) {
2234− if (inactive_list_is_low(lruvec, is_file_lru(lru),
2235− memcg, sc, true))
2228+ if (inactive_list_is_low(lruvec, is_file_lru(lru), sc, true))
22362229 shrink_active_list(nr_to_scan, lruvec, sc, lru);
22372230 return 0;
22382231 }
@@ -2332,7 +2325,7 @@ static void get_scan_count(struct lruvec *lruvec, struct mem_cgroup *memcg, · 93 unmodified lines
23322325 * anonymous pages on the LRU in eligible zones.
23332326 * Otherwise, the small LRU gets thrashed.
23342327 */
2335− if (!inactive_list_is_low(lruvec, false, memcg, sc, false) &&
2328+ if (!inactive_list_is_low(lruvec, false, sc, false) &&
23362329 lruvec_lru_size(lruvec, LRU_INACTIVE_ANON, sc->reclaim_idx)
23372330 >> sc->priority) {
23382331 scan_balance = SCAN_ANON;
@@ -2350,7 +2343,7 @@ static void get_scan_count(struct lruvec *lruvec, struct mem_cgroup *memcg, · 11 unmodified lines
23502343 * lruvec even if it has plenty of old anonymous pages unless the
23512344 * system is under heavy pressure.
23522345 */
2353− if (!inactive_list_is_low(lruvec, true, memcg, sc, false) &&
2346+ if (!inactive_list_is_low(lruvec, true, sc, false) &&
23542347 lruvec_lru_size(lruvec, LRU_INACTIVE_FILE, sc->reclaim_idx) >> sc->priority) {
23552348 scan_balance = SCAN_FILE;
23562349 goto out;
@@ -2503,7 +2496,7 @@ static void shrink_node_memcg(struct pglist_data *pgdat, struct mem_cgroup *memc · 146 unmodified lines
25032496 nr[lru] -= nr_to_scan;
25042497
25052498 nr_reclaimed += shrink_list(lru, nr_to_scan,
2506− lruvec, memcg, sc);
2499+ lruvec, sc);
25072500 }
25082501 }
25092502
@@ -2570,7 +2563,7 @@ static void shrink_node_memcg(struct pglist_data *pgdat, struct mem_cgroup *memc · 60 unmodified lines
25702563 * Even if we did not try to evict anon pages at all, we want to
25712564 * rebalance the anon lru active/inactive ratio.
25722565 */
2573− if (inactive_list_is_low(lruvec, false, memcg, sc, true))
2566+ if (inactive_list_is_low(lruvec, false, sc, true))
25742567 shrink_active_list(SWAP_CLUSTER_MAX, lruvec,
25752568 sc, LRU_ACTIVE_ANON);
25762569 }
@@ -2969,12 +2962,8 @@ static void snapshot_refaults(struct mem_cgroup *root_memcg, pg_data_t *pgdat) · 392 unmodified lines
29692962 unsigned long refaults;
29702963 struct lruvec *lruvec;
29712964
2972− if (memcg)
2973− refaults = memcg_page_state(memcg, WORKINGSET_ACTIVATE);
2974− else
2975− refaults = node_page_state(pgdat, WORKINGSET_ACTIVATE);
2976−
29772965 lruvec = mem_cgroup_lruvec(pgdat, memcg);
2966+ refaults = lruvec_page_state(lruvec, WORKINGSET_ACTIVATE);
29782967 lruvec->refaults = refaults;
29792968 } while ((memcg = mem_cgroup_iter(root_memcg, memcg, NULL)));
29802969 }
@@ -3339,7 +3328,7 @@ static void age_active_anon(struct pglist_data *pgdat, · 358 unmodified lines
33393328 do {
33403329 struct lruvec *lruvec = mem_cgroup_lruvec(pgdat, memcg);
33413330
3342− if (inactive_list_is_low(lruvec, false, memcg, sc, true))
3331+ if (inactive_list_is_low(lruvec, false, sc, true))
33433332 shrink_active_list(SWAP_CLUSTER_MAX, lruvec,
33443333 sc, LRU_ACTIVE_ANON);
33453334
mm/vmstat.c+0−5
@@ -1274,13 +1274,8 @@ const char * const vmstat_text[] = { · 1273 unmodified lines
12741274 #endif
12751275 #endif /* CONFIG_MEMORY_BALLOON */
12761276 #ifdef CONFIG_DEBUG_TLBFLUSH
1277−#ifdef CONFIG_SMP
12781277 "nr_tlb_remote_flush",
12791278 "nr_tlb_remote_flush_received",
1280−#else
1281− "", /* nr_tlb_remote_flush */
1282− "", /* nr_tlb_remote_flush_received */
1283−#endif /* CONFIG_SMP */
12841279 "nr_tlb_local_flush_all",
12851280 "nr_tlb_local_flush_one",
12861281 #endif /* CONFIG_DEBUG_TLBFLUSH */
net/bridge/netfilter/ebtables.c+2−1
@@ -2027,7 +2027,8 @@ static int ebt_size_mwt(struct compat_ebt_entry_mwt *match32, · 2026 unmodified lines
20272027 if (match_kern)
20282028 match_kern->match_size = ret;
20292029
2030− if (WARN_ON(type == EBT_COMPAT_TARGET && size_left))
2030+ /* rule should have no remaining data after target */
2031+ if (type == EBT_COMPAT_TARGET && size_left)
20312032 return -EINVAL;
20322033
20332034 match32 = (struct compat_ebt_entry_mwt *) buf;
net/ipv4/route.c+23−9
@@ -1198,25 +1198,39 @@ static struct dst_entry *ipv4_dst_check(struct dst_entry *dst, u32 cookie) · 1197 unmodified lines
11981198 return dst;
11991199 }
12001200
1201−static void ipv4_link_failure(struct sk_buff *skb)
1201+static void ipv4_send_dest_unreach(struct sk_buff *skb)
12021202 {
12031203 struct ip_options opt;
1204− struct rtable *rt;
12051204 int res;
12061205
12071206 /* Recompile ip options since IPCB may not be valid anymore.
1207+ * Also check we have a reasonable ipv4 header.
12081208 */
1209− memset(&opt, 0, sizeof(opt));
1210− opt.optlen = ip_hdr(skb)->ihl*4 - sizeof(struct iphdr);
1209+ if (!pskb_network_may_pull(skb, sizeof(struct iphdr)) ||
1210+ ip_hdr(skb)->version != 4 || ip_hdr(skb)->ihl < 5)
1211+ return;
12111212
1212− rcu_read_lock();
1213− res = __ip_options_compile(dev_net(skb->dev), &opt, skb, NULL);
1214− rcu_read_unlock();
1213+ memset(&opt, 0, sizeof(opt));
1214+ if (ip_hdr(skb)->ihl > 5) {
1215+ if (!pskb_network_may_pull(skb, ip_hdr(skb)->ihl * 4))
1216+ return;
1217+ opt.optlen = ip_hdr(skb)->ihl * 4 - sizeof(struct iphdr);
12151218
1216− if (res)
1217− return;
1219+ rcu_read_lock();
1220+ res = __ip_options_compile(dev_net(skb->dev), &opt, skb, NULL);
1221+ rcu_read_unlock();
12181222
1223+ if (res)
1224+ return;
1225+ }
12191226 __icmp_send(skb, ICMP_DEST_UNREACH, ICMP_HOST_UNREACH, 0, &opt);
1227+}
1228+
1229+static void ipv4_link_failure(struct sk_buff *skb)
1230+{
1231+ struct rtable *rt;
1232+
1233+ ipv4_send_dest_unreach(skb);
12201234
12211235 rt = skb_rtable(skb);
12221236 if (rt)
net/ipv4/sysctl_net_ipv4.c+4−1
@@ -49,6 +49,7 @@ static int ip_ping_group_range_min[] = { 0, 0 }; · 48 unmodified lines
4949 static int ip_ping_group_range_max[] = { GID_T_MAX, GID_T_MAX };
5050 static int comp_sack_nr_max = 255;
5151 static u32 u32_max_div_HZ = UINT_MAX / HZ;
52+static int one_day_secs = 24 * 3600;
5253
5354 /* obsolete */
5455 static int sysctl_tcp_low_latency __read_mostly;
@@ -1160,7 +1161,9 @@ static struct ctl_table ipv4_net_table[] = { · 1105 unmodified lines
11601161 .data = &init_net.ipv4.sysctl_tcp_min_rtt_wlen,
11611162 .maxlen = sizeof(int),
11621163 .mode = 0644,
1163− .proc_handler = proc_dointvec
1164+ .proc_handler = proc_dointvec_minmax,
1165+ .extra1 = &zero,
1166+ .extra2 = &one_day_secs
11641167 },
11651168 {
11661169 .procname = "tcp_autocorking",
net/ipv6/addrlabel.c+1−1
@@ -476,7 +476,7 @@ static int ip6addrlbl_valid_dump_req(const struct nlmsghdr *nlh, · 475 unmodified lines
476476 }
477477
478478 if (nlmsg_attrlen(nlh, sizeof(*ifal))) {
479− NL_SET_ERR_MSG_MOD(extack, "Invalid data after header for address label dump requewst");
479+ NL_SET_ERR_MSG_MOD(extack, "Invalid data after header for address label dump request");
480480 return -EINVAL;
481481 }
482482
net/ncsi/ncsi-rsp.c+5−1
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 #include <linux/kernel.h>
1212 #include <linux/init.h>
1313 #include <linux/netdevice.h>
14+#include <linux/etherdevice.h>
1415 #include <linux/skbuff.h>
1516
1617 #include <net/ncsi.h>
@@ -667,7 +668,10 @@ static int ncsi_rsp_handler_oem_bcm_gma(struct ncsi_request *nr) · 650 unmodified lines
667668 ndev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
668669 memcpy(saddr.sa_data, &rsp->data[BCM_MAC_ADDR_OFFSET], ETH_ALEN);
669670 /* Increase mac address by 1 for BMC's address */
670− saddr.sa_data[ETH_ALEN - 1]++;
671+ eth_addr_inc((u8 *)saddr.sa_data);
672+ if (!is_valid_ether_addr((const u8 *)saddr.sa_data))
673+ return -ENXIO;
674+
671675 ret = ops->ndo_set_mac_address(ndev, &saddr);
672676 if (ret < 0)
673677 netdev_warn(ndev, "NCSI: 'Writing mac address to device failed\n");
net/netfilter/ipvs/ip_vs_core.c+1−1
@@ -1678,7 +1678,7 @@ ip_vs_in_icmp(struct netns_ipvs *ipvs, struct sk_buff *skb, int *related, · 1677 unmodified lines
16781678 if (!cp) {
16791679 int v;
16801680
1681− if (!sysctl_schedule_icmp(ipvs))
1681+ if (ipip || !sysctl_schedule_icmp(ipvs))
16821682 return NF_ACCEPT;
16831683
16841684 if (!ip_vs_try_to_schedule(ipvs, AF_INET, skb, pd, &v, &cp, &ciph))
net/netfilter/nf_conntrack_core.c+38−5
@@ -25,6 +25,7 @@ · 24 unmodified lines
2525 #include <linux/slab.h>
2626 #include <linux/random.h>
2727 #include <linux/jhash.h>
28+#include <linux/siphash.h>
2829 #include <linux/err.h>
2930 #include <linux/percpu.h>
3031 #include <linux/moduleparam.h>
@@ -449,6 +450,40 @@ nf_ct_invert_tuple(struct nf_conntrack_tuple *inverse, · 418 unmodified lines
449450 }
450451 EXPORT_SYMBOL_GPL(nf_ct_invert_tuple);
451452
453+/* Generate a almost-unique pseudo-id for a given conntrack.
454+ *
455+ * intentionally doesn't re-use any of the seeds used for hash
456+ * table location, we assume id gets exposed to userspace.
457+ *
458+ * Following nf_conn items do not change throughout lifetime
459+ * of the nf_conn after it has been committed to main hash table:
460+ *
461+ * 1. nf_conn address
462+ * 2. nf_conn->ext address
463+ * 3. nf_conn->master address (normally NULL)
464+ * 4. tuple
465+ * 5. the associated net namespace
466+ */
467+u32 nf_ct_get_id(const struct nf_conn *ct)
468+{
469+ static __read_mostly siphash_key_t ct_id_seed;
470+ unsigned long a, b, c, d;
471+
472+ net_get_random_once(&ct_id_seed, sizeof(ct_id_seed));
473+
474+ a = (unsigned long)ct;
475+ b = (unsigned long)ct->master ^ net_hash_mix(nf_ct_net(ct));
476+ c = (unsigned long)ct->ext;
477+ d = (unsigned long)siphash(&ct->tuplehash, sizeof(ct->tuplehash),
478+ &ct_id_seed);
479+#ifdef CONFIG_64BIT
480+ return siphash_4u64((u64)a, (u64)b, (u64)c, (u64)d, &ct_id_seed);
481+#else
482+ return siphash_4u32((u32)a, (u32)b, (u32)c, (u32)d, &ct_id_seed);
483+#endif
484+}
485+EXPORT_SYMBOL_GPL(nf_ct_get_id);
486+
452487 static void
453488 clean_from_lists(struct nf_conn *ct)
454489 {
@@ -982,12 +1017,9 @@ __nf_conntrack_confirm(struct sk_buff *skb) · 527 unmodified lines
9821017
9831018 /* set conntrack timestamp, if enabled. */
9841019 tstamp = nf_conn_tstamp_find(ct);
985− if (tstamp) {
986− if (skb->tstamp == 0)
987− __net_timestamp(skb);
1020+ if (tstamp)
1021+ tstamp->start = ktime_get_real_ns();
9881022
989− tstamp->start = ktime_to_ns(skb->tstamp);
990− }
9911023 /* Since the lookup is lockless, hash insertion must be done after
9921024 * starting the timer and setting the CONFIRMED bit. The RCU barriers
9931025 * guarantee that no other CPU can find the conntrack before the above
@@ -1350,6 +1382,7 @@ __nf_conntrack_alloc(struct net *net, · 356 unmodified lines
13501382 /* save hash for reusing when confirming */
13511383 *(unsigned long *)(&ct->tuplehash[IP_CT_DIR_REPLY].hnnode.pprev) = hash;
13521384 ct->status = 0;
1385+ ct->timeout = 0;
13531386 write_pnet(&ct->ct_net, net);
13541387 memset(&ct->__nfct_init_offset[0], 0,
13551388 offsetof(struct nf_conn, proto) -
net/netfilter/nf_conntrack_netlink.c+29−5
@@ -29,6 +29,7 @@ · 28 unmodified lines
2929 #include <linux/spinlock.h>
3030 #include <linux/interrupt.h>
3131 #include <linux/slab.h>
32+#include <linux/siphash.h>
3233
3334 #include <linux/netfilter.h>
3435 #include <net/netlink.h>
@@ -485,7 +486,9 @@ nla_put_failure: · 450 unmodified lines
485486
486487 static int ctnetlink_dump_id(struct sk_buff *skb, const struct nf_conn *ct)
487488 {
488− if (nla_put_be32(skb, CTA_ID, htonl((unsigned long)ct)))
489+ __be32 id = (__force __be32)nf_ct_get_id(ct);
490+
491+ if (nla_put_be32(skb, CTA_ID, id))
489492 goto nla_put_failure;
490493 return 0;
491494
@@ -1286,8 +1289,9 @@ static int ctnetlink_del_conntrack(struct net *net, struct sock *ctnl, · 794 unmodified lines
12861289 }
12871290
12881291 if (cda[CTA_ID]) {
1289− u_int32_t id = ntohl(nla_get_be32(cda[CTA_ID]));
1290− if (id != (u32)(unsigned long)ct) {
1292+ __be32 id = nla_get_be32(cda[CTA_ID]);
1293+
1294+ if (id != (__force __be32)nf_ct_get_id(ct)) {
12911295 nf_ct_put(ct);
12921296 return -ENOENT;
12931297 }
@@ -2692,6 +2696,25 @@ nla_put_failure: · 1398 unmodified lines
26922696
26932697 static const union nf_inet_addr any_addr;
26942698
2699+static __be32 nf_expect_get_id(const struct nf_conntrack_expect *exp)
2700+{
2701+ static __read_mostly siphash_key_t exp_id_seed;
2702+ unsigned long a, b, c, d;
2703+
2704+ net_get_random_once(&exp_id_seed, sizeof(exp_id_seed));
2705+
2706+ a = (unsigned long)exp;
2707+ b = (unsigned long)exp->helper;
2708+ c = (unsigned long)exp->master;
2709+ d = (unsigned long)siphash(&exp->tuple, sizeof(exp->tuple), &exp_id_seed);
2710+
2711+#ifdef CONFIG_64BIT
2712+ return (__force __be32)siphash_4u64((u64)a, (u64)b, (u64)c, (u64)d, &exp_id_seed);
2713+#else
2714+ return (__force __be32)siphash_4u32((u32)a, (u32)b, (u32)c, (u32)d, &exp_id_seed);
2715+#endif
2716+}
2717+
26952718 static int
26962719 ctnetlink_exp_dump_expect(struct sk_buff *skb,
26972720 const struct nf_conntrack_expect *exp)
@@ -2739,7 +2762,7 @@ ctnetlink_exp_dump_expect(struct sk_buff *skb, · 41 unmodified lines
27392762 }
27402763 #endif
27412764 if (nla_put_be32(skb, CTA_EXPECT_TIMEOUT, htonl(timeout)) ||
2742− nla_put_be32(skb, CTA_EXPECT_ID, htonl((unsigned long)exp)) ||
2765+ nla_put_be32(skb, CTA_EXPECT_ID, nf_expect_get_id(exp)) ||
27432766 nla_put_be32(skb, CTA_EXPECT_FLAGS, htonl(exp->flags)) ||
27442767 nla_put_be32(skb, CTA_EXPECT_CLASS, htonl(exp->class)))
27452768 goto nla_put_failure;
@@ -3044,7 +3067,8 @@ static int ctnetlink_get_expect(struct net *net, struct sock *ctnl, · 298 unmodified lines
30443067
30453068 if (cda[CTA_EXPECT_ID]) {
30463069 __be32 id = nla_get_be32(cda[CTA_EXPECT_ID]);
3047− if (ntohl(id) != (u32)(unsigned long)exp) {
3070+
3071+ if (id != nf_expect_get_id(exp)) {
30483072 nf_ct_expect_put(exp);
30493073 return -ENOENT;
30503074 }
net/netfilter/nf_conntrack_proto.c+1−1
@@ -55,7 +55,7 @@ void nf_l4proto_log_invalid(const struct sk_buff *skb, · 54 unmodified lines
5555 struct va_format vaf;
5656 va_list args;
5757
58− if (net->ct.sysctl_log_invalid != protonum ||
58+ if (net->ct.sysctl_log_invalid != protonum &&
5959 net->ct.sysctl_log_invalid != IPPROTO_RAW)
6060 return;
6161
net/netfilter/nf_conntrack_proto_icmp.c+72−21
@@ -103,49 +103,94 @@ int nf_conntrack_icmp_packet(struct nf_conn *ct, · 102 unmodified lines
103103 return NF_ACCEPT;
104104 }
105105
106−/* Returns conntrack if it dealt with ICMP, and filled in skb fields */
107−static int
108−icmp_error_message(struct nf_conn *tmpl, struct sk_buff *skb,
109− const struct nf_hook_state *state)
106+/* Check inner header is related to any of the existing connections */
107+int nf_conntrack_inet_error(struct nf_conn *tmpl, struct sk_buff *skb,
108+ unsigned int dataoff,
109+ const struct nf_hook_state *state,
110+ u8 l4proto, union nf_inet_addr *outer_daddr)
110111 {
111112 struct nf_conntrack_tuple innertuple, origtuple;
112113 const struct nf_conntrack_tuple_hash *h;
113114 const struct nf_conntrack_zone *zone;
114115 enum ip_conntrack_info ctinfo;
115116 struct nf_conntrack_zone tmp;
117+ union nf_inet_addr *ct_daddr;
118+ enum ip_conntrack_dir dir;
119+ struct nf_conn *ct;
116120
117121 WARN_ON(skb_nfct(skb));
118122 zone = nf_ct_zone_tmpl(tmpl, skb, &tmp);
119123
120124 /* Are they talking about one of our connections? */
121− if (!nf_ct_get_tuplepr(skb,
122− skb_network_offset(skb) + ip_hdrlen(skb)
123− + sizeof(struct icmphdr),
124− PF_INET, state->net, &origtuple)) {
125− pr_debug("icmp_error_message: failed to get tuple\n");
125+ if (!nf_ct_get_tuplepr(skb, dataoff,
126+ state->pf, state->net, &origtuple))
126127 return -NF_ACCEPT;
127− }
128128
129129 /* Ordinarily, we'd expect the inverted tupleproto, but it's
130130 been preserved inside the ICMP. */
131− if (!nf_ct_invert_tuple(&innertuple, &origtuple)) {
132− pr_debug("icmp_error_message: no match\n");
131+ if (!nf_ct_invert_tuple(&innertuple, &origtuple))
133132 return -NF_ACCEPT;
134− }
135−
136− ctinfo = IP_CT_RELATED;
137133
138134 h = nf_conntrack_find_get(state->net, zone, &innertuple);
139− if (!h) {
140− pr_debug("icmp_error_message: no match\n");
135+ if (!h)
136+ return -NF_ACCEPT;
137+
138+ /* Consider: A -> T (=This machine) -> B
139+ * Conntrack entry will look like this:
140+ * Original: A->B
141+ * Reply: B->T (SNAT case) OR A
142+ *
143+ * When this function runs, we got packet that looks like this:
144+ * iphdr|icmphdr|inner_iphdr|l4header (tcp, udp, ..).
145+ *
146+ * Above nf_conntrack_find_get() makes lookup based on inner_hdr,
147+ * so we should expect that destination of the found connection
148+ * matches outer header destination address.
149+ *
150+ * In above example, we can consider these two cases:
151+ * 1. Error coming in reply direction from B or M (middle box) to
152+ * T (SNAT case) or A.
153+ * Inner saddr will be B, dst will be T or A.
154+ * The found conntrack will be reply tuple (B->T/A).
155+ * 2. Error coming in original direction from A or M to B.
156+ * Inner saddr will be A, inner daddr will be B.
157+ * The found conntrack will be original tuple (A->B).
158+ *
159+ * In both cases, conntrack[dir].dst == inner.dst.
160+ *
161+ * A bogus packet could look like this:
162+ * Inner: B->T
163+ * Outer: B->X (other machine reachable by T).
164+ *
165+ * In this case, lookup yields connection A->B and will
166+ * set packet from B->X as *RELATED*, even though no connection
167+ * from X was ever seen.
168+ */
169+ ct = nf_ct_tuplehash_to_ctrack(h);
170+ dir = NF_CT_DIRECTION(h);
171+ ct_daddr = &ct->tuplehash[dir].tuple.dst.u3;
172+ if (!nf_inet_addr_cmp(outer_daddr, ct_daddr)) {
173+ if (state->pf == AF_INET) {
174+ nf_l4proto_log_invalid(skb, state->net, state->pf,
175+ l4proto,
176+ "outer daddr %pI4 != inner %pI4",
177+ &outer_daddr->ip, &ct_daddr->ip);
178+ } else if (state->pf == AF_INET6) {
179+ nf_l4proto_log_invalid(skb, state->net, state->pf,
180+ l4proto,
181+ "outer daddr %pI6 != inner %pI6",
182+ &outer_daddr->ip6, &ct_daddr->ip6);
183+ }
184+ nf_ct_put(ct);
141185 return -NF_ACCEPT;
142186 }
143187
144− if (NF_CT_DIRECTION(h) == IP_CT_DIR_REPLY)
188+ ctinfo = IP_CT_RELATED;
189+ if (dir == IP_CT_DIR_REPLY)
145190 ctinfo += IP_CT_IS_REPLY;
146191
147192 /* Update skb to refer to this connection */
148− nf_ct_set(skb, nf_ct_tuplehash_to_ctrack(h), ctinfo);
193+ nf_ct_set(skb, ct, ctinfo);
149194 return NF_ACCEPT;
150195 }
151196
@@ -162,11 +207,12 @@ int nf_conntrack_icmpv4_error(struct nf_conn *tmpl, · 10 unmodified lines
162207 struct sk_buff *skb, unsigned int dataoff,
163208 const struct nf_hook_state *state)
164209 {
210+ union nf_inet_addr outer_daddr;
165211 const struct icmphdr *icmph;
166212 struct icmphdr _ih;
167213
168214 /* Not enough header? */
169− icmph = skb_header_pointer(skb, ip_hdrlen(skb), sizeof(_ih), &_ih);
215+ icmph = skb_header_pointer(skb, dataoff, sizeof(_ih), &_ih);
170216 if (icmph == NULL) {
171217 icmp_error_log(skb, state, "short packet");
172218 return -NF_ACCEPT;
@@ -199,7 +245,12 @@ int nf_conntrack_icmpv4_error(struct nf_conn *tmpl, · 26 unmodified lines
199245 icmph->type != ICMP_REDIRECT)
200246 return NF_ACCEPT;
201247
202− return icmp_error_message(tmpl, skb, state);
248+ memset(&outer_daddr, 0, sizeof(outer_daddr));
249+ outer_daddr.ip = ip_hdr(skb)->daddr;
250+
251+ dataoff += sizeof(*icmph);
252+ return nf_conntrack_inet_error(tmpl, skb, dataoff, state,
253+ IPPROTO_ICMP, &outer_daddr);
203254 }
204255
205256 #if IS_ENABLED(CONFIG_NF_CT_NETLINK)
net/netfilter/nf_conntrack_proto_icmpv6.c+6−46
@@ -123,51 +123,6 @@ int nf_conntrack_icmpv6_packet(struct nf_conn *ct, · 122 unmodified lines
123123 return NF_ACCEPT;
124124 }
125125
126−static int
127−icmpv6_error_message(struct net *net, struct nf_conn *tmpl,
128− struct sk_buff *skb,
129− unsigned int icmp6off)
130−{
131− struct nf_conntrack_tuple intuple, origtuple;
132− const struct nf_conntrack_tuple_hash *h;
133− enum ip_conntrack_info ctinfo;
134− struct nf_conntrack_zone tmp;
135−
136− WARN_ON(skb_nfct(skb));
137−
138− /* Are they talking about one of our connections? */
139− if (!nf_ct_get_tuplepr(skb,
140− skb_network_offset(skb)
141− + sizeof(struct ipv6hdr)
142− + sizeof(struct icmp6hdr),
143− PF_INET6, net, &origtuple)) {
144− pr_debug("icmpv6_error: Can't get tuple\n");
145− return -NF_ACCEPT;
146− }
147−
148− /* Ordinarily, we'd expect the inverted tupleproto, but it's
149− been preserved inside the ICMP. */
150− if (!nf_ct_invert_tuple(&intuple, &origtuple)) {
151− pr_debug("icmpv6_error: Can't invert tuple\n");
152− return -NF_ACCEPT;
153− }
154−
155− ctinfo = IP_CT_RELATED;
156−
157− h = nf_conntrack_find_get(net, nf_ct_zone_tmpl(tmpl, skb, &tmp),
158− &intuple);
159− if (!h) {
160− pr_debug("icmpv6_error: no match\n");
161− return -NF_ACCEPT;
162− } else {
163− if (NF_CT_DIRECTION(h) == IP_CT_DIR_REPLY)
164− ctinfo += IP_CT_IS_REPLY;
165− }
166−
167− /* Update skb to refer to this connection */
168− nf_ct_set(skb, nf_ct_tuplehash_to_ctrack(h), ctinfo);
169− return NF_ACCEPT;
170−}
171126
172127 static void icmpv6_error_log(const struct sk_buff *skb,
173128 const struct nf_hook_state *state,
@@ -182,6 +137,7 @@ int nf_conntrack_icmpv6_error(struct nf_conn *tmpl, · 8 unmodified lines
182137 unsigned int dataoff,
183138 const struct nf_hook_state *state)
184139 {
140+ union nf_inet_addr outer_daddr;
185141 const struct icmp6hdr *icmp6h;
186142 struct icmp6hdr _ih;
187143 int type;
@@ -210,7 +166,11 @@ int nf_conntrack_icmpv6_error(struct nf_conn *tmpl, · 22 unmodified lines
210166 if (icmp6h->icmp6_type >= 128)
211167 return NF_ACCEPT;
212168
213− return icmpv6_error_message(state->net, tmpl, skb, dataoff);
169+ memcpy(&outer_daddr.ip6, &ipv6_hdr(skb)->daddr,
170+ sizeof(outer_daddr.ip6));
171+ dataoff += sizeof(*icmp6h);
172+ return nf_conntrack_inet_error(tmpl, skb, dataoff, state,
173+ IPPROTO_ICMPV6, &outer_daddr);
214174 }
215175
216176 #if IS_ENABLED(CONFIG_NF_CT_NETLINK)
net/netfilter/nf_nat_core.c+8−3
@@ -415,9 +415,14 @@ static void nf_nat_l4proto_unique_tuple(struct nf_conntrack_tuple *tuple, · 414 unmodified lines
415415 case IPPROTO_ICMPV6:
416416 /* id is same for either direction... */
417417 keyptr = &tuple->src.u.icmp.id;
418− min = range->min_proto.icmp.id;
419− range_size = ntohs(range->max_proto.icmp.id) -
420− ntohs(range->min_proto.icmp.id) + 1;
418+ if (!(range->flags & NF_NAT_RANGE_PROTO_SPECIFIED)) {
419+ min = 0;
420+ range_size = 65536;
421+ } else {
422+ min = ntohs(range->min_proto.icmp.id);
423+ range_size = ntohs(range->max_proto.icmp.id) -
424+ ntohs(range->min_proto.icmp.id) + 1;
425+ }
421426 goto find_free_id;
422427 #if IS_ENABLED(CONFIG_NF_CT_PROTO_GRE)
423428 case IPPROTO_GRE:
net/netfilter/nf_tables_api.c+1−1
@@ -1544,7 +1544,7 @@ static int nft_chain_parse_hook(struct net *net, · 1543 unmodified lines
15441544 if (IS_ERR(type))
15451545 return PTR_ERR(type);
15461546 }
1547− if (!(type->hook_mask & (1 << hook->num)))
1547+ if (hook->num > NF_MAX_HOOKS || !(type->hook_mask & (1 << hook->num)))
15481548 return -EOPNOTSUPP;
15491549
15501550 if (type->type == NFT_CHAIN_T_NAT &&
net/netfilter/nfnetlink_log.c+1−1
@@ -540,7 +540,7 @@ __build_packet_message(struct nfnl_log_net *log, · 539 unmodified lines
540540 goto nla_put_failure;
541541 }
542542
543− if (skb->tstamp) {
543+ if (hooknum <= NF_INET_FORWARD && skb->tstamp) {
544544 struct nfulnl_msg_packet_timestamp ts;
545545 struct timespec64 kts = ktime_to_timespec64(skb->tstamp);
546546 ts.sec = cpu_to_be64(kts.tv_sec);
net/netfilter/nfnetlink_queue.c+1−1
@@ -582,7 +582,7 @@ nfqnl_build_packet_message(struct net *net, struct nfqnl_instance *queue, · 581 unmodified lines
582582 if (nfqnl_put_bridge(entry, skb) < 0)
583583 goto nla_put_failure;
584584
585− if (entskb->tstamp) {
585+ if (entry->state.hook <= NF_INET_FORWARD && entskb->tstamp) {
586586 struct nfqnl_msg_packet_timestamp ts;
587587 struct timespec64 kts = ktime_to_timespec64(entskb->tstamp);
588588
net/netfilter/xt_time.c+14−9
@@ -163,19 +163,24 @@ time_mt(const struct sk_buff *skb, struct xt_action_param *par) · 162 unmodified lines
163163 s64 stamp;
164164
165165 /*
166− * We cannot use get_seconds() instead of __net_timestamp() here.
166+ * We need real time here, but we can neither use skb->tstamp
167+ * nor __net_timestamp().
168+ *
169+ * skb->tstamp and skb->skb_mstamp_ns overlap, however, they
170+ * use different clock types (real vs monotonic).
171+ *
167172 * Suppose you have two rules:
168− * 1. match before 13:00
169− * 2. match after 13:00
173+ * 1. match before 13:00
174+ * 2. match after 13:00
175+ *
170176 * If you match against processing time (get_seconds) it
171177 * may happen that the same packet matches both rules if
172− * it arrived at the right moment before 13:00.
178+ * it arrived at the right moment before 13:00, so it would be
179+ * better to check skb->tstamp and set it via __net_timestamp()
180+ * if needed. This however breaks outgoing packets tx timestamp,
181+ * and causes them to get delayed forever by fq packet scheduler.
173182 */
174− if (skb->tstamp == 0)
175− __net_timestamp((struct sk_buff *)skb);
176−
177− stamp = ktime_to_ns(skb->tstamp);
178− stamp = div_s64(stamp, NSEC_PER_SEC);
183+ stamp = get_seconds();
179184
180185 if (info->flags & XT_TIME_LOCAL_TZ)
181186 /* Adjust for local timezone */
net/rds/ib_fmr.c+11−0
@@ -44,6 +44,17 @@ struct rds_ib_mr *rds_ib_alloc_fmr(struct rds_ib_device *rds_ibdev, int npages) · 43 unmodified lines
4444 else
4545 pool = rds_ibdev->mr_1m_pool;
4646
47+ if (atomic_read(&pool->dirty_count) >= pool->max_items / 10)
48+ queue_delayed_work(rds_ib_mr_wq, &pool->flush_worker, 10);
49+
50+ /* Switch pools if one of the pool is reaching upper limit */
51+ if (atomic_read(&pool->dirty_count) >= pool->max_items * 9 / 10) {
52+ if (pool->pool_type == RDS_IB_MR_8K_POOL)
53+ pool = rds_ibdev->mr_1m_pool;
54+ else
55+ pool = rds_ibdev->mr_8k_pool;
56+ }
57+
4758 ibmr = rds_ib_try_reuse_ibmr(pool);
4859 if (ibmr)
4960 return ibmr;
net/rds/ib_rdma.c+0−3
@@ -454,9 +454,6 @@ struct rds_ib_mr *rds_ib_try_reuse_ibmr(struct rds_ib_mr_pool *pool) · 453 unmodified lines
454454 struct rds_ib_mr *ibmr = NULL;
455455 int iter = 0;
456456
457− if (atomic_read(&pool->dirty_count) >= pool->max_items_soft / 10)
458− queue_delayed_work(rds_ib_mr_wq, &pool->flush_worker, 10);
459−
460457 while (1) {
461458 ibmr = rds_ib_reuse_mr(pool);
462459 if (ibmr)
net/rose/rose_loopback.c+16−11
@@ -16,6 +16,7 @@ · 15 unmodified lines
1616 #include <linux/init.h>
1717
1818 static struct sk_buff_head loopback_queue;
19+#define ROSE_LOOPBACK_LIMIT 1000
1920 static struct timer_list loopback_timer;
2021
2122 static void rose_set_loopback_timer(void);
@@ -35,29 +36,27 @@ static int rose_loopback_running(void) · 13 unmodified lines
3536
3637 int rose_loopback_queue(struct sk_buff *skb, struct rose_neigh *neigh)
3738 {
38− struct sk_buff *skbn;
39+ struct sk_buff *skbn = NULL;
3940
40− skbn = skb_clone(skb, GFP_ATOMIC);
41+ if (skb_queue_len(&loopback_queue) < ROSE_LOOPBACK_LIMIT)
42+ skbn = skb_clone(skb, GFP_ATOMIC);
4143
42− kfree_skb(skb);
43−
44− if (skbn != NULL) {
44+ if (skbn) {
45+ consume_skb(skb);
4546 skb_queue_tail(&loopback_queue, skbn);
4647
4748 if (!rose_loopback_running())
4849 rose_set_loopback_timer();
50+ } else {
51+ kfree_skb(skb);
4952 }
5053
5154 return 1;
5255 }
5356
54−
5557 static void rose_set_loopback_timer(void)
5658 {
57− del_timer(&loopback_timer);
58−
59− loopback_timer.expires = jiffies + 10;
60− add_timer(&loopback_timer);
59+ mod_timer(&loopback_timer, jiffies + 10);
6160 }
6261
6362 static void rose_loopback_timer(struct timer_list *unused)
@@ -68,8 +67,12 @@ static void rose_loopback_timer(struct timer_list *unused) · 4 unmodified lines
6867 struct sock *sk;
6968 unsigned short frametype;
7069 unsigned int lci_i, lci_o;
70+ int count;
7171
72− while ((skb = skb_dequeue(&loopback_queue)) != NULL) {
72+ for (count = 0; count < ROSE_LOOPBACK_LIMIT; count++) {
73+ skb = skb_dequeue(&loopback_queue);
74+ if (!skb)
75+ return;
7376 if (skb->len < ROSE_MIN_LEN) {
7477 kfree_skb(skb);
7578 continue;
@@ -106,6 +109,8 @@ static void rose_loopback_timer(struct timer_list *unused) · 30 unmodified lines
106109 kfree_skb(skb);
107110 }
108111 }
112+ if (!skb_queue_empty(&loopback_queue))
113+ mod_timer(&loopback_timer, jiffies + 1);
109114 }
110115
111116 void __exit rose_loopback_clear(void)
net/rxrpc/input.c+8−4
@@ -1161,19 +1161,19 @@ int rxrpc_extract_header(struct rxrpc_skb_priv *sp, struct sk_buff *skb) · 1160 unmodified lines
11611161 * handle data received on the local endpoint
11621162 * - may be called in interrupt context
11631163 *
1164− * The socket is locked by the caller and this prevents the socket from being
1165− * shut down and the local endpoint from going away, thus sk_user_data will not
1166− * be cleared until this function returns.
1164+ * [!] Note that as this is called from the encap_rcv hook, the socket is not
1165+ * held locked by the caller and nothing prevents sk_user_data on the UDP from
1166+ * being cleared in the middle of processing this function.
11671167 *
11681168 * Called with the RCU read lock held from the IP layer via UDP.
11691169 */
11701170 int rxrpc_input_packet(struct sock *udp_sk, struct sk_buff *skb)
11711171 {
1172+ struct rxrpc_local *local = rcu_dereference_sk_user_data(udp_sk);
11721173 struct rxrpc_connection *conn;
11731174 struct rxrpc_channel *chan;
11741175 struct rxrpc_call *call = NULL;
11751176 struct rxrpc_skb_priv *sp;
1176− struct rxrpc_local *local = udp_sk->sk_user_data;
11771177 struct rxrpc_peer *peer = NULL;
11781178 struct rxrpc_sock *rx = NULL;
11791179 unsigned int channel;
@@ -1181,6 +1181,10 @@ int rxrpc_input_packet(struct sock *udp_sk, struct sk_buff *skb) · 1 unmodified line
11811181
11821182 _enter("%p", udp_sk);
11831183
1184+ if (unlikely(!local)) {
1185+ kfree_skb(skb);
1186+ return 0;
1187+ }
11841188 if (skb->tstamp == 0)
11851189 skb->tstamp = ktime_get_real();
11861190
net/rxrpc/local_object.c+2−1
@@ -304,7 +304,8 @@ nomem: · 303 unmodified lines
304304 ret = -ENOMEM;
305305 sock_error:
306306 mutex_unlock(&rxnet->local_mutex);
307− kfree(local);
307+ if (local)
308+ call_rcu(&local->rcu, rxrpc_local_rcu);
308309 _leave(" = %d", ret);
309310 return ERR_PTR(ret);
310311
net/sunrpc/cache.c+3−0
@@ -54,6 +54,7 @@ static void cache_init(struct cache_head *h, struct cache_detail *detail) · 53 unmodified lines
5454 h->last_refresh = now;
5555 }
5656
57+static inline int cache_is_valid(struct cache_head *h);
5758 static void cache_fresh_locked(struct cache_head *head, time_t expiry,
5859 struct cache_detail *detail);
5960 static void cache_fresh_unlocked(struct cache_head *head,
@@ -105,6 +106,8 @@ static struct cache_head *sunrpc_cache_add_entry(struct cache_detail *detail, · 45 unmodified lines
105106 if (cache_is_expired(detail, tmp)) {
106107 hlist_del_init_rcu(&tmp->cache_list);
107108 detail->entries --;
109+ if (cache_is_valid(tmp) == -EAGAIN)
110+ set_bit(CACHE_NEGATIVE, &tmp->flags);
108111 cache_fresh_locked(tmp, 0, detail);
109112 freeme = tmp;
110113 break;
net/sunrpc/clnt.c+5−2
@@ -2081,8 +2081,8 @@ call_transmit_status(struct rpc_task *task) · 2080 unmodified lines
20812081 * test first.
20822082 */
20832083 if (rpc_task_transmitted(task)) {
2084− if (task->tk_status == 0)
2085− xprt_request_wait_receive(task);
2084+ task->tk_status = 0;
2085+ xprt_request_wait_receive(task);
20862086 return;
20872087 }
20882088
@@ -2167,6 +2167,9 @@ call_bc_transmit_status(struct rpc_task *task) · 78 unmodified lines
21672167 {
21682168 struct rpc_rqst *req = task->tk_rqstp;
21692169
2170+ if (rpc_task_transmitted(task))
2171+ task->tk_status = 0;
2172+
21702173 dprint_status(task);
21712174
21722175 switch (task->tk_status) {
net/tls/tls_device.c+2−2
@@ -904,7 +904,9 @@ int tls_set_device_offload_rx(struct sock *sk, struct tls_context *ctx) · 903 unmodified lines
904904 goto release_netdev;
905905
906906 free_sw_resources:
907+ up_read(&device_offload_lock);
907908 tls_sw_free_resources_rx(sk);
909+ down_read(&device_offload_lock);
908910 release_ctx:
909911 ctx->priv_ctx_rx = NULL;
910912 release_netdev:
@@ -939,8 +941,6 @@ void tls_device_offload_cleanup_rx(struct sock *sk) · 28 unmodified lines
939941 }
940942 out:
941943 up_read(&device_offload_lock);
942− kfree(tls_ctx->rx.rec_seq);
943− kfree(tls_ctx->rx.iv);
944944 tls_sw_release_resources_rx(sk);
945945 }
946946
net/tls/tls_device_fallback.c+10−3
@@ -194,6 +194,9 @@ static void update_chksum(struct sk_buff *skb, int headln) · 193 unmodified lines
194194
195195 static void complete_skb(struct sk_buff *nskb, struct sk_buff *skb, int headln)
196196 {
197+ struct sock *sk = skb->sk;
198+ int delta;
199+
197200 skb_copy_header(nskb, skb);
198201
199202 skb_put(nskb, skb->len);
@@ -201,11 +204,15 @@ static void complete_skb(struct sk_buff *nskb, struct sk_buff *skb, int headln) · 1 unmodified line
201204 update_chksum(nskb, headln);
202205
203206 nskb->destructor = skb->destructor;
204− nskb->sk = skb->sk;
207+ nskb->sk = sk;
205208 skb->destructor = NULL;
206209 skb->sk = NULL;
207− refcount_add(nskb->truesize - skb->truesize,
208− &nskb->sk->sk_wmem_alloc);
210+
211+ delta = nskb->truesize - skb->truesize;
212+ if (likely(delta < 0))
213+ WARN_ON_ONCE(refcount_sub_and_test(-delta, &sk->sk_wmem_alloc));
214+ else if (delta)
215+ refcount_add(delta, &sk->sk_wmem_alloc);
209216 }
210217
211218 /* This function may be called after the user socket is already
net/tls/tls_main.c+1−4
@@ -293,11 +293,8 @@ static void tls_sk_proto_close(struct sock *sk, long timeout) · 292 unmodified lines
293293 #endif
294294 }
295295
296− if (ctx->rx_conf == TLS_SW) {
297− kfree(ctx->rx.rec_seq);
298− kfree(ctx->rx.iv);
296+ if (ctx->rx_conf == TLS_SW)
299297 tls_sw_free_resources_rx(sk);
300− }
301298
302299 #ifdef CONFIG_TLS_DEVICE
303300 if (ctx->rx_conf == TLS_HW)
net/tls/tls_sw.c+3−0
@@ -2091,6 +2091,9 @@ void tls_sw_release_resources_rx(struct sock *sk) · 2090 unmodified lines
20912091 struct tls_context *tls_ctx = tls_get_ctx(sk);
20922092 struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx);
20932093
2094+ kfree(tls_ctx->rx.rec_seq);
2095+ kfree(tls_ctx->rx.iv);
2096+
20942097 if (ctx->aead_recv) {
20952098 kfree_skb(ctx->recv_pkt);
20962099 ctx->recv_pkt = NULL;
scripts/atomic/gen-atomics.sh+1−1
@@ -13,7 +13,7 @@ gen-atomic-long.sh asm-generic/atomic-long.h · 12 unmodified lines
1313 gen-atomic-fallback.sh linux/atomic-fallback.h
1414 EOF
1515 while read script header; do
16− ${ATOMICDIR}/${script} ${ATOMICTBL} > ${LINUXDIR}/include/${header}
16+ /bin/sh ${ATOMICDIR}/${script} ${ATOMICTBL} > ${LINUXDIR}/include/${header}
1717 HASH="$(sha1sum ${LINUXDIR}/include/${header})"
1818 HASH="${HASH%% *}"
1919 printf "// %s\n" "${HASH}" >> ${LINUXDIR}/include/${header}
security/device_cgroup.c+1−1
@@ -560,7 +560,7 @@ static int propagate_exception(struct dev_cgroup *devcg_root, · 559 unmodified lines
560560 devcg->behavior == DEVCG_DEFAULT_ALLOW) {
561561 rc = dev_exception_add(devcg, ex);
562562 if (rc)
563− break;
563+ return rc;
564564 } else {
565565 /*
566566 * in the other possible cases:
sound/core/info.c+10−2
@@ -713,8 +713,11 @@ snd_info_create_entry(const char *name, struct snd_info_entry *parent, · 712 unmodified lines
713713 INIT_LIST_HEAD(&entry->list);
714714 entry->parent = parent;
715715 entry->module = module;
716− if (parent)
716+ if (parent) {
717+ mutex_lock(&parent->access);
717718 list_add_tail(&entry->list, &parent->children);
719+ mutex_unlock(&parent->access);
720+ }
718721 return entry;
719722 }
720723
@@ -792,7 +795,12 @@ void snd_info_free_entry(struct snd_info_entry * entry) · 71 unmodified lines
792795 list_for_each_entry_safe(p, n, &entry->children, list)
793796 snd_info_free_entry(p);
794797
795− list_del(&entry->list);
798+ p = entry->parent;
799+ if (p) {
800+ mutex_lock(&p->access);
801+ list_del(&entry->list);
802+ mutex_unlock(&p->access);
803+ }
796804 kfree(entry->name);
797805 if (entry->private_free)
798806 entry->private_free(entry);
sound/core/init.c+9−9
@@ -382,14 +382,7 @@ int snd_card_disconnect(struct snd_card *card) · 381 unmodified lines
382382 card->shutdown = 1;
383383 spin_unlock(&card->files_lock);
384384
385− /* phase 1: disable fops (user space) operations for ALSA API */
386− mutex_lock(&snd_card_mutex);
387− snd_cards[card->number] = NULL;
388− clear_bit(card->number, snd_cards_lock);
389− mutex_unlock(&snd_card_mutex);
390−
391− /* phase 2: replace file->f_op with special dummy operations */
392−
385+ /* replace file->f_op with special dummy operations */
393386 spin_lock(&card->files_lock);
394387 list_for_each_entry(mfile, &card->files_list, list) {
395388 /* it's critical part, use endless loop */
@@ -405,7 +398,7 @@ int snd_card_disconnect(struct snd_card *card) · 9 unmodified lines
405398 }
406399 spin_unlock(&card->files_lock);
407400
408− /* phase 3: notify all connected devices about disconnection */
401+ /* notify all connected devices about disconnection */
409402 /* at this point, they cannot respond to any calls except release() */
410403
411404 #if IS_ENABLED(CONFIG_SND_MIXER_OSS)
@@ -421,6 +414,13 @@ int snd_card_disconnect(struct snd_card *card) · 9 unmodified lines
421414 device_del(&card->card_dev);
422415 card->registered = false;
423416 }
417+
418+ /* disable fops (user space) operations for ALSA API */
419+ mutex_lock(&snd_card_mutex);
420+ snd_cards[card->number] = NULL;
421+ clear_bit(card->number, snd_cards_lock);
422+ mutex_unlock(&snd_card_mutex);
423+
424424 #ifdef CONFIG_PM
425425 wake_up(&card->power_sleep);
426426 #endif
sound/pci/hda/hda_codec.c+1−0
@@ -969,6 +969,7 @@ int snd_hda_codec_device_new(struct hda_bus *bus, struct snd_card *card, · 968 unmodified lines
969969
970970 /* power-up all before initialization */
971971 hda_set_power_state(codec, AC_PWRST_D0);
972+ codec->core.dev.power.power_state = PMSG_ON;
972973
973974 snd_hda_codec_proc_new(codec);
974975
sound/pci/hda/patch_realtek.c+6−0
@@ -7266,6 +7266,8 @@ static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = { · 7265 unmodified lines
72667266 {0x12, 0x90a60140},
72677267 {0x14, 0x90170150},
72687268 {0x21, 0x02211020}),
7269+ SND_HDA_PIN_QUIRK(0x10ec0236, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7270+ {0x21, 0x02211020}),
72697271 SND_HDA_PIN_QUIRK(0x10ec0255, 0x1028, "Dell", ALC255_FIXUP_DELL2_MIC_NO_PRESENCE,
72707272 {0x14, 0x90170110},
72717273 {0x21, 0x02211020}),
@@ -7376,6 +7378,10 @@ static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = { · 104 unmodified lines
73767378 {0x21, 0x0221101f}),
73777379 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
73787380 ALC256_STANDARD_PINS),
7381+ SND_HDA_PIN_QUIRK(0x10ec0256, 0x1028, "Dell", ALC255_FIXUP_DELL1_MIC_NO_PRESENCE,
7382+ {0x14, 0x90170110},
7383+ {0x1b, 0x01011020},
7384+ {0x21, 0x0221101f}),
73797385 SND_HDA_PIN_QUIRK(0x10ec0256, 0x1043, "ASUS", ALC256_FIXUP_ASUS_MIC,
73807386 {0x14, 0x90170110},
73817387 {0x1b, 0x90a70130},
tools/include/uapi/sound/asound.h+1−0
@@ -32,6 +32,7 @@ · 31 unmodified lines
3232
3333 #ifndef __KERNEL__
3434 #include <stdlib.h>
35+#include <time.h>
3536 #endif
3637
3738 /*
tools/lib/traceevent/event-parse.c+1−1
@@ -2233,7 +2233,7 @@ eval_type_str(unsigned long long val, const char *type, int pointer) · 2232 unmodified lines
22332233 return val & 0xffffffff;
22342234
22352235 if (strcmp(type, "u64") == 0 ||
2236− strcmp(type, "s64"))
2236+ strcmp(type, "s64") == 0)
22372237 return val;
22382238
22392239 if (strcmp(type, "s8") == 0)
tools/perf/builtin-stat.c+1−0
@@ -1308,6 +1308,7 @@ static void init_features(struct perf_session *session) · 1307 unmodified lines
13081308 for (feat = HEADER_FIRST_FEATURE; feat < HEADER_LAST_FEATURE; feat++)
13091309 perf_header__set_feat(&session->header, feat);
13101310
1311+ perf_header__clear_feat(&session->header, HEADER_DIR_FORMAT);
13111312 perf_header__clear_feat(&session->header, HEADER_BUILD_ID);
13121313 perf_header__clear_feat(&session->header, HEADER_TRACING_DATA);
13131314 perf_header__clear_feat(&session->header, HEADER_BRANCH_STACK);
tools/perf/builtin-top.c+1−0
@@ -1377,6 +1377,7 @@ int cmd_top(int argc, const char **argv) · 1376 unmodified lines
13771377 * */
13781378 .overwrite = 0,
13791379 .sample_time = true,
1380+ .sample_time_set = true,
13801381 },
13811382 .max_stack = sysctl__max_stack(),
13821383 .annotation_opts = annotation__default_options,
tools/perf/scripts/python/export-to-sqlite.py+1−1
@@ -331,7 +331,7 @@ if perf_db_export_calls: · 330 unmodified lines
331331 'return_id,'
332332 'CASE WHEN flags=0 THEN \'\' WHEN flags=1 THEN \'no call\' WHEN flags=2 THEN \'no return\' WHEN flags=3 THEN \'no call/return\' WHEN flags=6 THEN \'jump\' ELSE flags END AS flags,'
333333 'parent_call_path_id,'
334− 'parent_id'
334+ 'calls.parent_id'
335335 ' FROM calls INNER JOIN call_paths ON call_paths.id = call_path_id')
336336
337337 do_query(query, 'CREATE VIEW samples_view AS '
tools/perf/util/env.c+6−2
@@ -57,9 +57,11 @@ struct bpf_prog_info_node *perf_env__find_bpf_prog_info(struct perf_env *env, · 56 unmodified lines
5757 else if (prog_id > node->info_linear->info.id)
5858 n = n->rb_right;
5959 else
60− break;
60+ goto out;
6161 }
62+ node = NULL;
6263
64+out:
6365 up_read(&env->bpf_progs.lock);
6466 return node;
6567 }
@@ -109,10 +111,12 @@ struct btf_node *perf_env__find_btf(struct perf_env *env, __u32 btf_id) · 43 unmodified lines
109111 else if (btf_id > node->id)
110112 n = n->rb_right;
111113 else
112− break;
114+ goto out;
113115 }
116+ node = NULL;
114117
115118 up_read(&env->bpf_progs.lock);
119+out:
116120 return node;
117121 }
118122
tools/perf/util/evlist.c+9−5
@@ -1868,12 +1868,12 @@ static void *perf_evlist__poll_thread(void *arg) · 1867 unmodified lines
18681868 {
18691869 struct perf_evlist *evlist = arg;
18701870 bool draining = false;
1871− int i;
1871+ int i, done = 0;
1872+
1873+ while (!done) {
1874+ bool got_data = false;
18721875
1873− while (draining || !(evlist->thread.done)) {
1874− if (draining)
1875− draining = false;
1876− else if (evlist->thread.done)
1876+ if (evlist->thread.done)
18771877 draining = true;
18781878
18791879 if (!draining)
@@ -1894,9 +1894,13 @@ static void *perf_evlist__poll_thread(void *arg) · 14 unmodified lines
18941894 pr_warning("cannot locate proper evsel for the side band event\n");
18951895
18961896 perf_mmap__consume(map);
1897+ got_data = true;
18971898 }
18981899 perf_mmap__read_done(map);
18991900 }
1901+
1902+ if (draining && !got_data)
1903+ break;
19001904 }
19011905 return NULL;
19021906 }
tools/perf/util/evsel.c+6−6
@@ -2368,7 +2368,7 @@ int perf_evsel__parse_sample(struct perf_evsel *evsel, union perf_event *event, · 2367 unmodified lines
23682368 if (data->user_regs.abi) {
23692369 u64 mask = evsel->attr.sample_regs_user;
23702370
2371− sz = hweight_long(mask) * sizeof(u64);
2371+ sz = hweight64(mask) * sizeof(u64);
23722372 OVERFLOW_CHECK(array, sz, max_size);
23732373 data->user_regs.mask = mask;
23742374 data->user_regs.regs = (u64 *)array;
@@ -2424,7 +2424,7 @@ int perf_evsel__parse_sample(struct perf_evsel *evsel, union perf_event *event, · 49 unmodified lines
24242424 if (data->intr_regs.abi != PERF_SAMPLE_REGS_ABI_NONE) {
24252425 u64 mask = evsel->attr.sample_regs_intr;
24262426
2427− sz = hweight_long(mask) * sizeof(u64);
2427+ sz = hweight64(mask) * sizeof(u64);
24282428 OVERFLOW_CHECK(array, sz, max_size);
24292429 data->intr_regs.mask = mask;
24302430 data->intr_regs.regs = (u64 *)array;
@@ -2552,7 +2552,7 @@ size_t perf_event__sample_event_size(const struct perf_sample *sample, u64 type, · 121 unmodified lines
25522552 if (type & PERF_SAMPLE_REGS_USER) {
25532553 if (sample->user_regs.abi) {
25542554 result += sizeof(u64);
2555− sz = hweight_long(sample->user_regs.mask) * sizeof(u64);
2555+ sz = hweight64(sample->user_regs.mask) * sizeof(u64);
25562556 result += sz;
25572557 } else {
25582558 result += sizeof(u64);
@@ -2580,7 +2580,7 @@ size_t perf_event__sample_event_size(const struct perf_sample *sample, u64 type, · 21 unmodified lines
25802580 if (type & PERF_SAMPLE_REGS_INTR) {
25812581 if (sample->intr_regs.abi) {
25822582 result += sizeof(u64);
2583− sz = hweight_long(sample->intr_regs.mask) * sizeof(u64);
2583+ sz = hweight64(sample->intr_regs.mask) * sizeof(u64);
25842584 result += sz;
25852585 } else {
25862586 result += sizeof(u64);
@@ -2710,7 +2710,7 @@ int perf_event__synthesize_sample(union perf_event *event, u64 type, · 123 unmodified lines
27102710 if (type & PERF_SAMPLE_REGS_USER) {
27112711 if (sample->user_regs.abi) {
27122712 *array++ = sample->user_regs.abi;
2713− sz = hweight_long(sample->user_regs.mask) * sizeof(u64);
2713+ sz = hweight64(sample->user_regs.mask) * sizeof(u64);
27142714 memcpy(array, sample->user_regs.regs, sz);
27152715 array = (void *)array + sz;
27162716 } else {
@@ -2746,7 +2746,7 @@ int perf_event__synthesize_sample(union perf_event *event, u64 type, · 29 unmodified lines
27462746 if (type & PERF_SAMPLE_REGS_INTR) {
27472747 if (sample->intr_regs.abi) {
27482748 *array++ = sample->intr_regs.abi;
2749− sz = hweight_long(sample->intr_regs.mask) * sizeof(u64);
2749+ sz = hweight64(sample->intr_regs.mask) * sizeof(u64);
27502750 memcpy(array, sample->intr_regs.regs, sz);
27512751 array = (void *)array + sz;
27522752 } else {
tools/perf/util/header.c+13−9
@@ -2606,6 +2606,7 @@ static int process_bpf_prog_info(struct feat_fd *ff, void *data __maybe_unused) · 2605 unmodified lines
26062606 perf_env__insert_bpf_prog_info(env, info_node);
26072607 }
26082608
2609+ up_write(&env->bpf_progs.lock);
26092610 return 0;
26102611 out:
26112612 free(info_linear);
@@ -2623,7 +2624,9 @@ static int process_bpf_prog_info(struct feat_fd *ff __maybe_unused, void *data _ · 11 unmodified lines
26232624 static int process_bpf_btf(struct feat_fd *ff, void *data __maybe_unused)
26242625 {
26252626 struct perf_env *env = &ff->ph->env;
2627+ struct btf_node *node = NULL;
26262628 u32 count, i;
2629+ int err = -1;
26272630
26282631 if (ff->ph->needs_swap) {
26292632 pr_warning("interpreting btf from systems with endianity is not yet supported\n");
@@ -2636,31 +2639,32 @@ static int process_bpf_btf(struct feat_fd *ff, void *data __maybe_unused) · 6 unmodified lines
26362639 down_write(&env->bpf_progs.lock);
26372640
26382641 for (i = 0; i < count; ++i) {
2639− struct btf_node *node;
26402642 u32 id, data_size;
26412643
26422644 if (do_read_u32(ff, &id))
2643− return -1;
2645+ goto out;
26442646 if (do_read_u32(ff, &data_size))
2645− return -1;
2647+ goto out;
26462648
26472649 node = malloc(sizeof(struct btf_node) + data_size);
26482650 if (!node)
2649− return -1;
2651+ goto out;
26502652
26512653 node->id = id;
26522654 node->data_size = data_size;
26532655
2654− if (__do_read(ff, node->data, data_size)) {
2655− free(node);
2656− return -1;
2657− }
2656+ if (__do_read(ff, node->data, data_size))
2657+ goto out;
26582658
26592659 perf_env__insert_btf(env, node);
2660+ node = NULL;
26602661 }
26612662
2663+ err = 0;
2664+out:
26622665 up_write(&env->bpf_progs.lock);
2663− return 0;
2666+ free(node);
2667+ return err;
26642668 }
26652669
26662670 struct feature_ops {
tools/perf/util/map.c+17−3
@@ -261,6 +261,22 @@ bool __map__is_extra_kernel_map(const struct map *map) · 260 unmodified lines
261261 return kmap && kmap->name[0];
262262 }
263263
264+bool __map__is_bpf_prog(const struct map *map)
265+{
266+ const char *name;
267+
268+ if (map->dso->binary_type == DSO_BINARY_TYPE__BPF_PROG_INFO)
269+ return true;
270+
271+ /*
272+ * If PERF_RECORD_BPF_EVENT is not included, the dso will not have
273+ * type of DSO_BINARY_TYPE__BPF_PROG_INFO. In such cases, we can
274+ * guess the type based on name.
275+ */
276+ name = map->dso->short_name;
277+ return name && (strstr(name, "bpf_prog_") == name);
278+}
279+
264280 bool map__has_symbols(const struct map *map)
265281 {
266282 return dso__has_symbols(map->dso);
@@ -910,10 +926,8 @@ static void __maps__insert_name(struct maps *maps, struct map *map) · 643 unmodified lines
910926 rc = strcmp(m->dso->short_name, map->dso->short_name);
911927 if (rc < 0)
912928 p = &(*p)->rb_left;
913− else if (rc > 0)
914− p = &(*p)->rb_right;
915929 else
916− return;
930+ p = &(*p)->rb_right;
917931 }
918932 rb_link_node(&map->rb_node_name, parent, p);
919933 rb_insert_color(&map->rb_node_name, &maps->names);
tools/perf/util/map.h+3−1
@@ -159,10 +159,12 @@ int map__set_kallsyms_ref_reloc_sym(struct map *map, const char *symbol_name, · 158 unmodified lines
159159
160160 bool __map__is_kernel(const struct map *map);
161161 bool __map__is_extra_kernel_map(const struct map *map);
162+bool __map__is_bpf_prog(const struct map *map);
162163
163164 static inline bool __map__is_kmodule(const struct map *map)
164165 {
165− return !__map__is_kernel(map) && !__map__is_extra_kernel_map(map);
166+ return !__map__is_kernel(map) && !__map__is_extra_kernel_map(map) &&
167+ !__map__is_bpf_prog(map);
166168 }
167169
168170 bool map__has_symbols(const struct map *map);
tools/testing/selftests/net/run_afpackettests+5−0
@@ -6,12 +6,14 @@ if [ $(id -u) != 0 ]; then · 5 unmodified lines
66 exit 0
77 fi
88
9+ret=0
910 echo "--------------------"
1011 echo "running psock_fanout test"
1112 echo "--------------------"
1213 ./in_netns.sh ./psock_fanout
1314 if [ $? -ne 0 ]; then
1415 echo "[FAIL]"
16+ ret=1
1517 else
1618 echo "[PASS]"
1719 fi
@@ -22,6 +24,7 @@ echo "--------------------" · 4 unmodified lines
2224 ./in_netns.sh ./psock_tpacket
2325 if [ $? -ne 0 ]; then
2426 echo "[FAIL]"
27+ ret=1
2528 else
2629 echo "[PASS]"
2730 fi
@@ -32,6 +35,8 @@ echo "--------------------" · 4 unmodified lines
3235 ./in_netns.sh ./txring_overwrite
3336 if [ $? -ne 0 ]; then
3437 echo "[FAIL]"
38+ ret=1
3539 else
3640 echo "[PASS]"
3741 fi
42+exit $ret
tools/testing/selftests/net/run_netsocktests+1−1
@@ -7,7 +7,7 @@ echo "--------------------" · 6 unmodified lines
77 ./socket
88 if [ $? -ne 0 ]; then
99 echo "[FAIL]"
10+ exit 1
1011 else
1112 echo "[PASS]"
1213 fi
13−
tools/testing/selftests/netfilter/Makefile+2−1
@@ -1,6 +1,7 @@
11 # SPDX-License-Identifier: GPL-2.0
22 # Makefile for netfilter selftests
33
4−TEST_PROGS := nft_trans_stress.sh nft_nat.sh bridge_brouter.sh
4+TEST_PROGS := nft_trans_stress.sh nft_nat.sh bridge_brouter.sh \
5+ conntrack_icmp_related.sh
56
67 include ../lib.mk
tools/testing/selftests/netfilter/conntrack_icmp_related.sh+283−0
@@ -0,0 +1,283 @@
1+#!/bin/bash
2+#
3+# check that ICMP df-needed/pkttoobig icmp are set are set as related
4+# state
5+#
6+# Setup is:
7+#
8+# nsclient1 -> nsrouter1 -> nsrouter2 -> nsclient2
9+# MTU 1500, except for nsrouter2 <-> nsclient2 link (1280).
10+# ping nsclient2 from nsclient1, checking that conntrack did set RELATED
11+# 'fragmentation needed' icmp packet.
12+#
13+# In addition, nsrouter1 will perform IP masquerading, i.e. also
14+# check the icmp errors are propagated to the correct host as per
15+# nat of "established" icmp-echo "connection".
16+
17+# Kselftest framework requirement - SKIP code is 4.
18+ksft_skip=4
19+ret=0
20+
21+nft --version > /dev/null 2>&1
22+if [ $? -ne 0 ];then
23+ echo "SKIP: Could not run test without nft tool"
24+ exit $ksft_skip
25+fi
26+
27+ip -Version > /dev/null 2>&1
28+if [ $? -ne 0 ];then
29+ echo "SKIP: Could not run test without ip tool"
30+ exit $ksft_skip
31+fi
32+
33+cleanup() {
34+ for i in 1 2;do ip netns del nsclient$i;done
35+ for i in 1 2;do ip netns del nsrouter$i;done
36+}
37+
38+ipv4() {
39+ echo -n 192.168.$1.2
40+}
41+
42+ipv6 () {
43+ echo -n dead:$1::2
44+}
45+
46+check_counter()
47+{
48+ ns=$1
49+ name=$2
50+ expect=$3
51+ local lret=0
52+
53+ cnt=$(ip netns exec $ns nft list counter inet filter "$name" | grep -q "$expect")
54+ if [ $? -ne 0 ]; then
55+ echo "ERROR: counter $name in $ns has unexpected value (expected $expect)" 1>&2
56+ ip netns exec $ns nft list counter inet filter "$name" 1>&2
57+ lret=1
58+ fi
59+
60+ return $lret
61+}
62+
63+check_unknown()
64+{
65+ expect="packets 0 bytes 0"
66+ for n in nsclient1 nsclient2 nsrouter1 nsrouter2; do
67+ check_counter $n "unknown" "$expect"
68+ if [ $? -ne 0 ] ;then
69+ return 1
70+ fi
71+ done
72+
73+ return 0
74+}
75+
76+for n in nsclient1 nsclient2 nsrouter1 nsrouter2; do
77+ ip netns add $n
78+ ip -net $n link set lo up
79+done
80+
81+DEV=veth0
82+ip link add $DEV netns nsclient1 type veth peer name eth1 netns nsrouter1
83+DEV=veth0
84+ip link add $DEV netns nsclient2 type veth peer name eth1 netns nsrouter2
85+
86+DEV=veth0
87+ip link add $DEV netns nsrouter1 type veth peer name eth2 netns nsrouter2
88+
89+DEV=veth0
90+for i in 1 2; do
91+ ip -net nsclient$i link set $DEV up
92+ ip -net nsclient$i addr add $(ipv4 $i)/24 dev $DEV
93+ ip -net nsclient$i addr add $(ipv6 $i)/64 dev $DEV
94+done
95+
96+ip -net nsrouter1 link set eth1 up
97+ip -net nsrouter1 link set veth0 up
98+
99+ip -net nsrouter2 link set eth1 up
100+ip -net nsrouter2 link set eth2 up
101+
102+ip -net nsclient1 route add default via 192.168.1.1
103+ip -net nsclient1 -6 route add default via dead:1::1
104+
105+ip -net nsclient2 route add default via 192.168.2.1
106+ip -net nsclient2 route add default via dead:2::1
107+
108+i=3
109+ip -net nsrouter1 addr add 192.168.1.1/24 dev eth1
110+ip -net nsrouter1 addr add 192.168.3.1/24 dev veth0
111+ip -net nsrouter1 addr add dead:1::1/64 dev eth1
112+ip -net nsrouter1 addr add dead:3::1/64 dev veth0
113+ip -net nsrouter1 route add default via 192.168.3.10
114+ip -net nsrouter1 -6 route add default via dead:3::10
115+
116+ip -net nsrouter2 addr add 192.168.2.1/24 dev eth1
117+ip -net nsrouter2 addr add 192.168.3.10/24 dev eth2
118+ip -net nsrouter2 addr add dead:2::1/64 dev eth1
119+ip -net nsrouter2 addr add dead:3::10/64 dev eth2
120+ip -net nsrouter2 route add default via 192.168.3.1
121+ip -net nsrouter2 route add default via dead:3::1
122+
123+sleep 2
124+for i in 4 6; do
125+ ip netns exec nsrouter1 sysctl -q net.ipv$i.conf.all.forwarding=1
126+ ip netns exec nsrouter2 sysctl -q net.ipv$i.conf.all.forwarding=1
127+done
128+
129+for netns in nsrouter1 nsrouter2; do
130+ip netns exec $netns nft -f - <<EOF
131+table inet filter {
132+ counter unknown { }
133+ counter related { }
134+ chain forward {
135+ type filter hook forward priority 0; policy accept;
136+ meta l4proto icmpv6 icmpv6 type "packet-too-big" ct state "related" counter name "related" accept
137+ meta l4proto icmp icmp type "destination-unreachable" ct state "related" counter name "related" accept
138+ meta l4proto { icmp, icmpv6 } ct state new,established accept
139+ counter name "unknown" drop
140+ }
141+}
142+EOF
143+done
144+
145+ip netns exec nsclient1 nft -f - <<EOF
146+table inet filter {
147+ counter unknown { }
148+ counter related { }
149+ chain input {
150+ type filter hook input priority 0; policy accept;
151+ meta l4proto { icmp, icmpv6 } ct state established,untracked accept
152+
153+ meta l4proto { icmp, icmpv6 } ct state "related" counter name "related" accept
154+ counter name "unknown" drop
155+ }
156+}
157+EOF
158+
159+ip netns exec nsclient2 nft -f - <<EOF
160+table inet filter {
161+ counter unknown { }
162+ counter new { }
163+ counter established { }
164+
165+ chain input {
166+ type filter hook input priority 0; policy accept;
167+ meta l4proto { icmp, icmpv6 } ct state established,untracked accept
168+
169+ meta l4proto { icmp, icmpv6 } ct state "new" counter name "new" accept
170+ meta l4proto { icmp, icmpv6 } ct state "established" counter name "established" accept
171+ counter name "unknown" drop
172+ }
173+ chain output {
174+ type filter hook output priority 0; policy accept;
175+ meta l4proto { icmp, icmpv6 } ct state established,untracked accept
176+
177+ meta l4proto { icmp, icmpv6 } ct state "new" counter name "new"
178+ meta l4proto { icmp, icmpv6 } ct state "established" counter name "established"
179+ counter name "unknown" drop
180+ }
181+}
182+EOF
183+
184+
185+# make sure NAT core rewrites adress of icmp error if nat is used according to
186+# conntrack nat information (icmp error will be directed at nsrouter1 address,
187+# but it needs to be routed to nsclient1 address).
188+ip netns exec nsrouter1 nft -f - <<EOF
189+table ip nat {
190+ chain postrouting {
191+ type nat hook postrouting priority 0; policy accept;
192+ ip protocol icmp oifname "veth0" counter masquerade
193+ }
194+}
195+table ip6 nat {
196+ chain postrouting {
197+ type nat hook postrouting priority 0; policy accept;
198+ ip6 nexthdr icmpv6 oifname "veth0" counter masquerade
199+ }
200+}
201+EOF
202+
203+ip netns exec nsrouter2 ip link set eth1 mtu 1280
204+ip netns exec nsclient2 ip link set veth0 mtu 1280
205+sleep 1
206+
207+ip netns exec nsclient1 ping -c 1 -s 1000 -q -M do 192.168.2.2 >/dev/null
208+if [ $? -ne 0 ]; then
209+ echo "ERROR: netns ip routing/connectivity broken" 1>&2
210+ cleanup
211+ exit 1
212+fi
213+ip netns exec nsclient1 ping6 -q -c 1 -s 1000 dead:2::2 >/dev/null
214+if [ $? -ne 0 ]; then
215+ echo "ERROR: netns ipv6 routing/connectivity broken" 1>&2
216+ cleanup
217+ exit 1
218+fi
219+
220+check_unknown
221+if [ $? -ne 0 ]; then
222+ ret=1
223+fi
224+
225+expect="packets 0 bytes 0"
226+for netns in nsrouter1 nsrouter2 nsclient1;do
227+ check_counter "$netns" "related" "$expect"
228+ if [ $? -ne 0 ]; then
229+ ret=1
230+ fi
231+done
232+
233+expect="packets 2 bytes 2076"
234+check_counter nsclient2 "new" "$expect"
235+if [ $? -ne 0 ]; then
236+ ret=1
237+fi
238+
239+ip netns exec nsclient1 ping -q -c 1 -s 1300 -M do 192.168.2.2 > /dev/null
240+if [ $? -eq 0 ]; then
241+ echo "ERROR: ping should have failed with PMTU too big error" 1>&2
242+ ret=1
243+fi
244+
245+# nsrouter2 should have generated the icmp error, so
246+# related counter should be 0 (its in forward).
247+expect="packets 0 bytes 0"
248+check_counter "nsrouter2" "related" "$expect"
249+if [ $? -ne 0 ]; then
250+ ret=1
251+fi
252+
253+# but nsrouter1 should have seen it, same for nsclient1.
254+expect="packets 1 bytes 576"
255+for netns in nsrouter1 nsclient1;do
256+ check_counter "$netns" "related" "$expect"
257+ if [ $? -ne 0 ]; then
258+ ret=1
259+ fi
260+done
261+
262+ip netns exec nsclient1 ping6 -c 1 -s 1300 dead:2::2 > /dev/null
263+if [ $? -eq 0 ]; then
264+ echo "ERROR: ping6 should have failed with PMTU too big error" 1>&2
265+ ret=1
266+fi
267+
268+expect="packets 2 bytes 1856"
269+for netns in nsrouter1 nsclient1;do
270+ check_counter "$netns" "related" "$expect"
271+ if [ $? -ne 0 ]; then
272+ ret=1
273+ fi
274+done
275+
276+if [ $ret -eq 0 ];then
277+ echo "PASS: icmp mtu error had RELATED state"
278+else
279+ echo "ERROR: icmp error RELATED state test has failed"
280+fi
281+
282+cleanup
283+exit $ret
tools/testing/selftests/netfilter/nft_nat.sh+53−3
@@ -347,6 +347,7 @@ EOF · 346 unmodified lines
347347 test_masquerade6()
348348 {
349349 local family=$1
350+ local natflags=$1
350351 local lret=0
351352
352353 ip netns exec ns0 sysctl net.ipv6.conf.all.forwarding=1 > /dev/null
@@ -380,7 +381,7 @@ ip netns exec ns0 nft -f - <<EOF · 27 unmodified lines
380381 table $family nat {
381382 chain postrouting {
382383 type nat hook postrouting priority 0; policy accept;
383− meta oif veth0 masquerade
384+ meta oif veth0 masquerade $natflags
384385 }
385386 }
386387 EOF
@@ -391,7 +392,11 @@ EOF · 4 unmodified lines
391392
392393 ip netns exec ns2 ping -q -c 1 dead:1::99 > /dev/null # ping ns2->ns1
393394 if [ $? -ne 0 ] ; then
395+<<<<<<< HEAD
394396 echo "ERROR: cannot ping ns1 from ns2 with active $family masquerading"
397+=======
398+ echo "ERROR: cannot ping ns1 from ns2 with active ipv6 masquerade $natflags"
399+>>>>>>> cd8dead0c39457e58ec1d36db93aedca811d48f1
395400 lret=1
396401 fi
397402
@@ -428,20 +433,38 @@ EOF · 30 unmodified lines
428433 fi
429434 done
430435
436+<<<<<<< HEAD
431437 ip netns exec ns0 nft flush chain $family nat postrouting
438+=======
439+ ip netns exec ns2 ping -q -c 1 dead:1::99 > /dev/null # ping ns2->ns1
440+ if [ $? -ne 0 ] ; then
441+ echo "ERROR: cannot ping ns1 from ns2 with active ipv6 masquerade $natflags (attempt 2)"
442+ lret=1
443+ fi
444+
445+ ip netns exec ns0 nft flush chain ip6 nat postrouting
446+>>>>>>> cd8dead0c39457e58ec1d36db93aedca811d48f1
432447 if [ $? -ne 0 ]; then
433448 echo "ERROR: Could not flush $family nat postrouting" 1>&2
434449 lret=1
435450 fi
436451
452+<<<<<<< HEAD
437453 test $lret -eq 0 && echo "PASS: $family IPv6 masquerade for ns2"
454+=======
455+ test $lret -eq 0 && echo "PASS: IPv6 masquerade $natflags for ns2"
456+>>>>>>> cd8dead0c39457e58ec1d36db93aedca811d48f1
438457
439458 return $lret
440459 }
441460
442461 test_masquerade()
443462 {
463+<<<<<<< HEAD
444464 local family=$1
465+=======
466+ local natflags=$1
467+>>>>>>> cd8dead0c39457e58ec1d36db93aedca811d48f1
445468 local lret=0
446469
447470 ip netns exec ns0 sysctl net.ipv4.conf.veth0.forwarding=1 > /dev/null
@@ -449,7 +472,7 @@ test_masquerade() · 1 unmodified line
449472
450473 ip netns exec ns2 ping -q -c 1 10.0.1.99 > /dev/null # ping ns2->ns1
451474 if [ $? -ne 0 ] ; then
452− echo "ERROR: canot ping ns1 from ns2"
475+ echo "ERROR: cannot ping ns1 from ns2 $natflags"
453476 lret=1
454477 fi
455478
@@ -475,7 +498,7 @@ ip netns exec ns0 nft -f - <<EOF · 19 unmodified lines
475498 table $family nat {
476499 chain postrouting {
477500 type nat hook postrouting priority 0; policy accept;
478− meta oif veth0 masquerade
501+ meta oif veth0 masquerade $natflags
479502 }
480503 }
481504 EOF
@@ -486,7 +509,11 @@ EOF · 4 unmodified lines
486509
487510 ip netns exec ns2 ping -q -c 1 10.0.1.99 > /dev/null # ping ns2->ns1
488511 if [ $? -ne 0 ] ; then
512+<<<<<<< HEAD
489513 echo "ERROR: cannot ping ns1 from ns2 with active $family masquerading"
514+=======
515+ echo "ERROR: cannot ping ns1 from ns2 with active ip masquere $natflags"
516+>>>>>>> cd8dead0c39457e58ec1d36db93aedca811d48f1
490517 lret=1
491518 fi
492519
@@ -522,13 +549,27 @@ EOF · 29 unmodified lines
522549 fi
523550 done
524551
552+<<<<<<< HEAD
525553 ip netns exec ns0 nft flush chain $family nat postrouting
554+=======
555+ ip netns exec ns2 ping -q -c 1 10.0.1.99 > /dev/null # ping ns2->ns1
556+ if [ $? -ne 0 ] ; then
557+ echo "ERROR: cannot ping ns1 from ns2 with active ip masquerade $natflags (attempt 2)"
558+ lret=1
559+ fi
560+
561+ ip netns exec ns0 nft flush chain ip nat postrouting
562+>>>>>>> cd8dead0c39457e58ec1d36db93aedca811d48f1
526563 if [ $? -ne 0 ]; then
527564 echo "ERROR: Could not flush $family nat postrouting" 1>&2
528565 lret=1
529566 fi
530567
568+<<<<<<< HEAD
531569 test $lret -eq 0 && echo "PASS: $family IP masquerade for ns2"
570+=======
571+ test $lret -eq 0 && echo "PASS: IP masquerade $natflags for ns2"
572+>>>>>>> cd8dead0c39457e58ec1d36db93aedca811d48f1
532573
533574 return $lret
534575 }
@@ -802,11 +843,20 @@ $test_inet_nat && test_local_dnat inet · 267 unmodified lines
802843 $test_inet_nat && test_local_dnat6 inet
803844
804845 reset_counters
846+<<<<<<< HEAD
805847 test_masquerade ip
806848 test_masquerade6 ip6
807849 reset_counters
808850 $test_inet_nat && test_masquerade inet
809851 $test_inet_nat && test_masquerade6 inet
852+=======
853+test_masquerade ""
854+test_masquerade6 ""
855+
856+reset_counters
857+test_masquerade "fully-random"
858+test_masquerade6 "fully-random"
859+>>>>>>> cd8dead0c39457e58ec1d36db93aedca811d48f1
810860
811861 reset_counters
812862 test_redirect ip
tools/testing/selftests/proc/proc-pid-vm.c+2−2
@@ -187,8 +187,8 @@ static int make_exe(const uint8_t *payload, size_t len) · 186 unmodified lines
187187 ph.p_offset = 0;
188188 ph.p_vaddr = VADDR;
189189 ph.p_paddr = 0;
190− ph.p_filesz = sizeof(struct elf64_hdr) + sizeof(struct elf64_phdr) + sizeof(payload);
191− ph.p_memsz = sizeof(struct elf64_hdr) + sizeof(struct elf64_phdr) + sizeof(payload);
190+ ph.p_filesz = sizeof(struct elf64_hdr) + sizeof(struct elf64_phdr) + len;
191+ ph.p_memsz = sizeof(struct elf64_hdr) + sizeof(struct elf64_phdr) + len;
192192 ph.p_align = 4096;
193193
194194 fd = openat(AT_FDCWD, "/tmp", O_WRONLY|O_EXCL|O_TMPFILE, 0700);
tools/testing/selftests/proc/proc-self-map-files-002.c+10−10
@@ -46,12 +46,9 @@ static void fail(const char *fmt, unsigned long a, unsigned long b) · 45 unmodified lines
4646
4747 int main(void)
4848 {
49− const unsigned int PAGE_SIZE = sysconf(_SC_PAGESIZE);
50−#ifdef __arm__
51− unsigned long va = 2 * PAGE_SIZE;
52−#else
53− unsigned long va = 0;
54−#endif
49+ const int PAGE_SIZE = sysconf(_SC_PAGESIZE);
50+ const unsigned long va_max = 1UL << 32;
51+ unsigned long va;
5552 void *p;
5653 int fd;
5754 unsigned long a, b;
@@ -60,10 +57,13 @@ int main(void) · 2 unmodified lines
6057 if (fd == -1)
6158 return 1;
6259
63− p = mmap((void *)va, PAGE_SIZE, PROT_NONE, MAP_PRIVATE|MAP_FILE|MAP_FIXED, fd, 0);
64− if (p == MAP_FAILED) {
65− if (errno == EPERM)
66− return 4;
60+ for (va = 0; va < va_max; va += PAGE_SIZE) {
61+ p = mmap((void *)va, PAGE_SIZE, PROT_NONE, MAP_PRIVATE|MAP_FILE|MAP_FIXED, fd, 0);
62+ if (p == (void *)va)
63+ break;
64+ }
65+ if (va == va_max) {
66+ fprintf(stderr, "error: mmap doesn't like you\n");
6767 return 1;
6868 }
6969

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