History

Merge 5.5-rc7 into usb-next

We need the USB fixes in here as well.

Greg Kroah-Hartman committed 6 years ago

Commit dd7d99d2 parents 42bbdd9 def9d27291 files · +2319 −2230Browse files

Unified · Split

291 files
  1. .mailmap +1 −0
  2. Documentation/ABI/stable/sysfs-driver-mlxreg-io +11 −2
  3. Documentation/admin-guide/devices.txt +1 −1
  4. Documentation/media/v4l-drivers/meye.rst +1 −1
  5. Documentation/process/embargoed-hardware-issues.rst +1 −1
  6. MAINTAINERS +10 −10
  7. Makefile +1 −1
  8. arch/arm/boot/dts/am571x-idk.dts +1 −5
  9. arch/arm/boot/dts/am572x-idk-common.dtsi +0 −4
  10. arch/arm/boot/dts/am57xx-beagle-x15-common.dtsi +21 −4
  11. arch/arm/boot/dts/aspeed-bmc-ibm-rainier.dts +2 −367
  12. arch/arm/boot/dts/aspeed-bmc-opp-tacoma.dts +5 −398
  13. arch/arm/boot/dts/aspeed-g6.dtsi +19 −20
  14. arch/arm/boot/dts/imx6dl-icore-mipi.dts +1 −1
  15. arch/arm/boot/dts/imx6q-dhcom-pdk2.dts +1 −1
  16. arch/arm/boot/dts/imx6q-dhcom-som.dtsi +1 −1
  17. arch/arm/boot/dts/imx6qdl-sabresd.dtsi +0 −4
  18. arch/arm/boot/dts/imx6sl-evk.dts +0 −4
  19. arch/arm/boot/dts/imx6sll-evk.dts +0 −4
  20. arch/arm/boot/dts/imx6sx-sdb-reva.dts +0 −4
  21. arch/arm/boot/dts/imx6sx-sdb.dts +0 −4
  22. arch/arm/boot/dts/imx7s-colibri.dtsi +4 −0
  23. arch/arm/boot/dts/imx7ulp.dtsi +2 −2
  24. arch/arm/boot/dts/meson8.dtsi +1 −1
  25. arch/arm/boot/dts/mmp3.dtsi +6 −6
  26. arch/arm/boot/dts/sun8i-a83t-cubietruck-plus.dts +1 −1
  27. arch/arm/mach-davinci/Kconfig +1 −0
  28. arch/arm/mach-mmp/time.c +1 −1
  29. arch/arm/mach-omap2/Kconfig +2 −1
  30. arch/arm/mach-omap2/pdata-quirks.c +5 −1
  31. arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino-emmc.dts +1 −1
  32. arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts +1 −1
  33. arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi +4 −4
  34. arch/arm64/boot/dts/amlogic/meson-sm1-sei610.dts +26 −2
  35. arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi +1 −1
  36. arch/arm64/boot/dts/freescale/imx8mm.dtsi +1 −1
  37. arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts +1 −1
  38. arch/arm64/boot/dts/intel/socfpga_agilex.dtsi +4 −4
  39. arch/arm64/boot/dts/rockchip/rk3328-a1.dts +2 −1
  40. arch/nds32/include/asm/cacheflush.h +7 −4
  41. arch/nds32/include/asm/pgtable.h +1 −1
  42. arch/parisc/kernel/drivers.c +2 −2
  43. arch/parisc/mm/init.c +1 −1
  44. arch/riscv/include/asm/asm-prototypes.h +4 −0
  45. arch/riscv/kernel/head.S +10 −6
  46. arch/riscv/kernel/vdso/Makefile +2 −1
  47. arch/riscv/lib/tishift.S +57 −18
  48. arch/s390/kernel/setup.c +1 −1
  49. arch/x86/boot/compressed/head_64.S +5 −0
  50. arch/x86/events/intel/uncore_snb.c +6 −0
  51. arch/x86/events/intel/uncore_snbep.c +1 −24
  52. arch/x86/kernel/cpu/amd.c +2 −2
  53. arch/x86/kernel/cpu/mce/therm_throt.c +5 −4
  54. arch/x86/kernel/cpu/resctrl/core.c +1 −1
  55. arch/x86/kernel/cpu/resctrl/rdtgroup.c +3 −3
  56. block/blk-merge.c +7 −2
  57. block/blk-settings.c +1 −1
  58. drivers/base/firmware_loader/builtin/Makefile +1 −1
  59. drivers/block/null_blk_zoned.c +3 −1
  60. drivers/bus/ti-sysc.c +8 −2
  61. drivers/clk/clk.c +8 −2
  62. drivers/clk/mmp/clk-of-mmp2.c +1 −1
  63. drivers/clk/qcom/gcc-sdm845.c +7 −0
  64. drivers/clk/samsung/clk-exynos5420.c +8 −0
  65. drivers/clk/sunxi-ng/ccu-sun50i-h6-r.c +3 −13
  66. drivers/clk/sunxi-ng/ccu-sun8i-r.c +3 −18
  67. drivers/clk/sunxi-ng/ccu-sun8i-r40.c +4 −2
  68. drivers/clk/sunxi-ng/ccu-sun8i-v3s.c +2 −2
  69. drivers/clk/sunxi-ng/ccu-sun8i-v3s.h +0 −2
  70. drivers/clk/tegra/clk.c +3 −1
  71. drivers/clk/ti/clk-dra7-atl.c +0 −1
  72. drivers/cpuidle/governors/teo.c +1 −1
  73. drivers/crypto/hisilicon/sec2/sec.h +3 −3
  74. drivers/crypto/hisilicon/sec2/sec_crypto.c +6 −6
  75. drivers/crypto/hisilicon/sec2/sec_main.c +12 −2
  76. drivers/firmware/efi/earlycon.c +7 −9
  77. drivers/firmware/efi/libstub/random.c +3 −3
  78. drivers/gpio/Kconfig +0 −1
  79. drivers/gpio/gpio-thunderx.c +107 −56
  80. drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c +1 −1
  81. drivers/gpu/drm/amd/display/dc/core/dc_link.c +1 −1
  82. drivers/gpu/drm/drm_dp_mst_topology.c +36 −3
  83. drivers/gpu/drm/i915/gt/intel_context.c +37 −3
  84. drivers/gpu/drm/i915/gt/intel_lrc.c +8 −0
  85. drivers/gpu/drm/i915/i915_gem_gtt.c +2 −5
  86. drivers/gpu/drm/i915/i915_pmu.c +8 −3
  87. drivers/gpu/drm/i915/selftests/i915_random.h +1 −0
  88. drivers/gpu/drm/rockchip/cdn-dp-core.h +1 −1
  89. drivers/gpu/drm/virtio/virtgpu_plane.c +1 −0
  90. drivers/hwtracing/coresight/coresight-etm4x.c +6 −7
  91. drivers/i2c/busses/i2c-iop3xx.c +8 −4
  92. drivers/i2c/busses/i2c-tegra.c +28 −10
  93. drivers/iio/adc/ad7124.c +5 −7
  94. drivers/iio/chemical/Kconfig +1 −0
  95. drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c +2 −1
  96. drivers/iio/industrialio-buffer.c +5 −1
  97. drivers/iio/light/vcnl4000.c +2 −1
  98. drivers/irqchip/irq-ingenic.c +2 −4
  99. drivers/md/dm-snap-persistent.c +1 −1
  100. drivers/md/raid0.c +1 −1
  101. drivers/message/fusion/mptctl.c +50 −163
  102. drivers/misc/enclosure.c +1 −2
  103. drivers/misc/lkdtm/bugs.c +7 −5
  104. drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c +10 −1
  105. drivers/mtd/spi-nor/spi-nor.c +3 −3
  106. drivers/net/dsa/bcm_sf2.c +1 −1
  107. drivers/net/dsa/sja1105/sja1105_main.c +1 −1
  108. drivers/net/ethernet/broadcom/bcmsysport.c +4 −3
  109. drivers/net/ethernet/broadcom/bnxt/bnxt.c +20 −9
  110. drivers/net/ethernet/broadcom/bnxt/bnxt.h +1 −3
  111. drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c +3 −0
  112. drivers/net/ethernet/cadence/macb_main.c +17 −13
  113. drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +11 −3
  114. drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_matchall.c +67 −0
  115. drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_mqprio.c +27 −1
  116. drivers/net/ethernet/chelsio/cxgb4/sched.c +16 −0
  117. drivers/net/ethernet/chelsio/cxgb4/sched.h +2 −0
  118. drivers/net/ethernet/hisilicon/hns/hns_enet.c +1 −3
  119. drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +6 −0
  120. drivers/net/ethernet/intel/e1000e/e1000.h +2 −3
  121. drivers/net/ethernet/intel/e1000e/netdev.c +25 −29
  122. drivers/net/ethernet/intel/i40e/i40e_adminq.c +5 −0
  123. drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +18 −4
  124. drivers/net/ethernet/intel/iavf/iavf.h +2 −0
  125. drivers/net/ethernet/intel/iavf/iavf_main.c +13 −4
  126. drivers/net/ethernet/intel/iavf/iavf_virtchnl.c +3 −0
  127. drivers/net/ethernet/intel/igb/e1000_82575.c +2 −6
  128. drivers/net/ethernet/intel/igb/igb_ethtool.c +1 −1
  129. drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +27 −10
  130. drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +0 −5
  131. drivers/net/ethernet/marvell/mvneta.c +10 −9
  132. drivers/net/ethernet/mellanox/mlx4/crdump.c +1 −1
  133. drivers/net/ethernet/mellanox/mlxsw/spectrum.c +41 −13
  134. drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c +23 −7
  135. drivers/net/ethernet/mellanox/mlxsw/switchx2.c +6 −11
  136. drivers/net/ethernet/renesas/sh_eth.c +21 −17
  137. drivers/net/ethernet/socionext/sni_ave.c +13 −7
  138. drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c +36 −16
  139. drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c +4 −0
  140. drivers/net/hyperv/rndis_filter.c +0 −2
  141. drivers/net/macvlan.c +3 −2
  142. drivers/net/netdevsim/dev.c +1 −1
  143. drivers/net/phy/Kconfig +4 −4
  144. drivers/net/phy/dp83867.c +7 −1
  145. drivers/net/usb/lan78xx.c +1 −0
  146. drivers/net/usb/qmi_wwan.c +1 −0
  147. drivers/net/usb/r8152.c +3 −0
  148. drivers/net/wan/fsl_ucc_hdlc.c +1 −1
  149. drivers/net/wan/lapbether.c +1 −1
  150. drivers/nfc/pn533/usb.c +1 −1
  151. drivers/platform/chrome/wilco_ec/keyboard_leds.c +20 −8
  152. drivers/platform/mellanox/mlxbf-tmfifo.c +10 −9
  153. drivers/platform/x86/asus-wmi.c +1 −7
  154. drivers/platform/x86/gpd-pocket-fan.c +20 −7
  155. drivers/platform/x86/intel_ips.h +1 −1
  156. drivers/platform/x86/intel_pmc_core.h +1 −1
  157. drivers/platform/x86/intel_pmc_core_pltdrv.c +2 −0
  158. drivers/ptp/ptp_clock.c +2 −2
  159. drivers/s390/crypto/ap_bus.c +0 −2
  160. drivers/s390/crypto/ap_bus.h +1 −1
  161. drivers/s390/crypto/ap_queue.c +3 −2
  162. drivers/s390/crypto/zcrypt_ccamisc.c +2 −2
  163. drivers/s390/crypto/zcrypt_cex2a.c +1 −0
  164. drivers/s390/crypto/zcrypt_cex2c.c +2 −0
  165. drivers/s390/crypto/zcrypt_cex4.c +1 −0
  166. drivers/scsi/fnic/vnic_dev.c +10 −10
  167. drivers/scsi/sd.c +3 −1
  168. drivers/scsi/storvsc_drv.c +3 −1
  169. drivers/soc/amlogic/meson-ee-pwrc.c +15 −9
  170. drivers/soc/ti/wkup_m3_ipc.c +2 −2
  171. drivers/staging/comedi/drivers/ni_routes.c +6 −6
  172. drivers/tee/optee/shm_pool.c +14 −1
  173. drivers/usb/core/hub.c +1 −0
  174. drivers/usb/serial/ch341.c +5 −1
  175. drivers/usb/serial/io_edgeport.c +9 −7
  176. drivers/usb/serial/keyspan.c +4 −0
  177. drivers/usb/serial/opticon.c +1 −1
  178. drivers/usb/serial/option.c +6 −0
  179. drivers/usb/serial/quatech2.c +6 −0
  180. drivers/usb/serial/usb-serial-simple.c +2 −0
  181. drivers/usb/serial/usb-serial.c +3 −0
  182. fs/afs/dir.c +8 −10
  183. fs/btrfs/inode.c +39 −34
  184. fs/btrfs/ioctl.c +13 −1
  185. fs/btrfs/qgroup.c +5 −1
  186. fs/btrfs/relocation.c +46 −5
  187. fs/btrfs/root-tree.c +6 −4
  188. fs/btrfs/volumes.c +5 −1
  189. fs/fuse/file.c +3 −1
  190. fs/io-wq.c +8 −4
  191. fs/io_uring.c +48 −24
  192. fs/namei.c +13 −77
  193. fs/nfs/nfstrace.h +0 −2
  194. include/asm-generic/cacheflush.h +32 −1
  195. include/drm/drm_dp_mst_helper.h +6 −0
  196. include/dt-bindings/reset/amlogic,meson8b-reset.h +3 −3
  197. include/linux/blkdev.h +4 −4
  198. include/linux/mm.h +15 −3
  199. include/linux/mmzone.h +2 −3
  200. include/linux/namei.h +0 −1
  201. include/linux/sched.h +2 −2
  202. include/linux/skmsg.h +9 −4
  203. include/linux/tnum.h +1 −1
  204. include/net/cfg80211.h +5 −0
  205. include/net/devlink.h +1 −1
  206. include/net/tcp.h +4 −2
  207. include/trace/events/afs.h +3 −9
  208. include/trace/events/huge_memory.h +2 −1
  209. init/main.c +1 −0
  210. kernel/bpf/tnum.c +7 −2
  211. kernel/bpf/verifier.c +10 −3
  212. kernel/cpu.c +72 −71
  213. kernel/cred.c +2 −2
  214. kernel/events/core.c +3 −1
  215. kernel/futex.c +1 −0
  216. kernel/locking/lockdep.c +3 −4
  217. kernel/locking/rwsem.c +2 −2
  218. kernel/ptrace.c +10 −5
  219. kernel/rseq.c +2 −0
  220. kernel/time/posix-stubs.c +3 −0
  221. kernel/time/tick-sched.c +9 −5
  222. lib/vdso/gettimeofday.c +1 −0
  223. mm/huge_memory.c +24 −14
  224. mm/memcontrol.c +9 −28
  225. mm/mempolicy.c +7 −3
  226. mm/page-writeback.c +5 −5
  227. mm/page_alloc.c +18 −43
  228. mm/shmem.c +4 −3
  229. mm/slab.c +2 −2
  230. mm/slab_common.c +2 −1
  231. mm/slub.c +1 −1
  232. mm/sparse.c +8 −1
  233. mm/vmalloc.c +2 −2
  234. net/batman-adv/distributed-arp-table.c +3 −1
  235. net/core/dev.c +0 −12
  236. net/core/devlink.c +4 −4
  237. net/core/filter.c +10 −10
  238. net/core/skmsg.c +2 −0
  239. net/core/sock_map.c +6 −1
  240. net/dsa/tag_gswip.c +1 −1
  241. net/dsa/tag_qca.c +0 −3
  242. net/ipv4/fib_trie.c +6 −0
  243. net/ipv4/netfilter/arp_tables.c +10 −9
  244. net/ipv4/tcp_bpf.c +7 −10
  245. net/ipv4/tcp_input.c +4 −3
  246. net/ipv4/tcp_ulp.c +4 −2
  247. net/mac80211/cfg.c +23 −0
  248. net/mac80211/mesh_hwmp.c +3 −0
  249. net/mac80211/tkip.c +15 −3
  250. net/netfilter/ipset/ip_set_bitmap_gen.h +1 −1
  251. net/netfilter/nf_nat_proto.c +13 −0
  252. net/netfilter/nf_tables_api.c +26 −13
  253. net/netfilter/nft_tunnel.c +4 −1
  254. net/sched/act_ctinfo.c +11 −0
  255. net/sched/act_ife.c +3 −4
  256. net/sunrpc/xprtrdma/verbs.c +22 −7
  257. net/sunrpc/xprtrdma/xprt_rdma.h +2 −0
  258. net/tls/tls_main.c +7 −3
  259. net/tls/tls_sw.c +32 −9
  260. net/vmw_vsock/hyperv_transport.c +6 −59
  261. net/wireless/nl80211.c +3 −0
  262. net/wireless/rdev-ops.h +14 −0
  263. net/wireless/reg.c +32 −4
  264. net/wireless/sme.c +3 −3
  265. net/wireless/trace.h +5 −0
  266. net/wireless/util.c +1 −1
  267. net/wireless/wext-core.c +2 −1
  268. net/x25/af_x25.c +5 −1
  269. sound/core/seq/seq_timer.c +9 −5
  270. sound/firewire/dice/dice-extension.c +4 −1
  271. sound/firewire/tascam/amdtp-tascam.c +3 −2
  272. sound/pci/hda/hda_intel.c +8 −5
  273. sound/soc/codecs/cros_ec_codec.c +8 −0
  274. sound/soc/codecs/hdac_hda.c +3 −1
  275. sound/soc/codecs/msm8916-wcd-analog.c +15 −5
  276. sound/soc/codecs/msm8916-wcd-digital.c +6 −0
  277. sound/soc/codecs/rt5640.c +7 −0
  278. sound/soc/intel/boards/bytcht_es8316.c +2 −1
  279. sound/soc/soc-component.c +3 −0
  280. sound/soc/sof/intel/hda-codec.c +12 −7
  281. sound/soc/sof/intel/hda-loader.c +3 −3
  282. sound/soc/sti/uniperif_player.c +4 −3
  283. sound/soc/stm/stm32_adfsdm.c +6 −6
  284. sound/soc/stm/stm32_sai_sub.c +140 −54
  285. sound/usb/pcm.c +1 −1
  286. tools/bpf/bpftool/btf_dumper.c +1 −1
  287. tools/lib/traceevent/parse-filter.c +3 −1
  288. tools/perf/builtin-report.c +4 −1
  289. tools/perf/util/hist.h +2 −2
  290. tools/perf/util/symbol-elf.c +3 −0
  291. tools/testing/selftests/drivers/net/mlxsw/qos_mc_aware.sh +6 −2
.mailmap+1−0
@@ -99,6 +99,7 @@ Jacob Shin <Jacob.Shin@amd.com> · 98 unmodified lines
9999 Jaegeuk Kim <jaegeuk@kernel.org> <jaegeuk@google.com>
100100 Jaegeuk Kim <jaegeuk@kernel.org> <jaegeuk@motorola.com>
101101 Jaegeuk Kim <jaegeuk@kernel.org> <jaegeuk.kim@samsung.com>
102+Jakub Kicinski <kuba@kernel.org> <jakub.kicinski@netronome.com>
102103 James Bottomley <jejb@mulgrave.(none)>
103104 James Bottomley <jejb@titanic.il.steeleye.com>
104105 James E Wilson <wilson@specifix.com>
Documentation/ABI/stable/sysfs-driver-mlxreg-io+11−2
@@ -29,13 +29,13 @@ Description: This file shows the system fans direction: · 28 unmodified lines
2929
3030 The files are read only.
3131
32−What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/jtag_enable
32+What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/cpld3_version
3333
3434 Date: November 2018
3535 KernelVersion: 5.0
3636 Contact: Vadim Pasternak <vadimpmellanox.com>
3737 Description: These files show with which CPLD versions have been burned
38− on LED board.
38+ on LED or Gearbox board.
3939
4040 The files are read only.
4141
@@ -121,6 +121,15 @@ Description: These files show the system reset cause, as following: ComEx · 79 unmodified lines
121121
122122 The files are read only.
123123
124+What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/cpld4_version
125+Date: November 2018
126+KernelVersion: 5.0
127+Contact: Vadim Pasternak <vadimpmellanox.com>
128+Description: These files show with which CPLD versions have been burned
129+ on LED board.
130+
131+ The files are read only.
132+
124133 Date: June 2019
125134 KernelVersion: 5.3
126135 Contact: Vadim Pasternak <vadimpmellanox.com>
Documentation/admin-guide/devices.txt+1−1
@@ -319,7 +319,7 @@ · 318 unmodified lines
319319 182 = /dev/perfctr Performance-monitoring counters
320320 183 = /dev/hwrng Generic random number generator
321321 184 = /dev/cpu/microcode CPU microcode update interface
322− 186 = /dev/atomicps Atomic shapshot of process state data
322+ 186 = /dev/atomicps Atomic snapshot of process state data
323323 187 = /dev/irnet IrNET device
324324 188 = /dev/smbusbios SMBus BIOS
325325 189 = /dev/ussp_ctl User space serial port control
Documentation/media/v4l-drivers/meye.rst+1−1
@@ -95,7 +95,7 @@ so all video4linux tools (like xawtv) should work with this driver. · 94 unmodified lines
9595
9696 Besides the video4linux interface, the driver has a private interface
9797 for accessing the Motion Eye extended parameters (camera sharpness,
98−agc, video framerate), the shapshot and the MJPEG capture facilities.
98+agc, video framerate), the snapshot and the MJPEG capture facilities.
9999
100100 This interface consists of several ioctls (prototypes and structures
101101 can be found in include/linux/meye.h):
Documentation/process/embargoed-hardware-issues.rst+1−1
@@ -255,7 +255,7 @@ an involved disclosed party. The current ambassadors list: · 254 unmodified lines
255255 Red Hat Josh Poimboeuf <jpoimboe@redhat.com>
256256 SUSE Jiri Kosina <jkosina@suse.cz>
257257
258− Amazon
258+ Amazon Peter Bowen <pzb@amzn.com>
259259 Google Kees Cook <keescook@chromium.org>
260260 ============= ========================================================
261261
MAINTAINERS+10−10
@@ -720,7 +720,7 @@ F: Documentation/devicetree/bindings/i2c/i2c-altera.txt · 719 unmodified lines
720720 F: drivers/i2c/busses/i2c-altera.c
721721
722722 ALTERA MAILBOX DRIVER
723−M: Ley Foon Tan <lftan@altera.com>
723+M: Ley Foon Tan <ley.foon.tan@intel.com>
724724 L: nios2-dev@lists.rocketboards.org (moderated for non-subscribers)
725725 S: Maintained
726726 F: drivers/mailbox/mailbox-altera.c
@@ -1407,7 +1407,7 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc.git · 680 unmodified lines
14071407
14081408 ARM/ACTIONS SEMI ARCHITECTURE
14091409 M: Andreas Färber <afaerber@suse.de>
1410−R: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
1410+M: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
14111411 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
14121412 S: Maintained
14131413 N: owl
@@ -3150,7 +3150,7 @@ S: Maintained · 1736 unmodified lines
31503150 F: arch/mips/net/
31513151
31523152 BPF JIT for NFP NICs
3153−M: Jakub Kicinski <jakub.kicinski@netronome.com>
3153+M: Jakub Kicinski <kuba@kernel.org>
31543154 L: netdev@vger.kernel.org
31553155 L: bpf@vger.kernel.org
31563156 S: Supported
@@ -11431,7 +11431,7 @@ F: include/uapi/linux/netrom.h · 8274 unmodified lines
1143111431 F: net/netrom/
1143211432
1143311433 NETRONOME ETHERNET DRIVERS
11434−M: Jakub Kicinski <jakub.kicinski@netronome.com>
11434+M: Jakub Kicinski <kuba@kernel.org>
1143511435 L: oss-drivers@netronome.com
1143611436 S: Maintained
1143711437 F: drivers/net/ethernet/netronome/
@@ -11591,7 +11591,7 @@ M: Boris Pismenny <borisp@mellanox.com> · 153 unmodified lines
1159111591 M: Aviad Yehezkel <aviadye@mellanox.com>
1159211592 M: John Fastabend <john.fastabend@gmail.com>
1159311593 M: Daniel Borkmann <daniel@iogearbox.net>
11594−M: Jakub Kicinski <jakub.kicinski@netronome.com>
11594+M: Jakub Kicinski <kuba@kernel.org>
1159511595 L: netdev@vger.kernel.org
1159611596 S: Maintained
1159711597 F: net/tls/*
@@ -11603,7 +11603,7 @@ L: linux-wireless@vger.kernel.org · 5 unmodified lines
1160311603 Q: http://patchwork.kernel.org/project/linux-wireless/list/
1160411604
1160511605 NETDEVSIM
11606−M: Jakub Kicinski <jakub.kicinski@netronome.com>
11606+M: Jakub Kicinski <kuba@kernel.org>
1160711607 S: Maintained
1160811608 F: drivers/net/netdevsim/*
1160911609
@@ -11680,7 +11680,7 @@ F: Documentation/scsi/NinjaSCSI.txt · 70 unmodified lines
1168011680 F: drivers/scsi/nsp32*
1168111681
1168211682 NIOS2 ARCHITECTURE
11683−M: Ley Foon Tan <lftan@altera.com>
11683+M: Ley Foon Tan <ley.foon.tan@intel.com>
1168411684 L: nios2-dev@lists.rocketboards.org (moderated for non-subscribers)
1168511685 T: git git://git.kernel.org/pub/scm/linux/kernel/git/lftan/nios2.git
1168611686 S: Maintained
@@ -12564,7 +12564,7 @@ F: Documentation/devicetree/bindings/pci/aardvark-pci.txt · 877 unmodified lines
1256412564 F: drivers/pci/controller/pci-aardvark.c
1256512565
1256612566 PCI DRIVER FOR ALTERA PCIE IP
12567−M: Ley Foon Tan <lftan@altera.com>
12567+M: Ley Foon Tan <ley.foon.tan@intel.com>
1256812568 L: rfi@lists.rocketboards.org (moderated for non-subscribers)
1256912569 L: linux-pci@vger.kernel.org
1257012570 S: Supported
@@ -12743,7 +12743,7 @@ S: Supported · 172 unmodified lines
1274312743 F: Documentation/PCI/pci-error-recovery.rst
1274412744
1274512745 PCI MSI DRIVER FOR ALTERA MSI IP
12746−M: Ley Foon Tan <lftan@altera.com>
12746+M: Ley Foon Tan <ley.foon.tan@intel.com>
1274712747 L: rfi@lists.rocketboards.org (moderated for non-subscribers)
1274812748 L: linux-pci@vger.kernel.org
1274912749 S: Supported
@@ -18043,7 +18043,7 @@ XDP (eXpress Data Path) · 5293 unmodified lines
1804318043 M: Alexei Starovoitov <ast@kernel.org>
1804418044 M: Daniel Borkmann <daniel@iogearbox.net>
1804518045 M: David S. Miller <davem@davemloft.net>
18046−M: Jakub Kicinski <jakub.kicinski@netronome.com>
18046+M: Jakub Kicinski <kuba@kernel.org>
1804718047 M: Jesper Dangaard Brouer <hawk@kernel.org>
1804818048 M: John Fastabend <john.fastabend@gmail.com>
1804918049 L: netdev@vger.kernel.org
Makefile+1−1
@@ -2,7 +2,7 @@ · 1 unmodified line
22 VERSION = 5
33 PATCHLEVEL = 5
44 SUBLEVEL = 0
5−EXTRAVERSION = -rc6
5+EXTRAVERSION = -rc7
66 NAME = Kleptomaniac Octopus
77
88 # *DOCUMENTATION*
arch/arm/boot/dts/am571x-idk.dts+1−5
@@ -167,11 +167,7 @@ · 166 unmodified lines
167167
168168 &pcie1_rc {
169169 status = "okay";
170− gpios = <&gpio3 23 GPIO_ACTIVE_HIGH>;
171−};
172−
173−&pcie1_ep {
174− gpios = <&gpio3 23 GPIO_ACTIVE_HIGH>;
170+ gpios = <&gpio5 18 GPIO_ACTIVE_HIGH>;
175171 };
176172
177173 &mmc1 {
arch/arm/boot/dts/am572x-idk-common.dtsi+0−4
@@ -147,10 +147,6 @@ · 146 unmodified lines
147147 gpios = <&gpio3 23 GPIO_ACTIVE_HIGH>;
148148 };
149149
150−&pcie1_ep {
151− gpios = <&gpio3 23 GPIO_ACTIVE_HIGH>;
152−};
153−
154150 &mailbox5 {
155151 status = "okay";
156152 mbox_ipu1_ipc3x: mbox_ipu1_ipc3x {
arch/arm/boot/dts/am57xx-beagle-x15-common.dtsi+21−4
@@ -29,6 +29,27 @@ · 28 unmodified lines
2929 reg = <0x0 0x80000000 0x0 0x80000000>;
3030 };
3131
32+ main_12v0: fixedregulator-main_12v0 {
33+ /* main supply */
34+ compatible = "regulator-fixed";
35+ regulator-name = "main_12v0";
36+ regulator-min-microvolt = <12000000>;
37+ regulator-max-microvolt = <12000000>;
38+ regulator-always-on;
39+ regulator-boot-on;
40+ };
41+
42+ evm_5v0: fixedregulator-evm_5v0 {
43+ /* Output of TPS54531D */
44+ compatible = "regulator-fixed";
45+ regulator-name = "evm_5v0";
46+ regulator-min-microvolt = <5000000>;
47+ regulator-max-microvolt = <5000000>;
48+ vin-supply = <&main_12v0>;
49+ regulator-always-on;
50+ regulator-boot-on;
51+ };
52+
3253 vdd_3v3: fixedregulator-vdd_3v3 {
3354 compatible = "regulator-fixed";
3455 regulator-name = "vdd_3v3";
@@ -547,10 +568,6 @@ · 512 unmodified lines
547568 gpios = <&gpio2 8 GPIO_ACTIVE_LOW>;
548569 };
549570
550−&pcie1_ep {
551− gpios = <&gpio2 8 GPIO_ACTIVE_LOW>;
552−};
553−
554571 &mcasp3 {
555572 #sound-dai-cells = <0>;
556573 assigned-clocks = <&l4per2_clkctrl DRA7_L4PER2_MCASP3_CLKCTRL 24>;
arch/arm/boot/dts/aspeed-bmc-ibm-rainier.dts+2−367
@@ -258,9 +258,9 @@ · 257 unmodified lines
258258 };
259259 };
260260
261− pca0: pca9552@60 {
261+ pca0: pca9552@61 {
262262 compatible = "nxp,pca9552";
263− reg = <0x60>;
263+ reg = <0x61>;
264264 #address-cells = <1>;
265265 #size-cells = <0>;
266266
@@ -519,371 +519,6 @@ · 252 unmodified lines
519519 status = "okay";
520520 };
521521
522−&i2c13 {
523− status = "okay";
524−};
525−
526−&i2c14 {
527− status = "okay";
528−};
529−
530−&i2c15 {
531− status = "okay";
532−};
533−
534−&i2c0 {
535− status = "okay";
536−};
537−
538−&i2c1 {
539− status = "okay";
540−};
541−
542−&i2c2 {
543− status = "okay";
544−};
545−
546−&i2c3 {
547− status = "okay";
548−
549− power-supply@68 {
550− compatible = "ibm,cffps2";
551− reg = <0x68>;
552− };
553−
554− power-supply@69 {
555− compatible = "ibm,cffps2";
556− reg = <0x69>;
557− };
558−
559− power-supply@6a {
560− compatible = "ibm,cffps2";
561− reg = <0x6a>;
562− };
563−
564− power-supply@6b {
565− compatible = "ibm,cffps2";
566− reg = <0x6b>;
567− };
568−};
569−
570−&i2c4 {
571− status = "okay";
572−
573− tmp275@48 {
574− compatible = "ti,tmp275";
575− reg = <0x48>;
576− };
577−
578− tmp275@49 {
579− compatible = "ti,tmp275";
580− reg = <0x49>;
581− };
582−
583− tmp275@4a {
584− compatible = "ti,tmp275";
585− reg = <0x4a>;
586− };
587−};
588−
589−&i2c5 {
590− status = "okay";
591−
592− tmp275@48 {
593− compatible = "ti,tmp275";
594− reg = <0x48>;
595− };
596−
597− tmp275@49 {
598− compatible = "ti,tmp275";
599− reg = <0x49>;
600− };
601−};
602−
603−&i2c6 {
604− status = "okay";
605−
606− tmp275@48 {
607− compatible = "ti,tmp275";
608− reg = <0x48>;
609− };
610−
611− tmp275@4a {
612− compatible = "ti,tmp275";
613− reg = <0x4a>;
614− };
615−
616− tmp275@4b {
617− compatible = "ti,tmp275";
618− reg = <0x4b>;
619− };
620−};
621−
622−&i2c7 {
623− status = "okay";
624−
625− si7021-a20@20 {
626− compatible = "silabs,si7020";
627− reg = <0x20>;
628− };
629−
630− tmp275@48 {
631− compatible = "ti,tmp275";
632− reg = <0x48>;
633− };
634−
635− max31785@52 {
636− compatible = "maxim,max31785a";
637− reg = <0x52>;
638− #address-cells = <1>;
639− #size-cells = <0>;
640−
641− fan@0 {
642− compatible = "pmbus-fan";
643− reg = <0>;
644− tach-pulses = <2>;
645− };
646−
647− fan@1 {
648− compatible = "pmbus-fan";
649− reg = <1>;
650− tach-pulses = <2>;
651− };
652−
653− fan@2 {
654− compatible = "pmbus-fan";
655− reg = <2>;
656− tach-pulses = <2>;
657− };
658−
659− fan@3 {
660− compatible = "pmbus-fan";
661− reg = <3>;
662− tach-pulses = <2>;
663− };
664− };
665−
666− pca0: pca9552@60 {
667− compatible = "nxp,pca9552";
668− reg = <0x60>;
669− #address-cells = <1>;
670− #size-cells = <0>;
671−
672− gpio-controller;
673− #gpio-cells = <2>;
674−
675− gpio@0 {
676− reg = <0>;
677− };
678−
679− gpio@1 {
680− reg = <1>;
681− };
682−
683− gpio@2 {
684− reg = <2>;
685− };
686−
687− gpio@3 {
688− reg = <3>;
689− };
690−
691− gpio@4 {
692− reg = <4>;
693− };
694−
695− gpio@5 {
696− reg = <5>;
697− };
698−
699− gpio@6 {
700− reg = <6>;
701− };
702−
703− gpio@7 {
704− reg = <7>;
705− };
706−
707− gpio@8 {
708− reg = <8>;
709− };
710−
711− gpio@9 {
712− reg = <9>;
713− };
714−
715− gpio@10 {
716− reg = <10>;
717− };
718−
719− gpio@11 {
720− reg = <11>;
721− };
722−
723− gpio@12 {
724− reg = <12>;
725− };
726−
727− gpio@13 {
728− reg = <13>;
729− };
730−
731− gpio@14 {
732− reg = <14>;
733− };
734−
735− gpio@15 {
736− reg = <15>;
737− };
738− };
739−
740− dps: dps310@76 {
741− compatible = "infineon,dps310";
742− reg = <0x76>;
743− #io-channel-cells = <0>;
744− };
745−};
746−
747−&i2c8 {
748− status = "okay";
749−
750− ucd90320@b {
751− compatible = "ti,ucd90160";
752− reg = <0x0b>;
753− };
754−
755− ucd90320@c {
756− compatible = "ti,ucd90160";
757− reg = <0x0c>;
758− };
759−
760− ucd90320@11 {
761− compatible = "ti,ucd90160";
762− reg = <0x11>;
763− };
764−
765− rtc@32 {
766− compatible = "epson,rx8900";
767− reg = <0x32>;
768− };
769−
770− tmp275@48 {
771− compatible = "ti,tmp275";
772− reg = <0x48>;
773− };
774−
775− tmp275@4a {
776− compatible = "ti,tmp275";
777− reg = <0x4a>;
778− };
779−};
780−
781−&i2c9 {
782− status = "okay";
783−
784− ir35221@42 {
785− compatible = "infineon,ir35221";
786− reg = <0x42>;
787− };
788−
789− ir35221@43 {
790− compatible = "infineon,ir35221";
791− reg = <0x43>;
792− };
793−
794− ir35221@44 {
795− compatible = "infineon,ir35221";
796− reg = <0x44>;
797− };
798−
799− tmp423a@4c {
800− compatible = "ti,tmp423";
801− reg = <0x4c>;
802− };
803−
804− tmp423b@4d {
805− compatible = "ti,tmp423";
806− reg = <0x4d>;
807− };
808−
809− ir35221@72 {
810− compatible = "infineon,ir35221";
811− reg = <0x72>;
812− };
813−
814− ir35221@73 {
815− compatible = "infineon,ir35221";
816− reg = <0x73>;
817− };
818−
819− ir35221@74 {
820− compatible = "infineon,ir35221";
821− reg = <0x74>;
822− };
823−};
824−
825−&i2c10 {
826− status = "okay";
827−
828− ir35221@42 {
829− compatible = "infineon,ir35221";
830− reg = <0x42>;
831− };
832−
833− ir35221@43 {
834− compatible = "infineon,ir35221";
835− reg = <0x43>;
836− };
837−
838− ir35221@44 {
839− compatible = "infineon,ir35221";
840− reg = <0x44>;
841− };
842−
843− tmp423a@4c {
844− compatible = "ti,tmp423";
845− reg = <0x4c>;
846− };
847−
848− tmp423b@4d {
849− compatible = "ti,tmp423";
850− reg = <0x4d>;
851− };
852−
853− ir35221@72 {
854− compatible = "infineon,ir35221";
855− reg = <0x72>;
856− };
857−
858− ir35221@73 {
859− compatible = "infineon,ir35221";
860− reg = <0x73>;
861− };
862−
863− ir35221@74 {
864− compatible = "infineon,ir35221";
865− reg = <0x74>;
866− };
867−};
868−
869−&i2c11 {
870− status = "okay";
871−
872− tmp275@48 {
873− compatible = "ti,tmp275";
874− reg = <0x48>;
875− };
876−
877− tmp275@49 {
878− compatible = "ti,tmp275";
879− reg = <0x49>;
880− };
881−};
882−
883−&i2c12 {
884− status = "okay";
885−};
886−
887522 &i2c13 {
888523 status = "okay";
889524
arch/arm/boot/dts/aspeed-bmc-opp-tacoma.dts+5−398
@@ -122,37 +122,6 @@ · 121 unmodified lines
122122 };
123123 };
124124
125−&fmc {
126− status = "okay";
127− flash@0 {
128− status = "okay";
129− m25p,fast-read;
130− label = "bmc";
131− spi-max-frequency = <50000000>;
132−#include "openbmc-flash-layout-128.dtsi"
133− };
134−
135− flash@1 {
136− status = "okay";
137− m25p,fast-read;
138− label = "alt-bmc";
139− spi-max-frequency = <50000000>;
140− };
141−};
142−
143−&spi1 {
144− status = "okay";
145− pinctrl-names = "default";
146− pinctrl-0 = <&pinctrl_spi1_default>;
147−
148− flash@0 {
149− status = "okay";
150− m25p,fast-read;
151− label = "pnor";
152− spi-max-frequency = <100000000>;
153− };
154−};
155−
156125 &mac2 {
157126 status = "okay";
158127 pinctrl-names = "default";
@@ -165,6 +134,11 @@ · 6 unmodified lines
165134
166135 &emmc {
167136 status = "okay";
137+};
138+
139+&fsim0 {
140+ status = "okay";
141+
168142 #address-cells = <2>;
169143 #size-cells = <0>;
170144
@@ -820,373 +794,6 @@ · 649 unmodified lines
820794 status = "okay";
821795 };
822796
823−&i2c0 {
824− status = "okay";
825−};
826−
827−&i2c1 {
828− status = "okay";
829−};
830−
831−&i2c2 {
832− status = "okay";
833−};
834−
835−&i2c3 {
836− status = "okay";
837−
838− bmp: bmp280@77 {
839− compatible = "bosch,bmp280";
840− reg = <0x77>;
841− #io-channel-cells = <1>;
842− };
843−
844− max31785@52 {
845− compatible = "maxim,max31785a";
846− reg = <0x52>;
847− #address-cells = <1>;
848− #size-cells = <0>;
849−
850− fan@0 {
851− compatible = "pmbus-fan";
852− reg = <0>;
853− tach-pulses = <2>;
854− maxim,fan-rotor-input = "tach";
855− maxim,fan-pwm-freq = <25000>;
856− maxim,fan-dual-tach;
857− maxim,fan-no-watchdog;
858− maxim,fan-no-fault-ramp;
859− maxim,fan-ramp = <2>;
860− maxim,fan-fault-pin-mon;
861− };
862−
863− fan@1 {
864− compatible = "pmbus-fan";
865− reg = <1>;
866− tach-pulses = <2>;
867− maxim,fan-rotor-input = "tach";
868− maxim,fan-pwm-freq = <25000>;
869− maxim,fan-dual-tach;
870− maxim,fan-no-watchdog;
871− maxim,fan-no-fault-ramp;
872− maxim,fan-ramp = <2>;
873− maxim,fan-fault-pin-mon;
874− };
875−
876− fan@2 {
877− compatible = "pmbus-fan";
878− reg = <2>;
879− tach-pulses = <2>;
880− maxim,fan-rotor-input = "tach";
881− maxim,fan-pwm-freq = <25000>;
882− maxim,fan-dual-tach;
883− maxim,fan-no-watchdog;
884− maxim,fan-no-fault-ramp;
885− maxim,fan-ramp = <2>;
886− maxim,fan-fault-pin-mon;
887− };
888−
889− fan@3 {
890− compatible = "pmbus-fan";
891− reg = <3>;
892− tach-pulses = <2>;
893− maxim,fan-rotor-input = "tach";
894− maxim,fan-pwm-freq = <25000>;
895− maxim,fan-dual-tach;
896− maxim,fan-no-watchdog;
897− maxim,fan-no-fault-ramp;
898− maxim,fan-ramp = <2>;
899− maxim,fan-fault-pin-mon;
900− };
901− };
902−
903− dps: dps310@76 {
904− compatible = "infineon,dps310";
905− reg = <0x76>;
906− #io-channel-cells = <0>;
907− };
908−
909− pca0: pca9552@60 {
910− compatible = "nxp,pca9552";
911− reg = <0x60>;
912− #address-cells = <1>;
913− #size-cells = <0>;
914−
915− gpio-controller;
916− #gpio-cells = <2>;
917−
918− gpio@0 {
919− reg = <0>;
920− type = <PCA955X_TYPE_GPIO>;
921− };
922−
923− gpio@1 {
924− reg = <1>;
925− type = <PCA955X_TYPE_GPIO>;
926− };
927−
928− gpio@2 {
929− reg = <2>;
930− type = <PCA955X_TYPE_GPIO>;
931− };
932−
933− gpio@3 {
934− reg = <3>;
935− type = <PCA955X_TYPE_GPIO>;
936− };
937−
938− gpio@4 {
939− reg = <4>;
940− type = <PCA955X_TYPE_GPIO>;
941− };
942−
943− gpio@5 {
944− reg = <5>;
945− type = <PCA955X_TYPE_GPIO>;
946− };
947−
948− gpio@6 {
949− reg = <6>;
950− type = <PCA955X_TYPE_GPIO>;
951− };
952−
953− gpio@7 {
954− reg = <7>;
955− type = <PCA955X_TYPE_GPIO>;
956− };
957−
958− gpio@8 {
959− reg = <8>;
960− type = <PCA955X_TYPE_GPIO>;
961− };
962−
963− gpio@9 {
964− reg = <9>;
965− type = <PCA955X_TYPE_GPIO>;
966− };
967−
968− gpio@10 {
969− reg = <10>;
970− type = <PCA955X_TYPE_GPIO>;
971− };
972−
973− gpio@11 {
974− reg = <11>;
975− type = <PCA955X_TYPE_GPIO>;
976− };
977−
978− gpio@12 {
979− reg = <12>;
980− type = <PCA955X_TYPE_GPIO>;
981− };
982−
983− gpio@13 {
984− reg = <13>;
985− type = <PCA955X_TYPE_GPIO>;
986− };
987−
988− gpio@14 {
989− reg = <14>;
990− type = <PCA955X_TYPE_GPIO>;
991− };
992−
993− gpio@15 {
994− reg = <15>;
995− type = <PCA955X_TYPE_GPIO>;
996− };
997− };
998−
999− power-supply@68 {
1000− compatible = "ibm,cffps1";
1001− reg = <0x68>;
1002− };
1003−
1004− power-supply@69 {
1005− compatible = "ibm,cffps1";
1006− reg = <0x69>;
1007− };
1008−};
1009−
1010−&i2c4 {
1011− status = "okay";
1012−
1013− tmp423a@4c {
1014− compatible = "ti,tmp423";
1015− reg = <0x4c>;
1016− };
1017−
1018− ir35221@70 {
1019− compatible = "infineon,ir35221";
1020− reg = <0x70>;
1021− };
1022−
1023− ir35221@71 {
1024− compatible = "infineon,ir35221";
1025− reg = <0x71>;
1026− };
1027−};
1028−
1029−&i2c5 {
1030− status = "okay";
1031−
1032− tmp423a@4c {
1033− compatible = "ti,tmp423";
1034− reg = <0x4c>;
1035− };
1036−
1037− ir35221@70 {
1038− compatible = "infineon,ir35221";
1039− reg = <0x70>;
1040− };
1041−
1042− ir35221@71 {
1043− compatible = "infineon,ir35221";
1044− reg = <0x71>;
1045− };
1046−};
1047−
1048−&i2c7 {
1049− status = "okay";
1050−};
1051−
1052−&i2c9 {
1053− status = "okay";
1054−
1055− tmp275@4a {
1056− compatible = "ti,tmp275";
1057− reg = <0x4a>;
1058− };
1059−};
1060−
1061−&i2c10 {
1062− status = "okay";
1063−};
1064−
1065−&i2c11 {
1066− status = "okay";
1067−
1068− pca9552: pca9552@60 {
1069− compatible = "nxp,pca9552";
1070− reg = <0x60>;
1071− #address-cells = <1>;
1072− #size-cells = <0>;
1073− gpio-controller;
1074− #gpio-cells = <2>;
1075−
1076− gpio-line-names = "PS_SMBUS_RESET_N", "APSS_RESET_N",
1077− "GPU0_TH_OVERT_N_BUFF", "GPU1_TH_OVERT_N_BUFF",
1078− "GPU2_TH_OVERT_N_BUFF", "GPU3_TH_OVERT_N_BUFF",
1079− "GPU4_TH_OVERT_N_BUFF", "GPU5_TH_OVERT_N_BUFF",
1080− "GPU0_PWR_GOOD_BUFF", "GPU1_PWR_GOOD_BUFF",
1081− "GPU2_PWR_GOOD_BUFF", "GPU3_PWR_GOOD_BUFF",
1082− "GPU4_PWR_GOOD_BUFF", "GPU5_PWR_GOOD_BUFF",
1083− "12V_BREAKER_FLT_N", "THROTTLE_UNLATCHED_N";
1084−
1085− gpio@0 {
1086− reg = <0>;
1087− type = <PCA955X_TYPE_GPIO>;
1088− };
1089−
1090− gpio@1 {
1091− reg = <1>;
1092− type = <PCA955X_TYPE_GPIO>;
1093− };
1094−
1095− gpio@2 {
1096− reg = <2>;
1097− type = <PCA955X_TYPE_GPIO>;
1098− };
1099−
1100− gpio@3 {
1101− reg = <3>;
1102− type = <PCA955X_TYPE_GPIO>;
1103− };
1104−
1105− gpio@4 {
1106− reg = <4>;
1107− type = <PCA955X_TYPE_GPIO>;
1108− };
1109−
1110− gpio@5 {
1111− reg = <5>;
1112− type = <PCA955X_TYPE_GPIO>;
1113− };
1114−
1115− gpio@6 {
1116− reg = <6>;
1117− type = <PCA955X_TYPE_GPIO>;
1118− };
1119−
1120− gpio@7 {
1121− reg = <7>;
1122− type = <PCA955X_TYPE_GPIO>;
1123− };
1124−
1125− gpio@8 {
1126− reg = <8>;
1127− type = <PCA955X_TYPE_GPIO>;
1128− };
1129−
1130− gpio@9 {
1131− reg = <9>;
1132− type = <PCA955X_TYPE_GPIO>;
1133− };
1134−
1135− gpio@10 {
1136− reg = <10>;
1137− type = <PCA955X_TYPE_GPIO>;
1138− };
1139−
1140− gpio@11 {
1141− reg = <11>;
1142− type = <PCA955X_TYPE_GPIO>;
1143− };
1144−
1145− gpio@12 {
1146− reg = <12>;
1147− type = <PCA955X_TYPE_GPIO>;
1148− };
1149−
1150− gpio@13 {
1151− reg = <13>;
1152− type = <PCA955X_TYPE_GPIO>;
1153− };
1154−
1155− gpio@14 {
1156− reg = <14>;
1157− type = <PCA955X_TYPE_GPIO>;
1158− };
1159−
1160− gpio@15 {
1161− reg = <15>;
1162− type = <PCA955X_TYPE_GPIO>;
1163− };
1164− };
1165−
1166− rtc@32 {
1167− compatible = "epson,rx8900";
1168− reg = <0x32>;
1169− };
1170−
1171− eeprom@51 {
1172− compatible = "atmel,24c64";
1173− reg = <0x51>;
1174− };
1175−
1176− ucd90160@64 {
1177− compatible = "ti,ucd90160";
1178− reg = <0x64>;
1179− };
1180−};
1181−
1182−&i2c12 {
1183− status = "okay";
1184−};
1185−
1186−&i2c13 {
1187− status = "okay";
1188−};
1189−
1190797 &pinctrl {
1191798 /* Hog these as no driver is probed for the entire LPC block */
1192799 pinctrl-names = "default";
arch/arm/boot/dts/aspeed-g6.dtsi+19−20
@@ -163,26 +163,6 @@ · 162 unmodified lines
163163 spi-max-frequency = <50000000>;
164164 status = "disabled";
165165 };
166−
167− fsim0: fsi@1e79b000 {
168− compatible = "aspeed,ast2600-fsi-master", "fsi-master";
169− reg = <0x1e79b000 0x94>;
170− interrupts = <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>;
171− pinctrl-names = "default";
172− pinctrl-0 = <&pinctrl_fsi1_default>;
173− clocks = <&syscon ASPEED_CLK_GATE_FSICLK>;
174− status = "disabled";
175− };
176−
177− fsim1: fsi@1e79b100 {
178− compatible = "aspeed,ast2600-fsi-master", "fsi-master";
179− reg = <0x1e79b100 0x94>;
180− interrupts = <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>;
181− pinctrl-names = "default";
182− pinctrl-0 = <&pinctrl_fsi2_default>;
183− clocks = <&syscon ASPEED_CLK_GATE_FSICLK>;
184− status = "disabled";
185− };
186166 };
187167
188168 mdio0: mdio@1e650000 {
@@ -595,6 +575,25 @@ · 406 unmodified lines
595575 ranges = <0 0x1e78a000 0x1000>;
596576 };
597577
578+ fsim0: fsi@1e79b000 {
579+ compatible = "aspeed,ast2600-fsi-master", "fsi-master";
580+ reg = <0x1e79b000 0x94>;
581+ interrupts = <GIC_SPI 100 IRQ_TYPE_LEVEL_HIGH>;
582+ pinctrl-names = "default";
583+ pinctrl-0 = <&pinctrl_fsi1_default>;
584+ clocks = <&syscon ASPEED_CLK_GATE_FSICLK>;
585+ status = "disabled";
586+ };
587+
588+ fsim1: fsi@1e79b100 {
589+ compatible = "aspeed,ast2600-fsi-master", "fsi-master";
590+ reg = <0x1e79b100 0x94>;
591+ interrupts = <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>;
592+ pinctrl-names = "default";
593+ pinctrl-0 = <&pinctrl_fsi2_default>;
594+ clocks = <&syscon ASPEED_CLK_GATE_FSICLK>;
595+ status = "disabled";
596+ };
598597 };
599598 };
600599 };
arch/arm/boot/dts/imx6dl-icore-mipi.dts+1−1
@@ -8,7 +8,7 @@ · 7 unmodified lines
88 /dts-v1/;
99
1010 #include "imx6dl.dtsi"
11−#include "imx6qdl-icore.dtsi"
11+#include "imx6qdl-icore-1.5.dtsi"
1212
1313 / {
1414 model = "Engicam i.CoreM6 DualLite/Solo MIPI Starter Kit";
arch/arm/boot/dts/imx6q-dhcom-pdk2.dts+1−1
@@ -63,7 +63,7 @@ · 62 unmodified lines
6363 #sound-dai-cells = <0>;
6464 clocks = <&clk_ext_audio_codec>;
6565 VDDA-supply = <&reg_3p3v>;
66− VDDIO-supply = <&reg_3p3v>;
66+ VDDIO-supply = <&sw2_reg>;
6767 };
6868 };
6969
arch/arm/boot/dts/imx6q-dhcom-som.dtsi+1−1
@@ -204,7 +204,7 @@ · 203 unmodified lines
204204 };
205205
206206 rtc@56 {
207− compatible = "rv3029c2";
207+ compatible = "microcrystal,rv3029";
208208 pinctrl-names = "default";
209209 pinctrl-0 = <&pinctrl_rtc_hw300>;
210210 reg = <0x56>;
arch/arm/boot/dts/imx6qdl-sabresd.dtsi+0−4
@@ -749,10 +749,6 @@ · 748 unmodified lines
749749 vin-supply = <&vgen5_reg>;
750750 };
751751
752−&reg_vdd3p0 {
753− vin-supply = <&sw2_reg>;
754−};
755−
756752 &reg_vdd2p5 {
757753 vin-supply = <&vgen5_reg>;
758754 };
arch/arm/boot/dts/imx6sl-evk.dts+0−4
@@ -584,10 +584,6 @@ · 583 unmodified lines
584584 vin-supply = <&sw2_reg>;
585585 };
586586
587−&reg_vdd3p0 {
588− vin-supply = <&sw2_reg>;
589−};
590−
591587 &reg_vdd2p5 {
592588 vin-supply = <&sw2_reg>;
593589 };
arch/arm/boot/dts/imx6sll-evk.dts+0−4
@@ -265,10 +265,6 @@ · 264 unmodified lines
265265 status = "okay";
266266 };
267267
268−&reg_3p0 {
269− vin-supply = <&sw2_reg>;
270−};
271−
272268 &snvs_poweroff {
273269 status = "okay";
274270 };
arch/arm/boot/dts/imx6sx-sdb-reva.dts+0−4
@@ -159,10 +159,6 @@ · 158 unmodified lines
159159 vin-supply = <&vgen6_reg>;
160160 };
161161
162−&reg_vdd3p0 {
163− vin-supply = <&sw2_reg>;
164−};
165−
166162 &reg_vdd2p5 {
167163 vin-supply = <&vgen6_reg>;
168164 };
arch/arm/boot/dts/imx6sx-sdb.dts+0−4
@@ -141,10 +141,6 @@ · 140 unmodified lines
141141 vin-supply = <&vgen6_reg>;
142142 };
143143
144−&reg_vdd3p0 {
145− vin-supply = <&sw2_reg>;
146−};
147−
148144 &reg_vdd2p5 {
149145 vin-supply = <&vgen6_reg>;
150146 };
arch/arm/boot/dts/imx7s-colibri.dtsi+4−0
@@ -49,3 +49,7 @@ · 48 unmodified lines
4949 reg = <0x80000000 0x10000000>;
5050 };
5151 };
52+
53+&gpmi {
54+ status = "okay";
55+};
arch/arm/boot/dts/imx7ulp.dtsi+2−2
@@ -37,10 +37,10 @@ · 36 unmodified lines
3737 #address-cells = <1>;
3838 #size-cells = <0>;
3939
40− cpu0: cpu@0 {
40+ cpu0: cpu@f00 {
4141 compatible = "arm,cortex-a7";
4242 device_type = "cpu";
43− reg = <0>;
43+ reg = <0xf00>;
4444 };
4545 };
4646
arch/arm/boot/dts/meson8.dtsi+1−1
@@ -253,7 +253,7 @@ · 252 unmodified lines
253253 &aobus {
254254 pmu: pmu@e0 {
255255 compatible = "amlogic,meson8-pmu", "syscon";
256− reg = <0xe0 0x8>;
256+ reg = <0xe0 0x18>;
257257 };
258258
259259 pinctrl_aobus: pinctrl@84 {
arch/arm/boot/dts/mmp3.dtsi+6−6
@@ -356,7 +356,7 @@ · 355 unmodified lines
356356
357357 twsi1: i2c@d4011000 {
358358 compatible = "mrvl,mmp-twsi";
359− reg = <0xd4011000 0x1000>;
359+ reg = <0xd4011000 0x70>;
360360 interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>;
361361 clocks = <&soc_clocks MMP2_CLK_TWSI0>;
362362 resets = <&soc_clocks MMP2_CLK_TWSI0>;
@@ -368,7 +368,7 @@ · 5 unmodified lines
368368
369369 twsi2: i2c@d4031000 {
370370 compatible = "mrvl,mmp-twsi";
371− reg = <0xd4031000 0x1000>;
371+ reg = <0xd4031000 0x70>;
372372 interrupt-parent = <&twsi_mux>;
373373 interrupts = <0>;
374374 clocks = <&soc_clocks MMP2_CLK_TWSI1>;
@@ -380,7 +380,7 @@ · 5 unmodified lines
380380
381381 twsi3: i2c@d4032000 {
382382 compatible = "mrvl,mmp-twsi";
383− reg = <0xd4032000 0x1000>;
383+ reg = <0xd4032000 0x70>;
384384 interrupt-parent = <&twsi_mux>;
385385 interrupts = <1>;
386386 clocks = <&soc_clocks MMP2_CLK_TWSI2>;
@@ -392,7 +392,7 @@ · 5 unmodified lines
392392
393393 twsi4: i2c@d4033000 {
394394 compatible = "mrvl,mmp-twsi";
395− reg = <0xd4033000 0x1000>;
395+ reg = <0xd4033000 0x70>;
396396 interrupt-parent = <&twsi_mux>;
397397 interrupts = <2>;
398398 clocks = <&soc_clocks MMP2_CLK_TWSI3>;
@@ -405,7 +405,7 @@ · 6 unmodified lines
405405
406406 twsi5: i2c@d4033800 {
407407 compatible = "mrvl,mmp-twsi";
408− reg = <0xd4033800 0x1000>;
408+ reg = <0xd4033800 0x70>;
409409 interrupt-parent = <&twsi_mux>;
410410 interrupts = <3>;
411411 clocks = <&soc_clocks MMP2_CLK_TWSI4>;
@@ -417,7 +417,7 @@ · 5 unmodified lines
417417
418418 twsi6: i2c@d4034000 {
419419 compatible = "mrvl,mmp-twsi";
420− reg = <0xd4034000 0x1000>;
420+ reg = <0xd4034000 0x70>;
421421 interrupt-parent = <&twsi_mux>;
422422 interrupts = <4>;
423423 clocks = <&soc_clocks MMP2_CLK_TWSI5>;
arch/arm/boot/dts/sun8i-a83t-cubietruck-plus.dts+1−1
@@ -101,7 +101,7 @@ · 100 unmodified lines
101101 initial-mode = <1>; /* initialize in HUB mode */
102102 disabled-ports = <1>;
103103 intn-gpios = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */
104− reset-gpios = <&pio 4 16 GPIO_ACTIVE_HIGH>; /* PE16 */
104+ reset-gpios = <&pio 4 16 GPIO_ACTIVE_LOW>; /* PE16 */
105105 connect-gpios = <&pio 4 17 GPIO_ACTIVE_HIGH>; /* PE17 */
106106 refclk-frequency = <19200000>;
107107 };
arch/arm/mach-davinci/Kconfig+1−0
@@ -9,6 +9,7 @@ menuconfig ARCH_DAVINCI · 8 unmodified lines
99 select PM_GENERIC_DOMAINS if PM
1010 select PM_GENERIC_DOMAINS_OF if PM && OF
1111 select REGMAP_MMIO
12+ select RESET_CONTROLLER
1213 select HAVE_IDE
1314 select PINCTRL_SINGLE
1415
arch/arm/mach-mmp/time.c+1−1
@@ -207,7 +207,7 @@ static int __init mmp_dt_init_timer(struct device_node *np) · 206 unmodified lines
207207 ret = clk_prepare_enable(clk);
208208 if (ret)
209209 return ret;
210− rate = clk_get_rate(clk) / 2;
210+ rate = clk_get_rate(clk);
211211 } else if (cpu_is_pj4()) {
212212 rate = 6500000;
213213 } else {
arch/arm/mach-omap2/Kconfig+2−1
@@ -95,6 +95,7 @@ config ARCH_OMAP2PLUS · 94 unmodified lines
9595 bool
9696 select ARCH_HAS_BANDGAP
9797 select ARCH_HAS_HOLES_MEMORYMODEL
98+ select ARCH_HAS_RESET_CONTROLLER
9899 select ARCH_OMAP
99100 select CLKSRC_MMIO
100101 select GENERIC_IRQ_CHIP
@@ -105,11 +106,11 @@ config ARCH_OMAP2PLUS · 4 unmodified lines
105106 select OMAP_DM_TIMER
106107 select OMAP_GPMC
107108 select PINCTRL
109+ select RESET_CONTROLLER
108110 select SOC_BUS
109111 select TI_SYSC
110112 select OMAP_IRQCHIP
111113 select CLKSRC_TI_32K
112− select ARCH_HAS_RESET_CONTROLLER
113114 help
114115 Systems based on OMAP2, OMAP3, OMAP4 or OMAP5
115116
arch/arm/mach-omap2/pdata-quirks.c+5−1
@@ -306,10 +306,14 @@ static void __init dra7x_evm_mmc_quirk(void) · 305 unmodified lines
306306
307307 static struct clockdomain *ti_sysc_find_one_clockdomain(struct clk *clk)
308308 {
309+ struct clk_hw *hw = __clk_get_hw(clk);
309310 struct clockdomain *clkdm = NULL;
310311 struct clk_hw_omap *hwclk;
311312
312− hwclk = to_clk_hw_omap(__clk_get_hw(clk));
313+ hwclk = to_clk_hw_omap(hw);
314+ if (!omap2_clk_is_hw_omap(hw))
315+ return NULL;
316+
313317 if (hwclk && hwclk->clkdm_name)
314318 clkdm = clkdm_lookup(hwclk->clkdm_name);
315319
arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino-emmc.dts+1−1
@@ -15,7 +15,7 @@ · 14 unmodified lines
1515 pinctrl-names = "default";
1616 pinctrl-0 = <&mmc2_pins>;
1717 vmmc-supply = <&reg_dcdc1>;
18− vqmmc-supply = <&reg_dcdc1>;
18+ vqmmc-supply = <&reg_eldo1>;
1919 bus-width = <8>;
2020 non-removable;
2121 cap-mmc-hw-reset;
arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts+1−1
@@ -140,7 +140,7 @@ · 139 unmodified lines
140140 &mmc1 {
141141 pinctrl-names = "default";
142142 pinctrl-0 = <&mmc1_pins>;
143− vmmc-supply = <&reg_aldo2>;
143+ vmmc-supply = <&reg_dcdc1>;
144144 vqmmc-supply = <&reg_dldo4>;
145145 mmc-pwrseq = <&wifi_pwrseq>;
146146 bus-width = <4>;
arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi+4−4
@@ -61,10 +61,10 @@ · 60 unmodified lines
6161
6262 pmu {
6363 compatible = "arm,armv8-pmuv3";
64− interrupts = <0 120 8>,
65− <0 121 8>,
66− <0 122 8>,
67− <0 123 8>;
64+ interrupts = <0 170 4>,
65+ <0 171 4>,
66+ <0 172 4>,
67+ <0 173 4>;
6868 interrupt-affinity = <&cpu0>,
6969 <&cpu1>,
7070 <&cpu2>,
arch/arm64/boot/dts/amlogic/meson-sm1-sei610.dts+26−2
@@ -46,25 +46,47 @@ · 45 unmodified lines
4646 };
4747
4848 gpio-keys {
49− compatible = "gpio-keys-polled";
50− poll-interval = <100>;
49+ compatible = "gpio-keys";
5150
5251 key1 {
5352 label = "A";
5453 linux,code = <BTN_0>;
5554 gpios = <&gpio GPIOH_6 GPIO_ACTIVE_LOW>;
55+ interrupt-parent = <&gpio_intc>;
56+ interrupts = <34 IRQ_TYPE_EDGE_BOTH>;
5657 };
5758
5859 key2 {
5960 label = "B";
6061 linux,code = <BTN_1>;
6162 gpios = <&gpio GPIOH_7 GPIO_ACTIVE_LOW>;
63+ interrupt-parent = <&gpio_intc>;
64+ interrupts = <35 IRQ_TYPE_EDGE_BOTH>;
6265 };
6366
6467 key3 {
6568 label = "C";
6669 linux,code = <BTN_2>;
6770 gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_LOW>;
71+ interrupt-parent = <&gpio_intc>;
72+ interrupts = <2 IRQ_TYPE_EDGE_BOTH>;
73+ };
74+
75+ mic_mute {
76+ label = "MicMute";
77+ linux,code = <SW_MUTE_DEVICE>;
78+ linux,input-type = <EV_SW>;
79+ gpios = <&gpio_ao GPIOE_2 GPIO_ACTIVE_LOW>;
80+ interrupt-parent = <&gpio_intc>;
81+ interrupts = <99 IRQ_TYPE_EDGE_BOTH>;
82+ };
83+
84+ power_key {
85+ label = "PowerKey";
86+ linux,code = <KEY_POWER>;
87+ gpios = <&gpio_ao GPIOAO_3 GPIO_ACTIVE_LOW>;
88+ interrupt-parent = <&gpio_intc>;
89+ interrupts = <3 IRQ_TYPE_EDGE_BOTH>;
6890 };
6991 };
7092
@@ -569,6 +591,8 @@ · 498 unmodified lines
569591
570592 bluetooth {
571593 compatible = "brcm,bcm43438-bt";
594+ interrupt-parent = <&gpio_intc>;
595+ interrupts = <95 IRQ_TYPE_LEVEL_HIGH>;
572596 shutdown-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>;
573597 max-speed = <2000000>;
574598 clocks = <&wifi32k>;
arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi+1−1
@@ -175,7 +175,7 @@ · 174 unmodified lines
175175 dcfg: syscon@1e00000 {
176176 compatible = "fsl,ls1028a-dcfg", "syscon";
177177 reg = <0x0 0x1e00000 0x0 0x10000>;
178− big-endian;
178+ little-endian;
179179 };
180180
181181 rst: syscon@1e60000 {
arch/arm64/boot/dts/freescale/imx8mm.dtsi+1−1
@@ -740,7 +740,7 @@ · 739 unmodified lines
740740 reg = <0x30bd0000 0x10000>;
741741 interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>;
742742 clocks = <&clk IMX8MM_CLK_SDMA1_ROOT>,
743− <&clk IMX8MM_CLK_SDMA1_ROOT>;
743+ <&clk IMX8MM_CLK_AHB>;
744744 clock-names = "ipg", "ahb";
745745 #dma-cells = <3>;
746746 fsl,sdma-ram-script-name = "imx/sdma/sdma-imx7d.bin";
arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts+1−1
@@ -421,7 +421,7 @@ · 420 unmodified lines
421421 pinctrl-names = "default";
422422 pinctrl-0 = <&pinctrl_imu>;
423423 interrupt-parent = <&gpio3>;
424− interrupts = <19 IRQ_TYPE_LEVEL_LOW>;
424+ interrupts = <19 IRQ_TYPE_LEVEL_HIGH>;
425425 vdd-supply = <&reg_3v3_p>;
426426 vddio-supply = <&reg_3v3_p>;
427427 };
arch/arm64/boot/dts/intel/socfpga_agilex.dtsi+4−4
@@ -60,10 +60,10 @@ · 59 unmodified lines
6060
6161 pmu {
6262 compatible = "arm,armv8-pmuv3";
63− interrupts = <0 120 8>,
64− <0 121 8>,
65− <0 122 8>,
66− <0 123 8>;
63+ interrupts = <0 170 4>,
64+ <0 171 4>,
65+ <0 172 4>,
66+ <0 173 4>;
6767 interrupt-affinity = <&cpu0>,
6868 <&cpu1>,
6969 <&cpu2>,
arch/arm64/boot/dts/rockchip/rk3328-a1.dts+2−1
@@ -49,7 +49,8 @@ · 48 unmodified lines
4949
5050 ir-receiver {
5151 compatible = "gpio-ir-receiver";
52− gpios = <&gpio2 RK_PA2 GPIO_ACTIVE_HIGH>;
52+ gpios = <&gpio2 RK_PA2 GPIO_ACTIVE_LOW>;
53+ linux,rc-map-name = "rc-beelink-gs1";
5354 };
5455 };
5556
arch/nds32/include/asm/cacheflush.h+7−4
@@ -9,7 +9,11 @@ · 8 unmodified lines
99 #define PG_dcache_dirty PG_arch_1
1010
1111 void flush_icache_range(unsigned long start, unsigned long end);
12+#define flush_icache_range flush_icache_range
13+
1214 void flush_icache_page(struct vm_area_struct *vma, struct page *page);
15+#define flush_icache_page flush_icache_page
16+
1317 #ifdef CONFIG_CPU_CACHE_ALIASING
1418 void flush_cache_mm(struct mm_struct *mm);
1519 void flush_cache_dup_mm(struct mm_struct *mm);
@@ -40,12 +44,11 @@ void invalidate_kernel_vmap_range(void *addr, int size); · 24 unmodified lines
4044 #define flush_dcache_mmap_unlock(mapping) xa_unlock_irq(&(mapping)->i_pages)
4145
4246 #else
43−#include <asm-generic/cacheflush.h>
44−#undef flush_icache_range
45−#undef flush_icache_page
46−#undef flush_icache_user_range
4747 void flush_icache_user_range(struct vm_area_struct *vma, struct page *page,
4848 unsigned long addr, int len);
49+#define flush_icache_user_range flush_icache_user_range
50+
51+#include <asm-generic/cacheflush.h>
4952 #endif
5053
5154 #endif /* __NDS32_CACHEFLUSH_H__ */
arch/nds32/include/asm/pgtable.h+1−1
@@ -195,7 +195,7 @@ extern void paging_init(void); · 194 unmodified lines
195195 #define pte_unmap(pte) do { } while (0)
196196 #define pte_unmap_nested(pte) do { } while (0)
197197
198−#define pmd_off_k(address) pmd_offset(pgd_offset_k(address), address)
198+#define pmd_off_k(address) pmd_offset(pud_offset(p4d_offset(pgd_offset_k(address), (address)), (address)), (address))
199199
200200 #define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval)
201201 /*
arch/parisc/kernel/drivers.c+2−2
@@ -889,8 +889,8 @@ static void print_parisc_device(struct parisc_device *dev) · 888 unmodified lines
889889 static int count;
890890
891891 print_pa_hwpath(dev, hw_path);
892− pr_info("%d. %s at 0x%px [%s] { %d, 0x%x, 0x%.3x, 0x%.5x }",
893− ++count, dev->name, (void*) dev->hpa.start, hw_path, dev->id.hw_type,
892+ pr_info("%d. %s at %pap [%s] { %d, 0x%x, 0x%.3x, 0x%.5x }",
893+ ++count, dev->name, &(dev->hpa.start), hw_path, dev->id.hw_type,
894894 dev->id.hversion_rev, dev->id.hversion, dev->id.sversion);
895895
896896 if (dev->num_addrs) {
arch/parisc/mm/init.c+1−1
@@ -401,7 +401,7 @@ static void __init map_pages(unsigned long start_vaddr, · 400 unmodified lines
401401 pmd = (pmd_t *) __pa(pmd);
402402 }
403403
404− pgd_populate(NULL, pg_dir, __va(pmd));
404+ pud_populate(NULL, (pud_t *)pg_dir, __va(pmd));
405405 #endif
406406 pg_dir++;
407407
arch/riscv/include/asm/asm-prototypes.h+4−0
@@ -5,4 +5,8 @@ · 4 unmodified lines
55 #include <linux/ftrace.h>
66 #include <asm-generic/asm-prototypes.h>
77
8+long long __lshrti3(long long a, int b);
9+long long __ashrti3(long long a, int b);
10+long long __ashlti3(long long a, int b);
11+
812 #endif /* _ASM_RISCV_PROTOTYPES_H */
arch/riscv/kernel/head.S+10−6
@@ -80,7 +80,9 @@ _start_kernel: · 79 unmodified lines
8080
8181 #ifdef CONFIG_SMP
8282 li t0, CONFIG_NR_CPUS
83− bgeu a0, t0, .Lsecondary_park
83+ blt a0, t0, .Lgood_cores
84+ tail .Lsecondary_park
85+.Lgood_cores:
8486 #endif
8587
8688 /* Pick one hart to run the main boot sequence */
@@ -209,11 +211,6 @@ relocate: · 122 unmodified lines
209211 tail smp_callin
210212 #endif
211213
212−.align 2
213−.Lsecondary_park:
214− /* We lack SMP support or have too many harts, so park this hart */
215− wfi
216− j .Lsecondary_park
217214 END(_start)
218215
219216 #ifdef CONFIG_RISCV_M_MODE
@@ -295,6 +292,13 @@ ENTRY(reset_regs) · 75 unmodified lines
295292 END(reset_regs)
296293 #endif /* CONFIG_RISCV_M_MODE */
297294
295+.section ".text", "ax",@progbits
296+.align 2
297+.Lsecondary_park:
298+ /* We lack SMP support or have too many harts, so park this hart */
299+ wfi
300+ j .Lsecondary_park
301+
298302 __PAGE_ALIGNED_BSS
299303 /* Empty zero page */
300304 .balign PAGE_SIZE
arch/riscv/kernel/vdso/Makefile+2−1
@@ -58,7 +58,8 @@ quiet_cmd_vdsold = VDSOLD $@ · 57 unmodified lines
5858 cmd_vdsold = $(CC) $(KBUILD_CFLAGS) $(call cc-option, -no-pie) -nostdlib -nostartfiles $(SYSCFLAGS_$(@F)) \
5959 -Wl,-T,$(filter-out FORCE,$^) -o $@.tmp && \
6060 $(CROSS_COMPILE)objcopy \
61− $(patsubst %, -G __vdso_%, $(vdso-syms)) $@.tmp $@
61+ $(patsubst %, -G __vdso_%, $(vdso-syms)) $@.tmp $@ && \
62+ rm $@.tmp
6263
6364 # install commands for the unstripped file
6465 quiet_cmd_vdso_install = INSTALL $@
arch/riscv/lib/tishift.S+57−18
@@ -4,34 +4,73 @@ · 3 unmodified lines
44 */
55
66 #include <linux/linkage.h>
7+#include <asm-generic/export.h>
78
8−ENTRY(__lshrti3)
9+SYM_FUNC_START(__lshrti3)
910 beqz a2, .L1
1011 li a5,64
1112 sub a5,a5,a2
12− addi sp,sp,-16
1313 sext.w a4,a5
1414 blez a5, .L2
1515 sext.w a2,a2
16− sll a4,a1,a4
1716 srl a0,a0,a2
18− srl a1,a1,a2
17+ sll a4,a1,a4
18+ srl a2,a1,a2
1919 or a0,a0,a4
20− sd a1,8(sp)
21− sd a0,0(sp)
22− ld a0,0(sp)
23− ld a1,8(sp)
24− addi sp,sp,16
25− ret
20+ mv a1,a2
2621 .L1:
2722 ret
2823 .L2:
29− negw a4,a4
30− srl a1,a1,a4
31− sd a1,0(sp)
32− sd zero,8(sp)
33− ld a0,0(sp)
34− ld a1,8(sp)
35− addi sp,sp,16
24+ negw a0,a4
25+ li a2,0
26+ srl a0,a1,a0
27+ mv a1,a2
28+ ret
29+SYM_FUNC_END(__lshrti3)
30+EXPORT_SYMBOL(__lshrti3)
31+
32+SYM_FUNC_START(__ashrti3)
33+ beqz a2, .L3
34+ li a5,64
35+ sub a5,a5,a2
36+ sext.w a4,a5
37+ blez a5, .L4
38+ sext.w a2,a2
39+ srl a0,a0,a2
40+ sll a4,a1,a4
41+ sra a2,a1,a2
42+ or a0,a0,a4
43+ mv a1,a2
44+.L3:
45+ ret
46+.L4:
47+ negw a0,a4
48+ srai a2,a1,0x3f
49+ sra a0,a1,a0
50+ mv a1,a2
51+ ret
52+SYM_FUNC_END(__ashrti3)
53+EXPORT_SYMBOL(__ashrti3)
54+
55+SYM_FUNC_START(__ashlti3)
56+ beqz a2, .L5
57+ li a5,64
58+ sub a5,a5,a2
59+ sext.w a4,a5
60+ blez a5, .L6
61+ sext.w a2,a2
62+ sll a1,a1,a2
63+ srl a4,a0,a4
64+ sll a2,a0,a2
65+ or a1,a1,a4
66+ mv a0,a2
67+.L5:
68+ ret
69+.L6:
70+ negw a1,a4
71+ li a2,0
72+ sll a1,a0,a1
73+ mv a0,a2
3674 ret
37−ENDPROC(__lshrti3)
75+SYM_FUNC_END(__ashlti3)
76+EXPORT_SYMBOL(__ashlti3)
arch/s390/kernel/setup.c+1−1
@@ -1052,7 +1052,7 @@ static void __init log_component_list(void) · 1051 unmodified lines
10521052
10531053 if (!early_ipl_comp_list_addr)
10541054 return;
1055− if (ipl_block.hdr.flags & IPL_PL_FLAG_IPLSR)
1055+ if (ipl_block.hdr.flags & IPL_PL_FLAG_SIPL)
10561056 pr_info("Linux is running with Secure-IPL enabled\n");
10571057 else
10581058 pr_info("Linux is running with Secure-IPL disabled\n");
arch/x86/boot/compressed/head_64.S+5−0
@@ -244,6 +244,11 @@ SYM_FUNC_START(efi32_stub_entry) · 243 unmodified lines
244244 leal efi32_config(%ebp), %eax
245245 movl %eax, efi_config(%ebp)
246246
247+ /* Disable paging */
248+ movl %cr0, %eax
249+ btrl $X86_CR0_PG_BIT, %eax
250+ movl %eax, %cr0
251+
247252 jmp startup_32
248253 SYM_FUNC_END(efi32_stub_entry)
249254 #endif
arch/x86/events/intel/uncore_snb.c+6−0
@@ -15,6 +15,7 @@ · 14 unmodified lines
1515 #define PCI_DEVICE_ID_INTEL_SKL_HQ_IMC 0x1910
1616 #define PCI_DEVICE_ID_INTEL_SKL_SD_IMC 0x190f
1717 #define PCI_DEVICE_ID_INTEL_SKL_SQ_IMC 0x191f
18+#define PCI_DEVICE_ID_INTEL_SKL_E3_IMC 0x1918
1819 #define PCI_DEVICE_ID_INTEL_KBL_Y_IMC 0x590c
1920 #define PCI_DEVICE_ID_INTEL_KBL_U_IMC 0x5904
2021 #define PCI_DEVICE_ID_INTEL_KBL_UQ_IMC 0x5914
@@ -657,6 +658,10 @@ static const struct pci_device_id skl_uncore_pci_ids[] = { · 636 unmodified lines
657658 PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SKL_SQ_IMC),
658659 .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
659660 },
661+ { /* IMC */
662+ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SKL_E3_IMC),
663+ .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
664+ },
660665 { /* IMC */
661666 PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_KBL_Y_IMC),
662667 .driver_data = UNCORE_PCI_DEV_DATA(SNB_PCI_UNCORE_IMC, 0),
@@ -826,6 +831,7 @@ static const struct imc_uncore_pci_dev desktop_imc_pci_ids[] = { · 163 unmodified lines
826831 IMC_DEV(SKL_HQ_IMC, &skl_uncore_pci_driver), /* 6th Gen Core H Quad Core */
827832 IMC_DEV(SKL_SD_IMC, &skl_uncore_pci_driver), /* 6th Gen Core S Dual Core */
828833 IMC_DEV(SKL_SQ_IMC, &skl_uncore_pci_driver), /* 6th Gen Core S Quad Core */
834+ IMC_DEV(SKL_E3_IMC, &skl_uncore_pci_driver), /* Xeon E3 V5 Gen Core processor */
829835 IMC_DEV(KBL_Y_IMC, &skl_uncore_pci_driver), /* 7th Gen Core Y */
830836 IMC_DEV(KBL_U_IMC, &skl_uncore_pci_driver), /* 7th Gen Core U */
831837 IMC_DEV(KBL_UQ_IMC, &skl_uncore_pci_driver), /* 7th Gen Core U Quad Core */
arch/x86/events/intel/uncore_snbep.c+1−24
@@ -369,11 +369,6 @@ · 368 unmodified lines
369369 #define SNR_M2M_PCI_PMON_BOX_CTL 0x438
370370 #define SNR_M2M_PCI_PMON_UMASK_EXT 0xff
371371
372−/* SNR PCIE3 */
373−#define SNR_PCIE3_PCI_PMON_CTL0 0x508
374−#define SNR_PCIE3_PCI_PMON_CTR0 0x4e8
375−#define SNR_PCIE3_PCI_PMON_BOX_CTL 0x4e4
376−
377372 /* SNR IMC */
378373 #define SNR_IMC_MMIO_PMON_FIXED_CTL 0x54
379374 #define SNR_IMC_MMIO_PMON_FIXED_CTR 0x38
@@ -4328,27 +4323,12 @@ static struct intel_uncore_type snr_uncore_m2m = { · 3948 unmodified lines
43284323 .format_group = &snr_m2m_uncore_format_group,
43294324 };
43304325
4331−static struct intel_uncore_type snr_uncore_pcie3 = {
4332− .name = "pcie3",
4333− .num_counters = 4,
4334− .num_boxes = 1,
4335− .perf_ctr_bits = 48,
4336− .perf_ctr = SNR_PCIE3_PCI_PMON_CTR0,
4337− .event_ctl = SNR_PCIE3_PCI_PMON_CTL0,
4338− .event_mask = SNBEP_PMON_RAW_EVENT_MASK,
4339− .box_ctl = SNR_PCIE3_PCI_PMON_BOX_CTL,
4340− .ops = &ivbep_uncore_pci_ops,
4341− .format_group = &ivbep_uncore_format_group,
4342−};
4343−
43444326 enum {
43454327 SNR_PCI_UNCORE_M2M,
4346− SNR_PCI_UNCORE_PCIE3,
43474328 };
43484329
43494330 static struct intel_uncore_type *snr_pci_uncores[] = {
43504331 [SNR_PCI_UNCORE_M2M] = &snr_uncore_m2m,
4351− [SNR_PCI_UNCORE_PCIE3] = &snr_uncore_pcie3,
43524332 NULL,
43534333 };
43544334
@@ -4357,10 +4337,6 @@ static const struct pci_device_id snr_uncore_pci_ids[] = { · 2 unmodified lines
43574337 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x344a),
43584338 .driver_data = UNCORE_PCI_DEV_FULL_DATA(12, 0, SNR_PCI_UNCORE_M2M, 0),
43594339 },
4360− { /* PCIe3 */
4361− PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x334a),
4362− .driver_data = UNCORE_PCI_DEV_FULL_DATA(4, 0, SNR_PCI_UNCORE_PCIE3, 0),
4363− },
43644340 { /* end: all zeroes */ }
43654341 };
43664342
@@ -4536,6 +4512,7 @@ static struct uncore_event_desc snr_uncore_imc_freerunning_events[] = { · 169 unmodified lines
45364512 INTEL_UNCORE_EVENT_DESC(write, "event=0xff,umask=0x21"),
45374513 INTEL_UNCORE_EVENT_DESC(write.scale, "3.814697266e-6"),
45384514 INTEL_UNCORE_EVENT_DESC(write.unit, "MiB"),
4515+ { /* end: all zeroes */ },
45394516 };
45404517
45414518 static struct intel_uncore_ops snr_uncore_imc_freerunning_ops = {
arch/x86/kernel/cpu/amd.c+2−2
@@ -615,9 +615,9 @@ static void early_detect_mem_encrypt(struct cpuinfo_x86 *c) · 614 unmodified lines
615615 return;
616616
617617 clear_all:
618− clear_cpu_cap(c, X86_FEATURE_SME);
618+ setup_clear_cpu_cap(X86_FEATURE_SME);
619619 clear_sev:
620− clear_cpu_cap(c, X86_FEATURE_SEV);
620+ setup_clear_cpu_cap(X86_FEATURE_SEV);
621621 }
622622 }
623623
arch/x86/kernel/cpu/mce/therm_throt.c+5−4
@@ -467,6 +467,7 @@ static int thermal_throttle_online(unsigned int cpu) · 466 unmodified lines
467467 {
468468 struct thermal_state *state = &per_cpu(thermal_state, cpu);
469469 struct device *dev = get_cpu_device(cpu);
470+ u32 l;
470471
471472 state->package_throttle.level = PACKAGE_LEVEL;
472473 state->core_throttle.level = CORE_LEVEL;
@@ -474,6 +475,10 @@ static int thermal_throttle_online(unsigned int cpu) · 1 unmodified line
474475 INIT_DELAYED_WORK(&state->package_throttle.therm_work, throttle_active_work);
475476 INIT_DELAYED_WORK(&state->core_throttle.therm_work, throttle_active_work);
476477
478+ /* Unmask the thermal vector after the above workqueues are initialized. */
479+ l = apic_read(APIC_LVTTHMR);
480+ apic_write(APIC_LVTTHMR, l & ~APIC_LVT_MASKED);
481+
477482 return thermal_throttle_add_dev(dev, cpu);
478483 }
479484
@@ -722,10 +727,6 @@ void intel_init_thermal(struct cpuinfo_x86 *c) · 242 unmodified lines
722727 rdmsr(MSR_IA32_MISC_ENABLE, l, h);
723728 wrmsr(MSR_IA32_MISC_ENABLE, l | MSR_IA32_MISC_ENABLE_TM1, h);
724729
725− /* Unmask the thermal vector: */
726− l = apic_read(APIC_LVTTHMR);
727− apic_write(APIC_LVTTHMR, l & ~APIC_LVT_MASKED);
728−
729730 pr_info_once("CPU0: Thermal monitoring enabled (%s)\n",
730731 tm2 ? "TM2" : "TM1");
731732
arch/x86/kernel/cpu/resctrl/core.c+1−1
@@ -618,7 +618,7 @@ static void domain_remove_cpu(int cpu, struct rdt_resource *r) · 617 unmodified lines
618618 if (static_branch_unlikely(&rdt_mon_enable_key))
619619 rmdir_mondata_subdir_allrdtgrp(r, d->id);
620620 list_del(&d->list);
621− if (is_mbm_enabled())
621+ if (r->mon_capable && is_mbm_enabled())
622622 cancel_delayed_work(&d->mbm_over);
623623 if (is_llc_occupancy_enabled() && has_busy_rmid(r, d)) {
624624 /*
arch/x86/kernel/cpu/resctrl/rdtgroup.c+3−3
@@ -1741,9 +1741,6 @@ static int set_cache_qos_cfg(int level, bool enable) · 1740 unmodified lines
17411741 struct rdt_domain *d;
17421742 int cpu;
17431743
1744− if (!zalloc_cpumask_var(&cpu_mask, GFP_KERNEL))
1745− return -ENOMEM;
1746−
17471744 if (level == RDT_RESOURCE_L3)
17481745 update = l3_qos_cfg_update;
17491746 else if (level == RDT_RESOURCE_L2)
@@ -1751,6 +1748,9 @@ static int set_cache_qos_cfg(int level, bool enable) · 1 unmodified line
17511748 else
17521749 return -EINVAL;
17531750
1751+ if (!zalloc_cpumask_var(&cpu_mask, GFP_KERNEL))
1752+ return -ENOMEM;
1753+
17541754 r_l = &rdt_resources_all[level];
17551755 list_for_each_entry(d, &r_l->domains, list) {
17561756 /* Pick one CPU from each domain instance to update MSR */
block/blk-merge.c+7−2
@@ -164,8 +164,13 @@ static inline unsigned get_max_segment_size(const struct request_queue *q, · 163 unmodified lines
164164 unsigned long mask = queue_segment_boundary(q);
165165
166166 offset = mask & (page_to_phys(start_page) + offset);
167− return min_t(unsigned long, mask - offset + 1,
168− queue_max_segment_size(q));
167+
168+ /*
169+ * overflow may be triggered in case of zero page physical address
170+ * on 32bit arch, use queue's max segment size when that happens.
171+ */
172+ return min_not_zero(mask - offset + 1,
173+ (unsigned long)queue_max_segment_size(q));
169174 }
170175
171176 /**
block/blk-settings.c+1−1
@@ -328,7 +328,7 @@ EXPORT_SYMBOL(blk_queue_max_segment_size); · 327 unmodified lines
328328 * storage device can address. The default of 512 covers most
329329 * hardware.
330330 **/
331−void blk_queue_logical_block_size(struct request_queue *q, unsigned short size)
331+void blk_queue_logical_block_size(struct request_queue *q, unsigned int size)
332332 {
333333 q->limits.logical_block_size = size;
334334
drivers/base/firmware_loader/builtin/Makefile+1−1
@@ -17,7 +17,7 @@ PROGBITS = $(if $(CONFIG_ARM),%,@)progbits · 16 unmodified lines
1717 filechk_fwbin = \
1818 echo "/* Generated by $(src)/Makefile */" ;\
1919 echo " .section .rodata" ;\
20− echo " .p2align $(ASM_ALIGN)" ;\
20+ echo " .p2align 4" ;\
2121 echo "_fw_$(FWSTR)_bin:" ;\
2222 echo " .incbin \"$(fwdir)/$(FWNAME)\"" ;\
2323 echo "_fw_end:" ;\
drivers/block/null_blk_zoned.c+3−1
@@ -129,11 +129,13 @@ static blk_status_t null_zone_write(struct nullb_cmd *cmd, sector_t sector, · 128 unmodified lines
129129 return BLK_STS_IOERR;
130130 case BLK_ZONE_COND_EMPTY:
131131 case BLK_ZONE_COND_IMP_OPEN:
132+ case BLK_ZONE_COND_EXP_OPEN:
133+ case BLK_ZONE_COND_CLOSED:
132134 /* Writes must be at the write pointer position */
133135 if (sector != zone->wp)
134136 return BLK_STS_IOERR;
135137
136− if (zone->cond == BLK_ZONE_COND_EMPTY)
138+ if (zone->cond != BLK_ZONE_COND_EXP_OPEN)
137139 zone->cond = BLK_ZONE_COND_IMP_OPEN;
138140
139141 zone->wp += nr_sectors;
drivers/bus/ti-sysc.c+8−2
@@ -343,6 +343,12 @@ static int sysc_get_clocks(struct sysc *ddata) · 342 unmodified lines
343343 return -EINVAL;
344344 }
345345
346+ /* Always add a slot for main clocks fck and ick even if unused */
347+ if (!nr_fck)
348+ ddata->nr_clocks++;
349+ if (!nr_ick)
350+ ddata->nr_clocks++;
351+
346352 ddata->clocks = devm_kcalloc(ddata->dev,
347353 ddata->nr_clocks, sizeof(*ddata->clocks),
348354 GFP_KERNEL);
@@ -421,7 +427,7 @@ static int sysc_enable_opt_clocks(struct sysc *ddata) · 72 unmodified lines
421427 struct clk *clock;
422428 int i, error;
423429
424− if (!ddata->clocks)
430+ if (!ddata->clocks || ddata->nr_clocks < SYSC_OPTFCK0 + 1)
425431 return 0;
426432
427433 for (i = SYSC_OPTFCK0; i < SYSC_MAX_CLOCKS; i++) {
@@ -455,7 +461,7 @@ static void sysc_disable_opt_clocks(struct sysc *ddata) · 27 unmodified lines
455461 struct clk *clock;
456462 int i;
457463
458− if (!ddata->clocks)
464+ if (!ddata->clocks || ddata->nr_clocks < SYSC_OPTFCK0 + 1)
459465 return;
460466
461467 for (i = SYSC_OPTFCK0; i < SYSC_MAX_CLOCKS; i++) {
drivers/clk/clk.c+8−2
@@ -3426,11 +3426,17 @@ static int __clk_core_init(struct clk_core *core) · 3425 unmodified lines
34263426 if (core->flags & CLK_IS_CRITICAL) {
34273427 unsigned long flags;
34283428
3429− clk_core_prepare(core);
3429+ ret = clk_core_prepare(core);
3430+ if (ret)
3431+ goto out;
34303432
34313433 flags = clk_enable_lock();
3432− clk_core_enable(core);
3434+ ret = clk_core_enable(core);
34333435 clk_enable_unlock(flags);
3436+ if (ret) {
3437+ clk_core_unprepare(core);
3438+ goto out;
3439+ }
34343440 }
34353441
34363442 clk_core_reparent_orphans_nolock();
drivers/clk/mmp/clk-of-mmp2.c+1−1
@@ -134,7 +134,7 @@ static DEFINE_SPINLOCK(ssp3_lock); · 133 unmodified lines
134134 static const char *ssp_parent_names[] = {"vctcxo_4", "vctcxo_2", "vctcxo", "pll1_16"};
135135
136136 static DEFINE_SPINLOCK(timer_lock);
137−static const char *timer_parent_names[] = {"clk32", "vctcxo_2", "vctcxo_4", "vctcxo"};
137+static const char *timer_parent_names[] = {"clk32", "vctcxo_4", "vctcxo_2", "vctcxo"};
138138
139139 static DEFINE_SPINLOCK(reset_lock);
140140
drivers/clk/qcom/gcc-sdm845.c+7−0
@@ -3255,6 +3255,7 @@ static struct gdsc hlos1_vote_aggre_noc_mmu_audio_tbu_gdsc = { · 3254 unmodified lines
32553255 .name = "hlos1_vote_aggre_noc_mmu_audio_tbu_gdsc",
32563256 },
32573257 .pwrsts = PWRSTS_OFF_ON,
3258+ .flags = VOTABLE,
32583259 };
32593260
32603261 static struct gdsc hlos1_vote_aggre_noc_mmu_pcie_tbu_gdsc = {
@@ -3263,6 +3264,7 @@ static struct gdsc hlos1_vote_aggre_noc_mmu_pcie_tbu_gdsc = { · 2 unmodified lines
32633264 .name = "hlos1_vote_aggre_noc_mmu_pcie_tbu_gdsc",
32643265 },
32653266 .pwrsts = PWRSTS_OFF_ON,
3267+ .flags = VOTABLE,
32663268 };
32673269
32683270 static struct gdsc hlos1_vote_aggre_noc_mmu_tbu1_gdsc = {
@@ -3271,6 +3273,7 @@ static struct gdsc hlos1_vote_aggre_noc_mmu_tbu1_gdsc = { · 2 unmodified lines
32713273 .name = "hlos1_vote_aggre_noc_mmu_tbu1_gdsc",
32723274 },
32733275 .pwrsts = PWRSTS_OFF_ON,
3276+ .flags = VOTABLE,
32743277 };
32753278
32763279 static struct gdsc hlos1_vote_aggre_noc_mmu_tbu2_gdsc = {
@@ -3279,6 +3282,7 @@ static struct gdsc hlos1_vote_aggre_noc_mmu_tbu2_gdsc = { · 2 unmodified lines
32793282 .name = "hlos1_vote_aggre_noc_mmu_tbu2_gdsc",
32803283 },
32813284 .pwrsts = PWRSTS_OFF_ON,
3285+ .flags = VOTABLE,
32823286 };
32833287
32843288 static struct gdsc hlos1_vote_mmnoc_mmu_tbu_hf0_gdsc = {
@@ -3287,6 +3291,7 @@ static struct gdsc hlos1_vote_mmnoc_mmu_tbu_hf0_gdsc = { · 2 unmodified lines
32873291 .name = "hlos1_vote_mmnoc_mmu_tbu_hf0_gdsc",
32883292 },
32893293 .pwrsts = PWRSTS_OFF_ON,
3294+ .flags = VOTABLE,
32903295 };
32913296
32923297 static struct gdsc hlos1_vote_mmnoc_mmu_tbu_hf1_gdsc = {
@@ -3295,6 +3300,7 @@ static struct gdsc hlos1_vote_mmnoc_mmu_tbu_hf1_gdsc = { · 2 unmodified lines
32953300 .name = "hlos1_vote_mmnoc_mmu_tbu_hf1_gdsc",
32963301 },
32973302 .pwrsts = PWRSTS_OFF_ON,
3303+ .flags = VOTABLE,
32983304 };
32993305
33003306 static struct gdsc hlos1_vote_mmnoc_mmu_tbu_sf_gdsc = {
@@ -3303,6 +3309,7 @@ static struct gdsc hlos1_vote_mmnoc_mmu_tbu_sf_gdsc = { · 2 unmodified lines
33033309 .name = "hlos1_vote_mmnoc_mmu_tbu_sf_gdsc",
33043310 },
33053311 .pwrsts = PWRSTS_OFF_ON,
3312+ .flags = VOTABLE,
33063313 };
33073314
33083315 static struct clk_regmap *gcc_sdm845_clocks[] = {
drivers/clk/samsung/clk-exynos5420.c+8−0
@@ -12,6 +12,7 @@ · 11 unmodified lines
1212 #include <linux/clk-provider.h>
1313 #include <linux/of.h>
1414 #include <linux/of_address.h>
15+#include <linux/clk.h>
1516
1617 #include "clk.h"
1718 #include "clk-cpu.h"
@@ -1646,6 +1647,13 @@ static void __init exynos5x_clk_init(struct device_node *np, · 1628 unmodified lines
16461647 exynos5x_subcmus);
16471648 }
16481649
1650+ /*
1651+ * Keep top part of G3D clock path enabled permanently to ensure
1652+ * that the internal busses get their clock regardless of the
1653+ * main G3D clock enablement status.
1654+ */
1655+ clk_prepare_enable(__clk_lookup("mout_sw_aclk_g3d"));
1656+
16491657 samsung_clk_of_add_provider(np, ctx);
16501658 }
16511659
drivers/clk/sunxi-ng/ccu-sun50i-h6-r.c+3−13
@@ -23,9 +23,9 @@ · 22 unmodified lines
2323 */
2424
2525 static const char * const ar100_r_apb2_parents[] = { "osc24M", "osc32k",
26− "pll-periph0", "iosc" };
26+ "iosc", "pll-periph0" };
2727 static const struct ccu_mux_var_prediv ar100_r_apb2_predivs[] = {
28− { .index = 2, .shift = 0, .width = 5 },
28+ { .index = 3, .shift = 0, .width = 5 },
2929 };
3030
3131 static struct ccu_div ar100_clk = {
@@ -51,17 +51,7 @@ static struct ccu_div ar100_clk = { · 19 unmodified lines
5151
5252 static CLK_FIXED_FACTOR_HW(r_ahb_clk, "r-ahb", &ar100_clk.common.hw, 1, 1, 0);
5353
54−static struct ccu_div r_apb1_clk = {
55− .div = _SUNXI_CCU_DIV(0, 2),
56−
57− .common = {
58− .reg = 0x00c,
59− .hw.init = CLK_HW_INIT("r-apb1",
60− "r-ahb",
61− &ccu_div_ops,
62− 0),
63− },
64−};
54+static SUNXI_CCU_M(r_apb1_clk, "r-apb1", "r-ahb", 0x00c, 0, 2, 0);
6555
6656 static struct ccu_div r_apb2_clk = {
6757 .div = _SUNXI_CCU_DIV_FLAGS(8, 2, CLK_DIVIDER_POWER_OF_TWO),
drivers/clk/sunxi-ng/ccu-sun8i-r.c+3−18
@@ -51,19 +51,7 @@ static struct ccu_div ar100_clk = { · 50 unmodified lines
5151
5252 static CLK_FIXED_FACTOR_HW(ahb0_clk, "ahb0", &ar100_clk.common.hw, 1, 1, 0);
5353
54−static struct ccu_div apb0_clk = {
55− .div = _SUNXI_CCU_DIV_FLAGS(0, 2, CLK_DIVIDER_POWER_OF_TWO),
56−
57− .common = {
58− .reg = 0x0c,
59− .hw.init = CLK_HW_INIT_HW("apb0",
60− &ahb0_clk.hw,
61− &ccu_div_ops,
62− 0),
63− },
64−};
65−
66−static SUNXI_CCU_M(a83t_apb0_clk, "apb0", "ahb0", 0x0c, 0, 2, 0);
54+static SUNXI_CCU_M(apb0_clk, "apb0", "ahb0", 0x0c, 0, 2, 0);
6755
6856 /*
6957 * Define the parent as an array that can be reused to save space
@@ -127,7 +115,7 @@ static struct ccu_mp a83t_ir_clk = { · 57 unmodified lines
127115
128116 static struct ccu_common *sun8i_a83t_r_ccu_clks[] = {
129117 &ar100_clk.common,
130− &a83t_apb0_clk.common,
118+ &apb0_clk.common,
131119 &apb0_pio_clk.common,
132120 &apb0_ir_clk.common,
133121 &apb0_timer_clk.common,
@@ -167,7 +155,7 @@ static struct clk_hw_onecell_data sun8i_a83t_r_hw_clks = { · 33 unmodified lines
167155 .hws = {
168156 [CLK_AR100] = &ar100_clk.common.hw,
169157 [CLK_AHB0] = &ahb0_clk.hw,
170− [CLK_APB0] = &a83t_apb0_clk.common.hw,
158+ [CLK_APB0] = &apb0_clk.common.hw,
171159 [CLK_APB0_PIO] = &apb0_pio_clk.common.hw,
172160 [CLK_APB0_IR] = &apb0_ir_clk.common.hw,
173161 [CLK_APB0_TIMER] = &apb0_timer_clk.common.hw,
@@ -282,9 +270,6 @@ static void __init sunxi_r_ccu_init(struct device_node *node, · 108 unmodified lines
282270
283271 static void __init sun8i_a83t_r_ccu_setup(struct device_node *node)
284272 {
285− /* Fix apb0 bus gate parents here */
286− apb0_gate_parent[0] = &a83t_apb0_clk.common.hw;
287−
288273 sunxi_r_ccu_init(node, &sun8i_a83t_r_ccu_desc);
289274 }
290275 CLK_OF_DECLARE(sun8i_a83t_r_ccu, "allwinner,sun8i-a83t-r-ccu",
drivers/clk/sunxi-ng/ccu-sun8i-r40.c+4−2
@@ -761,7 +761,8 @@ static struct ccu_mp outa_clk = { · 760 unmodified lines
761761 .reg = 0x1f0,
762762 .features = CCU_FEATURE_FIXED_PREDIV,
763763 .hw.init = CLK_HW_INIT_PARENTS("outa", out_parents,
764− &ccu_mp_ops, 0),
764+ &ccu_mp_ops,
765+ CLK_SET_RATE_PARENT),
765766 }
766767 };
767768
@@ -779,7 +780,8 @@ static struct ccu_mp outb_clk = { · 11 unmodified lines
779780 .reg = 0x1f4,
780781 .features = CCU_FEATURE_FIXED_PREDIV,
781782 .hw.init = CLK_HW_INIT_PARENTS("outb", out_parents,
782− &ccu_mp_ops, 0),
783+ &ccu_mp_ops,
784+ CLK_SET_RATE_PARENT),
783785 }
784786 };
785787
drivers/clk/sunxi-ng/ccu-sun8i-v3s.c+2−2
@@ -618,7 +618,7 @@ static struct clk_hw_onecell_data sun8i_v3s_hw_clks = { · 617 unmodified lines
618618 [CLK_MBUS] = &mbus_clk.common.hw,
619619 [CLK_MIPI_CSI] = &mipi_csi_clk.common.hw,
620620 },
621− .num = CLK_NUMBER,
621+ .num = CLK_PLL_DDR1 + 1,
622622 };
623623
624624 static struct clk_hw_onecell_data sun8i_v3_hw_clks = {
@@ -700,7 +700,7 @@ static struct clk_hw_onecell_data sun8i_v3_hw_clks = { · 75 unmodified lines
700700 [CLK_MBUS] = &mbus_clk.common.hw,
701701 [CLK_MIPI_CSI] = &mipi_csi_clk.common.hw,
702702 },
703− .num = CLK_NUMBER,
703+ .num = CLK_I2S0 + 1,
704704 };
705705
706706 static struct ccu_reset_map sun8i_v3s_ccu_resets[] = {
drivers/clk/sunxi-ng/ccu-sun8i-v3s.h+0−2
@@ -51,6 +51,4 @@ · 50 unmodified lines
5151
5252 #define CLK_PLL_DDR1 74
5353
54−#define CLK_NUMBER (CLK_I2S0 + 1)
55−
5654 #endif /* _CCU_SUN8I_H3_H_ */
drivers/clk/tegra/clk.c+3−1
@@ -231,8 +231,10 @@ struct clk ** __init tegra_clk_init(void __iomem *regs, int num, int banks) · 230 unmodified lines
231231 periph_banks = banks;
232232
233233 clks = kcalloc(num, sizeof(struct clk *), GFP_KERNEL);
234− if (!clks)
234+ if (!clks) {
235235 kfree(periph_clk_enb_refcnt);
236+ return NULL;
237+ }
236238
237239 clk_num = num;
238240
drivers/clk/ti/clk-dra7-atl.c+0−1
@@ -233,7 +233,6 @@ static int of_dra7_atl_clk_probe(struct platform_device *pdev) · 232 unmodified lines
233233 cinfo->iobase = of_iomap(node, 0);
234234 cinfo->dev = &pdev->dev;
235235 pm_runtime_enable(cinfo->dev);
236− pm_runtime_irq_safe(cinfo->dev);
237236
238237 pm_runtime_get_sync(cinfo->dev);
239238 atl_write(cinfo, DRA7_ATL_PCLKMUX_REG(0), DRA7_ATL_PCLKMUX);
drivers/cpuidle/governors/teo.c+1−1
@@ -198,7 +198,7 @@ static void teo_update(struct cpuidle_driver *drv, struct cpuidle_device *dev) · 197 unmodified lines
198198 * pattern detection.
199199 */
200200 cpu_data->intervals[cpu_data->interval_idx++] = measured_ns;
201− if (cpu_data->interval_idx > INTERVALS)
201+ if (cpu_data->interval_idx >= INTERVALS)
202202 cpu_data->interval_idx = 0;
203203 }
204204
drivers/crypto/hisilicon/sec2/sec.h+3−3
@@ -40,7 +40,7 @@ struct sec_req { · 39 unmodified lines
4040 int req_id;
4141
4242 /* Status of the SEC request */
43− int fake_busy;
43+ atomic_t fake_busy;
4444 };
4545
4646 /**
@@ -132,8 +132,8 @@ struct sec_debug_file { · 85 unmodified lines
132132 };
133133
134134 struct sec_dfx {
135− u64 send_cnt;
136− u64 recv_cnt;
135+ atomic64_t send_cnt;
136+ atomic64_t recv_cnt;
137137 };
138138
139139 struct sec_debug {
drivers/crypto/hisilicon/sec2/sec_crypto.c+6−6
@@ -120,7 +120,7 @@ static void sec_req_cb(struct hisi_qp *qp, void *resp) · 119 unmodified lines
120120 return;
121121 }
122122
123− __sync_add_and_fetch(&req->ctx->sec->debug.dfx.recv_cnt, 1);
123+ atomic64_inc(&req->ctx->sec->debug.dfx.recv_cnt);
124124
125125 req->ctx->req_op->buf_unmap(req->ctx, req);
126126
@@ -135,13 +135,13 @@ static int sec_bd_send(struct sec_ctx *ctx, struct sec_req *req) · 8 unmodified lines
135135 mutex_lock(&qp_ctx->req_lock);
136136 ret = hisi_qp_send(qp_ctx->qp, &req->sec_sqe);
137137 mutex_unlock(&qp_ctx->req_lock);
138− __sync_add_and_fetch(&ctx->sec->debug.dfx.send_cnt, 1);
138+ atomic64_inc(&ctx->sec->debug.dfx.send_cnt);
139139
140140 if (ret == -EBUSY)
141141 return -ENOBUFS;
142142
143143 if (!ret) {
144− if (req->fake_busy)
144+ if (atomic_read(&req->fake_busy))
145145 ret = -EBUSY;
146146 else
147147 ret = -EINPROGRESS;
@@ -641,7 +641,7 @@ static void sec_skcipher_callback(struct sec_ctx *ctx, struct sec_req *req) · 493 unmodified lines
641641 if (ctx->c_ctx.c_mode == SEC_CMODE_CBC && req->c_req.encrypt)
642642 sec_update_iv(req);
643643
644− if (__sync_bool_compare_and_swap(&req->fake_busy, 1, 0))
644+ if (atomic_cmpxchg(&req->fake_busy, 1, 0) != 1)
645645 sk_req->base.complete(&sk_req->base, -EINPROGRESS);
646646
647647 sk_req->base.complete(&sk_req->base, req->err_type);
@@ -672,9 +672,9 @@ static int sec_request_init(struct sec_ctx *ctx, struct sec_req *req) · 24 unmodified lines
672672 }
673673
674674 if (ctx->fake_req_limit <= atomic_inc_return(&qp_ctx->pending_reqs))
675− req->fake_busy = 1;
675+ atomic_set(&req->fake_busy, 1);
676676 else
677− req->fake_busy = 0;
677+ atomic_set(&req->fake_busy, 0);
678678
679679 ret = ctx->req_op->get_res(ctx, req);
680680 if (ret) {
drivers/crypto/hisilicon/sec2/sec_main.c+12−2
@@ -608,6 +608,14 @@ static const struct file_operations sec_dbg_fops = { · 607 unmodified lines
608608 .write = sec_debug_write,
609609 };
610610
611+static int debugfs_atomic64_t_get(void *data, u64 *val)
612+{
613+ *val = atomic64_read((atomic64_t *)data);
614+ return 0;
615+}
616+DEFINE_DEBUGFS_ATTRIBUTE(fops_atomic64_t_ro, debugfs_atomic64_t_get, NULL,
617+ "%lld\n");
618+
611619 static int sec_core_debug_init(struct sec_dev *sec)
612620 {
613621 struct hisi_qm *qm = &sec->qm;
@@ -628,9 +636,11 @@ static int sec_core_debug_init(struct sec_dev *sec) · 14 unmodified lines
628636
629637 debugfs_create_regset32("regs", 0444, tmp_d, regset);
630638
631− debugfs_create_u64("send_cnt", 0444, tmp_d, &dfx->send_cnt);
639+ debugfs_create_file("send_cnt", 0444, tmp_d, &dfx->send_cnt,
640+ &fops_atomic64_t_ro);
632641
633− debugfs_create_u64("recv_cnt", 0444, tmp_d, &dfx->recv_cnt);
642+ debugfs_create_file("recv_cnt", 0444, tmp_d, &dfx->recv_cnt,
643+ &fops_atomic64_t_ro);
634644
635645 return 0;
636646 }
drivers/firmware/efi/earlycon.c+7−9
@@ -17,7 +17,7 @@ static const struct console *earlycon_console __initdata; · 16 unmodified lines
1717 static const struct font_desc *font;
1818 static u32 efi_x, efi_y;
1919 static u64 fb_base;
20−static pgprot_t fb_prot;
20+static bool fb_wb;
2121 static void *efi_fb;
2222
2323 /*
@@ -33,10 +33,8 @@ static int __init efi_earlycon_remap_fb(void) · 9 unmodified lines
3333 if (!earlycon_console || !(earlycon_console->flags & CON_ENABLED))
3434 return 0;
3535
36− if (pgprot_val(fb_prot) == pgprot_val(PAGE_KERNEL))
37− efi_fb = memremap(fb_base, screen_info.lfb_size, MEMREMAP_WB);
38− else
39− efi_fb = memremap(fb_base, screen_info.lfb_size, MEMREMAP_WC);
36+ efi_fb = memremap(fb_base, screen_info.lfb_size,
37+ fb_wb ? MEMREMAP_WB : MEMREMAP_WC);
4038
4139 return efi_fb ? 0 : -ENOMEM;
4240 }
@@ -53,9 +51,12 @@ late_initcall(efi_earlycon_unmap_fb); · 10 unmodified lines
5351
5452 static __ref void *efi_earlycon_map(unsigned long start, unsigned long len)
5553 {
54+ pgprot_t fb_prot;
55+
5656 if (efi_fb)
5757 return efi_fb + start;
5858
59+ fb_prot = fb_wb ? PAGE_KERNEL : pgprot_writecombine(PAGE_KERNEL);
5960 return early_memremap_prot(fb_base + start, len, pgprot_val(fb_prot));
6061 }
6162
@@ -215,10 +216,7 @@ static int __init efi_earlycon_setup(struct earlycon_device *device, · 153 unmodified lines
215216 if (screen_info.capabilities & VIDEO_CAPABILITY_64BIT_BASE)
216217 fb_base |= (u64)screen_info.ext_lfb_base << 32;
217218
218− if (opt && !strcmp(opt, "ram"))
219− fb_prot = PAGE_KERNEL;
220− else
221− fb_prot = pgprot_writecombine(PAGE_KERNEL);
219+ fb_wb = opt && !strcmp(opt, "ram");
222220
223221 si = &screen_info;
224222 xres = si->lfb_width;
drivers/firmware/efi/libstub/random.c+3−3
@@ -33,7 +33,7 @@ efi_status_t efi_get_random_bytes(efi_system_table_t *sys_table_arg, · 32 unmodified lines
3333 {
3434 efi_guid_t rng_proto = EFI_RNG_PROTOCOL_GUID;
3535 efi_status_t status;
36− struct efi_rng_protocol *rng;
36+ struct efi_rng_protocol *rng = NULL;
3737
3838 status = efi_call_early(locate_protocol, &rng_proto, NULL,
3939 (void **)&rng);
@@ -162,8 +162,8 @@ efi_status_t efi_random_get_seed(efi_system_table_t *sys_table_arg) · 122 unmodified lines
162162 efi_guid_t rng_proto = EFI_RNG_PROTOCOL_GUID;
163163 efi_guid_t rng_algo_raw = EFI_RNG_ALGORITHM_RAW;
164164 efi_guid_t rng_table_guid = LINUX_EFI_RANDOM_SEED_TABLE_GUID;
165− struct efi_rng_protocol *rng;
166− struct linux_efi_random_seed *seed;
165+ struct efi_rng_protocol *rng = NULL;
166+ struct linux_efi_random_seed *seed = NULL;
167167 efi_status_t status;
168168
169169 status = efi_call_early(locate_protocol, &rng_proto, NULL,
drivers/gpio/Kconfig+0−1
@@ -573,7 +573,6 @@ config GPIO_THUNDERX · 572 unmodified lines
573573 tristate "Cavium ThunderX/OCTEON-TX GPIO"
574574 depends on ARCH_THUNDER || (64BIT && COMPILE_TEST)
575575 depends on PCI_MSI
576− select GPIOLIB_IRQCHIP
577576 select IRQ_DOMAIN_HIERARCHY
578577 select IRQ_FASTEOI_HIERARCHY_HANDLERS
579578 help
drivers/gpio/gpio-thunderx.c+107−56
@@ -53,6 +53,7 @@ struct thunderx_line { · 52 unmodified lines
5353 struct thunderx_gpio {
5454 struct gpio_chip chip;
5555 u8 __iomem *register_base;
56+ struct irq_domain *irqd;
5657 struct msix_entry *msix_entries; /* per line MSI-X */
5758 struct thunderx_line *line_entries; /* per line irq info */
5859 raw_spinlock_t lock;
@@ -285,60 +286,54 @@ static void thunderx_gpio_set_multiple(struct gpio_chip *chip, · 226 unmodified lines
285286 }
286287 }
287288
288−static void thunderx_gpio_irq_ack(struct irq_data *d)
289+static void thunderx_gpio_irq_ack(struct irq_data *data)
289290 {
290− struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
291− struct thunderx_gpio *txgpio = gpiochip_get_data(gc);
291+ struct thunderx_line *txline = irq_data_get_irq_chip_data(data);
292292
293293 writeq(GPIO_INTR_INTR,
294− txgpio->register_base + intr_reg(irqd_to_hwirq(d)));
294+ txline->txgpio->register_base + intr_reg(txline->line));
295295 }
296296
297−static void thunderx_gpio_irq_mask(struct irq_data *d)
297+static void thunderx_gpio_irq_mask(struct irq_data *data)
298298 {
299− struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
300− struct thunderx_gpio *txgpio = gpiochip_get_data(gc);
299+ struct thunderx_line *txline = irq_data_get_irq_chip_data(data);
301300
302301 writeq(GPIO_INTR_ENA_W1C,
303− txgpio->register_base + intr_reg(irqd_to_hwirq(d)));
302+ txline->txgpio->register_base + intr_reg(txline->line));
304303 }
305304
306−static void thunderx_gpio_irq_mask_ack(struct irq_data *d)
305+static void thunderx_gpio_irq_mask_ack(struct irq_data *data)
307306 {
308− struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
309− struct thunderx_gpio *txgpio = gpiochip_get_data(gc);
307+ struct thunderx_line *txline = irq_data_get_irq_chip_data(data);
310308
311309 writeq(GPIO_INTR_ENA_W1C | GPIO_INTR_INTR,
312− txgpio->register_base + intr_reg(irqd_to_hwirq(d)));
310+ txline->txgpio->register_base + intr_reg(txline->line));
313311 }
314312
315−static void thunderx_gpio_irq_unmask(struct irq_data *d)
313+static void thunderx_gpio_irq_unmask(struct irq_data *data)
316314 {
317− struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
318− struct thunderx_gpio *txgpio = gpiochip_get_data(gc);
315+ struct thunderx_line *txline = irq_data_get_irq_chip_data(data);
319316
320317 writeq(GPIO_INTR_ENA_W1S,
321− txgpio->register_base + intr_reg(irqd_to_hwirq(d)));
318+ txline->txgpio->register_base + intr_reg(txline->line));
322319 }
323320
324−static int thunderx_gpio_irq_set_type(struct irq_data *d,
321+static int thunderx_gpio_irq_set_type(struct irq_data *data,
325322 unsigned int flow_type)
326323 {
327− struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
328− struct thunderx_gpio *txgpio = gpiochip_get_data(gc);
329− struct thunderx_line *txline =
330− &txgpio->line_entries[irqd_to_hwirq(d)];
324+ struct thunderx_line *txline = irq_data_get_irq_chip_data(data);
325+ struct thunderx_gpio *txgpio = txline->txgpio;
331326 u64 bit_cfg;
332327
333− irqd_set_trigger_type(d, flow_type);
328+ irqd_set_trigger_type(data, flow_type);
334329
335330 bit_cfg = txline->fil_bits | GPIO_BIT_CFG_INT_EN;
336331
337332 if (flow_type & IRQ_TYPE_EDGE_BOTH) {
338− irq_set_handler_locked(d, handle_fasteoi_ack_irq);
333+ irq_set_handler_locked(data, handle_fasteoi_ack_irq);
339334 bit_cfg |= GPIO_BIT_CFG_INT_TYPE;
340335 } else {
341− irq_set_handler_locked(d, handle_fasteoi_mask_irq);
336+ irq_set_handler_locked(data, handle_fasteoi_mask_irq);
342337 }
343338
344339 raw_spin_lock(&txgpio->lock);
@@ -367,6 +362,33 @@ static void thunderx_gpio_irq_disable(struct irq_data *data) · 22 unmodified lines
367362 irq_chip_disable_parent(data);
368363 }
369364
365+static int thunderx_gpio_irq_request_resources(struct irq_data *data)
366+{
367+ struct thunderx_line *txline = irq_data_get_irq_chip_data(data);
368+ struct thunderx_gpio *txgpio = txline->txgpio;
369+ int r;
370+
371+ r = gpiochip_lock_as_irq(&txgpio->chip, txline->line);
372+ if (r)
373+ return r;
374+
375+ r = irq_chip_request_resources_parent(data);
376+ if (r)
377+ gpiochip_unlock_as_irq(&txgpio->chip, txline->line);
378+
379+ return r;
380+}
381+
382+static void thunderx_gpio_irq_release_resources(struct irq_data *data)
383+{
384+ struct thunderx_line *txline = irq_data_get_irq_chip_data(data);
385+ struct thunderx_gpio *txgpio = txline->txgpio;
386+
387+ irq_chip_release_resources_parent(data);
388+
389+ gpiochip_unlock_as_irq(&txgpio->chip, txline->line);
390+}
391+
370392 /*
371393 * Interrupts are chained from underlying MSI-X vectors. We have
372394 * these irq_chip functions to be able to handle level triggering
@@ -383,24 +405,50 @@ static struct irq_chip thunderx_gpio_irq_chip = { · 10 unmodified lines
383405 .irq_unmask = thunderx_gpio_irq_unmask,
384406 .irq_eoi = irq_chip_eoi_parent,
385407 .irq_set_affinity = irq_chip_set_affinity_parent,
408+ .irq_request_resources = thunderx_gpio_irq_request_resources,
409+ .irq_release_resources = thunderx_gpio_irq_release_resources,
386410 .irq_set_type = thunderx_gpio_irq_set_type,
387411
388412 .flags = IRQCHIP_SET_TYPE_MASKED
389413 };
390414
391−static int thunderx_gpio_child_to_parent_hwirq(struct gpio_chip *gc,
392− unsigned int child,
393− unsigned int child_type,
394− unsigned int *parent,
395− unsigned int *parent_type)
415+static int thunderx_gpio_irq_translate(struct irq_domain *d,
416+ struct irq_fwspec *fwspec,
417+ irq_hw_number_t *hwirq,
418+ unsigned int *type)
396419 {
397− struct thunderx_gpio *txgpio = gpiochip_get_data(gc);
398−
399− *parent = txgpio->base_msi + (2 * child);
400− *parent_type = IRQ_TYPE_LEVEL_HIGH;
420+ struct thunderx_gpio *txgpio = d->host_data;
421+
422+ if (WARN_ON(fwspec->param_count < 2))
423+ return -EINVAL;
424+ if (fwspec->param[0] >= txgpio->chip.ngpio)
425+ return -EINVAL;
426+ *hwirq = fwspec->param[0];
427+ *type = fwspec->param[1] & IRQ_TYPE_SENSE_MASK;
401428 return 0;
402429 }
403430
431+static int thunderx_gpio_irq_alloc(struct irq_domain *d, unsigned int virq,
432+ unsigned int nr_irqs, void *arg)
433+{
434+ struct thunderx_line *txline = arg;
435+
436+ return irq_domain_set_hwirq_and_chip(d, virq, txline->line,
437+ &thunderx_gpio_irq_chip, txline);
438+}
439+
440+static const struct irq_domain_ops thunderx_gpio_irqd_ops = {
441+ .alloc = thunderx_gpio_irq_alloc,
442+ .translate = thunderx_gpio_irq_translate
443+};
444+
445+static int thunderx_gpio_to_irq(struct gpio_chip *chip, unsigned int offset)
446+{
447+ struct thunderx_gpio *txgpio = gpiochip_get_data(chip);
448+
449+ return irq_find_mapping(txgpio->irqd, offset);
450+}
451+
404452 static int thunderx_gpio_probe(struct pci_dev *pdev,
405453 const struct pci_device_id *id)
406454 {
@@ -408,7 +456,6 @@ static int thunderx_gpio_probe(struct pci_dev *pdev, · 1 unmodified line
408456 struct device *dev = &pdev->dev;
409457 struct thunderx_gpio *txgpio;
410458 struct gpio_chip *chip;
411− struct gpio_irq_chip *girq;
412459 int ngpio, i;
413460 int err = 0;
414461
@@ -453,8 +500,8 @@ static int thunderx_gpio_probe(struct pci_dev *pdev, · 38 unmodified lines
453500 }
454501
455502 txgpio->msix_entries = devm_kcalloc(dev,
456− ngpio, sizeof(struct msix_entry),
457− GFP_KERNEL);
503+ ngpio, sizeof(struct msix_entry),
504+ GFP_KERNEL);
458505 if (!txgpio->msix_entries) {
459506 err = -ENOMEM;
460507 goto out;
@@ -495,6 +542,27 @@ static int thunderx_gpio_probe(struct pci_dev *pdev, · 34 unmodified lines
495542 if (err < 0)
496543 goto out;
497544
545+ /*
546+ * Push GPIO specific irqdomain on hierarchy created as a side
547+ * effect of the pci_enable_msix()
548+ */
549+ txgpio->irqd = irq_domain_create_hierarchy(irq_get_irq_data(txgpio->msix_entries[0].vector)->domain,
550+ 0, 0, of_node_to_fwnode(dev->of_node),
551+ &thunderx_gpio_irqd_ops, txgpio);
552+ if (!txgpio->irqd) {
553+ err = -ENOMEM;
554+ goto out;
555+ }
556+
557+ /* Push on irq_data and the domain for each line. */
558+ for (i = 0; i < ngpio; i++) {
559+ err = irq_domain_push_irq(txgpio->irqd,
560+ txgpio->msix_entries[i].vector,
561+ &txgpio->line_entries[i]);
562+ if (err < 0)
563+ dev_err(dev, "irq_domain_push_irq: %d\n", err);
564+ }
565+
498566 chip->label = KBUILD_MODNAME;
499567 chip->parent = dev;
500568 chip->owner = THIS_MODULE;
@@ -509,28 +577,11 @@ static int thunderx_gpio_probe(struct pci_dev *pdev, · 8 unmodified lines
509577 chip->set = thunderx_gpio_set;
510578 chip->set_multiple = thunderx_gpio_set_multiple;
511579 chip->set_config = thunderx_gpio_set_config;
512− girq = &chip->irq;
513− girq->chip = &thunderx_gpio_irq_chip;
514− girq->fwnode = of_node_to_fwnode(dev->of_node);
515− girq->parent_domain =
516− irq_get_irq_data(txgpio->msix_entries[0].vector)->domain;
517− girq->child_to_parent_hwirq = thunderx_gpio_child_to_parent_hwirq;
518− girq->handler = handle_bad_irq;
519− girq->default_type = IRQ_TYPE_NONE;
520−
580+ chip->to_irq = thunderx_gpio_to_irq;
521581 err = devm_gpiochip_add_data(dev, chip, txgpio);
522582 if (err)
523583 goto out;
524584
525− /* Push on irq_data and the domain for each line. */
526− for (i = 0; i < ngpio; i++) {
527− err = irq_domain_push_irq(chip->irq.domain,
528− txgpio->msix_entries[i].vector,
529− chip);
530− if (err < 0)
531− dev_err(dev, "irq_domain_push_irq: %d\n", err);
532− }
533−
534585 dev_info(dev, "ThunderX GPIO: %d lines with base %d.\n",
535586 ngpio, chip->base);
536587 return 0;
@@ -545,10 +596,10 @@ static void thunderx_gpio_remove(struct pci_dev *pdev) · 8 unmodified lines
545596 struct thunderx_gpio *txgpio = pci_get_drvdata(pdev);
546597
547598 for (i = 0; i < txgpio->chip.ngpio; i++)
548− irq_domain_pop_irq(txgpio->chip.irq.domain,
599+ irq_domain_pop_irq(txgpio->irqd,
549600 txgpio->msix_entries[i].vector);
550601
551− irq_domain_remove(txgpio->chip.irq.domain);
602+ irq_domain_remove(txgpio->irqd);
552603
553604 pci_set_drvdata(pdev, NULL);
554605 }
drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c+1−1
@@ -254,7 +254,7 @@ static const struct soc15_reg_golden golden_settings_sdma_4_3[] = { · 253 unmodified lines
254254 SOC15_REG_GOLDEN_VALUE(SDMA0, 0, mmSDMA0_RLC0_RB_WPTR_POLL_CNTL, 0xfffffff7, 0x00403000),
255255 SOC15_REG_GOLDEN_VALUE(SDMA0, 0, mmSDMA0_RLC1_RB_WPTR_POLL_CNTL, 0xfffffff7, 0x00403000),
256256 SOC15_REG_GOLDEN_VALUE(SDMA0, 0, mmSDMA0_UTCL1_PAGE, 0x000003ff, 0x000003c0),
257− SOC15_REG_GOLDEN_VALUE(SDMA0, 0, mmSDMA0_UTCL1_WATERMK, 0xfc000000, 0x00000000)
257+ SOC15_REG_GOLDEN_VALUE(SDMA0, 0, mmSDMA0_UTCL1_WATERMK, 0xfc000000, 0x03fbe1fe)
258258 };
259259
260260 static u32 sdma_v4_0_get_reg_offset(struct amdgpu_device *adev,
drivers/gpu/drm/amd/display/dc/core/dc_link.c+1−1
@@ -817,8 +817,8 @@ static bool dc_link_detect_helper(struct dc_link *link, · 816 unmodified lines
817817 }
818818
819819 case SIGNAL_TYPE_EDP: {
820− read_current_link_settings_on_detect(link);
821820 detect_edp_sink_caps(link);
821+ read_current_link_settings_on_detect(link);
822822 sink_caps.transaction_type = DDC_TRANSACTION_TYPE_I2C_OVER_AUX;
823823 sink_caps.signal = SIGNAL_TYPE_EDP;
824824 break;
drivers/gpu/drm/drm_dp_mst_topology.c+36−3
@@ -1190,6 +1190,8 @@ static int drm_dp_mst_wait_tx_reply(struct drm_dp_mst_branch *mstb, · 1189 unmodified lines
11901190 txmsg->state == DRM_DP_SIDEBAND_TX_SENT) {
11911191 mstb->tx_slots[txmsg->seqno] = NULL;
11921192 }
1193+ mgr->is_waiting_for_dwn_reply = false;
1194+
11931195 }
11941196 out:
11951197 if (unlikely(ret == -EIO) && drm_debug_enabled(DRM_UT_DP)) {
@@ -1199,6 +1201,7 @@ out: · 3 unmodified lines
11991201 }
12001202 mutex_unlock(&mgr->qlock);
12011203
1204+ drm_dp_mst_kick_tx(mgr);
12021205 return ret;
12031206 }
12041207
@@ -2318,7 +2321,7 @@ drm_dp_mst_handle_conn_stat(struct drm_dp_mst_branch *mstb, · 1113 unmodified lines
23182321 {
23192322 struct drm_dp_mst_topology_mgr *mgr = mstb->mgr;
23202323 struct drm_dp_mst_port *port;
2321− int old_ddps, ret;
2324+ int old_ddps, old_input, ret, i;
23222325 u8 new_pdt;
23232326 bool dowork = false, create_connector = false;
23242327
@@ -2349,6 +2352,7 @@ drm_dp_mst_handle_conn_stat(struct drm_dp_mst_branch *mstb, · 24 unmodified lines
23492352 }
23502353
23512354 old_ddps = port->ddps;
2355+ old_input = port->input;
23522356 port->input = conn_stat->input_port;
23532357 port->mcs = conn_stat->message_capability_status;
23542358 port->ldps = conn_stat->legacy_device_plug_status;
@@ -2373,6 +2377,28 @@ drm_dp_mst_handle_conn_stat(struct drm_dp_mst_branch *mstb, · 18 unmodified lines
23732377 dowork = false;
23742378 }
23752379
2380+ if (!old_input && old_ddps != port->ddps && !port->ddps) {
2381+ for (i = 0; i < mgr->max_payloads; i++) {
2382+ struct drm_dp_vcpi *vcpi = mgr->proposed_vcpis[i];
2383+ struct drm_dp_mst_port *port_validated;
2384+
2385+ if (!vcpi)
2386+ continue;
2387+
2388+ port_validated =
2389+ container_of(vcpi, struct drm_dp_mst_port, vcpi);
2390+ port_validated =
2391+ drm_dp_mst_topology_get_port_validated(mgr, port_validated);
2392+ if (!port_validated) {
2393+ mutex_lock(&mgr->payload_lock);
2394+ vcpi->num_slots = 0;
2395+ mutex_unlock(&mgr->payload_lock);
2396+ } else {
2397+ drm_dp_mst_topology_put_port(port_validated);
2398+ }
2399+ }
2400+ }
2401+
23762402 if (port->connector)
23772403 drm_modeset_unlock(&mgr->base.lock);
23782404 else if (create_connector)
@@ -2718,9 +2744,11 @@ static void process_single_down_tx_qlock(struct drm_dp_mst_topology_mgr *mgr) · 339 unmodified lines
27182744 ret = process_single_tx_qlock(mgr, txmsg, false);
27192745 if (ret == 1) {
27202746 /* txmsg is sent it should be in the slots now */
2747+ mgr->is_waiting_for_dwn_reply = true;
27212748 list_del(&txmsg->next);
27222749 } else if (ret) {
27232750 DRM_DEBUG_KMS("failed to send msg in q %d\n", ret);
2751+ mgr->is_waiting_for_dwn_reply = false;
27242752 list_del(&txmsg->next);
27252753 if (txmsg->seqno != -1)
27262754 txmsg->dst->tx_slots[txmsg->seqno] = NULL;
@@ -2760,7 +2788,8 @@ static void drm_dp_queue_down_tx(struct drm_dp_mst_topology_mgr *mgr, · 33 unmodified lines
27602788 drm_dp_mst_dump_sideband_msg_tx(&p, txmsg);
27612789 }
27622790
2763− if (list_is_singular(&mgr->tx_msg_downq))
2791+ if (list_is_singular(&mgr->tx_msg_downq) &&
2792+ !mgr->is_waiting_for_dwn_reply)
27642793 process_single_down_tx_qlock(mgr);
27652794 mutex_unlock(&mgr->qlock);
27662795 }
@@ -3678,6 +3707,7 @@ static int drm_dp_mst_handle_down_rep(struct drm_dp_mst_topology_mgr *mgr) · 911 unmodified lines
36783707 mutex_lock(&mgr->qlock);
36793708 txmsg->state = DRM_DP_SIDEBAND_TX_RX;
36803709 mstb->tx_slots[slot] = NULL;
3710+ mgr->is_waiting_for_dwn_reply = false;
36813711 mutex_unlock(&mgr->qlock);
36823712
36833713 wake_up_all(&mgr->tx_waitq);
@@ -3687,6 +3717,9 @@ static int drm_dp_mst_handle_down_rep(struct drm_dp_mst_topology_mgr *mgr) · 3 unmodified lines
36873717 no_msg:
36883718 drm_dp_mst_topology_put_mstb(mstb);
36893719 clear_down_rep_recv:
3720+ mutex_lock(&mgr->qlock);
3721+ mgr->is_waiting_for_dwn_reply = false;
3722+ mutex_unlock(&mgr->qlock);
36903723 memset(&mgr->down_rep_recv, 0, sizeof(struct drm_dp_sideband_msg_rx));
36913724
36923725 return 0;
@@ -4497,7 +4530,7 @@ static void drm_dp_tx_work(struct work_struct *work) · 804 unmodified lines
44974530 struct drm_dp_mst_topology_mgr *mgr = container_of(work, struct drm_dp_mst_topology_mgr, tx_work);
44984531
44994532 mutex_lock(&mgr->qlock);
4500− if (!list_empty(&mgr->tx_msg_downq))
4533+ if (!list_empty(&mgr->tx_msg_downq) && !mgr->is_waiting_for_dwn_reply)
45014534 process_single_down_tx_qlock(mgr);
45024535 mutex_unlock(&mgr->qlock);
45034536 }
drivers/gpu/drm/i915/gt/intel_context.c+37−3
@@ -123,6 +123,10 @@ static int __context_pin_state(struct i915_vma *vma) · 122 unmodified lines
123123 if (err)
124124 return err;
125125
126+ err = i915_active_acquire(&vma->active);
127+ if (err)
128+ goto err_unpin;
129+
126130 /*
127131 * And mark it as a globally pinned object to let the shrinker know
128132 * it cannot reclaim the object until we release it.
@@ -131,14 +135,44 @@ static int __context_pin_state(struct i915_vma *vma) · 2 unmodified lines
131135 vma->obj->mm.dirty = true;
132136
133137 return 0;
138+
139+err_unpin:
140+ i915_vma_unpin(vma);
141+ return err;
134142 }
135143
136144 static void __context_unpin_state(struct i915_vma *vma)
137145 {
138146 i915_vma_make_shrinkable(vma);
147+ i915_active_release(&vma->active);
139148 __i915_vma_unpin(vma);
140149 }
141150
151+static int __ring_active(struct intel_ring *ring)
152+{
153+ int err;
154+
155+ err = i915_active_acquire(&ring->vma->active);
156+ if (err)
157+ return err;
158+
159+ err = intel_ring_pin(ring);
160+ if (err)
161+ goto err_active;
162+
163+ return 0;
164+
165+err_active:
166+ i915_active_release(&ring->vma->active);
167+ return err;
168+}
169+
170+static void __ring_retire(struct intel_ring *ring)
171+{
172+ intel_ring_unpin(ring);
173+ i915_active_release(&ring->vma->active);
174+}
175+
142176 __i915_active_call
143177 static void __intel_context_retire(struct i915_active *active)
144178 {
@@ -151,7 +185,7 @@ static void __intel_context_retire(struct i915_active *active) · 6 unmodified lines
151185 __context_unpin_state(ce->state);
152186
153187 intel_timeline_unpin(ce->timeline);
154− intel_ring_unpin(ce->ring);
188+ __ring_retire(ce->ring);
155189
156190 intel_context_put(ce);
157191 }
@@ -163,7 +197,7 @@ static int __intel_context_active(struct i915_active *active) · 5 unmodified lines
163197
164198 intel_context_get(ce);
165199
166− err = intel_ring_pin(ce->ring);
200+ err = __ring_active(ce->ring);
167201 if (err)
168202 goto err_put;
169203
@@ -183,7 +217,7 @@ static int __intel_context_active(struct i915_active *active) · 13 unmodified lines
183217 err_timeline:
184218 intel_timeline_unpin(ce->timeline);
185219 err_ring:
186− intel_ring_unpin(ce->ring);
220+ __ring_retire(ce->ring);
187221 err_put:
188222 intel_context_put(ce);
189223 return err;
drivers/gpu/drm/i915/gt/intel_lrc.c+8−0
@@ -2664,6 +2664,14 @@ static u32 *gen9_init_indirectctx_bb(struct intel_engine_cs *engine, u32 *batch) · 2663 unmodified lines
26642664 /* WaFlushCoherentL3CacheLinesAtContextSwitch:skl,bxt,glk */
26652665 batch = gen8_emit_flush_coherentl3_wa(engine, batch);
26662666
2667+ /* WaClearSlmSpaceAtContextSwitch:skl,bxt,kbl,glk,cfl */
2668+ batch = gen8_emit_pipe_control(batch,
2669+ PIPE_CONTROL_FLUSH_L3 |
2670+ PIPE_CONTROL_STORE_DATA_INDEX |
2671+ PIPE_CONTROL_CS_STALL |
2672+ PIPE_CONTROL_QW_WRITE,
2673+ LRC_PPHWSP_SCRATCH_ADDR);
2674+
26672675 batch = emit_lri(batch, lri, ARRAY_SIZE(lri));
26682676
26692677 /* WaMediaPoolStateCmdInWABB:bxt,glk */
drivers/gpu/drm/i915/i915_gem_gtt.c+2−5
@@ -3304,7 +3304,7 @@ void i915_ggtt_disable_guc(struct i915_ggtt *ggtt) · 3303 unmodified lines
33043304
33053305 static void ggtt_restore_mappings(struct i915_ggtt *ggtt)
33063306 {
3307− struct i915_vma *vma, *vn;
3307+ struct i915_vma *vma;
33083308 bool flush = false;
33093309 int open;
33103310
@@ -3319,15 +3319,12 @@ static void ggtt_restore_mappings(struct i915_ggtt *ggtt) · 8 unmodified lines
33193319 open = atomic_xchg(&ggtt->vm.open, 0);
33203320
33213321 /* clflush objects bound into the GGTT and rebind them. */
3322− list_for_each_entry_safe(vma, vn, &ggtt->vm.bound_list, vm_link) {
3322+ list_for_each_entry(vma, &ggtt->vm.bound_list, vm_link) {
33233323 struct drm_i915_gem_object *obj = vma->obj;
33243324
33253325 if (!i915_vma_is_bound(vma, I915_VMA_GLOBAL_BIND))
33263326 continue;
33273327
3328− if (!__i915_vma_unbind(vma))
3329− continue;
3330−
33313328 clear_bit(I915_VMA_GLOBAL_BIND_BIT, __i915_vma_flags(vma));
33323329 WARN_ON(i915_vma_bind(vma,
33333330 obj ? obj->cache_level : 0,
drivers/gpu/drm/i915/i915_pmu.c+8−3
@@ -1074,12 +1074,17 @@ void i915_pmu_register(struct drm_i915_private *i915) · 1073 unmodified lines
10741074 hrtimer_init(&pmu->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
10751075 pmu->timer.function = i915_sample;
10761076
1077− if (!is_igp(i915))
1077+ if (!is_igp(i915)) {
10781078 pmu->name = kasprintf(GFP_KERNEL,
1079− "i915-%s",
1079+ "i915_%s",
10801080 dev_name(i915->drm.dev));
1081− else
1081+ if (pmu->name) {
1082+ /* tools/perf reserves colons as special. */
1083+ strreplace((char *)pmu->name, ':', '_');
1084+ }
1085+ } else {
10821086 pmu->name = "i915";
1087+ }
10831088 if (!pmu->name)
10841089 goto err;
10851090
drivers/gpu/drm/i915/selftests/i915_random.h+1−0
@@ -25,6 +25,7 @@ · 24 unmodified lines
2525 #ifndef __I915_SELFTESTS_RANDOM_H__
2626 #define __I915_SELFTESTS_RANDOM_H__
2727
28+#include <linux/math64.h>
2829 #include <linux/random.h>
2930
3031 #include "../i915_selftest.h"
drivers/gpu/drm/rockchip/cdn-dp-core.h+1−1
@@ -95,7 +95,7 @@ struct cdn_dp_device { · 94 unmodified lines
9595 struct cdn_dp_port *port[MAX_PHY];
9696 u8 ports;
9797 u8 max_lanes;
98− u8 max_rate;
98+ unsigned int max_rate;
9999 u8 lanes;
100100 int active_port;
101101
drivers/gpu/drm/virtio/virtgpu_plane.c+1−0
@@ -232,6 +232,7 @@ static void virtio_gpu_cursor_plane_update(struct drm_plane *plane, · 231 unmodified lines
232232 if (!objs)
233233 return;
234234 virtio_gpu_array_add_obj(objs, vgfb->base.obj[0]);
235+ virtio_gpu_array_lock_resv(objs);
235236 virtio_gpu_cmd_transfer_to_host_2d
236237 (vgdev, 0,
237238 plane->state->crtc_w,
drivers/hwtracing/coresight/coresight-etm4x.c+6−7
@@ -1132,7 +1132,6 @@ static void etm4_init_trace_id(struct etmv4_drvdata *drvdata) · 1131 unmodified lines
11321132 drvdata->trcid = coresight_get_trace_id(drvdata->cpu);
11331133 }
11341134
1135−#ifdef CONFIG_CPU_PM
11361135 static int etm4_cpu_save(struct etmv4_drvdata *drvdata)
11371136 {
11381137 int i, ret = 0;
@@ -1402,17 +1401,17 @@ static struct notifier_block etm4_cpu_pm_nb = { · 263 unmodified lines
14021401
14031402 static int etm4_cpu_pm_register(void)
14041403 {
1405− return cpu_pm_register_notifier(&etm4_cpu_pm_nb);
1404+ if (IS_ENABLED(CONFIG_CPU_PM))
1405+ return cpu_pm_register_notifier(&etm4_cpu_pm_nb);
1406+
1407+ return 0;
14061408 }
14071409
14081410 static void etm4_cpu_pm_unregister(void)
14091411 {
1410− cpu_pm_unregister_notifier(&etm4_cpu_pm_nb);
1412+ if (IS_ENABLED(CONFIG_CPU_PM))
1413+ cpu_pm_unregister_notifier(&etm4_cpu_pm_nb);
14111414 }
1412−#else
1413−static int etm4_cpu_pm_register(void) { return 0; }
1414−static void etm4_cpu_pm_unregister(void) { }
1415−#endif
14161415
14171416 static int etm4_probe(struct amba_device *adev, const struct amba_id *id)
14181417 {
drivers/i2c/busses/i2c-iop3xx.c+8−4
@@ -433,13 +433,17 @@ iop3xx_i2c_probe(struct platform_device *pdev) · 432 unmodified lines
433433 adapter_data->gpio_scl = devm_gpiod_get_optional(&pdev->dev,
434434 "scl",
435435 GPIOD_ASIS);
436− if (IS_ERR(adapter_data->gpio_scl))
437− return PTR_ERR(adapter_data->gpio_scl);
436+ if (IS_ERR(adapter_data->gpio_scl)) {
437+ ret = PTR_ERR(adapter_data->gpio_scl);
438+ goto free_both;
439+ }
438440 adapter_data->gpio_sda = devm_gpiod_get_optional(&pdev->dev,
439441 "sda",
440442 GPIOD_ASIS);
441− if (IS_ERR(adapter_data->gpio_sda))
442− return PTR_ERR(adapter_data->gpio_sda);
443+ if (IS_ERR(adapter_data->gpio_sda)) {
444+ ret = PTR_ERR(adapter_data->gpio_sda);
445+ goto free_both;
446+ }
443447
444448 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
445449 if (!res) {
drivers/i2c/busses/i2c-tegra.c+28−10
@@ -1608,14 +1608,18 @@ static int tegra_i2c_probe(struct platform_device *pdev) · 1607 unmodified lines
16081608 }
16091609
16101610 pm_runtime_enable(&pdev->dev);
1611− if (!pm_runtime_enabled(&pdev->dev))
1611+ if (!pm_runtime_enabled(&pdev->dev)) {
16121612 ret = tegra_i2c_runtime_resume(&pdev->dev);
1613− else
1613+ if (ret < 0) {
1614+ dev_err(&pdev->dev, "runtime resume failed\n");
1615+ goto unprepare_div_clk;
1616+ }
1617+ } else {
16141618 ret = pm_runtime_get_sync(i2c_dev->dev);
1615−
1616− if (ret < 0) {
1617− dev_err(&pdev->dev, "runtime resume failed\n");
1618− goto unprepare_div_clk;
1619+ if (ret < 0) {
1620+ dev_err(&pdev->dev, "runtime resume failed\n");
1621+ goto disable_rpm;
1622+ }
16191623 }
16201624
16211625 if (i2c_dev->is_multimaster_mode) {
@@ -1623,7 +1627,7 @@ static int tegra_i2c_probe(struct platform_device *pdev) · 1 unmodified line
16231627 if (ret < 0) {
16241628 dev_err(i2c_dev->dev, "div_clk enable failed %d\n",
16251629 ret);
1626− goto disable_rpm;
1630+ goto put_rpm;
16271631 }
16281632 }
16291633
@@ -1671,11 +1675,16 @@ disable_div_clk: · 41 unmodified lines
16711675 if (i2c_dev->is_multimaster_mode)
16721676 clk_disable(i2c_dev->div_clk);
16731677
1674−disable_rpm:
1675− pm_runtime_disable(&pdev->dev);
1676− if (!pm_runtime_status_suspended(&pdev->dev))
1678+put_rpm:
1679+ if (pm_runtime_enabled(&pdev->dev))
1680+ pm_runtime_put_sync(&pdev->dev);
1681+ else
16771682 tegra_i2c_runtime_suspend(&pdev->dev);
16781683
1684+disable_rpm:
1685+ if (pm_runtime_enabled(&pdev->dev))
1686+ pm_runtime_disable(&pdev->dev);
1687+
16791688 unprepare_div_clk:
16801689 clk_unprepare(i2c_dev->div_clk);
16811690
@@ -1710,9 +1719,14 @@ static int tegra_i2c_remove(struct platform_device *pdev) · 28 unmodified lines
17101719 static int __maybe_unused tegra_i2c_suspend(struct device *dev)
17111720 {
17121721 struct tegra_i2c_dev *i2c_dev = dev_get_drvdata(dev);
1722+ int err;
17131723
17141724 i2c_mark_adapter_suspended(&i2c_dev->adapter);
17151725
1726+ err = pm_runtime_force_suspend(dev);
1727+ if (err < 0)
1728+ return err;
1729+
17161730 return 0;
17171731 }
17181732
@@ -1733,6 +1747,10 @@ static int __maybe_unused tegra_i2c_resume(struct device *dev) · 14 unmodified lines
17331747 if (err)
17341748 return err;
17351749
1750+ err = pm_runtime_force_resume(dev);
1751+ if (err < 0)
1752+ return err;
1753+
17361754 i2c_mark_adapter_resumed(&i2c_dev->adapter);
17371755
17381756 return 0;
drivers/iio/adc/ad7124.c+5−7
@@ -494,13 +494,11 @@ static int ad7124_of_parse_channel_config(struct iio_dev *indio_dev, · 493 unmodified lines
494494 st->channel_config[channel].buf_negative =
495495 of_property_read_bool(child, "adi,buffered-negative");
496496
497− *chan = ad7124_channel_template;
498− chan->address = channel;
499− chan->scan_index = channel;
500− chan->channel = ain[0];
501− chan->channel2 = ain[1];
502−
503− chan++;
497+ chan[channel] = ad7124_channel_template;
498+ chan[channel].address = channel;
499+ chan[channel].scan_index = channel;
500+ chan[channel].channel = ain[0];
501+ chan[channel].channel2 = ain[1];
504502 }
505503
506504 return 0;
drivers/iio/chemical/Kconfig+1−0
@@ -65,6 +65,7 @@ config IAQCORE · 64 unmodified lines
6565 config PMS7003
6666 tristate "Plantower PMS7003 particulate matter sensor"
6767 depends on SERIAL_DEV_BUS
68+ select IIO_BUFFER
6869 select IIO_TRIGGERED_BUFFER
6970 help
7071 Say Y here to build support for the Plantower PMS7003 particulate
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c+2−1
@@ -1301,7 +1301,8 @@ static int st_lsm6dsx_check_whoami(struct st_lsm6dsx_hw *hw, int id, · 1300 unmodified lines
13011301
13021302 for (i = 0; i < ARRAY_SIZE(st_lsm6dsx_sensor_settings); i++) {
13031303 for (j = 0; j < ST_LSM6DSX_MAX_ID; j++) {
1304− if (id == st_lsm6dsx_sensor_settings[i].id[j].hw_id)
1304+ if (st_lsm6dsx_sensor_settings[i].id[j].name &&
1305+ id == st_lsm6dsx_sensor_settings[i].id[j].hw_id)
13051306 break;
13061307 }
13071308 if (j < ST_LSM6DSX_MAX_ID)
drivers/iio/industrialio-buffer.c+5−1
@@ -566,7 +566,7 @@ static int iio_compute_scan_bytes(struct iio_dev *indio_dev, · 565 unmodified lines
566566 const unsigned long *mask, bool timestamp)
567567 {
568568 unsigned bytes = 0;
569− int length, i;
569+ int length, i, largest = 0;
570570
571571 /* How much space will the demuxed element take? */
572572 for_each_set_bit(i, mask,
@@ -574,13 +574,17 @@ static int iio_compute_scan_bytes(struct iio_dev *indio_dev, · 1 unmodified line
574574 length = iio_storage_bytes_for_si(indio_dev, i);
575575 bytes = ALIGN(bytes, length);
576576 bytes += length;
577+ largest = max(largest, length);
577578 }
578579
579580 if (timestamp) {
580581 length = iio_storage_bytes_for_timestamp(indio_dev);
581582 bytes = ALIGN(bytes, length);
582583 bytes += length;
584+ largest = max(largest, length);
583585 }
586+
587+ bytes = ALIGN(bytes, largest);
584588 return bytes;
585589 }
586590
drivers/iio/light/vcnl4000.c+2−1
@@ -163,7 +163,6 @@ static int vcnl4200_init(struct vcnl4000_data *data) · 162 unmodified lines
163163 if (ret < 0)
164164 return ret;
165165
166− data->al_scale = 24000;
167166 data->vcnl4200_al.reg = VCNL4200_AL_DATA;
168167 data->vcnl4200_ps.reg = VCNL4200_PS_DATA;
169168 switch (id) {
@@ -172,11 +171,13 @@ static int vcnl4200_init(struct vcnl4000_data *data) · 2 unmodified lines
172171 /* show 54ms in total. */
173172 data->vcnl4200_al.sampling_rate = ktime_set(0, 54000 * 1000);
174173 data->vcnl4200_ps.sampling_rate = ktime_set(0, 4200 * 1000);
174+ data->al_scale = 24000;
175175 break;
176176 case VCNL4040_PROD_ID:
177177 /* Integration time is 80ms, add 10ms. */
178178 data->vcnl4200_al.sampling_rate = ktime_set(0, 100000 * 1000);
179179 data->vcnl4200_ps.sampling_rate = ktime_set(0, 100000 * 1000);
180+ data->al_scale = 120000;
180181 break;
181182 }
182183 data->vcnl4200_al.last_measurement = ktime_set(0, 0);
drivers/irqchip/irq-ingenic.c+2−4
@@ -17,7 +17,6 @@ · 16 unmodified lines
1717 #include <linux/delay.h>
1818
1919 #include <asm/io.h>
20−#include <asm/mach-jz4740/irq.h>
2120
2221 struct ingenic_intc_data {
2322 void __iomem *base;
@@ -50,7 +49,7 @@ static irqreturn_t intc_cascade(int irq, void *data) · 26 unmodified lines
5049 while (pending) {
5150 int bit = __fls(pending);
5251
53− irq = irq_find_mapping(domain, bit + (i * 32));
52+ irq = irq_linear_revmap(domain, bit + (i * 32));
5453 generic_handle_irq(irq);
5554 pending &= ~BIT(bit);
5655 }
@@ -97,8 +96,7 @@ static int __init ingenic_intc_of_init(struct device_node *node, · 40 unmodified lines
9796 goto out_unmap_irq;
9897 }
9998
100− domain = irq_domain_add_legacy(node, num_chips * 32,
101− JZ4740_IRQ_BASE, 0,
99+ domain = irq_domain_add_linear(node, num_chips * 32,
102100 &irq_generic_chip_ops, NULL);
103101 if (!domain) {
104102 err = -ENOMEM;
drivers/md/dm-snap-persistent.c+1−1
@@ -17,7 +17,7 @@ · 16 unmodified lines
1717 #include <linux/dm-bufio.h>
1818
1919 #define DM_MSG_PREFIX "persistent snapshot"
20−#define DM_CHUNK_SIZE_DEFAULT_SECTORS 32 /* 16KB */
20+#define DM_CHUNK_SIZE_DEFAULT_SECTORS 32U /* 16KB */
2121
2222 #define DM_PREFETCH_CHUNKS 12
2323
drivers/md/raid0.c+1−1
@@ -87,7 +87,7 @@ static int create_strip_zones(struct mddev *mddev, struct r0conf **private_conf) · 86 unmodified lines
8787 char b[BDEVNAME_SIZE];
8888 char b2[BDEVNAME_SIZE];
8989 struct r0conf *conf = kzalloc(sizeof(*conf), GFP_KERNEL);
90− unsigned short blksize = 512;
90+ unsigned blksize = 512;
9191
9292 *private_conf = ERR_PTR(-ENOMEM);
9393 if (!conf)
drivers/message/fusion/mptctl.c+50−163
@@ -100,19 +100,19 @@ struct buflist { · 99 unmodified lines
100100 * Function prototypes. Called from OS entry point mptctl_ioctl.
101101 * arg contents specific to function.
102102 */
103−static int mptctl_fw_download(unsigned long arg);
104−static int mptctl_getiocinfo(unsigned long arg, unsigned int cmd);
105−static int mptctl_gettargetinfo(unsigned long arg);
106−static int mptctl_readtest(unsigned long arg);
107−static int mptctl_mpt_command(unsigned long arg);
108−static int mptctl_eventquery(unsigned long arg);
109−static int mptctl_eventenable(unsigned long arg);
110−static int mptctl_eventreport(unsigned long arg);
111−static int mptctl_replace_fw(unsigned long arg);
112−
113−static int mptctl_do_reset(unsigned long arg);
114−static int mptctl_hp_hostinfo(unsigned long arg, unsigned int cmd);
115−static int mptctl_hp_targetinfo(unsigned long arg);
103+static int mptctl_fw_download(MPT_ADAPTER *iocp, unsigned long arg);
104+static int mptctl_getiocinfo(MPT_ADAPTER *iocp, unsigned long arg, unsigned int cmd);
105+static int mptctl_gettargetinfo(MPT_ADAPTER *iocp, unsigned long arg);
106+static int mptctl_readtest(MPT_ADAPTER *iocp, unsigned long arg);
107+static int mptctl_mpt_command(MPT_ADAPTER *iocp, unsigned long arg);
108+static int mptctl_eventquery(MPT_ADAPTER *iocp, unsigned long arg);
109+static int mptctl_eventenable(MPT_ADAPTER *iocp, unsigned long arg);
110+static int mptctl_eventreport(MPT_ADAPTER *iocp, unsigned long arg);
111+static int mptctl_replace_fw(MPT_ADAPTER *iocp, unsigned long arg);
112+
113+static int mptctl_do_reset(MPT_ADAPTER *iocp, unsigned long arg);
114+static int mptctl_hp_hostinfo(MPT_ADAPTER *iocp, unsigned long arg, unsigned int cmd);
115+static int mptctl_hp_targetinfo(MPT_ADAPTER *iocp, unsigned long arg);
116116
117117 static int mptctl_probe(struct pci_dev *, const struct pci_device_id *);
118118 static void mptctl_remove(struct pci_dev *);
@@ -123,8 +123,8 @@ static long compat_mpctl_ioctl(struct file *f, unsigned cmd, unsigned long arg); · 4 unmodified lines
123123 /*
124124 * Private function calls.
125125 */
126−static int mptctl_do_mpt_command(struct mpt_ioctl_command karg, void __user *mfPtr);
127−static int mptctl_do_fw_download(int ioc, char __user *ufwbuf, size_t fwlen);
126+static int mptctl_do_mpt_command(MPT_ADAPTER *iocp, struct mpt_ioctl_command karg, void __user *mfPtr);
127+static int mptctl_do_fw_download(MPT_ADAPTER *iocp, char __user *ufwbuf, size_t fwlen);
128128 static MptSge_t *kbuf_alloc_2_sgl(int bytes, u32 dir, int sge_offset, int *frags,
129129 struct buflist **blp, dma_addr_t *sglbuf_dma, MPT_ADAPTER *ioc);
130130 static void kfree_sgl(MptSge_t *sgl, dma_addr_t sgl_dma,
@@ -656,19 +656,19 @@ __mptctl_ioctl(struct file *file, unsigned int cmd, unsigned long arg) · 525 unmodified lines
656656 * by TM and FW reloads.
657657 */
658658 if ((cmd & ~IOCSIZE_MASK) == (MPTIOCINFO & ~IOCSIZE_MASK)) {
659− return mptctl_getiocinfo(arg, _IOC_SIZE(cmd));
659+ return mptctl_getiocinfo(iocp, arg, _IOC_SIZE(cmd));
660660 } else if (cmd == MPTTARGETINFO) {
661− return mptctl_gettargetinfo(arg);
661+ return mptctl_gettargetinfo(iocp, arg);
662662 } else if (cmd == MPTTEST) {
663− return mptctl_readtest(arg);
663+ return mptctl_readtest(iocp, arg);
664664 } else if (cmd == MPTEVENTQUERY) {
665− return mptctl_eventquery(arg);
665+ return mptctl_eventquery(iocp, arg);
666666 } else if (cmd == MPTEVENTENABLE) {
667− return mptctl_eventenable(arg);
667+ return mptctl_eventenable(iocp, arg);
668668 } else if (cmd == MPTEVENTREPORT) {
669− return mptctl_eventreport(arg);
669+ return mptctl_eventreport(iocp, arg);
670670 } else if (cmd == MPTFWREPLACE) {
671− return mptctl_replace_fw(arg);
671+ return mptctl_replace_fw(iocp, arg);
672672 }
673673
674674 /* All of these commands require an interrupt or
@@ -678,15 +678,15 @@ __mptctl_ioctl(struct file *file, unsigned int cmd, unsigned long arg) · 3 unmodified lines
678678 return ret;
679679
680680 if (cmd == MPTFWDOWNLOAD)
681− ret = mptctl_fw_download(arg);
681+ ret = mptctl_fw_download(iocp, arg);
682682 else if (cmd == MPTCOMMAND)
683− ret = mptctl_mpt_command(arg);
683+ ret = mptctl_mpt_command(iocp, arg);
684684 else if (cmd == MPTHARDRESET)
685− ret = mptctl_do_reset(arg);
685+ ret = mptctl_do_reset(iocp, arg);
686686 else if ((cmd & ~IOCSIZE_MASK) == (HP_GETHOSTINFO & ~IOCSIZE_MASK))
687− ret = mptctl_hp_hostinfo(arg, _IOC_SIZE(cmd));
687+ ret = mptctl_hp_hostinfo(iocp, arg, _IOC_SIZE(cmd));
688688 else if (cmd == HP_GETTARGETINFO)
689− ret = mptctl_hp_targetinfo(arg);
689+ ret = mptctl_hp_targetinfo(iocp, arg);
690690 else
691691 ret = -EINVAL;
692692
@@ -705,11 +705,10 @@ mptctl_ioctl(struct file *file, unsigned int cmd, unsigned long arg) · 12 unmodified lines
705705 return ret;
706706 }
707707
708−static int mptctl_do_reset(unsigned long arg)
708+static int mptctl_do_reset(MPT_ADAPTER *iocp, unsigned long arg)
709709 {
710710 struct mpt_ioctl_diag_reset __user *urinfo = (void __user *) arg;
711711 struct mpt_ioctl_diag_reset krinfo;
712− MPT_ADAPTER *iocp;
713712
714713 if (copy_from_user(&krinfo, urinfo, sizeof(struct mpt_ioctl_diag_reset))) {
715714 printk(KERN_ERR MYNAM "%s@%d::mptctl_do_reset - "
@@ -718,12 +717,6 @@ static int mptctl_do_reset(unsigned long arg) · 2 unmodified lines
718717 return -EFAULT;
719718 }
720719
721− if (mpt_verify_adapter(krinfo.hdr.iocnum, &iocp) < 0) {
722− printk(KERN_DEBUG MYNAM "%s@%d::mptctl_do_reset - ioc%d not found!\n",
723− __FILE__, __LINE__, krinfo.hdr.iocnum);
724− return -ENODEV; /* (-6) No such device or address */
725− }
726−
727720 dctlprintk(iocp, printk(MYIOC_s_DEBUG_FMT "mptctl_do_reset called.\n",
728721 iocp->name));
729722
@@ -754,7 +747,7 @@ static int mptctl_do_reset(unsigned long arg) · 24 unmodified lines
754747 * -ENOMSG if FW upload returned bad status
755748 */
756749 static int
757−mptctl_fw_download(unsigned long arg)
750+mptctl_fw_download(MPT_ADAPTER *iocp, unsigned long arg)
758751 {
759752 struct mpt_fw_xfer __user *ufwdl = (void __user *) arg;
760753 struct mpt_fw_xfer kfwdl;
@@ -766,7 +759,7 @@ mptctl_fw_download(unsigned long arg) · 5 unmodified lines
766759 return -EFAULT;
767760 }
768761
769− return mptctl_do_fw_download(kfwdl.iocnum, kfwdl.bufp, kfwdl.fwlen);
762+ return mptctl_do_fw_download(iocp, kfwdl.bufp, kfwdl.fwlen);
770763 }
771764
772765 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
@@ -784,11 +777,10 @@ mptctl_fw_download(unsigned long arg) · 11 unmodified lines
784777 * -ENOMSG if FW upload returned bad status
785778 */
786779 static int
787−mptctl_do_fw_download(int ioc, char __user *ufwbuf, size_t fwlen)
780+mptctl_do_fw_download(MPT_ADAPTER *iocp, char __user *ufwbuf, size_t fwlen)
788781 {
789782 FWDownload_t *dlmsg;
790783 MPT_FRAME_HDR *mf;
791− MPT_ADAPTER *iocp;
792784 FWDownloadTCSGE_t *ptsge;
793785 MptSge_t *sgl, *sgIn;
794786 char *sgOut;
@@ -808,17 +800,10 @@ mptctl_do_fw_download(int ioc, char __user *ufwbuf, size_t fwlen) · 13 unmodified lines
808800 pFWDownloadReply_t ReplyMsg = NULL;
809801 unsigned long timeleft;
810802
811− if (mpt_verify_adapter(ioc, &iocp) < 0) {
812− printk(KERN_DEBUG MYNAM "ioctl_fwdl - ioc%d not found!\n",
813− ioc);
814− return -ENODEV; /* (-6) No such device or address */
815− } else {
816−
817− /* Valid device. Get a message frame and construct the FW download message.
818− */
819− if ((mf = mpt_get_msg_frame(mptctl_id, iocp)) == NULL)
820− return -EAGAIN;
821− }
803+ /* Valid device. Get a message frame and construct the FW download message.
804+ */
805+ if ((mf = mpt_get_msg_frame(mptctl_id, iocp)) == NULL)
806+ return -EAGAIN;
822807
823808 dctlprintk(iocp, printk(MYIOC_s_DEBUG_FMT
824809 "mptctl_do_fwdl called. mptctl_id = %xh.\n", iocp->name, mptctl_id));
@@ -826,8 +811,6 @@ mptctl_do_fw_download(int ioc, char __user *ufwbuf, size_t fwlen) · 1 unmodified line
826811 iocp->name, ufwbuf));
827812 dctlprintk(iocp, printk(MYIOC_s_DEBUG_FMT "DbG: kfwdl.fwlen = %d\n",
828813 iocp->name, (int)fwlen));
829− dctlprintk(iocp, printk(MYIOC_s_DEBUG_FMT "DbG: kfwdl.ioc = %04xh\n",
830− iocp->name, ioc));
831814
832815 dlmsg = (FWDownload_t*) mf;
833816 ptsge = (FWDownloadTCSGE_t *) &dlmsg->SGL;
@@ -1238,13 +1221,11 @@ kfree_sgl(MptSge_t *sgl, dma_addr_t sgl_dma, struct buflist *buflist, MPT_ADAPTE · 404 unmodified lines
12381221 * -ENODEV if no such device/adapter
12391222 */
12401223 static int
1241−mptctl_getiocinfo (unsigned long arg, unsigned int data_size)
1224+mptctl_getiocinfo (MPT_ADAPTER *ioc, unsigned long arg, unsigned int data_size)
12421225 {
12431226 struct mpt_ioctl_iocinfo __user *uarg = (void __user *) arg;
12441227 struct mpt_ioctl_iocinfo *karg;
1245− MPT_ADAPTER *ioc;
12461228 struct pci_dev *pdev;
1247− int iocnum;
12481229 unsigned int port;
12491230 int cim_rev;
12501231 struct scsi_device *sdev;
@@ -1272,14 +1253,6 @@ mptctl_getiocinfo (unsigned long arg, unsigned int data_size) · 21 unmodified lines
12721253 return PTR_ERR(karg);
12731254 }
12741255
1275− if (((iocnum = mpt_verify_adapter(karg->hdr.iocnum, &ioc)) < 0) ||
1276− (ioc == NULL)) {
1277− printk(KERN_DEBUG MYNAM "%s::mptctl_getiocinfo() @%d - ioc%d not found!\n",
1278− __FILE__, __LINE__, iocnum);
1279− kfree(karg);
1280− return -ENODEV;
1281− }
1282−
12831256 /* Verify the data transfer size is correct. */
12841257 if (karg->hdr.maxDataSize != data_size) {
12851258 printk(MYIOC_s_ERR_FMT "%s@%d::mptctl_getiocinfo - "
@@ -1385,15 +1358,13 @@ mptctl_getiocinfo (unsigned long arg, unsigned int data_size) · 99 unmodified lines
13851358 * -ENODEV if no such device/adapter
13861359 */
13871360 static int
1388−mptctl_gettargetinfo (unsigned long arg)
1361+mptctl_gettargetinfo (MPT_ADAPTER *ioc, unsigned long arg)
13891362 {
13901363 struct mpt_ioctl_targetinfo __user *uarg = (void __user *) arg;
13911364 struct mpt_ioctl_targetinfo karg;
1392− MPT_ADAPTER *ioc;
13931365 VirtDevice *vdevice;
13941366 char *pmem;
13951367 int *pdata;
1396− int iocnum;
13971368 int numDevices = 0;
13981369 int lun;
13991370 int maxWordsLeft;
@@ -1408,13 +1379,6 @@ mptctl_gettargetinfo (unsigned long arg) · 8 unmodified lines
14081379 return -EFAULT;
14091380 }
14101381
1411− if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) ||
1412− (ioc == NULL)) {
1413− printk(KERN_DEBUG MYNAM "%s::mptctl_gettargetinfo() @%d - ioc%d not found!\n",
1414− __FILE__, __LINE__, iocnum);
1415− return -ENODEV;
1416− }
1417−
14181382 dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_gettargetinfo called.\n",
14191383 ioc->name));
14201384 /* Get the port number and set the maximum number of bytes
@@ -1510,12 +1474,10 @@ mptctl_gettargetinfo (unsigned long arg) · 89 unmodified lines
15101474 * -ENODEV if no such device/adapter
15111475 */
15121476 static int
1513−mptctl_readtest (unsigned long arg)
1477+mptctl_readtest (MPT_ADAPTER *ioc, unsigned long arg)
15141478 {
15151479 struct mpt_ioctl_test __user *uarg = (void __user *) arg;
15161480 struct mpt_ioctl_test karg;
1517− MPT_ADAPTER *ioc;
1518− int iocnum;
15191481
15201482 if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_test))) {
15211483 printk(KERN_ERR MYNAM "%s@%d::mptctl_readtest - "
@@ -1524,13 +1486,6 @@ mptctl_readtest (unsigned long arg) · 2 unmodified lines
15241486 return -EFAULT;
15251487 }
15261488
1527− if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) ||
1528− (ioc == NULL)) {
1529− printk(KERN_DEBUG MYNAM "%s::mptctl_readtest() @%d - ioc%d not found!\n",
1530− __FILE__, __LINE__, iocnum);
1531− return -ENODEV;
1532− }
1533−
15341489 dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_readtest called.\n",
15351490 ioc->name));
15361491 /* Fill in the data and return the structure to the calling
@@ -1571,12 +1526,10 @@ mptctl_readtest (unsigned long arg) · 34 unmodified lines
15711526 * -ENODEV if no such device/adapter
15721527 */
15731528 static int
1574−mptctl_eventquery (unsigned long arg)
1529+mptctl_eventquery (MPT_ADAPTER *ioc, unsigned long arg)
15751530 {
15761531 struct mpt_ioctl_eventquery __user *uarg = (void __user *) arg;
15771532 struct mpt_ioctl_eventquery karg;
1578− MPT_ADAPTER *ioc;
1579− int iocnum;
15801533
15811534 if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_eventquery))) {
15821535 printk(KERN_ERR MYNAM "%s@%d::mptctl_eventquery - "
@@ -1585,13 +1538,6 @@ mptctl_eventquery (unsigned long arg) · 2 unmodified lines
15851538 return -EFAULT;
15861539 }
15871540
1588− if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) ||
1589− (ioc == NULL)) {
1590− printk(KERN_DEBUG MYNAM "%s::mptctl_eventquery() @%d - ioc%d not found!\n",
1591− __FILE__, __LINE__, iocnum);
1592− return -ENODEV;
1593− }
1594−
15951541 dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_eventquery called.\n",
15961542 ioc->name));
15971543 karg.eventEntries = MPTCTL_EVENT_LOG_SIZE;
@@ -1610,12 +1556,10 @@ mptctl_eventquery (unsigned long arg) · 12 unmodified lines
16101556
16111557 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
16121558 static int
1613−mptctl_eventenable (unsigned long arg)
1559+mptctl_eventenable (MPT_ADAPTER *ioc, unsigned long arg)
16141560 {
16151561 struct mpt_ioctl_eventenable __user *uarg = (void __user *) arg;
16161562 struct mpt_ioctl_eventenable karg;
1617− MPT_ADAPTER *ioc;
1618− int iocnum;
16191563
16201564 if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_eventenable))) {
16211565 printk(KERN_ERR MYNAM "%s@%d::mptctl_eventenable - "
@@ -1624,13 +1568,6 @@ mptctl_eventenable (unsigned long arg) · 2 unmodified lines
16241568 return -EFAULT;
16251569 }
16261570
1627− if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) ||
1628− (ioc == NULL)) {
1629− printk(KERN_DEBUG MYNAM "%s::mptctl_eventenable() @%d - ioc%d not found!\n",
1630− __FILE__, __LINE__, iocnum);
1631− return -ENODEV;
1632− }
1633−
16341571 dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_eventenable called.\n",
16351572 ioc->name));
16361573 if (ioc->events == NULL) {
@@ -1658,12 +1595,10 @@ mptctl_eventenable (unsigned long arg) · 21 unmodified lines
16581595
16591596 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
16601597 static int
1661−mptctl_eventreport (unsigned long arg)
1598+mptctl_eventreport (MPT_ADAPTER *ioc, unsigned long arg)
16621599 {
16631600 struct mpt_ioctl_eventreport __user *uarg = (void __user *) arg;
16641601 struct mpt_ioctl_eventreport karg;
1665− MPT_ADAPTER *ioc;
1666− int iocnum;
16671602 int numBytes, maxEvents, max;
16681603
16691604 if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_eventreport))) {
@@ -1673,12 +1608,6 @@ mptctl_eventreport (unsigned long arg) · 3 unmodified lines
16731608 return -EFAULT;
16741609 }
16751610
1676− if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) ||
1677− (ioc == NULL)) {
1678− printk(KERN_DEBUG MYNAM "%s::mptctl_eventreport() @%d - ioc%d not found!\n",
1679− __FILE__, __LINE__, iocnum);
1680− return -ENODEV;
1681− }
16821611 dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_eventreport called.\n",
16831612 ioc->name));
16841613
@@ -1712,12 +1641,10 @@ mptctl_eventreport (unsigned long arg) · 27 unmodified lines
17121641
17131642 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
17141643 static int
1715−mptctl_replace_fw (unsigned long arg)
1644+mptctl_replace_fw (MPT_ADAPTER *ioc, unsigned long arg)
17161645 {
17171646 struct mpt_ioctl_replace_fw __user *uarg = (void __user *) arg;
17181647 struct mpt_ioctl_replace_fw karg;
1719− MPT_ADAPTER *ioc;
1720− int iocnum;
17211648 int newFwSize;
17221649
17231650 if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_replace_fw))) {
@@ -1727,13 +1654,6 @@ mptctl_replace_fw (unsigned long arg) · 3 unmodified lines
17271654 return -EFAULT;
17281655 }
17291656
1730− if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) ||
1731− (ioc == NULL)) {
1732− printk(KERN_DEBUG MYNAM "%s::mptctl_replace_fw() @%d - ioc%d not found!\n",
1733− __FILE__, __LINE__, iocnum);
1734− return -ENODEV;
1735− }
1736−
17371657 dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_replace_fw called.\n",
17381658 ioc->name));
17391659 /* If caching FW, Free the old FW image
@@ -1780,12 +1700,10 @@ mptctl_replace_fw (unsigned long arg) · 40 unmodified lines
17801700 * -ENOMEM if memory allocation error
17811701 */
17821702 static int
1783−mptctl_mpt_command (unsigned long arg)
1703+mptctl_mpt_command (MPT_ADAPTER *ioc, unsigned long arg)
17841704 {
17851705 struct mpt_ioctl_command __user *uarg = (void __user *) arg;
17861706 struct mpt_ioctl_command karg;
1787− MPT_ADAPTER *ioc;
1788− int iocnum;
17891707 int rc;
17901708
17911709
@@ -1796,14 +1714,7 @@ mptctl_mpt_command (unsigned long arg) · 4 unmodified lines
17961714 return -EFAULT;
17971715 }
17981716
1799− if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) ||
1800− (ioc == NULL)) {
1801− printk(KERN_DEBUG MYNAM "%s::mptctl_mpt_command() @%d - ioc%d not found!\n",
1802− __FILE__, __LINE__, iocnum);
1803− return -ENODEV;
1804− }
1805−
1806− rc = mptctl_do_mpt_command (karg, &uarg->MF);
1717+ rc = mptctl_do_mpt_command (ioc, karg, &uarg->MF);
18071718
18081719 return rc;
18091720 }
@@ -1821,9 +1732,8 @@ mptctl_mpt_command (unsigned long arg) · 11 unmodified lines
18211732 * -EPERM if SCSI I/O and target is untagged
18221733 */
18231734 static int
1824−mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr)
1735+mptctl_do_mpt_command (MPT_ADAPTER *ioc, struct mpt_ioctl_command karg, void __user *mfPtr)
18251736 {
1826− MPT_ADAPTER *ioc;
18271737 MPT_FRAME_HDR *mf = NULL;
18281738 MPIHeader_t *hdr;
18291739 char *psge;
@@ -1832,7 +1742,7 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr) · 2 unmodified lines
18321742 dma_addr_t dma_addr_in;
18331743 dma_addr_t dma_addr_out;
18341744 int sgSize = 0; /* Num SG elements */
1835− int iocnum, flagsLength;
1745+ int flagsLength;
18361746 int sz, rc = 0;
18371747 int msgContext;
18381748 u16 req_idx;
@@ -1847,13 +1757,6 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr) · 8 unmodified lines
18471757 bufIn.kptr = bufOut.kptr = NULL;
18481758 bufIn.len = bufOut.len = 0;
18491759
1850− if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) ||
1851− (ioc == NULL)) {
1852− printk(KERN_DEBUG MYNAM "%s::mptctl_do_mpt_command() @%d - ioc%d not found!\n",
1853− __FILE__, __LINE__, iocnum);
1854− return -ENODEV;
1855− }
1856−
18571760 spin_lock_irqsave(&ioc->taskmgmt_lock, flags);
18581761 if (ioc->ioc_reset_in_progress) {
18591762 spin_unlock_irqrestore(&ioc->taskmgmt_lock, flags);
@@ -2418,17 +2321,15 @@ done_free_mem: · 558 unmodified lines
24182321 * -ENOMEM if memory allocation error
24192322 */
24202323 static int
2421−mptctl_hp_hostinfo(unsigned long arg, unsigned int data_size)
2324+mptctl_hp_hostinfo(MPT_ADAPTER *ioc, unsigned long arg, unsigned int data_size)
24222325 {
24232326 hp_host_info_t __user *uarg = (void __user *) arg;
2424− MPT_ADAPTER *ioc;
24252327 struct pci_dev *pdev;
24262328 char *pbuf=NULL;
24272329 dma_addr_t buf_dma;
24282330 hp_host_info_t karg;
24292331 CONFIGPARMS cfg;
24302332 ConfigPageHeader_t hdr;
2431− int iocnum;
24322333 int rc, cim_rev;
24332334 ToolboxIstwiReadWriteRequest_t *IstwiRWRequest;
24342335 MPT_FRAME_HDR *mf = NULL;
@@ -2452,12 +2353,6 @@ mptctl_hp_hostinfo(unsigned long arg, unsigned int data_size) · 17 unmodified lines
24522353 return -EFAULT;
24532354 }
24542355
2455− if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) ||
2456− (ioc == NULL)) {
2457− printk(KERN_DEBUG MYNAM "%s::mptctl_hp_hostinfo() @%d - ioc%d not found!\n",
2458− __FILE__, __LINE__, iocnum);
2459− return -ENODEV;
2460− }
24612356 dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT ": mptctl_hp_hostinfo called.\n",
24622357 ioc->name));
24632358
@@ -2659,15 +2554,13 @@ retry_wait: · 195 unmodified lines
26592554 * -ENOMEM if memory allocation error
26602555 */
26612556 static int
2662−mptctl_hp_targetinfo(unsigned long arg)
2557+mptctl_hp_targetinfo(MPT_ADAPTER *ioc, unsigned long arg)
26632558 {
26642559 hp_target_info_t __user *uarg = (void __user *) arg;
26652560 SCSIDevicePage0_t *pg0_alloc;
26662561 SCSIDevicePage3_t *pg3_alloc;
2667− MPT_ADAPTER *ioc;
26682562 MPT_SCSI_HOST *hd = NULL;
26692563 hp_target_info_t karg;
2670− int iocnum;
26712564 int data_sz;
26722565 dma_addr_t page_dma;
26732566 CONFIGPARMS cfg;
@@ -2681,12 +2574,6 @@ mptctl_hp_targetinfo(unsigned long arg) · 7 unmodified lines
26812574 return -EFAULT;
26822575 }
26832576
2684− if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) ||
2685− (ioc == NULL)) {
2686− printk(KERN_DEBUG MYNAM "%s::mptctl_hp_targetinfo() @%d - ioc%d not found!\n",
2687− __FILE__, __LINE__, iocnum);
2688− return -ENODEV;
2689− }
26902577 if (karg.hdr.id >= MPT_MAX_FC_DEVICES)
26912578 return -EINVAL;
26922579 dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_hp_targetinfo called.\n",
@@ -2854,7 +2741,7 @@ compat_mptfwxfer_ioctl(struct file *filp, unsigned int cmd, · 161 unmodified lines
28542741 kfw.fwlen = kfw32.fwlen;
28552742 kfw.bufp = compat_ptr(kfw32.bufp);
28562743
2857− ret = mptctl_do_fw_download(kfw.iocnum, kfw.bufp, kfw.fwlen);
2744+ ret = mptctl_do_fw_download(iocp, kfw.bufp, kfw.fwlen);
28582745
28592746 mutex_unlock(&iocp->ioctl_cmds.mutex);
28602747
@@ -2908,7 +2795,7 @@ compat_mpt_command(struct file *filp, unsigned int cmd, · 47 unmodified lines
29082795
29092796 /* Pass new structure to do_mpt_command
29102797 */
2911− ret = mptctl_do_mpt_command (karg, &uarg->MF);
2798+ ret = mptctl_do_mpt_command (iocp, karg, &uarg->MF);
29122799
29132800 mutex_unlock(&iocp->ioctl_cmds.mutex);
29142801
drivers/misc/enclosure.c+1−2
@@ -406,10 +406,9 @@ int enclosure_remove_device(struct enclosure_device *edev, struct device *dev) · 405 unmodified lines
406406 cdev = &edev->component[i];
407407 if (cdev->dev == dev) {
408408 enclosure_remove_links(cdev);
409− device_del(&cdev->cdev);
410409 put_device(dev);
411410 cdev->dev = NULL;
412− return device_add(&cdev->cdev);
411+ return 0;
413412 }
414413 }
415414 return -ENODEV;
drivers/misc/lkdtm/bugs.c+7−5
@@ -278,7 +278,7 @@ void lkdtm_STACK_GUARD_PAGE_TRAILING(void) · 277 unmodified lines
278278
279279 void lkdtm_UNSET_SMEP(void)
280280 {
281−#ifdef CONFIG_X86_64
281+#if IS_ENABLED(CONFIG_X86_64) && !IS_ENABLED(CONFIG_UML)
282282 #define MOV_CR4_DEPTH 64
283283 void (*direct_write_cr4)(unsigned long val);
284284 unsigned char *insn;
@@ -338,13 +338,13 @@ void lkdtm_UNSET_SMEP(void) · 53 unmodified lines
338338 native_write_cr4(cr4);
339339 }
340340 #else
341− pr_err("FAIL: this test is x86_64-only\n");
341+ pr_err("XFAIL: this test is x86_64-only\n");
342342 #endif
343343 }
344344
345−#ifdef CONFIG_X86_32
346345 void lkdtm_DOUBLE_FAULT(void)
347346 {
347+#ifdef CONFIG_X86_32
348348 /*
349349 * Trigger #DF by setting the stack limit to zero. This clobbers
350350 * a GDT TLS slot, which is okay because the current task will die
@@ -373,6 +373,8 @@ void lkdtm_DOUBLE_FAULT(void) · 22 unmodified lines
373373 asm volatile ("movw %0, %%ss; addl $0, (%%esp)" ::
374374 "r" ((unsigned short)(GDT_ENTRY_TLS_MIN << 3)));
375375
376− panic("tried to double fault but didn't die\n");
377−}
376+ pr_err("FAIL: tried to double fault but didn't die\n");
377+#else
378+ pr_err("XFAIL: this test is ia32-only\n");
378379 #endif
380+}
drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c+10−1
@@ -148,6 +148,10 @@ static int gpmi_init(struct gpmi_nand_data *this) · 147 unmodified lines
148148 struct resources *r = &this->resources;
149149 int ret;
150150
151+ ret = pm_runtime_get_sync(this->dev);
152+ if (ret < 0)
153+ return ret;
154+
151155 ret = gpmi_reset_block(r->gpmi_regs, false);
152156 if (ret)
153157 goto err_out;
@@ -179,8 +183,9 @@ static int gpmi_init(struct gpmi_nand_data *this) · 25 unmodified lines
179183 */
180184 writel(BM_GPMI_CTRL1_DECOUPLE_CS, r->gpmi_regs + HW_GPMI_CTRL1_SET);
181185
182− return 0;
183186 err_out:
187+ pm_runtime_mark_last_busy(this->dev);
188+ pm_runtime_put_autosuspend(this->dev);
184189 return ret;
185190 }
186191
@@ -2722,6 +2727,10 @@ static int gpmi_pm_resume(struct device *dev) · 2535 unmodified lines
27222727 return ret;
27232728 }
27242729
2730+ /* Set flag to get timing setup restored for next exec_op */
2731+ if (this->hw.clk_rate)
2732+ this->hw.must_apply_timings = true;
2733+
27252734 /* re-init the BCH registers */
27262735 ret = bch_set_geometry(this);
27272736 if (ret) {
drivers/mtd/spi-nor/spi-nor.c+3−3
@@ -2124,6 +2124,8 @@ static int spi_nor_sr2_bit1_quad_enable(struct spi_nor *nor) · 2123 unmodified lines
21242124 if (nor->bouncebuf[0] & SR2_QUAD_EN_BIT1)
21252125 return 0;
21262126
2127+ nor->bouncebuf[0] |= SR2_QUAD_EN_BIT1;
2128+
21272129 return spi_nor_write_16bit_cr_and_check(nor, nor->bouncebuf[0]);
21282130 }
21292131
@@ -4769,9 +4771,7 @@ static void spi_nor_info_init_params(struct spi_nor *nor) · 2639 unmodified lines
47694771
47704772 static void spansion_post_sfdp_fixups(struct spi_nor *nor)
47714773 {
4772− struct mtd_info *mtd = &nor->mtd;
4773−
4774− if (mtd->size <= SZ_16M)
4774+ if (nor->params.size <= SZ_16M)
47754775 return;
47764776
47774777 nor->flags |= SNOR_F_4B_OPCODES;
drivers/net/dsa/bcm_sf2.c+1−1
@@ -68,7 +68,7 @@ static void bcm_sf2_imp_setup(struct dsa_switch *ds, int port) · 67 unmodified lines
6868
6969 /* Force link status for IMP port */
7070 reg = core_readl(priv, offset);
71− reg |= (MII_SW_OR | LINK_STS);
71+ reg |= (MII_SW_OR | LINK_STS | GMII_SPEED_UP_2G);
7272 core_writel(priv, reg, offset);
7373
7474 /* Enable Broadcast, Multicast, Unicast forwarding to IMP port */
drivers/net/dsa/sja1105/sja1105_main.c+1−1
@@ -582,7 +582,7 @@ static int sja1105_parse_ports_node(struct sja1105_private *priv, · 581 unmodified lines
582582 struct device *dev = &priv->spidev->dev;
583583 struct device_node *child;
584584
585− for_each_child_of_node(ports_node, child) {
585+ for_each_available_child_of_node(ports_node, child) {
586586 struct device_node *phy_node;
587587 phy_interface_t phy_mode;
588588 u32 index;
drivers/net/ethernet/broadcom/bcmsysport.c+4−3
@@ -2323,7 +2323,7 @@ static int bcm_sysport_map_queues(struct notifier_block *nb, · 2322 unmodified lines
23232323 ring->switch_queue = qp;
23242324 ring->switch_port = port;
23252325 ring->inspect = true;
2326− priv->ring_map[q + port * num_tx_queues] = ring;
2326+ priv->ring_map[qp + port * num_tx_queues] = ring;
23272327 qp++;
23282328 }
23292329
@@ -2338,7 +2338,7 @@ static int bcm_sysport_unmap_queues(struct notifier_block *nb, · 8 unmodified lines
23382338 struct net_device *slave_dev;
23392339 unsigned int num_tx_queues;
23402340 struct net_device *dev;
2341− unsigned int q, port;
2341+ unsigned int q, qp, port;
23422342
23432343 priv = container_of(nb, struct bcm_sysport_priv, dsa_notifier);
23442344 if (priv->netdev != info->master)
@@ -2364,7 +2364,8 @@ static int bcm_sysport_unmap_queues(struct notifier_block *nb, · 19 unmodified lines
23642364 continue;
23652365
23662366 ring->inspect = false;
2367− priv->ring_map[q + port * num_tx_queues] = NULL;
2367+ qp = ring->switch_queue;
2368+ priv->ring_map[qp + port * num_tx_queues] = NULL;
23682369 }
23692370
23702371 return 0;
drivers/net/ethernet/broadcom/bnxt/bnxt.c+20−9
@@ -11065,11 +11065,23 @@ static bool bnxt_fltr_match(struct bnxt_ntuple_filter *f1, · 11064 unmodified lines
1106511065 struct flow_keys *keys1 = &f1->fkeys;
1106611066 struct flow_keys *keys2 = &f2->fkeys;
1106711067
11068− if (keys1->addrs.v4addrs.src == keys2->addrs.v4addrs.src &&
11069− keys1->addrs.v4addrs.dst == keys2->addrs.v4addrs.dst &&
11070− keys1->ports.ports == keys2->ports.ports &&
11071− keys1->basic.ip_proto == keys2->basic.ip_proto &&
11072− keys1->basic.n_proto == keys2->basic.n_proto &&
11068+ if (keys1->basic.n_proto != keys2->basic.n_proto ||
11069+ keys1->basic.ip_proto != keys2->basic.ip_proto)
11070+ return false;
11071+
11072+ if (keys1->basic.n_proto == htons(ETH_P_IP)) {
11073+ if (keys1->addrs.v4addrs.src != keys2->addrs.v4addrs.src ||
11074+ keys1->addrs.v4addrs.dst != keys2->addrs.v4addrs.dst)
11075+ return false;
11076+ } else {
11077+ if (memcmp(&keys1->addrs.v6addrs.src, &keys2->addrs.v6addrs.src,
11078+ sizeof(keys1->addrs.v6addrs.src)) ||
11079+ memcmp(&keys1->addrs.v6addrs.dst, &keys2->addrs.v6addrs.dst,
11080+ sizeof(keys1->addrs.v6addrs.dst)))
11081+ return false;
11082+ }
11083+
11084+ if (keys1->ports.ports == keys2->ports.ports &&
1107311085 keys1->control.flags == keys2->control.flags &&
1107411086 ether_addr_equal(f1->src_mac_addr, f2->src_mac_addr) &&
1107511087 ether_addr_equal(f1->dst_mac_addr, f2->dst_mac_addr))
@@ -11361,7 +11373,7 @@ int bnxt_get_port_parent_id(struct net_device *dev, · 285 unmodified lines
1136111373 return -EOPNOTSUPP;
1136211374
1136311375 /* The PF and it's VF-reps only support the switchdev framework */
11364− if (!BNXT_PF(bp))
11376+ if (!BNXT_PF(bp) || !(bp->flags & BNXT_FLAG_DSN_VALID))
1136511377 return -EOPNOTSUPP;
1136611378
1136711379 ppid->id_len = sizeof(bp->switch_id);
@@ -11734,6 +11746,7 @@ static int bnxt_pcie_dsn_get(struct bnxt *bp, u8 dsn[]) · 366 unmodified lines
1173411746 put_unaligned_le32(dw, &dsn[0]);
1173511747 pci_read_config_dword(pdev, pos + 4, &dw);
1173611748 put_unaligned_le32(dw, &dsn[4]);
11749+ bp->flags |= BNXT_FLAG_DSN_VALID;
1173711750 return 0;
1173811751 }
1173911752
@@ -11845,9 +11858,7 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) · 105 unmodified lines
1184511858
1184611859 if (BNXT_PF(bp)) {
1184711860 /* Read the adapter's DSN to use as the eswitch switch_id */
11848− rc = bnxt_pcie_dsn_get(bp, bp->switch_id);
11849− if (rc)
11850− goto init_err_pci_clean;
11861+ bnxt_pcie_dsn_get(bp, bp->switch_id);
1185111862 }
1185211863
1185311864 /* MTU range: 60 - FW defined max */
drivers/net/ethernet/broadcom/bnxt/bnxt.h+1−3
@@ -1532,6 +1532,7 @@ struct bnxt { · 1531 unmodified lines
15321532 #define BNXT_FLAG_NO_AGG_RINGS 0x20000
15331533 #define BNXT_FLAG_RX_PAGE_MODE 0x40000
15341534 #define BNXT_FLAG_MULTI_HOST 0x100000
1535+ #define BNXT_FLAG_DSN_VALID 0x200000
15351536 #define BNXT_FLAG_DOUBLE_DB 0x400000
15361537 #define BNXT_FLAG_CHIP_NITRO_A0 0x1000000
15371538 #define BNXT_FLAG_DIM 0x2000000
@@ -1936,9 +1937,6 @@ static inline bool bnxt_cfa_hwrm_message(u16 req_type) · 398 unmodified lines
19361937 case HWRM_CFA_ENCAP_RECORD_FREE:
19371938 case HWRM_CFA_DECAP_FILTER_ALLOC:
19381939 case HWRM_CFA_DECAP_FILTER_FREE:
1939− case HWRM_CFA_NTUPLE_FILTER_ALLOC:
1940− case HWRM_CFA_NTUPLE_FILTER_FREE:
1941− case HWRM_CFA_NTUPLE_FILTER_CFG:
19421940 case HWRM_CFA_EM_FLOW_ALLOC:
19431941 case HWRM_CFA_EM_FLOW_FREE:
19441942 case HWRM_CFA_EM_FLOW_CFG:
drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c+3−0
@@ -398,6 +398,9 @@ static int bnxt_vf_reps_create(struct bnxt *bp) · 397 unmodified lines
398398 struct net_device *dev;
399399 int rc, i;
400400
401+ if (!(bp->flags & BNXT_FLAG_DSN_VALID))
402+ return -ENODEV;
403+
401404 bp->vf_reps = kcalloc(num_vfs, sizeof(vf_rep), GFP_KERNEL);
402405 if (!bp->vf_reps)
403406 return -ENOMEM;
drivers/net/ethernet/cadence/macb_main.c+17−13
@@ -611,21 +611,24 @@ static const struct phylink_mac_ops macb_phylink_ops = { · 610 unmodified lines
611611 .mac_link_up = macb_mac_link_up,
612612 };
613613
614+static bool macb_phy_handle_exists(struct device_node *dn)
615+{
616+ dn = of_parse_phandle(dn, "phy-handle", 0);
617+ of_node_put(dn);
618+ return dn != NULL;
619+}
620+
614621 static int macb_phylink_connect(struct macb *bp)
615622 {
623+ struct device_node *dn = bp->pdev->dev.of_node;
616624 struct net_device *dev = bp->dev;
617625 struct phy_device *phydev;
618626 int ret;
619627
620− if (bp->pdev->dev.of_node &&
621− of_parse_phandle(bp->pdev->dev.of_node, "phy-handle", 0)) {
622− ret = phylink_of_phy_connect(bp->phylink, bp->pdev->dev.of_node,
623− 0);
624− if (ret) {
625− netdev_err(dev, "Could not attach PHY (%d)\n", ret);
626− return ret;
627− }
628− } else {
628+ if (dn)
629+ ret = phylink_of_phy_connect(bp->phylink, dn, 0);
630+
631+ if (!dn || (ret && !macb_phy_handle_exists(dn))) {
629632 phydev = phy_find_first(bp->mii_bus);
630633 if (!phydev) {
631634 netdev_err(dev, "no PHY found\n");
@@ -634,10 +637,11 @@ static int macb_phylink_connect(struct macb *bp) · 2 unmodified lines
634637
635638 /* attach the mac to the phy */
636639 ret = phylink_connect_phy(bp->phylink, phydev);
637− if (ret) {
638− netdev_err(dev, "Could not attach to PHY (%d)\n", ret);
639− return ret;
640− }
640+ }
641+
642+ if (ret) {
643+ netdev_err(dev, "Could not attach PHY (%d)\n", ret);
644+ return ret;
641645 }
642646
643647 phylink_start(bp->phylink);
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c+11−3
@@ -3135,9 +3135,9 @@ static int cxgb_set_tx_maxrate(struct net_device *dev, int index, u32 rate) · 3134 unmodified lines
31353135 {
31363136 struct port_info *pi = netdev_priv(dev);
31373137 struct adapter *adap = pi->adapter;
3138+ struct ch_sched_queue qe = { 0 };
3139+ struct ch_sched_params p = { 0 };
31383140 struct sched_class *e;
3139− struct ch_sched_params p;
3140− struct ch_sched_queue qe;
31413141 u32 req_rate;
31423142 int err = 0;
31433143
@@ -3154,6 +3154,15 @@ static int cxgb_set_tx_maxrate(struct net_device *dev, int index, u32 rate) · 10 unmodified lines
31543154 return -EINVAL;
31553155 }
31563156
3157+ qe.queue = index;
3158+ e = cxgb4_sched_queue_lookup(dev, &qe);
3159+ if (e && e->info.u.params.level != SCHED_CLASS_LEVEL_CL_RL) {
3160+ dev_err(adap->pdev_dev,
3161+ "Queue %u already bound to class %u of type: %u\n",
3162+ index, e->idx, e->info.u.params.level);
3163+ return -EBUSY;
3164+ }
3165+
31573166 /* Convert from Mbps to Kbps */
31583167 req_rate = rate * 1000;
31593168
@@ -3183,7 +3192,6 @@ static int cxgb_set_tx_maxrate(struct net_device *dev, int index, u32 rate) · 23 unmodified lines
31833192 return 0;
31843193
31853194 /* Fetch any available unused or matching scheduling class */
3186− memset(&p, 0, sizeof(p));
31873195 p.type = SCHED_CLASS_TYPE_PACKET;
31883196 p.u.params.level = SCHED_CLASS_LEVEL_CL_RL;
31893197 p.u.params.mode = SCHED_CLASS_MODE_CLASS;
drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_matchall.c+67−0
@@ -15,6 +15,8 @@ static int cxgb4_matchall_egress_validate(struct net_device *dev, · 14 unmodified lines
1515 struct flow_action *actions = &cls->rule->action;
1616 struct port_info *pi = netdev2pinfo(dev);
1717 struct flow_action_entry *entry;
18+ struct ch_sched_queue qe;
19+ struct sched_class *e;
1820 u64 max_link_rate;
1921 u32 i, speed;
2022 int ret;
@@ -60,9 +62,61 @@ static int cxgb4_matchall_egress_validate(struct net_device *dev, · 39 unmodified lines
6062 }
6163 }
6264
65+ for (i = 0; i < pi->nqsets; i++) {
66+ memset(&qe, 0, sizeof(qe));
67+ qe.queue = i;
68+
69+ e = cxgb4_sched_queue_lookup(dev, &qe);
70+ if (e && e->info.u.params.level != SCHED_CLASS_LEVEL_CH_RL) {
71+ NL_SET_ERR_MSG_MOD(extack,
72+ "Some queues are already bound to different class");
73+ return -EBUSY;
74+ }
75+ }
76+
6377 return 0;
6478 }
6579
80+static int cxgb4_matchall_tc_bind_queues(struct net_device *dev, u32 tc)
81+{
82+ struct port_info *pi = netdev2pinfo(dev);
83+ struct ch_sched_queue qe;
84+ int ret;
85+ u32 i;
86+
87+ for (i = 0; i < pi->nqsets; i++) {
88+ qe.queue = i;
89+ qe.class = tc;
90+ ret = cxgb4_sched_class_bind(dev, &qe, SCHED_QUEUE);
91+ if (ret)
92+ goto out_free;
93+ }
94+
95+ return 0;
96+
97+out_free:
98+ while (i--) {
99+ qe.queue = i;
100+ qe.class = SCHED_CLS_NONE;
101+ cxgb4_sched_class_unbind(dev, &qe, SCHED_QUEUE);
102+ }
103+
104+ return ret;
105+}
106+
107+static void cxgb4_matchall_tc_unbind_queues(struct net_device *dev)
108+{
109+ struct port_info *pi = netdev2pinfo(dev);
110+ struct ch_sched_queue qe;
111+ u32 i;
112+
113+ for (i = 0; i < pi->nqsets; i++) {
114+ qe.queue = i;
115+ qe.class = SCHED_CLS_NONE;
116+ cxgb4_sched_class_unbind(dev, &qe, SCHED_QUEUE);
117+ }
118+}
119+
66120 static int cxgb4_matchall_alloc_tc(struct net_device *dev,
67121 struct tc_cls_matchall_offload *cls)
68122 {
@@ -83,6 +137,7 @@ static int cxgb4_matchall_alloc_tc(struct net_device *dev, · 14 unmodified lines
83137 struct adapter *adap = netdev2adap(dev);
84138 struct flow_action_entry *entry;
85139 struct sched_class *e;
140+ int ret;
86141 u32 i;
87142
88143 tc_port_matchall = &adap->tc_matchall->port_matchall[pi->port_id];
@@ -101,10 +156,21 @@ static int cxgb4_matchall_alloc_tc(struct net_device *dev, · 12 unmodified lines
101156 return -ENOMEM;
102157 }
103158
159+ ret = cxgb4_matchall_tc_bind_queues(dev, e->idx);
160+ if (ret) {
161+ NL_SET_ERR_MSG_MOD(extack,
162+ "Could not bind queues to traffic class");
163+ goto out_free;
164+ }
165+
104166 tc_port_matchall->egress.hwtc = e->idx;
105167 tc_port_matchall->egress.cookie = cls->cookie;
106168 tc_port_matchall->egress.state = CXGB4_MATCHALL_STATE_ENABLED;
107169 return 0;
170+
171+out_free:
172+ cxgb4_sched_class_free(dev, e->idx);
173+ return ret;
108174 }
109175
110176 static void cxgb4_matchall_free_tc(struct net_device *dev)
@@ -114,6 +180,7 @@ static void cxgb4_matchall_free_tc(struct net_device *dev) · 3 unmodified lines
114180 struct adapter *adap = netdev2adap(dev);
115181
116182 tc_port_matchall = &adap->tc_matchall->port_matchall[pi->port_id];
183+ cxgb4_matchall_tc_unbind_queues(dev);
117184 cxgb4_sched_class_free(dev, tc_port_matchall->egress.hwtc);
118185
119186 tc_port_matchall->egress.hwtc = SCHED_CLS_NONE;
drivers/net/ethernet/chelsio/cxgb4/cxgb4_tc_mqprio.c+27−1
@@ -12,8 +12,9 @@ static int cxgb4_mqprio_validate(struct net_device *dev, · 11 unmodified lines
1212 struct port_info *pi = netdev2pinfo(dev);
1313 struct adapter *adap = netdev2adap(dev);
1414 u32 speed, qcount = 0, qoffset = 0;
15+ u32 start_a, start_b, end_a, end_b;
1516 int ret;
16− u8 i;
17+ u8 i, j;
1718
1819 if (!mqprio->qopt.num_tc)
1920 return 0;
@@ -47,6 +48,31 @@ static int cxgb4_mqprio_validate(struct net_device *dev, · 27 unmodified lines
4748 qoffset = max_t(u16, mqprio->qopt.offset[i], qoffset);
4849 qcount += mqprio->qopt.count[i];
4950
51+ start_a = mqprio->qopt.offset[i];
52+ end_a = start_a + mqprio->qopt.count[i] - 1;
53+ for (j = i + 1; j < mqprio->qopt.num_tc; j++) {
54+ start_b = mqprio->qopt.offset[j];
55+ end_b = start_b + mqprio->qopt.count[j] - 1;
56+
57+ /* If queue count is 0, then the traffic
58+ * belonging to this class will not use
59+ * ETHOFLD queues. So, no need to validate
60+ * further.
61+ */
62+ if (!mqprio->qopt.count[i])
63+ break;
64+
65+ if (!mqprio->qopt.count[j])
66+ continue;
67+
68+ if (max_t(u32, start_a, start_b) <=
69+ min_t(u32, end_a, end_b)) {
70+ netdev_err(dev,
71+ "Queues can't overlap across tc\n");
72+ return -EINVAL;
73+ }
74+ }
75+
5076 /* Convert byte per second to bits per second */
5177 min_rate += (mqprio->min_rate[i] * 8);
5278 max_rate += (mqprio->max_rate[i] * 8);
drivers/net/ethernet/chelsio/cxgb4/sched.c+16−0
@@ -165,6 +165,22 @@ static void *t4_sched_entry_lookup(struct port_info *pi, · 164 unmodified lines
165165 return found;
166166 }
167167
168+struct sched_class *cxgb4_sched_queue_lookup(struct net_device *dev,
169+ struct ch_sched_queue *p)
170+{
171+ struct port_info *pi = netdev2pinfo(dev);
172+ struct sched_queue_entry *qe = NULL;
173+ struct adapter *adap = pi->adapter;
174+ struct sge_eth_txq *txq;
175+
176+ if (p->queue < 0 || p->queue >= pi->nqsets)
177+ return NULL;
178+
179+ txq = &adap->sge.ethtxq[pi->first_qset + p->queue];
180+ qe = t4_sched_entry_lookup(pi, SCHED_QUEUE, txq->q.cntxt_id);
181+ return qe ? &pi->sched_tbl->tab[qe->param.class] : NULL;
182+}
183+
168184 static int t4_sched_queue_unbind(struct port_info *pi, struct ch_sched_queue *p)
169185 {
170186 struct sched_queue_entry *qe = NULL;
drivers/net/ethernet/chelsio/cxgb4/sched.h+2−0
@@ -103,6 +103,8 @@ static inline bool valid_class_id(struct net_device *dev, u8 class_id) · 102 unmodified lines
103103 return true;
104104 }
105105
106+struct sched_class *cxgb4_sched_queue_lookup(struct net_device *dev,
107+ struct ch_sched_queue *p);
106108 int cxgb4_sched_class_bind(struct net_device *dev, void *arg,
107109 enum sched_bind_type type);
108110 int cxgb4_sched_class_unbind(struct net_device *dev, void *arg,
drivers/net/ethernet/hisilicon/hns/hns_enet.c+1−3
@@ -565,7 +565,6 @@ static int hns_nic_poll_rx_skb(struct hns_nic_ring_data *ring_data, · 564 unmodified lines
565565 skb = *out_skb = napi_alloc_skb(&ring_data->napi,
566566 HNS_RX_HEAD_SIZE);
567567 if (unlikely(!skb)) {
568− netdev_err(ndev, "alloc rx skb fail\n");
569568 ring->stats.sw_err_cnt++;
570569 return -ENOMEM;
571570 }
@@ -1056,7 +1055,6 @@ static int hns_nic_common_poll(struct napi_struct *napi, int budget) · 484 unmodified lines
10561055 container_of(napi, struct hns_nic_ring_data, napi);
10571056 struct hnae_ring *ring = ring_data->ring;
10581057
1059−try_again:
10601058 clean_complete += ring_data->poll_one(
10611059 ring_data, budget - clean_complete,
10621060 ring_data->ex_process);
@@ -1066,7 +1064,7 @@ try_again: · 3 unmodified lines
10661064 napi_complete(napi);
10671065 ring->q->handle->dev->ops->toggle_ring_irq(ring, 0);
10681066 } else {
1069− goto try_again;
1067+ return budget;
10701068 }
10711069 }
10721070
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c+6−0
@@ -54,6 +54,8 @@ MODULE_PARM_DESC(debug, " Network interface message level setting"); · 53 unmodified lines
5454 #define HNS3_INNER_VLAN_TAG 1
5555 #define HNS3_OUTER_VLAN_TAG 2
5656
57+#define HNS3_MIN_TX_LEN 33U
58+
5759 /* hns3_pci_tbl - PCI Device ID Table
5860 *
5961 * Last entry must be all 0s
@@ -1405,6 +1407,10 @@ netdev_tx_t hns3_nic_net_xmit(struct sk_buff *skb, struct net_device *netdev) · 1345 unmodified lines
14051407 int bd_num = 0;
14061408 int ret;
14071409
1410+ /* Hardware can only handle short frames above 32 bytes */
1411+ if (skb_put_padto(skb, HNS3_MIN_TX_LEN))
1412+ return NETDEV_TX_OK;
1413+
14081414 /* Prefetch the data used later */
14091415 prefetch(skb->data);
14101416
drivers/net/ethernet/intel/e1000e/e1000.h+2−3
@@ -185,13 +185,12 @@ struct e1000_phy_regs { · 184 unmodified lines
185185
186186 /* board specific private data structure */
187187 struct e1000_adapter {
188+ struct timer_list watchdog_timer;
188189 struct timer_list phy_info_timer;
189190 struct timer_list blink_timer;
190191
191192 struct work_struct reset_task;
192− struct delayed_work watchdog_task;
193−
194− struct workqueue_struct *e1000_workqueue;
193+ struct work_struct watchdog_task;
195194
196195 const struct e1000_info *ei;
197196
drivers/net/ethernet/intel/e1000e/netdev.c+25−29
@@ -1780,8 +1780,7 @@ static irqreturn_t e1000_intr_msi(int __always_unused irq, void *data) · 1779 unmodified lines
17801780 }
17811781 /* guard against interrupt when we're going down */
17821782 if (!test_bit(__E1000_DOWN, &adapter->state))
1783− mod_delayed_work(adapter->e1000_workqueue,
1784− &adapter->watchdog_task, HZ);
1783+ mod_timer(&adapter->watchdog_timer, jiffies + 1);
17851784 }
17861785
17871786 /* Reset on uncorrectable ECC error */
@@ -1861,8 +1860,7 @@ static irqreturn_t e1000_intr(int __always_unused irq, void *data) · 73 unmodified lines
18611860 }
18621861 /* guard against interrupt when we're going down */
18631862 if (!test_bit(__E1000_DOWN, &adapter->state))
1864− mod_delayed_work(adapter->e1000_workqueue,
1865− &adapter->watchdog_task, HZ);
1863+ mod_timer(&adapter->watchdog_timer, jiffies + 1);
18661864 }
18671865
18681866 /* Reset on uncorrectable ECC error */
@@ -1907,8 +1905,7 @@ static irqreturn_t e1000_msix_other(int __always_unused irq, void *data) · 38 unmodified lines
19071905 hw->mac.get_link_status = true;
19081906 /* guard against interrupt when we're going down */
19091907 if (!test_bit(__E1000_DOWN, &adapter->state))
1910− mod_delayed_work(adapter->e1000_workqueue,
1911− &adapter->watchdog_task, HZ);
1908+ mod_timer(&adapter->watchdog_timer, jiffies + 1);
19121909 }
19131910
19141911 if (!test_bit(__E1000_DOWN, &adapter->state))
@@ -4284,6 +4281,7 @@ void e1000e_down(struct e1000_adapter *adapter, bool reset) · 2369 unmodified lines
42844281
42854282 napi_synchronize(&adapter->napi);
42864283
4284+ del_timer_sync(&adapter->watchdog_timer);
42874285 del_timer_sync(&adapter->phy_info_timer);
42884286
42894287 spin_lock(&adapter->stats64_lock);
@@ -5155,11 +5153,25 @@ static void e1000e_check_82574_phy_workaround(struct e1000_adapter *adapter) · 865 unmodified lines
51555153 }
51565154 }
51575155
5156+/**
5157+ * e1000_watchdog - Timer Call-back
5158+ * @data: pointer to adapter cast into an unsigned long
5159+ **/
5160+static void e1000_watchdog(struct timer_list *t)
5161+{
5162+ struct e1000_adapter *adapter = from_timer(adapter, t, watchdog_timer);
5163+
5164+ /* Do the rest outside of interrupt context */
5165+ schedule_work(&adapter->watchdog_task);
5166+
5167+ /* TODO: make this use queue_delayed_work() */
5168+}
5169+
51585170 static void e1000_watchdog_task(struct work_struct *work)
51595171 {
51605172 struct e1000_adapter *adapter = container_of(work,
51615173 struct e1000_adapter,
5162− watchdog_task.work);
5174+ watchdog_task);
51635175 struct net_device *netdev = adapter->netdev;
51645176 struct e1000_mac_info *mac = &adapter->hw.mac;
51655177 struct e1000_phy_info *phy = &adapter->hw.phy;
@@ -5407,9 +5419,8 @@ link_up: · 241 unmodified lines
54075419
54085420 /* Reset the timer */
54095421 if (!test_bit(__E1000_DOWN, &adapter->state))
5410− queue_delayed_work(adapter->e1000_workqueue,
5411− &adapter->watchdog_task,
5412− round_jiffies(2 * HZ));
5422+ mod_timer(&adapter->watchdog_timer,
5423+ round_jiffies(jiffies + 2 * HZ));
54135424 }
54145425
54155426 #define E1000_TX_FLAGS_CSUM 0x00000001
@@ -7449,21 +7460,11 @@ static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *ent) · 2033 unmodified lines
74497460 goto err_eeprom;
74507461 }
74517462
7452− adapter->e1000_workqueue = alloc_workqueue("%s", WQ_MEM_RECLAIM, 0,
7453− e1000e_driver_name);
7454−
7455− if (!adapter->e1000_workqueue) {
7456− err = -ENOMEM;
7457− goto err_workqueue;
7458− }
7459−
7460− INIT_DELAYED_WORK(&adapter->watchdog_task, e1000_watchdog_task);
7461− queue_delayed_work(adapter->e1000_workqueue, &adapter->watchdog_task,
7462− 0);
7463−
7463+ timer_setup(&adapter->watchdog_timer, e1000_watchdog, 0);
74647464 timer_setup(&adapter->phy_info_timer, e1000_update_phy_info, 0);
74657465
74667466 INIT_WORK(&adapter->reset_task, e1000_reset_task);
7467+ INIT_WORK(&adapter->watchdog_task, e1000_watchdog_task);
74677468 INIT_WORK(&adapter->downshift_task, e1000e_downshift_workaround);
74687469 INIT_WORK(&adapter->update_phy_task, e1000e_update_phy_task);
74697470 INIT_WORK(&adapter->print_hang_task, e1000_print_hw_hang);
@@ -7557,9 +7558,6 @@ static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *ent) · 87 unmodified lines
75577558 return 0;
75587559
75597560 err_register:
7560− flush_workqueue(adapter->e1000_workqueue);
7561− destroy_workqueue(adapter->e1000_workqueue);
7562−err_workqueue:
75637561 if (!(adapter->flags & FLAG_HAS_AMT))
75647562 e1000e_release_hw_control(adapter);
75657563 err_eeprom:
@@ -7604,17 +7602,15 @@ static void e1000_remove(struct pci_dev *pdev) · 38 unmodified lines
76047602 * from being rescheduled.
76057603 */
76067604 set_bit(__E1000_DOWN, &adapter->state);
7605+ del_timer_sync(&adapter->watchdog_timer);
76077606 del_timer_sync(&adapter->phy_info_timer);
76087607
76097608 cancel_work_sync(&adapter->reset_task);
7609+ cancel_work_sync(&adapter->watchdog_task);
76107610 cancel_work_sync(&adapter->downshift_task);
76117611 cancel_work_sync(&adapter->update_phy_task);
76127612 cancel_work_sync(&adapter->print_hang_task);
76137613
7614− cancel_delayed_work(&adapter->watchdog_task);
7615− flush_workqueue(adapter->e1000_workqueue);
7616− destroy_workqueue(adapter->e1000_workqueue);
7617−
76187614 if (adapter->flags & FLAG_HAS_HW_TIMESTAMP) {
76197615 cancel_work_sync(&adapter->tx_hwtstamp_work);
76207616 if (adapter->tx_hwtstamp_skb) {
drivers/net/ethernet/intel/i40e/i40e_adminq.c+5−0
@@ -536,6 +536,11 @@ static void i40e_set_hw_flags(struct i40e_hw *hw) · 535 unmodified lines
536536 (aq->api_maj_ver == 1 &&
537537 aq->api_min_ver >= I40E_MINOR_VER_FW_LLDP_STOPPABLE_X722))
538538 hw->flags |= I40E_HW_FLAG_FW_LLDP_STOPPABLE;
539+
540+ if (aq->api_maj_ver > 1 ||
541+ (aq->api_maj_ver == 1 &&
542+ aq->api_min_ver >= I40E_MINOR_VER_GET_LINK_INFO_X722))
543+ hw->flags |= I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE;
539544 /* fall through */
540545 default:
541546 break;
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c+18−4
@@ -2321,6 +2321,22 @@ static int i40e_ctrl_vf_rx_rings(struct i40e_vsi *vsi, unsigned long q_map, · 2320 unmodified lines
23212321 return ret;
23222322 }
23232323
2324+/**
2325+ * i40e_vc_validate_vqs_bitmaps - validate Rx/Tx queue bitmaps from VIRTHCHNL
2326+ * @vqs: virtchnl_queue_select structure containing bitmaps to validate
2327+ *
2328+ * Returns true if validation was successful, else false.
2329+ */
2330+static bool i40e_vc_validate_vqs_bitmaps(struct virtchnl_queue_select *vqs)
2331+{
2332+ if ((!vqs->rx_queues && !vqs->tx_queues) ||
2333+ vqs->rx_queues >= BIT(I40E_MAX_VF_QUEUES) ||
2334+ vqs->tx_queues >= BIT(I40E_MAX_VF_QUEUES))
2335+ return false;
2336+
2337+ return true;
2338+}
2339+
23242340 /**
23252341 * i40e_vc_enable_queues_msg
23262342 * @vf: pointer to the VF info
@@ -2346,7 +2362,7 @@ static int i40e_vc_enable_queues_msg(struct i40e_vf *vf, u8 *msg) · 19 unmodified lines
23462362 goto error_param;
23472363 }
23482364
2349− if ((0 == vqs->rx_queues) && (0 == vqs->tx_queues)) {
2365+ if (i40e_vc_validate_vqs_bitmaps(vqs)) {
23502366 aq_ret = I40E_ERR_PARAM;
23512367 goto error_param;
23522368 }
@@ -2408,9 +2424,7 @@ static int i40e_vc_disable_queues_msg(struct i40e_vf *vf, u8 *msg) · 55 unmodified lines
24082424 goto error_param;
24092425 }
24102426
2411− if ((vqs->rx_queues == 0 && vqs->tx_queues == 0) ||
2412− vqs->rx_queues > I40E_MAX_VF_QUEUES ||
2413− vqs->tx_queues > I40E_MAX_VF_QUEUES) {
2427+ if (i40e_vc_validate_vqs_bitmaps(vqs)) {
24142428 aq_ret = I40E_ERR_PARAM;
24152429 goto error_param;
24162430 }
drivers/net/ethernet/intel/iavf/iavf.h+2−0
@@ -415,4 +415,6 @@ void iavf_enable_channels(struct iavf_adapter *adapter); · 414 unmodified lines
415415 void iavf_disable_channels(struct iavf_adapter *adapter);
416416 void iavf_add_cloud_filter(struct iavf_adapter *adapter);
417417 void iavf_del_cloud_filter(struct iavf_adapter *adapter);
418+struct iavf_mac_filter *iavf_add_filter(struct iavf_adapter *adapter,
419+ const u8 *macaddr);
418420 #endif /* _IAVF_H_ */
drivers/net/ethernet/intel/iavf/iavf_main.c+13−4
@@ -743,9 +743,8 @@ iavf_mac_filter *iavf_find_filter(struct iavf_adapter *adapter, · 742 unmodified lines
743743 *
744744 * Returns ptr to the filter object or NULL when no memory available.
745745 **/
746−static struct
747−iavf_mac_filter *iavf_add_filter(struct iavf_adapter *adapter,
748− const u8 *macaddr)
746+struct iavf_mac_filter *iavf_add_filter(struct iavf_adapter *adapter,
747+ const u8 *macaddr)
749748 {
750749 struct iavf_mac_filter *f;
751750
@@ -2065,9 +2064,9 @@ static void iavf_reset_task(struct work_struct *work) · 1313 unmodified lines
20652064 struct virtchnl_vf_resource *vfres = adapter->vf_res;
20662065 struct net_device *netdev = adapter->netdev;
20672066 struct iavf_hw *hw = &adapter->hw;
2067+ struct iavf_mac_filter *f, *ftmp;
20682068 struct iavf_vlan_filter *vlf;
20692069 struct iavf_cloud_filter *cf;
2070− struct iavf_mac_filter *f;
20712070 u32 reg_val;
20722071 int i = 0, err;
20732072 bool running;
@@ -2181,6 +2180,16 @@ continue_reset: · 107 unmodified lines
21812180
21822181 spin_lock_bh(&adapter->mac_vlan_list_lock);
21832182
2183+ /* Delete filter for the current MAC address, it could have
2184+ * been changed by the PF via administratively set MAC.
2185+ * Will be re-added via VIRTCHNL_OP_GET_VF_RESOURCES.
2186+ */
2187+ list_for_each_entry_safe(f, ftmp, &adapter->mac_filter_list, list) {
2188+ if (ether_addr_equal(f->macaddr, adapter->hw.mac.addr)) {
2189+ list_del(&f->list);
2190+ kfree(f);
2191+ }
2192+ }
21842193 /* re-add all MAC filters */
21852194 list_for_each_entry(f, &adapter->mac_filter_list, list) {
21862195 f->add = true;
drivers/net/ethernet/intel/iavf/iavf_virtchnl.c+3−0
@@ -1359,6 +1359,9 @@ void iavf_virtchnl_completion(struct iavf_adapter *adapter, · 1358 unmodified lines
13591359 ether_addr_copy(netdev->perm_addr,
13601360 adapter->hw.mac.addr);
13611361 }
1362+ spin_lock_bh(&adapter->mac_vlan_list_lock);
1363+ iavf_add_filter(adapter, adapter->hw.mac.addr);
1364+ spin_unlock_bh(&adapter->mac_vlan_list_lock);
13621365 iavf_process_config(adapter);
13631366 }
13641367 break;
drivers/net/ethernet/intel/igb/e1000_82575.c+2−6
@@ -530,7 +530,7 @@ static s32 igb_set_sfp_media_type_82575(struct e1000_hw *hw) · 529 unmodified lines
530530 dev_spec->module_plugged = true;
531531 if (eth_flags->e1000_base_lx || eth_flags->e1000_base_sx) {
532532 hw->phy.media_type = e1000_media_type_internal_serdes;
533− } else if (eth_flags->e100_base_fx) {
533+ } else if (eth_flags->e100_base_fx || eth_flags->e100_base_lx) {
534534 dev_spec->sgmii_active = true;
535535 hw->phy.media_type = e1000_media_type_internal_serdes;
536536 } else if (eth_flags->e1000_base_t) {
@@ -657,14 +657,10 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw) · 120 unmodified lines
657657 break;
658658 }
659659
660− /* do not change link mode for 100BaseFX */
661− if (dev_spec->eth_flags.e100_base_fx)
662− break;
663−
664660 /* change current link mode setting */
665661 ctrl_ext &= ~E1000_CTRL_EXT_LINK_MODE_MASK;
666662
667− if (hw->phy.media_type == e1000_media_type_copper)
663+ if (dev_spec->sgmii_active)
668664 ctrl_ext |= E1000_CTRL_EXT_LINK_MODE_SGMII;
669665 else
670666 ctrl_ext |= E1000_CTRL_EXT_LINK_MODE_PCIE_SERDES;
drivers/net/ethernet/intel/igb/igb_ethtool.c+1−1
@@ -181,7 +181,7 @@ static int igb_get_link_ksettings(struct net_device *netdev, · 180 unmodified lines
181181 advertising &= ~ADVERTISED_1000baseKX_Full;
182182 }
183183 }
184− if (eth_flags->e100_base_fx) {
184+ if (eth_flags->e100_base_fx || eth_flags->e100_base_lx) {
185185 supported |= SUPPORTED_100baseT_Full;
186186 advertising |= ADVERTISED_100baseT_Full;
187187 }
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c+27−10
@@ -5239,7 +5239,7 @@ static void ixgbe_fdir_filter_restore(struct ixgbe_adapter *adapter) · 5238 unmodified lines
52395239 struct ixgbe_hw *hw = &adapter->hw;
52405240 struct hlist_node *node2;
52415241 struct ixgbe_fdir_filter *filter;
5242− u64 action;
5242+ u8 queue;
52435243
52445244 spin_lock(&adapter->fdir_perfect_lock);
52455245
@@ -5248,17 +5248,34 @@ static void ixgbe_fdir_filter_restore(struct ixgbe_adapter *adapter) · 2 unmodified lines
52485248
52495249 hlist_for_each_entry_safe(filter, node2,
52505250 &adapter->fdir_filter_list, fdir_node) {
5251− action = filter->action;
5252− if (action != IXGBE_FDIR_DROP_QUEUE && action != 0)
5253− action =
5254− (action >> ETHTOOL_RX_FLOW_SPEC_RING_VF_OFF) - 1;
5251+ if (filter->action == IXGBE_FDIR_DROP_QUEUE) {
5252+ queue = IXGBE_FDIR_DROP_QUEUE;
5253+ } else {
5254+ u32 ring = ethtool_get_flow_spec_ring(filter->action);
5255+ u8 vf = ethtool_get_flow_spec_ring_vf(filter->action);
5256+
5257+ if (!vf && (ring >= adapter->num_rx_queues)) {
5258+ e_err(drv, "FDIR restore failed without VF, ring: %u\n",
5259+ ring);
5260+ continue;
5261+ } else if (vf &&
5262+ ((vf > adapter->num_vfs) ||
5263+ ring >= adapter->num_rx_queues_per_pool)) {
5264+ e_err(drv, "FDIR restore failed with VF, vf: %hhu, ring: %u\n",
5265+ vf, ring);
5266+ continue;
5267+ }
5268+
5269+ /* Map the ring onto the absolute queue index */
5270+ if (!vf)
5271+ queue = adapter->rx_ring[ring]->reg_idx;
5272+ else
5273+ queue = ((vf - 1) *
5274+ adapter->num_rx_queues_per_pool) + ring;
5275+ }
52555276
52565277 ixgbe_fdir_write_perfect_filter_82599(hw,
5257− &filter->filter,
5258− filter->sw_idx,
5259− (action == IXGBE_FDIR_DROP_QUEUE) ?
5260− IXGBE_FDIR_DROP_QUEUE :
5261− adapter->rx_ring[action]->reg_idx);
5278+ &filter->filter, filter->sw_idx, queue);
52625279 }
52635280
52645281 spin_unlock(&adapter->fdir_perfect_lock);
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c+0−5
@@ -2081,11 +2081,6 @@ static int ixgbevf_write_uc_addr_list(struct net_device *netdev) · 2080 unmodified lines
20812081 struct ixgbe_hw *hw = &adapter->hw;
20822082 int count = 0;
20832083
2084− if ((netdev_uc_count(netdev)) > 10) {
2085− pr_err("Too many unicast filters - No Space\n");
2086− return -ENOSPC;
2087− }
2088−
20892084 if (!netdev_uc_empty(netdev)) {
20902085 struct netdev_hw_addr *ha;
20912086
drivers/net/ethernet/marvell/mvneta.c+10−9
@@ -2081,7 +2081,11 @@ static int · 2080 unmodified lines
20812081 mvneta_run_xdp(struct mvneta_port *pp, struct mvneta_rx_queue *rxq,
20822082 struct bpf_prog *prog, struct xdp_buff *xdp)
20832083 {
2084− u32 ret, act = bpf_prog_run_xdp(prog, xdp);
2084+ unsigned int len;
2085+ u32 ret, act;
2086+
2087+ len = xdp->data_end - xdp->data_hard_start - pp->rx_offset_correction;
2088+ act = bpf_prog_run_xdp(prog, xdp);
20852089
20862090 switch (act) {
20872091 case XDP_PASS:
@@ -2094,9 +2098,8 @@ mvneta_run_xdp(struct mvneta_port *pp, struct mvneta_rx_queue *rxq, · 6 unmodified lines
20942098 if (err) {
20952099 ret = MVNETA_XDP_DROPPED;
20962100 __page_pool_put_page(rxq->page_pool,
2097− virt_to_head_page(xdp->data),
2098− xdp->data_end - xdp->data_hard_start,
2099− true);
2101+ virt_to_head_page(xdp->data),
2102+ len, true);
21002103 } else {
21012104 ret = MVNETA_XDP_REDIR;
21022105 }
@@ -2106,9 +2109,8 @@ mvneta_run_xdp(struct mvneta_port *pp, struct mvneta_rx_queue *rxq, · 3 unmodified lines
21062109 ret = mvneta_xdp_xmit_back(pp, xdp);
21072110 if (ret != MVNETA_XDP_TX)
21082111 __page_pool_put_page(rxq->page_pool,
2109− virt_to_head_page(xdp->data),
2110− xdp->data_end - xdp->data_hard_start,
2111− true);
2112+ virt_to_head_page(xdp->data),
2113+ len, true);
21122114 break;
21132115 default:
21142116 bpf_warn_invalid_xdp_action(act);
@@ -2119,8 +2121,7 @@ mvneta_run_xdp(struct mvneta_port *pp, struct mvneta_rx_queue *rxq, · 4 unmodified lines
21192121 case XDP_DROP:
21202122 __page_pool_put_page(rxq->page_pool,
21212123 virt_to_head_page(xdp->data),
2122− xdp->data_end - xdp->data_hard_start,
2123− true);
2124+ len, true);
21242125 ret = MVNETA_XDP_DROPPED;
21252126 break;
21262127 }
drivers/net/ethernet/mellanox/mlx4/crdump.c+1−1
@@ -182,7 +182,7 @@ int mlx4_crdump_collect(struct mlx4_dev *dev) · 181 unmodified lines
182182 crdump_enable_crspace_access(dev, cr_space);
183183
184184 /* Get the available snapshot ID for the dumps */
185− id = devlink_region_shapshot_id_get(devlink);
185+ id = devlink_region_snapshot_id_get(devlink);
186186
187187 /* Try to capture dumps */
188188 mlx4_crdump_collect_crspace(dev, cr_space, id);
drivers/net/ethernet/mellanox/mlxsw/spectrum.c+41−13
@@ -860,23 +860,17 @@ static netdev_tx_t mlxsw_sp_port_xmit(struct sk_buff *skb, · 859 unmodified lines
860860 u64 len;
861861 int err;
862862
863+ if (skb_cow_head(skb, MLXSW_TXHDR_LEN)) {
864+ this_cpu_inc(mlxsw_sp_port->pcpu_stats->tx_dropped);
865+ dev_kfree_skb_any(skb);
866+ return NETDEV_TX_OK;
867+ }
868+
863869 memset(skb->cb, 0, sizeof(struct mlxsw_skb_cb));
864870
865871 if (mlxsw_core_skb_transmit_busy(mlxsw_sp->core, &tx_info))
866872 return NETDEV_TX_BUSY;
867873
868− if (unlikely(skb_headroom(skb) < MLXSW_TXHDR_LEN)) {
869− struct sk_buff *skb_orig = skb;
870−
871− skb = skb_realloc_headroom(skb, MLXSW_TXHDR_LEN);
872− if (!skb) {
873− this_cpu_inc(mlxsw_sp_port->pcpu_stats->tx_dropped);
874− dev_kfree_skb_any(skb_orig);
875− return NETDEV_TX_OK;
876− }
877− dev_consume_skb_any(skb_orig);
878− }
879−
880874 if (eth_skb_pad(skb)) {
881875 this_cpu_inc(mlxsw_sp_port->pcpu_stats->tx_dropped);
882876 return NETDEV_TX_OK;
@@ -1215,6 +1209,9 @@ static void update_stats_cache(struct work_struct *work) · 332 unmodified lines
12151209 periodic_hw_stats.update_dw.work);
12161210
12171211 if (!netif_carrier_ok(mlxsw_sp_port->dev))
1212+ /* Note: mlxsw_sp_port_down_wipe_counters() clears the cache as
1213+ * necessary when port goes down.
1214+ */
12181215 goto out;
12191216
12201217 mlxsw_sp_port_get_hw_stats(mlxsw_sp_port->dev,
@@ -4324,6 +4321,15 @@ static int mlxsw_sp_port_unsplit(struct mlxsw_core *mlxsw_core, u8 local_port, · 3103 unmodified lines
43244321 return 0;
43254322 }
43264323
4324+static void
4325+mlxsw_sp_port_down_wipe_counters(struct mlxsw_sp_port *mlxsw_sp_port)
4326+{
4327+ int i;
4328+
4329+ for (i = 0; i < TC_MAX_QUEUE; i++)
4330+ mlxsw_sp_port->periodic_hw_stats.xstats.backlog[i] = 0;
4331+}
4332+
43274333 static void mlxsw_sp_pude_event_func(const struct mlxsw_reg_info *reg,
43284334 char *pude_pl, void *priv)
43294335 {
@@ -4345,6 +4351,7 @@ static void mlxsw_sp_pude_event_func(const struct mlxsw_reg_info *reg, · 15 unmodified lines
43454351 } else {
43464352 netdev_info(mlxsw_sp_port->dev, "link down\n");
43474353 netif_carrier_off(mlxsw_sp_port->dev);
4354+ mlxsw_sp_port_down_wipe_counters(mlxsw_sp_port);
43484355 }
43494356 }
43504357
@@ -5132,6 +5139,27 @@ static int mlxsw_sp2_init(struct mlxsw_core *mlxsw_core, · 781 unmodified lines
51325139 return mlxsw_sp_init(mlxsw_core, mlxsw_bus_info, extack);
51335140 }
51345141
5142+static int mlxsw_sp3_init(struct mlxsw_core *mlxsw_core,
5143+ const struct mlxsw_bus_info *mlxsw_bus_info,
5144+ struct netlink_ext_ack *extack)
5145+{
5146+ struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core);
5147+
5148+ mlxsw_sp->kvdl_ops = &mlxsw_sp2_kvdl_ops;
5149+ mlxsw_sp->afa_ops = &mlxsw_sp2_act_afa_ops;
5150+ mlxsw_sp->afk_ops = &mlxsw_sp2_afk_ops;
5151+ mlxsw_sp->mr_tcam_ops = &mlxsw_sp2_mr_tcam_ops;
5152+ mlxsw_sp->acl_tcam_ops = &mlxsw_sp2_acl_tcam_ops;
5153+ mlxsw_sp->nve_ops_arr = mlxsw_sp2_nve_ops_arr;
5154+ mlxsw_sp->mac_mask = mlxsw_sp2_mac_mask;
5155+ mlxsw_sp->rif_ops_arr = mlxsw_sp2_rif_ops_arr;
5156+ mlxsw_sp->sb_vals = &mlxsw_sp2_sb_vals;
5157+ mlxsw_sp->port_type_speed_ops = &mlxsw_sp2_port_type_speed_ops;
5158+ mlxsw_sp->ptp_ops = &mlxsw_sp2_ptp_ops;
5159+
5160+ return mlxsw_sp_init(mlxsw_core, mlxsw_bus_info, extack);
5161+}
5162+
51355163 static void mlxsw_sp_fini(struct mlxsw_core *mlxsw_core)
51365164 {
51375165 struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core);
@@ -5634,7 +5662,7 @@ static struct mlxsw_driver mlxsw_sp2_driver = { · 496 unmodified lines
56345662 static struct mlxsw_driver mlxsw_sp3_driver = {
56355663 .kind = mlxsw_sp3_driver_name,
56365664 .priv_size = sizeof(struct mlxsw_sp),
5637− .init = mlxsw_sp2_init,
5665+ .init = mlxsw_sp3_init,
56385666 .fini = mlxsw_sp_fini,
56395667 .basic_trap_groups_set = mlxsw_sp_basic_trap_groups_set,
56405668 .port_split = mlxsw_sp_port_split,
drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c+23−7
@@ -195,6 +195,20 @@ mlxsw_sp_qdisc_get_xstats(struct mlxsw_sp_port *mlxsw_sp_port, · 194 unmodified lines
195195 return -EOPNOTSUPP;
196196 }
197197
198+static u64
199+mlxsw_sp_xstats_backlog(struct mlxsw_sp_port_xstats *xstats, int tclass_num)
200+{
201+ return xstats->backlog[tclass_num] +
202+ xstats->backlog[tclass_num + 8];
203+}
204+
205+static u64
206+mlxsw_sp_xstats_tail_drop(struct mlxsw_sp_port_xstats *xstats, int tclass_num)
207+{
208+ return xstats->tail_drop[tclass_num] +
209+ xstats->tail_drop[tclass_num + 8];
210+}
211+
198212 static void
199213 mlxsw_sp_qdisc_bstats_per_priority_get(struct mlxsw_sp_port_xstats *xstats,
200214 u8 prio_bitmap, u64 *tx_packets,
@@ -269,7 +283,7 @@ mlxsw_sp_setup_tc_qdisc_red_clean_stats(struct mlxsw_sp_port *mlxsw_sp_port, · 68 unmodified lines
269283 &stats_base->tx_bytes);
270284 red_base->prob_mark = xstats->ecn;
271285 red_base->prob_drop = xstats->wred_drop[tclass_num];
272− red_base->pdrop = xstats->tail_drop[tclass_num];
286+ red_base->pdrop = mlxsw_sp_xstats_tail_drop(xstats, tclass_num);
273287
274288 stats_base->overlimits = red_base->prob_drop + red_base->prob_mark;
275289 stats_base->drops = red_base->prob_drop + red_base->pdrop;
@@ -370,7 +384,8 @@ mlxsw_sp_qdisc_get_red_xstats(struct mlxsw_sp_port *mlxsw_sp_port, · 94 unmodified lines
370384
371385 early_drops = xstats->wred_drop[tclass_num] - xstats_base->prob_drop;
372386 marks = xstats->ecn - xstats_base->prob_mark;
373− pdrops = xstats->tail_drop[tclass_num] - xstats_base->pdrop;
387+ pdrops = mlxsw_sp_xstats_tail_drop(xstats, tclass_num) -
388+ xstats_base->pdrop;
374389
375390 res->pdrop += pdrops;
376391 res->prob_drop += early_drops;
@@ -403,9 +418,10 @@ mlxsw_sp_qdisc_get_red_stats(struct mlxsw_sp_port *mlxsw_sp_port, · 26 unmodified lines
403418
404419 overlimits = xstats->wred_drop[tclass_num] + xstats->ecn -
405420 stats_base->overlimits;
406− drops = xstats->wred_drop[tclass_num] + xstats->tail_drop[tclass_num] -
421+ drops = xstats->wred_drop[tclass_num] +
422+ mlxsw_sp_xstats_tail_drop(xstats, tclass_num) -
407423 stats_base->drops;
408− backlog = xstats->backlog[tclass_num];
424+ backlog = mlxsw_sp_xstats_backlog(xstats, tclass_num);
409425
410426 _bstats_update(stats_ptr->bstats, tx_bytes, tx_packets);
411427 stats_ptr->qstats->overlimits += overlimits;
@@ -576,9 +592,9 @@ mlxsw_sp_qdisc_get_prio_stats(struct mlxsw_sp_port *mlxsw_sp_port, · 164 unmodified lines
576592 tx_packets = stats->tx_packets - stats_base->tx_packets;
577593
578594 for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++) {
579− drops += xstats->tail_drop[i];
595+ drops += mlxsw_sp_xstats_tail_drop(xstats, i);
580596 drops += xstats->wred_drop[i];
581− backlog += xstats->backlog[i];
597+ backlog += mlxsw_sp_xstats_backlog(xstats, i);
582598 }
583599 drops = drops - stats_base->drops;
584600
@@ -614,7 +630,7 @@ mlxsw_sp_setup_tc_qdisc_prio_clean_stats(struct mlxsw_sp_port *mlxsw_sp_port, · 29 unmodified lines
614630
615631 stats_base->drops = 0;
616632 for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++) {
617− stats_base->drops += xstats->tail_drop[i];
633+ stats_base->drops += mlxsw_sp_xstats_tail_drop(xstats, i);
618634 stats_base->drops += xstats->wred_drop[i];
619635 }
620636
drivers/net/ethernet/mellanox/mlxsw/switchx2.c+6−11
@@ -299,22 +299,17 @@ static netdev_tx_t mlxsw_sx_port_xmit(struct sk_buff *skb, · 298 unmodified lines
299299 u64 len;
300300 int err;
301301
302+ if (skb_cow_head(skb, MLXSW_TXHDR_LEN)) {
303+ this_cpu_inc(mlxsw_sx_port->pcpu_stats->tx_dropped);
304+ dev_kfree_skb_any(skb);
305+ return NETDEV_TX_OK;
306+ }
307+
302308 memset(skb->cb, 0, sizeof(struct mlxsw_skb_cb));
303309
304310 if (mlxsw_core_skb_transmit_busy(mlxsw_sx->core, &tx_info))
305311 return NETDEV_TX_BUSY;
306312
307− if (unlikely(skb_headroom(skb) < MLXSW_TXHDR_LEN)) {
308− struct sk_buff *skb_orig = skb;
309−
310− skb = skb_realloc_headroom(skb, MLXSW_TXHDR_LEN);
311− if (!skb) {
312− this_cpu_inc(mlxsw_sx_port->pcpu_stats->tx_dropped);
313− dev_kfree_skb_any(skb_orig);
314− return NETDEV_TX_OK;
315− }
316− dev_consume_skb_any(skb_orig);
317− }
318313 mlxsw_sx_txhdr_construct(skb, &tx_info);
319314 /* TX header is consumed by HW on the way so we shouldn't count its
320315 * bytes as being sent.
drivers/net/ethernet/renesas/sh_eth.c+21−17
@@ -2204,24 +2204,28 @@ static size_t __sh_eth_get_regs(struct net_device *ndev, u32 *buf) · 2203 unmodified lines
22042204 if (cd->tsu) {
22052205 add_tsu_reg(ARSTR);
22062206 add_tsu_reg(TSU_CTRST);
2207− add_tsu_reg(TSU_FWEN0);
2208− add_tsu_reg(TSU_FWEN1);
2209− add_tsu_reg(TSU_FCM);
2210− add_tsu_reg(TSU_BSYSL0);
2211− add_tsu_reg(TSU_BSYSL1);
2212− add_tsu_reg(TSU_PRISL0);
2213− add_tsu_reg(TSU_PRISL1);
2214− add_tsu_reg(TSU_FWSL0);
2215− add_tsu_reg(TSU_FWSL1);
2207+ if (cd->dual_port) {
2208+ add_tsu_reg(TSU_FWEN0);
2209+ add_tsu_reg(TSU_FWEN1);
2210+ add_tsu_reg(TSU_FCM);
2211+ add_tsu_reg(TSU_BSYSL0);
2212+ add_tsu_reg(TSU_BSYSL1);
2213+ add_tsu_reg(TSU_PRISL0);
2214+ add_tsu_reg(TSU_PRISL1);
2215+ add_tsu_reg(TSU_FWSL0);
2216+ add_tsu_reg(TSU_FWSL1);
2217+ }
22162218 add_tsu_reg(TSU_FWSLC);
2217− add_tsu_reg(TSU_QTAGM0);
2218− add_tsu_reg(TSU_QTAGM1);
2219− add_tsu_reg(TSU_FWSR);
2220− add_tsu_reg(TSU_FWINMK);
2221− add_tsu_reg(TSU_ADQT0);
2222− add_tsu_reg(TSU_ADQT1);
2223− add_tsu_reg(TSU_VTAG0);
2224− add_tsu_reg(TSU_VTAG1);
2219+ if (cd->dual_port) {
2220+ add_tsu_reg(TSU_QTAGM0);
2221+ add_tsu_reg(TSU_QTAGM1);
2222+ add_tsu_reg(TSU_FWSR);
2223+ add_tsu_reg(TSU_FWINMK);
2224+ add_tsu_reg(TSU_ADQT0);
2225+ add_tsu_reg(TSU_ADQT1);
2226+ add_tsu_reg(TSU_VTAG0);
2227+ add_tsu_reg(TSU_VTAG1);
2228+ }
22252229 add_tsu_reg(TSU_ADSBSY);
22262230 add_tsu_reg(TSU_TEN);
22272231 add_tsu_reg(TSU_POST1);
drivers/net/ethernet/socionext/sni_ave.c+13−7
@@ -424,16 +424,22 @@ static void ave_ethtool_get_wol(struct net_device *ndev, · 423 unmodified lines
424424 phy_ethtool_get_wol(ndev->phydev, wol);
425425 }
426426
427−static int ave_ethtool_set_wol(struct net_device *ndev,
428− struct ethtool_wolinfo *wol)
427+static int __ave_ethtool_set_wol(struct net_device *ndev,
428+ struct ethtool_wolinfo *wol)
429429 {
430− int ret;
431−
432430 if (!ndev->phydev ||
433431 (wol->wolopts & (WAKE_ARP | WAKE_MAGICSECURE)))
434432 return -EOPNOTSUPP;
435433
436− ret = phy_ethtool_set_wol(ndev->phydev, wol);
434+ return phy_ethtool_set_wol(ndev->phydev, wol);
435+}
436+
437+static int ave_ethtool_set_wol(struct net_device *ndev,
438+ struct ethtool_wolinfo *wol)
439+{
440+ int ret;
441+
442+ ret = __ave_ethtool_set_wol(ndev, wol);
437443 if (!ret)
438444 device_set_wakeup_enable(&ndev->dev, !!wol->wolopts);
439445
@@ -1216,7 +1222,7 @@ static int ave_init(struct net_device *ndev) · 776 unmodified lines
12161222
12171223 /* set wol initial state disabled */
12181224 wol.wolopts = 0;
1219− ave_ethtool_set_wol(ndev, &wol);
1225+ __ave_ethtool_set_wol(ndev, &wol);
12201226
12211227 if (!phy_interface_is_rgmii(phydev))
12221228 phy_set_max_speed(phydev, SPEED_100);
@@ -1768,7 +1774,7 @@ static int ave_resume(struct device *dev) · 545 unmodified lines
17681774
17691775 ave_ethtool_get_wol(ndev, &wol);
17701776 wol.wolopts = priv->wolopts;
1771− ave_ethtool_set_wol(ndev, &wol);
1777+ __ave_ethtool_set_wol(ndev, &wol);
17721778
17731779 if (ndev->phydev) {
17741780 ret = phy_resume(ndev->phydev);
drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c+36−16
@@ -80,7 +80,7 @@ static struct sk_buff *stmmac_test_get_udp_skb(struct stmmac_priv *priv, · 79 unmodified lines
8080 if (attr->max_size && (attr->max_size > size))
8181 size = attr->max_size;
8282
83− skb = netdev_alloc_skb_ip_align(priv->dev, size);
83+ skb = netdev_alloc_skb(priv->dev, size);
8484 if (!skb)
8585 return NULL;
8686
@@ -244,6 +244,8 @@ static int stmmac_test_loopback_validate(struct sk_buff *skb, · 157 unmodified lines
244244 struct net_device *orig_ndev)
245245 {
246246 struct stmmac_test_priv *tpriv = pt->af_packet_priv;
247+ unsigned char *src = tpriv->packet->src;
248+ unsigned char *dst = tpriv->packet->dst;
247249 struct stmmachdr *shdr;
248250 struct ethhdr *ehdr;
249251 struct udphdr *uhdr;
@@ -260,15 +262,15 @@ static int stmmac_test_loopback_validate(struct sk_buff *skb, · 10 unmodified lines
260262 goto out;
261263
262264 ehdr = (struct ethhdr *)skb_mac_header(skb);
263− if (tpriv->packet->dst) {
264− if (!ether_addr_equal(ehdr->h_dest, tpriv->packet->dst))
265+ if (dst) {
266+ if (!ether_addr_equal_unaligned(ehdr->h_dest, dst))
265267 goto out;
266268 }
267269 if (tpriv->packet->sarc) {
268− if (!ether_addr_equal(ehdr->h_source, ehdr->h_dest))
270+ if (!ether_addr_equal_unaligned(ehdr->h_source, ehdr->h_dest))
269271 goto out;
270− } else if (tpriv->packet->src) {
271− if (!ether_addr_equal(ehdr->h_source, tpriv->packet->src))
272+ } else if (src) {
273+ if (!ether_addr_equal_unaligned(ehdr->h_source, src))
272274 goto out;
273275 }
274276
@@ -714,7 +716,7 @@ static int stmmac_test_flowctrl_validate(struct sk_buff *skb, · 439 unmodified lines
714716 struct ethhdr *ehdr;
715717
716718 ehdr = (struct ethhdr *)skb_mac_header(skb);
717− if (!ether_addr_equal(ehdr->h_source, orig_ndev->dev_addr))
719+ if (!ether_addr_equal_unaligned(ehdr->h_source, orig_ndev->dev_addr))
718720 goto out;
719721 if (ehdr->h_proto != htons(ETH_P_PAUSE))
720722 goto out;
@@ -851,12 +853,16 @@ static int stmmac_test_vlan_validate(struct sk_buff *skb, · 130 unmodified lines
851853 if (tpriv->vlan_id) {
852854 if (skb->vlan_proto != htons(proto))
853855 goto out;
854− if (skb->vlan_tci != tpriv->vlan_id)
856+ if (skb->vlan_tci != tpriv->vlan_id) {
857+ /* Means filter did not work. */
858+ tpriv->ok = false;
859+ complete(&tpriv->comp);
855860 goto out;
861+ }
856862 }
857863
858864 ehdr = (struct ethhdr *)skb_mac_header(skb);
859− if (!ether_addr_equal(ehdr->h_dest, tpriv->packet->dst))
865+ if (!ether_addr_equal_unaligned(ehdr->h_dest, tpriv->packet->dst))
860866 goto out;
861867
862868 ihdr = ip_hdr(skb);
@@ -965,6 +971,9 @@ static int stmmac_test_vlanfilt_perfect(struct stmmac_priv *priv) · 102 unmodified lines
965971 {
966972 int ret, prev_cap = priv->dma_cap.vlhash;
967973
974+ if (!(priv->dev->features & NETIF_F_HW_VLAN_CTAG_FILTER))
975+ return -EOPNOTSUPP;
976+
968977 priv->dma_cap.vlhash = 0;
969978 ret = __stmmac_test_vlanfilt(priv);
970979 priv->dma_cap.vlhash = prev_cap;
@@ -1057,6 +1066,9 @@ static int stmmac_test_dvlanfilt_perfect(struct stmmac_priv *priv) · 86 unmodified lines
10571066 {
10581067 int ret, prev_cap = priv->dma_cap.vlhash;
10591068
1069+ if (!(priv->dev->features & NETIF_F_HW_VLAN_STAG_FILTER))
1070+ return -EOPNOTSUPP;
1071+
10601072 priv->dma_cap.vlhash = 0;
10611073 ret = __stmmac_test_dvlanfilt(priv);
10621074 priv->dma_cap.vlhash = prev_cap;
@@ -1323,16 +1335,19 @@ static int __stmmac_test_l3filt(struct stmmac_priv *priv, u32 dst, u32 src, · 260 unmodified lines
13231335 struct stmmac_packet_attrs attr = { };
13241336 struct flow_dissector *dissector;
13251337 struct flow_cls_offload *cls;
1338+ int ret, old_enable = 0;
13261339 struct flow_rule *rule;
1327− int ret;
13281340
13291341 if (!tc_can_offload(priv->dev))
13301342 return -EOPNOTSUPP;
13311343 if (!priv->dma_cap.l3l4fnum)
13321344 return -EOPNOTSUPP;
1333− if (priv->rss.enable)
1345+ if (priv->rss.enable) {
1346+ old_enable = priv->rss.enable;
1347+ priv->rss.enable = false;
13341348 stmmac_rss_configure(priv, priv->hw, NULL,
13351349 priv->plat->rx_queues_to_use);
1350+ }
13361351
13371352 dissector = kzalloc(sizeof(*dissector), GFP_KERNEL);
13381353 if (!dissector) {
@@ -1399,7 +1414,8 @@ cleanup_cls: · 60 unmodified lines
13991414 cleanup_dissector:
14001415 kfree(dissector);
14011416 cleanup_rss:
1402− if (priv->rss.enable) {
1417+ if (old_enable) {
1418+ priv->rss.enable = old_enable;
14031419 stmmac_rss_configure(priv, priv->hw, &priv->rss,
14041420 priv->plat->rx_queues_to_use);
14051421 }
@@ -1444,16 +1460,19 @@ static int __stmmac_test_l4filt(struct stmmac_priv *priv, u32 dst, u32 src, · 38 unmodified lines
14441460 struct stmmac_packet_attrs attr = { };
14451461 struct flow_dissector *dissector;
14461462 struct flow_cls_offload *cls;
1463+ int ret, old_enable = 0;
14471464 struct flow_rule *rule;
1448− int ret;
14491465
14501466 if (!tc_can_offload(priv->dev))
14511467 return -EOPNOTSUPP;
14521468 if (!priv->dma_cap.l3l4fnum)
14531469 return -EOPNOTSUPP;
1454− if (priv->rss.enable)
1470+ if (priv->rss.enable) {
1471+ old_enable = priv->rss.enable;
1472+ priv->rss.enable = false;
14551473 stmmac_rss_configure(priv, priv->hw, NULL,
14561474 priv->plat->rx_queues_to_use);
1475+ }
14571476
14581477 dissector = kzalloc(sizeof(*dissector), GFP_KERNEL);
14591478 if (!dissector) {
@@ -1525,7 +1544,8 @@ cleanup_cls: · 65 unmodified lines
15251544 cleanup_dissector:
15261545 kfree(dissector);
15271546 cleanup_rss:
1528− if (priv->rss.enable) {
1547+ if (old_enable) {
1548+ priv->rss.enable = old_enable;
15291549 stmmac_rss_configure(priv, priv->hw, &priv->rss,
15301550 priv->plat->rx_queues_to_use);
15311551 }
@@ -1578,7 +1598,7 @@ static int stmmac_test_arp_validate(struct sk_buff *skb, · 46 unmodified lines
15781598 struct arphdr *ahdr;
15791599
15801600 ehdr = (struct ethhdr *)skb_mac_header(skb);
1581− if (!ether_addr_equal(ehdr->h_dest, tpriv->packet->src))
1601+ if (!ether_addr_equal_unaligned(ehdr->h_dest, tpriv->packet->src))
15821602 goto out;
15831603
15841604 ahdr = arp_hdr(skb);
drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c+4−0
@@ -577,6 +577,10 @@ static int tc_setup_cls(struct stmmac_priv *priv, · 576 unmodified lines
577577 {
578578 int ret = 0;
579579
580+ /* When RSS is enabled, the filtering will be bypassed */
581+ if (priv->rss.enable)
582+ return -EBUSY;
583+
580584 switch (cls->command) {
581585 case FLOW_CLS_REPLACE:
582586 ret = tc_add_flow(priv, cls);
drivers/net/hyperv/rndis_filter.c+0−2
@@ -1443,8 +1443,6 @@ void rndis_filter_device_remove(struct hv_device *dev, · 1442 unmodified lines
14431443 /* Halt and release the rndis device */
14441444 rndis_filter_halt_device(net_dev, rndis_dev);
14451445
1446− net_dev->extension = NULL;
1447−
14481446 netvsc_device_remove(dev);
14491447 }
14501448
drivers/net/macvlan.c+3−2
@@ -259,7 +259,7 @@ static void macvlan_broadcast(struct sk_buff *skb, · 258 unmodified lines
259259 struct net_device *src,
260260 enum macvlan_mode mode)
261261 {
262− const struct ethhdr *eth = skb_eth_hdr(skb);
262+ const struct ethhdr *eth = eth_hdr(skb);
263263 const struct macvlan_dev *vlan;
264264 struct sk_buff *nskb;
265265 unsigned int i;
@@ -513,10 +513,11 @@ static int macvlan_queue_xmit(struct sk_buff *skb, struct net_device *dev) · 247 unmodified lines
513513 const struct macvlan_dev *dest;
514514
515515 if (vlan->mode == MACVLAN_MODE_BRIDGE) {
516− const struct ethhdr *eth = (void *)skb->data;
516+ const struct ethhdr *eth = skb_eth_hdr(skb);
517517
518518 /* send to other bridge ports directly */
519519 if (is_multicast_ether_addr(eth->h_dest)) {
520+ skb_reset_mac_header(skb);
520521 macvlan_broadcast(skb, port, dev, MACVLAN_MODE_BRIDGE);
521522 goto xmit_world;
522523 }
drivers/net/netdevsim/dev.c+1−1
@@ -53,7 +53,7 @@ static ssize_t nsim_dev_take_snapshot_write(struct file *file, · 52 unmodified lines
5353
5454 get_random_bytes(dummy_data, NSIM_DEV_DUMMY_REGION_SIZE);
5555
56− id = devlink_region_shapshot_id_get(priv_to_devlink(nsim_dev));
56+ id = devlink_region_snapshot_id_get(priv_to_devlink(nsim_dev));
5757 err = devlink_region_snapshot_create(nsim_dev->dummy_region,
5858 dummy_data, id, kfree);
5959 if (err) {
drivers/net/phy/Kconfig+4−4
@@ -340,14 +340,14 @@ config DAVICOM_PHY · 339 unmodified lines
340340 Currently supports dm9161e and dm9131
341341
342342 config DP83822_PHY
343− tristate "Texas Instruments DP83822 PHY"
343+ tristate "Texas Instruments DP83822/825 PHYs"
344344 ---help---
345− Supports the DP83822 PHY.
345+ Supports the DP83822 and DP83825I PHYs.
346346
347347 config DP83TC811_PHY
348− tristate "Texas Instruments DP83TC822 PHY"
348+ tristate "Texas Instruments DP83TC811 PHY"
349349 ---help---
350− Supports the DP83TC822 PHY.
350+ Supports the DP83TC811 PHY.
351351
352352 config DP83848_PHY
353353 tristate "Texas Instruments DP83848 PHY"
drivers/net/phy/dp83867.c+7−1
@@ -97,6 +97,7 @@ · 96 unmodified lines
9797 #define DP83867_PHYCR_FIFO_DEPTH_MAX 0x03
9898 #define DP83867_PHYCR_FIFO_DEPTH_MASK GENMASK(15, 14)
9999 #define DP83867_PHYCR_RESERVED_MASK BIT(11)
100+#define DP83867_PHYCR_FORCE_LINK_GOOD BIT(10)
100101
101102 /* RGMIIDCTL bits */
102103 #define DP83867_RGMII_TX_CLK_DELAY_MAX 0xf
@@ -599,7 +600,12 @@ static int dp83867_phy_reset(struct phy_device *phydev) · 496 unmodified lines
599600
600601 usleep_range(10, 20);
601602
602− return 0;
603+ /* After reset FORCE_LINK_GOOD bit is set. Although the
604+ * default value should be unset. Disable FORCE_LINK_GOOD
605+ * for the phy to work properly.
606+ */
607+ return phy_modify(phydev, MII_DP83867_PHYCTRL,
608+ DP83867_PHYCR_FORCE_LINK_GOOD, 0);
603609 }
604610
605611 static struct phy_driver dp83867_driver[] = {
drivers/net/usb/lan78xx.c+1−0
@@ -3750,6 +3750,7 @@ static int lan78xx_probe(struct usb_interface *intf, · 3749 unmodified lines
37503750
37513751 /* MTU range: 68 - 9000 */
37523752 netdev->max_mtu = MAX_SINGLE_PACKET_SIZE;
3753+ netif_set_gso_max_size(netdev, MAX_SINGLE_PACKET_SIZE - MAX_HEADER);
37533754
37543755 dev->ep_blkin = (intf->cur_altsetting)->endpoint + 0;
37553756 dev->ep_blkout = (intf->cur_altsetting)->endpoint + 1;
drivers/net/usb/qmi_wwan.c+1−0
@@ -1062,6 +1062,7 @@ static const struct usb_device_id products[] = { · 1061 unmodified lines
10621062 {QMI_QUIRK_QUECTEL_DYNCFG(0x2c7c, 0x0125)}, /* Quectel EC25, EC20 R2.0 Mini PCIe */
10631063 {QMI_QUIRK_QUECTEL_DYNCFG(0x2c7c, 0x0306)}, /* Quectel EP06/EG06/EM06 */
10641064 {QMI_QUIRK_QUECTEL_DYNCFG(0x2c7c, 0x0512)}, /* Quectel EG12/EM12 */
1065+ {QMI_QUIRK_QUECTEL_DYNCFG(0x2c7c, 0x0800)}, /* Quectel RM500Q-GL */
10651066
10661067 /* 3. Combined interface devices matching on interface number */
10671068 {QMI_FIXED_INTF(0x0408, 0xea42, 4)}, /* Yota / Megafon M100-1 */
drivers/net/usb/r8152.c+3−0
@@ -6597,6 +6597,9 @@ static int rtl8152_probe(struct usb_interface *intf, · 6596 unmodified lines
65976597 return -ENODEV;
65986598 }
65996599
6600+ if (intf->cur_altsetting->desc.bNumEndpoints < 3)
6601+ return -ENODEV;
6602+
66006603 usb_reset_device(udev);
66016604 netdev = alloc_etherdev(sizeof(struct r8152));
66026605 if (!netdev) {
drivers/net/wan/fsl_ucc_hdlc.c+1−1
@@ -73,7 +73,7 @@ static struct ucc_tdm_info utdm_primary_info = { · 72 unmodified lines
7373 },
7474 };
7575
76−static struct ucc_tdm_info utdm_info[MAX_HDLC_NUM];
76+static struct ucc_tdm_info utdm_info[UCC_MAX_NUM];
7777
7878 static int uhdlc_init(struct ucc_hdlc_private *priv)
7979 {
drivers/net/wan/lapbether.c+1−1
@@ -64,7 +64,7 @@ static struct lapbethdev *lapbeth_get_x25_dev(struct net_device *dev) · 63 unmodified lines
6464 {
6565 struct lapbethdev *lapbeth;
6666
67− list_for_each_entry_rcu(lapbeth, &lapbeth_devices, node) {
67+ list_for_each_entry_rcu(lapbeth, &lapbeth_devices, node, lockdep_rtnl_is_held()) {
6868 if (lapbeth->ethdev == dev)
6969 return lapbeth;
7070 }
drivers/nfc/pn533/usb.c+1−1
@@ -391,7 +391,7 @@ static int pn533_acr122_poweron_rdr(struct pn533_usb_phy *phy) · 390 unmodified lines
391391 cmd, sizeof(cmd), false);
392392
393393 rc = usb_bulk_msg(phy->udev, phy->out_urb->pipe, buffer, sizeof(cmd),
394− &transferred, 0);
394+ &transferred, 5000);
395395 kfree(buffer);
396396 if (rc || (transferred != sizeof(cmd))) {
397397 nfc_err(&phy->udev->dev,
drivers/platform/chrome/wilco_ec/keyboard_leds.c+20−8
@@ -73,13 +73,6 @@ static int send_kbbl_msg(struct wilco_ec_device *ec, · 72 unmodified lines
7373 return ret;
7474 }
7575
76− if (response->status) {
77− dev_err(ec->dev,
78− "EC reported failure sending keyboard LEDs command: %d",
79− response->status);
80− return -EIO;
81− }
82−
8376 return 0;
8477 }
8578
@@ -87,6 +80,7 @@ static int set_kbbl(struct wilco_ec_device *ec, enum led_brightness brightness) · 1 unmodified line
8780 {
8881 struct wilco_keyboard_leds_msg request;
8982 struct wilco_keyboard_leds_msg response;
83+ int ret;
9084
9185 memset(&request, 0, sizeof(request));
9286 request.command = WILCO_EC_COMMAND_KBBL;
@@ -94,7 +88,18 @@ static int set_kbbl(struct wilco_ec_device *ec, enum led_brightness brightness) · 1 unmodified line
9488 request.mode = WILCO_KBBL_MODE_FLAG_PWM;
9589 request.percent = brightness;
9690
97− return send_kbbl_msg(ec, &request, &response);
91+ ret = send_kbbl_msg(ec, &request, &response);
92+ if (ret < 0)
93+ return ret;
94+
95+ if (response.status) {
96+ dev_err(ec->dev,
97+ "EC reported failure sending keyboard LEDs command: %d",
98+ response.status);
99+ return -EIO;
100+ }
101+
102+ return 0;
98103 }
99104
100105 static int kbbl_exist(struct wilco_ec_device *ec, bool *exists)
@@ -140,6 +145,13 @@ static int kbbl_init(struct wilco_ec_device *ec) · 39 unmodified lines
140145 if (ret < 0)
141146 return ret;
142147
148+ if (response.status) {
149+ dev_err(ec->dev,
150+ "EC reported failure sending keyboard LEDs command: %d",
151+ response.status);
152+ return -EIO;
153+ }
154+
143155 if (response.mode & WILCO_KBBL_MODE_FLAG_PWM)
144156 return response.percent;
145157
drivers/platform/mellanox/mlxbf-tmfifo.c+10−9
@@ -149,7 +149,7 @@ struct mlxbf_tmfifo_irq_info { · 148 unmodified lines
149149 * @work: work struct for deferred process
150150 * @timer: background timer
151151 * @vring: Tx/Rx ring
152− * @spin_lock: spin lock
152+ * @spin_lock: Tx/Rx spin lock
153153 * @is_ready: ready flag
154154 */
155155 struct mlxbf_tmfifo {
@@ -164,7 +164,7 @@ struct mlxbf_tmfifo { · 8 unmodified lines
164164 struct work_struct work;
165165 struct timer_list timer;
166166 struct mlxbf_tmfifo_vring *vring[2];
167− spinlock_t spin_lock; /* spin lock */
167+ spinlock_t spin_lock[2]; /* spin lock */
168168 bool is_ready;
169169 };
170170
@@ -525,7 +525,7 @@ static void mlxbf_tmfifo_console_tx(struct mlxbf_tmfifo *fifo, int avail) · 354 unmodified lines
525525 writeq(*(u64 *)&hdr, fifo->tx_base + MLXBF_TMFIFO_TX_DATA);
526526
527527 /* Use spin-lock to protect the 'cons->tx_buf'. */
528− spin_lock_irqsave(&fifo->spin_lock, flags);
528+ spin_lock_irqsave(&fifo->spin_lock[0], flags);
529529
530530 while (size > 0) {
531531 addr = cons->tx_buf.buf + cons->tx_buf.tail;
@@ -552,7 +552,7 @@ static void mlxbf_tmfifo_console_tx(struct mlxbf_tmfifo *fifo, int avail) · 20 unmodified lines
552552 }
553553 }
554554
555− spin_unlock_irqrestore(&fifo->spin_lock, flags);
555+ spin_unlock_irqrestore(&fifo->spin_lock[0], flags);
556556 }
557557
558558 /* Rx/Tx one word in the descriptor buffer. */
@@ -731,9 +731,9 @@ static bool mlxbf_tmfifo_rxtx_one_desc(struct mlxbf_tmfifo_vring *vring, · 172 unmodified lines
731731 fifo->vring[is_rx] = NULL;
732732
733733 /* Notify upper layer that packet is done. */
734− spin_lock_irqsave(&fifo->spin_lock, flags);
734+ spin_lock_irqsave(&fifo->spin_lock[is_rx], flags);
735735 vring_interrupt(0, vring->vq);
736− spin_unlock_irqrestore(&fifo->spin_lock, flags);
736+ spin_unlock_irqrestore(&fifo->spin_lock[is_rx], flags);
737737 }
738738
739739 mlxbf_tmfifo_desc_done:
@@ -852,10 +852,10 @@ static bool mlxbf_tmfifo_virtio_notify(struct virtqueue *vq) · 112 unmodified lines
852852 * worker handler.
853853 */
854854 if (vring->vdev_id == VIRTIO_ID_CONSOLE) {
855− spin_lock_irqsave(&fifo->spin_lock, flags);
855+ spin_lock_irqsave(&fifo->spin_lock[0], flags);
856856 tm_vdev = fifo->vdev[VIRTIO_ID_CONSOLE];
857857 mlxbf_tmfifo_console_output(tm_vdev, vring);
858− spin_unlock_irqrestore(&fifo->spin_lock, flags);
858+ spin_unlock_irqrestore(&fifo->spin_lock[0], flags);
859859 } else if (test_and_set_bit(MLXBF_TM_TX_LWM_IRQ,
860860 &fifo->pend_events)) {
861861 return true;
@@ -1189,7 +1189,8 @@ static int mlxbf_tmfifo_probe(struct platform_device *pdev) · 327 unmodified lines
11891189 if (!fifo)
11901190 return -ENOMEM;
11911191
1192− spin_lock_init(&fifo->spin_lock);
1192+ spin_lock_init(&fifo->spin_lock[0]);
1193+ spin_lock_init(&fifo->spin_lock[1]);
11931194 INIT_WORK(&fifo->work, mlxbf_tmfifo_work_handler);
11941195 mutex_init(&fifo->lock);
11951196
drivers/platform/x86/asus-wmi.c+1−7
@@ -512,13 +512,7 @@ static void kbd_led_update(struct asus_wmi *asus) · 511 unmodified lines
512512 {
513513 int ctrl_param = 0;
514514
515− /*
516− * bits 0-2: level
517− * bit 7: light on/off
518− */
519− if (asus->kbd_led_wk > 0)
520− ctrl_param = 0x80 | (asus->kbd_led_wk & 0x7F);
521−
515+ ctrl_param = 0x80 | (asus->kbd_led_wk & 0x7F);
522516 asus_wmi_set_devstate(ASUS_WMI_DEVID_KBD_BACKLIGHT, ctrl_param, NULL);
523517 }
524518
drivers/platform/x86/gpd-pocket-fan.c+20−7
@@ -16,17 +16,27 @@ · 15 unmodified lines
1616
1717 #define MAX_SPEED 3
1818
19−static int temp_limits[3] = { 55000, 60000, 65000 };
19+#define TEMP_LIMIT0_DEFAULT 55000
20+#define TEMP_LIMIT1_DEFAULT 60000
21+#define TEMP_LIMIT2_DEFAULT 65000
22+
23+#define HYSTERESIS_DEFAULT 3000
24+
25+#define SPEED_ON_AC_DEFAULT 2
26+
27+static int temp_limits[3] = {
28+ TEMP_LIMIT0_DEFAULT, TEMP_LIMIT1_DEFAULT, TEMP_LIMIT2_DEFAULT,
29+};
2030 module_param_array(temp_limits, int, NULL, 0444);
2131 MODULE_PARM_DESC(temp_limits,
2232 "Millicelsius values above which the fan speed increases");
2333
24−static int hysteresis = 3000;
34+static int hysteresis = HYSTERESIS_DEFAULT;
2535 module_param(hysteresis, int, 0444);
2636 MODULE_PARM_DESC(hysteresis,
2737 "Hysteresis in millicelsius before lowering the fan speed");
2838
29−static int speed_on_ac = 2;
39+static int speed_on_ac = SPEED_ON_AC_DEFAULT;
3040 module_param(speed_on_ac, int, 0444);
3141 MODULE_PARM_DESC(speed_on_ac,
3242 "minimum fan speed to allow when system is powered by AC");
@@ -117,21 +127,24 @@ static int gpd_pocket_fan_probe(struct platform_device *pdev) · 84 unmodified lines
117127 int i;
118128
119129 for (i = 0; i < ARRAY_SIZE(temp_limits); i++) {
120− if (temp_limits[i] < 40000 || temp_limits[i] > 70000) {
130+ if (temp_limits[i] < 20000 || temp_limits[i] > 90000) {
121131 dev_err(&pdev->dev, "Invalid temp-limit %d (must be between 40000 and 70000)\n",
122132 temp_limits[i]);
123− return -EINVAL;
133+ temp_limits[0] = TEMP_LIMIT0_DEFAULT;
134+ temp_limits[1] = TEMP_LIMIT1_DEFAULT;
135+ temp_limits[2] = TEMP_LIMIT2_DEFAULT;
136+ break;
124137 }
125138 }
126139 if (hysteresis < 1000 || hysteresis > 10000) {
127140 dev_err(&pdev->dev, "Invalid hysteresis %d (must be between 1000 and 10000)\n",
128141 hysteresis);
129− return -EINVAL;
142+ hysteresis = HYSTERESIS_DEFAULT;
130143 }
131144 if (speed_on_ac < 0 || speed_on_ac > MAX_SPEED) {
132145 dev_err(&pdev->dev, "Invalid speed_on_ac %d (must be between 0 and 3)\n",
133146 speed_on_ac);
134− return -EINVAL;
147+ speed_on_ac = SPEED_ON_AC_DEFAULT;
135148 }
136149
137150 fan = devm_kzalloc(&pdev->dev, sizeof(*fan), GFP_KERNEL);
drivers/platform/x86/intel_ips.h+1−1
@@ -1,4 +1,4 @@
1−// SPDX-License-Identifier: GPL-2.0
1+/* SPDX-License-Identifier: GPL-2.0 */
22 /*
33 * Copyright (c) 2010 Intel Corporation
44 */
drivers/platform/x86/intel_pmc_core.h+1−1
@@ -1,4 +1,4 @@
1−// SPDX-License-Identifier: GPL-2.0
1+/* SPDX-License-Identifier: GPL-2.0 */
22 /*
33 * Intel Core SoC Power Management Controller Header File
44 *
drivers/platform/x86/intel_pmc_core_pltdrv.c+2−0
@@ -44,6 +44,8 @@ static const struct x86_cpu_id intel_pmc_core_platform_ids[] = { · 43 unmodified lines
4444 INTEL_CPU_FAM6(KABYLAKE, pmc_core_device),
4545 INTEL_CPU_FAM6(CANNONLAKE_L, pmc_core_device),
4646 INTEL_CPU_FAM6(ICELAKE_L, pmc_core_device),
47+ INTEL_CPU_FAM6(COMETLAKE, pmc_core_device),
48+ INTEL_CPU_FAM6(COMETLAKE_L, pmc_core_device),
4749 {}
4850 };
4951 MODULE_DEVICE_TABLE(x86cpu, intel_pmc_core_platform_ids);
drivers/ptp/ptp_clock.c+2−2
@@ -170,6 +170,7 @@ static void ptp_clock_release(struct device *dev) · 169 unmodified lines
170170 {
171171 struct ptp_clock *ptp = container_of(dev, struct ptp_clock, dev);
172172
173+ ptp_cleanup_pin_groups(ptp);
173174 mutex_destroy(&ptp->tsevq_mux);
174175 mutex_destroy(&ptp->pincfg_mux);
175176 ida_simple_remove(&ptp_clocks_map, ptp->index);
@@ -302,9 +303,8 @@ int ptp_clock_unregister(struct ptp_clock *ptp) · 126 unmodified lines
302303 if (ptp->pps_source)
303304 pps_unregister_source(ptp->pps_source);
304305
305− ptp_cleanup_pin_groups(ptp);
306−
307306 posix_clock_unregister(&ptp->clock);
307+
308308 return 0;
309309 }
310310 EXPORT_SYMBOL(ptp_clock_unregister);
drivers/s390/crypto/ap_bus.c+0−2
@@ -793,8 +793,6 @@ static int ap_device_probe(struct device *dev) · 792 unmodified lines
793793 drvres = ap_drv->flags & AP_DRIVER_FLAG_DEFAULT;
794794 if (!!devres != !!drvres)
795795 return -ENODEV;
796− /* (re-)init queue's state machine */
797− ap_queue_reinit_state(to_ap_queue(dev));
798796 }
799797
800798 /* Add queue/card to list of active queues/cards */
drivers/s390/crypto/ap_bus.h+1−1
@@ -261,7 +261,7 @@ void ap_queue_prepare_remove(struct ap_queue *aq); · 260 unmodified lines
261261 void ap_queue_remove(struct ap_queue *aq);
262262 void ap_queue_suspend(struct ap_device *ap_dev);
263263 void ap_queue_resume(struct ap_device *ap_dev);
264−void ap_queue_reinit_state(struct ap_queue *aq);
264+void ap_queue_init_state(struct ap_queue *aq);
265265
266266 struct ap_card *ap_card_create(int id, int queue_depth, int raw_device_type,
267267 int comp_device_type, unsigned int functions);
drivers/s390/crypto/ap_queue.c+3−2
@@ -638,7 +638,7 @@ struct ap_queue *ap_queue_create(ap_qid_t qid, int device_type) · 637 unmodified lines
638638 aq->ap_dev.device.type = &ap_queue_type;
639639 aq->ap_dev.device_type = device_type;
640640 aq->qid = qid;
641− aq->state = AP_STATE_RESET_START;
641+ aq->state = AP_STATE_UNBOUND;
642642 aq->interrupt = AP_INTR_DISABLED;
643643 spin_lock_init(&aq->lock);
644644 INIT_LIST_HEAD(&aq->list);
@@ -771,10 +771,11 @@ void ap_queue_remove(struct ap_queue *aq) · 126 unmodified lines
771771 spin_unlock_bh(&aq->lock);
772772 }
773773
774−void ap_queue_reinit_state(struct ap_queue *aq)
774+void ap_queue_init_state(struct ap_queue *aq)
775775 {
776776 spin_lock_bh(&aq->lock);
777777 aq->state = AP_STATE_RESET_START;
778778 ap_wait(ap_sm_event(aq, AP_EVENT_POLL));
779779 spin_unlock_bh(&aq->lock);
780780 }
781+EXPORT_SYMBOL(ap_queue_init_state);
drivers/s390/crypto/zcrypt_ccamisc.c+2−2
@@ -1037,8 +1037,8 @@ static int _ip_cprb_helper(u16 cardnr, u16 domain, · 1036 unmodified lines
10371037 prepparm = (struct iprepparm *) prepcblk->rpl_parmb;
10381038
10391039 /* do some plausibility checks on the key block */
1040− if (prepparm->kb.len < 120 + 5 * sizeof(uint16_t) ||
1041− prepparm->kb.len > 136 + 5 * sizeof(uint16_t)) {
1040+ if (prepparm->kb.len < 120 + 3 * sizeof(uint16_t) ||
1041+ prepparm->kb.len > 136 + 3 * sizeof(uint16_t)) {
10421042 DEBUG_ERR("%s reply with invalid or unknown key block\n",
10431043 __func__);
10441044 rc = -EIO;
drivers/s390/crypto/zcrypt_cex2a.c+1−0
@@ -175,6 +175,7 @@ static int zcrypt_cex2a_queue_probe(struct ap_device *ap_dev) · 174 unmodified lines
175175 zq->queue = aq;
176176 zq->online = 1;
177177 atomic_set(&zq->load, 0);
178+ ap_queue_init_state(aq);
178179 ap_queue_init_reply(aq, &zq->reply);
179180 aq->request_timeout = CEX2A_CLEANUP_TIME,
180181 aq->private = zq;
drivers/s390/crypto/zcrypt_cex2c.c+2−0
@@ -220,6 +220,7 @@ static int zcrypt_cex2c_queue_probe(struct ap_device *ap_dev) · 219 unmodified lines
220220 zq->queue = aq;
221221 zq->online = 1;
222222 atomic_set(&zq->load, 0);
223+ ap_rapq(aq->qid);
223224 rc = zcrypt_cex2c_rng_supported(aq);
224225 if (rc < 0) {
225226 zcrypt_queue_free(zq);
@@ -231,6 +232,7 @@ static int zcrypt_cex2c_queue_probe(struct ap_device *ap_dev) · 5 unmodified lines
231232 else
232233 zq->ops = zcrypt_msgtype(MSGTYPE06_NAME,
233234 MSGTYPE06_VARIANT_NORNG);
235+ ap_queue_init_state(aq);
234236 ap_queue_init_reply(aq, &zq->reply);
235237 aq->request_timeout = CEX2C_CLEANUP_TIME;
236238 aq->private = zq;
drivers/s390/crypto/zcrypt_cex4.c+1−0
@@ -381,6 +381,7 @@ static int zcrypt_cex4_queue_probe(struct ap_device *ap_dev) · 380 unmodified lines
381381 zq->queue = aq;
382382 zq->online = 1;
383383 atomic_set(&zq->load, 0);
384+ ap_queue_init_state(aq);
384385 ap_queue_init_reply(aq, &zq->reply);
385386 aq->request_timeout = CEX4_CLEANUP_TIME,
386387 aq->private = zq;
drivers/scsi/fnic/vnic_dev.c+10−10
@@ -688,26 +688,26 @@ int vnic_dev_soft_reset_done(struct vnic_dev *vdev, int *done) · 687 unmodified lines
688688
689689 int vnic_dev_hang_notify(struct vnic_dev *vdev)
690690 {
691− u64 a0, a1;
691+ u64 a0 = 0, a1 = 0;
692692 int wait = 1000;
693693 return vnic_dev_cmd(vdev, CMD_HANG_NOTIFY, &a0, &a1, wait);
694694 }
695695
696696 int vnic_dev_mac_addr(struct vnic_dev *vdev, u8 *mac_addr)
697697 {
698− u64 a0, a1;
698+ u64 a[2] = {};
699699 int wait = 1000;
700700 int err, i;
701701
702702 for (i = 0; i < ETH_ALEN; i++)
703703 mac_addr[i] = 0;
704704
705− err = vnic_dev_cmd(vdev, CMD_MAC_ADDR, &a0, &a1, wait);
705+ err = vnic_dev_cmd(vdev, CMD_MAC_ADDR, &a[0], &a[1], wait);
706706 if (err)
707707 return err;
708708
709709 for (i = 0; i < ETH_ALEN; i++)
710− mac_addr[i] = ((u8 *)&a0)[i];
710+ mac_addr[i] = ((u8 *)&a)[i];
711711
712712 return 0;
713713 }
@@ -732,30 +732,30 @@ void vnic_dev_packet_filter(struct vnic_dev *vdev, int directed, int multicast, · 18 unmodified lines
732732
733733 void vnic_dev_add_addr(struct vnic_dev *vdev, u8 *addr)
734734 {
735− u64 a0 = 0, a1 = 0;
735+ u64 a[2] = {};
736736 int wait = 1000;
737737 int err;
738738 int i;
739739
740740 for (i = 0; i < ETH_ALEN; i++)
741− ((u8 *)&a0)[i] = addr[i];
741+ ((u8 *)&a)[i] = addr[i];
742742
743− err = vnic_dev_cmd(vdev, CMD_ADDR_ADD, &a0, &a1, wait);
743+ err = vnic_dev_cmd(vdev, CMD_ADDR_ADD, &a[0], &a[1], wait);
744744 if (err)
745745 pr_err("Can't add addr [%pM], %d\n", addr, err);
746746 }
747747
748748 void vnic_dev_del_addr(struct vnic_dev *vdev, u8 *addr)
749749 {
750− u64 a0 = 0, a1 = 0;
750+ u64 a[2] = {};
751751 int wait = 1000;
752752 int err;
753753 int i;
754754
755755 for (i = 0; i < ETH_ALEN; i++)
756− ((u8 *)&a0)[i] = addr[i];
756+ ((u8 *)&a)[i] = addr[i];
757757
758− err = vnic_dev_cmd(vdev, CMD_ADDR_DEL, &a0, &a1, wait);
758+ err = vnic_dev_cmd(vdev, CMD_ADDR_DEL, &a[0], &a[1], wait);
759759 if (err)
760760 pr_err("Can't del addr [%pM], %d\n", addr, err);
761761 }
drivers/scsi/sd.c+3−1
@@ -2211,8 +2211,10 @@ static int sd_read_protection_type(struct scsi_disk *sdkp, unsigned char *buffer · 2210 unmodified lines
22112211 u8 type;
22122212 int ret = 0;
22132213
2214− if (scsi_device_protection(sdp) == 0 || (buffer[12] & 1) == 0)
2214+ if (scsi_device_protection(sdp) == 0 || (buffer[12] & 1) == 0) {
2215+ sdkp->protection_type = 0;
22152216 return ret;
2217+ }
22162218
22172219 type = ((buffer[12] >> 1) & 7) + 1; /* P_TYPE 0 = Type 1 */
22182220
drivers/scsi/storvsc_drv.c+3−1
@@ -1842,9 +1842,11 @@ static int storvsc_probe(struct hv_device *device, · 1841 unmodified lines
18421842 */
18431843 host->sg_tablesize = (stor_device->max_transfer_bytes >> PAGE_SHIFT);
18441844 /*
1845+ * For non-IDE disks, the host supports multiple channels.
18451846 * Set the number of HW queues we are supporting.
18461847 */
1847− host->nr_hw_queues = num_present_cpus();
1848+ if (!dev_is_ide)
1849+ host->nr_hw_queues = num_present_cpus();
18481850
18491851 /*
18501852 * Set the error handler work queue.
drivers/soc/amlogic/meson-ee-pwrc.c+15−9
@@ -323,6 +323,8 @@ static int meson_ee_pwrc_init_domain(struct platform_device *pdev, · 322 unmodified lines
323323 struct meson_ee_pwrc *pwrc,
324324 struct meson_ee_pwrc_domain *dom)
325325 {
326+ int ret;
327+
326328 dom->pwrc = pwrc;
327329 dom->num_rstc = dom->desc.reset_names_count;
328330 dom->num_clks = dom->desc.clk_names_count;
@@ -368,15 +370,21 @@ static int meson_ee_pwrc_init_domain(struct platform_device *pdev, · 39 unmodified lines
368370 * prepare/enable counters won't be in sync.
369371 */
370372 if (dom->num_clks && dom->desc.get_power && !dom->desc.get_power(dom)) {
371− int ret = clk_bulk_prepare_enable(dom->num_clks, dom->clks);
373+ ret = clk_bulk_prepare_enable(dom->num_clks, dom->clks);
372374 if (ret)
373375 return ret;
374376
375− pm_genpd_init(&dom->base, &pm_domain_always_on_gov, false);
376− } else
377− pm_genpd_init(&dom->base, NULL,
378− (dom->desc.get_power ?
379− dom->desc.get_power(dom) : true));
377+ ret = pm_genpd_init(&dom->base, &pm_domain_always_on_gov,
378+ false);
379+ if (ret)
380+ return ret;
381+ } else {
382+ ret = pm_genpd_init(&dom->base, NULL,
383+ (dom->desc.get_power ?
384+ dom->desc.get_power(dom) : true));
385+ if (ret)
386+ return ret;
387+ }
380388
381389 return 0;
382390 }
@@ -441,9 +449,7 @@ static int meson_ee_pwrc_probe(struct platform_device *pdev) · 58 unmodified lines
441449 pwrc->xlate.domains[i] = &dom->base;
442450 }
443451
444− of_genpd_add_provider_onecell(pdev->dev.of_node, &pwrc->xlate);
445−
446− return 0;
452+ return of_genpd_add_provider_onecell(pdev->dev.of_node, &pwrc->xlate);
447453 }
448454
449455 static void meson_ee_pwrc_shutdown(struct platform_device *pdev)
drivers/soc/ti/wkup_m3_ipc.c+2−2
@@ -419,6 +419,8 @@ static void wkup_m3_rproc_boot_thread(struct wkup_m3_ipc *m3_ipc) · 418 unmodified lines
419419 ret = rproc_boot(m3_ipc->rproc);
420420 if (ret)
421421 dev_err(dev, "rproc_boot failed\n");
422+ else
423+ m3_ipc_state = m3_ipc;
422424
423425 do_exit(0);
424426 }
@@ -505,8 +507,6 @@ static int wkup_m3_ipc_probe(struct platform_device *pdev) · 80 unmodified lines
505507 goto err_put_rproc;
506508 }
507509
508− m3_ipc_state = m3_ipc;
509−
510510 return 0;
511511
512512 err_put_rproc:
drivers/staging/comedi/drivers/ni_routes.c+6−6
@@ -72,9 +72,6 @@ static int ni_find_device_routes(const char *device_family, · 71 unmodified lines
7272 }
7373 }
7474
75− if (!rv)
76− return -ENODATA;
77−
7875 /* Second, find the set of routes valid for this device. */
7976 for (i = 0; ni_device_routes_list[i]; ++i) {
8077 if (memcmp(ni_device_routes_list[i]->device, board_name,
@@ -84,12 +81,12 @@ static int ni_find_device_routes(const char *device_family, · 3 unmodified lines
8481 }
8582 }
8683
87− if (!dr)
88− return -ENODATA;
89−
9084 tables->route_values = rv;
9185 tables->valid_routes = dr;
9286
87+ if (!rv || !dr)
88+ return -ENODATA;
89+
9390 return 0;
9491 }
9592
@@ -487,6 +484,9 @@ int ni_find_route_source(const u8 src_sel_reg_value, int dest, · 391 unmodified lines
487484 {
488485 int src;
489486
487+ if (!tables->route_values)
488+ return -EINVAL;
489+
490490 dest = B(dest); /* subtract NI names offset */
491491 /* ensure we are not going to under/over run the route value table */
492492 if (dest < 0 || dest >= NI_NUM_NAMES)
drivers/tee/optee/shm_pool.c+14−1
@@ -28,9 +28,22 @@ static int pool_op_alloc(struct tee_shm_pool_mgr *poolm, · 27 unmodified lines
2828 shm->size = PAGE_SIZE << order;
2929
3030 if (shm->flags & TEE_SHM_DMA_BUF) {
31+ unsigned int nr_pages = 1 << order, i;
32+ struct page **pages;
33+
34+ pages = kcalloc(nr_pages, sizeof(pages), GFP_KERNEL);
35+ if (!pages)
36+ return -ENOMEM;
37+
38+ for (i = 0; i < nr_pages; i++) {
39+ pages[i] = page;
40+ page++;
41+ }
42+
3143 shm->flags |= TEE_SHM_REGISTER;
32− rc = optee_shm_register(shm->ctx, shm, &page, 1 << order,
44+ rc = optee_shm_register(shm->ctx, shm, pages, nr_pages,
3345 (unsigned long)shm->kaddr);
46+ kfree(pages);
3447 }
3548
3649 return rc;
drivers/usb/core/hub.c+1−0
@@ -1192,6 +1192,7 @@ static void hub_activate(struct usb_hub *hub, enum hub_activation_type type) · 1191 unmodified lines
11921192 * PORT_OVER_CURRENT is not. So check for any of them.
11931193 */
11941194 if (udev || (portstatus & USB_PORT_STAT_CONNECTION) ||
1195+ (portchange & USB_PORT_STAT_C_CONNECTION) ||
11951196 (portstatus & USB_PORT_STAT_OVERCURRENT) ||
11961197 (portchange & USB_PORT_STAT_C_OVERCURRENT))
11971198 set_bit(port1, hub->change_bits);
drivers/usb/serial/ch341.c+5−1
@@ -642,9 +642,13 @@ static int ch341_tiocmget(struct tty_struct *tty) · 641 unmodified lines
642642 static int ch341_reset_resume(struct usb_serial *serial)
643643 {
644644 struct usb_serial_port *port = serial->port[0];
645− struct ch341_private *priv = usb_get_serial_port_data(port);
645+ struct ch341_private *priv;
646646 int ret;
647647
648+ priv = usb_get_serial_port_data(port);
649+ if (!priv)
650+ return 0;
651+
648652 /* reconfigure ch341 serial port after bus-reset */
649653 ch341_configure(serial->dev, priv);
650654
drivers/usb/serial/io_edgeport.c+9−7
@@ -716,7 +716,7 @@ static void edge_interrupt_callback(struct urb *urb) · 715 unmodified lines
716716 if (txCredits) {
717717 port = edge_serial->serial->port[portNumber];
718718 edge_port = usb_get_serial_port_data(port);
719− if (edge_port->open) {
719+ if (edge_port && edge_port->open) {
720720 spin_lock_irqsave(&edge_port->ep_lock,
721721 flags);
722722 edge_port->txCredits += txCredits;
@@ -1725,7 +1725,8 @@ static void edge_break(struct tty_struct *tty, int break_state) · 1002 unmodified lines
17251725 static void process_rcvd_data(struct edgeport_serial *edge_serial,
17261726 unsigned char *buffer, __u16 bufferLength)
17271727 {
1728− struct device *dev = &edge_serial->serial->dev->dev;
1728+ struct usb_serial *serial = edge_serial->serial;
1729+ struct device *dev = &serial->dev->dev;
17291730 struct usb_serial_port *port;
17301731 struct edgeport_port *edge_port;
17311732 __u16 lastBufferLength;
@@ -1821,11 +1822,10 @@ static void process_rcvd_data(struct edgeport_serial *edge_serial, · 89 unmodified lines
18211822
18221823 /* spit this data back into the tty driver if this
18231824 port is open */
1824− if (rxLen) {
1825− port = edge_serial->serial->port[
1826− edge_serial->rxPort];
1825+ if (rxLen && edge_serial->rxPort < serial->num_ports) {
1826+ port = serial->port[edge_serial->rxPort];
18271827 edge_port = usb_get_serial_port_data(port);
1828− if (edge_port->open) {
1828+ if (edge_port && edge_port->open) {
18291829 dev_dbg(dev, "%s - Sending %d bytes to TTY for port %d\n",
18301830 __func__, rxLen,
18311831 edge_serial->rxPort);
@@ -1833,8 +1833,8 @@ static void process_rcvd_data(struct edgeport_serial *edge_serial, · 1 unmodified line
18331833 rxLen);
18341834 edge_port->port->icount.rx += rxLen;
18351835 }
1836− buffer += rxLen;
18371836 }
1837+ buffer += rxLen;
18381838 break;
18391839
18401840 case EXPECT_HDR3: /* Expect 3rd byte of status header */
@@ -1869,6 +1869,8 @@ static void process_rcvd_status(struct edgeport_serial *edge_serial, · 28 unmodified lines
18691869 __u8 code = edge_serial->rxStatusCode;
18701870
18711871 /* switch the port pointer to the one being currently talked about */
1872+ if (edge_serial->rxPort >= edge_serial->serial->num_ports)
1873+ return;
18721874 port = edge_serial->serial->port[edge_serial->rxPort];
18731875 edge_port = usb_get_serial_port_data(port);
18741876 if (edge_port == NULL) {
drivers/usb/serial/keyspan.c+4−0
@@ -1058,6 +1058,8 @@ static void usa49_glocont_callback(struct urb *urb) · 1057 unmodified lines
10581058 for (i = 0; i < serial->num_ports; ++i) {
10591059 port = serial->port[i];
10601060 p_priv = usb_get_serial_port_data(port);
1061+ if (!p_priv)
1062+ continue;
10611063
10621064 if (p_priv->resend_cont) {
10631065 dev_dbg(&port->dev, "%s - sending setup\n", __func__);
@@ -1459,6 +1461,8 @@ static void usa67_glocont_callback(struct urb *urb) · 395 unmodified lines
14591461 for (i = 0; i < serial->num_ports; ++i) {
14601462 port = serial->port[i];
14611463 p_priv = usb_get_serial_port_data(port);
1464+ if (!p_priv)
1465+ continue;
14621466
14631467 if (p_priv->resend_cont) {
14641468 dev_dbg(&port->dev, "%s - sending setup\n", __func__);
drivers/usb/serial/opticon.c+1−1
@@ -113,7 +113,7 @@ static int send_control_msg(struct usb_serial_port *port, u8 requesttype, · 112 unmodified lines
113113 retval = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0),
114114 requesttype,
115115 USB_DIR_OUT|USB_TYPE_VENDOR|USB_RECIP_INTERFACE,
116− 0, 0, buffer, 1, 0);
116+ 0, 0, buffer, 1, USB_CTRL_SET_TIMEOUT);
117117 kfree(buffer);
118118
119119 if (retval < 0)
drivers/usb/serial/option.c+6−0
@@ -248,6 +248,7 @@ static void option_instat_callback(struct urb *urb); · 247 unmodified lines
248248 #define QUECTEL_PRODUCT_BG96 0x0296
249249 #define QUECTEL_PRODUCT_EP06 0x0306
250250 #define QUECTEL_PRODUCT_EM12 0x0512
251+#define QUECTEL_PRODUCT_RM500Q 0x0800
251252
252253 #define CMOTECH_VENDOR_ID 0x16d8
253254 #define CMOTECH_PRODUCT_6001 0x6001
@@ -1104,6 +1105,11 @@ static const struct usb_device_id option_ids[] = { · 850 unmodified lines
11041105 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM12, 0xff, 0xff, 0xff),
11051106 .driver_info = RSVD(1) | RSVD(2) | RSVD(3) | RSVD(4) | NUMEP2 },
11061107 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM12, 0xff, 0, 0) },
1108+ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500Q, 0xff, 0xff, 0x30) },
1109+ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500Q, 0xff, 0, 0) },
1110+ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500Q, 0xff, 0xff, 0x10),
1111+ .driver_info = ZLP },
1112+
11071113 { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6001) },
11081114 { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CMU_300) },
11091115 { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6003),
drivers/usb/serial/quatech2.c+6−0
@@ -841,7 +841,10 @@ static void qt2_update_msr(struct usb_serial_port *port, unsigned char *ch) · 840 unmodified lines
841841 u8 newMSR = (u8) *ch;
842842 unsigned long flags;
843843
844+ /* May be called from qt2_process_read_urb() for an unbound port. */
844845 port_priv = usb_get_serial_port_data(port);
846+ if (!port_priv)
847+ return;
845848
846849 spin_lock_irqsave(&port_priv->lock, flags);
847850 port_priv->shadowMSR = newMSR;
@@ -869,7 +872,10 @@ static void qt2_update_lsr(struct usb_serial_port *port, unsigned char *ch) · 21 unmodified lines
869872 unsigned long flags;
870873 u8 newLSR = (u8) *ch;
871874
875+ /* May be called from qt2_process_read_urb() for an unbound port. */
872876 port_priv = usb_get_serial_port_data(port);
877+ if (!port_priv)
878+ return;
873879
874880 if (newLSR & UART_LSR_BI)
875881 newLSR &= (u8) (UART_LSR_OE | UART_LSR_BI);
drivers/usb/serial/usb-serial-simple.c+2−0
@@ -86,6 +86,8 @@ DEVICE(moto_modem, MOTO_IDS); · 85 unmodified lines
8686 #define MOTOROLA_TETRA_IDS() \
8787 { USB_DEVICE(0x0cad, 0x9011) }, /* Motorola Solutions TETRA PEI */ \
8888 { USB_DEVICE(0x0cad, 0x9012) }, /* MTP6550 */ \
89+ { USB_DEVICE(0x0cad, 0x9013) }, /* MTP3xxx */ \
90+ { USB_DEVICE(0x0cad, 0x9015) }, /* MTP85xx */ \
8991 { USB_DEVICE(0x0cad, 0x9016) } /* TPG2200 */
9092 DEVICE(motorola_tetra, MOTOROLA_TETRA_IDS);
9193
drivers/usb/serial/usb-serial.c+3−0
@@ -1317,6 +1317,9 @@ static int usb_serial_register(struct usb_serial_driver *driver) · 1316 unmodified lines
13171317 return -EINVAL;
13181318 }
13191319
1320+ /* Prevent individual ports from being unbound. */
1321+ driver->driver.suppress_bind_attrs = true;
1322+
13201323 usb_serial_operations_init(driver);
13211324
13221325 /* Add this device to our list of devices */
fs/afs/dir.c+8−10
@@ -908,6 +908,7 @@ static struct dentry *afs_lookup(struct inode *dir, struct dentry *dentry, · 907 unmodified lines
908908 unsigned int flags)
909909 {
910910 struct afs_vnode *dvnode = AFS_FS_I(dir);
911+ struct afs_fid fid = {};
911912 struct inode *inode;
912913 struct dentry *d;
913914 struct key *key;
@@ -951,21 +952,18 @@ static struct dentry *afs_lookup(struct inode *dir, struct dentry *dentry, · 37 unmodified lines
951952 afs_stat_v(dvnode, n_lookup);
952953 inode = afs_do_lookup(dir, dentry, key);
953954 key_put(key);
954− if (inode == ERR_PTR(-ENOENT)) {
955+ if (inode == ERR_PTR(-ENOENT))
955956 inode = afs_try_auto_mntpt(dentry, dir);
956− } else {
957− dentry->d_fsdata =
958− (void *)(unsigned long)dvnode->status.data_version;
959− }
957+
958+ if (!IS_ERR_OR_NULL(inode))
959+ fid = AFS_FS_I(inode)->fid;
960+
960961 d = d_splice_alias(inode, dentry);
961962 if (!IS_ERR_OR_NULL(d)) {
962963 d->d_fsdata = dentry->d_fsdata;
963− trace_afs_lookup(dvnode, &d->d_name,
964− inode ? AFS_FS_I(inode) : NULL);
964+ trace_afs_lookup(dvnode, &d->d_name, &fid);
965965 } else {
966− trace_afs_lookup(dvnode, &dentry->d_name,
967− IS_ERR_OR_NULL(inode) ? NULL
968− : AFS_FS_I(inode));
966+ trace_afs_lookup(dvnode, &dentry->d_name, &fid);
969967 }
970968 return d;
971969 }
fs/btrfs/inode.c+39−34
@@ -4238,18 +4238,30 @@ out: · 4237 unmodified lines
42384238 }
42394239
42404240 static int btrfs_unlink_subvol(struct btrfs_trans_handle *trans,
4241− struct inode *dir, u64 objectid,
4242− const char *name, int name_len)
4241+ struct inode *dir, struct dentry *dentry)
42434242 {
42444243 struct btrfs_root *root = BTRFS_I(dir)->root;
4244+ struct btrfs_inode *inode = BTRFS_I(d_inode(dentry));
42454245 struct btrfs_path *path;
42464246 struct extent_buffer *leaf;
42474247 struct btrfs_dir_item *di;
42484248 struct btrfs_key key;
4249+ const char *name = dentry->d_name.name;
4250+ int name_len = dentry->d_name.len;
42494251 u64 index;
42504252 int ret;
4253+ u64 objectid;
42514254 u64 dir_ino = btrfs_ino(BTRFS_I(dir));
42524255
4256+ if (btrfs_ino(inode) == BTRFS_FIRST_FREE_OBJECTID) {
4257+ objectid = inode->root->root_key.objectid;
4258+ } else if (btrfs_ino(inode) == BTRFS_EMPTY_SUBVOL_DIR_OBJECTID) {
4259+ objectid = inode->location.objectid;
4260+ } else {
4261+ WARN_ON(1);
4262+ return -EINVAL;
4263+ }
4264+
42534265 path = btrfs_alloc_path();
42544266 if (!path)
42554267 return -ENOMEM;
@@ -4271,13 +4283,16 @@ static int btrfs_unlink_subvol(struct btrfs_trans_handle *trans, · 15 unmodified lines
42714283 }
42724284 btrfs_release_path(path);
42734285
4274− ret = btrfs_del_root_ref(trans, objectid, root->root_key.objectid,
4275− dir_ino, &index, name, name_len);
4276− if (ret < 0) {
4277− if (ret != -ENOENT) {
4278− btrfs_abort_transaction(trans, ret);
4279− goto out;
4280− }
4286+ /*
4287+ * This is a placeholder inode for a subvolume we didn't have a
4288+ * reference to at the time of the snapshot creation. In the meantime
4289+ * we could have renamed the real subvol link into our snapshot, so
4290+ * depending on btrfs_del_root_ref to return -ENOENT here is incorret.
4291+ * Instead simply lookup the dir_index_item for this entry so we can
4292+ * remove it. Otherwise we know we have a ref to the root and we can
4293+ * call btrfs_del_root_ref, and it _shouldn't_ fail.
4294+ */
4295+ if (btrfs_ino(inode) == BTRFS_EMPTY_SUBVOL_DIR_OBJECTID) {
42814296 di = btrfs_search_dir_index_item(root, path, dir_ino,
42824297 name, name_len);
42834298 if (IS_ERR_OR_NULL(di)) {
@@ -4292,8 +4307,16 @@ static int btrfs_unlink_subvol(struct btrfs_trans_handle *trans, · 8 unmodified lines
42924307 leaf = path->nodes[0];
42934308 btrfs_item_key_to_cpu(leaf, &key, path->slots[0]);
42944309 index = key.offset;
4310+ btrfs_release_path(path);
4311+ } else {
4312+ ret = btrfs_del_root_ref(trans, objectid,
4313+ root->root_key.objectid, dir_ino,
4314+ &index, name, name_len);
4315+ if (ret) {
4316+ btrfs_abort_transaction(trans, ret);
4317+ goto out;
4318+ }
42954319 }
4296− btrfs_release_path(path);
42974320
42984321 ret = btrfs_delete_delayed_dir_index(trans, BTRFS_I(dir), index);
42994322 if (ret) {
@@ -4487,8 +4510,7 @@ int btrfs_delete_subvolume(struct inode *dir, struct dentry *dentry) · 187 unmodified lines
44874510
44884511 btrfs_record_snapshot_destroy(trans, BTRFS_I(dir));
44894512
4490− ret = btrfs_unlink_subvol(trans, dir, dest->root_key.objectid,
4491− dentry->d_name.name, dentry->d_name.len);
4513+ ret = btrfs_unlink_subvol(trans, dir, dentry);
44924514 if (ret) {
44934515 err = ret;
44944516 btrfs_abort_transaction(trans, ret);
@@ -4583,10 +4605,7 @@ static int btrfs_rmdir(struct inode *dir, struct dentry *dentry) · 88 unmodified lines
45834605 return PTR_ERR(trans);
45844606
45854607 if (unlikely(btrfs_ino(BTRFS_I(inode)) == BTRFS_EMPTY_SUBVOL_DIR_OBJECTID)) {
4586− err = btrfs_unlink_subvol(trans, dir,
4587− BTRFS_I(inode)->location.objectid,
4588− dentry->d_name.name,
4589− dentry->d_name.len);
4608+ err = btrfs_unlink_subvol(trans, dir, dentry);
45904609 goto out;
45914610 }
45924611
@@ -9536,7 +9555,6 @@ static int btrfs_rename_exchange(struct inode *old_dir, · 4943 unmodified lines
95369555 u64 new_ino = btrfs_ino(BTRFS_I(new_inode));
95379556 u64 old_idx = 0;
95389557 u64 new_idx = 0;
9539− u64 root_objectid;
95409558 int ret;
95419559 bool root_log_pinned = false;
95429560 bool dest_log_pinned = false;
@@ -9642,10 +9660,7 @@ static int btrfs_rename_exchange(struct inode *old_dir, · 99 unmodified lines
96429660
96439661 /* src is a subvolume */
96449662 if (old_ino == BTRFS_FIRST_FREE_OBJECTID) {
9645− root_objectid = BTRFS_I(old_inode)->root->root_key.objectid;
9646− ret = btrfs_unlink_subvol(trans, old_dir, root_objectid,
9647− old_dentry->d_name.name,
9648− old_dentry->d_name.len);
9663+ ret = btrfs_unlink_subvol(trans, old_dir, old_dentry);
96499664 } else { /* src is an inode */
96509665 ret = __btrfs_unlink_inode(trans, root, BTRFS_I(old_dir),
96519666 BTRFS_I(old_dentry->d_inode),
@@ -9661,10 +9676,7 @@ static int btrfs_rename_exchange(struct inode *old_dir, · 9 unmodified lines
96619676
96629677 /* dest is a subvolume */
96639678 if (new_ino == BTRFS_FIRST_FREE_OBJECTID) {
9664− root_objectid = BTRFS_I(new_inode)->root->root_key.objectid;
9665− ret = btrfs_unlink_subvol(trans, new_dir, root_objectid,
9666− new_dentry->d_name.name,
9667− new_dentry->d_name.len);
9679+ ret = btrfs_unlink_subvol(trans, new_dir, new_dentry);
96689680 } else { /* dest is an inode */
96699681 ret = __btrfs_unlink_inode(trans, dest, BTRFS_I(new_dir),
96709682 BTRFS_I(new_dentry->d_inode),
@@ -9862,7 +9874,6 @@ static int btrfs_rename(struct inode *old_dir, struct dentry *old_dentry, · 191 unmodified lines
98629874 struct inode *new_inode = d_inode(new_dentry);
98639875 struct inode *old_inode = d_inode(old_dentry);
98649876 u64 index = 0;
9865− u64 root_objectid;
98669877 int ret;
98679878 u64 old_ino = btrfs_ino(BTRFS_I(old_inode));
98689879 bool log_pinned = false;
@@ -9970,10 +9981,7 @@ static int btrfs_rename(struct inode *old_dir, struct dentry *old_dentry, · 101 unmodified lines
99709981 BTRFS_I(old_inode), 1);
99719982
99729983 if (unlikely(old_ino == BTRFS_FIRST_FREE_OBJECTID)) {
9973− root_objectid = BTRFS_I(old_inode)->root->root_key.objectid;
9974− ret = btrfs_unlink_subvol(trans, old_dir, root_objectid,
9975− old_dentry->d_name.name,
9976− old_dentry->d_name.len);
9984+ ret = btrfs_unlink_subvol(trans, old_dir, old_dentry);
99779985 } else {
99789986 ret = __btrfs_unlink_inode(trans, root, BTRFS_I(old_dir),
99799987 BTRFS_I(d_inode(old_dentry)),
@@ -9992,10 +10000,7 @@ static int btrfs_rename(struct inode *old_dir, struct dentry *old_dentry, · 12 unmodified lines
999210000 new_inode->i_ctime = current_time(new_inode);
999310001 if (unlikely(btrfs_ino(BTRFS_I(new_inode)) ==
999410002 BTRFS_EMPTY_SUBVOL_DIR_OBJECTID)) {
9995− root_objectid = BTRFS_I(new_inode)->location.objectid;
9996− ret = btrfs_unlink_subvol(trans, new_dir, root_objectid,
9997− new_dentry->d_name.name,
9998− new_dentry->d_name.len);
10003+ ret = btrfs_unlink_subvol(trans, new_dir, new_dentry);
999910004 BUG_ON(new_inode->i_nlink == 0);
1000010005 } else {
1000110006 ret = btrfs_unlink_inode(trans, dest, BTRFS_I(new_dir),
fs/btrfs/ioctl.c+13−1
@@ -4252,7 +4252,19 @@ static long btrfs_ioctl_scrub(struct file *file, void __user *arg) · 4251 unmodified lines
42524252 &sa->progress, sa->flags & BTRFS_SCRUB_READONLY,
42534253 0);
42544254
4255− if (ret == 0 && copy_to_user(arg, sa, sizeof(*sa)))
4255+ /*
4256+ * Copy scrub args to user space even if btrfs_scrub_dev() returned an
4257+ * error. This is important as it allows user space to know how much
4258+ * progress scrub has done. For example, if scrub is canceled we get
4259+ * -ECANCELED from btrfs_scrub_dev() and return that error back to user
4260+ * space. Later user space can inspect the progress from the structure
4261+ * btrfs_ioctl_scrub_args and resume scrub from where it left off
4262+ * previously (btrfs-progs does this).
4263+ * If we fail to copy the btrfs_ioctl_scrub_args structure to user space
4264+ * then return -EFAULT to signal the structure was not copied or it may
4265+ * be corrupt and unreliable due to a partial copy.
4266+ */
4267+ if (copy_to_user(arg, sa, sizeof(*sa)))
42564268 ret = -EFAULT;
42574269
42584270 if (!(sa->flags & BTRFS_SCRUB_READONLY))
fs/btrfs/qgroup.c+5−1
@@ -2423,8 +2423,12 @@ int btrfs_qgroup_account_extent(struct btrfs_trans_handle *trans, u64 bytenr, · 2422 unmodified lines
24232423 u64 nr_old_roots = 0;
24242424 int ret = 0;
24252425
2426+ /*
2427+ * If quotas get disabled meanwhile, the resouces need to be freed and
2428+ * we can't just exit here.
2429+ */
24262430 if (!test_bit(BTRFS_FS_QUOTA_ENABLED, &fs_info->flags))
2427− return 0;
2431+ goto out_free;
24282432
24292433 if (new_roots) {
24302434 if (!maybe_fs_roots(new_roots))
fs/btrfs/relocation.c+46−5
@@ -517,6 +517,34 @@ static int update_backref_cache(struct btrfs_trans_handle *trans, · 516 unmodified lines
517517 return 1;
518518 }
519519
520+static bool reloc_root_is_dead(struct btrfs_root *root)
521+{
522+ /*
523+ * Pair with set_bit/clear_bit in clean_dirty_subvols and
524+ * btrfs_update_reloc_root. We need to see the updated bit before
525+ * trying to access reloc_root
526+ */
527+ smp_rmb();
528+ if (test_bit(BTRFS_ROOT_DEAD_RELOC_TREE, &root->state))
529+ return true;
530+ return false;
531+}
532+
533+/*
534+ * Check if this subvolume tree has valid reloc tree.
535+ *
536+ * Reloc tree after swap is considered dead, thus not considered as valid.
537+ * This is enough for most callers, as they don't distinguish dead reloc root
538+ * from no reloc root. But should_ignore_root() below is a special case.
539+ */
540+static bool have_reloc_root(struct btrfs_root *root)
541+{
542+ if (reloc_root_is_dead(root))
543+ return false;
544+ if (!root->reloc_root)
545+ return false;
546+ return true;
547+}
520548
521549 static int should_ignore_root(struct btrfs_root *root)
522550 {
@@ -525,6 +553,10 @@ static int should_ignore_root(struct btrfs_root *root) · 2 unmodified lines
525553 if (!test_bit(BTRFS_ROOT_REF_COWS, &root->state))
526554 return 0;
527555
556+ /* This root has been merged with its reloc tree, we can ignore it */
557+ if (reloc_root_is_dead(root))
558+ return 1;
559+
528560 reloc_root = root->reloc_root;
529561 if (!reloc_root)
530562 return 0;
@@ -1439,7 +1471,7 @@ int btrfs_init_reloc_root(struct btrfs_trans_handle *trans, · 908 unmodified lines
14391471 * The subvolume has reloc tree but the swap is finished, no need to
14401472 * create/update the dead reloc tree
14411473 */
1442− if (test_bit(BTRFS_ROOT_DEAD_RELOC_TREE, &root->state))
1474+ if (reloc_root_is_dead(root))
14431475 return 0;
14441476
14451477 if (root->reloc_root) {
@@ -1478,8 +1510,7 @@ int btrfs_update_reloc_root(struct btrfs_trans_handle *trans, · 32 unmodified lines
14781510 struct btrfs_root_item *root_item;
14791511 int ret;
14801512
1481− if (test_bit(BTRFS_ROOT_DEAD_RELOC_TREE, &root->state) ||
1482− !root->reloc_root)
1513+ if (!have_reloc_root(root))
14831514 goto out;
14841515
14851516 reloc_root = root->reloc_root;
@@ -1489,6 +1520,11 @@ int btrfs_update_reloc_root(struct btrfs_trans_handle *trans, · 3 unmodified lines
14891520 if (fs_info->reloc_ctl->merge_reloc_tree &&
14901521 btrfs_root_refs(root_item) == 0) {
14911522 set_bit(BTRFS_ROOT_DEAD_RELOC_TREE, &root->state);
1523+ /*
1524+ * Mark the tree as dead before we change reloc_root so
1525+ * have_reloc_root will not touch it from now on.
1526+ */
1527+ smp_wmb();
14921528 __del_reloc_root(reloc_root);
14931529 }
14941530
@@ -2201,6 +2237,11 @@ static int clean_dirty_subvols(struct reloc_control *rc) · 706 unmodified lines
22012237 if (ret2 < 0 && !ret)
22022238 ret = ret2;
22032239 }
2240+ /*
2241+ * Need barrier to ensure clear_bit() only happens after
2242+ * root->reloc_root = NULL. Pairs with have_reloc_root.
2243+ */
2244+ smp_wmb();
22042245 clear_bit(BTRFS_ROOT_DEAD_RELOC_TREE, &root->state);
22052246 btrfs_put_fs_root(root);
22062247 } else {
@@ -4718,7 +4759,7 @@ void btrfs_reloc_pre_snapshot(struct btrfs_pending_snapshot *pending, · 2511 unmodified lines
47184759 struct btrfs_root *root = pending->root;
47194760 struct reloc_control *rc = root->fs_info->reloc_ctl;
47204761
4721− if (!root->reloc_root || !rc)
4762+ if (!rc || !have_reloc_root(root))
47224763 return;
47234764
47244765 if (!rc->merge_reloc_tree)
@@ -4752,7 +4793,7 @@ int btrfs_reloc_post_snapshot(struct btrfs_trans_handle *trans, · 27 unmodified lines
47524793 struct reloc_control *rc = root->fs_info->reloc_ctl;
47534794 int ret;
47544795
4755− if (!root->reloc_root || !rc)
4796+ if (!rc || !have_reloc_root(root))
47564797 return 0;
47574798
47584799 rc = root->fs_info->reloc_ctl;
fs/btrfs/root-tree.c+6−4
@@ -376,11 +376,13 @@ again: · 375 unmodified lines
376376 leaf = path->nodes[0];
377377 ref = btrfs_item_ptr(leaf, path->slots[0],
378378 struct btrfs_root_ref);
379−
380− WARN_ON(btrfs_root_ref_dirid(leaf, ref) != dirid);
381− WARN_ON(btrfs_root_ref_name_len(leaf, ref) != name_len);
382379 ptr = (unsigned long)(ref + 1);
383− WARN_ON(memcmp_extent_buffer(leaf, name, ptr, name_len));
380+ if ((btrfs_root_ref_dirid(leaf, ref) != dirid) ||
381+ (btrfs_root_ref_name_len(leaf, ref) != name_len) ||
382+ memcmp_extent_buffer(leaf, name, ptr, name_len)) {
383+ err = -ENOENT;
384+ goto out;
385+ }
384386 *sequence = btrfs_root_ref_sequence(leaf, ref);
385387
386388 ret = btrfs_del_item(trans, tree_root, path);
fs/btrfs/volumes.c+5−1
@@ -3881,7 +3881,11 @@ int btrfs_balance(struct btrfs_fs_info *fs_info, · 3880 unmodified lines
38813881 }
38823882 }
38833883
3884− num_devices = btrfs_num_devices(fs_info);
3884+ /*
3885+ * rw_devices will not change at the moment, device add/delete/replace
3886+ * are excluded by EXCL_OP
3887+ */
3888+ num_devices = fs_info->fs_devices->rw_devices;
38853889
38863890 /*
38873891 * SINGLE profile on-disk has no profile bit, but in-memory we have a
fs/fuse/file.c+3−1
@@ -882,6 +882,7 @@ static void fuse_send_readpages(struct fuse_io_args *ia, struct file *file) · 881 unmodified lines
882882 struct fuse_args_pages *ap = &ia->ap;
883883 loff_t pos = page_offset(ap->pages[0]);
884884 size_t count = ap->num_pages << PAGE_SHIFT;
885+ ssize_t res;
885886 int err;
886887
887888 ap->args.out_pages = true;
@@ -896,7 +897,8 @@ static void fuse_send_readpages(struct fuse_io_args *ia, struct file *file) · 8 unmodified lines
896897 if (!err)
897898 return;
898899 } else {
899− err = fuse_simple_request(fc, &ap->args);
900+ res = fuse_simple_request(fc, &ap->args);
901+ err = res < 0 ? res : 0;
900902 }
901903 fuse_readpages_end(fc, &ap->args, err);
902904 }
fs/io-wq.c+8−4
@@ -445,10 +445,14 @@ next: · 444 unmodified lines
445445 task_unlock(current);
446446 }
447447 if ((work->flags & IO_WQ_WORK_NEEDS_USER) && !worker->mm &&
448− wq->mm && mmget_not_zero(wq->mm)) {
449− use_mm(wq->mm);
450− set_fs(USER_DS);
451− worker->mm = wq->mm;
448+ wq->mm) {
449+ if (mmget_not_zero(wq->mm)) {
450+ use_mm(wq->mm);
451+ set_fs(USER_DS);
452+ worker->mm = wq->mm;
453+ } else {
454+ work->flags |= IO_WQ_WORK_CANCEL;
455+ }
452456 }
453457 if (!worker->creds)
454458 worker->creds = override_creds(wq->creds);
fs/io_uring.c+48−24
@@ -1786,6 +1786,9 @@ static int io_setup_async_rw(struct io_kiocb *req, ssize_t io_size, · 1785 unmodified lines
17861786 struct iovec *iovec, struct iovec *fast_iov,
17871787 struct iov_iter *iter)
17881788 {
1789+ if (req->opcode == IORING_OP_READ_FIXED ||
1790+ req->opcode == IORING_OP_WRITE_FIXED)
1791+ return 0;
17891792 if (!req->io && io_alloc_async_ctx(req))
17901793 return -ENOMEM;
17911794
@@ -1840,6 +1843,7 @@ static int io_read(struct io_kiocb *req, struct io_kiocb **nxt, · 48 unmodified lines
18401843 if (!force_nonblock)
18411844 req->rw.kiocb.ki_flags &= ~IOCB_NOWAIT;
18421845
1846+ req->result = 0;
18431847 io_size = ret;
18441848 if (req->flags & REQ_F_LINK)
18451849 req->result = io_size;
@@ -1927,6 +1931,7 @@ static int io_write(struct io_kiocb *req, struct io_kiocb **nxt, · 81 unmodified lines
19271931 if (!force_nonblock)
19281932 req->rw.kiocb.ki_flags &= ~IOCB_NOWAIT;
19291933
1934+ req->result = 0;
19301935 io_size = ret;
19311936 if (req->flags & REQ_F_LINK)
19321937 req->result = io_size;
@@ -2034,6 +2039,28 @@ static bool io_req_cancelled(struct io_kiocb *req) · 101 unmodified lines
20342039 return false;
20352040 }
20362041
2042+static void io_link_work_cb(struct io_wq_work **workptr)
2043+{
2044+ struct io_wq_work *work = *workptr;
2045+ struct io_kiocb *link = work->data;
2046+
2047+ io_queue_linked_timeout(link);
2048+ work->func = io_wq_submit_work;
2049+}
2050+
2051+static void io_wq_assign_next(struct io_wq_work **workptr, struct io_kiocb *nxt)
2052+{
2053+ struct io_kiocb *link;
2054+
2055+ io_prep_async_work(nxt, &link);
2056+ *workptr = &nxt->work;
2057+ if (link) {
2058+ nxt->work.flags |= IO_WQ_WORK_CB;
2059+ nxt->work.func = io_link_work_cb;
2060+ nxt->work.data = link;
2061+ }
2062+}
2063+
20372064 static void io_fsync_finish(struct io_wq_work **workptr)
20382065 {
20392066 struct io_kiocb *req = container_of(*workptr, struct io_kiocb, work);
@@ -2052,7 +2079,7 @@ static void io_fsync_finish(struct io_wq_work **workptr) · 12 unmodified lines
20522079 io_cqring_add_event(req, ret);
20532080 io_put_req_find_next(req, &nxt);
20542081 if (nxt)
2055− *workptr = &nxt->work;
2082+ io_wq_assign_next(workptr, nxt);
20562083 }
20572084
20582085 static int io_fsync(struct io_kiocb *req, struct io_kiocb **nxt,
@@ -2108,7 +2135,7 @@ static void io_sync_file_range_finish(struct io_wq_work **workptr) · 49 unmodified lines
21082135 io_cqring_add_event(req, ret);
21092136 io_put_req_find_next(req, &nxt);
21102137 if (nxt)
2111− *workptr = &nxt->work;
2138+ io_wq_assign_next(workptr, nxt);
21122139 }
21132140
21142141 static int io_sync_file_range(struct io_kiocb *req, struct io_kiocb **nxt,
@@ -2374,7 +2401,7 @@ static void io_accept_finish(struct io_wq_work **workptr) · 259 unmodified lines
23742401 return;
23752402 __io_accept(req, &nxt, false);
23762403 if (nxt)
2377− *workptr = &nxt->work;
2404+ io_wq_assign_next(workptr, nxt);
23782405 }
23792406 #endif
23802407
@@ -2605,7 +2632,7 @@ static void io_poll_complete_work(struct io_wq_work **workptr) · 224 unmodified lines
26052632 req_set_fail_links(req);
26062633 io_put_req_find_next(req, &nxt);
26072634 if (nxt)
2608− *workptr = &nxt->work;
2635+ io_wq_assign_next(workptr, nxt);
26092636 }
26102637
26112638 static int io_poll_wake(struct wait_queue_entry *wait, unsigned mode, int sync,
@@ -3259,24 +3286,24 @@ static int io_issue_sqe(struct io_kiocb *req, const struct io_uring_sqe *sqe, · 647 unmodified lines
32593286 return ret;
32603287
32613288 if (ctx->flags & IORING_SETUP_IOPOLL) {
3289+ const bool in_async = io_wq_current_is_worker();
3290+
32623291 if (req->result == -EAGAIN)
32633292 return -EAGAIN;
32643293
3294+ /* workqueue context doesn't hold uring_lock, grab it now */
3295+ if (in_async)
3296+ mutex_lock(&ctx->uring_lock);
3297+
32653298 io_iopoll_req_issued(req);
3299+
3300+ if (in_async)
3301+ mutex_unlock(&ctx->uring_lock);
32663302 }
32673303
32683304 return 0;
32693305 }
32703306
3271−static void io_link_work_cb(struct io_wq_work **workptr)
3272−{
3273− struct io_wq_work *work = *workptr;
3274− struct io_kiocb *link = work->data;
3275−
3276− io_queue_linked_timeout(link);
3277− work->func = io_wq_submit_work;
3278−}
3279−
32803307 static void io_wq_submit_work(struct io_wq_work **workptr)
32813308 {
32823309 struct io_wq_work *work = *workptr;
@@ -3313,17 +3340,8 @@ static void io_wq_submit_work(struct io_wq_work **workptr) · 30 unmodified lines
33133340 }
33143341
33153342 /* if a dependent link is ready, pass it back */
3316− if (!ret && nxt) {
3317− struct io_kiocb *link;
3318−
3319− io_prep_async_work(nxt, &link);
3320− *workptr = &nxt->work;
3321− if (link) {
3322− nxt->work.flags |= IO_WQ_WORK_CB;
3323− nxt->work.func = io_link_work_cb;
3324− nxt->work.data = link;
3325− }
3326− }
3343+ if (!ret && nxt)
3344+ io_wq_assign_next(workptr, nxt);
33273345 }
33283346
33293347 static bool io_req_op_valid(int op)
@@ -5141,6 +5159,12 @@ SYSCALL_DEFINE6(io_uring_enter, unsigned int, fd, u32, to_submit, · 1811 unmodified lines
51415159 } else if (to_submit) {
51425160 struct mm_struct *cur_mm;
51435161
5162+ if (current->mm != ctx->sqo_mm ||
5163+ current_cred() != ctx->creds) {
5164+ ret = -EPERM;
5165+ goto out;
5166+ }
5167+
51445168 to_submit = min(to_submit, ctx->sq_entries);
51455169 mutex_lock(&ctx->uring_lock);
51465170 /* already have mm, so io_submit_sqes() won't try to grab it */
fs/namei.c+13−77
@@ -1232,6 +1232,7 @@ static int follow_managed(struct path *path, struct nameidata *nd) · 1231 unmodified lines
12321232 BUG_ON(!path->dentry->d_op);
12331233 BUG_ON(!path->dentry->d_op->d_manage);
12341234 ret = path->dentry->d_op->d_manage(path, false);
1235+ flags = smp_load_acquire(&path->dentry->d_flags);
12351236 if (ret < 0)
12361237 break;
12371238 }
@@ -1649,17 +1650,15 @@ again: · 411 unmodified lines
16491650 if (IS_ERR(dentry))
16501651 return dentry;
16511652 if (unlikely(!d_in_lookup(dentry))) {
1652− if (!(flags & LOOKUP_NO_REVAL)) {
1653− int error = d_revalidate(dentry, flags);
1654− if (unlikely(error <= 0)) {
1655− if (!error) {
1656− d_invalidate(dentry);
1657− dput(dentry);
1658− goto again;
1659− }
1653+ int error = d_revalidate(dentry, flags);
1654+ if (unlikely(error <= 0)) {
1655+ if (!error) {
1656+ d_invalidate(dentry);
16601657 dput(dentry);
1661− dentry = ERR_PTR(error);
1658+ goto again;
16621659 }
1660+ dput(dentry);
1661+ dentry = ERR_PTR(error);
16631662 }
16641663 } else {
16651664 old = inode->i_op->lookup(inode, dentry, flags);
@@ -2617,72 +2616,6 @@ int user_path_at_empty(int dfd, const char __user *name, unsigned flags, · 951 unmodified lines
26172616 }
26182617 EXPORT_SYMBOL(user_path_at_empty);
26192618
2620−/**
2621− * mountpoint_last - look up last component for umount
2622− * @nd: pathwalk nameidata - currently pointing at parent directory of "last"
2623− *
2624− * This is a special lookup_last function just for umount. In this case, we
2625− * need to resolve the path without doing any revalidation.
2626− *
2627− * The nameidata should be the result of doing a LOOKUP_PARENT pathwalk. Since
2628− * mountpoints are always pinned in the dcache, their ancestors are too. Thus,
2629− * in almost all cases, this lookup will be served out of the dcache. The only
2630− * cases where it won't are if nd->last refers to a symlink or the path is
2631− * bogus and it doesn't exist.
2632− *
2633− * Returns:
2634− * -error: if there was an error during lookup. This includes -ENOENT if the
2635− * lookup found a negative dentry.
2636− *
2637− * 0: if we successfully resolved nd->last and found it to not to be a
2638− * symlink that needs to be followed.
2639− *
2640− * 1: if we successfully resolved nd->last and found it to be a symlink
2641− * that needs to be followed.
2642− */
2643−static int
2644−mountpoint_last(struct nameidata *nd)
2645−{
2646− int error = 0;
2647− struct dentry *dir = nd->path.dentry;
2648− struct path path;
2649−
2650− /* If we're in rcuwalk, drop out of it to handle last component */
2651− if (nd->flags & LOOKUP_RCU) {
2652− if (unlazy_walk(nd))
2653− return -ECHILD;
2654− }
2655−
2656− nd->flags &= ~LOOKUP_PARENT;
2657−
2658− if (unlikely(nd->last_type != LAST_NORM)) {
2659− error = handle_dots(nd, nd->last_type);
2660− if (error)
2661− return error;
2662− path.dentry = dget(nd->path.dentry);
2663− } else {
2664− path.dentry = d_lookup(dir, &nd->last);
2665− if (!path.dentry) {
2666− /*
2667− * No cached dentry. Mounted dentries are pinned in the
2668− * cache, so that means that this dentry is probably
2669− * a symlink or the path doesn't actually point
2670− * to a mounted dentry.
2671− */
2672− path.dentry = lookup_slow(&nd->last, dir,
2673− nd->flags | LOOKUP_NO_REVAL);
2674− if (IS_ERR(path.dentry))
2675− return PTR_ERR(path.dentry);
2676− }
2677− }
2678− if (d_flags_negative(smp_load_acquire(&path.dentry->d_flags))) {
2679− dput(path.dentry);
2680− return -ENOENT;
2681− }
2682− path.mnt = nd->path.mnt;
2683− return step_into(nd, &path, 0, d_backing_inode(path.dentry), 0);
2684−}
2685−
26862619 /**
26872620 * path_mountpoint - look up a path to be umounted
26882621 * @nd: lookup context
@@ -2699,14 +2632,17 @@ path_mountpoint(struct nameidata *nd, unsigned flags, struct path *path) · 10 unmodified lines
26992632 int err;
27002633
27012634 while (!(err = link_path_walk(s, nd)) &&
2702− (err = mountpoint_last(nd)) > 0) {
2635+ (err = lookup_last(nd)) > 0) {
27032636 s = trailing_symlink(nd);
27042637 }
2638+ if (!err && (nd->flags & LOOKUP_RCU))
2639+ err = unlazy_walk(nd);
2640+ if (!err)
2641+ err = handle_lookup_down(nd);
27052642 if (!err) {
27062643 *path = nd->path;
27072644 nd->path.mnt = NULL;
27082645 nd->path.dentry = NULL;
2709− follow_mount(path);
27102646 }
27112647 terminate_walk(nd);
27122648 return err;
fs/nfs/nfstrace.h+0−2
@@ -206,7 +206,6 @@ TRACE_DEFINE_ENUM(LOOKUP_AUTOMOUNT); · 205 unmodified lines
206206 TRACE_DEFINE_ENUM(LOOKUP_PARENT);
207207 TRACE_DEFINE_ENUM(LOOKUP_REVAL);
208208 TRACE_DEFINE_ENUM(LOOKUP_RCU);
209−TRACE_DEFINE_ENUM(LOOKUP_NO_REVAL);
210209 TRACE_DEFINE_ENUM(LOOKUP_OPEN);
211210 TRACE_DEFINE_ENUM(LOOKUP_CREATE);
212211 TRACE_DEFINE_ENUM(LOOKUP_EXCL);
@@ -224,7 +223,6 @@ TRACE_DEFINE_ENUM(LOOKUP_DOWN); · 11 unmodified lines
224223 { LOOKUP_PARENT, "PARENT" }, \
225224 { LOOKUP_REVAL, "REVAL" }, \
226225 { LOOKUP_RCU, "RCU" }, \
227− { LOOKUP_NO_REVAL, "NO_REVAL" }, \
228226 { LOOKUP_OPEN, "OPEN" }, \
229227 { LOOKUP_CREATE, "CREATE" }, \
230228 { LOOKUP_EXCL, "EXCL" }, \
include/asm-generic/cacheflush.h+32−1
@@ -11,71 +11,102 @@ · 10 unmodified lines
1111 * The cache doesn't need to be flushed when TLB entries change when
1212 * the cache is mapped to physical memory, not virtual memory
1313 */
14+#ifndef flush_cache_all
1415 static inline void flush_cache_all(void)
1516 {
1617 }
18+#endif
1719
20+#ifndef flush_cache_mm
1821 static inline void flush_cache_mm(struct mm_struct *mm)
1922 {
2023 }
24+#endif
2125
26+#ifndef flush_cache_dup_mm
2227 static inline void flush_cache_dup_mm(struct mm_struct *mm)
2328 {
2429 }
30+#endif
2531
32+#ifndef flush_cache_range
2633 static inline void flush_cache_range(struct vm_area_struct *vma,
2734 unsigned long start,
2835 unsigned long end)
2936 {
3037 }
38+#endif
3139
40+#ifndef flush_cache_page
3241 static inline void flush_cache_page(struct vm_area_struct *vma,
3342 unsigned long vmaddr,
3443 unsigned long pfn)
3544 {
3645 }
46+#endif
3747
48+#ifndef flush_dcache_page
3849 static inline void flush_dcache_page(struct page *page)
3950 {
4051 }
52+#endif
4153
54+#ifndef flush_dcache_mmap_lock
4255 static inline void flush_dcache_mmap_lock(struct address_space *mapping)
4356 {
4457 }
58+#endif
4559
60+#ifndef flush_dcache_mmap_unlock
4661 static inline void flush_dcache_mmap_unlock(struct address_space *mapping)
4762 {
4863 }
64+#endif
4965
66+#ifndef flush_icache_range
5067 static inline void flush_icache_range(unsigned long start, unsigned long end)
5168 {
5269 }
70+#endif
5371
72+#ifndef flush_icache_page
5473 static inline void flush_icache_page(struct vm_area_struct *vma,
5574 struct page *page)
5675 {
5776 }
77+#endif
5878
79+#ifndef flush_icache_user_range
5980 static inline void flush_icache_user_range(struct vm_area_struct *vma,
6081 struct page *page,
6182 unsigned long addr, int len)
6283 {
6384 }
85+#endif
6486
87+#ifndef flush_cache_vmap
6588 static inline void flush_cache_vmap(unsigned long start, unsigned long end)
6689 {
6790 }
91+#endif
6892
93+#ifndef flush_cache_vunmap
6994 static inline void flush_cache_vunmap(unsigned long start, unsigned long end)
7095 {
7196 }
97+#endif
7298
73−#define copy_to_user_page(vma, page, vaddr, dst, src, len) \
99+#ifndef copy_to_user_page
100+#define copy_to_user_page(vma, page, vaddr, dst, src, len) \
74101 do { \
75102 memcpy(dst, src, len); \
76103 flush_icache_user_range(vma, page, vaddr, len); \
77104 } while (0)
105+#endif
106+
107+#ifndef copy_from_user_page
78108 #define copy_from_user_page(vma, page, vaddr, dst, src, len) \
79109 memcpy(dst, src, len)
110+#endif
80111
81112 #endif /* __ASM_CACHEFLUSH_H */
include/drm/drm_dp_mst_helper.h+6−0
@@ -605,6 +605,12 @@ struct drm_dp_mst_topology_mgr { · 604 unmodified lines
605605 * &drm_dp_sideband_msg_tx.state once they are queued
606606 */
607607 struct mutex qlock;
608+
609+ /**
610+ * @is_waiting_for_dwn_reply: indicate whether is waiting for down reply
611+ */
612+ bool is_waiting_for_dwn_reply;
613+
608614 /**
609615 * @tx_msg_downq: List of pending down replies.
610616 */
include/dt-bindings/reset/amlogic,meson8b-reset.h+3−3
@@ -46,9 +46,9 @@ · 45 unmodified lines
4646 #define RESET_VD_RMEM 64
4747 #define RESET_AUDIN 65
4848 #define RESET_DBLK 66
49−#define RESET_PIC_DC 66
50−#define RESET_PSC 66
51−#define RESET_NAND 66
49+#define RESET_PIC_DC 67
50+#define RESET_PSC 68
51+#define RESET_NAND 69
5252 #define RESET_GE2D 70
5353 #define RESET_PARSER_REG 71
5454 #define RESET_PARSER_FETCH 72
include/linux/blkdev.h+4−4
@@ -328,6 +328,7 @@ struct queue_limits { · 327 unmodified lines
328328 unsigned int max_sectors;
329329 unsigned int max_segment_size;
330330 unsigned int physical_block_size;
331+ unsigned int logical_block_size;
331332 unsigned int alignment_offset;
332333 unsigned int io_min;
333334 unsigned int io_opt;
@@ -338,7 +339,6 @@ struct queue_limits { · 4 unmodified lines
338339 unsigned int discard_granularity;
339340 unsigned int discard_alignment;
340341
341− unsigned short logical_block_size;
342342 unsigned short max_segments;
343343 unsigned short max_integrity_segments;
344344 unsigned short max_discard_segments;
@@ -1077,7 +1077,7 @@ extern void blk_queue_max_write_same_sectors(struct request_queue *q, · 732 unmodified lines
10771077 unsigned int max_write_same_sectors);
10781078 extern void blk_queue_max_write_zeroes_sectors(struct request_queue *q,
10791079 unsigned int max_write_same_sectors);
1080−extern void blk_queue_logical_block_size(struct request_queue *, unsigned short);
1080+extern void blk_queue_logical_block_size(struct request_queue *, unsigned int);
10811081 extern void blk_queue_physical_block_size(struct request_queue *, unsigned int);
10821082 extern void blk_queue_alignment_offset(struct request_queue *q,
10831083 unsigned int alignment);
@@ -1291,7 +1291,7 @@ static inline unsigned int queue_max_segment_size(const struct request_queue *q) · 207 unmodified lines
12911291 return q->limits.max_segment_size;
12921292 }
12931293
1294−static inline unsigned short queue_logical_block_size(const struct request_queue *q)
1294+static inline unsigned queue_logical_block_size(const struct request_queue *q)
12951295 {
12961296 int retval = 512;
12971297
@@ -1301,7 +1301,7 @@ static inline unsigned short queue_logical_block_size(const struct request_queue · 3 unmodified lines
13011301 return retval;
13021302 }
13031303
1304−static inline unsigned short bdev_logical_block_size(struct block_device *bdev)
1304+static inline unsigned int bdev_logical_block_size(struct block_device *bdev)
13051305 {
13061306 return queue_logical_block_size(bdev_get_queue(bdev));
13071307 }
include/linux/mm.h+15−3
@@ -2658,13 +2658,25 @@ static inline bool want_init_on_free(void) · 2657 unmodified lines
26582658 !page_poisoning_enabled();
26592659 }
26602660
2661−#ifdef CONFIG_DEBUG_PAGEALLOC_ENABLE_DEFAULT
2662−DECLARE_STATIC_KEY_TRUE(_debug_pagealloc_enabled);
2661+#ifdef CONFIG_DEBUG_PAGEALLOC
2662+extern void init_debug_pagealloc(void);
26632663 #else
2664−DECLARE_STATIC_KEY_FALSE(_debug_pagealloc_enabled);
2664+static inline void init_debug_pagealloc(void) {}
26652665 #endif
2666+extern bool _debug_pagealloc_enabled_early;
2667+DECLARE_STATIC_KEY_FALSE(_debug_pagealloc_enabled);
26662668
26672669 static inline bool debug_pagealloc_enabled(void)
2670+{
2671+ return IS_ENABLED(CONFIG_DEBUG_PAGEALLOC) &&
2672+ _debug_pagealloc_enabled_early;
2673+}
2674+
2675+/*
2676+ * For use in fast paths after init_debug_pagealloc() has run, or when a
2677+ * false negative result is not harmful when called too early.
2678+ */
2679+static inline bool debug_pagealloc_enabled_static(void)
26682680 {
26692681 if (!IS_ENABLED(CONFIG_DEBUG_PAGEALLOC))
26702682 return false;
include/linux/mmzone.h+2−3
@@ -215,9 +215,8 @@ enum node_stat_item { · 214 unmodified lines
215215 NR_INACTIVE_FILE, /* " " " " " */
216216 NR_ACTIVE_FILE, /* " " " " " */
217217 NR_UNEVICTABLE, /* " " " " " */
218− NR_SLAB_RECLAIMABLE, /* Please do not reorder this item */
219− NR_SLAB_UNRECLAIMABLE, /* and this one without looking at
220− * memcg_flush_percpu_vmstats() first. */
218+ NR_SLAB_RECLAIMABLE,
219+ NR_SLAB_UNRECLAIMABLE,
221220 NR_ISOLATED_ANON, /* Temporary isolated pages from anon lru */
222221 NR_ISOLATED_FILE, /* Temporary isolated pages from file lru */
223222 WORKINGSET_NODES,
include/linux/namei.h+0−1
@@ -34,7 +34,6 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LAST_DOTDOT, LAST_BIND}; · 33 unmodified lines
3434
3535 /* internal use only */
3636 #define LOOKUP_PARENT 0x0010
37−#define LOOKUP_NO_REVAL 0x0080
3837 #define LOOKUP_JUMPED 0x1000
3938 #define LOOKUP_ROOT 0x2000
4039 #define LOOKUP_ROOT_GRABBED 0x0008
include/linux/sched.h+2−2
@@ -1929,11 +1929,11 @@ static inline void rseq_migrate(struct task_struct *t) · 1928 unmodified lines
19291929
19301930 /*
19311931 * If parent process has a registered restartable sequences area, the
1932− * child inherits. Only applies when forking a process, not a thread.
1932+ * child inherits. Unregister rseq for a clone with CLONE_VM set.
19331933 */
19341934 static inline void rseq_fork(struct task_struct *t, unsigned long clone_flags)
19351935 {
1936− if (clone_flags & CLONE_THREAD) {
1936+ if (clone_flags & CLONE_VM) {
19371937 t->rseq = NULL;
19381938 t->rseq_sig = 0;
19391939 t->rseq_event_mask = 0;
include/linux/skmsg.h+9−4
@@ -358,17 +358,22 @@ static inline void sk_psock_update_proto(struct sock *sk, · 357 unmodified lines
358358 static inline void sk_psock_restore_proto(struct sock *sk,
359359 struct sk_psock *psock)
360360 {
361− sk->sk_write_space = psock->saved_write_space;
361+ sk->sk_prot->unhash = psock->saved_unhash;
362362
363363 if (psock->sk_proto) {
364364 struct inet_connection_sock *icsk = inet_csk(sk);
365365 bool has_ulp = !!icsk->icsk_ulp_data;
366366
367− if (has_ulp)
368− tcp_update_ulp(sk, psock->sk_proto);
369− else
367+ if (has_ulp) {
368+ tcp_update_ulp(sk, psock->sk_proto,
369+ psock->saved_write_space);
370+ } else {
370371 sk->sk_prot = psock->sk_proto;
372+ sk->sk_write_space = psock->saved_write_space;
373+ }
371374 psock->sk_proto = NULL;
375+ } else {
376+ sk->sk_write_space = psock->saved_write_space;
372377 }
373378 }
374379
include/linux/tnum.h+1−1
@@ -30,7 +30,7 @@ struct tnum tnum_lshift(struct tnum a, u8 shift); · 29 unmodified lines
3030 /* Shift (rsh) a tnum right (by a fixed shift) */
3131 struct tnum tnum_rshift(struct tnum a, u8 shift);
3232 /* Shift (arsh) a tnum right (by a fixed min_shift) */
33−struct tnum tnum_arshift(struct tnum a, u8 min_shift);
33+struct tnum tnum_arshift(struct tnum a, u8 min_shift, u8 insn_bitness);
3434 /* Add two tnums, return @a + @b */
3535 struct tnum tnum_add(struct tnum a, struct tnum b);
3636 /* Subtract two tnums, return @a - @b */
include/net/cfg80211.h+5−0
@@ -3548,6 +3548,9 @@ struct cfg80211_update_owe_info { · 3547 unmodified lines
35483548 *
35493549 * @start_radar_detection: Start radar detection in the driver.
35503550 *
3551+ * @end_cac: End running CAC, probably because a related CAC
3552+ * was finished on another phy.
3553+ *
35513554 * @update_ft_ies: Provide updated Fast BSS Transition information to the
35523555 * driver. If the SME is in the driver/firmware, this information can be
35533556 * used in building Authentication and Reassociation Request frames.
@@ -3874,6 +3877,8 @@ struct cfg80211_ops { · 320 unmodified lines
38743877 struct net_device *dev,
38753878 struct cfg80211_chan_def *chandef,
38763879 u32 cac_time_ms);
3880+ void (*end_cac)(struct wiphy *wiphy,
3881+ struct net_device *dev);
38773882 int (*update_ft_ies)(struct wiphy *wiphy, struct net_device *dev,
38783883 struct cfg80211_update_ft_ies_params *ftie);
38793884 int (*crit_proto_start)(struct wiphy *wiphy,
include/net/devlink.h+1−1
@@ -938,7 +938,7 @@ struct devlink_region *devlink_region_create(struct devlink *devlink, · 937 unmodified lines
938938 u32 region_max_snapshots,
939939 u64 region_size);
940940 void devlink_region_destroy(struct devlink_region *region);
941−u32 devlink_region_shapshot_id_get(struct devlink *devlink);
941+u32 devlink_region_snapshot_id_get(struct devlink *devlink);
942942 int devlink_region_snapshot_create(struct devlink_region *region,
943943 u8 *data, u32 snapshot_id,
944944 devlink_snapshot_data_dest_t *data_destructor);
include/net/tcp.h+4−2
@@ -2147,7 +2147,8 @@ struct tcp_ulp_ops { · 2146 unmodified lines
21472147 /* initialize ulp */
21482148 int (*init)(struct sock *sk);
21492149 /* update ulp */
2150− void (*update)(struct sock *sk, struct proto *p);
2150+ void (*update)(struct sock *sk, struct proto *p,
2151+ void (*write_space)(struct sock *sk));
21512152 /* cleanup ulp */
21522153 void (*release)(struct sock *sk);
21532154 /* diagnostic */
@@ -2162,7 +2163,8 @@ void tcp_unregister_ulp(struct tcp_ulp_ops *type); · 8 unmodified lines
21622163 int tcp_set_ulp(struct sock *sk, const char *name);
21632164 void tcp_get_available_ulp(char *buf, size_t len);
21642165 void tcp_cleanup_ulp(struct sock *sk);
2165−void tcp_update_ulp(struct sock *sk, struct proto *p);
2166+void tcp_update_ulp(struct sock *sk, struct proto *p,
2167+ void (*write_space)(struct sock *sk));
21662168
21672169 #define MODULE_ALIAS_TCP_ULP(name) \
21682170 __MODULE_INFO(alias, alias_userspace, name); \
include/trace/events/afs.h+3−9
@@ -915,9 +915,9 @@ TRACE_EVENT(afs_call_state, · 914 unmodified lines
915915
916916 TRACE_EVENT(afs_lookup,
917917 TP_PROTO(struct afs_vnode *dvnode, const struct qstr *name,
918− struct afs_vnode *vnode),
918+ struct afs_fid *fid),
919919
920− TP_ARGS(dvnode, name, vnode),
920+ TP_ARGS(dvnode, name, fid),
921921
922922 TP_STRUCT__entry(
923923 __field_struct(struct afs_fid, dfid )
@@ -928,13 +928,7 @@ TRACE_EVENT(afs_lookup, · 4 unmodified lines
928928 TP_fast_assign(
929929 int __len = min_t(int, name->len, 23);
930930 __entry->dfid = dvnode->fid;
931− if (vnode) {
932− __entry->fid = vnode->fid;
933− } else {
934− __entry->fid.vid = 0;
935− __entry->fid.vnode = 0;
936− __entry->fid.unique = 0;
937− }
931+ __entry->fid = *fid;
938932 memcpy(__entry->name, name->name, __len);
939933 __entry->name[__len] = 0;
940934 ),
include/trace/events/huge_memory.h+2−1
@@ -31,7 +31,8 @@ · 30 unmodified lines
3131 EM( SCAN_ALLOC_HUGE_PAGE_FAIL, "alloc_huge_page_failed") \
3232 EM( SCAN_CGROUP_CHARGE_FAIL, "ccgroup_charge_failed") \
3333 EM( SCAN_EXCEED_SWAP_PTE, "exceed_swap_pte") \
34− EMe(SCAN_TRUNCATED, "truncated") \
34+ EM( SCAN_TRUNCATED, "truncated") \
35+ EMe(SCAN_PAGE_HAS_PRIVATE, "page_has_private") \
3536
3637 #undef EM
3738 #undef EMe
init/main.c+1−0
@@ -553,6 +553,7 @@ static void __init mm_init(void) · 552 unmodified lines
553553 * bigger than MAX_ORDER unless SPARSEMEM.
554554 */
555555 page_ext_init_flatmem();
556+ init_debug_pagealloc();
556557 report_meminit();
557558 mem_init();
558559 kmem_cache_init();
kernel/bpf/tnum.c+7−2
@@ -44,14 +44,19 @@ struct tnum tnum_rshift(struct tnum a, u8 shift) · 43 unmodified lines
4444 return TNUM(a.value >> shift, a.mask >> shift);
4545 }
4646
47−struct tnum tnum_arshift(struct tnum a, u8 min_shift)
47+struct tnum tnum_arshift(struct tnum a, u8 min_shift, u8 insn_bitness)
4848 {
4949 /* if a.value is negative, arithmetic shifting by minimum shift
5050 * will have larger negative offset compared to more shifting.
5151 * If a.value is nonnegative, arithmetic shifting by minimum shift
5252 * will have larger positive offset compare to more shifting.
5353 */
54− return TNUM((s64)a.value >> min_shift, (s64)a.mask >> min_shift);
54+ if (insn_bitness == 32)
55+ return TNUM((u32)(((s32)a.value) >> min_shift),
56+ (u32)(((s32)a.mask) >> min_shift));
57+ else
58+ return TNUM((s64)a.value >> min_shift,
59+ (s64)a.mask >> min_shift);
5560 }
5661
5762 struct tnum tnum_add(struct tnum a, struct tnum b)
kernel/bpf/verifier.c+10−3
@@ -5049,9 +5049,16 @@ static int adjust_scalar_min_max_vals(struct bpf_verifier_env *env, · 5048 unmodified lines
50495049 /* Upon reaching here, src_known is true and
50505050 * umax_val is equal to umin_val.
50515051 */
5052− dst_reg->smin_value >>= umin_val;
5053− dst_reg->smax_value >>= umin_val;
5054− dst_reg->var_off = tnum_arshift(dst_reg->var_off, umin_val);
5052+ if (insn_bitness == 32) {
5053+ dst_reg->smin_value = (u32)(((s32)dst_reg->smin_value) >> umin_val);
5054+ dst_reg->smax_value = (u32)(((s32)dst_reg->smax_value) >> umin_val);
5055+ } else {
5056+ dst_reg->smin_value >>= umin_val;
5057+ dst_reg->smax_value >>= umin_val;
5058+ }
5059+
5060+ dst_reg->var_off = tnum_arshift(dst_reg->var_off, umin_val,
5061+ insn_bitness);
50555062
50565063 /* blow away the dst_reg umin_value/umax_value and rely on
50575064 * dst_reg var_off to refine the result.
kernel/cpu.c+72−71
@@ -1909,6 +1909,78 @@ void __cpuhp_remove_state(enum cpuhp_state state, bool invoke) · 1908 unmodified lines
19091909 }
19101910 EXPORT_SYMBOL(__cpuhp_remove_state);
19111911
1912+#ifdef CONFIG_HOTPLUG_SMT
1913+static void cpuhp_offline_cpu_device(unsigned int cpu)
1914+{
1915+ struct device *dev = get_cpu_device(cpu);
1916+
1917+ dev->offline = true;
1918+ /* Tell user space about the state change */
1919+ kobject_uevent(&dev->kobj, KOBJ_OFFLINE);
1920+}
1921+
1922+static void cpuhp_online_cpu_device(unsigned int cpu)
1923+{
1924+ struct device *dev = get_cpu_device(cpu);
1925+
1926+ dev->offline = false;
1927+ /* Tell user space about the state change */
1928+ kobject_uevent(&dev->kobj, KOBJ_ONLINE);
1929+}
1930+
1931+int cpuhp_smt_disable(enum cpuhp_smt_control ctrlval)
1932+{
1933+ int cpu, ret = 0;
1934+
1935+ cpu_maps_update_begin();
1936+ for_each_online_cpu(cpu) {
1937+ if (topology_is_primary_thread(cpu))
1938+ continue;
1939+ ret = cpu_down_maps_locked(cpu, CPUHP_OFFLINE);
1940+ if (ret)
1941+ break;
1942+ /*
1943+ * As this needs to hold the cpu maps lock it's impossible
1944+ * to call device_offline() because that ends up calling
1945+ * cpu_down() which takes cpu maps lock. cpu maps lock
1946+ * needs to be held as this might race against in kernel
1947+ * abusers of the hotplug machinery (thermal management).
1948+ *
1949+ * So nothing would update device:offline state. That would
1950+ * leave the sysfs entry stale and prevent onlining after
1951+ * smt control has been changed to 'off' again. This is
1952+ * called under the sysfs hotplug lock, so it is properly
1953+ * serialized against the regular offline usage.
1954+ */
1955+ cpuhp_offline_cpu_device(cpu);
1956+ }
1957+ if (!ret)
1958+ cpu_smt_control = ctrlval;
1959+ cpu_maps_update_done();
1960+ return ret;
1961+}
1962+
1963+int cpuhp_smt_enable(void)
1964+{
1965+ int cpu, ret = 0;
1966+
1967+ cpu_maps_update_begin();
1968+ cpu_smt_control = CPU_SMT_ENABLED;
1969+ for_each_present_cpu(cpu) {
1970+ /* Skip online CPUs and CPUs on offline nodes */
1971+ if (cpu_online(cpu) || !node_online(cpu_to_node(cpu)))
1972+ continue;
1973+ ret = _cpu_up(cpu, 0, CPUHP_ONLINE);
1974+ if (ret)
1975+ break;
1976+ /* See comment in cpuhp_smt_disable() */
1977+ cpuhp_online_cpu_device(cpu);
1978+ }
1979+ cpu_maps_update_done();
1980+ return ret;
1981+}
1982+#endif
1983+
19121984 #if defined(CONFIG_SYSFS) && defined(CONFIG_HOTPLUG_CPU)
19131985 static ssize_t show_cpuhp_state(struct device *dev,
19141986 struct device_attribute *attr, char *buf)
@@ -2063,77 +2135,6 @@ static const struct attribute_group cpuhp_cpu_root_attr_group = { · 148 unmodified lines
20632135
20642136 #ifdef CONFIG_HOTPLUG_SMT
20652137
2066−static void cpuhp_offline_cpu_device(unsigned int cpu)
2067−{
2068− struct device *dev = get_cpu_device(cpu);
2069−
2070− dev->offline = true;
2071− /* Tell user space about the state change */
2072− kobject_uevent(&dev->kobj, KOBJ_OFFLINE);
2073−}
2074−
2075−static void cpuhp_online_cpu_device(unsigned int cpu)
2076−{
2077− struct device *dev = get_cpu_device(cpu);
2078−
2079− dev->offline = false;
2080− /* Tell user space about the state change */
2081− kobject_uevent(&dev->kobj, KOBJ_ONLINE);
2082−}
2083−
2084−int cpuhp_smt_disable(enum cpuhp_smt_control ctrlval)
2085−{
2086− int cpu, ret = 0;
2087−
2088− cpu_maps_update_begin();
2089− for_each_online_cpu(cpu) {
2090− if (topology_is_primary_thread(cpu))
2091− continue;
2092− ret = cpu_down_maps_locked(cpu, CPUHP_OFFLINE);
2093− if (ret)
2094− break;
2095− /*
2096− * As this needs to hold the cpu maps lock it's impossible
2097− * to call device_offline() because that ends up calling
2098− * cpu_down() which takes cpu maps lock. cpu maps lock
2099− * needs to be held as this might race against in kernel
2100− * abusers of the hotplug machinery (thermal management).
2101− *
2102− * So nothing would update device:offline state. That would
2103− * leave the sysfs entry stale and prevent onlining after
2104− * smt control has been changed to 'off' again. This is
2105− * called under the sysfs hotplug lock, so it is properly
2106− * serialized against the regular offline usage.
2107− */
2108− cpuhp_offline_cpu_device(cpu);
2109− }
2110− if (!ret)
2111− cpu_smt_control = ctrlval;
2112− cpu_maps_update_done();
2113− return ret;
2114−}
2115−
2116−int cpuhp_smt_enable(void)
2117−{
2118− int cpu, ret = 0;
2119−
2120− cpu_maps_update_begin();
2121− cpu_smt_control = CPU_SMT_ENABLED;
2122− for_each_present_cpu(cpu) {
2123− /* Skip online CPUs and CPUs on offline nodes */
2124− if (cpu_online(cpu) || !node_online(cpu_to_node(cpu)))
2125− continue;
2126− ret = _cpu_up(cpu, 0, CPUHP_ONLINE);
2127− if (ret)
2128− break;
2129− /* See comment in cpuhp_smt_disable() */
2130− cpuhp_online_cpu_device(cpu);
2131− }
2132− cpu_maps_update_done();
2133− return ret;
2134−}
2135−
2136−
21372138 static ssize_t
21382139 __store_smt_control(struct device *dev, struct device_attribute *attr,
21392140 const char *buf, size_t count)
kernel/cred.c+2−2
@@ -175,8 +175,8 @@ void exit_creds(struct task_struct *tsk) · 174 unmodified lines
175175 put_cred(cred);
176176
177177 #ifdef CONFIG_KEYS_REQUEST_CACHE
178− key_put(current->cached_requested_key);
179− current->cached_requested_key = NULL;
178+ key_put(tsk->cached_requested_key);
179+ tsk->cached_requested_key = NULL;
180180 #endif
181181 }
182182
kernel/events/core.c+3−1
@@ -11465,8 +11465,10 @@ SYSCALL_DEFINE5(perf_event_open, · 11464 unmodified lines
1146511465 }
1146611466 }
1146711467
11468− if (perf_need_aux_event(event) && !perf_get_aux_event(event, group_leader))
11468+ if (perf_need_aux_event(event) && !perf_get_aux_event(event, group_leader)) {
11469+ err = -EINVAL;
1146911470 goto err_locked;
11471+ }
1147011472
1147111473 /*
1147211474 * Must be under the same ctx::mutex as perf_install_in_context(),
kernel/futex.c+1−0
@@ -1178,6 +1178,7 @@ out_error: · 1177 unmodified lines
11781178
11791179 /**
11801180 * wait_for_owner_exiting - Block until the owner has exited
1181+ * @ret: owner's current futex lock status
11811182 * @exiting: Pointer to the exiting task
11821183 *
11831184 * Caller must hold a refcount on @exiting.
kernel/locking/lockdep.c+3−4
@@ -482,7 +482,7 @@ static struct lock_trace *save_trace(void) · 481 unmodified lines
482482 struct lock_trace *trace, *t2;
483483 struct hlist_head *hash_head;
484484 u32 hash;
485− unsigned int max_entries;
485+ int max_entries;
486486
487487 BUILD_BUG_ON_NOT_POWER_OF_2(STACK_TRACE_HASH_SIZE);
488488 BUILD_BUG_ON(LOCK_TRACE_SIZE_IN_LONGS >= MAX_STACK_TRACE_ENTRIES);
@@ -490,10 +490,8 @@ static struct lock_trace *save_trace(void) · 1 unmodified line
490490 trace = (struct lock_trace *)(stack_trace + nr_stack_trace_entries);
491491 max_entries = MAX_STACK_TRACE_ENTRIES - nr_stack_trace_entries -
492492 LOCK_TRACE_SIZE_IN_LONGS;
493− trace->nr_entries = stack_trace_save(trace->entries, max_entries, 3);
494493
495− if (nr_stack_trace_entries >= MAX_STACK_TRACE_ENTRIES -
496− LOCK_TRACE_SIZE_IN_LONGS - 1) {
494+ if (max_entries <= 0) {
497495 if (!debug_locks_off_graph_unlock())
498496 return NULL;
499497
@@ -502,6 +500,7 @@ static struct lock_trace *save_trace(void) · 2 unmodified lines
502500
503501 return NULL;
504502 }
503+ trace->nr_entries = stack_trace_save(trace->entries, max_entries, 3);
505504
506505 hash = jhash(trace->entries, trace->nr_entries *
507506 sizeof(trace->entries[0]), 0);
kernel/locking/rwsem.c+2−2
@@ -1226,8 +1226,8 @@ wait: · 1225 unmodified lines
12261226 * In this case, we attempt to acquire the lock again
12271227 * without sleeping.
12281228 */
1229− if ((wstate == WRITER_HANDOFF) &&
1230− (rwsem_spin_on_owner(sem, 0) == OWNER_NULL))
1229+ if (wstate == WRITER_HANDOFF &&
1230+ rwsem_spin_on_owner(sem, RWSEM_NONSPINNABLE) == OWNER_NULL)
12311231 goto trylock_again;
12321232
12331233 /* Block until there are no active lockers. */
kernel/ptrace.c+10−5
@@ -264,12 +264,17 @@ static int ptrace_check_attach(struct task_struct *child, bool ignore_state) · 263 unmodified lines
264264 return ret;
265265 }
266266
267−static int ptrace_has_cap(struct user_namespace *ns, unsigned int mode)
267+static bool ptrace_has_cap(const struct cred *cred, struct user_namespace *ns,
268+ unsigned int mode)
268269 {
270+ int ret;
271+
269272 if (mode & PTRACE_MODE_NOAUDIT)
270− return has_ns_capability_noaudit(current, ns, CAP_SYS_PTRACE);
273+ ret = security_capable(cred, ns, CAP_SYS_PTRACE, CAP_OPT_NOAUDIT);
271274 else
272− return has_ns_capability(current, ns, CAP_SYS_PTRACE);
275+ ret = security_capable(cred, ns, CAP_SYS_PTRACE, CAP_OPT_NONE);
276+
277+ return ret == 0;
273278 }
274279
275280 /* Returns 0 on success, -errno on denial. */
@@ -321,7 +326,7 @@ static int __ptrace_may_access(struct task_struct *task, unsigned int mode) · 45 unmodified lines
321326 gid_eq(caller_gid, tcred->sgid) &&
322327 gid_eq(caller_gid, tcred->gid))
323328 goto ok;
324− if (ptrace_has_cap(tcred->user_ns, mode))
329+ if (ptrace_has_cap(cred, tcred->user_ns, mode))
325330 goto ok;
326331 rcu_read_unlock();
327332 return -EPERM;
@@ -340,7 +345,7 @@ ok: · 12 unmodified lines
340345 mm = task->mm;
341346 if (mm &&
342347 ((get_dumpable(mm) != SUID_DUMP_USER) &&
343− !ptrace_has_cap(mm->user_ns, mode)))
348+ !ptrace_has_cap(cred, mm->user_ns, mode)))
344349 return -EPERM;
345350
346351 return security_ptrace_access_check(task, mode);
kernel/rseq.c+2−0
@@ -310,6 +310,8 @@ SYSCALL_DEFINE4(rseq, struct rseq __user *, rseq, u32, rseq_len, · 309 unmodified lines
310310 int ret;
311311
312312 if (flags & RSEQ_FLAG_UNREGISTER) {
313+ if (flags & ~RSEQ_FLAG_UNREGISTER)
314+ return -EINVAL;
313315 /* Unregister rseq for current thread. */
314316 if (current->rseq != rseq || !current->rseq)
315317 return -EINVAL;
kernel/time/posix-stubs.c+3−0
@@ -151,6 +151,9 @@ SYSCALL_DEFINE4(clock_nanosleep, const clockid_t, which_clock, int, flags, · 150 unmodified lines
151151
152152 #ifdef CONFIG_COMPAT
153153 COMPAT_SYS_NI(timer_create);
154+#endif
155+
156+#if defined(CONFIG_COMPAT) || defined(CONFIG_ALPHA)
154157 COMPAT_SYS_NI(getitimer);
155158 COMPAT_SYS_NI(setitimer);
156159 #endif
kernel/time/tick-sched.c+9−5
@@ -58,8 +58,9 @@ static void tick_do_update_jiffies64(ktime_t now) · 57 unmodified lines
5858
5959 /*
6060 * Do a quick check without holding jiffies_lock:
61+ * The READ_ONCE() pairs with two updates done later in this function.
6162 */
62− delta = ktime_sub(now, last_jiffies_update);
63+ delta = ktime_sub(now, READ_ONCE(last_jiffies_update));
6364 if (delta < tick_period)
6465 return;
6566
@@ -70,8 +71,9 @@ static void tick_do_update_jiffies64(ktime_t now) · 4 unmodified lines
7071 if (delta >= tick_period) {
7172
7273 delta = ktime_sub(delta, tick_period);
73− last_jiffies_update = ktime_add(last_jiffies_update,
74− tick_period);
74+ /* Pairs with the lockless read in this function. */
75+ WRITE_ONCE(last_jiffies_update,
76+ ktime_add(last_jiffies_update, tick_period));
7577
7678 /* Slow path for long timeouts */
7779 if (unlikely(delta >= tick_period)) {
@@ -79,8 +81,10 @@ static void tick_do_update_jiffies64(ktime_t now) · 1 unmodified line
7981
8082 ticks = ktime_divns(delta, incr);
8183
82− last_jiffies_update = ktime_add_ns(last_jiffies_update,
83− incr * ticks);
84+ /* Pairs with the lockless read in this function. */
85+ WRITE_ONCE(last_jiffies_update,
86+ ktime_add_ns(last_jiffies_update,
87+ incr * ticks));
8488 }
8589 do_timer(++ticks);
8690
lib/vdso/gettimeofday.c+1−0
@@ -221,6 +221,7 @@ int __cvdso_clock_getres_common(clockid_t clock, struct __kernel_timespec *res) · 220 unmodified lines
221221 return 0;
222222 }
223223
224+static __maybe_unused
224225 int __cvdso_clock_getres(clockid_t clock, struct __kernel_timespec *res)
225226 {
226227 int ret = __cvdso_clock_getres_common(clock, res);
mm/huge_memory.c+24−14
@@ -527,13 +527,13 @@ void prep_transhuge_page(struct page *page) · 526 unmodified lines
527527 set_compound_page_dtor(page, TRANSHUGE_PAGE_DTOR);
528528 }
529529
530−static unsigned long __thp_get_unmapped_area(struct file *filp, unsigned long len,
530+static unsigned long __thp_get_unmapped_area(struct file *filp,
531+ unsigned long addr, unsigned long len,
531532 loff_t off, unsigned long flags, unsigned long size)
532533 {
533− unsigned long addr;
534534 loff_t off_end = off + len;
535535 loff_t off_align = round_up(off, size);
536− unsigned long len_pad;
536+ unsigned long len_pad, ret;
537537
538538 if (off_end <= off_align || (off_end - off_align) < size)
539539 return 0;
@@ -542,30 +542,40 @@ static unsigned long __thp_get_unmapped_area(struct file *filp, unsigned long le · 2 unmodified lines
542542 if (len_pad < len || (off + len_pad) < off)
543543 return 0;
544544
545− addr = current->mm->get_unmapped_area(filp, 0, len_pad,
545+ ret = current->mm->get_unmapped_area(filp, addr, len_pad,
546546 off >> PAGE_SHIFT, flags);
547− if (IS_ERR_VALUE(addr))
547+
548+ /*
549+ * The failure might be due to length padding. The caller will retry
550+ * without the padding.
551+ */
552+ if (IS_ERR_VALUE(ret))
548553 return 0;
549554
550− addr += (off - addr) & (size - 1);
551− return addr;
555+ /*
556+ * Do not try to align to THP boundary if allocation at the address
557+ * hint succeeds.
558+ */
559+ if (ret == addr)
560+ return addr;
561+
562+ ret += (off - ret) & (size - 1);
563+ return ret;
552564 }
553565
554566 unsigned long thp_get_unmapped_area(struct file *filp, unsigned long addr,
555567 unsigned long len, unsigned long pgoff, unsigned long flags)
556568 {
569+ unsigned long ret;
557570 loff_t off = (loff_t)pgoff << PAGE_SHIFT;
558571
559− if (addr)
560− goto out;
561572 if (!IS_DAX(filp->f_mapping->host) || !IS_ENABLED(CONFIG_FS_DAX_PMD))
562573 goto out;
563574
564− addr = __thp_get_unmapped_area(filp, len, off, flags, PMD_SIZE);
565− if (addr)
566− return addr;
567−
568− out:
575+ ret = __thp_get_unmapped_area(filp, addr, len, off, flags, PMD_SIZE);
576+ if (ret)
577+ return ret;
578+out:
569579 return current->mm->get_unmapped_area(filp, addr, len, pgoff, flags);
570580 }
571581 EXPORT_SYMBOL_GPL(thp_get_unmapped_area);
mm/memcontrol.c+9−28
@@ -3287,49 +3287,34 @@ static u64 mem_cgroup_read_u64(struct cgroup_subsys_state *css, · 3286 unmodified lines
32873287 }
32883288 }
32893289
3290−static void memcg_flush_percpu_vmstats(struct mem_cgroup *memcg, bool slab_only)
3290+static void memcg_flush_percpu_vmstats(struct mem_cgroup *memcg)
32913291 {
3292− unsigned long stat[MEMCG_NR_STAT];
3292+ unsigned long stat[MEMCG_NR_STAT] = {0};
32933293 struct mem_cgroup *mi;
32943294 int node, cpu, i;
3295− int min_idx, max_idx;
3296−
3297− if (slab_only) {
3298− min_idx = NR_SLAB_RECLAIMABLE;
3299− max_idx = NR_SLAB_UNRECLAIMABLE;
3300− } else {
3301− min_idx = 0;
3302− max_idx = MEMCG_NR_STAT;
3303− }
3304−
3305− for (i = min_idx; i < max_idx; i++)
3306− stat[i] = 0;
33073295
33083296 for_each_online_cpu(cpu)
3309− for (i = min_idx; i < max_idx; i++)
3297+ for (i = 0; i < MEMCG_NR_STAT; i++)
33103298 stat[i] += per_cpu(memcg->vmstats_percpu->stat[i], cpu);
33113299
33123300 for (mi = memcg; mi; mi = parent_mem_cgroup(mi))
3313− for (i = min_idx; i < max_idx; i++)
3301+ for (i = 0; i < MEMCG_NR_STAT; i++)
33143302 atomic_long_add(stat[i], &mi->vmstats[i]);
33153303
3316− if (!slab_only)
3317− max_idx = NR_VM_NODE_STAT_ITEMS;
3318−
33193304 for_each_node(node) {
33203305 struct mem_cgroup_per_node *pn = memcg->nodeinfo[node];
33213306 struct mem_cgroup_per_node *pi;
33223307
3323− for (i = min_idx; i < max_idx; i++)
3308+ for (i = 0; i < NR_VM_NODE_STAT_ITEMS; i++)
33243309 stat[i] = 0;
33253310
33263311 for_each_online_cpu(cpu)
3327− for (i = min_idx; i < max_idx; i++)
3312+ for (i = 0; i < NR_VM_NODE_STAT_ITEMS; i++)
33283313 stat[i] += per_cpu(
33293314 pn->lruvec_stat_cpu->count[i], cpu);
33303315
33313316 for (pi = pn; pi; pi = parent_nodeinfo(pi, node))
3332− for (i = min_idx; i < max_idx; i++)
3317+ for (i = 0; i < NR_VM_NODE_STAT_ITEMS; i++)
33333318 atomic_long_add(stat[i], &pi->lruvec_stat[i]);
33343319 }
33353320 }
@@ -3403,13 +3388,9 @@ static void memcg_offline_kmem(struct mem_cgroup *memcg) · 67 unmodified lines
34033388 parent = root_mem_cgroup;
34043389
34053390 /*
3406− * Deactivate and reparent kmem_caches. Then flush percpu
3407− * slab statistics to have precise values at the parent and
3408− * all ancestor levels. It's required to keep slab stats
3409− * accurate after the reparenting of kmem_caches.
3391+ * Deactivate and reparent kmem_caches.
34103392 */
34113393 memcg_deactivate_kmem_caches(memcg, parent);
3412− memcg_flush_percpu_vmstats(memcg, true);
34133394
34143395 kmemcg_id = memcg->kmemcg_id;
34153396 BUG_ON(kmemcg_id < 0);
@@ -4913,7 +4894,7 @@ static void mem_cgroup_free(struct mem_cgroup *memcg) · 1497 unmodified lines
49134894 * Flush percpu vmstats and vmevents to guarantee the value correctness
49144895 * on parent's and all ancestor levels.
49154896 */
4916− memcg_flush_percpu_vmstats(memcg, false);
4897+ memcg_flush_percpu_vmstats(memcg);
49174898 memcg_flush_percpu_vmevents(memcg);
49184899 __mem_cgroup_free(memcg);
49194900 }
mm/mempolicy.c+7−3
@@ -2148,18 +2148,22 @@ alloc_pages_vma(gfp_t gfp, int order, struct vm_area_struct *vma, · 2147 unmodified lines
21482148 nmask = policy_nodemask(gfp, pol);
21492149 if (!nmask || node_isset(hpage_node, *nmask)) {
21502150 mpol_cond_put(pol);
2151+ /*
2152+ * First, try to allocate THP only on local node, but
2153+ * don't reclaim unnecessarily, just compact.
2154+ */
21512155 page = __alloc_pages_node(hpage_node,
2152− gfp | __GFP_THISNODE, order);
2156+ gfp | __GFP_THISNODE | __GFP_NORETRY, order);
21532157
21542158 /*
21552159 * If hugepage allocations are configured to always
21562160 * synchronous compact or the vma has been madvised
21572161 * to prefer hugepage backing, retry allowing remote
2158− * memory as well.
2162+ * memory with both reclaim and compact as well.
21592163 */
21602164 if (!page && (gfp & __GFP_DIRECT_RECLAIM))
21612165 page = __alloc_pages_node(hpage_node,
2162− gfp | __GFP_NORETRY, order);
2166+ gfp, order);
21632167
21642168 goto out;
21652169 }
mm/page-writeback.c+5−5
@@ -201,11 +201,11 @@ static void wb_min_max_ratio(struct bdi_writeback *wb, · 200 unmodified lines
201201 if (this_bw < tot_bw) {
202202 if (min) {
203203 min *= this_bw;
204− do_div(min, tot_bw);
204+ min = div64_ul(min, tot_bw);
205205 }
206206 if (max < 100) {
207207 max *= this_bw;
208− do_div(max, tot_bw);
208+ max = div64_ul(max, tot_bw);
209209 }
210210 }
211211
@@ -766,7 +766,7 @@ static unsigned long __wb_calc_thresh(struct dirty_throttle_control *dtc) · 554 unmodified lines
766766 struct wb_domain *dom = dtc_dom(dtc);
767767 unsigned long thresh = dtc->thresh;
768768 u64 wb_thresh;
769− long numerator, denominator;
769+ unsigned long numerator, denominator;
770770 unsigned long wb_min_ratio, wb_max_ratio;
771771
772772 /*
@@ -777,7 +777,7 @@ static unsigned long __wb_calc_thresh(struct dirty_throttle_control *dtc) · 4 unmodified lines
777777
778778 wb_thresh = (thresh * (100 - bdi_min_ratio)) / 100;
779779 wb_thresh *= numerator;
780− do_div(wb_thresh, denominator);
780+ wb_thresh = div64_ul(wb_thresh, denominator);
781781
782782 wb_min_max_ratio(dtc->wb, &wb_min_ratio, &wb_max_ratio);
783783
@@ -1102,7 +1102,7 @@ static void wb_update_write_bandwidth(struct bdi_writeback *wb, · 318 unmodified lines
11021102 bw = written - min(written, wb->written_stamp);
11031103 bw *= HZ;
11041104 if (unlikely(elapsed > period)) {
1105− do_div(bw, elapsed);
1105+ bw = div64_ul(bw, elapsed);
11061106 avg = bw;
11071107 goto out;
11081108 }
mm/page_alloc.c+18−43
@@ -694,34 +694,27 @@ void prep_compound_page(struct page *page, unsigned int order) · 693 unmodified lines
694694 #ifdef CONFIG_DEBUG_PAGEALLOC
695695 unsigned int _debug_guardpage_minorder;
696696
697−#ifdef CONFIG_DEBUG_PAGEALLOC_ENABLE_DEFAULT
698−DEFINE_STATIC_KEY_TRUE(_debug_pagealloc_enabled);
699−#else
697+bool _debug_pagealloc_enabled_early __read_mostly
698+ = IS_ENABLED(CONFIG_DEBUG_PAGEALLOC_ENABLE_DEFAULT);
699+EXPORT_SYMBOL(_debug_pagealloc_enabled_early);
700700 DEFINE_STATIC_KEY_FALSE(_debug_pagealloc_enabled);
701−#endif
702701 EXPORT_SYMBOL(_debug_pagealloc_enabled);
703702
704703 DEFINE_STATIC_KEY_FALSE(_debug_guardpage_enabled);
705704
706705 static int __init early_debug_pagealloc(char *buf)
707706 {
708− bool enable = false;
709−
710− if (kstrtobool(buf, &enable))
711− return -EINVAL;
712−
713− if (enable)
714− static_branch_enable(&_debug_pagealloc_enabled);
715−
716− return 0;
707+ return kstrtobool(buf, &_debug_pagealloc_enabled_early);
717708 }
718709 early_param("debug_pagealloc", early_debug_pagealloc);
719710
720−static void init_debug_guardpage(void)
711+void init_debug_pagealloc(void)
721712 {
722713 if (!debug_pagealloc_enabled())
723714 return;
724715
716+ static_branch_enable(&_debug_pagealloc_enabled);
717+
725718 if (!debug_guardpage_minorder())
726719 return;
727720
@@ -1186,7 +1179,7 @@ static __always_inline bool free_pages_prepare(struct page *page, · 458 unmodified lines
11861179 */
11871180 arch_free_page(page, order);
11881181
1189− if (debug_pagealloc_enabled())
1182+ if (debug_pagealloc_enabled_static())
11901183 kernel_map_pages(page, 1 << order, 0);
11911184
11921185 kasan_free_nondeferred_pages(page, order);
@@ -1207,7 +1200,7 @@ static bool free_pcp_prepare(struct page *page) · 14 unmodified lines
12071200
12081201 static bool bulkfree_pcp_prepare(struct page *page)
12091202 {
1210− if (debug_pagealloc_enabled())
1203+ if (debug_pagealloc_enabled_static())
12111204 return free_pages_check(page);
12121205 else
12131206 return false;
@@ -1221,7 +1214,7 @@ static bool bulkfree_pcp_prepare(struct page *page) · 7 unmodified lines
12211214 */
12221215 static bool free_pcp_prepare(struct page *page)
12231216 {
1224− if (debug_pagealloc_enabled())
1217+ if (debug_pagealloc_enabled_static())
12251218 return free_pages_prepare(page, 0, true);
12261219 else
12271220 return free_pages_prepare(page, 0, false);
@@ -1973,10 +1966,6 @@ void __init page_alloc_init_late(void) · 745 unmodified lines
19731966
19741967 for_each_populated_zone(zone)
19751968 set_zone_contiguous(zone);
1976−
1977−#ifdef CONFIG_DEBUG_PAGEALLOC
1978− init_debug_guardpage();
1979−#endif
19801969 }
19811970
19821971 #ifdef CONFIG_CMA
@@ -2106,7 +2095,7 @@ static inline bool free_pages_prezeroed(void) · 123 unmodified lines
21062095 */
21072096 static inline bool check_pcp_refill(struct page *page)
21082097 {
2109− if (debug_pagealloc_enabled())
2098+ if (debug_pagealloc_enabled_static())
21102099 return check_new_page(page);
21112100 else
21122101 return false;
@@ -2128,7 +2117,7 @@ static inline bool check_pcp_refill(struct page *page) · 15 unmodified lines
21282117 }
21292118 static inline bool check_new_pcp(struct page *page)
21302119 {
2131− if (debug_pagealloc_enabled())
2120+ if (debug_pagealloc_enabled_static())
21322121 return check_new_page(page);
21332122 else
21342123 return false;
@@ -2155,7 +2144,7 @@ inline void post_alloc_hook(struct page *page, unsigned int order, · 20 unmodified lines
21552144 set_page_refcounted(page);
21562145
21572146 arch_alloc_page(page, order);
2158− if (debug_pagealloc_enabled())
2147+ if (debug_pagealloc_enabled_static())
21592148 kernel_map_pages(page, 1 << order, 1);
21602149 kasan_alloc_pages(page, order);
21612150 kernel_poison_pages(page, 1 << order, 1);
@@ -4476,8 +4465,11 @@ retry_cpuset: · 2314 unmodified lines
44764465 if (page)
44774466 goto got_pg;
44784467
4479− if (order >= pageblock_order && (gfp_mask & __GFP_IO) &&
4480− !(gfp_mask & __GFP_RETRY_MAYFAIL)) {
4468+ /*
4469+ * Checks for costly allocations with __GFP_NORETRY, which
4470+ * includes some THP page fault allocations
4471+ */
4472+ if (costly_order && (gfp_mask & __GFP_NORETRY)) {
44814473 /*
44824474 * If allocating entire pageblock(s) and compaction
44834475 * failed because all zones are below low watermarks
@@ -4498,23 +4490,6 @@ retry_cpuset: · 14 unmodified lines
44984490 if (compact_result == COMPACT_SKIPPED ||
44994491 compact_result == COMPACT_DEFERRED)
45004492 goto nopage;
4501− }
4502−
4503− /*
4504− * Checks for costly allocations with __GFP_NORETRY, which
4505− * includes THP page fault allocations
4506− */
4507− if (costly_order && (gfp_mask & __GFP_NORETRY)) {
4508− /*
4509− * If compaction is deferred for high-order allocations,
4510− * it is because sync compaction recently failed. If
4511− * this is the case and the caller requested a THP
4512− * allocation, we do not want to heavily disrupt the
4513− * system, so we fail the allocation instead of entering
4514− * direct reclaim.
4515− */
4516− if (compact_result == COMPACT_DEFERRED)
4517− goto nopage;
45184493
45194494 /*
45204495 * Looks like reclaim/compaction is worth trying, but
mm/shmem.c+4−3
@@ -2107,9 +2107,10 @@ unsigned long shmem_get_unmapped_area(struct file *file, · 2106 unmodified lines
21072107 /*
21082108 * Our priority is to support MAP_SHARED mapped hugely;
21092109 * and support MAP_PRIVATE mapped hugely too, until it is COWed.
2110− * But if caller specified an address hint, respect that as before.
2110+ * But if caller specified an address hint and we allocated area there
2111+ * successfully, respect that as before.
21112112 */
2112− if (uaddr)
2113+ if (uaddr == addr)
21132114 return addr;
21142115
21152116 if (shmem_huge != SHMEM_HUGE_FORCE) {
@@ -2143,7 +2144,7 @@ unsigned long shmem_get_unmapped_area(struct file *file, · 27 unmodified lines
21432144 if (inflated_len < len)
21442145 return addr;
21452146
2146− inflated_addr = get_area(NULL, 0, inflated_len, 0, flags);
2147+ inflated_addr = get_area(NULL, uaddr, inflated_len, 0, flags);
21472148 if (IS_ERR_VALUE(inflated_addr))
21482149 return addr;
21492150 if (inflated_addr & ~PAGE_MASK)
mm/slab.c+2−2
@@ -1416,7 +1416,7 @@ static void kmem_rcu_free(struct rcu_head *head) · 1415 unmodified lines
14161416 #if DEBUG
14171417 static bool is_debug_pagealloc_cache(struct kmem_cache *cachep)
14181418 {
1419− if (debug_pagealloc_enabled() && OFF_SLAB(cachep) &&
1419+ if (debug_pagealloc_enabled_static() && OFF_SLAB(cachep) &&
14201420 (cachep->size % PAGE_SIZE) == 0)
14211421 return true;
14221422
@@ -2008,7 +2008,7 @@ int __kmem_cache_create(struct kmem_cache *cachep, slab_flags_t flags) · 585 unmodified lines
20082008 * to check size >= 256. It guarantees that all necessary small
20092009 * sized slab is initialized in current slab initialization sequence.
20102010 */
2011− if (debug_pagealloc_enabled() && (flags & SLAB_POISON) &&
2011+ if (debug_pagealloc_enabled_static() && (flags & SLAB_POISON) &&
20122012 size >= 256 && cachep->object_size > cache_line_size()) {
20132013 if (size < PAGE_SIZE || size % PAGE_SIZE == 0) {
20142014 size_t tmp_size = ALIGN(size, PAGE_SIZE);
mm/slab_common.c+2−1
@@ -903,7 +903,8 @@ static void flush_memcg_workqueue(struct kmem_cache *s) · 902 unmodified lines
903903 * deactivates the memcg kmem_caches through workqueue. Make sure all
904904 * previous workitems on workqueue are processed.
905905 */
906− flush_workqueue(memcg_kmem_cache_wq);
906+ if (likely(memcg_kmem_cache_wq))
907+ flush_workqueue(memcg_kmem_cache_wq);
907908
908909 /*
909910 * If we're racing with children kmem_cache deactivation, it might
mm/slub.c+1−1
@@ -288,7 +288,7 @@ static inline void *get_freepointer_safe(struct kmem_cache *s, void *object) · 287 unmodified lines
288288 unsigned long freepointer_addr;
289289 void *p;
290290
291− if (!debug_pagealloc_enabled())
291+ if (!debug_pagealloc_enabled_static())
292292 return get_freepointer(s, object);
293293
294294 freepointer_addr = (unsigned long)object + s->offset;
mm/sparse.c+8−1
@@ -777,7 +777,14 @@ static void section_deactivate(unsigned long pfn, unsigned long nr_pages, · 776 unmodified lines
777777 if (bitmap_empty(subsection_map, SUBSECTIONS_PER_SECTION)) {
778778 unsigned long section_nr = pfn_to_section_nr(pfn);
779779
780− if (!section_is_early) {
780+ /*
781+ * When removing an early section, the usage map is kept (as the
782+ * usage maps of other sections fall into the same page). It
783+ * will be re-used when re-adding the section - which is then no
784+ * longer an early section. If the usage map is PageReserved, it
785+ * was allocated during boot.
786+ */
787+ if (!PageReserved(virt_to_page(ms->usage))) {
781788 kfree(ms->usage);
782789 ms->usage = NULL;
783790 }
mm/vmalloc.c+2−2
@@ -1383,7 +1383,7 @@ static void free_unmap_vmap_area(struct vmap_area *va) · 1382 unmodified lines
13831383 {
13841384 flush_cache_vunmap(va->va_start, va->va_end);
13851385 unmap_vmap_area(va);
1386− if (debug_pagealloc_enabled())
1386+ if (debug_pagealloc_enabled_static())
13871387 flush_tlb_kernel_range(va->va_start, va->va_end);
13881388
13891389 free_vmap_area_noflush(va);
@@ -1681,7 +1681,7 @@ static void vb_free(const void *addr, unsigned long size) · 291 unmodified lines
16811681
16821682 vunmap_page_range((unsigned long)addr, (unsigned long)addr + size);
16831683
1684− if (debug_pagealloc_enabled())
1684+ if (debug_pagealloc_enabled_static())
16851685 flush_tlb_kernel_range((unsigned long)addr,
16861686 (unsigned long)addr + size);
16871687
net/batman-adv/distributed-arp-table.c+3−1
@@ -285,6 +285,7 @@ static u32 batadv_hash_dat(const void *data, u32 size) · 284 unmodified lines
285285 u32 hash = 0;
286286 const struct batadv_dat_entry *dat = data;
287287 const unsigned char *key;
288+ __be16 vid;
288289 u32 i;
289290
290291 key = (const unsigned char *)&dat->ip;
@@ -294,7 +295,8 @@ static u32 batadv_hash_dat(const void *data, u32 size) · 3 unmodified lines
294295 hash ^= (hash >> 6);
295296 }
296297
297− key = (const unsigned char *)&dat->vid;
298+ vid = htons(dat->vid);
299+ key = (__force const unsigned char *)&vid;
298300 for (i = 0; i < sizeof(dat->vid); i++) {
299301 hash += key[i];
300302 hash += (hash << 10);
net/core/dev.c+0−12
@@ -9177,22 +9177,10 @@ static void netdev_unregister_lockdep_key(struct net_device *dev) · 9176 unmodified lines
91779177
91789178 void netdev_update_lockdep_key(struct net_device *dev)
91799179 {
9180− struct netdev_queue *queue;
9181− int i;
9182−
9183− lockdep_unregister_key(&dev->qdisc_xmit_lock_key);
91849180 lockdep_unregister_key(&dev->addr_list_lock_key);
9185−
9186− lockdep_register_key(&dev->qdisc_xmit_lock_key);
91879181 lockdep_register_key(&dev->addr_list_lock_key);
91889182
91899183 lockdep_set_class(&dev->addr_list_lock, &dev->addr_list_lock_key);
9190− for (i = 0; i < dev->num_tx_queues; i++) {
9191− queue = netdev_get_tx_queue(dev, i);
9192−
9193− lockdep_set_class(&queue->_xmit_lock,
9194− &dev->qdisc_xmit_lock_key);
9195− }
91969184 }
91979185 EXPORT_SYMBOL(netdev_update_lockdep_key);
91989186
net/core/devlink.c+4−4
@@ -6406,7 +6406,7 @@ static bool devlink_port_type_should_warn(struct devlink_port *devlink_port) · 6405 unmodified lines
64066406 devlink_port->attrs.flavour != DEVLINK_PORT_FLAVOUR_DSA;
64076407 }
64086408
6409−#define DEVLINK_PORT_TYPE_WARN_TIMEOUT (HZ * 30)
6409+#define DEVLINK_PORT_TYPE_WARN_TIMEOUT (HZ * 3600)
64106410
64116411 static void devlink_port_type_warn_schedule(struct devlink_port *devlink_port)
64126412 {
@@ -7563,7 +7563,7 @@ void devlink_region_destroy(struct devlink_region *region) · 1150 unmodified lines
75637563 EXPORT_SYMBOL_GPL(devlink_region_destroy);
75647564
75657565 /**
7566− * devlink_region_shapshot_id_get - get snapshot ID
7566+ * devlink_region_snapshot_id_get - get snapshot ID
75677567 *
75687568 * This callback should be called when adding a new snapshot,
75697569 * Driver should use the same id for multiple snapshots taken
@@ -7571,7 +7571,7 @@ EXPORT_SYMBOL_GPL(devlink_region_destroy); · 1 unmodified line
75717571 *
75727572 * @devlink: devlink
75737573 */
7574−u32 devlink_region_shapshot_id_get(struct devlink *devlink)
7574+u32 devlink_region_snapshot_id_get(struct devlink *devlink)
75757575 {
75767576 u32 id;
75777577
@@ -7581,7 +7581,7 @@ u32 devlink_region_shapshot_id_get(struct devlink *devlink) · 3 unmodified lines
75817581
75827582 return id;
75837583 }
7584−EXPORT_SYMBOL_GPL(devlink_region_shapshot_id_get);
7584+EXPORT_SYMBOL_GPL(devlink_region_snapshot_id_get);
75857585
75867586 /**
75877587 * devlink_region_snapshot_create - create a new snapshot
net/core/filter.c+10−10
@@ -2231,10 +2231,10 @@ BPF_CALL_4(bpf_msg_pull_data, struct sk_msg *, msg, u32, start, · 2230 unmodified lines
22312231 /* First find the starting scatterlist element */
22322232 i = msg->sg.start;
22332233 do {
2234+ offset += len;
22342235 len = sk_msg_elem(msg, i)->length;
22352236 if (start < offset + len)
22362237 break;
2237− offset += len;
22382238 sk_msg_iter_var_next(i);
22392239 } while (i != msg->sg.end);
22402240
@@ -2346,7 +2346,7 @@ BPF_CALL_4(bpf_msg_push_data, struct sk_msg *, msg, u32, start, · 105 unmodified lines
23462346 u32, len, u64, flags)
23472347 {
23482348 struct scatterlist sge, nsge, nnsge, rsge = {0}, *psge;
2349− u32 new, i = 0, l, space, copy = 0, offset = 0;
2349+ u32 new, i = 0, l = 0, space, copy = 0, offset = 0;
23502350 u8 *raw, *to, *from;
23512351 struct page *page;
23522352
@@ -2356,11 +2356,11 @@ BPF_CALL_4(bpf_msg_push_data, struct sk_msg *, msg, u32, start, · 3 unmodified lines
23562356 /* First find the starting scatterlist element */
23572357 i = msg->sg.start;
23582358 do {
2359+ offset += l;
23592360 l = sk_msg_elem(msg, i)->length;
23602361
23612362 if (start < offset + l)
23622363 break;
2363− offset += l;
23642364 sk_msg_iter_var_next(i);
23652365 } while (i != msg->sg.end);
23662366
@@ -2415,6 +2415,7 @@ BPF_CALL_4(bpf_msg_push_data, struct sk_msg *, msg, u32, start, · 48 unmodified lines
24152415
24162416 sk_msg_iter_var_next(i);
24172417 sg_unmark_end(psge);
2418+ sg_unmark_end(&rsge);
24182419 sk_msg_iter_next(msg, end);
24192420 }
24202421
@@ -2506,7 +2507,7 @@ static void sk_msg_shift_right(struct sk_msg *msg, int i) · 85 unmodified lines
25062507 BPF_CALL_4(bpf_msg_pop_data, struct sk_msg *, msg, u32, start,
25072508 u32, len, u64, flags)
25082509 {
2509− u32 i = 0, l, space, offset = 0;
2510+ u32 i = 0, l = 0, space, offset = 0;
25102511 u64 last = start + len;
25112512 int pop;
25122513
@@ -2516,11 +2517,11 @@ BPF_CALL_4(bpf_msg_pop_data, struct sk_msg *, msg, u32, start, · 3 unmodified lines
25162517 /* First find the starting scatterlist element */
25172518 i = msg->sg.start;
25182519 do {
2520+ offset += l;
25192521 l = sk_msg_elem(msg, i)->length;
25202522
25212523 if (start < offset + l)
25222524 break;
2523− offset += l;
25242525 sk_msg_iter_var_next(i);
25252526 } while (i != msg->sg.end);
25262527
@@ -5318,8 +5319,7 @@ __bpf_sk_lookup(struct sk_buff *skb, struct bpf_sock_tuple *tuple, u32 len, · 2791 unmodified lines
53185319 if (sk) {
53195320 sk = sk_to_full_sk(sk);
53205321 if (!sk_fullsock(sk)) {
5321− if (!sock_flag(sk, SOCK_RCU_FREE))
5322− sock_gen_put(sk);
5322+ sock_gen_put(sk);
53235323 return NULL;
53245324 }
53255325 }
@@ -5356,8 +5356,7 @@ bpf_sk_lookup(struct sk_buff *skb, struct bpf_sock_tuple *tuple, u32 len, · 30 unmodified lines
53565356 if (sk) {
53575357 sk = sk_to_full_sk(sk);
53585358 if (!sk_fullsock(sk)) {
5359− if (!sock_flag(sk, SOCK_RCU_FREE))
5360− sock_gen_put(sk);
5359+ sock_gen_put(sk);
53615360 return NULL;
53625361 }
53635362 }
@@ -5424,7 +5423,8 @@ static const struct bpf_func_proto bpf_sk_lookup_udp_proto = { · 60 unmodified lines
54245423
54255424 BPF_CALL_1(bpf_sk_release, struct sock *, sk)
54265425 {
5427− if (!sock_flag(sk, SOCK_RCU_FREE))
5426+ /* Only full sockets have sk->sk_flags. */
5427+ if (!sk_fullsock(sk) || !sock_flag(sk, SOCK_RCU_FREE))
54285428 sock_gen_put(sk);
54295429 return 0;
54305430 }
net/core/skmsg.c+2−0
@@ -594,6 +594,8 @@ EXPORT_SYMBOL_GPL(sk_psock_destroy); · 593 unmodified lines
594594
595595 void sk_psock_drop(struct sock *sk, struct sk_psock *psock)
596596 {
597+ sock_owned_by_me(sk);
598+
597599 sk_psock_cork_free(psock);
598600 sk_psock_zap_ingress(psock);
599601
net/core/sock_map.c+6−1
@@ -241,8 +241,11 @@ static void sock_map_free(struct bpf_map *map) · 240 unmodified lines
241241 struct sock *sk;
242242
243243 sk = xchg(psk, NULL);
244− if (sk)
244+ if (sk) {
245+ lock_sock(sk);
245246 sock_map_unref(sk, psk);
247+ release_sock(sk);
248+ }
246249 }
247250 raw_spin_unlock_bh(&stab->lock);
248251 rcu_read_unlock();
@@ -862,7 +865,9 @@ static void sock_hash_free(struct bpf_map *map) · 613 unmodified lines
862865 raw_spin_lock_bh(&bucket->lock);
863866 hlist_for_each_entry_safe(elem, node, &bucket->head, node) {
864867 hlist_del_rcu(&elem->node);
868+ lock_sock(elem->sk);
865869 sock_map_unref(elem->sk, elem);
870+ release_sock(elem->sk);
866871 }
867872 raw_spin_unlock_bh(&bucket->lock);
868873 }
net/dsa/tag_gswip.c+1−1
@@ -104,7 +104,7 @@ static struct sk_buff *gswip_tag_rcv(struct sk_buff *skb, · 103 unmodified lines
104104 }
105105
106106 static const struct dsa_device_ops gswip_netdev_ops = {
107− .name = "gwsip",
107+ .name = "gswip",
108108 .proto = DSA_TAG_PROTO_GSWIP,
109109 .xmit = gswip_tag_xmit,
110110 .rcv = gswip_tag_rcv,
net/dsa/tag_qca.c+0−3
@@ -33,9 +33,6 @@ static struct sk_buff *qca_tag_xmit(struct sk_buff *skb, struct net_device *dev) · 32 unmodified lines
3333 struct dsa_port *dp = dsa_slave_to_port(dev);
3434 u16 *phdr, hdr;
3535
36− dev->stats.tx_packets++;
37− dev->stats.tx_bytes += skb->len;
38−
3936 if (skb_cow_head(skb, 0) < 0)
4037 return NULL;
4138
net/ipv4/fib_trie.c+6−0
@@ -2193,6 +2193,12 @@ int fib_table_dump(struct fib_table *tb, struct sk_buff *skb, · 2192 unmodified lines
21932193 int count = cb->args[2];
21942194 t_key key = cb->args[3];
21952195
2196+ /* First time here, count and key are both always 0. Count > 0
2197+ * and key == 0 means the dump has wrapped around and we are done.
2198+ */
2199+ if (count && !key)
2200+ return skb->len;
2201+
21962202 while ((l = leaf_walk_rcu(&tp, key)) != NULL) {
21972203 int err;
21982204
net/ipv4/netfilter/arp_tables.c+10−9
@@ -496,12 +496,13 @@ static inline int check_entry_size_and_hooks(struct arpt_entry *e, · 495 unmodified lines
496496 return 0;
497497 }
498498
499−static inline void cleanup_entry(struct arpt_entry *e)
499+static void cleanup_entry(struct arpt_entry *e, struct net *net)
500500 {
501501 struct xt_tgdtor_param par;
502502 struct xt_entry_target *t;
503503
504504 t = arpt_get_target(e);
505+ par.net = net;
505506 par.target = t->u.kernel.target;
506507 par.targinfo = t->data;
507508 par.family = NFPROTO_ARP;
@@ -584,7 +585,7 @@ static int translate_table(struct net *net, · 76 unmodified lines
584585 xt_entry_foreach(iter, entry0, newinfo->size) {
585586 if (i-- == 0)
586587 break;
587− cleanup_entry(iter);
588+ cleanup_entry(iter, net);
588589 }
589590 return ret;
590591 }
@@ -927,7 +928,7 @@ static int __do_replace(struct net *net, const char *name, · 336 unmodified lines
927928 /* Decrease module usage counts and free resource */
928929 loc_cpu_old_entry = oldinfo->entries;
929930 xt_entry_foreach(iter, loc_cpu_old_entry, oldinfo->size)
930− cleanup_entry(iter);
931+ cleanup_entry(iter, net);
931932
932933 xt_free_table_info(oldinfo);
933934 if (copy_to_user(counters_ptr, counters,
@@ -990,7 +991,7 @@ static int do_replace(struct net *net, const void __user *user, · 56 unmodified lines
990991
991992 free_newinfo_untrans:
992993 xt_entry_foreach(iter, loc_cpu_entry, newinfo->size)
993− cleanup_entry(iter);
994+ cleanup_entry(iter, net);
994995 free_newinfo:
995996 xt_free_table_info(newinfo);
996997 return ret;
@@ -1287,7 +1288,7 @@ static int compat_do_replace(struct net *net, void __user *user, · 290 unmodified lines
12871288
12881289 free_newinfo_untrans:
12891290 xt_entry_foreach(iter, loc_cpu_entry, newinfo->size)
1290− cleanup_entry(iter);
1291+ cleanup_entry(iter, net);
12911292 free_newinfo:
12921293 xt_free_table_info(newinfo);
12931294 return ret;
@@ -1514,7 +1515,7 @@ static int do_arpt_get_ctl(struct sock *sk, int cmd, void __user *user, int *len · 220 unmodified lines
15141515 return ret;
15151516 }
15161517
1517−static void __arpt_unregister_table(struct xt_table *table)
1518+static void __arpt_unregister_table(struct net *net, struct xt_table *table)
15181519 {
15191520 struct xt_table_info *private;
15201521 void *loc_cpu_entry;
@@ -1526,7 +1527,7 @@ static void __arpt_unregister_table(struct xt_table *table) · 5 unmodified lines
15261527 /* Decrease module usage counts and free resources */
15271528 loc_cpu_entry = private->entries;
15281529 xt_entry_foreach(iter, loc_cpu_entry, private->size)
1529− cleanup_entry(iter);
1530+ cleanup_entry(iter, net);
15301531 if (private->number > private->initial_entries)
15311532 module_put(table_owner);
15321533 xt_free_table_info(private);
@@ -1566,7 +1567,7 @@ int arpt_register_table(struct net *net, · 33 unmodified lines
15661567
15671568 ret = nf_register_net_hooks(net, ops, hweight32(table->valid_hooks));
15681569 if (ret != 0) {
1569− __arpt_unregister_table(new_table);
1570+ __arpt_unregister_table(net, new_table);
15701571 *res = NULL;
15711572 }
15721573
@@ -1581,7 +1582,7 @@ void arpt_unregister_table(struct net *net, struct xt_table *table, · 8 unmodified lines
15811582 const struct nf_hook_ops *ops)
15821583 {
15831584 nf_unregister_net_hooks(net, ops, hweight32(table->valid_hooks));
1584− __arpt_unregister_table(table);
1585+ __arpt_unregister_table(net, table);
15851586 }
15861587
15871588 /* The built-in targets: standard (NULL) and error. */
net/ipv4/tcp_bpf.c+7−10
@@ -121,14 +121,14 @@ int tcp_bpf_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, · 120 unmodified lines
121121 struct sk_psock *psock;
122122 int copied, ret;
123123
124− if (unlikely(flags & MSG_ERRQUEUE))
125− return inet_recv_error(sk, msg, len, addr_len);
126− if (!skb_queue_empty(&sk->sk_receive_queue))
127− return tcp_recvmsg(sk, msg, len, nonblock, flags, addr_len);
128−
129124 psock = sk_psock_get(sk);
130125 if (unlikely(!psock))
131126 return tcp_recvmsg(sk, msg, len, nonblock, flags, addr_len);
127+ if (unlikely(flags & MSG_ERRQUEUE))
128+ return inet_recv_error(sk, msg, len, addr_len);
129+ if (!skb_queue_empty(&sk->sk_receive_queue) &&
130+ sk_psock_queue_empty(psock))
131+ return tcp_recvmsg(sk, msg, len, nonblock, flags, addr_len);
132132 lock_sock(sk);
133133 msg_bytes_ready:
134134 copied = __tcp_bpf_recvmsg(sk, psock, msg, len, flags);
@@ -139,7 +139,7 @@ msg_bytes_ready: · 4 unmodified lines
139139 timeo = sock_rcvtimeo(sk, nonblock);
140140 data = tcp_bpf_wait_data(sk, psock, flags, timeo, &err);
141141 if (data) {
142− if (skb_queue_empty(&sk->sk_receive_queue))
142+ if (!sk_psock_queue_empty(psock))
143143 goto msg_bytes_ready;
144144 release_sock(sk);
145145 sk_psock_put(sk, psock);
@@ -315,10 +315,7 @@ more_data: · 169 unmodified lines
315315 */
316316 delta = msg->sg.size;
317317 psock->eval = sk_psock_msg_verdict(sk, psock, msg);
318− if (msg->sg.size < delta)
319− delta -= msg->sg.size;
320− else
321− delta = 0;
318+ delta -= msg->sg.size;
322319 }
323320
324321 if (msg->cork_bytes &&
net/ipv4/tcp_input.c+4−3
@@ -915,9 +915,10 @@ static void tcp_check_sack_reordering(struct sock *sk, const u32 low_seq, · 914 unmodified lines
915915 /* This must be called before lost_out is incremented */
916916 static void tcp_verify_retransmit_hint(struct tcp_sock *tp, struct sk_buff *skb)
917917 {
918− if (!tp->retransmit_skb_hint ||
919− before(TCP_SKB_CB(skb)->seq,
920− TCP_SKB_CB(tp->retransmit_skb_hint)->seq))
918+ if ((!tp->retransmit_skb_hint && tp->retrans_out >= tp->lost_out) ||
919+ (tp->retransmit_skb_hint &&
920+ before(TCP_SKB_CB(skb)->seq,
921+ TCP_SKB_CB(tp->retransmit_skb_hint)->seq)))
921922 tp->retransmit_skb_hint = skb;
922923 }
923924
net/ipv4/tcp_ulp.c+4−2
@@ -99,17 +99,19 @@ void tcp_get_available_ulp(char *buf, size_t maxlen) · 98 unmodified lines
9999 rcu_read_unlock();
100100 }
101101
102−void tcp_update_ulp(struct sock *sk, struct proto *proto)
102+void tcp_update_ulp(struct sock *sk, struct proto *proto,
103+ void (*write_space)(struct sock *sk))
103104 {
104105 struct inet_connection_sock *icsk = inet_csk(sk);
105106
106107 if (!icsk->icsk_ulp_ops) {
108+ sk->sk_write_space = write_space;
107109 sk->sk_prot = proto;
108110 return;
109111 }
110112
111113 if (icsk->icsk_ulp_ops->update)
112− icsk->icsk_ulp_ops->update(sk, proto);
114+ icsk->icsk_ulp_ops->update(sk, proto, write_space);
113115 }
114116
115117 void tcp_cleanup_ulp(struct sock *sk)
net/mac80211/cfg.c+23−0
@@ -2954,6 +2954,28 @@ static int ieee80211_start_radar_detection(struct wiphy *wiphy, · 2953 unmodified lines
29542954 return err;
29552955 }
29562956
2957+static void ieee80211_end_cac(struct wiphy *wiphy,
2958+ struct net_device *dev)
2959+{
2960+ struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
2961+ struct ieee80211_local *local = sdata->local;
2962+
2963+ mutex_lock(&local->mtx);
2964+ list_for_each_entry(sdata, &local->interfaces, list) {
2965+ /* it might be waiting for the local->mtx, but then
2966+ * by the time it gets it, sdata->wdev.cac_started
2967+ * will no longer be true
2968+ */
2969+ cancel_delayed_work(&sdata->dfs_cac_timer_work);
2970+
2971+ if (sdata->wdev.cac_started) {
2972+ ieee80211_vif_release_channel(sdata);
2973+ sdata->wdev.cac_started = false;
2974+ }
2975+ }
2976+ mutex_unlock(&local->mtx);
2977+}
2978+
29572979 static struct cfg80211_beacon_data *
29582980 cfg80211_beacon_dup(struct cfg80211_beacon_data *beacon)
29592981 {
@@ -4023,6 +4045,7 @@ const struct cfg80211_ops mac80211_config_ops = { · 1063 unmodified lines
40234045 #endif
40244046 .get_channel = ieee80211_cfg_get_channel,
40254047 .start_radar_detection = ieee80211_start_radar_detection,
4048+ .end_cac = ieee80211_end_cac,
40264049 .channel_switch = ieee80211_channel_switch,
40274050 .set_qos_map = ieee80211_set_qos_map,
40284051 .set_ap_chanwidth = ieee80211_set_ap_chanwidth,
net/mac80211/mesh_hwmp.c+3−0
@@ -328,6 +328,9 @@ u32 airtime_link_metric_get(struct ieee80211_local *local, · 327 unmodified lines
328328 unsigned long fail_avg =
329329 ewma_mesh_fail_avg_read(&sta->mesh->fail_avg);
330330
331+ if (sta->mesh->plink_state != NL80211_PLINK_ESTAB)
332+ return MAX_METRIC;
333+
331334 /* Try to get rate based on HW/SW RC algorithm.
332335 * Rate is returned in units of Kbps, correct this
333336 * to comply with airtime calculation units
net/mac80211/tkip.c+15−3
@@ -263,9 +263,21 @@ int ieee80211_tkip_decrypt_data(struct arc4_ctx *ctx, · 262 unmodified lines
263263 if ((keyid >> 6) != key->conf.keyidx)
264264 return TKIP_DECRYPT_INVALID_KEYIDX;
265265
266− if (rx_ctx->ctx.state != TKIP_STATE_NOT_INIT &&
267− (iv32 < rx_ctx->iv32 ||
268− (iv32 == rx_ctx->iv32 && iv16 <= rx_ctx->iv16)))
266+ /* Reject replays if the received TSC is smaller than or equal to the
267+ * last received value in a valid message, but with an exception for
268+ * the case where a new key has been set and no valid frame using that
269+ * key has yet received and the local RSC was initialized to 0. This
270+ * exception allows the very first frame sent by the transmitter to be
271+ * accepted even if that transmitter were to use TSC 0 (IEEE 802.11
272+ * described TSC to be initialized to 1 whenever a new key is taken into
273+ * use).
274+ */
275+ if (iv32 < rx_ctx->iv32 ||
276+ (iv32 == rx_ctx->iv32 &&
277+ (iv16 < rx_ctx->iv16 ||
278+ (iv16 == rx_ctx->iv16 &&
279+ (rx_ctx->iv32 || rx_ctx->iv16 ||
280+ rx_ctx->ctx.state != TKIP_STATE_NOT_INIT)))))
269281 return TKIP_DECRYPT_REPLAY;
270282
271283 if (only_iv) {
net/netfilter/ipset/ip_set_bitmap_gen.h+1−1
@@ -60,9 +60,9 @@ mtype_destroy(struct ip_set *set) · 59 unmodified lines
6060 if (SET_WITH_TIMEOUT(set))
6161 del_timer_sync(&map->gc);
6262
63− ip_set_free(map->members);
6463 if (set->dsize && set->extensions & IPSET_EXT_DESTROY)
6564 mtype_ext_cleanup(set);
65+ ip_set_free(map->members);
6666 ip_set_free(map);
6767
6868 set->data = NULL;
net/netfilter/nf_nat_proto.c+13−0
@@ -233,6 +233,19 @@ icmp_manip_pkt(struct sk_buff *skb, · 232 unmodified lines
233233 return false;
234234
235235 hdr = (struct icmphdr *)(skb->data + hdroff);
236+ switch (hdr->type) {
237+ case ICMP_ECHO:
238+ case ICMP_ECHOREPLY:
239+ case ICMP_TIMESTAMP:
240+ case ICMP_TIMESTAMPREPLY:
241+ case ICMP_INFO_REQUEST:
242+ case ICMP_INFO_REPLY:
243+ case ICMP_ADDRESS:
244+ case ICMP_ADDRESSREPLY:
245+ break;
246+ default:
247+ return true;
248+ }
236249 inet_proto_csum_replace2(&hdr->checksum, skb,
237250 hdr->un.echo.id, tuple->src.u.icmp.id, false);
238251 hdr->un.echo.id = tuple->src.u.icmp.id;
net/netfilter/nf_tables_api.c+26−13
@@ -22,6 +22,8 @@ · 21 unmodified lines
2222 #include <net/net_namespace.h>
2323 #include <net/sock.h>
2424
25+#define NFT_MODULE_AUTOLOAD_LIMIT (MODULE_NAME_LEN - sizeof("nft-expr-255-"))
26+
2527 static LIST_HEAD(nf_tables_expressions);
2628 static LIST_HEAD(nf_tables_objects);
2729 static LIST_HEAD(nf_tables_flowtables);
@@ -564,33 +566,34 @@ __nf_tables_chain_type_lookup(const struct nlattr *nla, u8 family) · 536 unmodified lines
564566 }
565567
566568 /*
567− * Loading a module requires dropping mutex that guards the
568− * transaction.
569− * We first need to abort any pending transactions as once
570− * mutex is unlocked a different client could start a new
571− * transaction. It must not see any 'future generation'
572− * changes * as these changes will never happen.
569+ * Loading a module requires dropping mutex that guards the transaction.
570+ * A different client might race to start a new transaction meanwhile. Zap the
571+ * list of pending transaction and then restore it once the mutex is grabbed
572+ * again. Users of this function return EAGAIN which implicitly triggers the
573+ * transaction abort path to clean up the list of pending transactions.
573574 */
574575 #ifdef CONFIG_MODULES
575−static int __nf_tables_abort(struct net *net);
576−
577576 static void nft_request_module(struct net *net, const char *fmt, ...)
578577 {
579578 char module_name[MODULE_NAME_LEN];
579+ LIST_HEAD(commit_list);
580580 va_list args;
581581 int ret;
582582
583− __nf_tables_abort(net);
583+ list_splice_init(&net->nft.commit_list, &commit_list);
584584
585585 va_start(args, fmt);
586586 ret = vsnprintf(module_name, MODULE_NAME_LEN, fmt, args);
587587 va_end(args);
588− if (WARN(ret >= MODULE_NAME_LEN, "truncated: '%s' (len %d)", module_name, ret))
588+ if (ret >= MODULE_NAME_LEN)
589589 return;
590590
591591 mutex_unlock(&net->nft.commit_mutex);
592592 request_module("%s", module_name);
593593 mutex_lock(&net->nft.commit_mutex);
594+
595+ WARN_ON_ONCE(!list_empty(&net->nft.commit_list));
596+ list_splice(&commit_list, &net->nft.commit_list);
594597 }
595598 #endif
596599
@@ -1045,12 +1048,18 @@ static int nft_flush_table(struct nft_ctx *ctx) · 448 unmodified lines
10451048 }
10461049
10471050 list_for_each_entry_safe(flowtable, nft, &ctx->table->flowtables, list) {
1051+ if (!nft_is_active_next(ctx->net, flowtable))
1052+ continue;
1053+
10481054 err = nft_delflowtable(ctx, flowtable);
10491055 if (err < 0)
10501056 goto out;
10511057 }
10521058
10531059 list_for_each_entry_safe(obj, ne, &ctx->table->objects, list) {
1060+ if (!nft_is_active_next(ctx->net, obj))
1061+ continue;
1062+
10541063 err = nft_delobj(ctx, obj);
10551064 if (err < 0)
10561065 goto out;
@@ -1241,7 +1250,8 @@ static const struct nla_policy nft_chain_policy[NFTA_CHAIN_MAX + 1] = { · 184 unmodified lines
12411250 .len = NFT_CHAIN_MAXNAMELEN - 1 },
12421251 [NFTA_CHAIN_HOOK] = { .type = NLA_NESTED },
12431252 [NFTA_CHAIN_POLICY] = { .type = NLA_U32 },
1244− [NFTA_CHAIN_TYPE] = { .type = NLA_STRING },
1253+ [NFTA_CHAIN_TYPE] = { .type = NLA_STRING,
1254+ .len = NFT_MODULE_AUTOLOAD_LIMIT },
12451255 [NFTA_CHAIN_COUNTERS] = { .type = NLA_NESTED },
12461256 [NFTA_CHAIN_FLAGS] = { .type = NLA_U32 },
12471257 };
@@ -1676,6 +1686,7 @@ static int nf_tables_parse_netdev_hooks(struct net *net, · 428 unmodified lines
16761686 goto err_hook;
16771687 }
16781688 if (nft_hook_list_find(hook_list, hook)) {
1689+ kfree(hook);
16791690 err = -EEXIST;
16801691 goto err_hook;
16811692 }
@@ -2355,7 +2366,8 @@ static const struct nft_expr_type *nft_expr_type_get(struct net *net, · 673 unmodified lines
23552366 }
23562367
23572368 static const struct nla_policy nft_expr_policy[NFTA_EXPR_MAX + 1] = {
2358− [NFTA_EXPR_NAME] = { .type = NLA_STRING },
2369+ [NFTA_EXPR_NAME] = { .type = NLA_STRING,
2370+ .len = NFT_MODULE_AUTOLOAD_LIMIT },
23592371 [NFTA_EXPR_DATA] = { .type = NLA_NESTED },
23602372 };
23612373
@@ -4198,7 +4210,8 @@ static const struct nla_policy nft_set_elem_policy[NFTA_SET_ELEM_MAX + 1] = { · 1836 unmodified lines
41984210 [NFTA_SET_ELEM_USERDATA] = { .type = NLA_BINARY,
41994211 .len = NFT_USERDATA_MAXLEN },
42004212 [NFTA_SET_ELEM_EXPR] = { .type = NLA_NESTED },
4201− [NFTA_SET_ELEM_OBJREF] = { .type = NLA_STRING },
4213+ [NFTA_SET_ELEM_OBJREF] = { .type = NLA_STRING,
4214+ .len = NFT_OBJ_MAXNAMELEN - 1 },
42024215 };
42034216
42044217 static const struct nla_policy nft_set_elem_list_policy[NFTA_SET_ELEM_LIST_MAX + 1] = {
net/netfilter/nft_tunnel.c+4−1
@@ -76,7 +76,7 @@ static int nft_tunnel_get_init(const struct nft_ctx *ctx, · 75 unmodified lines
7676 struct nft_tunnel *priv = nft_expr_priv(expr);
7777 u32 len;
7878
79− if (!tb[NFTA_TUNNEL_KEY] &&
79+ if (!tb[NFTA_TUNNEL_KEY] ||
8080 !tb[NFTA_TUNNEL_DREG])
8181 return -EINVAL;
8282
@@ -266,6 +266,9 @@ static int nft_tunnel_obj_erspan_init(const struct nlattr *attr, · 183 unmodified lines
266266 if (err < 0)
267267 return err;
268268
269+ if (!tb[NFTA_TUNNEL_KEY_ERSPAN_VERSION])
270+ return -EINVAL;
271+
269272 version = ntohl(nla_get_be32(tb[NFTA_TUNNEL_KEY_ERSPAN_VERSION]));
270273 switch (version) {
271274 case ERSPAN_VERSION:
net/sched/act_ctinfo.c+11−0
@@ -360,6 +360,16 @@ static int tcf_ctinfo_search(struct net *net, struct tc_action **a, u32 index) · 359 unmodified lines
360360 return tcf_idr_search(tn, a, index);
361361 }
362362
363+static void tcf_ctinfo_cleanup(struct tc_action *a)
364+{
365+ struct tcf_ctinfo *ci = to_ctinfo(a);
366+ struct tcf_ctinfo_params *cp;
367+
368+ cp = rcu_dereference_protected(ci->params, 1);
369+ if (cp)
370+ kfree_rcu(cp, rcu);
371+}
372+
363373 static struct tc_action_ops act_ctinfo_ops = {
364374 .kind = "ctinfo",
365375 .id = TCA_ID_CTINFO,
@@ -367,6 +377,7 @@ static struct tc_action_ops act_ctinfo_ops = { · 1 unmodified line
367377 .act = tcf_ctinfo_act,
368378 .dump = tcf_ctinfo_dump,
369379 .init = tcf_ctinfo_init,
380+ .cleanup= tcf_ctinfo_cleanup,
370381 .walk = tcf_ctinfo_walker,
371382 .lookup = tcf_ctinfo_search,
372383 .size = sizeof(struct tcf_ctinfo),
net/sched/act_ife.c+3−4
@@ -537,6 +537,9 @@ static int tcf_ife_init(struct net *net, struct nlattr *nla, · 536 unmodified lines
537537 }
538538
539539 ife = to_ife(*a);
540+ if (ret == ACT_P_CREATED)
541+ INIT_LIST_HEAD(&ife->metalist);
542+
540543 err = tcf_action_check_ctrlact(parm->action, tp, &goto_ch, extack);
541544 if (err < 0)
542545 goto release_idr;
@@ -566,10 +569,6 @@ static int tcf_ife_init(struct net *net, struct nlattr *nla, · 23 unmodified lines
566569 p->eth_type = ife_type;
567570 }
568571
569−
570− if (ret == ACT_P_CREATED)
571− INIT_LIST_HEAD(&ife->metalist);
572−
573572 if (tb[TCA_IFE_METALST]) {
574573 err = nla_parse_nested_deprecated(tb2, IFE_META_MAX,
575574 tb[TCA_IFE_METALST], NULL,
net/sunrpc/xprtrdma/verbs.c+22−7
@@ -77,7 +77,7 @@ · 76 unmodified lines
7777 static void rpcrdma_sendctx_put_locked(struct rpcrdma_xprt *r_xprt,
7878 struct rpcrdma_sendctx *sc);
7979 static void rpcrdma_reqs_reset(struct rpcrdma_xprt *r_xprt);
80−static void rpcrdma_reps_destroy(struct rpcrdma_buffer *buf);
80+static void rpcrdma_reps_unmap(struct rpcrdma_xprt *r_xprt);
8181 static void rpcrdma_mrs_create(struct rpcrdma_xprt *r_xprt);
8282 static void rpcrdma_mrs_destroy(struct rpcrdma_xprt *r_xprt);
8383 static struct rpcrdma_regbuf *
@@ -244,6 +244,7 @@ rpcrdma_cm_event_handler(struct rdma_cm_id *id, struct rdma_cm_event *event) · 160 unmodified lines
244244 ia->ri_id->device->name,
245245 rpcrdma_addrstr(r_xprt), rpcrdma_portstr(r_xprt));
246246 #endif
247+ init_completion(&ia->ri_remove_done);
247248 set_bit(RPCRDMA_IAF_REMOVING, &ia->ri_flags);
248249 ep->rep_connected = -ENODEV;
249250 xprt_force_disconnect(xprt);
@@ -297,7 +298,6 @@ rpcrdma_create_id(struct rpcrdma_xprt *xprt, struct rpcrdma_ia *ia) · 47 unmodified lines
297298 int rc;
298299
299300 init_completion(&ia->ri_done);
300− init_completion(&ia->ri_remove_done);
301301
302302 id = rdma_create_id(xprt->rx_xprt.xprt_net, rpcrdma_cm_event_handler,
303303 xprt, RDMA_PS_TCP, IB_QPT_RC);
@@ -421,7 +421,7 @@ rpcrdma_ia_remove(struct rpcrdma_ia *ia) · 117 unmodified lines
421421 /* The ULP is responsible for ensuring all DMA
422422 * mappings and MRs are gone.
423423 */
424− rpcrdma_reps_destroy(buf);
424+ rpcrdma_reps_unmap(r_xprt);
425425 list_for_each_entry(req, &buf->rb_allreqs, rl_all) {
426426 rpcrdma_regbuf_dma_unmap(req->rl_rdmabuf);
427427 rpcrdma_regbuf_dma_unmap(req->rl_sendbuf);
@@ -599,6 +599,7 @@ static int rpcrdma_ep_recreate_xprt(struct rpcrdma_xprt *r_xprt, · 171 unmodified lines
599599 struct ib_qp_init_attr *qp_init_attr)
600600 {
601601 struct rpcrdma_ia *ia = &r_xprt->rx_ia;
602+ struct rpcrdma_ep *ep = &r_xprt->rx_ep;
602603 int rc, err;
603604
604605 trace_xprtrdma_reinsert(r_xprt);
@@ -613,6 +614,7 @@ static int rpcrdma_ep_recreate_xprt(struct rpcrdma_xprt *r_xprt, · 8 unmodified lines
613614 pr_err("rpcrdma: rpcrdma_ep_create returned %d\n", err);
614615 goto out2;
615616 }
617+ memcpy(qp_init_attr, &ep->rep_attr, sizeof(*qp_init_attr));
616618
617619 rc = -ENETUNREACH;
618620 err = rdma_create_qp(ia->ri_id, ia->ri_pd, qp_init_attr);
@@ -1090,6 +1092,7 @@ static struct rpcrdma_rep *rpcrdma_rep_create(struct rpcrdma_xprt *r_xprt, · 471 unmodified lines
10901092 rep->rr_recv_wr.sg_list = &rep->rr_rdmabuf->rg_iov;
10911093 rep->rr_recv_wr.num_sge = 1;
10921094 rep->rr_temp = temp;
1095+ list_add(&rep->rr_all, &r_xprt->rx_buf.rb_all_reps);
10931096 return rep;
10941097
10951098 out_free:
@@ -1100,6 +1103,7 @@ out: · 4 unmodified lines
11001103
11011104 static void rpcrdma_rep_destroy(struct rpcrdma_rep *rep)
11021105 {
1106+ list_del(&rep->rr_all);
11031107 rpcrdma_regbuf_free(rep->rr_rdmabuf);
11041108 kfree(rep);
11051109 }
@@ -1118,10 +1122,16 @@ static struct rpcrdma_rep *rpcrdma_rep_get_locked(struct rpcrdma_buffer *buf) · 12 unmodified lines
11181122 static void rpcrdma_rep_put(struct rpcrdma_buffer *buf,
11191123 struct rpcrdma_rep *rep)
11201124 {
1121− if (!rep->rr_temp)
1122− llist_add(&rep->rr_node, &buf->rb_free_reps);
1123− else
1124− rpcrdma_rep_destroy(rep);
1125+ llist_add(&rep->rr_node, &buf->rb_free_reps);
1126+}
1127+
1128+static void rpcrdma_reps_unmap(struct rpcrdma_xprt *r_xprt)
1129+{
1130+ struct rpcrdma_buffer *buf = &r_xprt->rx_buf;
1131+ struct rpcrdma_rep *rep;
1132+
1133+ list_for_each_entry(rep, &buf->rb_all_reps, rr_all)
1134+ rpcrdma_regbuf_dma_unmap(rep->rr_rdmabuf);
11251135 }
11261136
11271137 static void rpcrdma_reps_destroy(struct rpcrdma_buffer *buf)
@@ -1152,6 +1162,7 @@ int rpcrdma_buffer_create(struct rpcrdma_xprt *r_xprt) · 24 unmodified lines
11521162
11531163 INIT_LIST_HEAD(&buf->rb_send_bufs);
11541164 INIT_LIST_HEAD(&buf->rb_allreqs);
1165+ INIT_LIST_HEAD(&buf->rb_all_reps);
11551166
11561167 rc = -ENOMEM;
11571168 for (i = 0; i < buf->rb_max_requests; i++) {
@@ -1504,6 +1515,10 @@ void rpcrdma_post_recvs(struct rpcrdma_xprt *r_xprt, bool temp) · 346 unmodified lines
15041515 wr = NULL;
15051516 while (needed) {
15061517 rep = rpcrdma_rep_get_locked(buf);
1518+ if (rep && rep->rr_temp) {
1519+ rpcrdma_rep_destroy(rep);
1520+ continue;
1521+ }
15071522 if (!rep)
15081523 rep = rpcrdma_rep_create(r_xprt, temp);
15091524 if (!rep)
net/sunrpc/xprtrdma/xprt_rdma.h+2−0
@@ -203,6 +203,7 @@ struct rpcrdma_rep { · 202 unmodified lines
203203 struct xdr_stream rr_stream;
204204 struct llist_node rr_node;
205205 struct ib_recv_wr rr_recv_wr;
206+ struct list_head rr_all;
206207 };
207208
208209 /* To reduce the rate at which a transport invokes ib_post_recv
@@ -368,6 +369,7 @@ struct rpcrdma_buffer { · 159 unmodified lines
368369
369370 struct list_head rb_allreqs;
370371 struct list_head rb_all_mrs;
372+ struct list_head rb_all_reps;
371373
372374 struct llist_head rb_free_reps;
373375
net/tls/tls_main.c+7−3
@@ -732,15 +732,19 @@ out: · 731 unmodified lines
732732 return rc;
733733 }
734734
735−static void tls_update(struct sock *sk, struct proto *p)
735+static void tls_update(struct sock *sk, struct proto *p,
736+ void (*write_space)(struct sock *sk))
736737 {
737738 struct tls_context *ctx;
738739
739740 ctx = tls_get_ctx(sk);
740− if (likely(ctx))
741+ if (likely(ctx)) {
742+ ctx->sk_write_space = write_space;
741743 ctx->sk_proto = p;
742− else
744+ } else {
743745 sk->sk_prot = p;
746+ sk->sk_write_space = write_space;
747+ }
744748 }
745749
746750 static int tls_get_info(const struct sock *sk, struct sk_buff *skb)
net/tls/tls_sw.c+32−9
@@ -256,8 +256,6 @@ static int tls_do_decryption(struct sock *sk, · 255 unmodified lines
256256 return ret;
257257
258258 ret = crypto_wait_req(ret, &ctx->async_wait);
259− } else if (ret == -EBADMSG) {
260− TLS_INC_STATS(sock_net(sk), LINUX_MIB_TLSDECRYPTERROR);
261259 }
262260
263261 if (async)
@@ -682,12 +680,32 @@ static int tls_push_record(struct sock *sk, int flags, · 418 unmodified lines
682680
683681 split_point = msg_pl->apply_bytes;
684682 split = split_point && split_point < msg_pl->sg.size;
683+ if (unlikely((!split &&
684+ msg_pl->sg.size +
685+ prot->overhead_size > msg_en->sg.size) ||
686+ (split &&
687+ split_point +
688+ prot->overhead_size > msg_en->sg.size))) {
689+ split = true;
690+ split_point = msg_en->sg.size;
691+ }
685692 if (split) {
686693 rc = tls_split_open_record(sk, rec, &tmp, msg_pl, msg_en,
687694 split_point, prot->overhead_size,
688695 &orig_end);
689696 if (rc < 0)
690697 return rc;
698+ /* This can happen if above tls_split_open_record allocates
699+ * a single large encryption buffer instead of two smaller
700+ * ones. In this case adjust pointers and continue without
701+ * split.
702+ */
703+ if (!msg_pl->sg.size) {
704+ tls_merge_open_record(sk, rec, tmp, orig_end);
705+ msg_pl = &rec->msg_plaintext;
706+ msg_en = &rec->msg_encrypted;
707+ split = false;
708+ }
691709 sk_msg_trim(sk, msg_en, msg_pl->sg.size +
692710 prot->overhead_size);
693711 }
@@ -709,6 +727,12 @@ static int tls_push_record(struct sock *sk, int flags, · 15 unmodified lines
709727 sg_mark_end(sk_msg_elem(msg_pl, i));
710728 }
711729
730+ if (msg_pl->sg.end < msg_pl->sg.start) {
731+ sg_chain(&msg_pl->sg.data[msg_pl->sg.start],
732+ MAX_SKB_FRAGS - msg_pl->sg.start + 1,
733+ msg_pl->sg.data);
734+ }
735+
712736 i = msg_pl->sg.start;
713737 sg_chain(rec->sg_aead_in, 2, &msg_pl->sg.data[i]);
714738
@@ -772,7 +796,7 @@ static int bpf_exec_tx_verdict(struct sk_msg *msg, struct sock *sk, · 57 unmodified lines
772796 psock = sk_psock_get(sk);
773797 if (!psock || !policy) {
774798 err = tls_push_record(sk, flags, record_type);
775− if (err) {
799+ if (err && err != -EINPROGRESS) {
776800 *copied -= sk_msg_free(sk, msg);
777801 tls_free_open_rec(sk);
778802 }
@@ -783,10 +807,7 @@ more_data: · 4 unmodified lines
783807 if (psock->eval == __SK_NONE) {
784808 delta = msg->sg.size;
785809 psock->eval = sk_psock_msg_verdict(sk, psock, msg);
786− if (delta < msg->sg.size)
787− delta -= msg->sg.size;
788− else
789− delta = 0;
810+ delta -= msg->sg.size;
790811 }
791812 if (msg->cork_bytes && msg->cork_bytes > msg->sg.size &&
792813 !enospc && !full_record) {
@@ -801,7 +822,7 @@ more_data: · 8 unmodified lines
801822 switch (psock->eval) {
802823 case __SK_PASS:
803824 err = tls_push_record(sk, flags, record_type);
804− if (err < 0) {
825+ if (err && err != -EINPROGRESS) {
805826 *copied -= sk_msg_free(sk, msg);
806827 tls_free_open_rec(sk);
807828 goto out_err;
@@ -1515,7 +1536,9 @@ static int decrypt_skb_update(struct sock *sk, struct sk_buff *skb, · 707 unmodified lines
15151536 if (err == -EINPROGRESS)
15161537 tls_advance_record_sn(sk, prot,
15171538 &tls_ctx->rx);
1518−
1539+ else if (err == -EBADMSG)
1540+ TLS_INC_STATS(sock_net(sk),
1541+ LINUX_MIB_TLSDECRYPTERROR);
15191542 return err;
15201543 }
15211544 } else {
net/vmw_vsock/hyperv_transport.c+6−59
@@ -138,28 +138,15 @@ struct hvsock { · 137 unmodified lines
138138 ****************************************************************************
139139 * The only valid Service GUIDs, from the perspectives of both the host and *
140140 * Linux VM, that can be connected by the other end, must conform to this *
141− * format: <port>-facb-11e6-bd58-64006a7986d3, and the "port" must be in *
142− * this range [0, 0x7FFFFFFF]. *
141+ * format: <port>-facb-11e6-bd58-64006a7986d3. *
143142 ****************************************************************************
144143 *
145144 * When we write apps on the host to connect(), the GUID ServiceID is used.
146145 * When we write apps in Linux VM to connect(), we only need to specify the
147146 * port and the driver will form the GUID and use that to request the host.
148147 *
149− * From the perspective of Linux VM:
150− * 1. the local ephemeral port (i.e. the local auto-bound port when we call
151− * connect() without explicit bind()) is generated by __vsock_bind_stream(),
152− * and the range is [1024, 0xFFFFFFFF).
153− * 2. the remote ephemeral port (i.e. the auto-generated remote port for
154− * a connect request initiated by the host's connect()) is generated by
155− * hvs_remote_addr_init() and the range is [0x80000000, 0xFFFFFFFF).
156148 */
157149
158−#define MAX_LISTEN_PORT ((u32)0x7FFFFFFF)
159−#define MAX_VM_LISTEN_PORT MAX_LISTEN_PORT
160−#define MAX_HOST_LISTEN_PORT MAX_LISTEN_PORT
161−#define MIN_HOST_EPHEMERAL_PORT (MAX_HOST_LISTEN_PORT + 1)
162−
163150 /* 00000000-facb-11e6-bd58-64006a7986d3 */
164151 static const guid_t srv_id_template =
165152 GUID_INIT(0x00000000, 0xfacb, 0x11e6, 0xbd, 0x58,
@@ -184,34 +171,6 @@ static void hvs_addr_init(struct sockaddr_vm *addr, const guid_t *svr_id) · 18 unmodified lines
184171 vsock_addr_init(addr, VMADDR_CID_ANY, port);
185172 }
186173
187−static void hvs_remote_addr_init(struct sockaddr_vm *remote,
188− struct sockaddr_vm *local)
189−{
190− static u32 host_ephemeral_port = MIN_HOST_EPHEMERAL_PORT;
191− struct sock *sk;
192−
193− /* Remote peer is always the host */
194− vsock_addr_init(remote, VMADDR_CID_HOST, VMADDR_PORT_ANY);
195−
196− while (1) {
197− /* Wrap around ? */
198− if (host_ephemeral_port < MIN_HOST_EPHEMERAL_PORT ||
199− host_ephemeral_port == VMADDR_PORT_ANY)
200− host_ephemeral_port = MIN_HOST_EPHEMERAL_PORT;
201−
202− remote->svm_port = host_ephemeral_port++;
203−
204− sk = vsock_find_connected_socket(remote, local);
205− if (!sk) {
206− /* Found an available ephemeral port */
207− return;
208− }
209−
210− /* Release refcnt got in vsock_find_connected_socket */
211− sock_put(sk);
212− }
213−}
214−
215174 static void hvs_set_channel_pending_send_size(struct vmbus_channel *chan)
216175 {
217176 set_channel_pending_send_size(chan,
@@ -341,12 +300,7 @@ static void hvs_open_connection(struct vmbus_channel *chan) · 123 unmodified lines
341300 if_type = &chan->offermsg.offer.if_type;
342301 if_instance = &chan->offermsg.offer.if_instance;
343302 conn_from_host = chan->offermsg.offer.u.pipe.user_def[0];
344−
345− /* The host or the VM should only listen on a port in
346− * [0, MAX_LISTEN_PORT]
347− */
348− if (!is_valid_srv_id(if_type) ||
349− get_port_by_srv_id(if_type) > MAX_LISTEN_PORT)
303+ if (!is_valid_srv_id(if_type))
350304 return;
351305
352306 hvs_addr_init(&addr, conn_from_host ? if_type : if_instance);
@@ -371,8 +325,11 @@ static void hvs_open_connection(struct vmbus_channel *chan) · 18 unmodified lines
371325 vnew = vsock_sk(new);
372326
373327 hvs_addr_init(&vnew->local_addr, if_type);
374− hvs_remote_addr_init(&vnew->remote_addr, &vnew->local_addr);
375328
329+ /* Remote peer is always the host */
330+ vsock_addr_init(&vnew->remote_addr,
331+ VMADDR_CID_HOST, VMADDR_PORT_ANY);
332+ vnew->remote_addr.svm_port = get_port_by_srv_id(if_instance);
376333 ret = vsock_assign_transport(vnew, vsock_sk(sk));
377334 /* Transport assigned (looking at remote_addr) must be the
378335 * same where we received the request.
@@ -766,16 +723,6 @@ static bool hvs_stream_is_active(struct vsock_sock *vsk) · 387 unmodified lines
766723
767724 static bool hvs_stream_allow(u32 cid, u32 port)
768725 {
769− /* The host's port range [MIN_HOST_EPHEMERAL_PORT, 0xFFFFFFFF) is
770− * reserved as ephemeral ports, which are used as the host's ports
771− * when the host initiates connections.
772− *
773− * Perform this check in the guest so an immediate error is produced
774− * instead of a timeout.
775− */
776− if (port > MAX_HOST_LISTEN_PORT)
777− return false;
778−
779726 if (cid == VMADDR_CID_HOST)
780727 return true;
781728
net/wireless/nl80211.c+3−0
@@ -10843,6 +10843,7 @@ static int cfg80211_cqm_rssi_update(struct cfg80211_registered_device *rdev, · 10842 unmodified lines
1084310843 if (err)
1084410844 return err;
1084510845
10846+ cfg80211_sinfo_release_content(&sinfo);
1084610847 if (sinfo.filled & BIT_ULL(NL80211_STA_INFO_BEACON_SIGNAL_AVG))
1084710848 wdev->cqm_config->last_rssi_event_value =
1084810849 (s8) sinfo.rx_beacon_signal_avg;
@@ -13796,6 +13797,8 @@ static int nl80211_probe_mesh_link(struct sk_buff *skb, struct genl_info *info) · 2947 unmodified lines
1379613797 if (err)
1379713798 return err;
1379813799
13800+ cfg80211_sinfo_release_content(&sinfo);
13801+
1379913802 return rdev_probe_mesh_link(rdev, dev, dest, buf, len);
1380013803 }
1380113804
net/wireless/rdev-ops.h+14−0
@@ -538,6 +538,10 @@ static inline int · 537 unmodified lines
538538 rdev_set_wiphy_params(struct cfg80211_registered_device *rdev, u32 changed)
539539 {
540540 int ret;
541+
542+ if (!rdev->ops->set_wiphy_params)
543+ return -EOPNOTSUPP;
544+
541545 trace_rdev_set_wiphy_params(&rdev->wiphy, changed);
542546 ret = rdev->ops->set_wiphy_params(&rdev->wiphy, changed);
543547 trace_rdev_return_int(&rdev->wiphy, ret);
@@ -1167,6 +1171,16 @@ rdev_start_radar_detection(struct cfg80211_registered_device *rdev, · 623 unmodified lines
11671171 return ret;
11681172 }
11691173
1174+static inline void
1175+rdev_end_cac(struct cfg80211_registered_device *rdev,
1176+ struct net_device *dev)
1177+{
1178+ trace_rdev_end_cac(&rdev->wiphy, dev);
1179+ if (rdev->ops->end_cac)
1180+ rdev->ops->end_cac(&rdev->wiphy, dev);
1181+ trace_rdev_return_void(&rdev->wiphy);
1182+}
1183+
11701184 static inline int
11711185 rdev_set_mcast_rate(struct cfg80211_registered_device *rdev,
11721186 struct net_device *dev,
net/wireless/reg.c+32−4
@@ -2261,14 +2261,15 @@ static void update_all_wiphy_regulatory(enum nl80211_reg_initiator initiator) · 2260 unmodified lines
22612261
22622262 static void handle_channel_custom(struct wiphy *wiphy,
22632263 struct ieee80211_channel *chan,
2264− const struct ieee80211_regdomain *regd)
2264+ const struct ieee80211_regdomain *regd,
2265+ u32 min_bw)
22652266 {
22662267 u32 bw_flags = 0;
22672268 const struct ieee80211_reg_rule *reg_rule = NULL;
22682269 const struct ieee80211_power_rule *power_rule = NULL;
22692270 u32 bw;
22702271
2271− for (bw = MHZ_TO_KHZ(20); bw >= MHZ_TO_KHZ(5); bw = bw / 2) {
2272+ for (bw = MHZ_TO_KHZ(20); bw >= min_bw; bw = bw / 2) {
22722273 reg_rule = freq_reg_info_regd(MHZ_TO_KHZ(chan->center_freq),
22732274 regd, bw);
22742275 if (!IS_ERR(reg_rule))
@@ -2324,8 +2325,14 @@ static void handle_band_custom(struct wiphy *wiphy, · 49 unmodified lines
23242325 if (!sband)
23252326 return;
23262327
2328+ /*
2329+ * We currently assume that you always want at least 20 MHz,
2330+ * otherwise channel 12 might get enabled if this rule is
2331+ * compatible to US, which permits 2402 - 2472 MHz.
2332+ */
23272333 for (i = 0; i < sband->n_channels; i++)
2328− handle_channel_custom(wiphy, &sband->channels[i], regd);
2334+ handle_channel_custom(wiphy, &sband->channels[i], regd,
2335+ MHZ_TO_KHZ(20));
23292336 }
23302337
23312338 /* Used by drivers prior to wiphy registration */
@@ -3885,6 +3892,25 @@ bool regulatory_pre_cac_allowed(struct wiphy *wiphy) · 1553 unmodified lines
38853892 }
38863893 EXPORT_SYMBOL(regulatory_pre_cac_allowed);
38873894
3895+static void cfg80211_check_and_end_cac(struct cfg80211_registered_device *rdev)
3896+{
3897+ struct wireless_dev *wdev;
3898+ /* If we finished CAC or received radar, we should end any
3899+ * CAC running on the same channels.
3900+ * the check !cfg80211_chandef_dfs_usable contain 2 options:
3901+ * either all channels are available - those the CAC_FINISHED
3902+ * event has effected another wdev state, or there is a channel
3903+ * in unavailable state in wdev chandef - those the RADAR_DETECTED
3904+ * event has effected another wdev state.
3905+ * In both cases we should end the CAC on the wdev.
3906+ */
3907+ list_for_each_entry(wdev, &rdev->wiphy.wdev_list, list) {
3908+ if (wdev->cac_started &&
3909+ !cfg80211_chandef_dfs_usable(&rdev->wiphy, &wdev->chandef))
3910+ rdev_end_cac(rdev, wdev->netdev);
3911+ }
3912+}
3913+
38883914 void regulatory_propagate_dfs_state(struct wiphy *wiphy,
38893915 struct cfg80211_chan_def *chandef,
38903916 enum nl80211_dfs_state dfs_state,
@@ -3911,8 +3937,10 @@ void regulatory_propagate_dfs_state(struct wiphy *wiphy, · 20 unmodified lines
39113937 cfg80211_set_dfs_state(&rdev->wiphy, chandef, dfs_state);
39123938
39133939 if (event == NL80211_RADAR_DETECTED ||
3914− event == NL80211_RADAR_CAC_FINISHED)
3940+ event == NL80211_RADAR_CAC_FINISHED) {
39153941 cfg80211_sched_dfs_chan_update(rdev);
3942+ cfg80211_check_and_end_cac(rdev);
3943+ }
39163944
39173945 nl80211_radar_notify(rdev, chandef, event, NULL, GFP_KERNEL);
39183946 }
net/wireless/sme.c+3−3
@@ -1307,14 +1307,14 @@ void cfg80211_autodisconnect_wk(struct work_struct *work) · 1306 unmodified lines
13071307 if (wdev->conn_owner_nlportid) {
13081308 switch (wdev->iftype) {
13091309 case NL80211_IFTYPE_ADHOC:
1310− cfg80211_leave_ibss(rdev, wdev->netdev, false);
1310+ __cfg80211_leave_ibss(rdev, wdev->netdev, false);
13111311 break;
13121312 case NL80211_IFTYPE_AP:
13131313 case NL80211_IFTYPE_P2P_GO:
1314− cfg80211_stop_ap(rdev, wdev->netdev, false);
1314+ __cfg80211_stop_ap(rdev, wdev->netdev, false);
13151315 break;
13161316 case NL80211_IFTYPE_MESH_POINT:
1317− cfg80211_leave_mesh(rdev, wdev->netdev);
1317+ __cfg80211_leave_mesh(rdev, wdev->netdev);
13181318 break;
13191319 case NL80211_IFTYPE_STATION:
13201320 case NL80211_IFTYPE_P2P_CLIENT:
net/wireless/trace.h+5−0
@@ -646,6 +646,11 @@ DEFINE_EVENT(wiphy_netdev_evt, rdev_flush_pmksa, · 645 unmodified lines
646646 TP_ARGS(wiphy, netdev)
647647 );
648648
649+DEFINE_EVENT(wiphy_netdev_evt, rdev_end_cac,
650+ TP_PROTO(struct wiphy *wiphy, struct net_device *netdev),
651+ TP_ARGS(wiphy, netdev)
652+);
653+
649654 DECLARE_EVENT_CLASS(station_add_change,
650655 TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, u8 *mac,
651656 struct station_parameters *params),
net/wireless/util.c+1−1
@@ -564,7 +564,7 @@ __frame_add_frag(struct sk_buff *skb, struct page *page, · 563 unmodified lines
564564 struct skb_shared_info *sh = skb_shinfo(skb);
565565 int page_offset;
566566
567− page_ref_inc(page);
567+ get_page(page);
568568 page_offset = ptr - page_address(page);
569569 skb_add_rx_frag(skb, sh->nr_frags, page, page_offset, len, size);
570570 }
net/wireless/wext-core.c+2−1
@@ -657,7 +657,8 @@ struct iw_statistics *get_wireless_stats(struct net_device *dev) · 656 unmodified lines
657657 return NULL;
658658 }
659659
660−static int iw_handler_get_iwstats(struct net_device * dev,
660+/* noinline to avoid a bogus warning with -O3 */
661+static noinline int iw_handler_get_iwstats(struct net_device * dev,
661662 struct iw_request_info * info,
662663 union iwreq_data * wrqu,
663664 char * extra)
net/x25/af_x25.c+5−1
@@ -766,6 +766,10 @@ static int x25_connect(struct socket *sock, struct sockaddr *uaddr, · 765 unmodified lines
766766 if (sk->sk_state == TCP_ESTABLISHED)
767767 goto out;
768768
769+ rc = -EALREADY; /* Do nothing if call is already in progress */
770+ if (sk->sk_state == TCP_SYN_SENT)
771+ goto out;
772+
769773 sk->sk_state = TCP_CLOSE;
770774 sock->state = SS_UNCONNECTED;
771775
@@ -812,7 +816,7 @@ static int x25_connect(struct socket *sock, struct sockaddr *uaddr, · 40 unmodified lines
812816 /* Now the loop */
813817 rc = -EINPROGRESS;
814818 if (sk->sk_state != TCP_ESTABLISHED && (flags & O_NONBLOCK))
815− goto out_put_neigh;
819+ goto out;
816820
817821 rc = x25_wait_for_connection_establishment(sk);
818822 if (rc)
sound/core/seq/seq_timer.c+9−5
@@ -471,15 +471,19 @@ void snd_seq_info_timer_read(struct snd_info_entry *entry, · 470 unmodified lines
471471 q = queueptr(idx);
472472 if (q == NULL)
473473 continue;
474− if ((tmr = q->timer) == NULL ||
475− (ti = tmr->timeri) == NULL) {
476− queuefree(q);
477− continue;
478− }
474+ mutex_lock(&q->timer_mutex);
475+ tmr = q->timer;
476+ if (!tmr)
477+ goto unlock;
478+ ti = tmr->timeri;
479+ if (!ti)
480+ goto unlock;
479481 snd_iprintf(buffer, "Timer for queue %i : %s\n", q->queue, ti->timer->name);
480482 resolution = snd_timer_resolution(ti) * tmr->ticks;
481483 snd_iprintf(buffer, " Period time : %lu.%09lu\n", resolution / 1000000000, resolution % 1000000000);
482484 snd_iprintf(buffer, " Skew : %u / %u\n", tmr->skew, tmr->skew_base);
485+unlock:
486+ mutex_unlock(&q->timer_mutex);
483487 queuefree(q);
484488 }
485489 }
sound/firewire/dice/dice-extension.c+4−1
@@ -159,8 +159,11 @@ int snd_dice_detect_extension_formats(struct snd_dice *dice) · 158 unmodified lines
159159 int j;
160160
161161 for (j = i + 1; j < 9; ++j) {
162− if (pointers[i * 2] == pointers[j * 2])
162+ if (pointers[i * 2] == pointers[j * 2]) {
163+ // Fallback to limited functionality.
164+ err = -ENXIO;
163165 goto end;
166+ }
164167 }
165168 }
166169
sound/firewire/tascam/amdtp-tascam.c+3−2
@@ -157,14 +157,15 @@ static void read_status_messages(struct amdtp_stream *s, · 156 unmodified lines
157157 if ((before ^ after) & mask) {
158158 struct snd_firewire_tascam_change *entry =
159159 &tscm->queue[tscm->push_pos];
160+ unsigned long flag;
160161
161− spin_lock_irq(&tscm->lock);
162+ spin_lock_irqsave(&tscm->lock, flag);
162163 entry->index = index;
163164 entry->before = before;
164165 entry->after = after;
165166 if (++tscm->push_pos >= SND_TSCM_QUEUE_COUNT)
166167 tscm->push_pos = 0;
167− spin_unlock_irq(&tscm->lock);
168+ spin_unlock_irqrestore(&tscm->lock, flag);
168169
169170 wake_up(&tscm->hwdep_wait);
170171 }
sound/pci/hda/hda_intel.c+8−5
@@ -125,7 +125,7 @@ static char *patch[SNDRV_CARDS]; · 124 unmodified lines
125125 static bool beep_mode[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] =
126126 CONFIG_SND_HDA_INPUT_BEEP_MODE};
127127 #endif
128−static bool dsp_driver = 1;
128+static bool dmic_detect = 1;
129129
130130 module_param_array(index, int, NULL, 0444);
131131 MODULE_PARM_DESC(index, "Index value for Intel HD audio interface.");
@@ -160,9 +160,10 @@ module_param_array(beep_mode, bool, NULL, 0444); · 28 unmodified lines
160160 MODULE_PARM_DESC(beep_mode, "Select HDA Beep registration mode "
161161 "(0=off, 1=on) (default=1).");
162162 #endif
163−module_param(dsp_driver, bool, 0444);
164−MODULE_PARM_DESC(dsp_driver, "Allow DSP driver selection (bypass this driver) "
165− "(0=off, 1=on) (default=1)");
163+module_param(dmic_detect, bool, 0444);
164+MODULE_PARM_DESC(dmic_detect, "Allow DSP driver selection (bypass this driver) "
165+ "(0=off, 1=on) (default=1); "
166+ "deprecated, use snd-intel-dspcfg.dsp_driver option instead");
166167
167168 #ifdef CONFIG_PM
168169 static int param_set_xint(const char *val, const struct kernel_param *kp);
@@ -2099,11 +2100,13 @@ static int azx_probe(struct pci_dev *pci, · 1930 unmodified lines
20992100 /*
21002101 * stop probe if another Intel's DSP driver should be activated
21012102 */
2102− if (dsp_driver) {
2103+ if (dmic_detect) {
21032104 err = snd_intel_dsp_driver_probe(pci);
21042105 if (err != SND_INTEL_DSP_DRIVER_ANY &&
21052106 err != SND_INTEL_DSP_DRIVER_LEGACY)
21062107 return -ENODEV;
2108+ } else {
2109+ dev_warn(&pci->dev, "dmic_detect option is deprecated, pass snd-intel-dspcfg.dsp_driver=1 option instead\n");
21072110 }
21082111
21092112 err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
sound/soc/codecs/cros_ec_codec.c+8−0
@@ -10,6 +10,7 @@ · 9 unmodified lines
1010
1111 #include <crypto/hash.h>
1212 #include <crypto/sha.h>
13+#include <linux/acpi.h>
1314 #include <linux/delay.h>
1415 #include <linux/device.h>
1516 #include <linux/io.h>
@@ -1047,10 +1048,17 @@ static const struct of_device_id cros_ec_codec_of_match[] = { · 1031 unmodified lines
10471048 MODULE_DEVICE_TABLE(of, cros_ec_codec_of_match);
10481049 #endif
10491050
1051+static const struct acpi_device_id cros_ec_codec_acpi_id[] = {
1052+ { "GOOG0013", 0 },
1053+ { }
1054+};
1055+MODULE_DEVICE_TABLE(acpi, cros_ec_codec_acpi_id);
1056+
10501057 static struct platform_driver cros_ec_codec_platform_driver = {
10511058 .driver = {
10521059 .name = "cros-ec-codec",
10531060 .of_match_table = of_match_ptr(cros_ec_codec_of_match),
1061+ .acpi_match_table = ACPI_PTR(cros_ec_codec_acpi_id),
10541062 },
10551063 .probe = cros_ec_codec_platform_probe,
10561064 };
sound/soc/codecs/hdac_hda.c+3−1
@@ -588,7 +588,9 @@ static int hdac_hda_dev_remove(struct hdac_device *hdev) · 587 unmodified lines
588588 struct hdac_hda_priv *hda_pvt;
589589
590590 hda_pvt = dev_get_drvdata(&hdev->dev);
591− cancel_delayed_work_sync(&hda_pvt->codec.jackpoll_work);
591+ if (hda_pvt && hda_pvt->codec.registered)
592+ cancel_delayed_work_sync(&hda_pvt->codec.jackpoll_work);
593+
592594 return 0;
593595 }
594596
sound/soc/codecs/msm8916-wcd-analog.c+15−5
@@ -396,9 +396,6 @@ static int pm8916_wcd_analog_enable_micbias_int(struct snd_soc_component · 395 unmodified lines
396396
397397 switch (event) {
398398 case SND_SOC_DAPM_PRE_PMU:
399− snd_soc_component_update_bits(component, CDC_A_MICB_1_INT_RBIAS,
400− MICB_1_INT_TX2_INT_RBIAS_EN_MASK,
401− MICB_1_INT_TX2_INT_RBIAS_EN_ENABLE);
402399 snd_soc_component_update_bits(component, reg, MICB_1_EN_PULL_DOWN_EN_MASK, 0);
403400 snd_soc_component_update_bits(component, CDC_A_MICB_1_EN,
404401 MICB_1_EN_OPA_STG2_TAIL_CURR_MASK,
@@ -448,6 +445,14 @@ static int pm8916_wcd_analog_enable_micbias_int1(struct · 43 unmodified lines
448445 struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
449446 struct pm8916_wcd_analog_priv *wcd = snd_soc_component_get_drvdata(component);
450447
448+ switch (event) {
449+ case SND_SOC_DAPM_PRE_PMU:
450+ snd_soc_component_update_bits(component, CDC_A_MICB_1_INT_RBIAS,
451+ MICB_1_INT_TX1_INT_RBIAS_EN_MASK,
452+ MICB_1_INT_TX1_INT_RBIAS_EN_ENABLE);
453+ break;
454+ }
455+
451456 return pm8916_wcd_analog_enable_micbias_int(component, event, w->reg,
452457 wcd->micbias1_cap_mode);
453458 }
@@ -558,6 +563,11 @@ static int pm8916_wcd_analog_enable_micbias_int2(struct · 104 unmodified lines
558563 struct pm8916_wcd_analog_priv *wcd = snd_soc_component_get_drvdata(component);
559564
560565 switch (event) {
566+ case SND_SOC_DAPM_PRE_PMU:
567+ snd_soc_component_update_bits(component, CDC_A_MICB_1_INT_RBIAS,
568+ MICB_1_INT_TX2_INT_RBIAS_EN_MASK,
569+ MICB_1_INT_TX2_INT_RBIAS_EN_ENABLE);
570+ break;
561571 case SND_SOC_DAPM_POST_PMU:
562572 pm8916_mbhc_configure_bias(wcd, true);
563573 break;
@@ -938,10 +948,10 @@ static const struct snd_soc_dapm_widget pm8916_wcd_analog_dapm_widgets[] = { · 374 unmodified lines
938948
939949 SND_SOC_DAPM_SUPPLY("MIC BIAS External1", CDC_A_MICB_1_EN, 7, 0,
940950 pm8916_wcd_analog_enable_micbias_ext1,
941− SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
951+ SND_SOC_DAPM_POST_PMU),
942952 SND_SOC_DAPM_SUPPLY("MIC BIAS External2", CDC_A_MICB_2_EN, 7, 0,
943953 pm8916_wcd_analog_enable_micbias_ext2,
944− SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD),
954+ SND_SOC_DAPM_POST_PMU),
945955
946956 SND_SOC_DAPM_ADC_E("ADC1", NULL, CDC_A_TX_1_EN, 7, 0,
947957 pm8916_wcd_analog_enable_adc,
sound/soc/codecs/msm8916-wcd-digital.c+6−0
@@ -586,6 +586,12 @@ static int msm8916_wcd_digital_enable_interpolator( · 585 unmodified lines
586586 snd_soc_component_write(component, rx_gain_reg[w->shift],
587587 snd_soc_component_read32(component, rx_gain_reg[w->shift]));
588588 break;
589+ case SND_SOC_DAPM_POST_PMD:
590+ snd_soc_component_update_bits(component, LPASS_CDC_CLK_RX_RESET_CTL,
591+ 1 << w->shift, 1 << w->shift);
592+ snd_soc_component_update_bits(component, LPASS_CDC_CLK_RX_RESET_CTL,
593+ 1 << w->shift, 0x0);
594+ break;
589595 }
590596 return 0;
591597 }
sound/soc/codecs/rt5640.c+7−0
@@ -2432,6 +2432,13 @@ static void rt5640_disable_jack_detect(struct snd_soc_component *component) · 2431 unmodified lines
24322432 {
24332433 struct rt5640_priv *rt5640 = snd_soc_component_get_drvdata(component);
24342434
2435+ /*
2436+ * soc_remove_component() force-disables jack and thus rt5640->jack
2437+ * could be NULL at the time of driver's module unloading.
2438+ */
2439+ if (!rt5640->jack)
2440+ return;
2441+
24352442 disable_irq(rt5640->irq);
24362443 rt5640_cancel_work(rt5640);
24372444
sound/soc/intel/boards/bytcht_es8316.c+2−1
@@ -442,7 +442,8 @@ static const struct dmi_system_id byt_cht_es8316_quirk_table[] = { · 441 unmodified lines
442442 DMI_MATCH(DMI_SYS_VENDOR, "IRBIS"),
443443 DMI_MATCH(DMI_PRODUCT_NAME, "NB41"),
444444 },
445− .driver_data = (void *)(BYT_CHT_ES8316_INTMIC_IN2_MAP
445+ .driver_data = (void *)(BYT_CHT_ES8316_SSP0
446+ | BYT_CHT_ES8316_INTMIC_IN2_MAP
446447 | BYT_CHT_ES8316_JD_INVERTED),
447448 },
448449 { /* Teclast X98 Plus II */
sound/soc/soc-component.c+3−0
@@ -539,6 +539,9 @@ void snd_soc_pcm_component_free(struct snd_soc_pcm_runtime *rtd) · 538 unmodified lines
539539 struct snd_soc_rtdcom_list *rtdcom;
540540 struct snd_soc_component *component;
541541
542+ if (!rtd->pcm)
543+ return;
544+
542545 for_each_rtd_components(rtd, rtdcom, component)
543546 if (component->driver->pcm_destruct)
544547 component->driver->pcm_destruct(component, rtd->pcm);
sound/soc/sof/intel/hda-codec.c+12−7
@@ -24,19 +24,18 @@ · 23 unmodified lines
2424 #define IDISP_VID_INTEL 0x80860000
2525
2626 /* load the legacy HDA codec driver */
27−#ifdef MODULE
28−static void hda_codec_load_module(struct hda_codec *codec)
27+static int hda_codec_load_module(struct hda_codec *codec)
2928 {
29+#ifdef MODULE
3030 char alias[MODULE_NAME_LEN];
3131 const char *module = alias;
3232
3333 snd_hdac_codec_modalias(&codec->core, alias, sizeof(alias));
3434 dev_dbg(&codec->core.dev, "loading codec module: %s\n", module);
3535 request_module(module);
36−}
37−#else
38−static void hda_codec_load_module(struct hda_codec *codec) {}
3936 #endif
37+ return device_attach(hda_codec_dev(codec));
38+}
4039
4140 /* enable controller wake up event for all codecs with jack connectors */
4241 void hda_codec_jack_wake_enable(struct snd_sof_dev *sdev)
@@ -129,10 +128,16 @@ static int hda_codec_probe(struct snd_sof_dev *sdev, int address) · 86 unmodified lines
129128 if ((mach_params && mach_params->common_hdmi_codec_drv) ||
130129 (resp & 0xFFFF0000) != IDISP_VID_INTEL) {
131130 hdev->type = HDA_DEV_LEGACY;
132− hda_codec_load_module(&hda_priv->codec);
131+ ret = hda_codec_load_module(&hda_priv->codec);
132+ /*
133+ * handle ret==0 (no driver bound) as an error, but pass
134+ * other return codes without modification
135+ */
136+ if (ret == 0)
137+ ret = -ENOENT;
133138 }
134139
135− return 0;
140+ return ret;
136141 #else
137142 hdev = devm_kzalloc(sdev->dev, sizeof(*hdev), GFP_KERNEL);
138143 if (!hdev)
sound/soc/sof/intel/hda-loader.c+3−3
@@ -329,13 +329,13 @@ int hda_dsp_cl_boot_firmware(struct snd_sof_dev *sdev) · 328 unmodified lines
329329 if (!ret)
330330 break;
331331
332− dev_err(sdev->dev, "error: Error code=0x%x: FW status=0x%x\n",
332+ dev_dbg(sdev->dev, "iteration %d of Core En/ROM load failed: %d\n",
333+ i, ret);
334+ dev_dbg(sdev->dev, "Error code=0x%x: FW status=0x%x\n",
333335 snd_sof_dsp_read(sdev, HDA_DSP_BAR,
334336 HDA_DSP_SRAM_REG_ROM_ERROR),
335337 snd_sof_dsp_read(sdev, HDA_DSP_BAR,
336338 HDA_DSP_SRAM_REG_ROM_STATUS));
337− dev_err(sdev->dev, "error: iteration %d of Core En/ROM load failed: %d\n",
338− i, ret);
339339 }
340340
341341 if (i == HDA_FW_BOOT_ATTEMPTS) {
sound/soc/sti/uniperif_player.c+4−3
@@ -226,7 +226,6 @@ static void uni_player_set_channel_status(struct uniperif *player, · 225 unmodified lines
226226 * sampling frequency. If no sample rate is already specified, then
227227 * set one.
228228 */
229− mutex_lock(&player->ctrl_lock);
230229 if (runtime) {
231230 switch (runtime->rate) {
232231 case 22050:
@@ -303,7 +302,6 @@ static void uni_player_set_channel_status(struct uniperif *player, · 70 unmodified lines
303302 player->stream_settings.iec958.status[3 + (n * 4)] << 24;
304303 SET_UNIPERIF_CHANNEL_STA_REGN(player, n, status);
305304 }
306− mutex_unlock(&player->ctrl_lock);
307305
308306 /* Update the channel status */
309307 if (player->ver < SND_ST_UNIPERIF_VERSION_UNI_PLR_TOP_1_0)
@@ -365,8 +363,10 @@ static int uni_player_prepare_iec958(struct uniperif *player, · 55 unmodified lines
365363
366364 SET_UNIPERIF_CTRL_ZERO_STUFF_HW(player);
367365
366+ mutex_lock(&player->ctrl_lock);
368367 /* Update the channel status */
369368 uni_player_set_channel_status(player, runtime);
369+ mutex_unlock(&player->ctrl_lock);
370370
371371 /* Clear the user validity user bits */
372372 SET_UNIPERIF_USER_VALIDITY_VALIDITY_LR(player, 0);
@@ -598,7 +598,6 @@ static int uni_player_ctl_iec958_put(struct snd_kcontrol *kcontrol, · 225 unmodified lines
598598 iec958->status[1] = ucontrol->value.iec958.status[1];
599599 iec958->status[2] = ucontrol->value.iec958.status[2];
600600 iec958->status[3] = ucontrol->value.iec958.status[3];
601− mutex_unlock(&player->ctrl_lock);
602601
603602 spin_lock_irqsave(&player->irq_lock, flags);
604603 if (player->substream && player->substream->runtime)
@@ -608,6 +607,8 @@ static int uni_player_ctl_iec958_put(struct snd_kcontrol *kcontrol, · 3 unmodified lines
608607 uni_player_set_channel_status(player, NULL);
609608
610609 spin_unlock_irqrestore(&player->irq_lock, flags);
610+ mutex_unlock(&player->ctrl_lock);
611+
611612 return 0;
612613 }
613614
sound/soc/stm/stm32_adfsdm.c+6−6
@@ -153,13 +153,13 @@ static const struct snd_soc_component_driver stm32_adfsdm_dai_component = { · 152 unmodified lines
153153 .name = "stm32_dfsdm_audio",
154154 };
155155
156−static void memcpy_32to16(void *dest, const void *src, size_t n)
156+static void stm32_memcpy_32to16(void *dest, const void *src, size_t n)
157157 {
158158 unsigned int i = 0;
159159 u16 *d = (u16 *)dest, *s = (u16 *)src;
160160
161161 s++;
162− for (i = n; i > 0; i--) {
162+ for (i = n >> 1; i > 0; i--) {
163163 *d++ = *s++;
164164 s++;
165165 }
@@ -186,8 +186,8 @@ static int stm32_afsdm_pcm_cb(const void *data, size_t size, void *private) · 20 unmodified lines
186186
187187 if ((priv->pos + src_size) > buff_size) {
188188 if (format == SNDRV_PCM_FORMAT_S16_LE)
189− memcpy_32to16(&pcm_buff[priv->pos], src_buff,
190− buff_size - priv->pos);
189+ stm32_memcpy_32to16(&pcm_buff[priv->pos], src_buff,
190+ buff_size - priv->pos);
191191 else
192192 memcpy(&pcm_buff[priv->pos], src_buff,
193193 buff_size - priv->pos);
@@ -196,8 +196,8 @@ static int stm32_afsdm_pcm_cb(const void *data, size_t size, void *private) · 2 unmodified lines
196196 }
197197
198198 if (format == SNDRV_PCM_FORMAT_S16_LE)
199− memcpy_32to16(&pcm_buff[priv->pos],
200− &src_buff[src_size - cur_size], cur_size);
199+ stm32_memcpy_32to16(&pcm_buff[priv->pos],
200+ &src_buff[src_size - cur_size], cur_size);
201201 else
202202 memcpy(&pcm_buff[priv->pos], &src_buff[src_size - cur_size],
203203 cur_size);
sound/soc/stm/stm32_sai_sub.c+140−54
@@ -184,6 +184,56 @@ static bool stm32_sai_sub_writeable_reg(struct device *dev, unsigned int reg) · 183 unmodified lines
184184 }
185185 }
186186
187+static int stm32_sai_sub_reg_up(struct stm32_sai_sub_data *sai,
188+ unsigned int reg, unsigned int mask,
189+ unsigned int val)
190+{
191+ int ret;
192+
193+ ret = clk_enable(sai->pdata->pclk);
194+ if (ret < 0)
195+ return ret;
196+
197+ ret = regmap_update_bits(sai->regmap, reg, mask, val);
198+
199+ clk_disable(sai->pdata->pclk);
200+
201+ return ret;
202+}
203+
204+static int stm32_sai_sub_reg_wr(struct stm32_sai_sub_data *sai,
205+ unsigned int reg, unsigned int mask,
206+ unsigned int val)
207+{
208+ int ret;
209+
210+ ret = clk_enable(sai->pdata->pclk);
211+ if (ret < 0)
212+ return ret;
213+
214+ ret = regmap_write_bits(sai->regmap, reg, mask, val);
215+
216+ clk_disable(sai->pdata->pclk);
217+
218+ return ret;
219+}
220+
221+static int stm32_sai_sub_reg_rd(struct stm32_sai_sub_data *sai,
222+ unsigned int reg, unsigned int *val)
223+{
224+ int ret;
225+
226+ ret = clk_enable(sai->pdata->pclk);
227+ if (ret < 0)
228+ return ret;
229+
230+ ret = regmap_read(sai->regmap, reg, val);
231+
232+ clk_disable(sai->pdata->pclk);
233+
234+ return ret;
235+}
236+
187237 static const struct regmap_config stm32_sai_sub_regmap_config_f4 = {
188238 .reg_bits = 32,
189239 .reg_stride = 4,
@@ -295,7 +345,7 @@ static int stm32_sai_set_clk_div(struct stm32_sai_sub_data *sai, · 105 unmodified lines
295345
296346 mask = SAI_XCR1_MCKDIV_MASK(SAI_XCR1_MCKDIV_WIDTH(version));
297347 cr1 = SAI_XCR1_MCKDIV_SET(div);
298− ret = regmap_update_bits(sai->regmap, STM_SAI_CR1_REGX, mask, cr1);
348+ ret = stm32_sai_sub_reg_up(sai, STM_SAI_CR1_REGX, mask, cr1);
299349 if (ret < 0)
300350 dev_err(&sai->pdev->dev, "Failed to update CR1 register\n");
301351
@@ -372,8 +422,8 @@ static int stm32_sai_mclk_enable(struct clk_hw *hw) · 70 unmodified lines
372422
373423 dev_dbg(&sai->pdev->dev, "Enable master clock\n");
374424
375− return regmap_update_bits(sai->regmap, STM_SAI_CR1_REGX,
376− SAI_XCR1_MCKEN, SAI_XCR1_MCKEN);
425+ return stm32_sai_sub_reg_up(sai, STM_SAI_CR1_REGX,
426+ SAI_XCR1_MCKEN, SAI_XCR1_MCKEN);
377427 }
378428
379429 static void stm32_sai_mclk_disable(struct clk_hw *hw)
@@ -383,7 +433,7 @@ static void stm32_sai_mclk_disable(struct clk_hw *hw) · 3 unmodified lines
383433
384434 dev_dbg(&sai->pdev->dev, "Disable master clock\n");
385435
386− regmap_update_bits(sai->regmap, STM_SAI_CR1_REGX, SAI_XCR1_MCKEN, 0);
436+ stm32_sai_sub_reg_up(sai, STM_SAI_CR1_REGX, SAI_XCR1_MCKEN, 0);
387437 }
388438
389439 static const struct clk_ops mclk_ops = {
@@ -446,15 +496,15 @@ static irqreturn_t stm32_sai_isr(int irq, void *devid) · 56 unmodified lines
446496 unsigned int sr, imr, flags;
447497 snd_pcm_state_t status = SNDRV_PCM_STATE_RUNNING;
448498
449− regmap_read(sai->regmap, STM_SAI_IMR_REGX, &imr);
450− regmap_read(sai->regmap, STM_SAI_SR_REGX, &sr);
499+ stm32_sai_sub_reg_rd(sai, STM_SAI_IMR_REGX, &imr);
500+ stm32_sai_sub_reg_rd(sai, STM_SAI_SR_REGX, &sr);
451501
452502 flags = sr & imr;
453503 if (!flags)
454504 return IRQ_NONE;
455505
456− regmap_write_bits(sai->regmap, STM_SAI_CLRFR_REGX, SAI_XCLRFR_MASK,
457− SAI_XCLRFR_MASK);
506+ stm32_sai_sub_reg_wr(sai, STM_SAI_CLRFR_REGX, SAI_XCLRFR_MASK,
507+ SAI_XCLRFR_MASK);
458508
459509 if (!sai->substream) {
460510 dev_err(&pdev->dev, "Device stopped. Spurious IRQ 0x%x\n", sr);
@@ -503,8 +553,8 @@ static int stm32_sai_set_sysclk(struct snd_soc_dai *cpu_dai, · 42 unmodified lines
503553 int ret;
504554
505555 if (dir == SND_SOC_CLOCK_OUT && sai->sai_mclk) {
506− ret = regmap_update_bits(sai->regmap, STM_SAI_CR1_REGX,
507− SAI_XCR1_NODIV,
556+ ret = stm32_sai_sub_reg_up(sai, STM_SAI_CR1_REGX,
557+ SAI_XCR1_NODIV,
508558 freq ? 0 : SAI_XCR1_NODIV);
509559 if (ret < 0)
510560 return ret;
@@ -583,7 +633,7 @@ static int stm32_sai_set_dai_tdm_slot(struct snd_soc_dai *cpu_dai, u32 tx_mask, · 72 unmodified lines
583633
584634 slotr_mask |= SAI_XSLOTR_SLOTEN_MASK;
585635
586− regmap_update_bits(sai->regmap, STM_SAI_SLOTR_REGX, slotr_mask, slotr);
636+ stm32_sai_sub_reg_up(sai, STM_SAI_SLOTR_REGX, slotr_mask, slotr);
587637
588638 sai->slot_width = slot_width;
589639 sai->slots = slots;
@@ -665,7 +715,7 @@ static int stm32_sai_set_dai_fmt(struct snd_soc_dai *cpu_dai, unsigned int fmt) · 75 unmodified lines
665715 cr1_mask |= SAI_XCR1_CKSTR;
666716 frcr_mask |= SAI_XFRCR_FSPOL;
667717
668− regmap_update_bits(sai->regmap, STM_SAI_FRCR_REGX, frcr_mask, frcr);
718+ stm32_sai_sub_reg_up(sai, STM_SAI_FRCR_REGX, frcr_mask, frcr);
669719
670720 /* DAI clock master masks */
671721 switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
@@ -693,7 +743,7 @@ static int stm32_sai_set_dai_fmt(struct snd_soc_dai *cpu_dai, unsigned int fmt) · 21 unmodified lines
693743 cr1_mask |= SAI_XCR1_SLAVE;
694744
695745 conf_update:
696− ret = regmap_update_bits(sai->regmap, STM_SAI_CR1_REGX, cr1_mask, cr1);
746+ ret = stm32_sai_sub_reg_up(sai, STM_SAI_CR1_REGX, cr1_mask, cr1);
697747 if (ret < 0) {
698748 dev_err(cpu_dai->dev, "Failed to update CR1 register\n");
699749 return ret;
@@ -730,12 +780,12 @@ static int stm32_sai_startup(struct snd_pcm_substream *substream, · 30 unmodified lines
730780 }
731781
732782 /* Enable ITs */
733− regmap_write_bits(sai->regmap, STM_SAI_CLRFR_REGX,
734− SAI_XCLRFR_MASK, SAI_XCLRFR_MASK);
783+ stm32_sai_sub_reg_wr(sai, STM_SAI_CLRFR_REGX,
784+ SAI_XCLRFR_MASK, SAI_XCLRFR_MASK);
735785
736786 imr = SAI_XIMR_OVRUDRIE;
737787 if (STM_SAI_IS_CAPTURE(sai)) {
738− regmap_read(sai->regmap, STM_SAI_CR2_REGX, &cr2);
788+ stm32_sai_sub_reg_rd(sai, STM_SAI_CR2_REGX, &cr2);
739789 if (cr2 & SAI_XCR2_MUTECNT_MASK)
740790 imr |= SAI_XIMR_MUTEDETIE;
741791 }
@@ -745,8 +795,8 @@ static int stm32_sai_startup(struct snd_pcm_substream *substream, · 3 unmodified lines
745795 else
746796 imr |= SAI_XIMR_AFSDETIE | SAI_XIMR_LFSDETIE;
747797
748− regmap_update_bits(sai->regmap, STM_SAI_IMR_REGX,
749− SAI_XIMR_MASK, imr);
798+ stm32_sai_sub_reg_up(sai, STM_SAI_IMR_REGX,
799+ SAI_XIMR_MASK, imr);
750800
751801 return 0;
752802 }
@@ -763,10 +813,10 @@ static int stm32_sai_set_config(struct snd_soc_dai *cpu_dai, · 10 unmodified lines
763813 * SAI fifo threshold is set to half fifo, to keep enough space
764814 * for DMA incoming bursts.
765815 */
766− regmap_write_bits(sai->regmap, STM_SAI_CR2_REGX,
767− SAI_XCR2_FFLUSH | SAI_XCR2_FTH_MASK,
768− SAI_XCR2_FFLUSH |
769− SAI_XCR2_FTH_SET(STM_SAI_FIFO_TH_HALF));
816+ stm32_sai_sub_reg_wr(sai, STM_SAI_CR2_REGX,
817+ SAI_XCR2_FFLUSH | SAI_XCR2_FTH_MASK,
818+ SAI_XCR2_FFLUSH |
819+ SAI_XCR2_FTH_SET(STM_SAI_FIFO_TH_HALF));
770820
771821 /* DS bits in CR1 not set for SPDIF (size forced to 24 bits).*/
772822 if (STM_SAI_PROTOCOL_IS_SPDIF(sai)) {
@@ -795,7 +845,7 @@ static int stm32_sai_set_config(struct snd_soc_dai *cpu_dai, · 22 unmodified lines
795845 if ((sai->slots == 2) && (params_channels(params) == 1))
796846 cr1 |= SAI_XCR1_MONO;
797847
798− ret = regmap_update_bits(sai->regmap, STM_SAI_CR1_REGX, cr1_mask, cr1);
848+ ret = stm32_sai_sub_reg_up(sai, STM_SAI_CR1_REGX, cr1_mask, cr1);
799849 if (ret < 0) {
800850 dev_err(cpu_dai->dev, "Failed to update CR1 register\n");
801851 return ret;
@@ -809,7 +859,7 @@ static int stm32_sai_set_slots(struct snd_soc_dai *cpu_dai) · 7 unmodified lines
809859 struct stm32_sai_sub_data *sai = snd_soc_dai_get_drvdata(cpu_dai);
810860 int slotr, slot_sz;
811861
812− regmap_read(sai->regmap, STM_SAI_SLOTR_REGX, &slotr);
862+ stm32_sai_sub_reg_rd(sai, STM_SAI_SLOTR_REGX, &slotr);
813863
814864 /*
815865 * If SLOTSZ is set to auto in SLOTR, align slot width on data size
@@ -831,16 +881,16 @@ static int stm32_sai_set_slots(struct snd_soc_dai *cpu_dai) · 15 unmodified lines
831881 sai->slots = 2;
832882
833883 /* The number of slots in the audio frame is equal to NBSLOT[3:0] + 1*/
834− regmap_update_bits(sai->regmap, STM_SAI_SLOTR_REGX,
835− SAI_XSLOTR_NBSLOT_MASK,
836− SAI_XSLOTR_NBSLOT_SET((sai->slots - 1)));
884+ stm32_sai_sub_reg_up(sai, STM_SAI_SLOTR_REGX,
885+ SAI_XSLOTR_NBSLOT_MASK,
886+ SAI_XSLOTR_NBSLOT_SET((sai->slots - 1)));
837887
838888 /* Set default slots mask if not already set from DT */
839889 if (!(slotr & SAI_XSLOTR_SLOTEN_MASK)) {
840890 sai->slot_mask = (1 << sai->slots) - 1;
841− regmap_update_bits(sai->regmap,
842− STM_SAI_SLOTR_REGX, SAI_XSLOTR_SLOTEN_MASK,
843− SAI_XSLOTR_SLOTEN_SET(sai->slot_mask));
891+ stm32_sai_sub_reg_up(sai,
892+ STM_SAI_SLOTR_REGX, SAI_XSLOTR_SLOTEN_MASK,
893+ SAI_XSLOTR_SLOTEN_SET(sai->slot_mask));
844894 }
845895
846896 dev_dbg(cpu_dai->dev, "Slots %d, slot width %d\n",
@@ -870,14 +920,14 @@ static void stm32_sai_set_frame(struct snd_soc_dai *cpu_dai) · 23 unmodified lines
870920 dev_dbg(cpu_dai->dev, "Frame length %d, frame active %d\n",
871921 sai->fs_length, fs_active);
872922
873− regmap_update_bits(sai->regmap, STM_SAI_FRCR_REGX, frcr_mask, frcr);
923+ stm32_sai_sub_reg_up(sai, STM_SAI_FRCR_REGX, frcr_mask, frcr);
874924
875925 if ((sai->fmt & SND_SOC_DAIFMT_FORMAT_MASK) == SND_SOC_DAIFMT_LSB) {
876926 offset = sai->slot_width - sai->data_size;
877927
878− regmap_update_bits(sai->regmap, STM_SAI_SLOTR_REGX,
879− SAI_XSLOTR_FBOFF_MASK,
880− SAI_XSLOTR_FBOFF_SET(offset));
928+ stm32_sai_sub_reg_up(sai, STM_SAI_SLOTR_REGX,
929+ SAI_XSLOTR_FBOFF_MASK,
930+ SAI_XSLOTR_FBOFF_SET(offset));
881931 }
882932 }
883933
@@ -994,9 +1044,9 @@ static int stm32_sai_configure_clock(struct snd_soc_dai *cpu_dai, · 110 unmodified lines
9941044 return -EINVAL;
9951045 }
9961046
997− regmap_update_bits(sai->regmap,
998− STM_SAI_CR1_REGX,
999− SAI_XCR1_OSR, cr1);
1047+ stm32_sai_sub_reg_up(sai,
1048+ STM_SAI_CR1_REGX,
1049+ SAI_XCR1_OSR, cr1);
10001050
10011051 div = stm32_sai_get_clk_div(sai, sai_clk_rate,
10021052 sai->mclk_rate);
@@ -1058,12 +1108,12 @@ static int stm32_sai_trigger(struct snd_pcm_substream *substream, int cmd, · 55 unmodified lines
10581108 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
10591109 dev_dbg(cpu_dai->dev, "Enable DMA and SAI\n");
10601110
1061− regmap_update_bits(sai->regmap, STM_SAI_CR1_REGX,
1062− SAI_XCR1_DMAEN, SAI_XCR1_DMAEN);
1111+ stm32_sai_sub_reg_up(sai, STM_SAI_CR1_REGX,
1112+ SAI_XCR1_DMAEN, SAI_XCR1_DMAEN);
10631113
10641114 /* Enable SAI */
1065− ret = regmap_update_bits(sai->regmap, STM_SAI_CR1_REGX,
1066− SAI_XCR1_SAIEN, SAI_XCR1_SAIEN);
1115+ ret = stm32_sai_sub_reg_up(sai, STM_SAI_CR1_REGX,
1116+ SAI_XCR1_SAIEN, SAI_XCR1_SAIEN);
10671117 if (ret < 0)
10681118 dev_err(cpu_dai->dev, "Failed to update CR1 register\n");
10691119 break;
@@ -1072,16 +1122,16 @@ static int stm32_sai_trigger(struct snd_pcm_substream *substream, int cmd, · 2 unmodified lines
10721122 case SNDRV_PCM_TRIGGER_STOP:
10731123 dev_dbg(cpu_dai->dev, "Disable DMA and SAI\n");
10741124
1075− regmap_update_bits(sai->regmap, STM_SAI_IMR_REGX,
1076− SAI_XIMR_MASK, 0);
1125+ stm32_sai_sub_reg_up(sai, STM_SAI_IMR_REGX,
1126+ SAI_XIMR_MASK, 0);
10771127
1078− regmap_update_bits(sai->regmap, STM_SAI_CR1_REGX,
1079− SAI_XCR1_SAIEN,
1080− (unsigned int)~SAI_XCR1_SAIEN);
1128+ stm32_sai_sub_reg_up(sai, STM_SAI_CR1_REGX,
1129+ SAI_XCR1_SAIEN,
1130+ (unsigned int)~SAI_XCR1_SAIEN);
10811131
1082− ret = regmap_update_bits(sai->regmap, STM_SAI_CR1_REGX,
1083− SAI_XCR1_DMAEN,
1084− (unsigned int)~SAI_XCR1_DMAEN);
1132+ ret = stm32_sai_sub_reg_up(sai, STM_SAI_CR1_REGX,
1133+ SAI_XCR1_DMAEN,
1134+ (unsigned int)~SAI_XCR1_DMAEN);
10851135 if (ret < 0)
10861136 dev_err(cpu_dai->dev, "Failed to update CR1 register\n");
10871137
@@ -1101,7 +1151,7 @@ static void stm32_sai_shutdown(struct snd_pcm_substream *substream, · 13 unmodified lines
11011151 struct stm32_sai_sub_data *sai = snd_soc_dai_get_drvdata(cpu_dai);
11021152 unsigned long flags;
11031153
1104− regmap_update_bits(sai->regmap, STM_SAI_IMR_REGX, SAI_XIMR_MASK, 0);
1154+ stm32_sai_sub_reg_up(sai, STM_SAI_IMR_REGX, SAI_XIMR_MASK, 0);
11051155
11061156 clk_disable_unprepare(sai->sai_ck);
11071157
@@ -1169,7 +1219,7 @@ static int stm32_sai_dai_probe(struct snd_soc_dai *cpu_dai) · 61 unmodified lines
11691219 cr1_mask |= SAI_XCR1_SYNCEN_MASK;
11701220 cr1 |= SAI_XCR1_SYNCEN_SET(sai->sync);
11711221
1172− return regmap_update_bits(sai->regmap, STM_SAI_CR1_REGX, cr1_mask, cr1);
1222+ return stm32_sai_sub_reg_up(sai, STM_SAI_CR1_REGX, cr1_mask, cr1);
11731223 }
11741224
11751225 static const struct snd_soc_dai_ops stm32_sai_pcm_dai_ops = {
@@ -1322,8 +1372,13 @@ static int stm32_sai_sub_parse_of(struct platform_device *pdev, · 146 unmodified lines
13221372 if (STM_SAI_HAS_PDM(sai) && STM_SAI_IS_SUB_A(sai))
13231373 sai->regmap_config = &stm32_sai_sub_regmap_config_h7;
13241374
1325− sai->regmap = devm_regmap_init_mmio_clk(&pdev->dev, "sai_ck",
1326− base, sai->regmap_config);
1375+ /*
1376+ * Do not manage peripheral clock through regmap framework as this
1377+ * can lead to circular locking issue with sai master clock provider.
1378+ * Manage peripheral clock directly in driver instead.
1379+ */
1380+ sai->regmap = devm_regmap_init_mmio(&pdev->dev, base,
1381+ sai->regmap_config);
13271382 if (IS_ERR(sai->regmap)) {
13281383 dev_err(&pdev->dev, "Failed to initialize MMIO\n");
13291384 return PTR_ERR(sai->regmap);
@@ -1420,6 +1475,10 @@ static int stm32_sai_sub_parse_of(struct platform_device *pdev, · 90 unmodified lines
14201475 return PTR_ERR(sai->sai_ck);
14211476 }
14221477
1478+ ret = clk_prepare(sai->pdata->pclk);
1479+ if (ret < 0)
1480+ return ret;
1481+
14231482 if (STM_SAI_IS_F4(sai->pdata))
14241483 return 0;
14251484
@@ -1501,22 +1560,48 @@ static int stm32_sai_sub_probe(struct platform_device *pdev) · 75 unmodified lines
15011560 return 0;
15021561 }
15031562
1563+static int stm32_sai_sub_remove(struct platform_device *pdev)
1564+{
1565+ struct stm32_sai_sub_data *sai = dev_get_drvdata(&pdev->dev);
1566+
1567+ clk_unprepare(sai->pdata->pclk);
1568+
1569+ return 0;
1570+}
1571+
15041572 #ifdef CONFIG_PM_SLEEP
15051573 static int stm32_sai_sub_suspend(struct device *dev)
15061574 {
15071575 struct stm32_sai_sub_data *sai = dev_get_drvdata(dev);
1576+ int ret;
1577+
1578+ ret = clk_enable(sai->pdata->pclk);
1579+ if (ret < 0)
1580+ return ret;
15081581
15091582 regcache_cache_only(sai->regmap, true);
15101583 regcache_mark_dirty(sai->regmap);
1584+
1585+ clk_disable(sai->pdata->pclk);
1586+
15111587 return 0;
15121588 }
15131589
15141590 static int stm32_sai_sub_resume(struct device *dev)
15151591 {
15161592 struct stm32_sai_sub_data *sai = dev_get_drvdata(dev);
1593+ int ret;
1594+
1595+ ret = clk_enable(sai->pdata->pclk);
1596+ if (ret < 0)
1597+ return ret;
15171598
15181599 regcache_cache_only(sai->regmap, false);
1519− return regcache_sync(sai->regmap);
1600+ ret = regcache_sync(sai->regmap);
1601+
1602+ clk_disable(sai->pdata->pclk);
1603+
1604+ return ret;
15201605 }
15211606 #endif /* CONFIG_PM_SLEEP */
15221607
@@ -1531,6 +1616,7 @@ static struct platform_driver stm32_sai_sub_driver = { · 8 unmodified lines
15311616 .pm = &stm32_sai_sub_pm_ops,
15321617 },
15331618 .probe = stm32_sai_sub_probe,
1619+ .remove = stm32_sai_sub_remove,
15341620 };
15351621
15361622 module_platform_driver(stm32_sai_sub_driver);
sound/usb/pcm.c+1−1
@@ -370,7 +370,7 @@ static int set_sync_ep_implicit_fb_quirk(struct snd_usb_substream *subs, · 369 unmodified lines
370370 add_sync_ep_from_ifnum:
371371 iface = usb_ifnum_to_if(dev, ifnum);
372372
373− if (!iface || iface->num_altsetting == 0)
373+ if (!iface || iface->num_altsetting < 2)
374374 return -EINVAL;
375375
376376 alts = &iface->altsetting[1];
tools/bpf/bpftool/btf_dumper.c+1−1
@@ -26,7 +26,7 @@ static void btf_dumper_ptr(const void *data, json_writer_t *jw, · 25 unmodified lines
2626 bool is_plain_text)
2727 {
2828 if (is_plain_text)
29− jsonw_printf(jw, "%p", data);
29+ jsonw_printf(jw, "%p", *(void **)data);
3030 else
3131 jsonw_printf(jw, "%lu", *(unsigned long *)data);
3232 }
tools/lib/traceevent/parse-filter.c+3−1
@@ -1228,8 +1228,10 @@ filter_event(struct tep_event_filter *filter, struct tep_event *event, · 1227 unmodified lines
12281228 }
12291229
12301230 filter_type = add_filter_type(filter, event->id);
1231− if (filter_type == NULL)
1231+ if (filter_type == NULL) {
1232+ free_arg(arg);
12321233 return TEP_ERRNO__MEM_ALLOC_FAILED;
1234+ }
12331235
12341236 if (filter_type->filter)
12351237 free_arg(filter_type->filter);
tools/perf/builtin-report.c+4−1
@@ -1076,6 +1076,7 @@ int cmd_report(int argc, const char **argv) · 1075 unmodified lines
10761076 struct stat st;
10771077 bool has_br_stack = false;
10781078 int branch_mode = -1;
1079+ int last_key = 0;
10791080 bool branch_call_mode = false;
10801081 #define CALLCHAIN_DEFAULT_OPT "graph,0.5,caller,function,percent"
10811082 static const char report_callchain_help[] = "Display call graph (stack chain/backtrace):\n\n"
@@ -1450,7 +1451,8 @@ repeat: · 368 unmodified lines
14501451 sort_order = sort_tmp;
14511452 }
14521453
1453− if (setup_sorting(session->evlist) < 0) {
1454+ if ((last_key != K_SWITCH_INPUT_DATA) &&
1455+ (setup_sorting(session->evlist) < 0)) {
14541456 if (sort_order)
14551457 parse_options_usage(report_usage, options, "s", 1);
14561458 if (field_order)
@@ -1530,6 +1532,7 @@ repeat: · 73 unmodified lines
15301532 ret = __cmd_report(&report);
15311533 if (ret == K_SWITCH_INPUT_DATA) {
15321534 perf_session__delete(session);
1535+ last_key = K_SWITCH_INPUT_DATA;
15331536 goto repeat;
15341537 } else
15351538 ret = 0;
tools/perf/util/hist.h+2−2
@@ -339,10 +339,10 @@ static inline void perf_hpp__prepend_sort_field(struct perf_hpp_fmt *format) · 338 unmodified lines
339339 list_for_each_entry_safe(format, tmp, &(_list)->sorts, sort_list)
340340
341341 #define hists__for_each_format(hists, format) \
342− perf_hpp_list__for_each_format((hists)->hpp_list, fmt)
342+ perf_hpp_list__for_each_format((hists)->hpp_list, format)
343343
344344 #define hists__for_each_sort_list(hists, format) \
345− perf_hpp_list__for_each_sort_list((hists)->hpp_list, fmt)
345+ perf_hpp_list__for_each_sort_list((hists)->hpp_list, format)
346346
347347 extern struct perf_hpp_fmt perf_hpp__format[];
348348
tools/perf/util/symbol-elf.c+3−0
@@ -920,6 +920,9 @@ static int dso__process_kernel_symbol(struct dso *dso, struct map *map, · 919 unmodified lines
920920 if (curr_map == NULL)
921921 return -1;
922922
923+ if (curr_dso->kernel)
924+ map__kmap(curr_map)->kmaps = kmaps;
925+
923926 if (adjust_kernel_syms) {
924927 curr_map->start = shdr->sh_addr + ref_reloc(kmap);
925928 curr_map->end = curr_map->start + shdr->sh_size;
tools/testing/selftests/drivers/net/mlxsw/qos_mc_aware.sh+6−2
@@ -232,7 +232,7 @@ test_mc_aware() · 231 unmodified lines
232232 stop_traffic
233233 local ucth1=${uc_rate[1]}
234234
235− start_traffic $h1 own bc bc
235+ start_traffic $h1 192.0.2.65 bc bc
236236
237237 local d0=$(date +%s)
238238 local t0=$(ethtool_stats_get $h3 rx_octets_prio_0)
@@ -254,7 +254,11 @@ test_mc_aware() · 15 unmodified lines
254254 ret = 100 * ($ucth1 - $ucth2) / $ucth1
255255 if (ret > 0) { ret } else { 0 }
256256 ")
257− check_err $(bc <<< "$deg > 25")
257+
258+ # Minimum shaper of 200Mbps on MC TCs should cause about 20% of
259+ # degradation on 1Gbps link.
260+ check_err $(bc <<< "$deg < 15") "Minimum shaper not in effect"
261+ check_err $(bc <<< "$deg > 25") "MC traffic degrades UC performance too much"
258262
259263 local interval=$((d1 - d0))
260264 local mc_ir=$(rate $u0 $u1 $interval)